@arcgis/core 5.2.0-next.164 → 5.2.0-next.165
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/Graphic.d.ts +47 -14
- package/PopupTemplate.js +1 -1
- package/WebScene.d.ts +3 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{97d6ef9e34a43ad2e556.js → 02e10f44edf911832c2a.js} +1 -1
- package/assets/esri/core/workers/chunks/{97b5f4302fb867c829f4.js → 07f7177bfaf9de73bc25.js} +1 -1
- package/assets/esri/core/workers/chunks/{612345f17f5eeb99ea8f.js → 0d9c4c6c571ce26d356b.js} +1 -1
- package/assets/esri/core/workers/chunks/{12a7997a40c77f5c9160.js → 151e5799ede763a03ee2.js} +1 -1
- package/assets/esri/core/workers/chunks/196979cc6a765be3c5cd.js +1 -0
- package/assets/esri/core/workers/chunks/1ab59a97ffa49e9e1659.js +1 -0
- package/assets/esri/core/workers/chunks/{8715661a838361d4211a.js → 1b24a40c0fa197014873.js} +1 -1
- package/assets/esri/core/workers/chunks/{83f29a159b8b5197e76a.js → 266c90d8d56a2da42fcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1d989b72203113a06fe.js → 2a36fe3f3f257a779a1b.js} +1 -1
- package/assets/esri/core/workers/chunks/{fcaf9450642fcef83286.js → 3048e74e6246324ce6fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{95b82cbbe355266c65d7.js → 30af63b3b750142faadb.js} +1 -1
- package/assets/esri/core/workers/chunks/{74137ffec5265628c33b.js → 36c780a9527c75b36725.js} +1 -1
- package/assets/esri/core/workers/chunks/{6a0ec102962d2c7b4368.js → 40d803584eeade4df433.js} +1 -1
- package/assets/esri/core/workers/chunks/{a546ec82ba149e12f7bf.js → 41773d858e212468db88.js} +1 -1
- package/assets/esri/core/workers/chunks/{129e04d24ced77c9bb6d.js → 49b967d89d2841cea675.js} +1 -1
- package/assets/esri/core/workers/chunks/{b59aaf30c7fe2c8d1aaa.js → 4b99b4cf729881e616bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{a09d2e1e2540921e4717.js → 4d3d7ec407ee5cd5f036.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c626f525f3483c03477.js → 548b8f74a6883e364931.js} +1 -1
- package/assets/esri/core/workers/chunks/{25a3bd8bede2d07d3a54.js → 5af8fb4ec2c72697e35b.js} +1 -1
- package/assets/esri/core/workers/chunks/{340256866f524cb069f6.js → 5d2f043ebe1051326c56.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f46acfda693c70abbdd.js → 61552b4b8111a8624d84.js} +1 -1
- package/assets/esri/core/workers/chunks/{e653c81ffb3d818645dd.js → 632fdf1d95ad69109427.js} +1 -1
- package/assets/esri/core/workers/chunks/{434a8ba841a59e0deab9.js → 67e533748435253aaba6.js} +1 -1
- package/assets/esri/core/workers/chunks/69d5f8ef78b9b8b3d33d.js +1 -0
- package/assets/esri/core/workers/chunks/{feb41abc03d677df6f73.js → 6b9961261241fdce0e94.js} +1 -1
- package/assets/esri/core/workers/chunks/6f897b4e7ddd1dd1672b.js +1 -0
- package/assets/esri/core/workers/chunks/{e251921bc5367258c4d2.js → 710b8251a59884aee31e.js} +1 -1
- package/assets/esri/core/workers/chunks/{af349c7bc8ef41a0e1bd.js → 7748c2886d0122b40eeb.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a7b02037151767542f1.js → 7dbf4c7480bf9c72820d.js} +1 -1
- package/assets/esri/core/workers/chunks/{1bca39e0e651426bdbb5.js → 7dfbc31f3b56728485a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{c19f238b55ff2893f7c2.js → 82a022cc21364c9a8539.js} +1 -1
- package/assets/esri/core/workers/chunks/{5cb26bbaa08114aec5ce.js → 89cc1a5539b82fb46216.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ab57cb1bfd3dc8d3c2a.js → 8b8118ab56cc808b5a71.js} +1 -1
- package/assets/esri/core/workers/chunks/{542e5640ea1b80ef801a.js → 9189dfe19a2a2ccd5173.js} +1 -1
- package/assets/esri/core/workers/chunks/{f74ae0eff3f08978e607.js → 9f358c7b052cdc0ac06f.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee08ae5b73439a1ff666.js → a163c6005aba3378edaa.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec9a2425b4a498054a19.js → a17673e691ced46a90d3.js} +1 -1
- package/assets/esri/core/workers/chunks/{72bd866df89b8d92e247.js → a43b33955aa78a2a8deb.js} +1 -1
- package/assets/esri/core/workers/chunks/{46c5371c7a627537098c.js → a88f346786b04bd194dc.js} +6 -6
- package/assets/esri/core/workers/chunks/{092e311cb7aea92a6a26.js → acb265a22be5e12f38e5.js} +1 -1
- package/assets/esri/core/workers/chunks/{9e8f012a56237fc8285f.js → aea44253c80493ef5755.js} +1 -1
- package/assets/esri/core/workers/chunks/b5b9d42e1f84ee82429c.js +1 -0
- package/assets/esri/core/workers/chunks/c046c4fc934bc6f54c69.js +1 -0
- package/assets/esri/core/workers/chunks/{c72a904e01dc8c17d992.js → c47d095434d09b5f10c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{226f862bbeb33fc7c597.js → c4b7111dcedd9d6e1c2a.js} +1 -1
- package/assets/esri/core/workers/chunks/{81cad8d2f62a5f671c55.js → cb4db5489388559d6bd9.js} +1 -1
- package/assets/esri/core/workers/chunks/{bbd44ac63d2a317d8ed9.js → cc794bb94ebc1cb66024.js} +1 -1
- package/assets/esri/core/workers/chunks/{be308db5b61a7246edfe.js → cc94bf05b235e65291fc.js} +1 -1
- package/assets/esri/core/workers/chunks/d4af9faa5d901274fad2.js +1 -0
- package/assets/esri/core/workers/chunks/{fc5a36e54929e03efa86.js → dba5f44c4e4a3f075df2.js} +1 -1
- package/assets/esri/core/workers/chunks/{1f43e06dcfe56229bb0f.js → debe45e792212682b304.js} +1 -1
- package/assets/esri/core/workers/chunks/{8414ffd937c1099e0bbc.js → e6d10136bc08aef255ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{45fd2b456a6997584ca1.js → f8379cd45f750f28a3d8.js} +1 -1
- package/assets/esri/core/workers/chunks/{709e019885822b1f6f3e.js → f905f1a1aa4c123cbe83.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2fcbc494333376192aa.js → f9c80e9fc349db4873e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{c070d2ddf290b4f92916.js → feb4f8c807bb0dca488f.js} +1 -1
- package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
- package/chunks/GlobalIllumination.glsl.js +15 -30
- package/config.js +1 -1
- package/core/workers/WorkerFallback.js +4 -2
- package/core/workers/workerFactory.js +1 -1
- package/core/workers/workers.js +4 -2
- package/form/elements/inputs.d.ts +126 -25
- package/form/elements/inputs.js +1 -1
- package/form/elements.d.ts +1 -0
- package/graphic/AnnotationFeatureGraphicOrigin.d.ts +49 -9
- package/graphic/BuildingGraphicOrigin.d.ts +49 -0
- package/graphic/CSVGraphicOrigin.d.ts +42 -9
- package/graphic/CatalogGraphicOrigin.d.ts +42 -9
- package/graphic/DimensionFeatureGraphicOrigin.d.ts +42 -9
- package/graphic/FeatureGraphicOrigin.d.ts +42 -9
- package/graphic/GeoJSONGraphicOrigin.d.ts +42 -9
- package/graphic/GeoRSSGraphicOrigin.d.ts +42 -9
- package/graphic/GraphicOrigin.d.ts +52 -12
- package/graphic/ImageryGraphicOrigin.d.ts +42 -9
- package/graphic/ImageryTileGraphicOrigin.d.ts +42 -9
- package/graphic/KMLGraphicOrigin.d.ts +47 -10
- package/graphic/KnowledgeGraphGraphicOrigin.d.ts +49 -1
- package/graphic/LinkChartGraphicOrigin.d.ts +49 -1
- package/graphic/MapImageGraphicOrigin.d.ts +49 -1
- package/graphic/MapNotesGraphicOrigin.d.ts +48 -1
- package/graphic/OGCFeatureGraphicOrigin.d.ts +42 -9
- package/graphic/OrientedImageryGraphicOrigin.d.ts +42 -9
- package/graphic/ParquetGraphicOrigin.d.ts +42 -9
- package/graphic/PointCloudGraphicOrigin.d.ts +43 -0
- package/graphic/SceneGraphicOrigin.d.ts +43 -0
- package/graphic/SketchGraphicOrigin.d.ts +43 -0
- package/graphic/StreamGraphicOrigin.d.ts +43 -0
- package/graphic/SubtypeGroupGraphicOrigin.d.ts +49 -1
- package/graphic/TileGraphicOrigin.d.ts +49 -1
- package/graphic/VectorTileGraphicOrigin.d.ts +43 -14
- package/graphic/VoxelGraphicOrigin.d.ts +43 -0
- package/graphic/WCSGraphicOrigin.d.ts +43 -0
- package/graphic/WFSGraphicOrigin.d.ts +42 -9
- package/graphic/getGraphicOriginTitle.d.ts +21 -3
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.d.ts +2 -1
- package/layers/ParquetLayer.d.ts +24 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/mixins/ReloadableLayer.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/save/mapImageLayerUtils.js +1 -1
- package/layers/save/mediaLayerUtils.js +1 -1
- package/layers/save/parquetLayerUtils.js +2 -0
- package/layers/save/streamLayerUtils.js +1 -1
- package/layers/support/LabelClass.d.ts +8 -2
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/layersMapping.js +1 -1
- package/package.json +2 -2
- package/popup/content.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/webScene.js +1 -1
- package/tables/elements.d.ts +1 -0
- package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +5 -5
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/worldSizedRibbonLineIntersectionUtils.js +1 -1
- package/views/selection/SelectionOperation.js +1 -1
- package/views/selection/types.d.ts +43 -3
- package/views/support/layerViewUtils.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/OrientedImageryViewer/ImageMeasurementWorker.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +6 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +6 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +8 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/1fe24ffcd88280d84fbe.js +0 -1
- package/assets/esri/core/workers/chunks/72071ea5de89720fbe42.js +0 -1
- package/assets/esri/core/workers/chunks/9de5ad77bc37ec142218.js +0 -1
- package/assets/esri/core/workers/chunks/b736046c6b4ede73ea46.js +0 -1
- package/assets/esri/core/workers/chunks/c19cd5a03b6d480fe53b.js +0 -1
- package/assets/esri/core/workers/chunks/d1f98c5249c487eb96f1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8197],{4341(e,t,r){r.d(t,{I:()=>a});var i=r(26390);class a{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){let e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*s);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,s));e++)this._items.push(this._allocator())}}const s=1024},11964(e,t,r){r.d(t,{Cr:()=>u,H6:()=>d,LV:()=>h,_I:()=>m,kb:()=>c,vt:()=>l});var i=r(34727),a=r(4341),s=r(35522),n=r(51850),o=r(32114);function l(e){return e?{origin:(0,n.o8)(e.origin),vector:(0,n.o8)(e.vector)}:{origin:(0,n.vt)(),vector:(0,n.vt)()}}function h(e,t){let r=p.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,s.C)(r.origin,e),(0,s.Re)(r.vector,t,e),r}function c(e,t){let r=(0,s.Re)(o.rq.get(),t,e.origin),a=(0,s.Om)(e.vector,r),n=(0,s.Om)(e.vector,e.vector);if(Math.abs(n)<_)return(0,s.hG)(e.origin,t);let l=(0,i.qE)(a/n,0,1),h=(0,s.Re)(o.rq.get(),(0,s.hs)(o.rq.get(),e.vector,l),r);return(0,s.Om)(h,h)}function m(e,t,r){return d(e,t,0,1,r)}function d(e,t,r,a,n){let{vector:l,origin:h}=e,u=(0,s.Re)(o.rq.get(),t,h),c=(0,s.Om)(l,u)/(0,s.m3)(l);return(0,s.hs)(n,l,(0,i.qE)(c,r,a)),(0,s.WQ)(n,n,e.origin)}(0,n.vt)(),(0,n.vt)();const p=new a.I(()=>l()),_=1e-9},80754(e,t,r){r.d(t,{kS:()=>h,kd:()=>l});var i=r(82799),a=r(16930),s=r(60408),n=r(52006);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:a.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:a.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function h(e,t){if((0,n.Ed)(e))for(let r of function(e){return(0,s.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of r){if((0,n.aO)(e)){let[r,i]=e.c;r[0]+=t,i[0]+=t;continue}if((0,n.FG)(e)){let[r,i]=e.a;r[0]+=t,i[0]+=t;continue}if((0,n.n1)(e)){let[r,i,a]=e.b;r[0]+=t,i[0]+=t,a[0]+=t;continue}e[0]+=t}for(let r of function(e){return(0,s.Bi)(e)?e.rings:e.paths}(e))for(let e of r)e[0]+=t;return e}r.d(t,["j7",0,o])},71351(e,t,r){r.d(t,{C:()=>c,Cr:()=>m,LV:()=>u,fA:()=>d,kb:()=>p,vt:()=>l});var i=r(4341),a=(r(77690),r(29242)),s=r(35522),n=r(51850),o=r(32114);function l(e){return e?h((0,n.o8)(e.origin),(0,n.o8)(e.direction)):h((0,n.vt)(),(0,n.vt)())}function h(e,t){return{origin:e,direction:t}}function u(e,t){let r=_.get();return r.origin=e,r.direction=t,r}function c(e,t=l()){return d(e.origin,e.direction,t)}function m(e,t,r=l()){return(0,s.C)(r.origin,e),(0,s.Re)(r.direction,t,e),r}function d(e,t,r=l()){return(0,s.C)(r.origin,e),(0,s.C)(r.direction,t),r}function p(e,t){let r=(0,s.$A)(o.rq.get(),(0,s.S8)(o.rq.get(),e.direction),(0,s.Re)(o.rq.get(),t,e.origin));return(0,s.Om)(r,r)}const _=new i.I(()=>l());(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,a.vt)()},94008(e,t,r){r.d(t,{iy:()=>d}),r(44208),r(53966);var i=r(34727),a=r(34304),s=r(58083),n=r(35522),o=r(51850),l=r(91829),h=r(34275);var u=r(71351),c=r(44280),m=r(32114);class d{constructor(e=0,t=0,r=0,i=0){this.radius=i,"number"==typeof e?this._center=(0,o.fA)(e,t,r):function(e){return t=e,(0,h.vZ)(t)&&t.length>=3||function(e){return((0,h.aI)(e)||Array.isArray(e))&&e.length>=3}(e);var t}(e)||function(e){return(t=e)instanceof Float32Array&&t.length>=4||function(e){return Array.isArray(e)&&e.length>=4}(e);var t}(e)?(this._center=(0,o.ci)(e),this.radius=4===e.length?e[3]:t):(this._center=(0,o.o8)(e.center),this.radius=e.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(e){(0,n.C)(this.center,e)}exactEquals(e){return(0,n.aI)(this._center,e.center)&&this.radius===e.radius}copyFrom(e){return e!==this&&((0,n.C)(this._center,e.center),this.radius=e.radius),this}clone(){return new d(this.center,this.radius)}toVec4(){return(0,l.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(e){return(0,n.hG)(this.center,e)<=this.radius**2}intersects(e){let t=this.radius+e.radius;return(0,n.hG)(this.center,e.center)<=t*t}intersectRay(e,t){if(null==e||!this._intersect(e,p))return!1;let{t0:r,t1:i}=p;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(t){let{origin:i,direction:a}=e;t[0]=i[0]+a[0]*r,t[1]=i[1]+a[1]*r,t[2]=i[2]+a[2]*r}return!0}intersectLine(e,t){let r=(0,u.Cr)(e,t);if(!this._intersect(r,p))return[];let{origin:i,direction:s}=r,{t0:l,t1:h}=p,c=e=>{let t=(0,o.vt)();return(0,n.Ln)(t,i,s,e),this.projectPoint(t,t)};return Math.abs(l-h)<(0,a.FD)()?[c(l)]:[c(l),c(h)]}_intersect(e,t){let{origin:r,direction:i}=e,a=_;a[0]=r[0]-this.center[0],a[1]=r[1]-this.center[1],a[2]=r[2]-this.center[2];let s=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===s)return!1;let n=2*(i[0]*a[0]+i[1]*a[1]+i[2]*a[2]),o=n*n-4*s*(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-this.radius**2);if(o<0)return!1;let l=Math.sqrt(o);return t.t0=(-n-l)/(2*s),t.t1=(-n+l)/(2*s),!0}projectPoint(e,t){let r=(0,n.Re)(m.rq.get(),e,this.center),i=(0,n.hs)(m.rq.get(),r,this.radius/(0,n.Bw)(r));return(0,n.WQ)(t,i,this.center)}closestPointOnSilhouette(e,t){let r=m.rq.get(),i=m.Rc.get();(0,n.$A)(r,e.origin,e.direction),(0,n.$A)(t,r,e.origin),(0,n.hs)(t,t,1/(0,n.Bw)(t)*this.radius);let a=this._angleToSilhouette(e.origin),o=(0,c.g7)(e.origin,t);return(0,s.$0)(i,o+a,r),(0,n.Z0)(t,t,i),t}frustumCoverage(e,t,r){let i=this.radius,a=i*i,s=e+.5*Math.PI,n=t*t+a-2*Math.cos(s)*t*i,o=Math.sqrt(n),l=n-a;if(l<=0)return.5;let h=Math.acos(Math.sqrt(l)/o)-Math.asin(i/(o/Math.sin(s)));return Math.min(1,(h+.5*r)/r)}_angleToSilhouette(e){let t=(0,n.Re)(m.rq.get(),e,this.center),r=(0,n.Bw)(t),a=this.radius,s=a+Math.abs(a-r);return(0,i.XM)(a/s)}union(e){let t=(0,n.Io)(this._center,e.center),r=this.radius,i=e.radius;return t+i<r?this:t+r<i?(this.copyFrom(e),this):((0,n.Cc)(this._center,this._center,e.center,(t+i-r)/(2*t)),this.radius=(t+r+i)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(e){let{center:t,radius:r}=this,i=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3];return i<0?Math.min(i+r,0):Math.max(i-r,0)}}new d;const p={t0:0,t1:0},_=(0,o.vt)();(0,o.vt)(),(0,o.vt)()},38969(e,t,r){r.d(t,{i:()=>a});var i=r(37955);function a(e,t){return new Promise((r,a)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",a)))})}},31217(e,t,r){r.d(t,{D:()=>a});var i=r(56507);async function a(e,t){return(await(0,i.A)(e,{responseType:"image",...t})).data}},46859(e,t,r){r.d(t,{h:()=>L});var i=r(49186),a=r(65529),s=r(97768),n=r(17676),o=r(34275),l=r(24326),h=r(84952),u=r(38969),c=r(31217),m=r(95117),d=r(53966),p=r(2741);let _;var g=r(63907),f=r(21231),T=r(42293);const x=()=>d.A.getLogger("esri.views.3d.webgl-engine.lib.BasisUtil");let E=null,A=null;async function M(){return A??(_??=(async()=>{let e=await(await r.e(9321).then(()=>r(49321))).default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return e.initializeBasis(),e})(),A=_,E=await A),A}function R(e,t,r,i,a){let s=(0,T.MW)(t?g.CQ.COMPRESSED_RGBA8_ETC2_EAC:g.CQ.COMPRESSED_RGB8_ETC2),n=a&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*s*n)}function w(e){return e.getNumImages()>=1&&!e.isUASTC()}function b(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function C(e,t,r,i,a,s,n,o,l=!1){let{compressedTextureETC:h,compressedTextureS3TC:u}=e.capabilities,{basisFormat:c,internalFormat:m}=function(e,t,r,i){return e?r?{basisFormat:1,internalFormat:i?g.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:g.CQ.COMPRESSED_RGBA8_ETC2_EAC}:{basisFormat:0,internalFormat:i?g.CQ.COMPRESSED_SRGB8_ETC2:g.CQ.COMPRESSED_RGB8_ETC2}:t?r?{basisFormat:3,internalFormat:g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{basisFormat:2,internalFormat:g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT}:{basisFormat:13,internalFormat:i?g.H0.SRGB8_ALPHA8:6408}}(null!=h,null!=u,i,l),d=t.hasMipmap?r:Math.min(1,r),p=[];for(let e=0;e<d;e++)p.push(new Uint8Array(n(e,c))),o(e,c,p[e]);return t.internalFormat=m,t.hasMipmap=p.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=a,t.height=s,new f.A(e,t,{type:"compressed",levels:p})}function D(e,t){let r=new Uint32Array(e.buffer,e.byteOffset,16);if(1481919403!==r[0]||3140563232!==r[1]||169478669!==r[2])return x().error("Invalid magic number in KTX1 header"),null;if(67305985!==r[3]||1!==r[5]||r[7]!==g.CQ.COMPRESSED_RGB8_ETC2||6407!==r[8])return x().error("Unsupported KTX1 image"),null;let i=r[7],a=1,s=r[9],n=r[10];if(3&s||3&n)return null;let o=s,l=n;!1!==t&&(a=Math.max(1,r[14]));let h,u,c=e.byteOffset+64,m=[];for(let t=0;t<a;++t)u=(e[c]|e[c+1]<<8|e[c+2]<<16|e[c+3]<<24)>>>0,c+=4,h=new Uint8Array(e.buffer,c,u),m.push(h),c+=u,s=Math.max(1,s>>1),n=Math.max(1,n>>1);return{textureData:{type:"compressed",levels:m},internalFormat:i,width:o,height:l}}const S=()=>d.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function F(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const y=F("DXT1"),I=F("DXT3"),v=F("DXT5");function P(e,t){let r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return S().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return S().error("Unsupported format, must contain a FourCC code"),null;let i,a,s=r[21];switch(s){case y:i=8,a=g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case I:i=16,a=g.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case v:i=16,a=g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return S().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(s)),null}let n=1,o=r[4],l=r[3];(3&o||3&l)&&(S().warn("Rounding up compressed texture size to nearest multiple of 4."),o=o+3&-4,l=l+3&-4);let h=o,u=l;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let c,m,d=e.byteOffset+r[1]+4,p=[];for(let t=0;t<n;++t)m=(o+3>>2)*(l+3>>2)*i,c=new Uint8Array(e.buffer,d,m),p.push(c),d+=m,o=Math.max(1,o>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:a,width:h,height:u}}function H(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function U(e,t){let[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){let a=Math.max(e,t),s=e*t;if(a<=i&&s<=r)return[e,t];let n=Math.min(Math.sqrt(r/s),i/a);return[H(Math.round(e*n),i),H(Math.round(t*n),i)]}(e,t);return e.width===r&&e.height===i?e:O(e,r,i)}function O(e,t,r){if(e instanceof ImageData)return O(function(e){let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);let a=document.createElement("canvas");return a.width=t,a.height=r,a.getContext("2d").drawImage(e,0,0,a.width,a.height),a}var G=r(620),B=r(67171),N=r(12541);class L{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new a.bk,this._parameters={...W,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!(0,h.w8)(e.src)&&("auto"!==e.preload||!e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){let t=[];(0,u.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){!(0,h.DB)(e.src)&&!(0,h.w8)(e.src)&&!e.crossOrigin&&(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){let t=new B.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=!0===this._parameters.immutable&&function(e){return null!=e&&((0,N.tl)(e)||(0,N.tr)(e)||(0,N.CR)(e)||(0,N.QJ)(e))}(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,o.mw)(e)||(0,o.mg)(e))return"image/ktx2"===t.encoding?function(e,t){if(null==E)return e.byteLength;let r=new E.KTX2File(new Uint8Array(e)),i=b(r)?R(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):"image/x.basis"===t.encoding?function(e,t){if(null==E)return e.byteLength;let r=new E.BasisFile(new Uint8Array(e)),i=w(r)?R(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;let{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?X(e):t,a=t.pixelFormat??6408,s=(0,T.wH)(a);return(t.mipmap?4/3:1)*r*i*s||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;let t=this._data;return null==t?(this._texture=new f.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,o.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,o.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):(0,o.mg)(t)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(e,t):(0,o.mw)(t)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(e,new Uint8Array(t)):((0,o.mw)(t)||(0,o.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,o.mw)(t)||(0,o.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,o.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,o.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){let i=P(r,t.hasMipmap??!1);if(null==i)throw Error("DDS texture data is null");let{textureData:a,internalFormat:s,width:n,height:o}=i;return t.samplingMode=a.levels.length>1?9987:9729,t.hasMipmap=a.levels.length>1,t.internalFormat=s,t.width=n,t.height=o,new f.A(e,t,a)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX1(e,t){return this._texture=function(e,t,r){let i=D(r,t.hasMipmap??!1);if(null==i)throw Error("KTX1 texture data is null");let{textureData:a,internalFormat:s,width:n,height:o}=i;return t.samplingMode=a.levels.length>1?9987:9729,t.hasMipmap=a.levels.length>1,t.internalFormat=s,t.width=n,t.height=o,new f.A(e,t,a)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r,i=!1){E??=await M();let a=new E.KTX2File(new Uint8Array(r));if(!b(a))return null;let s=i&&2===a.getDFDTransferFunc();a.startTranscoding();let n=C(e,t,a.getLevels(),a.getHasAlpha(),a.getWidth(),a.getHeight(),(e,t)=>a.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>a.transcodeImage(r,e,0,0,t,0,-1,-1),s);return a.close(),a.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){E??=await M();let i=new E.BasisFile(new Uint8Array(r));if(!w(i))return null;i.startTranscoding();let a=C(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),a}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,G.vA)(this._parameters.width>0&&this._parameters.height>0);let r=this._createDescriptor(e);return(6407===r.pixelFormat||6408===r.pixelFormat)&&(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new f.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{let i=await(0,c.D)(t,{signal:r});return(0,n.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{let i=await(0,m.y)(t,t.src,!1,r);return(0,n.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((a,o)=>{let l=()=>{t.removeEventListener("loadeddata",h),t.removeEventListener("error",u),(0,s.xt)(c)},h=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),a(this._loadFromImage(e,t)))},u=e=>{l(),o(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",h),t.addEventListener("error",u);let c=(0,n.u7)(r,()=>u((0,n.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=U(r,e.parameters));let i=X(r);this._parameters.width=i.width,this._parameters.height=i.height;let a=this._createDescriptor(e);return a.width=i.width,a.height=i.height,a.compress=this._parameters.compressionOptions,this._texture=new f.A(e,a,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){let t=new AbortController;this._loadingController=t;let r=e(t.signal);this._loadingPromise=r;let i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){let e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function X(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const W={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},58682(e,t,r){r.d(t,{Uy:()=>l,h7:()=>m});var i=r(35522),a=r(51850),s=r(70328);class n{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const o=(0,s.vt)();function l(e,t,r,a,s,o){if(!e.visible)return;let l=(0,i.jb)(M,a,r),{tolerance:h}=t,c=new n(h,!1,t.options.normalRequired);if(e.boundingInfo)u(e.readPrimitivePosition,e.boundingInfo,r,l,h,s,c,o);else{let t=e.readPrimitivePosition;!function(e,t,r,a,s,n,o,l){let h=t,u=R,c=Math.abs(h[0]),m=Math.abs(h[1]),d=Math.abs(h[2]),f=c>=m?c>=d?0:2:m>=d?1:2,x=f,E=h[x]<0?2:1,A=(f+E)%3,M=(f+(3-E))%3,w=h[A]/h[x],b=h[M]/h[x],C=1/h[x],D=p,S=_,F=g,{normalRequired:y}=o;for(let t=r;t<a;++t){let r=3*t;s(u[0],r),s(u[1],r+1),s(u[2],r+2),n&&(n.applyToVertex(u[0],u[0][0],u[0][1],u[0][2],t),n.applyToVertex(u[1],u[1][0],u[1][1],u[1][2],t),n.applyToVertex(u[2],u[2][0],u[2][1],u[2][2],t)),(0,i.jb)(D,u[0],e),(0,i.jb)(S,u[1],e),(0,i.jb)(F,u[2],e);let a=D[A]-w*D[x],o=D[M]-b*D[x],h=S[A]-w*S[x],c=S[M]-b*S[x],m=F[A]-w*F[x],d=F[M]-b*F[x],p=m*c-d*h,_=a*d-o*m,g=h*o-c*a;if((p<0||_<0||g<0)&&(p>0||_>0||g>0))continue;let f=p+_+g;if(0===f)continue;let E=p*(C*D[x])+_*(C*S[x])+g*(C*F[x]);if(E*Math.sign(f)<0)continue;let R=E/f;R>=0&&l(R,R,y?T(u):null,t)}}(r,l,0,e.faceCount,t,s,c,o)}}const h=(0,a.vt)();function u(e,t,r,a,n,l,c,m){if(null==t)return;let p=function(e,t){return(0,i.hZ)(t,1/e[0],1/e[1],1/e[2])}(a,h);if((0,s.C)(o,t.box),l?.applyToAabb(o),function(e,t,r,i){return function(e,t,r,i){let a=(e[0]-i-t[0])*r[0],s=(e[3]+i-t[0])*r[0],n=Math.min(a,s),o=Math.max(a,s),l=(e[1]-i-t[1])*r[1],h=(e[4]+i-t[1])*r[1];if(o=Math.min(o,Math.max(l,h)),o<0||(n=Math.max(n,Math.min(l,h)),n>o))return!1;let u=(e[2]-i-t[2])*r[2],c=(e[5]+i-t[2])*r[2];return o=Math.min(o,Math.max(u,c)),!(o<0||(n=Math.max(n,Math.min(u,c)),n>o))&&n<1/0}(e,t,r,i)}(o,r,p,n)){let{primitiveIndices:i}=t,s=i.length;if(s>1e3){let i=t.children;if(void 0!==i){for(let t of i)u(e,t,r,a,n,l,c,m);return}}d(r,a,0,s,e,i,l,c,m)}}const c=(0,a.vt)();function m(e,t,r,i,a,s,n,o,l,h=null,u=0){let m=e[0],d=e[1],p=e[2],_=t[0],g=t[1],T=t[2];for(let e=r;e<i;++e){let t=u+(h?.[e]??e),r=3*t,i=n*a[r],x=s[i],E=s[i+1],M=s[i+2],R=n*a[r+1],w=s[R],b=s[R+1],C=s[R+2],D=n*a[r+2],S=w-x,F=b-E,y=C-M,I=s[D]-x,v=s[D+1]-E,P=s[D+2]-M,H=g*P-v*T,U=T*I-P*_,O=_*v-I*g,G=S*H+F*U+y*O,B=G*G;if(B<=A)continue;let N=m-x,L=d-E,X=p-M,W=(N*H+L*U+X*O)*G;if(W<0||W>B)continue;let Q=L*y-F*X,V=X*S-y*N,k=N*F-S*L,q=(_*Q+g*V+T*k)*G;if(q<0||W+q>B)continue;let K=(I*Q+v*V+P*k)/G;K>=0&&l(K,K,o?f(S,F,y,I,v,P,c):null,t)}}function d(e,t,r,i,a,s,n,o,l){let h=e[0],u=e[1],m=e[2],d=t[0],p=t[1],_=t[2],{normalRequired:g}=o;for(let e=r;e<i;++e){let t=s[e],r=3*t,[i,o,T]=a(b,r),[x,E,M]=a(b,r+1),[R,C,D]=a(b,r+2);null!=n&&([i,o,T]=n.applyToVertex(w,i,o,T,e),[x,E,M]=n.applyToVertex(w,x,E,M,e),[R,C,D]=n.applyToVertex(w,R,C,D,e));let S=x-i,F=E-o,y=M-T,I=R-i,v=C-o,P=D-T,H=p*P-v*_,U=_*I-P*d,O=d*v-I*p,G=S*H+F*U+y*O,B=G*G;if(B<=A)continue;let N=h-i,L=u-o,X=m-T,W=(N*H+L*U+X*O)*G;if(W<0||W>B)continue;let Q=L*y-F*X,V=X*S-y*N,k=N*F-S*L,q=(d*Q+p*V+_*k)*G;if(q<0||W+q>B)continue;let K=(I*Q+v*V+P*k)/G;K>=0&&l(K,K,g?f(S,F,y,I,v,P,c):null,t)}}const p=(0,a.vt)(),_=(0,a.vt)(),g=(0,a.vt)();function f(e,t,r,a,s,n,o){return(0,i.hZ)(x,e,t,r),(0,i.hZ)(E,a,s,n),(0,i.$A)(o,x,E),(0,i.S8)(o,o),o}function T(e){return(0,i.jb)(x,e[1],e[0]),(0,i.jb)(E,e[2],e[0]),(0,i.$A)(c,x,E),(0,i.S8)(c,c),c}const x=(0,a.vt)(),E=(0,a.vt)(),A=1e-7*1e-7,M=(0,a.vt)(),R=[(0,a.vt)(),(0,a.vt)(),(0,a.vt)()],w=(0,a.vt)(),b=(0,a.vt)()},74810(e,t,r){r.d(t,{Jr:()=>s});var i=r(35522),a=r(51850);function s({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:s,emissiveTexture:n,emissiveFactor:o,occlusionTexture:l}){return null==e&&null==t&&null==n&&(null==o||(0,i.t2)(o,a.uY))&&null==l&&(null==s||1===s)&&(null==r||1===r)}const n=(0,a.CN)(1,1,.5),o=(0,a.CN)(0,.6,.2),l=(0,a.CN)(0,1,.2);r.d(t,["Bt",0,o,"SY",0,l,"mb",0,n])},21231(e,t,r){r.d(t,{A:()=>g});var i=r(49186),a=r(44208),s=r(53966),n=r(97768),o=r(93637),l=r(17676),h=r(94656),u=r(63907),c=r(67171),m=r(12541);class d extends c.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R32F:case u.H0.R8_SNORM:case u.H0.R8:this.pixelFormat=6403;break;case u.H0.R8I:case u.H0.R8UI:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32I:case u.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new d(e,t)}}const p=!!(0,a.A)("esri-tests-disable-gpu-memory-measurements"),_=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{let r=d.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return p?0:(0,c.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(u.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){let r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!(0,m.Qp)(e)&&this._descriptor.internalFormat&&(0,o.a4)(u.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!(0,m.Qp)(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,a,s,n,o=0){n||_().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||_().error("An attempt to update uninitialized texture!");let l=this._descriptor;l.internalFormat=(0,m.mq)(l);let{context:h,pixelFormat:u,dataType:c,target:d,isImmutable:p}=l;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");let f=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+a>l.width||r+s>l.height)&&_().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();let{gl:T}=h;o&&((!a||!s)&&_().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,o)),(0,m.Kv)(n)?T.texSubImage2D(d,e,t,r,a,s,u,c,n):(0,m.Qp)(n)?T.compressedTexSubImage2D(d,e,t,r,a,s,l.internalFormat,n.levels[e]):T.texSubImage2D(d,e,t,r,a,s,u,c,n),o&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),h.bindTexture(f,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,a,s,n,o,l){l||_().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||_().error("An attempt to update an uninitialized texture!");let h=this._descriptor;h.internalFormat=(0,m.mq)(h);let{context:u,pixelFormat:c,dataType:d,isImmutable:p,target:f}=h;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,m.re)(f)||_().warn("Attempting to set 3D texture data on a non-3D texture");let T=u.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||a<0||t+s>h.width||r+n>h.height||a+o>h.depth)&&_().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();let{gl:x}=u;if((0,m.Qp)(l))l=l.levels[e],x.compressedTexSubImage3D(f,e,t,r,a,s,n,o,h.internalFormat,l);else{let i=l;x.texSubImage3D(f,e,t,r,a,s,n,o,c,d,i)}u.bindTexture(T,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){let e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,(0,m.QE)(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);let t=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){let e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,(0,m.QE)(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,(0,m.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),(0,m.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&=(this._applySamplingMode(),!1),this._wrapModeDirty&&=(this._applyWrapMode(),!1),this._shadowFilterDirty&&=(this._applyShadowMode(),!1)}abortCompression(){this._compressionAbortController=(0,n.DC)(this._compressionAbortController)}_setData(e,t){let r=this._descriptor,a=r.context?.gl;if(!a)return;(0,h.Y2)(a),this.hasWebGLTextureObject||(this._glName=a.createTexture(),r.context.instanceCounter.increment(u.vt.Texture,this)),(0,m.QE)(r);let s=r.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(a);let n=t??r.target,o=(0,m.re)(n);if((0,m.Kv)(e))this._setDataFromTexImageSource(e,n);else{let{width:t,height:s,depth:l}=r;if(null==t||null==s)throw new i.A("texture:missing-size","Width and height must be specified!");if(o&&null==l)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=(0,m.mq)(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,r.internalFormat,r.hasMipmap,t,s,l),(0,m.Qp)(e)){if(!(0,m.tl)(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,n)}else this._texImage(n,0,r.internalFormat,t,s,l,e),(0,h.Y2)(a),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(a),r.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){let e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,+!!r),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,+!!i)}_setDataFromTexImageSource(e,t){let{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=(0,m.mq)(i);let a=(0,m.re)(t),{width:s,height:n,depth:o}=(0,m.Eo)(e);i.width&&i.height,i.width||=s,i.height||=n,a&&i.depth,a&&(i.depth=o),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,s,n,o),this._texImage(t,0,i.internalFormat,s,n,o,e),(0,h.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(r))}_setDataFromCompressedSource(e,t,r){let i=this._descriptor,{width:a,height:s,depth:n}=i,o=e.levels,l=(0,m.FV)(r,a,s,n),h=Math.min(l,o.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,h),this._forEachMipmapLevel((e,i,a,s)=>{let n=o[Math.min(e,o.length-1)];this._compressedTexImage(r,e,t,i,a,s,n)},h)}_texStorage(e,t,r,a,s,n){let{gl:o}=this._descriptor.context;if(!(0,m.tr)(t)&&!(0,m.tl)(t))throw new i.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;let l=r?(0,m.FV)(e,a,s,n):1;if((0,m.re)(e)){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");o.texStorage3D(e,l,t,a,s,n)}else o.texStorage2D(e,l,t,a,s);this._wasImmutablyAllocated=!0}_texImage(e,t,r,a,s,n,o){let l=this._descriptor.context.gl,h=(0,m.re)(e),{isImmutable:u,pixelFormat:c,dataType:d}=this._descriptor;if(u){if(null!=o){let r=o;if(h){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,a,s,n,c,d,r)}else l.texSubImage2D(e,t,0,0,a,s,c,d,r)}}else{let u=o;if(h){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,a,s,n,0,c,d,u)}else l.texImage2D(e,t,r,a,s,0,c,d,u)}}_compressedTexImage(e,t,r,a,s,n,o){let l=this._descriptor.context.gl,h=(0,m.re)(e);if(this._descriptor.isImmutable){if(null!=o)if(h){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,a,s,n,r,o)}else l.compressedTexSubImage2D(e,t,0,0,a,s,r,o)}else if(h){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,a,s,n,0,o)}else l.compressedTexImage2D(e,t,r,a,s,0,o)}async _compressOnWorker(e){let{width:t,height:r,context:i,flipped:a,preMultiplyAlpha:s,hasMipmap:n,compress:o}=this._descriptor;if(!o)return;let{compressionTracker:h,compressionCallback:u,preserveSourceBitmap:c}=o,{compressedTextureETC:m,compressedTextureS3TC:d}=i.capabilities;if(!g.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!m&&!d)return;this.abortCompression();let p=new AbortController;this._compressionAbortController=p,h?.increment();let f,T=!1,x=!1;try{e instanceof ImageBitmap?c?(f=await createImageBitmap(e),(0,l.Te)(p),x=!0):f=e:e instanceof Uint8Array?(f=e.buffer,T=this.descriptor.flipped):(f=await createImageBitmap(e,{imageOrientation:a?"flipY":"none"}),(0,l.Te)(p),x=!0);let i={data:f,width:t,height:r,needsFlip:T,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,isOpaque:this._descriptor.isOpaque,hasMipmap:n,hasETC:!!m,hasS3TC:!!d},o=await g.compressionWorkerHandle.invoke(i,p.signal,1);if((0,l.Te)(p),o.compressedTexture&&this.hasWebGLTextureObject){let e=this.usedMemory;this._descriptor.internalFormat=o.internalFormat,this._setData(o.compressedTexture),u?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||_().error("Texture compression failed!")}finally{h?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),x&&f instanceof ImageBitmap&&f.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:a,depth:s,hasMipmap:n,target:o}=this._descriptor,l=32879===o;if(null==r||null==a||l&&null==s)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,a,s),n&&(1!==r||1!==a||l&&1!==s)&&!(i>=t);++i)r=Math.max(1,r>>1),a=Math.max(1,a>>1),l&&(s=Math.max(1,s>>1))}_applySamplingMode(){let e=this._descriptor,t=e.context?.gl,r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):(9984===r||9986===r)&&(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){let e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){let e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,h.Y2)(t)}_applyAnisotropicFilteringParameters(){let e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},67171(e,t,r){r.d(t,{R:()=>s,e:()=>n});var i=r(63907),a=r(42293);class s{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function n(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,a.MW)(e.internalFormat))*(34067===e.target?6:1))}},42293(e,t,r){r.d(t,{MW:()=>l,wH:()=>o,yu:()=>n});var i=r(94656),a=r(63907);const s=new Set([a.pe.BYTE,a.pe.SHORT,a.pe.INT,a.pe.UNSIGNED_BYTE,a.pe.UNSIGNED_SHORT,a.pe.UNSIGNED_INT]);function n(e,t,r,a=0){let n=e.gl;e.bindBuffer(r);for(let o of r.layout){let r=t.get(o.name);if(null==r){console.warn(`There is no location for vertex attribute '${o.name}' defined.`);continue}let l=a*o.stride;if(o.count<=4)o.integer&&s.has(o.type)?n.vertexAttribIPointer(r,o.count,o.type,o.stride,o.offset+l):n.vertexAttribPointer(r,o.count,o.type,o.normalized,o.stride,o.offset+l),n.enableVertexAttribArray(r),o.divisor>0&&n.vertexAttribDivisor(r,o.divisor);else if(9===o.count)for(let e=0;e<3;e++)n.vertexAttribPointer(r+e,3,o.type,o.normalized,o.stride,o.offset+12*e+l),n.enableVertexAttribArray(r+e),o.divisor>0&&n.vertexAttribDivisor(r+e,o.divisor);else if(16===o.count)for(let e=0;e<4;e++)n.vertexAttribPointer(r+e,4,o.type,o.normalized,o.stride,o.offset+16*e+l),n.enableVertexAttribArray(r+e),o.divisor>0&&n.vertexAttribDivisor(r+e,o.divisor);else console.error("Unsupported vertex attribute element count: "+o.count);if((0,i.en)()){let t=(0,i.u1)(e.gl);t&&console.error(`Unable to bind vertex attribute "${o.name}" with baseInstanceOffset ${l}:`,t,o)}}}function o(e){switch(e){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function l(e){switch(e){case 6406:case 6409:case 6403:case 36244:case a.H0.R8:case a.H0.R8I:case a.H0.R8UI:case a.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case a.H0.RGBA4:case a.H0.R16F:case a.H0.R16I:case a.H0.R16UI:case a.H0.RG8:case a.H0.RG8I:case a.H0.RG8UI:case a.H0.RG8_SNORM:case a.H0.RGB565:case a.H0.RGB5_A1:case a.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case a.H0.RGB8:case a.H0.RGB8I:case a.H0.RGB8UI:case a.H0.RGB8_SNORM:case a.H0.SRGB8:case a.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case a.H0.RGBA8:case a.H0.R32F:case a.H0.R11F_G11F_B10F:case a.H0.RG16F:case a.H0.R32I:case a.H0.R32UI:case a.H0.RG16I:case a.H0.RG16UI:case a.H0.RGBA8I:case a.H0.RGBA8UI:case a.H0.RGBA8_SNORM:case a.H0.SRGB8_ALPHA8:case a.H0.RGB9_E5:case a.H0.RGB10_A2UI:case a.H0.RGB10_A2:case a.SB.DEPTH_COMPONENT32F:case a.iE.DEPTH24_STENCIL8:return 4;case a.iE.DEPTH32F_STENCIL8:return 5;case a.H0.RGB16F:case a.H0.RGB16I:case a.H0.RGB16UI:return 6;case a.H0.RG32F:case a.H0.RG32I:case a.H0.RG32UI:case a.H0.RGBA16F:case a.H0.RGBA16I:case a.H0.RGBA16UI:return 8;case a.H0.RGB32F:case a.H0.RGB32I:case a.H0.RGB32UI:return 12;case a.H0.RGBA32F:case a.H0.RGBA32I:case a.H0.RGBA32UI:return 16;case a.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case a.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case a.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case a.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case a.CQ.COMPRESSED_R11_EAC:case a.CQ.COMPRESSED_SIGNED_R11_EAC:case a.CQ.COMPRESSED_RGB8_ETC2:case a.CQ.COMPRESSED_SRGB8_ETC2:case a.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case a.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case a.CQ.COMPRESSED_RG11_EAC:case a.CQ.COMPRESSED_SIGNED_RG11_EAC:case a.CQ.COMPRESSED_RGBA8_ETC2_EAC:case a.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},94656(e,t,r){r.d(t,{Y2:()=>h,en:()=>l,u1:()=>n});var i=r(49186),a=r(44208),s=r(53966);function n(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const o=!!(0,a.A)("enable-feature:webgl-debug");function l(){return o}function h(e,t=l()){if(t){let t=n(e);if(t){let e=Error().stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},12541(e,t,r){r.d(t,{CR:()=>u,Eo:()=>T,FV:()=>g,Kv:()=>p,QE:()=>l,QJ:()=>c,Qp:()=>d,mq:()=>f,re:()=>_,tl:()=>m,tr:()=>h});var i=r(49186),a=r(53966),s=r(93637),n=r(63907);const o=()=>a.A.getLogger("esri/views/webgl/textureUtils");function l(e){let{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&o().error("Negative dimension parameters are not allowed!");let{internalFormat:a}=e;if(a&&(u(a)||c(a))){let{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:a}=e;a&&o().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&o().error("Depth textures cannot sample mipmaps"):(9728!==i&&o().error("Depth textures without filtering must use NEAREST filtering"),r&&o().error("Depth textures without filtering cannot use compare function"))}}function h(e){return function(e){return n.XN.includes(e)}(e)||u(e)||c(e)}function u(e){return(0,s.a4)(n.SB,e)}function c(e){return(0,s.a4)(n.iE,e)}function m(e){return null!=e&&(0,s.a4)(n.CQ,e)}function d(e){return null!=e&&"type"in e&&"compressed"===e.type}function p(e){return null!=e&&!d(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function g(e,t,r,i=1){let a=Math.max(t,r);return 32879===e&&(a=Math.max(a,i)),Math.floor(Math.log2(a))+1}function f(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case n.ld.FLOAT:switch(e.pixelFormat){case 6408:return n.H0.RGBA32F;case 6407:return n.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case n.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return n.H0.RGBA8;case 6407:return n.H0.RGB8}}let{pixelFormat:t}=e;return e.internalFormat=34041===t?n.iE.DEPTH24_STENCIL8:6402===t?n.SB.DEPTH_COMPONENT24:t,e.internalFormat}function T(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}},49788(e,t,r){r.d(t,["Q",0,1/255.5,"v",0,.9960861056751468])}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8197],{4341(e,t,r){r.d(t,{I:()=>a});var i=r(26390);class a{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){let e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*s);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,s));e++)this._items.push(this._allocator())}}const s=1024},11964(e,t,r){r.d(t,{Cr:()=>u,H6:()=>d,LV:()=>h,_I:()=>m,kb:()=>c,vt:()=>l});var i=r(34727),a=r(4341),s=r(35522),n=r(51850),o=r(32114);function l(e){return e?{origin:(0,n.o8)(e.origin),vector:(0,n.o8)(e.vector)}:{origin:(0,n.vt)(),vector:(0,n.vt)()}}function h(e,t){let r=p.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,s.C)(r.origin,e),(0,s.Re)(r.vector,t,e),r}function c(e,t){let r=(0,s.Re)(o.rq.get(),t,e.origin),a=(0,s.Om)(e.vector,r),n=(0,s.Om)(e.vector,e.vector);if(Math.abs(n)<_)return(0,s.hG)(e.origin,t);let l=(0,i.qE)(a/n,0,1),h=(0,s.Re)(o.rq.get(),(0,s.hs)(o.rq.get(),e.vector,l),r);return(0,s.Om)(h,h)}function m(e,t,r){return d(e,t,0,1,r)}function d(e,t,r,a,n){let{vector:l,origin:h}=e,u=(0,s.Re)(o.rq.get(),t,h),c=(0,s.Om)(l,u)/(0,s.m3)(l);return(0,s.hs)(n,l,(0,i.qE)(c,r,a)),(0,s.WQ)(n,n,e.origin)}(0,n.vt)(),(0,n.vt)();const p=new a.I(()=>l()),_=1e-9},80754(e,t,r){r.d(t,{kS:()=>h,kd:()=>l});var i=r(82799),a=r(16930),s=r(60408),n=r(52006);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:a.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:a.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function h(e,t){if((0,n.Ed)(e))for(let r of function(e){return(0,s.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of r){if((0,n.aO)(e)){let[r,i]=e.c;r[0]+=t,i[0]+=t;continue}if((0,n.FG)(e)){let[r,i]=e.a;r[0]+=t,i[0]+=t;continue}if((0,n.n1)(e)){let[r,i,a]=e.b;r[0]+=t,i[0]+=t,a[0]+=t;continue}e[0]+=t}for(let r of function(e){return(0,s.Bi)(e)?e.rings:e.paths}(e))for(let e of r)e[0]+=t;return e}r.d(t,["j7",0,o])},71351(e,t,r){r.d(t,{C:()=>c,Cr:()=>m,LV:()=>u,fA:()=>d,kb:()=>p,vt:()=>l});var i=r(4341),a=(r(77690),r(29242)),s=r(35522),n=r(51850),o=r(32114);function l(e){return e?h((0,n.o8)(e.origin),(0,n.o8)(e.direction)):h((0,n.vt)(),(0,n.vt)())}function h(e,t){return{origin:e,direction:t}}function u(e,t){let r=_.get();return r.origin=e,r.direction=t,r}function c(e,t=l()){return d(e.origin,e.direction,t)}function m(e,t,r=l()){return(0,s.C)(r.origin,e),(0,s.Re)(r.direction,t,e),r}function d(e,t,r=l()){return(0,s.C)(r.origin,e),(0,s.C)(r.direction,t),r}function p(e,t){let r=(0,s.$A)(o.rq.get(),(0,s.S8)(o.rq.get(),e.direction),(0,s.Re)(o.rq.get(),t,e.origin));return(0,s.Om)(r,r)}const _=new i.I(()=>l());(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,a.vt)()},94008(e,t,r){r.d(t,{iy:()=>d}),r(44208),r(53966);var i=r(34727),a=r(34304),s=r(58083),n=r(35522),o=r(51850),l=r(91829),h=r(34275);var u=r(71351),c=r(44280),m=r(32114);class d{constructor(e=0,t=0,r=0,i=0){this.radius=i,"number"==typeof e?this._center=(0,o.fA)(e,t,r):function(e){return t=e,(0,h.vZ)(t)&&t.length>=3||function(e){return((0,h.aI)(e)||Array.isArray(e))&&e.length>=3}(e);var t}(e)||function(e){return(t=e)instanceof Float32Array&&t.length>=4||function(e){return Array.isArray(e)&&e.length>=4}(e);var t}(e)?(this._center=(0,o.ci)(e),this.radius=4===e.length?e[3]:t):(this._center=(0,o.o8)(e.center),this.radius=e.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(e){(0,n.C)(this.center,e)}exactEquals(e){return(0,n.aI)(this._center,e.center)&&this.radius===e.radius}copyFrom(e){return e!==this&&((0,n.C)(this._center,e.center),this.radius=e.radius),this}clone(){return new d(this.center,this.radius)}toVec4(){return(0,l.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(e){return(0,n.hG)(this.center,e)<=this.radius**2}intersects(e){let t=this.radius+e.radius;return(0,n.hG)(this.center,e.center)<=t*t}intersectRay(e,t){if(null==e||!this._intersect(e,p))return!1;let{t0:r,t1:i}=p;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(t){let{origin:i,direction:a}=e;t[0]=i[0]+a[0]*r,t[1]=i[1]+a[1]*r,t[2]=i[2]+a[2]*r}return!0}intersectLine(e,t){let r=(0,u.Cr)(e,t);if(!this._intersect(r,p))return[];let{origin:i,direction:s}=r,{t0:l,t1:h}=p,c=e=>{let t=(0,o.vt)();return(0,n.Ln)(t,i,s,e),this.projectPoint(t,t)};return Math.abs(l-h)<(0,a.FD)()?[c(l)]:[c(l),c(h)]}_intersect(e,t){let{origin:r,direction:i}=e,a=_;a[0]=r[0]-this.center[0],a[1]=r[1]-this.center[1],a[2]=r[2]-this.center[2];let s=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===s)return!1;let n=2*(i[0]*a[0]+i[1]*a[1]+i[2]*a[2]),o=n*n-4*s*(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-this.radius**2);if(o<0)return!1;let l=Math.sqrt(o);return t.t0=(-n-l)/(2*s),t.t1=(-n+l)/(2*s),!0}projectPoint(e,t){let r=(0,n.Re)(m.rq.get(),e,this.center),i=(0,n.hs)(m.rq.get(),r,this.radius/(0,n.Bw)(r));return(0,n.WQ)(t,i,this.center)}closestPointOnSilhouette(e,t){let r=m.rq.get(),i=m.Rc.get();(0,n.$A)(r,e.origin,e.direction),(0,n.$A)(t,r,e.origin),(0,n.hs)(t,t,1/(0,n.Bw)(t)*this.radius);let a=this._angleToSilhouette(e.origin),o=(0,c.g7)(e.origin,t);return(0,s.$0)(i,o+a,r),(0,n.Z0)(t,t,i),t}frustumCoverage(e,t,r){let i=this.radius,a=i*i,s=e+.5*Math.PI,n=t*t+a-2*Math.cos(s)*t*i,o=Math.sqrt(n),l=n-a;if(l<=0)return.5;let h=Math.acos(Math.sqrt(l)/o)-Math.asin(i/(o/Math.sin(s)));return Math.min(1,(h+.5*r)/r)}_angleToSilhouette(e){let t=(0,n.Re)(m.rq.get(),e,this.center),r=(0,n.Bw)(t),a=this.radius,s=a+Math.abs(a-r);return(0,i.XM)(a/s)}union(e){let t=(0,n.Io)(this._center,e.center),r=this.radius,i=e.radius;return t+i<r?this:t+r<i?(this.copyFrom(e),this):((0,n.Cc)(this._center,this._center,e.center,(t+i-r)/(2*t)),this.radius=(t+r+i)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(e){let{center:t,radius:r}=this,i=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3];return i<0?Math.min(i+r,0):Math.max(i-r,0)}}new d;const p={t0:0,t1:0},_=(0,o.vt)();(0,o.vt)(),(0,o.vt)()},38969(e,t,r){r.d(t,{i:()=>a});var i=r(37955);function a(e,t){return new Promise((r,a)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",a)))})}},31217(e,t,r){r.d(t,{D:()=>a});var i=r(56507);async function a(e,t){return(await(0,i.A)(e,{responseType:"image",...t})).data}},46859(e,t,r){r.d(t,{h:()=>L});var i=r(49186),a=r(65529),s=r(97768),n=r(17676),o=r(34275),l=r(24326),h=r(84952),u=r(38969),c=r(31217),m=r(95117),d=r(53966),p=r(2741);let _;var g=r(63907),f=r(21231),T=r(42293);const x=()=>d.A.getLogger("esri.views.3d.webgl-engine.lib.BasisUtil");let E=null,A=null;async function M(){return A??(_??=(async()=>{let e=await(await r.e(9321).then(()=>r(49321))).default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return e.initializeBasis(),e})(),A=_,E=await A),A}function R(e,t,r,i,a){let s=(0,T.MW)(t?g.CQ.COMPRESSED_RGBA8_ETC2_EAC:g.CQ.COMPRESSED_RGB8_ETC2),n=a&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*s*n)}function w(e){return e.getNumImages()>=1&&!e.isUASTC()}function b(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function C(e,t,r,i,a,s,n,o,l=!1){let{compressedTextureETC:h,compressedTextureS3TC:u}=e.capabilities,{basisFormat:c,internalFormat:m}=function(e,t,r,i){return e?r?{basisFormat:1,internalFormat:i?g.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:g.CQ.COMPRESSED_RGBA8_ETC2_EAC}:{basisFormat:0,internalFormat:i?g.CQ.COMPRESSED_SRGB8_ETC2:g.CQ.COMPRESSED_RGB8_ETC2}:t?r?{basisFormat:3,internalFormat:g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{basisFormat:2,internalFormat:g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT}:{basisFormat:13,internalFormat:i?g.H0.SRGB8_ALPHA8:6408}}(null!=h,null!=u,i,l),d=t.hasMipmap?r:Math.min(1,r),p=[];for(let e=0;e<d;e++)p.push(new Uint8Array(n(e,c))),o(e,c,p[e]);return t.internalFormat=m,t.hasMipmap=p.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=a,t.height=s,new f.A(e,t,{type:"compressed",levels:p})}function D(e,t){let r=new Uint32Array(e.buffer,e.byteOffset,16);if(1481919403!==r[0]||3140563232!==r[1]||169478669!==r[2])return x().error("Invalid magic number in KTX1 header"),null;if(67305985!==r[3]||1!==r[5]||r[7]!==g.CQ.COMPRESSED_RGB8_ETC2||6407!==r[8])return x().error("Unsupported KTX1 image"),null;let i=r[7],a=1,s=r[9],n=r[10];if(3&s||3&n)return null;let o=s,l=n;!1!==t&&(a=Math.max(1,r[14]));let h,u,c=e.byteOffset+64,m=[];for(let t=0;t<a;++t)u=(e[c]|e[c+1]<<8|e[c+2]<<16|e[c+3]<<24)>>>0,c+=4,h=new Uint8Array(e.buffer,c,u),m.push(h),c+=u,s=Math.max(1,s>>1),n=Math.max(1,n>>1);return{textureData:{type:"compressed",levels:m},internalFormat:i,width:o,height:l}}const S=()=>d.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function F(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const y=F("DXT1"),I=F("DXT3"),v=F("DXT5");function P(e,t){let r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return S().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return S().error("Unsupported format, must contain a FourCC code"),null;let i,a,s=r[21];switch(s){case y:i=8,a=g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case I:i=16,a=g.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case v:i=16,a=g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return S().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(s)),null}let n=1,o=r[4],l=r[3];(3&o||3&l)&&(S().warn("Rounding up compressed texture size to nearest multiple of 4."),o=o+3&-4,l=l+3&-4);let h=o,u=l;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let c,m,d=e.byteOffset+r[1]+4,p=[];for(let t=0;t<n;++t)m=(o+3>>2)*(l+3>>2)*i,c=new Uint8Array(e.buffer,d,m),p.push(c),d+=m,o=Math.max(1,o>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:a,width:h,height:u}}function H(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function U(e,t){let[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){let a=Math.max(e,t),s=e*t;if(a<=i&&s<=r)return[e,t];let n=Math.min(Math.sqrt(r/s),i/a);return[H(Math.round(e*n),i),H(Math.round(t*n),i)]}(e,t);return e.width===r&&e.height===i?e:O(e,r,i)}function O(e,t,r){if(e instanceof ImageData)return O(function(e){let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);let a=document.createElement("canvas");return a.width=t,a.height=r,a.getContext("2d").drawImage(e,0,0,a.width,a.height),a}var G=r(620),B=r(67171),N=r(12541);class L{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new a.bk,this._parameters={...W,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!(0,h.w8)(e.src)&&("auto"!==e.preload||!e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){let t=[];(0,u.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){!(0,h.DB)(e.src)&&!(0,h.w8)(e.src)&&!e.crossOrigin&&(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){let t=new B.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=!0===this._parameters.immutable&&function(e){return null!=e&&((0,N.tl)(e)||(0,N.tr)(e)||(0,N.CR)(e)||(0,N.QJ)(e))}(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,o.mw)(e)||(0,o.mg)(e))return"image/ktx2"===t.encoding?function(e,t){if(null==E)return e.byteLength;let r=new E.KTX2File(new Uint8Array(e)),i=b(r)?R(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):"image/x.basis"===t.encoding?function(e,t){if(null==E)return e.byteLength;let r=new E.BasisFile(new Uint8Array(e)),i=w(r)?R(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;let{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?X(e):t,a=t.pixelFormat??6408,s=(0,T.wH)(a);return(t.mipmap?4/3:1)*r*i*s||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;let t=this._data;return null==t?(this._texture=new f.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,o.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,o.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):(0,o.mg)(t)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(e,t):(0,o.mw)(t)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(e,new Uint8Array(t)):((0,o.mw)(t)||(0,o.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,o.mw)(t)||(0,o.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,o.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,o.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){let i=P(r,t.hasMipmap??!1);if(null==i)throw Error("DDS texture data is null");let{textureData:a,internalFormat:s,width:n,height:o}=i;return t.samplingMode=a.levels.length>1?9987:9729,t.hasMipmap=a.levels.length>1,t.internalFormat=s,t.width=n,t.height=o,new f.A(e,t,a)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX1(e,t){return this._texture=function(e,t,r){let i=D(r,t.hasMipmap??!1);if(null==i)throw Error("KTX1 texture data is null");let{textureData:a,internalFormat:s,width:n,height:o}=i;return t.samplingMode=a.levels.length>1?9987:9729,t.hasMipmap=a.levels.length>1,t.internalFormat=s,t.width=n,t.height=o,new f.A(e,t,a)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r,i=!1){E??=await M();let a=new E.KTX2File(new Uint8Array(r));if(!b(a))return null;let s=i&&2===a.getDFDTransferFunc();a.startTranscoding();let n=C(e,t,a.getLevels(),a.getHasAlpha(),a.getWidth(),a.getHeight(),(e,t)=>a.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>a.transcodeImage(r,e,0,0,t,0,-1,-1),s);return a.close(),a.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){E??=await M();let i=new E.BasisFile(new Uint8Array(r));if(!w(i))return null;i.startTranscoding();let a=C(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),a}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,G.vA)(this._parameters.width>0&&this._parameters.height>0);let r=this._createDescriptor(e);return(6407===r.pixelFormat||6408===r.pixelFormat)&&(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new f.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{let i=await(0,c.D)(t,{signal:r});return(0,n.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{let i=await(0,m.y)(t,t.src,!1,r);return(0,n.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((a,o)=>{let l=()=>{t.removeEventListener("loadeddata",h),t.removeEventListener("error",u),(0,s.xt)(c)},h=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),a(this._loadFromImage(e,t)))},u=e=>{l(),o(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",h),t.addEventListener("error",u);let c=(0,n.u7)(r,()=>u((0,n.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=U(r,e.parameters));let i=X(r);this._parameters.width=i.width,this._parameters.height=i.height;let a=this._createDescriptor(e);return a.width=i.width,a.height=i.height,a.compress=this._parameters.compressionOptions,this._texture=new f.A(e,a,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){let t=new AbortController;this._loadingController=t;let r=e(t.signal);this._loadingPromise=r;let i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){let e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function X(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const W={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},58682(e,t,r){r.d(t,{Uy:()=>l,h7:()=>m});var i=r(35522),a=r(51850),s=r(70328);class n{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const o=(0,s.vt)();function l(e,t,r,a,s,o){if(!e.visible)return;let l=(0,i.jb)(M,a,r),{tolerance:h}=t,c=new n(h,!1,t.options.normalRequired);if(e.boundingInfo)u(e.readPrimitivePosition,e.boundingInfo,r,l,h,s,c,o);else{let t=e.readPrimitivePosition;!function(e,t,r,a,s,n,o,l){let h=t,u=R,c=Math.abs(h[0]),m=Math.abs(h[1]),d=Math.abs(h[2]),f=c>=m?c>=d?0:2:m>=d?1:2,x=f,E=h[x]<0?2:1,A=(f+E)%3,M=(f+(3-E))%3,w=h[A]/h[x],b=h[M]/h[x],C=1/h[x],D=p,S=_,F=g,{normalRequired:y}=o;for(let t=r;t<a;++t){let r=3*t;s(u[0],r),s(u[1],r+1),s(u[2],r+2),n&&(n.applyToVertex(u[0],u[0][0],u[0][1],u[0][2],t),n.applyToVertex(u[1],u[1][0],u[1][1],u[1][2],t),n.applyToVertex(u[2],u[2][0],u[2][1],u[2][2],t)),(0,i.jb)(D,u[0],e),(0,i.jb)(S,u[1],e),(0,i.jb)(F,u[2],e);let a=D[A]-w*D[x],o=D[M]-b*D[x],h=S[A]-w*S[x],c=S[M]-b*S[x],m=F[A]-w*F[x],d=F[M]-b*F[x],p=m*c-d*h,_=a*d-o*m,g=h*o-c*a;if((p<0||_<0||g<0)&&(p>0||_>0||g>0))continue;let f=p+_+g;if(0===f)continue;let E=p*(C*D[x])+_*(C*S[x])+g*(C*F[x]);if(E*Math.sign(f)<0)continue;let R=E/f;R>=0&&l(R,R,y?T(u):null,t)}}(r,l,0,e.faceCount,t,s,c,o)}}const h=(0,a.vt)();function u(e,t,r,a,n,l,c,m){if(null==t)return;let p=function(e,t){return(0,i.hZ)(t,1/e[0],1/e[1],1/e[2])}(a,h);if((0,s.C)(o,t.box),l?.applyToAabb(o),function(e,t,r,i){return function(e,t,r,i){let a=(e[0]-i-t[0])*r[0],s=(e[3]+i-t[0])*r[0],n=Math.min(a,s),o=Math.max(a,s),l=(e[1]-i-t[1])*r[1],h=(e[4]+i-t[1])*r[1];if(o=Math.min(o,Math.max(l,h)),o<0||(n=Math.max(n,Math.min(l,h)),n>o))return!1;let u=(e[2]-i-t[2])*r[2],c=(e[5]+i-t[2])*r[2];return o=Math.min(o,Math.max(u,c)),!(o<0||(n=Math.max(n,Math.min(u,c)),n>o))&&n<1/0}(e,t,r,i)}(o,r,p,n)){let{primitiveIndices:i}=t,s=i.length;if(s>1e3){let i=t.children;if(void 0!==i){for(let t of i)u(e,t,r,a,n,l,c,m);return}}d(r,a,0,s,e,i,l,c,m)}}const c=(0,a.vt)();function m(e,t,r,i,a,s,n,o,l,h=null,u=0){let m=e[0],d=e[1],p=e[2],_=t[0],g=t[1],T=t[2];for(let e=r;e<i;++e){let t=u+(h?.[e]??e),r=3*t,i=n*a[r],x=s[i],E=s[i+1],M=s[i+2],R=n*a[r+1],w=s[R],b=s[R+1],C=s[R+2],D=n*a[r+2],S=w-x,F=b-E,y=C-M,I=s[D]-x,v=s[D+1]-E,P=s[D+2]-M,H=g*P-v*T,U=T*I-P*_,O=_*v-I*g,G=S*H+F*U+y*O,B=G*G;if(B<=A)continue;let N=m-x,L=d-E,X=p-M,W=(N*H+L*U+X*O)*G;if(W<0||W>B)continue;let Q=L*y-F*X,V=X*S-y*N,k=N*F-S*L,q=(_*Q+g*V+T*k)*G;if(q<0||W+q>B)continue;let K=(I*Q+v*V+P*k)/G;K>=0&&l(K,K,o?f(S,F,y,I,v,P,c):null,t)}}function d(e,t,r,i,a,s,n,o,l){let h=e[0],u=e[1],m=e[2],d=t[0],p=t[1],_=t[2],{normalRequired:g}=o;for(let e=r;e<i;++e){let t=s[e],r=3*t,[i,o,T]=a(b,r),[x,E,M]=a(b,r+1),[R,C,D]=a(b,r+2);null!=n&&([i,o,T]=n.applyToVertex(w,i,o,T,e),[x,E,M]=n.applyToVertex(w,x,E,M,e),[R,C,D]=n.applyToVertex(w,R,C,D,e));let S=x-i,F=E-o,y=M-T,I=R-i,v=C-o,P=D-T,H=p*P-v*_,U=_*I-P*d,O=d*v-I*p,G=S*H+F*U+y*O,B=G*G;if(B<=A)continue;let N=h-i,L=u-o,X=m-T,W=(N*H+L*U+X*O)*G;if(W<0||W>B)continue;let Q=L*y-F*X,V=X*S-y*N,k=N*F-S*L,q=(d*Q+p*V+_*k)*G;if(q<0||W+q>B)continue;let K=(I*Q+v*V+P*k)/G;K>=0&&l(K,K,g?f(S,F,y,I,v,P,c):null,t)}}const p=(0,a.vt)(),_=(0,a.vt)(),g=(0,a.vt)();function f(e,t,r,a,s,n,o){return(0,i.hZ)(x,e,t,r),(0,i.hZ)(E,a,s,n),(0,i.$A)(o,x,E),(0,i.S8)(o,o),o}function T(e){return(0,i.jb)(x,e[1],e[0]),(0,i.jb)(E,e[2],e[0]),(0,i.$A)(c,x,E),(0,i.S8)(c,c),c}const x=(0,a.vt)(),E=(0,a.vt)(),A=1e-7*1e-7,M=(0,a.vt)(),R=[(0,a.vt)(),(0,a.vt)(),(0,a.vt)()],w=(0,a.vt)(),b=(0,a.vt)()},74810(e,t,r){r.d(t,{Jr:()=>s});var i=r(35522),a=r(51850);function s({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:s,emissiveTexture:n,emissiveFactor:o,occlusionTexture:l}){return null==e&&null==t&&null==n&&(null==o||(0,i.t2)(o,a.uY))&&null==l&&(null==s||1===s)&&(null==r||1===r)}const n=(0,a.CN)(1,1,.5),o=(0,a.CN)(0,.6,.2),l=(0,a.CN)(0,1,.2);r.d(t,["Bt",0,o,"SY",0,l,"mb",0,n])},21231(e,t,r){r.d(t,{A:()=>g});var i=r(49186),a=r(44208),s=r(53966),n=r(97768),o=r(93637),l=r(17676),h=r(94656),u=r(63907),c=r(67171),m=r(12541);class d extends c.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R32F:case u.H0.R8_SNORM:case u.H0.R8:this.pixelFormat=6403;break;case u.H0.R8I:case u.H0.R8UI:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32I:case u.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new d(e,t)}}const p=!!(0,a.A)("esri-tests-disable-gpu-memory-measurements"),_=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{let r=d.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return p?0:(0,c.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(u.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){let r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!(0,m.Qp)(e)&&this._descriptor.internalFormat&&(0,o.a4)(u.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!(0,m.Qp)(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,a,s,n,o=0){n||_().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||_().error("An attempt to update uninitialized texture!");let l=this._descriptor;l.internalFormat=(0,m.mq)(l);let{context:h,pixelFormat:u,dataType:c,target:d,isImmutable:p}=l;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");let f=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+a>l.width||r+s>l.height)&&_().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();let{gl:T}=h;o&&((!a||!s)&&_().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,o)),(0,m.Kv)(n)?T.texSubImage2D(d,e,t,r,a,s,u,c,n):(0,m.Qp)(n)?T.compressedTexSubImage2D(d,e,t,r,a,s,l.internalFormat,n.levels[e]):T.texSubImage2D(d,e,t,r,a,s,u,c,n),o&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),h.bindTexture(f,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,a,s,n,o,l){l||_().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||_().error("An attempt to update an uninitialized texture!");let h=this._descriptor;h.internalFormat=(0,m.mq)(h);let{context:u,pixelFormat:c,dataType:d,isImmutable:p,target:f}=h;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,m.re)(f)||_().warn("Attempting to set 3D texture data on a non-3D texture");let T=u.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||a<0||t+s>h.width||r+n>h.height||a+o>h.depth)&&_().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();let{gl:x}=u;if((0,m.Qp)(l))l=l.levels[e],x.compressedTexSubImage3D(f,e,t,r,a,s,n,o,h.internalFormat,l);else{let i=l;x.texSubImage3D(f,e,t,r,a,s,n,o,c,d,i)}u.bindTexture(T,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){let e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,(0,m.QE)(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);let t=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){let e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,(0,m.QE)(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,(0,m.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),(0,m.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&=(this._applySamplingMode(),!1),this._wrapModeDirty&&=(this._applyWrapMode(),!1),this._shadowFilterDirty&&=(this._applyShadowMode(),!1)}abortCompression(){this._compressionAbortController=(0,n.DC)(this._compressionAbortController)}_setData(e,t){let r=this._descriptor,a=r.context?.gl;if(!a)return;(0,h.Y2)(a),this.hasWebGLTextureObject||(this._glName=a.createTexture(),r.context.instanceCounter.increment(u.vt.Texture,this)),(0,m.QE)(r);let s=r.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(a);let n=t??r.target,o=(0,m.re)(n);if((0,m.Kv)(e))this._setDataFromTexImageSource(e,n);else{let{width:t,height:s,depth:l}=r;if(null==t||null==s)throw new i.A("texture:missing-size","Width and height must be specified!");if(o&&null==l)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=(0,m.mq)(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,r.internalFormat,r.hasMipmap,t,s,l),(0,m.Qp)(e)){if(!(0,m.tl)(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,n)}else this._texImage(n,0,r.internalFormat,t,s,l,e),(0,h.Y2)(a),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(a),r.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){let e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,+!!r),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,+!!i)}_setDataFromTexImageSource(e,t){let{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=(0,m.mq)(i);let a=(0,m.re)(t),{width:s,height:n,depth:o}=(0,m.Eo)(e);i.width&&i.height,i.width||=s,i.height||=n,a&&i.depth,a&&(i.depth=o),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,s,n,o),this._texImage(t,0,i.internalFormat,s,n,o,e),(0,h.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(r))}_setDataFromCompressedSource(e,t,r){let i=this._descriptor,{width:a,height:s,depth:n}=i,o=e.levels,l=(0,m.FV)(r,a,s,n),h=Math.min(l,o.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,h),this._forEachMipmapLevel((e,i,a,s)=>{let n=o[Math.min(e,o.length-1)];this._compressedTexImage(r,e,t,i,a,s,n)},h)}_texStorage(e,t,r,a,s,n){let{gl:o}=this._descriptor.context;if(!(0,m.tr)(t)&&!(0,m.tl)(t))throw new i.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;let l=r?(0,m.FV)(e,a,s,n):1;if((0,m.re)(e)){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");o.texStorage3D(e,l,t,a,s,n)}else o.texStorage2D(e,l,t,a,s);this._wasImmutablyAllocated=!0}_texImage(e,t,r,a,s,n,o){let l=this._descriptor.context.gl,h=(0,m.re)(e),{isImmutable:u,pixelFormat:c,dataType:d}=this._descriptor;if(u){if(null!=o){let r=o;if(h){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,a,s,n,c,d,r)}else l.texSubImage2D(e,t,0,0,a,s,c,d,r)}}else{let u=o;if(h){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,a,s,n,0,c,d,u)}else l.texImage2D(e,t,r,a,s,0,c,d,u)}}_compressedTexImage(e,t,r,a,s,n,o){let l=this._descriptor.context.gl,h=(0,m.re)(e);if(this._descriptor.isImmutable){if(null!=o)if(h){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,a,s,n,r,o)}else l.compressedTexSubImage2D(e,t,0,0,a,s,r,o)}else if(h){if(null==n)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,a,s,n,0,o)}else l.compressedTexImage2D(e,t,r,a,s,0,o)}async _compressOnWorker(e){let{width:t,height:r,context:i,flipped:a,preMultiplyAlpha:s,hasMipmap:n,compress:o}=this._descriptor;if(!o)return;let{compressionTracker:h,compressionCallback:u,preserveSourceBitmap:c}=o,{compressedTextureETC:m,compressedTextureS3TC:d}=i.capabilities;if(!g.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!m&&!d)return;this.abortCompression();let p=new AbortController;this._compressionAbortController=p,h?.increment();let f,T=!1,x=!1;try{e instanceof ImageBitmap?c?(f=await createImageBitmap(e),(0,l.Te)(p),x=!0):f=e:e instanceof Uint8Array?(f=e.buffer,T=this.descriptor.flipped):(f=await createImageBitmap(e,{imageOrientation:a?"flipY":"none"}),(0,l.Te)(p),x=!0);let i={data:f,width:t,height:r,needsFlip:T,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,isOpaque:this._descriptor.isOpaque,hasMipmap:n,hasETC:!!m,hasS3TC:!!d},o=await g.compressionWorkerHandle.invoke(i,p.signal,1);if((0,l.Te)(p),o.compressedTexture&&this.hasWebGLTextureObject){let e=this.usedMemory;this._descriptor.internalFormat=o.internalFormat,this._setData(o.compressedTexture),u?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||_().error("Texture compression failed!")}finally{h?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),x&&f instanceof ImageBitmap&&f.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:a,depth:s,hasMipmap:n,target:o}=this._descriptor,l=32879===o;if(null==r||null==a||l&&null==s)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,a,s),n&&(1!==r||1!==a||l&&1!==s)&&!(i>=t);++i)r=Math.max(1,r>>1),a=Math.max(1,a>>1),l&&(s=Math.max(1,s>>1))}_applySamplingMode(){let e=this._descriptor,t=e.context?.gl,r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):(9984===r||9986===r)&&(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i),null!=e.maxMipLevel&&t.texParameteri(e.target,t.TEXTURE_MAX_LEVEL,e.maxMipLevel)}_applyWrapMode(){let e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){let e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,h.Y2)(t)}_applyAnisotropicFilteringParameters(){let e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},67171(e,t,r){r.d(t,{R:()=>s,e:()=>n});var i=r(63907),a=r(42293);class s{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function n(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,a.MW)(e.internalFormat))*(34067===e.target?6:1))}},42293(e,t,r){r.d(t,{MW:()=>l,wH:()=>o,yu:()=>n});var i=r(94656),a=r(63907);const s=new Set([a.pe.BYTE,a.pe.SHORT,a.pe.INT,a.pe.UNSIGNED_BYTE,a.pe.UNSIGNED_SHORT,a.pe.UNSIGNED_INT]);function n(e,t,r,a=0){let n=e.gl;e.bindBuffer(r);for(let o of r.layout){let r=t.get(o.name);if(null==r){console.warn(`There is no location for vertex attribute '${o.name}' defined.`);continue}let l=a*o.stride;if(o.count<=4)o.integer&&s.has(o.type)?n.vertexAttribIPointer(r,o.count,o.type,o.stride,o.offset+l):n.vertexAttribPointer(r,o.count,o.type,o.normalized,o.stride,o.offset+l),n.enableVertexAttribArray(r),o.divisor>0&&n.vertexAttribDivisor(r,o.divisor);else if(9===o.count)for(let e=0;e<3;e++)n.vertexAttribPointer(r+e,3,o.type,o.normalized,o.stride,o.offset+12*e+l),n.enableVertexAttribArray(r+e),o.divisor>0&&n.vertexAttribDivisor(r+e,o.divisor);else if(16===o.count)for(let e=0;e<4;e++)n.vertexAttribPointer(r+e,4,o.type,o.normalized,o.stride,o.offset+16*e+l),n.enableVertexAttribArray(r+e),o.divisor>0&&n.vertexAttribDivisor(r+e,o.divisor);else console.error("Unsupported vertex attribute element count: "+o.count);if((0,i.en)()){let t=(0,i.u1)(e.gl);t&&console.error(`Unable to bind vertex attribute "${o.name}" with baseInstanceOffset ${l}:`,t,o)}}}function o(e){switch(e){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function l(e){switch(e){case 6406:case 6409:case 6403:case 36244:case a.H0.R8:case a.H0.R8I:case a.H0.R8UI:case a.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case a.H0.RGBA4:case a.H0.R16F:case a.H0.R16I:case a.H0.R16UI:case a.H0.RG8:case a.H0.RG8I:case a.H0.RG8UI:case a.H0.RG8_SNORM:case a.H0.RGB565:case a.H0.RGB5_A1:case a.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case a.H0.RGB8:case a.H0.RGB8I:case a.H0.RGB8UI:case a.H0.RGB8_SNORM:case a.H0.SRGB8:case a.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case a.H0.RGBA8:case a.H0.R32F:case a.H0.R11F_G11F_B10F:case a.H0.RG16F:case a.H0.R32I:case a.H0.R32UI:case a.H0.RG16I:case a.H0.RG16UI:case a.H0.RGBA8I:case a.H0.RGBA8UI:case a.H0.RGBA8_SNORM:case a.H0.SRGB8_ALPHA8:case a.H0.RGB9_E5:case a.H0.RGB10_A2UI:case a.H0.RGB10_A2:case a.SB.DEPTH_COMPONENT32F:case a.iE.DEPTH24_STENCIL8:return 4;case a.iE.DEPTH32F_STENCIL8:return 5;case a.H0.RGB16F:case a.H0.RGB16I:case a.H0.RGB16UI:return 6;case a.H0.RG32F:case a.H0.RG32I:case a.H0.RG32UI:case a.H0.RGBA16F:case a.H0.RGBA16I:case a.H0.RGBA16UI:return 8;case a.H0.RGB32F:case a.H0.RGB32I:case a.H0.RGB32UI:return 12;case a.H0.RGBA32F:case a.H0.RGBA32I:case a.H0.RGBA32UI:return 16;case a.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case a.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case a.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case a.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case a.CQ.COMPRESSED_R11_EAC:case a.CQ.COMPRESSED_SIGNED_R11_EAC:case a.CQ.COMPRESSED_RGB8_ETC2:case a.CQ.COMPRESSED_SRGB8_ETC2:case a.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case a.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case a.CQ.COMPRESSED_RG11_EAC:case a.CQ.COMPRESSED_SIGNED_RG11_EAC:case a.CQ.COMPRESSED_RGBA8_ETC2_EAC:case a.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},94656(e,t,r){r.d(t,{Y2:()=>h,en:()=>l,u1:()=>n});var i=r(49186),a=r(44208),s=r(53966);function n(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const o=!!(0,a.A)("enable-feature:webgl-debug");function l(){return o}function h(e,t=l()){if(t){let t=n(e);if(t){let e=Error().stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},12541(e,t,r){r.d(t,{CR:()=>u,Eo:()=>T,FV:()=>g,Kv:()=>p,QE:()=>l,QJ:()=>c,Qp:()=>d,mq:()=>f,re:()=>_,tl:()=>m,tr:()=>h});var i=r(49186),a=r(53966),s=r(93637),n=r(63907);const o=()=>a.A.getLogger("esri/views/webgl/textureUtils");function l(e){let{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&o().error("Negative dimension parameters are not allowed!");let{internalFormat:a}=e;if(a&&(u(a)||c(a))){let{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:a}=e;a&&o().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&o().error("Depth textures cannot sample mipmaps"):(9728!==i&&o().error("Depth textures without filtering must use NEAREST filtering"),r&&o().error("Depth textures without filtering cannot use compare function"))}}function h(e){return function(e){return n.XN.includes(e)}(e)||u(e)||c(e)}function u(e){return(0,s.a4)(n.SB,e)}function c(e){return(0,s.a4)(n.iE,e)}function m(e){return null!=e&&(0,s.a4)(n.CQ,e)}function d(e){return null!=e&&"type"in e&&"compressed"===e.type}function p(e){return null!=e&&!d(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function g(e,t,r,i=1){let a=Math.max(t,r);return 32879===e&&(a=Math.max(a,i)),Math.floor(Math.log2(a))+1}function f(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case n.ld.FLOAT:switch(e.pixelFormat){case 6408:return n.H0.RGBA32F;case 6407:return n.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case n.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return n.H0.RGBA8;case 6407:return n.H0.RGB8}}let{pixelFormat:t}=e;return e.internalFormat=34041===t?n.iE.DEPTH24_STENCIL8:6402===t?n.SB.DEPTH_COMPONENT24:t,e.internalFormat}function T(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}},49788(e,t,r){r.d(t,["Q",0,1/255.5,"v",0,.9960861056751468])}}]);
|