@arcgis/core 4.29.0-next.20231220 → 4.29.0-next.20231221

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 (99) hide show
  1. package/analysis/Analysis.js +1 -1
  2. package/applications/WebEditor/sketchUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/00b340b4495bfabd4ca2.js +1 -0
  5. package/assets/esri/core/workers/chunks/{4301736368af52b94ee2.js → 02d6e2f0b1003534a077.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0e315452f11b112523f0.js +1 -0
  7. package/assets/esri/core/workers/chunks/{37faadfa58a2f72d11bd.js → 1254a544d369d99ccf59.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{0be38fd63e870341c660.js → 220fcc25578b2ef316da.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{c9f8354d51f701cd69e5.js → 321dcff84c31c739ed93.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{f350378a0d93dda39425.js → 7205c1680afee0cc0aac.js} +1 -1
  11. package/assets/esri/core/workers/chunks/831283ac6653d7af90b6.js +1 -0
  12. package/assets/esri/core/workers/chunks/8485562b452686c6c3f2.js +1 -0
  13. package/assets/esri/core/workers/chunks/{ff582d31932d72912c33.js → b7c2244c27790ccaca92.js} +1 -1
  14. package/assets/esri/core/workers/chunks/dbded06d7a944dd97b01.js +1 -0
  15. package/assets/esri/core/workers/chunks/dcfc48bf5c27774fa05c.js +1 -0
  16. package/assets/esri/core/workers/chunks/e4049e498b3eaa9c8596.js +1 -0
  17. package/assets/esri/themes/base/widgets/_Directions.scss +4 -0
  18. package/assets/esri/themes/base/widgets/_Grid.scss +8 -2
  19. package/assets/esri/themes/dark/main.css +1 -1
  20. package/assets/esri/themes/light/main.css +1 -1
  21. package/assets/esri/themes/light/view.css +1 -1
  22. package/chunks/vec32.js +1 -1
  23. package/core/PooledArray.js +1 -1
  24. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  25. package/geometry/ellipsoidUtils.js +1 -1
  26. package/interfaces.d.ts +298 -30
  27. package/layers/GeoJSONLayer.js +1 -1
  28. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  29. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  30. package/layers/support/rasterFunctions/bandIndexUtils.js +1 -1
  31. package/package.json +1 -1
  32. package/support/revision.js +1 -1
  33. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  34. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  35. package/views/2d/layers/support/DebugOverlay.js +1 -1
  36. package/views/3d/analysis/AnalysisView3D.js +1 -1
  37. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  38. package/views/3d/layers/I3SMeshView3D.js +1 -1
  39. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  40. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  41. package/views/3d/layers/IntegratedMesh3DTilesViewPerformanceInfo.js +5 -0
  42. package/views/3d/layers/TiledLayerView3D.js +1 -1
  43. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  44. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  45. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  46. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  47. package/views/3d/layers/i3s/PagedNodeIndex.js +1 -1
  48. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  49. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  50. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  51. package/views/3d/support/RenderCoordsHelper.js +1 -1
  52. package/views/3d/support/orientedBoundingBox.js +1 -1
  53. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  54. package/views/3d/terrain/OverlayManager.js +1 -1
  55. package/views/3d/terrain/OverlayRenderer.js +1 -1
  56. package/views/3d/terrain/PatchRenderData.js +1 -1
  57. package/views/3d/terrain/SphericalPatch.js +1 -1
  58. package/views/3d/terrain/TerrainSurface.js +1 -1
  59. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  60. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  61. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  62. package/views/3d/webgl-engine/effects/RenderNodeCollection.js +1 -1
  63. package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +1 -1
  64. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  65. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  66. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  67. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  68. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  69. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  70. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  71. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  72. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  73. package/views/draw/DrawGraphicTool.js +1 -1
  74. package/views/interactive/AnalysisToolBase.js +1 -1
  75. package/views/interactive/tooltip/Tooltip.js +1 -1
  76. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  77. package/views/layers/DimensionLayerView.js +1 -1
  78. package/views/webgl/Program.js +1 -1
  79. package/widgets/BasemapLayerList.js +1 -1
  80. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +4 -0
  81. package/widgets/DirectionalPad.d.ts +4 -0
  82. package/widgets/Directions/css.js +1 -1
  83. package/widgets/Directions.js +1 -1
  84. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  85. package/widgets/FeatureTable/FieldColumn.js +1 -1
  86. package/widgets/FeatureTable/Grid/Column.js +1 -1
  87. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  88. package/widgets/Features/FeaturesViewModel.js +1 -1
  89. package/widgets/LayerList/support/layerListUtils.js +1 -1
  90. package/widgets/LayerList.js +1 -1
  91. package/widgets/TableList.js +1 -1
  92. package/widgets/support/AnchorElementViewModel.js +1 -1
  93. package/assets/esri/core/workers/chunks/4051e70c2d25c5bea933.js +0 -1
  94. package/assets/esri/core/workers/chunks/5730e14c706a1e4e57d3.js +0 -1
  95. package/assets/esri/core/workers/chunks/5db76bdc4916d11cbcfe.js +0 -1
  96. package/assets/esri/core/workers/chunks/642e652bf21a7fa463c9.js +0 -1
  97. package/assets/esri/core/workers/chunks/67e4bec7950f09ffe4a7.js +0 -1
  98. package/assets/esri/core/workers/chunks/8407cf549c0c59a206f1.js +0 -1
  99. package/assets/esri/core/workers/chunks/f11896da4989806a66ce.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9717],{22303:(t,e,n)=>{n.d(e,{Z:()=>h});var r,i,s=n(35270),o=n(22021),l=n(75215);function a(t){return(0,o.uZ)((0,l.vU)(t),0,255)}function u(t,e,n){return t=Number(t),isNaN(t)?n:t<e?e:t>n?n:t}function p(t,e){const n=t.toString(16).padStart(2,"0");return e?n.substring(0,1):n}class c{static blendColors(t,e,n,r=new c){return r.r=Math.round(t.r+(e.r-t.r)*n),r.g=Math.round(t.g+(e.g-t.g)*n),r.b=Math.round(t.b+(e.b-t.b)*n),r.a=t.a+(e.a-t.a)*n,r._sanitize()}static fromRgb(t,e){const n=t.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(n){const t=n[2].split(/\s*,\s*/),r=n[1];if("rgb"===r&&3===t.length||"rgba"===r&&4===t.length){const n=t[0];if("%"===n.charAt(n.length-1)){const n=t.map((t=>2.56*parseFloat(t)));return 4===t.length&&(n[3]=parseFloat(t[3])),c.fromArray(n,e)}return c.fromArray(t.map((t=>parseFloat(t))),e)}if("hsl"===r&&3===t.length||"hsla"===r&&4===t.length)return c.fromArray((0,s.B7)(parseFloat(t[0]),parseFloat(t[1])/100,parseFloat(t[2])/100,parseFloat(t[3])),e)}return null}static fromHex(t,e=new c){if("#"!==t[0]||isNaN(Number(`0x${t.substring(1)}`)))return null;switch(t.length){case 4:case 5:{const n=parseInt(t.substring(1,2),16),r=parseInt(t.substring(2,3),16),i=parseInt(t.substring(3,4),16),s=5===t.length?15:parseInt(t.substring(4),16);return c.fromArray([n+16*n,r+16*r,i+16*i,(s+16*s)/255],e)}case 7:case 9:{const n=parseInt(t.substring(1,3),16),r=parseInt(t.substring(3,5),16),i=parseInt(t.substring(5,7),16),s=7===t.length?255:parseInt(t.substring(7),16);return c.fromArray([n,r,i,s/255],e)}default:return null}}static fromArray(t,e=new c){return e._set(Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])),isNaN(e.a)&&(e.a=1),e._sanitize()}static fromString(t,e){const n=(0,s.St)(t)?(0,s.h$)(t):null;return n&&c.fromArray(n,e)||c.fromRgb(t,e)||c.fromHex(t,e)}static fromJSON(t){return null!=t?new c([t[0],t[1],t[2],(t[3]??255)/255]):void 0}static toUnitRGB(t){return null!=t?[t.r/255,t.g/255,t.b/255]:null}static toUnitRGBA(t){return null!=t?[t.r/255,t.g/255,t.b/255,null!=t.a?t.a:1]:null}constructor(t){this.r=255,this.g=255,this.b=255,this.a=1,t&&this.setColor(t)}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(t){return"string"==typeof t?c.fromString(t,this):Array.isArray(t)?c.fromArray(t,this):(this._set(t.r??0,t.g??0,t.b??0,t.a??1),t instanceof c||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(t){const e=t?.capitalize??!1,n=t?.digits??6,r=3===n||4===n,i=4===n||8===n,s=`#${p(this.r,r)}${p(this.g,r)}${p(this.b,r)}${i?p(Math.round(255*this.a),r):""}`;return e?s.toUpperCase():s}toCss(t=!1){const e=this.r+", "+this.g+", "+this.b;return t?`rgba(${e}, ${this.a})`:`rgb(${e})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(t=c.AlphaMode.ALWAYS){const e=a(this.r),n=a(this.g),r=a(this.b);return t===c.AlphaMode.ALWAYS||1!==this.a?[e,n,r,a(255*this.a)]:[e,n,r]}clone(){return new c(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(t){return null!=t&&t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}_sanitize(){return this.r=Math.round(u(this.r,0,255)),this.g=Math.round(u(this.g,0,255)),this.b=Math.round(u(this.b,0,255)),this.a=u(this.a,0,1),this}_set(t,e,n,r){this.r=t,this.g=e,this.b=n,this.a=r}}c.prototype.declaredClass="esri.Color",(i=(r=c||(c={})).AlphaMode||(r.AlphaMode={}))[i.ALWAYS=0]="ALWAYS",i[i.UNLESS_OPAQUE=1]="UNLESS_OPAQUE";const h=c},92835:(t,e,n)=>{n.d(e,{Z:()=>m});var r,i=n(43697),s=n(96674),o=n(35463),l=n(5600),a=(n(80442),n(92604),n(77734),n(71715)),u=n(52011),p=n(30556),c=n(25031);let h=r=class extends s.wq{static get allTime(){return d}static get empty(){return y}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,r=t.start?.getTime()??t.start,i=t.end?.getTime()??t.end;return e===r&&n===i}expandTo(t,e=c.By){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=(0,o.JE)(n,t,e));let i=this.end;if(i){const n=(0,o.JE)(i,t,e);i=i.getTime()===n.getTime()?n:(0,o.Nm)(n,1,t,e)}return new r({start:n,end:i})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return r.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,i=t.start?.getTime()??-1/0,s=t.end?.getTime()??1/0;let o,l;if(i>=e&&i<=n?o=i:e>=i&&e<=s&&(o=e),n>=i&&n<=s?l=n:s>=e&&s<=n&&(l=s),null!=o&&null!=l&&!isNaN(o)&&!isNaN(l)){const t=new r;return t.start=o===-1/0?null:new Date(o),t.end=l===1/0?null:new Date(l),t}return r.empty}offset(t,e,n=c.By){if(this.isEmpty||this.isAllTime)return this.clone();const i=new r,{start:s,end:l}=this;return null!=s&&(i.start=(0,o.Nm)(s,t,e,n)),null!=l&&(i.end=(0,o.Nm)(l,t,e,n)),i}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return d.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,n=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new r({start:e,end:n})}};(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,i._)([(0,a.r)("end")],h.prototype,"readEnd",null),(0,i._)([(0,p.c)("end")],h.prototype,"writeEnd",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,i._)([(0,a.r)("start")],h.prototype,"readStart",null),(0,i._)([(0,p.c)("start")],h.prototype,"writeStart",null),h=r=(0,i._)([(0,u.j)("esri.TimeExtent")],h);const d=new h,y=new h({start:void 0,end:void 0}),m=h},4757:(t,e,n)=>{n.d(e,{Z:()=>d});var r=n(43697),i=n(92036),s=n(67676),o=n(2368),l=n(10699),a=n(96674),u=n(5600),p=(n(80442),n(92604),n(52011));let c=0,h=class extends((0,a.eC)((0,o.J)((0,l.IG)(i.Z)))){constructor(t){super(t),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(t){const e=this.parent;if(null!=e)switch(e.type){case"line-of-sight":case"dimension":e.releaseAnalysis(this);break;case"2d":case"3d":e.analyses.includes(this)&&e.analyses.remove(this)}this._set("parent",t)}get isEditable(){return this.requiredPropertiesForEditing.every(s.pC)}};(0,r._)([(0,u.Cb)({type:String,constructOnly:!0,clonable:!1})],h.prototype,"id",void 0),(0,r._)([(0,u.Cb)({type:String})],h.prototype,"title",void 0),(0,r._)([(0,u.Cb)({clonable:!1,value:null})],h.prototype,"parent",null),(0,r._)([(0,u.Cb)({readOnly:!0})],h.prototype,"isEditable",null),h=(0,r._)([(0,p.j)("esri.analysis.Analysis")],h);const d=h},2368:(t,e,n)=>{n.d(e,{J:()=>p,j:()=>c});var r=n(43697),i=n(92036),s=(n(80442),n(22974)),o=(n(92604),n(70586)),l=n(31263),a=n(1153),u=n(52011);const p=t=>{let e=class extends t{clone(){const t=(0,a.vw)(this);(0,o.O3)(t,"unable to clone instance of non-accessor class");const e=t.metadatas,n=t.store,r={},i=new Map;for(const t in e){const o=e[t],a=n?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||a!==l.s3.USER&&a!==l.s3.DEFAULTS&&a!==l.s3.WEB_MAP&&a!==l.s3.WEB_SCENE)continue;const p=this[t];let c=null;c="function"==typeof u?u(p):"reference"===u?p:(0,s.Vo)(p),null!=p&&null==c||(a===l.s3.DEFAULTS?i.set(t,c):r[t]=c)}const u=new(0,Object.getPrototypeOf(this).constructor)(r);if(i.size){const t=(0,a.vw)(u)?.store;if(t)for(const[e,n]of i)t.set(e,n,l.s3.DEFAULTS)}return u}};return e=(0,r._)([(0,u.j)("esri.core.Clonable")],e),e};let c=class extends(p(i.Z)){};c=(0,r._)([(0,u.j)("esri.core.Clonable")],c)},68251:(t,e,n)=>{n.d(e,{BV:()=>o});var r=n(22021);class i{constructor(t,e){this.min=t,this.max=e,this.range=e-t}ndiff(t,e=0){return Math.ceil((t-e)/this.range)*this.range+e}_normalize(t,e,n,r=0,i=!1){return(n-=r)<t?n+=this.ndiff(t-n):n>e&&(n-=this.ndiff(n-e)),i&&n===e&&(n=t),n+r}normalize(t,e=0,n=!1){return this._normalize(this.min,this.max,t,e,n)}clamp(t,e=0){return(0,r.uZ)(t-e,this.min,this.max)+e}monotonic(t,e,n){return t<e?e:e+this.ndiff(t-e,n)}minimalMonotonic(t,e,n){return this._normalize(t,t+this.range,e,n)}center(t,e,n){return e=this.monotonic(t,e,n),this.normalize((t+e)/2,n)}diff(t,e,n){return this.monotonic(t,e,n)-t}shortestSignedDiff(t,e){t=this.normalize(t);const n=(e=this.normalize(e))-t,r=e<t?this.minimalMonotonic(t,e)-t:e-this.minimalMonotonic(e,t);return Math.abs(n)<Math.abs(r)?n:r}contains(t,e,n){return e=this.minimalMonotonic(t,e),(n=this.minimalMonotonic(t,n))>t&&n<e}}function s(t){for(const e in t){const n=t[e];n instanceof Function&&(t[e]=n.bind(t))}return t}s(new i(0,2*Math.PI)),s(new i(-Math.PI,Math.PI));const o=s(new i(0,360))},10699:(t,e,n)=>{n.d(e,{IG:()=>o,iv:()=>l});var r=n(43697),i=n(52011);let s=0;const o=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+s++})}};return e=(0,r._)([(0,i.j)("esri.core.Identifiable")],e),e},l=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:s++})}};return e=(0,r._)([(0,i.j)("esri.core.NumericIdentifiable")],e),e};let a=class extends(o(class{})){};a=(0,r._)([(0,i.j)("esri.core.Identifiable")],a)},17445:(t,e,n)=>{n.d(e,{N1:()=>h,YP:()=>a,Z_:()=>m,gx:()=>u,nn:()=>b,on:()=>c,tX:()=>g}),n(66643),n(46791);var r=n(91460),i=n(50758),s=n(70586),o=n(95330),l=n(26258);function a(t,e,n={}){return p(t,e,n,d)}function u(t,e,n={}){return p(t,e,n,y)}function p(t,e,n={},r){let i=null;const o=n.once?(t,n)=>{r(t)&&((0,s.hw)(i),e(t,n))}:(t,n)=>{r(t)&&e(t,n)};if(i=(0,l.aQ)(t,o,n.sync,n.equals),n.initial){const e=t();o(e,e)}return i}function c(t,e,n,o={}){let l=null,u=null,p=null;function c(){l&&u&&(u.remove(),o.onListenerRemove?.(l),l=null,u=null)}function h(t){o.once&&o.once&&(0,s.hw)(p),n(t)}const d=a(t,((t,n)=>{c(),(0,r.vT)(t)&&(l=t,u=(0,r.on)(t,e,h),o.onListenerAdd?.(t))}),{sync:o.sync,initial:!0});return p=(0,i.kB)((()=>{d.remove(),c()})),p}function h(t,e){return function(t,e,n){if((0,o.Hc)(n))return Promise.reject((0,o.zE)());const r=t();if(e?.(r))return Promise.resolve(r);let l=null;function a(){l=(0,s.hw)(l)}return new Promise(((r,s)=>{l=(0,i.AL)([(0,o.fu)(n,(()=>{a(),s((0,o.zE)())})),p(t,(t=>{a(),r(t)}),{sync:!1,once:!0},e??d)])}))}(t,y,e)}function d(t){return!0}function y(t){return!!t}n(87538);const m={sync:!0},b={initial:!0},g={sync:!0,initial:!0}},40081:(t,e,n)=>{n.r(e),n.d(e,{default:()=>M});var r=n(43697),i=n(4757),s=n(22303),o=n(2368),l=n(96674),a=n(62357),u=n(5600),p=n(75215),c=(n(77734),n(80442),n(52011));let h=class extends((0,l.eC)(o.j)){constructor(t){super(t),this.type="simple",this.color=new s.Z("black"),this.lineSize=2,this.fontSize=10,this.textColor=new s.Z("black"),this.textBackgroundColor=new s.Z([255,255,255,.6])}};(0,r._)([(0,u.Cb)({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],h.prototype,"type",void 0),(0,r._)([(0,u.Cb)({type:s.Z,nonNullable:!0,json:{type:[p.z8],write:{isRequired:!0}}})],h.prototype,"color",void 0),(0,r._)([(0,u.Cb)({type:Number,cast:a.t_,nonNullable:!0,range:{min:(0,a.Wz)(1)},json:{write:{isRequired:!0}}})],h.prototype,"lineSize",void 0),(0,r._)([(0,u.Cb)({type:Number,cast:a.t_,nonNullable:!0,json:{write:{isRequired:!0}}})],h.prototype,"fontSize",void 0),(0,r._)([(0,u.Cb)({type:s.Z,nonNullable:!0,json:{type:[p.z8],write:{isRequired:!0}}})],h.prototype,"textColor",void 0),(0,r._)([(0,u.Cb)({type:s.Z,nonNullable:!0,json:{type:[p.z8],write:{isRequired:!0}}})],h.prototype,"textBackgroundColor",void 0),h=(0,r._)([(0,c.j)("esri.analysis.DimensionSimpleStyle")],h);const d=h;var y;n(66577),function(t){t.Horizontal="horizontal",t.Vertical="vertical",t.Direct="direct"}(y||(y={}));const m=[y.Horizontal,y.Vertical,y.Direct];var b=n(68251),g=n(90578),f=n(94139);let _=class extends((0,l.eC)(o.j)){constructor(t){super(t),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};(0,r._)([(0,u.Cb)({type:["length"],json:{write:{isRequired:!0}}})],_.prototype,"type",void 0),(0,r._)([(0,u.Cb)({type:f.Z,json:{write:!0}})],_.prototype,"startPoint",void 0),(0,r._)([(0,u.Cb)({type:f.Z,json:{write:!0}})],_.prototype,"endPoint",void 0),(0,r._)([(0,u.Cb)({type:m,nonNullable:!0,json:{write:{isRequired:!0}}})],_.prototype,"measureType",void 0),(0,r._)([(0,u.Cb)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],_.prototype,"offset",void 0),(0,r._)([(0,u.Cb)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,g.p)((t=>b.BV.normalize((0,p.q9)(t),0,!0)))],_.prototype,"orientation",void 0),_=(0,r._)([(0,c.j)("esri.analysis.LengthDimension")],_);const w=_;var v=n(46791),C=n(70921),A=n(17445),E=(n(92604),n(6570)),N=n(73615);const S=v.Z.ofType(w);let x=class extends i.Z{constructor(t){super(t),this.type="dimension",this.style=new d,this.extent=null}initialize(){this.addHandles((0,A.YP)((()=>this._computeExtent()),(t=>{null==t?.pending&&this._set("extent",null!=t?t.extent:null)}),A.tX))}get dimensions(){return this._get("dimensions")||new S}set dimensions(t){this._set("dimensions",(0,C.Z)(t,this.dimensions,S))}get spatialReference(){for(const t of this.dimensions){if(null!=t.startPoint)return t.startPoint.spatialReference;if(null!=t.endPoint)return t.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce(((t,e)=>(t.push(e.startPoint,e.endPoint),t)),[])}async waitComputeExtent(){const t=this._computeExtent();return null!=t?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(null==t)return{pending:null,extent:null};const e=[];for(const t of this.dimensions)null!=t.startPoint&&e.push(t.startPoint),null!=t.endPoint&&e.push(t.endPoint);const n=(0,N.projectOrLoadMany)(e,t);if(null!=n.pending)return{pending:n.pending,extent:null};let r=null;return null!=n.geometries&&(r=n.geometries.reduce(((t,e)=>null==t?null!=e?E.Z.fromPoint(e):null:null!=e?t.union(E.Z.fromPoint(e)):t),null)),{pending:null,extent:r}}clear(){this.dimensions.removeAll()}};(0,r._)([(0,u.Cb)({type:["dimension"]})],x.prototype,"type",void 0),(0,r._)([(0,u.Cb)({cast:C.R,type:S,nonNullable:!0})],x.prototype,"dimensions",null),(0,r._)([(0,u.Cb)({readOnly:!0})],x.prototype,"spatialReference",null),(0,r._)([(0,u.Cb)({types:{key:"type",base:null,typeMap:{simple:d}},nonNullable:!0})],x.prototype,"style",void 0),(0,r._)([(0,u.Cb)({value:null,readOnly:!0})],x.prototype,"extent",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],x.prototype,"requiredPropertiesForEditing",null),x=(0,r._)([(0,c.j)("esri.analysis.DimensionAnalysis")],x);const j=x;var P=n(16453),T=n(30556),D=n(87085),Z=n(38009);let R=class extends((0,Z.q)((0,P.R)(D.Z))){constructor(t){if(super(t),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new j,this.opacity=1,t){const{source:e,style:n}=t;e&&n&&(e.style=n)}}initialize(){this.addHandles([(0,A.YP)((()=>this.source),((t,e)=>{null!=e&&e.parent===this&&(e.parent=null),null!=t&&(t.parent=this)}),A.tX)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(t){this.source.style=t}get fullExtent(){return this.source.extent}releaseAnalysis(t){this.source===t&&(this.source=new j)}get analysis(){return this.source}set analysis(t){this.source=t}get dimensions(){return this.source.dimensions}set dimensions(t){this.source.dimensions=t}writeDimensions(t,e,n,r){e.dimensions=t.filter((({startPoint:t,endPoint:e})=>null!=t&&null!=e)).map((t=>t.toJSON(r))).toJSON()}};(0,r._)([(0,u.Cb)({json:{read:!1},readOnly:!0})],R.prototype,"type",void 0),(0,r._)([(0,u.Cb)({type:["ArcGISDimensionLayer"]})],R.prototype,"operationalLayerType",void 0),(0,r._)([(0,u.Cb)({nonNullable:!0})],R.prototype,"source",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"spatialReference",null),(0,r._)([(0,u.Cb)({types:{key:"type",base:null,typeMap:{simple:d}},json:{write:{ignoreOrigin:!0}}})],R.prototype,"style",null),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"fullExtent",null),(0,r._)([(0,u.Cb)({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],R.prototype,"opacity",void 0),(0,r._)([(0,u.Cb)({type:["show","hide"]})],R.prototype,"listMode",void 0),(0,r._)([(0,u.Cb)({type:v.Z.ofType(w),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],R.prototype,"dimensions",null),(0,r._)([(0,T.c)("web-scene","dimensions")],R.prototype,"writeDimensions",null),R=(0,r._)([(0,c.j)("esri.layers.DimensionLayer")],R);const M=R},87085:(t,e,n)=>{n.d(e,{Z:()=>_});var r=n(43697),i=(n(66577),n(3172)),s=n(20102),o=n(32448),l=n(10699),a=n(83379),u=n(92604),p=n(95330),c=n(17452),h=n(5600),d=(n(80442),n(77734),n(52011)),y=n(68773),m=n(6570),b=n(82971);let g=0,f=class extends(o.Z.EventedMixin((0,l.IG)(a.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new m.Z(-180,-90,180,90,b.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=b.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(t){const e="string"==typeof t?{url:t}:t;return(await n.e(3529).then(n.bind(n,63529))).fromUrl(e)}static fromPortalItem(t){return async function(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:r}=await n.e(8008).then(n.bind(n,28008));try{return await r(e)}catch(t){const n=e&&e.portalItem,r=n?.id||"unset",i=n&&n.portal&&n.portal.url||y.default.portalUrl;throw u.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+r+"')",t),t}}(t)}initialize(){this.when().catch((t=>{(0,p.D_)(t)||u.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})}))}destroy(){const t=this.parent;if(t){const e=this;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"referenceLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,c.mN)(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await(0,i.Z)(t,{query:{f:"json"},responseType:"json"})).data;throw new s.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,r._)([(0,h.Cb)({type:String})],f.prototype,"attributionDataUrl",void 0),(0,r._)([(0,h.Cb)({type:m.Z})],f.prototype,"fullExtent",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],f.prototype,"hasAttributionData",null),(0,r._)([(0,h.Cb)({type:String,clonable:!1})],f.prototype,"id",void 0),(0,r._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],f.prototype,"legendEnabled",void 0),(0,r._)([(0,h.Cb)({type:["show","hide","hide-children"]})],f.prototype,"listMode",void 0),(0,r._)([(0,h.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],f.prototype,"opacity",void 0),(0,r._)([(0,h.Cb)({clonable:!1})],f.prototype,"parent",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],f.prototype,"parsedUrl",null),(0,r._)([(0,h.Cb)({type:Boolean,readOnly:!0})],f.prototype,"persistenceEnabled",void 0),(0,r._)([(0,h.Cb)({type:Boolean})],f.prototype,"popupEnabled",void 0),(0,r._)([(0,h.Cb)({type:Boolean})],f.prototype,"attributionVisible",void 0),(0,r._)([(0,h.Cb)({type:b.Z})],f.prototype,"spatialReference",void 0),(0,r._)([(0,h.Cb)({type:String})],f.prototype,"title",void 0),(0,r._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],f.prototype,"type",void 0),(0,r._)([(0,h.Cb)()],f.prototype,"url",void 0),(0,r._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],f.prototype,"visible",void 0),f=(0,r._)([(0,d.j)("esri.layers.Layer")],f);const _=f}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6170],{8310:(t,e,n)=>{n.d(e,{b:()=>N,c:()=>d,d:()=>M,g:()=>g,i:()=>U,n:()=>D}),n(80442);var r=n(92604),i=n(22021),o=n(55488),s=n(20773),c=n(28712),u=n(11077),a=n(22549),f=n(39514),l=n(62155),E=n(78341),T=n(61277),I=n(12981);const h=N();function N(){return(0,a.Ue)()}const O=u.e,A=u.e;function d(t,e){return(0,u.c)(e,t)}function M(t){return t[3]}function g(t){return t}function R(t,e,n){if(null==e)return!1;if(!m(t,e,_))return!1;let{t0:r,t1:i}=_;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(n){const{origin:t,direction:i}=e;n[0]=t[0]+i[0]*r,n[1]=t[1]+i[1]*r,n[2]=t[2]+i[2]*r}return!0}const _={t0:0,t1:0};function m(t,e,n){const{origin:r,direction:i}=e,o=S;o[0]=r[0]-t[0],o[1]=r[1]-t[1],o[2]=r[2]-t[2];const s=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===s)return!1;const c=2*(i[0]*o[0]+i[1]*o[1]+i[2]*o[2]),u=c*c-4*s*(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]-t[3]*t[3]);if(u<0)return!1;const a=Math.sqrt(u);return n.t0=(-c-a)/(2*s),n.t1=(-c+a)/(2*s),!0}const S=(0,c.Ue)();function U(t,e){return R(t,e,null)}function P(t,e,n){const r=I.WM.get(),i=I.MP.get();(0,s.b)(r,e.origin,e.direction);const c=M(t);(0,s.b)(n,r,e.origin),(0,s.i)(n,n,1/(0,s.l)(n)*c);const u=C(t,e.origin),a=(0,T.EU)(e.origin,n);return(0,o.Us)(i,a+u,r),(0,s.e)(n,n,i),n}function p(t,e,n){const r=(0,s.f)(I.WM.get(),e,t),i=(0,s.i)(I.WM.get(),r,t[3]/(0,s.l)(r));return(0,s.g)(n,i,t)}function C(t,e){const n=(0,s.f)(I.WM.get(),e,t),r=(0,s.l)(n),o=M(t),c=o+Math.abs(o-r);return(0,i.ZF)(o/c)}const L=(0,c.Ue)();function b(t,e,n,r){const o=(0,s.f)(L,e,t);switch(n){case l.R.X:{const t=(0,i.jE)(o,L)[2];return(0,s.s)(r,-Math.sin(t),Math.cos(t),0)}case l.R.Y:{const t=(0,i.jE)(o,L),e=t[1],n=t[2],c=Math.sin(e);return(0,s.s)(r,-c*Math.cos(n),-c*Math.sin(n),Math.cos(e))}case l.R.Z:return(0,s.n)(r,o);default:return}}function F(t,e){const n=(0,s.f)(V,e,t);return(0,s.l)(n)-t[3]}function D(t,e){const n=(0,s.a)(t,e),r=M(t);return n<=r*r}const V=(0,c.Ue)(),v=N();Object.freeze(Object.defineProperty({__proto__:null,NullSphere:h,altitudeAt:F,angleToSilhouette:C,axisAt:b,clear:function(t){t[0]=t[1]=t[2]=t[3]=0},closestPoint:function(t,e,n){return R(t,e,n)?n:((0,E.JI)(e,t,n),p(t,n,n))},closestPointOnSilhouette:P,containsPoint:D,copy:d,create:N,distanceToSilhouette:function(t,e){const n=(0,s.f)(I.WM.get(),e,t),r=(0,s.m)(n),i=t[3]*t[3];return Math.sqrt(Math.abs(r-i))},elevate:function(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n},equals:A,exactEquals:O,fromCenterAndRadius:function(t,e){return(0,a.al)(t[0],t[1],t[2],e)},fromRadius:function(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t},fromValues:function(t,e,n,r){return(0,a.al)(t,e,n,r)},getCenter:g,getRadius:M,intersectLine:function(t,e,n){const r=(0,E.zk)(e,n);if(!m(t,r,_))return[];const{origin:i,direction:o}=r,{t0:u,t1:a}=_,l=e=>{const n=(0,c.Ue)();return(0,s.p)(n,i,o,e),p(t,n,n)};return Math.abs(u-a)<(0,f.bn)()?[l(u)]:[l(u),l(a)]},intersectRay:R,intersectRayClosestSilhouette:function(t,e,n){if(R(t,e,n))return n;const r=P(t,e,I.WM.get());return(0,s.g)(n,e.origin,(0,s.i)(I.WM.get(),e.direction,(0,s.k)(e.origin,r)/(0,s.l)(e.direction))),n},intersectsRay:U,projectPoint:p,setAltitudeAt:function(t,e,n,r){const i=F(t,e),o=b(t,e,l.R.Z,V),c=(0,s.i)(V,o,n-i);return(0,s.g)(r,e,c)},setExtent:function(t,e,n){return r.Z.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t!==n&&d(t,n),n},tmpSphere:v,union:function(t,e,n=(0,a.Ue)()){const r=(0,s.k)(t,e),i=t[3],o=e[3];return r+o<i?((0,u.c)(n,t),n):r+i<o?((0,u.c)(n,e),n):((0,s.o)(n,t,e,(r+o-i)/(2*r)),n[3]=(r+i+o)/2,n)},wrap:function(t){return t}},Symbol.toStringTag,{value:"Module"}))},22807:(t,e,n)=>{n.d(e,{x:()=>i});var r=n(41213);class i{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,r.Y)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,o));t++)this._items.push(this._allocator())}}const o=1024},4818:(t,e,n)=>{function r(){return[1,0,0,0,1,0,0,0,1]}function i(t,e,n,r,i,o,s,c,u){return[t,e,n,r,i,o,s,c,u]}n.d(e,{Ue:()=>r,Wd:()=>o,al:()=>i});const o=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:r,createView:function(t,e){return new Float64Array(t,e,9)},fromValues:i},Symbol.toStringTag,{value:"Module"}))},10681:(t,e,n)=>{function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}n.d(e,{Ue:()=>r,Wd:()=>o,d9:()=>i});const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:i,create:r,createView:function(t,e){return new Float64Array(t,e,16)},fromValues:function(t,e,n,r,i,o,s,c,u,a,f,l,E,T,I,h){return[t,e,n,r,i,o,s,c,u,a,f,l,E,T,I,h]}},Symbol.toStringTag,{value:"Module"}))},2153:(t,e,n)=>{function r(){return[0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3]]}n.d(e,{Ue:()=>r,Wd:()=>o,d9:()=>i});const o=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:i,create:r,createView:function(t,e){return new Float64Array(t,e,4)},fromValues:function(t,e,n,r){return[t,e,n,r]}},Symbol.toStringTag,{value:"Module"}))},46505:(t,e,n)=>{function r(){return[0,0]}function i(t,e){return[t,e]}function o(){return i(1,1)}function s(){return i(1,0)}function c(){return i(0,1)}n.d(e,{Ue:()=>r,al:()=>i});const u=o(),a=s(),f=c();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:a,UNIT_Y:f,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:r,createView:function(t,e){return new Float64Array(t,e,2)},fromArray:function(t,e=[0,0]){const n=Math.min(2,t.length);for(let r=0;r<n;++r)e[r]=t[r];return e},fromValues:i,ones:o,unitX:s,unitY:c,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},62073:(t,e,n)=>{n.d(e,{Ue:()=>o,zu:()=>c,st:()=>s,jH:()=>I}),n(22021);var r=n(20773),i=n(28712);function o(t=h){return[t[0],t[1],t[2],t[3]]}function s(t){return t}function c(t,e,n,i=0,s=Math.floor(n*(1/3)),I=Math.floor(n*(2/3))){if(n<3)return!1;e(a,i);let h=s,N=!1;for(;h<n-1&&!N;)e(f,h),h++,N=!(0,r.h)(a,f);if(!N)return!1;for(h=Math.max(h,I),N=!1;h<n&&!N;)e(l,h),h++,(0,r.f)(E,a,f),(0,r.n)(E,E),(0,r.f)(T,f,l),(0,r.n)(T,T),N=!(0,r.h)(a,l)&&!(0,r.h)(f,l)&&Math.abs((0,r.j)(E,T))<u;return N?(function(t,e,n,r=o()){const i=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],u=t[0]-e[0],a=t[1]-e[1],f=t[2]-e[2],l=s*f-c*a,E=c*u-i*f,T=i*a-s*u,I=l*l+E*E+T*T,h=Math.abs(I-1)>1e-5&&I>1e-12?1/Math.sqrt(I):1;r[0]=l*h,r[1]=E*h,r[2]=T*h,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2])}(a,f,l,t),!0):(0!==i||1!==s||2!==I)&&c(t,e,n,0,1,2)}n(11077),n(39514),n(8310),n(61277),n(12981),(0,i.Ue)(),(0,i.Ue)(),(0,i.Ue)(),(0,i.Ue)(),(0,i.Ue)();const u=.99619469809,a=(0,i.Ue)(),f=(0,i.Ue)(),l=(0,i.Ue)(),E=(0,i.Ue)(),T=(0,i.Ue)();function I(t,e){return(0,r.j)(t,e)+t[3]}const h=[0,0,1,0];var N,O;(O=N||(N={}))[O.NONE=0]="NONE",O[O.CLAMP=1]="CLAMP",O[O.INFINITE_MIN=4]="INFINITE_MIN",O[O.INFINITE_MAX=8]="INFINITE_MAX",N.INFINITE_MIN,N.INFINITE_MAX,N.INFINITE_MAX},78341:(t,e,n)=>{n.d(e,{JI:()=>f,Ue:()=>s,re:()=>u,zk:()=>a}),n(67676);var r=n(22807),i=n(20773),o=n(28712);function s(t){return t?c((0,o.d9)(t.origin),(0,o.d9)(t.direction)):c((0,o.Ue)(),(0,o.Ue)())}function c(t,e){return{origin:t,direction:e}}function u(t,e){const n=l.get();return n.origin=t,n.direction=e,n}function a(t,e,n=s()){return(0,i.c)(n.origin,t),(0,i.f)(n.direction,e,t),n}function f(t,e,n){const r=(0,i.j)(t.direction,(0,i.f)(n,e,t.origin));return(0,i.g)(n,t.origin,(0,i.i)(n,t.direction,r)),n}n(12981);const l=new r.x((()=>s()))},61277:(t,e,n)=>{n.d(e,{EU:()=>s});var r=n(22021),i=n(20773),o=n(28712);function s(t,e){const n=(0,i.j)(t,e)/((0,i.l)(t)*(0,i.l)(e));return-(0,r.ZF)(n)}(0,o.Ue)(),(0,o.Ue)()},12981:(t,e,n)=>{n.d(e,{MP:()=>E,vD:()=>T,WM:()=>l});var r=n(41213),i=n(4818),o=n(10681),s=n(2153),c=n(46505),u=n(28712),a=n(22549);class f{constructor(t){this._create=t,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,r.Y)((()=>this._reset())),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const t=2*this._itemsPtr;this._items.length>t&&(this._items.length=t),this._itemsPtr=0}static createVec2f64(){return new f(c.Ue)}static createVec3f64(){return new f(u.Ue)}static createVec4f64(){return new f(a.Ue)}static createMat3f64(){return new f(i.Ue)}static createMat4f64(){return new f(o.Ue)}static createQuatf64(){return new f(s.Ue)}get test(){return{length:this._items.length}}}f.createVec2f64();const l=f.createVec3f64(),E=(f.createVec4f64(),f.createMat3f64(),f.createMat4f64()),T=f.createQuatf64()},35065:(t,e,n)=>{var r;n.d(e,{T:()=>r}),function(t){t.POSITION="position",t.NORMAL="normal",t.NORMALCOMPRESSED="normalCompressed",t.UV0="uv0",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.TANGENT="tangent",t.OFFSET="offset",t.PERSPECTIVEDIVIDE="perspectiveDivide",t.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",t.LENGTH="length",t.PREVPOSITION="prevPosition",t.NEXTPOSITION="nextPosition",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.INSTANCEMODELORIGINHI="instanceModelOriginHi",t.INSTANCEMODELORIGINLO="instanceModelOriginLo",t.INSTANCEMODEL="instanceModel",t.INSTANCEMODELNORMAL="instanceModelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMAL2COMPRESSED="normal2Compressed",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.EXTRUDE="extrude",t.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",t.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6170],{8310:(t,e,n)=>{n.d(e,{b:()=>N,c:()=>d,d:()=>M,g:()=>g,i:()=>U,n:()=>D}),n(80442);var r=n(92604),i=n(22021),o=n(55488),s=n(20773),c=n(28712),u=n(11077),a=n(22549),f=n(39514),l=n(62155),E=n(78341),T=n(61277),I=n(12981);const h=N();function N(){return(0,a.Ue)()}const O=u.e,A=u.e;function d(t,e){return(0,u.c)(e,t)}function M(t){return t[3]}function g(t){return t}function R(t,e,n){if(null==e)return!1;if(!m(t,e,_))return!1;let{t0:r,t1:i}=_;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(n){const{origin:t,direction:i}=e;n[0]=t[0]+i[0]*r,n[1]=t[1]+i[1]*r,n[2]=t[2]+i[2]*r}return!0}const _={t0:0,t1:0};function m(t,e,n){const{origin:r,direction:i}=e,o=S;o[0]=r[0]-t[0],o[1]=r[1]-t[1],o[2]=r[2]-t[2];const s=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===s)return!1;const c=2*(i[0]*o[0]+i[1]*o[1]+i[2]*o[2]),u=c*c-4*s*(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]-t[3]*t[3]);if(u<0)return!1;const a=Math.sqrt(u);return n.t0=(-c-a)/(2*s),n.t1=(-c+a)/(2*s),!0}const S=(0,c.Ue)();function U(t,e){return R(t,e,null)}function P(t,e,n){const r=I.WM.get(),i=I.MP.get();(0,s.b)(r,e.origin,e.direction);const c=M(t);(0,s.b)(n,r,e.origin),(0,s.i)(n,n,1/(0,s.l)(n)*c);const u=C(t,e.origin),a=(0,T.EU)(e.origin,n);return(0,o.Us)(i,a+u,r),(0,s.e)(n,n,i),n}function p(t,e,n){const r=(0,s.f)(I.WM.get(),e,t),i=(0,s.i)(I.WM.get(),r,t[3]/(0,s.l)(r));return(0,s.g)(n,i,t)}function C(t,e){const n=(0,s.f)(I.WM.get(),e,t),r=(0,s.l)(n),o=M(t),c=o+Math.abs(o-r);return(0,i.ZF)(o/c)}const L=(0,c.Ue)();function b(t,e,n,r){const o=(0,s.f)(L,e,t);switch(n){case l.R.X:{const t=(0,i.jE)(o,L)[2];return(0,s.s)(r,-Math.sin(t),Math.cos(t),0)}case l.R.Y:{const t=(0,i.jE)(o,L),e=t[1],n=t[2],c=Math.sin(e);return(0,s.s)(r,-c*Math.cos(n),-c*Math.sin(n),Math.cos(e))}case l.R.Z:return(0,s.n)(r,o);default:return}}function F(t,e){const n=(0,s.f)(V,e,t);return(0,s.l)(n)-t[3]}function D(t,e){const n=(0,s.a)(t,e),r=M(t);return n<=r*r}const V=(0,c.Ue)(),v=N();Object.freeze(Object.defineProperty({__proto__:null,NullSphere:h,altitudeAt:F,angleToSilhouette:C,axisAt:b,clear:function(t){t[0]=t[1]=t[2]=t[3]=0},closestPoint:function(t,e,n){return R(t,e,n)?n:((0,E.JI)(e,t,n),p(t,n,n))},closestPointOnSilhouette:P,containsPoint:D,copy:d,create:N,distanceToSilhouette:function(t,e){const n=(0,s.f)(I.WM.get(),e,t),r=(0,s.m)(n),i=t[3]*t[3];return Math.sqrt(Math.abs(r-i))},elevate:function(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n},equals:A,exactEquals:O,fromCenterAndRadius:function(t,e){return(0,a.al)(t[0],t[1],t[2],e)},fromRadius:function(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t},fromValues:function(t,e,n,r){return(0,a.al)(t,e,n,r)},getCenter:g,getRadius:M,intersectLine:function(t,e,n){const r=(0,E.zk)(e,n);if(!m(t,r,_))return[];const{origin:i,direction:o}=r,{t0:u,t1:a}=_,l=e=>{const n=(0,c.Ue)();return(0,s.p)(n,i,o,e),p(t,n,n)};return Math.abs(u-a)<(0,f.bn)()?[l(u)]:[l(u),l(a)]},intersectRay:R,intersectRayClosestSilhouette:function(t,e,n){if(R(t,e,n))return n;const r=P(t,e,I.WM.get());return(0,s.g)(n,e.origin,(0,s.i)(I.WM.get(),e.direction,(0,s.k)(e.origin,r)/(0,s.l)(e.direction))),n},intersectsRay:U,projectPoint:p,setAltitudeAt:function(t,e,n,r){const i=F(t,e),o=b(t,e,l.R.Z,V),c=(0,s.i)(V,o,n-i);return(0,s.g)(r,e,c)},setExtent:function(t,e,n){return r.Z.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t!==n&&d(t,n),n},tmpSphere:v,union:function(t,e,n=(0,a.Ue)()){const r=(0,s.k)(t,e),i=t[3],o=e[3];return r+o<i?((0,u.c)(n,t),n):r+i<o?((0,u.c)(n,e),n):((0,s.o)(n,t,e,(r+o-i)/(2*r)),n[3]=(r+i+o)/2,n)},wrap:function(t){return t}},Symbol.toStringTag,{value:"Module"}))},22807:(t,e,n)=>{n.d(e,{x:()=>i});var r=n(41213);class i{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,r.Y)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,o));t++)this._items.push(this._allocator())}}const o=1024},4818:(t,e,n)=>{function r(){return[1,0,0,0,1,0,0,0,1]}function i(t,e,n,r,i,o,s,c,u){return[t,e,n,r,i,o,s,c,u]}n.d(e,{Ue:()=>r,Wd:()=>o,al:()=>i});const o=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:r,createView:function(t,e){return new Float64Array(t,e,9)},fromValues:i},Symbol.toStringTag,{value:"Module"}))},10681:(t,e,n)=>{function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}n.d(e,{Ue:()=>r,Wd:()=>o,d9:()=>i});const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:i,create:r,createView:function(t,e){return new Float64Array(t,e,16)},fromValues:function(t,e,n,r,i,o,s,c,u,a,f,l,E,T,I,h){return[t,e,n,r,i,o,s,c,u,a,f,l,E,T,I,h]}},Symbol.toStringTag,{value:"Module"}))},2153:(t,e,n)=>{function r(){return[0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3]]}n.d(e,{Ue:()=>r,Wd:()=>o,d9:()=>i});const o=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:i,create:r,createView:function(t,e){return new Float64Array(t,e,4)},fromValues:function(t,e,n,r){return[t,e,n,r]}},Symbol.toStringTag,{value:"Module"}))},46505:(t,e,n)=>{function r(){return[0,0]}function i(t,e){return[t,e]}function o(){return i(1,1)}function s(){return i(1,0)}function c(){return i(0,1)}n.d(e,{Ue:()=>r,al:()=>i});const u=o(),a=s(),f=c();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:a,UNIT_Y:f,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:r,createView:function(t,e){return new Float64Array(t,e,2)},fromArray:function(t,e=[0,0]){const n=Math.min(2,t.length);for(let r=0;r<n;++r)e[r]=t[r];return e},fromValues:i,ones:o,unitX:s,unitY:c,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},62073:(t,e,n)=>{n.d(e,{Ue:()=>o,zu:()=>c,st:()=>s}),n(22021);var r=n(20773),i=n(28712);function o(t=I){return[t[0],t[1],t[2],t[3]]}function s(t){return t}function c(t,e,n,i=0,s=Math.floor(n*(1/3)),I=Math.floor(n*(2/3))){if(n<3)return!1;e(a,i);let h=s,N=!1;for(;h<n-1&&!N;)e(f,h),h++,N=!(0,r.h)(a,f);if(!N)return!1;for(h=Math.max(h,I),N=!1;h<n&&!N;)e(l,h),h++,(0,r.f)(E,a,f),(0,r.n)(E,E),(0,r.f)(T,f,l),(0,r.n)(T,T),N=!(0,r.h)(a,l)&&!(0,r.h)(f,l)&&Math.abs((0,r.j)(E,T))<u;return N?(function(t,e,n,r=o()){const i=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],u=t[0]-e[0],a=t[1]-e[1],f=t[2]-e[2],l=s*f-c*a,E=c*u-i*f,T=i*a-s*u,I=l*l+E*E+T*T,h=Math.abs(I-1)>1e-5&&I>1e-12?1/Math.sqrt(I):1;r[0]=l*h,r[1]=E*h,r[2]=T*h,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2])}(a,f,l,t),!0):(0!==i||1!==s||2!==I)&&c(t,e,n,0,1,2)}n(11077),n(39514),n(8310),n(61277),n(12981),(0,i.Ue)(),(0,i.Ue)(),(0,i.Ue)(),(0,i.Ue)(),(0,i.Ue)();const u=.99619469809,a=(0,i.Ue)(),f=(0,i.Ue)(),l=(0,i.Ue)(),E=(0,i.Ue)(),T=(0,i.Ue)(),I=[0,0,1,0];var h,N;(N=h||(h={}))[N.NONE=0]="NONE",N[N.CLAMP=1]="CLAMP",N[N.INFINITE_MIN=4]="INFINITE_MIN",N[N.INFINITE_MAX=8]="INFINITE_MAX",h.INFINITE_MIN,h.INFINITE_MAX,h.INFINITE_MAX},78341:(t,e,n)=>{n.d(e,{JI:()=>f,Ue:()=>s,re:()=>u,zk:()=>a}),n(67676);var r=n(22807),i=n(20773),o=n(28712);function s(t){return t?c((0,o.d9)(t.origin),(0,o.d9)(t.direction)):c((0,o.Ue)(),(0,o.Ue)())}function c(t,e){return{origin:t,direction:e}}function u(t,e){const n=l.get();return n.origin=t,n.direction=e,n}function a(t,e,n=s()){return(0,i.c)(n.origin,t),(0,i.f)(n.direction,e,t),n}function f(t,e,n){const r=(0,i.j)(t.direction,(0,i.f)(n,e,t.origin));return(0,i.g)(n,t.origin,(0,i.i)(n,t.direction,r)),n}n(12981);const l=new r.x((()=>s()))},61277:(t,e,n)=>{n.d(e,{EU:()=>s});var r=n(22021),i=n(20773),o=n(28712);function s(t,e){const n=(0,i.j)(t,e)/((0,i.l)(t)*(0,i.l)(e));return-(0,r.ZF)(n)}(0,o.Ue)(),(0,o.Ue)()},12981:(t,e,n)=>{n.d(e,{MP:()=>E,vD:()=>T,WM:()=>l});var r=n(41213),i=n(4818),o=n(10681),s=n(2153),c=n(46505),u=n(28712),a=n(22549);class f{constructor(t){this._create=t,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,r.Y)((()=>this._reset())),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const t=2*this._itemsPtr;this._items.length>t&&(this._items.length=t),this._itemsPtr=0}static createVec2f64(){return new f(c.Ue)}static createVec3f64(){return new f(u.Ue)}static createVec4f64(){return new f(a.Ue)}static createMat3f64(){return new f(i.Ue)}static createMat4f64(){return new f(o.Ue)}static createQuatf64(){return new f(s.Ue)}get test(){return{length:this._items.length}}}f.createVec2f64();const l=f.createVec3f64(),E=(f.createVec4f64(),f.createMat3f64(),f.createMat4f64()),T=f.createQuatf64()},35065:(t,e,n)=>{var r;n.d(e,{T:()=>r}),function(t){t.POSITION="position",t.NORMAL="normal",t.NORMALCOMPRESSED="normalCompressed",t.UV0="uv0",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.TANGENT="tangent",t.OFFSET="offset",t.PERSPECTIVEDIVIDE="perspectiveDivide",t.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",t.LENGTH="length",t.PREVPOSITION="prevPosition",t.NEXTPOSITION="nextPosition",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.INSTANCEMODELORIGINHI="instanceModelOriginHi",t.INSTANCEMODELORIGINLO="instanceModelOriginLo",t.INSTANCEMODEL="instanceModel",t.INSTANCEMODELNORMAL="instanceModelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMAL2COMPRESSED="normal2Compressed",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.EXTRUDE="extrude",t.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",t.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(r||(r={}))}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4216],{24197:(t,e,n)=>{n.d(e,{Ue:()=>cs,G8:()=>ls});var s=n(3892),r=n(20102),o=n(22974),i=n(43697),a=n(5600),u=(n(80442),n(92604),n(77734),n(52011)),l=n(81578),c=n(96674);let p=class extends c.wq{constructor(){super(...arguments),this.raster=void 0}};(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"raster",void 0),p=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunctionArguments")],p);const f=p;var h;let m=h=class extends f{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new h({raster:this.raster,raster2:this.raster2,operation:this.operation})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],m.prototype,"operation",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],m.prototype,"raster2",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],m.prototype,"rasters",null),m=h=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],m);const d=m;var g=n(90578),y=n(5847),b=n(25972);const x=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let w=class extends c.wq{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const t=[];for(let e=0;e<s.length;e++){const{parameters:n}=s[e],r=n.rasters||n.raster&&[n.raster];r?.length&&t.push(...r)}s=t}for(let t=e.length-1;t>=0;t--)e[t].isNoopProcess&&e.splice(t,1);let r=!1;for(let t=0;t<e.length;t++){const n=e[t];n.id=e.length-t-1;const{rasters:s}=n.parameters;r=r||null!=s&&s.length>1}const o=e.some((({name:t})=>x.has(t.toLowerCase())));return{functions:e,hasBranches:r,hasFocalFunction:o}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let n=0;n<s.length;n++){const o=s[n];if(null!=o&&this._isRasterFunctionValue(o)){const s=o.bind(t,e,this.id+n);if(!s.success)return this._bindingResult=s,s;r=r&&s.supportsGPU}}return!this.rasterInfo||e?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),this._bindingResult.success&&this._patchRasterInfo(),this._bindingResult.supportsGPU=r&&this._bindingResult.supportsGPU,this.processInputBandIds(),this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this.processInputBandIds(),this._bindingResult)}process(t){const e=this._getRasterValues(),n=0===e.length?t.pixelBlocks??t.primaryPixelBlocks:e.map((e=>this._readRasterValue(e,t)));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const e=t.map((t=>t.processInputBandIds()[0]));this.rawInputBandIds=e,this.isInputBandIdsSwizzled=this.rawInputBandIds.some(((t,e)=>t!==e));const n=t.filter((t=>"ExtractBand"===t.functionName));return n.length&&n.forEach(((t,e)=>{t.isInputBandIdsSwizzled=!0,t.swizzledBandSelection=[e,e,e]})),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:t}=this.sourceRasterInfos[0];for(let n=0;n<t;n++)e.push(n)}const s=this._getInputBandIds(e);return this.isInputBandIdsSwizzled=s.some(((t,e)=>t!==e)),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map((t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1})),t.rasters.some((t=>null!=t))||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];"Clip"===this.functionName&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach((e=>{if(this._isRasterFunctionValue(e)){const n=e.getClippingGeometries();t.push(...n)}}));else if(this._isRasterFunctionValue(e)){const n=e.getClippingGeometries();t.push(...n)}return t}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.flatMap((t=>this.functionArguments[t]))}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(0===e.length)return n;const r=e.map((t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&s.includes(t)?n[s.indexOf(t)]:"number"!=typeof t?n[0]:void 0)),o=r.find((t=>t))??n[0];return r.forEach(((t,e)=>{void 0===t&&(r[e]=o)})),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;s<t.sourceRasters.length;s++){const r=t.sourceRasters[s];if("number"!=typeof r)if("bind"in r)this._getPrimaryRasters(r,e,n);else{const t=r,s=this._getPrimaryRasterId(t);if(null==s)continue;n.includes(s)||(this.mainPrimaryRasterId===s?(e.unshift(t),n.unshift(s)):(e.push(t),n.push(s)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,e){const{primaryPixelBlocks:n}=e;if(null==t||"$$"===t){const t=n[0];return null==t?null:t.clone()}if("string"==typeof t){const s=e.primaryRasterIds.indexOf(t);return-1===s?null:n[s]}if("number"==typeof t){const e=n[0];if(null==e)return null;const{width:s,height:r,pixelType:o,mask:i}=e,a=i?new Uint8Array(i):null,u=new Float32Array(s*r);u.fill(t);const l=this.sourceRasterInfos[0].bandCount,c=new Array(l).fill(u);return new y.Z({width:s,height:r,pixelType:o,pixels:c,mask:a})}return t.process(e)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:e,keyProperties:n,statistics:s,histograms:r}=t,o=n.BandProperties;o&&o.length!==e&&(t.keyProperties={...n,BandProperties:void 0}),s&&s.length!==e&&(t.statistics=s.length>e?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:"string"==typeof n.BAND_COUNT?String(e):e})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],w.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],w.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],w.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}}),(0,g.p)((t=>t?.toLowerCase()))],w.prototype,"outputPixelType",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],w.prototype,"mainPrimaryRasterId",void 0),(0,i._)([(0,a.Cb)()],w.prototype,"sourceRasters",void 0),(0,i._)([(0,a.Cb)({type:[b.Z],json:{write:!0}})],w.prototype,"sourceRasterInfos",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],w.prototype,"rasterInfo",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],w.prototype,"readingBufferSize",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],w.prototype,"id",void 0),(0,i._)([(0,a.Cb)()],w.prototype,"isNoopProcess",void 0),(0,i._)([(0,a.Cb)()],w.prototype,"supportsGPU",null),(0,i._)([(0,a.Cb)()],w.prototype,"rawInputBandIds",void 0),(0,i._)([(0,a.Cb)()],w.prototype,"isInputBandIdsSwizzled",void 0),(0,i._)([(0,a.Cb)()],w.prototype,"swizzledBandSelection",void 0),(0,i._)([(0,a.Cb)()],w.prototype,"isBranch",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],w.prototype,"flatWebGLFunctionChain",null),(0,i._)([(0,a.Cb)()],w.prototype,"_bindingResult",void 0),w=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.BaseRasterFunction")],w);const v=w,_={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},C={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},A={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},P={setNull:50,conditional:78},T={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65,...C,...A,majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75,...P},N=new Map([[A.acos,{domain:[0,Math.PI],isInteger:!1}],[A.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[A.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[A.cos,{domain:[-1,1],isInteger:!1}],[A.sin,{domain:[-1,1],isInteger:!1}],[C.booleanAnd,{domain:[0,1],isInteger:!0}],[C.booleanNot,{domain:[0,1],isInteger:!0}],[C.booleanOr,{domain:[0,1],isInteger:!0}],[C.booleanXOr,{domain:[0,1],isInteger:!0}],[C.equalTo,{domain:[0,1],isInteger:!0}],[C.notEqual,{domain:[0,1],isInteger:!0}],[C.greaterThan,{domain:[0,1],isInteger:!0}],[C.greaterThanEqual,{domain:[0,1],isInteger:!0}],[C.lessThan,{domain:[0,1],isInteger:!0}],[C.lessThanEqual,{domain:[0,1],isInteger:!0}],[C.isNull,{domain:[0,1],isInteger:!0}]]);function R(t){return N.get(t)}const F=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function I(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]+r[t]);return i}function j(t,e,n){const[s]=t,r=s.length,o=y.Z.createEmptyBand("f32",r);return o.set(s),o}function k(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]-r[t]);return i}function M(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]*r[t]);return i}function S(t,e,n){const[s]=t,r=s.length,o=y.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=Math.sign(s[t])*Math.floor(Math.abs(s[t])));return o}function B(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]/r[t]);return i}function G(t,e,n){return B(t,e,"f32")}function O(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=Math.floor(s[t]/r[t]));return i}function D(t,e,n,s){const r=t[0],o=r.length,i=y.Z.createEmptyBand(n,o);if(s===A.atanh){for(let t=0;t<o;t++)if(e[t]){const n=r[t];Math.abs(n)>=1?e[t]=0:i[t]=Math.atanh(n)}return i}const a=s===A.asin?Math.asin:Math.acos;for(let t=0;t<o;t++)if(e[t]){const n=r[t];Math.abs(n)>1?e[t]=0:i[t]=a(n)}return i}function E(t,e,n,s){const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s(r[t]));return i}function z(t,e,n,s){const[r,o]=t,i=r.length,a=y.Z.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s(r[t],o[t]));return a}function Z(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&r[t]);return i}function L(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<<r[t]);return i}function V(t,e,n){const[s]=t,r=s.length,o=y.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=~s[t]);return o}function U(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]|r[t]);return i}function W(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>>r[t]);return i}function q(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]^r[t]);return i}function X(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&&r[t]?1:0);return i}function J(t,e,n){const[s]=t,r=s.length,o=y.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=s[t]?0:1);return o}function $(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]||r[t]?1:0);return i}function H(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=(s[t]?1:0)^(r[t]?1:0));return i}function Y(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?1:0);return i}function K(t,e,n,s){const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o),a=s===Math.E;for(let t=0;t<o;t++)e&&!e[t]||(i[t]=a?Math.exp(r[t]):s**r[t]);return i}function Q(t,e,n){return K(t,e,n,10)}function tt(t,e,n){return K(t,e,n,2)}function et(t,e,n){return K(t,e,n,Math.E)}function nt(t,e,n,s){const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(r[t]<=0?e[t]=0:i[t]=s(r[t]));return i}function st(t,e,n){return nt(t,e,n,Math.log10)}function rt(t,e,n){return nt(t,e,n,Math.log2)}function ot(t,e,n){return nt(t,e,n,Math.log)}function it(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>r[t]?1:0);return i}function at(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>=r[t]?1:0);return i}function ut(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<r[t]?1:0);return i}function lt(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<=r[t]?1:0);return i}function ct(t,e,n){const[s]=t,r=s.length,o=y.Z.createEmptyBand(n,r);if(!e)return o;for(let t=0;t<r;t++)o[t]=e[t]?0:1;return o}function pt(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]%r[t]);return i}function ft(t,e,n){const[s]=t,r=s.length,o=y.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=-s[t]);return o}function ht(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?0:1);return i}function mt(t,e,n){const[s,r]=t,o=s.length,i=y.Z.createEmptyBand(n,o),a=new Uint8Array(o);for(let t=0;t<o;t++)null!=e&&!e[t]||0!==s[t]||(i[t]=r[t],a[t]=255);return{band:i,mask:a}}function dt(t,e,n){const[s,r,o]=t,i=s.length,a=y.Z.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s[t]?r[t]:o[t]);return a}function gt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n];for(let r=1;r<s;r++){const s=t[r][n];e<s&&(e=s)}i[n]=e}return i}function yt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n];for(let r=1;r<s;r++){const s=t[r][n];e>s&&(e=s)}i[n]=e}return i}function bt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n],o=e;for(let r=1;r<s;r++){const s=t[r][n];o<s?o=s:e>s&&(e=s)}i[n]=o-e}return i}function xt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=0;for(let r=0;r<s;r++)e+=t[r][n];i[n]=e/s}return i}function wt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n])for(let e=0;e<s;e++){const s=t[e];i[n]+=s[n]}return i}function vt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){const e=new Float32Array(s);let r=0;for(let o=0;o<s;o++){const s=t[o];r+=s[n],e[o]=s[n]}r/=s;let o=0;for(let t=0;t<s;t++)o+=(e[t]-r)**2;i[n]=Math.sqrt(o/s)}return i}function _t(t,e,n){const s=t.length;if(s<2)return t[0];const r=Math.floor(s/2),[o]=t,i=o.length,a=y.Z.createEmptyBand(n,i),u=new Float32Array(s),l=s%2==1;for(let n=0;n<i;n++)if(!e||e[n]){for(let e=0;e<s;e++)u[e]=t[e][n];u.sort(),a[n]=l?u[r]:(u[r]+u[r-1])/2}return a}function Ct(t,e,n){const[s,r]=t;if(null==r)return s;const o=s.length,i=y.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e[t]&&(s[t]===r[t]?i[t]=s[t]:e[t]=0);return i}function At(t,e,n){const s=t.length;if(s<=2)return Ct(t,e,n);const r=t[0].length,o=y.Z.createEmptyBand(n,r),i=new Map;for(let n=0;n<r;n++)if(!e||e[n]){let e;i.clear();for(let r=0;r<s;r++)e=t[r][n],i.set(e,i.has(e)?i.get(e)+1:1);let r=0,a=0;for(const t of i.keys())r=i.get(t),r>a&&(a=r,e=t);o[n]=e}return o}function Pt(t,e,n){const s=t.length;if(s<=2)return Ct(t,e,n);const r=t[0].length,o=y.Z.createEmptyBand(n,r),i=new Map;for(let n=0;n<r;n++)if(!e||e[n]){let e;i.clear();for(let r=0;r<s;r++)e=t[r][n],i.set(e,i.has(e)?i.get(e)+1:1);let r=0,a=t.length;for(const t of i.keys())r=i.get(t),r<a&&(a=r,e=t);o[n]=e}return o}function Tt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.Z.createEmptyBand(n,o),a=new Set;for(let n=0;n<o;n++)if(!e||e[n]){let e;a.clear();for(let r=0;r<s;r++)e=t[r][n],a.add(e);i[n]=a.size}return i}const Nt=new Map,Rt=new Map,Ft=new Map,It=new Map;function jt(t,e,n,s){let[r,o]=(0,l.rL)(n);const i=(0,l.DV)(n);i&&(r-=1e-5,o+=1e-5);for(let n=0;n<e.length;n++)if(e[n]){const a=t[n];isNaN(a)||a<r||a>o?e[n]=0:s[n]=i?Math.round(a):a}}function kt(t,e,n={}){Nt.size||(Nt.set(4,Math.sqrt),Nt.set(6,Math.acos),Nt.set(7,Math.asin),Nt.set(8,Math.atan),Nt.set(9,Math.atanh),Nt.set(10,Math.abs),Nt.set(21,Math.cos),Nt.set(22,Math.cosh),Nt.set(48,Math.floor),Nt.set(49,Math.ceil),Nt.set(51,Math.sin),Nt.set(52,Math.sinh),Nt.set(56,Math.tan),Nt.set(57,Math.tanh),Nt.set(59,Math.acosh),Nt.set(60,Math.asinh),Nt.set(65,Math.floor),Rt.set(5,Math.pow),Rt.set(61,Math.atan2),Ft.set(1,I),Ft.set(2,k),Ft.set(3,M),Ft.set(11,Z),Ft.set(12,L),Ft.set(13,V),Ft.set(14,U),Ft.set(15,W),Ft.set(16,q),Ft.set(17,X),Ft.set(18,J),Ft.set(19,$),Ft.set(20,H),Ft.set(23,B),Ft.set(24,Y),Ft.set(25,et),Ft.set(26,Q),Ft.set(27,tt),Ft.set(28,it),Ft.set(29,at),Ft.set(30,S),Ft.set(31,ct),Ft.set(32,j),Ft.set(33,ut),Ft.set(34,lt),Ft.set(35,ot),Ft.set(36,st),Ft.set(37,rt),Ft.set(44,pt),Ft.set(45,ft),Ft.set(46,ht),Ft.set(64,G),Ft.set(65,O),Ft.set(76,dt),Ft.set(78,dt),It.set(38,At),It.set(39,gt),It.set(40,xt),It.set(41,_t),It.set(42,yt),It.set(43,Pt),It.set(47,bt),It.set(54,vt),It.set(55,wt),It.set(58,Tt),It.set(66,At),It.set(67,gt),It.set(68,xt),It.set(69,_t),It.set(70,yt),It.set(71,Pt),It.set(72,bt),It.set(73,vt),It.set(74,wt),It.set(75,Tt));let s=function(t,e=!1){const n=t.map((t=>t.mask)),s=n.filter((t=>null!=t)),r=t[0].pixels[0].length;if(0===s.length)return new Uint8Array(r).fill(255);const o=s[0],i=new Uint8Array(o);if(1===s.length)return i;if(!e){for(let t=1;t<s.length;t++){const e=s[t];for(let t=0;t<i.length;t++)i[t]&&(i[t]=e[t]?255:0)}return i}if(s.length!==n.length)return new Uint8Array(r).fill(255);for(let t=1;t<s.length;t++){const e=s[t];for(let t=0;t<i.length;t++)0===i[t]&&(i[t]=e[t]?255:0)}return i}(t,e>=66&&e<=75);const{outputPixelType:r="f32"}=n,o=!It.has(e)||n.processAsMultiband,i=o?t[0].pixels.length:1,a=[];for(let n=0;n<i;n++){const i=It.has(e)&&!o?t.flatMap((t=>t.pixels)):t.map((t=>t.pixels[n]));let u,l=!0;if(e===P.setNull){const t=mt(i,s,r);u=t.band,s=t.mask,l=!1}else Ft.has(e)?u=Ft.get(e)(i,s,"f64"):Nt.has(e)?u=e===A.asin||e===A.acos||e===A.atanh?D(i,s,"f64",e):E(i,s,"f64",Nt.get(e)):Rt.has(e)?u=z(i,s,"f64",Rt.get(e)):It.has(e)?u=It.get(e)(i,s,"f64"):(u=i[0],l=!1);if(l&&e!==C.isNull&&!N.has(e)){const t=y.Z.createEmptyBand(r,u.length);s||(s=new Uint8Array(u.length).fill(255)),jt(u,s,r,t),u=t}a.push(u)}const u=t[0];return new y.Z({width:u.width,height:u.height,pixelType:r,mask:e===C.isNull?null:s,pixels:a})}let Mt=class extends v{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,e.statistics=null,e.histograms=null,e.colormap=null,e.attributeTable=null,this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return null==e?.[0]||null==e?.[1]?null:function(t,e,n){return kt(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=(0,l.rL)(n);const o=(0,l.DV)(n);return o&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:o}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Mt.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:d,json:{write:!0,name:"rasterFunctionArguments"}})],Mt.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Mt.prototype,"rasterArgumentNames",void 0),Mt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ArithmeticFunction")],Mt);const St=Mt;var Bt;let Gt=Bt=class extends f{clone(){return new Bt({raster:this.raster})}};Gt=Bt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Gt);const Ot=Gt;var Dt=n(63342);let Et=class extends v{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.histograms=null,e.colormap=null,e.attributeTable=null,e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],o=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return(0,Dt.M_)(e,{resolution:o})}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Et.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Ot,json:{write:!0,name:"rasterFunctionArguments"}})],Et.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Et.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Et.prototype,"isGCS",void 0),Et=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunction")],Et);const zt=Et;var Zt=n(36030),Lt=n(35454);const Vt=new Set(["+","-","*","/","(",")"]);function Ut(t,e){return t.toLowerCase().startsWith("b")?e[parseInt(t.slice(1),10)-1]:parseFloat(t)}function Wt(t,e,n,s){if("number"==typeof n&&"number"==typeof s)return n+s;let r,o,i;"number"==typeof n?(i=s,r=i.length,o=new Float32Array(r),o.fill(n)):(r=n.length,o=n,s.constructor===Number?(i=new Float32Array(r),i.fill(s)):i=s);const a=new Float32Array(r);switch(e){case"+":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]+i[e]);break;case"-":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]-i[e]);break;case"*":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]*i[e]);break;case"/":for(let e=0;e<r;e++)(null==t||t[e])&&i[e]&&(a[e]=o[e]/i[e]);break;case"(":case")":throw new Error("encountered error with custom band index equation")}return a}function qt(t,e){t.splice(e,1);let n=0,s=0;do{n=0,s=0;for(let e=0;e<t.length;e++)if("("===t[e])n=e;else if(")"===t[e]){s=e;break}s===n+1&&t.splice(n,2)}while(s===n+1);return t}function Xt(t){if(1===t.length)return{opIndex:0,numIndex:0};let e=0,n=0;for(let s=0;s<t.length;s++)if("("===t[s])e=s;else if(")"===t[s]){n=s;break}const s=0===n?t:t.slice(e+1,n);let r=-1;for(let t=0;t<s.length;t++)if("*"===s[t]||"/"===s[t]){r=t;break}if(r>-1)n>0&&(r+=e+1);else{for(let t=0;t<s.length;t++)if("+"===s[t]||"-"===s[t]){r=t;break}n>0&&(r+=e+1)}let o=0;for(let e=0;e<r;e++)"("===t[e]&&o++;return{opIndex:r,numIndex:r-o}}var Jt=n(55914);const $t=new Lt.X({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Ht(t,e){if(!(0,Jt.nk)(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map((t=>t-1)),{pixels:o,mask:i}=t;let a;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=Kt(i,o[r[0]],o[r[1]]);break;case"ndwi":a=Kt(i,o[r[1]],o[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s)}return[r]}(i,o[r[0]],o[r[1]]);break;case"ci-g":case"ci-re":a=function(t,e,n){const s=e.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s-1)}return[r]}(i,o[r[0]],o[r[1]]);break;case"savi":a=function(t,e,n,s){const r=n.length,o=new Float32Array(r);for(let i=0;i<r;i++)if(null==t||t[i]){const t=n[i],r=e[i],a=r+t+s;a&&(o[i]=(r-t)/a*(1+s))}return[o]}(i,o[r[0]],o[r[1]],r[2]+1);break;case"tsavi":a=function(t,e,n,s,r,o){const i=n.length,a=new Float32Array(i),u=-r*s+o*(1+s*s);for(let o=0;o<i;o++)if(null==t||t[o]){const t=n[o],i=e[o],l=r*i+t+u;l&&(a[o]=s*(i-s*t-r)/l)}return[a]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o],i=2*s+1;r[o]=.5*(i-Math.sqrt(i*i-8*(s-t)))}return[r]}(i,o[r[0]],o[r[1]]);break;case"gemi":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o];if(1!==t&&s+t+.5!==0){const e=(2*(s*s-t*t)+1.5*s+.5*t)/(s+t+.5);r[o]=e*(1-.25*e)-(t-.125)/(1-t)}}return[r]}(i,o[r[0]],o[r[1]]);break;case"pvi":a=function(t,e,n,s,r){const o=n.length,i=new Float32Array(o),a=1/Math.sqrt(1+s*s);for(let u=0;u<o;u++)if(null==t||t[u]){const t=n[u],o=e[u];i[u]=(o-s*t-r)*a}return[i]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1);break;case"gvitm":a=function(t,e){const[n,s,r,o,i,a]=e,u=n.length,l=new Float32Array(u);for(let e=0;e<u;e++)(null==t||t[e])&&(l[e]=-.2848*n[e]-.2435*s[e]-.5436*r[e]+.7243*o[e]+.084*i[e]-.18*a[e]);return[l]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]],o[r[5]]]);break;case"sultan":a=function(t,e){const[n,s,r,o,i]=e,a=n.length,u=new Float32Array(a),l=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;e++)(null==t||t[e])&&(u[e]=i[e]?o[e]/i[e]*100:0,l[e]=n[e]?o[e]/n[e]*100:0,c[e]=r[e]?s[e]/r[e]*(o[e]/r[e])*100:0);return[u,l,c]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]]]);break;case"vari":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=o+t-r[e];a&&(i[e]=(o-t)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"mtvi2":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e],u=Math.sqrt((2*t+1)**2-(6*t-5*Math.sqrt(o))-.5);if(u){const n=1.5*(1.2*(t-a)-2.5*(o-a));i[e]=n/u}}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"rtvi-core":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e];i[e]=100*(t-o)-10*(t-a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"evi":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=t+6*o-7.5*r[e]+1;a&&(i[e]=2.5*(t-o)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"wndwi":a=function(t,e,n=.5){const[s,r,o]=e,i=r.length,a=new Float32Array(i);for(let e=0;e<i;e++)if(null==t||t[e])for(e=0;e<i;e++){const t=s[e],i=r[e],u=o[e],l=t+n*i+(1-n)*u;l&&(a[e]=(t-n*i-(1-n)*u)/l)}return[a]}(i,[o[r[0]],o[r[1]],o[r[2]]],r[3]?r[3]+1:.5);break;case"bai":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o])for(o=0;o<s;o++){const t=(.1-e[o])**2+(.06-n[o])**2;t&&(r[o]=1/t)}return[r]}(i,o[r[0]],o[r[1]]);break;case"custom":a=function(t,e,n){let s,{ops:r,nums:o}=function(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1,t.length));const n=t.split(""),s=[],r=[];let o="";for(let t=0;t<n.length;t++){const i=n[t];Vt.has(i)?(o.length&&r.push(Ut(o,e)),s.push(i),o=""):o=o.concat(i)}return o.length&&r.push(Ut(o,e)),{ops:s,nums:r}}(n,e);if(0===r.length){const t=1===o.length?o[0]:e[0];if(t instanceof Float32Array)return[t];const n=new Float32Array(e[0].length);return"number"==typeof t?n.fill(t):n.set(t),[n]}for(;r.length>0;){const{numIndex:e,opIndex:n}=Xt(r);if(s=Wt(t,r[n],o[e],o[e+1]),1===r.length)break;r=qt(r,n),o.splice(e,2,s)}return[s]}(i,o,n);break;default:return t}const u=null!=i?new Uint8Array(i.length):null;null!=i&&null!=u&&u.set(i);const l=new y.Z({width:t.width,height:t.height,pixelType:"f32",pixels:a,mask:u});return l.updateStatistics(),l}function Yt(t){const e=new Float32Array(9);return e[3*t[0]]=1,e[3*t[1]+1]=1,e[3*t[2]+2]=1,e}function Kt(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o],i=t+s;i&&(r[o]=(t-s)/i)}return[r]}var Qt;let te=Qt=class extends f{constructor(){super(...arguments),this.method="custom"}clone(){return new Qt({method:this.method,bandIndexes:this.bandIndexes,raster:(0,o.d9)(this.raster)})}};(0,i._)([(0,a.Cb)({json:{type:String,write:!0}})],te.prototype,"bandIndexes",void 0),(0,i._)([(0,Zt.J)($t)],te.prototype,"method",void 0),te=Qt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.BandArithmeticFunctionArguments")],te);const ee=te,ne=new Set(["vari","mtvi2","rtvi-core","evi"]);let se=class extends v{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0];if(t.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=null,e.histograms=null,e.bandCount="sultan"===this.functionArguments.method?3:1,e.keyProperties={...e.keyProperties,BandProperties:void 0},this.rasterInfo=e,{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{method:n,bandIndexes:s}=this.functionArguments,r=s.split(" ").map((t=>parseFloat(t)));return Ht(e,{method:n,bandIndexes:r,equation:s})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1));2===t.length&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=Yt([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=Yt([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=Yt([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=Yt([e[0],e[1],0]),s="ci";break;case"savi":n=Yt([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=Yt([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=Yt([e[0],e[1],0]),s="msavi";break;case"gemi":n=Yt([e[0],e[1],0]),s="gemi";break;case"pvi":n=Yt([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=Yt([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=Yt([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=Yt([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=Yt([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=Yt([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=Yt([e[1],e[0],0]),s="bai";break;default:n=Yt([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r}}_getInputBandIds(t){if("custom"===this.functionArguments.method)return t;const e=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1)),n=t.length,s=e.map((t=>t>=n?n-1:t)),r=ne.has(this.functionArguments.method)?3:2,o=s.slice(0,r).map((e=>t[e]));return 2===o.length&&o.push(0),o}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],se.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:ee,json:{write:!0,name:"rasterFunctionArguments"}})],se.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],se.prototype,"rasterArgumentNames",void 0),se=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.BandArithmeticFunction")],se);const re=se;var oe,ie=n(66577),ae=n(33955);const ue=new Lt.X({1:"outside",2:"inside"},{useNumericKeys:!0});let le=oe=class extends f{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new oe({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};(0,i._)([(0,a.Cb)({types:ie.qM,json:{read:ae.im,write:!0}})],le.prototype,"clippingGeometry",void 0),(0,i._)([(0,a.Cb)({json:{read:ue.read,write:ue.write}})],le.prototype,"clippingType",void 0),le=oe=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ClipFunctionArguments")],le);const ce=le;let pe=class extends v{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],pe.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:ce,json:{write:!0,name:"rasterFunctionArguments"}})],pe.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],pe.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)()],pe.prototype,"isNoopProcess",void 0),pe=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ClipFunction")],pe);const fe=pe;var he,me=n(71715),de=n(93010),ge=n(94593);let ye=he=class extends f{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return de.Oi.includes(e)?e:null}readColorRamp(t){return(0,ge.i)(t)}readColorRampName(t,e){if(!t)return null;const n=de.H0.jsonValues.find((e=>e.toLowerCase()===t.toLowerCase()));return n?de.H0.fromJSON(n):null}clone(){return new he({colormap:(0,o.d9)(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};(0,i._)([(0,a.Cb)({type:[[Number]],json:{write:!0}})],ye.prototype,"colormap",void 0),(0,i._)([(0,a.Cb)({type:String,json:{write:!0}})],ye.prototype,"colormapName",void 0),(0,i._)([(0,g.p)("colormapName")],ye.prototype,"castColormapName",null),(0,i._)([(0,a.Cb)({types:ge.V,json:{write:!0}})],ye.prototype,"colorRamp",void 0),(0,i._)([(0,me.r)("colorRamp")],ye.prototype,"readColorRamp",null),(0,i._)([(0,a.Cb)({type:de.H0.apiValues,json:{type:de.H0.jsonValues,write:de.H0.write}})],ye.prototype,"colorRampName",void 0),(0,i._)([(0,me.r)("colorRampName")],ye.prototype,"readColorRampName",null),ye=he=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],ye);const be=ye,xe=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],we=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function ve(t,e){const n=[],s=[];for(let e=0;e<t.length-1;e++)n.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:t[e].slice(1),toColor:t[e+1].slice(1)}),s.push(t[e+1][0]-t[e][0]);const r=t[t.length-1][0];return(0,de.XL)({type:"multipart",colorRamps:n},{numColors:r,weights:e=e??s})}let _e=class extends v{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)e=(0,de.Jw)(s,{interpolateAlpha:!0});else if(r){const t=(0,de.B4)(r);t&&(e=(0,de.Jw)(t))}else n&&(e=function(t){let e;switch(t){case"elevation":e=ve([[0,0,191,191],[51,0,0,255],[102,255,0,255],[153,255,0,127],[204,191,63,127],[256,20,20,20]]);break;case"gray":e=(0,de.XL)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":e=ve([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case"ndvi":e=xe;break;case"ndvi2":e=function(){const t=ve([[0,255,255,255],[70,0,255,0],[80,205,173,193],[100,150,150,150],[110,120,51,100],[130,120,100,200],[140,28,3,144],[160,6,0,55],[180,10,25,30],[201,6,7,27]]);for(let e=t.length;e<256;e++)t.push([6,27,7]);return t}();break;case"ndvi3":e=we;break;case"random":e=function(){const t=[];for(let e=0;e<256;e++){const e=[];for(let t=0;t<3;t++)e.push(Math.round(255*Math.random()));t.push(e)}return t}()}return e?(e=e.map(((t,e)=>[e,...t])),e):null}(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const o=this._getOutputPixelType(t.pixelType);this.outputPixelType=o.startsWith("f")?"s32":o;const i=t.clone();return i.pixelType=this.outputPixelType,i.colormap=e,i.bandCount=1,this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],_e.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:be,json:{write:!0,name:"rasterFunctionArguments"}})],_e.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],_e.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)()],_e.prototype,"isNoopProcess",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],_e.prototype,"indexedColormap",void 0),_e=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ColormapFunction")],_e);const Ce=_e;var Ae,Pe=n(30556);let Te=Ae=class extends f{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map((t=>"number"==typeof t||"string"==typeof t?t:t.toJSON()))}clone(){return new Ae({rasters:(0,o.d9)(this.rasters)})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],Te.prototype,"rasters",void 0),(0,i._)([(0,Pe.c)("rasters")],Te.prototype,"writeRasters",null),Te=Ae=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],Te);const Ne=Te;let Re=class extends v{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map((({bandCount:t})=>t)).reduce(((t,e)=>t+e)),t.every((({statistics:t})=>null!=t&&t.length))){const e=[];t.forEach((({statistics:t})=>null!=t&&e.push(...t))),n.statistics=e}if(t.every((({histograms:t})=>null!=t&&t.length))){const e=[];t.forEach((({histograms:t})=>null!=t&&e.push(...t))),n.histograms=e}n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every((t=>t.keyProperties.BandProperties?.length))?t.flatMap((t=>t.keyProperties.BandProperties)):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;if(!e)return null;const n=e?.[0];return null==n?null:(0,Jt.Gd)(e)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Re.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Ne,json:{write:!0,name:"rasterFunctionArguments"}})],Re.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Re.prototype,"rasterArgumentNames",void 0),Re=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.CompositeBandFunction")],Re);const Fe=Re;var Ie;let je=Ie=class extends f{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new Ie({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],je.prototype,"contrastOffset",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],je.prototype,"brightnessOffset",void 0),je=Ie=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],je);const ke=je;var Me=n(15612);let Se=class extends v{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if("u8"!==e.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();n.colormap=null,n.statistics=null,n.histograms=null,this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=(0,Me.gI)(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:(0,Jt.XV)(e,{lut:e.pixels.map((()=>this.lookup)),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Se.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:ke,json:{write:!0,name:"rasterFunctionArguments"}})],Se.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Se.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Se.prototype,"lookup",void 0),Se=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],Se);const Be=Se;function Ge(t,e,n,s,r){const o=Math.floor(s/2);for(let s=0;s<o;s++)for(let o=0;o<e;o++)t[s*e+o]=t[(r-1-s)*e+o],t[(n-1-s)*e+o]=t[(n-r+s)*e+o];const i=Math.floor(r/2);for(let s=0;s<n;s++){const n=s*e;for(let s=0;s<i;s++)t[n+s]=t[n+r-1-s],t[n+e-s-1]=t[n+e+s-r]}}const Oe=new Map;function De(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=o.length,l=i?0:s,c=i?s:0,p=i?1:e;for(let i=l;i<n-l;i++){const n=i*e;for(let i=c;i<e-c;i++){if(r&&!r[n+i])continue;let e=0;for(let r=0;r<u;r++)e+=t[n+i+(r-s)*p]*o[r];a[n+i]=e}}return a}function Ee(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=Math.floor(s/2),l=Math.floor(r/2);for(let c=u;c<n-u;c++){const n=c*e;for(let c=l;c<e-l;c++){if(o&&!o[n+c])continue;let p=0;for(let o=0;o<s;o++)for(let s=0;s<r;s++)p+=t[n+c+(o-u)*e+s-l]*i[o*r+s];a[n+c]=p}}return a}var ze;Oe.set(_.none,[0,0,0,0,1,0,0,0,0]),Oe.set(_.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),Oe.set(_.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),Oe.set(_.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),Oe.set(_.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),Oe.set(_.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),Oe.set(_.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),Oe.set(_.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),Oe.set(_.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),Oe.set(_.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),Oe.set(_.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),Oe.set(_.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),Oe.set(_.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),Oe.set(_.smoothing5x5,[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]),Oe.set(_.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Oe.set(_.sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]),Oe.set(_.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),Oe.set(_.laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]),Oe.set(_.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),Oe.set(_.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),Oe.set(_.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),Oe.set(_.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),Oe.set(_.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let Ze=ze=class extends f{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(t){this._set("convolutionType",t);const e=Oe.get(t);if(!e||t===_.userDefined||t===_.none)return;const n=Math.sqrt(e.length);this._set("kernel",e),this._set("cols",n),this._set("rows",n)}clone(){return new ze({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:(0,o.d9)(this.raster)})}};(0,i._)([(0,a.Cb)({json:{type:Number,write:!0}})],Ze.prototype,"rows",void 0),(0,i._)([(0,a.Cb)({json:{type:Number,write:!0}})],Ze.prototype,"cols",void 0),(0,i._)([(0,a.Cb)({json:{name:"type",type:Number,write:!0}})],Ze.prototype,"convolutionType",null),(0,i._)([(0,a.Cb)({json:{type:[Number],write:!0}})],Ze.prototype,"kernel",void 0),Ze=ze=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ConvolutionFunctionArguments")],Ze);const Le=Ze;let Ve=class extends v{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(_).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==_.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const o=r.clone();o.pixelType=this.outputPixelType;const i=[_.none,_.sharpen,_.sharpen2,_.sharpening3x3,_.sharpening5x5];return"u8"===this.outputPixelType||i.includes(t)||(o.statistics=null,o.histograms=null),o.colormap=null,o.attributeTable=null,this.rasterInfo=o,{success:!0,supportsGPU:s.length<=25}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e||this.functionArguments.convolutionType===_.none)return e;let{kernel:n,rows:s,cols:r}=this.functionArguments;const o=n.reduce(((t,e)=>t+e));return 0!==o&&1!==o&&(n=n.map((t=>t/o))),function(t,e){const n=function(t){const e=Math.sqrt(t.length),n=t.slice(0,e),s=[1];for(let n=1;n<e;n++){let r=null;for(let s=0;s<e;s++){const o=t[s+n*e],i=t[s];if(null==r)if(0===i){if(o)return{separable:!1,row:null,col:null}}else r=o/i;else if(o/i!==r)return{separable:!1,row:null,col:null}}if(null==r)return{separable:!1,row:null,col:null};s.push(r)}return{separable:!0,row:n,col:s}}(e.kernel),s=!1!==e.mirrorEdges,r=n.separable?function(t,e,n,s=!0){const{pixels:r,width:o,height:i,pixelType:a,mask:u}=t,l=r.length,c=[],p=e.length,f=n.length,h=Math.floor(p/2),m=Math.floor(f/2);for(let t=0;t<l;t++){let a=De(r[t],o,i,h,u,e,!0);a=De(a,o,i,m,u,n,!1),s&&Ge(a,o,i,p,f),c.push(a)}return new y.Z({width:o,height:i,pixelType:a,pixels:c,mask:u})}(t,n.row,n.col,s):function(t,e,n=!0){const{pixels:s,width:r,height:o,pixelType:i,mask:a}=t,u=s.length,l=[],{kernel:c,rows:p,cols:f}=e;for(let t=0;t<u;t++){const e=Ee(s[t],r,o,p,f,a,c);n&&Ge(e,r,o,p,f),l.push(e)}return new y.Z({width:r,height:o,pixelType:i,pixels:l,mask:a})}(t,e,s),{outputPixelType:o}=e;return o&&r.clamp(o),r}(e,{kernel:n,rows:s,cols:r,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{kernel:t}=this.functionArguments;const e=t.reduce(((t,e)=>t+e));0!==e&&1!==e&&(t=t.map((t=>t/e)));const n=new Float32Array(25);return n.set(t),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:n,clampRange:(0,l.rL)(this.outputPixelType)}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Ve.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Le,json:{write:!0,name:"rasterFunctionArguments"}})],Ve.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Ve.prototype,"rasterArgumentNames",void 0),Ve=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ConvolutionFunction")],Ve);const Ue=Ve;var We;const qe=new Lt.X({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});let Xe=We=class extends f{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return qe.fromJSON(e.type??e.curvatureType??0)}clone(){return new We({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};(0,i._)([(0,a.Cb)({json:{write:{target:"type"}}}),(0,Zt.J)(qe)],Xe.prototype,"curvatureType",void 0),(0,i._)([(0,me.r)("curvatureType",["type","curvatureType"])],Xe.prototype,"readCurvatureType",null),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],Xe.prototype,"zFactor",void 0),Xe=We=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Xe);const Je=Xe;let $e=class extends v{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:o}=t,i=o?.[0],a=i??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*Dt._p:n;return(0,Dt.Ne)(e,{zFactor:u,curvatureType:s,resolution:a})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Dt._p:t}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],$e.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Je,json:{write:!0,name:"rasterFunctionArguments"}})],$e.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],$e.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],$e.prototype,"isGCS",void 0),$e=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.CurvatureFunction")],$e);const He=$e;var Ye;let Ke=Ye=class extends f{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Jt.CD.bestMatch}clone(){return new Ye({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],Ke.prototype,"bandIds",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ke.prototype,"bandNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ke.prototype,"bandWavelengths",void 0),(0,i._)([(0,Zt.J)({0:"name",1:"wavelength",2:"id"})],Ke.prototype,"method",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ke.prototype,"missingBandAction",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ke.prototype,"wavelengthMatchTolerance",void 0),Ke=Ye=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],Ke);const Qe=Ke;let tn=class extends v{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:o,bandIds:i,missingBandAction:a}=t,u=r?.length&&("name"===s||"id"!==s&&!i?.length),l=o?.length&&("wavelength"===s||"id"!==s&&!i?.length),c=a===Jt.CD.fail,p=u?this._matchBandNames(n,r):l?this._matchBandWavelengths(n,o,c):this._matchBandIds(n,i,c);if(null==p)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=n.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:h,histograms:m}=f;null!=h&&h.length&&(f.statistics=p.map((t=>h[t]||h[h.length-1]))),null!=m&&m.length&&(f.histograms=p.map((t=>m[t]||m[m.length-1])));let d=f.keyProperties?.BandProperties;return d?.length&&(d=p.map((t=>t>=d.length?d[d.length-1]:d[t])),f.keyProperties={...f.keyProperties,BandProperties:d}),this.rasterInfo=f,{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map((t=>t>=n?n-1:t));return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],0===t.length?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:Yt(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map((t=>t>=e?e-1:t)).map((e=>t[e]))}_matchBandNames(t,e){const n=t.bandInfos.map((({name:t})=>t.toLowerCase())),s=[];for(let t=0;t<e.length;t++){const r=e[t].toLowerCase();let o=n.indexOf(r);if(-1===o&&"nearinfrared"===r&&(o=n.findIndex((t=>t.startsWith("nearinfrared_1"))),-1===o&&(o=n.findIndex((t=>t.startsWith("nearinfrared"))))),-1===o)return null;s.push(o)}return s}_matchBandIds(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some((t=>t<0||t>=s))?null:e}_matchBandWavelengths(t,e,n){const{bandInfos:s}=t,r=[];for(let t=0;t<s.length;t++){const{minWavelength:e,maxWavelength:n}=s[t];if(!e||!n)return null;r.push({minWavelength:e,maxWavelength:n})}const{wavelengthMatchTolerance:o}=this.functionArguments,i=[];for(let t=0;t<e.length;t++){const s=e[t];let a=!1,u=-1,l=Number.MAX_VALUE;for(let t=0;t<r.length;t++){const e=r[t],n=s>=e.minWavelength&&s<=e.maxWavelength,o=Math.abs(s-(e.minWavelength+e.maxWavelength)/2);n?o<l&&(a=!0,u=t,l=o):!a&&o<l&&(u=t,l=o)}if(!a&&o&&l<o&&(a=!0),!a&&n)return null;i.push(u)}return i}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],tn.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Qe,json:{write:!0,name:"rasterFunctionArguments"}})],tn.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],tn.prototype,"rasterArgumentNames",void 0),tn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ExtractBandFunction")],tn);const en=tn;var nn;let sn=nn=class extends f{clone(){return new nn({conversionParameters:[...this.conversionParameters],raster:this.raster})}};(0,i._)([(0,a.Cb)({type:[Number],json:{write:!0}})],sn.prototype,"conversionParameters",void 0),sn=nn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.GrayscaleFunctionArguments")],sn);const rn=sn;let on=class extends v{constructor(){super(...arguments),this.functionName="Grayscale",this.functionArguments=null,this.rasterArgumentNames=["raster"]}get _noramlizedWeights(){const{conversionParameters:t}=this.functionArguments,e=t.reduce(((t,e)=>t+e));return t.map((t=>t/e))}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,e.statistics=null,e.histograms=null,e.colormap=null,e.attributeTable=null;const n=3===t.length||3===e.bandCount&&t.length>3;return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:function(t,e,n){const{pixels:s,width:r,height:o,mask:i,bandMasks:a}=t,u=r*o,c=a?.length?y.Z.combineBandMasks(a):i,p=Math.min(e.length,s.length),f=n.startsWith("f"),h=!f&&n!==t.pixelType,[m,d]=(0,l.rL)(n),g=y.Z.createEmptyBand(n,u);for(let t=0;t<o;t++){let n=t*r;for(let t=0;t<r;t++,n++)if(!c||c[n]){let t=0;for(let r=0;r<p;r++)t+=e[r]*s[r][n];f||(t=Math.round(t),h&&(t=t>d?d:t<m?m:t)),g[n]=t}}const b=new y.Z({width:r,height:o,pixels:[g],pixelType:n,mask:c});return b.updateStatistics(),b}(e,this._noramlizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._noramlizedWeights}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],on.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:rn,json:{write:!0,name:"rasterFunctionArguments"}})],on.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],on.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)()],on.prototype,"_noramlizedWeights",null),on=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.GrayscaleFunction")],on);const an=on;var un;let ln=un=class extends f{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map((t=>"number"==typeof t||"string"==typeof t?t:t.toJSON()))}clone(){return new un({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,o.d9)(this.rasters)})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],ln.prototype,"operation",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],ln.prototype,"rasters",void 0),(0,i._)([(0,Pe.c)("rasters")],ln.prototype,"writeRasters",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],ln.prototype,"processAsMultiband",void 0),ln=un=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.LocalFunctionArguments")],ln);const cn=ln;let pn=class extends v{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some((t=>t.bandCount!==n)))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:o}=this.functionArguments,i=F[r];if(!(999===i||o.length===i||o.length<=1&&1===i))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${i}`};const a=e.clone();return a.statistics=null,a.histograms=null,a.colormap=null,a.attributeTable=null,a.bandCount=999!==i||s?n:1,this._updateStatistics(a),this._updatePixelType(a),this.rasterInfo=a,{success:!0,supportsGPU:1===a.bandCount&&i<=3&&(r<11||r>16)}}_processPixels(t){const{pixelBlocks:e}=t;return null==e||e.some((t=>null==t))?null:kt(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=F[t],n=Object.keys(T).find((e=>T[e]===t))?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,o]=(0,l.rL)(s);const i=(0,l.DV)(s);return i&&(r-=1e-4,o+=1e-4),{imageCount:e,operationName:n,domainRange:[r,o],isOutputRounded:i}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=R(n)?.domain;if(s){t.statistics=[];for(let e=0;e<t.bandCount;e++)t.statistics[e]={min:s[0],max:s[1],avg:(s[0]+s[1])/2,stddev:(s[0]+s[1])/10}}else 45===n&&e.statistics?.length&&(t.statistics=e.statistics.map((t=>({min:-t.max,max:-t.min,avg:null!=t.avg?-t.avg:void 0,stddev:null!=t.stddev?-t.stddev:void 0}))))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:o}=R(s)??{domain:null,isInteger:!1};let i="f32";if(r&&o)i=(0,l.JQ)(r[0],r[1]);else if(30===s){const t=e?.[0];i=t?(0,l.JQ)(t.min,t.max):(0,l.DV)(n)?n:"s32"}else if(45===s&&(0,l.DV)(n)){const t=e?.map((({max:t})=>-t)),s=e?.map((({min:t})=>-t)),r=t?.length?Math.min(...t):null,o=s?.length?Math.min(...s):null;i=null!=r&&null!=o?(0,l.JQ)(r,o):n.startsWith("s")?n.replace("s","u"):"u1"===n||"u2"===n||"u4"===n?"s8":"u8"===n?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(i)}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],pn.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:cn,json:{write:!0,name:"rasterFunctionArguments"}})],pn.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],pn.prototype,"rasterArgumentNames",void 0),pn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.LocalFunction")],pn);const fn=pn;var hn,mn=n(22021);let dn=hn=class extends f{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Jt.DX.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map((t=>{if("number"==typeof t)return e=!0,[t];if("string"==typeof t){const n=t.trim().split(" ").filter((t=>""!==t.trim())).map((t=>Number(t)));return e=e||n.length>0,0===n.length?null:n}return null}));return e?n:null}clone(){return new hn({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],dn.prototype,"includedRanges",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],dn.prototype,"noDataValues",void 0),(0,i._)([(0,a.Cb)()],dn.prototype,"normalizedNoDataValues",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],dn.prototype,"noDataInterpretation",void 0),dn=hn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.MaskFunctionArguments")],dn);const gn=dn;let yn=class extends v{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let o=0;o<t.bandCount;o++){const t=(0,Jt.nA)(e,n?.slice(2*o,2*o+2),s?.[o]);if(null==t){r=null;break}r.push(t)}this.lookups=r;const o=null!=s&&s.every((t=>t?.length===s[0]?.length));return{success:!0,supportsGPU:(!n||n.length<=2*Jt.$f)&&(!s||o&&s[0].length<=Jt.$f)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:o,normalizedNoDataValues:i}=this.functionArguments,a=o===Jt.DX.matchAll;return(0,Jt.sS)(e,{includedRanges:r,noDataValues:i,outputPixelType:n,matchAll:a,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(Jt.$f);n.fill(mn.F3),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(Jt.$f);for(let e=0;e<s.length;e+=2)s[e]=t?.[e]??-mn.F3,s[e+1]=t?.[e+1]??mn.F3;return t&&t.length&&s.set(t),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:n,includedRanges:s}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],yn.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:gn,json:{write:!0,name:"rasterFunctionArguments"}})],yn.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],yn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],yn.prototype,"lookups",void 0),yn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.MaskFunction")],yn);const bn=yn;var xn;let wn=xn=class extends f{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this;return new xn({visibleBandID:t,infraredBandID:e,scientificOutput:n})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],wn.prototype,"visibleBandID",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],wn.prototype,"infraredBandID",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],wn.prototype,"scientificOutput",void 0),wn=xn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.NDVIFunctionArguments")],wn);const vn=wn;let _n=class extends v{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t,visibleBandID:e,infraredBandID:n}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const s=this.sourceRasterInfos[0],r=Math.max(e,n);if(s.bandCount<2||r>=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const o=s.clone();o.pixelType=this.outputPixelType,o.colormap=null,o.histograms=null,o.bandCount=1,o.keyProperties={...o.keyProperties,BandProperties:void 0};const[i,a,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return o.statistics=[{min:i,max:a,avg:u,stddev:l}],this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return function(t,e,n,s){const{mask:r,pixels:o,width:i,height:a}=t,u=o[n],l=o[e],c=l.length,p=s?new Uint8Array(c):new Float32Array(c),f=s?100:1,h=s?100.5:0;for(let t=0;t<c;t++)if(null==r||r[t]){const e=u[t],n=l[t],s=e+n;s&&(p[t]=(e-n)/s*f+h)}const m=new y.Z({width:i,height:a,mask:r,pixelType:s?"u8":"f32",pixels:[p]});return m.updateStatistics(),m}(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments;return{bandIndexMat3:Yt(this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0]),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map((e=>t[e]))}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],_n.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:vn,json:{write:!0,name:"rasterFunctionArguments"}})],_n.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],_n.prototype,"rasterArgumentNames",void 0),_n=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.NDVIFunction")],_n);const Cn=_n;var An;let Pn=An=class extends f{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new An({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],Pn.prototype,"inputRanges",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Pn.prototype,"outputValues",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Pn.prototype,"noDataRanges",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Pn.prototype,"allowUnmatched",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Pn.prototype,"isLastInputRangeInclusive",void 0),Pn=An=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.RemapFunctionArguments")],Pn);const Tn=Pn;let Nn=class extends v{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null,t.bandCount=1,t.attributeTable=null;const{statistics:n}=t,{allowUnmatched:s,outputValues:r,inputRanges:o,noDataRanges:i,isLastInputRangeInclusive:a}=this.functionArguments;if(null!=n&&n.length&&r?.length)if(s){const e=Math.min.apply(null,[...r,n[0].min]),s=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:e,max:s}]}else{let e=r[0],s=e;for(let t=0;t<r.length;t++)e=e>r[t]?r[t]:e,s=s>r[t]?s:r[t];t.statistics=[{...n[0],min:e,max:s}]}return this.rasterInfo=t,this.lookup=s?null:(0,Jt.oB)({srcPixelType:e,inputRanges:o,outputValues:r,noDataRanges:i,allowUnmatched:s,isLastInputRangeInclusive:a,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=Jt.$f)&&(!i||i.length<=Jt.$f)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:n,outputPixelType:s}=this;if(n){const t=(0,Jt.XV)(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return null!=t&&n.mask&&(t.mask=(0,Jt.wV)(e.pixels[0],e.mask,n.mask,n.offset,"u8")),t}const{inputRanges:r,outputValues:o,noDataRanges:i,allowUnmatched:a,isLastInputRangeInclusive:u}=this.functionArguments;return(0,Jt.a2)(e,{inputRanges:r,outputValues:o,noDataRanges:i,outputPixelType:s,allowUnmatched:a,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*Jt.$f),r=1e-5,o=this.functionArguments.inputRanges??[],i=this.functionArguments.outputValues??[],a=i.length;for(let t=0;t<Jt.$f;t++)s[3*t]=o[2*t]??mn.F3-1,s[3*t+1]=o[2*t+1]??mn.F3,s[3*t+2]=i[t]??0,t<a&&(t>0&&(s[3*t]-=r),(t<a-1||!n)&&(s[3*t+1]-=r));const u=new Float32Array(2*Jt.$f);return u.fill(mn.F3),e?.length&&u.set(e),{allowUnmatched:t,rangeMaps:s,noDataRanges:u,clampRange:(0,l.rL)(this.outputPixelType)}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Nn.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Tn,json:{write:!0,name:"rasterFunctionArguments"}})],Nn.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Nn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Nn.prototype,"lookup",void 0),Nn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.RemapFunction")],Nn);const Rn=Nn;var Fn;const In=new Lt.X({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let jn=Fn=class extends f{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new Fn({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,i._)([(0,Zt.J)(In)],jn.prototype,"slopeType",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],jn.prototype,"zFactor",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{name:"psPower",write:!0}})],jn.prototype,"pixelSizePower",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{name:"psZFactor",write:!0}})],jn.prototype,"pixelSizeFactor",void 0),(0,i._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],jn.prototype,"removeEdgeEffect",void 0),jn=Fn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],jn);const kn=jn;let Mn=class extends v{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.statistics="percent-rise"!==this.functionArguments.slopeType?[{min:0,max:90,avg:1,stddev:1}]:null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o}=this.functionArguments,{isGCS:i}=this,{extent:a,primaryPixelSizes:u}=t,l=u?.[0],c=l??(a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1});return(0,Dt.yg)(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o,isGCS:i,resolution:c})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Dt._p:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Mn.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:kn,json:{write:!0,name:"rasterFunctionArguments"}})],Mn.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Mn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Mn.prototype,"isGCS",void 0),Mn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.SlopeFunction")],Mn);const Sn=Mn,Bn=new Lt.X({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Gn(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{statisticsType:u,kernelRows:l,kernelCols:c}=e,p="stddev"===u,f=r*o,h=new Float64Array(f),m=new Float64Array(f),d=new Uint32Array(f);for(let t=0;t<o;t++){const e=t*r;let n=0,o=0,a=0;for(let t=0;t<c;t++)i&&!i[e+t]||(n+=s[e+t],p&&(o+=s[e+t]**2),a++);h[e]=n,m[e]=o,d[e]=a;for(let t=1;t<=r-c;t++){const r=e+t-1,u=r+c;i?(i[r]&&(a--,n-=s[r],p&&(o-=s[r]**2)),i[u]&&(a++,n+=s[u],p&&(o+=s[u]**2))):(n-=s[r],n+=s[u],p&&(o-=s[r]**2,o+=s[u]**2)),h[e+t]=n,d[e+t]=a,p&&(m[e+t]=o)}}const g=new Float64Array(f),y=new Float64Array(f),b=new Uint32Array(f),x=l*r;for(let t=0;t<=r-c;t++){let e=0,n=0,s=0;for(let o=0;o<l;o++){const i=o*r+t;e+=h[i],s+=d[i],p&&(n+=m[i])}g[t]=e,y[t]=n,b[t]=s;for(let i=1;i<=o-l;i++){const o=(i-1)*r+t,a=o+x;e-=h[o],e+=h[a],s-=d[o],s+=d[a],p&&(n-=m[o],n+=m[a]),g[i*r+t]=e,y[i*r+t]=n,b[i*r+t]=s}}const w=Math.floor(l/2),v=Math.floor(c/2);for(let t=w;t<o-w;t++){const e=t*r;for(let s=v;s<r-v;s++){const o=(t-w)*r+s-v,u=b[o];if(0===u||n&&(!i||i[e+s]))continue;const l=g[o]/u,c=p?Math.sqrt((y[o]-g[o]*l)/u):l;a[e+s]=c,i&&(i[e+s]=255)}}}function On(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:u,kernelCols:l,statisticsType:c}=e,p=Math.floor(u/2),f=Math.floor(l/2),h="min"===c,m=a.slice(),d=new Uint32Array(r*o);for(let t=p;t<o-p;t++){const e=t*r;for(let t=f;t<r-f;t++){let n=h?Number.MAX_VALUE:-Number.MAX_VALUE,o=0;for(let a=0;a<u;a++)for(let u=0;u<l;u++){const l=e+t+(a-p)*r+u-f;i&&!i[l]||(n=h?Math.min(n,s[l]):Math.max(n,s[l]),o++)}i?(m[e+t]=0===o?0:n,d[e+t]=o):a[e+t]=0===o?0:n}}if(i)for(let t=p;t<o-p;t++){const e=t*r;for(let t=f;t<r-f;t++)if(d[e+t]){if(n&&i[e+t])continue;a[e+t]=m[e+t],i[e+t]=255}}}function Dn(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:u,kernelCols:l}=e,c=Math.floor(u/2),p=Math.floor(l/2),f=a.slice(),h=new Uint32Array(r*o);for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++){if(n&&i&&i[e+t])continue;const o=[];for(let n=0;n<u;n++)for(let a=0;a<l;a++){const u=e+t+(n-c)*r+a-p;i&&!i[u]||o.push(s[u])}o.length&&(o.sort(((t,e)=>t-e)),i?(f[e+t]=o[Math.floor((o.length-1)/2)],h[e+t]=o.length):a[e+t]=o[Math.floor((o.length-1)/2)])}}if(i)for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++)if(h[e+t]){if(n&&i[e+t])continue;a[e+t]=f[e+t],i[e+t]=255}}}function En(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:u,kernelCols:l}=e,c=Math.floor(u/2),p=Math.floor(l/2),f="majority"===e.statisticsType,h=u*l,m=a.slice(),d=new Uint32Array(r*o);for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++){if(n&&i&&i[e+t])continue;const o=new Map;for(let n=0;n<u;n++)for(let a=0;a<l;a++){const u=e+t+(n-c)*r+a-p;if(i&&!i[u])continue;const l=s[u];o.set(l,o.has(l)?o.get(l)+1:1)}if(0===o.size)continue;let g=0,y=0,b=f?0:h+1;for(const t of o.keys())y=o.get(t),f===y>b&&(b=y,g=t);i?(m[e+t]=g,d[e+t]=o.size):a[e+t]=g}}if(i)for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++)if(d[e+t]){if(n&&i[e+t])continue;a[e+t]=m[e+t],i[e+t]=255}}}var zn;let Zn=zn=class extends f{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new zn({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:(0,o.d9)(this.raster)})}};(0,i._)([(0,a.Cb)({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],Zn.prototype,"rows",void 0),(0,i._)([(0,a.Cb)({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],Zn.prototype,"cols",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Zn.prototype,"fillNoDataOnly",void 0),(0,i._)([(0,a.Cb)({json:{read:{source:["statisticsType","type"],reader:(t,e)=>Bn.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),(0,Zt.J)(Bn)],Zn.prototype,"statisticsType",void 0),Zn=zn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],Zn);const Ln=Zn,Vn=new Set(["min","max","mean","median","majority","minority"]);let Un=class extends v{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return Vn.has(s)||(n.statistics=null,n.histograms=null,n.colormap=null,n.attributeTable=null),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:o}=this.functionArguments;return function(t,e){const{mask:n}=t,{fillNoDataOnly:s}=e;if(s&&!n)return t;const{pixels:r,width:o,height:i,bandMasks:a,pixelType:u}=t,l=r.length,c=o*i,p=[],{kernelRows:f,kernelCols:h,statisticsType:m,mirrorEdges:d}=e;if(s&&!n)return t;const g=e.outputPixelType??u,b=[];for(let t=0;t<l;t++){const u=r[t],l=y.Z.createEmptyBand(g,c);s&&l.set(u);const x=a?.[t]??n,w=x?.slice()??null,v={band:u,width:o,height:i,mask:w,outBand:l};switch(m){case"min":case"max":On(v,e);break;case"mean":case"stddev":Gn(v,e);break;case"median":Dn(v,e);break;case"majority":case"minority":En(v,e)}d&&!s&&Ge(l,o,i,f,h),p.push(l),w&&b.push(w)}let x=b[0]??n;b.length!==l&&(b.length=0),l>1&&a?.length&&(x=y.Z.combineBandMasks(a));const w=new y.Z({pixelType:g,width:o,height:i,pixels:p,bandMasks:a&&b.length?b:null,mask:x});return w.updateStatistics(),w}(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:o,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:(0,l.rL)(this.outputPixelType)}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Un.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Ln,json:{write:!0,name:"rasterFunctionArguments"}})],Un.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Un.prototype,"rasterArgumentNames",void 0),Un=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StatisticsFunction")],Un);const Wn=Un;var qn;let Xn=qn=class extends f{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach((t=>{const e={min:t.min,max:t.max,avg:t.avg??t.mean,stddev:t.stddev??t.standardDeviation};n.push(e)})),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach((t=>{const e={...t,mean:t.avg,standardDeviation:t.stddev};delete e.avg,delete e.stddev,s.push(e)})),e[n]=s}clone(){return new qn({statistics:(0,o.d9)(this.statistics),histograms:(0,o.d9)(this.histograms)})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],Xn.prototype,"statistics",void 0),(0,i._)([(0,me.r)("statistics")],Xn.prototype,"readStatistics",null),(0,i._)([(0,Pe.c)("statistics")],Xn.prototype,"writeStatistics",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],Xn.prototype,"histograms",void 0),Xn=qn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],Xn);const Jn=Xn;let $n=class extends v{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],$n.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Jn,json:{write:!0,name:"rasterFunctionArguments"}})],$n.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],$n.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],$n.prototype,"indexedColormap",void 0),(0,i._)([(0,a.Cb)()],$n.prototype,"isNoopProcess",void 0),$n=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],$n);const Hn=$n;var Yn;const Kn=new Lt.X({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let Qn=Yn=class extends f{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map((t=>[t.min,t.max,t.avg,t.stddev]))),e[n]=t)}clone(){return new Yn({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:(0,o.d9)(this.statistics),gamma:(0,o.d9)(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:(0,o.d9)(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};(0,i._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],Qn.prototype,"computeGamma",void 0),(0,i._)([(0,a.Cb)({type:Boolean,json:{name:"dra",write:!0}})],Qn.prototype,"dynamicRangeAdjustment",void 0),(0,i._)([(0,a.Cb)({type:[Number],json:{write:!0}})],Qn.prototype,"gamma",void 0),(0,i._)([(0,a.Cb)()],Qn.prototype,"histograms",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],Qn.prototype,"maxPercent",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],Qn.prototype,"minPercent",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],Qn.prototype,"numberOfStandardDeviations",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{name:"max",write:!0}})],Qn.prototype,"outputMax",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{name:"min",write:!0}})],Qn.prototype,"outputMin",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],Qn.prototype,"sigmoidStrengthLevel",void 0),(0,i._)([(0,a.Cb)({json:{type:[[Number]],write:!0}})],Qn.prototype,"statistics",void 0),(0,i._)([(0,Pe.c)("statistics")],Qn.prototype,"writeStatistics",null),(0,i._)([(0,Zt.J)(Kn)],Qn.prototype,"stretchType",void 0),(0,i._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],Qn.prototype,"useGamma",void 0),Qn=Yn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StretchFunctionArguments")],Qn);const ts=Qn;let es=class extends v{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:o}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const s=(0,Me.AV)(n.toJSON(),{rasterInfo:t}),i=(0,l.DV)(this.outputPixelType)?"round":"float";this.lookup=(0,Me.hE)({pixelType:e,...s,gamma:o?r:null,rounding:i}),this.cutOffs=s}else s||(this.cutOffs=(0,Me.AV)(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const i=t.clone();return i.pixelType=this.outputPixelType,i.statistics=null,i.histograms=null,i.colormap=null,i.attributeTable=null,"u8"===this.outputPixelType&&(i.keyProperties.DataType="processed"),this.rasterInfo=i,{success:!0,supportsGPU:!s}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{lookup:n}=this;if(n)return(0,Jt.XV)(e,{...n,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:s}=this,r=this.cutOffs||(0,Me.AV)(s.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),o=s.useGamma?s.gamma:null;return(0,Me.dy)(e,{...r,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:n,useGamma:s}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,o=s&&n?.length?(0,Me.um)(r,n):[1,1,1],{minCutOff:i,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===i.length&&(i[1]=i[2]=i[0],a[1]=a[2]=a[0]);const u=new Float32Array(r);let c;for(c=0;c<r;c++)u[c]=(e-t)/(a[c]-i[c]);const p=(0,l.DV)(this.outputPixelType);return{bandCount:r,outMin:t,outMax:e,minCutOff:i,maxCutOff:a,factor:u,useGamma:s,gamma:s&&n?n:[1,1,1],gammaCorrection:s&&o?o:[1,1,1],stretchType:this.functionArguments.stretchType,isOutputRounded:p,type:"stretch"}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],es.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:ts,json:{write:!0,name:"rasterFunctionArguments"}})],es.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],es.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],es.prototype,"lookup",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],es.prototype,"cutOffs",void 0),es=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StretchFunction")],es);const ns=es;var ss;let rs=ss=class extends f{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new ss({attributeTableAsRecordSet:(0,o.d9)(this.attributeTableAsRecordSet)})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],rs.prototype,"attributeTableAsRecordSet",void 0),rs=ss=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.TableFunctionArguments")],rs);const os=rs;let is=class extends v{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,"thematic"!==n.dataType&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],is.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:os,json:{write:!0,name:"rasterFunctionArguments"}})],is.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],is.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)()],is.prototype,"isNoopProcess",void 0),is=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.TableFunction")],is);const as=is,us=new Map;function ls(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster]).forEach((t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&ls(t,e))}))}function cs(t,e){if(e=e??{},"function"in(t=(0,o.d9)(t))&&"arguments"in t&&t.arguments){const n=ys(t,new Map,e);if(xs(n),!n.renderingRule)throw new r.Z("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return hs(t=fs(t),e);throw new r.Z("raster-function-helper","unsupported raster function json.")}function ps(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function fs(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const t in n){let e=n[t];const r=t.toLowerCase();if("rasters"===r&&Array.isArray(e))s.rasters=e.map((t=>ps(t)?fs(t):t));else switch(ps(e)&&(e=fs(e)),r){case"dra":s.dra=e;break;case"pspower":s.psPower=e;break;case"pszfactor":s.psZFactor=e;break;case"bandids":s.bandIds=e;break;default:s[t[0].toLowerCase()+t.slice(1)]=e}}return"Local"!==e||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function hs(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,o=t.outputPixelType?.toLowerCase();if(null==n||!us.has(n))throw new r.Z("raster-function-helper",`unsupported raster function: ${n}`);const i=us.get(n),a=("function"==typeof i.ctor?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:o}),{rasterArgumentNames:u}=a,l=[],c=function(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map((e=>t[e]))}(s,u),p="rasters"===u[0],f=[];for(let t=0;t<c.length;t++){const n=c[t];let s;null==n||"string"==typeof n&&n.startsWith("$")?l.push(e?.raster):"string"==typeof n?e[n]&&l.push(e[n]):"number"!=typeof n&&"rasterFunction"in n&&(s=hs(n,e),p||(a.functionArguments[u[t]]=s),l.push(s)),p&&f.push(s??n)}if(p&&(a.functionArguments.rasters=f),e){a.sourceRasters=l;const t=e.raster?.url;t&&(a.mainPrimaryRasterId=t)}return a}function ms(t,e){if(t&&e)for(const n in t){const s=t[n];s&&"object"==typeof s&&"type"in s&&("RasterFunctionTemplate"===s.type?ms(s.arguments,e):"RasterFunctionVariable"===s.type&&null!=e[s.name]&&(s.value=e[s.name]))}}function ds(t,e){if(!t||"object"!=typeof t)return t;const{value:n}=t;if(!n||"object"!=typeof n)return t.isDataset?"$$":n;if(Array.isArray(n))return 0===n.length?[]:n.map((t=>"object"==typeof t&&"RasterFunctionVariable"===t.type?ds(t,e):t));if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&"Scalar"!==n.type)return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=gs(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(gs)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let s=0;s<n.elements.length;s++){const o=n.elements[s],{type:i}=o;if(i)if("RasterFunctionTemplate"===i){const{renderingRule:n}=ys(o,e);t.push(n),null!=o._object_id&&e.set(o._object_id,n)}else{if("RasterFunctionVariable"!==i)throw new r.Z("raster-function-helper","unsupported raster function json.");{const n=ds(o,e);t.push(n),null!=o._object_id&&e.set(o._object_id,n)}}else t.push(o)}s=t}else s=n.elements}return null!=n._object_id&&e.set(n._object_id,s),s}function gs(t){const e=t.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:r}=t;if(!Array.isArray(n)){const{r:t,g:e,b:r}=(0,s.xr)({h:n.Hue,s:n.Saturation,v:n.Value});n=[t,e,r,n.AlphaValue]}if(!Array.isArray(r)){const{r:t,g:e,b:n}=(0,s.xr)({h:r.Hue,s:r.Saturation,v:r.Value});r=[t,e,n,r.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:n,toColor:r}}function ys(t,e,n){n&&ms(t,n);const s={renderingRule:{},templates:e};return bs(t,s),s}function bs(t,e){if(!t||!e.renderingRule)return;const{renderingRule:n,templates:s}=e,{function:r,arguments:o,_object_id:i}=t;if(!r||!o)return;null!=i&&s.set(i,n),n.rasterFunction=r.type.replace("Function",""),n.outputPixelType=r.pixelType;const a={};n.rasterFunctionArguments=a;for(const t in o){if("type"===t||"object_id"===t||"_object_ref_id"===t)continue;const e=o[t];e&&"object"==typeof e&&"type"in e&&("RasterFunctionTemplate"===e.type||"RasterFunctionVariable"===e.type)?("RasterFunctionVariable"===e.type?a[t]=ds(e,s):(n.rasterFunctionArguments[t]={},bs(e,{renderingRule:n.rasterFunctionArguments[t],templates:s})),null!=e._object_id&&s.set(e._object_id,a[t])):a[t]=e}switch(a.DEM&&!a.Raster&&(a.Raster=a.DEM,delete a.DEM),n.rasterFunction){case"Stretch":!function(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map((t=>[t.min,t.max,t.mean,t.standardDeviation]))),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}(a);break;case"Colormap":!function(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}(a);break;case"Convolution":!function(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}(a);break;case"Mask":!function(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter((t=>""!==t)).map((t=>Number(t))))}(a)}}function xs(t){const{renderingRule:e,templates:n}=t;if("object"!=typeof e||!e?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:s}=e;for(const t in s){const e=s[t],o="_object_ref_id"===t?e:e&&"object"==typeof e&&"_object_ref_id"in e?e._object_ref_id:null;if(null==o)e&&"object"==typeof e&&(e.rasterFunctionArguments&&xs({renderingRule:e,templates:n}),Array.isArray(e)&&e.forEach(((t,s)=>{if("object"==typeof t)if(null!=t._object_ref_id){if(!n.has(t._object_ref_id))throw new r.Z("raster-function-helper",`unsupported raster function json. _object_ref_id: ${e} does not exist`);const i=n.get(o);i&&"object"==typeof i?Object.assign(t,i):e[s]=i}else xs({renderingRule:t,templates:n})})));else{if(!n.has(o))throw new r.Z("raster-function-helper",`unsupported raster function json. _object_ref_id: ${o} does not exist`);const e=n.get(o);"_object_ref_id"!==t?s[t]=e:e&&"object"==typeof e&&Object.assign(s,e)}}}us.set("Arithmetic",{desc:"Arithmetic Function",ctor:St,rasterArgumentNames:["rasters"]}),us.set("Aspect",{desc:"Aspect Function",ctor:zt,rasterArgumentNames:["raster"]}),us.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:re,rasterArgumentNames:["raster"]}),us.set("Colormap",{desc:"Colormap Function",ctor:Ce,rasterArgumentNames:["raster"]}),us.set("CompositeBand",{desc:"CompositeBand Function",ctor:Fe,rasterArgumentNames:["rasters"]}),us.set("Convolution",{desc:"Convolution Function",ctor:Ue,rasterArgumentNames:["raster"]}),us.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Be,rasterArgumentNames:["raster"]}),us.set("ExtractBand",{desc:"ExtractBand Function",ctor:en,rasterArgumentNames:["raster"]}),us.set("Curvature",{desc:"Curvature Function",ctor:He,rasterArgumentNames:["raster"]}),us.set("Grayscale",{desc:"Grayscale Function",ctor:an,rasterArgumentNames:["raster"]}),us.set("Clip",{desc:"Clip Function",ctor:fe,rasterArgumentNames:["raster"]}),us.set("Local",{desc:"Local Function",ctor:fn,rasterArgumentNames:["rasters"]}),us.set("Mask",{desc:"Mask Function",ctor:bn,rasterArgumentNames:["raster"]}),us.set("NDVI",{desc:"NDVI Function",ctor:Cn,rasterArgumentNames:["raster"]}),us.set("Remap",{desc:"Remap Function",ctor:Rn,rasterArgumentNames:["raster"]}),us.set("Slope",{desc:"Slope Function",ctor:Sn,rasterArgumentNames:["raster"]}),us.set("Statistics",{desc:"Focal Statistics Function",ctor:Wn,rasterArgumentNames:["raster"]}),us.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:Hn,rasterArgumentNames:["raster"]}),us.set("Stretch",{desc:"Stretch Function",ctor:ns,rasterArgumentNames:["raster"]}),us.set("Table",{desc:"Attribute Table Function",ctor:as,rasterArgumentNames:["raster"]})},73506:(t,e,n)=>{n.d(e,{Fi:()=>q,Hq:()=>Z,Mk:()=>d,P_:()=>L,Qp:()=>V,VO:()=>T,Wt:()=>G,kr:()=>X,nF:()=>R,tB:()=>B,ut:()=>D,zD:()=>P}),n(66577);var s,r,o=n(67676),i=n(20102),a=n(67900),u=n(83305),l=n(73615),c=n(8744),p=n(6570),f=n(94139),h=n(38913),m=n(82971);function d(t,e,n){return!(0,l.canProjectWithoutEngine)(t,e,n)}function g(t,e,n){const s=d(t,e,n);if(s&&!(0,l.isLoaded)())throw new i.Z("rasterprojectionhelper-project","projection engine is not loaded");return s}(r=s||(s={}))[r.None=0]="None",r[r.North=1]="North",r[r.South=2]="South",r[r.Both=3]="Both";const y=(t,e,n,s=0)=>{if(1===n[0])return[0,0];let r=1,o=-1,i=1,a=-1;for(let e=0;e<t.length;e+=2)isNaN(t[e])||(r=r>t[e]?t[e]:r,o=o>t[e]?o:t[e],i=i>t[e+1]?t[e+1]:i,a=a>t[e+1]?a:t[e+1]);const{cols:u,rows:l}=e,c=(o-r)/u/n[0],p=(a-i)/l/n[1],f=2*s;let h=0,m=!1,d=[0,0];for(let e=0;e<u-3;e++){for(let n=0;n<l-3;n++){const s=e*l*2+2*n,r=(t[s]+t[s+4]+t[s+4*l]+t[s+4*l+4])/4,o=(t[s+1]+t[s+5]+t[s+4*l+1]+t[s+4*l+5])/4,i=Math.abs((r-t[s+2*l+2])/c),a=Math.abs((o-t[s+2*l+3])/p);if(i+a>h&&(h=i+a,d=[i,a]),f&&h>f){m=!0;break}}if(m)break}return d},b={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},x=32,w=4,v=w,_=new Map,C=new Map,A=500;async function P(){(0,l.isLoaded)()||await(0,l.load)()}function T(t,e,n,s=null){const r=t.spatialReference;if(r.equals(e))return t;g(r,e,s);const o=n.center,i=new p.Z({xmin:o.x-t.x/2,xmax:o.x+t.x/2,ymin:o.y-t.y/2,ymax:o.y+t.y/2,spatialReference:r}),u=(0,l.project)(i,e,s),c=D(e);let f;if(null==u||null!=c&&u.width>=c){const n=(0,a.c9)(r)/(0,a.c9)(e);f={x:t.x*n,y:t.y*n}}else f={x:u.width,y:u.height};return f}function N(t,e=.01){return(0,a.c9)(t)?e/(0,a.c9)(t):0}function R(t,e,n=null,s=!0){const r=t.spatialReference;if(r.equals(e))return t;g(r,e,n);const o=(0,l.project)(t,e,n);return s&&o?(F([t],[o],r,e),o):o}function F(t,e,n,s){const r=E(n,!0),o=E(s,!0),i=N(n,A),a=N(s,A);if(i&&null!=r&&null!=o)for(let n=0;n<t.length;n++){const s=e[n];if(!s)continue;const{x:u}=t[n],{x:l}=s;l>=o[1]-a&&Math.abs(u-r[0])<i?s.x-=o[1]-o[0]:l<=o[0]+a&&Math.abs(u-r[1])<i&&(s.x+=o[1]-o[0])}}function I(t){const{inSR:e,outSR:n,datumTransformation:s,preferPE:r}=t;if(e.equals(n)){const{points:e}=S(t,null);return e}if(e.isWebMercator&&n.isWGS84||e.isWGS84&&n.isWebMercator)return function(t){const{cols:e,rows:n,xres:s,yres:r,usePixelCenter:o,inSR:i,outSR:a}=t;let{xmin:u,ymax:c}=t;o&&(u+=s/2,c-=r/2);const p=[],h=[],m=Math.max(e,n);for(let t=0;t<m;t++){const o=u+s*Math.min(e,t),m=c-r*Math.min(n,t),d=(0,l.project)(new f.Z({x:o,y:m,spatialReference:i}),a);t<=e&&p.push(d.x),t<=n&&h.push(d.y)}const d=[];for(let t=0;t<e;t++)for(let e=0;e<n;e++)d.push([p[t],h[e]]);return d}(t);if(g(e,n,s)&&r){if(e.isGeographic)return j(t);if(null!=k(e))return j(t)}return function(t){const{points:e}=S(t,null),{inSR:n,outSR:s,datumTransformation:r}=t,o=e.map((t=>new f.Z(t[0],t[1],n))),i=(0,l.project)(o,s,r);return r&&F(o,i,n,s),i.map((t=>t?[t.x,t.y]:[NaN,NaN]))}(t)}function j(t){const{inSR:e,outSR:n,datumTransformation:s}=t,r=k(e),{points:o,mask:i}=S(t,r);if(!e.isGeographic){const t=e.wkid?u.P.coordsys(e.wkid):u.P.fromString(e.isGeographic?u.a.PE_TYPE_GEOGCS:u.a.PE_TYPE_PROJCS,e.wkt2||e.wkt);u.g.projToGeog(t,o.length,o)}if(null!=s&&s.steps.length){let t;const e=179.9955;if(n.isGeographic&&(t=o.map((([t])=>t>e?1:t<-e?-1:0))),s.steps.forEach((t=>{const e=t.wkid?u.P.geogtran(t.wkid):u.P.fromString(u.a.PE_TYPE_GEOGTRAN,t.wkt);u.h.geogToGeog(e,o.length,o,null,t.isInverse?u.a.PE_TRANSFORM_2_TO_1:u.a.PE_TRANSFORM_1_TO_2)})),t)for(let n=0;n<o.length;n++){const s=t[n],r=o[n][0],i=r>e?1:r<-e?-1:0;s&&i&&s!==i&&(o[n][0]=s>0?r+360:r-360)}}if(!n.isGeographic){const t=k(n,!0),e=null!=t&&t.isEnvelope?[t.bbox[1],t.bbox[3]]:[-90,90];!function(t,e){const[n,s]=e;for(let e=0;e<t.length;e++){const r=t[e][1];(r<n||r>s)&&(t[e]=[NaN,NaN])}}(o,e);const s=n.wkid?u.P.coordsys(n.wkid):u.P.fromString(n.isGeographic?u.a.PE_TYPE_GEOGCS:u.a.PE_TYPE_PROJCS,n.wkt2||n.wkt);u.g.geogToProj(s,o.length,o)}let a=o;if(i&&o.length!==i.length){a=[];for(let t=0,e=0;t<i.length;t++)i[t]?a.push(o[e++]):a.push([NaN,NaN])}return a}function k(t,e=!1){let n=t.wkid||t.wkt2||t.wkt;if(!n||t.isGeographic)return null;if(n=String(n),_.has(n)){const t=_.get(n);return e?t?.gcs:t?.pcs}const s=t.wkid?u.P.coordsys(t.wkid):u.P.fromString(t.isGeographic?u.a.PE_TYPE_GEOGCS:u.a.PE_TYPE_PROJCS,t.wkt2||t.wkt),r=M(s,N(t,1e-4)),o=M(s,0,!0);return _.set(n,{pcs:r,gcs:o}),e?o:r}function M(t,e=0,n=!1){const s=u.j.generate(t),r=n?t.horizonGcsGenerate():t.horizonPcsGenerate();if(!s||!r?.length)return null;let o=!1,i=r.find((t=>1===t.getInclusive()&&1===t.getKind()));if(!i){if(i=r.find((t=>1===t.getInclusive()&&0===t.getKind())),!i)return null;o=!0}const a=n?0:(2===s.getNorthPoleLocation()?1:0)|(2===s.getSouthPoleLocation()?2:0),l=s.isPannableRectangle(),c=i.getCoord();if(o)return{isEnvelope:o,isPannable:l,vertices:c,coef:null,bbox:[c[0][0]-e,c[0][1]-e,c[1][0]+e,c[1][1]+e],poleLocation:a};let p=0;const f=[];let[h,m]=c[0],[d,g]=c[0];for(let t=0,e=c.length;t<e;t++){p++,p===e&&(p=0);const[n,s]=c[t],[r,o]=c[p];if(o===s)f.push([n,r,s,o,2]);else{const t=(r-n)/(o-s||1e-4),e=n-t*s;s<o?f.push([t,e,s,o,0]):f.push([t,e,o,s,1])}h=h<n?h:n,m=m<s?m:s,d=d>n?d:n,g=g>s?g:s}return{isEnvelope:!1,isPannable:l,vertices:c,coef:f,bbox:[h,m,d,g],poleLocation:a}}function S(t,e){const n=[],{cols:s,rows:r,xres:o,yres:i,usePixelCenter:a}=t;let{xmin:u,ymax:l}=t;if(a&&(u+=o/2,l-=i/2),null==e){for(let t=0;t<s;t++)for(let e=0;e<r;e++)n.push([u+o*t,l-i*e]);return{points:n}}const c=new Uint8Array(s*r);if(e.isEnvelope){const{bbox:[t,a,p,f]}=e;for(let h=0,m=0;h<s;h++){const s=u+o*h,d=e.isPannable||s>=t&&s<=p;for(let t=0;t<r;t++,m++){const e=l-i*t;d&&e>=a&&e<=f&&(n.push([s,e]),c[m]=1)}}return{points:n,mask:c}}const p=e.coef,f=[];for(let t=0;t<r;t++){const e=l-i*t,n=[],s=[];for(let t=0;t<p.length;t++){const[r,o,i,a,u]=p[t];if(e===i&&i===a)n.push(r),n.push(o),s.push(2),s.push(2);else if(e>=i&&e<=a){const t=r*e+o;n.push(t),s.push(u)}}let r=n;if(n.length>2){let t=2===s[0]?0:s[0],e=n[0];r=[];for(let o=1;o<s.length;o++)2===s[o]&&o!==s.length-1||(s[o]!==t&&(r.push(0===t?Math.min(e,n[o-1]):Math.max(e,n[o-1])),t=s[o],e=n[o]),o===s.length-1&&r.push(0===s[o]?Math.min(e,n[o]):Math.max(e,n[o])));r.sort(((t,e)=>t-e))}else n[0]>n[1]&&(r=[n[1],n[0]]);f.push(r)}for(let t=0,e=0;t<s;t++){const s=u+o*t;for(let t=0;t<r;t++,e++){const r=l-i*t,o=f[t];if(2===o.length)s>=o[0]&&s<=o[1]&&(n.push([s,r]),c[e]=1);else if(o.length>2){let t=!1;for(let e=0;e<o.length;e+=2)if(s>=o[e]&&s<=o[e+1]){t=!0;break}t&&(n.push([s,r]),c[e]=1)}}}return{points:n,mask:c}}function B(t,e,n=null,r=!0){const i=t.spatialReference;if(i.equals(e))return t;const a=Z(t),u=D(i,!0),c=D(e);if(0===a||null==u||null==c){const o=O(t,e,n,r);if(null==u&&null!=c&&Math.abs(o.width-c)<N(e)&&(0,l.isLoaded)()){const n=k(i);if(null!=n&&n.poleLocation===s.None&&t.width<(n.bbox[2]-n.bbox[0])/2)return function(t,e){const n=D(e);if(null==n)return null;let{xmin:s,ymin:r,xmax:o,ymax:i}=t;const a=t.spatialReference,u=new h.Z({spatialReference:a,rings:[[[s,r],[o,r],[o,i],[s,i],[s,r]]]}),c=(0,l.project)(u,e);if(2!==c.rings.length||!c.rings[0].length||!c.rings[1].length)return null;const{rings:f}=c,m=N(a),d=new p.Z({spatialReference:e});for(let t=0;t<2;t++){s=o=f[t][0][0],r=i=f[t][0][1];for(let e=0;e<f[t].length;e++)s=s>f[t][e][0]?f[t][e][0]:s,o=o<f[t][e][0]?f[t][e][0]:o,r=r>f[t][e][1]?f[t][e][1]:r,i=i<f[t][e][1]?f[t][e][1]:i;if(0===t)d.ymin=r,d.ymax=i,d.xmin=s,d.xmax=o;else if(d.ymin=Math.min(d.ymin,r),d.ymax=Math.max(d.ymax,i),Math.abs(o-n/2)<m)d.xmin=s,d.xmax=d.xmax+n;else{if(!(Math.abs(s+n/2)<m))return null;d.xmax=o+n}}return d}(t,e)||o}return o}const f=t.clone().normalize();if(1===f.length&&t.xmax<u&&t.xmax-u/2>N(i)){const{xmin:e,xmax:n}=t;for(let s=0;s<=a;s++){const r=0===s?e:-u/2,o=s===a?n-u*s:u/2;f[s]=new p.Z({xmin:r,xmax:o,ymin:t.ymin,ymax:t.ymax,spatialReference:i})}}return function(t,e){const n=D(t[0].spatialReference);if(t.length<2||null==n)return t[0];if(e=e??N(t[0].spatialReference),1===(t=t.filter((t=>t.width>e))).length)return t[0];let{xmin:s,xmax:r,ymin:o,ymax:i}=t[0];for(let e=1;e<t.length;e++){const s=t[e];r=s.xmax+n*e,o=Math.min(o,s.ymin),i=Math.max(i,s.ymax)}return new p.Z({xmin:s,xmax:r,ymin:o,ymax:i,spatialReference:t[0].spatialReference})}(f.map((t=>O(t,e,n,r))).filter(o.pC))}function G(t,e,n){if("extent"===t.type){const{xmin:e,ymin:n,xmax:s,ymax:r,spatialReference:o}=t;t=new h.Z({rings:[[[e,r],[s,r],[s,n],[e,n],[e,r]]],spatialReference:o})}return t.spatialReference.equals(e)?t:(g(t.spatialReference,e,n),(0,l.project)(t,e,n))}function O(t,e,n=null,s=!0,r=!0){const o=t.spatialReference;if(o.equals(e)||!e)return t;g(o,e,n);const i=(0,l.project)(t,e,n);if(r&&e.isWebMercator&&i&&(i.ymax=Math.min(20037508.342787,i.ymax),i.ymin=Math.max(-20037508.342787,i.ymin),i.ymin>=i.ymax))return null;if(!s||!i)return i;const a=E(o,!0),u=E(e,!0);if(null==a||null==u)return i;const c=N(o,.001),p=N(o,A),h=N(e,.001);if(Math.abs(i.xmin-u[0])<h&&Math.abs(i.xmax-u[1])<h){const s=Math.abs(t.xmin-a[0]),r=Math.abs(a[1]-t.xmax);if(s<c&&r>p){i.xmin=u[0];const s=[];s.push(new f.Z(t.xmax,t.ymin,o)),s.push(new f.Z(t.xmax,(t.ymin+t.ymax)/2,o)),s.push(new f.Z(t.xmax,t.ymax,o));const r=s.map((t=>R(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));i.xmax=Math.max.apply(null,r)}if(r<c&&s>p){i.xmax=u[1];const s=[];s.push(new f.Z(t.xmin,t.ymin,o)),s.push(new f.Z(t.xmin,(t.ymin+t.ymax)/2,o)),s.push(new f.Z(t.xmin,t.ymax,o));const r=s.map((t=>R(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));i.xmin=Math.min.apply(null,r)}}else{const t=N(e,.001);Math.abs(i.xmin-u[0])<t&&(i.xmin=u[0]),Math.abs(i.xmax-u[1])<t&&(i.xmax=u[1])}return i}function D(t,e=!1){if(!t)return null;const n=e?20037508.342787:20037508.342788905;return t.isWebMercator?2*n:t.wkid&&t.isGeographic?360:2*b[t.wkid]||null}function E(t,e=!1){if(t.isGeographic)return[-180,180];const n=D(t,e);return null!=n?[-n/2,n/2]:null}function z(t,e,n,s){let r=(t-e)/n;return r-Math.floor(r)!=0?r=Math.floor(r):s&&(r-=1),r}function Z(t,e=!1){const n=D(t.spatialReference);if(null==n)return 0;const s=e?0:-n/2,r=N(t.spatialReference),o=!e&&Math.abs(t.xmax-n/2)<r?n/2:t.xmax,i=!e&&Math.abs(t.xmin+n/2)<r?-n/2:t.xmin;return z(o,s,n,!0)-z(i,s,n,!1)}function L(t){const e=t.storageInfo.origin.x,n=D(t.spatialReference,!0);if(null==n)return{originX:e,halfWorldWidth:null,pyramidsInfo:null};const s=n/2,{nativePixelSize:r,storageInfo:o,extent:i}=t,{maximumPyramidLevel:a,blockWidth:u,pyramidScalingFactor:l}=o;let c=r.x;const p=[],f=null!=t.transform&&"gcs-shift"===t.transform.type,h=e+(f?0:s),m=f?n-e:s-e;for(let t=0;t<=a;t++){const t=(i.xmax-e)/c/u,n=t-Math.floor(t)==0?t:Math.ceil(t),s=m/c/u,r=s-Math.floor(s)==0?s:Math.ceil(s),o=Math.floor(h/c/u),a=Math.round(h/c)%u,f=(u-Math.round(m/c)%u)%u;p.push({resolutionX:c,blockWidth:u,datsetColumnCount:n,worldColumnCountFromOrigin:r,leftMargin:a,rightPadding:f,originColumnOffset:o}),c*=l}return{originX:e,halfWorldWidth:s,pyramidsInfo:p,hasGCSSShiftTransform:f}}function V(t){const e=t.isAdaptive&&null==t.spacing;let n=t.spacing||[x,x],s=U(t),r={cols:s.size[0]+1,rows:s.size[1]+1};const o=s.outofBoundPointCount>0&&s.outofBoundPointCount<s.offsets.length/2;let i=s.outofBoundPointCount===s.offsets.length/2||e&&o?[0,0]:y(s.offsets,r,n,v);const a=(i[0]+i[1])/2,l=t.projectedExtent.spatialReference,c=t.srcBufferExtent.spatialReference;if(e&&(o||a>v)&&(d(l,c,t.datumTransformation)&&(l.isGeographic||k(l)),n=[w,w],s=U({...t,spacing:n}),r={cols:s.size[0]+1,rows:s.size[1]+1},i=y(s.offsets,r,n,v)),s.error=i,n[0]>1&&(s.coefficients=W(s.offsets,r,o)),t.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:n};else{const e=k(l);if(null!=e&&!e.isEnvelope){const e=function(t){if(!t||t.isGeographic)return t;const e=String(t.wkid||t.wkt2||t.wkt);let n;return C.has(e)?n=C.get(e):(n=(t.wkid?u.P.coordsys(t.wkid):u.P.fromString(u.a.PE_TYPE_PROJCS,t.wkt2||t.wkt)).getGeogcs().getCode(),C.set(e,n)),new m.Z({wkid:n})}(l),i=B(t.projectedExtent,e),{offsets:a}=U({...t,srcBufferExtent:i,spacing:n}),c=W(a,r,o);s.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return s}function U(t){const{projectedExtent:e,srcBufferExtent:n,pixelSize:s,datumTransformation:r,rasterTransform:o}=t,i=e.spatialReference,a=n.spatialReference,u=g(i,a),{xmin:l,ymin:c,xmax:p,ymax:h}=e,m=D(a),d=null!=m&&(t.hasWrapAround||"gcs-shift"===o?.type),y=t.spacing||[x,x],b=y[0]*s.x,v=y[1]*s.y,_=1===y[0],C=Math.ceil((p-l)/b-.1/y[0])+(_?0:1),P=Math.ceil((h-c)/v-.1/y[1])+(_?0:1),T=I({cols:C,rows:P,xmin:l,ymax:h,xres:b,yres:v,inSR:i,outSR:a,datumTransformation:r,preferPE:y[0]<=w,usePixelCenter:_}),R=[];let F,j=0;const M=_?-1:NaN,{xmin:S,xmax:B,ymax:G,width:O,height:E}=n,z=N(a,A),Z=null!=m&&S>0&&B>m/2;let L=!1;if(u){const t=k(i);L=null!=t&&t.poleLocation>0}for(let t=0;t<C;t++){const e=[];for(let n=0;n<P;n++){let s=T[t*P+n];if(d&&s[0]>B&&s[0]>m/2-z?s[0]-=m:d&&0===t&&s[0]<0&&Z&&!o&&(s[0]+=m),!s||isNaN(s[0])||isNaN(s[1]))R.push(M),R.push(M),e.push(null),j++;else{if(o){const t=o.inverseTransform(new f.Z({x:s[0],y:s[1],spatialReference:a}));s=[t.x,t.y]}e.push(s),t>0&&d&&F[n]&&s[0]<F[n][0]&&(s[0]+=m,L&&s[0]>B&&s[0]>m&&(s[0]-=m)),R.push((s[0]-S)/O),R.push((G-s[1])/E)}}F=e}return{offsets:R,error:null,coefficients:null,outofBoundPointCount:j,spacing:y,size:_?[C,P]:[C-1,P-1]}}function W(t,e,n){const{cols:s,rows:r}=e,o=new Float32Array((s-1)*(r-1)*2*6),i=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let e=0;e<s-1;e++){for(let n=0;n<r-1;n++){let u=e*r*2+2*n;const l=t[u],c=t[u+1],p=t[u+2],f=t[u+3];u+=2*r;const h=t[u],m=t[u+1],d=t[u+2],g=t[u+3];let y=0,b=12*(n*(s-1)+e);for(let t=0;t<3;t++)o[b++]=i[y++]*l+i[y++]*p+i[y++]*d;y=0;for(let t=0;t<3;t++)o[b++]=i[y++]*c+i[y++]*f+i[y++]*g;y=0;for(let t=0;t<3;t++)o[b++]=a[y++]*l+a[y++]*h+a[y++]*d;y=0;for(let t=0;t<3;t++)o[b++]=a[y++]*c+a[y++]*m+a[y++]*g}if(n)for(let t=0;t<o.length;t++)isNaN(o[t])&&(o[t]=-1)}return o}function q(t){const{spatialReference:e}=t,n=(0,c.C5)(e);if(!n)return t;const[s,r]=n.valid,o=r-s;let i=0;if(t.xmin<s){const e=s-t.xmin;i=Math.ceil(e/o)}else if(t.xmin>r){const e=t.xmin-r;i=-Math.ceil(e/o)}return new p.Z({spatialReference:t.spatialReference,xmin:t.xmin+i*o,ymin:t.ymin,xmax:t.xmax+i*o,ymax:t.ymax})}function X(t,e,n){const{storageInfo:s,pixelSize:r}=e;let o=0,i=!1;const{pyramidResolutions:u}=s,l="mixed"===s.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,s.tileInfo.dpi/96)):1,c=(t.x+t.y)/2/l;if(null!=u&&u.length){const t=u[u.length-1],s=(t.x+t.y)/2,l=(r.x+r.y)/2;if(c<=l)o=0;else if(c>=s)o=u.length,i=c/s>8;else{let t,e=l;for(let s=1;s<=u.length;s++){if(t=(u[s-1].x+u[s-1].y)/2,c<=t){c===t?o=s:"down"===n?(o=s-1,i=c/e>8):o="up"===n||c-e>t-c||c/e>2?s:s-1;break}e=t}}const p=0===o?r:u[o-1];return i&&Math.min(p.x,p.y)*(0,a.c9)(e.spatialReference)>19567&&(i=!1),{pyramidLevel:o,pyramidResolution:new f.Z({x:p.x,y:p.y,spatialReference:e.spatialReference}),excessiveReading:i}}const p=Math.log(t.x/r.x)/Math.LN2,h=Math.log(t.y/r.y)/Math.LN2,m=e.storageInfo.maximumPyramidLevel||0;o="down"===n?Math.floor(Math.min(p,h)):"up"===n?Math.ceil(Math.max(p,h)):Math.round((p+h)/2),o<0?o=0:o>m&&(i=o>m+3,o=m);const d=2**o;return{pyramidLevel:o,pyramidResolution:new f.Z({x:d*e.nativePixelSize.x,y:d*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:i}}},48700:(t,e,n)=>{n.d(e,{Z:()=>u});var s=n(43697),r=n(96674),o=n(5600),i=(n(80442),n(92604),n(77734),n(52011));let a=class extends r.wq{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};(0,s._)([(0,o.Cb)()],a.prototype,"affectsPixelSize",null),(0,s._)([(0,o.Cb)({json:{write:!0}})],a.prototype,"spatialReference",void 0),a=(0,s._)([(0,i.j)("esri.layers.support.rasterTransforms.BaseRasterTransform")],a);const u=a},29680:(t,e,n)=>{n.d(e,{Z:()=>c});var s,r=n(43697),o=n(5600),i=(n(80442),n(92604),n(77734),n(36030)),a=n(52011),u=n(48700);let l=s=class extends u.Z{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return"point"===(t=t.clone()).type?(t.x>180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return"point"===(t=t.clone()).type?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}clone(){return new s({tolerance:this.tolerance})}};(0,r._)([(0,i.J)({GCSShiftXform:"gcs-shift"})],l.prototype,"type",void 0),(0,r._)([(0,o.Cb)()],l.prototype,"tolerance",void 0),l=s=(0,r._)([(0,a.j)("esri.layers.support.rasterTransforms.GCSShiftTransform")],l);const c=l},87390:(t,e,n)=>{n.d(e,{Z:()=>g});var s,r=n(43697),o=(n(66577),n(5600)),i=(n(80442),n(92604),n(77734),n(36030)),a=n(71715),u=n(52011),l=n(30556),c=n(48700),p=n(94139),f=n(6570);function h(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(2===n){const e=s*s,n=r*r,o=s*r;return{x:t[0]+s*t[2]+r*t[4]+e*t[6]+o*t[8]+n*t[10],y:t[1]+s*t[3]+r*t[5]+e*t[7]+o*t[9]+n*t[11]}}const o=s*s,i=r*r,a=s*r,u=o*s,l=o*r,c=s*i,p=r*i;return{x:t[0]+s*t[2]+r*t[4]+o*t[6]+a*t[8]+i*t[10]+u*t[12]+l*t[14]+c*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+o*t[7]+a*t[9]+i*t[11]+u*t[13]+l*t[15]+c*t[17]+p*t[19]}}function m(t,e,n){const{xmin:s,ymin:r,xmax:o,ymax:i,spatialReference:a}=e;let u=[];if(n<2)u.push({x:s,y:i}),u.push({x:o,y:i}),u.push({x:s,y:r}),u.push({x:o,y:r});else{let t=10;for(let e=0;e<t;e++)u.push({x:s,y:r+(i-r)*e/(t-1)}),u.push({x:o,y:r+(i-r)*e/(t-1)});t=8;for(let e=1;e<=t;e++)u.push({x:s+(o-s)*e/t,y:r}),u.push({x:s+(o-s)*e/t,y:i})}u=u.map((e=>h(t,e,n)));const l=u.map((t=>t.x)),c=u.map((t=>t.y));return new f.Z({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,c),ymax:Math.max.apply(null,c),spatialReference:a})}let d=s=class extends c.Z{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let t=0;t<n.length;t++)r.push(n[t]),r.push(s[t]);return r}writeForwardCoefficients(t,e,n){const s=[],r=[];for(let e=0;e<t?.length;e++)e%2==0?s.push(t[e]):r.push(t[e]);e.coeffX=s,e.coeffY=r}get inverseCoefficients(){let t=this._get("inverseCoefficients");const e=this._get("forwardCoefficients");return!t&&e&&this.polynomialOrder<2&&(t=function(t){const[e,n,s,r,o,i]=t,a=s*i-o*r,u=o*r-s*i;return[(o*n-e*i)/a,(s*n-e*r)/u,i/a,r/u,-o/a,-s/u]}(e)),t}set inverseCoefficients(t){this._set("inverseCoefficients",t)}readInverseCoefficients(t,e){const{inverseCoeffX:n,inverseCoeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let t=0;t<n.length;t++)r.push(n[t]),r.push(s[t]);return r}writeInverseCoefficients(t,e,n){const s=[],r=[];for(let e=0;e<t?.length;e++)e%2==0?s.push(t[e]):r.push(t[e]);e.inverseCoeffX=s,e.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(t){if("point"===t.type){const e=h(this.forwardCoefficients,t,this.polynomialOrder);return new p.Z({x:e.x,y:e.y,spatialReference:t.spatialReference})}return m(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if("point"===t.type){const e=h(this.inverseCoefficients,t,this.polynomialOrder);return new p.Z({x:e.x,y:e.y,spatialReference:t.spatialReference})}return m(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new s({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r._)([(0,o.Cb)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,r._)([(0,o.Cb)()],d.prototype,"forwardCoefficients",void 0),(0,r._)([(0,a.r)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,r._)([(0,l.c)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,r._)([(0,o.Cb)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,r._)([(0,a.r)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,r._)([(0,l.c)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,r._)([(0,o.Cb)()],d.prototype,"affectsPixelSize",null),(0,r._)([(0,i.J)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=s=(0,r._)([(0,u.j)("esri.layers.support.rasterTransforms.PolynomialTransform")],d);const g=d},87521:(t,e,n)=>{n.d(e,{j:()=>m,c:()=>d});var s,r=n(29680),o=n(43697),i=(n(92604),n(80442),n(77734),n(20102),n(36030)),a=n(52011),u=n(48700);let l=s=class extends u.Z{constructor(){super(...arguments),this.type="identity"}clone(){return new s}};(0,o._)([(0,i.J)({IdentityXform:"identity"})],l.prototype,"type",void 0),l=s=(0,o._)([(0,a.j)("esri.layers.support.rasterTransforms.IdentityTransform")],l);const c=l;var p=n(87390);const f={GCSShiftXform:r.Z,IdentityXform:c,PolynomialXform:p.Z},h=Object.keys(f);function m(t){const e=t?.type;return!t||h.includes(e)}function d(t){const e=t?.type;if(!e)return null;const n=f[t?.type];if(n){const e=new n;return e.read(t),e}return null}}}]);