@arcgis/core 4.33.0-next.20250409 → 4.33.0-next.20250411

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 (91) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0c8f9ad2461323441372.js +1 -0
  3. package/assets/esri/core/workers/chunks/{f92d521ed3df3c9f737b.js → 26fcbe053194bd78fcc3.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{1364744b15b327abd5a1.js → 37716880cef8155259f5.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{ccb289911e7445b17763.js → 3a84ee5d0434362286a6.js} +10 -10
  6. package/assets/esri/core/workers/chunks/4deeeceb784e4390441d.js +1 -0
  7. package/assets/esri/core/workers/chunks/5a991c8e0febb0cf9be1.js +1 -0
  8. package/assets/esri/core/workers/chunks/{4de3d692557120a4bbf7.js → 95379fdd6917c8a84c71.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{b06e3ba73f353592c81d.js → b6361cec92003997bfe5.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{b308bef7ff08e0e635b5.js → d8e6f8e22cda67ac70f9.js} +23 -23
  11. package/assets/esri/core/workers/chunks/{35ab75010817f1525e54.js → e6a97f9b6f7be8076f85.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{3b2bda2e8c08f486de27.js → ed07bb41e1fd8043c88c.js} +1 -1
  13. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  14. package/assets/esri/themes/base/widgets/_BuildingDisciplinesTree.scss +0 -1
  15. package/assets/esri/themes/dark/main.css +1 -1
  16. package/assets/esri/themes/light/main.css +1 -1
  17. package/assets/esri/themes/light/view.css +1 -1
  18. package/chunks/BloomBlur.glsl.js +4 -6
  19. package/chunks/BloomComposition.glsl.js +12 -12
  20. package/chunks/Theme.js +1 -1
  21. package/chunks/bundle.js +5 -0
  22. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  23. package/interfaces.d.ts +1 -1
  24. package/layers/ParquetLayer.js +1 -1
  25. package/layers/mixins/ImageryTileMixin.js +1 -1
  26. package/layers/support/rasterDatasets/RawBlockCache.js +1 -1
  27. package/layers/support/rasterFunctions/RemapFunction.js +1 -1
  28. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  29. package/libs/parquet/loadParquetModule.js +5 -0
  30. package/libs/parquet/parquet.js +1 -1
  31. package/package.json +1 -1
  32. package/support/revision.js +1 -1
  33. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  34. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
  35. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  36. package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
  37. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  38. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  39. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  40. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  41. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  42. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  43. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  44. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  45. package/views/3d/layers/graphics/Labeler.js +1 -1
  46. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  47. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  48. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  49. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  50. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  51. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  52. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  53. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  54. package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
  55. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  56. package/views/3d/support/MemoryController.js +1 -1
  57. package/views/3d/terrain/OverlayManager.js +1 -1
  58. package/views/3d/terrain/OverlayRenderer.js +1 -1
  59. package/views/3d/terrain/PatchRenderData.js +1 -1
  60. package/views/3d/terrain/TextureFader.js +1 -1
  61. package/views/3d/terrain/TileRenderer.js +1 -1
  62. package/views/3d/terrain/TileTexture.js +1 -1
  63. package/views/3d/webgl/formats.js +1 -1
  64. package/views/3d/webgl-engine/Stage.js +1 -1
  65. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  66. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  67. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +1 -1
  68. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  69. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  70. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  71. package/views/3d/webgl-engine/lib/RendererBase.js +5 -0
  72. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  73. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  74. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  75. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  76. package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
  77. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  78. package/views/FocusAreas.js +1 -1
  79. package/views/webgl/VertexArrayObject.js +1 -1
  80. package/views/webgl/enums.js +1 -1
  81. package/views/webgl/textureUtils.js +1 -1
  82. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  83. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  84. package/widgets/ElevationProfile.js +1 -1
  85. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  86. package/widgets/Features.js +1 -1
  87. package/widgets/Popup.js +1 -1
  88. package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +0 -1
  89. package/assets/esri/core/workers/chunks/39bcfc9cd3a12a35316c.js +0 -1
  90. package/assets/esri/core/workers/chunks/ec83af4fb3bf59df7759.js +0 -1
  91. package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>u});var s=i(97768),n=i(74887),r=i(9775),o=i(32587),l=i(11932),a=i(44794);class c{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class u{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new r.A(e.peeker),this.process=e.process}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,i)=>e(i)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this.get(e);if(i)return i;const s=new AbortController;let r=null;t&&(r=(0,n.u7)(t,(()=>s.abort())));const o=()=>{l.remove(),null!=r&&r.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},l=(0,n.NY)(s.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),o(),a.reject((0,n.NK)())})),a=(0,n.Tw)();return this._deferreds.set(e,a),this._controllers.set(e,s),a.promise.then(o,o),this._queue.push(e),this._scheduleNext(),a.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject((0,n.NK)()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new c(e,i);this._processingItems.set(e,s);try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,n.$X)(t)?(s.promise=t,t.then((e=>this._processResult(s,e)),(e=>this._processError(s,e)))):this._processResult(s,t)}}},4916:(e,t,i)=>{i.d(t,{A:()=>B});var s=i(90237),n=i(78888),r=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),p=(i(44208),i(87811),i(40608)),d=i(5443),f=i(86738),m=i(16930),y=i(60694),g=i(10873),x=i(45617),_=i(91806),v=i(20223),b=i(87045),w=i(76353),R=i(77301),I=i(70834);const S=new Map,M=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const n=this._cachedBlocks,r=e+"/"+t;if(n.has(r)){const e=n.get(r);e.ts=Date.now(),e.refCount++}else n.set(r,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function k(e,t,i){const s=S.get(e);if(!s)return null==t?M.decreaseRefCount(e,i):0;if(null==t||null==s[t])return M.decreaseRefCount(e,i);const n=s[t]?.cache,r=n?.get(i);if(n&&r){if(r.refCount--,0===r.refCount){n.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function T(e,t,i){const s=S.get(e);if(!s)return null==t?M.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return M.getBlock(e,i)}const n=s[t]?.cache.get(i);if(n)return n.refCount++,n.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const n=s[e]?.cache,r=n?.get(i);if(n&&r)return r.refCount++,n.set(i,r),r.block}return null}function A(e,t,i,s,n=null){const r=S.get(e);if(!r)return void(null==t&&M.putBlock(e,i,s,n));if(null==t||null==r[t])return void M.putBlock(e,i,s,n);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:n};s.then((()=>o.isResolved=!0)).catch((()=>o.isRejected=!0)),r[t]?.cache.set(i,o)}function z(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):M.deleteBlock(e,i):null==t&&M.deleteBlock(e,i)}var F=i(16019),P=i(51244),C=i(28435),D=i(14636);let N=0,O=class extends o.A{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this._fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:b.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,I.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,w.q)(this)&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}get rasterId(){return this.url||"rasterId-"+N++}set url(e){this._set("url",(0,y.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,I.Hh)().then((()=>this._open(e))),this._openPromise}async fetchTile(e,t,i,s={}){const n=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,n);return s={noClip:!0,...s},this.fetchPixels(r,n.size[0],n.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:n}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:o}=n;let{transposedVariableName:l}=t;const a=null!=o&&r&&(null!=s||(0,R.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=n,{datumTransformation:p}=t;let m=(0,I._I)(e,c,p);if(!u.intersects(m))return{location:m,value:null};if(null!=n.transform){const e=n.transform.inverseTransform(m);if(!n.nativeExtent.intersects(e))return{location:e,value:null};m=e}let y=0;const g=null!=l&&null!=o&&n.hasMultidimensionalTranspose;if((0,w.q)(this)){const e=this.primaryRasters.rasters[0];if(g)return e.identify(m,t);const{pixelSize:s}=n,r=3,o=s.x*r/2,l=s.y*r/2,a=new d.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId},{pixelBlock:h}=await e.fetchPixels(a,r,r,u),{pixelBlock:p}=await this.fetchPixels(a,r,r,u);if(null==h)return{location:m,value:null};const f=Math.floor(r*r*.5),y=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):null;let x;return null!=p&&(x=!p.mask||p.mask[f]?p.pixels.map((e=>e[f])):void 0),{location:m,value:y,processedValue:x,pyramidLevel:0}}if(!g)if(t.srcResolution)y=(0,I.t$)(t.srcResolution,n,this.ioConfig.sampling).pyramidLevel;else if(y=await this.computeBestPyramidLevelForLocation(e,t),null==y)return{location:m,value:null};const x=this.identifyPixelLocation(m,y,null,g);if(null===x)return{location:m,value:null};const{row:_,col:v,rowOffset:b,colOffset:S,blockWidth:M}=x,k=await this._tileFetchQueue.push({pyramidLevel:y,row:_,col:v,options:t},{signal:t.signal});if(!k?.pixels?.length)return{location:m,value:null};const T=b*M+S;return this._processIdentifyResult(k,{srcLocation:m,position:T,pyramidLevel:y,useTransposedTile:!!g,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,I.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,I.FT)(e.spatialReference),o=(0,I.OM)(e);if(null==r||0===o||1===o&&this._isGlobalWrappableSource&&n)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(r/(c-a)*t),h=u-Math.round((r/2-a)/(c-a)*t);let p=0;const f=[];for(let n=0;n<=o;n++){const m=new d.A({xmin:0===n?a:-r/2,xmax:n===o?c-r*n:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),y=0===n?u-h:n===o?t-p:u;p+=y,f.push(y);const g=s.disableWrapAround&&n>0?null:this._fetchPixels(m,y,i,s);l.push(g)}const m=(await Promise.all(l)).map((e=>e?.pixelBlock));let y=null;const g={width:t,height:i};return y=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,C.z7)(m,g,{blockWidths:f}),{extent:e,srcExtent:(0,I._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:y}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,s),{nativeExtent:r,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new d.A({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!n)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:p,mosaicSize:f}=n;if(1===p.length&&null!=p[0]&&p[0].width===i.width&&p[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:n.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,y=e>0?l.pyramidBlockHeight:l.blockHeight,g={x:t.x%m,y:t.y%y};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:f,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,C.z7)(p,f,{clipOffset:g,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new r.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,I._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,P.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:r,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await(0,n.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,R.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const n=s.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,i,s.origin,s.spatialReference,s.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:n}=e;if(!e.tileInfo){const r=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(r.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(n){const t=(n[e].x+n[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new b.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:n,height:r,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(n,r))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new v.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,n,r=0,o=2){if(1===n.length&&r>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<r;i++)e*=o,t*=o,n.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<n.length;s++){const{x:r,y:o}=n[s];l.push({minCol:Math.floor((e.xmin-a+.1*r)/t/r),maxCol:Math.floor((e.xmax-a-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const n=s**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,s){const{spatialReference:n,nativeExtent:r,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,p=(0,I._I)(e,n,i);if(!r.intersects(p))return null;if(t<0||t>l)return null;const d=this.getPyramidPixelSize(t),{x:f,y:m}=d,y=(a.y-p.y)/m/h,g=(p.x-a.x)/f/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),_=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:p}}getTileExtent(e,t,i,s,n,r){const[o,l]=r,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new d.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,n=m.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new d.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:o}=e;if(o){o.origin=new f.A({x:r.xmin,y:r.ymax,spatialReference:n});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach((e=>{e.x/=t.x,e.y/=t.y})),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach(((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254}))}}}async _fetchPixels(e,t,i,s={}){let n=(0,I.OM)(e);if(n>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:p}=this,d=p.transform,m="gcs-shift"===d?.type,y=null!=(0,I.FT)(e.spatialReference);!m&&y||(n=(0,I.OM)(r.srcExtent,m));const g=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:n},s);if(!g)return{extent:e,srcExtent:a,pixelBlock:null};const x=p.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,v=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:b,y:w}=p.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:b,y:w}=e[o-1]);else{const e=t**o;b*=e,w*=e}}const R=p.spatialReference,S=new f.A({x:b,y:w,spatialReference:R}),M=_===c&&v===u&&h.x%_==0&&h.y%v==0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(R),A=R.isGeographic?1e-9:1e-4,{datumTransformation:z}=s;if(!T&&M&&1===g.pixelBlocks.length&&_===t&&v===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,A))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:g.pixelBlocks[0]};const F=y&&null!=(0,I.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,P=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");P&&!this.rasterJobHandler&&await(0,I.Hh)();const N=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k.toJSON(),datumTransformation:z,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:P},s):(0,I.l0)({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k,datumTransformation:z,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1,includeGCSGrid:P});let O;const B=!s.requestRawData,E={rows:N.spacing[0],cols:N.spacing[1]},J=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,g.extent.xmin):void 0,{pixelBlocks:H,mosaicSize:L,isPartiallyFilled:Z}=g;let W=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:H,srcMosaicSize:L,destDimension:B?{width:t,height:i}:null,coefs:B?N.coefficients:null,sampleSpacing:B?E:null,projectDirections:P,gcsGrid:P?N.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:J,blockWidths:null},s);({pixelBlock:O,localNorthDirections:W}=e)}else{const e=(0,C.z7)(H,L,{alignmentInfo:J});O=B?(0,C.$i)(e,{width:t,height:i},N.coefficients,E,s.interpolation):e,P&&N.gcsGrid&&(W=(0,C.QF)({width:t,height:i},N.gcsGrid),O=(0,D.Y2)(O,this.rasterInfo.dataType,W))}return s.requestRawData||P?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:O,transformGrid:N,localNorthDirections:W,isPartiallyFilled:Z}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:O}}async _fetchRawTiles(e,t,i,s){const{origin:n,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:p}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,y=0,g=0;p&&null!=f&&(({worldColumnCountFromOrigin:y,originColumnOffset:g,rightPadding:m}=f),y*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),v=Math.floor((a+u+m-1)/o),b=Math.floor((c+h+m-1)/l),w=r[e];if(!w)return null;const{minRow:R,minCol:I,maxCol:S,maxRow:M}=w;if(0===p&&(b<R||v<I||_>M||x>S))return null;const k=new Array;let T=!1;const A=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=b;t++)for(let i=x;i<=v;i++){let n=i;if(!s.disableWrapAround&&p&&null!=f&&y<=i&&(n=i-y-g),t>=R&&n>=I&&M>=t&&S>=n){const i=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:n,options:s},{signal:s.signal});A?k.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{T=!0,e(null)}))}))):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const z=await Promise.all(k),F={height:(b-_+1)*l,width:(v-x+1)*o},{spatialReference:P}=this.rasterInfo,C=this.getPyramidPixelSize(e),{x:D,y:N}=C;return{extent:new d.A({xmin:n.x+x*o*D,xmax:n.x+(v+1)*o*D,ymin:n.y-(b+1)*l*N,ymax:n.y-_*l*N,spatialReference:P}),pixelBlocks:z,mosaicSize:F,isPartiallyFilled:T}}_fetchRawTile(e,t,i,s){const{storageInfo:n}=this.rasterInfo,r=null!=n.transposeInfo&&!!s.transposedVariableName;if(!r){const s=n.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:o,maxCol:l,maxRow:a}=s;if(t<r||i<o||t>a||i>l)return Promise.resolve(null)}const o=function(e,t){return null==t?e:`${e}?sliceId=${t}`}(this.rasterId,r?s.transposeVariableName:s.sliceId),l=`${e}/${t}/${i}`;let c=T(o,s.registryId,l);if(null==c){const n=new AbortController;c=this.fetchRawTile(e,t,i,{...s,signal:n.signal}),A(o,s.registryId,l,c,n),c.catch((()=>z(o,s.registryId,l)))}return s.signal&&(0,a.u7)(s,(()=>{k(o,s.registryId,l)})),c}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[n,r]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,D.Lu)([n[e],r[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,I.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const n={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(n.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,n));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=n,c=o/t,u=l/i,h=a<r&&c*u>=16,p=a===r&&this._requireTooManySrcTiles(o,l,t,i);if(h||p||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,I.Wo)(o,this.rasterInfo.spatialReference,e,n.datumTransformation);const p=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&p){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(n.srcResolution=l,this._updateSourceDataInfo(e,n))}return this._requireTooManySrcTiles(n.srcWidth,n.srcHeight,t,i)&&(n.srcWidth=0,n.srcHeight=0),n}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:n}=this.rasterInfo.storageInfo,r=e/i,o=t/s;return Math.ceil(e/n.size[0])*Math.ceil(t/n.size[1])>=256*Math.max(1,(i+s)/1024)||r>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:n,datumTransformation:r}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,I.t$)(n,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,I._l)(e,s,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:p}=i.storageInfo.origin,d=Math.floor((c.xmin-h)/l.x+.1),f=Math.floor((p-c.ymax)/l.y+.1),m=Math.floor((c.xmax-h)/l.x-.1),y=Math.floor((p-c.ymin)/l.y-.1),g=c.width<.1*l.x?0:m-d+1,x=c.height<.1*l.y?0:y-f+1;t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=g,t.srcHeight=x,t.ul={x:d,y:f}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:n,useTransposedTile:r}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!r){const t=e.pixels.map((e=>e[s])),r={location:i,value:t,pyramidLevel:n},o=this._computeMagDirValues(t.map((e=>[e])));return o?.length&&(r.magdirValue=o.map((e=>e[0]))),r}let a=e.pixels.map((e=>e.slice(s*o,s*o+o))),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let p=(0,R.QW)(l,h.transposedVariableName);if(u){const e=(0,R.xx)(p,h.multidimensionalDefinition,h.timeExtent);a=a.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),p=e.map((e=>p[e]))}const d=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=d&&((0,F.Sp)(f,d),m=f.mask),{location:i,value:null,dataSeries:p.map(((e,t)=>{const i={value:0===m?.[t]?null:a.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new x.A({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:n}}};(0,s._)([(0,u.MZ)()],O.prototype,"_rasterTileAlignmentInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"_tileFetchQueue",void 0),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"_isGlobalWrappableSource",null),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s._)([(0,u.MZ)()],O.prototype,"_openPromise",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"rasterJobHandler",null),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"rasterId",null),(0,s._)([(0,u.MZ)(g.OZ)],O.prototype,"url",null),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],O.prototype,"datasetName",void 0),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],O.prototype,"datasetFormat",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"rasterInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"ioConfig",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"sourceJSON",void 0),O=(0,s._)([(0,p.$)("esri.layers.support.rasterDatasets.BaseRaster")],O);const B=O},32587:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(62788),n=i(95488);class r{constructor(e){this._observable=new n.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach(((i,s)=>e.call(t,i,s,this)),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),n=i(62788),r=i(95488);class o{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const r=s(e,i);for(let e=0;e<r.length;e++)s(r[e],t).forEach((e=>n.push(e)));return n}const r=e.getElementsByTagNameNS("*",i);if(!r||0===r.length)return[];for(let e=0;e<r.length;e++)n.push(r[e]||r.item(e));return n}function n(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=s(e,i);return r.length>0?t?n(r[0],t):r[0]:null}function r(e,t=null){const i=t?n(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(e,t),n=[];let r;for(let e=0;e<i.length;e++)r=i[e].textContent||i[e].nodeValue,r&&(r=r.trim(),""!==r&&n.push(r));return n}function l(e,t=null){const i=r(e,t);return i?.split(" ").map((e=>Number(e)))??[]}function a(e,t){return o(e,t).map((e=>Number(e)))}function c(e,t){const i=r(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>n,g7:()=>u,mX:()=>r,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>s});class s{constructor(e,t,i,s,n=void 0){this.id=e,this.level=t,this.row=i,this.col=s,this.extent=n}}},84169:(e,t,i)=>{i.d(t,{A:()=>f});var s=i(90237),n=i(49186),r=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),p=i(22671);let d=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:n,rasterIds:r}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===n.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o});const h=n.map((n=>n.fetchPixels(e,t,i,s))),p=await Promise.all(h),d=p.map((e=>e.pixelBlock)),f=o||s.requestRawData?p.map((e=>e.srcTilePixelSize)):null;if(s.skipRasterFunction||d.every((e=>null==e)))return p[0];const m=p.find((e=>null!=e.pixelBlock))?.extent??e;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:d,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:m,primaryPixelBlocks:d,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:g}=p[0];if(!o||null==y||null==g){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return s.noClip||s.requestRawData||null==y||!e||(y=await(0,c.$Q)(y,m,e)),{...p[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:t,height:i},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(y,{width:t,height:i},g.coefficients,x,l);const v=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||s.requestRawData||null==_||null==v||(_=await(0,c.$Q)(_,e,v)),{extent:e,srcExtent:p[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:s}=this.primaryRasters,r=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(r);const o=i.map((({rasterInfo:e})=>e)),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new n.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=p.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every((e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:n,extent:r}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&n.equals(a)&&r.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel}(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let r=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,h.uk)(r,t.spatialReference),t=n.execute(r,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s._)([(0,r.MZ)({type:String,json:{write:!0}})],d.prototype,"datasetFormat",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"tileType",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"rasterFunction",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"primaryRasters",void 0),d=(0,s._)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],d);const f=d},87045:(e,t,i)=>{i.d(t,{A:()=>I});var s,n=i(90237),r=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(40608),p=i(43937),d=i(86738),f=i(16930),m=i(19419),y=i(21325),g=i(28735),x=i(91806),_=i(72802);const v=new r.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let b=class extends o.A{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=f.A.WebMercator,numLODs:o=24}=e;if(!(0,y.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new x.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new x.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new d.A(0,0,r),size:[n,n],spatialReference:r})}const a=(0,y.Vp)(r),c=e.origin?new d.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new d.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),u=1/(39.37*(0,l.GA)(r)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new x.A({level:e,scale:t,resolution:s}))}else{let e=(0,y.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(o/t);h.push(new x.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,n=i*u;h.push(new x.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return d.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e}))),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],n=t[s+1];if(i<=e)return s;if(n===e)return s+1;if(i>e&&n<e)return s+Math.log(i/e)/Math.log(i/n)}return s}tileAt(e,t,i,s){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=i;else if((0,y.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,s=i}const l=n.resolution*this.size[0],a=n.resolution*this.size[1];return s||(s=new _.U(null,0,0,0,(0,m.vt)())),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((r-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=s.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===s.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,o=i.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,m.vt)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,n=s*this.size[0],r=s*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],n=this.lods.length-t;for(let e=0;e<n;e++){const s=e+t,{scale:n,resolution:r}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new x.A({level:e,scale:n,resolution:r}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};var w,R;(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],b.prototype,"compressionQuality",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],b.prototype,"dpi",void 0),(0,n._)([(0,a.MZ)({type:String,json:{read:v.read,write:v.write,origins:{"web-scene":{read:!1,write:!1}}}})],b.prototype,"format",void 0),(0,n._)([(0,a.MZ)({readOnly:!0})],b.prototype,"isWrappable",null),(0,n._)([(0,a.MZ)({type:d.A,json:{write:!0}})],b.prototype,"origin",void 0),(0,n._)([(0,u.w)("origin")],b.prototype,"readOrigin",null),(0,n._)([(0,a.MZ)({type:[x.A],value:null,json:{write:!0}})],b.prototype,"lods",null),(0,n._)([(0,a.MZ)({readOnly:!0})],b.prototype,"scales",void 0),(0,n._)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],b.prototype,"size",void 0),(0,n._)([(0,u.w)("size",["rows","cols"])],b.prototype,"readSize",null),(0,n._)([(0,p.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],b.prototype,"writeSize",null),(0,n._)([(0,a.MZ)({type:f.A,json:{write:!0}})],b.prototype,"spatialReference",void 0),b=s=(0,n._)([(0,h.$)("esri.layers.support.TileInfo")],b),w=b||(b={}),(R=w.ExtrapolateOptions||(w.ExtrapolateOptions={}))[R.NONE=0]="NONE",R[R.POWER_OF_TWO=1]="POWER_OF_TWO";const I=b},89015:(e,t,i)=>{i.d(t,{o:()=>O});var s=i(90237),n=i(78888),r=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(40608),p=i(86738),d=i(16930),f=i(21325),m=i(60694),y=i(10873),g=i(45617),x=i(43577),_=i(13868),v=i(22796),b=i(87045),w=i(76353),R=i(84169),I=i(77301),S=i(77359),M=i(6049),k=i(70834),T=i(6952),A=i(12711),z=i(85676),F=i(94359),P=i(22048),C=i(49410),D=i(34606),N=i(51508);const O=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,w.q)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,F.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(P.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=i;s.spatialReference.equals(o)||(await(0,k.Hh)(),n="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o));const l=e.pixelSize??new p.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,n,l),d=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(d.pixelBlock,c,n),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,T.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,I.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,n=(0,I.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name,o=(0,A.m7)(s,r);return this._updateSymbolizer(t,i,r,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const n=this.bandIds??[],{pixelBlock:r}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:n,symbolizer:this.symbolizer},i);return r}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,f.Vp)(e);return b.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(O(this),s.requestAsImageElement){const r=this.getTileUrl(e,t,i);return(0,n.A)(r,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const n=s.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,i,n),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,s))}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(D.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new r.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),o=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new N.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&!(s.hasMultidimensionalTranspose&&((0,I.DY)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new r.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date((0,I.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,I.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,I.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,w.q)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;O(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,w.q)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:n}=t;if("multipoint"===n)return t.points.map((e=>new p.A({x:e[0],y:e[1],spatialReference:s})));if("polyline"===n){let n=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=(await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(4929)]).then(i.bind(i,965))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=r/(o+(2===n.paths[0].length?1:0))),n=s.execute(t,l,{unit:"meters"})}return n.paths.flatMap((e=>e.map((e=>new p.A({x:e[0],y:e[1],spatialReference:s})))))}const r=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/r),c=l.height/a,u=l.width/a,{xmin:h,ymax:d}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const n=new p.A({x:h+(i+.5)*a,y:d-(e+.5)*a,spatialReference:s});(o||t.contains(n))&&f.push(n)}return f}_configDefaultInterpolation(){if(null==this.interpolation){O(this);const{raster:e}=this,t=(0,A.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){O(this);const{rasterInfo:t}=this.raster,i=(0,I.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=(0,A.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??(0,A.ci)(t)),!this.renderer||"override"===e){const e=(0,A.Mm)(this.raster),i=n?.renderer??(0,A.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const r=(0,A.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,A.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=l):this.symbolizer=new z.A({rendererJSON:r,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,A.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,w.q)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",v.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,w.q)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const n=(0,M.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new R.A({rasterFunction:n});r.rasterJobHandler=this._rasterJobHandler,await r.open(),this.raster=r}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:n}=this,{bandCount:r}=this.raster.rasterInfo,o=n?.length?n.some((e=>e>=r)):r>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new C.A({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const r=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new C.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:n,attributes:l});r.push(a)})),r}};function O(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}return(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_cachedRasterFunctionJson",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_compatibleFullExtent",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s._)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],t.prototype,"bandIds",void 0),(0,s._)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,s._)([(0,l.MZ)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,s._)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],t.prototype,"interpolation",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"ioConfig",void 0),(0,s._)([(0,l.MZ)({type:[g.A],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,s._)([(0,l.MZ)({type:x.A,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"raster",void 0),(0,s._)([(0,l.MZ)({type:v.A})],t.prototype,"rasterFunction",null),(0,s._)([(0,l.MZ)()],t.prototype,"serviceRasterInfo",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,l.MZ)({readOnly:!0,type:d.A,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,s._)([(0,l.MZ)({type:b.A})],t.prototype,"tileInfo",void 0),(0,s._)([(0,l.MZ)(y.OZ)],t.prototype,"url",null),(0,s._)([(0,l.MZ)()],t.prototype,"renderer",null),(0,s._)([(0,l.MZ)({types:F.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:F.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"internalRenderer",null),(0,s._)([(0,u.w)("internalRenderer")],t.prototype,"readRenderer",null),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"symbolizer",void 0),t=(0,s._)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],t),t}},91806:(e,t,i)=>{i.d(t,{A:()=>u});var s,n=i(90237),r=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(40608));let c=class extends r.A{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,n._)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,n._)([(0,a.$)("esri.layers.support.LOD")],c);const u=c}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>u});var s=i(97768),n=i(74887),r=i(9775),o=i(32587),l=i(11932),a=i(44794);class c{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class u{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new r.A(e.peeker),this.process=e.process}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,i)=>e(i)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this.get(e);if(i)return i;const s=new AbortController;let r=null;t&&(r=(0,n.u7)(t,(()=>s.abort())));const o=()=>{l.remove(),null!=r&&r.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},l=(0,n.NY)(s.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),o(),a.reject((0,n.NK)())})),a=(0,n.Tw)();return this._deferreds.set(e,a),this._controllers.set(e,s),a.promise.then(o,o),this._queue.push(e),this._scheduleNext(),a.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject((0,n.NK)()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new c(e,i);this._processingItems.set(e,s);try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,n.$X)(t)?(s.promise=t,t.then((e=>this._processResult(s,e)),(e=>this._processError(s,e)))):this._processResult(s,t)}}},4916:(e,t,i)=>{i.d(t,{A:()=>B});var s=i(90237),n=i(78888),r=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),p=(i(44208),i(87811),i(40608)),d=i(5443),f=i(86738),m=i(16930),y=i(60694),g=i(10873),x=i(45617),_=i(91806),w=i(20223),b=i(87045),v=i(76353),R=i(77301),I=i(70834);const S=new Map,M=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const n=this._cachedBlocks,r=e+"/"+t;if(n.has(r)){const e=n.get(r);e.ts=Date.now(),e.refCount++}else n.set(r,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function k(e,t,i){const s=S.get(e);if(!s)return null==t?M.decreaseRefCount(e,i):0;if(null==t||null==s[t])return M.decreaseRefCount(e,i);const n=s[t]?.cache,r=n?.get(i);if(n&&r){if(r.refCount--,0===r.refCount){n.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function T(e,t,i){const s=S.get(e);if(!s)return null==t?M.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return M.getBlock(e,i)}const n=s[t]?.cache.get(i);if(n)return n.refCount++,n.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const n=s[e]?.cache,r=n?.get(i);if(n&&r)return r.refCount++,n.set(i,r),r.block}return null}function A(e,t,i,s,n=null){const r=S.get(e);if(!r)return void(null==t&&M.putBlock(e,i,s,n));if(null==t||null==r[t])return void M.putBlock(e,i,s,n);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:n};s.then((()=>o.isResolved=!0)).catch((()=>o.isRejected=!0)),r[t]?.cache.set(i,o)}function z(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):M.deleteBlock(e,i):null==t&&M.deleteBlock(e,i)}var F=i(16019),P=i(51244),C=i(28435),D=i(14636);let N=0,O=class extends o.A{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this._fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:b.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,I.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,v.q)(this)&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}get rasterId(){return this.url||"rasterId-"+N++}set url(e){this._set("url",(0,y.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,I.Hh)().then((()=>this._open(e))),this._openPromise}async fetchTile(e,t,i,s={}){const n=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,n);return s={noClip:!0,...s},this.fetchPixels(r,n.size[0],n.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:n}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:o}=n;let{transposedVariableName:l}=t;const a=null!=o&&r&&(null!=s||(0,R.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=n,{datumTransformation:p}=t;let m=(0,I._I)(e,c,p);if(!u.intersects(m))return{location:m,value:null};if(null!=n.transform){const e=n.transform.inverseTransform(m);if(!n.nativeExtent.intersects(e))return{location:e,value:null};m=e}let y=0;const g=null!=l&&null!=o&&n.hasMultidimensionalTranspose;if((0,v.q)(this)){const e=this.primaryRasters.rasters[0];if(g)return e.identify(m,t);const{pixelSize:s}=n,r=3,o=s.x*r/2,l=s.y*r/2,a=new d.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId},{pixelBlock:h}=await e.fetchPixels(a,r,r,u),{pixelBlock:p}=await this.fetchPixels(a,r,r,u);if(null==h)return{location:m,value:null};const f=Math.floor(r*r*.5),y=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):null;let x;return null!=p&&(x=!p.mask||p.mask[f]?p.pixels.map((e=>e[f])):void 0),{location:m,value:y,processedValue:x,pyramidLevel:0}}if(!g)if(t.srcResolution)y=(0,I.t$)(t.srcResolution,n,this.ioConfig.sampling).pyramidLevel;else if(y=await this.computeBestPyramidLevelForLocation(e,t),null==y)return{location:m,value:null};const x=this.identifyPixelLocation(m,y,null,g);if(null===x)return{location:m,value:null};const{row:_,col:w,rowOffset:b,colOffset:S,blockWidth:M}=x,k=await this._tileFetchQueue.push({pyramidLevel:y,row:_,col:w,options:t},{signal:t.signal});if(!k?.pixels?.length)return{location:m,value:null};const T=b*M+S;return this._processIdentifyResult(k,{srcLocation:m,position:T,pyramidLevel:y,useTransposedTile:!!g,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,I.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,I.FT)(e.spatialReference),o=(0,I.OM)(e);if(null==r||0===o||1===o&&this._isGlobalWrappableSource&&n)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(r/(c-a)*t),h=u-Math.round((r/2-a)/(c-a)*t);let p=0;const f=[];for(let n=0;n<=o;n++){const m=new d.A({xmin:0===n?a:-r/2,xmax:n===o?c-r*n:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),y=0===n?u-h:n===o?t-p:u;p+=y,f.push(y);const g=s.disableWrapAround&&n>0?null:this._fetchPixels(m,y,i,s);l.push(g)}const m=(await Promise.all(l)).map((e=>e?.pixelBlock));let y=null;const g={width:t,height:i};return y=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,C.z7)(m,g,{blockWidths:f}),{extent:e,srcExtent:(0,I._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:y}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,s),{nativeExtent:r,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new d.A({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!n)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:p,mosaicSize:f}=n;if(1===p.length&&null!=p[0]&&p[0].width===i.width&&p[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:n.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,y=e>0?l.pyramidBlockHeight:l.blockHeight,g={x:t.x%m,y:t.y%y};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:f,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,C.z7)(p,f,{clipOffset:g,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new r.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,I._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,P.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:r,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await(0,n.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,R.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const n=s.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,i,s.origin,s.spatialReference,s.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:n}=e;if(!e.tileInfo){const r=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(r.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(n){const t=(n[e].x+n[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new b.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:n,height:r,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(n,r))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new w.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,n,r=0,o=2){if(1===n.length&&r>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<r;i++)e*=o,t*=o,n.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<n.length;s++){const{x:r,y:o}=n[s];l.push({minCol:Math.floor((e.xmin-a+.1*r)/t/r),maxCol:Math.floor((e.xmax-a-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const n=s**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,s){const{spatialReference:n,nativeExtent:r,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,p=(0,I._I)(e,n,i);if(!r.intersects(p))return null;if(t<0||t>l)return null;const d=this.getPyramidPixelSize(t),{x:f,y:m}=d,y=(a.y-p.y)/m/h,g=(p.x-a.x)/f/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),_=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:p}}getTileExtent(e,t,i,s,n,r){const[o,l]=r,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new d.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,n=m.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new d.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:o}=e;if(o){o.origin=new f.A({x:r.xmin,y:r.ymax,spatialReference:n});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach((e=>{e.x/=t.x,e.y/=t.y})),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach(((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254}))}}}async _fetchPixels(e,t,i,s={}){let n=(0,I.OM)(e);if(n>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:p}=this,d=p.transform,m="gcs-shift"===d?.type,y=null!=(0,I.FT)(e.spatialReference);!m&&y||(n=(0,I.OM)(r.srcExtent,m));const g=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:n},s);if(!g)return{extent:e,srcExtent:a,pixelBlock:null};const x=p.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,w=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:b,y:v}=p.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:b,y:v}=e[o-1]);else{const e=t**o;b*=e,v*=e}}const R=p.spatialReference,S=new f.A({x:b,y:v,spatialReference:R}),M=_===c&&w===u&&h.x%_==0&&h.y%w==0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(R),A=R.isGeographic?1e-9:1e-4,{datumTransformation:z}=s;if(!T&&M&&1===g.pixelBlocks.length&&_===t&&w===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,A))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:g.pixelBlocks[0]};const F=y&&null!=(0,I.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,P=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");P&&!this.rasterJobHandler&&await(0,I.Hh)();const N=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k.toJSON(),datumTransformation:z,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:P},s):(0,I.l0)({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k,datumTransformation:z,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1,includeGCSGrid:P});let O;const B=!s.requestRawData,E={rows:N.spacing[0],cols:N.spacing[1]},J=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,g.extent.xmin):void 0,{pixelBlocks:H,mosaicSize:L,isPartiallyFilled:Z}=g;let W=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:H,srcMosaicSize:L,destDimension:B?{width:t,height:i}:null,coefs:B?N.coefficients:null,sampleSpacing:B?E:null,projectDirections:P,gcsGrid:P?N.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:J,blockWidths:null},s);({pixelBlock:O,localNorthDirections:W}=e)}else{const e=(0,C.z7)(H,L,{alignmentInfo:J});O=B?(0,C.$i)(e,{width:t,height:i},N.coefficients,E,s.interpolation):e,P&&N.gcsGrid&&(W=(0,C.QF)({width:t,height:i},N.gcsGrid),O=(0,D.Y2)(O,this.rasterInfo.dataType,W))}return s.requestRawData||P?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:O,transformGrid:N,localNorthDirections:W,isPartiallyFilled:Z}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:O}}async _fetchRawTiles(e,t,i,s){const{origin:n,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:p}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,y=0,g=0;p&&null!=f&&(({worldColumnCountFromOrigin:y,originColumnOffset:g,rightPadding:m}=f),y*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),w=Math.floor((a+u+m-1)/o),b=Math.floor((c+h+m-1)/l),v=r[e];if(!v)return null;const{minRow:R,minCol:I,maxCol:S,maxRow:M}=v;if(0===p&&(b<R||w<I||_>M||x>S))return null;const k=new Array;let T=!1;const A=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=b;t++)for(let i=x;i<=w;i++){let n=i;if(!s.disableWrapAround&&p&&null!=f&&y<=i&&(n=i-y-g),t>=R&&n>=I&&M>=t&&S>=n){const i=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:n,options:s},{signal:s.signal});A?k.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{T=!0,e(null)}))}))):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const z=await Promise.all(k),F={height:(b-_+1)*l,width:(w-x+1)*o},{spatialReference:P}=this.rasterInfo,C=this.getPyramidPixelSize(e),{x:D,y:N}=C;return{extent:new d.A({xmin:n.x+x*o*D,xmax:n.x+(w+1)*o*D,ymin:n.y-(b+1)*l*N,ymax:n.y-_*l*N,spatialReference:P}),pixelBlocks:z,mosaicSize:F,isPartiallyFilled:T}}_fetchRawTile(e,t,i,s){const{storageInfo:n}=this.rasterInfo,r=null!=n.transposeInfo&&!!s.transposedVariableName;if(!r){const s=n.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:o,maxCol:l,maxRow:a}=s;if(t<r||i<o||t>a||i>l)return Promise.resolve(null)}const o=function(e,t){return null==t?e:`${e}?sliceId=${t}`}(this.rasterId,r?s.transposeVariableName:s.sliceId),l=`${e}/${t}/${i}`;let c=T(o,s.registryId,l);if(null==c){const n=new AbortController;c=this.fetchRawTile(e,t,i,{...s,signal:n.signal}),A(o,s.registryId,l,c,n),c.catch((()=>z(o,s.registryId,l)))}return s.signal&&(0,a.u7)(s,(()=>{k(o,s.registryId,l)})),c}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[n,r]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,D.Lu)([n[e],r[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,I.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const n={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(n.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,n));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=n,c=o/t,u=l/i,h=a<r&&c*u>=16,p=a===r&&this._requireTooManySrcTiles(o,l,t,i);if(h||p||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,I.Wo)(o,this.rasterInfo.spatialReference,e,n.datumTransformation);const p=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&p){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(n.srcResolution=l,this._updateSourceDataInfo(e,n))}return this._requireTooManySrcTiles(n.srcWidth,n.srcHeight,t,i)&&(n.srcWidth=0,n.srcHeight=0),n}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:n}=this.rasterInfo.storageInfo,r=e/i,o=t/s;return Math.ceil(e/n.size[0])*Math.ceil(t/n.size[1])>=256*Math.max(1,(i+s)/1024)||r>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:n,datumTransformation:r}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,I.t$)(n,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,I._l)(e,s,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:p}=i.storageInfo.origin,d=Math.floor((c.xmin-h)/l.x+.1),f=Math.floor((p-c.ymax)/l.y+.1),m=Math.floor((c.xmax-h)/l.x-.1),y=Math.floor((p-c.ymin)/l.y-.1),g=c.width<.1*l.x?0:m-d+1,x=c.height<.1*l.y?0:y-f+1;t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=g,t.srcHeight=x,t.ul={x:d,y:f}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:n,useTransposedTile:r}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!r){const t=e.pixels.map((e=>e[s])),r={location:i,value:t,pyramidLevel:n},o=this._computeMagDirValues(t.map((e=>[e])));return o?.length&&(r.magdirValue=o.map((e=>e[0]))),r}let a=e.pixels.map((e=>e.slice(s*o,s*o+o))),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let p=(0,R.QW)(l,h.transposedVariableName);if(u){const e=(0,R.xx)(p,h.multidimensionalDefinition,h.timeExtent);a=a.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),p=e.map((e=>p[e]))}const d=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=d&&((0,F.Sp)(f,d),m=f.mask),{location:i,value:null,dataSeries:p.map(((e,t)=>{const i={value:0===m?.[t]?null:a.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new x.A({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:n}}};(0,s._)([(0,u.MZ)()],O.prototype,"_rasterTileAlignmentInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"_tileFetchQueue",void 0),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"_isGlobalWrappableSource",null),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s._)([(0,u.MZ)()],O.prototype,"_openPromise",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"rasterJobHandler",null),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"rasterId",null),(0,s._)([(0,u.MZ)(g.OZ)],O.prototype,"url",null),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],O.prototype,"datasetName",void 0),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],O.prototype,"datasetFormat",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"rasterInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"ioConfig",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"sourceJSON",void 0),O=(0,s._)([(0,p.$)("esri.layers.support.rasterDatasets.BaseRaster")],O);const B=O},32587:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(62788),n=i(95488);class r{constructor(e){this._observable=new n.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach(((i,s)=>e.call(t,i,s,this)),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),n=i(62788),r=i(95488);class o{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const r=s(e,i);for(let e=0;e<r.length;e++)s(r[e],t).forEach((e=>n.push(e)));return n}const r=e.getElementsByTagNameNS("*",i);if(!r||0===r.length)return[];for(let e=0;e<r.length;e++)n.push(r[e]||r.item(e));return n}function n(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=s(e,i);return r.length>0?t?n(r[0],t):r[0]:null}function r(e,t=null){const i=t?n(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(e,t),n=[];let r;for(let e=0;e<i.length;e++)r=i[e].textContent||i[e].nodeValue,r&&(r=r.trim(),""!==r&&n.push(r));return n}function l(e,t=null){const i=r(e,t);return i?.split(" ").map((e=>Number(e)))??[]}function a(e,t){return o(e,t).map((e=>Number(e)))}function c(e,t){const i=r(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>n,g7:()=>u,mX:()=>r,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>s});class s{constructor(e,t,i,s,n=void 0){this.id=e,this.level=t,this.row=i,this.col=s,this.extent=n}}},84169:(e,t,i)=>{i.d(t,{A:()=>f});var s=i(90237),n=i(49186),r=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),p=i(22671);let d=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:n,rasterIds:r}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===n.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o});const h=n.map((n=>n.fetchPixels(e,t,i,s))),p=await Promise.all(h),d=p.map((e=>e.pixelBlock)),f=o||s.requestRawData?p.map((e=>e.srcTilePixelSize)):null;if(s.skipRasterFunction||d.every((e=>null==e)))return p[0];const m=p.find((e=>null!=e.pixelBlock))?.extent??e;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:d,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:m,primaryPixelBlocks:d,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:g}=p[0];if(!o||null==y||null==g){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return s.noClip||s.requestRawData||null==y||!e||(y=await(0,c.$Q)(y,m,e)),{...p[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:t,height:i},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(y,{width:t,height:i},g.coefficients,x,l);const w=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||s.requestRawData||null==_||null==w||(_=await(0,c.$Q)(_,e,w)),{extent:e,srcExtent:p[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:s}=this.primaryRasters,r=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(r);const o=i.map((({rasterInfo:e})=>e)),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new n.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=p.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every((e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:n,extent:r}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&n.equals(a)&&r.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel}(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let r=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,h.uk)(r,t.spatialReference),t=n.execute(r,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s._)([(0,r.MZ)({type:String,json:{write:!0}})],d.prototype,"datasetFormat",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"tileType",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"rasterFunction",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"primaryRasters",void 0),d=(0,s._)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],d);const f=d},87045:(e,t,i)=>{i.d(t,{A:()=>I});var s,n=i(90237),r=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(40608),p=i(43937),d=i(86738),f=i(16930),m=i(19419),y=i(21325),g=i(28735),x=i(91806),_=i(72802);const w=new r.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let b=class extends o.A{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=f.A.WebMercator,numLODs:o=24}=e;if(!(0,y.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new x.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new x.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new d.A(0,0,r),size:[n,n],spatialReference:r})}const a=(0,y.Vp)(r),c=e.origin?new d.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new d.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),u=1/(39.37*(0,l.GA)(r)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new x.A({level:e,scale:t,resolution:s}))}else{let e=(0,y.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(o/t);h.push(new x.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,n=i*u;h.push(new x.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return d.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e}))),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],n=t[s+1];if(i<=e)return s;if(n===e)return s+1;if(i>e&&n<e)return s+Math.log(i/e)/Math.log(i/n)}return s}tileAt(e,t,i,s){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=i;else if((0,y.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,s=i}const l=n.resolution*this.size[0],a=n.resolution*this.size[1];return s||(s=new _.U(null,0,0,0,(0,m.vt)())),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((r-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=s.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===s.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,o=i.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,m.vt)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,n=s*this.size[0],r=s*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],n=this.lods.length-t;for(let e=0;e<n;e++){const s=e+t,{scale:n,resolution:r}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new x.A({level:e,scale:n,resolution:r}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};var v,R;(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],b.prototype,"compressionQuality",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],b.prototype,"dpi",void 0),(0,n._)([(0,a.MZ)({type:String,json:{read:w.read,write:w.write,origins:{"web-scene":{read:!1,write:!1}}}})],b.prototype,"format",void 0),(0,n._)([(0,a.MZ)({readOnly:!0})],b.prototype,"isWrappable",null),(0,n._)([(0,a.MZ)({type:d.A,json:{write:!0}})],b.prototype,"origin",void 0),(0,n._)([(0,u.w)("origin")],b.prototype,"readOrigin",null),(0,n._)([(0,a.MZ)({type:[x.A],value:null,json:{write:!0}})],b.prototype,"lods",null),(0,n._)([(0,a.MZ)({readOnly:!0})],b.prototype,"scales",void 0),(0,n._)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],b.prototype,"size",void 0),(0,n._)([(0,u.w)("size",["rows","cols"])],b.prototype,"readSize",null),(0,n._)([(0,p.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],b.prototype,"writeSize",null),(0,n._)([(0,a.MZ)({type:f.A,json:{write:!0}})],b.prototype,"spatialReference",void 0),b=s=(0,n._)([(0,h.$)("esri.layers.support.TileInfo")],b),v=b||(b={}),(R=v.ExtrapolateOptions||(v.ExtrapolateOptions={}))[R.NONE=0]="NONE",R[R.POWER_OF_TWO=1]="POWER_OF_TWO";const I=b},89015:(e,t,i)=>{i.d(t,{o:()=>O});var s=i(90237),n=i(78888),r=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(40608),p=i(86738),d=i(16930),f=i(21325),m=i(60694),y=i(10873),g=i(45617),x=i(43577),_=i(13868),w=i(22796),b=i(87045),v=i(76353),R=i(84169),I=i(77301),S=i(77359),M=i(6049),k=i(70834),T=i(6952),A=i(12711),z=i(85676),F=i(94359),P=i(22048),C=i(49410),D=i(34606),N=i(51508);const O=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,v.q)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,F.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(P.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await(0,k.Hh)();const e="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o);if(null==e)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new p.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,n,l),d=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(d.pixelBlock,c,n),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,T.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,I.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,n=(0,I.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name,o=(0,A.m7)(s,r);return this._updateSymbolizer(t,i,r,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const n=this.bandIds??[],{pixelBlock:r}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:n,symbolizer:this.symbolizer},i);return r}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,f.Vp)(e);return b.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(O(this),s.requestAsImageElement){const r=this.getTileUrl(e,t,i);return(0,n.A)(r,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const n=s.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,i,n),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,s))}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(D.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new r.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),o=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new N.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&!(s.hasMultidimensionalTranspose&&((0,I.DY)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new r.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date((0,I.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,I.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,I.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,v.q)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;O(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,v.q)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:n}=t;if("multipoint"===n)return t.points.map((e=>new p.A({x:e[0],y:e[1],spatialReference:s})));if("polyline"===n){let n=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=(await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(4929)]).then(i.bind(i,965))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=r/(o+(2===n.paths[0].length?1:0))),n=s.execute(t,l,{unit:"meters"})}return n.paths.flatMap((e=>e.map((e=>new p.A({x:e[0],y:e[1],spatialReference:s})))))}const r=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/r),c=l.height/a,u=l.width/a,{xmin:h,ymax:d}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const n=new p.A({x:h+(i+.5)*a,y:d-(e+.5)*a,spatialReference:s});(o||t.contains(n))&&f.push(n)}return f}_configDefaultInterpolation(){if(null==this.interpolation){O(this);const{raster:e}=this,t=(0,A.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){O(this);const{rasterInfo:t}=this.raster,i=(0,I.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=(0,A.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??(0,A.ci)(t)),!this.renderer||"override"===e){const e=(0,A.Mm)(this.raster),i=n?.renderer??(0,A.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const r=(0,A.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,A.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=l):this.symbolizer=new z.A({rendererJSON:r,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,A.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,v.q)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",w.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,v.q)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const n=(0,M.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new R.A({rasterFunction:n});r.rasterJobHandler=this._rasterJobHandler,await r.open(),this.raster=r}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:n}=this,{bandCount:r}=this.raster.rasterInfo,o=n?.length?n.some((e=>e>=r)):r>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new C.A({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const r=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new C.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:n,attributes:l});r.push(a)})),r}};function O(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}return(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_cachedRasterFunctionJson",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_compatibleFullExtent",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s._)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],t.prototype,"bandIds",void 0),(0,s._)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,s._)([(0,l.MZ)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,s._)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],t.prototype,"interpolation",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"ioConfig",void 0),(0,s._)([(0,l.MZ)({type:[g.A],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,s._)([(0,l.MZ)({type:x.A,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"raster",void 0),(0,s._)([(0,l.MZ)({type:w.A})],t.prototype,"rasterFunction",null),(0,s._)([(0,l.MZ)()],t.prototype,"serviceRasterInfo",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,l.MZ)({readOnly:!0,type:d.A,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,s._)([(0,l.MZ)({type:b.A})],t.prototype,"tileInfo",void 0),(0,s._)([(0,l.MZ)(y.OZ)],t.prototype,"url",null),(0,s._)([(0,l.MZ)()],t.prototype,"renderer",null),(0,s._)([(0,l.MZ)({types:F.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:F.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"internalRenderer",null),(0,s._)([(0,u.w)("internalRenderer")],t.prototype,"readRenderer",null),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"symbolizer",void 0),t=(0,s._)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],t),t}},91806:(e,t,i)=>{i.d(t,{A:()=>u});var s,n=i(90237),r=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(40608));let c=class extends r.A{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,n._)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,n._)([(0,a.$)("esri.layers.support.LOD")],c);const u=c}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8096],{8096:(e,t,s)=>{s.r(t),s.d(t,{toBinaryGLTF:()=>Q});var n,i=s(74887);!function(e){e[e.JSON=1313821514]="JSON",e[e.BIN=5130562]="BIN"}(n||(n={}));class r{static{this.HEADER_SIZE=12}static{this.CHUNK_HEADER_SIZE=8}static{this.MAGIC=1179937895}static{this.VERSION=2}constructor(e,t){if(!e)throw new Error("GLB requires a JSON gltf chunk");this._length=r.HEADER_SIZE,this._length+=r.CHUNK_HEADER_SIZE;const s=function(e){return(new TextEncoder).encode(e).buffer}(e);if(this._length+=_(s.byteLength,4),t&&(this._length+=r.CHUNK_HEADER_SIZE,this._length+=t.byteLength,t.byteLength%4))throw new Error("Expected BIN chunk length to be divisible by 4 at this point");this.buffer=new ArrayBuffer(this._length),this._outView=new DataView(this.buffer),this._writeHeader();const i=this._writeChunk(s,12,n.JSON,32);t&&this._writeChunk(t,i,n.BIN)}_writeHeader(){this._outView.setUint32(0,r.MAGIC,!0),this._outView.setUint32(4,r.VERSION,!0),this._outView.setUint32(8,this._length,!0)}_writeChunk(e,t,s,n=0){const i=_(e.byteLength,4);for(this._outView.setUint32(t,i,!0),this._outView.setUint32(t+=4,s,!0),function(e,t,s,n,i){new Uint8Array(e,s,i).set(new Uint8Array(t,0,i),0)}(this._outView.buffer,e,t+=4,0,e.byteLength),t+=e.byteLength;t%4;)n&&this._outView.setUint8(t,n),t++;return t}}function _(e,t){return t*Math.ceil(e/t)}var E,a,o,A,R,T,c,u,N=s(40876),f=s(53966),h=s(91869),l=s(34727),S=s(67026),I=s(82534),O=s(38954),C=s(51850),d=s(80882),L=s(72258);(u=E||(E={}))[u.External=0]="External",u[u.DataURI=1]="DataURI",u[u.GLB=2]="GLB",function(e){e[e.External=0]="External",e[e.DataURI=1]="DataURI",e[e.GLB=2]="GLB"}(a||(a={})),function(e){e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"}(o||(o={})),function(e){e.SCALAR="SCALAR",e.VEC2="VEC2",e.VEC3="VEC3",e.VEC4="VEC4",e.MAT2="MAT2",e.MAT3="MAT3",e.MAT4="MAT4"}(A||(A={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(R||(R={})),function(e){e.OPAQUE="OPAQUE",e.MASK="MASK",e.BLEND="BLEND"}(T||(T={})),function(e){e[e.NoColor=0]="NoColor",e[e.FaceColor=1]="FaceColor",e[e.VertexColor=2]="VertexColor"}(c||(c={}));var M=s(63907);class D{constructor(e,t,s,n,i){this._buffer=e,this._componentType=s,this._dataType=n,this._data=[],this._isFinalized=!1,this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,t.bufferViews||(t.bufferViews=[]),this.index=t.bufferViews.length,this._bufferView={buffer:e.index,byteLength:-1,target:i};const r=this._getElementSize();r>=4&&i!==o.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=r),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,n=this._accessorMin[s];this._accessorMin[s]="number"!=typeof n?e:Math.min(n,e);const i=this._accessorMax[s];this._accessorMax[s]="number"!=typeof i?e:Math.max(i,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){return function(e){return 4*Math.ceil(e/4)}(this.dataSize)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case M.pe.BYTE:return new Int8Array(e,t);case M.pe.FLOAT:return new Float32Array(e,t);case M.pe.SHORT:return new Int16Array(e,t);case M.pe.UNSIGNED_BYTE:return new Uint8Array(e,t);case M.pe.UNSIGNED_INT:return new Uint32Array(e,t);case M.pe.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then((e=>{const t=new Uint8Array(e);for(let e=0;e<t.length;++e)this._data.push(t[e]);delete this._asyncWritePromise})),this._asyncWritePromise}startAccessor(e){if(this._accessorIndex>=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let e=0;e<this._accessorMin.length;++e)"number"!=typeof this._accessorMin[e]&&(this._accessorMin[e]=0),"number"!=typeof this._accessorMax[e]&&(this._accessorMax[e]=0);const n={byteOffset:e*(this._accessorIndex/t),componentType:this._componentType,count:s,type:this._dataType,min:this._accessorMin,max:this._accessorMax,name:this._accessorAttribute};switch(this._accessorAttribute){case"TEXCOORD_0":case"TEXCOORD_1":case"COLOR_0":case"WEIGHTS_0":switch(this._componentType){case M.pe.UNSIGNED_BYTE:case M.pe.UNSIGNED_SHORT:n.normalized=!0}}return this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,n}get finalized(){return this._finalizedPromise?this._finalizedPromise:this._isFinalized?this._finalizedPromise=Promise.resolve():this._finalizedPromise=new Promise((e=>this._finalizedPromiseResolve=e))}async finalize(){const e=this._bufferView,t=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&t.push(this._asyncWritePromise),await Promise.allSettled(t),this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case M.pe.BYTE:case M.pe.UNSIGNED_BYTE:return 1;case M.pe.SHORT:case M.pe.UNSIGNED_SHORT:return 2;case M.pe.UNSIGNED_INT:case M.pe.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case A.SCALAR:return 1;case A.VEC2:return 2;case A.VEC3:return 3;case A.VEC4:case A.MAT2:return 4;case A.MAT3:return 9;case A.MAT4:return 16}}}class p{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const n=new D(this,this._gltf,e,t,s);return this._bufferViews.push(n),n}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const e of this._bufferViews)e.writeOutToBuffer(t,s),s+=e.byteSize;return t}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then((()=>{this._isFinalized=!0;const e=this.getArrayBuffer();this._buffer.byteLength=e.byteLength,this._buffer.uri=e})),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}}function U(e,t){if(e.components)for(const s of e.components)s.faces&&"smooth"===s.shading&&B(s.faces,t)}function B(e,t){null==t.normal&&(t.normal=new Float32Array(t.position.length));const{position:s,normal:n}=t,i=e.length/3;for(let t=0;t<i;++t){const i=3*e[3*t],r=3*e[3*t+1],_=3*e[3*t+2],E=(0,O.i)(P,s[i],s[i+1],s[i+2]),a=(0,O.i)(m,s[r],s[r+1],s[r+2]),o=(0,O.i)(G,s[_],s[_+1],s[_+2]),A=(0,O.d)(a,a,E),R=(0,O.d)(o,o,E),T=(0,O.e)(A,A,R);n[i]+=T[0],n[i+1]+=T[1],n[i+2]+=T[2],n[r]+=T[0],n[r+1]+=T[1],n[r+2]+=T[2],n[_]+=T[0],n[_+1]+=T[1],n[_+2]+=T[2]}for(let e=0;e<n.length;e+=3)(0,O.i)(g,n[e],n[e+1],n[e+2]),(0,O.n)(g,g),n[e]=g[0],n[e+1]=g[1],n[e+2]=g[2]}const P=(0,C.vt)(),m=(0,C.vt)(),G=(0,C.vt)(),g=(0,C.vt)();s(44208);var F=s(49186),w=s(84952);async function b(e,t){const s=x(e);if(null==s)throw new F.A("imageToArrayBuffer","Unsupported image type");const n=function(e){if(!(e instanceof HTMLImageElement))return"image/png";const t=e.src;if((0,w.DB)(t)){const e=(0,w.r$)(t);return"image/jpeg"===e?.mediaType?e.mediaType:"image/png"}return/\.png$/i.test(t)?"image/png":/\.(jpg|jpeg)$/i.test(t)?"image/jpeg":"image/png"}(e),r=await new Promise((e=>s.toBlob(e,n)));if((0,i.Te)(t),!r)throw new F.A("imageToArrayBuffer","Failed to encode image");const _=await r.arrayBuffer();return(0,i.Te)(t),{data:_,type:n}}function x(e){if(e instanceof HTMLCanvasElement)return e;if(e instanceof HTMLVideoElement)return null;const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");return e instanceof HTMLImageElement?s.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&s.putImageData(e,0,0),t}var y=s(51530);const V=()=>f.A.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class H{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=t.output.buffer===E.GLB||t.output.image===a.GLB;s&&(t.binChunkBuffer=new p(this.gltf)),e.forEachScene((e=>{this._addScene(e)})),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode((e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))})),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;(0,O.p)(s,C.uY)||(t.translation=(0,C.o8)(s));const n=e.rotation;(0,S.t2)(n,I.zK)||(t.rotation=(0,I.o8)(n));const i=e.scale;(0,O.p)(i,C.Un)||(t.scale=(0,C.o8)(i));const r=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),n=[r];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),n.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return n}return e.forEachNode((e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))})),[r]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=t.output.buffer===E.GLB;let n;n=s?t.binChunkBuffer:new p(this.gltf);const i=this.options.origin,r=e.vertexSpace.clone();r.origin=[i.x,i.y,i.z??0];const _=(0,L.UR)({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},r,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!_)return[];U(e,_),Y(_);const{position:a,normal:R,tangent:T}=_,{uv:c,color:u}=e.vertexAttributes,N=n.addBufferView(M.pe.FLOAT,A.VEC3,o.ARRAY_BUFFER);let f,h,l,S;R&&(f=n.addBufferView(M.pe.FLOAT,A.VEC3,o.ARRAY_BUFFER)),c&&(h=n.addBufferView(M.pe.FLOAT,A.VEC2,o.ARRAY_BUFFER)),T&&(l=n.addBufferView(M.pe.FLOAT,A.VEC4,o.ARRAY_BUFFER)),u&&(S=n.addBufferView(M.pe.FLOAT,A.VEC4,o.ARRAY_BUFFER)),N.startAccessor("POSITION"),f&&f.startAccessor("NORMAL"),h&&h.startAccessor("TEXCOORD_0"),l&&l.startAccessor("TANGENT"),S&&S.startAccessor("COLOR_0");const I=_.position.length/3;for(let e=0;e<I;++e)N.push(a[3*e]),N.push(a[3*e+1]),N.push(a[3*e+2]),f&&null!=R&&(f.push(R[3*e]),f.push(R[3*e+1]),f.push(R[3*e+2])),h&&null!=c&&(h.push(c[2*e]),h.push(c[2*e+1])),l&&null!=T&&(l.push(T[4*e]),l.push(T[4*e+1]),l.push(T[4*e+2]),l.push(T[4*e+3])),S&&null!=u&&(S.push(v(u[4*e]/255)),S.push(v(u[4*e+1]/255)),S.push(v(u[4*e+2]/255)),S.push(u[4*e+3]/255));const O=N.endAccessor(),C=this._addAccessor(N.index,O);let d,D,B,P,m;if(f){const e=f.endAccessor();d=this._addAccessor(f.index,e)}if(h){const e=h.endAccessor();D=this._addAccessor(h.index,e)}if(l){const e=l.endAccessor();B=this._addAccessor(l.index,e)}if(S){const e=S.endAccessor();P=this._addAccessor(S.index,e)}const G=[];return e.components&&e.components.length>0&&e.components[0].faces?(m=n.addBufferView(M.pe.UNSIGNED_INT,A.SCALAR,o.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(m,e.components,G,C,d,D,B,P)):this._addMeshVertexNonIndexed(e.components,G,C,d,D,B,P),N.finalize(),f&&f.finalize(),h&&h.finalize(),l&&l.finalize(),m&&m.finalize(),S&&S.finalize(),s||n.finalize(),G}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode=T.MASK;break;case"auto":case"blend":s.alphaMode=T.BLEND}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const n=e=>{const t=e.toRgba();return t[0]=v(t[0]/255),t[1]=v(t[1]/255),t[2]=v(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=n(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof d.A){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),null!=e.emissiveColor){const t=n(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,V().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const i=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),i}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:(0,l.kU)(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,(0,h.tE)(this._textureMap,e,(()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},n=t.length;return t.push(s),n}))}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const n=this.gltf.extras;switch(n.output.image){case a.GLB:{const e=n.binChunkBuffer.addBufferView(M.pe.UNSIGNED_BYTE,A.SCALAR);if((0,y.x3)(t))null!=t.data&&e.writeOutToBuffer(t.data,0);else{const i=b(t,this.options.signal).then((({data:e,type:t})=>(s.mimeType=t,e)));n.promises.push(e.writeAsync(i).then((()=>{e.finalize()})))}s.bufferView=e.index;break}case a.DataURI:if((0,y.x3)(t)){V().warnOnce("Image export for basis compressed textures not available.");break}s.uri=function(e){const t=x(e);return null!=t?t.toDataURL():""}(t);break;default:if((0,y.x3)(t)){V().warnOnce("Image export for basis compressed textures not available.");break}n.promises.push(b(t,this.options.signal).then((({data:e,type:t})=>{s.uri=e,s.mimeType=t})))}}const n=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,n),n}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=M.pF.REPEAT,s=M.pF.REPEAT;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=M.pF.CLAMP_TO_EDGE,s=M.pF.CLAMP_TO_EDGE;break;case"mirror":t=M.pF.MIRRORED_REPEAT,s=M.pF.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":s=M.pF.CLAMP_TO_EDGE;break;case"mirror":s=M.pF.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":t=M.pF.CLAMP_TO_EDGE;break;case"mirror":t=M.pF.MIRRORED_REPEAT}}const n={wrapS:t,wrapT:s};for(let e=0;e<this.gltf.samplers.length;++e)if(JSON.stringify(n)===JSON.stringify(this.gltf.samplers[e]))return e;const i=this.gltf.samplers.length;return this.gltf.samplers.push(n),i}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const n=this.gltf.accessors.length;return this.gltf.accessors.push(s),n}_addMeshVertexIndexed(e,t,s,n,i,r,_,E){const a=new Map;for(const o of t){if(e.startAccessor("INDICES"),o.faces)for(let t=0;t<o.faces.length;++t)e.push(o.faces[t]);const t=e.endAccessor(),A={attributes:{POSITION:n},indices:this._addAccessor(e.index,t),material:this._addMaterial(o.material)};i&&"flat"!==o.shading&&(A.attributes.NORMAL=i),r&&(A.attributes.TEXCOORD_0=r),_&&"flat"!==o.shading&&(A.attributes.TANGENT=_),E&&(A.attributes.COLOR_0=E);const R=a.get(o.name);if(R)R.primitives.push(A);else{const e={name:o.name,primitives:[A]};a.set(o.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,n,i,r,_){const E={primitives:[]};t.push(E);const a={attributes:{POSITION:s}};n&&(a.attributes.NORMAL=n),i&&(a.attributes.TEXCOORD_0=i),r&&(a.attributes.TANGENT=r),_&&(a.attributes.COLOR_0=_),e&&(a.material=this._addMaterial(e[0].material)),E.primitives.push(a)}}function Y({position:e,normal:t,tangent:s}){X(e,3),X(t,3),X(s,4)}function X(e,t){if(null!=e)for(let s=1,n=2;s<e.length;s+=t,n+=t){const t=e[s],i=e[n];e[s]=i,e[n]=-t}}function v(e){return e**N.Tf}var z=s(4576);class k{constructor(){this.copyright="",this.defaultScene=0,this.generator="",this._scenes=[]}addScene(e){if(this._scenes.includes(e))throw new Error("Scene already added");this._scenes.push(e)}removeScene(e){(0,z.TF)(this._scenes,e)}forEachScene(e){this._scenes.forEach(e)}}class W{constructor(e){this.mesh=e,this.name="",this.translation=(0,C.vt)(),this.rotation=(0,I.vt)(),this.scale=(0,C.o8)(C.Un),this._nodes=[]}addNode(e){if(this._nodes.includes(e))throw new Error("Node already added");this._nodes.push(e)}forEachNode(e){this._nodes.forEach(e)}set rotationAngles(e){(0,S.A6)(this.rotation,e[0],e[1],e[2])}}const K="model.gltf",j="model.glb";async function Z(e,t){const s=new H(e,t).gltf,n=s.extras.promises;let _=1,o=1,A=null;await Promise.allSettled(n),(0,i.Te)(t.signal);const R=t.jsonSpacing??4,T=new Map,c=JSON.stringify(s,((e,s)=>{if("extras"!==e){if(s instanceof ArrayBuffer){if(function(e){if(e.byteLength<8)return!1;const t=new Uint8Array(e);return 137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7]}(s))switch(t.output?.image){case a.DataURI:case a.GLB:break;case a.External:default:{const e=`img${o}.png`;return o++,T.set(e,s),e}}switch(t.output?.buffer){case E.DataURI:return function(e){const t=[],s=new Uint8Array(e);for(let e=0;e<s.length;e++)t.push(String.fromCharCode(s[e]));return"data:application/octet-stream;base64,"+btoa(t.join(""))}(s);case E.GLB:if(A)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(A=s);case E.External:default:{const e=`data${_}.bin`;return _++,T.set(e,s),e}}}return s}}),R);return t.output?.buffer===E.GLB||t.output?.image===a.GLB?T.set(j,new r(c,A).buffer):T.set(K,c),T}class J{constructor(){this.name="",this._nodes=[]}addNode(e){if(this._nodes.includes(e))throw new Error("Node already added");this._nodes.push(e)}forEachNode(e){this._nodes.forEach(e)}}async function Q(e,t){const s=new k,n=new J;return s.addScene(n),n.addNode(new W(e)),await async function(e,t){const s=(await Z(e,{output:{buffer:E.GLB,image:a.GLB},jsonSpacing:0,...t})).get(j);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}(s,{origin:e.origin,...t})}},51530:(e,t,s)=>{s.d(t,{KB:()=>E,Xi:()=>r,pn:()=>a,x3:()=>_});var n=s(44208),i=s(89192);class r{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding=i.JS.KTX2_ENCODING}}function _(e){return"encoded-mesh-texture"===e?.type}async function E(e){const t=new Blob([e]),s=await t.text();return JSON.parse(s)}async function a(e,t){if(t===i.JS.KTX2_ENCODING)return new r(e);const s=new Blob([e],{type:t});let _=URL.createObjectURL(s);switch(t){case"image/jpeg":_+="#.jpg";break;case"image/png":_+="#.png"}const E=new Image;if((0,n.A)("esri-iPhone"))return new Promise(((e,t)=>{const s=()=>{i(),e(E)},n=e=>{i(),t(e)},i=()=>{URL.revokeObjectURL(_),E.removeEventListener("load",s),E.removeEventListener("error",n)};E.addEventListener("load",s),E.addEventListener("error",n),E.src=_}));try{E.src=_,await E.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(_),E}},63907:(e,t,s)=>{var n,i,r,_,E,a,o,A,R,T,c,u,N,f,h,l,S,I,O,C,d,L,M,D,p,U,B;s.d(t,{Ab:()=>l,Ac:()=>A,Ap:()=>f,CQ:()=>F,Cj:()=>u,Fq:()=>G,H0:()=>S,H3:()=>h,Hr:()=>B,MT:()=>T,NV:()=>n,SB:()=>C,Tb:()=>E,WR:()=>r,Xo:()=>d,Y7:()=>o,bh:()=>Y,dn:()=>_,eA:()=>c,iE:()=>O,j7:()=>I,ld:()=>L,nI:()=>g,pF:()=>N,pe:()=>R,r6:()=>P,vt:()=>U,yI:()=>m}),function(e){e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e[e.COLOR=16384]="COLOR"}(n||(n={})),function(e){e[e.COLOR=6144]="COLOR",e[e.DEPTH=6145]="DEPTH",e[e.STENCIL=6146]="STENCIL",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(i||(i={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(r||(r={})),function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(_||(_={})),function(e){e[e.ADD=32774]="ADD",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX",e[e.SUBTRACT=32778]="SUBTRACT",e[e.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(E||(E={})),function(e){e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e[e.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",e[e.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",e[e.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",e[e.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",e[e.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(a||(a={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(o||(o={})),function(e){e[e.CW=2304]="CW",e[e.CCW=2305]="CCW"}(A||(A={})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.HALF_FLOAT=5131]="HALF_FLOAT"}(R||(R={})),function(e){e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS"}(T||(T={})),function(e){e[e.ZERO=0]="ZERO",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP"}(c||(c={})),function(e){e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(u||(u={})),function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(N||(N={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_3D=32879]="TEXTURE_3D",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(f||(f={})),function(e){e[e.MIN_LOD=33082]="MIN_LOD",e[e.MAX_LOD=33083]="MAX_LOD",e[e.BASE_LEVEL=33084]="BASE_LEVEL",e[e.MAX_LEVEL=33085]="MAX_LEVEL",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE"}(h||(h={})),function(e){e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.RED=6403]="RED",e[e.RG=33319]="RG",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER"}(l||(l={})),function(e){e[e.RGBA4=32854]="RGBA4",e[e.R16F=33325]="R16F",e[e.RG16F=33327]="RG16F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.R32F=33326]="R32F",e[e.RG32F=33328]="RG32F",e[e.RGBA32F=34836]="RGBA32F",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB5_A1=32855]="RGB5_A1",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.RGB16F=34843]="RGB16F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.RGB565=36194]="RGB565",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2=32857]="RGB10_A2",e[e.RGB10_A2UI=36975]="RGB10_A2UI"}(S||(S={})),function(e){e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(I||(I={})),function(e){e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(O||(O={})),function(e){e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F"}(C||(C={})),function(e){e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8"}(d||(d={})),function(e){e[e.FLOAT=5126]="FLOAT",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.INT=5124]="INT",e[e.HALF_FLOAT=5131]="HALF_FLOAT",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(L||(L={})),function(e){e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.STATIC_READ=35045]="STATIC_READ",e[e.DYNAMIC_READ=35049]="DYNAMIC_READ",e[e.STREAM_READ=35041]="STREAM_READ",e[e.STATIC_COPY=35046]="STATIC_COPY",e[e.DYNAMIC_COPY=35050]="DYNAMIC_COPY",e[e.STREAM_COPY=35042]="STREAM_COPY"}(M||(M={})),function(e){e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER"}(D||(D={})),function(e){e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",e[e.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(p||(p={})),function(e){e[e.Texture=0]="Texture",e[e.BufferObject=1]="BufferObject",e[e.VertexArrayObject=2]="VertexArrayObject",e[e.Shader=3]="Shader",e[e.Program=4]="Program",e[e.FramebufferObject=5]="FramebufferObject",e[e.Renderbuffer=6]="Renderbuffer",e[e.TransformFeedback=7]="TransformFeedback",e[e.Sync=8]="Sync",e[e.UNCOUNTED=9]="UNCOUNTED",e[e.LinesOfCode=9]="LinesOfCode",e[e.Uniform=10]="Uniform",e[e.COUNT=11]="COUNT"}(U||(U={})),function(e){e[e.NONE=0]="NONE",e[e.BACK=1029]="BACK"}(B||(B={}));const P=36064,m=36065,G=36066,g=33306;var F,w,b,x,y,V,H,Y,X;!function(e){e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(F||(F={})),function(e){e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT=5124]="INT",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",e[e.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",e[e.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",e[e.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",e[e.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",e[e.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",e[e.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",e[e.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",e[e.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",e[e.SAMPLER_3D=35679]="SAMPLER_3D",e[e.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",e[e.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",e[e.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",e[e.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",e[e.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",e[e.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",e[e.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",e[e.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",e[e.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",e[e.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",e[e.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(w||(w={})),function(e){e[e.OBJECT_TYPE=37138]="OBJECT_TYPE",e[e.SYNC_CONDITION=37139]="SYNC_CONDITION",e[e.SYNC_STATUS=37140]="SYNC_STATUS",e[e.SYNC_FLAGS=37141]="SYNC_FLAGS"}(b||(b={})),function(e){e[e.UNSIGNALED=37144]="UNSIGNALED",e[e.SIGNALED=37145]="SIGNALED"}(x||(x={})),function(e){e[e.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",e[e.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",e[e.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",e[e.WAIT_FAILED=37149]="WAIT_FAILED"}(y||(y={})),function(e){e[e.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(V||(V={})),function(e){e[e.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(H||(H={})),function(e){e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL"}(Y||(Y={})),function(e){e[e.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR"}(X||(X={}))},89192:(e,t,s)=>{var n,i,r,_,E,a,o,A;s.d(t,{Am:()=>_,C7:()=>r,JS:()=>A,Mg:()=>a,dd:()=>E,it:()=>i,s2:()=>n,sf:()=>o}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(n||(n={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(i||(i={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(r||(r={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(_||(_={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(E||(E={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee"}(a||(a={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(o||(o={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(A||(A={}))}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8096],{8096:(e,t,s)=>{s.r(t),s.d(t,{toBinaryGLTF:()=>Q});var n,i=s(74887);!function(e){e[e.JSON=1313821514]="JSON",e[e.BIN=5130562]="BIN"}(n||(n={}));class r{static{this.HEADER_SIZE=12}static{this.CHUNK_HEADER_SIZE=8}static{this.MAGIC=1179937895}static{this.VERSION=2}constructor(e,t){if(!e)throw new Error("GLB requires a JSON gltf chunk");this._length=r.HEADER_SIZE,this._length+=r.CHUNK_HEADER_SIZE;const s=function(e){return(new TextEncoder).encode(e).buffer}(e);if(this._length+=_(s.byteLength,4),t&&(this._length+=r.CHUNK_HEADER_SIZE,this._length+=t.byteLength,t.byteLength%4))throw new Error("Expected BIN chunk length to be divisible by 4 at this point");this.buffer=new ArrayBuffer(this._length),this._outView=new DataView(this.buffer),this._writeHeader();const i=this._writeChunk(s,12,n.JSON,32);t&&this._writeChunk(t,i,n.BIN)}_writeHeader(){this._outView.setUint32(0,r.MAGIC,!0),this._outView.setUint32(4,r.VERSION,!0),this._outView.setUint32(8,this._length,!0)}_writeChunk(e,t,s,n=0){const i=_(e.byteLength,4);for(this._outView.setUint32(t,i,!0),this._outView.setUint32(t+=4,s,!0),function(e,t,s,n,i){new Uint8Array(e,s,i).set(new Uint8Array(t,0,i),0)}(this._outView.buffer,e,t+=4,0,e.byteLength),t+=e.byteLength;t%4;)n&&this._outView.setUint8(t,n),t++;return t}}function _(e,t){return t*Math.ceil(e/t)}var E,a,o,A,R,T,c,u,N=s(40876),f=s(53966),h=s(91869),l=s(34727),S=s(67026),I=s(82534),O=s(38954),C=s(51850),d=s(80882),L=s(72258);(u=E||(E={}))[u.External=0]="External",u[u.DataURI=1]="DataURI",u[u.GLB=2]="GLB",function(e){e[e.External=0]="External",e[e.DataURI=1]="DataURI",e[e.GLB=2]="GLB"}(a||(a={})),function(e){e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"}(o||(o={})),function(e){e.SCALAR="SCALAR",e.VEC2="VEC2",e.VEC3="VEC3",e.VEC4="VEC4",e.MAT2="MAT2",e.MAT3="MAT3",e.MAT4="MAT4"}(A||(A={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(R||(R={})),function(e){e.OPAQUE="OPAQUE",e.MASK="MASK",e.BLEND="BLEND"}(T||(T={})),function(e){e[e.NoColor=0]="NoColor",e[e.FaceColor=1]="FaceColor",e[e.VertexColor=2]="VertexColor"}(c||(c={}));var M=s(63907);class D{constructor(e,t,s,n,i){this._buffer=e,this._componentType=s,this._dataType=n,this._data=[],this._isFinalized=!1,this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,t.bufferViews||(t.bufferViews=[]),this.index=t.bufferViews.length,this._bufferView={buffer:e.index,byteLength:-1,target:i};const r=this._getElementSize();r>=4&&i!==o.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=r),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,n=this._accessorMin[s];this._accessorMin[s]="number"!=typeof n?e:Math.min(n,e);const i=this._accessorMax[s];this._accessorMax[s]="number"!=typeof i?e:Math.max(i,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){return function(e){return 4*Math.ceil(e/4)}(this.dataSize)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case M.pe.BYTE:return new Int8Array(e,t);case M.pe.FLOAT:return new Float32Array(e,t);case M.pe.SHORT:return new Int16Array(e,t);case M.pe.UNSIGNED_BYTE:return new Uint8Array(e,t);case M.pe.UNSIGNED_INT:return new Uint32Array(e,t);case M.pe.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then((e=>{const t=new Uint8Array(e);for(let e=0;e<t.length;++e)this._data.push(t[e]);delete this._asyncWritePromise})),this._asyncWritePromise}startAccessor(e){if(this._accessorIndex>=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let e=0;e<this._accessorMin.length;++e)"number"!=typeof this._accessorMin[e]&&(this._accessorMin[e]=0),"number"!=typeof this._accessorMax[e]&&(this._accessorMax[e]=0);const n={byteOffset:e*(this._accessorIndex/t),componentType:this._componentType,count:s,type:this._dataType,min:this._accessorMin,max:this._accessorMax,name:this._accessorAttribute};switch(this._accessorAttribute){case"TEXCOORD_0":case"TEXCOORD_1":case"COLOR_0":case"WEIGHTS_0":switch(this._componentType){case M.pe.UNSIGNED_BYTE:case M.pe.UNSIGNED_SHORT:n.normalized=!0}}return this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,n}get finalized(){return this._finalizedPromise?this._finalizedPromise:this._isFinalized?this._finalizedPromise=Promise.resolve():this._finalizedPromise=new Promise((e=>this._finalizedPromiseResolve=e))}async finalize(){const e=this._bufferView,t=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&t.push(this._asyncWritePromise),await Promise.allSettled(t),this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case M.pe.BYTE:case M.pe.UNSIGNED_BYTE:return 1;case M.pe.SHORT:case M.pe.UNSIGNED_SHORT:return 2;case M.pe.UNSIGNED_INT:case M.pe.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case A.SCALAR:return 1;case A.VEC2:return 2;case A.VEC3:return 3;case A.VEC4:case A.MAT2:return 4;case A.MAT3:return 9;case A.MAT4:return 16}}}class p{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const n=new D(this,this._gltf,e,t,s);return this._bufferViews.push(n),n}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const e of this._bufferViews)e.writeOutToBuffer(t,s),s+=e.byteSize;return t}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then((()=>{this._isFinalized=!0;const e=this.getArrayBuffer();this._buffer.byteLength=e.byteLength,this._buffer.uri=e})),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}}function U(e,t){if(e.components)for(const s of e.components)s.faces&&"smooth"===s.shading&&B(s.faces,t)}function B(e,t){null==t.normal&&(t.normal=new Float32Array(t.position.length));const{position:s,normal:n}=t,i=e.length/3;for(let t=0;t<i;++t){const i=3*e[3*t],r=3*e[3*t+1],_=3*e[3*t+2],E=(0,O.i)(P,s[i],s[i+1],s[i+2]),a=(0,O.i)(m,s[r],s[r+1],s[r+2]),o=(0,O.i)(G,s[_],s[_+1],s[_+2]),A=(0,O.d)(a,a,E),R=(0,O.d)(o,o,E),T=(0,O.e)(A,A,R);n[i]+=T[0],n[i+1]+=T[1],n[i+2]+=T[2],n[r]+=T[0],n[r+1]+=T[1],n[r+2]+=T[2],n[_]+=T[0],n[_+1]+=T[1],n[_+2]+=T[2]}for(let e=0;e<n.length;e+=3)(0,O.i)(g,n[e],n[e+1],n[e+2]),(0,O.n)(g,g),n[e]=g[0],n[e+1]=g[1],n[e+2]=g[2]}const P=(0,C.vt)(),m=(0,C.vt)(),G=(0,C.vt)(),g=(0,C.vt)();s(44208);var F=s(49186),w=s(84952);async function b(e,t){const s=x(e);if(null==s)throw new F.A("imageToArrayBuffer","Unsupported image type");const n=function(e){if(!(e instanceof HTMLImageElement))return"image/png";const t=e.src;if((0,w.DB)(t)){const e=(0,w.r$)(t);return"image/jpeg"===e?.mediaType?e.mediaType:"image/png"}return/\.png$/i.test(t)?"image/png":/\.(jpg|jpeg)$/i.test(t)?"image/jpeg":"image/png"}(e),r=await new Promise((e=>s.toBlob(e,n)));if((0,i.Te)(t),!r)throw new F.A("imageToArrayBuffer","Failed to encode image");const _=await r.arrayBuffer();return(0,i.Te)(t),{data:_,type:n}}function x(e){if(e instanceof HTMLCanvasElement)return e;if(e instanceof HTMLVideoElement)return null;const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");return e instanceof HTMLImageElement?s.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&s.putImageData(e,0,0),t}var y=s(51530);const V=()=>f.A.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class H{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=t.output.buffer===E.GLB||t.output.image===a.GLB;s&&(t.binChunkBuffer=new p(this.gltf)),e.forEachScene((e=>{this._addScene(e)})),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode((e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))})),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;(0,O.p)(s,C.uY)||(t.translation=(0,C.o8)(s));const n=e.rotation;(0,S.t2)(n,I.zK)||(t.rotation=(0,I.o8)(n));const i=e.scale;(0,O.p)(i,C.Un)||(t.scale=(0,C.o8)(i));const r=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),n=[r];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),n.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return n}return e.forEachNode((e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))})),[r]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=t.output.buffer===E.GLB;let n;n=s?t.binChunkBuffer:new p(this.gltf);const i=this.options.origin,r=e.vertexSpace.clone();r.origin=[i.x,i.y,i.z??0];const _=(0,L.UR)({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},r,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!_)return[];U(e,_),Y(_);const{position:a,normal:R,tangent:T}=_,{uv:c,color:u}=e.vertexAttributes,N=n.addBufferView(M.pe.FLOAT,A.VEC3,o.ARRAY_BUFFER);let f,h,l,S;R&&(f=n.addBufferView(M.pe.FLOAT,A.VEC3,o.ARRAY_BUFFER)),c&&(h=n.addBufferView(M.pe.FLOAT,A.VEC2,o.ARRAY_BUFFER)),T&&(l=n.addBufferView(M.pe.FLOAT,A.VEC4,o.ARRAY_BUFFER)),u&&(S=n.addBufferView(M.pe.FLOAT,A.VEC4,o.ARRAY_BUFFER)),N.startAccessor("POSITION"),f&&f.startAccessor("NORMAL"),h&&h.startAccessor("TEXCOORD_0"),l&&l.startAccessor("TANGENT"),S&&S.startAccessor("COLOR_0");const I=_.position.length/3;for(let e=0;e<I;++e)N.push(a[3*e]),N.push(a[3*e+1]),N.push(a[3*e+2]),f&&null!=R&&(f.push(R[3*e]),f.push(R[3*e+1]),f.push(R[3*e+2])),h&&null!=c&&(h.push(c[2*e]),h.push(c[2*e+1])),l&&null!=T&&(l.push(T[4*e]),l.push(T[4*e+1]),l.push(T[4*e+2]),l.push(T[4*e+3])),S&&null!=u&&(S.push(v(u[4*e]/255)),S.push(v(u[4*e+1]/255)),S.push(v(u[4*e+2]/255)),S.push(u[4*e+3]/255));const O=N.endAccessor(),C=this._addAccessor(N.index,O);let d,D,B,P,m;if(f){const e=f.endAccessor();d=this._addAccessor(f.index,e)}if(h){const e=h.endAccessor();D=this._addAccessor(h.index,e)}if(l){const e=l.endAccessor();B=this._addAccessor(l.index,e)}if(S){const e=S.endAccessor();P=this._addAccessor(S.index,e)}const G=[];return e.components&&e.components.length>0&&e.components[0].faces?(m=n.addBufferView(M.pe.UNSIGNED_INT,A.SCALAR,o.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(m,e.components,G,C,d,D,B,P)):this._addMeshVertexNonIndexed(e.components,G,C,d,D,B,P),N.finalize(),f&&f.finalize(),h&&h.finalize(),l&&l.finalize(),m&&m.finalize(),S&&S.finalize(),s||n.finalize(),G}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode=T.MASK;break;case"auto":case"blend":s.alphaMode=T.BLEND}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const n=e=>{const t=e.toRgba();return t[0]=v(t[0]/255),t[1]=v(t[1]/255),t[2]=v(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=n(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof d.A){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),null!=e.emissiveColor){const t=n(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,V().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const i=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),i}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:(0,l.kU)(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,(0,h.tE)(this._textureMap,e,(()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},n=t.length;return t.push(s),n}))}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const n=this.gltf.extras;switch(n.output.image){case a.GLB:{const e=n.binChunkBuffer.addBufferView(M.pe.UNSIGNED_BYTE,A.SCALAR);if((0,y.x3)(t))null!=t.data&&e.writeOutToBuffer(t.data,0);else{const i=b(t,this.options.signal).then((({data:e,type:t})=>(s.mimeType=t,e)));n.promises.push(e.writeAsync(i).then((()=>{e.finalize()})))}s.bufferView=e.index;break}case a.DataURI:if((0,y.x3)(t)){V().warnOnce("Image export for basis compressed textures not available.");break}s.uri=function(e){const t=x(e);return null!=t?t.toDataURL():""}(t);break;default:if((0,y.x3)(t)){V().warnOnce("Image export for basis compressed textures not available.");break}n.promises.push(b(t,this.options.signal).then((({data:e,type:t})=>{s.uri=e,s.mimeType=t})))}}const n=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,n),n}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=M.pF.REPEAT,s=M.pF.REPEAT;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=M.pF.CLAMP_TO_EDGE,s=M.pF.CLAMP_TO_EDGE;break;case"mirror":t=M.pF.MIRRORED_REPEAT,s=M.pF.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":s=M.pF.CLAMP_TO_EDGE;break;case"mirror":s=M.pF.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":t=M.pF.CLAMP_TO_EDGE;break;case"mirror":t=M.pF.MIRRORED_REPEAT}}const n={wrapS:t,wrapT:s};for(let e=0;e<this.gltf.samplers.length;++e)if(JSON.stringify(n)===JSON.stringify(this.gltf.samplers[e]))return e;const i=this.gltf.samplers.length;return this.gltf.samplers.push(n),i}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const n=this.gltf.accessors.length;return this.gltf.accessors.push(s),n}_addMeshVertexIndexed(e,t,s,n,i,r,_,E){const a=new Map;for(const o of t){if(e.startAccessor("INDICES"),o.faces)for(let t=0;t<o.faces.length;++t)e.push(o.faces[t]);const t=e.endAccessor(),A={attributes:{POSITION:n},indices:this._addAccessor(e.index,t),material:this._addMaterial(o.material)};i&&"flat"!==o.shading&&(A.attributes.NORMAL=i),r&&(A.attributes.TEXCOORD_0=r),_&&"flat"!==o.shading&&(A.attributes.TANGENT=_),E&&(A.attributes.COLOR_0=E);const R=a.get(o.name);if(R)R.primitives.push(A);else{const e={name:o.name,primitives:[A]};a.set(o.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,n,i,r,_){const E={primitives:[]};t.push(E);const a={attributes:{POSITION:s}};n&&(a.attributes.NORMAL=n),i&&(a.attributes.TEXCOORD_0=i),r&&(a.attributes.TANGENT=r),_&&(a.attributes.COLOR_0=_),e&&(a.material=this._addMaterial(e[0].material)),E.primitives.push(a)}}function Y({position:e,normal:t,tangent:s}){X(e,3),X(t,3),X(s,4)}function X(e,t){if(null!=e)for(let s=1,n=2;s<e.length;s+=t,n+=t){const t=e[s],i=e[n];e[s]=i,e[n]=-t}}function v(e){return e**N.Tf}var z=s(4576);class k{constructor(){this.copyright="",this.defaultScene=0,this.generator="",this._scenes=[]}addScene(e){if(this._scenes.includes(e))throw new Error("Scene already added");this._scenes.push(e)}removeScene(e){(0,z.TF)(this._scenes,e)}forEachScene(e){this._scenes.forEach(e)}}class W{constructor(e){this.mesh=e,this.name="",this.translation=(0,C.vt)(),this.rotation=(0,I.vt)(),this.scale=(0,C.o8)(C.Un),this._nodes=[]}addNode(e){if(this._nodes.includes(e))throw new Error("Node already added");this._nodes.push(e)}forEachNode(e){this._nodes.forEach(e)}set rotationAngles(e){(0,S.A6)(this.rotation,e[0],e[1],e[2])}}const K="model.gltf",j="model.glb";async function Z(e,t){const s=new H(e,t).gltf,n=s.extras.promises;let _=1,o=1,A=null;await Promise.allSettled(n),(0,i.Te)(t.signal);const R=t.jsonSpacing??4,T=new Map,c=JSON.stringify(s,((e,s)=>{if("extras"!==e){if(s instanceof ArrayBuffer){if(function(e){if(e.byteLength<8)return!1;const t=new Uint8Array(e);return 137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7]}(s))switch(t.output?.image){case a.DataURI:case a.GLB:break;case a.External:default:{const e=`img${o}.png`;return o++,T.set(e,s),e}}switch(t.output?.buffer){case E.DataURI:return function(e){const t=[],s=new Uint8Array(e);for(let e=0;e<s.length;e++)t.push(String.fromCharCode(s[e]));return"data:application/octet-stream;base64,"+btoa(t.join(""))}(s);case E.GLB:if(A)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(A=s);case E.External:default:{const e=`data${_}.bin`;return _++,T.set(e,s),e}}}return s}}),R);return t.output?.buffer===E.GLB||t.output?.image===a.GLB?T.set(j,new r(c,A).buffer):T.set(K,c),T}class J{constructor(){this.name="",this._nodes=[]}addNode(e){if(this._nodes.includes(e))throw new Error("Node already added");this._nodes.push(e)}forEachNode(e){this._nodes.forEach(e)}}async function Q(e,t){const s=new k,n=new J;return s.addScene(n),n.addNode(new W(e)),await async function(e,t){const s=(await Z(e,{output:{buffer:E.GLB,image:a.GLB},jsonSpacing:0,...t})).get(j);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}(s,{origin:e.origin,...t})}},51530:(e,t,s)=>{s.d(t,{KB:()=>E,Xi:()=>r,pn:()=>a,x3:()=>_});var n=s(44208),i=s(89192);class r{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding=i.JS.KTX2_ENCODING}}function _(e){return"encoded-mesh-texture"===e?.type}async function E(e){const t=new Blob([e]),s=await t.text();return JSON.parse(s)}async function a(e,t){if(t===i.JS.KTX2_ENCODING)return new r(e);const s=new Blob([e],{type:t});let _=URL.createObjectURL(s);switch(t){case"image/jpeg":_+="#.jpg";break;case"image/png":_+="#.png"}const E=new Image;if((0,n.A)("esri-iPhone"))return new Promise(((e,t)=>{const s=()=>{i(),e(E)},n=e=>{i(),t(e)},i=()=>{URL.revokeObjectURL(_),E.removeEventListener("load",s),E.removeEventListener("error",n)};E.addEventListener("load",s),E.addEventListener("error",n),E.src=_}));try{E.src=_,await E.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(_),E}},63907:(e,t,s)=>{var n,i,r,_,E,a,o,A,R,T,c,u,N,f,h,l,S,I,O,C,d,L,M,D,p,U,B;s.d(t,{Ab:()=>l,Ac:()=>A,Ap:()=>f,CQ:()=>F,Cj:()=>u,Fq:()=>G,H0:()=>S,H3:()=>h,Hr:()=>B,MT:()=>T,NV:()=>n,SB:()=>C,Tb:()=>E,WR:()=>r,Xo:()=>d,Y7:()=>o,bh:()=>Y,dn:()=>_,eA:()=>c,iE:()=>O,j7:()=>I,ld:()=>L,nI:()=>g,pF:()=>N,pe:()=>R,r6:()=>P,vt:()=>U,yI:()=>m}),function(e){e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e[e.COLOR=16384]="COLOR"}(n||(n={})),function(e){e[e.COLOR=6144]="COLOR",e[e.DEPTH=6145]="DEPTH",e[e.STENCIL=6146]="STENCIL",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(i||(i={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(r||(r={})),function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(_||(_={})),function(e){e[e.ADD=32774]="ADD",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX",e[e.SUBTRACT=32778]="SUBTRACT",e[e.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(E||(E={})),function(e){e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e[e.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",e[e.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",e[e.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",e[e.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",e[e.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(a||(a={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(o||(o={})),function(e){e[e.CW=2304]="CW",e[e.CCW=2305]="CCW"}(A||(A={})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.HALF_FLOAT=5131]="HALF_FLOAT"}(R||(R={})),function(e){e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS"}(T||(T={})),function(e){e[e.ZERO=0]="ZERO",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP"}(c||(c={})),function(e){e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(u||(u={})),function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(N||(N={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_3D=32879]="TEXTURE_3D",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(f||(f={})),function(e){e[e.MIN_LOD=33082]="MIN_LOD",e[e.MAX_LOD=33083]="MAX_LOD",e[e.BASE_LEVEL=33084]="BASE_LEVEL",e[e.MAX_LEVEL=33085]="MAX_LEVEL",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE"}(h||(h={})),function(e){e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.RED=6403]="RED",e[e.RG=33319]="RG",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER"}(l||(l={})),function(e){e[e.RGBA4=32854]="RGBA4",e[e.R16F=33325]="R16F",e[e.RG16F=33327]="RG16F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.R32F=33326]="R32F",e[e.RG32F=33328]="RG32F",e[e.RGBA32F=34836]="RGBA32F",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB5_A1=32855]="RGB5_A1",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.RGB16F=34843]="RGB16F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.RGB565=36194]="RGB565",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2=32857]="RGB10_A2",e[e.RGB10_A2UI=36975]="RGB10_A2UI"}(S||(S={})),function(e){e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(I||(I={})),function(e){e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(O||(O={})),function(e){e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F"}(C||(C={})),function(e){e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8"}(d||(d={})),function(e){e[e.FLOAT=5126]="FLOAT",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.INT=5124]="INT",e[e.HALF_FLOAT=5131]="HALF_FLOAT",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(L||(L={})),function(e){e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.STATIC_READ=35045]="STATIC_READ",e[e.DYNAMIC_READ=35049]="DYNAMIC_READ",e[e.STREAM_READ=35041]="STREAM_READ",e[e.STATIC_COPY=35046]="STATIC_COPY",e[e.DYNAMIC_COPY=35050]="DYNAMIC_COPY",e[e.STREAM_COPY=35042]="STREAM_COPY"}(M||(M={})),function(e){e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER"}(D||(D={})),function(e){e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",e[e.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(p||(p={})),function(e){e[e.Texture=0]="Texture",e[e.TileTexture=1]="TileTexture",e[e.BufferObject=2]="BufferObject",e[e.VertexArrayObject=3]="VertexArrayObject",e[e.Shader=4]="Shader",e[e.Program=5]="Program",e[e.FramebufferObject=6]="FramebufferObject",e[e.Renderbuffer=7]="Renderbuffer",e[e.TransformFeedback=8]="TransformFeedback",e[e.Sync=9]="Sync",e[e.UNCOUNTED=10]="UNCOUNTED",e[e.LinesOfCode=10]="LinesOfCode",e[e.Uniform=11]="Uniform",e[e.COUNT=12]="COUNT"}(U||(U={})),function(e){e[e.NONE=0]="NONE",e[e.BACK=1029]="BACK"}(B||(B={}));const P=36064,m=36065,G=36066,g=33306;var F,w,b,x,y,V,H,Y,X;!function(e){e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(F||(F={})),function(e){e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT=5124]="INT",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",e[e.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",e[e.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",e[e.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",e[e.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",e[e.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",e[e.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",e[e.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",e[e.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",e[e.SAMPLER_3D=35679]="SAMPLER_3D",e[e.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",e[e.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",e[e.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",e[e.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",e[e.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",e[e.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",e[e.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",e[e.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",e[e.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",e[e.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",e[e.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(w||(w={})),function(e){e[e.OBJECT_TYPE=37138]="OBJECT_TYPE",e[e.SYNC_CONDITION=37139]="SYNC_CONDITION",e[e.SYNC_STATUS=37140]="SYNC_STATUS",e[e.SYNC_FLAGS=37141]="SYNC_FLAGS"}(b||(b={})),function(e){e[e.UNSIGNALED=37144]="UNSIGNALED",e[e.SIGNALED=37145]="SIGNALED"}(x||(x={})),function(e){e[e.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",e[e.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",e[e.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",e[e.WAIT_FAILED=37149]="WAIT_FAILED"}(y||(y={})),function(e){e[e.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(V||(V={})),function(e){e[e.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(H||(H={})),function(e){e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL"}(Y||(Y={})),function(e){e[e.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR"}(X||(X={}))},89192:(e,t,s)=>{var n,i,r,_,E,a,o,A;s.d(t,{Am:()=>_,C7:()=>r,JS:()=>A,Mg:()=>a,dd:()=>E,it:()=>i,s2:()=>n,sf:()=>o}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(n||(n={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(i||(i={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(r||(r={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(_||(_={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(E||(E={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee"}(a||(a={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(o||(o={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(A||(A={}))}}]);