@arcgis/core 5.1.0-next.93 → 5.1.0-next.94
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.
- package/analysis/Viewshed.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/compilerUtils.js +1 -1
- package/arcade/debug.d.ts +10 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01af2a0611386df64cb1.js +636 -0
- package/assets/esri/core/workers/chunks/031ea31bbdb7f1be791e.js +1 -0
- package/assets/esri/core/workers/chunks/{9c09097e390985bbac58.js → 075a1e91a075efe59cd3.js} +1 -1
- package/assets/esri/core/workers/chunks/0981fe06796060e50d40.js +1 -0
- package/assets/esri/core/workers/chunks/0ab1384282afc8731857.js +1 -0
- package/assets/esri/core/workers/chunks/{de3e5d82502ee15b7eae.js → 15a070d4ac2087b79e8b.js} +1 -1
- package/assets/esri/core/workers/chunks/198864c107fa2b24518c.js +1 -0
- package/assets/esri/core/workers/chunks/{8a370cc1a99ddc7ce70b.js → 1f141a007b1ef9b069c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7ee05f46b26b17f9414.js → 268f203d2492a03165ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{f52443cd203e687551da.js → 2fda38219d778f0447b5.js} +1 -1
- package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +1 -0
- package/assets/esri/core/workers/chunks/{394812e19b6915d560b0.js → 3a691f848152e3818a48.js} +1 -1
- package/assets/esri/core/workers/chunks/{5eff240a0e41a4f80e61.js → 3a6b8879702fb247328b.js} +1 -1
- package/assets/esri/core/workers/chunks/{41cbde4738ae4adf973d.js → 4142d5232c99d8aa943d.js} +5 -5
- package/assets/esri/core/workers/chunks/{77c2d8d0ce1c1ab469e9.js → 4378e544687fec4b06fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{412745bfacef23e3b702.js → 460e693ad19fa77ffdc2.js} +1 -1
- package/assets/esri/core/workers/chunks/{a169d9fe66b5865911d9.js → 503439246250d9e1cbd5.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e3fe89970c57a883fe5.js → 53ff47c06ccfc0be885c.js} +1 -1
- package/assets/esri/core/workers/chunks/561d45dc9421f80feca5.js +1 -0
- package/assets/esri/core/workers/chunks/598271956c46e21e5c09.js +1 -0
- package/assets/esri/core/workers/chunks/{d82da31dc702b8fd6a07.js → 59a64d72eed8c40c63cf.js} +1 -1
- package/assets/esri/core/workers/chunks/5a8fd2fd8a24f9290b7f.js +1 -0
- package/assets/esri/core/workers/chunks/64cf18ba2869171a5a7a.js +1 -0
- package/assets/esri/core/workers/chunks/{fade7b878a9498382bb2.js → 700f7aa9cf7b13acaf5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c97cc922eece3a91b6b.js → 7531bbcb6613c87a344e.js} +1 -1
- package/assets/esri/core/workers/chunks/{6f67c9f68101a084b683.js → 765bc49e58e9d0caa496.js} +6 -6
- package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +1 -0
- package/assets/esri/core/workers/chunks/{f8072a4cf1b25d8b93f9.js → 82215d7a64b8be02eff1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3d9d40556c847bba1a7.js → 87f7a674957f734b1b42.js} +1 -1
- package/assets/esri/core/workers/chunks/{172228d1a392ca7a5b21.js → 8875e53097b25655ef67.js} +1 -1
- package/assets/esri/core/workers/chunks/8e1140725a72038627c2.js +1 -0
- package/assets/esri/core/workers/chunks/8e374ce47256a567ae11.js +1 -0
- package/assets/esri/core/workers/chunks/{127cd8fee3717a473fc5.js → 928dac64e6ba401d391a.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7e7f3efd1d28617b808.js → 92e7067960549733f8e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a6df243b18acae471be.js → 992525afdf11b2fb16d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{f1673e723b336204ad77.js → 9b23d999db902d25ba58.js} +1 -1
- package/assets/esri/core/workers/chunks/{19a0cb2d335d97ad9488.js → 9b869a8bda9384f25464.js} +1 -1
- package/assets/esri/core/workers/chunks/a76e14fe5e8b2f7ef9de.js +2 -0
- package/assets/esri/core/workers/chunks/{46b16501db6681dc467b.js → af074b5b4e1d6baf5219.js} +1 -1
- package/assets/esri/core/workers/chunks/{75c09a2fa4c34b4844c5.js → be0eab592db0e651b023.js} +6 -6
- package/assets/esri/core/workers/chunks/{6aed2e42e65ac80f1fab.js → c7b9df9a204f6206364a.js} +1 -1
- package/assets/esri/core/workers/chunks/{969f58a2de4ebe63619d.js → c88fd4f69cb2b53b48ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{f706bfea34d22539b46a.js → d6f03f628ebfc28fdd23.js} +2 -2
- package/assets/esri/core/workers/chunks/{2647c739cda29361a463.js → d87e504082e293640ece.js} +2 -2
- package/assets/esri/core/workers/chunks/{54c035cdc171998d0776.js → de99500b0fcedf2c8a5c.js} +1 -1
- package/assets/esri/core/workers/chunks/e54ad3683ad992682deb.js +1 -0
- package/assets/esri/core/workers/chunks/e7e7c7cbfd8542bd7a46.js +1 -0
- package/assets/esri/core/workers/chunks/{aefeb5a17bb481c95da3.js → eeb847bfea558566adf6.js} +1 -1
- package/assets/esri/core/workers/chunks/{be47e42c6c8c0820efd8.js → f04b49d80f422708d98c.js} +1 -1
- package/assets/esri/core/workers/chunks/{d11de13537b623739e14.js → f14e3693cd644265f909.js} +1 -1
- package/assets/esri/core/workers/chunks/f2beb4267b8d4cddfa3e.js +1 -0
- package/assets/esri/core/workers/chunks/{2fd4220131bfc3f5e2dd.js → f635a8e3b0bfeda99ed5.js} +1 -1
- package/assets/esri/core/workers/chunks/f69c44479ee3fd8c831d.js +1 -0
- package/assets/esri/core/workers/chunks/fa3138dd8139008b430d.js +1 -0
- package/assets/esri/core/workers/chunks/fa4265db06e2721754a0.js +1 -0
- package/assets/esri/core/workers/chunks/{12f41c1c66fb446b6286.js → fb75d4bce1e86eed017a.js} +7 -7
- package/chunks/GlowComposition.glsl.js +4 -4
- package/config.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +27 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/InMemoryRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/support/RasterJobHandler.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/rest/versionManagement/gdbVersion/support/ConflictsParameters.js +1 -1
- package/rest/versionManagement/gdbVersion/support/DifferencesParameters.js +1 -1
- package/rest/versionManagement/gdbVersion/support/DifferencesResult.d.ts +25 -0
- package/rest/versionManagement/gdbVersion/support/InspectConflictsParameters.js +1 -1
- package/rest/versionManagement/gdbVersion/support/ReconcileParameters.d.ts +3 -5
- package/rest/versionManagement/gdbVersion/support/ReconcileParameters.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/types.d.ts +27 -0
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/GlyphSDFCreator.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -12
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
- package/views/SceneView.d.ts +3 -3
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.d.ts +2 -17
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -7
- package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -9
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +0 -8
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/00e9e25269d5776f8645.js +0 -1
- package/assets/esri/core/workers/chunks/014a5fad55f97b9b5166.js +0 -1
- package/assets/esri/core/workers/chunks/06003996a378c45bc605.js +0 -1
- package/assets/esri/core/workers/chunks/34f7450769826e8b7069.js +0 -636
- package/assets/esri/core/workers/chunks/3d9032217347dadcbe41.js +0 -1
- package/assets/esri/core/workers/chunks/4b79ebfb3328f9483147.js +0 -1
- package/assets/esri/core/workers/chunks/4dbbf59c79d9e72f20ee.js +0 -1
- package/assets/esri/core/workers/chunks/4e206957b28253ddc1a3.js +0 -1
- package/assets/esri/core/workers/chunks/53ef72edc3ed80bf558c.js +0 -1
- package/assets/esri/core/workers/chunks/6dac8dfcd63fc757ae2d.js +0 -1
- package/assets/esri/core/workers/chunks/7ba67f1d7831a5576a5a.js +0 -1
- package/assets/esri/core/workers/chunks/8a7a99533d02eb9cb058.js +0 -2
- package/assets/esri/core/workers/chunks/a6b75576d598ec161cc4.js +0 -1
- package/assets/esri/core/workers/chunks/b4bac22467e96be7a974.js +0 -1
- package/assets/esri/core/workers/chunks/dd5b362bded458afa2d6.js +0 -1
- package/assets/esri/core/workers/chunks/dde94664110ff231a52d.js +0 -1
- package/assets/esri/core/workers/chunks/f1e5626a0cc1631a1efb.js +0 -1
- package/assets/esri/core/workers/chunks/f36345ebb9851ab92453.js +0 -1
- package/assets/esri/core/workers/chunks/f49c7bb5d134bcb22155.js +0 -1
- package/assets/esri/core/workers/chunks/f7531aa69a87814c60d1.js +0 -1
- package/assets/esri/themes/base/fonts/cdn.scss +0 -3
- /package/assets/esri/core/workers/chunks/{8a7a99533d02eb9cb058.js.LICENSE.txt → a76e14fe5e8b2f7ef9de.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f706bfea34d22539b46a.js.LICENSE.txt → d6f03f628ebfc28fdd23.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2647c739cda29361a463.js.LICENSE.txt → d87e504082e293640ece.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1003],{1003(e,t,s){s.r(t),s.d(t,{default:()=>me});var i=s(49186),n=s(5482),a=s(91429),r=s(49859),o=s(68197),l=s(5443),c=s(16930),f=s(73444),u=s(94778),h=s(14140);function p(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function d(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function m(e){const{axes:t}=e.domain,s=Object.keys(t),i=[],n=[];let a=-1,r=-1,o=[];for(let e=0;e<s.length;e++){const l=s[e];p(l)?a=e:d(l)&&(r=e);const c=t[l],f=[];if("values"in c){c.values.forEach(e=>f.push("string"==typeof e?new Date(e).getTime():e));const e=f[1]-f[0];i.push([f[0]-.5*e,f[f.length-1]+.5*e]),n.push(e)}else{const{start:e,stop:t,num:s}=c,a=(t-e)/(s-1);i.push([e-.5*a,t+.5*a]),n.push(a);for(let t=0;t<s;t++)f.push(e+a*t)}o.push({name:l,values:f,extent:[f[0],f[f.length-1]]})}a>-1&&-1===r?r=0===a?1:0:r>-1&&-1===a?a=0===r?1:0:-1===r&&-1===a&&(a=0,r=1),o=o.filter((e,t)=>!(t===a||t===r));const{referencing:f}=e.domain,u=f.find(e=>e.coordinates.includes(s[a])).system.id,h=u?.slice(u.lastIndexOf("/")+1),m=null==h||"CRS84"===h?4326:Number(h),g=new c.A({wkid:m}),[y,x]=i[a],[w,I]=i[r],v=new l.A({xmin:y,xmax:x,ymin:w,ymax:I,spatialReference:g});return{width:Math.round(v.width/n[a]),height:Math.round(v.height/n[r]),extent:v,dimensions:o}}function g(e){const t=(0,f.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function y(){return Math.round(255*Math.random())}function x(e){const t={},{parameters:s}=e;if(!s)return t;for(const[e,i]of Object.entries(s)){const{type:s,description:n,unit:a,categoryEncoding:r,observedProperty:l}=i;if("Parameter"===s&&(t[e]={},n&&(t[e].description=g(n)),a&&(t[e].unit=a.label?g(a.label):null,t[e].symbol=a.symbol?.value),r)){const s=Object.entries(r).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1}));let i=!1;l?.categories?.length&&(l.categories.forEach(e=>{if(!e.id)return;const t=e.id.slice(e.id.lastIndexOf("/")+1),n=s.find(e=>e.ClassName===t);if(!n)return;const a=e.label?g(e.label):null;if(n.Label=a,e.preferredColor){const t=o.A.fromHex(e.preferredColor);t&&(i=!0,n.Red=t.r,n.Green=t.g,n.Blue=t.b)}}),i&&s.forEach(e=>{null==e.Red&&(e.Red=y(),e.Green=y(),e.Blue=y())}));const n={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:s.map(e=>({attributes:e}))};i&&n.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=n}}return t}function w(e){let t=Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let i=0;i<e.length;i++){const n=e[i];null!=n&&(n<t&&(t=n),n>s&&(s=n))}return(0,u.X1)(t,s)}function I(e,t,s){const i=e.map((e,s)=>({name:e,count:t[s]})).sort((e,t)=>e.name>t.name?-1:1),n=(a=1,e=>a*=e.count);var a;const r=[...i.slice(1),{name:"",count:1}].reverse().map(n).reverse();let o=0;for(let n=e.length-1;n>=0;n--)o+=r[i.findIndex(({name:t})=>t===e[n])]*(s%t[n]),s=Math.floor(s/t[n]);return o}var v=s(17676),C=s(4366),b=s(47520),T=s(51927),S=s(45617),A=s(87186);let R=class extends r.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.preGenerateTiles=!0,this.source=null}get url(){return""}fetchRawTile(e,t,s,i={}){if(!this._pixelBlockTiles){const{rasterInfo:n}=this,[a,r]=n.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:l}=this.source,c={pixelBlock:null==o?l[0]:l[o],useBilinear:"thematic"!==n.dataType,tileSize:{width:a,height:r},level:e,row:t,col:s},f=this.rasterJobHandler?this.rasterJobHandler.clipTile(c,i):(0,b.J$)(c);return Promise.resolve(f)}const n=this._pixelBlockTiles.get(`${e}/${t}/${s}`);return Promise.resolve(n)}async _open(e){const t=this.source,{pixelBlocks:s,attributeTable:i,statistics:n,histograms:a,name:r,nativeExtent:o,transform:f,colormap:u}=t,h=s[0],{width:p,height:d,pixelType:m}=h,g=t.extent??new l.A({xmin:-.5,ymin:.5,xmax:p-.5,ymax:d-.5,spatialReference:new c.A({wkid:3857})}),y=t.isPseudoSpatialReference??!t.extent,x={x:g.width/p,y:g.height/d},w={...t.keyProperties};t.dataType&&(w.DataType=t.dataType),t.bandInfos&&(w.BandProperties=t.bandInfos.map(e=>e.toJSON())),i&&(w.DataType="Thematic");const I=new A.A({width:p,height:d,pixelType:m,extent:g,nativeExtent:o,attributeTable:i,colormap:u,transform:f,pixelSize:x,spatialReference:g.spatialReference,bandCount:h.pixels.length,keyProperties:w,multidimensionalInfo:t.multidimensionalInfo,statistics:n,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(I),this.createRemoteDatasetStorageInfo(I,512,512),this._set("rasterInfo",I),this.updateTileInfo(),I.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,I.multidimensionalInfo):this.preGenerateTiles&&await this._buildInMemoryRaster(h,{width:512,height:512},e),I.multidimensionalInfo||(this.source=null),this.datasetName=r}async _buildInMemoryRaster(e,t,s){const{rasterInfo:n}=this,a=n.storageInfo.maximumPyramidLevel??0,r="thematic"!==n.dataType,o=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:a,useBilinear:r},s):Promise.resolve((0,b.lD)(e,t,a,r)),l=null!=n.statistics,c=null!=n.histograms,f=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},s):Promise.resolve((0,T.f4)(e)),u=await(0,v.Lx)([o,f]);if(!u[0].value&&u[1].value)throw new i.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(n.statistics=u[1].value?.statistics),c||(n.histograms=u[1].value?.histograms)}async _buildMDimStats(e,t,s){for(let i=0;i<t.variables.length;i++){const n=t.variables[i];if(n.statistics)continue;const a=n.dimensions.map(e=>new S.A({variableName:n.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),r=(0,C.NG)(a,t),o=null==r?null:e[r];if(null==o)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},s):(0,T.eH)(o);n.statistics=l.statistics,n.histograms||(n.histograms=l.histograms)}}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],R.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],R.prototype,"preGenerateTiles",void 0),(0,n.Cg)([(0,a.MZ)()],R.prototype,"source",void 0),(0,n.Cg)([(0,a.MZ)()],R.prototype,"url",null),R=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.InMemoryRaster")],R);const M=R;var O=s(22671);let k=class extends r.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,s,i={}){return this._inMemoryRaster.fetchRawTile(e,t,s,i)}async _open(e){const{extent:t,pixelBlocks:s,multidimensionalInfo:i,attributeTable:n,bandNames:a}=await this._fetchData(e),{statistics:r,histograms:o}=(0,T.eH)(s[0]),l=a?.map(e=>({BandName:e})),c={DataType:n?"Thematic":i?"Scientific":"Generic",BandProperties:l},f=new M({source:{extent:t,pixelBlocks:s,attributeTable:n?O.A.fromJSON(n):null,multidimensionalInfo:i,statistics:r,histograms:o,keyProperties:c,isPseudoSpatialReference:!1}});await f.open(),this._inMemoryRaster=f;const u=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",u.slice(0,u.indexOf("."))),this._set("rasterInfo",f.rasterInfo)}async _fetchData(e){const t=this.source??(await this.request(this.url,{signal:e?.signal})).data,s="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new i.A(s,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new i.A(s,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new i.A(s,"Missing domain referencing in the grid coverage data");const n=Object.values(t.ranges);for(let e=0;e<n.length;e++){const{axisNames:t,shape:a,type:r,values:o}=n[e];if(!("ndarray"===r.toLowerCase()&&o?.length&&t?.length&&a?.length))throw new i.A(s,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!p(t[t.length-1])||!d(t[t.length-2]))throw new i.A(s,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){const{width:t,height:s,extent:i,dimensions:n}=m(e),{ranges:a}=e,r=Object.keys(a).sort((e,t)=>e<t?-1:1),o=[];for(let e=0;e<r.length;e++){const t=r[e];n?.length&&o.push({name:t,dimensions:n})}const l=x(e);o.forEach(e=>l[e.name]&&Object.assign(e,l[e.name]));const c=o.length?{variables:o}:void 0,f=[];for(let e=0;e<r.length;e++){const i=r[e],{values:o,dataType:l,axisNames:c,shape:u}=a[i],p=u.length>2?e*u.slice(0,-2).reduce((e,t)=>e*t):0,d=c.slice(0,-2),m=u.slice(0,-2),g="float"===l?"f32":w(o),y=t*s,x=o.length/y;for(let i=0;i<x;i++){const a=h.A.createEmptyBand(g,y),r=new Uint8Array(y).fill(255);let l=!1;const c=i*y;for(let e=0;e<y;e++){const t=o[c+e];null==t?(r[e]=0,l=!0):a[e]=t}if(0===e||n?.length){const e=new h.A({width:t,height:s,mask:l?r:null,pixels:[a],pixelType:g});e.updateStatistics(),n?.length?f[I(d,m,i)+p]=e:f.push(e)}else{const e=f[i];e.pixels.push(a),l?e.mask&&(e.mask=h.A.combineBandMasks([e.mask,r])):e.mask=l?r:null}}}const u=Object.values(l).find(e=>e.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:f,multidimensionalInfo:c,attributeTable:u,bandNames:c?void 0:r}}(t)}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],k.prototype,"source",void 0),k=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.CovJSONRaster")],k);const _=k;var F=s(4576),P=s(21325),B=s(330),N=s(43163);function D(e,t){if(!e||!t)return null;const s=[];for(let i=0;i<e.length;i++)s.push(e[i]),s.push(t[i]);return s}function E(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new c.A({wkid:t});if(e=String(e).trim(),(0,P.jp)(e))return new c.A({wkt2:e});const s=e.toUpperCase();if(s.startsWith("COMPD_CS")){if(!s.includes("VERTCS")||!s.includes("GEOGCS")&&!s.startsWith("PROJCS"))return null;const i=s.indexOf("VERTCS"),n=s.indexOf("PROJCS"),a=n>-1?n:s.indexOf("GEOGCS");if(-1===a)return null;const r=e.slice(a,e.lastIndexOf("]",i)+1).trim(),o=e.slice(i,e.lastIndexOf("]")).trim();t=L(r);const l=new c.A(t?{wkid:t}:{wkt:r}),f=L(o);return f&&(l.vcsWkid=f),l}return s.startsWith("GEOGCS")||s.startsWith("PROJCS")?(t=L(e),new c.A(0!==t?{wkid:t}:{wkt:e})):null}function L(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),s=t[t.length-1].split(","),i=s[0]?.toLowerCase();if(("epsg"===i||"esri"===i)&&e.endsWith('"]]')){const e=Number(s[1]);if(!isNaN(e)&&0!==e)return e}return 0}function z(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,B.g7)(e,"SRS")){if(!t.spatialReference){const s=(0,B.mX)(e);t.spatialReference=E(s)}}else if((0,B.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:s,transform:i}=function(e){const t=(0,B.V6)(e,"GeodataXform"),s=E((0,B.v7)(t,"SpatialReference/WKID")||(0,B.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:s,transform:null};const i=(0,B.v7)(t,"PolynomialOrder")??1,n=(0,B.Ui)(t,"CoeffX/Double"),a=(0,B.Ui)(t,"CoeffY/Double"),r=(0,B.Ui)(t,"InverseCoeffX/Double"),o=(0,B.Ui)(t,"InverseCoeffY/Double"),l=D(n,a),c=D(r,o);return{spatialReference:s,transform:l&&c&&l.length&&c.length?new N.A({spatialReference:s,polynomialOrder:i,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=i,t.spatialReference||(t.spatialReference=s)}else(0,B.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,B.mX)(e));else if((0,B.g7)(e,"PAMRasterBand")){const s=function(e){const t=(0,B.v7)(e,"NoDataValue"),s=(0,B.V6)(e,"Histograms/HistItem"),i=(0,B.v7)(s,"HistMin"),n=(0,B.v7)(s,"HistMax"),a=(0,B.v7)(s,"BucketCount"),r=(0,B.mX)(s,"HistCounts")?.split("|").map(e=>Number(e));let o,l,c,f;(0,B.IC)(e,"Metadata/MDI").forEach(e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":f=t}});const u=(0,B.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:r?.length&&null!=i&&null!=n?{min:i,max:n,size:a||r.length,counts:r}:null,sourceBandIndex:u,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:f}:null}}(e);null!=s.sourceBandIndex&&null==t.rasterBands[s.sourceBandIndex]?t.rasterBands[s.sourceBandIndex]=s:t.rasterBands.push(s)}});const s=t.rasterBands;if(s.length){const e=!!s[0].statistics;t.statistics=e?s.map(e=>e.statistics).filter(F.Ru):null;const i=!!s[0].histogram;t.histograms=i?s.map(e=>e.histogram).filter(F.Ru):null}return t}var U=s(20758);let G=class extends r.A{fetchRawTile(e,t,s,i={}){if(this._imageBlob){const{blockWidth:i,blockHeight:n}=this.rasterInfo.storageInfo;return this.decodePixelBlock(this._imageBlob,{tileSize:[i,n],tileIndex:[e,t,s],canvasUsage:"canvas-only",cloneSource:!0})}return this._inMemoryRaster.fetchRawTile(e,t,s,i)}async _open(e){const t=await this._fetchData(e);if(null==t)throw new i.A("image-aux-raster:open","the data cannot be decoded");let{spatialReference:s,statistics:n,histograms:a,transform:r}=await this._fetchAuxiliaryData(e);const o=!s;o&&(s=new c.A({wkid:3857})),a?.length&&null==n&&(n=(0,T.Pg)(a));const{width:f,height:u}=t;let h=new l.A({xmin:-.5,ymin:.5-u,xmax:f-.5,ymax:.5,spatialReference:s});const p=r?r.forwardTransform(h):h;let d=!0;if(r){const e=r.forwardCoefficients;d=e&&0===e[1]&&0===e[2],d&&(r=null,h=p)}const m=new M({preGenerateTiles:!1,source:{extent:p,nativeExtent:h,transform:r,pixelBlocks:[t],statistics:n,histograms:a,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:o},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(m.ioConfig.skipMapInfo=!0),await m.open(),m.source=null,this._set("rasterInfo",m.rasterInfo),this._inMemoryRaster=m}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),s=(0,U.g)(t).toUpperCase();if("JPG"!==s&&"PNG"!==s&&"GIF"!==s&&"BMP"!==s)throw new i.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",s);const n=s.toLowerCase();try{const e=await this.decodePixelBlock(t,{format:n,canvasUsage:"canvas-only",cloneSource:!0});return this._imageBlob=t,e}catch{return this.decodePixelBlock(t,{format:n,canvasUsage:"no-canvas"})}}async _fetchAuxiliaryData(e){const t=e?.signal,{skipExtensions:s=[],skipMapInfo:i}=this.ioConfig,n=i||s.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),a=this.datasetFormat,r="JPG"===a?"jgw":"PNG"===a?"pgw":"BMP"===a?"bpw":null,o=r&&s.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:t}),l=await(0,v.Lx)([n,o]);if(t?.aborted)throw(0,v.NK)();const c=z(l[0].value?.data);if(!c.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;c.transform=6===e?.length?new N.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return c}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],G.prototype,"datasetFormat",void 0),G=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.ImageAuxRaster")],G);const J=G;var H=s(97768),j=s(84952),q=s(86738),V=s(75414),W=s(20223),X=s(87045),$=s(25943),Z=s(82371);let Y=class extends r.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,s,i={}){const{storageInfo:n,extent:a}=this.rasterInfo,{transposeInfo:r}=n,o=null!=r&&!!i.transposedVariableName;if(this._slices&&!o&&null==i.sliceId)return null;const l=o?0:n.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${s}`,f={...this._slices?o?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,...i.refreshParameters};let u,h;if(n.isBsqTile){const e=(i.bandIds?.length?i.bandIds:[0,1,2]).map(e=>this.request(c,{query:{...f,bandId:e},responseType:"array-buffer",signal:i.signal})),t=await Promise.all(e),s=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),n=new Uint8Array(s);h=[];let a=0;for(const{data:e}of t)h.push(a),n.set(new Uint8Array(e),a),a+=e.byteLength;u=n.buffer}else u=(await this.request(c,{query:f,responseType:"array-buffer",signal:i.signal})).data;if(!u)return null;const{tileInfo:p}=n,d=o?r.tileSize:p.size,m=/^(mixed|jp)/i.test(p.format),g=await this.decodePixelBlock(u,{width:d[0],height:d[1],planes:h?.length,offsets:h,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue,applyJpegMask:m});if(null==g)return null;const y=n.blockBoundary[e];if("jpg"!==n.compression||s>y.minCol&&s<y.maxCol&&t>y.minRow&&t<y.maxRow)return g;const{origin:x,blockWidth:w,blockHeight:I}=n,{x:v,y:C}=this.getPyramidPixelSize(e),T=Math.round((a.xmin-x.x)/v)%w,S=Math.round((a.xmax-x.x)/v)%w||w,A=Math.round((x.y-a.ymax)/C)%I,R=Math.round((x.y-a.ymin)/C)%I||I,M=s===y.minCol?T:0,O=t===y.minRow?A:0,k=s===y.maxCol?S:w,_=t===y.maxRow?R:I;return(0,b.z$)(g,{x:M,y:O},{width:k-M,height:_-O}),g}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const s=this._slices[e].multidimensionalDefinition;if(s.length===t.length&&!s.some(e=>{const s=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!s||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){const s=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),n=await Promise.all([s,i]);return n[0]&&n[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),n[1]?.[0]?.counts?.length||(n[1]=null),{statistics:n[0]||null,histograms:n[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let s=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===s)return null;let i=0;const{maximumPyramidLevel:n}=this.rasterInfo.storageInfo;let a=n-i+this._levelOffset;const r=s.srcLocation;for(;a>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(a,s.row,s.col,t))break}catch{}if(a--,i++,s=this.identifyPixelLocation(r,i,t.datumTransformation),null===s)return null}return-1===a||null==s?null:i}async _open(e){const t=e?.signal,s=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});s.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=s.data;if(this.sourceJSON=n,!n)throw new i.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new i.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(n.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name?.slice(n.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:t});if(null==a)throw new i.A("image-server-raster:open","cannot initialize image service");(0,Z.E9)(a,n);const r="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:s,maxScale:i,minLOD:n,maxLOD:a}=t;if(null!=n&&null!=a)return X.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=n&&e<=a)});if(0!==s&&0!==i){const t=e=>Math.round(1e4*e)/1e4,n=s?t(s):1/0,a=i?t(i):-1/0;return X.A.fromJSON({...e,lods:e.lods.filter(e=>{const s=t(e.scale);return s<=n&&s>=a})})}return X.A.fromJSON(e)}(n.tileInfo,n):X.A.fromJSON(n.tileInfo);(0,H.Lw)(r);const[o,l]=this._computeMinMaxLOD(a,r),{extent:c,pixelSize:f}=a,u=.001*Math.min(f.x,f.y);(f.x!==f.y||Math.abs(o.resolution-f.x)>u)&&(f.x=f.y=o.resolution,a.width=Math.ceil((c.xmax-c.xmin)/f.x-.1),a.height=Math.ceil((c.ymax-c.ymin)/f.y-.1));const h=o.level-l.level,[p,d]=r.size,m=[],g=[],{lods:y}=r;y.forEach((e,t)=>{e.level>=l.level&&e.level<=o.level&&m.push({x:e.resolution,y:e.resolution}),t<y.length-1&&g.push(Math.round(10*e.resolution/y[t+1].resolution)/10)}),m.sort((e,t)=>e.x-t.x);const x=this.computeBlockBoundary(c,p,d,r.origin,m,h),w=m.length>1?m.slice(1):null;let I;n.transposeInfo&&(I={tileSize:[n.transposeInfo.rows,n.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const v=g.length<=1||g.length>=3&&g.slice(0,-1).every(e=>e===g[0])?g[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/h))/10,C=!!n.bsq&&"Raster"===this.tileType;if(a.storageInfo=new W.A({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:w,pyramidScalingFactor:v,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:h,tileInfo:r,isBsqTile:C,transposeInfo:I,blockBoundary:x}),function(e){const{extent:t,spatialReference:s}=e;t.xmin>-1&&t.xmax>181&&s?.wkid&&s.isGeographic&&(e.nativeExtent=e.extent,e.transform=new V.A,e.extent=e.transform.forwardTransform(t))}(a),this._set("rasterInfo",a),n.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:a.storageInfo.tileInfo,parsedUrl:(0,j.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new $.d({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,s=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),i=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),n=c.A.fromJSON(t.spatialReference||e.spatialReference),a=new q.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:n});return new A.A({width:s,height:i,bandCount:3,extent:l.A.fromJSON(e),spatialReference:n,pixelSize:a,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const s={...e,query:{...this.ioConfig.customFetchParameters,f:"json"}},i=(0,Z.Tw)(this.url,this.sourceJSON,s),n=t.hasMultidimensions?this.request(`${this.url}/slices`,s).then(e=>e.data?.slices).catch(()=>null):null,a=await Promise.all([i,n]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:s}=e,i=.5/e.width*s.x,{lods:n}=t,a=t.lodAt(Math.max.apply(null,n.map(e=>e.level))),r=t.lodAt(Math.min.apply(null,n.map(e=>e.level))),{tileType:o}=this;if("Map"===o)return this._levelOffset=n[0].level,[a,r];if("Raster"===o)return[n.find(e=>e.resolution===s.x)??a,r];const{minScale:l,maxScale:c}=this.sourceJSON;let f=a;c>0&&(f=n.find(e=>Math.abs(e.scale-c)<i),f||(f=n.filter(e=>e.scale>c).sort((e,t)=>e.scale>t.scale?1:-1)[0]??a));let u=r;return l>0&&(u=n.find(e=>Math.abs(e.scale-l)<i)??r,this._levelOffset=u.level-r.level),[f,u]}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],Y.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)()],Y.prototype,"tileType",void 0),Y=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.ImageServerRaster")],Y);const K=Y;var Q=s(10713);const ee=new Map([["byte","u8"],["signedbyte","s8"],["int8","s8"],["uint8","u8"],["int16","s16"],["uint16","u16"],["int32","s32"],["uint32","u32"],["float32","f32"],["float64","f64"],["double64","f64"]]),te=new Map;te.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),te.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),te.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),te.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),te.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let se=class extends r.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,s,i={}){const{blockWidth:n,blockHeight:a,blockBoundary:r}=this.rasterInfo.storageInfo,o=r[e];if(!o||o.maxRow<t||o.maxCol<s||o.minRow>t||o.minCol>s)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:f,actualTileWidth:u,actualTileHeight:p}=this._getTileLocation(e,t,s);if(!f||0===f.length)return null;if(f.some(e=>e.from>e.to)){const e=new Uint8Array(n*a);return new h.A({width:n,height:a,pixels:void 0,mask:e,validPixelCount:0})}const{bandIds:d}=this.ioConfig,m=this._getBandSegmentCount(),g=[];let y=0;for(y=0;y<m;y++)d&&!d.includes(y)||g.push(this.request(this._files.data,{range:{from:f[y].from,to:f[y].to},responseType:"array-buffer",signal:i.signal}));const x=await Promise.all(g),w=x.map(e=>e.data.byteLength).reduce((e,t)=>e+t),I=new Uint8Array(w),v=[];let C=0;for(y=0;y<m;y++)v.push(C),I.set(new Uint8Array(x[y].data),C),C+=x[y].data.byteLength;const b=te.get(this.rasterInfo.storageInfo.compression).decoderFormat,T=await this.decodePixelBlock(I.buffer,{width:n,height:a,format:b,planes:d?.length||l,offsets:v,pixelType:c}).catch(()=>null);if(null==T)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==b&&!T.mask&&(S=S[0],null!=S)){const e=T.width*T.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(y=0;y<e;y++)Math.abs((T.pixels[0][y]-S)/S)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)T.pixels[0][y]!==S&&(t[y]=1);T.mask=t}let A=0,R=0;if(u!==n||p!==a){let e=T.mask;if(e)for(y=0;y<a;y++)if(R=y*n,y<p)for(A=u;A<n;A++)e[R+A]=0;else for(A=0;A<n;A++)e[R+A]=0;else for(e=new Uint8Array(n*a),T.mask=e,y=0;y<p;y++)for(R=y*n,A=0;A<u;A++)e[R+A]=1}return T}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,s=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:i,files:n}=this._parseHeader(s.data),{skipMapInfo:a,skipExtensions:r=[]}=this.ioConfig;if(!r.includes("aux.xml")&&!a){const t=await this._fetchAuxiliaryData(e);null!=t&&(i.statistics=t.statistics??i.statistics,i.histograms=t.histograms,t.histograms&&null==i.statistics&&(i.statistics=(0,T.Pg)(t.histograms)))}a&&this.updateImageSpaceRasterInfo(i),this._set("rasterInfo",i),this._files=n;const o=await this.request(n.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,s,i,n,a,r;if(Q.Z){for(s=new Uint8Array(e),n=new ArrayBuffer(e.byteLength),i=new Uint8Array(n),a=0;a<e.byteLength/4;a++)for(r=0;r<4;r++)i[4*a+r]=s[4*a+3-r];t=new Uint32Array(n)}else t=new Uint32Array(e);return t}(o.data);const{blockWidth:l,blockHeight:c}=this.rasterInfo.storageInfo,f=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:h}=this.rasterInfo,p=[],d=this._getBandSegmentCount();let m=0,g=-1;for(;m<this._storageIndex.length;){g++;const e=Math.ceil(u/l/f**g)-1,t=Math.ceil(h/c/f**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return te.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,s){const{blockWidth:i,blockHeight:n,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:r,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,f,u,h=0,p=0;for(u=0;u<e;u++)p=a**u,c=Math.ceil(r/i/p),f=Math.ceil(o/n/p),h+=c*f;p=a**e,c=Math.ceil(r/i/p),f=Math.ceil(o/n/p),h+=t*c+s,h*=4*l;const d=this._storageIndex.subarray(h,h+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:s<c-1?i:Math.ceil(r/p)-i*(c-1),actualTileHeight:t<f-1?n:Math.ceil(o/p)-n*(f-1)}}_parseHeader(e){const t=(0,B.V6)(e,"MRF_META/Raster");if(!t)throw new i.A("mrf:open","not a valid MRF format");const s=(0,B.V6)(t,"Size"),n=parseInt(s.getAttribute("x"),10),a=parseInt(s.getAttribute("y"),10),r=parseInt(s.getAttribute("c"),10),o=((0,B.mX)(t,"Compression")||"none").toLowerCase();if(!te.has(o))throw new i.A("mrf:open","currently does not support compression "+o);const f=(0,B.mX)(t,"DataType")||"UInt8",u=ee.get(f.toLowerCase());if(null==u)throw new i.A("mrf:open","currently does not support pixel type "+f);const h=(0,B.V6)(t,"PageSize"),p=parseInt(h.getAttribute("x"),10),d=parseInt(h.getAttribute("y"),10),m=(0,B.V6)(t,"DataValues");let g,y;if(m&&(y=m.getAttribute("NoData"),null!=y&&(g=y.trim().split(" ").map(e=>parseFloat(e)))),(0,B.V6)(e,"MRF_META/CachedSource"))throw new i.A("mrf:open","currently does not support MRF referencing other data files");const x=(0,B.V6)(e,"MRF_META/GeoTags"),w=(0,B.V6)(x,"BoundingBox");let I,v=!1;if(null!=w){const e=parseFloat(w.getAttribute("minx")),t=parseFloat(w.getAttribute("miny")),s=parseFloat(w.getAttribute("maxx")),i=parseFloat(w.getAttribute("maxy")),n=(0,B.mX)(x,"Projection")||"";let a=c.A.WGS84;if("LOCAL_CS[]"!==n)if(n.toLowerCase().startsWith("epsg:")){const e=Number(n.slice(5));isNaN(e)||0===e||(a=new c.A({wkid:e}))}else a=E(n)??c.A.WGS84;else v=!0,a=new c.A({wkid:3857});I=new l.A(e,t,s,i),I.spatialReference=a}else v=!0,I=new l.A({xmin:-.5,ymin:.5-a,xmax:n-.5,ymax:.5,spatialReference:new c.A({wkid:3857})});const C=(0,B.V6)(e,"MRF_META/Rsets"),b=parseInt(C?.getAttribute("scale")||"2",10),T=I.spatialReference,S=new W.A({origin:new q.A({x:I.xmin,y:I.ymax,spatialReference:T}),blockWidth:p,blockHeight:d,pyramidBlockWidth:p,pyramidBlockHeight:d,compression:o,pyramidScalingFactor:b}),R=new q.A({x:I.width/n,y:I.height/a,spatialReference:T}),M=new A.A({width:n,height:a,extent:I,isPseudoSpatialReference:v,spatialReference:T,bandCount:r,pixelType:u,pixelSize:R,noDataValue:g,storageInfo:S}),O=this._getAuxFullPath((0,B.mX)(t,"DataFile")),k=this._getAuxFullPath((0,B.mX)(t,"IndexFile"));return{rasterInfo:M,files:{mrf:this.url,index:k||this.url.replace(".mrf",".idx"),data:O||this.url.replace(".mrf",te.get(o).blobExtension)}}}_getAuxFullPath(e){return e?e.includes("\\")?null:e.includes("/")?e.startsWith(new URL(this.url).origin)?e:null:`${this.url.slice(0,this.url.lastIndexOf("/"))}/${e}`:null}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return z(t)}catch{return null}}};(0,n.Cg)([(0,a.MZ)()],se.prototype,"_files",void 0),(0,n.Cg)([(0,a.MZ)()],se.prototype,"_storageIndex",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),se=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.MRFRaster")],se);const ie=se;s(44208);var ne=s(53966),ae=s(9334);function re(e){const t=e.fields,s=e.records,i=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",n=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=n.map(e=>e.name),r=[];let o=0,l=0;return s.forEach(e=>{const t={};for(t[i]=o++,l=1;l<a.length;l++)t[a[l]]=e[l-1];r.push({attributes:t})}),{displayFieldName:"",fields:n,features:r}}class oe{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),s=3&t.getUint8(0);if(3!==s)return{header:{version:s},recordSet:null};const i=t.getUint32(4,!0),n=t.getUint16(8,!0),a=t.getUint16(10,!0),r={version:s,recordCount:i,headerByteCount:n,recordByteCount:a};let o=32;const l=[],c=[];let f;if(3===s){for(;13!==t.getUint8(o);)f=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,ae.w)(new Uint8Array(e,o,11)),type:f,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(f)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<i&&e.byteLength-o>a;){const s=[];32===t.getUint8(o)?(o+=1,l.forEach(t=>{if("C"===t.type)s.push((0,ae.w)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)s.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)s.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const i=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();s.push(new Date(parseInt(i.slice(0,4),10),parseInt(i.slice(4,6),10)-1,parseInt(i.slice(6,8),10)))}o+=t.length}),c.push(s)):o+=a}}return{header:r,fields:l,records:c,recordSet:re({fields:l,records:c})}}}var le=s(87877),ce=s(94213);const fe=(e,t)=>e.get(t)?.values,ue=(e,t)=>e.get(t)?.values?.[0];let he=class extends r.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,s,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,s))return null;const n=await this._fetchRawTiffTile(e,t,s,!1,i);if(null!=n&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,s,!0,i);null!=a&&a.pixels[0]instanceof Uint8Array&&(n.mask=a.pixels[0])}return n}async _open(e){const t=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!s)throw new i.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:n,firstIFDPos:a,isBigTiff:r}=(0,le.uT)(s),o=[],f={fileChunk:s,posIFD:a,fileOffset:0};await this._readIFDs(o,f,n,r?8:4,t);const{imageInfo:u,rasterInfo:h}=function(e){const t=(0,le.uc)(e),{width:s,height:i,tileWidth:n,tileHeight:a,planes:r,pixelType:o,compression:f,firstPyramidLevel:u,maximumPyramidLevel:h,pyramidBlockWidth:p,pyramidBlockHeight:d,pyramidResolutions:m,tileBoundary:g,affine:y,metadata:x}=t;let w=E(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),I=!!t.isPseudoGeographic;null==w&&(I=!0,w=new c.A({wkid:3857}));const v=new l.A({...t.extent,spatialReference:w}),C=new q.A(v?{x:v.xmin,y:v.ymax,spatialReference:w}:{x:0,y:0}),b=new W.A({blockWidth:n,blockHeight:a,pyramidBlockWidth:p,pyramidBlockHeight:d,compression:f,origin:C,firstPyramidLevel:u,maximumPyramidLevel:h,pyramidResolutions:m,blockBoundary:g}),T=new q.A({x:(v.xmax-v.xmin)/s,y:(v.ymax-v.ymin)/i,spatialReference:w}),S=x?{BandProperties:x.bandProperties,DataType:x.dataType}:{};let R=null;const M=ue(e[0],"PHOTOMETRICINTERPRETATION"),O=fe(e[0],"COLORMAP");if(M<=3&&O?.length>3&&O.length%3==0){R=[];const e=O.length/3;for(let t=0;t<e;t++)R.push([t,O[t]>>>8,O[t+e]>>>8,O[t+2*e]>>>8])}const k=new A.A({width:s,height:i,bandCount:r,pixelType:o,pixelSize:T,storageInfo:b,spatialReference:w,isPseudoSpatialReference:I,keyProperties:S,extent:v,colormap:R,statistics:x?x.statistics:null});if(y?.length&&(k.nativeExtent=new l.A({xmin:-.5,ymin:.5-i,xmax:s-.5,ymax:.5,spatialReference:w}),k.transform=new N.A({polynomialOrder:1,forwardCoefficients:[y[2]+y[0]/2,y[5]-y[3]/2,y[0],y[3],-y[1],-y[4]]}),k.extent=k.transform.forwardTransform(k.nativeExtent),k.pixelSize=new q.A({x:(v.xmax-v.xmin)/s,y:(v.ymax-v.ymin)/i,spatialReference:w}),b.origin.x=-.5,b.origin.y=.5),m){const{x:e,y:t}=k.pixelSize;m.forEach(s=>{s.x*=e,s.y*=t})}return{imageInfo:t,rasterInfo:k}}(o),p=(0,le.zS)(o),d=(0,le.r9)(o);if(this._headerInfo={littleEndian:n,isBigTiff:r,ifds:o,pyramidIFDs:p,maskIFDs:d,...u},this._set("rasterInfo",h),!u.isSupported)throw new i.A("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new i.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");h.isPseudoSpatialReference&&ne.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const m=o[0].get("PREDICTOR")?.values?.[0],g=o[0].get("SAMPLEFORMAT")?.values?.[0];if(3===g&&2===m)throw new i.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:y,skipExtensions:x=[]}=this.ioConfig;if(!x.includes("aux.xml")&&!y){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,T.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const s=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new q.A({x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=s}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,h)}x.includes("vat.dbf")||1!==h.bandCount||"u8"!==h.pixelType||y||(h.attributeTable=await this._fetchAuxiliaryTable(e),null!=h.attributeTable&&(h.keyProperties.DataType="thematic")),y&&this.updateImageSpaceRasterInfo(h),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:s,fileOffset:i,posIFD:n}=e;return(n+8>=s.byteLength||n<0)&&(i=n+i,s=(await this.request(this.url,{range:{from:i,to:i+this._bufferSize},responseType:"array-buffer",signal:t})).data,n=0),{fileChunk:s,fileOffset:i,posIFD:n}}async _readIFDs(e,t,s,n=4,a){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,a);const r=await this._readIFD(t,s,ce.NB,n,a);if(!r?.ifd)throw new i.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(r.ifd),!r.nextIFD)return null;t.posIFD=r.nextIFD-t.fileOffset,await this._readIFDs(e,t,s,n,a)}async _readIFD(e,t,s=ce.NB,i=4,n){let{fileChunk:a,posIFD:r,fileOffset:o}=e;if(!e.fileChunk)return null;const l=(0,le.JM)(a,t,r,o,s,i);if(l.success){const e=[];if(l.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,l.nextIFD,n),l.ifd?.has("GEOKEYDIRECTORY")){const e=l.ifd.get("GEOKEYDIRECTORY"),s=e?.values;if(s&&s.length>4){const i=s[0]+"."+s[1]+"."+s[2];r=e.valueOffset+6-o;const l=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:r,fileOffset:o},n),c=await this._readIFD(l,t,ce.YC,2,n);e.data=c?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[i]})}}return l}return l.requiredBufferSize?(a=(await this.request(this.url,{range:{from:o,to:o+r+l.requiredBufferSize+8},responseType:"array-buffer",signal:n})).data,a.byteLength<r+l.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,s,i,n))):null}async _fillOffsets(e,t,s,i){const n=e.filter(e=>null!=e.offlineOffsetSize);if(0===n.length)return;const a=n.map(e=>e.offlineOffsetSize),r=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let l=1===a.length||o-r<=this._bufferSize;if(!l&&a.length>1&&(a.sort((e,t)=>e[0]-t[0]),l=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o),l){const e=await this._fetchOffsets(r,Math.max(o,r+this._bufferSize),i);return void n.forEach(s=>(0,le.Cr)(e,t,s,r))}const c=n.map(async e=>{const s=e.offlineOffsetSize,n=await this._fetchOffsets(s[0],s[1]+s[0],i);(0,le.Cr)(n,t,e,s[0])});await Promise.all(c)}async _fetchOffsets(e,t,s){const i=[],n=this._chunkSize,a=Math.ceil((t-e)/n);let r=e;for(let e=0;e<a;e++)i.push(this.request(this.url,{range:{from:r,to:e===a-1?t:r+n-1},responseType:"array-buffer",signal:s})),r+=n;const o=await Promise.all(i);if(1===a)return o[0].data;const l=new Uint8Array(t-e+1);for(let e=0;e<a;e++)l.set(new Uint8Array(o[e].data),e*n);return l.buffer}async _fetchRawTiffTile(e,t,s,i,n={}){const a=this._getTileLocation(e,t,s,i);if(!a)return null;const{ranges:r,actualTileWidth:o,actualTileHeight:l,ifd:c}=a,f=r.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:n.signal})),u=await Promise.all(f),h=u.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===u.length?u[0].data:new ArrayBuffer(h),d=[0],m=[0];if(u.length>1){const e=new Uint8Array(p);for(let t=0,s=0;t<u.length;t++){const i=u[t].data;e.set(new Uint8Array(i),s),d[t]=s,s+=i.byteLength,m[t]=i.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==x)return null;if(o!==g||l!==y){let e=x.mask;if(e)for(let t=0;t<y;t++){const s=t*g;if(t<l)for(let t=o;t<g;t++)e[s+t]=0;else for(let t=0;t<g;t++)e[s+t]=0}else{e=new Uint8Array(g*y),x.mask=e;for(let t=0;t<l;t++){const s=t*g;for(let t=0;t<o;t++)e[s+t]=1}}}return x}_getTileLocation(e,t,s,i=!1){const{firstPyramidLevel:n,blockBoundary:a}=this.rasterInfo.storageInfo,r=0===e?0:e-(n-1),{_headerInfo:o}=this;if(!o)return null;const l=i?o.maskIFDs[r]:0===r?o?.ifds[0]:o?.pyramidIFDs[r-1];if(!l)return null;const c=(0,le.XO)(l,o),f=fe(l,"TILEOFFSETS");if(void 0===f)return null;const u=fe(l,"TILEBYTECOUNTS"),{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[r];if(t>d||s>m||t<h||s<p)return null;const g=ue(l,"IMAGEWIDTH"),y=ue(l,"IMAGELENGTH"),x=ue(l,"TILEWIDTH"),w=ue(l,"TILELENGTH"),I=[];if(c){const{bandCount:e}=this.rasterInfo;for(let i=0;i<e;i++){const e=i*(d+1)*(m+1)+t*(m+1)+s;I[i]={from:f[e],to:f[e]+u[e]-1}}}else{const e=t*(m+1)+s;I.push({from:f[e],to:f[e]+u[e]-1})}for(let e=0;e<I.length;e++)if(null==I[e].from||!I[e].to||I[e].to<0)return null;return{ranges:I,ifd:l,actualTileWidth:s===m&&g%x||x,actualTileHeight:t===d&&y%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return z(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),s=oe.parse(t);return s?.recordSet?O.A.fromJSON(s.recordSet):null}catch{return null}}};(0,n.Cg)([(0,a.MZ)()],he.prototype,"_files",void 0),(0,n.Cg)([(0,a.MZ)()],he.prototype,"_headerInfo",void 0),(0,n.Cg)([(0,a.MZ)()],he.prototype,"_bufferSize",void 0),(0,n.Cg)([(0,a.MZ)()],he.prototype,"_chunkSize",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],he.prototype,"datasetFormat",void 0),he=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.TIFFRaster")],he);const pe=he,de=new Map;de.set("MRF",{desc:"Meta Raster Format",constructor:ie}),de.set("TIFF",{desc:"GeoTIFF",constructor:pe}),de.set("RasterTileServer",{desc:"Raster Tile Server",constructor:K}),de.set("JPG",{desc:"JPG Raster Format",constructor:J}),de.set("PNG",{desc:"PNG Raster Format",constructor:J}),de.set("GIF",{desc:"GIF Raster Format",constructor:J}),de.set("BMP",{desc:"BMP Raster Format",constructor:J}),de.set("CovJSON",{desc:"COVJSON Raster Format",constructor:_}),de.set("MEMORY",{desc:"In Memory Raster Format",constructor:M});class me{static get supportedFormats(){const e=new Set;return de.forEach((t,s)=>e.add(s)),e}static async open(e){const{url:t,ioConfig:s,source:n,sourceJSON:a}=e;let r=e.datasetFormat??s?.datasetFormat;null==r&&(t.includes(".")?r=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===n?.type?.toLowerCase()?r="CovJSON":n?.extent&&n.pixelblocks&&(r="MEMORY")),"OVR"===r||"TIF"===r?r="TIFF":"JPG"===r||"JPEG"===r||"JFIF"===r?r="JPG":"COVJSON"===r&&(r="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const o={url:t,source:n,sourceJSON:a,datasetFormat:r,ioConfig:s??{bandIds:null,sampling:null}};if(Object.keys(o).forEach(e=>{null==o[e]&&delete o[e]}),r){if(!this.supportedFormats.has(r))throw new i.A("rasterfactory:open","not a supported format "+r);if("CRF"===r)throw new i.A("rasterfactory:open",`cannot open raster: ${t}`);const s=new(0,de.get(r).constructor)(o);return await s.open({signal:e.signal}),s}const l=Array.from(de.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e);let c=0;const f=()=>{if(r=l[c++],!r)return null;if("CRF"===r)return null;const t=new(0,de.get(r).constructor)(o);return t.open({signal:e.signal}).then(()=>t).catch(()=>f())};return f()}static register(e,t,s){de.has(e.toUpperCase())||de.set(e.toUpperCase(),{desc:t,constructor:s})}}},10333(e,t,s){s.d(t,{A:()=>r});var i=s(5482),n=s(25482),a=s(91429);let r=class extends n.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,i.Cg)([(0,a.MZ)()],r.prototype,"affectsPixelSize",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],r.prototype,"spatialReference",void 0),r=(0,i.Cg)([(0,a.$K)("esri.layers.raster.transforms.BaseRasterTransform")],r)},75414(e,t,s){s.d(t,{A:()=>l});var i,n=s(5482),a=s(91429),r=s(10333),o=s(93223);let l=i=class extends r.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new i({tolerance:this.tolerance})}};(0,n.Cg)([(0,o.e)({GCSShiftXform:"gcs-shift"})],l.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)()],l.prototype,"tolerance",void 0),l=i=(0,n.Cg)([(0,a.$K)("esri.layers.raster.transforms.GCSShiftTransform")],l)},43163(e,t,s){s.d(t,{A:()=>d});var i,n=s(5482),a=s(91429),r=s(5443),o=s(86738),l=s(10333),c=s(36005),f=s(43937),u=s(93223);function h(e,t,s){const{x:i,y:n}=t;if(s<2)return{x:e[0]+i*e[2]+n*e[4],y:e[1]+i*e[3]+n*e[5]};if(2===s){const t=i*i,s=n*n,a=i*n;return{x:e[0]+i*e[2]+n*e[4]+t*e[6]+a*e[8]+s*e[10],y:e[1]+i*e[3]+n*e[5]+t*e[7]+a*e[9]+s*e[11]}}const a=i*i,r=n*n,o=i*n,l=a*i,c=a*n,f=i*r,u=n*r;return{x:e[0]+i*e[2]+n*e[4]+a*e[6]+o*e[8]+r*e[10]+l*e[12]+c*e[14]+f*e[16]+u*e[18],y:e[1]+i*e[3]+n*e[5]+a*e[7]+o*e[9]+r*e[11]+l*e[13]+c*e[15]+f*e[17]+u*e[19]}}function p(e,t,s){const{xmin:i,ymin:n,xmax:a,ymax:o,spatialReference:l}=t;let c=[];if(s<2)c.push({x:i,y:o}),c.push({x:a,y:o}),c.push({x:i,y:n}),c.push({x:a,y:n});else{let e=10;for(let t=0;t<e;t++)c.push({x:i,y:n+(o-n)*t/(e-1)}),c.push({x:a,y:n+(o-n)*t/(e-1)});e=8;for(let t=1;t<=e;t++)c.push({x:i+(a-i)*t/e,y:n}),c.push({x:i+(a-i)*t/e,y:o})}c=c.map(t=>h(e,t,s));const f=c.map(e=>e.x),u=c.map(e=>e.y);return new r.A({xmin:Math.min.apply(null,f),xmax:Math.max.apply(null,f),ymin:Math.min.apply(null,u),ymax:Math.max.apply(null,u),spatialReference:l})}let d=i=class extends l.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){const{coeffX:s,coeffY:i}=t;if(!s?.length||!i?.length||s.length!==i.length)return null;const n=[];for(let e=0;e<s.length;e++)n.push(s[e]),n.push(i[e]);return n}writeForwardCoefficients(e,t,s){const i=[],n=[];for(let t=0;t<e?.length;t++)t%2==0?i.push(e[t]):n.push(e[t]);t.coeffX=i,t.coeffY=n}get inverseCoefficients(){let e=this._get("inverseCoefficients");const t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){const[t,s,i,n,a,r]=e,o=i*r-a*n,l=a*n-i*r;return[(a*s-t*r)/o,(i*s-t*n)/l,r/o,n/l,-a/o,-i/l]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){const{inverseCoeffX:s,inverseCoeffY:i}=t;if(!s?.length||!i?.length||s.length!==i.length)return null;const n=[];for(let e=0;e<s.length;e++)n.push(s[e]),n.push(i[e]);return n}writeInverseCoefficients(e,t,s){const i=[],n=[];for(let t=0;t<e?.length;t++)t%2==0?i.push(e[t]):n.push(e[t]);t.inverseCoeffX=i,t.inverseCoeffY=n}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const t=h(this.forwardCoefficients,e,this.polynomialOrder);return new o.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const t=h(this.inverseCoefficients,e,this.polynomialOrder);return new o.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new i({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,n.Cg)([(0,a.MZ)()],d.prototype,"forwardCoefficients",void 0),(0,n.Cg)([(0,c.w)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,n.Cg)([(0,f.K)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,n.Cg)([(0,c.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,n.Cg)([(0,f.K)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,n.Cg)([(0,a.MZ)()],d.prototype,"affectsPixelSize",null),(0,n.Cg)([(0,u.e)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=i=(0,n.Cg)([(0,a.$K)("esri.layers.raster.transforms.PolynomialTransform")],d)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6650],{69052(e,t,i){i.d(t,{hr:()=>s,ie:()=>a,uC:()=>l});var n=i(34727);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,i=!1){return r(this.range,this.min,this.max,e,t,i)}clamp(e,t=0){return(0,n.qE)(e-t,this.min,this.max)+t}monotonic(e,t,i){return e<t?t:t+o(this.range,e-t,i)}minimalMonotonic(e,t,i){return r(this.range,e,e+this.range,t,i)}center(e,t,i){return t=this.monotonic(e,t,i),this.normalize((e+t)/2,i)}diff(e,t,i){return this.monotonic(e,t,i)-e}shortestSignedDiff(e,t){e=this.normalize(e);const i=(t=this.normalize(t))-e,n=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(i)<Math.abs(n)?i:n}contains(e,t,i){return t=this.minimalMonotonic(e,t),(i=this.minimalMonotonic(e,i))>e&&i<t}}function r(e,t,i,n,s=0,r=!1){return(n-=s)<t?n+=o(e,t-n):n>i&&(n-=o(e,n-i)),r&&n===i&&(n=t),n+s}function o(e,t,i=0){return Math.ceil((t-i)/e)*e+i}const l=new s(0,2*Math.PI),a=(new s(-Math.PI,Math.PI),new s(0,360))},96650(e,t,i){i.r(t),i.d(t,{default:()=>j});var n=i(5482),s=i(91715),r=i(69540),o=i(69052),l=i(25482),a=i(97768),u=i(91429),h=i(56507),d=i(87024),p=i(86738),c=i(88625);let w=class extends((0,l.T)(r.Pw)){constructor(e){super(e),this.observer=null,this.farDistance=1e3,this.heading=0,this.tilt=90,this.horizontalFieldOfView=45,this.verticalFieldOfView=45,this.elevationInfo=null,this.feature=null}get valid(){return null!=this.observer&&this.farDistance>0}equals(e){return(0,a.CM)(this.observer,e.observer)&&this.farDistance===e.farDistance&&this.heading===e.heading&&this.tilt===e.tilt&&this.horizontalFieldOfView===e.horizontalFieldOfView&&this.verticalFieldOfView===e.verticalFieldOfView&&(0,a.CM)(this.elevationInfo,e.elevationInfo)&&(0,s.xH)(this.feature,e.feature)}};(0,n.Cg)([(0,u.MZ)({type:p.A,json:{write:{isRequired:!0}}})],w.prototype,"observer",void 0),(0,n.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],w.prototype,"farDistance",void 0),(0,n.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,u.wg)(e=>o.ie.normalize((0,h.GB)(e),void 0,!0))],w.prototype,"heading",void 0),(0,n.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],w.prototype,"tilt",void 0),(0,n.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}})],w.prototype,"horizontalFieldOfView",void 0),(0,n.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],w.prototype,"verticalFieldOfView",void 0),(0,n.Cg)([(0,u.MZ)({type:c.A}),(0,d.P)()],w.prototype,"elevationInfo",void 0),(0,n.Cg)([(0,u.MZ)(s.N1)],w.prototype,"feature",void 0),(0,n.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1}})],w.prototype,"valid",null),w=(0,n.Cg)([(0,u.$K)("esri.analysis.Viewshed")],w);var v=i(79608),y=i(4576),g=i(7762),m=i(62885),f=i(34727),M=i(36708),x=i(5443),C=i(91218),b=i(24212);const Z=g.A.ofType(w);let O=class extends v.A{constructor(e){super(e),this.type="viewshed",this._extent=null}initialize(){this.addHandles((0,M.wB)(()=>this._computeExtent(),e=>{null==e.pending&&(this._extent=e.extent)},M.pc))}get viewsheds(){return this._get("viewsheds")||new Z}set viewsheds(e){this._set("viewsheds",(0,m.V)(e,this.viewsheds,Z))}get spatialReference(){for(const e of this.viewsheds)if(null!=e.observer)return e.observer.spatialReference;return null}get extent(){return this._extent}get valid(){return this.viewsheds.every(e=>e.valid)}async waitComputeExtent(){const e=this._computeExtent();null!=e.pending&&await e.pending}_computeExtent(){const{spatialReference:e}=this;if(null==e)return{pending:null,extent:null};const t=this.viewsheds.filter(e=>null!=e.observer),i=t.map(e=>e.observer).toArray(),n=(0,C.projectOrLoadMany)(i,e);if(null!=n.pending)return{pending:n.pending,extent:null};const s=n.geometries.map((e,i)=>{const n=t.at(i);return null!=e&&null!=n?this._computeViewshedExtent(this.viewsheds.at(i),e):null}).filter(e=>null!=e).reduce((e,t)=>function(e,t){return null==e?t:null==t?e:e.union(t)}(e,t),null);return null!=s&&t.some(e=>!function(e){return"absolute-height"===(0,b.w7)(e.observer,e.elevationInfo)}(e))&&(s.zmin=void 0,s.zmax=void 0),{pending:null,extent:s}}_computeViewshedExtent(e,t){const{farDistance:i,heading:n,tilt:s,horizontalFieldOfView:r,verticalFieldOfView:l}=e,{spatialReference:a}=t,u=r/2,h=l/2,d=i/a.metersPerUnit,p=[o.ie.normalize(n-u),n,o.ie.normalize(n+u)],c=x.A.fromPoint(t),w=e=>{const t=p.map(t=>o.ie.normalize(t-e));if(t[0]>t[2]||360===r)return d;const i=t.map(e=>Math.abs(e>180?360-e:e)).reduce((e,t)=>e>t?t:e);return i>90?0:d*Math.cos((0,f.kU)(i))};c.xmax+=w(90),c.xmin-=w(-90),c.ymax+=w(0),c.ymin-=w(180);const v=t.z;if(null!=v){let e=v,t=v;const n=s-90,r=(0,f.qE)(n+h,-90,90),o=(0,f.qE)(n-h,-90,90),l=a?.isGeographic?i:d;e+=l*V(r),t+=l*V(o);const p=z(h)*l,w=V(n)*p*(1-z(u));s<90&&(e-=w),s>90&&(t-=w),c.zmax=Math.max(e,v),c.zmin=Math.min(t,v)}return c}equals(e){return this===e||super.equals(e)&&(0,y.aI)(this.viewsheds.toArray(),e.viewsheds.toArray(),(e,t)=>e.equals(t))}clear(){this.viewsheds.removeAll()}};function z(e){return Math.cos((0,f.kU)(e))}function V(e){return Math.sin((0,f.kU)(e))}(0,n.Cg)([(0,u.MZ)({type:["viewshed"]})],O.prototype,"type",void 0),(0,n.Cg)([(0,u.MZ)({cast:m.H,type:Z,nonNullable:!0})],O.prototype,"viewsheds",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],O.prototype,"spatialReference",null),(0,n.Cg)([(0,u.MZ)()],O.prototype,"_extent",void 0),(0,n.Cg)([(0,u.MZ)()],O.prototype,"extent",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],O.prototype,"valid",null),O=(0,n.Cg)([(0,u.$K)("esri.analysis.ViewshedAnalysis")],O);var R=i(25728),q=i(4146),N=i(34287),A=i(43937);let E=class extends((0,N.q)((0,R.M)(q.A))){constructor(e){super(e),this.type="viewshed",this.operationalLayerType="ViewshedLayer",this.source=new O,this.opacity=1}initialize(){this.addHandles((0,M.wB)(()=>this.source,(e,t)=>{null!=t&&t.parent===this&&(t.parent=null),null!=e&&(e.parent=this)},M.pc))}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new O)}get analysis(){return this.source}set analysis(e){this.source=e}get viewsheds(){return this.source.viewsheds}set viewsheds(e){this.source.viewsheds=e}writeViewsheds(e,t,i,n){t.viewsheds=e.filter(e=>e.valid).toJSON(n)}};(0,n.Cg)([(0,u.MZ)({json:{read:!1},readOnly:!0})],E.prototype,"type",void 0),(0,n.Cg)([(0,u.MZ)({type:["ViewshedLayer"]})],E.prototype,"operationalLayerType",void 0),(0,n.Cg)([(0,u.MZ)({type:O,nonNullable:!0})],E.prototype,"source",void 0),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],E.prototype,"spatialReference",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],E.prototype,"fullExtent",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],E.prototype,"opacity",void 0),(0,n.Cg)([(0,u.MZ)({type:["show","hide"]})],E.prototype,"listMode",void 0),(0,n.Cg)([(0,u.MZ)({type:g.A.ofType(w),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],E.prototype,"viewsheds",null),(0,n.Cg)([(0,A.K)("web-scene","viewsheds")],E.prototype,"writeViewsheds",null),E=(0,n.Cg)([(0,u.$K)("esri.layers.ViewshedLayer")],E);const j=E}}]);
|
|
@@ -246,7 +246,7 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
|
246
246
|
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
247
247
|
}`),t.vertex.code.add(o.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
248
248
|
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
249
|
-
}`)}function c(t){t.uniforms.add(new s.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new s.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,n.vt)()},77949(t,e,i){i.d(e,{NB:()=>p,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,s.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function p(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(f,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,s.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(f,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const f=(0,n.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,n)=>r.setUniform2fv(t,e(n),i))}}},68259(t,e,i){i.d(e,{t:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,n,s,o)=>r.setUniform2fv(t,e(n,s,o),i))}}},47286(t,e,i){i.d(e,{G:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,n,s)=>r.setUniform2fv(t,e(n,s),i))}}},23205(t,e,i){i.d(e,{d:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,n)=>r.setUniform3fv(t,e(n),i))}}},14314(t,e,i){i.d(e,{I:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,n)=>r.setUniform4fv(t,e(n),i))}}},71988(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,n,s)=>r.setUniform4fv(t,e(n,s),i))}}},33094(t,e,i){i.d(e,{U:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"float",0,(r,n)=>r.setUniform1f(t,e(n),i))}}},44887(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,n,s)=>e.setUniform1fv(t,i(n,s),r),e)}}},35818(t,e,i){i.d(e,{W:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",1,(i,r,n)=>i.setUniform1i(t,e(r,n)))}}},35644(t,e,i){i.d(e,{k:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,n,s)=>r.setUniformMatrix3fv(t,e(n,s),i))}}},58029(t,e,i){i.d(e,{F:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,n)=>r.setUniformMatrix4fv(t,e(n),i))}}},97102(t,e,i){i.d(e,{S:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,n,s)=>r.setUniformMatrix4fv(t,e(n,s),i))}}},12791(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>f});var r=i(5482),n=i(69622),s=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||s.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const n=r.unit;this.setUniform1i(t,n),this._context.bindTexture(e,n,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),p=i(85079);let f=class extends n.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,p.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void s.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};f=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},51976(t,e,i){i.d(e,{K:()=>a,W:()=>c});var r=i(49186),n=i(4576);class s{constructor(t){this._bits=[...t]}equals(t){return(0,n.aI)(this._bits,t.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var o=i(65786);class a extends o.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new s(this._parameterBits),this._key}decode(t=this.key){const e=this._parameterBits;this._parameterBits=[...t.bits];const i=this._parameterNames.map(t=>` ${t}: ${this[t]}`).join("\n");return this._parameterBits=e,i}}function c(t={}){return(e,i)=>{e.hasOwnProperty("_parameterNames")||Object.defineProperty(e,"_parameterNames",{value:e._parameterNames?.slice()??[],configurable:!0,writable:!0}),e.hasOwnProperty("_parameterBits")||Object.defineProperty(e,"_parameterBits",{value:e._parameterBits?.slice()??[0],configurable:!0,writable:!0}),e._parameterNames.push(i);const n=t.count||2,s=Math.ceil(Math.log2(n)),o=e._parameterBits;let a=0;for(;o[a]+s>16;)a++,a>=o.length&&o.push(0);const c=o[a],h=(1<<s)-1<<c;o[a]+=s,t.count?Object.defineProperty(e,i,{get(){return(this._parameterBits[a]&h)>>c},set(e){const n=this._parameterBits[a];if((n&h)>>c!==e){if(this._key=null,this._parameterBits[a]=n&~h|+e<<c&h,"number"!=typeof e)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must be a number, got ${typeof e}`);if(null==t.count)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must provide a count option`)}}}):Object.defineProperty(e,i,{get(){return!!((this._parameterBits[a]&h)>>c)},set(t){const e=this._parameterBits[a];if(!!((e&h)>>c)!==t&&(this._key=null,this._parameterBits[a]=e&~h|+t<<c,"boolean"!=typeof t))throw new r.A("internal:invalid-shader-configurationx",`Configuration value for ${i} must be boolean, got ${typeof t}`)}})}}},16943(t,e,i){i.d(e,{E:()=>n});var r=i(44208);function n(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){i.d(e,{lK:()=>a,wR:()=>o});var r=i(63907),n=i(85079),s=i(74038);const o=[],a=(new s._("position",3,r.pe.FLOAT,0,12),[new s._("position",2,r.pe.FLOAT,0,8)]);(0,n.Xk)(a),new s._("position",2,r.pe.FLOAT,0,12),new s._("uv0",2,r.pe.HALF_FLOAT,8,12),new s._("position",2,r.pe.FLOAT,0,16),new s._("uv0",2,r.pe.FLOAT,8,16)},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},63500(t,e,i){i.d(e,{V:()=>E});var r=i(9093),n=i(35522),s=i(97146),o=i(46610),a=i(34275),c=i(20498);function h(t){if(t.length<a.y9)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,a.LW)(t)?(0,c.pX)().from(t):(0,a.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return Float32Array.from(t);default:return Float64Array.from(t)}}var l=i(15142),u=i(51850),d=i(620);class p{get center(){return(0,u.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,u.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,u.fA)(this._data[7],this._data[8],this._data[9])}constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=i,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,d.vA)(t.length>=1),(0,d.vA)(3===i.size||4===i.size);const{data:r,size:s,indices:o}=i;(0,d.vA)(o.length%this._numIndexPerPrimitive===0),(0,d.vA)(o.length>=t.length*this._numIndexPerPrimitive);const a=t.length;let c=s*o[this._numIndexPerPrimitive*t[0]];f.clear(),f.push(c);const h=(0,u.fA)(r[c],r[c+1],r[c+2]),l=(0,u.o8)(h);for(let e=0;e<a;++e){const i=this._numIndexPerPrimitive*t[e];for(let t=0;t<this._numIndexPerPrimitive;++t){c=s*o[i+t],f.push(c);let e=r[c];h[0]=Math.min(e,h[0]),l[0]=Math.max(e,l[0]),e=r[c+1],h[1]=Math.min(e,h[1]),l[1]=Math.max(e,l[1]),e=r[c+2],h[2]=Math.min(e,h[2]),l[2]=Math.max(e,l[2])}}for(let t=0;t<3;++t)this._data[4+t]=h[t],this._data[7+t]=l[t];const p=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-h[0],l[1]-h[1]),l[2]-h[2]),g=m*m;for(let t=0;t<f.length;++t){c=f.at(t);const e=r[c]-p[0],i=r[c+1]-p[1],n=r[c+2]-p[2],s=e*e+i*i+n*n;if(s<=g)continue;const o=Math.sqrt(s),a=.5*(o-m);m+=a,g=m*m;const h=a/o;p[0]+=e*h,p[1]+=i*h,p[2]+=n*h}this._data[3]=m;for(let t=0;t<3;++t)this._data[0+t]=p[t];f.clear()}getChildren(){if(this._children||(0,n.hG)(this.bbMin,this.bbMax)<=1)return this._children;const t=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5),e=this.primitiveIndices.length,i=new Uint8Array(e),r=new Array(8);for(let t=0;t<8;++t)r[t]=0;const{data:s,size:o,indices:a}=this.position;for(let n=0;n<e;++n){let e=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[n];let h=o*a[c],l=s[h],u=s[h+1],d=s[h+2];for(let t=1;t<this._numIndexPerPrimitive;++t){h=o*a[c+t];const e=s[h],i=s[h+1],r=s[h+2];e<l&&(l=e),i<u&&(u=i),r<d&&(d=r)}l<t[0]&&(e|=1),u<t[1]&&(e|=2),d<t[2]&&(e|=4),i[n]=e,++r[e]}let c=0;for(let t=0;t<8;++t)r[t]>0&&++c;if(c<2)return;const h=new Array(8);for(let t=0;t<8;++t)h[t]=r[t]>0?new Uint32Array(r[t]):void 0;for(let t=0;t<8;++t)r[t]=0;for(let t=0;t<e;++t){const e=i[t];h[e][r[e]++]=this.primitiveIndices[t]}this._children=new Array;for(let t=0;t<8;++t)void 0!==h[t]&&this._children.push(new p(h[t],this._numIndexPerPrimitive,this.position));return this._children}static prune(){f.prune()}}const f=new l.A({deallocator:null});var m=i(24326);class g{constructor(t){this.id=(0,m.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,s.Dg)(i.indices)})}get attributes(){return this._attributes}}var _=i(4341),v=i(11964);function y(t,e,i){return(0,n.Re)(x,e,t),(0,n.Re)(b,i,t),.5*(0,n.Bw)((0,n.$A)(x,x,b))}i(32114),new _.I(v.vt),new _.I(()=>{return t?{p0:(0,u.o8)(t.p0),p1:(0,u.o8)(t.p1),p2:(0,u.o8)(t.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var t});const x=(0,u.vt)(),b=(0,u.vt)(),w=(0,u.vt)(),T=(0,u.vt)(),A=(0,u.vt)(),M=(0,u.vt)();var C=i(17478),S=i(94656);class E extends g{constructor(t,e,i=null,r=0,n=null,s=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=n,this.edgeIndicesLength=s,this.baseGeometry=o,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,d.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const c=this.positionAttribute;null!=c&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=c.indices.length)}instantiate(t={}){const e=new E(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:h(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const i=this._attributes.get(t);i?this._attributes.set(t,{...i,exclusive:!0,data:e}):(0,S.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);this._vertexPositionIndicesCache=i}else this._vertexPositionIndicesCache=e?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!(0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&(0,n.Z0)(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0),(0,n.hZ)(M,0,0,0);let o=0,a=0;for(let e=0;e<i.length-2;e+=3){const c=i[e]*r,h=i[e+1]*r,l=i[e+2]*r;(0,n.hZ)(w,s[c],s[c+1],s[c+2]),(0,n.hZ)(T,s[h],s[h+1],s[h+2]),(0,n.hZ)(A,s[l],s[l+1],s[l+2]);const u=y(w,T,A);u?((0,n.WQ)(w,w,T),(0,n.WQ)(w,w,A),(0,n.hs)(w,w,1/3*u),(0,n.WQ)(t,t,w),o+=u):((0,n.WQ)(M,M,w),(0,n.WQ)(M,M,T),(0,n.WQ)(M,M,A),a+=3)}return!(0===a&&0===o||(0!==o?((0,n.hs)(t,t,1/o),0):0===a||((0,n.hs)(t,M,1/a),0)))}(t,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(t){const e=this.positionAttribute,i=this.primitivePositionIndices;return function(t,e,i,r=e?.indices){if(!e||!r)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(M,0,0,0);let s=0,o=0;const{size:a,data:c}=e,h=r.length-1,l=h+(i?2:0);for(let e=0;e<l;e+=2){const i=e<h?e+1:0,l=r[e<h?e:h]*a,u=r[i]*a;w[0]=c[l],w[1]=c[l+1],w[2]=c[l+2],T[0]=c[u],T[1]=c[u+1],T[2]=c[u+2],(0,n.hs)(w,(0,n.WQ)(w,w,T),.5);const d=(0,n.xg)(w,T);d>0?((0,n.WQ)(t,t,(0,n.hs)(w,w,d)),s+=d):0===s&&((0,n.WQ)(M,M,w),o++)}return 0!==s?((0,n.hs)(t,t,1/s),!0):0!==o&&((0,n.hs)(t,M,1/o),!0)}(t,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}(this.material.parameters,e),i)}_computeAttachmentOriginPoints(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0);let o=-1,a=0;for(let e=0;e<i.length;e++){const n=i[e]*r;o!==n&&(t[0]+=s[n],t[1]+=s[n+1],t[2]+=s[n+2],a++),o=n}return a>1&&(0,n.hs)(t,t,1/a),a>0}(t,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.primitivePositionIndices;if(!t||!e||0===e.length)return null;const i=e===t.indices?t:new o.n(t.data,e,t.size,!1,t.stride),r=0===this.type?3:1;(0,d.vA)(e.length%r===0,"Indexing error: "+e.length+" not divisible by "+r);const n=(0,s.tM)(e.length/r);return new p(n,r,i)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||R}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new C.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const R=new Set},49718(t,e,i){i(51850),i(6867).i},6867(t,e,i){i.d(e,{i:()=>l});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,s.hs)(d,this.ray.direction,this.distance),(0,s.Bw)(d))}withinDistance(t){return!!u(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!u(this)&&((0,s.hs)(d,this.ray.direction,this.distance),(0,s.WQ)(t,this.ray.origin,d),!0)}getTransformedNormal(t){return(0,s.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,s.C)(t,p),(0,s.S8)(t,t)}constructor(t){this.intersector=4,this.normal=(0,o.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this.intersector=t,this.distance=i,(0,s.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??n.zK),this.target=e,this.drapedLayerOrder=h,this.renderPriority=l}copy(t){(0,h.C)(t.ray,this._ray),this.intersector=t.intersector,this.distance=t.distance,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.renderPriority=t.renderPriority,(0,s.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function u(t){return null!=t?.distance}const d=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>U});var r=i(49186),n=i(65529),s=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),p=i(2741);let f;var m=i(63907),g=i(21231),_=i(42293);let v=null,y=null;async function x(){return null==y&&(f??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),y=f,v=await y),y}function b(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=A(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=M(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,n){const s=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function A(t){return t.getNumImages()>=1&&!t.isUASTC()}function M(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function C(t,e,i,r,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(o(t,l))),a(t,l,p[t]);return e.internalFormat=u,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=n,e.height=s,new g.A(t,e,{type:"compressed",levels:p})}var S=i(53966);const E=()=>S.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),O=R("DXT3"),D=R("DXT5");function F(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let n,s;switch(r){case I:n=8,s=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case D:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let p=t.byteOffset+i[1]+4;const f=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*n,u=new Uint8Array(t.buffer,p,d),f.push(u),p+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:s,width:h,height:l}}var P=i(78988),N=i(620),B=i(67171),L=i(12541);class U{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new n.bk,this._parameters={...z,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new B.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e.isImmutable=!0===this._parameters.immutable&&function(t){return null!=t&&((0,L.tl)(t)||(0,L.tr)(t)||(0,L.CR)(t)||(0,L.QJ)(t))}(this._parameters.internalFormat),e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?b(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,n=e.pixelFormat??6408,s=(0,_.wH)(n);return(e.mipmap?4/3:1)*i*r*s||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=F(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=r;return e.samplingMode=n.levels.length>1?9987:9729,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new g.A(t,e,n)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.KTX2File(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const n=C(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.BasisFile(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const n=C(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((n,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,s.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,P.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const n=this._createDescriptor(t);return n.width=r.width,n.height=r.height,n.compress=this._parameters.compressionOptions,this._texture=new g.A(t,n,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const z={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),n=i(49255),s=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,s.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,s.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,n._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value,this._configuration.emissionDimmingPass=t.transparentWithoutDepthEmissionDimmingPass&&(0,n._o)(t.output)}}o.Y},17478(t,e,i){i.d(e,{h:()=>s,p:()=>o});var r=i(24326);class n{constructor(){this.uid=(0,r.c)()}}class s extends n{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends n{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>o,mt:()=>c,z5:()=>a});var r=i(49255),n=i(90644);const s=(0,n.p3)(1,0,1,771);function o(t,e=!1,i=!1){if(i)return n.uR;switch(t){case 0:return e?n.RC:n.T8;case 1:return s;default:return null}}function a(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?n.Uy:null;case 1:return null}}function c(t,e=513){return{func:(0,r.Sp)(t)?515:e}}},56133(t,e,i){i.d(e,{Ax:()=>h,Q0:()=>u,cP:()=>c,iB:()=>l,m:()=>n,r8:()=>a,sf:()=>s,v0:()=>o});var r=i(90644);const n={func:513},s={func:519},o={mask:255},a={mask:0},c=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),h=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681}),l=(0,r.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),u=(0,r.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680})},77194(t,e,i){i.d(e,{PS:()=>n}),i(44208);var r=i(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:n}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),n,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>n,vM:()=>s});var r=i(49186);function n(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function s(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const s=Math.max(t,e),o=t*e;if(s<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/s);return[n(Math.round(t*a),r),n(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const n=document.createElement("canvas");return n.width=e,n.height=i,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),n=i(51850),s=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,n.vt)(),this._tmpSphere=new s.iy}applyToVertex(t,e,i){const n=this.objectTransform.transform,s=(0,r.hZ)(h,t,e,i),o=(0,r.Z0)(s,s,n),a=this.offset/(0,r.Bw)(o);(0,r.Ln)(o,o,o,a);const c=this.objectTransform.inverse;return(0,r.Z0)(this.tmpVertex,o,c),this.tmpVertex}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const n=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,n)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),n=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,n),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=new s.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i){const n=(0,r.hZ)(h,t,e,i),s=(0,r.hZ)(l,t,e,i+this.componentLocalOriginLength),o=this._totalOffset/(0,r.Bw)(s);return(0,r.Ln)(this._tmpVertex,n,s,o),this._tmpVertex}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],n=t[2]+e,s=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(n),u=Math.abs(s),d=Math.abs(o),p=Math.abs(a),f=.5*(1+Math.sign(i*s))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(n*a))*Math.min(l,p),_=Math.sqrt(f*f+m*m+g*g),v=Math.sign(c+i),y=Math.sign(h+r),x=Math.sign(l+n),b=Math.sign(u+s),w=Math.sign(d+o),T=Math.sign(p+a),A=this._totalOffset;if(_<A)return t[0]-=(1-v)*A,t[1]-=(1-y)*A,t[2]-=(1-x)*A,t[3]+=b*A,t[4]+=w*A,t[5]+=T*A,t;const M=Math.max(c,u),C=Math.max(h,d),S=Math.max(l,p),E=A/Math.sqrt(M*M+C*C+S*S),R=A/_,I=R-E,O=-I;return t[0]+=i*(v*O+R),t[1]+=r*(y*O+R),t[2]+=n*(x*O+R),t[3]+=s*(b*I+E),t[4]+=o*(w*I+E),t[5]+=a*(T*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),n=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,n),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,n.vt)()}applyToVertex(t,e,i){const n=(0,r.hZ)(h,t,e,i),s=(0,r.WQ)(l,n,this.localOrigin),o=this.offset/(0,r.Bw)(s);return(0,r.Ln)(this.tmpVertex,n,s,o),this.tmpVertex}applyToAabb(t){const e=u,i=d,r=p;for(let n=0;n<3;++n)e[n]=t[0+n]+this.localOrigin[n],i[n]=t[3+n]+this.localOrigin[n],r[n]=e[n];const n=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=n[e],t[e+3]=n[e];const s=e=>{const i=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let n=0;n<3;++n)r[n]=t&1<<n?i[n]:e[n];s(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let n=0;n<3;++n)r[n]=o&1<<n?0:t&1<<n?e[n]:i[n];s(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,n.vt)(),l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),p=(0,n.vt)()},75497(t,e,i){i.d(e,{$p:()=>s,Qx:()=>o,e_:()=>a});var r=i(51850),n=i(37957);class s{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}}class a{constructor(){this.r=n.P.create(),this.g=n.P.create(),this.b=n.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{TA:()=>x,uH:()=>y});var r=i(34727),n=i(35522),s=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,n.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],n=t[2],s=e||h.P.create();s[0]=l,s[1]=.4886025119*i,s[2]=.4886025119*n,s[3]=.4886025119*r,s[4]=1.09254843059*i*r,s[5]=1.09254843059*r*n,s[6]=.31539156525*(3*n*n-1),s[7]=1.09254843059*i*n,s[8]=.54627421529*(i*i-r*r)}(m,p),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(p,g),a(p,t.intensity[0],f),c(e.r,f),a(p,t.intensity[1],f),c(e.g,f),a(p,t.intensity[2],f),c(e.b,f)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const p=h.P.create(),f=h.P.create(),m=(0,s.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,s.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,s.vt)(),this.ambient=new _,this.diffuse=new _}}const y=.4;class x{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,s.vt)(),(0,s.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,n.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,n.C)(e.direction,t[0].direction),(0,n.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,n.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,n.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,n.C)(b,this._legacy.diffuse.color),(0,n.hs)(b,b,y*this.globalFactor),(0,n.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,b)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,n.C)(this._mainLight.direction,t.mainLight.direction),(0,n.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,n.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,n.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let n=0;n<e.sh.r.length;n++)this._sphericalHarmonics.r[n]=(0,r.Cc)(t.sh.r[n],e.sh.r[n],i),this._sphericalHarmonics.g[n]=(0,r.Cc)(t.sh.g[n],e.sh.g[n],i),this._sphericalHarmonics.b[n]=(0,r.Cc)(t.sh.b[n],e.sh.b[n],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const b=(0,s.vt)()},33442(t,e,i){i.d(e,{Tk:()=>_,b6:()=>p,sG:()=>u});var r=i(35522),n=i(51850),s=i(49255);const o=d(-1),a=d(1),c=o,h=new Array;h[0]=null,h[1]=a,h[2]=o,h[3]=d(-2),h[4]=d(-3);const l=h.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(c,t));function u({output:t,enableOITOffset:e,polygonOffset:i}){return(0,s.Sp)(t)&&e?l[i]:h[i]}function d(t){return{factor:1*t,units:2*t}}function p(t,e,i,n){const s=u(e);if(!s)return t;const o=m*s.units,a=(0,r.S8)(g,(0,r.jb)(g,n,i));return(e,i,n)=>{const c=(i?1-Math.abs((0,r.Om)(a,i)):0)*s.factor*f+o;return t(e+c,i,n)}}h[1]=a;const f=5e-5,m=5e-6,g=(0,n.vt)();function _(t){const e=u(t)??{factor:0,units:0};return{factor:e.factor+o.factor*t.polygonOffsetIndex,units:e.units+o.units*t.polygonOffsetIndex}}},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),n=i(51976),s=i(68317);class o extends s.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,n.W)()],o.prototype,"hasHighlightMixTexture",void 0),(0,r.Cg)([(0,n.W)()],o.prototype,"emissionDimmingPass",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,n.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"enableOITOffset",void 0)},35622(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),n=(i(35522),i(51850)),s=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends s.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,n.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,Um:()=>h,kE:()=>o});var r=i(4576),n=i(34727),s=i(77194);function o(t,e,i,r,s,o){let a=i.screenLength*t.pixelRatio;null!=s&&(l.update(r,e,s,o),a=l.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,n.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const n=e[r];void 0!==n&&(Array.isArray(n)?Array.isArray(t[r])&&a(n,t[r])||(t[r]=n.slice(),i=!0):t[r]!==n&&(i=!0,t[r]=n))}return i}const h={multiply:1,ignore:2,replace:3,tint:4},l=new s.PS},59907(t,e,i){i.d(e,{Wu:()=>u,vJ:()=>f});var r=i(35522),n=i(51850),s=i(58083),o=i(13030),a=i(620);function c(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length;i*=o;for(let t=0;t<a;++t){const e=2*n[t];s[i]=r[e],s[i+1]=r[e+1],i+=o}}function h(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=3*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}else for(let t=0;t<c;++t){const e=3*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}}function l(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=4*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}else for(let t=0;t<c;++t){const e=4*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}}function u(t,e,i,n){(0,r.Re)(d,t,e);const s=Math.max(Math.sqrt((0,r.Bw)(d)),1e-4);(0,r.hs)(d,d,1/s),i[n++]=d[0],i[n++]=d[1],i[n++]=d[2],i[n++]=s}const d=(0,n.vt)();function p(t,e,i,r,n=1){const s=e.typedBuffer,o=e.typedBufferStride;if(r*=o,1===n)for(let e=0;e<i;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o;else for(let e=0;e<i;++e)for(let e=0;e<n;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o}function f(t,e,i,r,n,s){const{buffer:a,offset:c}=s;for(const s of i.fields.keys()){const i=t.get(s),h=i?.indices;if(i&&h)m(s,i,r,n,a,c);else if("olidColor"===s&&null!=e){const i=t.get("position")?.indices;if(i){const t=i.length;p(e,a.getField(s,o.XP),t,c)}}}}function m(t,e,i,r,n,u){switch(t){case"position":{(0,a.vA)(3===e.size);const r=n.getField(t,o.xs);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void h(t,i,r,n);const{data:o,indices:a}=t,c=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=e[0],p=e[1],f=e[2],m=e[4],g=e[5],_=e[6],v=e[8],y=e[9],x=e[10],b=e[12],w=e[13],T=e[14];r*=l;let A=0,M=0,C=0;const S=(0,s.tZ)(e)?t=>{A=o[t]+b,M=o[t+1]+w,C=o[t+2]+T}:t=>{const e=o[t],i=o[t+1],r=o[t+2];A=d*e+m*i+v*r+b,M=p*e+g*i+y*r+w,C=f*e+_*i+x*r+T};if(1===n)for(let t=0;t<u;++t)S(3*a[t]),c[r]=A,c[r+1]=M,c[r+2]=C,r+=l;else for(let t=0;t<u;++t){S(3*a[t]);for(let t=0;t<n;++t)c[r]=A,c[r+1]=M,c[r+2]=C,r+=l}}(e,i,r,u);break}case"normal":{(0,a.vA)(3===e.size);const i=n.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void h(t,i,r,n);const{data:o,indices:a}=t,c=e,l=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],y=c[8],x=c[9],b=c[10],w=!(0,s.ut)(c),T=1e-6,A=1-T;r*=u;let M=0,C=0,S=0;const E=(0,s.tZ)(c)?t=>{M=o[t],C=o[t+1],S=o[t+2]}:t=>{const e=o[t],i=o[t+1],r=o[t+2];M=p*e+g*i+y*r,C=f*e+_*i+x*r,S=m*e+v*i+b*r};if(1===n)if(w)for(let t=0;t<d;++t){E(3*a[t]);const e=M*M+C*C+S*S;if(e<A&&e>T){const t=1/Math.sqrt(e);l[r]=M*t,l[r+1]=C*t,l[r+2]=S*t}else l[r]=M,l[r+1]=C,l[r+2]=S;r+=u}else for(let t=0;t<d;++t)E(3*a[t]),l[r]=M,l[r+1]=C,l[r+2]=S,r+=u;else for(let t=0;t<d;++t){if(E(3*a[t]),w){const t=M*M+C*C+S*S;if(t<A&&t>T){const e=1/Math.sqrt(t);M*=e,C*=e,S*=e}}for(let t=0;t<n;++t)l[r]=M,l[r+1]=C,l[r+2]=S,r+=u}}(e,r,i,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===e.size);const i=n.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uv0":{(0,a.vA)(2===e.size);const i=n.getField(t,o.ZD)??n.getField(t,o.gH);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uvi":{(0,a.vA)(2===e.size);const i=n.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"color":case"symbolColor":{const i=n.getField(t,o.XP);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(3===e.size||4===e.size),function(t,e,i,r,n=1){const{data:s,indices:o}=t,a=i.typedBuffer,c=i.typedBufferStride,h=o.length;if(r*=c,e===s.length&&4===e){a[r]=s[0],a[r+1]=s[1],a[r+2]=s[2],a[r+3]=s[3];const t=new Uint32Array(i.typedBuffer.buffer,i.start),e=c/4,o=t[r/=4];r+=e;const l=h*n;for(let i=1;i<l;++i)t[r]=o,r+=e;return}if(1!==n)if(4!==e)for(let t=0;t<h;++t){const e=3*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}else for(let t=0;t<h;++t){const e=4*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}else{if(4===e){for(let t=0;t<h;++t){const e=4*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}return}for(let t=0;t<h;++t){const e=3*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}}}(e,e.size,i,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const i=n.getField(t,o.Y$)??n.getField(t,o.Y$);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(1===e.size),function(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length,c=r[0];i*=o;for(let t=0;t<a;++t)s[i]=c,i+=o}(e,i,u);break}case"tangent":{(0,a.vA)(4===e.size);const r=n.getField(t,o.Eq);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void l(t,i,r,n);const{data:o,indices:a}=t,c=e,h=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],y=c[8],x=c[9],b=c[10],w=!(0,s.ut)(c),T=1e-6,A=1-T;if(r*=u,1===n)for(let t=0;t<d;++t){const e=4*a[t],i=o[e],n=o[e+1],s=o[e+2],c=o[e+3];let l=p*i+g*n+y*s,d=f*i+_*n+x*s,M=m*i+v*n+b*s;if(w){const t=l*l+d*d+M*M;if(t<A&&t>T){const e=1/Math.sqrt(t);l*=e,d*=e,M*=e}}h[r]=l,h[r+1]=d,h[r+2]=M,h[r+3]=c,r+=u}else for(let t=0;t<d;++t){const e=4*a[t],i=o[e],s=o[e+1],c=o[e+2],l=o[e+3];let d=p*i+g*s+y*c,M=f*i+_*s+x*c,C=m*i+v*s+b*c;if(w){const t=d*d+M*M+C*C;if(t<A&&t>T){const e=1/Math.sqrt(t);d*=e,M*=e,C*=e}}for(let t=0;t<n;++t)h[r]=d,h[r+1]=M,h[r+2]=C,h[r+3]=l,r+=u}}(e,i,r,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===e.size);const i=n.getField(t,o.jz)??n.getField(t,o.Eq);(0,a.vA)(!!i,`No buffer view for ${t}`),l(e,i,u);break}case"profileAuxData":{(0,a.vA)(3===e.size);const i=n.getField(t,o.EC)??n.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),h(e,i,u);break}}}},26292(t,e,i){i.d(e,{D:()=>d});var r=i(49255),n=i(22911),s=i(3871),o=i(63365);function a(t){t.code.add("\n vec3 emissionDimming(vec3 srcColor, float srcAlpha) {\n srcColor = clamp(srcColor, vec3(0.0), srcColor);\n return mix(vec3(1.0), srcColor, srcAlpha);\n }\n ")}var c=i(31821),h=i(26934);function l(t,e){e.useFloatBlend?t.code.add(c.H`float ditherNoise(vec4 color) { return 0.0; }`):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}var u=i(66211);function d(t,e){t.include(s.Q,e),t.include(n.NL,e);const{fragment:i,outputs:d}=t;i.include(o.a);const{output:p,hasEmission:f,discardInvisibleFragments:m,oitPremultipliedAlpha:g,snowCover:_,useFloatBlend:v,emissionDimmingPass:y}=e,x=11===p,b=(0,r.Sp)(p),w=(0,r.Rb)(p),T=(0,r._o)(p)&&!b;let A=0;(T||b)&&d.add("fragColor","vec4",A++),f&&d.add("fragEmission","vec4",A++),b&&d.add("fragAlpha","float",A++),i.include(h.Q),i.include(u.H,e),i.include(l,e),y&&i.include(a),i.code.add(c.H`
|
|
249
|
+
}`)}function c(t){t.uniforms.add(new s.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new s.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,n.vt)()},77949(t,e,i){i.d(e,{NB:()=>p,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,s.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function p(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(f,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,s.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(f,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const f=(0,n.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,n)=>r.setUniform2fv(t,e(n),i))}}},68259(t,e,i){i.d(e,{t:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,n,s,o)=>r.setUniform2fv(t,e(n,s,o),i))}}},47286(t,e,i){i.d(e,{G:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,n,s)=>r.setUniform2fv(t,e(n,s),i))}}},23205(t,e,i){i.d(e,{d:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,n)=>r.setUniform3fv(t,e(n),i))}}},14314(t,e,i){i.d(e,{I:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,n)=>r.setUniform4fv(t,e(n),i))}}},71988(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,n,s)=>r.setUniform4fv(t,e(n,s),i))}}},33094(t,e,i){i.d(e,{U:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"float",0,(r,n)=>r.setUniform1f(t,e(n),i))}}},44887(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,n,s)=>e.setUniform1fv(t,i(n,s),r),e)}}},35818(t,e,i){i.d(e,{W:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",1,(i,r,n)=>i.setUniform1i(t,e(r,n)))}}},35644(t,e,i){i.d(e,{k:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,n,s)=>r.setUniformMatrix3fv(t,e(n,s),i))}}},58029(t,e,i){i.d(e,{F:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,n)=>r.setUniformMatrix4fv(t,e(n),i))}}},97102(t,e,i){i.d(e,{S:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,n,s)=>r.setUniformMatrix4fv(t,e(n,s),i))}}},12791(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>f});var r=i(5482),n=i(69622),s=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||s.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const n=r.unit;this.setUniform1i(t,n),this._context.bindTexture(e,n,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),p=i(85079);let f=class extends n.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,p.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void s.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};f=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},51976(t,e,i){i.d(e,{K:()=>a,W:()=>c});var r=i(49186),n=i(4576);class s{constructor(t){this._bits=[...t]}equals(t){return(0,n.aI)(this._bits,t.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var o=i(65786);class a extends o.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new s(this._parameterBits),this._key}decode(t=this.key){const e=this._parameterBits;this._parameterBits=[...t.bits];const i=this._parameterNames.map(t=>` ${t}: ${this[t]}`).join("\n");return this._parameterBits=e,i}}function c(t={}){return(e,i)=>{e.hasOwnProperty("_parameterNames")||Object.defineProperty(e,"_parameterNames",{value:e._parameterNames?.slice()??[],configurable:!0,writable:!0}),e.hasOwnProperty("_parameterBits")||Object.defineProperty(e,"_parameterBits",{value:e._parameterBits?.slice()??[0],configurable:!0,writable:!0}),e._parameterNames.push(i);const n=t.count||2,s=Math.ceil(Math.log2(n)),o=e._parameterBits;let a=0;for(;o[a]+s>16;)a++,a>=o.length&&o.push(0);const c=o[a],h=(1<<s)-1<<c;o[a]+=s,t.count?Object.defineProperty(e,i,{get(){return(this._parameterBits[a]&h)>>c},set(e){const n=this._parameterBits[a];if((n&h)>>c!==e){if(this._key=null,this._parameterBits[a]=n&~h|+e<<c&h,"number"!=typeof e)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must be a number, got ${typeof e}`);if(null==t.count)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must provide a count option`)}}}):Object.defineProperty(e,i,{get(){return!!((this._parameterBits[a]&h)>>c)},set(t){const e=this._parameterBits[a];if(!!((e&h)>>c)!==t&&(this._key=null,this._parameterBits[a]=e&~h|+t<<c,"boolean"!=typeof t))throw new r.A("internal:invalid-shader-configurationx",`Configuration value for ${i} must be boolean, got ${typeof t}`)}})}}},16943(t,e,i){i.d(e,{E:()=>n});var r=i(44208);function n(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){i.d(e,{lK:()=>a,wR:()=>o});var r=i(63907),n=i(85079),s=i(74038);const o=[],a=(new s._("position",3,r.pe.FLOAT,0,12),[new s._("position",2,r.pe.FLOAT,0,8)]);(0,n.Xk)(a),new s._("position",2,r.pe.FLOAT,0,12),new s._("uv0",2,r.pe.HALF_FLOAT,8,12),new s._("position",2,r.pe.FLOAT,0,16),new s._("uv0",2,r.pe.FLOAT,8,16)},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},63500(t,e,i){i.d(e,{V:()=>E});var r=i(9093),n=i(35522),s=i(97146),o=i(46610),a=i(34275),c=i(20498);function h(t){if(t.length<a.y9)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,a.LW)(t)?(0,c.pX)().from(t):(0,a.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return Float32Array.from(t);default:return Float64Array.from(t)}}var l=i(15142),u=i(51850),d=i(620);class p{get center(){return(0,u.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,u.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,u.fA)(this._data[7],this._data[8],this._data[9])}constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=i,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,d.vA)(t.length>=1),(0,d.vA)(3===i.size||4===i.size);const{data:r,size:s,indices:o}=i;(0,d.vA)(o.length%this._numIndexPerPrimitive===0),(0,d.vA)(o.length>=t.length*this._numIndexPerPrimitive);const a=t.length;let c=s*o[this._numIndexPerPrimitive*t[0]];f.clear(),f.push(c);const h=(0,u.fA)(r[c],r[c+1],r[c+2]),l=(0,u.o8)(h);for(let e=0;e<a;++e){const i=this._numIndexPerPrimitive*t[e];for(let t=0;t<this._numIndexPerPrimitive;++t){c=s*o[i+t],f.push(c);let e=r[c];h[0]=Math.min(e,h[0]),l[0]=Math.max(e,l[0]),e=r[c+1],h[1]=Math.min(e,h[1]),l[1]=Math.max(e,l[1]),e=r[c+2],h[2]=Math.min(e,h[2]),l[2]=Math.max(e,l[2])}}for(let t=0;t<3;++t)this._data[4+t]=h[t],this._data[7+t]=l[t];const p=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-h[0],l[1]-h[1]),l[2]-h[2]),g=m*m;for(let t=0;t<f.length;++t){c=f.at(t);const e=r[c]-p[0],i=r[c+1]-p[1],n=r[c+2]-p[2],s=e*e+i*i+n*n;if(s<=g)continue;const o=Math.sqrt(s),a=.5*(o-m);m+=a,g=m*m;const h=a/o;p[0]+=e*h,p[1]+=i*h,p[2]+=n*h}this._data[3]=m;for(let t=0;t<3;++t)this._data[0+t]=p[t];f.clear()}getChildren(){if(this._children||(0,n.hG)(this.bbMin,this.bbMax)<=1)return this._children;const t=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5),e=this.primitiveIndices.length,i=new Uint8Array(e),r=new Array(8);for(let t=0;t<8;++t)r[t]=0;const{data:s,size:o,indices:a}=this.position;for(let n=0;n<e;++n){let e=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[n];let h=o*a[c],l=s[h],u=s[h+1],d=s[h+2];for(let t=1;t<this._numIndexPerPrimitive;++t){h=o*a[c+t];const e=s[h],i=s[h+1],r=s[h+2];e<l&&(l=e),i<u&&(u=i),r<d&&(d=r)}l<t[0]&&(e|=1),u<t[1]&&(e|=2),d<t[2]&&(e|=4),i[n]=e,++r[e]}let c=0;for(let t=0;t<8;++t)r[t]>0&&++c;if(c<2)return;const h=new Array(8);for(let t=0;t<8;++t)h[t]=r[t]>0?new Uint32Array(r[t]):void 0;for(let t=0;t<8;++t)r[t]=0;for(let t=0;t<e;++t){const e=i[t];h[e][r[e]++]=this.primitiveIndices[t]}this._children=new Array;for(let t=0;t<8;++t)void 0!==h[t]&&this._children.push(new p(h[t],this._numIndexPerPrimitive,this.position));return this._children}static prune(){f.prune()}}const f=new l.A({deallocator:null});var m=i(24326);class g{constructor(t){this.id=(0,m.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,s.Dg)(i.indices)})}get attributes(){return this._attributes}}var _=i(4341),v=i(11964);function y(t,e,i){return(0,n.Re)(x,e,t),(0,n.Re)(b,i,t),.5*(0,n.Bw)((0,n.$A)(x,x,b))}i(32114),new _.I(v.vt),new _.I(()=>{return t?{p0:(0,u.o8)(t.p0),p1:(0,u.o8)(t.p1),p2:(0,u.o8)(t.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var t});const x=(0,u.vt)(),b=(0,u.vt)(),w=(0,u.vt)(),T=(0,u.vt)(),A=(0,u.vt)(),M=(0,u.vt)();var C=i(17478),S=i(94656);class E extends g{constructor(t,e,i=null,r=0,n=null,s=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=n,this.edgeIndicesLength=s,this.baseGeometry=o,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,d.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const c=this.positionAttribute;null!=c&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=c.indices.length)}instantiate(t={}){const e=new E(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:h(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const i=this._attributes.get(t);i?this._attributes.set(t,{...i,exclusive:!0,data:e}):(0,S.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);this._vertexPositionIndicesCache=i}else this._vertexPositionIndicesCache=e?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!(0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&(0,n.Z0)(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0),(0,n.hZ)(M,0,0,0);let o=0,a=0;for(let e=0;e<i.length-2;e+=3){const c=i[e]*r,h=i[e+1]*r,l=i[e+2]*r;(0,n.hZ)(w,s[c],s[c+1],s[c+2]),(0,n.hZ)(T,s[h],s[h+1],s[h+2]),(0,n.hZ)(A,s[l],s[l+1],s[l+2]);const u=y(w,T,A);u?((0,n.WQ)(w,w,T),(0,n.WQ)(w,w,A),(0,n.hs)(w,w,1/3*u),(0,n.WQ)(t,t,w),o+=u):((0,n.WQ)(M,M,w),(0,n.WQ)(M,M,T),(0,n.WQ)(M,M,A),a+=3)}return!(0===a&&0===o||(0!==o?((0,n.hs)(t,t,1/o),0):0===a||((0,n.hs)(t,M,1/a),0)))}(t,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(t){const e=this.positionAttribute,i=this.primitivePositionIndices;return function(t,e,i,r=e?.indices){if(!e||!r)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(M,0,0,0);let s=0,o=0;const{size:a,data:c}=e,h=r.length-1,l=h+(i?2:0);for(let e=0;e<l;e+=2){const i=e<h?e+1:0,l=r[e<h?e:h]*a,u=r[i]*a;w[0]=c[l],w[1]=c[l+1],w[2]=c[l+2],T[0]=c[u],T[1]=c[u+1],T[2]=c[u+2],(0,n.hs)(w,(0,n.WQ)(w,w,T),.5);const d=(0,n.xg)(w,T);d>0?((0,n.WQ)(t,t,(0,n.hs)(w,w,d)),s+=d):0===s&&((0,n.WQ)(M,M,w),o++)}return 0!==s?((0,n.hs)(t,t,1/s),!0):0!==o&&((0,n.hs)(t,M,1/o),!0)}(t,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}(this.material.parameters,e),i)}_computeAttachmentOriginPoints(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0);let o=-1,a=0;for(let e=0;e<i.length;e++){const n=i[e]*r;o!==n&&(t[0]+=s[n],t[1]+=s[n+1],t[2]+=s[n+2],a++),o=n}return a>1&&(0,n.hs)(t,t,1/a),a>0}(t,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.primitivePositionIndices;if(!t||!e||0===e.length)return null;const i=e===t.indices?t:new o.n(t.data,e,t.size,!1,t.stride),r=0===this.type?3:1;(0,d.vA)(e.length%r===0,"Indexing error: "+e.length+" not divisible by "+r);const n=(0,s.tM)(e.length/r);return new p(n,r,i)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||R}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new C.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const R=new Set},49718(t,e,i){i(51850),i(6867).i},6867(t,e,i){i.d(e,{i:()=>l});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,s.hs)(d,this.ray.direction,this.distance),(0,s.Bw)(d))}withinDistance(t){return!!u(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!u(this)&&((0,s.hs)(d,this.ray.direction,this.distance),(0,s.WQ)(t,this.ray.origin,d),!0)}getTransformedNormal(t){return(0,s.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,s.C)(t,p),(0,s.S8)(t,t)}constructor(t){this.intersector=4,this.normal=(0,o.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this.intersector=t,this.distance=i,(0,s.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??n.zK),this.target=e,this.drapedLayerOrder=h,this.renderPriority=l}copy(t){(0,h.C)(t.ray,this._ray),this.intersector=t.intersector,this.distance=t.distance,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.renderPriority=t.renderPriority,(0,s.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function u(t){return null!=t?.distance}const d=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>U});var r=i(49186),n=i(65529),s=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),p=i(2741);let f;var m=i(63907),g=i(21231),_=i(42293);let v=null,y=null;async function x(){return null==y&&(f??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),y=f,v=await y),y}function b(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=A(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=M(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,n){const s=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function A(t){return t.getNumImages()>=1&&!t.isUASTC()}function M(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function C(t,e,i,r,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(o(t,l))),a(t,l,p[t]);return e.internalFormat=u,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=n,e.height=s,new g.A(t,e,{type:"compressed",levels:p})}var S=i(53966);const E=()=>S.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),O=R("DXT3"),D=R("DXT5");function F(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let n,s;switch(r){case I:n=8,s=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case D:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let p=t.byteOffset+i[1]+4;const f=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*n,u=new Uint8Array(t.buffer,p,d),f.push(u),p+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:s,width:h,height:l}}var P=i(78988),N=i(620),B=i(67171),L=i(12541);class U{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new n.bk,this._parameters={...z,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new B.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e.isImmutable=!0===this._parameters.immutable&&function(t){return null!=t&&((0,L.tl)(t)||(0,L.tr)(t)||(0,L.CR)(t)||(0,L.QJ)(t))}(this._parameters.internalFormat),e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?b(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,n=e.pixelFormat??6408,s=(0,_.wH)(n);return(e.mipmap?4/3:1)*i*r*s||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=F(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=r;return e.samplingMode=n.levels.length>1?9987:9729,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new g.A(t,e,n)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.KTX2File(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const n=C(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.BasisFile(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const n=C(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((n,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,s.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,P.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const n=this._createDescriptor(t);return n.width=r.width,n.height=r.height,n.compress=this._parameters.compressionOptions,this._texture=new g.A(t,n,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const z={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),n=i(49255),s=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,s.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,s.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,n._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value,this._configuration.emissionDimmingPass=t.transparentWithoutDepthEmissionDimmingPass&&(0,n._o)(t.output)}}o.Y},17478(t,e,i){i.d(e,{h:()=>s,p:()=>o});var r=i(24326);class n{constructor(){this.uid=(0,r.c)()}}class s extends n{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends n{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>o,mt:()=>c,z5:()=>a});var r=i(49255),n=i(90644);const s=(0,n.p3)(1,0,1,771);function o(t,e=!1,i=!1){if(i)return n.uR;switch(t){case 0:return e?n.RC:n.T8;case 1:return s;default:return null}}function a(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?n.Uy:null;case 1:return null}}function c(t,e=513){return{func:(0,r.Sp)(t)?515:e}}},56133(t,e,i){i.d(e,{Ax:()=>h,Q0:()=>u,cP:()=>c,iB:()=>l,m:()=>n,r8:()=>a,sf:()=>s,v0:()=>o});var r=i(90644);const n={func:513},s={func:519},o={mask:255},a={mask:0},c=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),h=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681}),l=(0,r.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),u=(0,r.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680})},77194(t,e,i){i.d(e,{PS:()=>n}),i(44208);var r=i(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:n}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),n,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>n,vM:()=>s});var r=i(49186);function n(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function s(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const s=Math.max(t,e),o=t*e;if(s<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/s);return[n(Math.round(t*a),r),n(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const n=document.createElement("canvas");return n.width=e,n.height=i,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),n=i(51850),s=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,n.vt)(),this._tmpSphere=new s.iy}applyToVertex(t,e,i){const n=this.objectTransform.transform,s=(0,r.hZ)(h,t,e,i),o=(0,r.Z0)(s,s,n),a=this.offset/(0,r.Bw)(o);(0,r.Ln)(o,o,o,a);const c=this.objectTransform.inverse;return(0,r.Z0)(this.tmpVertex,o,c),this.tmpVertex}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const n=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,n)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),n=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,n),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=new s.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i){const n=(0,r.hZ)(h,t,e,i),s=(0,r.hZ)(l,t,e,i+this.componentLocalOriginLength),o=this._totalOffset/(0,r.Bw)(s);return(0,r.Ln)(this._tmpVertex,n,s,o),this._tmpVertex}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],n=t[2]+e,s=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(n),u=Math.abs(s),d=Math.abs(o),p=Math.abs(a),f=.5*(1+Math.sign(i*s))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(n*a))*Math.min(l,p),_=Math.sqrt(f*f+m*m+g*g),v=Math.sign(c+i),y=Math.sign(h+r),x=Math.sign(l+n),b=Math.sign(u+s),w=Math.sign(d+o),T=Math.sign(p+a),A=this._totalOffset;if(_<A)return t[0]-=(1-v)*A,t[1]-=(1-y)*A,t[2]-=(1-x)*A,t[3]+=b*A,t[4]+=w*A,t[5]+=T*A,t;const M=Math.max(c,u),C=Math.max(h,d),S=Math.max(l,p),E=A/Math.sqrt(M*M+C*C+S*S),R=A/_,I=R-E,O=-I;return t[0]+=i*(v*O+R),t[1]+=r*(y*O+R),t[2]+=n*(x*O+R),t[3]+=s*(b*I+E),t[4]+=o*(w*I+E),t[5]+=a*(T*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),n=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,n),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,n.vt)()}applyToVertex(t,e,i){const n=(0,r.hZ)(h,t,e,i),s=(0,r.WQ)(l,n,this.localOrigin),o=this.offset/(0,r.Bw)(s);return(0,r.Ln)(this.tmpVertex,n,s,o),this.tmpVertex}applyToAabb(t){const e=u,i=d,r=p;for(let n=0;n<3;++n)e[n]=t[0+n]+this.localOrigin[n],i[n]=t[3+n]+this.localOrigin[n],r[n]=e[n];const n=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=n[e],t[e+3]=n[e];const s=e=>{const i=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let n=0;n<3;++n)r[n]=t&1<<n?i[n]:e[n];s(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let n=0;n<3;++n)r[n]=o&1<<n?0:t&1<<n?e[n]:i[n];s(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,n.vt)(),l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),p=(0,n.vt)()},75497(t,e,i){i.d(e,{$p:()=>s,Qx:()=>o,e_:()=>a});var r=i(51850),n=i(37957);class s{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}}class a{constructor(){this.r=n.P.create(),this.g=n.P.create(),this.b=n.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{TA:()=>x,uH:()=>y});var r=i(34727),n=i(35522),s=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,n.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],n=t[2],s=e||h.P.create();s[0]=l,s[1]=.4886025119*i,s[2]=.4886025119*n,s[3]=.4886025119*r,s[4]=1.09254843059*i*r,s[5]=1.09254843059*r*n,s[6]=.31539156525*(3*n*n-1),s[7]=1.09254843059*i*n,s[8]=.54627421529*(i*i-r*r)}(m,p),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(p,g),a(p,t.intensity[0],f),c(e.r,f),a(p,t.intensity[1],f),c(e.g,f),a(p,t.intensity[2],f),c(e.b,f)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const p=h.P.create(),f=h.P.create(),m=(0,s.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,s.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,s.vt)(),this.ambient=new _,this.diffuse=new _}}const y=.4;class x{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,s.vt)(),(0,s.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,n.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,n.C)(e.direction,t[0].direction),(0,n.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,n.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,n.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,n.C)(b,this._legacy.diffuse.color),(0,n.hs)(b,b,y*this.globalFactor),(0,n.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,b)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,n.C)(this._mainLight.direction,t.mainLight.direction),(0,n.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,n.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,n.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let n=0;n<e.sh.r.length;n++)this._sphericalHarmonics.r[n]=(0,r.Cc)(t.sh.r[n],e.sh.r[n],i),this._sphericalHarmonics.g[n]=(0,r.Cc)(t.sh.g[n],e.sh.g[n],i),this._sphericalHarmonics.b[n]=(0,r.Cc)(t.sh.b[n],e.sh.b[n],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const b=(0,s.vt)()},33442(t,e,i){i.d(e,{Tk:()=>_,b6:()=>p,sG:()=>u});var r=i(35522),n=i(51850),s=i(49255);const o=d(-1),a=d(1),c=o,h=new Array;h[0]=null,h[1]=a,h[2]=o,h[3]=d(-2),h[4]=d(-3);const l=h.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(c,t));function u({output:t,enableOITOffset:e,polygonOffset:i}){return(0,s.Sp)(t)&&e?l[i]:h[i]}function d(t){return{factor:1*t,units:2*t}}function p(t,e,i,n){const s=u(e);if(!s)return t;const o=m*s.units,a=(0,r.S8)(g,(0,r.jb)(g,n,i));return(e,i,n)=>{const c=(i?1-Math.abs((0,r.Om)(a,i)):0)*s.factor*f+o;return t(e+c,i,n)}}h[1]=a;const f=5e-5,m=5e-6,g=(0,n.vt)();function _(t){const e=u(t)??{factor:0,units:0};return{factor:e.factor+o.factor*t.polygonOffsetIndex,units:e.units+o.units*t.polygonOffsetIndex}}},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),n=i(51976),s=i(68317);class o extends s.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,n.W)()],o.prototype,"hasHighlightMixTexture",void 0),(0,r.Cg)([(0,n.W)()],o.prototype,"emissionDimmingPass",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,n.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"enableOITOffset",void 0)},35622(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),n=(i(35522),i(51850)),s=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends s.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,n.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,Um:()=>h,kE:()=>o});var r=i(4576),n=i(34727),s=i(77194);function o(t,e,i,r,s,o){let a=i.screenLength*t.pixelRatio;null!=s&&(l.update(r,e,s,o),a=l.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,n.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const n=e[r];void 0!==n&&(Array.isArray(n)?Array.isArray(t[r])&&a(n,t[r])||(t[r]=n.slice(),i=!0):t[r]!==n&&(i=!0,t[r]=n))}return i}const h={multiply:1,ignore:2,replace:3,tint:4},l=new s.PS},59907(t,e,i){i.d(e,{Wu:()=>u,vJ:()=>f});var r=i(35522),n=i(51850),s=i(58083),o=i(13030),a=i(620);function c(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length;i*=o;for(let t=0;t<a;++t){const e=2*n[t];s[i]=r[e],s[i+1]=r[e+1],i+=o}}function h(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=3*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}else for(let t=0;t<c;++t){const e=3*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}}function l(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=4*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}else for(let t=0;t<c;++t){const e=4*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}}function u(t,e,i,n){(0,r.Re)(d,t,e);const s=Math.max(Math.sqrt((0,r.Bw)(d)),1e-4);(0,r.hs)(d,d,1/s),i[n++]=d[0],i[n++]=d[1],i[n++]=d[2],i[n++]=s}const d=(0,n.vt)();function p(t,e,i,r,n=1){const s=e.typedBuffer,o=e.typedBufferStride;if(r*=o,1===n)for(let e=0;e<i;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o;else for(let e=0;e<i;++e)for(let e=0;e<n;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o}function f(t,e,i,r,n,s){const{buffer:a,offset:c}=s;for(const s of i.fields.keys()){const i=t.get(s),h=i?.indices;if(i&&h)m(s,i,r,n,a,c);else if("olidColor"===s&&null!=e){const i=t.get("position")?.indices;if(i){const t=i.length;p(e,a.getField(s,o.XP),t,c)}}}}function m(t,e,i,r,n,u){switch(t){case"position":{(0,a.vA)(3===e.size);const r=n.getField(t,o.xs);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void h(t,i,r,n);const{data:o,indices:a}=t,c=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=e[0],p=e[1],f=e[2],m=e[4],g=e[5],_=e[6],v=e[8],y=e[9],x=e[10],b=e[12],w=e[13],T=e[14];r*=l;let A=0,M=0,C=0;const S=(0,s.tZ)(e)?t=>{A=o[t]+b,M=o[t+1]+w,C=o[t+2]+T}:t=>{const e=o[t],i=o[t+1],r=o[t+2];A=d*e+m*i+v*r+b,M=p*e+g*i+y*r+w,C=f*e+_*i+x*r+T};if(1===n)for(let t=0;t<u;++t)S(3*a[t]),c[r]=A,c[r+1]=M,c[r+2]=C,r+=l;else for(let t=0;t<u;++t){S(3*a[t]);for(let t=0;t<n;++t)c[r]=A,c[r+1]=M,c[r+2]=C,r+=l}}(e,i,r,u);break}case"normal":{(0,a.vA)(3===e.size);const i=n.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void h(t,i,r,n);const{data:o,indices:a}=t,c=e,l=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],y=c[8],x=c[9],b=c[10],w=!(0,s.ut)(c),T=1e-6,A=1-T;r*=u;let M=0,C=0,S=0;const E=(0,s.tZ)(c)?t=>{M=o[t],C=o[t+1],S=o[t+2]}:t=>{const e=o[t],i=o[t+1],r=o[t+2];M=p*e+g*i+y*r,C=f*e+_*i+x*r,S=m*e+v*i+b*r};if(1===n)if(w)for(let t=0;t<d;++t){E(3*a[t]);const e=M*M+C*C+S*S;if(e<A&&e>T){const t=1/Math.sqrt(e);l[r]=M*t,l[r+1]=C*t,l[r+2]=S*t}else l[r]=M,l[r+1]=C,l[r+2]=S;r+=u}else for(let t=0;t<d;++t)E(3*a[t]),l[r]=M,l[r+1]=C,l[r+2]=S,r+=u;else for(let t=0;t<d;++t){if(E(3*a[t]),w){const t=M*M+C*C+S*S;if(t<A&&t>T){const e=1/Math.sqrt(t);M*=e,C*=e,S*=e}}for(let t=0;t<n;++t)l[r]=M,l[r+1]=C,l[r+2]=S,r+=u}}(e,r,i,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===e.size);const i=n.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uv0":{(0,a.vA)(2===e.size);const i=n.getField(t,o.ZD)??n.getField(t,o.gH);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uvi":{(0,a.vA)(2===e.size);const i=n.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"color":case"symbolColor":{const i=n.getField(t,o.XP);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(3===e.size||4===e.size),function(t,e,i,r,n=1){const{data:s,indices:o}=t,a=i.typedBuffer,c=i.typedBufferStride,h=o.length;if(r*=c,e===s.length&&4===e){a[r]=s[0],a[r+1]=s[1],a[r+2]=s[2],a[r+3]=s[3];const t=new Uint32Array(i.typedBuffer.buffer,i.start),e=c/4,o=t[r/=4];r+=e;const l=h*n;for(let i=1;i<l;++i)t[r]=o,r+=e;return}if(1!==n)if(4!==e)for(let t=0;t<h;++t){const e=3*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}else for(let t=0;t<h;++t){const e=4*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}else{if(4===e){for(let t=0;t<h;++t){const e=4*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}return}for(let t=0;t<h;++t){const e=3*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}}}(e,e.size,i,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const i=n.getField(t,o.Y$)??n.getField(t,o.Y$);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(1===e.size),function(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length,c=r[0];i*=o;for(let t=0;t<a;++t)s[i]=c,i+=o}(e,i,u);break}case"tangent":{(0,a.vA)(4===e.size);const r=n.getField(t,o.Eq);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void l(t,i,r,n);const{data:o,indices:a}=t,c=e,h=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],y=c[8],x=c[9],b=c[10],w=!(0,s.ut)(c),T=1e-6,A=1-T;if(r*=u,1===n)for(let t=0;t<d;++t){const e=4*a[t],i=o[e],n=o[e+1],s=o[e+2],c=o[e+3];let l=p*i+g*n+y*s,d=f*i+_*n+x*s,M=m*i+v*n+b*s;if(w){const t=l*l+d*d+M*M;if(t<A&&t>T){const e=1/Math.sqrt(t);l*=e,d*=e,M*=e}}h[r]=l,h[r+1]=d,h[r+2]=M,h[r+3]=c,r+=u}else for(let t=0;t<d;++t){const e=4*a[t],i=o[e],s=o[e+1],c=o[e+2],l=o[e+3];let d=p*i+g*s+y*c,M=f*i+_*s+x*c,C=m*i+v*s+b*c;if(w){const t=d*d+M*M+C*C;if(t<A&&t>T){const e=1/Math.sqrt(t);d*=e,M*=e,C*=e}}for(let t=0;t<n;++t)h[r]=d,h[r+1]=M,h[r+2]=C,h[r+3]=l,r+=u}}(e,i,r,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===e.size);const i=n.getField(t,o.jz)??n.getField(t,o.Eq);(0,a.vA)(!!i,`No buffer view for ${t}`),l(e,i,u);break}case"profileAuxData":{(0,a.vA)(3===e.size);const i=n.getField(t,o.EC)??n.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),h(e,i,u);break}}}},26292(t,e,i){i.d(e,{D:()=>d});var r=i(49255),n=i(22911),s=i(3871),o=i(63365);function a(t){t.code.add("\n vec3 emissionDimming(vec3 srcColor, float srcAlpha) {\n srcColor = clamp(srcColor, vec3(0.0), srcColor);\n return mix(vec3(1.0), srcColor, srcAlpha);\n }\n ")}var c=i(31821),h=i(26934);function l(t,e){e.useFloatBlend?t.code.add(c.H`float ditherNoise(vec4 color) { return 0.0; }`):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}var u=i(66211);function d(t,e){t.include(s.Q,e),t.include(n.NL,e);const{fragment:i,outputs:d}=t;i.include(o.a);const{output:p,hasEmission:f,discardInvisibleFragments:m,oitPremultipliedAlpha:g,snowCover:_,useFloatBlend:v,emissionDimmingPass:y}=e,x=11===p,b=(0,r.Sp)(p),w=(0,r.Rb)(p),T=(0,r._o)(p)&&!b;let A=0;(T||b)&&d.add("fragColor","vec4",A++),f&&d.add("fragEmission","vec4",A++),b&&d.add("fragAlpha","float",A++),i.include(h.Q),i.include(u.Hp,e),i.include(l,e),y&&i.include(a),i.code.add(c.H`
|
|
250
250
|
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,c.If)(_,", float snow")}) {
|
|
251
251
|
${(0,c.If)(x,"finalColor.a = 1.0;")}
|
|
252
252
|
${(0,c.If)(m,"if (finalColor.a < alphaCutoff) { discard; }")}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2741],{2741(e,r,t){t.d(r,{s:()=>i});var s=t(92602),n=(t(11254),t(49186)),o=t(53966),a=t(84952);function i(e){if(!s.A.assetsPath)throw o.A.getLogger("esri.assets").errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new n.A("assets:path-not-set","config.assetsPath is not set");return(0,a.fj)(s.A.assetsPath,e)}},97159(e,r,t){t.d(r,{a:()=>y,b:()=>g,e:()=>h,f:()=>a,i:()=>p,p:()=>f,r:()=>l,t:()=>i,w:()=>u});var s=t(70333),n=t(84952),o=t(39131);function a(e,r){const t=r?.url?.path;if(e&&t&&(e=(0,n.s2)(e,t,{preserveProtocolRelative:!0}),r.portalItem&&r.readResourcePaths)){const t=(0,n.V1)(e,r.portalItem.itemUrl);null!=t&&t.startsWith(d)&&r.readResourcePaths.push(r.portalItem.resourceFromPath(t).path)}return(e=m(e,r?.portal))&&c.test(e)?y(e):e}function i(e,r,t=0){if(null==(e=e&&c.test(e)?w(e):e))return e;!(0,n.oP)(e)&&r?.blockedRelativeUrls&&r.blockedRelativeUrls.push(e);let s=(0,n.s2)(e);if(r){const t=r.verifyItemRelativeUrls?.rootPath||r.url?.path;if(t){const o=m(t,r.portal),a=m(s,r.portal);s=(0,n.V1)(a,o,o),null!=s&&s!==a&&s!==e&&r.verifyItemRelativeUrls&&r.verifyItemRelativeUrls.writtenUrls.push(s)}}return s=h(s,r?.portal),(0,n.oP)(s)&&(s=(0,n.S8)(s)),r?.resources&&r?.portalItem&&!(0,n.oP)(s)&&!(0,n.DB)(s)&&0===t&&r.resources.toKeep.push({resource:r.portalItem.resourceFromPath(s),compress:!1}),s}function l(e,r,t){return a(e,t)}function u(e,r,t,s){const n=i(e,s);void 0!==n&&(r[t]=n)}const c=/\/items\/([^/]+)\/resources\/(.*)/,d="./resources/";function p(e){const r=e?.match(c)??null;return r?.[1]??null}function f(e){const r=e?.match(c)??null;if(null==r)return null;const t=r[2],s=t.lastIndexOf("/");if(-1===s){const{path:e,extension:r}=(0,n.xw)(t);return{prefix:null,filename:e,extension:r}}const{path:o,extension:a}=(0,n.xw)(t.slice(s+1));return{prefix:t.slice(0,s),filename:o,extension:a}}function h(e,r){return r&&!r.isPortal&&r.urlKey&&r.customBaseUrl?(0,n.T1)(e,`${r.urlKey}.${r.customBaseUrl}`,r.portalHostname):e}function m(e,r){if(!r||r.isPortal||!r.urlKey||!r.customBaseUrl)return e;const t=`${r.urlKey}.${r.customBaseUrl}`,s=(0,n.Xq)();return(0,n.FX)(s,`${s.scheme}://${t}`)?(0,n.T1)(e,r.portalHostname,t):(0,n.T1)(e,t,r.portalHostname)}function y(e){if(!e)return e||null;let r=e;return r&&s.id&&!s.id.findCredential(r)&&(r=(0,o.qG)(r),r=r.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),r=r.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),r=r.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),r}function w(e){if(!e)return e||null;let r=e;return r=r.replace(/^https?:\/\/cdn\.arcgis\.com/,"https://www.arcgis.com"),r=r.replace(/^https?:\/\/cdndev\.arcgis\.com/,"https://devext.arcgis.com"),r=r.replace(/^https?:\/\/cdnqa\.arcgis\.com/,"https://qaext.arcgis.com"),r&&s.id&&!s.id.findCredential(r)&&(r=(0,o.qG)(r)),r}const g=Object.freeze(Object.defineProperty({__proto__:null,ensureMainOnlineDomain:h,fromCDNUrl:w,fromJSON:a,itemIdFromResourceUrl:p,prefixAndFilenameFromResourceUrl:f,read:l,toCDNUrl:y,toJSON:i,write:u},Symbol.toStringTag,{value:"Module"}))},91869(e,r,t){function s(e,r){for(const t of e.values())if(r(t))return!0;return!1}function n(e,r){for(const t of e.values())if(!r(t))return!1;return!0}function o(e,r,t){const s=e.get(r);if(void 0!==s)return s;const n=t();return e.set(r,n),n}function a(e){const r=new Map;return t=>(r.has(t)||r.set(t,e(t)),r.get(t))}t.d(r,{Bj:()=>a,Bs:()=>s,mt:()=>n,tE:()=>o})},60694(e,r,t){t.d(r,{Fi:()=>d,HZ:()=>q,Jf:()=>v,LS:()=>b,Wo:()=>w,bd:()=>S,cr:()=>h,iz:()=>f,qg:()=>p,uV:()=>g,yG:()=>m});var s=t(84952),n=t(39131),o=t(97159);const a={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",knowledgegraphserver:"KnowledgeGraphServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer",videoserver:"VideoServer"},i=Object.values(a),l=new RegExp(`^(?<path>(?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(?<serviceTitle>.+?)\\/(?<serverType>${i.join("|")})(?:\\/exts\\/(?<soeTitle>.+?)\\/(?<soeServerType>${i.join("|")}))?)(?:\\/(?:layers))?(?:\\/(?<sublayer>\\d+))?`,"i"),u=new RegExp(`^(?<path>(?:https?:)?\\/\\/\\S+?\\/(?<serviceTitle>[^/\\n]+)\\/(?<serverType>${i.join("|")}))(?:\\/(?:layers))?(?:\\/(?<sublayer>\\d+))?`,"i"),c=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function d(e){return l.test(e)}function p(e){if(null==e)return null;const r=(0,s.An)(e),t=r?.path.match(l)||r?.path.match(u);if(!t)return null;const{path:n,serviceTitle:o,serverType:i,soeTitle:c,soeServerType:d,sublayer:p}=t.groups??{},f=c||o,m=f.indexOf("/");return{title:h(-1!==m?f.slice(m+1):f),serverType:a[(d||i).toLowerCase()],sublayer:null!=p&&""!==p?parseInt(p,10):null,url:{path:n}}}function f(e){const r=(0,s.An)(e).path.match(c);return r?{serviceUrl:r[1],sublayerId:Number(r[2])}:null}function h(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function m(e,r){const t=[];if(e){const r=p(e);null!=r&&r.title&&t.push(r.title)}if(r){const e=h(r);t.push(e)}if(2===t.length){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}const y=["services","features","tiles","elevation3d","basemaps3d"];function w(e){let r=(0,s.$z)(e,!0);return!!r&&(r=r.toLowerCase(),!!r.endsWith(".arcgis.com")&&(!!y.some(e=>r.startsWith(e))||/^[a-z\d-]+\.svcs[a-z\d-]*\./.test(r)))}function g(e){return(0,n.$E)(e)&&function(e){const r=(0,s.$z)(e);return!!r&&r.toLowerCase().endsWith(".arcgis.com")}(e)}function v(e,r){return e?(0,s.UC)((0,s.zi)(e,r)):e}function q(e){let{url:r}=e;if(!r)return{url:r};r=(0,s.zi)(r,e.logger);const t=(0,s.An)(r),n=p(t.path);let o;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(o=n.sublayer),r=n.url.path;else if(e.nonStandardUrlAllowed){const e=f(t.path);null!=e&&(r=e.serviceUrl,o=e.sublayerId)}return{url:(0,s.UC)(r),layerId:o}}function b(e,r,t,n,a){(0,o.w)(r,n,"url",a),n.url&&null!=e.layerId&&(n.url=(0,s.fj)(n.url,t,e.layerId.toString()))}function S(e){if(!e)return!1;const r=e.toLowerCase(),t=r.includes("/services/"),s=r.includes("/mapserver/wmsserver"),n=r.includes("/imageserver/wmsserver"),o=r.includes("/wmsserver");return t&&(s||n||o)}},11254(e,r,t){t.d(r,{A:()=>w});var s=t(92602),n=t(49186),o=t(44208),a=t(17676),i=t(84952),l=t(56152),u=t(65592),c=t(91869),d=t(60694);async function p(e){const r=function(e){let r,t=!1;return"string"==typeof e?(r=(0,i.$z)(e,!0),t=(0,d.Wo)(e)):(r=e.origin,t=(0,d.Wo)(e.toString())),null==r?null:new y(r,t)}(e.parameters.url);if(!r)return null;const{QueueProcessor:s,SharedConcurrency:n}=await t.e(563).then(t.bind(t,563));return(0,c.tE)(f,r.origin,()=>{const e=(r.isHosted?(0,o.A)("request-queue-concurrency-hosted"):(0,o.A)("request-queue-concurrency-non-hosted"))??4;return h??=new n((0,o.A)("request-queue-concurrency-global")??50),new s({concurrency:e,sharedConcurrency:h,process:e=>{if((0,a.G4)(e.parameters.requestOptions))throw(0,u.YB)("",(0,a.NK)("Request canceled"),e.parameters);return(0,u.zc)(e)}})})}const f=new Map;let h,m;class y{constructor(e,r){this.origin=e,this.isHosted=r}}async function w(e,r){e instanceof URL&&(e=e.toString());const s=(0,i.DB)(e),n=(0,i.w8)(e);n||s||(e=(0,i.S8)(e));const c={url:e,requestOptions:{...r}};r?.query&&(c.requestOptions.query=r?.query instanceof URLSearchParams?(0,i.zf)(r.query.toString().replaceAll("+"," ")):r?.query);const d=e=>({data:e,getAllHeaders:v,getHeader:v,httpStatus:200,requestOptions:c.requestOptions,url:c.url}),f=(0,i.sC)(e,g.internalInterceptors);if(f){const e=await q(f,c);if(null!=e)return d(e)}let h=(0,i.sC)(e);if(h){const e=await q(h,c);if(null!=e)return d(e);h.after||h.error||(h=null)}if(e=c.url,"image"===(r=c.requestOptions).responseType&&((0,o.A)("host-webworker")||(0,o.A)("host-node")))throw(0,u.YB)("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),c);if("head"===r.method){if(r.body)throw(0,u.YB)("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),c);if(s||n)throw(0,u.YB)("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),c)}if(await async function(){(0,o.A)("host-webworker")&&(!m&&globalThis.invokeStaticMessage?m=await t.e(369).then(t.bind(t,40369)):l.i.isForeignWorker=!0)}(),m)return m.execute(e,r);const y=new AbortController,w=(0,a.u7)(r,()=>y.abort()),b={controller:y,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:h,parameters:c,redoRequest:!1,useIdentity:g.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},S=r.useQueue?async function(e){const r=await p(e);return r?r.push(e):(0,u.zc)(e)}(b):(0,u.zc)(b),T=await S.finally(()=>w?.remove());return h?.after?.(T),T}const g=s.A.request,v=()=>null;async function q(e,r){if(null!=e.responseData)return e.responseData;if(e.headers&&(r.requestOptions.headers={...r.requestOptions.headers,...e.headers}),e.query&&(r.requestOptions.query={...r.requestOptions.query,...e.query}),e.before){let t,s;try{s=await e.before(r)}catch(e){t=(0,u.YB)("request:interceptor",e,r)}if((s instanceof Error||s instanceof n.A)&&(t=(0,u.YB)("request:interceptor",s,r)),t)throw e.error&&e.error(t),t;return s}}},56152(e,r,t){t.d(r,{i:()=>s});const s={corsServers:["https://server.arcgisonline.com","https://services.arcgisonline.com"],beforeFetch:void 0,afterFetch:void 0,isForeignWorker:!1}},95117(e,r,t){t.d(r,{y:()=>n});var s=t(17676);function n(e,r,t=!1,n){return new Promise((o,a)=>{if((0,s.G4)(n))return void a((0,s.NK)());let i=()=>{c(),a(new Error(`Unable to load ${r}`))},l=async()=>{const r=e;try{await r.decode()}catch{}c(),o(r)},u=()=>{if(!e)return;const r=e;c(),r.src="",a((0,s.NK)())};const c=()=>{e&&(e.removeEventListener("error",i),e.removeEventListener("load",l),i=null,l=null,e=null,n?.removeEventListener("abort",u),u=null,t&&URL.revokeObjectURL(r))};n?.addEventListener("abort",u),e.addEventListener("error",i),e.addEventListener("load",l)})}},65592(e,r,t){t.d(r,{YB:()=>x,c8:()=>$,zc:()=>b});var s=t(92602),n=t(70333),o=t(49186),a=t(44208),i=t(4718),l=t(17676),u=t(84952),c=t(39131),d=t(56152),p=t(95117),f=t(60694);const h=new Map;function m(e,r){const t=r?.preferredHost;if(!t||(0,u.FX)(e,`https://${t}`,!0))return;const s=(0,f.qg)(e);if(!s||"FeatureServer"!==s.serverType||(0,c.$E)(e))return;const n=s.url.path.toLowerCase();h.has(n)||h.set(n,t)}function y(e){const r=(0,f.qg)(e)?.url.path.toLowerCase();if(!r)return e;const t=h.get(r);return t?(0,u.hf)(e,t):e}const w="FormData"in globalThis,g=new Set([499,498,403,401]),v=new Set(["COM_0056","COM_0057","SB_0008"]),q=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i];async function b(e){let r,o;await async function(e){const r=e.parameters.url,o=e.parameters.requestOptions,a=e.controller.signal,i=o.body;let u=null,c=null;if(w&&"HTMLFormElement"in globalThis&&(i instanceof FormData?u=i:i instanceof HTMLFormElement&&(u=new FormData(i))),"string"==typeof i&&(c=i),e.fetchOptions={cache:o.cacheMode??(o.cacheBust?"no-cache":"default"),credentials:"same-origin",headers:o.headers||{},keepalive:o.keepAlive??!1,method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:o.priority??s.A.request.priority,redirect:"follow",signal:a},(u||c)&&(e.fetchOptions.body=u||c),(d.i.isForeignWorker||"anonymous"===o.authMode)&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(r)||o.query?.token||u?.get("token")),!e.hasToken){const{getApiKey:s,getSessionToken:n}=await t.e(926).then(t.bind(t,926)),a=await n(r)??s(r);a&&(o.query??={},o.query.token=a,e.hasToken=!0)}if(e.useIdentity&&!e.hasToken&&!e.credential&&!e.credentialToken&&!O(r)&&!(0,l.G4)(a)){let t;"immediate"===o.authMode?(await A(),t=await n.id.getCredential(r,{signal:a})):"no-prompt"===o.authMode?(await A(),t=await n.id.getCredential(r,{prompt:!1,signal:a}).catch(()=>{})):n.id&&(t=n.id.findCredential(r)),t&&(e.credential=t,e.credentialToken=t.token,e.useSSL=!!t.ssl)}}(e);try{do{[r,o]=await S(e)}while(!await L(e,r,o))}catch(t){const s=x("request:server",t,e.parameters,r);throw s.details.ssl=e.useSSL,e.interceptor?.error?.(s),s}const a=e.parameters.url;if(o)if(/\/sharing\/rest\/(accounts|portals)\/self/i.test(a)){if(!e.hasToken&&!e.credentialToken&&o.user?.username&&!(0,u.FL)(a)){const e=(0,u.$z)(a,!0);e&&s.A.request.trustedServers.push(e)}Array.isArray(o.authorizedCrossOriginNoCorsDomains)&&function(e){s.A.request.crossOriginNoCorsDomains||(s.A.request.crossOriginNoCorsDomains={});const r=s.A.request.crossOriginNoCorsDomains;for(let t of e)t=t.toLowerCase(),/^https?:\/\//.test(t)?r[(0,u.$z)(t)??""]=0:(r[(0,u.$z)("http://"+t)??""]=0,r[(0,u.$z)("https://"+t)??""]=0)}(o.authorizedCrossOriginNoCorsDomains)}else"json"===(e.parameters.requestOptions.responseType||"json")&&m(a,o);const i=e.credential;if(i&&n.id){const e=n.id.findServerInfo(i.server);let r=e?.owningSystemUrl;if(r){r=r.replace(/\/?$/,"/sharing");const e=n.id.findCredential(r,i.userId);e&&-1===n.id._getIdenticalSvcIdx(r,e)&&e.resources.unshift(r)}}return{data:o,getAllHeaders:r?()=>Array.from(r.headers):E,getHeader:r?e=>r.headers.get(e):E,httpStatus:r?.status??200,requestOptions:e.parameters.requestOptions,ssl:e.useSSL,url:e.parameters.url}}async function S(e){let r=e.parameters.url,t=y(r);const o=e.parameters.requestOptions,i=e.fetchOptions??{},p=(0,u.w8)(r)||(0,u.DB)(r),f=o.responseType??"json",h=p?0:null!=o.timeout?o.timeout:s.A.request.timeout;let m=!1;if(!p){e.useSSL&&(r=(0,u.lM)(r));let l={...o.query};e.credentialToken&&(l.token=e.credentialToken);let d=(0,u.x0)(l);(0,a.A)("esri-url-encodes-apostrophe")&&(d=d.replaceAll("'","%27"));const p=t.length+1+d.length;let f;m="delete"===o.method||"post"===o.method||"put"===o.method||!!o.body||p>s.A.request.maxUrlLength;const h=o.useProxy||!!(0,u.zs)(r);if(h){const e=(0,u.s_)(r);f=e.path,!m&&f.length+1+p>s.A.request.maxUrlLength&&(m=!0),e.query&&(l={...e.query,...l})}if("HEAD"===i.method&&(m||h)){if(m){if(p>s.A.request.maxUrlLength)throw x("request:invalid-parameters",new Error("URL exceeds maximum length"),e.parameters);throw x("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.parameters)}if(h)throw x("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.parameters)}if(m?(i.method="delete"===o.method?"DELETE":"put"===o.method?"PUT":"POST",o.body?r=(0,u.a6)(r,l):(i.body=(0,u.x0)(l),i.headers||(i.headers={}),i.headers["Content-Type"]="application/x-www-form-urlencoded")):r=(0,u.a6)(r,l),h&&(e.useProxy=!0,r=`${f}?${r}`),l.token&&w&&i.body instanceof FormData&&!(0,c.$E)(r)&&i.body.set("token",l.token),o.hasOwnProperty("withCredentials"))e.withCredentials=o.withCredentials;else if(!(0,u.FX)(r,(0,u.Xq)()))if((0,u.FL)(r))e.withCredentials=!0;else if(n.id){const t=n.id.findServerInfo(r);t?.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(i.credentials="include",function(e){const r=s.A.request.crossOriginNoCorsDomains;if(r){let t=(0,u.$z)(e);if(t)return t=t.toLowerCase(),!(0,u.FX)(t,(0,u.Xq)())&&r[t]<Date.now()-36e5}return!1}(r)&&await async function(e){const r=(0,u.An)(e);e=r.path,"json"===r.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}const t=s.A.request.crossOriginNoCorsDomains,n=(0,u.$z)(e);t&&n&&(t[n.toLowerCase()]=Date.now())}(m?(0,u.a6)(r,l):r)),t=y(r)}let g,v,q=0,b=!1;h>0&&(q=setTimeout(()=>{b=!0,e.controller.abort()},h));try{if("native-request-init"===o.responseType)v=i,v.url=t,o.signal?v.signal=o.signal:delete v.signal;else if("image"!==o.responseType||"default"!==i.cache||i.keepalive||"GET"!==i.method||m||function(e){if(e)for(const r of Object.getOwnPropertyNames(e))if(e[r])return!0;return!1}(o.headers)||!p&&!e.useProxy&&s.A.request.proxyUrl&&!C(r)){if(await(d.i.beforeFetch?.(r,i)),g=await fetch(t,i),await(d.i.afterFetch?.(g)),e.useProxy||function(e){const r=(0,u.$z)(e);r&&!d.i.corsServers.includes(r)&&d.i.corsServers.push(r)}(r),"native"===o.responseType)v=g;else if("HEAD"!==i.method)if(g.ok){switch(f){case"array-buffer":v=await g.arrayBuffer();break;case"blob":case"image":v=await g.blob();break;default:v=await g.text()}if(q&&(clearTimeout(q),q=0),"json"===f||"xml"===f||"document"===f)if(v)switch(f){case"json":v=JSON.parse(v);break;case"xml":v=k(v,"application/xml");break;case"document":v=k(v,"text/html")}else v=null;if(v){if(("array-buffer"===f||"blob"===f)&&v["blob"===f?"size":"byteLength"]<=750)try{const e=await new Response(v).json();e.error&&(v=e)}catch{}"image"===f&&v instanceof Blob&&(v=await T(URL.createObjectURL(v),e,!0))}}else{v=await g.text();try{v=JSON.parse(v)}catch{}}}else v=await T(t,e)}catch(t){if("AbortError"===t.name){if(b)throw new Error(P);throw(0,l.NK)("Request canceled")}if(!(!g&&t instanceof TypeError&&s.A.request.proxyUrl)||o.body||"delete"===o.method||"head"===o.method||"post"===o.method||"put"===o.method||e.useProxy||C(r))throw t;e.redoRequest=!0,(0,u.oy)({proxyUrl:s.A.request.proxyUrl,urlPrefix:(0,u.$z)(r)??""})}finally{q&&clearTimeout(q)}return[g,v]}function T(e,r,t=!1){const n=r.controller.signal,o=new Image;return r.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.fetchPriority=s.A.request.priority,o.src=e,(0,p.y)(o,e,t,n)}function C(e){const r=(0,u.$z)(e);return!r||r.endsWith(".arcgis.com")||d.i.corsServers.includes(r)||(0,u.FL)(r)}async function A(){n.id||await Promise.all([t.e(7632),t.e(6408),t.e(8690),t.e(9466),t.e(5482),t.e(148),t.e(8050)]).then(t.bind(t,50148))}function O(e){return q.some(r=>r.test(e))}function k(e,r){let t;try{t=(new DOMParser).parseFromString(e,r)}catch{}if(!t||t.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return t}async function L(e,r,t){if(e.redoRequest)return e.redoRequest=!1,!1;const s=e.parameters.requestOptions;if(!r||"native"===s.responseType||"native-request-init"===s.responseType)return!0;let o,a;if(t&&(t.error&&"object"==typeof t.error?o=t.error:"error"===t.status&&Array.isArray(t.messages)&&(o={...t},o[U]=t,o.details=t.messages)),!o&&!r.ok)throw o=new Error(`Unable to load ${r.url} status: ${r.status}`),o[U]=t,o;let i,l=null;o&&(a=Number(o.code),l=o.hasOwnProperty("subcode")?Number(o.subcode):null,i=o.messageCode,i=i?.toUpperCase());const u=s.authMode;if(403===a&&(4===l||o.message?.toLowerCase().includes("ssl")&&!o.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===a)&&void 0!==a&&g.has(a)&&!O(e.parameters.url)&&(403!==a||(!i||!v.has(i))&&(null==l||2===l&&e.credentialToken))){await A();try{const r=await n.id.getCredential(e.parameters.url,{error:x("request:server",o,e.parameters),credential:e.credential,prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=r,e.credentialToken=r.token,e.useSSL=e.useSSL||r.ssl,!1}catch(r){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;o=r}}if(o)throw o;return!0}function x(e,r,t,s){let n;const a={url:t.url,requestOptions:t.requestOptions,getAllHeaders:E,getHeader:E,ssl:!1};if(r instanceof o.A)return r.details?(r.details=(0,i.o8)(r.details),r.details.url=t.url,r.details.requestOptions=t.requestOptions):r.details=a,r;if(r){const e=s&&(()=>Array.from(s.headers)),t=s&&(e=>s.headers.get(e)),o=s?.status,i=r.message;i&&(n=i),e&&t&&(a.getAllHeaders=e,a.getHeader=t),a.httpStatus=(null!=r.httpCode?r.httpCode:r.code)||o||0,a.subCode=r.subcode,a.messageCode=r.messageCode,"string"==typeof r.details?(a.messages=[r.details],n??=r.details):(a.messages=r.details,n??=a.messages?.[0]),a.raw=U in r?r[U]:r}return n??="Error",(0,l.zf)(r)?(0,l.NK)():new o.A(e,n,a)}const U=Symbol(),E=()=>null,P="Timeout exceeded";function $(e){return"object"==typeof e&&!!e&&"message"in e&&e.message===P}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2741],{2741(e,r,t){t.d(r,{s:()=>i});var s=t(92602),n=(t(11254),t(49186)),o=t(53966),a=t(84952);function i(e){if(!s.A.assetsPath)throw o.A.getLogger("esri.assets").errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new n.A("assets:path-not-set","config.assetsPath is not set");return(0,a.fj)(s.A.assetsPath,e)}},97159(e,r,t){t.d(r,{a:()=>y,b:()=>g,e:()=>h,f:()=>a,i:()=>p,p:()=>f,r:()=>l,t:()=>i,w:()=>u});var s=t(70333),n=t(84952),o=t(39131);function a(e,r){const t=r?.url?.path;if(e&&t&&(e=(0,n.s2)(e,t,{preserveProtocolRelative:!0}),r.portalItem&&r.readResourcePaths)){const t=(0,n.V1)(e,r.portalItem.itemUrl);null!=t&&t.startsWith(d)&&r.readResourcePaths.push(r.portalItem.resourceFromPath(t).path)}return(e=m(e,r?.portal))&&c.test(e)?y(e):e}function i(e,r,t=0){if(null==(e=e&&c.test(e)?w(e):e))return e;!(0,n.oP)(e)&&r?.blockedRelativeUrls&&r.blockedRelativeUrls.push(e);let s=(0,n.s2)(e);if(r){const t=r.verifyItemRelativeUrls?.rootPath||r.url?.path;if(t){const o=m(t,r.portal),a=m(s,r.portal);s=(0,n.V1)(a,o,o),null!=s&&s!==a&&s!==e&&r.verifyItemRelativeUrls&&r.verifyItemRelativeUrls.writtenUrls.push(s)}}return s=h(s,r?.portal),(0,n.oP)(s)&&(s=(0,n.S8)(s)),r?.resources&&r?.portalItem&&!(0,n.oP)(s)&&!(0,n.DB)(s)&&0===t&&r.resources.toKeep.push({resource:r.portalItem.resourceFromPath(s),compress:!1}),s}function l(e,r,t){return a(e,t)}function u(e,r,t,s){const n=i(e,s);void 0!==n&&(r[t]=n)}const c=/\/items\/([^/]+)\/resources\/(.*)/,d="./resources/";function p(e){const r=e?.match(c)??null;return r?.[1]??null}function f(e){const r=e?.match(c)??null;if(null==r)return null;const t=r[2],s=t.lastIndexOf("/");if(-1===s){const{path:e,extension:r}=(0,n.xw)(t);return{prefix:null,filename:e,extension:r}}const{path:o,extension:a}=(0,n.xw)(t.slice(s+1));return{prefix:t.slice(0,s),filename:o,extension:a}}function h(e,r){return r&&!r.isPortal&&r.urlKey&&r.customBaseUrl?(0,n.T1)(e,`${r.urlKey}.${r.customBaseUrl}`,r.portalHostname):e}function m(e,r){if(!r||r.isPortal||!r.urlKey||!r.customBaseUrl)return e;const t=`${r.urlKey}.${r.customBaseUrl}`,s=(0,n.Xq)();return(0,n.FX)(s,`${s.scheme}://${t}`)?(0,n.T1)(e,r.portalHostname,t):(0,n.T1)(e,t,r.portalHostname)}function y(e){if(!e)return e||null;let r=e;return r&&s.id&&!s.id.findCredential(r)&&(r=(0,o.qG)(r),r=r.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),r=r.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),r=r.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),r}function w(e){if(!e)return e||null;let r=e;return r=r.replace(/^https?:\/\/cdn\.arcgis\.com/,"https://www.arcgis.com"),r=r.replace(/^https?:\/\/cdndev\.arcgis\.com/,"https://devext.arcgis.com"),r=r.replace(/^https?:\/\/cdnqa\.arcgis\.com/,"https://qaext.arcgis.com"),r&&s.id&&!s.id.findCredential(r)&&(r=(0,o.qG)(r)),r}const g=Object.freeze(Object.defineProperty({__proto__:null,ensureMainOnlineDomain:h,fromCDNUrl:w,fromJSON:a,itemIdFromResourceUrl:p,prefixAndFilenameFromResourceUrl:f,read:l,toCDNUrl:y,toJSON:i,write:u},Symbol.toStringTag,{value:"Module"}))},91869(e,r,t){function s(e,r){for(const t of e.values())if(r(t))return!0;return!1}function n(e,r){for(const t of e.values())if(!r(t))return!1;return!0}function o(e,r,t){const s=e.get(r);if(void 0!==s)return s;const n=t();return e.set(r,n),n}function a(e){const r=new Map;return t=>(r.has(t)||r.set(t,e(t)),r.get(t))}t.d(r,{Bj:()=>a,Bs:()=>s,mt:()=>n,tE:()=>o})},60694(e,r,t){t.d(r,{Fi:()=>d,HZ:()=>q,Jf:()=>v,LS:()=>b,Wo:()=>w,bd:()=>S,cr:()=>h,iz:()=>f,qg:()=>p,uV:()=>g,yG:()=>m});var s=t(84952),n=t(39131),o=t(97159);const a={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",knowledgegraphserver:"KnowledgeGraphServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer",videoserver:"VideoServer"},i=Object.values(a),l=new RegExp(`^(?<path>(?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(?<serviceTitle>.+?)\\/(?<serverType>${i.join("|")})(?:\\/exts\\/(?<soeTitle>.+?)\\/(?<soeServerType>${i.join("|")}))?)(?:\\/(?:layers))?(?:\\/(?<sublayer>\\d+))?`,"i"),u=new RegExp(`^(?<path>(?:https?:)?\\/\\/\\S+?\\/(?<serviceTitle>[^/\\n]+)\\/(?<serverType>${i.join("|")}))(?:\\/(?:layers))?(?:\\/(?<sublayer>\\d+))?`,"i"),c=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function d(e){return l.test(e)}function p(e){if(null==e)return null;const r=(0,s.An)(e),t=r?.path.match(l)||r?.path.match(u);if(!t)return null;const{path:n,serviceTitle:o,serverType:i,soeTitle:c,soeServerType:d,sublayer:p}=t.groups??{},f=c||o,m=f.indexOf("/");return{title:h(-1!==m?f.slice(m+1):f),serverType:a[(d||i).toLowerCase()],sublayer:null!=p&&""!==p?parseInt(p,10):null,url:{path:n}}}function f(e){const r=(0,s.An)(e).path.match(c);return r?{serviceUrl:r[1],sublayerId:Number(r[2])}:null}function h(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function m(e,r){const t=[];if(e){const r=p(e);null!=r&&r.title&&t.push(r.title)}if(r){const e=h(r);t.push(e)}if(2===t.length){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}const y=["services","features","tiles","elevation3d","basemaps3d"];function w(e){let r=(0,s.$z)(e,!0);return!!r&&(r=r.toLowerCase(),!!r.endsWith(".arcgis.com")&&(!!y.some(e=>r.startsWith(e))||/^[a-z\d-]+\.svcs[a-z\d-]*\./.test(r)))}function g(e){return(0,n.$E)(e)&&function(e){const r=(0,s.$z)(e);return!!r&&r.toLowerCase().endsWith(".arcgis.com")}(e)}function v(e,r){return e?(0,s.UC)((0,s.zi)(e,r)):e}function q(e){let{url:r}=e;if(!r)return{url:r};r=(0,s.zi)(r,e.logger);const t=(0,s.An)(r),n=p(t.path);let o;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(o=n.sublayer),r=n.url.path;else if(e.nonStandardUrlAllowed){const e=f(t.path);null!=e&&(r=e.serviceUrl,o=e.sublayerId)}return{url:(0,s.UC)(r),layerId:o}}function b(e,r,t,n,a){(0,o.w)(r,n,"url",a),n.url&&null!=e.layerId&&(n.url=(0,s.fj)(n.url,t,e.layerId.toString()))}function S(e){if(!e)return!1;const r=e.toLowerCase(),t=r.includes("/services/"),s=r.includes("/mapserver/wmsserver"),n=r.includes("/imageserver/wmsserver"),o=r.includes("/wmsserver");return t&&(s||n||o)}},11254(e,r,t){t.d(r,{A:()=>w});var s=t(92602),n=t(49186),o=t(44208),a=t(17676),i=t(84952),l=t(56152),u=t(65592),c=t(91869),d=t(60694);async function p(e){const r=function(e){let r,t=!1;return"string"==typeof e?(r=(0,i.$z)(e,!0),t=(0,d.Wo)(e)):(r=e.origin,t=(0,d.Wo)(e.toString())),null==r?null:new y(r,t)}(e.parameters.url);if(!r)return null;const{QueueProcessor:s,SharedConcurrency:n}=await t.e(563).then(t.bind(t,563));return(0,c.tE)(f,r.origin,()=>{const e=(r.isHosted?(0,o.A)("request-queue-concurrency-hosted"):(0,o.A)("request-queue-concurrency-non-hosted"))??4;return h??=new n((0,o.A)("request-queue-concurrency-global")??50),new s({concurrency:e,sharedConcurrency:h,process:e=>{if((0,a.G4)(e.parameters.requestOptions))throw(0,u.YB)("",(0,a.NK)("Request canceled"),e.parameters);return(0,u.zc)(e)}})})}const f=new Map;let h,m;class y{constructor(e,r){this.origin=e,this.isHosted=r}}async function w(e,r){e instanceof URL&&(e=e.toString());const s=(0,i.DB)(e),n=(0,i.w8)(e);n||s||(e=(0,i.S8)(e));const c={url:e,requestOptions:{...r}};r?.query&&(c.requestOptions.query=r?.query instanceof URLSearchParams?(0,i.zf)(r.query.toString().replaceAll("+"," ")):r?.query);const d=e=>({data:e,getAllHeaders:v,getHeader:v,httpStatus:200,requestOptions:c.requestOptions,url:c.url}),f=(0,i.sC)(e,g.internalInterceptors);if(f){const e=await q(f,c);if(null!=e)return d(e)}let h=(0,i.sC)(e);if(h){const e=await q(h,c);if(null!=e)return d(e);h.after||h.error||(h=null)}if(e=c.url,"image"===(r=c.requestOptions).responseType&&((0,o.A)("host-webworker")||(0,o.A)("host-node")))throw(0,u.YB)("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),c);if("head"===r.method){if(r.body)throw(0,u.YB)("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),c);if(s||n)throw(0,u.YB)("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),c)}if(await async function(){(0,o.A)("host-webworker")&&(!m&&globalThis.invokeStaticMessage?m=await t.e(369).then(t.bind(t,40369)):l.i.isForeignWorker=!0)}(),m)return m.execute(e,r);const y=new AbortController,w=(0,a.u7)(r,()=>y.abort()),b={controller:y,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:h,parameters:c,redoRequest:!1,useIdentity:g.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},S=r.useQueue?async function(e){const r=await p(e);return r?r.push(e):(0,u.zc)(e)}(b):(0,u.zc)(b),T=await S.finally(()=>w?.remove());return h?.after?.(T),T}const g=s.A.request,v=()=>null;async function q(e,r){if(null!=e.responseData)return e.responseData;if(e.headers&&(r.requestOptions.headers={...r.requestOptions.headers,...e.headers}),e.query&&(r.requestOptions.query={...r.requestOptions.query,...e.query}),e.before){let t,s;try{s=await e.before(r)}catch(e){t=(0,u.YB)("request:interceptor",e,r)}if((s instanceof Error||s instanceof n.A)&&(t=(0,u.YB)("request:interceptor",s,r)),t)throw e.error&&e.error(t),t;return s}}},56152(e,r,t){t.d(r,{i:()=>s});const s={corsServers:["https://server.arcgisonline.com","https://services.arcgisonline.com"],beforeFetch:void 0,afterFetch:void 0,isForeignWorker:!1}},95117(e,r,t){t.d(r,{y:()=>n});var s=t(17676);function n(e,r,t=!1,n){return new Promise((o,a)=>{if((0,s.G4)(n))return void a((0,s.NK)());let i=()=>{c(),a(new Error(`Unable to load ${r}`))},l=async()=>{const r=e;try{await r.decode()}catch{}c(),o(r)},u=()=>{if(!e)return;const r=e;c(),r.src="",a((0,s.NK)())};const c=()=>{e&&(e.removeEventListener("error",i),e.removeEventListener("load",l),i=null,l=null,e=null,n?.removeEventListener("abort",u),u=null,t&&URL.revokeObjectURL(r))};n?.addEventListener("abort",u),e.addEventListener("error",i),e.addEventListener("load",l)})}},65592(e,r,t){t.d(r,{YB:()=>x,c8:()=>$,zc:()=>b});var s=t(92602),n=t(70333),o=t(49186),a=t(44208),i=t(4718),l=t(17676),u=t(84952),c=t(39131),d=t(56152),p=t(95117),f=t(60694);const h=new Map;function m(e,r){const t=r?.preferredHost;if(!t||(0,u.FX)(e,`https://${t}`,!0))return;const s=(0,f.qg)(e);if(!s||"FeatureServer"!==s.serverType||(0,c.$E)(e))return;const n=s.url.path.toLowerCase();h.has(n)||h.set(n,t)}function y(e){const r=(0,f.qg)(e)?.url.path.toLowerCase();if(!r)return e;const t=h.get(r);return t?(0,u.hf)(e,t):e}const w="FormData"in globalThis,g=new Set([499,498,403,401]),v=new Set(["COM_0056","COM_0057","SB_0008"]),q=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i];async function b(e){let r,o;await async function(e){const r=e.parameters.url,o=e.parameters.requestOptions,a=e.controller.signal,i=o.body;let u=null,c=null;if(w&&"HTMLFormElement"in globalThis&&(i instanceof FormData?u=i:i instanceof HTMLFormElement&&(u=new FormData(i))),"string"==typeof i&&(c=i),e.fetchOptions={cache:o.cacheMode??(o.cacheBust?"no-cache":"default"),credentials:"same-origin",headers:o.headers||{},keepalive:o.keepAlive??!1,method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:o.priority??s.A.request.priority,redirect:"follow",signal:a},(u||c)&&(e.fetchOptions.body=u||c),(d.i.isForeignWorker||"anonymous"===o.authMode)&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(r)||o.query?.token||u?.get("token")),!e.hasToken){const{getApiKey:s,getSessionToken:n}=await t.e(926).then(t.bind(t,926)),a=await n(r)??s(r);a&&(o.query??={},o.query.token=a,e.hasToken=!0)}if(e.useIdentity&&!e.hasToken&&!e.credential&&!e.credentialToken&&!O(r)&&!(0,l.G4)(a)){let t;"immediate"===o.authMode?(await A(),t=await n.id.getCredential(r,{signal:a})):"no-prompt"===o.authMode?(await A(),t=await n.id.getCredential(r,{prompt:!1,signal:a}).catch(()=>{})):n.id&&(t=n.id.findCredential(r)),t&&(e.credential=t,e.credentialToken=t.token,e.useSSL=!!t.ssl)}}(e);try{do{[r,o]=await S(e)}while(!await L(e,r,o))}catch(t){const s=x("request:server",t,e.parameters,r);throw s.details.ssl=e.useSSL,e.interceptor?.error?.(s),s}const a=e.parameters.url;if(o)if(/\/sharing\/rest\/(accounts|portals)\/self/i.test(a)){if(!e.hasToken&&!e.credentialToken&&o.user?.username&&!(0,u.FL)(a)){const e=(0,u.$z)(a,!0);e&&s.A.request.trustedServers.push(e)}Array.isArray(o.authorizedCrossOriginNoCorsDomains)&&function(e){s.A.request.crossOriginNoCorsDomains||(s.A.request.crossOriginNoCorsDomains={});const r=s.A.request.crossOriginNoCorsDomains;for(let t of e)t=t.toLowerCase(),/^https?:\/\//.test(t)?r[(0,u.$z)(t)??""]=0:(r[(0,u.$z)("http://"+t)??""]=0,r[(0,u.$z)("https://"+t)??""]=0)}(o.authorizedCrossOriginNoCorsDomains)}else"json"===(e.parameters.requestOptions.responseType||"json")&&m(a,o);const i=e.credential;if(i&&n.id){const e=n.id.findServerInfo(i.server);let r=e?.owningSystemUrl;if(r){r=r.replace(/\/?$/,"/sharing");const e=n.id.findCredential(r,i.userId);e&&-1===n.id._getIdenticalSvcIdx(r,e)&&e.resources.unshift(r)}}return{data:o,getAllHeaders:r?()=>Array.from(r.headers):E,getHeader:r?e=>r.headers.get(e):E,httpStatus:r?.status??200,requestOptions:e.parameters.requestOptions,ssl:e.useSSL,url:e.parameters.url}}async function S(e){let r=e.parameters.url,t=y(r);const o=e.parameters.requestOptions,i=e.fetchOptions??{},p=(0,u.w8)(r)||(0,u.DB)(r),f=o.responseType??"json",h=p?0:null!=o.timeout?o.timeout:s.A.request.timeout;let m=!1;if(!p){e.useSSL&&(r=(0,u.lM)(r));let l={...o.query};e.credentialToken&&(l.token=e.credentialToken);let d=(0,u.x0)(l);(0,a.A)("esri-url-encodes-apostrophe")&&(d=d.replaceAll("'","%27"));const p=t.length+1+d.length;let f;m="delete"===o.method||"post"===o.method||"put"===o.method||!!o.body||p>s.A.request.maxUrlLength;const h=o.useProxy||!!(0,u.zs)(r);if(h){const e=(0,u.s_)(r);f=e.path,!m&&f.length+1+p>s.A.request.maxUrlLength&&(m=!0),e.query&&(l={...e.query,...l})}if("HEAD"===i.method&&(m||h)){if(m){if(p>s.A.request.maxUrlLength)throw x("request:invalid-parameters",new Error("URL exceeds maximum length"),e.parameters);throw x("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.parameters)}if(h)throw x("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.parameters)}if(m?(i.method="delete"===o.method?"DELETE":"put"===o.method?"PUT":"POST",o.body?r=(0,u.a6)(r,l):(i.body=(0,u.x0)(l),i.headers||(i.headers={}),i.headers["Content-Type"]="application/x-www-form-urlencoded")):r=(0,u.a6)(r,l),h&&(e.useProxy=!0,r=`${f}?${r}`),l.token&&w&&i.body instanceof FormData&&!(0,c.$E)(r)&&i.body.set("token",l.token),o.hasOwnProperty("withCredentials"))e.withCredentials=o.withCredentials;else if(!(0,u.FX)(r,(0,u.Xq)()))if((0,u.FL)(r))e.withCredentials=!0;else if(n.id){const t=n.id.findServerInfo(r);t?.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(i.credentials="include",function(e){const r=s.A.request.crossOriginNoCorsDomains;if(r){let t=(0,u.$z)(e);if(t)return t=t.toLowerCase(),!(0,u.FX)(t,(0,u.Xq)())&&r[t]<Date.now()-36e5}return!1}(r)&&await async function(e){const r=(0,u.An)(e);e=r.path,"json"===r.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}const t=s.A.request.crossOriginNoCorsDomains,n=(0,u.$z)(e);t&&n&&(t[n.toLowerCase()]=Date.now())}(m?(0,u.a6)(r,l):r)),t=y(r)}let g,v,q=0,b=!1;h>0&&(q=setTimeout(()=>{b=!0,e.controller.abort()},h));try{if("native-request-init"===o.responseType)v=i,v.url=t,o.signal?v.signal=o.signal:delete v.signal;else if("image"!==o.responseType||"default"!==i.cache||i.keepalive||"GET"!==i.method||m||function(e){if(e)for(const r of Object.getOwnPropertyNames(e))if(e[r])return!0;return!1}(o.headers)||!p&&!e.useProxy&&s.A.request.proxyUrl&&!C(r)){if(await(d.i.beforeFetch?.(r,i)),g=await fetch(t,i),await(d.i.afterFetch?.(g)),e.useProxy||function(e){const r=(0,u.$z)(e);r&&!d.i.corsServers.includes(r)&&d.i.corsServers.push(r)}(r),"native"===o.responseType)v=g;else if("HEAD"!==i.method)if(g.ok){switch(f){case"array-buffer":v=await g.arrayBuffer();break;case"blob":case"image":v=await g.blob();break;default:v=await g.text()}if(q&&(clearTimeout(q),q=0),"json"===f||"xml"===f||"document"===f)if(v)switch(f){case"json":v=JSON.parse(v);break;case"xml":v=k(v,"application/xml");break;case"document":v=k(v,"text/html")}else v=null;if(v){if(("array-buffer"===f||"blob"===f)&&v["blob"===f?"size":"byteLength"]<=750)try{const e=await new Response(v).json();e.error&&(v=e)}catch{}"image"===f&&v instanceof Blob&&(v=await T(URL.createObjectURL(v),e,!0))}}else{v=await g.text();try{v=JSON.parse(v)}catch{}}}else v=await T(t,e)}catch(t){if("AbortError"===t.name){if(b)throw new Error(P);throw(0,l.NK)("Request canceled")}if(!(!g&&t instanceof TypeError&&s.A.request.proxyUrl)||o.body||"delete"===o.method||"head"===o.method||"post"===o.method||"put"===o.method||e.useProxy||C(r))throw t;e.redoRequest=!0,(0,u.oy)({proxyUrl:s.A.request.proxyUrl,urlPrefix:(0,u.$z)(r)??""})}finally{q&&clearTimeout(q)}return[g,v]}function T(e,r,t=!1){const n=r.controller.signal,o=new Image;return r.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.fetchPriority=s.A.request.priority,o.src=e,(0,p.y)(o,e,t,n)}function C(e){const r=(0,u.$z)(e);return!r||r.endsWith(".arcgis.com")||d.i.corsServers.includes(r)||(0,u.FL)(r)}async function A(){n.id||await Promise.all([t.e(7632),t.e(6408),t.e(7824),t.e(9466),t.e(5482),t.e(148),t.e(8050)]).then(t.bind(t,50148))}function O(e){return q.some(r=>r.test(e))}function k(e,r){let t;try{t=(new DOMParser).parseFromString(e,r)}catch{}if(!t||t.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return t}async function L(e,r,t){if(e.redoRequest)return e.redoRequest=!1,!1;const s=e.parameters.requestOptions;if(!r||"native"===s.responseType||"native-request-init"===s.responseType)return!0;let o,a;if(t&&(t.error&&"object"==typeof t.error?o=t.error:"error"===t.status&&Array.isArray(t.messages)&&(o={...t},o[U]=t,o.details=t.messages)),!o&&!r.ok)throw o=new Error(`Unable to load ${r.url} status: ${r.status}`),o[U]=t,o;let i,l=null;o&&(a=Number(o.code),l=o.hasOwnProperty("subcode")?Number(o.subcode):null,i=o.messageCode,i=i?.toUpperCase());const u=s.authMode;if(403===a&&(4===l||o.message?.toLowerCase().includes("ssl")&&!o.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===a)&&void 0!==a&&g.has(a)&&!O(e.parameters.url)&&(403!==a||(!i||!v.has(i))&&(null==l||2===l&&e.credentialToken))){await A();try{const r=await n.id.getCredential(e.parameters.url,{error:x("request:server",o,e.parameters),credential:e.credential,prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=r,e.credentialToken=r.token,e.useSSL=e.useSSL||r.ssl,!1}catch(r){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;o=r}}if(o)throw o;return!0}function x(e,r,t,s){let n;const a={url:t.url,requestOptions:t.requestOptions,getAllHeaders:E,getHeader:E,ssl:!1};if(r instanceof o.A)return r.details?(r.details=(0,i.o8)(r.details),r.details.url=t.url,r.details.requestOptions=t.requestOptions):r.details=a,r;if(r){const e=s&&(()=>Array.from(s.headers)),t=s&&(e=>s.headers.get(e)),o=s?.status,i=r.message;i&&(n=i),e&&t&&(a.getAllHeaders=e,a.getHeader=t),a.httpStatus=(null!=r.httpCode?r.httpCode:r.code)||o||0,a.subCode=r.subcode,a.messageCode=r.messageCode,"string"==typeof r.details?(a.messages=[r.details],n??=r.details):(a.messages=r.details,n??=a.messages?.[0]),a.raw=U in r?r[U]:r}return n??="Error",(0,l.zf)(r)?(0,l.NK)():new o.A(e,n,a)}const U=Symbol(),E=()=>null,P="Timeout exceeded";function $(e){return"object"==typeof e&&!!e&&"message"in e&&e.message===P}}}]);
|