@arcgis/core 6.0.0-next.33 → 6.0.0-next.34

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 (142) hide show
  1. package/README.md +2 -2
  2. package/applications/Urban/meshUtils.d.ts +1 -0
  3. package/applications/Urban/meshUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{f3dc0bc0e00635855a7a.js → 03daf6f235c6edef6268.js} +1 -1
  6. package/assets/esri/core/workers/chunks/04a1d08c3b5b1dc7628f.js +1 -0
  7. package/assets/esri/core/workers/chunks/{1eaf8bfdd3765a90ccc2.js → 0523f893870a1546d7d9.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{72d20d3957d612f86431.js → 0a508e25ec05363e1f04.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{84038dd85005fea413eb.js → 139e753d95cfc9470e74.js} +1 -1
  10. package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +1 -0
  11. package/assets/esri/core/workers/chunks/{418addce122dbb8897b4.js → 1a614bac5db42c6263f8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{58c3ae6030def2ed5f31.js → 1b17f5f720f6cf3f6d73.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f9dc38761b314d33890f.js → 1f51567f47c2e2fc8a23.js} +1 -1
  14. package/assets/esri/core/workers/chunks/2211ff0a1f1ae8100231.js +1 -0
  15. package/assets/esri/core/workers/chunks/24ada9511b074dc5ae27.js +1 -0
  16. package/assets/esri/core/workers/chunks/29c610ce1c81ebb84a6b.js +1 -0
  17. package/assets/esri/core/workers/chunks/2b4dd42920d37b1ff0a9.js +2 -0
  18. package/assets/esri/core/workers/chunks/2c8ca43563c4f3e94535.js +1 -0
  19. package/assets/esri/core/workers/chunks/{55a9eaeb152a3abada67.js → 311e4969f19df63451dd.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{8da2a10318f49d0dc73a.js → 31ef7b7074b3e3829763.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{360c944c610efa2051fc.js → 379db67f78161ebd5468.js} +2 -2
  22. package/assets/esri/core/workers/chunks/{b8fd7c3b36981261378b.js → 38df7b1d58c4bcf693d0.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{be55771758e4bcef0976.js → 3e406043a374ee17475b.js} +1 -1
  24. package/assets/esri/core/workers/chunks/46c290108a90518ef695.js +1 -0
  25. package/assets/esri/core/workers/chunks/{a596779eaeec7310671d.js → 478a89317a12e9b4d146.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{fcc3902d6d9eda6f09f5.js → 48b8b57f559a53c6c513.js} +1 -1
  27. package/assets/esri/core/workers/chunks/4f3e0d583cfa9d1d6727.js +2 -0
  28. package/assets/esri/core/workers/chunks/507ecc3692e6d0700958.js +1 -0
  29. package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js → 5864bce1498a13ee5b7e.js} +2 -2
  30. package/assets/esri/core/workers/chunks/{f4d91d470ca5fea0bd26.js → 5bd1414220e42cb8ebcf.js} +1 -1
  31. package/assets/esri/core/workers/chunks/5c3aa8386705c5e40358.js +1 -0
  32. package/assets/esri/core/workers/chunks/{176d75e76318bfc25a53.js → 60c8eedd06080edab3e3.js} +1 -1
  33. package/assets/esri/core/workers/chunks/661847f1b7044f21600f.js +1 -0
  34. package/assets/esri/core/workers/chunks/{1a8d8274df292d65f82e.js → 676c8c0329d68f9f3ac4.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{29cc6b1705418b1be5d7.js → 687deb918eb48a963c8f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{0694c7bcfe71692e2ccf.js → 723df53cfa0189837d01.js} +1 -1
  37. package/assets/esri/core/workers/chunks/7582654a0fc70910731c.js +1 -0
  38. package/assets/esri/core/workers/chunks/{1ee4df0fd61440cb5f02.js → 7810586c35dfe1437516.js} +1 -1
  39. package/assets/esri/core/workers/chunks/8517d96fc8ba7b21d845.js +2 -0
  40. package/assets/esri/core/workers/chunks/90360c0bd053d3e3fd77.js +1 -0
  41. package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +1 -0
  42. package/assets/esri/core/workers/chunks/{0e445ec3523de9f2dfa2.js → a107f16cd004626b5018.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{e3b212f8af448ec29eef.js → a1e8209d00809c9520a0.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{46453ebfee17b5421d9d.js → bf62be00f3040f91aaee.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{89dc49e784f7ba3b93ea.js → c034c30e577d620b8e28.js} +1 -1
  46. package/assets/esri/core/workers/chunks/c5bf19da62a3d31009fe.js +2 -0
  47. package/assets/esri/core/workers/chunks/{2226c20c38e20713bcb5.js.LICENSE.txt → c5bf19da62a3d31009fe.js.LICENSE.txt} +1 -1
  48. package/assets/esri/core/workers/chunks/{6bb191b19ce43a27f205.js → caad4f475d6eb01c2850.js} +1 -1
  49. package/assets/esri/core/workers/chunks/cd55cad81accf51d2989.js +1 -0
  50. package/assets/esri/core/workers/chunks/db1f7b2562de495b3401.js +2 -0
  51. package/assets/esri/core/workers/chunks/e0a37d3bcb9a944e53dd.js +1 -0
  52. package/assets/esri/core/workers/chunks/{fe6dcb21570395e46ce8.js → e0a7a75709121a26f255.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{096b2bf1c0d69d27f20c.js → e8e54faf947a582b4cf7.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{636e9c4ac1f9ae98f9d1.js → ea81f9d71b0842a4be26.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js → eaa0e906b46ae4c84d72.js} +2 -2
  56. package/assets/esri/core/workers/chunks/{a504a5e06cb89a620799.js → ec8b7476eac4718eb0ac.js} +1 -1
  57. package/chunks/GlobalIllumination.glsl.js +55 -46
  58. package/chunks/GlobalIlluminationBlur.glsl.js +13 -9
  59. package/chunks/RibbonLine.glsl.js +90 -88
  60. package/config.js +1 -1
  61. package/core/has.js +1 -1
  62. package/core/workers.d.ts +1 -0
  63. package/geometry/support/MeshLocalVertexSpace.d.ts +3 -3
  64. package/geometry/support/aaBoundingRect.js +1 -1
  65. package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
  66. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  67. package/identity/IdentityManagerBase.js +1 -1
  68. package/kernel.d.ts +3 -3
  69. package/kernel.js +1 -1
  70. package/layers/VoxelWasmPerSceneView.js +1 -1
  71. package/layers/WFSLayer.d.ts +8 -4
  72. package/layers/graphics/sources/WFSSource.js +1 -1
  73. package/layers/graphics/sources/geojson/geojson.js +1 -1
  74. package/layers/mixins/ArcGISMapService.d.ts +17 -0
  75. package/layers/mixins/ArcGISMapService.js +1 -1
  76. package/layers/ogc/wfsUtils.d.ts +7 -2
  77. package/layers/ogc/wfsUtils.js +1 -1
  78. package/layers/ogc/xmlUtils.js +1 -1
  79. package/package.json +4 -4
  80. package/rest/route.d.ts +1 -1
  81. package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
  82. package/rest/support/LengthsParameters.d.ts +1 -1
  83. package/symbols/TextSymbol.d.ts +0 -1
  84. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  85. package/views/3d/FocusAreasView.js +1 -1
  86. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  87. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  88. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  89. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  90. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  91. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  92. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  93. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  94. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  95. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  96. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  97. package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
  98. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  99. package/views/3d/state/ScreenSizePerspective.js +1 -1
  100. package/views/3d/state/ViewStateManager.js +1 -1
  101. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  102. package/views/3d/support/RenderCoordsHelper.js +1 -1
  103. package/views/3d/terrain/TerrainRenderer.js +1 -1
  104. package/views/3d/terrain/TerrainSurface.js +1 -1
  105. package/views/3d/terrain/TileRenderer.js +1 -1
  106. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  107. package/views/3d/webgl-engine/lib/NavigationDepthCache.js +1 -1
  108. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  109. package/views/3d/webgl-engine/lib/RibbonLineVertexInfo.js +1 -1
  110. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  111. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  112. package/views/SceneView.js +1 -1
  113. package/views/webgl/BufferObject.js +1 -1
  114. package/views/webgl/FramebufferObject.js +1 -1
  115. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  116. package/widgets/HistogramRangeSlider.d.ts +1 -1
  117. package/assets/esri/core/workers/chunks/0cc7fba402a93e6d2455.js +0 -2
  118. package/assets/esri/core/workers/chunks/131185d26343a997495e.js +0 -1
  119. package/assets/esri/core/workers/chunks/1a3f71c4d97c36050030.js +0 -1
  120. package/assets/esri/core/workers/chunks/2226c20c38e20713bcb5.js +0 -2
  121. package/assets/esri/core/workers/chunks/2981e904ab62f3ed80d0.js +0 -2
  122. package/assets/esri/core/workers/chunks/32cc59e126df8c96a0cf.js +0 -2
  123. package/assets/esri/core/workers/chunks/5bb6c255bdc8aa9ba23e.js +0 -1
  124. package/assets/esri/core/workers/chunks/654f5441227579d2b6b4.js +0 -1
  125. package/assets/esri/core/workers/chunks/7084dd6e10c6c1393e92.js +0 -1
  126. package/assets/esri/core/workers/chunks/7566321c6a2913f2852b.js +0 -1
  127. package/assets/esri/core/workers/chunks/7b5cd150a4d0139850be.js +0 -1
  128. package/assets/esri/core/workers/chunks/7cc9d7a88b64e25fce14.js +0 -1
  129. package/assets/esri/core/workers/chunks/844eedda8f749972f707.js +0 -2
  130. package/assets/esri/core/workers/chunks/87177e0f82e8a6ae3189.js +0 -1
  131. package/assets/esri/core/workers/chunks/9976eaa81085c0d17e14.js +0 -1
  132. package/assets/esri/core/workers/chunks/a2196a49f89d57a0a1c7.js +0 -1
  133. package/assets/esri/core/workers/chunks/aba259a70bee68d2edb7.js +0 -1
  134. package/assets/esri/core/workers/chunks/b9cb92858a576eb6aa06.js +0 -1
  135. package/assets/esri/core/workers/chunks/c33a9635c294c8774977.js +0 -1
  136. package/assets/esri/core/workers/chunks/f39c700f3db7db52b522.js +0 -1
  137. /package/assets/esri/core/workers/chunks/{844eedda8f749972f707.js.LICENSE.txt → 2b4dd42920d37b1ff0a9.js.LICENSE.txt} +0 -0
  138. /package/assets/esri/core/workers/chunks/{32cc59e126df8c96a0cf.js.LICENSE.txt → 4f3e0d583cfa9d1d6727.js.LICENSE.txt} +0 -0
  139. /package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js.LICENSE.txt → 5864bce1498a13ee5b7e.js.LICENSE.txt} +0 -0
  140. /package/assets/esri/core/workers/chunks/{0cc7fba402a93e6d2455.js.LICENSE.txt → 8517d96fc8ba7b21d845.js.LICENSE.txt} +0 -0
  141. /package/assets/esri/core/workers/chunks/{2981e904ab62f3ed80d0.js.LICENSE.txt → db1f7b2562de495b3401.js.LICENSE.txt} +0 -0
  142. /package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js.LICENSE.txt → eaa0e906b46ae4c84d72.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2258],{50867(e,t,r){r.d(t,{a:()=>i,b:()=>c,l:()=>l,n:()=>u,t:()=>n}),r(44208);var s=r(72727);function i(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,i=4,n=i){let u=(0,s.k)(e.length,i,4),f=(0,s.k)(t.length,n,4),l=Math.min(u,f),c=r[0],o=r[1],y=r[2],h=r[3],p=r[4],a=r[5],d=r[6],B=r[7],E=r[8],m=0,T=0;for(let r=0;r<l;r++){let r=t[m],s=t[m+1],u=t[m+2],f=t[m+3];e[T]=c*r+h*s+d*u,e[T+1]=o*r+p*s+B*u,e[T+2]=y*r+a*s+E*u,e[T+3]=f,m+=n,T+=i}}function u(e,t){let r=Math.min(e.count,t.count),s=e.typedBuffer,i=e.typedBufferStride,n=t.typedBuffer,u=t.typedBufferStride;for(let e=0;e<r;e++){let t=e*i,r=e*u,f=n[r],l=n[r+1],c=n[r+2],o=f*f+l*l+c*c;if(o>0){let e=1/Math.sqrt(o);s[t]=e*f,s[t+1]=e*l,s[t+2]=e*c}}}function f(e,t,r,s=4){let i=Math.min(e.length/s,t.count),n=t.typedBuffer,u=t.typedBufferStride,f=0,l=0;for(let t=0;t<i;t++)e[l]=r*n[f],e[l+1]=r*n[f+1],e[l+2]=r*n[f+2],e[l+3]=r*n[f+3],f+=u,l+=s}function l(e,t,r,s){c(e.typedBuffer,t,r,s,e.typedBufferStride)}function c(e,t,r,s,i=4){let n=Math.min(e.length/i,t.count),u=t.typedBuffer,f=t.typedBufferStride,l=0,c=0,o=1/2.2;for(let t=0;t<n;t++)e[c]=s*(r*u[l])**o,e[c+1]=s*(r*u[l+1])**o,e[c+2]=s*(r*u[l+2])**o,e[c+3]=s*r*u[l+3],l+=f,c+=i}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:l,normalize:u,scale:f,scaleView:function(e,t,r){f(e.typedBuffer,t,r,e.typedBufferStride)},transformMat3:n,transformMat3View:i,transformMat4:function(e,t,r,i=4,n=i){let u=(0,s.k)(e.length,i,4),f=(0,s.k)(t.length,n,4),l=Math.min(u,f),c=r[0],o=r[1],y=r[2],h=r[3],p=r[4],a=r[5],d=r[6],B=r[7],E=r[8],m=r[9],T=r[10],g=r[11],S=r[12],A=r[13],x=r[14],M=r[15],b=0,_=0;for(let r=0;r<l;r++){let r=t[b],s=t[b+1],u=t[b+2],f=t[b+3];e[_]=c*r+p*s+E*u+S*f,e[_+1]=o*r+a*s+m*u+A*f,e[_+2]=y*r+d*s+T*u+x*f,e[_+3]=h*r+B*s+g*u+M*f,b+=n,_+=i}},transformMat4View:function(e,t,r){let i=e.typedBuffer,n=e.typedBufferStride,u=t.typedBuffer,f=t.typedBufferStride,l=(0,s.k)(i.length,n,4),c=(0,s.k)(u.length,f,4),o=Math.min(l,c),y=r[0],h=r[1],p=r[2],a=r[3],d=r[4],B=r[5],E=r[6],m=r[7],T=r[8],g=r[9],S=r[10],A=r[11],x=r[12],M=r[13],b=r[14],_=r[15];for(let e=0;e<o;e++){let t=e*n,r=e*f,s=u[r],l=u[r+1],c=u[r+2],o=u[r+3];i[t]=y*s+d*l+T*c+x*o,i[t+1]=h*s+B*l+g*c+M*o,i[t+2]=p*s+E*l+S*c+b*o,i[t+3]=a*s+m*l+A*c+_*o}}},Symbol.toStringTag,{value:"Module"}))},13030(e,t,r){r.d(t,{Y$:()=>B,XW:()=>d,qB:()=>w,Qt:()=>K,My:()=>J,bf:()=>q,jZ:()=>x,j0:()=>M,Sx:()=>b,E$:()=>_,Qy:()=>se,h:()=>P,P:()=>O,SL:()=>F,dy:()=>te,ES:()=>ie,gH:()=>m,ZD:()=>E,si:()=>C,mJ:()=>G,UL:()=>Q,D6:()=>z,Yi:()=>Y,An:()=>k,LC:()=>R,xs:()=>g,EC:()=>T,Xm:()=>v,Vp:()=>D,zD:()=>W,m8:()=>Z,nS:()=>U,H$:()=>X,eI:()=>N,td:()=>re,Eq:()=>A,jz:()=>S,Aj:()=>L,E7:()=>H,Y4:()=>ee,TX:()=>$,Uz:()=>I,ml:()=>j,XP:()=>V});var s=r(34727),i=r(37585),n=r(48163),u=r(78955),f=r(91829);class l{static{this.ElementCount=9}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=9;let n=this.TypedArrayConstructor;void 0===s&&(s=9*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<9;e++)t[e]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<9;e++)this.typedBuffer[r++]=t[e]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){let s=this.typedBuffer,i=t.typedBuffer,n=e*this.typedBufferStride,u=r*t.typedBufferStride;for(let e=0;e<9;++e)s[n++]=i[u++]}get buffer(){return this.typedBuffer.buffer}}class c{static{this.ElementCount=16}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=16;let n=this.TypedArrayConstructor;void 0===s&&(s=16*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<16;e++)t[e]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<16;e++)this.typedBuffer[r++]=t[e]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){this.copyFromTypedBuffer(e,t.typedBuffer,r*t.typedBufferStride)}copyFromTypedBuffer(e,t,r){let s=this.typedBuffer,i=e*this.typedBufferStride;for(let e=0;e<16;++e)s[i++]=t[r++]}get buffer(){return this.typedBuffer.buffer}}class o{static{this.ElementCount=1}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=1;let n=this.TypedArrayConstructor;void 0===s&&(s=n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}class y{static{this.ElementCount=2}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=2;let n=this.TypedArrayConstructor;void 0===s&&(s=2*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,i.hZ)(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=r}copyFrom(e,t,r){let s=this.typedBuffer,i=t.typedBuffer,n=e*this.typedBufferStride,u=r*t.typedBufferStride;s[n++]=i[u++],s[n]=i[u]}get buffer(){return this.typedBuffer.buffer}}var h=r(35522);class p{static{this.ElementCount=3}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=3;let n=this.TypedArrayConstructor;void 0===s&&(s=3*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,h.hZ)(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e]=s}copyFrom(e,t,r){let s=this.typedBuffer,i=t.typedBuffer,n=e*this.typedBufferStride,u=r*t.typedBufferStride;s[n++]=i[u++],s[n++]=i[u++],s[n]=i[u]}get buffer(){return this.typedBuffer.buffer}}class a{static{this.ElementCount=4}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;let n=this.TypedArrayConstructor;void 0===s&&(s=4*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,u.hZ)(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=s,this.typedBuffer[e]=i}copyFrom(e,t,r){let s=this.typedBuffer,i=t.typedBuffer,n=e*this.typedBufferStride,u=r*t.typedBufferStride;s[n++]=i[u++],s[n++]=i[u++],s[n++]=i[u++],s[n]=i[u]}get buffer(){return this.typedBuffer.buffer}}class d extends o{constructor(e,t=0,r,s){super(Float16Array,e,t,r,s),this.elementType="f16"}static{this.ElementType="f16"}}class B extends o{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static{this.ElementType="f32"}}class E extends y{constructor(e,t=0,r,s){super(Float16Array,e,t,r,s),this.elementType="f16"}slice(e,t){return this.sliceBuffer(E,e,t)}static{this.ElementType="f16"}}class m extends y{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(m,e,t)}static{this.ElementType="f32"}}class T extends p{constructor(e,t=0,r,s){super(Float16Array,e,t,r,s),this.elementType="f16"}slice(e,t){return this.sliceBuffer(T,e,t)}static{this.ElementType="f16"}}class g extends p{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class S extends a{constructor(e,t=0,r,s){super(Float16Array,e,t,r,s),this.elementType="f16"}slice(e,t){return this.sliceBuffer(S,e,t)}static{this.ElementType="f16"}}class A extends a{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(A,e,t)}static{this.ElementType="f32"}}class x extends l{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(x,e,t)}static{this.ElementType="f32"}}class M extends l{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(M,e,t)}static{this.ElementType="f64"}}class b extends c{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(b,e,t)}static{this.ElementType="f32"}}class _ extends c{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(_,e,t)}static{this.ElementType="f64"}}class w extends o{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(w,e,t)}static{this.ElementType="f64"}}class C extends y{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(C,e,t)}static{this.ElementType="f64"}}class v extends p{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class L extends a{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(L,e,t)}static{this.ElementType="f64"}}class F extends o{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(F,e,t)}static{this.ElementType="u8"}}class R extends y{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(R,e,t)}static{this.ElementType="u8"}}class N extends p{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class V extends a{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(V,e,t)}static{this.ElementType="u8"}}class P extends o{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(P,e,t)}static{this.ElementType="u16"}}class Y extends y{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(Y,e,t)}static{this.ElementType="u16"}}class U extends p{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(U,e,t)}static{this.ElementType="u16"}}class I extends a{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(I,e,t)}static{this.ElementType="u16"}}class O extends o{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(O,e,t)}static{this.ElementType="u32"}}class k extends y{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(k,e,t)}static{this.ElementType="u32"}}class X extends p{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(X,e,t)}static{this.ElementType="u32"}}class j extends a{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(j,e,t)}static{this.ElementType="u32"}}class q extends o{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(q,e,t)}static{this.ElementType="i8"}}class z extends y{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(z,e,t)}static{this.ElementType="i8"}}class Z extends p{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(Z,e,t)}static{this.ElementType="i8"}}class $ extends a{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer($,e,t)}static{this.ElementType="i8"}}class K extends o{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static{this.ElementType="i16"}}class G extends y{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(G,e,t)}static{this.ElementType="i16"}}class D extends p{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(D,e,t)}static{this.ElementType="i16"}}class H extends a{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(H,e,t)}static{this.ElementType="i16"}}class J extends o{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(J,e,t)}static{this.ElementType="i32"}}class Q extends y{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Q,e,t)}static{this.ElementType="i32"}}class W extends p{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(W,e,t)}static{this.ElementType="i32"}}class ee extends a{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(ee,e,t)}static{this.ElementType="i32"}}class te extends F{constructor(e,t=0,r,s){super(e,t,r,s)}get(e){return this.typedBuffer[e*this.typedBufferStride]/255}set(e,t){this.typedBuffer[e*this.typedBufferStride]=Math.round(255*(0,s.qE)(t,0,1))}slice(e,t){return this.sliceBuffer(te,e,t)}}class re extends V{constructor(e,t=0,r,s){super(e,t,r,s)}getVec(e,t){return(0,u.hs)(t,super.getVec(e,t),1/255)}setVec(e,t){(0,u.jk)(ue,(0,u.T9)(ue,t,f.uY),f.Un),(0,u.hs)(ue,ue,255),(0,u.LI)(ue,ue),super.setVec(e,ue)}get(e,t){return super.get(e,t)/255}set(e,t,r){super.set(e,t,Math.round(255*(0,s.qE)(r,0,1)))}setValues(e,t,r,s,i){(0,u.hZ)(ue,t,r,s,i),this.setVec(e,ue)}slice(e,t){return this.sliceBuffer(re,e,t)}}class se extends K{constructor(e,t=0,r,s){super(e,t,r,s)}get(e){return Math.max(super.get(e)/32767,-1)}set(e,t){super.set(e,Math.round(32767*(0,s.qE)(t,-1,1)))}slice(e,t){return this.sliceBuffer(se,e,t)}}class ie extends G{constructor(e,t=0,r,s){super(e,t,r,s)}getVec(e,t){return(0,i.hZ)(ne,-1,-1),(0,i.T9)(t,(0,i.hs)(t,super.getVec(e,t),1/32767),ne)}setVec(e,t){(0,i.qE)(ne,t,n.IA,n.Un),(0,i.hs)(ne,ne,32767),(0,i.LI)(ne,ne),super.setVec(e,ne)}get(e,t){return Math.max(super.get(e,t)/32767,-1)}set(e,t,r){super.set(e,t,Math.round(32767*(0,s.qE)(r,-1,1)))}setValues(e,t,r){(0,i.hZ)(ne,t,r),this.setVec(e,ne)}slice(e,t){return this.sliceBuffer(ie,e,t)}}const ne=(0,n.vt)(),ue=(0,f.vt)()},22141(e,t,r){r.d(t,{$5:()=>A,CN:()=>m,KM:()=>M,Mv:()=>_,X4:()=>T,gr:()=>S,qs:()=>x,si:()=>g,xA:()=>b});var s=r(34727),i=r(77690),n=r(29242),u=r(58083),f=r(9093),l=r(35522),c=r(51850),o=r(73941),y=r(48353),h=r(9762),p=(r(79258),r(21325)),a=r(28735),d=r(13030),B=r(73354),E=r(50867);function m(e,t,r,s){e.error(`Failed to project from (wkid:${t.wkid}) to (wkid:${r.wkid}).${s?" ":""}${s}`)}function T(e,t,r,s,i,n){return C(0,d.xs.fromTypedArray(e),0,d.Xm.fromTypedArray(t),r,d.Xm.fromTypedArray(s),i,d.xs.fromTypedArray(n))?n:null}function g(e,t,r,s,i,n){return C(1,d.xs.fromTypedArray(e),0,d.Xm.fromTypedArray(t),r,d.Xm.fromTypedArray(s),i,d.xs.fromTypedArray(n))?n:null}function S(e,t,r,s){return(0,h.projectBuffer)(e,t,0,r,s,0)?r:null}function A(e,t,r,s){return(0,h.projectBuffer)(e,t,0,r,s,0)?r:null}function x(e,t,r){return(0,i.Ge)(R,r),(0,B.b)(t,e,R),(0,s.or)(R)&&(0,B.n)(t,t),t}function M(e,t,r){return(0,i.z0)(R,r),(0,E.t)(t,e,R),(0,s.or)(R)&&(0,B.n)(t,t,4),t}function b(e,t,r,s,i,n){if(!C(0,d.xs.fromTypedArray(e,4*Float32Array.BYTES_PER_ELEMENT),1,d.Xm.fromTypedArray(t),r,d.Xm.fromTypedArray(s),i,d.xs.fromTypedArray(n,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let t=3;t<e.length;t+=4)n[t]=e[t];return n}function _(e,t,r,s,i,n){if(!C(1,d.xs.fromTypedArray(e,16),1,d.Xm.fromTypedArray(t),r,d.Xm.fromTypedArray(s),i,d.xs.fromTypedArray(n,16)))return null;for(let t=3;t<e.length;t+=4)n[t]=e[t];return n}function w(e,t,r,s,n){switch((0,y.l)(s,r,F,s),1===e&&(0,u.B8)(F,F),t){case 0:return(0,i.Ge)(n,F);case 1:return(0,i.z0)(n,F)}}function C(e,t,r,s,i,n,u,f){if(!t)return;let c=s.count;if(function(e){return e.isWGS84||(0,p.x1)(e)||(0,o.q8)(e)||(0,o.KQ)(e)}(i))for(let s=0;s<c;s++)n.getVec(s,v),t.getVec(s,L),(0,l.ei)(L,L,w(e,r,v,u,R)),f.setVec(s,L);else for(let i=0;i<c;i++){n.getVec(i,v),t.getVec(i,L);let c=(0,a.jg)(s.get(i,1)),o=Math.cos(c);1===r!=(0===e)&&(o=1/o),w(e,r,v,u,R),0===e?(R[0]*=o,R[1]*=o,R[2]*=o,R[3]*=o,R[4]*=o,R[5]*=o):(R[0]*=o,R[3]*=o,R[6]*=o,R[1]*=o,R[4]*=o,R[7]*=o),(0,l.ei)(L,L,R),(0,l.S8)(L,L),f.setVec(i,L)}return f}const v=(0,c.vt)(),L=(0,c.vt)(),F=(0,f.vt)(),R=(0,n.vt)();r.d(t,["JP",0,"Projection may be possible after calling projection.load()."])},72258(e,t,r){r.d(t,{UR:()=>S,p5:()=>g});var s=r(53966),i=r(34727),n=r(86211),u=r(77690),f=r(29242),l=r(58083),c=r(9093),o=r(35522),y=r(51850),h=r(73941),p=r(98764),a=r(48353),d=r(65806),B=r(27615),E=r(73354),m=r(22141);const T=()=>s.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function g(e,t,{vertexSpace:r,spatialReference:s}){if("georeferenced"===r.type){let i=e;if(!(0,d.g)(t,i,s))return!1;let{origin:n}=r;return(0,o.Re)(e,i,n),!0}let i=(0,p.lO)(s),n=e;if(!(0,d.g)(t,n,i))return!1;let{origin:u}=r,f=R;if(!(0,a.l)(s,u,f,i))return!1;let c=(0,l.B8)(R,f);return null!=c&&((0,o.Z0)(e,n,c),!0)}function S(e,t,r){let{vertexSpace:s,transform:i,vertexAttributes:n}=e,f=(0,B.Hq)(s)?i:null,y=b(e.spatialReference,r,3);if((0,B.yJ)(s,t)&&(!f||(0,l.t2)(f.localMatrix,c.zK))&&_(y)){let{position:e,normal:t,tangent:s}=n,i=r?.allowBufferReuse;return{position:i?e:e.slice(),normal:i?t:t?.slice(),tangent:i?s:s?.slice()}}switch(e.vertexSpace.type){case"local":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:r},{origin:s},i,n){let u=A(t,n);if(!(0,a.l)(t,s,C,u))return(0,m.CN)(T(),t,u),null;if(r&&(0,l.lw)(C,C,r.localMatrix),!(0,a.l)(t,i,v,u))return(0,m.CN)(T(),u,t),null;(0,l.B8)(v,v);let f=(0,l.lw)(C,v,C);return M(f,t,n,3),x(e,f)}(e,e.vertexSpace,t.origin,r):function({spatialReference:e,vertexAttributes:t,transform:r},{origin:s},i,n){let u=A(e,n);if(!(0,a.l)(e,s,C,u))return(0,m.CN)(T(),e,u),null;r&&(0,l.lw)(C,C,r.localMatrix),M(C,e,n,1);let f=new Float64Array(t.position.length),c=function(e,t,r,s,i){(0,E.t)(s,e,t);let n=new Float64Array(e.length);return(0,m.$5)(s,i,n,r)?n:((0,m.CN)(T(),i,r),null)}(t.position,C,e,f,u);if(!c)return null;let y=function(e,t,r,s,i,n){if(null==i)return null;let u=new Float32Array(i.length);return(0,m.qs)(i,u,n),(0,m.si)(u,e,t,r,s,u)?u:((0,m.CN)(T(),s,t),null)}(c,e,f,u,t.normal,C);if(t.normal&&!y)return null;let h=function(e,t,r,s,i,n){if(null==i)return null;let u=new Float32Array(i.length);return(0,m.KM)(i,u,n),(0,m.Mv)(u,e,t,r,s,u)?u:((0,m.CN)(T(),s,t),null)}(c,e,f,u,t.tangent,C);if(t.tangent&&!h)return null;if(i){let e=(0,o.ze)(F,i);(0,E.a)(c,c,e)}return{position:c,normal:y,tangent:h}}(e,e.vertexSpace,t.origin,r);case"georeferenced":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:r},{origin:s},i,n){let f=A(t,n);if(!(0,a.l)(t,i,C,f))return(0,m.CN)(T(),t,f),null;let c=1/b(t,n,2);(0,l.hs)(C,C,[c,c,c]);let o=(0,l.B8)(v,C),{position:y,normal:h,tangent:p}=function(e,t,r){if(!t)return e;if(!r){let{position:r,normal:s,tangent:i}=e;return{position:(0,E.a)(new Float64Array(r.length),r,t),tangent:i,normal:s}}let s=x(e,r.localMatrix);return(0,E.a)(s.position,s.position,t),s}(e,s,r),d=new Float64Array(y.length),B=function(e,t,r,s,i){let n=(0,m.gr)(e,t,s,i);if(!n)return(0,m.CN)(T(),t,i),null;let u=new Float64Array(n.length);return(0,E.t)(u,n,r),u}(y,t,o,d,f);if(!B)return null;let g=(0,u.Ge)(L,o),S=function(e,t,r,s,i,n,u){if(null==e)return null;let f=u??new Float32Array(e.length);return(0,m.X4)(e,t,r,s,i,f)?((0,E.b)(f,f,n),f):((0,m.CN)(T(),r,i),null)}(h,y,t,d,f,g,h===e.normal?void 0:h);if(!S&&h)return null;let M=function(e,t,r,s,i,n,u){if(null==e)return null;let f=u??new Float32Array(e.length);return(0,m.xA)(e,t,r,s,i,f)?((0,E.b)(f,f,n,4),f):((0,m.CN)(T(),r,i),null)}(p,y,t,d,f,g,p===e.tangent?void 0:p);return!M&&p?null:{position:B,normal:S,tangent:M}}(e,e.vertexSpace,t.origin,r):function({vertexAttributes:e,transform:t,spatialReference:r},{origin:s},i,n){let u=b(r,n,3),f=s||!_(u)?(0,l.C)(C,t?.localMatrix??c.zK):null;f&&M(f,r,n,3);let{position:y,normal:h,tangent:p}=f?x(e,f):e,a=n?.allowBufferReuse,d=a?y:new Float64Array(y.length),B=y;if(s&&(B=(0,E.a)(d,B,s)),i){let e=(0,o.ze)(F,i);B=(0,E.a)(d,B,e)}return{position:B!==e.position||a?B:B.slice(),normal:h!==e.normal||a?h:h?.slice(),tangent:p!==e.tangent||a?p:p?.slice()}}(e,e.vertexSpace,t.origin,r)}}function A(e,t){return t?.useEllipsoid&&(0,h.B3)(e)?p.Y0:(0,p.lO)(e)}function x(e,t){let r=new Float64Array(e.position.length);(0,E.t)(r,e.position,t);let s=e.normal?new Float32Array(e.normal.length):null,i=e.tangent?new Float32Array(e.tangent.length):null;return s&&e.normal&&(0,m.qs)(e.normal,s,t),i&&e.tangent&&(0,m.KM)(e.tangent,i,t),{position:r,normal:s,tangent:i}}function M(e,t,r,s){let i=b(t,r,s);_(i)||(0,l.hs)(e,e,[i,i,i])}function b(e,t,r){let s=!!(1&r),i=!!(2&r),n=t?.sourceUnit,u=t?.targetUnit;if(!n&&!u)return 1;let f=w(n,e);!s&&n&&!_(f)&&(T().warn("source unit conversion not supported"),f=1);let l=1/w(u,e);return!i&&u&&!_(l)&&(T().warn("target unit conversion not supported"),l=1),f*l}function _(e){return(0,i.Io)(e,1)}function w(e,t){if(null==e)return 1;let r=(0,n.KX)(t);return 1/(0,n.oU)(r,"meters",e)}const C=(0,c.vt)(),v=(0,c.vt)(),L=(0,f.vt)(),F=(0,y.vt)(),R=(0,c.vt)()}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2258],{50867(e,t,r){r.d(t,{a:()=>i,b:()=>c,l:()=>l,n:()=>u,t:()=>n}),r(44208);var s=r(72727);function i(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,i=4,n=i){let u=(0,s.k)(e.length,i,4),f=(0,s.k)(t.length,n,4),l=Math.min(u,f),c=r[0],o=r[1],y=r[2],h=r[3],p=r[4],a=r[5],d=r[6],B=r[7],E=r[8],m=0,T=0;for(let r=0;r<l;r++){let r=t[m],s=t[m+1],u=t[m+2],f=t[m+3];e[T]=c*r+h*s+d*u,e[T+1]=o*r+p*s+B*u,e[T+2]=y*r+a*s+E*u,e[T+3]=f,m+=n,T+=i}}function u(e,t){let r=Math.min(e.count,t.count),s=e.typedBuffer,i=e.typedBufferStride,n=t.typedBuffer,u=t.typedBufferStride;for(let e=0;e<r;e++){let t=e*i,r=e*u,f=n[r],l=n[r+1],c=n[r+2],o=f*f+l*l+c*c;if(o>0){let e=1/Math.sqrt(o);s[t]=e*f,s[t+1]=e*l,s[t+2]=e*c}}}function f(e,t,r,s=4){let i=Math.min(e.length/s,t.count),n=t.typedBuffer,u=t.typedBufferStride,f=0,l=0;for(let t=0;t<i;t++)e[l]=r*n[f],e[l+1]=r*n[f+1],e[l+2]=r*n[f+2],e[l+3]=r*n[f+3],f+=u,l+=s}function l(e,t,r,s){c(e.typedBuffer,t,r,s,e.typedBufferStride)}function c(e,t,r,s,i=4){let n=Math.min(e.length/i,t.count),u=t.typedBuffer,f=t.typedBufferStride,l=0,c=0,o=1/2.2;for(let t=0;t<n;t++)e[c]=s*(r*u[l])**o,e[c+1]=s*(r*u[l+1])**o,e[c+2]=s*(r*u[l+2])**o,e[c+3]=s*r*u[l+3],l+=f,c+=i}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:l,normalize:u,scale:f,scaleView:function(e,t,r){f(e.typedBuffer,t,r,e.typedBufferStride)},transformMat3:n,transformMat3View:i,transformMat4:function(e,t,r,i=4,n=i){let u=(0,s.k)(e.length,i,4),f=(0,s.k)(t.length,n,4),l=Math.min(u,f),c=r[0],o=r[1],y=r[2],h=r[3],p=r[4],a=r[5],d=r[6],B=r[7],E=r[8],m=r[9],T=r[10],g=r[11],S=r[12],A=r[13],x=r[14],M=r[15],b=0,_=0;for(let r=0;r<l;r++){let r=t[b],s=t[b+1],u=t[b+2],f=t[b+3];e[_]=c*r+p*s+E*u+S*f,e[_+1]=o*r+a*s+m*u+A*f,e[_+2]=y*r+d*s+T*u+x*f,e[_+3]=h*r+B*s+g*u+M*f,b+=n,_+=i}},transformMat4View:function(e,t,r){let i=e.typedBuffer,n=e.typedBufferStride,u=t.typedBuffer,f=t.typedBufferStride,l=(0,s.k)(i.length,n,4),c=(0,s.k)(u.length,f,4),o=Math.min(l,c),y=r[0],h=r[1],p=r[2],a=r[3],d=r[4],B=r[5],E=r[6],m=r[7],T=r[8],g=r[9],S=r[10],A=r[11],x=r[12],M=r[13],b=r[14],_=r[15];for(let e=0;e<o;e++){let t=e*n,r=e*f,s=u[r],l=u[r+1],c=u[r+2],o=u[r+3];i[t]=y*s+d*l+T*c+x*o,i[t+1]=h*s+B*l+g*c+M*o,i[t+2]=p*s+E*l+S*c+b*o,i[t+3]=a*s+m*l+A*c+_*o}}},Symbol.toStringTag,{value:"Module"}))},13030(e,t,r){r.d(t,{Y$:()=>B,XW:()=>d,qB:()=>w,Qt:()=>K,My:()=>J,bf:()=>q,jZ:()=>x,j0:()=>M,Sx:()=>b,E$:()=>_,Qy:()=>se,h:()=>P,P:()=>k,SL:()=>R,dy:()=>te,ES:()=>ie,gH:()=>m,ZD:()=>E,si:()=>C,mJ:()=>G,UL:()=>Q,D6:()=>z,Yi:()=>Y,An:()=>O,LC:()=>F,xs:()=>g,EC:()=>T,Xm:()=>v,Vp:()=>D,zD:()=>W,m8:()=>Z,nS:()=>U,H$:()=>X,eI:()=>N,td:()=>re,Eq:()=>A,jz:()=>S,Aj:()=>L,E7:()=>H,Y4:()=>ee,TX:()=>$,Uz:()=>I,ml:()=>j,XP:()=>V});var s=r(34727),i=r(37585),n=r(48163),u=r(78955),f=r(91829);class l{static{this.ElementCount=9}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=9;let n=this.TypedArrayConstructor;void 0===s&&(s=9*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<9;e++)t[e]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<9;e++)this.typedBuffer[r++]=t[e]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){let s=this.typedBuffer,i=t.typedBuffer,n=e*this.typedBufferStride,u=r*t.typedBufferStride;for(let e=0;e<9;++e)s[n++]=i[u++]}get buffer(){return this.typedBuffer.buffer}}class c{static{this.ElementCount=16}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=16;let n=this.TypedArrayConstructor;void 0===s&&(s=16*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<16;e++)t[e]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<16;e++)this.typedBuffer[r++]=t[e]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){this.copyFromTypedBuffer(e,t.typedBuffer,r*t.typedBufferStride)}copyFromTypedBuffer(e,t,r){let s=this.typedBuffer,i=e*this.typedBufferStride;for(let e=0;e<16;++e)s[i++]=t[r++]}get buffer(){return this.typedBuffer.buffer}}class o{static{this.ElementCount=1}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=1;let n=this.TypedArrayConstructor;void 0===s&&(s=n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}class y{static{this.ElementCount=2}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=2;let n=this.TypedArrayConstructor;void 0===s&&(s=2*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,i.hZ)(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=r}copyFrom(e,t,r){let s=this.typedBuffer,i=t.typedBuffer,n=e*this.typedBufferStride,u=r*t.typedBufferStride;s[n++]=i[u++],s[n]=i[u]}get buffer(){return this.typedBuffer.buffer}}var h=r(35522);class p{static{this.ElementCount=3}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=3;let n=this.TypedArrayConstructor;void 0===s&&(s=3*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,h.hZ)(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e]=s}copyFrom(e,t,r){let s=this.typedBuffer,i=t.typedBuffer,n=e*this.typedBufferStride,u=r*t.typedBufferStride;s[n++]=i[u++],s[n++]=i[u++],s[n]=i[u]}get buffer(){return this.typedBuffer.buffer}}class a{static{this.ElementCount=4}constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;let n=this.TypedArrayConstructor;void 0===s&&(s=4*n.BYTES_PER_ELEMENT);let u=0===t.byteLength?0:r;this.typedBuffer=null==i?new n(t,u):new n(t,u,(i-r)/n.BYTES_PER_ELEMENT),this.typedBufferStride=s/n.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){let s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,u.hZ)(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=s,this.typedBuffer[e]=i}copyFrom(e,t,r){let s=this.typedBuffer,i=t.typedBuffer,n=e*this.typedBufferStride,u=r*t.typedBufferStride;s[n++]=i[u++],s[n++]=i[u++],s[n++]=i[u++],s[n]=i[u]}get buffer(){return this.typedBuffer.buffer}}class d extends o{constructor(e,t=0,r,s){super(Float16Array,e,t,r,s),this.elementType="f16"}static{this.ElementType="f16"}}class B extends o{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static{this.ElementType="f32"}}class E extends y{constructor(e,t=0,r,s){super(Float16Array,e,t,r,s),this.elementType="f16"}slice(e,t){return this.sliceBuffer(E,e,t)}static{this.ElementType="f16"}}class m extends y{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(m,e,t)}static{this.ElementType="f32"}}class T extends p{constructor(e,t=0,r,s){super(Float16Array,e,t,r,s),this.elementType="f16"}slice(e,t){return this.sliceBuffer(T,e,t)}static{this.ElementType="f16"}}class g extends p{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class S extends a{constructor(e,t=0,r,s){super(Float16Array,e,t,r,s),this.elementType="f16"}slice(e,t){return this.sliceBuffer(S,e,t)}static{this.ElementType="f16"}}class A extends a{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(A,e,t)}static{this.ElementType="f32"}}class x extends l{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(x,e,t)}static{this.ElementType="f32"}}class M extends l{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(M,e,t)}static{this.ElementType="f64"}}class b extends c{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(b,e,t)}static{this.ElementType="f32"}}class _ extends c{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(_,e,t)}static{this.ElementType="f64"}}class w extends o{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(w,e,t)}static{this.ElementType="f64"}}class C extends y{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(C,e,t)}static{this.ElementType="f64"}}class v extends p{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class L extends a{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(L,e,t)}static{this.ElementType="f64"}}class R extends o{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(R,e,t)}static{this.ElementType="u8"}}class F extends y{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(F,e,t)}static{this.ElementType="u8"}}class N extends p{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class V extends a{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(V,e,t)}static{this.ElementType="u8"}}class P extends o{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(P,e,t)}static{this.ElementType="u16"}}class Y extends y{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(Y,e,t)}static{this.ElementType="u16"}}class U extends p{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(U,e,t)}static{this.ElementType="u16"}}class I extends a{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(I,e,t)}static{this.ElementType="u16"}}class k extends o{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(k,e,t)}static{this.ElementType="u32"}}class O extends y{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(O,e,t)}static{this.ElementType="u32"}}class X extends p{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(X,e,t)}static{this.ElementType="u32"}}class j extends a{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(j,e,t)}static{this.ElementType="u32"}}class q extends o{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(q,e,t)}static{this.ElementType="i8"}}class z extends y{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(z,e,t)}static{this.ElementType="i8"}}class Z extends p{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(Z,e,t)}static{this.ElementType="i8"}}class $ extends a{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer($,e,t)}static{this.ElementType="i8"}}class K extends o{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static{this.ElementType="i16"}}class G extends y{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(G,e,t)}static{this.ElementType="i16"}}class D extends p{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(D,e,t)}static{this.ElementType="i16"}}class H extends a{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(H,e,t)}static{this.ElementType="i16"}}class J extends o{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(J,e,t)}static{this.ElementType="i32"}}class Q extends y{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Q,e,t)}static{this.ElementType="i32"}}class W extends p{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(W,e,t)}static{this.ElementType="i32"}}class ee extends a{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(ee,e,t)}static{this.ElementType="i32"}}class te extends R{constructor(e,t=0,r,s){super(e,t,r,s)}get(e){return this.typedBuffer[e*this.typedBufferStride]/255}set(e,t){this.typedBuffer[e*this.typedBufferStride]=Math.round(255*(0,s.qE)(t,0,1))}slice(e,t){return this.sliceBuffer(te,e,t)}}class re extends V{constructor(e,t=0,r,s){super(e,t,r,s)}getVec(e,t){return(0,u.hs)(t,super.getVec(e,t),1/255)}setVec(e,t){(0,u.jk)(ue,(0,u.T9)(ue,t,f.uY),f.Un),(0,u.hs)(ue,ue,255),(0,u.LI)(ue,ue),super.setVec(e,ue)}get(e,t){return super.get(e,t)/255}set(e,t,r){super.set(e,t,Math.round(255*(0,s.qE)(r,0,1)))}setValues(e,t,r,s,i){(0,u.hZ)(ue,t,r,s,i),this.setVec(e,ue)}slice(e,t){return this.sliceBuffer(re,e,t)}}class se extends K{constructor(e,t=0,r,s){super(e,t,r,s)}get(e){return Math.max(super.get(e)/32767,-1)}set(e,t){super.set(e,Math.round(32767*(0,s.qE)(t,-1,1)))}slice(e,t){return this.sliceBuffer(se,e,t)}}class ie extends G{constructor(e,t=0,r,s){super(e,t,r,s)}getVec(e,t){return(0,i.hZ)(ne,-1,-1),(0,i.T9)(t,(0,i.hs)(t,super.getVec(e,t),1/32767),ne)}setVec(e,t){(0,i.qE)(ne,t,n.IA,n.Un),(0,i.hs)(ne,ne,32767),(0,i.LI)(ne,ne),super.setVec(e,ne)}get(e,t){return Math.max(super.get(e,t)/32767,-1)}set(e,t,r){super.set(e,t,Math.round(32767*(0,s.qE)(r,-1,1)))}setValues(e,t,r){(0,i.hZ)(ne,t,r),this.setVec(e,ne)}slice(e,t){return this.sliceBuffer(ie,e,t)}}const ne=(0,n.vt)(),ue=(0,f.vt)()},22141(e,t,r){r.d(t,{$5:()=>A,CN:()=>m,KM:()=>M,Mv:()=>_,X4:()=>T,gr:()=>S,qs:()=>x,si:()=>g,xA:()=>b});var s=r(34727),i=r(77690),n=r(29242),u=r(58083),f=r(9093),l=r(35522),c=r(51850),o=r(73941),y=r(48353),h=r(9762),p=(r(79258),r(21325)),a=r(28735),d=r(13030),B=r(73354),E=r(50867);function m(e,t,r,s){e.error(`Failed to project from (wkid:${t.wkid}) to (wkid:${r.wkid}).${s?" ":""}${s}`)}function T(e,t,r,s,i,n){return C(0,d.xs.fromTypedArray(e),0,d.Xm.fromTypedArray(t),r,d.Xm.fromTypedArray(s),i,d.xs.fromTypedArray(n))?n:null}function g(e,t,r,s,i,n){return C(1,d.xs.fromTypedArray(e),0,d.Xm.fromTypedArray(t),r,d.Xm.fromTypedArray(s),i,d.xs.fromTypedArray(n))?n:null}function S(e,t,r,s){return(0,h.projectBuffer)(e,t,0,r,s,0)?r:null}function A(e,t,r,s){return(0,h.projectBuffer)(e,t,0,r,s,0)?r:null}function x(e,t,r){return(0,i.Ge)(F,r),(0,B.b)(t,e,F),(0,s.or)(F)&&(0,B.n)(t,t),t}function M(e,t,r){return(0,i.z0)(F,r),(0,E.t)(t,e,F),(0,s.or)(F)&&(0,B.n)(t,t,4),t}function b(e,t,r,s,i,n){if(!C(0,d.xs.fromTypedArray(e,4*Float32Array.BYTES_PER_ELEMENT),1,d.Xm.fromTypedArray(t),r,d.Xm.fromTypedArray(s),i,d.xs.fromTypedArray(n,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let t=3;t<e.length;t+=4)n[t]=e[t];return n}function _(e,t,r,s,i,n){if(!C(1,d.xs.fromTypedArray(e,16),1,d.Xm.fromTypedArray(t),r,d.Xm.fromTypedArray(s),i,d.xs.fromTypedArray(n,16)))return null;for(let t=3;t<e.length;t+=4)n[t]=e[t];return n}function w(e,t,r,s,n){switch((0,y.l)(s,r,R,s),1===e&&(0,u.B8)(R,R),t){case 0:return(0,i.Ge)(n,R);case 1:return(0,i.z0)(n,R)}}function C(e,t,r,s,i,n,u,f){if(!t)return;let c=s.count;if(function(e){return e.isWGS84||(0,p.x1)(e)||(0,o.q8)(e)||(0,o.KQ)(e)}(i))for(let s=0;s<c;s++)n.getVec(s,v),t.getVec(s,L),(0,l.ei)(L,L,w(e,r,v,u,F)),f.setVec(s,L);else for(let i=0;i<c;i++){n.getVec(i,v),t.getVec(i,L);let c=(0,a.jg)(s.get(i,1)),o=Math.cos(c);1===r!=(0===e)&&(o=1/o),w(e,r,v,u,F),0===e?(F[0]*=o,F[1]*=o,F[2]*=o,F[3]*=o,F[4]*=o,F[5]*=o):(F[0]*=o,F[3]*=o,F[6]*=o,F[1]*=o,F[4]*=o,F[7]*=o),(0,l.ei)(L,L,F),(0,l.S8)(L,L),f.setVec(i,L)}return f}const v=(0,c.vt)(),L=(0,c.vt)(),R=(0,f.vt)(),F=(0,n.vt)();r.d(t,["JP",0,"Projection may be possible after calling projection.load()."])},72258(e,t,r){r.d(t,{UR:()=>S,p5:()=>g});var s=r(53966),i=r(34727),n=r(86211),u=r(77690),f=r(29242),l=r(58083),c=r(9093),o=r(35522),y=r(51850),h=r(73941),p=r(98764),a=r(48353),d=r(65806),B=r(27615),E=r(73354),m=r(22141);const T=()=>s.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function g(e,t,{vertexSpace:r,spatialReference:s}){if("georeferenced"===r.type){let i=e;if(!(0,d.g)(t,i,s))return!1;let{origin:n}=r;return(0,o.Re)(e,i,n),!0}let i=A(s),n=e;if(!(0,d.g)(t,n,i))return!1;let{origin:u}=r,f=F;if(!(0,a.l)(s,u,f,i))return!1;let c=(0,l.B8)(F,f);return null!=c&&((0,o.Z0)(e,n,c),!0)}function S(e,t,r){let{vertexSpace:s,transform:i,vertexAttributes:n}=e,f=(0,B.Hq)(s)?i:null,y=b(e.spatialReference,r,3);if((0,B.yJ)(s,t)&&(!f||(0,l.t2)(f.localMatrix,c.zK))&&_(y)){let{position:e,normal:t,tangent:s}=n,i=r?.allowBufferReuse;return{position:i?e:e.slice(),normal:i?t:t?.slice(),tangent:i?s:s?.slice()}}switch(e.vertexSpace.type){case"local":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:r},{origin:s},i,n){let u=A(t);if(!(0,a.l)(t,s,C,u))return(0,m.CN)(T(),t,u),null;if(r&&(0,l.lw)(C,C,r.localMatrix),!(0,a.l)(t,i,v,u))return(0,m.CN)(T(),u,t),null;(0,l.B8)(v,v);let f=(0,l.lw)(C,v,C);return M(f,t,n,3),x(e,f)}(e,e.vertexSpace,t.origin,r):function(e,t,r,s){let{spatialReference:i,vertexAttributes:n}=e,u=A(i),f=function({spatialReference:e,transform:t},{origin:r},s){let i=A(e);return(0,a.l)(e,r,C,i)?(t&&(0,l.lw)(C,C,t.localMatrix),M(C,e,s,1),C):((0,m.CN)(T(),e,i),null)}(e,t,s);if(!f)return null;let c=new Float64Array(n.position.length),y=function(e,t,r,s,i){(0,E.t)(s,e,t);let n=new Float64Array(e.length);return(0,m.$5)(s,i,n,r)?n:((0,m.CN)(T(),i,r),null)}(n.position,f,i,c,u);if(!y)return null;let h=function(e,t,r,s,i,n){if(null==i)return null;let u=new Float32Array(i.length);return(0,m.qs)(i,u,n),(0,m.si)(u,e,t,r,s,u)?u:((0,m.CN)(T(),s,t),null)}(y,i,c,u,n.normal,f);if(n.normal&&!h)return null;let p=function(e,t,r,s,i,n){if(null==i)return null;let u=new Float32Array(i.length);return(0,m.KM)(i,u,n),(0,m.Mv)(u,e,t,r,s,u)?u:((0,m.CN)(T(),s,t),null)}(y,i,c,u,n.tangent,f);if(n.tangent&&!p)return null;if(r){let e=(0,o.ze)(R,r);(0,E.a)(y,y,e)}return{position:y,normal:h,tangent:p}}(e,e.vertexSpace,t.origin,r);case"georeferenced":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:r},{origin:s},i,n){let f=A(t);if(!(0,a.l)(t,i,C,f))return(0,m.CN)(T(),t,f),null;let c=1/b(t,n,2);(0,l.hs)(C,C,[c,c,c]);let o=(0,l.B8)(v,C),{position:y,normal:h,tangent:p}=function(e,t,r){if(!t)return e;if(!r){let{position:r,normal:s,tangent:i}=e;return{position:(0,E.a)(new Float64Array(r.length),r,t),tangent:i,normal:s}}let s=x(e,r.localMatrix);return(0,E.a)(s.position,s.position,t),s}(e,s,r),d=new Float64Array(y.length),B=function(e,t,r,s,i){let n=(0,m.gr)(e,t,s,i);if(!n)return(0,m.CN)(T(),t,i),null;let u=new Float64Array(n.length);return(0,E.t)(u,n,r),u}(y,t,o,d,f);if(!B)return null;let g=(0,u.Ge)(L,o),S=function(e,t,r,s,i,n,u){if(null==e)return null;let f=u??new Float32Array(e.length);return(0,m.X4)(e,t,r,s,i,f)?((0,E.b)(f,f,n),f):((0,m.CN)(T(),r,i),null)}(h,y,t,d,f,g,h===e.normal?void 0:h);if(!S&&h)return null;let M=function(e,t,r,s,i,n,u){if(null==e)return null;let f=u??new Float32Array(e.length);return(0,m.xA)(e,t,r,s,i,f)?((0,E.b)(f,f,n,4),f):((0,m.CN)(T(),r,i),null)}(p,y,t,d,f,g,p===e.tangent?void 0:p);return!M&&p?null:{position:B,normal:S,tangent:M}}(e,e.vertexSpace,t.origin,r):function({vertexAttributes:e,transform:t,spatialReference:r},{origin:s},i,n){let u=b(r,n,3),f=s||!_(u)?(0,l.C)(C,t?.localMatrix??c.zK):null;f&&M(f,r,n,3);let{position:y,normal:h,tangent:p}=f?x(e,f):e,a=n?.allowBufferReuse,d=a?y:new Float64Array(y.length),B=y;if(s&&(B=(0,E.a)(d,B,s)),i){let e=(0,o.ze)(R,i);B=(0,E.a)(d,B,e)}return{position:B!==e.position||a?B:B.slice(),normal:h!==e.normal||a?h:h?.slice(),tangent:p!==e.tangent||a?p:p?.slice()}}(e,e.vertexSpace,t.origin,r)}}function A(e){return null==e||(0,h.B3)(e)?p.Y0:(0,p.lO)(e)}function x(e,t){let r=new Float64Array(e.position.length);(0,E.t)(r,e.position,t);let s=e.normal?new Float32Array(e.normal.length):null,i=e.tangent?new Float32Array(e.tangent.length):null;return s&&e.normal&&(0,m.qs)(e.normal,s,t),i&&e.tangent&&(0,m.KM)(e.tangent,i,t),{position:r,normal:s,tangent:i}}function M(e,t,r,s){let i=b(t,r,s);_(i)||(0,l.hs)(e,e,[i,i,i])}function b(e,t,r){let s=!!(1&r),i=!!(2&r),n=t?.sourceUnit,u=t?.targetUnit;if(!n&&!u)return 1;let f=w(n,e);!s&&n&&!_(f)&&(T().warn("source unit conversion not supported"),f=1);let l=1/w(u,e);return!i&&u&&!_(l)&&(T().warn("target unit conversion not supported"),l=1),f*l}function _(e){return(0,i.Io)(e,1)}function w(e,t){if(null==e)return 1;let r=(0,n.KX)(t);return 1/(0,n.oU)(r,"meters",e)}const C=(0,c.vt)(),v=(0,c.vt)(),L=(0,f.vt)(),R=(0,y.vt)(),F=(0,c.vt)()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1137],{56512(e,t,i){function r(e){let t,i,r=[],a=!1;return function(...s){return a&&t===this&&function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}(s,r)||(i=e.apply(this,s),t=this,r=s,a=!0),i}}i.d(t,{B:()=>r})},69397(e,t,i){i.d(t,{Qf:()=>o,Qh:()=>n,lM:()=>s,ro:()=>u,rq:()=>f});var r=i(44208),a=i(34275);function s(e){if(!e)return 0;let t=h;for(let i in e)e.hasOwnProperty(i)&&(t+=l(e[i],!1));return t}function n(e){if(!e)return 0;if("number"==typeof e[0])return o(e);if(Array.isArray(e))return function(e){let t=e.length;if(0===t||"number"==typeof e[0])return f(e,8);let i=c;for(let r=0;r<t;r++)i+=l(e[r]);return i}(e);let t=h;for(let i in e)e.hasOwnProperty(i)&&(t+=l(e[i]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?n(e):h;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function o(...e){return e.reduce((e,t)=>e+u(t),0)}function u(e,t=16){return e?(0,a.iu)(e)?e.byteLength+d:Array.isArray(e)?f(e,t):0:0}function f(e,t){return c+e.length*t}const h=32,c=16,p=(0,r.A)("ios")||!(0,r.A)("chrome")&&!(0,r.A)("opr")?8:4,d=145;i.d(t,["JY",0,p])},5359(e,t,i){i.d(t,{Z:()=>a});const r=Symbol("isImageryTileGraphicOrigin");function a(e){return!!e&&r in e}i.d(t,["H",0,r])},11137(e,t,i){i.r(t),i.d(t,{default:()=>rt});var r,a=i(32198),s=i(40124),n=i(69540),l=i(49186),o=i(53966),u=i(97768),f=i(25728),h=i(17676),c=i(36708),p=i(91429),d=i(78888),m=i(41910),g=i(60950),y=i(89808),w=i(99959),v=i(5359);class x extends w.A{get[(r=v.H,g.ym)](){return this.layer}get[y.Q](){return this.layer}get[m.e7](){return this.layer}constructor(e){super(),this[r]=!0,this.type="imagery-tile",this.layer=e}get id(){return this.layer.id}}var b=i(4146),I=i(18768),C=i(63074),S=i(69208),A=i(34287),_=i(8303),T=i(72545),R=i(56551),M=i(54310),O=i(25036),F=i(82935),k=i(82806),P=i(7548),D=i(23636),N=i(49859),L=i(68197),B=i(5443),z=i(16930),E=i(73444),J=i(94778),H=i(14140);function $(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function U(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function Z(e){let t=(0,E.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function j(){return Math.round(255*Math.random())}function q(e){let t={},{parameters:i}=e;if(!i)return t;for(let[e,r]of Object.entries(i)){let{type:i,description:a,unit:s,categoryEncoding:n,observedProperty:l}=r;if("Parameter"===i&&(t[e]={},a&&(t[e].description=Z(a)),s&&(t[e].unit=s.label?Z(s.label):null,t[e].symbol=s.symbol?.value),n)){let i=Object.entries(n).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})),r=!1;l?.categories?.length&&(l.categories.forEach(e=>{if(!e.id)return;let t=e.id.slice(e.id.lastIndexOf("/")+1),a=i.find(e=>e.ClassName===t);if(a&&(a.Label=e.label?Z(e.label):null,e.preferredColor)){let t=L.A.fromHex(e.preferredColor);t&&(r=!0,a.Red=t.r,a.Green=t.g,a.Blue=t.b)}}),r&&i.forEach(e=>{e.Red??(e.Red=j(),e.Green=j(),e.Blue=j())}));let a={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};r&&a.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=a}}return t}function V(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let r=0;r<e.length;r++){let a=e[r];null!=a&&(a<t&&(t=a),a>i&&(i=a))}return(0,J.X1)(t,i)}function G(e,t,i){let r=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),a=(e=>t=>e*=t.count)(1),s=[...r.slice(1),{name:"",count:1}].reverse().map(a).reverse(),n=0;for(let a=e.length-1;a>=0;a--){let l=r.findIndex(({name:t})=>t===e[a]);n+=s[l]*(i%t[a]),i=Math.floor(i/t[a])}return n}var W=i(4366),X=i(47520),K=i(51927),Y=i(45617),Q=i(87186);let ee=class extends N.A{constructor(){super(...arguments),this._pixelBlockTiles=new Map,this.datasetFormat="MEMORY",this.preGenerateTiles=!0,this.source=null}get url(){return""}async fetchRawTile(e,t,i,r={}){let a=`${e}/${t}/${i}`,s=this._pixelBlockTiles.get(a);if(s)return s;if(!this.source)return null;let{rasterInfo:n}=this,[l,o]=n.storageInfo.tileInfo.size,{sliceId:u}=r,{encodedData:f}=this.source;if(f){let s=await this.decodePixelBlock(f,{tileSize:[l,o],tileIndex:[e,t,i],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0},{signal:r.signal});return s&&this._pixelBlockTiles.set(a,s),s}let{pixelBlocks:h}=this.source,c=null==u?h[0]:h[u];if(null==c)return null;let p={pixelBlock:c,useBilinear:"thematic"!==n.dataType,tileSize:{width:l,height:o},level:e,row:t,col:i};return this.rasterJobHandler?this.rasterJobHandler.clipTile(p,r):(0,X.J$)(p)}async _open(e){if(!this.source)throw new l.A("in-memory-raster:open","source is required to open an in memory raster");let t=this.source;this.datasetName=t.name;let{pixelBlocks:i,attributeTable:r,statistics:a,histograms:s,nativeExtent:n,transform:o,colormap:u}=t,f=i[0],{width:h,height:c,pixelType:p}=f??t.imageInfo,d=t.extent??new B.A({xmin:-.5,ymin:.5,xmax:h-.5,ymax:c-.5,spatialReference:new z.A({wkid:3857})}),m=t.isPseudoSpatialReference??!t.extent,g={x:d.width/h,y:d.height/c},y={...t.keyProperties};t.dataType&&(y.DataType=t.dataType),t.bandInfos&&(y.BandProperties=t.bandInfos.map(e=>e.toJSON())),r&&(y.DataType="Thematic");let w=new Q.A({width:h,height:c,pixelType:p,extent:d,nativeExtent:n,attributeTable:r,colormap:u,transform:o,pixelSize:g,spatialReference:d.spatialReference,bandCount:f?.pixels.length??t.imageInfo.bandCount,keyProperties:y,multidimensionalInfo:t.multidimensionalInfo,statistics:a,isPseudoSpatialReference:m,histograms:s});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(w),this.createRemoteDatasetStorageInfo(w,512,512),this._set("rasterInfo",w),this.updateTileInfo(),w.multidimensionalInfo?await this._buildMDimStats(i,w.multidimensionalInfo):this.preGenerateTiles&&f&&(await this._buildInMemoryRaster(f,{width:512,height:512},e),this.source=null)}async _buildInMemoryRaster(e,t,i){let{rasterInfo:r}=this,a=r.storageInfo.maximumPyramidLevel??0,s="thematic"!==r.dataType,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:a,useBilinear:s},i):Promise.resolve((0,X.lD)(e,t,a,s)),o=null!=r.statistics,u=null!=r.histograms,f=this.ioConfig.skipStatistics||o?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,K.f4)(e)),c=await(0,h.Lx)([n,f]);if(!c[0].value)throw new l.A("in-memory-raster:open","failed to build in memory raster");this._pixelBlockTiles=c[0].value,o||(r.statistics=c[1].value?.statistics),u||(r.histograms=c[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let r=0;r<t.variables.length;r++){let a=t.variables[r];if(a.statistics)continue;let s=a.dimensions.map(e=>new Y.A({variableName:a.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),n=(0,W.NG)(s,t),l=null==n?null:e[n];if(null==l)continue;let o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},i):(0,K.eH)(l);a.statistics=o.statistics,a.histograms||=o.histograms}}};(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],ee.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)({constructOnly:!0})],ee.prototype,"preGenerateTiles",void 0),(0,a.Cg)([(0,p.MZ)()],ee.prototype,"source",void 0),(0,a.Cg)([(0,p.MZ)()],ee.prototype,"url",null),ee=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.InMemoryRaster")],ee);const te=ee;var ie=i(22671);let re=class extends N.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,r={}){return this._inMemoryRaster.fetchRawTile(e,t,i,r)}async _open(e){let{extent:t,pixelBlocks:i,multidimensionalInfo:r,attributeTable:a,bandNames:s}=await this._fetchData(e),{statistics:n,histograms:l}=(0,K.eH)(i[0]),o=s?.map(e=>({BandName:e})),u={DataType:a?"Thematic":r?"Scientific":"Generic",BandProperties:o},f=new te({source:{extent:t,pixelBlocks:i,attributeTable:a?ie.A.fromJSON(a):null,multidimensionalInfo:r,statistics:n,histograms:l,keyProperties:u,isPseudoSpatialReference:!1}});await f.open(),this._inMemoryRaster=f;let h=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",h.slice(0,h.indexOf("."))),this._set("rasterInfo",f.rasterInfo)}async _fetchData(e){let t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new l.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new l.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new l.A(i,"Missing domain referencing in the grid coverage data");let r=Object.values(t.ranges);for(let e=0;e<r.length;e++){let{axisNames:t,shape:a,type:s,values:n}=r[e];if(!("ndarray"===s.toLowerCase()&&n?.length&&t?.length&&a?.length))throw new l.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!$(t[t.length-1])||!U(t[t.length-2]))throw new l.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){let{width:t,height:i,extent:r,dimensions:a}=function(e){let{axes:t}=e.domain,i=Object.keys(t),r=[],a=[],s=-1,n=-1,l=[];for(let e=0;e<i.length;e++){let o=i[e];$(o)?s=e:U(o)&&(n=e);let u=t[o],f=[];if("values"in u){u.values.forEach(e=>f.push("string"==typeof e?new Date(e).getTime():e));let e=f[1]-f[0];r.push([f[0]-.5*e,f[f.length-1]+.5*e]),a.push(e)}else{let{start:e,stop:t,num:i}=u,s=(t-e)/(i-1);r.push([e-.5*s,t+.5*s]),a.push(s);for(let t=0;t<i;t++)f.push(e+s*t)}l.push({name:o,values:f,extent:[f[0],f[f.length-1]]})}s>-1&&-1===n?n=+(0===s):n>-1&&-1===s?s=+(0===n):-1===n&&-1===s&&(s=0,n=1),l=l.filter((e,t)=>t!==s&&t!==n);let{referencing:o}=e.domain,u=o.find(e=>e.coordinates.includes(i[s])).system.id,f=u?.slice(u.lastIndexOf("/")+1),h=null==f||"CRS84"===f?4326:Number(f),c=new z.A({wkid:h}),[p,d]=r[s],[m,g]=r[n],y=new B.A({xmin:p,xmax:d,ymin:m,ymax:g,spatialReference:c});return{width:Math.round(y.width/a[s]),height:Math.round(y.height/a[n]),extent:y,dimensions:l}}(e),{ranges:s}=e,n=Object.keys(s).sort((e,t)=>e<t?-1:1),l=[];for(let e=0;e<n.length;e++){let t=n[e];a?.length&&l.push({name:t,dimensions:a})}let o=q(e);l.forEach(e=>o[e.name]&&Object.assign(e,o[e.name]));let u=l.length?{variables:l}:void 0,f=[];for(let e=0;e<n.length;e++){let{values:r,dataType:l,axisNames:o,shape:u}=s[n[e]],h=u.length>2?e*u.slice(0,-2).reduce((e,t)=>e*t):0,c=o.slice(0,-2),p=u.slice(0,-2),d="float"===l?"f32":V(r),m=t*i,g=r.length/m;for(let s=0;s<g;s++){let n=H.A.createEmptyBand(d,m),l=new Uint8Array(m).fill(255),o=!1,u=s*m;for(let e=0;e<m;e++){let t=r[u+e];null==t?(l[e]=0,o=!0):n[e]=t}if(0===e||a?.length){let e=new H.A({width:t,height:i,mask:o?l:null,pixels:[n],pixelType:d});e.updateStatistics(),a?.length?f[G(c,p,s)+h]=e:f.push(e)}else{let e=f[s];e.pixels.push(n),o?e.mask&&=H.A.combineBandMasks([e.mask,l]):e.mask=o?l:null}}}return{extent:r,pixelBlocks:f,multidimensionalInfo:u,attributeTable:Object.values(o).find(e=>e.attributeTable)?.attributeTable,bandNames:u?void 0:n}}(t)}};(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],re.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)({constructOnly:!0})],re.prototype,"source",void 0),re=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.CovJSONRaster")],re);const ae=re;var se=i(4576),ne=i(21325),le=i(330),oe=i(43163);function ue(e,t){if(!e||!t)return null;let i=[];for(let r=0;r<e.length;r++)i.push(e[r]),i.push(t[r]);return i}function fe(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new z.A({wkid:t});if(e=String(e).trim(),(0,ne.jp)(e))return new z.A({wkt2:e});let i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;let r=i.indexOf("VERTCS"),a=i.indexOf("PROJCS"),s=a>-1?a:i.indexOf("GEOGCS");if(-1===s)return null;let n=e.slice(s,e.lastIndexOf("]",r)+1).trim(),l=e.slice(r,e.lastIndexOf("]")).trim();t=he(n);let o=t?new z.A({wkid:t}):new z.A({wkt:n}),u=he(l);return u&&(o.vcsWkid=u),o}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=he(e),0===t?new z.A({wkt:e}):new z.A({wkid:t})):null}function he(e){let t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),r=i[0]?.toLowerCase();if(("epsg"===r||"esri"===r)&&e.endsWith('"]]')){let e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function ce(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};let t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,le.g7)(e,"SRS")){if(!t.spatialReference){let i=(0,le.mX)(e);t.spatialReference=fe(i)}}else if((0,le.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){let{spatialReference:i,transform:r}=function(e){let t=(0,le.V6)(e,"GeodataXform"),i=fe((0,le.v7)(t,"SpatialReference/WKID")||(0,le.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};let r=(0,le.v7)(t,"PolynomialOrder")??1,a=(0,le.Ui)(t,"CoeffX/Double"),s=(0,le.Ui)(t,"CoeffY/Double"),n=(0,le.Ui)(t,"InverseCoeffX/Double"),l=(0,le.Ui)(t,"InverseCoeffY/Double"),o=ue(a,s),u=ue(n,l);return{spatialReference:i,transform:o&&u&&o.length&&u.length?new oe.A({spatialReference:i,polynomialOrder:r,forwardCoefficients:o,inverseCoefficients:u}):null}}(e);t.transform=r,t.spatialReference||=i}else(0,le.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,le.mX)(e));else if((0,le.g7)(e,"PAMRasterBand")){let i=function(e){let t,i,r,a,s=(0,le.v7)(e,"NoDataValue"),n=(0,le.V6)(e,"Histograms/HistItem"),l=(0,le.v7)(n,"HistMin"),o=(0,le.v7)(n,"HistMax"),u=(0,le.v7)(n,"BucketCount"),f=(0,le.mX)(n,"HistCounts")?.split("|").map(e=>Number(e));(0,le.IC)(e,"Metadata/MDI").forEach(e=>{let s=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":t=s;break;case"STATISTICS_MAXIMUM":i=s;break;case"STATISTICS_MEAN":r=s;break;case"STATISTICS_STDDEV":a=s}});let h=(0,le.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:s,histogram:f?.length&&null!=l&&null!=o?{min:l,max:o,size:u||f.length,counts:f}:null,sourceBandIndex:h,statistics:null!=t&&null!=i?{min:t,max:i,avg:r,stddev:a}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});let i=t.rasterBands;return i.length&&(t.statistics=i[0].statistics?i.map(e=>e.statistics).filter(se.Ru):null,t.histograms=i[0].histogram?i.map(e=>e.histogram).filter(se.Ru):null),t}var pe=i(85951),de=i(40951);const me="image-aux-raster:open",ge="The data is not a supported format.";let ye=class extends N.A{set rasterJobHandler(e){this._set("rasterJobHandler",e),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=e)}async fetchRawTile(e,t,i,r={}){return this._inMemoryRaster?.fetchRawTile(e,t,i,r)}async _open(e){let t,{data:i,format:r}=await this._fetchData(e),{tileGeneration:a}=this.ioConfig,s="immediate"===a||"jpg"!==r;if(s){let a=await this._decodeFullImage(i,r,e);if(!a)throw new l.A(me,"The data cannot be decoded.");t=await this._createRasterSource(a,e)}else{let r=(0,pe.R)(i);if(!r)throw new l.A(me,ge);t=await this._createRasterSource(r,e),t.encodedData=i}let{rasterJobHandler:n,ioConfig:o}=this,u=new te({preGenerateTiles:s,rasterJobHandler:n,source:t,ioConfig:{...o,sampling:"closest",skipStatistics:!0}});await u.open(e),this._set("rasterInfo",u.rasterInfo),this._inMemoryRaster=u}async _createRasterSource(e,t){let{spatialReference:i,statistics:r,histograms:a,transform:s}=await this._fetchAuxiliaryData(t),n=!i;n&&(i=new z.A({wkid:3857})),a?.length&&null==r&&(r=(0,K.Pg)(a));let{width:l,height:o}=e,u=new B.A({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:i}),f=s?s.forwardTransform(u):u,h=!0;if(s){let e=s.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(s=null,u=f)}let c=[];return"pixels"in e&&c.push(e),{name:this.datasetName,pixelBlocks:c,imageInfo:{width:l,height:o,pixelType:"u8",bandCount:3},extent:f,nativeExtent:u,transform:s,statistics:r,histograms:a,isPseudoSpatialReference:n,keyProperties:{DataType:"Processed"}}}async _fetchData(e){let{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,de.g)(t);if("jpg"!==i&&"png"!==i&&"gif"!==i&&"bmp"!==i)throw new l.A(me,ge);return this._set("datasetFormat",i.toUpperCase()),{data:t,format:i}}async _decodeFullImage(e,t,i){try{return await this.decodePixelBlock(e,{format:t,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0},i)}catch{return(0,h.Te)(i?.signal),this.decodePixelBlock(e,{format:t,canvasUsage:"no-canvas",skipStatistics:!0},i)}}async _fetchAuxiliaryData(e){let t=e?.signal,{skipExtensions:i=[],skipMapInfo:r}=this.ioConfig,a=r||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,n="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,l=r||null==n||i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),o=await(0,h.Lx)([a,l]);if(t?.aborted)throw(0,h.NK)();let u=ce(o[0].value?.data);if(!u.transform){let e=o[1].value?o[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;u.transform=6===e?.length?new oe.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],ye.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)()],ye.prototype,"rasterJobHandler",null),ye=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.ImageAuxRaster")],ye);const we=ye;var ve=i(84952),xe=i(86738),be=i(75414),Ie=i(20223),Ce=i(87045),Se=i(25943),Ae=i(82371);let _e=class extends N.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,r={}){let{storageInfo:a,extent:s}=this.rasterInfo,{transposeInfo:n}=a,l=null!=n&&!!r.transposedVariableName;if(this._slices&&!l&&null==r.sliceId)return null;let o,u,f=l?0:a.maximumPyramidLevel-e+this._levelOffset,h=`${this.url}/tile/${f}/${t}/${i}`,c={...this._slices?l?{variable:r.transposedVariableName}:{sliceId:r.sliceId||0}:null,...r.refreshParameters};if(a.isBsqTile){let e=(r.bandIds?.length?r.bandIds:[0,1,2]).map(e=>this.request(h,{query:{...c,bandId:e},responseType:"array-buffer",signal:r.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),a=new Uint8Array(i);u=[];let s=0;for(let{data:e}of t)u.push(s),a.set(new Uint8Array(e),s),s+=e.byteLength;o=a.buffer}else o=(await this.request(h,{query:c,responseType:"array-buffer",signal:r.signal})).data;if(!o)return null;let{tileInfo:p}=a,d=l?n.tileSize:p.size,m=/^(mixed|jp)/i.test(p.format),g="raw"===p.format,y=await this.decodePixelBlock(o,{format:g?"bsq":void 0,width:d[0],height:d[1],planes:u?.length,offsets:u,pixelType:g?this.rasterInfo.pixelType:void 0,isPoint:"Elevation"===this.tileType,returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue,applyJpegMask:m},{signal:r.signal});if(null==y)return null;let w=a.blockBoundary[e];if("jpg"!==a.compression||i>w.minCol&&i<w.maxCol&&t>w.minRow&&t<w.maxRow)return y;let{origin:v,blockWidth:x,blockHeight:b}=a,{x:I,y:C}=this.getPyramidPixelSize(e),S=Math.round((s.xmin-v.x)/I)%x,A=Math.round((s.xmax-v.x)/I)%x||x,_=Math.round((v.y-s.ymax)/C)%b,T=Math.round((v.y-s.ymin)/C)%b||b,R=i===w.minCol?S:0,M=t===w.minRow?_:0,O=i===w.maxCol?A:x,F=t===w.maxRow?T:b;return(0,X.z$)(y,{x:R,y:M},{width:O-R,height:F-M}),y}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;let t=e;for(let e=0;e<this._slices.length;e++){let i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{let i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){let i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),r=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),a=await Promise.all([i,r]);return a[0]&&a[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),a[1]?.[0]?.counts?.length||(a[1]=null),{statistics:a[0]||null,histograms:a[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let r=0,{maximumPyramidLevel:a}=this.rasterInfo.storageInfo,s=a-r+this._levelOffset,n=i.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,i.row,i.col,t))break}catch{}if(s--,r++,i=this.identifyPixelLocation(n,r,t.datumTransformation),null===i)return null}return-1===s||null==i?null:r}async _open(e){let t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=i.data;if(this.sourceJSON=r,!r)throw new l.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!r.tileInfo)throw new l.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();this.tileType=r.cacheType,this.tileType??=["jpg","jpeg","png","png8","png24","png32","mixed"].includes(r.tileInfo.format.toLowerCase())?"Map":"lerc"===r.tileInfo.format.toLowerCase()?"Elevation":"Raster",this.datasetName=r.name?.slice(r.name.indexOf("/")+1)??"";let a=this.rasterInfo??await this._fetchRasterInfo({signal:t});if(null==a)throw new l.A("image-server-raster:open","cannot initialize image service");(0,Ae.E9)(a,r);let s="Map"===this.tileType?function(e,t){if(!e)return null;let{minScale:i,maxScale:r,minLOD:a,maxLOD:s}=t;if(null!=a&&null!=s)return Ce.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=a&&e<=s)});if(0!==i&&0!==r){let t=e=>Math.round(1e4*e)/1e4,a=i?t(i):1/0,s=r?t(r):-1/0;return Ce.A.fromJSON({...e,lods:e.lods.filter(e=>{let i=t(e.scale);return i<=a&&i>=s})})}return Ce.A.fromJSON(e)}(r.tileInfo,r):Ce.A.fromJSON(r.tileInfo);(0,u.Lw)(s);let[n,o]=this._computeMinMaxLOD(a,s),{extent:f,pixelSize:h}=a,c=.001*Math.min(h.x,h.y);(h.x!==h.y||Math.abs(n.resolution-h.x)>c)&&(h.x=h.y=n.resolution,a.width=Math.ceil((f.xmax-f.xmin)/h.x-.1),a.height=Math.ceil((f.ymax-f.ymin)/h.y-.1));let p=n.level-o.level,[d,m]=s.size,g=[],y=[],{lods:w}=s;w.forEach((e,t)=>{e.level>=o.level&&e.level<=n.level&&g.push({x:e.resolution,y:e.resolution}),t<w.length-1&&y.push(Math.round(10*e.resolution/w[t+1].resolution)/10)}),g.sort((e,t)=>e.x-t.x);let v,x=this.computeBlockBoundary(f,d,m,s.origin,g,p),b=g.length>1?g.slice(1):null;r.transposeInfo&&(v={tileSize:[r.transposeInfo.rows,r.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});let I=y.length<=1||y.length>=3&&y.slice(0,-1).every(e=>e===y[0])?y[0]??2:Math.round(10/(o.resolution/n.resolution)**(-1/p))/10,C=!!r.bsq&&"Raster"===this.tileType;if(a.storageInfo=new Ie.A({blockWidth:s.size[0],blockHeight:s.size[1],pyramidBlockWidth:s.size[0],pyramidBlockHeight:s.size[1],pyramidResolutions:b,pyramidScalingFactor:I,compression:s.format,origin:s.origin,firstPyramidLevel:1,maximumPyramidLevel:p,tileInfo:s,isBsqTile:C,transposeInfo:v,blockBoundary:x}),function(e){let{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new be.A,e.extent=e.transform.forwardTransform(t))}(a),this._set("rasterInfo",a),r.capabilities.toLowerCase().includes("tilemap")){let e={tileInfo:a.storageInfo.tileInfo,parsedUrl:(0,ve.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Se.d({layer:e})}}async _fetchRasterInfo(e){let t=this.sourceJSON;if("Map"===this.tileType){let e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),r=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),a=z.A.fromJSON(t.spatialReference||e.spatialReference),s=new xe.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a});return new Q.A({width:i,height:r,bandCount:3,extent:B.A.fromJSON(e),spatialReference:a,pixelSize:s,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}let i={...e,query:{...this.ioConfig.customFetchParameters,f:"json"}},r=(0,Ae.Tw)(this.url,this.sourceJSON,i),a=t.hasMultidimensions?this.request(`${this.url}/slices`,i).then(e=>e.data?.slices).catch(()=>null):null,s=await Promise.all([r,a]);return this._slices=s[1],s[0]}_fixScaleInServiceInfo(){let{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){let{pixelSize:i}=e,r=.5/e.width*i.x,{lods:a}=t,s=t.lodAt(Math.max.apply(null,a.map(e=>e.level))),n=t.lodAt(Math.min.apply(null,a.map(e=>e.level))),{tileType:l}=this;if("Map"===l)return this._levelOffset=a[0].level,[s,n];if("Raster"===l)return[a.find(e=>e.resolution===i.x)??s,n];let{minScale:o,maxScale:u}=this.sourceJSON,f=s;u>0&&(f=a.find(e=>Math.abs(e.scale-u)<r),f||=a.filter(e=>e.scale>u).sort((e,t)=>e.scale>t.scale?1:-1)[0]??s);let h=n;return o>0&&(h=a.find(e=>Math.abs(e.scale-o)<r)??n,this._levelOffset=h.level-n.level),[f,h]}};(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],_e.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)()],_e.prototype,"tileType",void 0),_e=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.ImageServerRaster")],_e);const Te=_e;var Re=i(10713);const Me=new Map([["byte","u8"],["signedbyte","s8"],["int8","s8"],["uint8","u8"],["int16","s16"],["uint16","u16"],["int32","s32"],["uint32","u32"],["float32","f32"],["float64","f64"],["double64","f64"]]),Oe=new Map;Oe.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Oe.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Oe.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Oe.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),Oe.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let Fe=class extends N.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this._isBsq=!1,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,r={}){let{blockWidth:a,blockHeight:s,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[e];if(!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i)return null;let{bandCount:o,pixelType:u}=this.rasterInfo,{ranges:f,actualTileWidth:h,actualTileHeight:c}=this._getTileLocation(e,t,i);if(!f||0===f.length)return null;if(f.some(e=>e.from>e.to)){let e=new Uint8Array(a*s);return new H.A({width:a,height:s,pixels:void 0,mask:e,validPixelCount:0})}let{bandIds:p}=this.ioConfig,d=this._getBandSegmentCount(),m=[],g=0;for(g=0;g<d;g++)(!p||p.includes(g))&&m.push(this.request(this._files.data,{range:{from:f[g].from,to:f[g].to},responseType:"array-buffer",signal:r.signal}));let y=await Promise.all(m),w=y.map(e=>e.data.byteLength).reduce((e,t)=>e+t),v=new Uint8Array(w),x=[],b=0;for(g=0;g<d;g++)x.push(b),v.set(new Uint8Array(y[g].data),b),b+=y[g].data.byteLength;let I=Oe.get(this.rasterInfo.storageInfo.compression).decoderFormat,C="jpg"===I&&4===o&&1===x.length,S=await this.decodePixelBlock(v.buffer,{width:a,height:s,format:I,planes:p?.length||o,offsets:x,pixelType:u,canvasUsage:C?"no-canvas":void 0,decodeJpegAsRgb:!1},{signal:r.signal});if(null==S)return null;let{noDataValue:A}=this.rasterInfo;if(null!=A&&"lerc"!==I&&!S.mask&&(A=A[0],null!=A)){let e=S.width*S.height,t=new Uint8Array(e);if(Math.abs(A)>1e24)for(g=0;g<e;g++)Math.abs((S.pixels[0][g]-A)/A)>1e-6&&(t[g]=1);else for(g=0;g<e;g++)S.pixels[0][g]!==A&&(t[g]=1);S.mask=t}let _=0,T=0;if(h!==a||c!==s){let e=S.mask;if(e)for(g=0;g<s;g++)if(T=g*a,g<c)for(_=h;_<a;_++)e[T+_]=0;else for(_=0;_<a;_++)e[T+_]=0;else for(e=new Uint8Array(a*s),S.mask=e,g=0;g<c;g++)for(T=g*a,_=0;_<h;_++)e[T+_]=1}return S}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);let t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:r,files:a}=this._parseHeader(i.data),{skipMapInfo:s,skipExtensions:n=[]}=this.ioConfig;if(!n.includes("aux.xml")&&!s){let t=await this._fetchAuxiliaryData(e);null!=t&&(r.statistics=t.statistics??r.statistics,r.histograms=t.histograms,t.histograms&&null==r.statistics&&(r.statistics=(0,K.Pg)(t.histograms)))}s&&this.updateImageSpaceRasterInfo(r),this._set("rasterInfo",r),this._files=a;let l=await this.request(a.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw Error("invalid array buffer must be multiples of 16");let t;if(Re.Z){let i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),a=new Uint8Array(r);for(let t=0;t<e.byteLength/4;t++)for(let e=0;e<4;e++)a[4*t+e]=i[4*t+3-e];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}(l.data);let{blockWidth:o,blockHeight:u}=this.rasterInfo.storageInfo,f=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:c}=this.rasterInfo,p=[],d=this._getBandSegmentCount(),m=0,g=-1;for(;m<this._storageIndex.length;){g++;let e=Math.ceil(h/o/f**g)-1,t=Math.ceil(c/u/f**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return this._isBsq?this.rasterInfo.bandCount:1}_getTileLocation(e,t,i){let r,a,s,{blockWidth:n,blockHeight:l,pyramidScalingFactor:o}=this.rasterInfo.storageInfo,{width:u,height:f}=this.rasterInfo,h=this._getBandSegmentCount(),c=0,p=0;for(s=0;s<e;s++)p=o**s,r=Math.ceil(u/n/p),a=Math.ceil(f/l/p),c+=r*a;p=o**e,r=Math.ceil(u/n/p),a=Math.ceil(f/l/p),c+=t*r+i,c*=4*h;let d=this._storageIndex.subarray(c,c+4*h),m=0,g=0,y=[];for(let e=0;e<h;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<r-1?n:Math.ceil(u/p)-n*(r-1),actualTileHeight:t<a-1?l:Math.ceil(f/p)-l*(a-1)}}_parseHeader(e){let t=(0,le.V6)(e,"MRF_META/Raster");if(!t)throw new l.A("mrf:open","not a valid MRF format");let i=(0,le.V6)(t,"Size"),r=parseInt(i.getAttribute("x"),10),a=parseInt(i.getAttribute("y"),10),s=parseInt(i.getAttribute("c"),10),n=((0,le.mX)(t,"Compression")||"none").toLowerCase();if(!Oe.has(n))throw new l.A("mrf:open","currently does not support compression "+n);let o=(0,le.mX)(t,"DataType")||"UInt8",u=Me.get(o.toLowerCase());if(null==u)throw new l.A("mrf:open","currently does not support pixel type "+o);let f=(0,le.V6)(t,"PageSize"),h=parseInt(f.getAttribute("x"),10),c=parseInt(f.getAttribute("y"),10),p=f.getAttribute("c"),d=p?p===String(s):Oe.get(n).isOneSegment;this._isBsq=!d;let m,g=(0,le.V6)(t,"DataValues");if(g){let e=g.getAttribute("NoData");null!=e&&(m=e.trim().split(" ").map(e=>parseFloat(e)))}if((0,le.V6)(e,"MRF_META/CachedSource"))throw new l.A("mrf:open","currently does not support MRF referencing other data files");let y,w=(0,le.V6)(e,"MRF_META/GeoTags"),v=(0,le.V6)(w,"BoundingBox"),x=!1;if(null!=v){let e=parseFloat(v.getAttribute("minx")),t=parseFloat(v.getAttribute("miny")),i=parseFloat(v.getAttribute("maxx")),r=parseFloat(v.getAttribute("maxy")),a=(0,le.mX)(w,"Projection")||"",s=z.A.WGS84;if("LOCAL_CS[]"!==a)if(a.toLowerCase().startsWith("epsg:")){let e=Number(a.slice(5));!isNaN(e)&&0!==e&&(s=new z.A({wkid:e}))}else s=fe(a)??z.A.WGS84;else x=!0,s=new z.A({wkid:3857});y=new B.A(e,t,i,r),y.spatialReference=s}else x=!0,y=new B.A({xmin:-.5,ymin:.5-a,xmax:r-.5,ymax:.5,spatialReference:new z.A({wkid:3857})});let b=(0,le.V6)(e,"MRF_META/Rsets"),I=parseInt(b?.getAttribute("scale")||"2",10),C=y.spatialReference,S=new Ie.A({origin:new xe.A({x:y.xmin,y:y.ymax,spatialReference:C}),blockWidth:h,blockHeight:c,pyramidBlockWidth:h,pyramidBlockHeight:c,compression:n,pyramidScalingFactor:I}),A=new xe.A({x:y.width/r,y:y.height/a,spatialReference:C}),_=new Q.A({width:r,height:a,extent:y,isPseudoSpatialReference:x,spatialReference:C,bandCount:s,pixelType:u,pixelSize:A,noDataValue:m,storageInfo:S}),T=this._getAuxFullPath((0,le.mX)(t,"DataFile")),R=this._getAuxFullPath((0,le.mX)(t,"IndexFile"));return{rasterInfo:_,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Oe.get(n).blobExtension)}}}_getAuxFullPath(e){return!e||e.includes("\\")?null:e.includes("/")?e.startsWith(new URL(this.url).origin)?e:null:`${this.url.slice(0,this.url.lastIndexOf("/"))}/${e}`}async _fetchAuxiliaryData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ce(t)}catch{return null}}};(0,a.Cg)([(0,p.MZ)()],Fe.prototype,"_files",void 0),(0,a.Cg)([(0,p.MZ)()],Fe.prototype,"_storageIndex",void 0),(0,a.Cg)([(0,p.MZ)()],Fe.prototype,"_isBsq",void 0),(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],Fe.prototype,"datasetFormat",void 0),Fe=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.MRFRaster")],Fe);const ke=Fe;i(44208);var Pe=i(9334);function De(e){let t=e.fields,i=e.records,r=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",a=[{name:r,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),s=a.map(e=>e.name),n=[],l=0,o=0;return i.forEach(e=>{let t={};for(t[r]=l++,o=1;o<s.length;o++)t[s[o]]=e[o-1];n.push({attributes:t})}),{displayFieldName:"",fields:a,features:n}}function Ne(e){let t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};let r=t.getUint32(4,!0),a=t.getUint16(8,!0),s=t.getUint16(10,!0),n={version:i,recordCount:r,headerByteCount:a,recordByteCount:s},l=32,o=[],u=[];for(;13!==t.getUint8(l);){let i=String.fromCharCode(t.getUint8(l+11)).trim();o.push({name:(0,Pe.w)(new Uint8Array(e,l,11)),type:i,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(i)],length:t.getUint8(l+16)}),l+=32}if(l+=1,o.length>0)for(;u.length<r&&e.byteLength-l>s;){let i=[];32===t.getUint8(l)?(l+=1,o.forEach(t=>{if("C"===t.type)i.push((0,Pe.w)(new Uint8Array(e,l,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim()));else if("D"===t.type){let r=String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim();i.push(new Date(parseInt(r.slice(0,4),10),parseInt(r.slice(4,6),10)-1,parseInt(r.slice(6,8),10)))}l+=t.length}),u.push(i)):l+=s}return{header:n,fields:o,records:u,recordSet:De({fields:o,records:u})}}var Le=i(44094),Be=i(94213);const ze="none-tiled tiff is not optimized for access, convert to COG and retry.";let Ee=class extends N.A{constructor(){super(...arguments),this._bufferSize=1048576,this._chunkSize=10485760,this._fileSize=-1,this._headerChunks=[],this.datasetFormat="TIFF",this.headerInfo=null}async fetchRawTile(e,t,i,r={}){if(!this.headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;let a=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=a&&this.headerInfo.hasMaskBand){let s=await this._fetchRawTiffTile(e,t,i,!0,r);null!=s&&s.pixels[0]instanceof Uint8Array&&(a.mask=s.pixels[0])}return a}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf(".")),await this._readHeader(e?.signal),await this._fetchAllAuxData(),this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(this.rasterInfo),this.updateTileInfo()}async _readHeader(e){try{let t=await this._fetchHeaderData(0,this._bufferSize,e);if(!t)throw new l.A("tiffraster:open","failed to open url "+this.url);let{littleEndian:i,firstIFDPos:r,isBigTiff:a}=(0,Le.uT)(t),s=[],n={fileChunk:t,posIFD:r,fileOffset:0};await this._readIFDs(s,n,i,a?8:4,e);let{imageInfo:o,rasterInfo:u}=function(e){let t=(0,Le.uc)(e),{width:i,height:r,tileWidth:a,tileHeight:s,planes:n,pixelType:l,compression:o,firstPyramidLevel:u,maximumPyramidLevel:f,pyramidBlockWidth:h,pyramidBlockHeight:c,pyramidResolutions:p,tileBoundary:d,affine:m,metadata:g,colormap:y}=t,w=fe(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),v=!!t.isPseudoGeographic;w??=(v=!0,new z.A({wkid:3857}));let x=new B.A({...t.extent,spatialReference:w}),b=x?new xe.A({x:x.xmin,y:x.ymax,spatialReference:w}):new xe.A({x:0,y:0}),I=new Ie.A({blockWidth:a,blockHeight:s,pyramidBlockWidth:h,pyramidBlockHeight:c,compression:o,origin:b,firstPyramidLevel:u,maximumPyramidLevel:f,pyramidResolutions:p,blockBoundary:d}),C=new xe.A({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/r,spatialReference:w}),S=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{},A=new Q.A({width:i,height:r,bandCount:n,pixelType:l,pixelSize:C,storageInfo:I,spatialReference:w,isPseudoSpatialReference:v,keyProperties:S,extent:x,colormap:y,statistics:g?g.statistics:null});if(m?.length&&(A.nativeExtent=new B.A({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:w}),A.transform=new oe.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),A.extent=A.transform.forwardTransform(A.nativeExtent),A.pixelSize=new xe.A({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/r,spatialReference:w}),I.origin.x=-.5,I.origin.y=.5),p){let{x:e,y:t}=A.pixelSize;p.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:A}}(s),f=(0,Le.zS)(s),h=(0,Le.r9)(s);this.headerInfo={littleEndian:i,isBigTiff:a,ifds:s,pyramidIFDs:f,maskIFDs:h,...o},this._set("rasterInfo",u),this._validateHeader()}finally{this._headerChunks.length=0}}_validateHeader(){let e=this.headerInfo;if(!e.isSupported)throw new l.A("tiffraster:open","this tiff is not supported: "+e.message);if(!e.tileWidth||!e.tileHeight)throw new l.A("tiffraster:open",ze);this.rasterInfo.isPseudoSpatialReference&&o.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");let t=e.ifds[0],i=t.get("PREDICTOR")?.values?.[0];if(3===t.get("SAMPLEFORMAT")?.values?.[0]&&2===i)throw new l.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data")}async _fetchHeaderData(e,t,i){let r=this._getCachedHeaderData(e,t);if(r)return r;let a=Math.floor(e/this._bufferSize)*this._bufferSize,s=a+Math.max(1,Math.ceil((t-a)/this._bufferSize))*this._bufferSize,n=this._getMissingHeaderRanges(a,s).map(async e=>{let{from:t,to:r}=e,a=await this._fetchOffsets(t,r,i),s=this._fileSize;return{chunk:a,fileOffset:t,isEOF:s>0?t+a.byteLength>=s:a.byteLength<r-t+1}}),o=await Promise.all(n);this._headerChunks.push(...o),this._headerChunks.sort((e,t)=>e.fileOffset-t.fileOffset);let u=this._getCachedHeaderData(e,t);if(!u)throw new l.A("tiffraster:open",`failed to fetch byte range ${e}-${t} from ${this.url}`);return u}_getCachedHeaderData(e,t){let i=[],r=e;for(let{chunk:a,fileOffset:s,isEOF:n}of this._headerChunks){if(s+a.byteLength-1<r)continue;if(s>r)return null;let l=r-s,o=Math.min(t-s+1,a.byteLength);if(i.push({chunk:a,start:l,end:o}),r=s+o,r>t||n&&o===a.byteLength){let t=new Uint8Array(r-e),a=0;for(let e of i){let i=new Uint8Array(e.chunk,e.start,e.end-e.start);t.set(i,a),a+=i.byteLength}return t.buffer}}return null}_getMissingHeaderRanges(e,t){let i=[],r=(e,t)=>{let r=Math.floor(e/this._bufferSize)*this._bufferSize,a=Math.ceil(t/this._bufferSize)*this._bufferSize;i.push({from:r,to:a})},a=e;for(let{chunk:e,fileOffset:s,isEOF:n}of this._headerChunks){let l=s+e.byteLength-1;if(!(l<a)&&(s>a&&r(a,Math.min(s-1,t)),a=Math.max(a,l+1),a>t||n))return i}return a<=t&&r(a,t),i}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:a}=e;if(a+8>=i.byteLength||a<0){if(r=a+r,r<0)throw new l.A("tiffraster:open",`invalid IFD position ${r}. failed to open url ${this.url}`);i=await this._fetchHeaderData(r,r+this._bufferSize/2,t),a=0}return{fileChunk:i,fileOffset:r,posIFD:a}}async _readIFDs(e,t,i,r=4,a){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,a);let s=await this._readIFD(t,i,Be.NB,r,a);if(!s?.ifd)throw new l.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(s.ifd),!s.nextIFD)return null;t.posIFD=s.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,r,a)}async _readIFD(e,t,i=Be.NB,r=4,a){let{fileChunk:s,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;let u=(0,Le.JM)(s,t,n,o,i,r);if(u.success){let{ifd:e}=u;if(!e)throw new l.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(!(this.ioConfig.loadFullMetadata||i!==Be.NB||e.has("TILEWIDTH")&&e.has("TILELENGTH")))throw new l.A("tiffraster:open",ze);let r=[];e.forEach(e=>{e.values||r.push(e)}),r.length>0&&await this._fillOffsets(r,t,u.nextIFD,a),(0,Le.fM)(e),(0,Le.h_)(e);for(let[i,r]of Be.RR){let l=e.get(i),u=null!=l?.data&&Array.from(l.data.values()).some(e=>null==e.values&&null!=e.offlineOffsetSize);if(l&&(!l.data||u)){n=l.valueOffset-o;let e=await this._validateOrFetchHeaderBuffer({fileChunk:s,posIFD:n,fileOffset:o},a);l.data=(await this._readIFD(e,t,r,4,a))?.ifd}}return u}return u.requiredBufferSize?(s=await this._fetchHeaderData(o,o+n+u.requiredBufferSize+8,a),s.byteLength<n+u.requiredBufferSize?null:(e.fileChunk=s,e.fileOffset=o,this._readIFD(e,t,i,r,a))):null}async _fillOffsets(e,t,i,r){let a=e.filter(e=>null!=e.offlineOffsetSize);if(0===a.length)return;let s=a.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,s.map(e=>e[0])),l=Math.max.apply(null,s.map(e=>e[0]+e[1])),o=1===s.length||l-n<=this._bufferSize;if(!o&&s.length>1&&(s.sort((e,t)=>e[0]-t[0]),o=s.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,s[0][0])===l),o){let e=Math.max(l,n+this._bufferSize/4),i=await this._fetchHeaderData(n,e,r);return void a.forEach(e=>(0,Le.Cr)(i,t,e,n))}let u=a.map(async e=>{let i=e.offlineOffsetSize,a=await this._fetchHeaderData(i[0],i[1]+i[0],r);(0,Le.Cr)(a,t,e,i[0])});await Promise.all(u)}async _fetchOffsets(e,t,i){let r=[],a=this._chunkSize;this._fileSize>0&&(t=Math.min(t,this._fileSize-1));let s=Math.ceil((t-e+1)/a),n=e;for(let e=0;e<s;e++)r.push(this.request(this.url,{range:{from:n,to:e===s-1?t:n+a-1},responseType:"array-buffer",signal:i})),n+=a;let l=await Promise.all(r);if(-1===this._fileSize&&206===l[0].httpStatus){let e=l[0].getHeader?.("Content-Range"),t=Number(e?.split("/")[1]);Number.isFinite(t)&&(this._fileSize=t)}if(1===l.length)return l[0].data;let o=l.reduce((e,t)=>e+t.data.byteLength,0),u=new Uint8Array(o),f=0;for(let e of l)u.set(new Uint8Array(e.data),f),f+=e.data.byteLength;return u.buffer}async _fetchRawTiffTile(e,t,i,r,a={}){let s=this._getTileLocation(e,t,i,r);if(!s)return null;let{ranges:n,actualTileWidth:l,actualTileHeight:o,ifd:u}=s,f=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:a.signal})),h=await Promise.all(f),c=h.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===h.length?h[0].data:new ArrayBuffer(c),d=[0],m=[0];if(h.length>1){let e=new Uint8Array(p);for(let t=0,i=0;t<h.length;t++){let r=h[t].data;e.set(new Uint8Array(r),i),d[t]=i,i+=r.byteLength,m[t]=r.byteLength}}let{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),w=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this.headerInfo,ifd:u,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null},{signal:a.signal});if(null==w)return null;if(l!==g||o!==y){let e=w.mask;if(e)for(let t=0;t<y;t++){let i=t*g;if(t<o)for(let t=l;t<g;t++)e[i+t]=0;else for(let t=0;t<g;t++)e[i+t]=0}else{e=new Uint8Array(g*y),w.mask=e;for(let t=0;t<o;t++){let i=t*g;for(let t=0;t<l;t++)e[i+t]=1}}}return w}_getTileLocation(e,t,i,r=!1){let{firstPyramidLevel:a,blockBoundary:s}=this.rasterInfo.storageInfo,n=0===e?0:e-(a-1),{headerInfo:l}=this;if(!l)return null;let o=r?l.maskIFDs[n]:0===n?l.ifds[0]:l.pyramidIFDs[n-1];if(!o)return null;let u=(0,Le.XO)(o,l),f=(0,Le.wc)(o,"TILEOFFSETS"),h=(0,Le.wc)(o,"TILEBYTECOUNTS");if(!f?.length||!h?.length)return null;let{minRow:c,minCol:p,maxRow:d,maxCol:m}=s[n];if(t>d||i>m||t<c||i<p)return null;let g=(0,Le.LZ)(o,"IMAGEWIDTH"),y=(0,Le.LZ)(o,"IMAGELENGTH"),w=(0,Le.LZ)(o,"TILEWIDTH"),v=(0,Le.LZ)(o,"TILELENGTH"),x=[];if(u){let{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){let e=r*(d+1)*(m+1)+t*(m+1)+i;x[r]={from:f[e],to:f[e]+h[e]-1}}}else{let e=t*(m+1)+i;x.push({from:f[e],to:f[e]+h[e]-1})}for(let e=0;e<x.length;e++)if(null==x[e].from||!x[e].to||x[e].to<0)return null;return{ranges:x,ifd:o,actualTileWidth:i===m&&g%w||w,actualTileHeight:t===d&&y%v||v}}async _fetchAllAuxData(e){if(this.ioConfig.skipMapInfo)return;let{rasterInfo:t}=this,{skipExtensions:i=[]}=this.ioConfig,r=i.includes("aux.xml")?Promise.resolve(null):this._fetchAuxiliaryMetaData(e),a=i.includes("vat.dbf")||1!==t.bandCount||"u8"!==t.pixelType?Promise.resolve(null):this._fetchAuxiliaryTable(e),[s,n]=await Promise.all([r,a]);null!=s&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,K.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;let i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new xe.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(s,t),null!=n&&(t.attributeTable=n,t.keyProperties.DataType="thematic")}async _fetchAuxiliaryMetaData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ce(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{let{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Ne(t);return i?.recordSet?ie.A.fromJSON(i.recordSet):null}catch{return null}}};(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"_bufferSize",void 0),(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"_chunkSize",void 0),(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"_fileSize",void 0),(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"_headerChunks",void 0),(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],Ee.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"headerInfo",void 0),Ee=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.TIFFRaster")],Ee);const Je=Ee,He=new Map;He.set("MRF",{desc:"Meta Raster Format",constructor:ke}),He.set("TIFF",{desc:"GeoTIFF",constructor:Je}),He.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Te}),He.set("JPG",{desc:"JPG Raster Format",constructor:we}),He.set("PNG",{desc:"PNG Raster Format",constructor:we}),He.set("GIF",{desc:"GIF Raster Format",constructor:we}),He.set("BMP",{desc:"BMP Raster Format",constructor:we}),He.set("CovJSON",{desc:"COVJSON Raster Format",constructor:ae}),He.set("MEMORY",{desc:"In Memory Raster Format",constructor:te});class $e{static get supportedFormats(){let e=new Set;return He.forEach((t,i)=>e.add(i)),e}static async open(e){let{url:t,ioConfig:i,source:r,sourceJSON:a}=e,s=e.datasetFormat??i?.datasetFormat;s??(t.includes(".")?s=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===r?.type?.toLowerCase()?s="CovJSON":r?.extent&&r.pixelblocks&&(s="MEMORY")),"OVR"===s||"TIF"===s||"DM"===s?s="TIFF":"JPG"===s||"JPEG"===s||"JFIF"===s?s="JPG":"COVJSON"===s&&(s="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");let n={url:t,source:r,sourceJSON:a,datasetFormat:s,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(n).forEach(e=>{n[e]??delete n[e]}),s){if(!this.supportedFormats.has(s))throw new l.A("rasterfactory:open","not a supported format "+s);if("CRF"===s)throw new l.A("rasterfactory:open",`cannot open raster: ${t}`);let i=new(0,He.get(s).constructor)(n);return i.rasterJobHandler=e.rasterJobHandler,i.rasterInfo=e.rasterInfo,await i.open({signal:e.signal}),i}let o=Array.from(He.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e),u=0,f=()=>{if(s=o[u++],!s||"CRF"===s)return null;let t=new(0,He.get(s).constructor)(n);return t.rasterJobHandler=e.rasterJobHandler,t.open({signal:e.signal}).then(()=>t).catch(()=>f())};return f()}static register(e,t,i){He.has(e.toUpperCase())||He.set(e.toUpperCase(),{desc:t,constructor:i})}}var Ue=i(99235),Ze=i(10873),je=i(20437),qe=i(74797),Ve=i(22796),Ge=i(69409);const We={instance:null,refCount:0,connectionPromise:null};async function Xe(){if(We.refCount++,We.instance)return We.instance;if(!We.connectionPromise){let e=new Ge.A;We.connectionPromise=e.initialize().then(()=>{We.instance=e})}return await We.connectionPromise,We.instance}function Ke(){We.refCount--,We.refCount>0||(We.instance?.destroy(),We.instance=null,We.connectionPromise=null,We.refCount=0)}var Ye=i(24212),Qe=i(30291),et=i(88625),tt=i(59923);let it=class extends((0,C.dM)((0,O.j)((0,A.q)((0,_.A)((0,R.H)((0,S.d)((0,k.b)((0,T.G)((0,F.e)((0,I.b)((0,M.J)((0,f.M)((0,n.OU)(b.A)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new x(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,h.sg)(async(e,t,r)=>{let{save:a,saveAs:s}=await i.e(9838).then(()=>i(59838));switch(e){case 0:return a(this,t);case 1:return s(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){let t=null==e?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(h.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}destroy(){super.destroy(),this._releaseWorkerHandle=(0,u.xt)(this._releaseWorkerHandle)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[(0,qe.rZ)("Pixel Value"),(0,qe.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){let t=(0,qe.jC)(i);e.push(...t)}let r=t?.dataType,a=t?.multidimensionalInfo;if(("vector-magdir"===r||"vector-uv"===r)&&null!=a){let t=a.variables[0].unit?.trim(),i=(0,qe.DV)(t),r=(0,qe.y6)();e.push(i,r)}if(a){let t=(0,qe.AL)(a);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){let{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==qe.F_.rawServicePixelValue)),r=(0,Qe.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:a}=this.raster;return r?.fieldInfos&&a&&(0,qe.h4)(r.fieldInfos,a),r}async generateRasterInfo(e,t){let i=(0,d.PZ)(Ve.A,e);if(await this.load(),!i||"none"===i.functionName?.toLowerCase())return this.serviceRasterInfo;try{let{rasterInfo:e}=await this._openFunctionRaster(i,t);return e}catch(e){throw e instanceof l.A?e:new l.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsExportMapTiles(){let e=this._primaryRasters[0]??this.raster,t="RasterTileServer"===e?.datasetFormat,i=!!this.sourceJSON?.exportTilesAllowed,r=this.sourceJSON?.datasetFormat?.toLowerCase(),a=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&"Raster"===e?.tileType&&("cache/jpegplus"===r||"cache/jpegpng"===r);return t&&i&&("Map"===e?.tileType||a)}supportsWrite(){let e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){return this.supportsWrite()?super.write(e,t):((0,tt.U4)(t,this),null)}async hasDataChanged(){try{let e=this._primaryRasters[0]??this.raster,{dataChanged:t,updates:i}=await e.refresh();return t&&(this.serviceRasterInfo!==e.rasterInfo&&this._set("serviceRasterInfo",e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),i&&this.read(i,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0})),t}catch{return!1}}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=(0,P.qg)(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{let{url:t,rasterFunction:i,source:r}=this;if(!t&&!r)throw new l.A("imagery-tile-layer:open","missing url or source parameter");r?await this._openFromSource(r,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}let i=this.raster.rasterInfo;if(!i)throw new l.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){let e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||=this.raster.datasetName,"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,c.wB)(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=(0,P.pb)(e),this.url||=this._primaryRasters[0].url}async _openFromUrlWithRasterFunction(e,t,i){let r,a=[e];t&&(0,Ue.UD)(t.toJSON(),a),a.some(e=>at(e,this.ioConfig))&&(r=await Xe(),this._releaseWorkerHandle={remove:()=>Ke()});let s=await Promise.all(a.map(e=>$e.open({url:e,rasterInfo:1===a.length?this.serviceRasterInfo:void 0,sourceJSON:1===a.length?this.sourceJSON:void 0,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:r,signal:i}))),n=s.findIndex(e=>null==e);if(n>-1)throw new l.A("imagery-tile-layer:open",`cannot open raster: ${a[n]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){let i;at(e,this.ioConfig)&&(i=await Xe(),this._releaseWorkerHandle={remove:()=>Ke()});let r=await $e.open({url:e,rasterInfo:this.serviceRasterInfo,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:i,signal:t});if(null==r)throw new l.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){let i="the tiled imagery data source is not supported",r="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!r)throw new l.A("imagery-tile-layer:open",i);"MEMORY"===r&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});let a=await $e.open({url:"",source:e,datasetFormat:r,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==a)throw new l.A("imagery-tile-layer:open",i);this._primaryRasters=[a],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=a}async _openFunctionRaster(e,t){let i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);let r=(0,Ue.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),a=new D.A({rasterFunction:r});return await a.open(t),a}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof l.A&&o.A.getLogger(this).error("imagery-tile-layer:open",e.message),o.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){(0,Ye.XF)(o.A.getLogger(this),(0,Ye.$7)("ImageryTile layers","relative-to-scene",e)),(0,Ye.XF)(o.A.getLogger(this),(0,Ye.tW)("ImageryTile layers",e))}};(0,a.Cg)([(0,p.MZ)({clonable:!1})],it.prototype,"_primaryRasters",void 0),(0,a.Cg)([(0,p.MZ)({clonable:!1})],it.prototype,"_releaseWorkerHandle",void 0),(0,a.Cg)([(0,p.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],it.prototype,"charts",void 0),(0,a.Cg)([(0,p.MZ)({type:et.A,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],it.prototype,"elevationInfo",null),(0,a.Cg)([(0,p.MZ)({type:Ce.A})],it.prototype,"tileInfo",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,clonable:!1})],it.prototype,"graphicOrigin",void 0),(0,a.Cg)([(0,p.MZ)(Ze.fV)],it.prototype,"legendEnabled",void 0),(0,a.Cg)([(0,p.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],it.prototype,"isReference",void 0),(0,a.Cg)([(0,p.MZ)({type:["show","hide"]})],it.prototype,"listMode",void 0),(0,a.Cg)([(0,p.MZ)({json:{read:!0,write:!0}})],it.prototype,"blendMode",void 0),(0,a.Cg)([(0,p.MZ)({type:Ve.A,json:{name:"renderingRule",write:!0}})],it.prototype,"rasterFunction",void 0),(0,a.Cg)([(0,p.MZ)()],it.prototype,"sourceJSON",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],it.prototype,"version",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],it.prototype,"type",void 0),(0,a.Cg)([(0,p.MZ)({type:["ArcGISTiledImageServiceLayer"]})],it.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,p.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],it.prototype,"popupEnabled",void 0),(0,a.Cg)([(0,p.MZ)({type:s.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],it.prototype,"popupTemplate",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0})],it.prototype,"defaultPopupTemplate",null),(0,a.Cg)([(0,p.MZ)(Ze.PY)],it.prototype,"screenSizePerspectiveEnabled",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,type:[je.A]})],it.prototype,"fields",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,type:[je.A]})],it.prototype,"rasterFields",null),(0,a.Cg)([(0,p.MZ)({constructOnly:!0})],it.prototype,"source",void 0),it=(0,a.Cg)([(0,p.$K)("esri.layers.ImageryTileLayer")],it);const rt=it;function at(e,t){let{tileGeneration:i}=t??{};return"immediate"===i||/\.(png|gif|bmp)$/i.test(e)}},18768(e,t,i){var r=i(32198),a=i(53966),s=i(91429),n=i(60694);i.d(t,["b",0,e=>{let t=e,i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){let e=(0,n.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Jf)(e,a.A.getLogger(this)))}};return(0,r.Cg)([(0,s.MZ)()],i.prototype,"title",null),(0,r.Cg)([(0,s.MZ)({type:String})],i.prototype,"url",null),i=(0,r.Cg)([(0,s.$K)("esri.layers.mixins.ArcGISService")],i),i}])},56551(e,t,i){i.d(t,{H:()=>h});var r=i(32198),a=i(91429),s=i(69540),n=i(25482),l=i(78888),o=i(94359),u=i(93223);let f=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,r.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"name",void 0),(0,r.Cg)([(0,a.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,u.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],f.prototype,"method",void 0),(0,r.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"value",void 0),(0,r.Cg)([(0,a.MZ)({type:[l.jz],json:{write:{isRequired:!0}}})],f.prototype,"bandIds",void 0),(0,r.Cg)([(0,a.MZ)({types:o.uy,json:{write:!0,origins:{"web-scene":{types:o.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],f.prototype,"renderer",void 0),f=(0,r.Cg)([(0,a.$K)("esri.renderers.support.RasterPresetRenderer")],f);const h=e=>{let t=e,i=class extends t{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,r.Cg)([(0,a.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],i.prototype,"activePresetRendererName",void 0),(0,r.Cg)([(0,a.MZ)({type:[f],json:{name:"layerDefinition.presetRenderers",write:!0}})],i.prototype,"presetRenderers",void 0),i=(0,r.Cg)([(0,a.$K)("esri.layers.mixins.RasterPresetRendererMixin")],i),i}},10333(e,t,i){i.d(t,{A:()=>n});var r=i(32198),a=i(25482),s=i(91429);let n=class extends a.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,r.Cg)([(0,s.MZ)()],n.prototype,"affectsPixelSize",null),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],n.prototype,"spatialReference",void 0),n=(0,r.Cg)([(0,s.$K)("esri.layers.raster.transforms.BaseRasterTransform")],n)},75414(e,t,i){i.d(t,{A:()=>o});var r,a=i(32198),s=i(91429),n=i(10333),l=i(93223);let o=r=class extends n.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new r({tolerance:this.tolerance})}};(0,a.Cg)([(0,l.e)({GCSShiftXform:"gcs-shift"})],o.prototype,"type",void 0),(0,a.Cg)([(0,s.MZ)()],o.prototype,"tolerance",void 0),o=r=(0,a.Cg)([(0,s.$K)("esri.layers.raster.transforms.GCSShiftTransform")],o)},43163(e,t,i){i.d(t,{A:()=>d});var r,a=i(32198),s=i(91429),n=i(5443),l=i(86738),o=i(10333),u=i(36005),f=i(43937),h=i(93223);function c(e,t,i){let{x:r,y:a}=t;if(i<2)return{x:e[0]+r*e[2]+a*e[4],y:e[1]+r*e[3]+a*e[5]};if(2===i){let t=r*r,i=a*a,s=r*a;return{x:e[0]+r*e[2]+a*e[4]+t*e[6]+s*e[8]+i*e[10],y:e[1]+r*e[3]+a*e[5]+t*e[7]+s*e[9]+i*e[11]}}let s=r*r,n=a*a,l=r*a,o=s*r,u=s*a,f=r*n,h=a*n;return{x:e[0]+r*e[2]+a*e[4]+s*e[6]+l*e[8]+n*e[10]+o*e[12]+u*e[14]+f*e[16]+h*e[18],y:e[1]+r*e[3]+a*e[5]+s*e[7]+l*e[9]+n*e[11]+o*e[13]+u*e[15]+f*e[17]+h*e[19]}}function p(e,t,i){let{xmin:r,ymin:a,xmax:s,ymax:l,spatialReference:o}=t,u=[];if(i<2)u.push({x:r,y:l}),u.push({x:s,y:l}),u.push({x:r,y:a}),u.push({x:s,y:a});else{let e=10;for(let t=0;t<e;t++)u.push({x:r,y:a+(l-a)*t/(e-1)}),u.push({x:s,y:a+(l-a)*t/(e-1)});e=8;for(let t=1;t<=e;t++)u.push({x:r+(s-r)*t/e,y:a}),u.push({x:r+(s-r)*t/e,y:l})}u=u.map(t=>c(e,t,i));let f=u.map(e=>e.x),h=u.map(e=>e.y);return new n.A({xmin:Math.min.apply(null,f),xmax:Math.max.apply(null,f),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}let d=r=class extends o.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){let{coeffX:i,coeffY:r}=t;if(!i?.length||!r?.length||i.length!==r.length)return null;let a=[];for(let e=0;e<i.length;e++)a.push(i[e]),a.push(r[e]);return a}writeForwardCoefficients(e,t,i){let r=[],a=[];for(let t=0;t<e?.length;t++)t%2==0?r.push(e[t]):a.push(e[t]);t.coeffX=r,t.coeffY=a}get inverseCoefficients(){let e=this._get("inverseCoefficients"),t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){let[t,i,r,a,s,n]=e,l=r*n-s*a,o=s*a-r*n;return[(s*i-t*n)/l,(r*i-t*a)/o,n/l,a/o,-s/l,-r/o]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){let{inverseCoeffX:i,inverseCoeffY:r}=t;if(!i?.length||!r?.length||i.length!==r.length)return null;let a=[];for(let e=0;e<i.length;e++)a.push(i[e]),a.push(r[e]);return a}writeInverseCoefficients(e,t,i){let r=[],a=[];for(let t=0;t<e?.length;t++)t%2==0?r.push(e[t]):a.push(e[t]);t.inverseCoeffX=r,t.inverseCoeffY=a}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){let t=c(this.forwardCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){let t=c(this.inverseCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new r({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,a.Cg)([(0,s.MZ)()],d.prototype,"forwardCoefficients",void 0),(0,a.Cg)([(0,u.w)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,a.Cg)([(0,f.K)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,a.Cg)([(0,u.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,a.Cg)([(0,f.K)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,a.Cg)([(0,s.MZ)()],d.prototype,"affectsPixelSize",null),(0,a.Cg)([(0,h.e)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=r=(0,a.Cg)([(0,s.$K)("esri.layers.raster.transforms.PolynomialTransform")],d)},25943(e,t,i){i.d(t,{d:()=>I});var r,a=i(32198),s=i(56507),n=i(69622),l=i(49186),o=i(36563),u=(i(44208),i(66344)),f=i(15142),h=i(17676),c=i(36708),p=i(76030),d=i(84952),m=i(91429),g=i(72802),y=i(4718),w=i(69397);class v{constructor(e){!function(e){if(!e?.location)throw new l.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new l.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new l.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new l.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new l.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);let{location:t,data:i}=e;this.location=Object.freeze((0,y.o8)(t));let r=this.location.width,a=this.location.height,s=!0,n=!0,o=function(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Uint32Array(e)}(Math.ceil(r*a/32)),u=0;for(let e=0;e<i.length;e++){let t=e%32;i[e]?(n=!1,o[u]|=1<<t):s=!1,31===t&&++u}n?(this._availability="unavailable",this.byteSize=40):s?(this._availability="available",this.byteSize=40):(this._availability=o,this.byteSize=40+(0,w.Qf)(o))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;let i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,a=i>>5,s=this._availability;return a<0||a>s.length?"unknown":s[a]&1<<r?"available":"unavailable"}static fromDefinition(e,t){let i=e.service.request||s.A,{row:r,col:a,width:n,height:o}=e,u={query:{f:"json"}};return t=t?{...u,...t}:u,i(function(e){let t;if(e.service.tileServers?.length){let i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;let i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:r,left:a,width:n,height:o},valid:!0,data:Array(n*o).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==r||e.location.left!==a||e.location.width!==n||e.location.height!==o))throw new l.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:a,width:n,height:o}});return v.fromJSON(e)})}static fromJSON(e){return Object.freeze(new v(e))}}function x(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function b(e,t,i){return new l.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let I=class extends n.A{static{r=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=s.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new u.q(2097152),this.addHandles((0,c.wB)(()=>{let{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),c.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";let r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(b(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof v){let a=r.getAvailability(t,i);if("unavailable"===a)throw b(e,t,i);return a}if((0,h.zf)(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,a){r.level=e,r.row=t,r.col=i;let s=this.layer.tileInfo;s.updateTileInfo(r);let n=this.fetchAvailability(e,t,i,a).catch(e=>{if((0,h.zf)(e))throw e;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,a);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,a,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,a,s){if(!this._prefetchingEnabled)return;let n=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(n))return;let l=new AbortController;s.then(()=>l.abort(),()=>l.abort());let u=!1,f=(0,o.hA)(()=>{u||(u=!0,l.abort())});if(this.addHandles(f,n),await(0,p.md)(10,l.signal).catch(()=>{}),u||(u=!0,this.removeHandles(n)),(0,h.G4)(l))return;let c=new g.U(e,t,i),d={...a,signal:l.signal},m=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&m.upsampleTile(c);++e){let e=this.fetchAvailability(c.level,c.row,c.col,d);r._prefetches.push(e);let t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new f.A({initialSize:r._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new l.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));let a=this._tmpTilemapDefinition,s=this._tilemapFromCache(e,t,i,a);if(s)return Promise.resolve(s);let n=r?.signal;return r={...r,signal:null},new Promise((e,t)=>{(0,h.u7)(n,()=>t((0,h.NK)()));let i=x(a),s=this._pendingTilemapRequests[i];if(!s){s=v.fromDefinition(a,r).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));let e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;let{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,d.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;let a=x(r);return this._tilemapCache.get(a)}get test(){}};(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"layer",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"minLOD",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"maxLOD",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"request",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"size",void 0),I=r=(0,a.Cg)([(0,m.$K)("esri.layers.support.TilemapCache")],I)},82371(e,t,i){i.d(t,{E9:()=>d,Tw:()=>c,X6:()=>p});var r=i(56507),a=i(5443),s=i(86738),n=i(16930),l=i(87186),o=i(20223),u=i(2272),f=i(22671);async function h(e,t,i){let h=(0,u.Dl)(e),{rasterFunction:c,sourceJSON:p}=t||{},d=c?JSON.stringify(c.rasterFunctionDefinition||c):null,m=(0,u.lF)({...h.query,renderingRule:d,f:"json"}),g=(0,u.jV)(m,i);e=h.path;let y=p||await(0,r.A)(e,g).then(e=>e.data),{currentVersion:w}=y,v=y.hasRasterAttributeTable?(0,r.A)(`${e}/rasterAttributeTable`,g):null,x=y.hasColormap?(0,r.A)(`${e}/colormap`,g):null,b=y.hasHistograms?(0,r.A)(`${e}/histograms`,g):null,I=w>=10.3?(0,r.A)(`${e}/keyProperties`,g):null,C=y.hasMultidimensions?(0,r.A)(`${e}/multidimensionalInfo`,g):null,S=(c?w>=10.91:w>=10.81)?(0,r.A)(`${e}/statistics`,g):null,A=await Promise.allSettled([v,x,b,I,C,S]),_=a.A.fromJSON(y.extent),T=Math.ceil(_.width/y.pixelSizeX-.1),R=Math.ceil(_.height/y.pixelSizeY-.1),M=n.A.fromJSON(y.spatialReference||y.extent.spatialReference),O="fulfilled"===A[0].status?A[0].value?.data:null,F=O?.features?.length?f.A.fromJSON(O):null,k="fulfilled"===A[1].status?A[1].value?.data.colormap:null,P=k?.length?k:null,D="fulfilled"===A[2].status?A[2].value?.data.histograms:null,N=D?.[0]?.counts?.length?D:null,L="fulfilled"===A[3].status?A[3].value?.data??{}:{},B="fulfilled"===A[4].status?A[4].value?.data.multidimensionalInfo:null,z=B?.variables?.length?B:null;var E;(E=z)&&E.variables.forEach(e=>{e.statistics?.length&&e.statistics.forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),e.dimensions?.forEach(e=>{"StdTime"===e.name&&!e.recurring&&!e.unit&&(e.unit="ISO8601")})});let J=function(e,t){let i=null;t&&t.length===e.bandCount&&(i=t.map(e=>{let t=e.covariances?.trim(),i=t?t.split(",").map(Number):void 0;return{avg:e.mean,count:e.count,max:e.max,median:e.median,min:e.min,mode:e.mode,stddev:e.standardDeviation,sum:e.sum,covariances:i}}));let r=e.minValues?.length===e.bandCount?e.minValues.map((t,i)=>({min:t,max:e.maxValues[i],avg:e.meanValues[i],stddev:e.stdvValues[i]})):null;return null==r||null==i||i.some((e,t)=>e.min!==r[t]?.min||e.max!==r[t]?.max||e.avg!==r[t]?.avg||e.stddev!==r[t]?.stddev)?r:i}(y,"fulfilled"===A[5].status?A[5].value?.data.statistics:null),{defaultVariable:H,serviceDataType:$}=y;H&&H!==L.DefaultVariable&&(L.DefaultVariable=H),$?.includes("esriImageServiceDataTypeVector")&&!$.includes(L.DataType)&&(L.DataType=$.replace("esriImageServiceDataType",""));let U=y.noDataValue;y.noDataValues?.length&&y.noDataValues.some(e=>e!==U)&&(U=y.noDataValues);let Z=y.transposeInfo?new o.A({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new s.A({x:y.extent.xmin,y:y.extent.ymax,spatialReference:M}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(T,R))/Math.LN2-8)),transposeInfo:y.transposeInfo}):void 0;return new l.A({width:T,height:R,bandCount:y.bandCount,extent:a.A.fromJSON(y.extent),spatialReference:M,pixelSize:new s.A({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:M}),pixelType:y.pixelType.toLowerCase(),statistics:J,attributeTable:F,colormap:P,histograms:N,keyProperties:L,noDataValue:U,multidimensionalInfo:z,storageInfo:Z})}function c(e,t,i){return h(e,{sourceJSON:t},i)}function p(e,t,i){return h(e,{rasterFunction:t},i)}function d(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}},2272(e,t,i){i.d(t,{Dl:()=>u,gf:()=>h,jV:()=>o,lF:()=>f});var r=i(92602),a=i(70333),s=i(4718),n=i(84952),l=i(926);function o(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,n.An)(e):(0,s.o8)(e)}function f(e,t,i){let r={};for(let a in e){if("declaredClass"===a)continue;let s=e[a];if(null!=s&&"function"!=typeof s)if(Array.isArray(s))r[a]=s.map(e=>f(e));else if("object"==typeof s)if(s.toJSON){let e=s.toJSON(i?.[a]);r[a]=t?e:JSON.stringify(e)}else r[a]=t?s:JSON.stringify(s);else r[a]=s}return r}async function h(e,t,s){return function(e,t){return e?t&&(0,l.Qc)(e)?t:(0,l.getApiKey)(e)??a.id?.findCredential(e)?.token:null}(e,t)||(!a.id&&r.A.request.useIdentity&&await Promise.all([i.e(6361),i.e(6475),i.e(3713)]).then(()=>i(50148)),(await a.id.getCredential(e,s))?.token)}},24212(e,t,i){i.d(t,{$7:()=>o,B:()=>l,M7:()=>h,XF:()=>f,tW:()=>u,w7:()=>n});var r=i(56512),a=i(86211),s=i(16271);function n(e,t){return function(e,t){return t?.mode?t.mode:function(e){return e?c:p}(e).mode}(null==e||(e.hasZ??!1),t)}function l(e,t,i){return i&&i.mode!==t?`${e} only support ${t} elevation mode`:null}function o(e,t,i){return i?.mode===t?`${e} do not support ${t} elevation mode`:null}function u(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function f(e,t){t&&e.warn(".elevationInfo=",t)}function h(e){return(e?.offset??0)*(0,s.Ao)(e?.unit)}(0,r.B)((e,t,i)=>{if(!e||"decimal-degrees"===t)return 0;let r="unknown"!==t&&t?t:"meters",s=(0,a.mq)(i);return s?(0,a.oU)(e,r,s):0});const c={mode:"absolute-height",offset:0},p={mode:"on-the-ground",offset:null}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1137],{56512(e,t,i){function r(e){let t,i,r=[],a=!1;return function(...s){return a&&t===this&&function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}(s,r)||(i=e.apply(this,s),t=this,r=s,a=!0),i}}i.d(t,{B:()=>r})},69397(e,t,i){i.d(t,{Qf:()=>o,Qh:()=>n,lM:()=>s,ro:()=>u,rq:()=>f});var r=i(44208),a=i(34275);function s(e){if(!e)return 0;let t=h;for(let i in e)e.hasOwnProperty(i)&&(t+=l(e[i],!1));return t}function n(e){if(!e)return 0;if("number"==typeof e[0])return o(e);if(Array.isArray(e))return function(e){let t=e.length;if(0===t||"number"==typeof e[0])return f(e,8);let i=c;for(let r=0;r<t;r++)i+=l(e[r]);return i}(e);let t=h;for(let i in e)e.hasOwnProperty(i)&&(t+=l(e[i]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?n(e):h;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function o(...e){return e.reduce((e,t)=>e+u(t),0)}function u(e,t=16){return e?(0,a.iu)(e)?e.byteLength+d:Array.isArray(e)?f(e,t):0:0}function f(e,t){return c+e.length*t}const h=32,c=16,p=(0,r.A)("ios")||!(0,r.A)("chrome")&&!(0,r.A)("opr")?8:4,d=145;i.d(t,["JY",0,p])},5359(e,t,i){i.d(t,{Z:()=>a});const r=Symbol("isImageryTileGraphicOrigin");function a(e){return!!e&&r in e}i.d(t,["H",0,r])},11137(e,t,i){i.r(t),i.d(t,{default:()=>rt});var r,a=i(32198),s=i(40124),n=i(69540),l=i(49186),o=i(53966),u=i(97768),f=i(25728),h=i(17676),c=i(36708),p=i(91429),d=i(78888),m=i(41910),g=i(60950),y=i(89808),w=i(99959),v=i(5359);class x extends w.A{get[(r=v.H,g.ym)](){return this.layer}get[y.Q](){return this.layer}get[m.e7](){return this.layer}constructor(e){super(),this[r]=!0,this.type="imagery-tile",this.layer=e}get id(){return this.layer.id}}var b=i(4146),I=i(18768),C=i(63074),S=i(69208),A=i(34287),_=i(8303),T=i(72545),R=i(56551),M=i(54310),O=i(25036),F=i(82935),k=i(82806),P=i(7548),D=i(23636),N=i(49859),L=i(68197),B=i(5443),z=i(16930),E=i(73444),J=i(94778),H=i(14140);function $(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function U(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function Z(e){let t=(0,E.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function j(){return Math.round(255*Math.random())}function q(e){let t={},{parameters:i}=e;if(!i)return t;for(let[e,r]of Object.entries(i)){let{type:i,description:a,unit:s,categoryEncoding:n,observedProperty:l}=r;if("Parameter"===i&&(t[e]={},a&&(t[e].description=Z(a)),s&&(t[e].unit=s.label?Z(s.label):null,t[e].symbol=s.symbol?.value),n)){let i=Object.entries(n).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})),r=!1;l?.categories?.length&&(l.categories.forEach(e=>{if(!e.id)return;let t=e.id.slice(e.id.lastIndexOf("/")+1),a=i.find(e=>e.ClassName===t);if(a&&(a.Label=e.label?Z(e.label):null,e.preferredColor)){let t=L.A.fromHex(e.preferredColor);t&&(r=!0,a.Red=t.r,a.Green=t.g,a.Blue=t.b)}}),r&&i.forEach(e=>{e.Red??(e.Red=j(),e.Green=j(),e.Blue=j())}));let a={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};r&&a.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=a}}return t}function V(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let r=0;r<e.length;r++){let a=e[r];null!=a&&(a<t&&(t=a),a>i&&(i=a))}return(0,J.X1)(t,i)}function G(e,t,i){let r=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),a=(e=>t=>e*=t.count)(1),s=[...r.slice(1),{name:"",count:1}].reverse().map(a).reverse(),n=0;for(let a=e.length-1;a>=0;a--){let l=r.findIndex(({name:t})=>t===e[a]);n+=s[l]*(i%t[a]),i=Math.floor(i/t[a])}return n}var W=i(4366),X=i(47520),K=i(51927),Y=i(45617),Q=i(87186);let ee=class extends N.A{constructor(){super(...arguments),this._pixelBlockTiles=new Map,this.datasetFormat="MEMORY",this.preGenerateTiles=!0,this.source=null}get url(){return""}async fetchRawTile(e,t,i,r={}){let a=`${e}/${t}/${i}`,s=this._pixelBlockTiles.get(a);if(s)return s;if(!this.source)return null;let{rasterInfo:n}=this,[l,o]=n.storageInfo.tileInfo.size,{sliceId:u}=r,{encodedData:f}=this.source;if(f){let s=await this.decodePixelBlock(f,{tileSize:[l,o],tileIndex:[e,t,i],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0},{signal:r.signal});return s&&this._pixelBlockTiles.set(a,s),s}let{pixelBlocks:h}=this.source,c=null==u?h[0]:h[u];if(null==c)return null;let p={pixelBlock:c,useBilinear:"thematic"!==n.dataType,tileSize:{width:l,height:o},level:e,row:t,col:i};return this.rasterJobHandler?this.rasterJobHandler.clipTile(p,r):(0,X.J$)(p)}async _open(e){if(!this.source)throw new l.A("in-memory-raster:open","source is required to open an in memory raster");let t=this.source;this.datasetName=t.name;let{pixelBlocks:i,attributeTable:r,statistics:a,histograms:s,nativeExtent:n,transform:o,colormap:u}=t,f=i[0],{width:h,height:c,pixelType:p}=f??t.imageInfo,d=t.extent??new B.A({xmin:-.5,ymin:.5,xmax:h-.5,ymax:c-.5,spatialReference:new z.A({wkid:3857})}),m=t.isPseudoSpatialReference??!t.extent,g={x:d.width/h,y:d.height/c},y={...t.keyProperties};t.dataType&&(y.DataType=t.dataType),t.bandInfos&&(y.BandProperties=t.bandInfos.map(e=>e.toJSON())),r&&(y.DataType="Thematic");let w=new Q.A({width:h,height:c,pixelType:p,extent:d,nativeExtent:n,attributeTable:r,colormap:u,transform:o,pixelSize:g,spatialReference:d.spatialReference,bandCount:f?.pixels.length??t.imageInfo.bandCount,keyProperties:y,multidimensionalInfo:t.multidimensionalInfo,statistics:a,isPseudoSpatialReference:m,histograms:s});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(w),this.createRemoteDatasetStorageInfo(w,512,512),this._set("rasterInfo",w),this.updateTileInfo(),w.multidimensionalInfo?await this._buildMDimStats(i,w.multidimensionalInfo):this.preGenerateTiles&&f&&(await this._buildInMemoryRaster(f,{width:512,height:512},e),this.source=null)}async _buildInMemoryRaster(e,t,i){let{rasterInfo:r}=this,a=r.storageInfo.maximumPyramidLevel??0,s="thematic"!==r.dataType,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:a,useBilinear:s},i):Promise.resolve((0,X.lD)(e,t,a,s)),o=null!=r.statistics,u=null!=r.histograms,f=this.ioConfig.skipStatistics||o?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,K.f4)(e)),c=await(0,h.Lx)([n,f]);if(!c[0].value)throw new l.A("in-memory-raster:open","failed to build in memory raster");this._pixelBlockTiles=c[0].value,o||(r.statistics=c[1].value?.statistics),u||(r.histograms=c[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let r=0;r<t.variables.length;r++){let a=t.variables[r];if(a.statistics)continue;let s=a.dimensions.map(e=>new Y.A({variableName:a.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),n=(0,W.NG)(s,t),l=null==n?null:e[n];if(null==l)continue;let o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},i):(0,K.eH)(l);a.statistics=o.statistics,a.histograms||=o.histograms}}};(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],ee.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)({constructOnly:!0})],ee.prototype,"preGenerateTiles",void 0),(0,a.Cg)([(0,p.MZ)()],ee.prototype,"source",void 0),(0,a.Cg)([(0,p.MZ)()],ee.prototype,"url",null),ee=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.InMemoryRaster")],ee);const te=ee;var ie=i(22671);let re=class extends N.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,r={}){return this._inMemoryRaster.fetchRawTile(e,t,i,r)}async _open(e){let{extent:t,pixelBlocks:i,multidimensionalInfo:r,attributeTable:a,bandNames:s}=await this._fetchData(e),{statistics:n,histograms:l}=(0,K.eH)(i[0]),o=s?.map(e=>({BandName:e})),u={DataType:a?"Thematic":r?"Scientific":"Generic",BandProperties:o},f=new te({source:{extent:t,pixelBlocks:i,attributeTable:a?ie.A.fromJSON(a):null,multidimensionalInfo:r,statistics:n,histograms:l,keyProperties:u,isPseudoSpatialReference:!1}});await f.open(),this._inMemoryRaster=f;let h=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",h.slice(0,h.indexOf("."))),this._set("rasterInfo",f.rasterInfo)}async _fetchData(e){let t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new l.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new l.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new l.A(i,"Missing domain referencing in the grid coverage data");let r=Object.values(t.ranges);for(let e=0;e<r.length;e++){let{axisNames:t,shape:a,type:s,values:n}=r[e];if(!("ndarray"===s.toLowerCase()&&n?.length&&t?.length&&a?.length))throw new l.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!$(t[t.length-1])||!U(t[t.length-2]))throw new l.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){let{width:t,height:i,extent:r,dimensions:a}=function(e){let{axes:t}=e.domain,i=Object.keys(t),r=[],a=[],s=-1,n=-1,l=[];for(let e=0;e<i.length;e++){let o=i[e];$(o)?s=e:U(o)&&(n=e);let u=t[o],f=[];if("values"in u){u.values.forEach(e=>f.push("string"==typeof e?new Date(e).getTime():e));let e=f[1]-f[0];r.push([f[0]-.5*e,f[f.length-1]+.5*e]),a.push(e)}else{let{start:e,stop:t,num:i}=u,s=(t-e)/(i-1);r.push([e-.5*s,t+.5*s]),a.push(s);for(let t=0;t<i;t++)f.push(e+s*t)}l.push({name:o,values:f,extent:[f[0],f[f.length-1]]})}s>-1&&-1===n?n=+(0===s):n>-1&&-1===s?s=+(0===n):-1===n&&-1===s&&(s=0,n=1),l=l.filter((e,t)=>t!==s&&t!==n);let{referencing:o}=e.domain,u=o.find(e=>e.coordinates.includes(i[s])).system.id,f=u?.slice(u.lastIndexOf("/")+1),h=null==f||"CRS84"===f?4326:Number(f),c=new z.A({wkid:h}),[p,d]=r[s],[m,g]=r[n],y=new B.A({xmin:p,xmax:d,ymin:m,ymax:g,spatialReference:c});return{width:Math.round(y.width/a[s]),height:Math.round(y.height/a[n]),extent:y,dimensions:l}}(e),{ranges:s}=e,n=Object.keys(s).sort((e,t)=>e<t?-1:1),l=[];for(let e=0;e<n.length;e++){let t=n[e];a?.length&&l.push({name:t,dimensions:a})}let o=q(e);l.forEach(e=>o[e.name]&&Object.assign(e,o[e.name]));let u=l.length?{variables:l}:void 0,f=[];for(let e=0;e<n.length;e++){let{values:r,dataType:l,axisNames:o,shape:u}=s[n[e]],h=u.length>2?e*u.slice(0,-2).reduce((e,t)=>e*t):0,c=o.slice(0,-2),p=u.slice(0,-2),d="float"===l?"f32":V(r),m=t*i,g=r.length/m;for(let s=0;s<g;s++){let n=H.A.createEmptyBand(d,m),l=new Uint8Array(m).fill(255),o=!1,u=s*m;for(let e=0;e<m;e++){let t=r[u+e];null==t?(l[e]=0,o=!0):n[e]=t}if(0===e||a?.length){let e=new H.A({width:t,height:i,mask:o?l:null,pixels:[n],pixelType:d});e.updateStatistics(),a?.length?f[G(c,p,s)+h]=e:f.push(e)}else{let e=f[s];e.pixels.push(n),o?e.mask&&=H.A.combineBandMasks([e.mask,l]):e.mask=o?l:null}}}return{extent:r,pixelBlocks:f,multidimensionalInfo:u,attributeTable:Object.values(o).find(e=>e.attributeTable)?.attributeTable,bandNames:u?void 0:n}}(t)}};(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],re.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)({constructOnly:!0})],re.prototype,"source",void 0),re=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.CovJSONRaster")],re);const ae=re;var se=i(4576),ne=i(21325),le=i(330),oe=i(43163);function ue(e,t){if(!e||!t)return null;let i=[];for(let r=0;r<e.length;r++)i.push(e[r]),i.push(t[r]);return i}function fe(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new z.A({wkid:t});if(e=String(e).trim(),(0,ne.jp)(e))return new z.A({wkt2:e});let i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;let r=i.indexOf("VERTCS"),a=i.indexOf("PROJCS"),s=a>-1?a:i.indexOf("GEOGCS");if(-1===s)return null;let n=e.slice(s,e.lastIndexOf("]",r)+1).trim(),l=e.slice(r,e.lastIndexOf("]")).trim();t=he(n);let o=t?new z.A({wkid:t}):new z.A({wkt:n}),u=he(l);return u&&(o.vcsWkid=u),o}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=he(e),0===t?new z.A({wkt:e}):new z.A({wkid:t})):null}function he(e){let t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),r=i[0]?.toLowerCase();if(("epsg"===r||"esri"===r)&&e.endsWith('"]]')){let e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function ce(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};let t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,le.g7)(e,"SRS")){if(!t.spatialReference){let i=(0,le.mX)(e);t.spatialReference=fe(i)}}else if((0,le.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){let{spatialReference:i,transform:r}=function(e){let t=(0,le.V6)(e,"GeodataXform"),i=fe((0,le.v7)(t,"SpatialReference/WKID")||(0,le.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};let r=(0,le.v7)(t,"PolynomialOrder")??1,a=(0,le.Ui)(t,"CoeffX/Double"),s=(0,le.Ui)(t,"CoeffY/Double"),n=(0,le.Ui)(t,"InverseCoeffX/Double"),l=(0,le.Ui)(t,"InverseCoeffY/Double"),o=ue(a,s),u=ue(n,l);return{spatialReference:i,transform:o&&u&&o.length&&u.length?new oe.A({spatialReference:i,polynomialOrder:r,forwardCoefficients:o,inverseCoefficients:u}):null}}(e);t.transform=r,t.spatialReference||=i}else(0,le.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,le.mX)(e));else if((0,le.g7)(e,"PAMRasterBand")){let i=function(e){let t,i,r,a,s=(0,le.v7)(e,"NoDataValue"),n=(0,le.V6)(e,"Histograms/HistItem"),l=(0,le.v7)(n,"HistMin"),o=(0,le.v7)(n,"HistMax"),u=(0,le.v7)(n,"BucketCount"),f=(0,le.mX)(n,"HistCounts")?.split("|").map(e=>Number(e));(0,le.IC)(e,"Metadata/MDI").forEach(e=>{let s=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":t=s;break;case"STATISTICS_MAXIMUM":i=s;break;case"STATISTICS_MEAN":r=s;break;case"STATISTICS_STDDEV":a=s}});let h=(0,le.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:s,histogram:f?.length&&null!=l&&null!=o?{min:l,max:o,size:u||f.length,counts:f}:null,sourceBandIndex:h,statistics:null!=t&&null!=i?{min:t,max:i,avg:r,stddev:a}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});let i=t.rasterBands;return i.length&&(t.statistics=i[0].statistics?i.map(e=>e.statistics).filter(se.Ru):null,t.histograms=i[0].histogram?i.map(e=>e.histogram).filter(se.Ru):null),t}var pe=i(85951),de=i(40951);const me="image-aux-raster:open",ge="The data is not a supported format.";let ye=class extends N.A{set rasterJobHandler(e){this._set("rasterJobHandler",e),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=e)}async fetchRawTile(e,t,i,r={}){return this._inMemoryRaster?.fetchRawTile(e,t,i,r)}async _open(e){let t,{data:i,format:r}=await this._fetchData(e),{tileGeneration:a}=this.ioConfig,s="immediate"===a||"jpg"!==r;if(s){let a=await this._decodeFullImage(i,r,e);if(!a)throw new l.A(me,"The data cannot be decoded.");t=await this._createRasterSource(a,e)}else{let r=(0,pe.R)(i);if(!r)throw new l.A(me,ge);t=await this._createRasterSource(r,e),t.encodedData=i}let{rasterJobHandler:n,ioConfig:o}=this,u=new te({preGenerateTiles:s,rasterJobHandler:n,source:t,ioConfig:{...o,sampling:"closest",skipStatistics:!0}});await u.open(e),this._set("rasterInfo",u.rasterInfo),this._inMemoryRaster=u}async _createRasterSource(e,t){let{spatialReference:i,statistics:r,histograms:a,transform:s}=await this._fetchAuxiliaryData(t),n=!i;n&&(i=new z.A({wkid:3857})),a?.length&&null==r&&(r=(0,K.Pg)(a));let{width:l,height:o}=e,u=new B.A({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:i}),f=s?s.forwardTransform(u):u,h=!0;if(s){let e=s.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(s=null,u=f)}let c=[];return"pixels"in e&&c.push(e),{name:this.datasetName,pixelBlocks:c,imageInfo:{width:l,height:o,pixelType:"u8",bandCount:3},extent:f,nativeExtent:u,transform:s,statistics:r,histograms:a,isPseudoSpatialReference:n,keyProperties:{DataType:"Processed"}}}async _fetchData(e){let{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,de.g)(t);if("jpg"!==i&&"png"!==i&&"gif"!==i&&"bmp"!==i)throw new l.A(me,ge);return this._set("datasetFormat",i.toUpperCase()),{data:t,format:i}}async _decodeFullImage(e,t,i){try{return await this.decodePixelBlock(e,{format:t,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0},i)}catch{return(0,h.Te)(i?.signal),this.decodePixelBlock(e,{format:t,canvasUsage:"no-canvas",skipStatistics:!0},i)}}async _fetchAuxiliaryData(e){let t=e?.signal,{skipExtensions:i=[],skipMapInfo:r}=this.ioConfig,a=r||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,n="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,l=r||null==n||i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),o=await(0,h.Lx)([a,l]);if(t?.aborted)throw(0,h.NK)();let u=ce(o[0].value?.data);if(!u.transform){let e=o[1].value?o[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;u.transform=6===e?.length?new oe.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],ye.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)()],ye.prototype,"rasterJobHandler",null),ye=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.ImageAuxRaster")],ye);const we=ye;var ve=i(84952),xe=i(86738),be=i(75414),Ie=i(20223),Ce=i(87045),Se=i(25943),Ae=i(82371);let _e=class extends N.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,r={}){let{storageInfo:a,extent:s}=this.rasterInfo,{transposeInfo:n}=a,l=null!=n&&!!r.transposedVariableName;if(this._slices&&!l&&null==r.sliceId)return null;let o,u,f=l?0:a.maximumPyramidLevel-e+this._levelOffset,h=`${this.url}/tile/${f}/${t}/${i}`,c={...this._slices?l?{variable:r.transposedVariableName}:{sliceId:r.sliceId||0}:null,...r.refreshParameters};if(a.isBsqTile){let e=(r.bandIds?.length?r.bandIds:[0,1,2]).map(e=>this.request(h,{query:{...c,bandId:e},responseType:"array-buffer",signal:r.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),a=new Uint8Array(i);u=[];let s=0;for(let{data:e}of t)u.push(s),a.set(new Uint8Array(e),s),s+=e.byteLength;o=a.buffer}else o=(await this.request(h,{query:c,responseType:"array-buffer",signal:r.signal})).data;if(!o)return null;let{tileInfo:p}=a,d=l?n.tileSize:p.size,m=/^(mixed|jp)/i.test(p.format),g="raw"===p.format,y=await this.decodePixelBlock(o,{format:g?"bsq":void 0,width:d[0],height:d[1],planes:u?.length,offsets:u,pixelType:g?this.rasterInfo.pixelType:void 0,isPoint:"Elevation"===this.tileType,returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue,applyJpegMask:m},{signal:r.signal});if(null==y)return null;let w=a.blockBoundary[e];if("jpg"!==a.compression||i>w.minCol&&i<w.maxCol&&t>w.minRow&&t<w.maxRow)return y;let{origin:v,blockWidth:x,blockHeight:b}=a,{x:I,y:C}=this.getPyramidPixelSize(e),S=Math.round((s.xmin-v.x)/I)%x,A=Math.round((s.xmax-v.x)/I)%x||x,_=Math.round((v.y-s.ymax)/C)%b,T=Math.round((v.y-s.ymin)/C)%b||b,R=i===w.minCol?S:0,M=t===w.minRow?_:0,O=i===w.maxCol?A:x,F=t===w.maxRow?T:b;return(0,X.z$)(y,{x:R,y:M},{width:O-R,height:F-M}),y}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;let t=e;for(let e=0;e<this._slices.length;e++){let i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{let i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){let i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),r=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),a=await Promise.all([i,r]);return a[0]&&a[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),a[1]?.[0]?.counts?.length||(a[1]=null),{statistics:a[0]||null,histograms:a[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let r=0,{maximumPyramidLevel:a}=this.rasterInfo.storageInfo,s=a-r+this._levelOffset,n=i.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,i.row,i.col,t))break}catch{}if(s--,r++,i=this.identifyPixelLocation(n,r,t.datumTransformation),null===i)return null}return-1===s||null==i?null:r}async _open(e){let t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=i.data;if(this.sourceJSON=r,!r)throw new l.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!r.tileInfo)throw new l.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();this.tileType=r.cacheType,this.tileType??=["jpg","jpeg","png","png8","png24","png32","mixed"].includes(r.tileInfo.format.toLowerCase())?"Map":"lerc"===r.tileInfo.format.toLowerCase()?"Elevation":"Raster",this.datasetName=r.name?.slice(r.name.indexOf("/")+1)??"";let a=this.rasterInfo??await this._fetchRasterInfo({signal:t});if(null==a)throw new l.A("image-server-raster:open","cannot initialize image service");(0,Ae.E9)(a,r);let s="Map"===this.tileType?function(e,t){if(!e)return null;let{minScale:i,maxScale:r,minLOD:a,maxLOD:s}=t;if(null!=a&&null!=s)return Ce.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=a&&e<=s)});if(0!==i&&0!==r){let t=e=>Math.round(1e4*e)/1e4,a=i?t(i):1/0,s=r?t(r):-1/0;return Ce.A.fromJSON({...e,lods:e.lods.filter(e=>{let i=t(e.scale);return i<=a&&i>=s})})}return Ce.A.fromJSON(e)}(r.tileInfo,r):Ce.A.fromJSON(r.tileInfo);(0,u.Lw)(s);let[n,o]=this._computeMinMaxLOD(a,s),{extent:f,pixelSize:h}=a,c=.001*Math.min(h.x,h.y);(h.x!==h.y||Math.abs(n.resolution-h.x)>c)&&(h.x=h.y=n.resolution,a.width=Math.ceil((f.xmax-f.xmin)/h.x-.1),a.height=Math.ceil((f.ymax-f.ymin)/h.y-.1));let p=n.level-o.level,[d,m]=s.size,g=[],y=[],{lods:w}=s;w.forEach((e,t)=>{e.level>=o.level&&e.level<=n.level&&g.push({x:e.resolution,y:e.resolution}),t<w.length-1&&y.push(Math.round(10*e.resolution/w[t+1].resolution)/10)}),g.sort((e,t)=>e.x-t.x);let v,x=this.computeBlockBoundary(f,d,m,s.origin,g,p),b=g.length>1?g.slice(1):null;r.transposeInfo&&(v={tileSize:[r.transposeInfo.rows,r.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});let I=y.length<=1||y.length>=3&&y.slice(0,-1).every(e=>e===y[0])?y[0]??2:Math.round(10/(o.resolution/n.resolution)**(-1/p))/10,C=!!r.bsq&&"Raster"===this.tileType;if(a.storageInfo=new Ie.A({blockWidth:s.size[0],blockHeight:s.size[1],pyramidBlockWidth:s.size[0],pyramidBlockHeight:s.size[1],pyramidResolutions:b,pyramidScalingFactor:I,compression:s.format,origin:s.origin,firstPyramidLevel:1,maximumPyramidLevel:p,tileInfo:s,isBsqTile:C,transposeInfo:v,blockBoundary:x}),function(e){let{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new be.A,e.extent=e.transform.forwardTransform(t))}(a),this._set("rasterInfo",a),r.capabilities.toLowerCase().includes("tilemap")){let e={tileInfo:a.storageInfo.tileInfo,parsedUrl:(0,ve.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Se.d({layer:e})}}async _fetchRasterInfo(e){let t=this.sourceJSON;if("Map"===this.tileType){let e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),r=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),a=z.A.fromJSON(t.spatialReference||e.spatialReference),s=new xe.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a});return new Q.A({width:i,height:r,bandCount:3,extent:B.A.fromJSON(e),spatialReference:a,pixelSize:s,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}let i={...e,query:{...this.ioConfig.customFetchParameters,f:"json"}},r=(0,Ae.Tw)(this.url,this.sourceJSON,i),a=t.hasMultidimensions?this.request(`${this.url}/slices`,i).then(e=>e.data?.slices).catch(()=>null):null,s=await Promise.all([r,a]);return this._slices=s[1],s[0]}_fixScaleInServiceInfo(){let{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){let{pixelSize:i}=e,r=.5/e.width*i.x,{lods:a}=t,s=t.lodAt(Math.max.apply(null,a.map(e=>e.level))),n=t.lodAt(Math.min.apply(null,a.map(e=>e.level))),{tileType:l}=this;if("Map"===l)return this._levelOffset=a[0].level,[s,n];if("Raster"===l)return[a.find(e=>e.resolution===i.x)??s,n];let{minScale:o,maxScale:u}=this.sourceJSON,f=s;u>0&&(f=a.find(e=>Math.abs(e.scale-u)<r),f||=a.filter(e=>e.scale>u).sort((e,t)=>e.scale>t.scale?1:-1)[0]??s);let h=n;return o>0&&(h=a.find(e=>Math.abs(e.scale-o)<r)??n,this._levelOffset=h.level-n.level),[f,h]}};(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],_e.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)()],_e.prototype,"tileType",void 0),_e=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.ImageServerRaster")],_e);const Te=_e;var Re=i(10713);const Me=new Map([["byte","u8"],["signedbyte","s8"],["int8","s8"],["uint8","u8"],["int16","s16"],["uint16","u16"],["int32","s32"],["uint32","u32"],["float32","f32"],["float64","f64"],["double64","f64"]]),Oe=new Map;Oe.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Oe.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Oe.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Oe.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),Oe.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let Fe=class extends N.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this._isBsq=!1,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,r={}){let{blockWidth:a,blockHeight:s,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[e];if(!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i)return null;let{bandCount:o,pixelType:u}=this.rasterInfo,{ranges:f,actualTileWidth:h,actualTileHeight:c}=this._getTileLocation(e,t,i);if(!f||0===f.length)return null;if(f.some(e=>e.from>e.to)){let e=new Uint8Array(a*s);return new H.A({width:a,height:s,pixels:void 0,mask:e,validPixelCount:0})}let{bandIds:p}=this.ioConfig,d=this._getBandSegmentCount(),m=[],g=0;for(g=0;g<d;g++)(!p||p.includes(g))&&m.push(this.request(this._files.data,{range:{from:f[g].from,to:f[g].to},responseType:"array-buffer",signal:r.signal}));let y=await Promise.all(m),w=y.map(e=>e.data.byteLength).reduce((e,t)=>e+t),v=new Uint8Array(w),x=[],b=0;for(g=0;g<d;g++)x.push(b),v.set(new Uint8Array(y[g].data),b),b+=y[g].data.byteLength;let I=Oe.get(this.rasterInfo.storageInfo.compression).decoderFormat,C="jpg"===I&&4===o&&1===x.length,S=await this.decodePixelBlock(v.buffer,{width:a,height:s,format:I,planes:p?.length||o,offsets:x,pixelType:u,canvasUsage:C?"no-canvas":void 0,decodeJpegAsRgb:!1},{signal:r.signal});if(null==S)return null;let{noDataValue:A}=this.rasterInfo;if(null!=A&&"lerc"!==I&&!S.mask&&(A=A[0],null!=A)){let e=S.width*S.height,t=new Uint8Array(e);if(Math.abs(A)>1e24)for(g=0;g<e;g++)Math.abs((S.pixels[0][g]-A)/A)>1e-6&&(t[g]=1);else for(g=0;g<e;g++)S.pixels[0][g]!==A&&(t[g]=1);S.mask=t}let _=0,T=0;if(h!==a||c!==s){let e=S.mask;if(e)for(g=0;g<s;g++)if(T=g*a,g<c)for(_=h;_<a;_++)e[T+_]=0;else for(_=0;_<a;_++)e[T+_]=0;else for(e=new Uint8Array(a*s),S.mask=e,g=0;g<c;g++)for(T=g*a,_=0;_<h;_++)e[T+_]=1}return S}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);let t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:r,files:a}=this._parseHeader(i.data),{skipMapInfo:s,skipExtensions:n=[]}=this.ioConfig;if(!n.includes("aux.xml")&&!s){let t=await this._fetchAuxiliaryData(e);null!=t&&(r.statistics=t.statistics??r.statistics,r.histograms=t.histograms,t.histograms&&null==r.statistics&&(r.statistics=(0,K.Pg)(t.histograms)))}s&&this.updateImageSpaceRasterInfo(r),this._set("rasterInfo",r),this._files=a;let l=await this.request(a.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw Error("invalid array buffer must be multiples of 16");let t;if(Re.Z){let i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),a=new Uint8Array(r);for(let t=0;t<e.byteLength/4;t++)for(let e=0;e<4;e++)a[4*t+e]=i[4*t+3-e];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}(l.data);let{blockWidth:o,blockHeight:u}=this.rasterInfo.storageInfo,f=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:c}=this.rasterInfo,p=[],d=this._getBandSegmentCount(),m=0,g=-1;for(;m<this._storageIndex.length;){g++;let e=Math.ceil(h/o/f**g)-1,t=Math.ceil(c/u/f**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return this._isBsq?this.rasterInfo.bandCount:1}_getTileLocation(e,t,i){let r,a,s,{blockWidth:n,blockHeight:l,pyramidScalingFactor:o}=this.rasterInfo.storageInfo,{width:u,height:f}=this.rasterInfo,h=this._getBandSegmentCount(),c=0,p=0;for(s=0;s<e;s++)p=o**s,r=Math.ceil(u/n/p),a=Math.ceil(f/l/p),c+=r*a;p=o**e,r=Math.ceil(u/n/p),a=Math.ceil(f/l/p),c+=t*r+i,c*=4*h;let d=this._storageIndex.subarray(c,c+4*h),m=0,g=0,y=[];for(let e=0;e<h;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<r-1?n:Math.ceil(u/p)-n*(r-1),actualTileHeight:t<a-1?l:Math.ceil(f/p)-l*(a-1)}}_parseHeader(e){let t=(0,le.V6)(e,"MRF_META/Raster");if(!t)throw new l.A("mrf:open","not a valid MRF format");let i=(0,le.V6)(t,"Size"),r=parseInt(i.getAttribute("x"),10),a=parseInt(i.getAttribute("y"),10),s=parseInt(i.getAttribute("c"),10),n=((0,le.mX)(t,"Compression")||"none").toLowerCase();if(!Oe.has(n))throw new l.A("mrf:open","currently does not support compression "+n);let o=(0,le.mX)(t,"DataType")||"UInt8",u=Me.get(o.toLowerCase());if(null==u)throw new l.A("mrf:open","currently does not support pixel type "+o);let f=(0,le.V6)(t,"PageSize"),h=parseInt(f.getAttribute("x"),10),c=parseInt(f.getAttribute("y"),10),p=f.getAttribute("c"),d=p?p===String(s):Oe.get(n).isOneSegment;this._isBsq=!d;let m,g=(0,le.V6)(t,"DataValues");if(g){let e=g.getAttribute("NoData");null!=e&&(m=e.trim().split(" ").map(e=>parseFloat(e)))}if((0,le.V6)(e,"MRF_META/CachedSource"))throw new l.A("mrf:open","currently does not support MRF referencing other data files");let y,w=(0,le.V6)(e,"MRF_META/GeoTags"),v=(0,le.V6)(w,"BoundingBox"),x=!1;if(null!=v){let e=parseFloat(v.getAttribute("minx")),t=parseFloat(v.getAttribute("miny")),i=parseFloat(v.getAttribute("maxx")),r=parseFloat(v.getAttribute("maxy")),a=(0,le.mX)(w,"Projection")||"",s=z.A.WGS84;if("LOCAL_CS[]"!==a)if(a.toLowerCase().startsWith("epsg:")){let e=Number(a.slice(5));!isNaN(e)&&0!==e&&(s=new z.A({wkid:e}))}else s=fe(a)??z.A.WGS84;else x=!0,s=new z.A({wkid:3857});y=new B.A(e,t,i,r),y.spatialReference=s}else x=!0,y=new B.A({xmin:-.5,ymin:.5-a,xmax:r-.5,ymax:.5,spatialReference:new z.A({wkid:3857})});let b=(0,le.V6)(e,"MRF_META/Rsets"),I=parseInt(b?.getAttribute("scale")||"2",10),C=y.spatialReference,S=new Ie.A({origin:new xe.A({x:y.xmin,y:y.ymax,spatialReference:C}),blockWidth:h,blockHeight:c,pyramidBlockWidth:h,pyramidBlockHeight:c,compression:n,pyramidScalingFactor:I}),A=new xe.A({x:y.width/r,y:y.height/a,spatialReference:C}),_=new Q.A({width:r,height:a,extent:y,isPseudoSpatialReference:x,spatialReference:C,bandCount:s,pixelType:u,pixelSize:A,noDataValue:m,storageInfo:S}),T=this._getAuxFullPath((0,le.mX)(t,"DataFile")),R=this._getAuxFullPath((0,le.mX)(t,"IndexFile"));return{rasterInfo:_,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Oe.get(n).blobExtension)}}}_getAuxFullPath(e){return!e||e.includes("\\")?null:e.includes("/")?e.startsWith(new URL(this.url).origin)?e:null:`${this.url.slice(0,this.url.lastIndexOf("/"))}/${e}`}async _fetchAuxiliaryData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ce(t)}catch{return null}}};(0,a.Cg)([(0,p.MZ)()],Fe.prototype,"_files",void 0),(0,a.Cg)([(0,p.MZ)()],Fe.prototype,"_storageIndex",void 0),(0,a.Cg)([(0,p.MZ)()],Fe.prototype,"_isBsq",void 0),(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],Fe.prototype,"datasetFormat",void 0),Fe=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.MRFRaster")],Fe);const ke=Fe;i(44208);var Pe=i(9334);function De(e){let t=e.fields,i=e.records,r=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",a=[{name:r,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),s=a.map(e=>e.name),n=[],l=0,o=0;return i.forEach(e=>{let t={};for(t[r]=l++,o=1;o<s.length;o++)t[s[o]]=e[o-1];n.push({attributes:t})}),{displayFieldName:"",fields:a,features:n}}function Ne(e){let t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};let r=t.getUint32(4,!0),a=t.getUint16(8,!0),s=t.getUint16(10,!0),n={version:i,recordCount:r,headerByteCount:a,recordByteCount:s},l=32,o=[],u=[];for(;13!==t.getUint8(l);){let i=String.fromCharCode(t.getUint8(l+11)).trim();o.push({name:(0,Pe.w)(new Uint8Array(e,l,11)),type:i,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(i)],length:t.getUint8(l+16)}),l+=32}if(l+=1,o.length>0)for(;u.length<r&&e.byteLength-l>s;){let i=[];32===t.getUint8(l)?(l+=1,o.forEach(t=>{if("C"===t.type)i.push((0,Pe.w)(new Uint8Array(e,l,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim()));else if("D"===t.type){let r=String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim();i.push(new Date(parseInt(r.slice(0,4),10),parseInt(r.slice(4,6),10)-1,parseInt(r.slice(6,8),10)))}l+=t.length}),u.push(i)):l+=s}return{header:n,fields:o,records:u,recordSet:De({fields:o,records:u})}}var Le=i(44094),Be=i(94213);const ze="none-tiled tiff is not optimized for access, convert to COG and retry.";let Ee=class extends N.A{constructor(){super(...arguments),this._bufferSize=1048576,this._chunkSize=10485760,this._fileSize=-1,this._headerChunks=[],this.datasetFormat="TIFF",this.headerInfo=null}async fetchRawTile(e,t,i,r={}){if(!this.headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;let a=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=a&&this.headerInfo.hasMaskBand){let s=await this._fetchRawTiffTile(e,t,i,!0,r);null!=s&&s.pixels[0]instanceof Uint8Array&&(a.mask=s.pixels[0])}return a}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf(".")),await this._readHeader(e?.signal),await this._fetchAllAuxData(),this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(this.rasterInfo),this.updateTileInfo()}async _readHeader(e){try{let t=await this._fetchHeaderData(0,this._bufferSize,e);if(!t)throw new l.A("tiffraster:open","failed to open url "+this.url);let{littleEndian:i,firstIFDPos:r,isBigTiff:a}=(0,Le.uT)(t),s=[],n={fileChunk:t,posIFD:r,fileOffset:0};await this._readIFDs(s,n,i,a?8:4,e);let{imageInfo:o,rasterInfo:u}=function(e){let t=(0,Le.uc)(e),{width:i,height:r,tileWidth:a,tileHeight:s,planes:n,pixelType:l,compression:o,firstPyramidLevel:u,maximumPyramidLevel:f,pyramidBlockWidth:h,pyramidBlockHeight:c,pyramidResolutions:p,tileBoundary:d,affine:m,metadata:g,colormap:y}=t,w=fe(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),v=!!t.isPseudoGeographic;w??=(v=!0,new z.A({wkid:3857}));let x=new B.A({...t.extent,spatialReference:w}),b=x?new xe.A({x:x.xmin,y:x.ymax,spatialReference:w}):new xe.A({x:0,y:0}),I=new Ie.A({blockWidth:a,blockHeight:s,pyramidBlockWidth:h,pyramidBlockHeight:c,compression:o,origin:b,firstPyramidLevel:u,maximumPyramidLevel:f,pyramidResolutions:p,blockBoundary:d}),C=new xe.A({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/r,spatialReference:w}),S=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{},A=new Q.A({width:i,height:r,bandCount:n,pixelType:l,pixelSize:C,storageInfo:I,spatialReference:w,isPseudoSpatialReference:v,keyProperties:S,extent:x,colormap:y,statistics:g?g.statistics:null});if(m?.length&&(A.nativeExtent=new B.A({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:w}),A.transform=new oe.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),A.extent=A.transform.forwardTransform(A.nativeExtent),A.pixelSize=new xe.A({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/r,spatialReference:w}),I.origin.x=-.5,I.origin.y=.5),p){let{x:e,y:t}=A.pixelSize;p.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:A}}(s),f=(0,Le.zS)(s),h=(0,Le.r9)(s);this.headerInfo={littleEndian:i,isBigTiff:a,ifds:s,pyramidIFDs:f,maskIFDs:h,...o},this._set("rasterInfo",u),this._validateHeader()}finally{this._headerChunks.length=0}}_validateHeader(){let e=this.headerInfo;if(!e.isSupported)throw new l.A("tiffraster:open","this tiff is not supported: "+e.message);if(!e.tileWidth||!e.tileHeight)throw new l.A("tiffraster:open",ze);this.rasterInfo.isPseudoSpatialReference&&o.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");let t=e.ifds[0],i=t.get("PREDICTOR")?.values?.[0];if(3===t.get("SAMPLEFORMAT")?.values?.[0]&&2===i)throw new l.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data")}async _fetchHeaderData(e,t,i){let r=this._getCachedHeaderData(e,t);if(r)return r;let a=Math.floor(e/this._bufferSize)*this._bufferSize,s=a+Math.max(1,Math.ceil((t-a)/this._bufferSize))*this._bufferSize,n=this._getMissingHeaderRanges(a,s).map(async e=>{let{from:t,to:r}=e,a=await this._fetchOffsets(t,r,i),s=this._fileSize;return{chunk:a,fileOffset:t,isEOF:s>0?t+a.byteLength>=s:a.byteLength<r-t+1}}),o=await Promise.all(n);this._headerChunks.push(...o),this._headerChunks.sort((e,t)=>e.fileOffset-t.fileOffset);let u=this._getCachedHeaderData(e,t);if(!u)throw new l.A("tiffraster:open",`failed to fetch byte range ${e}-${t} from ${this.url}`);return u}_getCachedHeaderData(e,t){let i=[],r=e;for(let{chunk:a,fileOffset:s,isEOF:n}of this._headerChunks){if(s+a.byteLength-1<r)continue;if(s>r)return null;let l=r-s,o=Math.min(t-s+1,a.byteLength);if(i.push({chunk:a,start:l,end:o}),r=s+o,r>t||n&&o===a.byteLength){let t=new Uint8Array(r-e),a=0;for(let e of i){let i=new Uint8Array(e.chunk,e.start,e.end-e.start);t.set(i,a),a+=i.byteLength}return t.buffer}}return null}_getMissingHeaderRanges(e,t){let i=[],r=(e,t)=>{let r=Math.floor(e/this._bufferSize)*this._bufferSize,a=Math.ceil(t/this._bufferSize)*this._bufferSize;i.push({from:r,to:a})},a=e;for(let{chunk:e,fileOffset:s,isEOF:n}of this._headerChunks){let l=s+e.byteLength-1;if(!(l<a)&&(s>a&&r(a,Math.min(s-1,t)),a=Math.max(a,l+1),a>t||n))return i}return a<=t&&r(a,t),i}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:a}=e;if(a+8>=i.byteLength||a<0){if(r=a+r,r<0)throw new l.A("tiffraster:open",`invalid IFD position ${r}. failed to open url ${this.url}`);i=await this._fetchHeaderData(r,r+this._bufferSize/2,t),a=0}return{fileChunk:i,fileOffset:r,posIFD:a}}async _readIFDs(e,t,i,r=4,a){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,a);let s=await this._readIFD(t,i,Be.NB,r,a);if(!s?.ifd)throw new l.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(s.ifd),!s.nextIFD)return null;t.posIFD=s.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,r,a)}async _readIFD(e,t,i=Be.NB,r=4,a){let{fileChunk:s,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;let u=(0,Le.JM)(s,t,n,o,i,r);if(u.success){let{ifd:e}=u;if(!e)throw new l.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(!(this.ioConfig.loadFullMetadata||i!==Be.NB||e.has("TILEWIDTH")&&e.has("TILELENGTH")))throw new l.A("tiffraster:open",ze);let r=[];e.forEach(e=>{e.values||r.push(e)}),r.length>0&&await this._fillOffsets(r,t,u.nextIFD,a),(0,Le.fM)(e),(0,Le.h_)(e);for(let[i,r]of Be.RR){let l=e.get(i),u=null!=l?.data&&Array.from(l.data.values()).some(e=>null==e.values&&null!=e.offlineOffsetSize);if(l&&(!l.data||u)){n=l.valueOffset-o;let e=await this._validateOrFetchHeaderBuffer({fileChunk:s,posIFD:n,fileOffset:o},a);l.data=(await this._readIFD(e,t,r,4,a))?.ifd}}return u}return u.requiredBufferSize?(s=await this._fetchHeaderData(o,o+n+u.requiredBufferSize+8,a),s.byteLength<n+u.requiredBufferSize?null:(e.fileChunk=s,e.fileOffset=o,this._readIFD(e,t,i,r,a))):null}async _fillOffsets(e,t,i,r){let a=e.filter(e=>null!=e.offlineOffsetSize);if(0===a.length)return;let s=a.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,s.map(e=>e[0])),l=Math.max.apply(null,s.map(e=>e[0]+e[1])),o=1===s.length||l-n<=this._bufferSize;if(!o&&s.length>1&&(s.sort((e,t)=>e[0]-t[0]),o=s.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,s[0][0])===l),o){let e=Math.max(l,n+this._bufferSize/4),i=await this._fetchHeaderData(n,e,r);return void a.forEach(e=>(0,Le.Cr)(i,t,e,n))}let u=a.map(async e=>{let i=e.offlineOffsetSize,a=await this._fetchHeaderData(i[0],i[1]+i[0],r);(0,Le.Cr)(a,t,e,i[0])});await Promise.all(u)}async _fetchOffsets(e,t,i){let r=[],a=this._chunkSize;this._fileSize>0&&(t=Math.min(t,this._fileSize-1));let s=Math.ceil((t-e+1)/a),n=e;for(let e=0;e<s;e++)r.push(this.request(this.url,{range:{from:n,to:e===s-1?t:n+a-1},responseType:"array-buffer",signal:i})),n+=a;let l=await Promise.all(r);if(-1===this._fileSize&&206===l[0].httpStatus){let e=l[0].getHeader?.("Content-Range"),t=Number(e?.split("/")[1]);Number.isFinite(t)&&(this._fileSize=t)}if(1===l.length)return l[0].data;let o=l.reduce((e,t)=>e+t.data.byteLength,0),u=new Uint8Array(o),f=0;for(let e of l)u.set(new Uint8Array(e.data),f),f+=e.data.byteLength;return u.buffer}async _fetchRawTiffTile(e,t,i,r,a={}){let s=this._getTileLocation(e,t,i,r);if(!s)return null;let{ranges:n,actualTileWidth:l,actualTileHeight:o,ifd:u}=s,f=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:a.signal})),h=await Promise.all(f),c=h.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===h.length?h[0].data:new ArrayBuffer(c),d=[0],m=[0];if(h.length>1){let e=new Uint8Array(p);for(let t=0,i=0;t<h.length;t++){let r=h[t].data;e.set(new Uint8Array(r),i),d[t]=i,i+=r.byteLength,m[t]=r.byteLength}}let{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),w=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this.headerInfo,ifd:u,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null},{signal:a.signal});if(null==w)return null;if(l!==g||o!==y){let e=w.mask;if(e)for(let t=0;t<y;t++){let i=t*g;if(t<o)for(let t=l;t<g;t++)e[i+t]=0;else for(let t=0;t<g;t++)e[i+t]=0}else{e=new Uint8Array(g*y),w.mask=e;for(let t=0;t<o;t++){let i=t*g;for(let t=0;t<l;t++)e[i+t]=1}}}return w}_getTileLocation(e,t,i,r=!1){let{firstPyramidLevel:a,blockBoundary:s}=this.rasterInfo.storageInfo,n=0===e?0:e-(a-1),{headerInfo:l}=this;if(!l)return null;let o=r?l.maskIFDs[n]:0===n?l.ifds[0]:l.pyramidIFDs[n-1];if(!o)return null;let u=(0,Le.XO)(o,l),f=(0,Le.wc)(o,"TILEOFFSETS"),h=(0,Le.wc)(o,"TILEBYTECOUNTS");if(!f?.length||!h?.length)return null;let{minRow:c,minCol:p,maxRow:d,maxCol:m}=s[n];if(t>d||i>m||t<c||i<p)return null;let g=(0,Le.LZ)(o,"IMAGEWIDTH"),y=(0,Le.LZ)(o,"IMAGELENGTH"),w=(0,Le.LZ)(o,"TILEWIDTH"),v=(0,Le.LZ)(o,"TILELENGTH"),x=[];if(u){let{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){let e=r*(d+1)*(m+1)+t*(m+1)+i;x[r]={from:f[e],to:f[e]+h[e]-1}}}else{let e=t*(m+1)+i;x.push({from:f[e],to:f[e]+h[e]-1})}for(let e=0;e<x.length;e++)if(null==x[e].from||!x[e].to||x[e].to<0)return null;return{ranges:x,ifd:o,actualTileWidth:i===m&&g%w||w,actualTileHeight:t===d&&y%v||v}}async _fetchAllAuxData(e){if(this.ioConfig.skipMapInfo)return;let{rasterInfo:t}=this,{skipExtensions:i=[]}=this.ioConfig,r=i.includes("aux.xml")?Promise.resolve(null):this._fetchAuxiliaryMetaData(e),a=i.includes("vat.dbf")||1!==t.bandCount||"u8"!==t.pixelType?Promise.resolve(null):this._fetchAuxiliaryTable(e),[s,n]=await Promise.all([r,a]);null!=s&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,K.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;let i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new xe.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(s,t),null!=n&&(t.attributeTable=n,t.keyProperties.DataType="thematic")}async _fetchAuxiliaryMetaData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ce(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{let{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Ne(t);return i?.recordSet?ie.A.fromJSON(i.recordSet):null}catch{return null}}};(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"_bufferSize",void 0),(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"_chunkSize",void 0),(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"_fileSize",void 0),(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"_headerChunks",void 0),(0,a.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],Ee.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,p.MZ)()],Ee.prototype,"headerInfo",void 0),Ee=(0,a.Cg)([(0,p.$K)("esri.layers.raster.datasets.TIFFRaster")],Ee);const Je=Ee,He=new Map;He.set("MRF",{desc:"Meta Raster Format",constructor:ke}),He.set("TIFF",{desc:"GeoTIFF",constructor:Je}),He.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Te}),He.set("JPG",{desc:"JPG Raster Format",constructor:we}),He.set("PNG",{desc:"PNG Raster Format",constructor:we}),He.set("GIF",{desc:"GIF Raster Format",constructor:we}),He.set("BMP",{desc:"BMP Raster Format",constructor:we}),He.set("CovJSON",{desc:"COVJSON Raster Format",constructor:ae}),He.set("MEMORY",{desc:"In Memory Raster Format",constructor:te});class $e{static get supportedFormats(){let e=new Set;return He.forEach((t,i)=>e.add(i)),e}static async open(e){let{url:t,ioConfig:i,source:r,sourceJSON:a}=e,s=e.datasetFormat??i?.datasetFormat;s??(t.includes(".")?s=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===r?.type?.toLowerCase()?s="CovJSON":r?.extent&&r.pixelblocks&&(s="MEMORY")),"OVR"===s||"TIF"===s||"DM"===s?s="TIFF":"JPG"===s||"JPEG"===s||"JFIF"===s?s="JPG":"COVJSON"===s&&(s="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");let n={url:t,source:r,sourceJSON:a,datasetFormat:s,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(n).forEach(e=>{n[e]??delete n[e]}),s){if(!this.supportedFormats.has(s))throw new l.A("rasterfactory:open","not a supported format "+s);if("CRF"===s)throw new l.A("rasterfactory:open",`cannot open raster: ${t}`);let i=new(0,He.get(s).constructor)(n);return i.rasterJobHandler=e.rasterJobHandler,i.rasterInfo=e.rasterInfo,await i.open({signal:e.signal}),i}let o=Array.from(He.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e),u=0,f=()=>{if(s=o[u++],!s||"CRF"===s)return null;let t=new(0,He.get(s).constructor)(n);return t.rasterJobHandler=e.rasterJobHandler,t.open({signal:e.signal}).then(()=>t).catch(()=>f())};return f()}static register(e,t,i){He.has(e.toUpperCase())||He.set(e.toUpperCase(),{desc:t,constructor:i})}}var Ue=i(99235),Ze=i(10873),je=i(20437),qe=i(74797),Ve=i(22796),Ge=i(69409);const We={instance:null,refCount:0,connectionPromise:null};async function Xe(){if(We.refCount++,We.instance)return We.instance;if(!We.connectionPromise){let e=new Ge.A;We.connectionPromise=e.initialize().then(()=>{We.instance=e})}return await We.connectionPromise,We.instance}function Ke(){We.refCount--,We.refCount>0||(We.instance?.destroy(),We.instance=null,We.connectionPromise=null,We.refCount=0)}var Ye=i(24212),Qe=i(30291),et=i(88625),tt=i(59923);let it=class extends((0,C.dM)((0,O.j)((0,A.q)((0,_.A)((0,R.H)((0,S.d)((0,k.b)((0,T.G)((0,F.e)((0,I.b)((0,M.J)((0,f.M)((0,n.OU)(b.A)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new x(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,h.sg)(async(e,t,r)=>{let{save:a,saveAs:s}=await i.e(9838).then(()=>i(59838));switch(e){case 0:return a(this,t);case 1:return s(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){let t=null==e?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(h.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}destroy(){super.destroy(),this._releaseWorkerHandle=(0,u.xt)(this._releaseWorkerHandle)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[(0,qe.rZ)("Pixel Value"),(0,qe.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){let t=(0,qe.jC)(i);e.push(...t)}let r=t?.dataType,a=t?.multidimensionalInfo;if(("vector-magdir"===r||"vector-uv"===r)&&null!=a){let t=a.variables[0].unit?.trim(),i=(0,qe.DV)(t),r=(0,qe.y6)();e.push(i,r)}if(a){let t=(0,qe.AL)(a);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){let{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==qe.F_.rawServicePixelValue)),r=(0,Qe.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:a}=this.raster;return r?.fieldInfos&&a&&(0,qe.h4)(r.fieldInfos,a),r}async generateRasterInfo(e,t){let i=(0,d.PZ)(Ve.A,e);if(await this.load(),!i||"none"===i.functionName?.toLowerCase())return this.serviceRasterInfo;try{let{rasterInfo:e}=await this._openFunctionRaster(i,t);return e}catch(e){throw e instanceof l.A?e:new l.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsExportMapTiles(){let e=this._primaryRasters[0]??this.raster,t="RasterTileServer"===e?.datasetFormat,i=!!this.sourceJSON?.exportTilesAllowed,r=this.sourceJSON?.datasetFormat?.toLowerCase(),a=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&"Raster"===e?.tileType&&("cache/jpegplus"===r||"cache/jpegpng"===r);return t&&i&&("Map"===e?.tileType||a)}supportsWrite(){let e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){return this.supportsWrite()?super.write(e,t):((0,tt.U4)(t,this),null)}async hasDataChanged(){try{let e=this._primaryRasters[0]??this.raster,{dataChanged:t,updates:i}=await e.refresh();return t&&(this.serviceRasterInfo!==e.rasterInfo&&this._set("serviceRasterInfo",e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),i&&this.read(i,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0})),t}catch{return!1}}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=(0,P.qg)(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{let{url:t,rasterFunction:i,source:r}=this;if(!t&&!r)throw new l.A("imagery-tile-layer:open","missing url or source parameter");r?await this._openFromSource(r,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}let i=this.raster.rasterInfo;if(!i)throw new l.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){let e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||=this.raster.datasetName,"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,c.wB)(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=(0,P.pb)(e),this.url||=this._primaryRasters[0].url}async _openFromUrlWithRasterFunction(e,t,i){let r,a=[e];t&&(0,Ue.UD)(t.toJSON(),a),a.some(e=>at(e,this.ioConfig))&&(r=await Xe(),this._releaseWorkerHandle={remove:()=>Ke()});let s=await Promise.all(a.map(e=>$e.open({url:e,rasterInfo:1===a.length?this.serviceRasterInfo:void 0,sourceJSON:1===a.length?this.sourceJSON:void 0,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:r,signal:i}))),n=s.findIndex(e=>null==e);if(n>-1)throw new l.A("imagery-tile-layer:open",`cannot open raster: ${a[n]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){let i;at(e,this.ioConfig)&&(i=await Xe(),this._releaseWorkerHandle={remove:()=>Ke()});let r=await $e.open({url:e,rasterInfo:this.serviceRasterInfo,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:i,signal:t});if(null==r)throw new l.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){let i="the tiled imagery data source is not supported",r="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!r)throw new l.A("imagery-tile-layer:open",i);"MEMORY"===r&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});let a=await $e.open({url:"",source:e,datasetFormat:r,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==a)throw new l.A("imagery-tile-layer:open",i);this._primaryRasters=[a],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=a}async _openFunctionRaster(e,t){let i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);let r=(0,Ue.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),a=new D.A({rasterFunction:r});return await a.open(t),a}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof l.A&&o.A.getLogger(this).error("imagery-tile-layer:open",e.message),o.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){(0,Ye.XF)(o.A.getLogger(this),(0,Ye.$7)("ImageryTile layers","relative-to-scene",e)),(0,Ye.XF)(o.A.getLogger(this),(0,Ye.tW)("ImageryTile layers",e))}};(0,a.Cg)([(0,p.MZ)({clonable:!1})],it.prototype,"_primaryRasters",void 0),(0,a.Cg)([(0,p.MZ)({clonable:!1})],it.prototype,"_releaseWorkerHandle",void 0),(0,a.Cg)([(0,p.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],it.prototype,"charts",void 0),(0,a.Cg)([(0,p.MZ)({type:et.A,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],it.prototype,"elevationInfo",null),(0,a.Cg)([(0,p.MZ)({type:Ce.A})],it.prototype,"tileInfo",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,clonable:!1})],it.prototype,"graphicOrigin",void 0),(0,a.Cg)([(0,p.MZ)(Ze.fV)],it.prototype,"legendEnabled",void 0),(0,a.Cg)([(0,p.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],it.prototype,"isReference",void 0),(0,a.Cg)([(0,p.MZ)({type:["show","hide"]})],it.prototype,"listMode",void 0),(0,a.Cg)([(0,p.MZ)({json:{read:!0,write:!0}})],it.prototype,"blendMode",void 0),(0,a.Cg)([(0,p.MZ)({type:Ve.A,json:{name:"renderingRule",write:!0}})],it.prototype,"rasterFunction",void 0),(0,a.Cg)([(0,p.MZ)()],it.prototype,"sourceJSON",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],it.prototype,"version",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],it.prototype,"type",void 0),(0,a.Cg)([(0,p.MZ)({type:["ArcGISTiledImageServiceLayer"]})],it.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,p.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],it.prototype,"popupEnabled",void 0),(0,a.Cg)([(0,p.MZ)({type:s.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],it.prototype,"popupTemplate",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0})],it.prototype,"defaultPopupTemplate",null),(0,a.Cg)([(0,p.MZ)(Ze.PY)],it.prototype,"screenSizePerspectiveEnabled",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,type:[je.A]})],it.prototype,"fields",void 0),(0,a.Cg)([(0,p.MZ)({readOnly:!0,type:[je.A]})],it.prototype,"rasterFields",null),(0,a.Cg)([(0,p.MZ)({constructOnly:!0})],it.prototype,"source",void 0),it=(0,a.Cg)([(0,p.$K)("esri.layers.ImageryTileLayer")],it);const rt=it;function at(e,t){let{tileGeneration:i}=t??{};return"immediate"===i||/\.(png|gif|bmp)$/i.test(e)}},18768(e,t,i){var r=i(32198),a=i(53966),s=i(91429),n=i(60694);i.d(t,["b",0,e=>{let t=e,i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){let e=(0,n.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Jf)(e,a.A.getLogger(this)))}};return(0,r.Cg)([(0,s.MZ)()],i.prototype,"title",null),(0,r.Cg)([(0,s.MZ)({type:String})],i.prototype,"url",null),i=(0,r.Cg)([(0,s.$K)("esri.layers.mixins.ArcGISService")],i),i}])},56551(e,t,i){i.d(t,{H:()=>h});var r=i(32198),a=i(91429),s=i(69540),n=i(25482),l=i(78888),o=i(94359),u=i(93223);let f=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,r.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"name",void 0),(0,r.Cg)([(0,a.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,u.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],f.prototype,"method",void 0),(0,r.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"value",void 0),(0,r.Cg)([(0,a.MZ)({type:[l.jz],json:{write:{isRequired:!0}}})],f.prototype,"bandIds",void 0),(0,r.Cg)([(0,a.MZ)({types:o.uy,json:{write:!0,origins:{"web-scene":{types:o.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],f.prototype,"renderer",void 0),f=(0,r.Cg)([(0,a.$K)("esri.renderers.support.RasterPresetRenderer")],f);const h=e=>{let t=e,i=class extends t{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,r.Cg)([(0,a.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],i.prototype,"activePresetRendererName",void 0),(0,r.Cg)([(0,a.MZ)({type:[f],json:{name:"layerDefinition.presetRenderers",write:!0}})],i.prototype,"presetRenderers",void 0),i=(0,r.Cg)([(0,a.$K)("esri.layers.mixins.RasterPresetRendererMixin")],i),i}},10333(e,t,i){i.d(t,{A:()=>n});var r=i(32198),a=i(25482),s=i(91429);let n=class extends a.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,r.Cg)([(0,s.MZ)()],n.prototype,"affectsPixelSize",null),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],n.prototype,"spatialReference",void 0),n=(0,r.Cg)([(0,s.$K)("esri.layers.raster.transforms.BaseRasterTransform")],n)},75414(e,t,i){i.d(t,{A:()=>o});var r,a=i(32198),s=i(91429),n=i(10333),l=i(93223);let o=r=class extends n.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new r({tolerance:this.tolerance})}};(0,a.Cg)([(0,l.e)({GCSShiftXform:"gcs-shift"})],o.prototype,"type",void 0),(0,a.Cg)([(0,s.MZ)()],o.prototype,"tolerance",void 0),o=r=(0,a.Cg)([(0,s.$K)("esri.layers.raster.transforms.GCSShiftTransform")],o)},43163(e,t,i){i.d(t,{A:()=>d});var r,a=i(32198),s=i(91429),n=i(5443),l=i(86738),o=i(10333),u=i(36005),f=i(43937),h=i(93223);function c(e,t,i){let{x:r,y:a}=t;if(i<2)return{x:e[0]+r*e[2]+a*e[4],y:e[1]+r*e[3]+a*e[5]};if(2===i){let t=r*r,i=a*a,s=r*a;return{x:e[0]+r*e[2]+a*e[4]+t*e[6]+s*e[8]+i*e[10],y:e[1]+r*e[3]+a*e[5]+t*e[7]+s*e[9]+i*e[11]}}let s=r*r,n=a*a,l=r*a,o=s*r,u=s*a,f=r*n,h=a*n;return{x:e[0]+r*e[2]+a*e[4]+s*e[6]+l*e[8]+n*e[10]+o*e[12]+u*e[14]+f*e[16]+h*e[18],y:e[1]+r*e[3]+a*e[5]+s*e[7]+l*e[9]+n*e[11]+o*e[13]+u*e[15]+f*e[17]+h*e[19]}}function p(e,t,i){let{xmin:r,ymin:a,xmax:s,ymax:l,spatialReference:o}=t,u=[];if(i<2)u.push({x:r,y:l}),u.push({x:s,y:l}),u.push({x:r,y:a}),u.push({x:s,y:a});else{let e=10;for(let t=0;t<e;t++)u.push({x:r,y:a+(l-a)*t/(e-1)}),u.push({x:s,y:a+(l-a)*t/(e-1)});e=8;for(let t=1;t<=e;t++)u.push({x:r+(s-r)*t/e,y:a}),u.push({x:r+(s-r)*t/e,y:l})}u=u.map(t=>c(e,t,i));let f=u.map(e=>e.x),h=u.map(e=>e.y);return new n.A({xmin:Math.min.apply(null,f),xmax:Math.max.apply(null,f),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}let d=r=class extends o.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){let{coeffX:i,coeffY:r}=t;if(!i?.length||!r?.length||i.length!==r.length)return null;let a=[];for(let e=0;e<i.length;e++)a.push(i[e]),a.push(r[e]);return a}writeForwardCoefficients(e,t,i){let r=[],a=[];for(let t=0;t<e?.length;t++)t%2==0?r.push(e[t]):a.push(e[t]);t.coeffX=r,t.coeffY=a}get inverseCoefficients(){let e=this._get("inverseCoefficients"),t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){let[t,i,r,a,s,n]=e,l=r*n-s*a,o=s*a-r*n;return[(s*i-t*n)/l,(r*i-t*a)/o,n/l,a/o,-s/l,-r/o]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){let{inverseCoeffX:i,inverseCoeffY:r}=t;if(!i?.length||!r?.length||i.length!==r.length)return null;let a=[];for(let e=0;e<i.length;e++)a.push(i[e]),a.push(r[e]);return a}writeInverseCoefficients(e,t,i){let r=[],a=[];for(let t=0;t<e?.length;t++)t%2==0?r.push(e[t]):a.push(e[t]);t.inverseCoeffX=r,t.inverseCoeffY=a}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){let t=c(this.forwardCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){let t=c(this.inverseCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new r({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,a.Cg)([(0,s.MZ)()],d.prototype,"forwardCoefficients",void 0),(0,a.Cg)([(0,u.w)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,a.Cg)([(0,f.K)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,a.Cg)([(0,u.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,a.Cg)([(0,f.K)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,a.Cg)([(0,s.MZ)()],d.prototype,"affectsPixelSize",null),(0,a.Cg)([(0,h.e)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=r=(0,a.Cg)([(0,s.$K)("esri.layers.raster.transforms.PolynomialTransform")],d)},25943(e,t,i){i.d(t,{d:()=>I});var r,a=i(32198),s=i(56507),n=i(69622),l=i(49186),o=i(36563),u=(i(44208),i(66344)),f=i(15142),h=i(17676),c=i(36708),p=i(76030),d=i(84952),m=i(91429),g=i(72802),y=i(4718),w=i(69397);class v{constructor(e){!function(e){if(!e?.location)throw new l.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new l.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new l.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new l.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new l.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);let{location:t,data:i}=e;this.location=Object.freeze((0,y.o8)(t));let r=this.location.width,a=this.location.height,s=!0,n=!0,o=function(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Uint32Array(e)}(Math.ceil(r*a/32)),u=0;for(let e=0;e<i.length;e++){let t=e%32;i[e]?(n=!1,o[u]|=1<<t):s=!1,31===t&&++u}n?(this._availability="unavailable",this.byteSize=40):s?(this._availability="available",this.byteSize=40):(this._availability=o,this.byteSize=40+(0,w.Qf)(o))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;let i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,a=i>>5,s=this._availability;return a<0||a>s.length?"unknown":s[a]&1<<r?"available":"unavailable"}static fromDefinition(e,t){let i=e.service.request||s.A,{row:r,col:a,width:n,height:o}=e,u={query:{f:"json"}};return t=t?{...u,...t}:u,i(function(e){let t;if(e.service.tileServers?.length){let i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;let i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:r,left:a,width:n,height:o},valid:!0,data:Array(n*o).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==r||e.location.left!==a||e.location.width!==n||e.location.height!==o))throw new l.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:a,width:n,height:o}});return v.fromJSON(e)})}static fromJSON(e){return Object.freeze(new v(e))}}function x(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function b(e,t,i){return new l.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let I=class extends n.A{static{r=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=s.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new u.q(2097152),this.addHandles((0,c.wB)(()=>{let{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),c.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";let r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(b(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof v){let a=r.getAvailability(t,i);if("unavailable"===a)throw b(e,t,i);return a}if((0,h.zf)(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,a){r.level=e,r.row=t,r.col=i;let s=this.layer.tileInfo;s.updateTileInfo(r);let n=this.fetchAvailability(e,t,i,a).catch(e=>{if((0,h.zf)(e))throw e;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,a);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,a,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,a,s){if(!this._prefetchingEnabled)return;let n=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(n))return;let l=new AbortController;s.then(()=>l.abort(),()=>l.abort());let u=!1,f=(0,o.hA)(()=>{u||(u=!0,l.abort())});if(this.addHandles(f,n),await(0,p.md)(10,l.signal).catch(()=>{}),u||(u=!0,this.removeHandles(n)),(0,h.G4)(l))return;let c=new g.U(e,t,i),d={...a,signal:l.signal},m=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&m.upsampleTile(c);++e){let e=this.fetchAvailability(c.level,c.row,c.col,d);r._prefetches.push(e);let t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new f.A({initialSize:r._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new l.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));let a=this._tmpTilemapDefinition,s=this._tilemapFromCache(e,t,i,a);if(s)return Promise.resolve(s);let n=r?.signal;return r={...r,signal:null},new Promise((e,t)=>{(0,h.u7)(n,()=>t((0,h.NK)()));let i=x(a),s=this._pendingTilemapRequests[i];if(!s){s=v.fromDefinition(a,r).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));let e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;let{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,d.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;let a=x(r);return this._tilemapCache.get(a)}get test(){}};(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"layer",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"minLOD",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"maxLOD",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"request",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"size",void 0),I=r=(0,a.Cg)([(0,m.$K)("esri.layers.support.TilemapCache")],I)},82371(e,t,i){i.d(t,{E9:()=>d,Tw:()=>c,X6:()=>p});var r=i(56507),a=i(5443),s=i(86738),n=i(16930),l=i(87186),o=i(20223),u=i(2272),f=i(22671);async function h(e,t,i){let h=(0,u.Dl)(e),{rasterFunction:c,sourceJSON:p}=t||{},d=c?JSON.stringify(c.rasterFunctionDefinition||c):null,m=(0,u.lF)({...h.query,renderingRule:d,f:"json"}),g=(0,u.jV)(m,i);e=h.path;let y=p||await(0,r.A)(e,g).then(e=>e.data),{currentVersion:w}=y,v=y.hasRasterAttributeTable?(0,r.A)(`${e}/rasterAttributeTable`,g):null,x=y.hasColormap?(0,r.A)(`${e}/colormap`,g):null,b=y.hasHistograms?(0,r.A)(`${e}/histograms`,g):null,I=w>=10.3?(0,r.A)(`${e}/keyProperties`,g):null,C=y.hasMultidimensions?(0,r.A)(`${e}/multidimensionalInfo`,g):null,S=(c?w>=10.91:w>=10.81)?(0,r.A)(`${e}/statistics`,g):null,A=await Promise.allSettled([v,x,b,I,C,S]),_=a.A.fromJSON(y.extent),T=Math.ceil(_.width/y.pixelSizeX-.1),R=Math.ceil(_.height/y.pixelSizeY-.1),M=n.A.fromJSON(y.spatialReference||y.extent.spatialReference),O="fulfilled"===A[0].status?A[0].value?.data:null,F=O?.features?.length?f.A.fromJSON(O):null,k="fulfilled"===A[1].status?A[1].value?.data.colormap:null,P=k?.length?k:null,D="fulfilled"===A[2].status?A[2].value?.data.histograms:null,N=D?.[0]?.counts?.length?D:null,L="fulfilled"===A[3].status?A[3].value?.data??{}:{},B="fulfilled"===A[4].status?A[4].value?.data.multidimensionalInfo:null,z=B?.variables?.length?B:null;var E;(E=z)&&E.variables.forEach(e=>{e.statistics?.length&&e.statistics.forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),e.dimensions?.forEach(e=>{"StdTime"===e.name&&!e.recurring&&!e.unit&&(e.unit="ISO8601")})});let J=function(e,t){let i=null;t&&t.length===e.bandCount&&(i=t.map(e=>{let t=e.covariances?.trim(),i=t?t.split(",").map(Number):void 0;return{avg:e.mean,count:e.count,max:e.max,median:e.median,min:e.min,mode:e.mode,stddev:e.standardDeviation,sum:e.sum,covariances:i}}));let r=e.minValues?.length===e.bandCount?e.minValues.map((t,i)=>({min:t,max:e.maxValues[i],avg:e.meanValues[i],stddev:e.stdvValues[i]})):null;return null==r||null==i||i.some((e,t)=>e.min!==r[t]?.min||e.max!==r[t]?.max||e.avg!==r[t]?.avg||e.stddev!==r[t]?.stddev)?r:i}(y,"fulfilled"===A[5].status?A[5].value?.data.statistics:null),{defaultVariable:H,serviceDataType:$}=y;H&&H!==L.DefaultVariable&&(L.DefaultVariable=H),$?.includes("esriImageServiceDataTypeVector")&&!$.includes(L.DataType)&&(L.DataType=$.replace("esriImageServiceDataType",""));let U=y.noDataValue;y.noDataValues?.length&&y.noDataValues.some(e=>e!==U)&&(U=y.noDataValues);let Z=y.transposeInfo?new o.A({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new s.A({x:y.extent.xmin,y:y.extent.ymax,spatialReference:M}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(T,R))/Math.LN2-8)),transposeInfo:y.transposeInfo}):void 0;return new l.A({width:T,height:R,bandCount:y.bandCount,extent:a.A.fromJSON(y.extent),spatialReference:M,pixelSize:new s.A({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:M}),pixelType:y.pixelType.toLowerCase(),statistics:J,attributeTable:F,colormap:P,histograms:N,keyProperties:L,noDataValue:U,multidimensionalInfo:z,storageInfo:Z})}function c(e,t,i){return h(e,{sourceJSON:t},i)}function p(e,t,i){return h(e,{rasterFunction:t},i)}function d(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}},2272(e,t,i){i.d(t,{Dl:()=>u,gf:()=>h,jV:()=>o,lF:()=>f});var r=i(92602),a=i(70333),s=i(4718),n=i(84952),l=i(926);function o(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,n.An)(e):(0,s.o8)(e)}function f(e,t,i){let r={};for(let a in e){if("declaredClass"===a)continue;let s=e[a];if(null!=s&&"function"!=typeof s)if(Array.isArray(s))r[a]=s.map(e=>f(e));else if("object"==typeof s)if(s.toJSON){let e=s.toJSON(i?.[a]);r[a]=t?e:JSON.stringify(e)}else r[a]=t?s:JSON.stringify(s);else r[a]=s}return r}async function h(e,t,s){return function(e,t){return e?t&&(0,l.Qc)(e)?t:(0,l.getApiKey)(e)??a.id?.findCredential(e)?.token:null}(e,t)||(!a.id&&r.A.request.useIdentity&&await Promise.all([i.e(8673),i.e(7956),i.e(3713)]).then(()=>i(50148)),(await a.id.getCredential(e,s))?.token)}},24212(e,t,i){i.d(t,{$7:()=>o,B:()=>l,M7:()=>h,XF:()=>f,tW:()=>u,w7:()=>n});var r=i(56512),a=i(86211),s=i(16271);function n(e,t){return function(e,t){return t?.mode?t.mode:function(e){return e?c:p}(e).mode}(null==e||(e.hasZ??!1),t)}function l(e,t,i){return i&&i.mode!==t?`${e} only support ${t} elevation mode`:null}function o(e,t,i){return i?.mode===t?`${e} do not support ${t} elevation mode`:null}function u(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function f(e,t){t&&e.warn(".elevationInfo=",t)}function h(e){return(e?.offset??0)*(0,s.Ao)(e?.unit)}(0,r.B)((e,t,i)=>{if(!e||"decimal-degrees"===t)return 0;let r="unknown"!==t&&t?t:"meters",s=(0,a.mq)(i);return s?(0,a.oU)(e,r,s):0});const c={mode:"absolute-height",offset:0},p={mode:"on-the-ground",offset:null}}}]);