@arcgis/core 4.27.0-next.20230402 → 4.27.0-next.20230404
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{b32c728056185dbb6f5d.js → 1ab6f006a61d41e91a63.js} +3 -3
- package/assets/esri/core/workers/chunks/1cf67168212c7c5413e1.js +1 -0
- package/assets/esri/core/workers/chunks/{8d0c3b36971b6b3bde00.js → 27353056c3e4e8d8b8d3.js} +1 -1
- package/assets/esri/core/workers/chunks/27404b98cf53b3da7496.js +1 -0
- package/assets/esri/core/workers/chunks/{d19e9fab4f4fb765c6a3.js → 282bc00ce0767c90a072.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ed0a9b05e9938044aba.js → 2a6902994fc7c104d76e.js} +1 -1
- package/assets/esri/core/workers/chunks/2b1f28ed6a308359e9ef.js +1 -0
- package/assets/esri/core/workers/chunks/{301de0dab629a0448450.js → 3125061c8dfd69e1ae3b.js} +1 -1
- package/assets/esri/core/workers/chunks/{f657205ce2d7cbc10be1.js → 353e5b283e0f4416684a.js} +1 -1
- package/assets/esri/core/workers/chunks/38e8d5f5a9ca343aec03.js +1 -0
- package/assets/esri/core/workers/chunks/408cd2bd0a699422606b.js +1 -0
- package/assets/esri/core/workers/chunks/{26671a6ec5053ceed752.js → 477a69e55ce6f7111ae7.js} +1 -1
- package/assets/esri/core/workers/chunks/{5e23de27ac145a7464af.js → 4dfe34acc58b8cc4de80.js} +1 -1
- package/assets/esri/core/workers/chunks/{88c58d80a92447752d1d.js → 56e2785bf6d56abc44c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{e184b4ac78d6c453489f.js → 57482366a8f9aaf968ce.js} +1 -1
- package/assets/esri/core/workers/chunks/{62873e814774b654ca45.js → 5bae7057b4472cde9d78.js} +1 -1
- package/assets/esri/core/workers/chunks/6412be94b716e8ec5dc1.js +1 -0
- package/assets/esri/core/workers/chunks/{92e7ea029aabd4f6959a.js → 65d24661919c2423ba98.js} +1 -1
- package/assets/esri/core/workers/chunks/6759d5856164ebeb9dce.js +1 -0
- package/assets/esri/core/workers/chunks/{44ee28b5488d0d62055a.js → 6d42e4f51e4f97bc45da.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4662910419e1b3a0077.js → 7205be16bed7948d4557.js} +1 -1
- package/assets/esri/core/workers/chunks/{99b6262f93e3fcb49edc.js → 801b5d79422028469006.js} +1 -1
- package/assets/esri/core/workers/chunks/80c95f43f982eab0e2ae.js +1 -0
- package/assets/esri/core/workers/chunks/83d30e558c8d7cae150a.js +1 -0
- package/assets/esri/core/workers/chunks/859fbe82c137172edcac.js +1 -0
- package/assets/esri/core/workers/chunks/{f2c3a2c081c10352fcc8.js → 876466c7cc52b795a03e.js} +1 -1
- package/assets/esri/core/workers/chunks/a207ba4c5fdde20dc6d9.js +1 -0
- package/assets/esri/core/workers/chunks/{983b26414cc46d9c3105.js → a2969ddd0769be471ed0.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce7928416c28430ca78c.js → a72211e010e2d64921cb.js} +1 -1
- package/assets/esri/core/workers/chunks/bcd79124744cd3682c78.js +1 -0
- package/assets/esri/core/workers/chunks/{9b82a3e751c54e3488fc.js → be2e5b454b7f1ccda9a7.js} +1 -1
- package/assets/esri/core/workers/chunks/bf0341c298b7119b75ce.js +1 -0
- package/assets/esri/core/workers/chunks/d055f8840d5195bb168d.js +1 -0
- package/assets/esri/core/workers/chunks/d1c0b27bd611912406cb.js +1 -0
- package/assets/esri/core/workers/chunks/d2ffa54b2b98823da8d7.js +1 -0
- package/assets/esri/core/workers/chunks/{a6554fa5585da05d2b41.js → d80604b052a75f284795.js} +1 -1
- package/assets/esri/core/workers/chunks/{84a0995714ff7afceefa.js → dddb5d43473dec842381.js} +1 -1
- package/assets/esri/core/workers/chunks/{619c65dd6416bad5e290.js → e9ecfd3ee78492b797cd.js} +1 -1
- package/assets/esri/core/workers/chunks/ec772bcb4dd0fad8b7ef.js +1 -0
- package/assets/esri/core/workers/chunks/ece67851ec5940d747f9.js +1 -0
- package/assets/esri/core/workers/chunks/f115086971b329d840b6.js +1 -0
- package/assets/esri/core/workers/chunks/{5827c2a112a1bccb846a.js → fb54360ea7595d8ec0fd.js} +1 -1
- package/assets/esri/themes/base/_View.scss +1 -1
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_Daylight.scss +21 -83
- package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
- package/assets/esri/themes/base/widgets/_Popup.scss +3 -0
- package/assets/esri/themes/base/widgets/_ShadowCast.scss +0 -40
- package/assets/esri/themes/base/widgets/_TimezonePicker.scss +44 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Clouds.glsl.js +3 -5
- package/chunks/ar2.js +5 -0
- package/chunks/bg_BG2.js +5 -0
- package/chunks/bs_BA2.js +5 -0
- package/chunks/ca_ES2.js +5 -0
- package/chunks/cs_CZ2.js +5 -0
- package/chunks/da_DK2.js +5 -0
- package/chunks/de_CH2.js +5 -0
- package/chunks/de_DE2.js +5 -0
- package/chunks/el_GR2.js +5 -0
- package/chunks/en_CA2.js +5 -0
- package/chunks/en_US2.js +5 -0
- package/chunks/es_ES2.js +5 -0
- package/chunks/et_EE2.js +5 -0
- package/chunks/fi_FI2.js +5 -0
- package/chunks/fr_FR2.js +5 -0
- package/chunks/he_IL2.js +5 -0
- package/chunks/hr_HR2.js +5 -0
- package/chunks/hu_HU2.js +5 -0
- package/chunks/id_ID2.js +5 -0
- package/chunks/it_IT2.js +5 -0
- package/chunks/ja_JP2.js +5 -0
- package/chunks/ko_KR2.js +5 -0
- package/chunks/lt_LT2.js +5 -0
- package/chunks/lv_LV2.js +5 -0
- package/chunks/nb_NO2.js +5 -0
- package/chunks/nl_NL2.js +5 -0
- package/chunks/pl_PL2.js +5 -0
- package/chunks/pt_BR2.js +5 -0
- package/chunks/pt_PT2.js +5 -0
- package/chunks/ro_RO2.js +5 -0
- package/chunks/ru_RU2.js +5 -0
- package/chunks/sk_SK2.js +5 -0
- package/chunks/sl_SL2.js +5 -0
- package/chunks/sr_RS2.js +5 -0
- package/chunks/sv_SE2.js +5 -0
- package/chunks/th_TH2.js +5 -0
- package/chunks/tr_TR2.js +5 -0
- package/chunks/tslib.es6.js +1 -1
- package/chunks/uk_UA2.js +5 -0
- package/chunks/vi_VN2.js +5 -0
- package/chunks/zh_Hans2.js +5 -0
- package/chunks/zh_Hant2.js +5 -0
- package/core/analysisThemeUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/FloatArray.js +1 -1
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/UByteArray.js +5 -0
- package/geometry/support/UintArray.js +5 -0
- package/geometry/support/meshUtils/External.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/graphics/sources/support/uploadAssets.js +1 -1
- package/layers/support/Tilemap.js +1 -1
- package/layers/support/infoFor3D.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
- package/layers/support/rasterFunctions/customBandIndexUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
- package/layers/support/rasterFunctions/stretchUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/layers/voxel/VoxelTransferFunctionStyle.js +1 -1
- package/package.json +1 -1
- package/renderers/support/DictionaryLoader.js +1 -1
- package/rest/query/executeQuery.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/support/Query.js +1 -1
- package/support/actions/ActionBase.js +1 -1
- package/support/actions/ActionButton.js +1 -1
- package/support/actions/ActionToggle.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/Symbol3DLayer.js +1 -1
- package/symbols/support/symbolConversion.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/imagery/BrushVectorField.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/Profiler.js +1 -1
- package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
- package/views/2d/engine/webgl/TileData.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
- package/views/2d/engine/webgl/mesh/VertexBuffer.js +1 -1
- package/views/2d/engine/webgl/mesh/VertexVector.js +1 -1
- package/views/2d/engine/webgl/util/Writer.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/settings.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightToolConfiguration.js +1 -1
- package/views/3d/analysis/Slice/settings.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/enums.js +1 -1
- package/views/3d/layers/graphics/labelPlacement.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdownViewModel.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/modelUploadUtils.js +5 -0
- package/widgets/Editor.js +1 -1
- package/widgets/Popup/actions.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ShadowCast/css.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/support/TimezonePicker.js +5 -0
- package/widgets/support/am5chartUtils.js +5 -0
- package/assets/esri/core/workers/chunks/0d4a1f80ce6d15a7b831.js +0 -1
- package/assets/esri/core/workers/chunks/15eb357f3253a1d9de3b.js +0 -1
- package/assets/esri/core/workers/chunks/4e9bfe92c7c7d4906049.js +0 -1
- package/assets/esri/core/workers/chunks/67a147feb12c01885f3f.js +0 -1
- package/assets/esri/core/workers/chunks/882dccfa9add74ea622c.js +0 -1
- package/assets/esri/core/workers/chunks/9dbd9d63db21971856b1.js +0 -1
- package/assets/esri/core/workers/chunks/a2ec74bfda109d8b1e8c.js +0 -1
- package/assets/esri/core/workers/chunks/bbde77128b7f175a3b88.js +0 -1
- package/assets/esri/core/workers/chunks/c11e289cac10d3d005de.js +0 -1
- package/assets/esri/core/workers/chunks/c8ead3df4621e9623921.js +0 -1
- package/assets/esri/core/workers/chunks/cda3b94899a450812989.js +0 -1
- package/assets/esri/core/workers/chunks/d043695a12897d89ec0b.js +0 -1
- package/assets/esri/core/workers/chunks/d8cd365972c491045d1d.js +0 -1
- package/assets/esri/core/workers/chunks/daf7fa24f7442da39af8.js +0 -1
- package/assets/esri/core/workers/chunks/e746408b64f33d19748e.js +0 -1
- package/assets/esri/core/workers/chunks/e7bfc259536f9bac596a.js +0 -1
- package/assets/esri/core/workers/chunks/e9d0f481a54fc1f895ed.js +0 -1
- package/assets/esri/core/workers/chunks/f3588ae48feb1a7c32b2.js +0 -1
- package/assets/esri/core/workers/chunks/f4c9d092566bed85626f.js +0 -1
- package/widgets/ShadowCast/components/TimezonePicker.js +0 -5
|
@@ -281,7 +281,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
281
281
|
|
|
282
282
|
fragColor = vec4(b / w_total);
|
|
283
283
|
}
|
|
284
|
-
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,a,n,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=a,c[6]=n,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return i()}function n(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>d,Z:()=>c,c:()=>i,f:()=>o});const c=a(),d=n(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:n,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>n,c:()=>o,d:()=>d,e:()=>l,n:()=>u,s:()=>c,t:()=>a});var i=r(72220);function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=3,a=o){if(e.length/o!==Math.ceil(t.length/a))return i.c.error("source and destination buffers need to have the same number of elements"),e;const n=e.length/o,s=r[0],l=r[1],c=r[2],d=r[4],u=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],_=r[13],v=r[14];let T=0,x=0;for(let r=0;r<n;r++){const r=t[T],i=t[T+1],n=t[T+2];e[x]=s*r+d*i+m*n+g,e[x+1]=l*r+u*i+f*n+_,e[x+2]=c*r+h*i+p*n+v,T+=a,x+=o}return e}function n(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,a=o){if(e.length/o!==Math.ceil(t.length/a))return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.length/o,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,_=0;for(let r=0;r<n;r++){const r=t[g],i=t[g+1],n=t[g+2];e[_]=s*r+d*i+m*n,e[_+1]=l*r+u*i+f*n,e[_+2]=c*r+h*i+p*n,g+=a,_+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),a=t.typedBuffer,n=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*a[s],e[l+1]=r*a[s+1],e[l+2]=r*a[s+2],s+=n,l+=i}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let a=0,n=0;for(let s=0;s<o;s++){const o=t[a],s=t[a+1],l=t[a+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[n]=t*o,e[n+1]=t*s,e[n+2]=t*l}a+=i,n+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=n[l]>>r,o[c+1]=n[l+1]>>r,o[c+2]=n[l+2]>>r,l+=s,c+=a},transformMat3:s,transformMat3View:n,transformMat4:a,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>d,zk:()=>c});var i=r(22021),o=r(22807),a=r(17896),n=r(65617),s=r(12981);function l(e){return e?{origin:(0,n.a)(e.origin),vector:(0,n.a)(e.vector)}:{origin:(0,n.c)(),vector:(0,n.c)()}}function c(e,t,r=l()){return(0,a.c)(r.origin,e),(0,a.b)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,n){const{vector:l,origin:c}=e,d=(0,a.b)(s.WM.get(),t,c),u=(0,a.e)(l,d)/(0,a.p)(l);return(0,a.g)(n,l,(0,i.uZ)(u,0,1)),(0,a.a)(n,n,e.origin)}(e,t,0,0,r)}(0,n.c)(),(0,n.c)(),new o.x((()=>l()))},70723:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>ir,gltfToEngineResources:()=>ar,parseUrl:()=>or});var i=r(32243),o=r(21787),a=r(46521),n=r(52138),s=r(13598),l=r(17896),c=r(65617),d=r(60437),u=r(1533);function h(e,t=!1){return e<=u.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),_=r(56067),v=r(75488),T=r(40270),x=r(91695),b=r(91911),E=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,a=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),n=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,n,s),(0,o.m)(l,a,l),l}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var y=r(3172),O=r(66643),M=r(43090),P=r(20102),N=r(92604);class I{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function H(e,t){const{data:r}=await(0,y.default)(e,{responseType:"image",...t});return r}var F=r(51417),B=r(47026),U=r(24882);function z(e){if(e.length<u.DB)return Array.from(e);if((0,u.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,u.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var V=r(44553),G=r(11726);class W{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,G.hu)(e.length>=1),(0,G.hu)(r.length%this._numIndexPerPrimitive==0),(0,G.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,G.hu)(3===i.size||4===i.size);const{data:o,size:a}=i,n=e.length;let s=a*r[this._numIndexPerPrimitive*e[0]];k.clear(),k.push(s);const d=(0,c.f)(o[s],o[s+1],o[s+2]),u=(0,c.a)(d);for(let t=0;t<n;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=a*r[i+e],k.push(s);let t=o[s];d[0]=Math.min(t,d[0]),u[0]=Math.max(t,u[0]),t=o[s+1],d[1]=Math.min(t,d[1]),u[1]=Math.max(t,u[1]),t=o[s+2],d[2]=Math.min(t,d[2]),u[2]=Math.max(t,u[2])}}this.bbMin=d,this.bbMax=u;const h=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(u[0]-d[0],u[1]-d[1]),u[2]-d[2]);let m=this.radius*this.radius;for(let e=0;e<k.length;++e){s=k.getItemAt(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],a=t*t+r*r+i*i;if(a<=m)continue;const n=Math.sqrt(a),l=.5*(n-this.radius);this.radius=this.radius+l,m=this.radius*this.radius;const c=l/n;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,k.clear()}getChildren(){if(this._children||(0,l.d)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:o,size:a}=this.position;for(let n=0;n<t;++n){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[n];let l=a*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=a*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<e[2]&&(t|=4),r[n]=t,++i[t]}let n=0;for(let e=0;e<8;++e)i[e]>0&&++n;if(n<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==s[e]&&this._children.push(new W(s[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){k.prune()}}const k=new V.Z({deallocator:null});var $=r(17662),q=r(4726),j=r(22807),X=r(16996);function Y(e,t,r){return(0,l.b)(J,t,e),(0,l.b)(K,r,e),(0,l.l)((0,l.f)(J,J,K))/2}r(12981),new j.x(X.Ue),new j.x((()=>{return e?{p0:(0,c.a)(e.p0),p1:(0,c.a)(e.p1),p2:(0,c.a)(e.p2)}:{p0:(0,c.c)(),p1:(0,c.c)(),p2:(0,c.c)()};var e}));const J=(0,c.c)(),K=(0,c.c)(),Z=(0,c.c)(),Q=(0,c.c)(),ee=(0,c.c)(),te=(0,c.c)();var re=r(99001);class ie{constructor(e){this.channel=e,this.id=(0,re.D)()}}var oe=r(35065);r(9820),(0,c.c)(),new Float32Array(6);class ae extends $.c{constructor(e,t,r=[],i=null,o=q.U.Mesh,a=null,n=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=a,this.edgeIndicesLength=n,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,U.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,U.mi)(t)),e===oe.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new ae(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===q.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===q.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,l.m)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0),(0,l.s)(te,0,0,0);let a=0,n=0;for(let e=0;e<t.length-2;e+=3){const s=t[e]*i,c=t[e+1]*i,d=t[e+2]*i;(0,l.s)(Z,o[s],o[s+1],o[s+2]),(0,l.s)(Q,o[c],o[c+1],o[c+2]),(0,l.s)(ee,o[d],o[d+1],o[d+2]);const u=Y(Z,Q,ee);u?((0,l.a)(Z,Z,Q),(0,l.a)(Z,Z,ee),(0,l.g)(Z,Z,1/3*u),(0,l.a)(r,r,Z),a+=u):((0,l.a)(te,te,Z),(0,l.a)(te,te,Q),(0,l.a)(te,te,ee),n+=3)}return!(0===n&&0===a||(0!==a?((0,l.g)(r,r,1/a),0):0===n||((0,l.g)(r,te,1/n),0)))}(this.vertexAttributes.get(oe.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(oe.T.POSITION),r=this.indices.get(oe.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,l.s)(i,0,0,0),(0,l.s)(te,0,0,0);let o=0,a=0;const{size:n,data:s}=e,c=t?t.length-1:s.length/n-1,d=c+(r?2:0);for(let e=0;e<d;e+=2){const r=e<c?e:c,d=e<c?e+1:0,u=(t?t[r]:r)*n,h=(t?t[d]:d)*n;Z[0]=s[u],Z[1]=s[u+1],Z[2]=s[u+2],Q[0]=s[h],Q[1]=s[h+1],Q[2]=s[h+2],(0,l.g)(Z,(0,l.a)(Z,Z,Q),.5);const m=(0,l.j)(Z,Q);m>0?((0,l.a)(i,i,(0,l.g)(Z,Z,m)),o+=m):0===o&&((0,l.a)(te,te,Z),a++)}return 0!==o?((0,l.g)(i,i,1/o),!0):0!==a&&((0,l.g)(i,te,1/a),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0);let a=-1,n=0;for(let e=0;e<t.length;e++){const s=t[e]*i;a!==s&&(r[0]+=o[s],r[1]+=o[s+1],r[2]+=o[s+2],n++),a=s}return n>1&&(0,l.g)(r,r,1/n),n>0}(this.vertexAttributes.get(oe.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(oe.T.POSITION),t=this.vertexAttributes.get(oe.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===q.U.Mesh?3:1;(0,G.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,U.KF)(e.length/r);return new W(i,r,e,t)}get transformation(){return this._transformation??s.I}set transformation(e){this._transformation=e&&e!==s.I?(0,s.b)(e):null}get shaderTransformation(){return null!=this._shaderTransformer?this._shaderTransformer(this.transformation):this.transformation}get shaderTransformer(){return this._shaderTransformer}set shaderTransformer(e){this._shaderTransformer=e}get hasVolatileTransformation(){return null!=this._shaderTransformer}addHighlight(){const e=new ie(B.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ne=r(80442),se=r(32448),le=r(70586),ce=r(17452),de=r(85958),ue=r(99880);let he;var me,fe;(fe=me||(me={}))[fe.ETC1_RGB=0]="ETC1_RGB",fe[fe.ETC2_RGBA=1]="ETC2_RGBA",fe[fe.BC1_RGB=2]="BC1_RGB",fe[fe.BC3_RGBA=3]="BC3_RGBA",fe[fe.BC4_R=4]="BC4_R",fe[fe.BC5_RG=5]="BC5_RG",fe[fe.BC7_M6_RGB=6]="BC7_M6_RGB",fe[fe.BC7_M5_RGBA=7]="BC7_M5_RGBA",fe[fe.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",fe[fe.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",fe[fe.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",fe[fe.ATC_RGB=11]="ATC_RGB",fe[fe.ATC_RGBA=12]="ATC_RGBA",fe[fe.FXT1_RGB=17]="FXT1_RGB",fe[fe.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",fe[fe.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",fe[fe.ETC2_EAC_R11=20]="ETC2_EAC_R11",fe[fe.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",fe[fe.RGBA32=13]="RGBA32",fe[fe.RGB565=14]="RGB565",fe[fe.BGR565=15]="BGR565",fe[fe.RGBA4444=16]="RGBA4444";var pe=r(35371),ge=r(75656),_e=r(45762);let ve=null,Te=null;async function xe(){return null==Te&&(Te=function(){if(null==he){const e=e=>(0,ue.V)(`esri/libs/basisu/${e}`);he=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return he}(),ve=await Te),Te}function be(e,t,r,i,o){const a=(0,_e.RG)(t?pe.q_.COMPRESSED_RGBA8_ETC2_EAC:pe.q_.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function Ee(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Se(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[me.ETC2_RGBA,pe.q_.COMPRESSED_RGBA8_ETC2_EAC]:[me.ETC1_RGB,pe.q_.COMPRESSED_RGB8_ETC2]:c?i?[me.BC3_RGBA,pe.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[me.BC1_RGB,pe.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[me.RGBA32,pe.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,d))),s(e,d,m[e]);const f=m.length>1,p=f?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,g={...t,samplingMode:p,hasMipmap:f,internalFormat:u,width:o,height:a};return new ge.x(e,g,{type:"compressed",levels:m})}const Re=N.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function we(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Ce=we("DXT1"),ye=we("DXT3"),Oe=we("DXT5");class Me extends $.c{constructor(e,t){super(),this._data=e,this.type=q.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.Z,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:pe.e8.REPEAT,t:pe.e8.REPEAT},this.estimatedTexMemRequired=Me._estimateTexMemRequired(this._data,this.params),this._startPreload()}_startPreload(){const e=this._data;null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.HK)(e.src)||(0,ce.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if(null==e)return 0;if((0,u.eP)(e)||(0,u.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==ve)return e.byteLength;const r=new ve.KTX2File(new Uint8Array(e)),i=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==ve)return e.byteLength;const r=new ve.BasisFile(new Uint8Array(e)),i=Ee(r)?be(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;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Me._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this._data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:pe.No.TEXTURE_2D,pixelFormat:pe.VI.RGBA,dataType:pe.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e){if(null!=this._glTexture)return this._glTexture;if(null!=this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ge.x(e,this._createDescriptor(e),null),this._glTexture):"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,u.eP)(t)||(0,u.lq)(t))&&this.params.encoding===B.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.params.encoding===B.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.params.encoding===B.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,t)):(0,u.lq)(t)?this._loadFromPixelData(e,t):(0,u.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e){return this._data instanceof HTMLVideoElement&&null!=this._glTexture?this._data.readyState<Pe.HAVE_CURRENT_DATA||e===this._data.currentTime?e:(this._glTexture.setData(this._data),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.params.updateCallback&&this.params.updateCallback(),this._data.currentTime):e}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return Re.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Re.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,a;switch(i){case Ce:o=8,a=pe.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ye:o=16,a=pe.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:o=16,a=pe.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Re.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let n=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(Re.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:s}=i;return t.samplingMode=o.levels.length>1?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new ge.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==ve&&(ve=await xe());const i=new ve.KTX2File(new Uint8Array(r));if(!Ae(i))return null;i.startTranscoding();const o=Se(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==ve&&(ve=await xe());const i=new ve.BasisFile(new Uint8Array(r));if(!Ee(i))return null;i.startTranscoding();const o=Se(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(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,G.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?pe.VI.LUMINANCE:3===this.params.components?pe.VI.RGB:pe.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new ge.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await H(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,de.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=Pe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,le.hw)(l)},n=()=>{t.readyState>=Pe.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},s=e=>{a(),o(e||new P.Z("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){const r=Me._getDataDimensions(t);this.params.width=r.width,this.params.height=r.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this.params.components?pe.VI.RGB:pe.VI.RGBA,i.width=r.width,i.height=r.height,this._glTexture=new ge.x(e,i,t),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(null!=this._glTexture&&(this._glTexture.dispose(),this._glTexture=null),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}var Pe,Ne;(Ne=Pe||(Pe={}))[Ne.HAVE_NOTHING=0]="HAVE_NOTHING",Ne[Ne.HAVE_METADATA=1]="HAVE_METADATA",Ne[Ne.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ne[Ne.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ne[Ne.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var Ie=r(64822),Le=r(65576),De=r(55039),He=r(60624),Fe=r(19419),Be=r(85504),Ue=r(60537),ze=r(82791),Ve=r(93144),Ge=r(27097);const We=(0,Ge.wK)(pe.zi.SRC_ALPHA,pe.zi.ONE,pe.zi.ONE_MINUS_SRC_ALPHA,pe.zi.ONE_MINUS_SRC_ALPHA),ke=(0,Ge.if)(pe.zi.ONE,pe.zi.ONE),$e=(0,Ge.if)(pe.zi.ZERO,pe.zi.ONE_MINUS_SRC_ALPHA);function qe(e){return e===Ve.A.FrontFace?null:e===Ve.A.Alpha?$e:ke}const je={factor:-1,units:-2};function Xe(e,t=pe.wb.LESS){return e===Ve.A.NONE||e===Ve.A.FrontFace?t:pe.wb.LEQUAL}var Ye,Je;(Je=Ye||(Ye={}))[Je.INTEGRATED_MESH=0]="INTEGRATED_MESH",Je[Je.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",Je[Je.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",Je[Je.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",Je[Je.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",Je[Je.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",Je[Je.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",Je[Je.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",Je[Je.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",Je[Je.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",Je[Je.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",Je[Je.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",Je[Je.LASERLINES=12]="LASERLINES",Je[Je.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",Je[Je.HUD_MATERIAL=14]="HUD_MATERIAL",Je[Je.LABEL_MATERIAL=15]="LABEL_MATERIAL",Je[Je.LINE_CALLOUTS=16]="LINE_CALLOUTS",Je[Je.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",Je[Je.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",Je[Je.DRAPED_WATER=19]="DRAPED_WATER",Je[Je.VOXEL=20]="VOXEL",Je[Je.MAX_SLOTS=21]="MAX_SLOTS";var Ke=r(51305),Ze=r(94961),Qe=r(72119),et=r(29268);const tt=(0,c.c)(),rt=(0,c.c)(),it=(0,c.c)(),ot=new class{constructor(e=0){this.offset=e,this.sphere=(0,et.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],a=i[1]*e+i[5]*t+i[9]*r+i[13],n=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+a*a+n*n);o+=o*s,a+=a*s,n+=n*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*a+l[8]*n+l[12],this.tmpVertex[1]=l[1]*o+l[5]*a+l[9]*n+l[13],this.tmpVertex[2]=l[2]*o+l[6]*a+l[10]*n+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,et.c)(),this._obb={center:(0,c.c)(),halfSize:(0,Qe.c)(),quaternion:null},this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,a=r+this.componentLocalOriginLength,n=this._totalOffset/Math.sqrt(i*i+o*o+a*a);return this._tmpVertex[0]=e+i*n,this._tmpVertex[1]=t+o*n,this._tmpVertex[2]=r+a*n,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],a=e[4],n=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*a<0?0:Math.min(Math.abs(r),Math.abs(a)),c=i*n<0?0:Math.min(Math.abs(i),Math.abs(n)),d=Math.sqrt(s*s+l*l+c*c);if(d<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=a>0?this._totalOffset:0,e[5]+=n>0?this._totalOffset:0,e;const u=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(a)),m=Math.max(Math.abs(i),Math.abs(n)),f=Math.sqrt(u*u+h*h+m*m),p=this._totalOffset/f,g=this._totalOffset/d;return e[0]+=t*(t>0?p:g),e[1]+=r*(r>0?p:g),e[2]+=i*(i>0?p:g),e[3]+=o*(o<0?p:g),e[4]+=a*(a<0?p:g),e[5]+=n*(n<0?p:g),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,l.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,l.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,l.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,Ke.c)(at,e.quaternion),(0,l.q)(this._obb.halfSize,this._obb.halfSize,at),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],a=r+this.localOrigin[2],n=this.offset/Math.sqrt(i*i+o*o+a*a);return this.tmpVertex[0]=e+i*n,this.tmpVertex[1]=t+o*n,this.tmpVertex[2]=r+a*n,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)tt[t]=e[0+t]+this.localOrigin[t],rt[t]=e[3+t]+this.localOrigin[t],it[t]=tt[t];const t=this.applyToVertex(tt[0],tt[1],tt[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)it[t]=0==(e&1<<t)?tt[t]:rt[t];r(it)}let i=0;for(let e=0;e<3;++e)tt[e]*rt[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)it[t]=0!=(i&1<<t)?0:0!=(e&1<<t)?tt[t]:rt[t];r(it)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const at=(0,Ze.a)();function nt(e,t,r,i){const o=r.typedBuffer,a=r.typedBufferStride,n=e.length;i*=a;for(let r=0;r<n;++r){const n=2*e[r];o[i]=t[n],o[i+1]=t[n+1],i+=a}}function st(e,t,r,i,o){const a=r.typedBuffer,n=r.typedBufferStride,s=e.length;if(i*=n,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];a[i]=t[o],a[i+1]=t[o+1],a[i+2]=t[o+2],i+=n}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)a[i]=t[s],a[i+1]=t[s+1],a[i+2]=t[s+2],i+=n}}function lt(e,t,r,i,o=1){const a=r.typedBuffer,n=r.typedBufferStride,s=e.length;if(i*=n,1===o)for(let r=0;r<s;++r){const o=4*e[r];a[i]=t[o],a[i+1]=t[o+1],a[i+2]=t[o+2],a[i+3]=t[o+3],i+=n}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)a[i]=t[s],a[i+1]=t[s+1],a[i+2]=t[s+2],a[i+3]=t[s+3],i+=n}}function ct(e,t,r,i,o,a=1){if(!r)return void st(e,t,i,o,a);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,d=r[0],u=r[1],h=r[2],m=r[4],f=r[5],p=r[6],g=r[8],_=r[9],v=r[10],T=r[12],x=r[13],b=r[14];o*=l;let E=0,A=0,S=0;const R=(0,n.y)(r)?e=>{E=t[e]+T,A=t[e+1]+x,S=t[e+2]+b}:e=>{const r=t[e],i=t[e+1],o=t[e+2];E=d*r+m*i+g*o+T,A=u*r+f*i+_*o+x,S=h*r+p*i+v*o+b};if(1===a)for(let t=0;t<c;++t)R(3*e[t]),s[o]=E,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){R(3*e[t]);for(let e=0;e<a;++e)s[o]=E,s[o+1]=A,s[o+2]=S,o+=l}}function dt(e,t,r,i,o,a=1){if(!r)return void st(e,t,i,o,a);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],_=s[8],v=s[9],T=s[10],x=!(0,n.z)(s),b=1e-6,E=1-b;o*=c;let A=0,S=0,R=0;const w=(0,n.y)(s)?e=>{A=t[e],S=t[e+1],R=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=u*r+f*i+_*o,S=h*r+p*i+v*o,R=m*r+g*i+T*o};if(1===a)if(x)for(let t=0;t<d;++t){w(3*e[t]);const r=A*A+S*S+R*R;if(r<E&&r>b){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=R*e}else l[o]=A,l[o+1]=S,l[o+2]=R;o+=c}else for(let t=0;t<d;++t)w(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=R,o+=c;else for(let t=0;t<d;++t){if(w(3*e[t]),x){const e=A*A+S*S+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}for(let e=0;e<a;++e)l[o]=A,l[o+1]=S,l[o+2]=R,o+=c}}function ut(e,t,r,i,o,a=1){if(!r)return void lt(e,t,i,o,a);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],_=s[8],v=s[9],T=s[10],x=!(0,n.z)(s),b=1e-6,E=1-b;if(o*=c,1===a)for(let r=0;r<d;++r){const i=4*e[r],a=t[i],n=t[i+1],s=t[i+2],d=t[i+3];let A=u*a+f*n+_*s,S=h*a+p*n+v*s,R=m*a+g*n+T*s;if(x){const e=A*A+S*S+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}l[o]=A,l[o+1]=S,l[o+2]=R,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],n=t[i],s=t[i+1],d=t[i+2],A=t[i+3];let S=u*n+f*s+_*d,R=h*n+p*s+v*d,w=m*n+g*s+T*d;if(x){const e=S*S+R*R+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<a;++e)l[o]=S,l[o+1]=R,l[o+2]=w,l[o+3]=A,o+=c}}function ht(e,t,r,i,o,a=1){const n=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==a)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<a;++e)n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<a;++e)n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=255,o+=s}}else{n[o]=t[0],n[o+1]=t[1],n[o+2]=t[2],n[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const d=l*a;for(let t=1;t<d;++t)e[o]=c,o+=r}}function mt(e,t,r,i){const o=r.typedBuffer,a=r.typedBufferStride,n=e.length,s=t[0];i*=a;for(let e=0;e<n;++e)o[i]=s,i+=a}function ft(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}class pt{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(oe.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,a){for(const n of t.fields.keys()){const t=e.vertexAttributes.get(n),s=e.indices.get(n);if(t&&s)switch(n){case oe.T.POSITION:{(0,G.hu)(3===t.size);const e=o.getField(n,m.ct);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&ct(s,t.data,r,e,a);break}case oe.T.NORMAL:{(0,G.hu)(3===t.size);const e=o.getField(n,m.ct);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&dt(s,t.data,i,e,a);break}case oe.T.NORMALCOMPRESSED:{(0,G.hu)(2===t.size);const e=o.getField(n,m.or);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&nt(s,t.data,e,a);break}case oe.T.UV0:{(0,G.hu)(2===t.size);const e=o.getField(n,m.Eu);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&nt(s,t.data,e,a);break}case oe.T.COLOR:case oe.T.SYMBOLCOLOR:{const e=o.getField(n,m.mc);(0,G.hu)(!!e,`No buffer view for ${n}`),(0,G.hu)(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||ht(s,t.data,t.size,e,a);break}case oe.T.COLORFEATUREATTRIBUTE:{const e=o.getField(n,m.ly);(0,G.hu)(!!e,`No buffer view for ${n}`),(0,G.hu)(1===t.size),e&&1===t.size&&mt(s,t.data,e,a);break}case oe.T.TANGENT:{(0,G.hu)(4===t.size);const e=o.getField(n,m.ek);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&ut(s,t.data,i,e,a);break}case oe.T.PROFILERIGHT:case oe.T.PROFILEUP:case oe.T.PROFILEVERTEXANDNORMAL:case oe.T.FEATUREVALUE:{(0,G.hu)(4===t.size);const e=o.getField(n,m.ek);(0,G.hu)(!!e,`No buffer view for ${n}`),e&<(s,t.data,e,a)}}else if(n===oe.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(oe.T.POSITION);if((0,G.hu)(!!t,`No buffer view for ${n}`),t){const r=t.length,i=o.getField(n,m.mc);ft(e.objectAndLayerIdColor,i,r,a)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var gt=r(57790),_t=r(88669),vt=r(135),Tt=r(15719),xt=r(96310),bt=r(78869),Et=r(14589),At=r(83475),St=r(59377);pe.wb.LESS,pe.wb.ALWAYS;const Rt={mask:255},wt={function:{func:pe.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:pe.xS.KEEP,zFail:pe.xS.KEEP,zPass:pe.xS.ZERO}},Ct={function:{func:pe.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:pe.xS.KEEP,zFail:pe.xS.KEEP,zPass:pe.xS.REPLACE}};pe.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,pe.xS.KEEP,pe.xS.KEEP,pe.xS.KEEP,pe.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,pe.xS.KEEP,pe.xS.KEEP,pe.xS.KEEP;var yt=r(32078);class Ot extends Tt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=He.r.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,_t.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=xt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=ze.yD.Occlude}}class Mt extends Et.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===Ie.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?vt.N.Default:vt.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Mt.shader)}_initializeProgram(e,t){return new St.$(e.rctx,t.get().build(this.configuration),At.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?pe.wb.LEQUAL:pe.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===Ve.A.NONE,o=e===Ve.A.FrontFace;return(0,Ge.sm)({blending:r.output!==De.H.Color&&r.output!==De.H.Alpha||!r.transparent?null:i?We:qe(e),culling:Pt(r)?(0,Ge.zp)(r.cullFace):null,depthTest:{func:Xe(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ge.LZ:null,colorWrite:Ge.BK,stencilWrite:r.hasOccludees?Rt:null,stencilTest:r.hasOccludees?t?Ct:wt:null,polygonOffset:i||o?null:(a=r.enableOffset,a?je:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function Pt(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Mt.shader=new bt.J(yt.D,(()=>r.e(9291).then(r.bind(r,79291))));var Nt=r(43697),It=r(51354),Lt=r(67498);class Dt extends It.m{}(0,Nt._)([(0,It.o)({constValue:!0})],Dt.prototype,"hasSliceHighlight",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Dt.prototype,"hasSliceInVertexProgram",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Dt.prototype,"instancedDoublePrecision",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Dt.prototype,"hasModelTransformation",void 0),(0,Nt._)([(0,It.o)({constValue:Lt.P.Pass})],Dt.prototype,"pbrTextureBindType",void 0);class Ht extends Dt{constructor(){super(...arguments),this.output=De.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=Fe.q.None,this.pbrMode=Be.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=Ve.A.NONE,this.normalType=He.r.Attribute,this.textureCoordinateType=vt.N.None,this.customDepthTest=B.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Nt._)([(0,It.o)({count:De.H.COUNT})],Ht.prototype,"output",void 0),(0,Nt._)([(0,It.o)({count:B.JJ.COUNT})],Ht.prototype,"alphaDiscardMode",void 0),(0,Nt._)([(0,It.o)({count:Fe.q.COUNT})],Ht.prototype,"doubleSidedMode",void 0),(0,Nt._)([(0,It.o)({count:Be.f7.COUNT})],Ht.prototype,"pbrMode",void 0),(0,Nt._)([(0,It.o)({count:B.Vr.COUNT})],Ht.prototype,"cullFace",void 0),(0,Nt._)([(0,It.o)({count:Ve.A.COUNT})],Ht.prototype,"transparencyPassType",void 0),(0,Nt._)([(0,It.o)({count:He.r.COUNT})],Ht.prototype,"normalType",void 0),(0,Nt._)([(0,It.o)({count:vt.N.COUNT})],Ht.prototype,"textureCoordinateType",void 0),(0,Nt._)([(0,It.o)({count:B.Gv.COUNT})],Ht.prototype,"customDepthTest",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"spherical",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasVertexColors",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasSymbolColors",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasVerticalOffset",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasSlicePlane",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasSliceHighlight",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasColorTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasMetallicRoughnessTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasEmissionTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasOcclusionTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasNormalTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasScreenSizePerspective",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasVertexTangents",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasOccludees",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasMultipassTerrain",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasModelTransformation",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"offsetBackfaces",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"vvSize",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"vvColor",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"receiveShadows",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"receiveAmbientOcclusion",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"textureAlphaPremultiplied",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"instanced",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"instancedColor",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"instancedDoublePrecision",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"writeDepth",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"transparent",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"enableOffset",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"cullAboveGround",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"snowCover",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasColorTextureTransform",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasEmissionTextureTransform",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasNormalTextureTransform",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasOcclusionTextureTransform",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Nt._)([(0,It.o)({constValue:!0})],Ht.prototype,"hasVvInstancing",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Ht.prototype,"useCustomDTRExponentForWater",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Ht.prototype,"supportsTextureAtlas",void 0),(0,Nt._)([(0,It.o)({constValue:!0})],Ht.prototype,"useFillLights",void 0);var Ft=r(41846);class Bt extends Mt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=He.r.Attribute,t.doubleSidedMode=Fe.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Bt.shader)}}Bt.shader=new bt.J(Ft.R,(()=>r.e(8096).then(r.bind(r,38096))));class Ut extends ze.F5{constructor(e){super(e,Vt),this.supportsEdges=!0,this._configuration=new Ht,this._vertexBufferLayout=function(e){const t=(0,Le.U$)().vec3f(oe.T.POSITION);return e.normalType===He.r.Compressed?t.vec2i16(oe.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(oe.T.NORMAL),e.hasVertexTangents&&t.vec4f(oe.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(oe.T.UV0),e.hasVertexColors&&t.vec4u8(oe.T.COLOR),e.hasSymbolColors&&t.vec4u8(oe.T.SYMBOLCOLOR),(0,ne.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(oe.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==De.H.Shadow&&e!==De.H.ShadowExcludeHighlight&&e!==De.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==De.H.Color&&e!==De.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Fe.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Fe.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Fe.q.WindingOrder:Fe.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Be.f7.Schematic:Be.f7.Normal:Be.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(jt,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case Ie.JY.Global:a=(0,l.n)($t,jt);break;case Ie.JY.Local:a=(0,l.c)($t,kt)}let n=0;const s=(0,l.b)(Xt,jt,e.eye),c=(0,l.l)(s),d=(0,l.g)(s,s,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,l.e)(a,d)),n+=(0,gt.Hx)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,l.g)(a,a,n),(0,l.t)(qt,a,r.transform.inverseRotation),i=(0,l.b)(Gt,i,qt),o=(0,l.b)(Wt,o,qt)}(0,gt.Bw)(e,r,i,o,function(e){return null!=e?(ot.offset=e,ot):null}(r.verticalOffset),a)}requiresSlot(e,t){return!(t!==De.H.Color&&t!==De.H.Alpha&&t!==De.H.Depth&&t!==De.H.Normal&&t!==De.H.Shadow&&t!==De.H.ShadowHighlight&&t!==De.H.ShadowExcludeHighlight&&t!==De.H.Highlight&&t!==De.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Ye.TRANSPARENT_MATERIAL:Ye.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Ye.OPAQUE_MATERIAL)&&e!==Ye.DRAPED_MATERIAL)}createGLMaterial(e){return new zt(e)}createBufferWriter(){return new pt(this._vertexBufferLayout)}}class zt extends Ue.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==De.H.Color&&this._output!==De.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Bt:Mt,e)}}const Vt=new class extends Ot{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Gt=(0,c.c)(),Wt=(0,c.c)(),kt=(0,c.f)(0,0,1),$t=(0,c.c)(),qt=(0,c.c)(),jt=(0,c.c)(),Xt=(0,c.c)(),Yt=N.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Jt(e){throw new P.Z("",`Request for object resource failed: ${e}`)}function Kt(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Yt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Yt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Yt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Yt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Yt.warn("Indexed geometries must specify faces"),i=!1;break}default:Yt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Yt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Yt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Zt(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,d.pp)(t,r.bbMin),(0,d.pp)(t,r.bbMax))})),t}function Qt(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function er(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const tr=new D.G(1,2,"wosr");var rr=r(57758);async function ir(e,t){const r=or((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,O.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Jt(i.error.details.url)}(e,r,t);const i=await(0,O.q6)((0,y.default)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Jt(i.error)}(e,t),i=await async function(e,t){const r=[];for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Yt.warn("Externally referenced texture data is not yet supported");continue}const n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.e8.REPEAT,t:pe.e8.REPEAT},preMultiplyAlpha:Qt(l)!==B.JJ.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):H(n,t);r.push(d.then((e=>({refId:s,image:e,params:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,M.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,a=new I,n=e.resource,s=D.G.parse(n.version||"1.0","wosr");tr.validate(s);const l=n.model.name,d=n.model.geometries,u=n.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<d.length;e++){const n=d[e];if(!Kt(n))continue;const s=er(n),l=n.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new F.a(r,t.valuesPerElement,!0)])}const g=[];if("PerAttributeArray"!==n.params.topology){const e=n.params.faces;for(const t in e)g.push([t,e[t].values])}const _=s.texture,v=h&&h[_];if(v&&!f.has(_)){const{image:e,params:t}=v,r=new Me(e,t);i.push(r),f.set(_,r)}const T=f.get(_),x=T?T.id:void 0,b=s.material;let E=a.get(b,_);if(null==E){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=v?Qt(v.alphaChannelUsage):void 0,n={ambient:(0,c.d)(e.diffuse),diffuse:(0,c.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};null!=t&&t.materialParamsMixin&&Object.assign(n,t.materialParamsMixin),E=new Ut(n),a.set(b,_,E)}o.push(E);const A=new ae(E,p,g);m+=g.find((e=>e[0]===oe.T.POSITION))?.[0].length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Zt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const o=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),a=o.model.meta?.ESRI_proxyEllipsoid,d=o.meta.isEsriSymbolResource&&null!=a&&o.meta.uri.includes("/RealisticTrees/");d&&!o.customMeta.esriTreeRendering&&(o.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const a=o.attributes.position,d=a.count,u=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*d),g=new Float64Array(3*d),_=(0,n.a)((0,s.c)(),o.transform);let v=0,T=0;for(let n=0;n<d;n++){a.getVec(n,h),i.getVec(n,u),(0,l.m)(h,h,o.transform),(0,l.b)(f,h,t.center),(0,l.D)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),d=Math.min(.45+.55*c*c,1);(0,l.D)(f,f,t.radius),null!==_&&(0,l.m)(f,f,_),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.h)(f,f,u,s>-1?.2:Math.min(-4*s-3.8,1)),g[v]=f[0],g[v+1]=f[1],g[v+2]=f[2],v+=3,p[T]=255*d,p[T+1]=255*d,p[T+2]=255*d,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(o,a));const u=!!t.usePBR,h=o.meta.isEsriSymbolResource?{usePBR:u,isSchematic:!1,treeRendering:d,mrrFactors:[0,1,.2]}:{usePBR:u,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:d},{engineResources:p,referenceBoundingBox:g}=ar(o,h,f,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:p,referenceBoundingBox:g,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1}}function or(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function ar(e,t,r,i){const a=e.model,n=new Array,s=new Map,l=new Map,c=a.lods.length,u=(0,d.cS)();return a.lods.forEach(((e,T)=>{const x=!0===i.skipHighLods&&(c>1&&0===T||c>3&&1===T)||!1===i.skipHighLods&&null!=i.singleLodIndex&&T!==i.singleLodIndex;if(x&&0!==T)return;const A=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=x?new Ut({}):function(e,t,r,i,o,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),c=null!=t.attributes.texCoord0,d=null!=t.attributes.normal;if(null==l)return null;const u=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(l.alphaMode);if(!a.has(s)){if(c){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;n.set(t,new Me((0,E.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,E.$A)(e)&&r,encoding:(0,E.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,u!==B.JJ.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/rr.K),h=l.color[1]**(1/rr.K),m=l.color[2]**(1/rr.K),f=l.emissiveFactor[0]**(1/rr.K),p=l.emissiveFactor[1]**(1/rr.K),g=l.emissiveFactor[2]**(1/rr.K),_=null!=l.textureColor&&c?n.get(l.textureColor):null;a.set(s,new Ut({...i,transparent:u===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:u,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,h,m],ambient:[r,h,m],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:d?He.r.Attribute:He.r.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=_?_.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&c?n.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=_&&!!_.params.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&c?n.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&c?n.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&c?n.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[f,p,g],mrrFactors:[l.metallicFactor,l.roughnessFactor,i.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:R(l.colorTextureTransform),normalTextureTransformMatrix:R(l.normalTextureTransform),occlusionTextureTransformMatrix:R(l.occlusionTextureTransform),emissiveTextureTransformMatrix:R(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(l.metallicRoughnessTextureTransform),...o}))}const h=a.get(s);if(r.stageResources.materials.push(h),c){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return h}(a,e,A,t,r,s,l),{geometry:n,vertexCount:c}=function(e,t){const r=e.attributes.position.count,i=(0,b.p)(e.indices||r,e.primitiveType),a=h(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.position;(0,f.t)(a,n,e.transform,3,s);const l=[[oe.T.POSITION,new F.a(a,3,!0)]],c=[[oe.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.normal;(0,o.b)(nr,e.transform),(0,f.a)(t,a,nr,3,n),l.push([oe.T.NORMAL,new F.a(t,3,!0)]),c.push([oe.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.tangent;(0,o.b)(nr,e.transform),(0,p.t)(t,a,nr,4,n),l.push([oe.T.TANGENT,new F.a(t,4,!0)]),c.push([oe.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,g.n)(t,o,2,a),l.push([oe.T.UV0,new F.a(t,2,!0)]),c.push([oe.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,v.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,_.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([oe.T.COLOR,new F.a(t,4,!0)]),c.push([oe.T.COLOR,i])}return{geometry:new ae(t,l,c),vertexCount:r}}(e,null!=i?i:new Ut({})),S=n.boundingInfo;null!=S&&0===T&&((0,d.pp)(u,S.bbMin),(0,d.pp)(u,S.bbMax)),null!=i&&(A.stageResources.geometries.push(n),A.numberOfVertices+=c)})),x||n.push(A)})),{engineResources:n,referenceBoundingBox:u}}const nr=(0,a.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),a=r(19693),n=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
284
|
+
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,a,n,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=a,c[6]=n,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return i()}function n(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>d,Z:()=>c,c:()=>i,f:()=>o});const c=a(),d=n(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:n,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>n,c:()=>o,d:()=>d,e:()=>l,n:()=>u,s:()=>c,t:()=>a});var i=r(72220);function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=3,a=o){if(e.length/o!==Math.ceil(t.length/a))return i.c.error("source and destination buffers need to have the same number of elements"),e;const n=e.length/o,s=r[0],l=r[1],c=r[2],d=r[4],u=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],_=r[13],v=r[14];let T=0,x=0;for(let r=0;r<n;r++){const r=t[T],i=t[T+1],n=t[T+2];e[x]=s*r+d*i+m*n+g,e[x+1]=l*r+u*i+f*n+_,e[x+2]=c*r+h*i+p*n+v,T+=a,x+=o}return e}function n(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,a=o){if(e.length/o!==Math.ceil(t.length/a))return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.length/o,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,_=0;for(let r=0;r<n;r++){const r=t[g],i=t[g+1],n=t[g+2];e[_]=s*r+d*i+m*n,e[_+1]=l*r+u*i+f*n,e[_+2]=c*r+h*i+p*n,g+=a,_+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),a=t.typedBuffer,n=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*a[s],e[l+1]=r*a[s+1],e[l+2]=r*a[s+2],s+=n,l+=i}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let a=0,n=0;for(let s=0;s<o;s++){const o=t[a],s=t[a+1],l=t[a+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[n]=t*o,e[n+1]=t*s,e[n+2]=t*l}a+=i,n+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=n[l]>>r,o[c+1]=n[l+1]>>r,o[c+2]=n[l+2]>>r,l+=s,c+=a},transformMat3:s,transformMat3View:n,transformMat4:a,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>d,zk:()=>c});var i=r(22021),o=r(22807),a=r(17896),n=r(65617),s=r(12981);function l(e){return e?{origin:(0,n.a)(e.origin),vector:(0,n.a)(e.vector)}:{origin:(0,n.c)(),vector:(0,n.c)()}}function c(e,t,r=l()){return(0,a.c)(r.origin,e),(0,a.b)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,n){const{vector:l,origin:c}=e,d=(0,a.b)(s.WM.get(),t,c),u=(0,a.e)(l,d)/(0,a.p)(l);return(0,a.g)(n,l,(0,i.uZ)(u,0,1)),(0,a.a)(n,n,e.origin)}(e,t,0,0,r)}(0,n.c)(),(0,n.c)(),new o.x((()=>l()))},70723:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>ir,gltfToEngineResources:()=>ar,parseUrl:()=>or});var i=r(32243),o=r(21787),a=r(46521),n=r(52138),s=r(13598),l=r(17896),c=r(65617),d=r(60437),u=r(1533);function h(e,t=!1){return e<=u.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),_=r(56067),v=r(75488),T=r(40270),x=r(91695),b=r(91911),E=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,a=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),n=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,n,s),(0,o.m)(l,a,l),l}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var y=r(3172),O=r(66643),M=r(43090),P=r(20102),N=r(92604);class I{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function H(e,t){const{data:r}=await(0,y.default)(e,{responseType:"image",...t});return r}var F=r(51417),B=r(47026),U=r(24882);function z(e){if(e.length<u.DB)return Array.from(e);if((0,u.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,u.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var V=r(44553),G=r(11726);class W{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,G.hu)(e.length>=1),(0,G.hu)(r.length%this._numIndexPerPrimitive==0),(0,G.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,G.hu)(3===i.size||4===i.size);const{data:o,size:a}=i,n=e.length;let s=a*r[this._numIndexPerPrimitive*e[0]];k.clear(),k.push(s);const d=(0,c.f)(o[s],o[s+1],o[s+2]),u=(0,c.a)(d);for(let t=0;t<n;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=a*r[i+e],k.push(s);let t=o[s];d[0]=Math.min(t,d[0]),u[0]=Math.max(t,u[0]),t=o[s+1],d[1]=Math.min(t,d[1]),u[1]=Math.max(t,u[1]),t=o[s+2],d[2]=Math.min(t,d[2]),u[2]=Math.max(t,u[2])}}this.bbMin=d,this.bbMax=u;const h=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(u[0]-d[0],u[1]-d[1]),u[2]-d[2]);let m=this.radius*this.radius;for(let e=0;e<k.length;++e){s=k.getItemAt(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],a=t*t+r*r+i*i;if(a<=m)continue;const n=Math.sqrt(a),l=.5*(n-this.radius);this.radius=this.radius+l,m=this.radius*this.radius;const c=l/n;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,k.clear()}getChildren(){if(this._children||(0,l.d)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:o,size:a}=this.position;for(let n=0;n<t;++n){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[n];let l=a*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=a*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<e[2]&&(t|=4),r[n]=t,++i[t]}let n=0;for(let e=0;e<8;++e)i[e]>0&&++n;if(n<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==s[e]&&this._children.push(new W(s[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){k.prune()}}const k=new V.Z({deallocator:null});var $=r(17662),q=r(4726),j=r(22807),X=r(16996);function Y(e,t,r){return(0,l.b)(J,t,e),(0,l.b)(K,r,e),(0,l.l)((0,l.f)(J,J,K))/2}r(12981),new j.x(X.Ue),new j.x((()=>{return e?{p0:(0,c.a)(e.p0),p1:(0,c.a)(e.p1),p2:(0,c.a)(e.p2)}:{p0:(0,c.c)(),p1:(0,c.c)(),p2:(0,c.c)()};var e}));const J=(0,c.c)(),K=(0,c.c)(),Z=(0,c.c)(),Q=(0,c.c)(),ee=(0,c.c)(),te=(0,c.c)();var re=r(99001);class ie{constructor(e){this.channel=e,this.id=(0,re.D)()}}var oe=r(35065);r(9820),(0,c.c)(),new Float32Array(6);class ae extends $.c{constructor(e,t,r=[],i=null,o=q.U.Mesh,a=null,n=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=a,this.edgeIndicesLength=n,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,U.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,U.mi)(t)),e===oe.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new ae(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===q.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===q.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,l.m)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0),(0,l.s)(te,0,0,0);let a=0,n=0;for(let e=0;e<t.length-2;e+=3){const s=t[e]*i,c=t[e+1]*i,d=t[e+2]*i;(0,l.s)(Z,o[s],o[s+1],o[s+2]),(0,l.s)(Q,o[c],o[c+1],o[c+2]),(0,l.s)(ee,o[d],o[d+1],o[d+2]);const u=Y(Z,Q,ee);u?((0,l.a)(Z,Z,Q),(0,l.a)(Z,Z,ee),(0,l.g)(Z,Z,1/3*u),(0,l.a)(r,r,Z),a+=u):((0,l.a)(te,te,Z),(0,l.a)(te,te,Q),(0,l.a)(te,te,ee),n+=3)}return!(0===n&&0===a||(0!==a?((0,l.g)(r,r,1/a),0):0===n||((0,l.g)(r,te,1/n),0)))}(this.vertexAttributes.get(oe.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(oe.T.POSITION),r=this.indices.get(oe.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,l.s)(i,0,0,0),(0,l.s)(te,0,0,0);let o=0,a=0;const{size:n,data:s}=e,c=t?t.length-1:s.length/n-1,d=c+(r?2:0);for(let e=0;e<d;e+=2){const r=e<c?e:c,d=e<c?e+1:0,u=(t?t[r]:r)*n,h=(t?t[d]:d)*n;Z[0]=s[u],Z[1]=s[u+1],Z[2]=s[u+2],Q[0]=s[h],Q[1]=s[h+1],Q[2]=s[h+2],(0,l.g)(Z,(0,l.a)(Z,Z,Q),.5);const m=(0,l.j)(Z,Q);m>0?((0,l.a)(i,i,(0,l.g)(Z,Z,m)),o+=m):0===o&&((0,l.a)(te,te,Z),a++)}return 0!==o?((0,l.g)(i,i,1/o),!0):0!==a&&((0,l.g)(i,te,1/a),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0);let a=-1,n=0;for(let e=0;e<t.length;e++){const s=t[e]*i;a!==s&&(r[0]+=o[s],r[1]+=o[s+1],r[2]+=o[s+2],n++),a=s}return n>1&&(0,l.g)(r,r,1/n),n>0}(this.vertexAttributes.get(oe.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(oe.T.POSITION),t=this.vertexAttributes.get(oe.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===q.U.Mesh?3:1;(0,G.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,U.KF)(e.length/r);return new W(i,r,e,t)}get transformation(){return this._transformation??s.I}set transformation(e){this._transformation=e&&e!==s.I?(0,s.b)(e):null}get shaderTransformation(){return null!=this._shaderTransformer?this._shaderTransformer(this.transformation):this.transformation}get shaderTransformer(){return this._shaderTransformer}set shaderTransformer(e){this._shaderTransformer=e}get hasVolatileTransformation(){return null!=this._shaderTransformer}addHighlight(){const e=new ie(B.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ne=r(80442),se=r(32448),le=r(70586),ce=r(17452),de=r(85958),ue=r(99880);let he;var me,fe;(fe=me||(me={}))[fe.ETC1_RGB=0]="ETC1_RGB",fe[fe.ETC2_RGBA=1]="ETC2_RGBA",fe[fe.BC1_RGB=2]="BC1_RGB",fe[fe.BC3_RGBA=3]="BC3_RGBA",fe[fe.BC4_R=4]="BC4_R",fe[fe.BC5_RG=5]="BC5_RG",fe[fe.BC7_M6_RGB=6]="BC7_M6_RGB",fe[fe.BC7_M5_RGBA=7]="BC7_M5_RGBA",fe[fe.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",fe[fe.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",fe[fe.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",fe[fe.ATC_RGB=11]="ATC_RGB",fe[fe.ATC_RGBA=12]="ATC_RGBA",fe[fe.FXT1_RGB=17]="FXT1_RGB",fe[fe.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",fe[fe.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",fe[fe.ETC2_EAC_R11=20]="ETC2_EAC_R11",fe[fe.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",fe[fe.RGBA32=13]="RGBA32",fe[fe.RGB565=14]="RGB565",fe[fe.BGR565=15]="BGR565",fe[fe.RGBA4444=16]="RGBA4444";var pe=r(35371),ge=r(75656),_e=r(45762);let ve=null,Te=null;async function xe(){return null==Te&&(Te=function(){if(null==he){const e=e=>(0,ue.V)(`esri/libs/basisu/${e}`);he=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return he}(),ve=await Te),Te}function be(e,t,r,i,o){const a=(0,_e.RG)(t?pe.q_.COMPRESSED_RGBA8_ETC2_EAC:pe.q_.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function Ee(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Se(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[me.ETC2_RGBA,pe.q_.COMPRESSED_RGBA8_ETC2_EAC]:[me.ETC1_RGB,pe.q_.COMPRESSED_RGB8_ETC2]:c?i?[me.BC3_RGBA,pe.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[me.BC1_RGB,pe.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[me.RGBA32,pe.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,d))),s(e,d,m[e]);const f=m.length>1,p=f?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,g={...t,samplingMode:p,hasMipmap:f,internalFormat:u,width:o,height:a};return new ge.x(e,g,{type:"compressed",levels:m})}const Re=N.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function we(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Ce=we("DXT1"),ye=we("DXT3"),Oe=we("DXT5");class Me extends $.c{constructor(e,t){super(),this._data=e,this.type=q.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.Z,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:pe.e8.REPEAT,t:pe.e8.REPEAT},this.estimatedTexMemRequired=Me._estimateTexMemRequired(this._data,this.params),this._startPreload()}_startPreload(){const e=this._data;null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.HK)(e.src)||(0,ce.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if(null==e)return 0;if((0,u.eP)(e)||(0,u.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==ve)return e.byteLength;const r=new ve.KTX2File(new Uint8Array(e)),i=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==ve)return e.byteLength;const r=new ve.BasisFile(new Uint8Array(e)),i=Ee(r)?be(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;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Me._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this._data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:pe.No.TEXTURE_2D,pixelFormat:pe.VI.RGBA,dataType:pe.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e){if(null!=this._glTexture)return this._glTexture;if(null!=this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ge.x(e,this._createDescriptor(e),null),this._glTexture):"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,u.eP)(t)||(0,u.lq)(t))&&this.params.encoding===B.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.params.encoding===B.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.params.encoding===B.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,t)):(0,u.lq)(t)?this._loadFromPixelData(e,t):(0,u.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e){return this._data instanceof HTMLVideoElement&&null!=this._glTexture?this._data.readyState<Pe.HAVE_CURRENT_DATA||e===this._data.currentTime?e:(this._glTexture.setData(this._data),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.params.updateCallback&&this.params.updateCallback(),this._data.currentTime):e}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return Re.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Re.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,a;switch(i){case Ce:o=8,a=pe.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ye:o=16,a=pe.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:o=16,a=pe.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Re.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let n=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(Re.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:s}=i;return t.samplingMode=o.levels.length>1?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new ge.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==ve&&(ve=await xe());const i=new ve.KTX2File(new Uint8Array(r));if(!Ae(i))return null;i.startTranscoding();const o=Se(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==ve&&(ve=await xe());const i=new ve.BasisFile(new Uint8Array(r));if(!Ee(i))return null;i.startTranscoding();const o=Se(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(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,G.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?pe.VI.LUMINANCE:3===this.params.components?pe.VI.RGB:pe.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new ge.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await H(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,de.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=Pe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,le.hw)(l)},n=()=>{t.readyState>=Pe.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},s=e=>{a(),o(e||new P.Z("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){const r=Me._getDataDimensions(t);this.params.width=r.width,this.params.height=r.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this.params.components?pe.VI.RGB:pe.VI.RGBA,i.width=r.width,i.height=r.height,this._glTexture=new ge.x(e,i,t),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(null!=this._glTexture&&(this._glTexture.dispose(),this._glTexture=null),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}var Pe,Ne;(Ne=Pe||(Pe={}))[Ne.HAVE_NOTHING=0]="HAVE_NOTHING",Ne[Ne.HAVE_METADATA=1]="HAVE_METADATA",Ne[Ne.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ne[Ne.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ne[Ne.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var Ie=r(64822),Le=r(65576),De=r(55039),He=r(60624),Fe=r(19419),Be=r(85504),Ue=r(60537),ze=r(82791),Ve=r(93144),Ge=r(27097);const We=(0,Ge.wK)(pe.zi.SRC_ALPHA,pe.zi.ONE,pe.zi.ONE_MINUS_SRC_ALPHA,pe.zi.ONE_MINUS_SRC_ALPHA),ke=(0,Ge.if)(pe.zi.ONE,pe.zi.ONE),$e=(0,Ge.if)(pe.zi.ZERO,pe.zi.ONE_MINUS_SRC_ALPHA);function qe(e){return e===Ve.A.FrontFace?null:e===Ve.A.Alpha?$e:ke}const je={factor:-1,units:-2};function Xe(e,t=pe.wb.LESS){return e===Ve.A.NONE||e===Ve.A.FrontFace?t:pe.wb.LEQUAL}var Ye,Je;(Je=Ye||(Ye={}))[Je.INTEGRATED_MESH=0]="INTEGRATED_MESH",Je[Je.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",Je[Je.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",Je[Je.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",Je[Je.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",Je[Je.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",Je[Je.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",Je[Je.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",Je[Je.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",Je[Je.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",Je[Je.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",Je[Je.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",Je[Je.LASERLINES=12]="LASERLINES",Je[Je.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",Je[Je.HUD_MATERIAL=14]="HUD_MATERIAL",Je[Je.LABEL_MATERIAL=15]="LABEL_MATERIAL",Je[Je.LINE_CALLOUTS=16]="LINE_CALLOUTS",Je[Je.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",Je[Je.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",Je[Je.DRAPED_WATER=19]="DRAPED_WATER",Je[Je.VOXEL=20]="VOXEL",Je[Je.MAX_SLOTS=21]="MAX_SLOTS";var Ke=r(51305),Ze=r(94961),Qe=r(72119),et=r(29268);const tt=(0,c.c)(),rt=(0,c.c)(),it=(0,c.c)(),ot=new class{constructor(e=0){this.offset=e,this.sphere=(0,et.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],a=i[1]*e+i[5]*t+i[9]*r+i[13],n=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+a*a+n*n);o+=o*s,a+=a*s,n+=n*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*a+l[8]*n+l[12],this.tmpVertex[1]=l[1]*o+l[5]*a+l[9]*n+l[13],this.tmpVertex[2]=l[2]*o+l[6]*a+l[10]*n+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,et.c)(),this._obb={center:(0,c.c)(),halfSize:(0,Qe.c)(),quaternion:null},this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,a=r+this.componentLocalOriginLength,n=this._totalOffset/Math.sqrt(i*i+o*o+a*a);return this._tmpVertex[0]=e+i*n,this._tmpVertex[1]=t+o*n,this._tmpVertex[2]=r+a*n,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],a=e[4],n=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*a<0?0:Math.min(Math.abs(r),Math.abs(a)),c=i*n<0?0:Math.min(Math.abs(i),Math.abs(n)),d=Math.sqrt(s*s+l*l+c*c);if(d<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=a>0?this._totalOffset:0,e[5]+=n>0?this._totalOffset:0,e;const u=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(a)),m=Math.max(Math.abs(i),Math.abs(n)),f=Math.sqrt(u*u+h*h+m*m),p=this._totalOffset/f,g=this._totalOffset/d;return e[0]+=t*(t>0?p:g),e[1]+=r*(r>0?p:g),e[2]+=i*(i>0?p:g),e[3]+=o*(o<0?p:g),e[4]+=a*(a<0?p:g),e[5]+=n*(n<0?p:g),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,l.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,l.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,l.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,Ke.c)(at,e.quaternion),(0,l.q)(this._obb.halfSize,this._obb.halfSize,at),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],a=r+this.localOrigin[2],n=this.offset/Math.sqrt(i*i+o*o+a*a);return this.tmpVertex[0]=e+i*n,this.tmpVertex[1]=t+o*n,this.tmpVertex[2]=r+a*n,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)tt[t]=e[0+t]+this.localOrigin[t],rt[t]=e[3+t]+this.localOrigin[t],it[t]=tt[t];const t=this.applyToVertex(tt[0],tt[1],tt[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)it[t]=0==(e&1<<t)?tt[t]:rt[t];r(it)}let i=0;for(let e=0;e<3;++e)tt[e]*rt[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)it[t]=0!=(i&1<<t)?0:0!=(e&1<<t)?tt[t]:rt[t];r(it)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const at=(0,Ze.a)();function nt(e,t,r,i){const o=r.typedBuffer,a=r.typedBufferStride,n=e.length;i*=a;for(let r=0;r<n;++r){const n=2*e[r];o[i]=t[n],o[i+1]=t[n+1],i+=a}}function st(e,t,r,i,o){const a=r.typedBuffer,n=r.typedBufferStride,s=e.length;if(i*=n,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];a[i]=t[o],a[i+1]=t[o+1],a[i+2]=t[o+2],i+=n}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)a[i]=t[s],a[i+1]=t[s+1],a[i+2]=t[s+2],i+=n}}function lt(e,t,r,i,o=1){const a=r.typedBuffer,n=r.typedBufferStride,s=e.length;if(i*=n,1===o)for(let r=0;r<s;++r){const o=4*e[r];a[i]=t[o],a[i+1]=t[o+1],a[i+2]=t[o+2],a[i+3]=t[o+3],i+=n}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)a[i]=t[s],a[i+1]=t[s+1],a[i+2]=t[s+2],a[i+3]=t[s+3],i+=n}}function ct(e,t,r,i,o,a=1){if(!r)return void st(e,t,i,o,a);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,d=r[0],u=r[1],h=r[2],m=r[4],f=r[5],p=r[6],g=r[8],_=r[9],v=r[10],T=r[12],x=r[13],b=r[14];o*=l;let E=0,A=0,S=0;const R=(0,n.y)(r)?e=>{E=t[e]+T,A=t[e+1]+x,S=t[e+2]+b}:e=>{const r=t[e],i=t[e+1],o=t[e+2];E=d*r+m*i+g*o+T,A=u*r+f*i+_*o+x,S=h*r+p*i+v*o+b};if(1===a)for(let t=0;t<c;++t)R(3*e[t]),s[o]=E,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){R(3*e[t]);for(let e=0;e<a;++e)s[o]=E,s[o+1]=A,s[o+2]=S,o+=l}}function dt(e,t,r,i,o,a=1){if(!r)return void st(e,t,i,o,a);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],_=s[8],v=s[9],T=s[10],x=!(0,n.z)(s),b=1e-6,E=1-b;o*=c;let A=0,S=0,R=0;const w=(0,n.y)(s)?e=>{A=t[e],S=t[e+1],R=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=u*r+f*i+_*o,S=h*r+p*i+v*o,R=m*r+g*i+T*o};if(1===a)if(x)for(let t=0;t<d;++t){w(3*e[t]);const r=A*A+S*S+R*R;if(r<E&&r>b){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=R*e}else l[o]=A,l[o+1]=S,l[o+2]=R;o+=c}else for(let t=0;t<d;++t)w(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=R,o+=c;else for(let t=0;t<d;++t){if(w(3*e[t]),x){const e=A*A+S*S+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}for(let e=0;e<a;++e)l[o]=A,l[o+1]=S,l[o+2]=R,o+=c}}function ut(e,t,r,i,o,a=1){if(!r)return void lt(e,t,i,o,a);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],_=s[8],v=s[9],T=s[10],x=!(0,n.z)(s),b=1e-6,E=1-b;if(o*=c,1===a)for(let r=0;r<d;++r){const i=4*e[r],a=t[i],n=t[i+1],s=t[i+2],d=t[i+3];let A=u*a+f*n+_*s,S=h*a+p*n+v*s,R=m*a+g*n+T*s;if(x){const e=A*A+S*S+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}l[o]=A,l[o+1]=S,l[o+2]=R,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],n=t[i],s=t[i+1],d=t[i+2],A=t[i+3];let S=u*n+f*s+_*d,R=h*n+p*s+v*d,w=m*n+g*s+T*d;if(x){const e=S*S+R*R+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<a;++e)l[o]=S,l[o+1]=R,l[o+2]=w,l[o+3]=A,o+=c}}function ht(e,t,r,i,o,a=1){const n=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==a)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<a;++e)n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<a;++e)n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=255,o+=s}}else{n[o]=t[0],n[o+1]=t[1],n[o+2]=t[2],n[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const d=l*a;for(let t=1;t<d;++t)e[o]=c,o+=r}}function mt(e,t,r,i){const o=r.typedBuffer,a=r.typedBufferStride,n=e.length,s=t[0];i*=a;for(let e=0;e<n;++e)o[i]=s,i+=a}function ft(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}class pt{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(oe.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,a){for(const n of t.fields.keys()){const t=e.vertexAttributes.get(n),s=e.indices.get(n);if(t&&s)switch(n){case oe.T.POSITION:{(0,G.hu)(3===t.size);const e=o.getField(n,m.ct);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&ct(s,t.data,r,e,a);break}case oe.T.NORMAL:{(0,G.hu)(3===t.size);const e=o.getField(n,m.ct);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&dt(s,t.data,i,e,a);break}case oe.T.NORMALCOMPRESSED:{(0,G.hu)(2===t.size);const e=o.getField(n,m.or);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&nt(s,t.data,e,a);break}case oe.T.UV0:{(0,G.hu)(2===t.size);const e=o.getField(n,m.Eu);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&nt(s,t.data,e,a);break}case oe.T.COLOR:case oe.T.SYMBOLCOLOR:{const e=o.getField(n,m.mc);(0,G.hu)(!!e,`No buffer view for ${n}`),(0,G.hu)(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||ht(s,t.data,t.size,e,a);break}case oe.T.COLORFEATUREATTRIBUTE:{const e=o.getField(n,m.ly);(0,G.hu)(!!e,`No buffer view for ${n}`),(0,G.hu)(1===t.size),e&&1===t.size&&mt(s,t.data,e,a);break}case oe.T.TANGENT:{(0,G.hu)(4===t.size);const e=o.getField(n,m.ek);(0,G.hu)(!!e,`No buffer view for ${n}`),e&&ut(s,t.data,i,e,a);break}case oe.T.PROFILERIGHT:case oe.T.PROFILEUP:case oe.T.PROFILEVERTEXANDNORMAL:case oe.T.FEATUREVALUE:{(0,G.hu)(4===t.size);const e=o.getField(n,m.ek);(0,G.hu)(!!e,`No buffer view for ${n}`),e&<(s,t.data,e,a)}}else if(n===oe.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(oe.T.POSITION);if((0,G.hu)(!!t,`No buffer view for ${n}`),t){const r=t.length,i=o.getField(n,m.mc);ft(e.objectAndLayerIdColor,i,r,a)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var gt=r(57790),_t=r(88669),vt=r(135),Tt=r(15719),xt=r(96310),bt=r(78869),Et=r(14589),At=r(83475),St=r(59377);pe.wb.LESS,pe.wb.ALWAYS;const Rt={mask:255},wt={function:{func:pe.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:pe.xS.KEEP,zFail:pe.xS.KEEP,zPass:pe.xS.ZERO}},Ct={function:{func:pe.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:pe.xS.KEEP,zFail:pe.xS.KEEP,zPass:pe.xS.REPLACE}};pe.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,pe.xS.KEEP,pe.xS.KEEP,pe.xS.KEEP,pe.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,pe.xS.KEEP,pe.xS.KEEP,pe.xS.KEEP;var yt=r(32078);class Ot extends Tt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=He.r.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,_t.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=xt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=ze.yD.Occlude}}class Mt extends Et.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===Ie.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?vt.N.Default:vt.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Mt.shader)}_initializeProgram(e,t){return new St.$(e.rctx,t.get().build(this.configuration),At.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?pe.wb.LEQUAL:pe.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===Ve.A.NONE,o=e===Ve.A.FrontFace;return(0,Ge.sm)({blending:r.output!==De.H.Color&&r.output!==De.H.Alpha||!r.transparent?null:i?We:qe(e),culling:Pt(r)?(0,Ge.zp)(r.cullFace):null,depthTest:{func:Xe(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ge.LZ:null,colorWrite:Ge.BK,stencilWrite:r.hasOccludees?Rt:null,stencilTest:r.hasOccludees?t?Ct:wt:null,polygonOffset:i||o?null:(a=r.enableOffset,a?je:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function Pt(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Mt.shader=new bt.J(yt.D,(()=>r.e(9291).then(r.bind(r,79291))));var Nt=r(43697),It=r(51354),Lt=r(67498);class Dt extends It.m{}(0,Nt._)([(0,It.o)({constValue:!0})],Dt.prototype,"hasSliceHighlight",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Dt.prototype,"hasSliceInVertexProgram",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Dt.prototype,"instancedDoublePrecision",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Dt.prototype,"hasModelTransformation",void 0),(0,Nt._)([(0,It.o)({constValue:Lt.P.Pass})],Dt.prototype,"pbrTextureBindType",void 0);class Ht extends Dt{constructor(){super(...arguments),this.output=De.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=Fe.q.None,this.pbrMode=Be.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=Ve.A.NONE,this.normalType=He.r.Attribute,this.textureCoordinateType=vt.N.None,this.customDepthTest=B.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Nt._)([(0,It.o)({count:De.H.COUNT})],Ht.prototype,"output",void 0),(0,Nt._)([(0,It.o)({count:B.JJ.COUNT})],Ht.prototype,"alphaDiscardMode",void 0),(0,Nt._)([(0,It.o)({count:Fe.q.COUNT})],Ht.prototype,"doubleSidedMode",void 0),(0,Nt._)([(0,It.o)({count:Be.f7.COUNT})],Ht.prototype,"pbrMode",void 0),(0,Nt._)([(0,It.o)({count:B.Vr.COUNT})],Ht.prototype,"cullFace",void 0),(0,Nt._)([(0,It.o)({count:Ve.A.COUNT})],Ht.prototype,"transparencyPassType",void 0),(0,Nt._)([(0,It.o)({count:He.r.COUNT})],Ht.prototype,"normalType",void 0),(0,Nt._)([(0,It.o)({count:vt.N.COUNT})],Ht.prototype,"textureCoordinateType",void 0),(0,Nt._)([(0,It.o)({count:B.Gv.COUNT})],Ht.prototype,"customDepthTest",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"spherical",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasVertexColors",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasSymbolColors",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasVerticalOffset",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasSlicePlane",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasSliceHighlight",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasColorTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasMetallicRoughnessTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasEmissionTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasOcclusionTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasNormalTexture",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasScreenSizePerspective",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasVertexTangents",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasOccludees",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasMultipassTerrain",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasModelTransformation",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"offsetBackfaces",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"vvSize",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"vvColor",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"receiveShadows",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"receiveAmbientOcclusion",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"textureAlphaPremultiplied",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"instanced",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"instancedColor",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"instancedDoublePrecision",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"writeDepth",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"transparent",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"enableOffset",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"cullAboveGround",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"snowCover",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasColorTextureTransform",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasEmissionTextureTransform",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasNormalTextureTransform",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasOcclusionTextureTransform",void 0),(0,Nt._)([(0,It.o)()],Ht.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Nt._)([(0,It.o)({constValue:!0})],Ht.prototype,"hasVvInstancing",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Ht.prototype,"useCustomDTRExponentForWater",void 0),(0,Nt._)([(0,It.o)({constValue:!1})],Ht.prototype,"supportsTextureAtlas",void 0),(0,Nt._)([(0,It.o)({constValue:!0})],Ht.prototype,"useFillLights",void 0);var Ft=r(41846);class Bt extends Mt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=He.r.Attribute,t.doubleSidedMode=Fe.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Bt.shader)}}Bt.shader=new bt.J(Ft.R,(()=>r.e(8096).then(r.bind(r,38096))));class Ut extends ze.F5{constructor(e){super(e,Vt),this.supportsEdges=!0,this._configuration=new Ht,this._vertexBufferLayout=function(e){const t=(0,Le.U$)().vec3f(oe.T.POSITION);return e.normalType===He.r.Compressed?t.vec2i16(oe.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(oe.T.NORMAL),e.hasVertexTangents&&t.vec4f(oe.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(oe.T.UV0),e.hasVertexColors&&t.vec4u8(oe.T.COLOR),e.hasSymbolColors&&t.vec4u8(oe.T.SYMBOLCOLOR),(0,ne.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(oe.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==De.H.Shadow&&e!==De.H.ShadowExcludeHighlight&&e!==De.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==De.H.Color&&e!==De.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Fe.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Fe.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Fe.q.WindingOrder:Fe.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Be.f7.Schematic:Be.f7.Normal:Be.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(jt,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case Ie.JY.Global:a=(0,l.n)($t,jt);break;case Ie.JY.Local:a=(0,l.c)($t,kt)}let n=0;const s=(0,l.b)(Xt,jt,e.eye),c=(0,l.l)(s),d=(0,l.g)(s,s,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,l.e)(a,d)),n+=(0,gt.Hx)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,l.g)(a,a,n),(0,l.t)(qt,a,r.transform.inverseRotation),i=(0,l.b)(Gt,i,qt),o=(0,l.b)(Wt,o,qt)}(0,gt.Bw)(e,r,i,o,function(e){return null!=e?(ot.offset=e,ot):null}(r.verticalOffset),a)}requiresSlot(e,t){return!(t!==De.H.Color&&t!==De.H.Alpha&&t!==De.H.Depth&&t!==De.H.Normal&&t!==De.H.Shadow&&t!==De.H.ShadowHighlight&&t!==De.H.ShadowExcludeHighlight&&t!==De.H.Highlight&&t!==De.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Ye.TRANSPARENT_MATERIAL:Ye.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Ye.OPAQUE_MATERIAL)&&e!==Ye.DRAPED_MATERIAL)}createGLMaterial(e){return new zt(e)}createBufferWriter(){return new pt(this._vertexBufferLayout)}}class zt extends Ue.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==De.H.Color&&this._output!==De.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Bt:Mt,e)}}const Vt=new class extends Ot{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Gt=(0,c.c)(),Wt=(0,c.c)(),kt=(0,c.f)(0,0,1),$t=(0,c.c)(),qt=(0,c.c)(),jt=(0,c.c)(),Xt=(0,c.c)(),Yt=N.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Jt(e){throw new P.Z("",`Request for object resource failed: ${e}`)}function Kt(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Yt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Yt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Yt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Yt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Yt.warn("Indexed geometries must specify faces"),i=!1;break}default:Yt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Yt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Yt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Zt(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,d.pp)(t,r.bbMin),(0,d.pp)(t,r.bbMax))})),t}function Qt(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function er(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const tr=new D.G(1,2,"wosr");var rr=r(57758);async function ir(e,t){const r=or((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,O.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Jt(i.error.details.url)}(e,r,t);const i=await(0,O.q6)((0,y.default)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Jt(i.error)}(e,t),i=await async function(e,t){const r=[];for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Yt.warn("Externally referenced texture data is not yet supported");continue}const n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.e8.REPEAT,t:pe.e8.REPEAT},preMultiplyAlpha:Qt(l)!==B.JJ.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):H(n,t);r.push(d.then((e=>({refId:s,image:e,params:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,M.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,a=new I,n=e.resource,s=D.G.parse(n.version||"1.0","wosr");tr.validate(s);const l=n.model.name,d=n.model.geometries,u=n.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<d.length;e++){const n=d[e];if(!Kt(n))continue;const s=er(n),l=n.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new F.a(r,t.valuesPerElement,!0)])}const g=[];if("PerAttributeArray"!==n.params.topology){const e=n.params.faces;for(const t in e)g.push([t,e[t].values])}const _=s.texture,v=h&&h[_];if(v&&!f.has(_)){const{image:e,params:t}=v,r=new Me(e,t);i.push(r),f.set(_,r)}const T=f.get(_),x=T?T.id:void 0,b=s.material;let E=a.get(b,_);if(null==E){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=v?Qt(v.alphaChannelUsage):void 0,n={ambient:(0,c.d)(e.diffuse),diffuse:(0,c.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};null!=t&&t.materialParamsMixin&&Object.assign(n,t.materialParamsMixin),E=new Ut(n),a.set(b,_,E)}o.push(E);const A=new ae(E,p,g);m+=g.find((e=>e[0]===oe.T.POSITION))?.[1].length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Zt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const o=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),a=o.model.meta?.ESRI_proxyEllipsoid,d=o.meta.isEsriSymbolResource&&null!=a&&o.meta.uri.includes("/RealisticTrees/");d&&!o.customMeta.esriTreeRendering&&(o.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const a=o.attributes.position,d=a.count,u=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*d),g=new Float64Array(3*d),_=(0,n.a)((0,s.c)(),o.transform);let v=0,T=0;for(let n=0;n<d;n++){a.getVec(n,h),i.getVec(n,u),(0,l.m)(h,h,o.transform),(0,l.b)(f,h,t.center),(0,l.D)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),d=Math.min(.45+.55*c*c,1);(0,l.D)(f,f,t.radius),null!==_&&(0,l.m)(f,f,_),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.h)(f,f,u,s>-1?.2:Math.min(-4*s-3.8,1)),g[v]=f[0],g[v+1]=f[1],g[v+2]=f[2],v+=3,p[T]=255*d,p[T+1]=255*d,p[T+2]=255*d,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(o,a));const u=!!t.usePBR,h=o.meta.isEsriSymbolResource?{usePBR:u,isSchematic:!1,treeRendering:d,mrrFactors:[0,1,.2]}:{usePBR:u,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:d},{engineResources:p,referenceBoundingBox:g}=ar(o,h,f,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:p,referenceBoundingBox:g,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1}}function or(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function ar(e,t,r,i){const a=e.model,n=new Array,s=new Map,l=new Map,c=a.lods.length,u=(0,d.cS)();return a.lods.forEach(((e,T)=>{const x=!0===i.skipHighLods&&(c>1&&0===T||c>3&&1===T)||!1===i.skipHighLods&&null!=i.singleLodIndex&&T!==i.singleLodIndex;if(x&&0!==T)return;const A=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=x?new Ut({}):function(e,t,r,i,o,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),c=null!=t.attributes.texCoord0,d=null!=t.attributes.normal;if(null==l)return null;const u=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(l.alphaMode);if(!a.has(s)){if(c){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;n.set(t,new Me((0,E.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,E.$A)(e)&&r,encoding:(0,E.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,u!==B.JJ.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/rr.K),h=l.color[1]**(1/rr.K),m=l.color[2]**(1/rr.K),f=l.emissiveFactor[0]**(1/rr.K),p=l.emissiveFactor[1]**(1/rr.K),g=l.emissiveFactor[2]**(1/rr.K),_=null!=l.textureColor&&c?n.get(l.textureColor):null;a.set(s,new Ut({...i,transparent:u===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:u,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,h,m],ambient:[r,h,m],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:d?He.r.Attribute:He.r.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=_?_.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&c?n.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=_&&!!_.params.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&c?n.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&c?n.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&c?n.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[f,p,g],mrrFactors:[l.metallicFactor,l.roughnessFactor,i.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:R(l.colorTextureTransform),normalTextureTransformMatrix:R(l.normalTextureTransform),occlusionTextureTransformMatrix:R(l.occlusionTextureTransform),emissiveTextureTransformMatrix:R(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(l.metallicRoughnessTextureTransform),...o}))}const h=a.get(s);if(r.stageResources.materials.push(h),c){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return h}(a,e,A,t,r,s,l),{geometry:n,vertexCount:c}=function(e,t){const r=e.attributes.position.count,i=(0,b.p)(e.indices||r,e.primitiveType),a=h(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.position;(0,f.t)(a,n,e.transform,3,s);const l=[[oe.T.POSITION,new F.a(a,3,!0)]],c=[[oe.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.normal;(0,o.b)(nr,e.transform),(0,f.a)(t,a,nr,3,n),l.push([oe.T.NORMAL,new F.a(t,3,!0)]),c.push([oe.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.tangent;(0,o.b)(nr,e.transform),(0,p.t)(t,a,nr,4,n),l.push([oe.T.TANGENT,new F.a(t,4,!0)]),c.push([oe.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,g.n)(t,o,2,a),l.push([oe.T.UV0,new F.a(t,2,!0)]),c.push([oe.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,v.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,_.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([oe.T.COLOR,new F.a(t,4,!0)]),c.push([oe.T.COLOR,i])}return{geometry:new ae(t,l,c),vertexCount:r}}(e,null!=i?i:new Ut({})),S=n.boundingInfo;null!=S&&0===T&&((0,d.pp)(u,S.bbMin),(0,d.pp)(u,S.bbMax)),null!=i&&(A.stageResources.geometries.push(n),A.numberOfVertices+=c)})),x||n.push(A)})),{engineResources:n,referenceBoundingBox:u}}const nr=(0,a.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),a=r(19693),n=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
285
285
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
286
286
|
}`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(n.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(n.H`void forwardLinearDepth() {
|
|
287
287
|
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
|
|
@@ -448,7 +448,7 @@ vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
|
448
448
|
void forwardNormal() {
|
|
449
449
|
vNormalWorld = ${t.spherical?s.H`normalize(vPositionWorldCameraRelative);`:s.H`vec3(0.0, 0.0, 1.0);`}
|
|
450
450
|
}
|
|
451
|
-
`);break;case a.r.ScreenDerivative:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:(0,i.Bg)(t.normalType);case a.r.COUNT:}}class u extends n.su{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.c)()}}},2095:(e,t,r)=>{r.d(t,{su:()=>p,up:()=>f});var i=r(46521),o=r(13598),a=
|
|
451
|
+
`);break;case a.r.ScreenDerivative:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:(0,i.Bg)(t.normalType);case a.r.COUNT:}}class u extends n.su{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.c)()}}},2095:(e,t,r)=>{r.d(t,{su:()=>p,up:()=>f});var i=r(46521),o=r(13598),a=r(65617),n=r(37099),s=r(89243),l=r(70582),c=r(172),d=r(74709),u=r(52114),h=r(19850),m=r(8319);function f(e,t){e.include(n.f);const r=e.vertex;r.include(s.$,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add([new c.J("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.c("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new m.g("transformProjFromView",(e=>e.transformProjFromView)),new u.j("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new l.B("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new l.B("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))]),r.code.add(d.H`vec3 positionWorldCameraRelative() {
|
|
452
452
|
vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
|
|
453
453
|
vec3 transform_CameraRelativeFromModel = dpAdd(
|
|
454
454
|
transformWorldFromModelTL,
|
|
@@ -1092,4 +1092,4 @@ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
|
|
|
1092
1092
|
);
|
|
1093
1093
|
float rgba2float(vec4 rgba) {
|
|
1094
1094
|
return dot(rgba, RGBA_2_FLOAT_FACTORS);
|
|
1095
|
-
}`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>m,Sv:()=>f,_8:()=>_});var i=r(52138),o=r(10937),a=r(17896),n=r(65617),s=r(70582),l=r(172),c=r(79884),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,a.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin))]);const r=e=>(0,a.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t)))])}const p=(0,o.c)(),g=(0,n.c)();function _(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,a)=>r.setUniform2fv(e,t(i,o,a))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,a)=>r.setUniform3fv(e,t(i,o,a))))}}},172:(e,t,r)=>{r.d(t,{J:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),o=r(92604),a=r(11726);const n=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){n.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.extensions=new f,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(o.constants.generateSource());return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${a.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${n.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)}));const i=Array.from(r.values()),o=i.length;return(e,r,a)=>{for(let n=0;n<o;++n)i[n](t,e,r,a)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new d,this.constants=new p}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}f.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],f.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif\n\nout vec4 fragColor;",_="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,a=null){this.name=e,this.type=t,this.arraySize=a,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},null!=r&&null!=o&&(this.bind[r]=o)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var a;(a=o||(o={})).int=function(e){return Math.round(e).toString()},a.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(70586),o=r(35371);class a{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>a});var i=r(74709);class o extends i.K{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function a(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits??[0];let s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);t._parameterBits=n;const l=n[s],c=(1<<a)-1<<l;n[s]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.NORMALCOMPRESSED,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEOBJECTANDLAYERIDCOLOR,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),a=r(74709),n=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return n.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?n.Rw.LOADED:n.Rw.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends a.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,a=r(65617),n=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(57790);class d extends n.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._pp0=(0,a.f)(0,0,1),this._pp1=(0,a.f)(0,0,0),this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){null!=this.repository&&this.repository.materialChanged(this)}intersectDraped(e,t,r,i,o,a){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>n});var i=r(44553),o=r(67498),a=r(49300);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(o.P.Pass,this),this.bindDraw=t.generateBind(o.P.Draw,this),this._fragmentUniforms=(0,a.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),null!=this._fragmentUniforms&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},57790:(e,t,r)=>{r.d(t,{FZ:()=>w,Uf:()=>A,Bw:()=>f,LO:()=>S,Hx:()=>E});var i=r(67676),o=r(22021),a=r(17896),n=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return Math.max((0,o.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}(e,function(e,t,r){const i=r.parameters,o=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=o,d}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var u=r(11726),h=r(35065);const m=(0,s.Ue)();function f(e,t,r,i,o,a){if(e.visible)if(e.boundingInfo){(0,u.hu)(e.type===l.U.Mesh);const n=t.tolerance;g(e.boundingInfo,r,i,n,o,a)}else{const t=e.indices.get(h.T.POSITION),n=e.vertexAttributes.get(h.T.POSITION);v(r,i,0,t.length/3,t,n,void 0,o,a)}}const p=(0,n.c)();function g(e,t,r,i,o,n){if(null==e)return;const l=function(e,t,r){return(0,a.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(m,e.bbMin),(0,s.Tn)(m,e.bbMax),null!=o&&o.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,l,i)){const{primitiveIndices:a,indices:s,position:l}=e,c=a?a.length:s.length/3;if(c>C){const a=e.getChildren();if(void 0!==a){for(const e of a)g(e,t,r,i,o,n);return}}v(t,r,0,c,s,l,a,o,n)}}const _=(0,n.c)();function v(e,t,r,i,o,a,n,s,l){if(n)return function(e,t,r,i,o,a,n,s,l){const{data:c,stride:d}=a,u=e[0],h=e[1],m=e[2],f=t[0]-u,p=t[1]-h,g=t[2]-m;for(let e=r;e<i;++e){const t=n[e];let r=3*t,i=d*o[r++],a=c[i++],v=c[i++],T=c[i];i=d*o[r++];let x=c[i++],E=c[i++],A=c[i];i=d*o[r];let S=c[i++],R=c[i++],w=c[i];null!=s&&([a,v,T]=s.applyToVertex(a,v,T,e),[x,E,A]=s.applyToVertex(x,E,A,e),[S,R,w]=s.applyToVertex(S,R,w,e));const C=x-a,y=E-v,O=A-T,M=S-a,P=R-v,N=w-T,I=p*N-P*g,L=g*M-N*f,D=f*P-M*p,H=C*I+y*L+O*D;if(Math.abs(H)<=Number.EPSILON)continue;const F=u-a,B=h-v,U=m-T,z=F*I+B*L+U*D;if(H>0){if(z<0||z>H)continue}else if(z>0||z<H)continue;const V=B*O-y*U,G=U*C-O*F,W=F*y-C*B,k=f*V+p*G+g*W;if(H>0){if(k<0||z+k>H)continue}else if(k>0||z+k<H)continue;const $=(M*V+P*G+N*W)/H;$>=0&&l($,b(C,y,O,M,P,N,_),t,!1)}}(e,t,r,i,o,a,n,s,l);const{data:c,stride:d}=a,u=e[0],h=e[1],m=e[2],f=t[0]-u,p=t[1]-h,g=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=d*o[t++],i=c[r++],a=c[r++],n=c[r];r=d*o[t++];let v=c[r++],T=c[r++],x=c[r];r=d*o[t++];let E=c[r++],A=c[r++],S=c[r];null!=s&&([i,a,n]=s.applyToVertex(i,a,n,e),[v,T,x]=s.applyToVertex(v,T,x,e),[E,A,S]=s.applyToVertex(E,A,S,e));const R=v-i,w=T-a,C=x-n,y=E-i,O=A-a,M=S-n,P=p*M-O*g,N=g*y-M*f,I=f*O-y*p,L=R*P+w*N+C*I;if(Math.abs(L)<=Number.EPSILON)continue;const D=u-i,H=h-a,F=m-n,B=D*P+H*N+F*I;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const U=H*C-w*F,z=F*R-C*D,V=D*w-R*H,G=f*U+p*z+g*V;if(L>0){if(G<0||B+G>L)continue}else if(G>0||B+G<L)continue;const W=(y*U+O*z+M*V)/L;W>=0&&l(W,b(R,w,C,y,O,M,_),e,!1)}}const T=(0,n.c)(),x=(0,n.c)();function b(e,t,r,i,o,n,s){return(0,a.s)(T,e,t,r),(0,a.s)(x,i,o,n),(0,a.f)(s,T,x),(0,a.n)(s,s),s}function E(e,t,r,i,a){let n=(r.screenLength||0)*e.pixelRatio;null!=a&&(n=c(n,i,t,a));const s=n*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=R(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const a=t[o];void 0!==a&&(Array.isArray(a)?null===e[o]?(e[o]=a.slice(),r=!0):(0,i.Vx)(e[o],a)&&(r=!0):e[o]!==a&&(r=!0,e[o]=a))}return r}function R(e){const t=[];return e.forEach((e=>t.push(e))),t}const w={multiply:1,ignore:2,replace:3,tint:4},C=1e3},75656:(e,t,r)=>{r.d(t,{x:()=>l}),r(80442);var i=r(22021),o=r(49300),a=r(7575),n=r(35371);const s={target:n.No.TEXTURE_2D,samplingMode:n.cw.LINEAR,wrapMode:n.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1};let l=class{constructor(e,t,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(n._g.Texture,this),this._descriptor={...s,...t};for(const e in s)void 0===this._descriptor[e]&&(this._descriptor[e]=s[e]);if(e.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),u(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===n.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(n._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===n.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=n.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=n.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor,a=t??i.target,s=u(a);null===e&&(i.width=i.width||4,i.height=i.height||4,s&&(i.depth=i.depth??1));const m=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),l._validateTexture(this._context,i),this._configurePixelStorage(),(0,o.zu)(r);const f=i.pixelFormat;let p=i.internalFormat??this._deriveInternalFormat(f,i.dataType);if(d(e)){let t=e.width,n=e.height;const l=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,n=e.videoHeight),i.width&&i.height,s&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,p,i.hasMipmap,t,n,l),this._texImage(a,0,p,t,n,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=t),void 0===i.height&&(i.height=n),s&&void 0===i.depth&&(i.depth=l)}else{const{width:t,height:l,depth:d}=i;if(null==t||null==l)throw new Error("Width and height must be specified!");if(s&&null==d)throw new Error("Depth must be specified!");if(i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,p,i.hasMipmap,t,l,d),r.DEPTH24_STENCIL8&&p===r.DEPTH_STENCIL&&(p=r.DEPTH24_STENCIL8),c(e)){const o=e.levels,s=h(a,t,l,d),c=Math.min(s-1,o.length-1);null!=this._context.gl2?r.texParameteri(i.target,this._context.gl2.TEXTURE_MAX_LEVEL,c):i.hasMipmap=i.hasMipmap&&s===o.length;const u=p;if(!function(e){return e in n.q_}(u))throw new Error("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const n=o[Math.min(e,o.length-1)];this._compressedTexImage(a,e,u,t,r,i,n)}),c)}else null!=e?(this._texImage(a,0,p,t,l,d,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,t,i,n)=>{this._texImage(a,e,p,t,i,n,null),(0,o.zu)(r)}))}l._applySamplingMode(r,this._descriptor),l._applyWrapMode(r,this._descriptor),l._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(m,l.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,o,a,n=0){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const s=this._context.gl,u=this._descriptor,{pixelFormat:h,dataType:m,target:f,isImmutable:p}=u,g=u.internalFormat??this._deriveInternalFormat(h,m);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const _=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||i>u.width||o>u.height||t+i>u.width||r+o>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),n){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,n)}if(d(a)?null!=this._context.gl2?this._context.gl2.texSubImage2D(f,e,t,r,i,o,h,m,a):s.texSubImage2D(f,e,t,r,h,m,a):c(a)?s.compressedTexSubImage2D(f,e,t,r,i,o,g,a.levels[e]):s.texSubImage2D(f,e,t,r,i,o,h,m,a),n){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(_,l.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,o,a,n,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl2;if(null==d)throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:m,dataType:f,isImmutable:p,target:g}=h,_=h.internalFormat??this._deriveInternalFormat(m,f);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");u(g)||console.warn("Attempting to set 3D texture data on a non-3D texture");const v=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||o>h.width||a>h.height||n>h.depth||t+o>h.width||r+a>h.height||i+n>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),c(s))s=s.levels[e],d.compressedTexSubImage3D(g,e,t,r,i,o,a,n,_,s);else{const l=s;d.texSubImage3D(g,e,t,r,i,o,a,n,m,f,l)}this._context.bindTexture(v,l.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,l._validateTexture(this._context,e)}e.samplingMode===n.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=n.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===n.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=n.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,l.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,l._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(l._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(l._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===a.zO.WEBGL1)return e;switch(t){case n.Br.FLOAT:switch(e){case n.VI.RGBA:return n.lP.RGBA32F;case n.VI.RGB:return n.lP.RGB32F;default:throw new Error("Unable to derive format")}case n.Br.UNSIGNED_BYTE:switch(e){case n.VI.RGBA:return n.lP.RGBA8;case n.VI.RGB:return n.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,o,a){const s=this._context.gl2;if(null==s)throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in n.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?h(e,i,o,a):1;if(u(e)){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,i,o,a)}else s.texStorage2D(e,l,t,i,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,n,s){const l=this._context.gl;let c=null;const h=this._context.type===a.zO.WEBGL2,m=u(e),{isImmutable:f,pixelFormat:p,dataType:g}=this._descriptor;if(h&&(c=l),h||!d(s))if(f){if(null!=s){const r=s;if(m){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,o,n,p,g,r)}else l.texSubImage2D(e,t,0,0,i,o,p,g,r)}}else{const a=s;if(m){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,o,n,0,p,g,a)}else l.texImage2D(e,t,r,i,o,0,p,g,a)}else l.texImage2D(e,0,r,p,g,s)}_compressedTexImage(e,t,r,i,o,n,s){const l=this._context.gl;let c=null;const d=u(e),h=this._descriptor.isImmutable;if(d){if(this._context.type!==a.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");c=l}if(h){if(null!=s)if(d){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,o,n,r,s)}else l.compressedTexSubImage2D(e,t,0,0,i,o,r,s)}else if(d){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,o,n,0,s)}else l.compressedTexImage2D(e,t,r,i,o,0,s)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:o,hasMipmap:a,target:s}=this._descriptor;const l=s===n.No.TEXTURE_3D;if(null==r||null==i||l&&null==o)throw new Error("Missing texture dimensions for mipmap calculation");for(let n=0;e(n,r,i,o),a&&(1!==r||1!==i||l&&1!==o)&&!(n>=t);++n)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===a.zO.WEBGL2,o=null!=t.width&&(0,i.wt)(t.width)&&null!=t.height&&(0,i.wt)(t.height);r||!t.isImmutable&&!u(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||o||("number"==typeof t.wrapMode?t.wrapMode!==n.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===n.e8.CLAMP_TO_EDGE&&t.wrapMode.t===n.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===n.cw.LINEAR_MIPMAP_NEAREST||r===n.cw.LINEAR_MIPMAP_LINEAR?(r=n.cw.LINEAR,t.hasMipmap||(i=n.cw.LINEAR)):r!==n.cw.NEAREST_MIPMAP_NEAREST&&r!==n.cw.NEAREST_MIPMAP_LINEAR||(r=n.cw.NEAREST,t.hasMipmap||(i=n.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};function c(e){return null!=e&&"type"in e&&"compressed"===e.type}function d(e){return null!=e&&!c(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function u(e){return e===n.No.TEXTURE_3D||e===n.No.TEXTURE_2D_ARRAY}function h(e,t,r,i=1){let o=Math.max(t,r);return e===n.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}l.TEXTURE_UNIT_FOR_UPDATES=0},45762:(e,t,r)=>{r.d(t,{RG:()=>o,un:()=>a}),r(80442);var i=r(35371);function o(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function a(e){if(null==e)return 0;if("descriptor"in e)return e.glName?a(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return o(t)*i*r}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const a=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),n=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return n}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){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"}}(e,t),o=(new Error).stack;a.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:o}))}}}},7575:(e,t,r)=>{r.d(t,{Sh:()=>n,kr:()=>a,zO:()=>i});var i,o=r(80442);function a(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];for(const t of o){const i=e.getContext(t,r);if(i)return i}return null}function n(e){if("3d"===e)return[i.WEBGL2];const t=(0,o.Z)("esri-force-webgl");return t===i.WEBGL1||t===i.WEBGL2?[t]:(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1]}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const a=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>u,LZ:()=>d,if:()=>a,sm:()=>x,wK:()=>n,zp:()=>c});var i=r(47026),o=r(35371);function a(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,a=o.db.ADD,n=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:a,opAlpha:n,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return A.intern(e)}function m(e){return R.intern(e)}function f(e){return C.intern(e)}function p(e){return O.intern(e)}function g(e){return P.intern(e)}function _(e){return I.intern(e)}function v(e){return D.intern(e)}function T(e){return F.intern(e)}function x(e){return U.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function E(e){return"["+e.join(",")+"]"}const A=new b(S,(e=>({__tag:"Blending",...e})));function S(e){return e?E([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const R=new b(w,(e=>({__tag:"Culling",...e})));function w(e){return e?E([e.face,e.mode]):null}const C=new b(y,(e=>({__tag:"PolygonOffset",...e})));function y(e){return e?E([e.factor,e.units]):null}const O=new b(M,(e=>({__tag:"DepthTest",...e})));function M(e){return e?E([e.func]):null}const P=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?E([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const I=new b(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?E([e.zNear,e.zFar]):null}const D=new b(H,(e=>({__tag:"ColorWrite",...e})));function H(e){return e?E([e.r,e.g,e.b,e.a]):null}const F=new b(B,(e=>({__tag:"StencilWrite",...e})));function B(e){return e?E([e.mask]):null}const U=new b((function(e){return e?E([S(e.blending),w(e.culling),y(e.polygonOffset),M(e.depthTest),N(e.stencilTest),L(e.depthWrite),H(e.colorWrite),B(e.stencilWrite)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:_(e.depthWrite),colorWrite:v(e.colorWrite),stencilWrite:T(e.stencilWrite)})))}}]);
|
|
1095
|
+
}`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>m,Sv:()=>f,_8:()=>_});var i=r(52138),o=r(13598),a=r(17896),n=r(65617),s=r(70582),l=r(172),c=r(79884),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,a.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin))]);const r=e=>(0,a.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t)))])}const p=(0,o.c)(),g=(0,n.c)();function _(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,a)=>r.setUniform2fv(e,t(i,o,a))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,a)=>r.setUniform3fv(e,t(i,o,a))))}}},172:(e,t,r)=>{r.d(t,{J:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),o=r(92604),a=r(11726);const n=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){n.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.extensions=new f,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(o.constants.generateSource());return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${a.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${n.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)}));const i=Array.from(r.values()),o=i.length;return(e,r,a)=>{for(let n=0;n<o;++n)i[n](t,e,r,a)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new d,this.constants=new p}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}f.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],f.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif\n\nout vec4 fragColor;",_="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,a=null){this.name=e,this.type=t,this.arraySize=a,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},null!=r&&null!=o&&(this.bind[r]=o)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var a;(a=o||(o={})).int=function(e){return Math.round(e).toString()},a.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(70586),o=r(35371);class a{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>a});var i=r(74709);class o extends i.K{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function a(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits??[0];let s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);t._parameterBits=n;const l=n[s],c=(1<<a)-1<<l;n[s]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.NORMALCOMPRESSED,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEOBJECTANDLAYERIDCOLOR,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),a=r(74709),n=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return n.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?n.Rw.LOADED:n.Rw.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends a.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,a=r(65617),n=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(57790);class d extends n.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._pp0=(0,a.f)(0,0,1),this._pp1=(0,a.f)(0,0,0),this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){null!=this.repository&&this.repository.materialChanged(this)}intersectDraped(e,t,r,i,o,a){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>n});var i=r(44553),o=r(67498),a=r(49300);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(o.P.Pass,this),this.bindDraw=t.generateBind(o.P.Draw,this),this._fragmentUniforms=(0,a.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),null!=this._fragmentUniforms&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},57790:(e,t,r)=>{r.d(t,{FZ:()=>w,Uf:()=>A,Bw:()=>f,LO:()=>S,Hx:()=>E});var i=r(67676),o=r(22021),a=r(17896),n=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return Math.max((0,o.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}(e,function(e,t,r){const i=r.parameters,o=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=o,d}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var u=r(11726),h=r(35065);const m=(0,s.Ue)();function f(e,t,r,i,o,a){if(e.visible)if(e.boundingInfo){(0,u.hu)(e.type===l.U.Mesh);const n=t.tolerance;g(e.boundingInfo,r,i,n,o,a)}else{const t=e.indices.get(h.T.POSITION),n=e.vertexAttributes.get(h.T.POSITION);v(r,i,0,t.length/3,t,n,void 0,o,a)}}const p=(0,n.c)();function g(e,t,r,i,o,n){if(null==e)return;const l=function(e,t,r){return(0,a.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(m,e.bbMin),(0,s.Tn)(m,e.bbMax),null!=o&&o.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,l,i)){const{primitiveIndices:a,indices:s,position:l}=e,c=a?a.length:s.length/3;if(c>C){const a=e.getChildren();if(void 0!==a){for(const e of a)g(e,t,r,i,o,n);return}}v(t,r,0,c,s,l,a,o,n)}}const _=(0,n.c)();function v(e,t,r,i,o,a,n,s,l){if(n)return function(e,t,r,i,o,a,n,s,l){const{data:c,stride:d}=a,u=e[0],h=e[1],m=e[2],f=t[0]-u,p=t[1]-h,g=t[2]-m;for(let e=r;e<i;++e){const t=n[e];let r=3*t,i=d*o[r++],a=c[i++],v=c[i++],T=c[i];i=d*o[r++];let x=c[i++],E=c[i++],A=c[i];i=d*o[r];let S=c[i++],R=c[i++],w=c[i];null!=s&&([a,v,T]=s.applyToVertex(a,v,T,e),[x,E,A]=s.applyToVertex(x,E,A,e),[S,R,w]=s.applyToVertex(S,R,w,e));const C=x-a,y=E-v,O=A-T,M=S-a,P=R-v,N=w-T,I=p*N-P*g,L=g*M-N*f,D=f*P-M*p,H=C*I+y*L+O*D;if(Math.abs(H)<=Number.EPSILON)continue;const F=u-a,B=h-v,U=m-T,z=F*I+B*L+U*D;if(H>0){if(z<0||z>H)continue}else if(z>0||z<H)continue;const V=B*O-y*U,G=U*C-O*F,W=F*y-C*B,k=f*V+p*G+g*W;if(H>0){if(k<0||z+k>H)continue}else if(k>0||z+k<H)continue;const $=(M*V+P*G+N*W)/H;$>=0&&l($,b(C,y,O,M,P,N,_),t,!1)}}(e,t,r,i,o,a,n,s,l);const{data:c,stride:d}=a,u=e[0],h=e[1],m=e[2],f=t[0]-u,p=t[1]-h,g=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=d*o[t++],i=c[r++],a=c[r++],n=c[r];r=d*o[t++];let v=c[r++],T=c[r++],x=c[r];r=d*o[t++];let E=c[r++],A=c[r++],S=c[r];null!=s&&([i,a,n]=s.applyToVertex(i,a,n,e),[v,T,x]=s.applyToVertex(v,T,x,e),[E,A,S]=s.applyToVertex(E,A,S,e));const R=v-i,w=T-a,C=x-n,y=E-i,O=A-a,M=S-n,P=p*M-O*g,N=g*y-M*f,I=f*O-y*p,L=R*P+w*N+C*I;if(Math.abs(L)<=Number.EPSILON)continue;const D=u-i,H=h-a,F=m-n,B=D*P+H*N+F*I;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const U=H*C-w*F,z=F*R-C*D,V=D*w-R*H,G=f*U+p*z+g*V;if(L>0){if(G<0||B+G>L)continue}else if(G>0||B+G<L)continue;const W=(y*U+O*z+M*V)/L;W>=0&&l(W,b(R,w,C,y,O,M,_),e,!1)}}const T=(0,n.c)(),x=(0,n.c)();function b(e,t,r,i,o,n,s){return(0,a.s)(T,e,t,r),(0,a.s)(x,i,o,n),(0,a.f)(s,T,x),(0,a.n)(s,s),s}function E(e,t,r,i,a){let n=(r.screenLength||0)*e.pixelRatio;null!=a&&(n=c(n,i,t,a));const s=n*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=R(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const a=t[o];void 0!==a&&(Array.isArray(a)?null===e[o]?(e[o]=a.slice(),r=!0):(0,i.Vx)(e[o],a)&&(r=!0):e[o]!==a&&(r=!0,e[o]=a))}return r}function R(e){const t=[];return e.forEach((e=>t.push(e))),t}const w={multiply:1,ignore:2,replace:3,tint:4},C=1e3},75656:(e,t,r)=>{r.d(t,{x:()=>l}),r(80442);var i=r(22021),o=r(49300),a=r(7575),n=r(35371);const s={target:n.No.TEXTURE_2D,samplingMode:n.cw.LINEAR,wrapMode:n.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1};let l=class{constructor(e,t,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(n._g.Texture,this),this._descriptor={...s,...t};for(const e in s)void 0===this._descriptor[e]&&(this._descriptor[e]=s[e]);if(e.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),u(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===n.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(n._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===n.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=n.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=n.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor,a=t??i.target,s=u(a);null===e&&(i.width=i.width||4,i.height=i.height||4,s&&(i.depth=i.depth??1));const m=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),l._validateTexture(this._context,i),this._configurePixelStorage(),(0,o.zu)(r);const f=i.pixelFormat;let p=i.internalFormat??this._deriveInternalFormat(f,i.dataType);if(d(e)){let t=e.width,n=e.height;const l=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,n=e.videoHeight),i.width&&i.height,s&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,p,i.hasMipmap,t,n,l),this._texImage(a,0,p,t,n,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=t),void 0===i.height&&(i.height=n),s&&void 0===i.depth&&(i.depth=l)}else{const{width:t,height:l,depth:d}=i;if(null==t||null==l)throw new Error("Width and height must be specified!");if(s&&null==d)throw new Error("Depth must be specified!");if(i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,p,i.hasMipmap,t,l,d),r.DEPTH24_STENCIL8&&p===r.DEPTH_STENCIL&&(p=r.DEPTH24_STENCIL8),c(e)){const o=e.levels,s=h(a,t,l,d),c=Math.min(s-1,o.length-1);null!=this._context.gl2?r.texParameteri(i.target,this._context.gl2.TEXTURE_MAX_LEVEL,c):i.hasMipmap=i.hasMipmap&&s===o.length;const u=p;if(!function(e){return e in n.q_}(u))throw new Error("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const n=o[Math.min(e,o.length-1)];this._compressedTexImage(a,e,u,t,r,i,n)}),c)}else null!=e?(this._texImage(a,0,p,t,l,d,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,t,i,n)=>{this._texImage(a,e,p,t,i,n,null),(0,o.zu)(r)}))}l._applySamplingMode(r,this._descriptor),l._applyWrapMode(r,this._descriptor),l._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(m,l.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,o,a,n=0){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const s=this._context.gl,u=this._descriptor,{pixelFormat:h,dataType:m,target:f,isImmutable:p}=u,g=u.internalFormat??this._deriveInternalFormat(h,m);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const _=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||i>u.width||o>u.height||t+i>u.width||r+o>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),n){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,n)}if(d(a)?null!=this._context.gl2?this._context.gl2.texSubImage2D(f,e,t,r,i,o,h,m,a):s.texSubImage2D(f,e,t,r,h,m,a):c(a)?s.compressedTexSubImage2D(f,e,t,r,i,o,g,a.levels[e]):s.texSubImage2D(f,e,t,r,i,o,h,m,a),n){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(_,l.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,o,a,n,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl2;if(null==d)throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:m,dataType:f,isImmutable:p,target:g}=h,_=h.internalFormat??this._deriveInternalFormat(m,f);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");u(g)||console.warn("Attempting to set 3D texture data on a non-3D texture");const v=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||o>h.width||a>h.height||n>h.depth||t+o>h.width||r+a>h.height||i+n>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),c(s))s=s.levels[e],d.compressedTexSubImage3D(g,e,t,r,i,o,a,n,_,s);else{const l=s;d.texSubImage3D(g,e,t,r,i,o,a,n,m,f,l)}this._context.bindTexture(v,l.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,l._validateTexture(this._context,e)}e.samplingMode===n.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=n.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===n.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=n.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,l.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,l._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(l._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(l._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===a.zO.WEBGL1)return e;switch(t){case n.Br.FLOAT:switch(e){case n.VI.RGBA:return n.lP.RGBA32F;case n.VI.RGB:return n.lP.RGB32F;default:throw new Error("Unable to derive format")}case n.Br.UNSIGNED_BYTE:switch(e){case n.VI.RGBA:return n.lP.RGBA8;case n.VI.RGB:return n.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,o,a){const s=this._context.gl2;if(null==s)throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in n.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?h(e,i,o,a):1;if(u(e)){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,i,o,a)}else s.texStorage2D(e,l,t,i,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,n,s){const l=this._context.gl;let c=null;const h=this._context.type===a.zO.WEBGL2,m=u(e),{isImmutable:f,pixelFormat:p,dataType:g}=this._descriptor;if(h&&(c=l),h||!d(s))if(f){if(null!=s){const r=s;if(m){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,o,n,p,g,r)}else l.texSubImage2D(e,t,0,0,i,o,p,g,r)}}else{const a=s;if(m){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,o,n,0,p,g,a)}else l.texImage2D(e,t,r,i,o,0,p,g,a)}else l.texImage2D(e,0,r,p,g,s)}_compressedTexImage(e,t,r,i,o,n,s){const l=this._context.gl;let c=null;const d=u(e),h=this._descriptor.isImmutable;if(d){if(this._context.type!==a.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");c=l}if(h){if(null!=s)if(d){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,o,n,r,s)}else l.compressedTexSubImage2D(e,t,0,0,i,o,r,s)}else if(d){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,o,n,0,s)}else l.compressedTexImage2D(e,t,r,i,o,0,s)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:o,hasMipmap:a,target:s}=this._descriptor;const l=s===n.No.TEXTURE_3D;if(null==r||null==i||l&&null==o)throw new Error("Missing texture dimensions for mipmap calculation");for(let n=0;e(n,r,i,o),a&&(1!==r||1!==i||l&&1!==o)&&!(n>=t);++n)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===a.zO.WEBGL2,o=null!=t.width&&(0,i.wt)(t.width)&&null!=t.height&&(0,i.wt)(t.height);r||!t.isImmutable&&!u(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||o||("number"==typeof t.wrapMode?t.wrapMode!==n.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===n.e8.CLAMP_TO_EDGE&&t.wrapMode.t===n.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===n.cw.LINEAR_MIPMAP_NEAREST||r===n.cw.LINEAR_MIPMAP_LINEAR?(r=n.cw.LINEAR,t.hasMipmap||(i=n.cw.LINEAR)):r!==n.cw.NEAREST_MIPMAP_NEAREST&&r!==n.cw.NEAREST_MIPMAP_LINEAR||(r=n.cw.NEAREST,t.hasMipmap||(i=n.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};function c(e){return null!=e&&"type"in e&&"compressed"===e.type}function d(e){return null!=e&&!c(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function u(e){return e===n.No.TEXTURE_3D||e===n.No.TEXTURE_2D_ARRAY}function h(e,t,r,i=1){let o=Math.max(t,r);return e===n.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}l.TEXTURE_UNIT_FOR_UPDATES=0},45762:(e,t,r)=>{r.d(t,{RG:()=>o,un:()=>a}),r(80442);var i=r(35371);function o(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function a(e){if(null==e)return 0;if("descriptor"in e)return e.glName?a(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return o(t)*i*r}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const a=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),n=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return n}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){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"}}(e,t),o=(new Error).stack;a.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:o}))}}}},7575:(e,t,r)=>{r.d(t,{Sh:()=>n,kr:()=>a,zO:()=>i});var i,o=r(80442);function a(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];for(const t of o){const i=e.getContext(t,r);if(i)return i}return null}function n(e){if("3d"===e)return[i.WEBGL2];const t=(0,o.Z)("esri-force-webgl");return t===i.WEBGL1||t===i.WEBGL2?[t]:(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1]}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const a=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>u,LZ:()=>d,if:()=>a,sm:()=>x,wK:()=>n,zp:()=>c});var i=r(47026),o=r(35371);function a(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,a=o.db.ADD,n=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:a,opAlpha:n,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return A.intern(e)}function m(e){return R.intern(e)}function f(e){return C.intern(e)}function p(e){return O.intern(e)}function g(e){return P.intern(e)}function _(e){return I.intern(e)}function v(e){return D.intern(e)}function T(e){return F.intern(e)}function x(e){return U.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function E(e){return"["+e.join(",")+"]"}const A=new b(S,(e=>({__tag:"Blending",...e})));function S(e){return e?E([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const R=new b(w,(e=>({__tag:"Culling",...e})));function w(e){return e?E([e.face,e.mode]):null}const C=new b(y,(e=>({__tag:"PolygonOffset",...e})));function y(e){return e?E([e.factor,e.units]):null}const O=new b(M,(e=>({__tag:"DepthTest",...e})));function M(e){return e?E([e.func]):null}const P=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?E([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const I=new b(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?E([e.zNear,e.zFar]):null}const D=new b(H,(e=>({__tag:"ColorWrite",...e})));function H(e){return e?E([e.r,e.g,e.b,e.a]):null}const F=new b(B,(e=>({__tag:"StencilWrite",...e})));function B(e){return e?E([e.mask]):null}const U=new b((function(e){return e?E([S(e.blending),w(e.culling),y(e.polygonOffset),M(e.depthTest),N(e.stencilTest),L(e.depthWrite),H(e.colorWrite),B(e.stencilWrite)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:_(e.depthWrite),colorWrite:v(e.colorWrite),stencilWrite:T(e.stencilWrite)})))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4499],{32243:(e,t,n)=>{function o(e){return e=e||globalThis.location.hostname,m.some((t=>null!=e?.match(t)))}function r(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(l)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(s)||null!=t.match(i)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}n.d(t,{XO:()=>o,pJ:()=>r});const l=/^devext.arcgis.com$/,s=/^qaext.arcgis.com$/,a=/^[\w-]*\.mapsdevext.arcgis.com$/,i=/^[\w-]*\.mapsqa.arcgis.com$/,m=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,l,s,/^jsapps.esri.com$/,a,i]},72245:(e,t,n)=>{n.d(t,{K3:()=>r,Rx:()=>l});var o=n(80442);const r=()=>!!(0,o.Z)("enable-feature:force-wosr"),l=()=>!!(0,o.Z)("enable-feature:SceneLayer-editing")},21878:(e,t,n)=>{n.d(t,{im:()=>$,cW:()=>S,vX:()=>Z});var o=n(9790),r=n(20102),l=n(84230),s=n(87223),a=n(59390),i=n(42143),m=n(4095),c=n(98587),u=n(77987),y=n(37898),f=n(20256),b=n(3456),p=n(86114),d=n(78724),h=n(20825);const g={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function w(e,t=g){if(!e)return{symbol:null};const{retainId:n=g.retainId,ignoreDrivers:l=g.ignoreDrivers,hasLabelingContext:s=g.hasLabelingContext,retainCIM:w=g.retainCIM}=t;let S=null;if((0,o.dU)(e)||e instanceof a.Z)S=e.clone();else if("cim"===e.type){const t=e.data?.symbol?.type;if("CIMPointSymbol"!==t)return{error:new r.Z("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${t||"unknown"}' is unsupported in 3D`,{symbol:e})};S=w?e.clone():i.Z.fromCIMSymbol(e)}else if(e instanceof m.Z)S=c.Z.fromSimpleLineSymbol(e);else if(e instanceof u.Z)S=i.Z.fromSimpleMarkerSymbol(e);else if(e instanceof y.Z)S=i.Z.fromPictureMarkerSymbol(e);else if(e instanceof f.Z)S=t.geometryType&&"mesh"===t.geometryType?b.Z.fromSimpleFillSymbol(e):p.Z.fromSimpleFillSymbol(e);else{if(!(e instanceof d.Z))return{error:new r.Z("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};S=s?h.Z.fromTextSymbol(e):i.Z.fromTextSymbol(e)}return n&&S&&"cim"!==S.type&&(S.id=e.id),l&&(0,o.dU)(S)&&S.symbolLayers.forEach((e=>e.ignoreDrivers=!0)),{symbol:S}}function S(e,t,n,o){const r=v(e,{},{context:o,isLabelSymbol:!1});null!=r&&(t[n]=r)}function Z(e,t,n,o){const r=v(e,{},{context:o,isLabelSymbol:!0});null!=r&&(t[n]=r)}function C(e){return e instanceof s.Z||e instanceof a.Z}function v(e,t,n){if(null==e)return null;const{context:o,isLabelSymbol:s}=n,a=o?.origin,i=o?.messages;if("web-scene"===a&&!C(e)){const n=w(e,{retainCIM:!0,hasLabelingContext:s});return null!=n.symbol?n.symbol.write(t,o):(i?.push(new r.Z("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:e,context:o,error:n.error})),null)}return("web-map"===a||"portal-item"===a&&!(0,l.A2)(o?.layer))&&C(e)?(i?.push(new r.Z("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:e,context:o})),null):e.write(t,o)}function $(e,t){return(0,o.S9)(e,null,t)}},27883:(e,t,n)=>{n.d(t,{EJ:()=>b,KV:()=>y,n2:()=>u,v9:()=>f,wm:()=>h});var o=n(3172),r=n(20102),l=n(95330),s=n(17452),a=n(65587),i=n(41253),m=n(72245);let c={};function u(e,t,n){return e&&null!=e.styleUrl?async function(e,t){try{return{data:(await b(e,t)).data,baseUrl:(0,s.Yd)(e),styleUrl:e}}catch(e){return(0,l.r9)(e),null}}(e.styleUrl,n):e&&null!=e.styleName?function(e,t,n){const o=null!=t.portal?t.portal:a.Z.getDefault();let l;const s=`${o.url} - ${o.user&&o.user.username} - ${e}`;return c[s]||(c[s]=function(e,t,n){return t.load(n).then((()=>{const o=new i.Z({disableExtraQuery:!0,query:`owner:${p} AND type:${d} AND typekeywords:"${e}"`});return t.queryItems(o,n)})).then((({results:t})=>{let o=null;const l=e.toLowerCase();if(t&&Array.isArray(t))for(const e of t){const t=e.typeKeywords?.some((e=>e.toLowerCase()===l));if(t&&e.type===d&&e.owner===p){o=e;break}}if(!o)throw new r.Z("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return o.load(n)}))}(e,o,n).then((e=>(l=e,e.fetchData()))).then((t=>({data:t,baseUrl:l.itemUrl??"",styleName:e})))),c[s]}(e.styleName,t,n):Promise.reject(new r.Z("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function y(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function f(e,t){if("cimRef"===t)return e.cimRef;if(e.formatInfos&&!(0,m.K3)())for(const t of e.formatInfos)if("gltf"===t.type)return t.href;return e.webRef}function b(e,t){const n={responseType:"json",query:{f:"json"},...t};return(0,o.default)((0,s.Fv)(e),n)}const p="esri_en",d="Style",h="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},74499:(e,t,n)=>{n.r(t),n.d(t,{fetchSymbolFromStyle:()=>p,resolveWebStyleSymbol:()=>b});var o=n(9790),r=n(32243),l=n(20102),s=n(70586),a=n(17452),i=n(65587),m=n(25929),c=n(21878),u=n(71144),y=n(27883),f=n(23203);function b(e,t,n,o){const r=e.name;return null==r?Promise.reject(new l.Z("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):e.styleName&&"Esri2DPointSymbolsStyle"===e.styleName?function(e,t,n){const o=y.wm.replace(/\{SymbolName\}/gi,e),r=null!=t.portal?t.portal:i.Z.getDefault();return(0,y.EJ)(o,n).then((e=>{const t=(0,y.KV)(e.data);return(0,c.im)(t,{portal:r,url:(0,a.mN)((0,a.Yd)(o)),origin:"portal-item"})}))}(r,t,o):(0,y.n2)(e,t,o).then((e=>p((0,s.s3)(e),r,t,n,o)))}function p(e,t,n,s,b){const p=e.data,d=n&&null!=n.portal?n.portal:i.Z.getDefault(),h={portal:d,url:(0,a.mN)(e.baseUrl),origin:"portal-item"},g=p.items.find((e=>e.name===t));if(!g){const e=`The symbol name '${t}' could not be found`;return Promise.reject(new l.Z("symbolstyleutils:symbol-name-not-found",e,{symbolName:t}))}let w=(0,m.f)((0,y.v9)(g,s),h),S=g.thumbnail?.href??null;const Z=g.thumbnail&&g.thumbnail.imageData;(0,r.XO)()&&(w=(0,r.pJ)(w)??"",S=(0,r.pJ)(S));const C={portal:d,url:(0,a.mN)((0,a.Yd)(w)),origin:"portal-item"};return(0,y.EJ)(w,b).then((r=>{const l="cimRef"===s?(0,y.KV)(r.data):r.data,a=(0,c.im)(l,C);if(a&&(0,o.dU)(a)){if(S){const e=(0,m.f)(S,h);a.thumbnail=new f.p({url:e})}else Z&&(a.thumbnail=new f.p({url:`data:image/png;base64,${Z}`}));e.styleUrl?a.styleOrigin=new u.Z({portal:n.portal,styleUrl:e.styleUrl,name:t}):e.styleName&&(a.styleOrigin=new u.Z({portal:n.portal,styleName:e.styleName,name:t}))}return a}))}}}]);
|