@arcgis/core 4.33.0-next.20250429 → 4.33.0-next.20250430
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/applications/Components/baUtils.js +5 -0
- package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -1
- package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -1
- package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -1
- package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{9a1c058d3ecd1db0e996.js → 0c338364cb55afdbd580.js} +1 -1
- package/assets/esri/core/workers/chunks/{4351b3e54b309935faed.js → 173737c60fa54f7d82bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{90dc783a617ff053e862.js → 181ad3cee0b30a72e7c7.js} +1 -1
- package/assets/esri/core/workers/chunks/210e057fe5e66abea984.js +1 -0
- package/assets/esri/core/workers/chunks/{9850ff14bd9c7da81c65.js → 23c76963481e38f39653.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1473d15c75fc560ea4a.js → 2ad47c0ba1680f7d5e03.js} +1 -1
- package/assets/esri/core/workers/chunks/2c3920ad82b9d86c3f05.js +1 -0
- package/assets/esri/core/workers/chunks/{4da99f058cca83937e9b.js → 2c92f6f268aa2de5432c.js} +1 -1
- package/assets/esri/core/workers/chunks/{12c9dd3932218238033b.js → 3a205f87f100832ef9f5.js} +1 -1
- package/assets/esri/core/workers/chunks/543eb46b55cacd6e1dbc.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{2fd5b48976cefe7cc0ab.js → 581180668e0229dcdc14.js} +1 -1
- package/assets/esri/core/workers/chunks/5c2299f22a69e58cc4dd.js +1 -0
- package/assets/esri/core/workers/chunks/60eb6dd09080da5653a1.js +1 -0
- package/assets/esri/core/workers/chunks/6210346dc9d064ac90af.js +1 -0
- package/assets/esri/core/workers/chunks/{3cf001abca8ad933bccf.js → 670a66617249f2d15a62.js} +2 -2
- package/assets/esri/core/workers/chunks/{3cf001abca8ad933bccf.js.LICENSE.txt → 670a66617249f2d15a62.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/710e03feaa25e357f17a.js +1 -0
- package/assets/esri/core/workers/chunks/{a6de903f22f76d875005.js → 7496c4c33c2d8f60a434.js} +1 -1
- package/assets/esri/core/workers/chunks/7b4523ab392966624d97.js +2 -0
- package/assets/esri/core/workers/chunks/{30551c1d3e4fa7be86c1.js.LICENSE.txt → 7b4523ab392966624d97.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{50ffb2620cdbcfd75723.js → 81b3351ea9627bb631d4.js} +1 -1
- package/assets/esri/core/workers/chunks/84d7ed2cf5fe23a0888f.js +1 -0
- package/assets/esri/core/workers/chunks/84f972d7851d982701a0.js +319 -0
- package/assets/esri/core/workers/chunks/{f52e597dca4b32a81881.js → 867c6c5b2ee1db977c99.js} +1 -1
- package/assets/esri/core/workers/chunks/{c5d786166a5609b85276.js → 8a87c181b85d0b86b9bb.js} +2 -2
- package/assets/esri/core/workers/chunks/{c5d786166a5609b85276.js.LICENSE.txt → 8a87c181b85d0b86b9bb.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{a0c51c4c30a5f749dfc6.js → 8bf2e2fe5e3e8b4a1fa0.js} +1 -1
- package/assets/esri/core/workers/chunks/{213adc87c843d627c5d6.js → 8f2e0277c66247bd40b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{a600194cfe26aedc21dd.js → 9d32f41f8f69b8a507c3.js} +1 -1
- package/assets/esri/core/workers/chunks/ac9c6779771ec855da79.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{899f197556b6ced6eddf.js → ad9b4e0164706c53b872.js} +2 -2
- package/assets/esri/core/workers/chunks/{1a6d2d090b643a87408a.js → b780c7062b1b18a5ae19.js} +1 -1
- package/assets/esri/core/workers/chunks/{72097a8247101018dcdf.js → ba4aafa8dfa76006c3e7.js} +1 -1
- package/assets/esri/core/workers/chunks/c2594024d72133d3ed7b.js +2 -0
- package/assets/esri/core/workers/chunks/{e524462c63834fae7e01.js.LICENSE.txt → c2594024d72133d3ed7b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{5a821b7bf58eebb9062c.js → c607d618b64d3accecc4.js} +1 -1
- package/assets/esri/core/workers/chunks/c819535525e9a27bae1f.js +39 -0
- package/assets/esri/core/workers/chunks/{c3033f148213c960b906.js → cb25b45a6b385e60c68d.js} +307 -309
- package/assets/esri/core/workers/chunks/{577f24923fa4d08360e4.js → ce9de24cb96b56d20562.js} +2 -2
- package/assets/esri/core/workers/chunks/{577f24923fa4d08360e4.js.LICENSE.txt → ce9de24cb96b56d20562.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d30fae6233d3426615ed.js +1 -0
- package/assets/esri/core/workers/chunks/d8dc922f7466300b668f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{28317c8d7fa2eeeaf997.js → d92ea6b0674f34206ab6.js} +1 -1
- package/assets/esri/core/workers/chunks/{345993291540433d3d92.js → e93222c65bd28203ddf7.js} +1 -1
- package/assets/esri/themes/base/widgets/_SelectionList.scss +5 -17
- 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/BloomBlur.glsl.js +1 -1
- package/chunks/BloomComposition.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +1 -1
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +33 -33
- package/chunks/DefaultMaterial.glsl.js +22 -22
- package/chunks/Fog.glsl.js +3 -3
- package/chunks/Haze.glsl.js +1 -1
- package/chunks/Path.glsl.js +22 -18
- package/chunks/RealisticTree.glsl.js +9 -9
- package/chunks/RibbonLine.glsl.js +1 -1
- package/chunks/ShadowCastAccumulate.glsl.js +5 -5
- package/chunks/ShadowHighlight.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +1 -1
- package/chunks/Viewshed.glsl.js +1 -1
- package/geometry/support/PolylineBuilder.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +5 -0
- package/geometry/support/curves/circleUtils.js +5 -0
- package/geometry/support/curves/circularArcUtils.js +5 -0
- package/geometry/support/curves/closestPointOnCurve.js +5 -0
- package/geometry/support/curves/curveUtils.js +5 -0
- package/geometry/support/curves/densifyCurvedGeometry.js +5 -0
- package/geometry/support/curves/ellipticArc4Utils.js +5 -0
- package/geometry/support/curves/ellipticArc7Utils.js +5 -0
- package/geometry/support/curves/mathUtils.js +5 -0
- package/geometry/support/curves/splitCurveAtPoint.js +5 -0
- package/interfaces.d.ts +452 -17
- package/layers/VideoLayer.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +5 -0
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +5 -0
- package/rest/knowledgeGraph/wasmInterface/wasmUtils.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +5 -0
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/FeatureProcessingContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/ObjectSymbolLayerRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/Point3DSymbolRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/SimpleFeatureRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/factoryUtils.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +15 -15
- package/views/3d/webgl-engine/core/shaderLibrary/shading/FoamRendering.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +27 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +28 -0
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +12 -0
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +9 -9
- package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ToneMapping.glsl.js +2 -20
- package/views/VideoView.js +1 -1
- package/webscene/support/FeatureReference.d.ts +4 -0
- package/webscene/support/FeatureReference.js +5 -0
- package/webscene/support/FeatureReferenceGlobalId.d.ts +4 -0
- package/webscene/support/FeatureReferenceGlobalId.js +5 -0
- package/webscene/support/FeatureReferenceId.d.ts +4 -0
- package/webscene/support/FeatureReferenceId.js +5 -0
- package/webscene/support/FeatureReferenceObjectId.d.ts +4 -0
- package/webscene/support/FeatureReferenceObjectId.js +5 -0
- package/webscene/support/LayerReference.d.ts +4 -0
- package/webscene/support/LayerReference.js +5 -0
- package/webscene/support/SlideElements.js +1 -1
- package/webscene/support/SlidePopupInfo.d.ts +4 -0
- package/webscene/support/SlidePopupInfo.js +5 -0
- package/webscene/support/featureReferenceUtils.js +5 -0
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/2e3019ce49e972a815ca.js +0 -1
- package/assets/esri/core/workers/chunks/30551c1d3e4fa7be86c1.js +0 -2
- package/assets/esri/core/workers/chunks/3293b4041c222299428f.js +0 -1
- package/assets/esri/core/workers/chunks/626ba3a7dee952308566.js +0 -1
- package/assets/esri/core/workers/chunks/97eedd6b90c6a9c67947.js +0 -1
- package/assets/esri/core/workers/chunks/b1e420cb425a3625170e.js +0 -319
- package/assets/esri/core/workers/chunks/bf4947fe446dcb477031.js +0 -1
- package/assets/esri/core/workers/chunks/cd2927b922444880566d.js +0 -1
- package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +0 -1
- package/assets/esri/core/workers/chunks/def182fff5a0244b1c2c.js +0 -1
- package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +0 -2
- package/assets/esri/core/workers/chunks/e64e0c3240f8e577a61c.js +0 -39
- package/geometry/support/curveUtils.js +0 -5
- package/geometry/support/densifyUtils.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/Factory.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.js +0 -38
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.js +0 -35
- package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechniqueConfiguration.js +0 -5
- package/widgets/support/InteractiveAnalysisViewModel.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3455],{431:(t,e,n)=>{n.d(e,{o6:()=>v,HY:()=>x,hx:()=>F,Jb:()=>w});var o=n(9318);function r(t,e,n){const o=e/3,r=new Uint32Array(n+1),i=new Uint32Array(n+1),s=(t,e)=>{t<e?r[t+1]++:i[e+1]++};for(let e=0;e<o;e++){const n=t[3*e],o=t[3*e+1],r=t[3*e+2];s(n,o),s(o,r),s(r,n)}let c=0,a=0;for(let t=0;t<n;t++){const e=r[t+1],n=i[t+1];r[t+1]=c,i[t+1]=a,c+=e,a+=n}const u=new Uint32Array(6*o),h=r[n],l=(t,e,n)=>{if(t<e){const o=r[t+1]++;u[2*o]=e,u[2*o+1]=n}else{const o=i[e+1]++;u[2*h+2*o]=t,u[2*h+2*o+1]=n}};for(let e=0;e<o;e++){const n=t[3*e],o=t[3*e+1],r=t[3*e+2];l(n,o,e),l(o,r,e),l(r,n,e)}const d=(t,e)=>{const n=2*t,o=e-t;for(let t=1;t<o;t++){const e=u[n+2*t],o=u[n+2*t+1];let r=t-1;for(;r>=0&&u[n+2*r]>e;r--)u[n+2*r+2]=u[n+2*r],u[n+2*r+3]=u[n+2*r+1];u[n+2*r+2]=e,u[n+2*r+3]=o}};for(let t=0;t<n;t++)d(r[t],r[t+1]),d(h+i[t],h+i[t+1]);const f=new Int32Array(3*o),m=(e,n)=>e===t[3*n]?0:e===t[3*n+1]?1:e===t[3*n+2]?2:-1,T=(t,e)=>{const n=m(t,e);f[3*e+n]=-1},_=(t,e,n,o)=>{const r=m(t,e);f[3*e+r]=o;const i=m(n,o);f[3*o+i]=e};for(let t=0;t<n;t++){let e=r[t];const n=r[t+1];let o=i[t];const s=i[t+1];for(;e<n&&o<s;){const n=u[2*e],r=u[2*h+2*o];n===r?(_(t,u[2*e+1],r,u[2*h+2*o+1]),e++,o++):n<r?(T(t,u[2*e+1]),e++):(T(r,u[2*h+2*o+1]),o++)}for(;e<n;)T(t,u[2*e+1]),e++;for(;o<s;)T(u[2*h+2*o],u[2*h+2*o+1]),o++}return f}var i=n(1843),s=n(46540),c=n(3055),a=n(87811),u=n(38954),h=n(51850),l=n(4431),d=n(34727);function f(t,e,n,o,r,i=2){const s=1/(Math.abs(n)+Math.abs(o)+Math.abs(r)),c=n*s,a=o*s,u=r<=0?(c>=0?1:-1)*(1-Math.abs(a)):c,h=r<=0?(a>=0?1:-1)*(1-Math.abs(c)):a,l=e*i;t[l]=m(u),t[l+1]=m(h)}function m(t){return(0,d.qE)(Math.round(32767*t),-32767,32767)}n(11868),n(34275);class T{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?A:p}write(t,e,n){b.seed=this._edgeHashFunction(n);const o=b.getIntRange(0,255),r=b.getIntRange(0,this.settings.variants-1),i=b.getFloat(),s=255*(.5*function(t){return Math.abs(t)**1.2*Math.sign(t)}(-(1-Math.min(i/.7,1))+Math.max(0,i-.7)/(1-.7))+.5);t.position0.setVec(e,n.position0),t.position1.setVec(e,n.position1),t.componentIndex.set(e,n.componentIndex),t.variantOffset.set(e,o),t.variantStroke.set(e,r),t.variantExtension.set(e,s)}}const _=new Float32Array(6),g=new Uint32Array(_.buffer),O=new Uint32Array(1);function p(t){return _[0]=t.position0[0],_[1]=t.position0[1],_[2]=t.position0[2],_[3]=t.position1[0],_[4]=t.position1[1],_[5]=t.position1[2],O[0]=31*(31*(31*(31*(31*(166811+g[0])+g[1])+g[2])+g[3])+g[4])+g[5],O[0]}function A(t){const e=_;e[0]=N(t.position0[0]),e[1]=N(t.position0[1]),e[2]=N(t.position0[2]),e[3]=N(t.position1[0]),e[4]=N(t.position1[1]),e[5]=N(t.position1[2]),O[0]=5381;for(let t=0;t<g.length;t++)O[0]=31*O[0]+g[t];return O[0]}const E=1e4;function N(t){return Math.round(t*E)/E}class R{constructor(){this._commonWriter=new T}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.gr.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n),(0,u.g)(I,n.faceNormal0,n.faceNormal1),(0,u.n)(I,I);const{typedBuffer:o,typedBufferStride:r}=t.normalCompressed;f(o,e,I[0],I[1],I[2],r)}static{this.Layout=c.gr}static{this.glLayout=(0,l.U)(c.gr,1)}}class S{constructor(){this._commonWriter=new T}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.In.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n);{const{typedBuffer:o,typedBufferStride:r}=t.normalCompressed;f(o,e,n.faceNormal0[0],n.faceNormal0[1],n.faceNormal0[2],r)}{const{typedBuffer:o,typedBufferStride:r}=t.normal2Compressed;f(o,e,n.faceNormal1[0],n.faceNormal1[1],n.faceNormal1[2],r)}}static{this.Layout=c.In}static{this.glLayout=(0,l.U)(c.In,1)}}const I=(0,h.vt)(),b=new a.A;var M=n(93406);function v(t){const e=F(t.data,t.skipDeduplicate,t.indices,t.indicesLength);return L.updateSettings(t.writerSettings),C.updateSettings(t.writerSettings),(0,M.K)(e,L,C)}function F(t,e,n,i){if(e){const e=r(n,i,t.count);return new P(n,i,e,t)}const s=(0,o.b)(t.buffer,t.stride/4,{originalIndices:n,originalIndicesLength:i}),a=r(s.indices,i,s.uniqueCount);return{faces:s.indices,facesLength:s.indices.length,neighbors:a,vertices:c.I$.createView(s.buffer)}}class P{constructor(t,e,n,o){this.faces=t,this.facesLength=e,this.neighbors=n,this.vertices=o}}const L=new R,C=new S,w=(0,i.BP)().vec3f(s.r.POSITION0).vec3f(s.r.POSITION1),x=(0,i.BP)().vec3f(s.r.POSITION0).vec3f(s.r.POSITION1).u16(s.r.COMPONENTINDEX)},3055:(t,e,n)=>{n.d(e,{I$:()=>s,In:()=>u,gr:()=>a});var o=n(4431),r=n(1843),i=n(46540);const s=(0,r.BP)().vec3f(i.r.POSITION).u16(i.r.COMPONENTINDEX).freeze(),c=(0,r.BP)().vec2u8(i.r.SIDENESS).freeze(),a=((0,o.U)(c),(0,r.BP)().vec3f(i.r.POSITION0).vec3f(i.r.POSITION1).vec2i16(i.r.NORMALCOMPRESSED).u16(i.r.COMPONENTINDEX).u8(i.r.VARIANTOFFSET,{glNormalized:!0}).u8(i.r.VARIANTSTROKE).u8(i.r.VARIANTEXTENSION,{glNormalized:!0}).freeze()),u=(0,r.BP)().vec3f(i.r.POSITION0).vec3f(i.r.POSITION1).vec2i16(i.r.NORMALCOMPRESSED).vec2i16(i.r.NORMAL2COMPRESSED).u16(i.r.COMPONENTINDEX).u8(i.r.VARIANTOFFSET,{glNormalized:!0}).u8(i.r.VARIANTSTROKE).u8(i.r.VARIANTEXTENSION,{glNormalized:!0}).freeze();new Map([[i.r.POSITION0,0],[i.r.POSITION1,1],[i.r.COMPONENTINDEX,2],[i.r.VARIANTOFFSET,3],[i.r.VARIANTSTROKE,4],[i.r.VARIANTEXTENSION,5],[i.r.NORMALCOMPRESSED,6],[i.r.NORMAL2COMPRESSED,7],[i.r.SIDENESS,8]])},4341:(t,e,n)=>{n.d(e,{I:()=>r});var o=n(26390);class r{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,o.d)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*i);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,i));t++)this._items.push(this._allocator())}}const i=1024},4431:(t,e,n)=>{n.d(e,{U:()=>i});var o=n(63907),r=n(74038);function i(t,e=0){const n=t.stride;return Array.from(t.fields.keys()).map((o=>{const i=t.fields.get(o),c=i.constructor.ElementCount,a=s(i.constructor.ElementType),u=i.offset,h=i.optional?.glNormalized??!1;return new r._(o,c,a,u,n,h,e)}))}function s(t){const e=c[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const c={u8:o.pe.UNSIGNED_BYTE,u16:o.pe.UNSIGNED_SHORT,u32:o.pe.UNSIGNED_INT,i8:o.pe.BYTE,i16:o.pe.SHORT,i32:o.pe.INT,f16:o.pe.HALF_FLOAT,f32:o.pe.FLOAT}},9318:(t,e,n)=>{n.d(e,{b:()=>i});var o=n(34727),r=n(97146);function i(t,e,n){const i=Array.isArray(t),h=i?t.length/e:t.byteLength/(4*e),l=i?t:new Uint32Array(t,0,h*e),d=n?.minReduction??0,f=n?.originalIndices||null,m=f?f.length:0,T=n?.componentOffsets||null;let _=0;if(T)for(let t=0;t<T.length-1;t++){const e=T[t+1]-T[t];e>_&&(_=e)}else _=h;const g=Math.floor(1.1*_)+1;(null==u||u.length<2*g)&&(u=new Uint32Array((0,o.cU)(2*g)));for(let t=0;t<2*g;t++)u[t]=0;let O=0;const p=!!T&&!!f,A=p?m:h;let E=(0,r.my)(h);const N=new Uint32Array(m),R=1.96;let S=0!==d?Math.ceil(4*R*R/(d*d)*d*(1-d)):A,I=1,b=T?T[1]:A;for(let t=0;t<A;t++){if(t===S){const e=1-O/t;if(e+R*Math.sqrt(e*(1-e)/t)<d)return null;S*=2}if(t===b){for(let t=0;t<2*g;t++)u[t]=0;if(f)for(let t=T[I-1];t<T[I];t++)N[t]=E[f[t]];b=T[++I]}const n=p?f[t]:t,o=n*e,r=a(l,o,e);let i=r%g,c=O;for(;0!==u[2*i+1];){if(u[2*i]===r){const t=u[2*i+1]-1;if(s(l,o,t*e,e)){c=E[t];break}}i++,i>=g&&(i-=g)}c===O&&(u[2*i]=r,u[2*i+1]=n+1,O++),E[n]=c}if(0!==d&&1-O/h<d)return null;if(p){for(let t=T[I-1];t<N.length;t++)N[t]=E[f[t]];E=(0,r.uW)(N)}const M=i?new Array(O):new Uint32Array(O*e);O=0;for(let t=0;t<A;t++)E[t]===O&&(c(l,(p?f[t]:t)*e,M,O*e,e),O++);if(f&&!p){const t=new Uint32Array(m);for(let e=0;e<t.length;e++)t[e]=E[f[e]];E=(0,r.uW)(t)}return{buffer:Array.isArray(M)?M:M.buffer,indices:E,uniqueCount:O}}function s(t,e,n,o){for(let r=0;r<o;r++)if(t[e+r]!==t[n+r])return!1;return!0}function c(t,e,n,o,r){for(let i=0;i<r;i++)n[o+i]=t[e+i]}function a(t,e,n){let o=0;for(let r=0;r<n;r++)o=t[e+r]+o|0,o=o+(o<<11)+(o>>>2)|0;return o>>>0}let u=null},11964:(t,e,n)=>{n.d(e,{Cr:()=>u,H6:()=>d,_I:()=>l,kb:()=>h,vt:()=>a});var o=n(34727),r=n(4341),i=n(38954),s=n(51850),c=n(32114);function a(t){return t?{origin:(0,s.o8)(t.origin),vector:(0,s.o8)(t.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function u(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.d)(n.vector,e,t),n}function h(t,e){const n=(0,i.d)(c.rq.get(),e,t.origin),r=(0,i.f)(t.vector,n),s=(0,i.f)(t.vector,t.vector),a=(0,o.qE)(r/s,0,1),u=(0,i.d)(c.rq.get(),(0,i.h)(c.rq.get(),t.vector,a),n);return(0,i.f)(u,u)}function l(t,e,n){return d(t,e,0,1,n)}function d(t,e,n,r,s){const{vector:a,origin:u}=t,h=(0,i.d)(c.rq.get(),e,u),l=(0,i.f)(a,h)/(0,i.k)(a);return(0,i.h)(s,a,(0,o.qE)(l,n,r)),(0,i.g)(s,s,t.origin)}(0,s.vt)(),(0,s.vt)(),new r.I((()=>a()))},24587:(t,e,n)=>{n.r(e),n.d(e,{default:()=>ot});var o,r,i,s=n(90237),c=n(74887),a=(n(53966),n(44208),n(87811),n(49186),n(40608)),u=n(38954),h=n(51850),l=n(11964),d=n(97937),f=n(93687),m=n(3694),T=n(4341),_=(n(58083),n(87317),n(91829)),g=n(71351);function O(t){return t?{ray:(0,g.vt)(t.ray),c0:t.c0,c1:t.c1}:{ray:(0,g.vt)(),c0:0,c1:Number.MAX_VALUE}}function p(t,e){for(let n=0;n<A;n++){const o=t[n];if(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]+o[3]>=e[3])return!1}return!0}new T.I((()=>O())),n(240),n(32114),(i=o||(o={}))[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT",i[i.BOTTOM=2]="BOTTOM",i[i.TOP=3]="TOP",i[i.NEAR=4]="NEAR",i[i.FAR=5]="FAR",function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(r||(r={})),r.FAR_BOTTOM_RIGHT,r.NEAR_BOTTOM_RIGHT,r.NEAR_BOTTOM_LEFT,r.FAR_BOTTOM_LEFT,r.NEAR_BOTTOM_LEFT,r.NEAR_BOTTOM_RIGHT,r.NEAR_TOP_RIGHT,r.NEAR_TOP_LEFT,r.FAR_BOTTOM_RIGHT,r.FAR_BOTTOM_LEFT,r.FAR_TOP_LEFT,r.FAR_TOP_RIGHT,r.NEAR_BOTTOM_RIGHT,r.FAR_BOTTOM_RIGHT,r.FAR_TOP_RIGHT,r.NEAR_TOP_RIGHT,r.FAR_BOTTOM_LEFT,r.NEAR_BOTTOM_LEFT,r.NEAR_TOP_LEFT,r.FAR_TOP_LEFT,r.FAR_TOP_LEFT,r.NEAR_TOP_LEFT,r.NEAR_TOP_RIGHT,r.FAR_TOP_RIGHT;const A=6;(0,_.fA)(-1,-1,-1,1),(0,_.fA)(1,-1,-1,1),(0,_.fA)(1,1,-1,1),(0,_.fA)(-1,1,-1,1),(0,_.fA)(-1,-1,1,1),(0,_.fA)(1,-1,1,1),(0,_.fA)(1,1,1,1),(0,_.fA)(-1,1,1,1),new T.I(O),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)();var E,N,R=n(620);class S{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new I,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),I.clearPool(),V[0]=null,X.prune(),$.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=I.acquire();for(let o=0;o<e;o++){const e=t[o];this._isDegenerate(e)?this._degenerateObjects.add(e):(n.init(this._root),this._add(e,n))}I.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=I.acquire();for(const o of t){const t=e??(0,d.e)(this.objectToBoundingSphere(o),W);y(t[3])?(n.init(this._root),v(o,t,n)):this._degenerateObjects.delete(o)}I.release(n),this._shrink()}update(t,e){if(!y(e[3])&&this._isDegenerate(t))return;const n=function(t){return V[0]=t,V}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const o=(0,g.LV)(t,e);b(this._root,(t=>{if(!function(t,e){return w((0,d.a)(e.bounds),2*-e.halfSize,G),w((0,d.a)(e.bounds),2*e.halfSize,k),(0,R.O_)(t.origin,t.direction,G,k)}(o,t))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),!0}))}forEachAlongRayWithVerticalOffset(t,e,n,o){const r=(0,g.LV)(t,e);b(this._root,(t=>{if(!function(t,e,n){return w((0,d.a)(e.bounds),2*-e.halfSize,G),w((0,d.a)(e.bounds),2*e.halfSize,k),n.applyToMinMax(G,k),(0,R.O_)(t.origin,t.direction,G,k)}(r,t,o))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObjectWithOffset(r,t,o)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObjectWithOffset(r,t,o)&&n(t)})),!0}))}forEach(t){b(this._root,(e=>{const n=e.node;return n.terminals.forAll(t),null!==n.residents&&n.residents.forAll(t),!0})),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,o=()=>!0,r=1/0){let i=1/0,s=1/0,c=null;const a=B(t,e),h=a=>{if(--r,!o(a))return;const u=this.objectToBoundingSphere(a);if(!p(n,u))return;const h=D(t,e,(0,d.a)(u)),l=h-u[3],f=h+u[3];l<i&&(i=l,s=f,c=a)};return M(this._root,(o=>{if(r<=0||!p(n,o.bounds))return!1;if((0,u.h)(q,a,o.halfSize),(0,u.g)(q,q,(0,d.a)(o.bounds)),D(t,e,q)>s)return!1;const i=o.node;return i.terminals.forAll((t=>h(t))),null!==i.residents&&i.residents.forAll((t=>h(t))),!0}),t,e),c}forEachInDepthRange(t,e,n,o,r,i,s){let c=-1/0,a=1/0;const h={setRange:t=>{n===S.DepthOrder.FRONT_TO_BACK?(c=Math.max(c,t.near),a=Math.min(a,t.far)):(c=Math.max(c,-t.far),a=Math.min(a,-t.near))}};h.setRange(o);const l=D(e,n,t),f=B(e,n),m=B(e,-n),T=t=>{if(!s(t))return;const o=this.objectToBoundingSphere(t),u=(0,d.a)(o),f=D(e,n,u)-l,m=f-o[3],T=f+o[3];m>a||T<c||!p(i,o)||r(t,h)};M(this._root,(t=>{if(!p(i,t.bounds))return!1;if((0,u.h)(q,f,t.halfSize),(0,u.g)(q,q,(0,d.a)(t.bounds)),D(e,n,q)-l>a)return!1;if((0,u.h)(q,m,t.halfSize),(0,u.g)(q,q,(0,d.a)(t.bounds)),D(e,n,q)-l<c)return!1;const o=t.node;return o.terminals.forAll((t=>T(t))),null!==o.residents&&o.residents.forAll((t=>T(t))),!0}),e,n)}forEachNode(t){b(this._root,(e=>t(e.node,e.bounds,e.halfSize,e.depth)))}forEachNeighbor(t,e){const n=(0,d.g)(e),o=(0,d.a)(e),r=e=>{const r=this.objectToBoundingSphere(e),i=(0,d.g)(r),s=n+i;return!((0,u.s)((0,d.a)(r),o)-s*s<=0)||t(e)};let i=!0;const s=t=>{i&&(i=r(t))};b(this._root,(t=>{const e=(0,d.g)(t.bounds),r=n+e;if((0,u.s)((0,d.a)(t.bounds),o)-r*r>0)return!1;const c=t.node;return c.terminals.forAll(s),i&&null!==c.residents&&c.residents.forAll(s),i})),i&&this.forEachDegenerateObject(s)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||(0,d.i)(n,t)}_intersectsObjectWithOffset(t,e,n){const o=this.objectToBoundingSphere(e);return!(o[3]>0)||(0,d.i)(n.applyToBoundingSphere(o),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){const e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){const o=I.acquire().init(t);this._add(e.at(n),o),I.release(o)}}_grow(t,e){if(0!==e&&(x(t,e,(t=>this.objectToBoundingSphere(t)),K),y(K[3])&&!this._fitsInsideTree(K)))if(P(this._root.node))(0,d.e)(K,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(K);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(K,t):this._growRootAsSubNode(t),I.release(t)}}_rebuildTree(t,e){(0,u.c)((0,d.a)(Y),(0,d.a)(e.bounds)),Y[3]=e.halfSize,x([t,Y],2,(t=>t),J);const n=I.acquire().init(this._root);this._root.initFrom(null,J,J[3]),this._root.increaseHalfSize(1.25),b(n,(t=>(this.add(t.node.terminals.data,t.node.terminals.length),null!==t.node.residents&&this.add(t.node.residents.data,t.node.residents.length),!0))),I.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return b(this._root,(t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth))),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let o=-1/0;const r=this._root.bounds,i=this._root.halfSize;for(let t=0;t<3;t++){const s=r[t]-i-(n[t]-e),c=n[t]+e-(r[t]+i),a=Math.max(0,Math.ceil(s/(2*i))),u=Math.max(0,Math.ceil(c/(2*i)))+1,h=2**Math.ceil(Math.log(a+u)*Math.LOG2E);o=Math.max(o,h),Z[t].min=a,Z[t].max=u}for(let t=0;t<3;t++){let e=Z[t].min,n=Z[t].max;const s=(o-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);const c=r[t]-i-e*i*2;H[t]=c+(n+e)*i}const s=o*i;return H[3]=s*z,I.acquire().initFrom(null,H,s,0)}_growRootAsSubNode(t){const e=this._root.node;(0,u.c)((0,d.a)(K),(0,d.a)(this._root.bounds)),K[3]=this._root.halfSize,this._root.init(t),t.advanceTo(K,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,o=0;for(;o<e.length&&null==t;)n=o++,t=e[n];for(;o<e.length;)if(e[o++])return-1;return n}_isDegenerate(t){return!y(this.objectToBoundingSphere(t)[3])}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t[3]<=n&&t[0]>=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,o=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:o}}}_nodeToJSON(t){const e=t.children.map((t=>t?this._nodeToJSON(t):null)),n=t.residents?.map((t=>this.objectToBoundingSphere(t))),o=t.terminals?.map((t=>this.objectToBoundingSphere(t)));return{children:e,residents:n,terminals:o}}static fromJSON(t){const e=new S((t=>t),{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class I{constructor(){this.bounds=(0,d.c)(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,o=this.depth){return this.node=null!=t?t:I.createEmptyNode(),e&&(0,d.e)(e,this.bounds),this.halfSize=n,this.depth=o,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*z}advance(t){let e=this.node.children[t];e||(e=I.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=j[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const o=this._childIndex(t);e&&e(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]<t[0]?1:0)+(e[1]<t[1]?2:0)+(e[2]<t[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new m.A({shrink:!0}),residents:new m.A({shrink:!0})}}static{this._pool=new f.A(I)}static acquire(){return I._pool.acquire()}static release(t){I._pool.release(t)}static clearPool(){I._pool.prune()}}function b(t,e){let n=I.acquire().init(t);const o=[n];for(;0!==o.length;){if(n=o.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++)n.node.children[t]&&o.push(I.acquire().init(n).advance(t));I.release(n)}}function M(t,e,n,o=S.DepthOrder.FRONT_TO_BACK){let r=I.acquire().init(t);const i=[r];for(function(t,e,n){if(!$.length)for(let t=0;t<8;++t)$.push({index:0,distance:0});for(let n=0;n<8;++n){const o=j[n];$.data[n].index=n,$.data[n].distance=D(t,e,o)}$.sort(((t,e)=>t.distance-e.distance));for(let t=0;t<8;++t)n[t]=$.data[t].index}(n,o,Q);0!==i.length;){if(r=i.pop(),e(r)&&!r.isLeaf())for(let t=7;t>=0;--t){const e=Q[t];r.node.children[e]&&i.push(I.acquire().init(r).advance(e))}I.release(r)}}function v(t,e,n){X.clear();const o=n.advanceTo(e,((t,e)=>{X.push(t.node),X.push(e)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(t),0===o.length)for(let t=X.length-2;t>=0&&F(X.data[t],X.data[t+1]);t-=2);}function F(t,e){return e>=0&&(t.children[e]=null),!!P(t)&&(null===t.residents&&(t.residents=new m.A({shrink:!0})),!0)}function P(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}function L(t,e){t[0]=Math.min(t[0],e[0]-e[3]),t[1]=Math.min(t[1],e[1]-e[3]),t[2]=Math.min(t[2],e[2]-e[3])}function C(t,e){t[0]=Math.max(t[0],e[0]+e[3]),t[1]=Math.max(t[1],e[1]+e[3]),t[2]=Math.max(t[2],e[2]+e[3])}function w(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function x(t,e,n,o){if(1===e){const e=n(t[0]);(0,d.e)(e,o)}else{G[0]=1/0,G[1]=1/0,G[2]=1/0,k[0]=-1/0,k[1]=-1/0,k[2]=-1/0;for(let o=0;o<e;o++){const e=n(t[o]);y(e[3])&&(L(G,e),C(k,e))}(0,u.m)((0,d.a)(o),G,k,.5),o[3]=Math.max(k[0]-G[0],k[1]-G[1],k[2]-G[2])/2}}function B(t,e){let n,o=1/0;for(let r=0;r<8;++r){const i=D(t,e,U[r]);i<o&&(o=i,n=U[r])}return n}function D(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function y(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}(N=(E=S).DepthOrder||(E.DepthOrder={}))[N.FRONT_TO_BACK=1]="FRONT_TO_BACK",N[N.BACK_TO_FRONT=-1]="BACK_TO_FRONT";const j=[(0,h.fA)(-1,-1,-1),(0,h.fA)(1,-1,-1),(0,h.fA)(-1,1,-1),(0,h.fA)(1,1,-1),(0,h.fA)(-1,-1,1),(0,h.fA)(1,-1,1),(0,h.fA)(-1,1,1),(0,h.fA)(1,1,1)],U=[(0,h.fA)(-1,-1,-1),(0,h.fA)(-1,-1,1),(0,h.fA)(-1,1,-1),(0,h.fA)(-1,1,1),(0,h.fA)(1,-1,-1),(0,h.fA)(1,-1,1),(0,h.fA)(1,1,-1),(0,h.fA)(1,1,1)],z=Math.sqrt(3),V=[null],H=(0,d.c)(),q=(0,h.vt)(),G=(0,h.vt)(),k=(0,h.vt)(),X=new m.A,W=(0,d.c)(),K=(0,d.c)(),Y=(0,d.c)(),J=(0,d.c)(),Z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],$=new m.A,Q=[0,0,0,0,0,0,0,0];var tt=n(431);function et(t,e,n){const o=(0,d.c)(),r=(0,d.a)(o);return(0,u.b)(r,r,t,.5),(0,u.b)(r,r,e,.5),o[3]=(0,u.j)(r,t),(0,u.g)(r,r,n),o}let nt=class{constructor(){this._idToComponent=new Map,this._components=new S((t=>t.bounds)),this._edges=new S((t=>t.bounds)),this._tmpLineSegment=(0,l.vt)(),this._tmpP1=(0,h.vt)(),this._tmpP2=(0,h.vt)(),this._tmpP3=(0,h.vt)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,c.Te)(e),await this._ensureEdgeLocations(t,e);const n=[];return this._edges.forEachNeighbor((e=>(this._addCandidates(t,e,n),n.length<1e3)),t.bounds),{result:{candidates:n}}}async _ensureEdgeLocations(t,e){const n=[];if(this._components.forEachNeighbor((t=>{if(null==t.info){const{id:e,uid:o}=t;n.push({id:e,uid:o})}return!0}),t.bounds),!n.length)return;const o={components:n},r=await this.remoteClient.invoke("fetchAllEdgeLocations",o,e??{});for(const t of r.components)this._setFetchEdgeLocations(t)}async add(t){const e=new it(t.id,t.bounds);return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){const e=this._idToComponent.get(t.id);if(e){const t=[];this._edges.forEachNeighbor((n=>(n.component===e&&t.push(n),!0)),e.bounds),this._edges.remove(t),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){const e=this._idToComponent.get(t.id);if(null==e||t.uid!==e.uid)return;const n=tt.HY.createView(t.locations),o=new Array(n.count),r=(0,h.vt)(),i=(0,h.vt)();for(let s=0;s<n.count;s++){n.position0.getVec(s,r),n.position1.getVec(s,i);const c=et(r,i,t.origin),a=new st(e,s,c);o[s]=a}this._edges.add(o);const{objectIds:s,origin:c}=t;e.info={locations:n,objectIds:s,origin:c}}_addCandidates(t,e,n){const{info:o}=e.component,{origin:r,objectIds:i}=o,s=o.locations,c=s.position0.getVec(e.index,this._tmpP1),a=s.position1.getVec(e.index,this._tmpP2);(0,u.g)(c,c,r),(0,u.g)(a,a,r);const h=i[s.componentIndex.get(e.index)];this._addEdgeCandidate(t,h,c,a,n),rt(t,h,c,n),rt(t,h,a,n)}_addEdgeCandidate(t,e,n,o,r){if(!t.returnEdge)return;const i=(0,d.a)(t.bounds),s=(0,l.Cr)(n,o,this._tmpLineSegment),c=(0,l._I)(s,i,this._tmpP3);(0,d.o)(t.bounds,c)&&r.push({type:"edge",objectId:e,target:(0,h.o8)(c),distance:(0,u.j)(i,c),start:(0,h.o8)(n),end:(0,h.o8)(o)})}};nt=(0,s._)([(0,a.$)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],nt);const ot=nt;function rt(t,e,n,o){if(!t.returnVertex||!(0,d.o)(t.bounds,n))return;const r=(0,d.a)(t.bounds);o.push({type:"vertex",objectId:e,target:(0,h.o8)(n),distance:(0,u.j)(r,n)})}class it{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=++it.uid}static{this.uid=0}}class st{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}},34727:(t,e,n)=>{n.d(e,{$8:()=>N,Cc:()=>s,Hx:()=>T,Io:()=>E,KJ:()=>u,Sp:()=>d,XM:()=>h,YN:()=>l,ZH:()=>m,cU:()=>r,gg:()=>f,hs:()=>c,kU:()=>a,or:()=>S,pF:()=>b,pq:()=>I,qE:()=>i});const o=new Float32Array(1);function r(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function i(t,e,n){return Math.min(Math.max(t,e),n)}function s(t,e,n){return t+(e-t)*n}function c(t,e,n,o,r){return s(o,r,(t-e)/(n-e))}function a(t){return t*Math.PI/180}function u(t){return 180*t/Math.PI}function h(t){return Math.acos(i(t,-1,1))}function l(t){return Math.asin(i(t,-1,1))}function d(t,e,n=1e-6){return t===e||!(!Number.isFinite(t)||!Number.isFinite(e))&&(t>e?t-e:e-t)<=n}function f(t,e,n=1e-6){return!d(t,e,n)&&t>e}function m(t,e,n=1e-6){return!d(t,e,n)&&t<e}function T(t,e,n=1e-6){return d(t,e,n)||t>e}const _=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function g(t){return _.setFloat64(0,t),_.getBigInt64(0)}const O=BigInt("1000000"),p=A(1);function A(t){const e=g(t=Math.abs(t)),n=function(t){return _.setBigInt64(0,t),_.getFloat64(0)}(e<=O?O:e-O);return Math.abs(t-n)}function E(t,e,n=p){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(null!=n&&A(Math.min(Math.abs(t),Math.abs(e)))<n)return Math.abs(t-e)<=n;const o=g(t),r=g(e);return o<0==r<0&&!((o<r?r-o:o-r)>O)}function N(t){return R(Math.max(-I,Math.min(t,I)))}function R(t){return o[0]=t,o[0]}function S(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],o=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(d(e,1)&&d(n,1)&&d(o,1))}const I=R(34028234663852886e22);function b(t,e,n){if(void 0===n||0==+n)return Math[t](e);if(e=+e,n=+n,isNaN(e)||"number"!=typeof n||n%1!=0)return NaN;let o=e.toString().split("e");return o=(e=Math[t](+(o[0]+"e"+(o[1]?+o[1]-n:-n)))).toString().split("e"),+(o[0]+"e"+(o[1]?+o[1]+n:n))}},46540:(t,e,n)=>{var o;n.d(e,{r:()=>o}),function(t){t.POSITION="position",t.NORMAL="normal",t.NORMALCOMPRESSED="normalCompressed",t.UV0="uv0",t.UVI="uvi",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.ROTATION="rotation",t.TANGENT="tangent",t.OFFSET="offset",t.PERSPECTIVEDIVIDE="perspectiveDivide",t.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",t.LENGTH="length",t.NEXTDELTA="nextDelta",t.PREVIOUSDELTA="previousDelta",t.U0="u0",t.LINEPARAMETERS="lineParameters",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.PROFILEAUXDATA="profileAuxData",t.INSTANCEMODELORIGINHI="instanceModelOriginHi",t.INSTANCEMODELORIGINLO="instanceModelOriginLo",t.INSTANCEMODEL="instanceModel",t.INSTANCEMODELNORMAL="instanceModelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMAL2COMPRESSED="normal2Compressed",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.START_UP="startUp",t.END_UP="endUp",t.EXTRUDE="extrude",t.OLIDCOLOR="objectAndLayerIdColor",t.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(o||(o={}))},71351:(t,e,n)=>{n.d(e,{Cr:()=>l,LV:()=>h,kb:()=>d,oC:()=>f,vt:()=>a}),n(4576);var o=n(4341),r=(n(77690),n(29242)),i=n(38954),s=n(51850),c=n(32114);function a(t){return t?u((0,s.o8)(t.origin),(0,s.o8)(t.direction)):u((0,s.vt)(),(0,s.vt)())}function u(t,e){return{origin:t,direction:e}}function h(t,e){const n=m.get();return n.origin=t,n.direction=e,n}function l(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.d)(n.direction,e,t),n}function d(t,e){const n=(0,i.e)(c.rq.get(),(0,i.n)(c.rq.get(),t.direction),(0,i.d)(c.rq.get(),e,t.origin));return(0,i.f)(n,n)}function f(t,e,n){const o=(0,i.f)(t.direction,(0,i.d)(n,e,t.origin));return(0,i.g)(n,t.origin,(0,i.h)(n,t.direction,o)),n}const m=new o.I((()=>a()));(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,r.vt)()},74038:(t,e,n)=>{n.d(e,{_:()=>o});class o{constructor(t,e,n,o,r,i=!1,s=0){this.name=t,this.count=e,this.type=n,this.offset=o,this.stride=r,this.normalized=i,this.divisor=s}}},88582:(t,e,n)=>{var o;n.d(e,{_:()=>o}),function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"}(o||(o={}))},91869:(t,e,n)=>{function o(t,e){for(const n of t.values())if(e(n))return!0;return!1}function r(t,e,n){const o=t.get(e);if(void 0!==o)return o;const r=n();return t.set(e,r),r}function i(t){const e=new Map;return n=>(e.has(n)||e.set(n,t(n)),e.get(n))}n.d(e,{Bj:()=>i,Bs:()=>o,tE:()=>r})},93406:(t,e,n)=>{n.d(e,{K:()=>a});var o=n(34727),r=n(3694),i=n(38954),s=n(51850);const c=-1;function a(t,e,n){const o=t.vertices.position,r=t.vertices.componentIndex,s=T.position0,a=T.position1,l=T.faceNormal0,f=T.faceNormal1,{edges:m,normals:_}=h(t),g=m.length/4,O=e.allocate(g);let p=0;const A=g,R=n?.allocate(A);let I=0,b=0,M=0;d.length=0;for(let t=0;t<g;++t){const e=4*t;o.getVec(m.data[e],s),o.getVec(m.data[e+1],a);const n=d.pushNew();n.index=4*t,n.length=(0,i.j)(s,a)}d.sort(((t,e)=>e.length-t.length));const v=new Array,F=new Array;d.forAll((({length:t,index:h})=>{const d=m.data[h],g=m.data[h+1],A=m.data[h+2],P=m.data[h+3],L=P===c;if(o.getVec(d,s),o.getVec(g,a),L){const t=3*A;(0,i.i)(l,_.data[t],_.data[t+1],_.data[t+2]),(0,i.c)(f,l),T.componentIndex=r.get(d),T.cosAngle=(0,i.f)(l,f)}else{let t=3*A;if((0,i.i)(l,_.data[t],_.data[t+1],_.data[t+2]),t=3*P,(0,i.i)(f,_.data[t],_.data[t+1],_.data[t+2]),T.componentIndex=r.get(d),T.cosAngle=(0,i.f)(l,f),function(t,e){return t.cosAngle>e}(T,N))return;T.cosAngle<-.9999&&(0,i.c)(f,l)}b+=t,M++,L||function(t,e){return t.cosAngle<e}(T,S)?(e.write(O,p++,T),v.push(t)):u(T,E)&&(R&&n&&n.write(R,I++,T),F.push(t))}));const P=new Float32Array(v.reverse()),L=new Float32Array(F.reverse()),C=R&&n?{instancesData:R.slice(0,I),lodInfo:{lengths:L}}:void 0;return{regular:{instancesData:O.slice(0,p),lodInfo:{lengths:P}},silhouette:C,averageEdgeLength:b/M}}function u(t,e){const n=(0,o.XM)(t.cosAngle);return(0,i.o)(g,t.position1,t.position0),n*((0,i.f)((0,i.e)(_,t.faceNormal0,t.faceNormal1),g)>0?-1:1)>e}function h(t){const e=t.faces.length/3,n=t.faces,o=t.neighbors,r=t.vertices.position;f.length=m.length=0;for(let t=0;t<e;t++){const e=3*t,s=o[e],a=o[e+1],u=o[e+2],h=n[e],l=n[e+1],d=n[e+2];r.getVec(h,O),r.getVec(l,p),r.getVec(d,A),(0,i.d)(p,p,O),(0,i.d)(A,A,O),(0,i.e)(O,p,A),(0,i.n)(O,O),m.pushArray(O),(s===c||h<l)&&(f.push(h),f.push(l),f.push(t),f.push(s)),(a===c||l<d)&&(f.push(l),f.push(d),f.push(t),f.push(a)),(u===c||d<h)&&(f.push(d),f.push(h),f.push(t),f.push(u))}return{edges:f,normals:m}}class l{constructor(){this.index=0,this.length=0}}const d=new r.A({allocator:t=>t||new l,deallocator:null}),f=new r.A({deallocator:null}),m=new r.A({deallocator:null}),T=new class{constructor(){this.position0=(0,s.vt)(),this.position1=(0,s.vt)(),this.faceNormal0=(0,s.vt)(),this.faceNormal1=(0,s.vt)(),this.componentIndex=0,this.cosAngle=0}},_=(0,s.vt)(),g=(0,s.vt)(),O=(0,s.vt)(),p=(0,s.vt)(),A=(0,s.vt)(),E=(0,o.kU)(4),N=Math.cos(E),R=(0,o.kU)(35),S=Math.cos(R)},97937:(t,e,n)=>{n.d(e,{a:()=>E,c:()=>_,e:()=>p,f:()=>N,g:()=>A,i:()=>M,o:()=>x,s:()=>y}),n(44208),n(53966);var o=n(34727),r=n(58083),i=n(38954),s=n(51850),c=n(87317),a=n(91829),u=n(34304),h=n(88582),l=n(71351);function d(t,e){const n=(0,i.l)(t),r=(0,o.YN)(t[2]/n),s=Math.atan2(t[1]/n,t[0]/n);return(0,i.i)(e,n,r,s),e}var f=n(44280),m=n(32114);const T=_();function _(){return(0,a.vt)()}const g=c.e,O=c.e;function p(t,e){return(0,c.c)(e,t)}function A(t){return t[3]}function E(t){return t}function N(t,e,n,o){return(0,a.fA)(t,e,n,o)}function R(t,e,n){if(null==e)return!1;if(!I(t,e,S))return!1;let{t0:o,t1:r}=S;if((o<0||r<o&&r>0)&&(o=r),o<0)return!1;if(n){const{origin:t,direction:r}=e;n[0]=t[0]+r[0]*o,n[1]=t[1]+r[1]*o,n[2]=t[2]+r[2]*o}return!0}const S={t0:0,t1:0};function I(t,e,n){const{origin:o,direction:r}=e,i=b;i[0]=o[0]-t[0],i[1]=o[1]-t[1],i[2]=o[2]-t[2];const s=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(0===s)return!1;const c=2*(r[0]*i[0]+r[1]*i[1]+r[2]*i[2]),a=c*c-4*s*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-t[3]*t[3]);if(a<0)return!1;const u=Math.sqrt(a);return n.t0=(-c-u)/(2*s),n.t1=(-c+u)/(2*s),!0}const b=(0,s.vt)();function M(t,e){return R(t,e,null)}function v(t,e,n){const o=m.rq.get(),s=m.Rc.get();(0,i.e)(o,e.origin,e.direction);const c=A(t);(0,i.e)(n,o,e.origin),(0,i.h)(n,n,1/(0,i.l)(n)*c);const a=P(t,e.origin),u=(0,f.g7)(e.origin,n);return(0,r.$0)(s,u+a,o),(0,i.t)(n,n,s),n}function F(t,e,n){const o=(0,i.d)(m.rq.get(),e,t),r=(0,i.h)(m.rq.get(),o,t[3]/(0,i.l)(o));return(0,i.g)(n,r,t)}function P(t,e){const n=(0,i.d)(m.rq.get(),e,t),r=(0,i.l)(n),s=A(t),c=s+Math.abs(s-r);return(0,o.XM)(s/c)}const L=(0,s.vt)();function C(t,e,n,o){const r=(0,i.d)(L,e,t);switch(n){case h._.X:{const t=d(r,L)[2];return(0,i.i)(o,-Math.sin(t),Math.cos(t),0)}case h._.Y:{const t=d(r,L),e=t[1],n=t[2],s=Math.sin(e);return(0,i.i)(o,-s*Math.cos(n),-s*Math.sin(n),Math.cos(e))}case h._.Z:return(0,i.n)(o,r);default:return}}function w(t,e){const n=(0,i.d)(B,e,t);return(0,i.l)(n)-t[3]}function x(t,e){const n=(0,i.s)(t,e),o=A(t);return n<=o*o}const B=(0,s.vt)(),D=_(),y=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:T,altitudeAt:w,angleToSilhouette:P,axisAt:C,cameraFrustumCoverage:function(t,e,n,o){const r=A(t),i=r*r,s=e+.5*Math.PI,c=n*n+i-2*Math.cos(s)*n*r,a=Math.sqrt(c),u=c-i;if(u<=0)return.5;const h=Math.sqrt(u),l=Math.acos(h/a)-Math.asin(r/(a/Math.sin(s)));return Math.min(1,(l+.5*o)/o)},clear:function(t){t[0]=t[1]=t[2]=t[3]=0},closestPoint:function(t,e,n){return R(t,e,n)?n:((0,l.oC)(e,t,n),F(t,n,n))},closestPointOnSilhouette:v,containsPoint:x,copy:p,create:_,distanceToSilhouette:function(t,e){const n=(0,i.d)(m.rq.get(),e,t),o=(0,i.k)(n),r=t[3]*t[3];return Math.sqrt(Math.abs(o-r))},elevate:function(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n},equals:O,exactEquals:g,fromCenterAndRadius:function(t,e){return(0,a.fA)(t[0],t[1],t[2],e)},fromRadius:function(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t},fromValues:N,getCenter:E,getExtent:function(t,e){return e},getRadius:A,intersectLine:function(t,e,n){const o=(0,l.Cr)(e,n);if(!I(t,o,S))return[];const{origin:r,direction:c}=o,{t0:a,t1:h}=S,d=e=>{const n=(0,s.vt)();return(0,i.b)(n,r,c,e),F(t,n,n)};return Math.abs(a-h)<(0,u.FD)()?[d(a)]:[d(a),d(h)]},intersectRay:R,intersectRayClosestSilhouette:function(t,e,n){if(R(t,e,n))return n;const o=v(t,e,m.rq.get());return(0,i.g)(n,e.origin,(0,i.h)(m.rq.get(),e.direction,(0,i.j)(e.origin,o)/(0,i.l)(e.direction))),n},intersectsRay:M,projectPoint:F,setAltitudeAt:function(t,e,n,o){const r=w(t,e),s=C(t,e,h._.Z,B),c=(0,i.h)(B,s,n-r);return(0,i.g)(o,e,c)},setExtent:function(t,e,n){return t!==n&&p(t,n),n},tmpSphere:D,union:function(t,e,n=(0,a.vt)()){const o=(0,i.j)(t,e),r=t[3],s=e[3];return o+s<r?((0,c.c)(n,t),n):o+r<s?((0,c.c)(n,e),n):((0,i.m)(n,t,e,(o+s-r)/(2*o)),n[3]=(o+r+s)/2,n)},wrap:function(t){return t}},Symbol.toStringTag,{value:"Module"}))}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3455],{431:(t,e,n)=>{n.d(e,{o6:()=>v,HY:()=>x,hx:()=>F,Jb:()=>w});var o=n(9318);function r(t,e,n){const o=e/3,r=new Uint32Array(n+1),i=new Uint32Array(n+1),s=(t,e)=>{t<e?r[t+1]++:i[e+1]++};for(let e=0;e<o;e++){const n=t[3*e],o=t[3*e+1],r=t[3*e+2];s(n,o),s(o,r),s(r,n)}let c=0,a=0;for(let t=0;t<n;t++){const e=r[t+1],n=i[t+1];r[t+1]=c,i[t+1]=a,c+=e,a+=n}const u=new Uint32Array(6*o),h=r[n],l=(t,e,n)=>{if(t<e){const o=r[t+1]++;u[2*o]=e,u[2*o+1]=n}else{const o=i[e+1]++;u[2*h+2*o]=t,u[2*h+2*o+1]=n}};for(let e=0;e<o;e++){const n=t[3*e],o=t[3*e+1],r=t[3*e+2];l(n,o,e),l(o,r,e),l(r,n,e)}const d=(t,e)=>{const n=2*t,o=e-t;for(let t=1;t<o;t++){const e=u[n+2*t],o=u[n+2*t+1];let r=t-1;for(;r>=0&&u[n+2*r]>e;r--)u[n+2*r+2]=u[n+2*r],u[n+2*r+3]=u[n+2*r+1];u[n+2*r+2]=e,u[n+2*r+3]=o}};for(let t=0;t<n;t++)d(r[t],r[t+1]),d(h+i[t],h+i[t+1]);const f=new Int32Array(3*o),m=(e,n)=>e===t[3*n]?0:e===t[3*n+1]?1:e===t[3*n+2]?2:-1,g=(t,e)=>{const n=m(t,e);f[3*e+n]=-1},T=(t,e,n,o)=>{const r=m(t,e);f[3*e+r]=o;const i=m(n,o);f[3*o+i]=e};for(let t=0;t<n;t++){let e=r[t];const n=r[t+1];let o=i[t];const s=i[t+1];for(;e<n&&o<s;){const n=u[2*e],r=u[2*h+2*o];n===r?(T(t,u[2*e+1],r,u[2*h+2*o+1]),e++,o++):n<r?(g(t,u[2*e+1]),e++):(g(r,u[2*h+2*o+1]),o++)}for(;e<n;)g(t,u[2*e+1]),e++;for(;o<s;)g(u[2*h+2*o],u[2*h+2*o+1]),o++}return f}var i=n(1843),s=n(46540),c=n(3055),a=n(87811),u=n(38954),h=n(51850),l=n(4431),d=n(34727);function f(t,e,n,o,r,i=2){const s=1/(Math.abs(n)+Math.abs(o)+Math.abs(r)),c=n*s,a=o*s,u=r<=0?(c>=0?1:-1)*(1-Math.abs(a)):c,h=r<=0?(a>=0?1:-1)*(1-Math.abs(c)):a,l=e*i;t[l]=m(u),t[l+1]=m(h)}function m(t){return(0,d.qE)(Math.round(32767*t),-32767,32767)}n(11868),n(34275);class g{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?A:p}write(t,e,n){b.seed=this._edgeHashFunction(n);const o=b.getIntRange(0,255),r=b.getIntRange(0,this.settings.variants-1),i=b.getFloat(),s=255*(.5*function(t){return Math.abs(t)**1.2*Math.sign(t)}(-(1-Math.min(i/.7,1))+Math.max(0,i-.7)/(1-.7))+.5);t.position0.setVec(e,n.position0),t.position1.setVec(e,n.position1),t.componentIndex.set(e,n.componentIndex),t.variantOffset.set(e,o),t.variantStroke.set(e,r),t.variantExtension.set(e,s)}}const T=new Float32Array(6),_=new Uint32Array(T.buffer),O=new Uint32Array(1);function p(t){return T[0]=t.position0[0],T[1]=t.position0[1],T[2]=t.position0[2],T[3]=t.position1[0],T[4]=t.position1[1],T[5]=t.position1[2],O[0]=31*(31*(31*(31*(31*(166811+_[0])+_[1])+_[2])+_[3])+_[4])+_[5],O[0]}function A(t){const e=T;e[0]=N(t.position0[0]),e[1]=N(t.position0[1]),e[2]=N(t.position0[2]),e[3]=N(t.position1[0]),e[4]=N(t.position1[1]),e[5]=N(t.position1[2]),O[0]=5381;for(let t=0;t<_.length;t++)O[0]=31*O[0]+_[t];return O[0]}const E=1e4;function N(t){return Math.round(t*E)/E}class R{constructor(){this._commonWriter=new g}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.gr.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n),(0,u.g)(I,n.faceNormal0,n.faceNormal1),(0,u.n)(I,I);const{typedBuffer:o,typedBufferStride:r}=t.normalCompressed;f(o,e,I[0],I[1],I[2],r)}static{this.Layout=c.gr}static{this.glLayout=(0,l.U)(c.gr,1)}}class S{constructor(){this._commonWriter=new g}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.In.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n);{const{typedBuffer:o,typedBufferStride:r}=t.normalCompressed;f(o,e,n.faceNormal0[0],n.faceNormal0[1],n.faceNormal0[2],r)}{const{typedBuffer:o,typedBufferStride:r}=t.normal2Compressed;f(o,e,n.faceNormal1[0],n.faceNormal1[1],n.faceNormal1[2],r)}}static{this.Layout=c.In}static{this.glLayout=(0,l.U)(c.In,1)}}const I=(0,h.vt)(),b=new a.A;var M=n(93406);function v(t){const e=F(t.data,t.skipDeduplicate,t.indices,t.indicesLength);return L.updateSettings(t.writerSettings),C.updateSettings(t.writerSettings),(0,M.K)(e,L,C)}function F(t,e,n,i){if(e){const e=r(n,i,t.count);return new P(n,i,e,t)}const s=(0,o.b)(t.buffer,t.stride/4,{originalIndices:n,originalIndicesLength:i}),a=r(s.indices,i,s.uniqueCount);return{faces:s.indices,facesLength:s.indices.length,neighbors:a,vertices:c.I$.createView(s.buffer)}}class P{constructor(t,e,n,o){this.faces=t,this.facesLength=e,this.neighbors=n,this.vertices=o}}const L=new R,C=new S,w=(0,i.BP)().vec3f(s.r.POSITION0).vec3f(s.r.POSITION1),x=(0,i.BP)().vec3f(s.r.POSITION0).vec3f(s.r.POSITION1).u16(s.r.COMPONENTINDEX)},3055:(t,e,n)=>{n.d(e,{I$:()=>s,In:()=>u,gr:()=>a});var o=n(4431),r=n(1843),i=n(46540);const s=(0,r.BP)().vec3f(i.r.POSITION).u16(i.r.COMPONENTINDEX).freeze(),c=(0,r.BP)().vec2u8(i.r.SIDENESS).freeze(),a=((0,o.U)(c),(0,r.BP)().vec3f(i.r.POSITION0).vec3f(i.r.POSITION1).vec2i16(i.r.NORMALCOMPRESSED).u16(i.r.COMPONENTINDEX).u8(i.r.VARIANTOFFSET,{glNormalized:!0}).u8(i.r.VARIANTSTROKE).u8(i.r.VARIANTEXTENSION,{glNormalized:!0}).freeze()),u=(0,r.BP)().vec3f(i.r.POSITION0).vec3f(i.r.POSITION1).vec2i16(i.r.NORMALCOMPRESSED).vec2i16(i.r.NORMAL2COMPRESSED).u16(i.r.COMPONENTINDEX).u8(i.r.VARIANTOFFSET,{glNormalized:!0}).u8(i.r.VARIANTSTROKE).u8(i.r.VARIANTEXTENSION,{glNormalized:!0}).freeze();new Map([[i.r.POSITION0,0],[i.r.POSITION1,1],[i.r.COMPONENTINDEX,2],[i.r.VARIANTOFFSET,3],[i.r.VARIANTSTROKE,4],[i.r.VARIANTEXTENSION,5],[i.r.NORMALCOMPRESSED,6],[i.r.NORMAL2COMPRESSED,7],[i.r.SIDENESS,8]])},4341:(t,e,n)=>{n.d(e,{I:()=>r});var o=n(26390);class r{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,o.d)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*i);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,i));t++)this._items.push(this._allocator())}}const i=1024},4431:(t,e,n)=>{n.d(e,{U:()=>i});var o=n(63907),r=n(74038);function i(t,e=0){const n=t.stride;return Array.from(t.fields.keys()).map((o=>{const i=t.fields.get(o),c=i.constructor.ElementCount,a=s(i.constructor.ElementType),u=i.offset,h=i.optional?.glNormalized??!1;return new r._(o,c,a,u,n,h,e)}))}function s(t){const e=c[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const c={u8:o.pe.UNSIGNED_BYTE,u16:o.pe.UNSIGNED_SHORT,u32:o.pe.UNSIGNED_INT,i8:o.pe.BYTE,i16:o.pe.SHORT,i32:o.pe.INT,f16:o.pe.HALF_FLOAT,f32:o.pe.FLOAT}},9318:(t,e,n)=>{n.d(e,{b:()=>i});var o=n(34727),r=n(97146);function i(t,e,n){const i=Array.isArray(t),h=i?t.length/e:t.byteLength/(4*e),l=i?t:new Uint32Array(t,0,h*e),d=n?.minReduction??0,f=n?.originalIndices||null,m=f?f.length:0,g=n?.componentOffsets||null;let T=0;if(g)for(let t=0;t<g.length-1;t++){const e=g[t+1]-g[t];e>T&&(T=e)}else T=h;const _=Math.floor(1.1*T)+1;(null==u||u.length<2*_)&&(u=new Uint32Array((0,o.cU)(2*_)));for(let t=0;t<2*_;t++)u[t]=0;let O=0;const p=!!g&&!!f,A=p?m:h;let E=(0,r.my)(h);const N=new Uint32Array(m),R=1.96;let S=0!==d?Math.ceil(4*R*R/(d*d)*d*(1-d)):A,I=1,b=g?g[1]:A;for(let t=0;t<A;t++){if(t===S){const e=1-O/t;if(e+R*Math.sqrt(e*(1-e)/t)<d)return null;S*=2}if(t===b){for(let t=0;t<2*_;t++)u[t]=0;if(f)for(let t=g[I-1];t<g[I];t++)N[t]=E[f[t]];b=g[++I]}const n=p?f[t]:t,o=n*e,r=a(l,o,e);let i=r%_,c=O;for(;0!==u[2*i+1];){if(u[2*i]===r){const t=u[2*i+1]-1;if(s(l,o,t*e,e)){c=E[t];break}}i++,i>=_&&(i-=_)}c===O&&(u[2*i]=r,u[2*i+1]=n+1,O++),E[n]=c}if(0!==d&&1-O/h<d)return null;if(p){for(let t=g[I-1];t<N.length;t++)N[t]=E[f[t]];E=(0,r.uW)(N)}const M=i?new Array(O):new Uint32Array(O*e);O=0;for(let t=0;t<A;t++)E[t]===O&&(c(l,(p?f[t]:t)*e,M,O*e,e),O++);if(f&&!p){const t=new Uint32Array(m);for(let e=0;e<t.length;e++)t[e]=E[f[e]];E=(0,r.uW)(t)}return{buffer:Array.isArray(M)?M:M.buffer,indices:E,uniqueCount:O}}function s(t,e,n,o){for(let r=0;r<o;r++)if(t[e+r]!==t[n+r])return!1;return!0}function c(t,e,n,o,r){for(let i=0;i<r;i++)n[o+i]=t[e+i]}function a(t,e,n){let o=0;for(let r=0;r<n;r++)o=t[e+r]+o|0,o=o+(o<<11)+(o>>>2)|0;return o>>>0}let u=null},11964:(t,e,n)=>{n.d(e,{Cr:()=>u,H6:()=>d,_I:()=>l,kb:()=>h,vt:()=>a});var o=n(34727),r=n(4341),i=n(38954),s=n(51850),c=n(32114);function a(t){return t?{origin:(0,s.o8)(t.origin),vector:(0,s.o8)(t.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function u(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.d)(n.vector,e,t),n}function h(t,e){const n=(0,i.d)(c.rq.get(),e,t.origin),r=(0,i.f)(t.vector,n),s=(0,i.f)(t.vector,t.vector),a=(0,o.qE)(r/s,0,1),u=(0,i.d)(c.rq.get(),(0,i.h)(c.rq.get(),t.vector,a),n);return(0,i.f)(u,u)}function l(t,e,n){return d(t,e,0,1,n)}function d(t,e,n,r,s){const{vector:a,origin:u}=t,h=(0,i.d)(c.rq.get(),e,u),l=(0,i.f)(a,h)/(0,i.k)(a);return(0,i.h)(s,a,(0,o.qE)(l,n,r)),(0,i.g)(s,s,t.origin)}(0,s.vt)(),(0,s.vt)(),new r.I((()=>a()))},24587:(t,e,n)=>{n.r(e),n.d(e,{default:()=>ot});var o,r,i,s=n(90237),c=n(74887),a=(n(53966),n(44208),n(87811),n(49186),n(40608)),u=n(38954),h=n(51850),l=n(11964),d=n(97937),f=n(93687),m=n(3694),g=n(4341),T=(n(58083),n(87317),n(91829)),_=n(71351);function O(t){return t?{ray:(0,_.vt)(t.ray),c0:t.c0,c1:t.c1}:{ray:(0,_.vt)(),c0:0,c1:Number.MAX_VALUE}}function p(t,e){for(let n=0;n<A;n++){const o=t[n];if(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]+o[3]>=e[3])return!1}return!0}new g.I((()=>O())),n(240),n(32114),(i=o||(o={}))[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT",i[i.BOTTOM=2]="BOTTOM",i[i.TOP=3]="TOP",i[i.NEAR=4]="NEAR",i[i.FAR=5]="FAR",function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(r||(r={})),r.FAR_BOTTOM_RIGHT,r.NEAR_BOTTOM_RIGHT,r.NEAR_BOTTOM_LEFT,r.FAR_BOTTOM_LEFT,r.NEAR_BOTTOM_LEFT,r.NEAR_BOTTOM_RIGHT,r.NEAR_TOP_RIGHT,r.NEAR_TOP_LEFT,r.FAR_BOTTOM_RIGHT,r.FAR_BOTTOM_LEFT,r.FAR_TOP_LEFT,r.FAR_TOP_RIGHT,r.NEAR_BOTTOM_RIGHT,r.FAR_BOTTOM_RIGHT,r.FAR_TOP_RIGHT,r.NEAR_TOP_RIGHT,r.FAR_BOTTOM_LEFT,r.NEAR_BOTTOM_LEFT,r.NEAR_TOP_LEFT,r.FAR_TOP_LEFT,r.FAR_TOP_LEFT,r.NEAR_TOP_LEFT,r.NEAR_TOP_RIGHT,r.FAR_TOP_RIGHT;const A=6;(0,T.fA)(-1,-1,-1,1),(0,T.fA)(1,-1,-1,1),(0,T.fA)(1,1,-1,1),(0,T.fA)(-1,1,-1,1),(0,T.fA)(-1,-1,1,1),(0,T.fA)(1,-1,1,1),(0,T.fA)(1,1,1,1),(0,T.fA)(-1,1,1,1),new g.I(O),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)();var E,N,R=n(620);class S{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new I,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),I.clearPool(),V[0]=null,X.prune(),$.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=I.acquire();for(let o=0;o<e;o++){const e=t[o];this._isDegenerate(e)?this._degenerateObjects.add(e):(n.init(this._root),this._add(e,n))}I.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=I.acquire();for(const o of t){const t=e??(0,d.e)(this.objectToBoundingSphere(o),W);y(t[3])?(n.init(this._root),v(o,t,n)):this._degenerateObjects.delete(o)}I.release(n),this._shrink()}update(t,e){if(!y(e[3])&&this._isDegenerate(t))return;const n=function(t){return V[0]=t,V}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const o=(0,_.LV)(t,e);b(this._root,(t=>{if(!function(t,e){return w((0,d.a)(e.bounds),2*-e.halfSize,G),w((0,d.a)(e.bounds),2*e.halfSize,k),(0,R.O_)(t.origin,t.direction,G,k)}(o,t))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),!0}))}forEachAlongRayWithVerticalOffset(t,e,n,o){const r=(0,_.LV)(t,e);b(this._root,(t=>{if(!function(t,e,n){return w((0,d.a)(e.bounds),2*-e.halfSize,G),w((0,d.a)(e.bounds),2*e.halfSize,k),n.applyToMinMax(G,k),(0,R.O_)(t.origin,t.direction,G,k)}(r,t,o))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObjectWithOffset(r,t,o)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObjectWithOffset(r,t,o)&&n(t)})),!0}))}forEach(t){b(this._root,(e=>{const n=e.node;return n.terminals.forAll(t),null!==n.residents&&n.residents.forAll(t),!0})),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,o=()=>!0,r=1/0){let i=1/0,s=1/0,c=null;const a=B(t,e),h=a=>{if(--r,!o(a))return;const u=this.objectToBoundingSphere(a);if(!p(n,u))return;const h=D(t,e,(0,d.a)(u)),l=h-u[3],f=h+u[3];l<i&&(i=l,s=f,c=a)};return M(this._root,(o=>{if(r<=0||!p(n,o.bounds))return!1;if((0,u.h)(q,a,o.halfSize),(0,u.g)(q,q,(0,d.a)(o.bounds)),D(t,e,q)>s)return!1;const i=o.node;return i.terminals.forAll((t=>h(t))),null!==i.residents&&i.residents.forAll((t=>h(t))),!0}),t,e),c}forEachInDepthRange(t,e,n,o,r,i,s){let c=-1/0,a=1/0;const h={setRange:t=>{n===S.DepthOrder.FRONT_TO_BACK?(c=Math.max(c,t.near),a=Math.min(a,t.far)):(c=Math.max(c,-t.far),a=Math.min(a,-t.near))}};h.setRange(o);const l=D(e,n,t),f=B(e,n),m=B(e,-n),g=t=>{if(!s(t))return;const o=this.objectToBoundingSphere(t),u=(0,d.a)(o),f=D(e,n,u)-l,m=f-o[3],g=f+o[3];m>a||g<c||!p(i,o)||r(t,h)};M(this._root,(t=>{if(!p(i,t.bounds))return!1;if((0,u.h)(q,f,t.halfSize),(0,u.g)(q,q,(0,d.a)(t.bounds)),D(e,n,q)-l>a)return!1;if((0,u.h)(q,m,t.halfSize),(0,u.g)(q,q,(0,d.a)(t.bounds)),D(e,n,q)-l<c)return!1;const o=t.node;return o.terminals.forAll((t=>g(t))),null!==o.residents&&o.residents.forAll((t=>g(t))),!0}),e,n)}forEachNode(t){b(this._root,(e=>t(e.node,e.bounds,e.halfSize,e.depth)))}forEachNeighbor(t,e){const n=(0,d.g)(e),o=(0,d.a)(e),r=e=>{const r=this.objectToBoundingSphere(e),i=(0,d.g)(r),s=n+i;return!((0,u.s)((0,d.a)(r),o)-s*s<=0)||t(e)};let i=!0;const s=t=>{i&&(i=r(t))};b(this._root,(t=>{const e=(0,d.g)(t.bounds),r=n+e;if((0,u.s)((0,d.a)(t.bounds),o)-r*r>0)return!1;const c=t.node;return c.terminals.forAll(s),i&&null!==c.residents&&c.residents.forAll(s),i})),i&&this.forEachDegenerateObject(s)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||(0,d.i)(n,t)}_intersectsObjectWithOffset(t,e,n){const o=this.objectToBoundingSphere(e);return!(o[3]>0)||(0,d.i)(n.applyToBoundingSphere(o),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){const e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){const o=I.acquire().init(t);this._add(e.at(n),o),I.release(o)}}_grow(t,e){if(0!==e&&(x(t,e,(t=>this.objectToBoundingSphere(t)),K),y(K[3])&&!this._fitsInsideTree(K)))if(P(this._root.node))(0,d.e)(K,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(K);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(K,t):this._growRootAsSubNode(t),I.release(t)}}_rebuildTree(t,e){(0,u.c)((0,d.a)(Y),(0,d.a)(e.bounds)),Y[3]=e.halfSize,x([t,Y],2,(t=>t),J);const n=I.acquire().init(this._root);this._root.initFrom(null,J,J[3]),this._root.increaseHalfSize(1.25),b(n,(t=>(this.add(t.node.terminals.data,t.node.terminals.length),null!==t.node.residents&&this.add(t.node.residents.data,t.node.residents.length),!0))),I.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return b(this._root,(t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth))),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let o=-1/0;const r=this._root.bounds,i=this._root.halfSize;for(let t=0;t<3;t++){const s=r[t]-i-(n[t]-e),c=n[t]+e-(r[t]+i),a=Math.max(0,Math.ceil(s/(2*i))),u=Math.max(0,Math.ceil(c/(2*i)))+1,h=2**Math.ceil(Math.log(a+u)*Math.LOG2E);o=Math.max(o,h),Z[t].min=a,Z[t].max=u}for(let t=0;t<3;t++){let e=Z[t].min,n=Z[t].max;const s=(o-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);const c=r[t]-i-e*i*2;H[t]=c+(n+e)*i}const s=o*i;return H[3]=s*z,I.acquire().initFrom(null,H,s,0)}_growRootAsSubNode(t){const e=this._root.node;(0,u.c)((0,d.a)(K),(0,d.a)(this._root.bounds)),K[3]=this._root.halfSize,this._root.init(t),t.advanceTo(K,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,o=0;for(;o<e.length&&null==t;)n=o++,t=e[n];for(;o<e.length;)if(e[o++])return-1;return n}_isDegenerate(t){return!y(this.objectToBoundingSphere(t)[3])}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t[3]<=n&&t[0]>=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,o=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:o}}}_nodeToJSON(t){const e=t.children.map((t=>t?this._nodeToJSON(t):null)),n=t.residents?.map((t=>this.objectToBoundingSphere(t))),o=t.terminals?.map((t=>this.objectToBoundingSphere(t)));return{children:e,residents:n,terminals:o}}static fromJSON(t){const e=new S((t=>t),{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class I{constructor(){this.bounds=(0,d.c)(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,o=this.depth){return this.node=null!=t?t:I.createEmptyNode(),e&&(0,d.e)(e,this.bounds),this.halfSize=n,this.depth=o,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*z}advance(t){let e=this.node.children[t];e||(e=I.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=j[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const o=this._childIndex(t);e&&e(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]<t[0]?1:0)+(e[1]<t[1]?2:0)+(e[2]<t[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new m.A({shrink:!0}),residents:new m.A({shrink:!0})}}static{this._pool=new f.A(I)}static acquire(){return I._pool.acquire()}static release(t){I._pool.release(t)}static clearPool(){I._pool.prune()}}function b(t,e){let n=I.acquire().init(t);const o=[n];for(;0!==o.length;){if(n=o.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++)n.node.children[t]&&o.push(I.acquire().init(n).advance(t));I.release(n)}}function M(t,e,n,o=S.DepthOrder.FRONT_TO_BACK){let r=I.acquire().init(t);const i=[r];for(function(t,e,n){if(!$.length)for(let t=0;t<8;++t)$.push({index:0,distance:0});for(let n=0;n<8;++n){const o=j[n];$.data[n].index=n,$.data[n].distance=D(t,e,o)}$.sort(((t,e)=>t.distance-e.distance));for(let t=0;t<8;++t)n[t]=$.data[t].index}(n,o,Q);0!==i.length;){if(r=i.pop(),e(r)&&!r.isLeaf())for(let t=7;t>=0;--t){const e=Q[t];r.node.children[e]&&i.push(I.acquire().init(r).advance(e))}I.release(r)}}function v(t,e,n){X.clear();const o=n.advanceTo(e,((t,e)=>{X.push(t.node),X.push(e)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(t),0===o.length)for(let t=X.length-2;t>=0&&F(X.data[t],X.data[t+1]);t-=2);}function F(t,e){return e>=0&&(t.children[e]=null),!!P(t)&&(null===t.residents&&(t.residents=new m.A({shrink:!0})),!0)}function P(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}function L(t,e){t[0]=Math.min(t[0],e[0]-e[3]),t[1]=Math.min(t[1],e[1]-e[3]),t[2]=Math.min(t[2],e[2]-e[3])}function C(t,e){t[0]=Math.max(t[0],e[0]+e[3]),t[1]=Math.max(t[1],e[1]+e[3]),t[2]=Math.max(t[2],e[2]+e[3])}function w(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function x(t,e,n,o){if(1===e){const e=n(t[0]);(0,d.e)(e,o)}else{G[0]=1/0,G[1]=1/0,G[2]=1/0,k[0]=-1/0,k[1]=-1/0,k[2]=-1/0;for(let o=0;o<e;o++){const e=n(t[o]);y(e[3])&&(L(G,e),C(k,e))}(0,u.m)((0,d.a)(o),G,k,.5),o[3]=Math.max(k[0]-G[0],k[1]-G[1],k[2]-G[2])/2}}function B(t,e){let n,o=1/0;for(let r=0;r<8;++r){const i=D(t,e,U[r]);i<o&&(o=i,n=U[r])}return n}function D(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function y(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}(N=(E=S).DepthOrder||(E.DepthOrder={}))[N.FRONT_TO_BACK=1]="FRONT_TO_BACK",N[N.BACK_TO_FRONT=-1]="BACK_TO_FRONT";const j=[(0,h.fA)(-1,-1,-1),(0,h.fA)(1,-1,-1),(0,h.fA)(-1,1,-1),(0,h.fA)(1,1,-1),(0,h.fA)(-1,-1,1),(0,h.fA)(1,-1,1),(0,h.fA)(-1,1,1),(0,h.fA)(1,1,1)],U=[(0,h.fA)(-1,-1,-1),(0,h.fA)(-1,-1,1),(0,h.fA)(-1,1,-1),(0,h.fA)(-1,1,1),(0,h.fA)(1,-1,-1),(0,h.fA)(1,-1,1),(0,h.fA)(1,1,-1),(0,h.fA)(1,1,1)],z=Math.sqrt(3),V=[null],H=(0,d.c)(),q=(0,h.vt)(),G=(0,h.vt)(),k=(0,h.vt)(),X=new m.A,W=(0,d.c)(),K=(0,d.c)(),Y=(0,d.c)(),J=(0,d.c)(),Z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],$=new m.A,Q=[0,0,0,0,0,0,0,0];var tt=n(431);function et(t,e,n){const o=(0,d.c)(),r=(0,d.a)(o);return(0,u.b)(r,r,t,.5),(0,u.b)(r,r,e,.5),o[3]=(0,u.j)(r,t),(0,u.g)(r,r,n),o}let nt=class{constructor(){this._idToComponent=new Map,this._components=new S((t=>t.bounds)),this._edges=new S((t=>t.bounds)),this._tmpLineSegment=(0,l.vt)(),this._tmpP1=(0,h.vt)(),this._tmpP2=(0,h.vt)(),this._tmpP3=(0,h.vt)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,c.Te)(e),await this._ensureEdgeLocations(t,e);const n=[];return this._edges.forEachNeighbor((e=>(this._addCandidates(t,e,n),n.length<1e3)),t.bounds),{result:{candidates:n}}}async _ensureEdgeLocations(t,e){const n=[];if(this._components.forEachNeighbor((t=>{if(null==t.info){const{id:e,uid:o}=t;n.push({id:e,uid:o})}return!0}),t.bounds),!n.length)return;const o={components:n},r=await this.remoteClient.invoke("fetchAllEdgeLocations",o,e??{});for(const t of r.components)this._setFetchEdgeLocations(t)}async add(t){const e=new it(t.id,t.bounds);return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){const e=this._idToComponent.get(t.id);if(e){const t=[];this._edges.forEachNeighbor((n=>(n.component===e&&t.push(n),!0)),e.bounds),this._edges.remove(t),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){const e=this._idToComponent.get(t.id);if(null==e||t.uid!==e.uid)return;const n=tt.HY.createView(t.locations),o=new Array(n.count),r=(0,h.vt)(),i=(0,h.vt)();for(let s=0;s<n.count;s++){n.position0.getVec(s,r),n.position1.getVec(s,i);const c=et(r,i,t.origin),a=new st(e,s,c);o[s]=a}this._edges.add(o);const{objectIds:s,origin:c}=t;e.info={locations:n,objectIds:s,origin:c}}_addCandidates(t,e,n){const{info:o}=e.component,{origin:r,objectIds:i}=o,s=o.locations,c=s.position0.getVec(e.index,this._tmpP1),a=s.position1.getVec(e.index,this._tmpP2);(0,u.g)(c,c,r),(0,u.g)(a,a,r);const h=i[s.componentIndex.get(e.index)];this._addEdgeCandidate(t,h,c,a,n),rt(t,h,c,n),rt(t,h,a,n)}_addEdgeCandidate(t,e,n,o,r){if(!t.returnEdge)return;const i=(0,d.a)(t.bounds),s=(0,l.Cr)(n,o,this._tmpLineSegment),c=(0,l._I)(s,i,this._tmpP3);(0,d.o)(t.bounds,c)&&r.push({type:"edge",objectId:e,target:(0,h.o8)(c),distance:(0,u.j)(i,c),start:(0,h.o8)(n),end:(0,h.o8)(o)})}};nt=(0,s._)([(0,a.$)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],nt);const ot=nt;function rt(t,e,n,o){if(!t.returnVertex||!(0,d.o)(t.bounds,n))return;const r=(0,d.a)(t.bounds);o.push({type:"vertex",objectId:e,target:(0,h.o8)(n),distance:(0,u.j)(r,n)})}class it{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=++it.uid}static{this.uid=0}}class st{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}},34727:(t,e,n)=>{n.d(e,{$8:()=>N,Cc:()=>s,Hx:()=>g,Io:()=>E,KJ:()=>u,Sp:()=>d,XM:()=>h,YN:()=>l,ZH:()=>m,cU:()=>r,gg:()=>f,hs:()=>c,kU:()=>a,or:()=>S,pF:()=>b,pq:()=>I,qE:()=>i});const o=new Float32Array(1);function r(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function i(t,e,n){return Math.min(Math.max(t,e),n)}function s(t,e,n){return t+(e-t)*n}function c(t,e,n,o,r){return s(o,r,(t-e)/(n-e))}function a(t){return t*Math.PI/180}function u(t){return 180*t/Math.PI}function h(t){return Math.acos(i(t,-1,1))}function l(t){return Math.asin(i(t,-1,1))}function d(t,e,n=1e-6){return t===e||!(!Number.isFinite(t)||!Number.isFinite(e))&&(t>e?t-e:e-t)<=n}function f(t,e,n=1e-6){return!d(t,e,n)&&t>e}function m(t,e,n=1e-6){return!d(t,e,n)&&t<e}function g(t,e,n=1e-6){return d(t,e,n)||t>e}const T=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function _(t){return T.setFloat64(0,t),T.getBigInt64(0)}const O=BigInt("1000000"),p=A(1);function A(t){const e=_(t=Math.abs(t)),n=function(t){return T.setBigInt64(0,t),T.getFloat64(0)}(e<=O?O:e-O);return Math.abs(t-n)}function E(t,e,n=p){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(null!=n&&A(Math.min(Math.abs(t),Math.abs(e)))<n)return Math.abs(t-e)<=n;const o=_(t),r=_(e);return o<0==r<0&&!((o<r?r-o:o-r)>O)}function N(t){return R(Math.max(-I,Math.min(t,I)))}function R(t){return o[0]=t,o[0]}function S(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],o=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(d(e,1)&&d(n,1)&&d(o,1))}const I=R(34028234663852886e22);function b(t,e,n){if(void 0===n||0==+n)return Math[t](e);if(e=+e,n=+n,isNaN(e)||"number"!=typeof n||n%1!=0)return NaN;let o=e.toString().split("e");return o=(e=Math[t](+(o[0]+"e"+(o[1]?+o[1]-n:-n)))).toString().split("e"),+(o[0]+"e"+(o[1]?+o[1]+n:n))}},46540:(t,e,n)=>{var o;n.d(e,{r:()=>o}),function(t){t.POSITION="position",t.NORMAL="normal",t.NORMALCOMPRESSED="normalCompressed",t.UV0="uv0",t.UVI="uvi",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.ROTATION="rotation",t.TANGENT="tangent",t.OFFSET="offset",t.PERSPECTIVEDIVIDE="perspectiveDivide",t.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",t.LENGTH="length",t.NEXTDELTA="nextDelta",t.PREVIOUSDELTA="previousDelta",t.U0="u0",t.LINEPARAMETERS="lineParameters",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.PROFILEAUXDATA="profileAuxData",t.INSTANCEMODELORIGINHI="instanceModelOriginHi",t.INSTANCEMODELORIGINLO="instanceModelOriginLo",t.INSTANCEMODEL="instanceModel",t.INSTANCEMODELNORMAL="instanceModelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMAL2COMPRESSED="normal2Compressed",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.START_UP="startUp",t.END_UP="endUp",t.EXTRUDE="extrude",t.OLIDCOLOR="objectAndLayerIdColor",t.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(o||(o={}))},71351:(t,e,n)=>{n.d(e,{C:()=>l,Cr:()=>d,LV:()=>h,kb:()=>f,oC:()=>m,vt:()=>a}),n(4576);var o=n(4341),r=(n(77690),n(29242)),i=n(38954),s=n(51850),c=n(32114);function a(t){return t?u((0,s.o8)(t.origin),(0,s.o8)(t.direction)):u((0,s.vt)(),(0,s.vt)())}function u(t,e){return{origin:t,direction:e}}function h(t,e){const n=g.get();return n.origin=t,n.direction=e,n}function l(t,e=a()){return function(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.c)(n.direction,e),n}(t.origin,t.direction,e)}function d(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.d)(n.direction,e,t),n}function f(t,e){const n=(0,i.e)(c.rq.get(),(0,i.n)(c.rq.get(),t.direction),(0,i.d)(c.rq.get(),e,t.origin));return(0,i.f)(n,n)}function m(t,e,n){const o=(0,i.f)(t.direction,(0,i.d)(n,e,t.origin));return(0,i.g)(n,t.origin,(0,i.h)(n,t.direction,o)),n}const g=new o.I((()=>a()));(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,r.vt)()},74038:(t,e,n)=>{n.d(e,{_:()=>o});class o{constructor(t,e,n,o,r,i=!1,s=0){this.name=t,this.count=e,this.type=n,this.offset=o,this.stride=r,this.normalized=i,this.divisor=s}}},88582:(t,e,n)=>{var o;n.d(e,{_:()=>o}),function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"}(o||(o={}))},91869:(t,e,n)=>{function o(t,e){for(const n of t.values())if(e(n))return!0;return!1}function r(t,e,n){const o=t.get(e);if(void 0!==o)return o;const r=n();return t.set(e,r),r}function i(t){const e=new Map;return n=>(e.has(n)||e.set(n,t(n)),e.get(n))}n.d(e,{Bj:()=>i,Bs:()=>o,tE:()=>r})},93406:(t,e,n)=>{n.d(e,{K:()=>a});var o=n(34727),r=n(3694),i=n(38954),s=n(51850);const c=-1;function a(t,e,n){const o=t.vertices.position,r=t.vertices.componentIndex,s=g.position0,a=g.position1,l=g.faceNormal0,f=g.faceNormal1,{edges:m,normals:T}=h(t),_=m.length/4,O=e.allocate(_);let p=0;const A=_,R=n?.allocate(A);let I=0,b=0,M=0;d.length=0;for(let t=0;t<_;++t){const e=4*t;o.getVec(m.data[e],s),o.getVec(m.data[e+1],a);const n=d.pushNew();n.index=4*t,n.length=(0,i.j)(s,a)}d.sort(((t,e)=>e.length-t.length));const v=new Array,F=new Array;d.forAll((({length:t,index:h})=>{const d=m.data[h],_=m.data[h+1],A=m.data[h+2],P=m.data[h+3],L=P===c;if(o.getVec(d,s),o.getVec(_,a),L){const t=3*A;(0,i.i)(l,T.data[t],T.data[t+1],T.data[t+2]),(0,i.c)(f,l),g.componentIndex=r.get(d),g.cosAngle=(0,i.f)(l,f)}else{let t=3*A;if((0,i.i)(l,T.data[t],T.data[t+1],T.data[t+2]),t=3*P,(0,i.i)(f,T.data[t],T.data[t+1],T.data[t+2]),g.componentIndex=r.get(d),g.cosAngle=(0,i.f)(l,f),function(t,e){return t.cosAngle>e}(g,N))return;g.cosAngle<-.9999&&(0,i.c)(f,l)}b+=t,M++,L||function(t,e){return t.cosAngle<e}(g,S)?(e.write(O,p++,g),v.push(t)):u(g,E)&&(R&&n&&n.write(R,I++,g),F.push(t))}));const P=new Float32Array(v.reverse()),L=new Float32Array(F.reverse()),C=R&&n?{instancesData:R.slice(0,I),lodInfo:{lengths:L}}:void 0;return{regular:{instancesData:O.slice(0,p),lodInfo:{lengths:P}},silhouette:C,averageEdgeLength:b/M}}function u(t,e){const n=(0,o.XM)(t.cosAngle);return(0,i.o)(_,t.position1,t.position0),n*((0,i.f)((0,i.e)(T,t.faceNormal0,t.faceNormal1),_)>0?-1:1)>e}function h(t){const e=t.faces.length/3,n=t.faces,o=t.neighbors,r=t.vertices.position;f.length=m.length=0;for(let t=0;t<e;t++){const e=3*t,s=o[e],a=o[e+1],u=o[e+2],h=n[e],l=n[e+1],d=n[e+2];r.getVec(h,O),r.getVec(l,p),r.getVec(d,A),(0,i.d)(p,p,O),(0,i.d)(A,A,O),(0,i.e)(O,p,A),(0,i.n)(O,O),m.pushArray(O),(s===c||h<l)&&(f.push(h),f.push(l),f.push(t),f.push(s)),(a===c||l<d)&&(f.push(l),f.push(d),f.push(t),f.push(a)),(u===c||d<h)&&(f.push(d),f.push(h),f.push(t),f.push(u))}return{edges:f,normals:m}}class l{constructor(){this.index=0,this.length=0}}const d=new r.A({allocator:t=>t||new l,deallocator:null}),f=new r.A({deallocator:null}),m=new r.A({deallocator:null}),g=new class{constructor(){this.position0=(0,s.vt)(),this.position1=(0,s.vt)(),this.faceNormal0=(0,s.vt)(),this.faceNormal1=(0,s.vt)(),this.componentIndex=0,this.cosAngle=0}},T=(0,s.vt)(),_=(0,s.vt)(),O=(0,s.vt)(),p=(0,s.vt)(),A=(0,s.vt)(),E=(0,o.kU)(4),N=Math.cos(E),R=(0,o.kU)(35),S=Math.cos(R)},97937:(t,e,n)=>{n.d(e,{a:()=>E,c:()=>T,e:()=>p,f:()=>N,g:()=>A,i:()=>M,o:()=>x,s:()=>y}),n(44208),n(53966);var o=n(34727),r=n(58083),i=n(38954),s=n(51850),c=n(87317),a=n(91829),u=n(34304),h=n(88582),l=n(71351);function d(t,e){const n=(0,i.l)(t),r=(0,o.YN)(t[2]/n),s=Math.atan2(t[1]/n,t[0]/n);return(0,i.i)(e,n,r,s),e}var f=n(44280),m=n(32114);const g=T();function T(){return(0,a.vt)()}const _=c.e,O=c.e;function p(t,e){return(0,c.c)(e,t)}function A(t){return t[3]}function E(t){return t}function N(t,e,n,o){return(0,a.fA)(t,e,n,o)}function R(t,e,n){if(null==e)return!1;if(!I(t,e,S))return!1;let{t0:o,t1:r}=S;if((o<0||r<o&&r>0)&&(o=r),o<0)return!1;if(n){const{origin:t,direction:r}=e;n[0]=t[0]+r[0]*o,n[1]=t[1]+r[1]*o,n[2]=t[2]+r[2]*o}return!0}const S={t0:0,t1:0};function I(t,e,n){const{origin:o,direction:r}=e,i=b;i[0]=o[0]-t[0],i[1]=o[1]-t[1],i[2]=o[2]-t[2];const s=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(0===s)return!1;const c=2*(r[0]*i[0]+r[1]*i[1]+r[2]*i[2]),a=c*c-4*s*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-t[3]*t[3]);if(a<0)return!1;const u=Math.sqrt(a);return n.t0=(-c-u)/(2*s),n.t1=(-c+u)/(2*s),!0}const b=(0,s.vt)();function M(t,e){return R(t,e,null)}function v(t,e,n){const o=m.rq.get(),s=m.Rc.get();(0,i.e)(o,e.origin,e.direction);const c=A(t);(0,i.e)(n,o,e.origin),(0,i.h)(n,n,1/(0,i.l)(n)*c);const a=P(t,e.origin),u=(0,f.g7)(e.origin,n);return(0,r.$0)(s,u+a,o),(0,i.t)(n,n,s),n}function F(t,e,n){const o=(0,i.d)(m.rq.get(),e,t),r=(0,i.h)(m.rq.get(),o,t[3]/(0,i.l)(o));return(0,i.g)(n,r,t)}function P(t,e){const n=(0,i.d)(m.rq.get(),e,t),r=(0,i.l)(n),s=A(t),c=s+Math.abs(s-r);return(0,o.XM)(s/c)}const L=(0,s.vt)();function C(t,e,n,o){const r=(0,i.d)(L,e,t);switch(n){case h._.X:{const t=d(r,L)[2];return(0,i.i)(o,-Math.sin(t),Math.cos(t),0)}case h._.Y:{const t=d(r,L),e=t[1],n=t[2],s=Math.sin(e);return(0,i.i)(o,-s*Math.cos(n),-s*Math.sin(n),Math.cos(e))}case h._.Z:return(0,i.n)(o,r);default:return}}function w(t,e){const n=(0,i.d)(B,e,t);return(0,i.l)(n)-t[3]}function x(t,e){const n=(0,i.s)(t,e),o=A(t);return n<=o*o}const B=(0,s.vt)(),D=T(),y=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:g,altitudeAt:w,angleToSilhouette:P,axisAt:C,cameraFrustumCoverage:function(t,e,n,o){const r=A(t),i=r*r,s=e+.5*Math.PI,c=n*n+i-2*Math.cos(s)*n*r,a=Math.sqrt(c),u=c-i;if(u<=0)return.5;const h=Math.sqrt(u),l=Math.acos(h/a)-Math.asin(r/(a/Math.sin(s)));return Math.min(1,(l+.5*o)/o)},clear:function(t){t[0]=t[1]=t[2]=t[3]=0},closestPoint:function(t,e,n){return R(t,e,n)?n:((0,l.oC)(e,t,n),F(t,n,n))},closestPointOnSilhouette:v,containsPoint:x,copy:p,create:T,distanceToSilhouette:function(t,e){const n=(0,i.d)(m.rq.get(),e,t),o=(0,i.k)(n),r=t[3]*t[3];return Math.sqrt(Math.abs(o-r))},elevate:function(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n},equals:O,exactEquals:_,fromCenterAndRadius:function(t,e){return(0,a.fA)(t[0],t[1],t[2],e)},fromRadius:function(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t},fromValues:N,getCenter:E,getExtent:function(t,e){return e},getRadius:A,intersectLine:function(t,e,n){const o=(0,l.Cr)(e,n);if(!I(t,o,S))return[];const{origin:r,direction:c}=o,{t0:a,t1:h}=S,d=e=>{const n=(0,s.vt)();return(0,i.b)(n,r,c,e),F(t,n,n)};return Math.abs(a-h)<(0,u.FD)()?[d(a)]:[d(a),d(h)]},intersectRay:R,intersectRayClosestSilhouette:function(t,e,n){if(R(t,e,n))return n;const o=v(t,e,m.rq.get());return(0,i.g)(n,e.origin,(0,i.h)(m.rq.get(),e.direction,(0,i.j)(e.origin,o)/(0,i.l)(e.direction))),n},intersectsRay:M,projectPoint:F,setAltitudeAt:function(t,e,n,o){const r=w(t,e),s=C(t,e,h._.Z,B),c=(0,i.h)(B,s,n-r);return(0,i.g)(o,e,c)},setExtent:function(t,e,n){return t!==n&&p(t,n),n},tmpSphere:D,union:function(t,e,n=(0,a.vt)()){const o=(0,i.j)(t,e),r=t[3],s=e[3];return o+s<r?((0,c.c)(n,t),n):o+r<s?((0,c.c)(n,e),n):((0,i.m)(n,t,e,(o+s-r)/(2*o)),n[3]=(o+r+s)/2,n)},wrap:function(t){return t}},Symbol.toStringTag,{value:"Module"}))}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3379],{11764:(e,t,s)=>{s.r(t),s.d(t,{default:()=>ee});var n=s(74887),i=s(89640),r=s(6774),a=s(83027),o=s(13195);function l(e){return 746===e||747===e||!(e<4352)&&(e>=12704&&e<=12735||e>=12544&&e<=12591||e>=65072&&e<=65103&&!(e>=65097&&e<=65103)||e>=63744&&e<=64255||e>=13056&&e<=13311||e>=11904&&e<=12031||e>=12736&&e<=12783||e>=12288&&e<=12351&&!(e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=12800&&e<=13055||e>=12592&&e<=12687||e>=43360&&e<=43391||e>=55216&&e<=55295||e>=4352&&e<=4607||e>=44032&&e<=55215||e>=12352&&e<=12447||e>=12272&&e<=12287||e>=12688&&e<=12703||e>=12032&&e<=12255||e>=12784&&e<=12799||e>=12448&&e<=12543&&12540!==e||e>=65280&&e<=65519&&!(65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||e>=65104&&e<=65135&&!(e>=65112&&e<=65118||e>=65123&&e<=65126)||e>=5120&&e<=5759||e>=6320&&e<=6399||e>=65040&&e<=65055||e>=19904&&e<=19967||e>=40960&&e<=42127||e>=42128&&e<=42191)}function h(e){return!(e<11904)&&(e>=12704&&e<=12735||e>=12544&&e<=12591||e>=65072&&e<=65103||e>=63744&&e<=64255||e>=13056&&e<=13311||e>=11904&&e<=12031||e>=12736&&e<=12783||e>=12288&&e<=12351||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=12800&&e<=13055||e>=65280&&e<=65519||e>=12352&&e<=12447||e>=12272&&e<=12287||e>=12032&&e<=12255||e>=12784&&e<=12799||e>=12448&&e<=12543||e>=65040&&e<=65055||e>=42128&&e<=42191||e>=40960&&e<=42127)}function c(e){switch(e){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function u(e){switch(e){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}var f=s(18989);const d=24;class g{constructor(e,t,s,n,i,r,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=s,this._letterSpacing=n,this._hAnchor=i,this._vAnchor=r,this._justify=a}getShaping(e,t,s){const n=this._letterSpacing,i=this._lineHeight,r=this._justify,a=this._maxWidth,o=[];let f=0,d=0;for(const t of e){const e=t.codePointAt(0);if(null==e)continue;const i=s&&l(e);let r;for(const t of this._glyphItems)if(r=t[e],r)break;o.push({codePoint:e,x:f,y:d,vertical:i,glyphMosaicItem:r}),r&&(f+=r.metrics.advance+n)}let g=f;a>0&&(g=f/Math.max(1,Math.ceil(f/a)));const p=e.includes(""),y=[],x=o.length;for(let e=0;e<x-1;e++){const t=o[e].codePoint,s=h(t);if(c(t)||s){let n=0;if(10===t)n-=1e4;else if(s&&p)n+=150;else{40!==t&&65288!==t||(n+=50);const s=o[e+1].codePoint;41!==s&&65289!==s||(n+=50)}y.push(this._buildBreak(e+1,o[e].x,g,y,n,!1))}}const _=this._optimalBreaks(this._buildBreak(x,f,g,y,0,!0));let m=0;const I=t?-i:i;let b=0;for(let e=0;e<_.length;e++){const t=_[e];let s=b;for(;s<t&&u(o[s].codePoint);)o[s].glyphMosaicItem=null,++s;let n=t-1;for(;n>s&&u(o[n].codePoint);)o[n].glyphMosaicItem=null,--n;if(s<=n){const e=o[s].x;for(let t=s;t<=n;t++)o[t].x-=e,o[t].y=d;let t=o[n].x;o[n].glyphMosaicItem&&(t+=o[n].glyphMosaicItem.metrics.advance),m=Math.max(t,m),r&&this._applyJustification(o,s,n)}b=t,d+=I}if(o.length>0){const e=_.length-1,s=(r-this._hAnchor)*m;let n=(-this._vAnchor*(e+1)+.5)*i;t&&e&&(n+=e*i);for(const e of o)e.x+=s,e.y+=n}return o.filter((e=>e.glyphMosaicItem))}static getTextBox(e,t){if(!e.length)return null;let s=1/0,n=1/0,i=0,r=0;for(const a of e){const e=a.glyphMosaicItem.metrics.advance,o=a.x,l=a.y-17,h=o+e,c=l+t;s=Math.min(s,o),i=Math.max(i,h),n=Math.min(n,l),r=Math.max(r,c)}return{x:s,y:n,width:i-s,height:r-n}}static getBox(e){if(!e.length)return null;let t=1/0,s=1/0,n=0,i=0;for(const r of e){const{height:e,left:a,top:o,width:l}=r.glyphMosaicItem.metrics,h=r.x,c=r.y-(e-Math.abs(o)),u=h+l+a,f=c+e;t=Math.min(t,h),n=Math.max(n,u),s=Math.min(s,c),i=Math.max(i,f)}return{x:t,y:s,width:n-t,height:i-s}}static addDecoration(e,t){const s=e.length;if(0===s)return;let n=e[0].x+e[0].glyphMosaicItem.metrics.left,i=e[0].y;for(let r=1;r<s;r++){const s=e[r];if(s.y!==i){const a=e[r-1].x+e[r-1].glyphMosaicItem.metrics.left+e[r-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:i+t-3,vertical:!1,glyphMosaicItem:{sdf:!0,rect:new f.A(4,0,4,8),metrics:{width:a-n,height:8,left:0,top:0,advance:0},page:0,code:0}}),i=s.y,n=s.x+s.glyphMosaicItem.metrics.left}}const r=e[s-1].x+e[s-1].glyphMosaicItem.metrics.left+e[s-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:i+t-3,vertical:!1,glyphMosaicItem:{sdf:!0,rect:new f.A(4,0,4,8),metrics:{width:r-n,height:8,left:0,top:0,advance:0},page:0,code:0}})}_breakScore(e,t,s,n){const i=(e-t)*(e-t);return n?e<t?i/2:2*i:i+Math.abs(s)*s}_buildBreak(e,t,s,n,i,r){let a=null,o=this._breakScore(t,s,i,r);for(const e of n){const n=t-e.x,l=this._breakScore(n,s,i,r)+e.score;l<=o&&(a=e,o=l)}return{index:e,x:t,score:o,previousBreak:a}}_optimalBreaks(e){return e?this._optimalBreaks(e.previousBreak).concat(e.index):[]}_applyJustification(e,t,s){const n=e[s],i=n.vertical?d:n.glyphMosaicItem?n.glyphMosaicItem.metrics.advance:0,r=(n.x+i)*this._justify;for(let n=t;n<=s;n++)e[n].x-=r}}var p=s(4272);const y=.5;class x{constructor(e,t,s=0,n=-1,i=y){this.x=e,this.y=t,this.angle=s,this.segment=n,this.minzoom=i}}class _{constructor(e,t,s,n,i,r=y,a=o.MG){this.anchor=e,this.labelAngle=t,this.glyphAngle=s,this.page=n,this.alternateVerticalGlyph=i,this.minzoom=r,this.maxzoom=a}}class m{constructor(e,t,s,n,i,r,a,o,l,h,c,u){this.tl=e,this.tr=t,this.bl=s,this.br=n,this.mosaicRect=i,this.labelAngle=r,this.minAngle=a,this.maxAngle=o,this.anchor=l,this.minzoom=h,this.maxzoom=c,this.page=u}}class I{constructor(e){this.shapes=e}}class b{getIconPlacement(e,t,s){const n=new r.bR(e.x,e.y),i=s.rotationAlignment===p.I5.MAP,a=s.keepUpright;let l=s.rotate*o.os;i&&(l+=e.angle);const h=new I([]);return s.allowOverlap&&s.ignorePlacement||(h.iconColliders=[]),this._addIconPlacement(h,n,t,s,l),i&&a&&this._addIconPlacement(h,n,t,s,l+o.Jo),h}_addIconPlacement(e,t,s,n,i){const a=s.rasterizationScale,l=s.width/a,h=s.height/a,c=n.offset;let u=c[0],f=c[1];switch(n.anchor){case p.KI.CENTER:u-=l/2,f-=h/2;break;case p.KI.LEFT:f-=h/2;break;case p.KI.RIGHT:u-=l,f-=h/2;break;case p.KI.TOP:u-=l/2;break;case p.KI.BOTTOM:u-=l/2,f-=h;break;case p.KI.TOP_LEFT:break;case p.KI.BOTTOM_LEFT:f-=h;break;case p.KI.TOP_RIGHT:u-=l;break;case p.KI.BOTTOM_RIGHT:u-=l,f-=h}const d=s.rect,g=2/a,x=u-g,_=f-g,I=x+d.width/a,b=_+d.height/a,M=new r.bR(x,_),w=new r.bR(I,b),k=new r.bR(x,b),T=new r.bR(I,_);if(0!==i){const e=Math.cos(i),t=Math.sin(i);M.rotate(e,t),w.rotate(e,t),k.rotate(e,t),T.rotate(e,t)}const A=new m(M,T,k,w,d,i,0,256,t,y,o.MG,0);if(e.shapes.push(A),!n.allowOverlap||!n.ignorePlacement){const s=n.size,r=n.padding,a={xTile:t.x,yTile:t.y,dxPixels:u*s-r,dyPixels:f*s-r,hard:!n.optional,partIndex:0,width:l*s+2*r,height:h*s+2*r,angle:i,minLod:y,maxLod:o.MG};e.iconColliders.push(a)}}getTextPlacement(e,t,s,n){const i=new r.bR(e.x,e.y),l=n.rotate*o.os,h=n.rotationAlignment===p.I5.MAP,c=n.keepUpright,u=n.padding;let f=y;const x=h?e.angle:0,b=e.segment>=0&&h,M=n.allowOverlap&&n.ignorePlacement?null:[],w=[],k=!b;let T=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,P=T,D=A;const L=(b||h)&&c,V=n.size/d;let B=!1;for(const e of t)if(e.vertical){B=!0;break}let v,R=0,S=0;if(!b&&B){const e=g.getTextBox(t,n.lineHeight*d);switch(n.anchor){case p.KI.LEFT:R=e.height/2,S=-e.width/2;break;case p.KI.RIGHT:R=-e.height/2,S=e.width/2;break;case p.KI.TOP:R=e.height/2,S=e.width/2;break;case p.KI.BOTTOM:R=-e.height/2,S=-e.width/2;break;case p.KI.TOP_LEFT:R=e.height;break;case p.KI.BOTTOM_LEFT:S=-e.width;break;case p.KI.TOP_RIGHT:S=e.width;break;case p.KI.BOTTOM_RIGHT:R=-e.height}}R+=n.offset[0]*d,S+=n.offset[1]*d;for(const d of t){const t=d.glyphMosaicItem;if(!t||t.rect.isEmpty)continue;const g=t.rect,p=t.metrics,I=t.page;if(M&&k){if(void 0!==v&&v!==d.y){let t,s,i,r;B?(t=-D+R,s=T+S,i=D-P,r=A-T):(t=T+R,s=P+S,i=A-T,r=D-P);const a={xTile:e.x,yTile:e.y,dxPixels:t*V-u,dyPixels:s*V-u,hard:!n.optional,partIndex:1,width:i*V+2*u,height:r*V+2*u,angle:l,minLod:y,maxLod:o.MG};M.push(a),T=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,P=T,D=A}v=d.y}const C=[];if(b){const n=.5*t.metrics.width,i=(d.x+p.left-4+n)*V*a.ih;if(f=this._placeGlyph(e,f,i,s,e.segment,1,d.vertical,I,C),c&&(f=this._placeGlyph(e,f,i,s,e.segment,-1,d.vertical,I,C)),f>=2)break}else C.push(new _(i,x,x,I,!1)),h&&c&&C.push(new _(i,x+o.Jo,x+o.Jo,I,!1));const E=d.x+p.left,O=d.y-17-p.top,F=E+p.width,N=O+p.height;let U,z,G,K,q,H,W,j;if(!b&&B)if(d.vertical){const e=(E+F)/2-p.height/2,t=(O+N)/2+p.width/2;U=new r.bR(-t-4+R,e-4+S),z=new r.bR(U.x+g.width,U.y+g.height),G=new r.bR(U.x,z.y),K=new r.bR(z.x,U.y)}else U=new r.bR(4-O+R,E-4+S),z=new r.bR(U.x-g.height,U.y+g.width),G=new r.bR(z.x,U.y),K=new r.bR(U.x,z.y);else U=new r.bR(E-4+R,O-4+S),z=new r.bR(U.x+g.width,U.y+g.height),G=new r.bR(U.x,z.y),K=new r.bR(z.x,U.y);for(const t of C){let s,i,a,o;if(t.alternateVerticalGlyph){if(!q){const e=(O+N)/2+S;q=new r.bR((E+F)/2+R-p.height/2-4,e+p.width/2+4),H=new r.bR(q.x+g.height,q.y-g.width),W=new r.bR(H.x,q.y),j=new r.bR(q.x,H.y)}s=q,i=W,a=j,o=H}else s=U,i=G,a=K,o=z;const h=O,c=N,f=t.glyphAngle+l;if(0!==f){const e=Math.cos(f),t=Math.sin(f);s=s.clone(),i=i?.clone(),a=a?.clone(),o=o?.clone(),s.rotate(e,t),o?.rotate(e,t),i?.rotate(e,t),a?.rotate(e,t)}let y=0,x=256;if(b&&B?d.vertical?t.alternateVerticalGlyph?(y=32,x=96):(y=224,x=32):(y=224,x=96):(y=192,x=64),w.push(new m(s,a,i,o,g,t.labelAngle,y,x,t.anchor,t.minzoom,t.maxzoom,t.page)),M&&(!L||this._legible(t.labelAngle)))if(k)E<T&&(T=E),h<P&&(P=h),F>A&&(A=F),c>D&&(D=c);else if(t.minzoom<2){const s={xTile:e.x,yTile:e.y,dxPixels:(E+R)*V-u,dyPixels:(h+R)*V-u,hard:!n.optional,partIndex:1,width:(F-E)*V+2*u,height:(c-h)*V+2*u,angle:f,minLod:t.minzoom,maxLod:t.maxzoom};M.push(s)}}}if(f>=2)return null;if(M&&k){let t,s,i,r;B?(t=-D+R,s=T+S,i=D-P,r=A-T):(t=T+R,s=P+S,i=A-T,r=D-P);const a={xTile:e.x,yTile:e.y,dxPixels:t*V-u,dyPixels:s*V-u,hard:!n.optional,partIndex:1,width:i*V+2*u,height:r*V+2*u,angle:l,minLod:y,maxLod:o.MG};M.push(a)}const C=new I(w);return M&&M.length>0&&(C.textColliders=M),C}_legible(e){const t=(0,o.z0)(e);return t<65||t>=193}_placeGlyph(e,t,s,n,i,a,l,h,c){let u=a;const f=u<0?(0,o.Wh)(e.angle+o.Jo,o.pJ):e.angle;let d=0;s<0&&(u*=-1,s*=-1,d=o.Jo),u>0&&++i;let g=new r.bR(e.x,e.y),p=n[i],y=o.MG;if(n.length<=i)return y;for(;;){const e=p.x-g.x,r=p.y-g.y,a=Math.sqrt(e*e+r*r),x=Math.max(s/a,t),m=e/a,I=r/a,b=(0,o.Wh)(Math.atan2(I,m)+d,o.pJ);if(c.push(new _(g,f,b,h,!1,x,y)),l&&c.push(new _(g,f,b,h,!0,x,y)),x<=t)return x;g=p.clone();do{if(i+=u,n.length<=i||i<0)return x;p=n[i]}while(g.isEqual(p));let M=p.x-g.x,w=p.y-g.y;const k=Math.sqrt(M*M+w*w);M*=a/k,w*=a/k,g.x-=M,g.y-=w,y=x}}}var M,w,k=s(51624),T=s(15585);(w=M||(M={}))[w.moveTo=1]="moveTo",w[w.lineTo=2]="lineTo",w[w.close=7]="close";class A{constructor(e,t,s=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=s;const n=t.keys,i=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const e=r.getMessage().asUnsafe(),t=this.values;for(;!e.empty();){const s=e.getUInt32(),r=e.getUInt32();t[n[s]]=i[r]}e.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(void 0!==this._geometry)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let s,n;this._pbfGeometry=null,e?e.reset(this.type):s=[];let i,a=M.moveTo,o=0,l=0,h=0;for(;!t.empty();){if(0===o){const e=t.getUInt32();a=7&e,o=e>>3}switch(o--,a){case M.moveTo:l+=t.getSInt32(),h+=t.getSInt32(),e?e.moveTo(l,h):s&&(n&&s.push(n),n=[],n.push(new r.bR(l,h)));break;case M.lineTo:l+=t.getSInt32(),h+=t.getSInt32(),e?e.lineTo(l,h):n&&n.push(new r.bR(l,h));break;case M.close:e?e.close():n&&!n[0].equals(l,h)&&n.push(n[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?i=e.result():s&&(n&&s.push(n),i=s),t.release(),this._geometry=i,i}}var P=s(80081);class D extends P.A{constructor(){super(12)}add(e,t,s){const n=this.array;n.push(e),n.push(t),n.push(s)}}P.A;class L{constructor(e){this.extent=a.vA,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(L._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}class V extends P.A{constructor(e){super(e)}add(e,t,s,n,i,r,a,o,l,h,c,u){const f=this.array;let d=P.A.i1616to32(e,t);f.push(d);const g=31;d=P.A.i8888to32(Math.round(g*s),Math.round(g*n),Math.round(g*i),Math.round(g*r)),f.push(d),d=P.A.i8888to32(Math.round(g*a),Math.round(g*o),Math.round(g*l),Math.round(g*h)),f.push(d),d=P.A.i1616to32(c,0),f.push(d),u&&f.push(...u)}}class B extends P.A{constructor(e){super(e)}add(e,t,s){const n=this.array;n.push(P.A.i1616to32(e,t)),s&&n.push(...s)}}class v extends P.A{constructor(e){super(e)}add(e,t,s,n,i,r,a){const o=this.array,l=this.index;let h=P.A.i1616to32(e,t);return o.push(h),h=P.A.i8888to32(Math.round(15*s),Math.round(15*n),i,r),o.push(h),a&&o.push(...a),l}}class R extends P.A{constructor(e){super(e)}add(e,t,s,n,i,r,a,l,h,c,u,f){const d=this.array;let g=P.A.i1616to32(e,t);d.push(g),g=P.A.i1616to32(Math.round(8*s),Math.round(8*n)),d.push(g),g=P.A.i8888to32(i/4,r/4,l,h),d.push(g),g=P.A.i8888to32(0,(0,o.z0)(a),10*c,Math.min(10*u,255)),d.push(g),f&&d.push(...f)}}class S extends P.A{constructor(e){super(e)}add(e,t,s,n,i){const r=this.array,a=P.A.i1616to32(2*e+s,2*t+n);r.push(a),i&&r.push(...i)}}class C{constructor(e,t,s){this.layerExtent=a.vA,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=s,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,s){}}class E extends C{constructor(e,t,s,n,r){super(e,t,s),this.type=i.NP.CIRCLE,this._circleVertexBuffer=n,this._circleIndexBuffer=r}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,s=this._circleIndexBuffer;this._circleIndexStart=3*s.index,this._circleIndexCount=0;const n=this.layer,i=this.zoom;e&&e.setExtent(this.layerExtent);for(const r of this._features){const a=r.getGeometry(e);if(!a)continue;const o=n.circleMaterial.encodeAttributes(r,i,n);for(const e of a)if(e)for(const n of e){const e=t.index;t.add(n.x,n.y,0,0,o),t.add(n.x,n.y,0,1,o),t.add(n.x,n.y,1,0,o),t.add(n.x,n.y,1,1,o),s.add(e,e+1,e+2),s.add(e+1,e+2,e+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._circleIndexStart,t[n++]=this._circleIndexCount,t[n++]=this._circleVertexBuffer.array.length;for(let e=0;e<this._circleVertexBuffer.array.length;e++)s[n++]=this._circleVertexBuffer.array[e];t[n++]=this._circleIndexBuffer.array.length;for(let e=0;e<this._circleIndexBuffer.array.length;e++)t[n++]=this._circleIndexBuffer.array[e];return t.buffer}}var O=s(98291),F=s(83349);class N extends C{constructor(e,t,s,n,r,a,o){super(e,t,s),this.type=i.NP.FILL,this._patternMap=new Map,this._fillVertexBuffer=n,this._fillIndexBuffer=r,this._outlineVertexBuffer=a,this._outlineIndexBuffer=o}get fillIndexStart(){return this._fillIndexStart}get fillIndexCount(){return this._fillIndexCount}get outlineIndexStart(){return this._outlineIndexStart}get outlineIndexCount(){return this._outlineIndexCount}getResources(e,t,s){const n=this.layer,i=this.zoom,r=n.getPaintProperty("fill-pattern");if(r)if(r.isDataDriven)for(const e of this._features)t(r.getValue(i,e),!0);else t(r.getValue(i),!0)}processFeatures(e){this._fillIndexStart=3*this._fillIndexBuffer.index,this._fillIndexCount=0,this._outlineIndexStart=3*this._outlineIndexBuffer.index,this._outlineIndexCount=0;const t=this.layer,s=this.zoom,{fillMaterial:n,outlineMaterial:i,hasDataDrivenFill:r,hasDataDrivenOutline:a}=t;e&&e.setExtent(this.layerExtent);const o=t.getPaintProperty("fill-pattern"),l=o?.isDataDriven;let h=!o&&t.getPaintValue("fill-antialias",s);if(t.outlineUsesFillColor){if(h&&!t.hasDataDrivenOpacity){const e=t.getPaintValue("fill-opacity",s),n=t.getPaintValue("fill-opacity",s+1);e<1&&n<1&&(h=!1)}if(h&&!t.hasDataDrivenColor){const e=t.getPaintValue("fill-color",s),n=t.getPaintValue("fill-color",s+1);e[3]<1&&n[3]<1&&(h=!1)}}const c=this._features,u=e?.validateTessellation;if(l){const r=[];for(const l of c){const c=o.getValue(s,l),f=this._spriteInfo[c];if(!f?.rect)continue;const d=n.encodeAttributes(l,s,t,f),g=h&&a?i.encodeAttributes(l,s,t):[],p=l.getGeometry(e);r.push({ddFillAttributes:d,ddOutlineAttributes:g,page:f.page,geometry:p}),r.sort(((e,t)=>e.page-t.page));for(const{ddFillAttributes:e,ddOutlineAttributes:s,page:n,geometry:i}of r)this._processFeature(i,h,t.outlineUsesFillColor,e,s,u,n)}}else for(const o of c){const l=r?n.encodeAttributes(o,s,t):null,c=h&&a?i.encodeAttributes(o,s,t):null,f=o.getGeometry(e);this._processFeature(f,h,t.outlineUsesFillColor,l,c,u)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._fillIndexStart,t[n++]=this._fillIndexCount,t[n++]=this._outlineIndexStart,t[n++]=this._outlineIndexCount;const i=this._patternMap,r=i.size;if(t[n++]=r,r>0)for(const[e,[s,r]]of i)t[n++]=e,t[n++]=s,t[n++]=r;t[n++]=this._fillVertexBuffer.array.length;for(let e=0;e<this._fillVertexBuffer.array.length;e++)s[n++]=this._fillVertexBuffer.array[e];t[n++]=this._fillIndexBuffer.array.length;for(let e=0;e<this._fillIndexBuffer.array.length;e++)t[n++]=this._fillIndexBuffer.array[e];t[n++]=this._outlineVertexBuffer.array.length;for(let e=0;e<this._outlineVertexBuffer.array.length;e++)s[n++]=this._outlineVertexBuffer.array[e];t[n++]=this._outlineIndexBuffer.array.length;for(let e=0;e<this._outlineIndexBuffer.array.length;e++)t[n++]=this._outlineIndexBuffer.array[e];return t.buffer}_processFeature(e,t,s,n,i,r,a){if(!e)return;const o=e.length,l=!i||0===i.length;if(t&&(!s||l))for(let t=0;t<o;t++)this._processOutline(e[t],i);let h;for(let t=0;t<o;t++){const s=N._area(e[t]);s>32?(void 0!==h&&this._processFill(e,h,n,r,a),h=[t]):s<-32&&void 0!==h&&h.push(t)}void 0!==h&&this._processFill(e,h,n,r,a)}_processOutline(e,t){const s=this._outlineVertexBuffer,n=this._outlineIndexBuffer,i=n.index;let a,o,l;const h=new r.bR(0,0),c=new r.bR(0,0),u=new r.bR(0,0);let f=-1,d=-1,g=-1,p=-1,y=-1,x=!1,_=e.length;if(_<2)return;const m=e[0];let I=e[_-1];for(;_&&I.isEqual(m);)--_,I=e[_-1];if(!(_-0<2)){for(let i=0;i<_;++i){0===i?(a=e[_-1],o=e[0],l=e[1],h.assignSub(o,a),h.normalize(),h.rightPerpendicular()):(a=o,o=l,l=i!==_-1?e[i+1]:e[0],h.assign(c));const r=this._isClipEdge(a,o);-1===p&&(x=r),c.assignSub(l,o),c.normalize(),c.rightPerpendicular();const m=h.x*c.y-h.y*c.x;u.assignAdd(h,c),u.normalize();const I=-u.x*-h.x+-u.y*-h.y;let b=Math.abs(0!==I?1/I:1);b>8&&(b=8),m>=0?(g=s.add(o.x,o.y,h.x,h.y,0,1,t),-1===p&&(p=g),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),d=s.add(o.x,o.y,b*-u.x,b*-u.y,0,-1,t),-1===y&&(y=d),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),f=d,d=g,g=s.add(o.x,o.y,u.x,u.y,0,1,t),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),d=s.add(o.x,o.y,c.x,c.y,0,1,t),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g)):(g=s.add(o.x,o.y,b*u.x,b*u.y,0,1,t),-1===p&&(p=g),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),d=s.add(o.x,o.y,-h.x,-h.y,0,-1,t),-1===y&&(y=d),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),f=d,d=g,g=s.add(o.x,o.y,-u.x,-u.y,0,-1,t),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),f=s.add(o.x,o.y,-c.x,-c.y,0,-1,t),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g))}f>=0&&d>=0&&p>=0&&!x&&n.add(f,d,p),f>=0&&p>=0&&y>=0&&!x&&n.add(f,y,p),this._outlineIndexCount+=3*(n.index-i)}}_processFill(e,t,s,n,i){let r;t.length>1&&(r=[]);let a=0;for(const s of t)0!==a&&r.push(a),a+=e[s].length;const o=2*a,l=O.A.acquire();for(const s of t){const t=e[s],n=t.length;for(let e=0;e<n;++e)l.push(t[e].x,t[e].y)}const h=(0,F.e)(l,r,2);if(F.e.deviation(l,r,2,h)>0){const n=t.map((t=>e[t].length)),{buffer:r,vertexCount:a}=(0,T.l)(l,n);if(a>0){const e=this._fillVertexBuffer.index;for(let e=0;e<a;e++)this._fillVertexBuffer.add(r[2*e],r[2*e+1],s);for(let t=0;t<a;t+=3){const s=e+t;this._fillIndexBuffer.add(s,s+1,s+2)}if(void 0!==i){const e=this._patternMap,t=e.get(i);t?t[1]+=a:e.set(i,[this._fillIndexStart+this._fillIndexCount,a])}this._fillIndexCount+=a}}else{const e=h.length;if(e>0){const t=this._fillVertexBuffer.index;let n=0;for(;n<o;)this._fillVertexBuffer.add(l[n++],l[n++],s);let r=0;for(;r<e;)this._fillIndexBuffer.add(t+h[r++],t+h[r++],t+h[r++]);if(void 0!==i){const t=this._patternMap,s=t.get(i);s?s[1]+=e:t.set(i,[this._fillIndexStart+this._fillIndexCount,e])}this._fillIndexCount+=e}}O.A.release(l)}_isClipEdge(e,t){return e.x===t.x?e.x<=-64||e.x>=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const s=e.length-1;for(let n=0;n<s;n++)t+=(e[n].x-e[n+1].x)*(e[n].y+e[n+1].y);return t+=(e[s].x-e[0].x)*(e[s].y+e[0].y),.5*t}}var U=s(83773);class z extends C{constructor(e,t,s,n,r){super(e,t,s),this.type=i.NP.LINE,this._tessellationOptions={pixelCoordRatio:8,halfWidth:0,offset:0},this._patternMap=new Map,this.tessellationProperties={_lineVertexBuffer:null,_lineIndexBuffer:null,_ddValues:null},this.tessellationProperties._lineVertexBuffer=n,this.tessellationProperties._lineIndexBuffer=r,this._lineTessellator=new U.i(G(this.tessellationProperties),K(this.tessellationProperties),e.canUseThinTessellation)}get lineIndexStart(){return this._lineIndexStart}get lineIndexCount(){return this._lineIndexCount}getResources(e,t,s){const n=this.layer,i=this.zoom,r=n.getPaintProperty("line-pattern"),a=n.getPaintProperty("line-dasharray"),o=n.getLayoutProperty("line-cap");if(!r&&!a)return;const l=o?.getValue(i)||0,h=o?.isDataDriven,c=r?.isDataDriven,u=a?.isDataDriven;if(c||u)for(const e of this._features)t(c?r.getValue(i,e):this._getDashArrayKey(e,i,n,a,h,o,l));else if(r)t(r.getValue(i));else if(a){const e=a.getValue(i);t(n.getDashKey(e,l))}}processFeatures(e){this._lineIndexStart=3*this.tessellationProperties._lineIndexBuffer.index,this._lineIndexCount=0;const t=this.layer,s=this.zoom,n=this._features,i=this._tessellationOptions,{hasDataDrivenLine:r,lineMaterial:a}=t;e&&e.setExtent(this.layerExtent);const o=t.getPaintProperty("line-pattern"),l=t.getPaintProperty("line-dasharray"),h=o?.isDataDriven,c=l?.isDataDriven;let u;u=t.getLayoutProperty("line-cap");const f=u?.isDataDriven?u:null,d=f?null:t.getLayoutValue("line-cap",s),g=d||0,p=!!f;u=t.getLayoutProperty("line-join");const y=u?.isDataDriven?u:null,x=y?null:t.getLayoutValue("line-join",s);u=t.getLayoutProperty("line-miter-limit");const _=u?.isDataDriven?u:null,m=_?null:t.getLayoutValue("line-miter-limit",s);u=t.getLayoutProperty("line-round-limit");const I=u?.isDataDriven?u:null,b=I?null:t.getLayoutValue("line-round-limit",s);u=t.getPaintProperty("line-width");const M=u?.isDataDriven?u:null,w=M?null:t.getPaintValue("line-width",s);u=t.getPaintProperty("line-offset");const k=u?.isDataDriven?u:null,T=k?null:t.getPaintValue("line-offset",s);if(h||c){const r=[];for(const i of n){const n=h?o.getValue(s,i):this._getDashArrayKey(i,s,t,l,p,f,g),c=this._spriteInfo[n];if(!c?.rect)continue;const u=a.encodeAttributes(i,s,t,c),A=i.getGeometry(e);r.push({ddAttributes:u,page:c.page,cap:f?f.getValue(s,i):d,join:y?y.getValue(s,i):x,miterLimit:_?_.getValue(s,i):m,roundLimit:I?I.getValue(s,i):b,halfWidth:.5*(M?M.getValue(s,i):w),offset:k?k.getValue(s,i):T,geometry:A})}r.sort(((e,t)=>e.page-t.page)),i.textured=!0;for(const{ddAttributes:e,page:t,cap:s,join:n,miterLimit:a,roundLimit:o,halfWidth:l,offset:h,geometry:c}of r)i.capType=s,i.joinType=n,i.miterLimit=a,i.roundLimit=o,i.halfWidth=l,i.offset=h,this._processFeature(c,e,t)}else{if(o){const e=o.getValue(s),t=this._spriteInfo[e];if(!t?.rect)return}i.textured=!(!o&&!l),i.capType=d,i.joinType=x,i.miterLimit=m,i.roundLimit=b,i.halfWidth=.5*w,i.offset=T;for(const o of n){const n=r?a.encodeAttributes(o,s,t):null;f&&(i.capType=f.getValue(s,o)),y&&(i.joinType=y.getValue(s,o)),_&&(i.miterLimit=_.getValue(s,o)),I&&(i.roundLimit=I.getValue(s,o)),M&&(i.halfWidth=.5*M.getValue(s,o)),k&&(i.offset=k.getValue(s,o));const l=o.getGeometry(e);this._processFeature(l,n)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._lineIndexStart,t[n++]=this._lineIndexCount;const i=this._patternMap,r=i.size;if(t[n++]=r,r>0)for(const[e,[s,r]]of i)t[n++]=e,t[n++]=s,t[n++]=r;t[n++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let e=0;e<this.tessellationProperties._lineVertexBuffer.array.length;e++)s[n++]=this.tessellationProperties._lineVertexBuffer.array[e];t[n++]=this.tessellationProperties._lineIndexBuffer.array.length;for(let e=0;e<this.tessellationProperties._lineIndexBuffer.array.length;e++)t[n++]=this.tessellationProperties._lineIndexBuffer.array[e];return t.buffer}_processFeature(e,t,s){if(!e)return;const n=e.length;for(let i=0;i<n;i++)this._processGeometry(e[i],t,s)}_processGeometry(e,t,s){if(e.length<2)return;let n,i,r=e[0],a=1;for(;a<e.length;)n=e[a].x-r.x,i=e[a].y-r.y,n*n+i*i<1e-6?e.splice(a,1):(r=e[a],++a);if(e.length<2)return;const o=this.tessellationProperties._lineIndexBuffer,l=3*o.index;this._tessellationOptions.initialDistance=0,this._tessellationOptions.wrapDistance=65535,this.tessellationProperties._ddValues=t,this._lineTessellator.tessellate(e,this._tessellationOptions);const h=3*o.index-l;if(void 0!==s){const e=this._patternMap,t=e.get(s);t?t[1]+=h:e.set(s,[l+this._lineIndexCount,h])}this._lineIndexCount+=h}_getDashArrayKey(e,t,s,n,i,r,a){const o=i?r.getValue(t,e):a,l=n.getValue(t,e);return s.getDashKey(l,o)}}const G=e=>(t,s,n,i,r,a,o,l,h,c,u)=>(e._lineVertexBuffer.add(t,s,o,l,n,i,r,a,h,c,u,e._ddValues),e._lineVertexBuffer.index-1),K=e=>(t,s,n)=>{e._lineIndexBuffer.add(t,s,n)};var q,H=s(32488),W=s(97768),j=s(799),Y=s(3057);function J(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class Z extends C{constructor(e,t,s,n,r,a,o,l,h){super(t,s,h.getSpriteItems()),this.type=i.NP.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=n,this._iconIndexBuffer=r,this._textVertexBuffer=a,this._textIndexBuffer=o,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}static{this._bidiEngine=new H.A}getResources(e,t,s){const n=this.layer,i=this.zoom;e&&e.setExtent(this.layerExtent);const r=n.getLayoutProperty("icon-image"),a=n.getLayoutProperty("text-field");let o=n.getLayoutProperty("text-transform"),l=n.getLayoutProperty("text-font");const h=[];let c,u,f,d;r&&!r.isDataDriven&&(c=r.getValue(i)),a&&!a.isDataDriven&&(u=a.getValue(i)),o&&o.isDataDriven||(f=n.getLayoutValue("text-transform",i),o=null),l&&l.isDataDriven||(d=n.getLayoutValue("text-font",i),l=null);for(const g of this._features){const y=g.getGeometry(e);if(!y||0===y.length)continue;let x,_;r&&(x=r.isDataDriven?r.getValue(i,g):this._replaceKeys(c,g.values),x&&t(x));let m=!1;if(a&&(_=a.isDataDriven?a.getValue(i,g):this._replaceKeys(u,g.values),_)){switch(_=_.replaceAll("\\n","\n"),o&&(f=o.getValue(i,g)),f){case p.Ms.LOWERCASE:_=_.toLowerCase();break;case p.Ms.UPPERCASE:_=_.toUpperCase()}if(Z._bidiEngine.hasBidiChar(_)){let e;e="rtl"===Z._bidiEngine.checkContextual(_)?"IDNNN":"ICNNN",_=Z._bidiEngine.bidiTransform(_,e,"VLYSN"),m=!0}if(_.length>0){l&&(d=l.getValue(i,g));for(const e of d){let t=s[e];t||(t=s[e]=new Set);for(const e of _){const s=e.codePointAt(0);null!=s&&t.add(s)}}}}if(!x&&!_)continue;const I=n.getLayoutValue("symbol-sort-key",i,g),b={feature:g,sprite:x,label:_,rtl:m,geometry:y,hash:(_?(0,j.Wm)(_):0)^(x?(0,j.Wm)(x):0),priority:I,textFont:d};h.push(b)}this._symbolFeatures=h}processFeatures(e){e&&e.setExtent(this.layerExtent);const t=this.layer,s=this.zoom,n=t.getLayoutValue("symbol-placement",s),i=n!==p.kt.POINT,l=t.getLayoutValue("symbol-spacing",s)*a.ih,h=t.getLayoutProperty("icon-image"),c=t.getLayoutProperty("text-field"),u=h?new Y.aR(t,s,i):null,f=c?new Y.uU(t,s,i):null,y=this._workerTileHandler;let _;h&&(_=y.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const m=[];let I=1;f?.size&&(I=f.size/d);const b=f?f.maxAngle*o.os:0,M=f?f.size*a.ih:0;for(const e of this._symbolFeatures){let t,o;u&&_&&e.sprite&&(t=_[e.sprite],t&&t.sdf&&(this._isIconSDF=!0)),t&&u.update(s,e.feature);let h=0;const c=e.label;if(c){(0,W.Lw)(f),f.update(s,e.feature);const t=i&&f.rotationAlignment===p.I5.MAP?f.keepUpright:f.writingMode&&f.writingMode.includes(p.v9.VERTICAL);let n=.5;switch(f.anchor){case p.KI.TOP_LEFT:case p.KI.LEFT:case p.KI.BOTTOM_LEFT:n=0;break;case p.KI.TOP_RIGHT:case p.KI.RIGHT:case p.KI.BOTTOM_RIGHT:n=1}let r=.5;switch(f.anchor){case p.KI.TOP_LEFT:case p.KI.TOP:case p.KI.TOP_RIGHT:r=0;break;case p.KI.BOTTOM_LEFT:case p.KI.BOTTOM:case p.KI.BOTTOM_RIGHT:r=1}let l=.5;switch(f.justify){case p.O6.AUTO:l=n;break;case p.O6.LEFT:l=0;break;case p.O6.RIGHT:l=1}const u=f.letterSpacing*d,x=i?0:f.maxWidth*d,_=f.lineHeight*d,m=e.textFont.map((e=>y.getGlyphItems(e)));if(o=new g(m,x,_,u,n,r,l).getShaping(c,e.rtl,t),o&&o.length>0){let e=1e30,t=-1e30;for(const s of o)e=Math.min(e,s.x),t=Math.max(t,s.x);h=(t-e+48)*I*a.ih}}for(let s of e.geometry){const c=[];if(n===p.kt.LINE){if(o?.length&&f?.size){const e=f.size*a.ih*(2+Math.min(2,4*Math.abs(f.offset[1])));s=Z._smoothVertices(s,e)}Z._pushAnchors(c,s,l,h)}else n===p.kt.LINE_CENTER?Z._pushCenterAnchor(c,s):e.feature.type===r.dC.Polygon?Z._pushCentroid(c,s):c.push(new x(s[0].x,s[0].y));for(const n of c){if(n.x<0||n.x>a.vA||n.y<0||n.y>a.vA)continue;if(i&&h>0&&f?.rotationAlignment===p.I5.MAP&&!Z._honorsTextMaxAngle(s,n,h,b,M))continue;const r={shaping:o,line:s,iconMosaicItem:t,anchor:n,symbolFeature:e,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};m.push(r),this._processFeature(r,u,f)}}}m.sort(J),this._addPlacedGlyphs(),this._symbolInstances=m}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=Z._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),s=new Int32Array(t.buffer),n=new Float32Array(t.buffer),[i,r,a]=this._sourceTileKey.split("/");let o=0;t[o++]=this.type,t[o++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[o++]=this.layerUIDs[e];t[o++]=this._isIconSDF?1:0,t[o++]=parseFloat(i),t[o++]=parseFloat(r),t[o++]=parseFloat(a),t[o++]=this.markerPageMap.size;for(const[e,[s,n]]of this.markerPageMap)t[o++]=e,t[o++]=s,t[o++]=n;t[o++]=this.glyphsPageMap.size;for(const[e,[s,n]]of this.glyphsPageMap)t[o++]=e,t[o++]=s,t[o++]=n;t[o++]=this._iconVertexBuffer.index/4,t[o++]=this._textVertexBuffer.index/4,o=Z.serializeSymbols(t,s,n,o,this._symbolInstances),t[o++]=this._iconVertexBuffer.array.length;for(let e=0;e<this._iconVertexBuffer.array.length;e++)s[o++]=this._iconVertexBuffer.array[e];t[o++]=this._iconIndexBuffer.array.length;for(let e=0;e<this._iconIndexBuffer.array.length;e++)t[o++]=this._iconIndexBuffer.array[e];t[o++]=this._textVertexBuffer.array.length;for(let e=0;e<this._textVertexBuffer.array.length;e++)s[o++]=this._textVertexBuffer.array[e];t[o++]=this._textIndexBuffer.array.length;for(let e=0;e<this._textIndexBuffer.array.length;e++)t[o++]=this._textIndexBuffer.array[e];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const s of e||[]){t+=5,t+=1;for(const e of s.textColliders)t+=10;for(const e of s.iconColliders)t+=10;t+=1,t+=2*s.textVertexRanges.length,t+=1,t+=2*s.iconVertexRanges.length}return t}static serializeSymbols(e,t,s,n,i){i=i||[],t[n++]=i.length;for(const e of i){t[n++]=e.anchor.x,t[n++]=e.anchor.y,t[n++]=e.symbolFeature.hash,t[n++]=e.symbolFeature.priority,t[n++]=e.symbolFeature.feature.featureIndex,t[n++]=e.textColliders.length+e.iconColliders.length;for(const i of e.textColliders)t[n++]=i.xTile,t[n++]=i.yTile,t[n++]=i.dxPixels,t[n++]=i.dyPixels,t[n++]=i.hard?1:0,t[n++]=i.partIndex,s[n++]=i.minLod,s[n++]=i.maxLod,t[n++]=i.width,t[n++]=i.height;for(const i of e.iconColliders)t[n++]=i.xTile,t[n++]=i.yTile,t[n++]=i.dxPixels,t[n++]=i.dyPixels,t[n++]=i.hard?1:0,t[n++]=i.partIndex,s[n++]=i.minLod,s[n++]=i.maxLod,t[n++]=i.width,t[n++]=i.height;t[n++]=e.textVertexRanges.length;for(const[s,i]of e.textVertexRanges)t[n++]=s,t[n++]=i;t[n++]=e.iconVertexRanges.length;for(const[s,i]of e.iconVertexRanges)t[n++]=s,t[n++]=i}return n}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,((e,s)=>s in t?t[s]:""))}_processFeature(e,t,s){const{line:n,iconMosaicItem:i,shaping:r,anchor:a}=e,l=this.zoom,h=this.layer,c=!!i;let u=!0;c&&(u=t?.optional||!i);const f=r&&r.length>0,d=!f||s?.optional;let g,y;if(c&&(g=this._placementEngine.getIconPlacement(a,i,t)),(g||u)&&(f&&(y=this._placementEngine.getTextPlacement(a,r,n,s)),y||d)){if(g&&y||(d||u?d||y?u||g||(y=null):g=null:(g=null,y=null)),y){const t=h.hasDataDrivenText?h.textMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(e,y.shapes,l,s.rotationAlignment,t),y.textColliders){e.textColliders=y.textColliders;for(const e of y.textColliders){e.minLod=Math.max(l+(0,o.p6)(e.minLod),0),e.maxLod=Math.min(l+(0,o.p6)(e.maxLod),25);const t=e.angle;if(t){const s=Math.cos(t),n=Math.sin(t),i=e.dxPixels*s-e.dyPixels*n,r=e.dxPixels*n+e.dyPixels*s,a=(e.dxPixels+e.width)*s-e.dyPixels*n,o=(e.dxPixels+e.width)*n+e.dyPixels*s,l=e.dxPixels*s-(e.dyPixels+e.height)*n,h=e.dxPixels*n+(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s-(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n+(e.dyPixels+e.height)*s,f=Math.min(i,a,l,c),d=Math.max(i,a,l,c),g=Math.min(r,o,h,u),p=Math.max(r,o,h,u);e.dxPixels=f,e.dyPixels=g,e.width=d-f,e.height=p-g}}}}if(g){const s=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(e,g.shapes,l,i.page,t.rotationAlignment===p.I5.VIEWPORT,s),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(l+(0,o.p6)(e.minLod),0),e.maxLod=Math.min(l+(0,o.p6)(e.maxLod),25);const t=e.angle;if(t){const s=Math.cos(t),n=Math.sin(t),i=e.dxPixels*s-e.dyPixels*n,r=e.dxPixels*n+e.dyPixels*s,a=(e.dxPixels+e.width)*s-e.dyPixels*n,o=(e.dxPixels+e.width)*n+e.dyPixels*s,l=e.dxPixels*s-(e.dyPixels+e.height)*n,h=e.dxPixels*n+(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s-(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n+(e.dyPixels+e.height)*s,f=Math.min(i,a,l,c),d=Math.max(i,a,l,c),g=Math.min(r,o,h,u),p=Math.max(r,o,h,u);e.dxPixels=f,e.dyPixels=g,e.width=d-f,e.height=p-g}}}}}}_addPlacedIcons(e,t,s,n,i,r){const a=Math.max(s-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,c=this._markerMap;for(const u of t){const t=i?0:Math.max(s+(0,o.p6)(u.minzoom),a),f=i?25:Math.min(s+(0,o.p6)(u.maxzoom),25);if(f<=t)continue;const d=u.tl,g=u.tr,p=u.bl,y=u.br,x=u.mosaicRect,_=u.labelAngle,m=u.minAngle,I=u.maxAngle,b=u.anchor,M=l.index,w=x.x,k=x.y,T=w+x.width,A=k+x.height,P=l.index;l.add(b.x,b.y,d.x,d.y,w,k,_,m,I,t,f,r),l.add(b.x,b.y,g.x,g.y,T,k,_,m,I,t,f,r),l.add(b.x,b.y,p.x,p.y,w,A,_,m,I,t,f,r),l.add(b.x,b.y,y.x,y.y,T,A,_,m,I,t,f,r),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===P?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([P,4]),h.add(M,M+1,M+2),h.add(M+1,M+2,M+3),c.has(n)?c.get(n)[1]+=6:c.set(n,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,s=this._glyphMap;for(const[n,i]of this._glyphBufferDataStorage)for(const r of i){const i=e.index,a=r.symbolInstance,o=r.ddAttributes,l=e.index;e.add(r.glyphAnchor[0],r.glyphAnchor[1],r.tl[0],r.tl[1],r.xmin,r.ymin,r.labelAngle,r.minAngle,r.maxAngle,r.minLod,r.maxLod,o),e.add(r.glyphAnchor[0],r.glyphAnchor[1],r.tr[0],r.tr[1],r.xmax,r.ymin,r.labelAngle,r.minAngle,r.maxAngle,r.minLod,r.maxLod,o),e.add(r.glyphAnchor[0],r.glyphAnchor[1],r.bl[0],r.bl[1],r.xmin,r.ymax,r.labelAngle,r.minAngle,r.maxAngle,r.minLod,r.maxLod,o),e.add(r.glyphAnchor[0],r.glyphAnchor[1],r.br[0],r.br[1],r.xmax,r.ymax,r.labelAngle,r.minAngle,r.maxAngle,r.minLod,r.maxLod,o),a.textVertexRanges.length>0&&a.textVertexRanges[0][0]+a.textVertexRanges[0][1]===l?a.textVertexRanges[0][1]+=4:a.textVertexRanges.push([l,4]),t.add(i,i+1,i+2),t.add(i+1,i+2,i+3),s.has(n)?s.get(n)[1]+=6:s.set(n,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,s,n,i){const r=Math.max(s-1,0),a=n===p.I5.VIEWPORT;let l,h,c,u,f,d,g,y,x,_,m;for(const n of t)l=a?0:Math.max(s+(0,o.p6)(n.minzoom),r),h=a?25:Math.min(s+(0,o.p6)(n.maxzoom),25),h<=l||(c=n.tl,u=n.tr,f=n.bl,d=n.br,g=n.labelAngle,y=n.minAngle,x=n.maxAngle,_=n.anchor,m=n.mosaicRect,this._glyphBufferDataStorage.has(n.page)||this._glyphBufferDataStorage.set(n.page,[]),this._glyphBufferDataStorage.get(n.page).push({glyphAnchor:[_.x,_.y],tl:[c.x,c.y],tr:[u.x,u.y],bl:[f.x,f.y],br:[d.x,d.y],xmin:m.x,ymin:m.y,xmax:m.x+m.width,ymax:m.y+m.height,labelAngle:g,minAngle:y,maxAngle:x,minLod:l,maxLod:h,placementLod:r,symbolInstance:e,ddAttributes:i}))}static _pushAnchors(e,t,s,n){s+=n;let i=0;const a=t.length-1;for(let e=0;e<a;e++)i+=r.bR.distance(t[e],t[e+1]);let l=n||s;if(l*=.5,i<=l)return;const h=l/i;let c=0,u=-(s=i/Math.max(Math.round(i/s),1))/2;const f=t.length-1;for(let n=0;n<f;n++){const i=t[n],r=t[n+1],a=r.x-i.x,l=r.y-i.y,f=Math.sqrt(a*a+l*l);let d;for(;u+s<c+f;){u+=s;const t=(u-c)/f,g=(0,o.GW)(i.x,r.x,t),p=(0,o.GW)(i.y,r.y,t);void 0===d&&(d=Math.atan2(l,a)),e.push(new x(g,p,d,n,h))}c+=f}}static _pushCenterAnchor(e,t){let s=0;const n=t.length-1;for(let e=0;e<n;e++)s+=r.bR.distance(t[e],t[e+1]);const i=s/2;let a=0;const l=t.length-1;for(let s=0;s<l;s++){const n=t[s],r=t[s+1],l=r.x-n.x,h=r.y-n.y,c=Math.sqrt(l*l+h*h);if(i<a+c){const t=(i-a)/c,u=(0,o.GW)(n.x,r.x,t),f=(0,o.GW)(n.y,r.y,t),d=Math.atan2(h,l);return void e.push(new x(u,f,d,s,0))}a+=c}}static _deviation(e,t,s){const n=(t.x-e.x)*(s.x-t.x)+(t.y-e.y)*(s.y-t.y),i=(t.x-e.x)*(s.y-t.y)-(t.y-e.y)*(s.x-t.x);return Math.atan2(i,n)}static _honorsTextMaxAngle(e,t,s,n,i){let a=0;const o=s/2;let l=new r.bR(t.x,t.y),h=t.segment+1;for(;a>-o;){if(--h,h<0)return!1;a-=r.bR.distance(e[h],l),l=e[h]}a+=r.bR.distance(e[h],e[h+1]);const c=[];let u=0;const f=e.length;for(;a<o;){const t=e[h];let s,o=h;do{if(++o,o===f)return!1;s=e[o]}while(s.isEqual(t));let l,d=o;do{if(++d,d===f)return!1;l=e[d]}while(l.isEqual(s));const g=this._deviation(t,s,l);for(c.push({deviation:g,distToAnchor:a}),u+=g;a-c[0].distToAnchor>i;)u-=c.shift().deviation;if(Math.abs(u)>n)return!1;a+=r.bR.distance(s,l),h=o}return!0}static _smoothVertices(e,t){if(t<=0)return e;let s=e.length;if(s<3)return e;const n=[];let i=0,a=0;n.push(0);for(let t=1;t<s;t++){const s=r.bR.distance(e[t],e[t-1]);s>0&&(i+=s,n.push(i),a++,a!==t&&(e[a]=e[t]))}if(s=a+1,s<3)return e;t=Math.min(t,.2*i);const o=e[0].x,l=e[0].y,h=e[s-1].x,c=e[s-1].y,u=r.bR.sub(e[0],e[1]);u.normalize(),e[0].x+=t*u.x,e[0].y+=t*u.y,u.assignSub(e[s-1],e[s-2]),u.normalize(),e[s-1].x+=t*u.x,e[s-1].y+=t*u.y,n[0]-=t,n[s-1]+=t;const f=[];f.push(new r.bR(o,l));const d=1e-6,g=.5*t;for(let i=1;i<s-1;i++){let a=0,o=0,l=0;for(let s=i-1;s>=0;s--){const r=g+n[s+1]-n[i];if(r<0)break;const h=n[s+1]-n[s],c=n[i]-n[s]<g?1:r/h;if(c<d)break;const u=c*c,f=c*r-.5*u*h,p=c*h/t,y=e[s+1],x=e[s].x-y.x,_=e[s].y-y.y;a+=p/f*(y.x*c*r+.5*u*(r*x-h*y.x)-u*c*h*x/3),o+=p/f*(y.y*c*r+.5*u*(r*_-h*y.y)-u*c*h*_/3),l+=p}for(let r=i+1;r<s;r++){const s=g-n[r-1]+n[i];if(s<0)break;const h=n[r]-n[r-1],c=n[r]-n[i]<g?1:s/h;if(c<d)break;const u=c*c,f=c*s-.5*u*h,p=c*h/t,y=e[r-1],x=e[r].x-y.x,_=e[r].y-y.y;a+=p/f*(y.x*c*s+.5*u*(s*x-h*y.x)-u*c*h*x/3),o+=p/f*(y.y*c*s+.5*u*(s*_-h*y.y)-u*c*h*_/3),l+=p}f.push(new r.bR(a/l,o/l))}return f.push(new r.bR(h,c)),e[0].x=o,e[0].y=l,e[s-1].x=h,e[s-1].y=c,f}static _pushCentroid(e,t){const s=a.vA,n=a.vA,i=t.length-1;let r=0,o=0,l=0,h=t[0].x,c=t[0].y;h>s&&(h=s),h<0&&(h=0),c>n&&(c=n),c<0&&(c=0);for(let e=1;e<i;e++){let i=t[e].x,a=t[e].y,u=t[e+1].x,f=t[e+1].y;i>s&&(i=s),i<0&&(i=0),a>n&&(a=n),a<0&&(a=0),u>s&&(u=s),u<0&&(u=0),f>n&&(f=n),f<0&&(f=0);const d=(i-h)*(f-c)-(u-h)*(a-c);r+=d*(h+i+u),o+=d*(c+a+f),l+=d}r/=3*l,o/=3*l,isNaN(r)||isNaN(o)||e.push(new x(r,o))}}!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.NO_DATA=1]="NO_DATA",e[e.READY=2]="READY",e[e.MODIFIED=3]="MODIFIED",e[e.INVALID=4]="INVALID"}(q||(q={}));class ${constructor(e,t,s,n,i,a){if(this._pbfTiles={},this._tileClippers={},this._client=s,this._tile=t,this._sourceDataMaxLOD=n,a){this._styleLayerUIDs=new Set;for(const e of a)this._styleLayerUIDs.add(e)}this._styleRepository=i,this._layers=this._styleRepository?.layers??[];const[l,h,c]=t.tileKey.split("/").map(parseFloat);this._level=l;const u=(0,o.IU)(this._level);for(const t of Object.keys(e)){const s=e[t];if(this._pbfTiles[t]=new k.A(new Uint8Array(s.protobuff),new DataView(s.protobuff)),s.refKey){const[e]=s.refKey.split("/").map(parseFloat),n=l-e;if(n>0){const e=(1<<n)-1,s=h&e,i=c&e;this._tileClippers[t]=new r.O3(n,s,i,8,u)}}this._tileClippers[t]||(this._tileClippers[t]=new r.Ox)}}_canParseStyleLayer(e){return!this._styleLayerUIDs||this._styleLayerUIDs.has(e)}async parse(e){const t=(0,T.F)(),s=this._initialize(e),{returnedBuckets:n}=s;this._processLayers(s),this._linkReferences(s),this._filterFeatures(s);const i=[],r=new Set,a=(e,t)=>{r.has(e)||(i.push({name:e,repeat:t}),r.add(e))},o={};for(const e of n)e.getResources(e.tileClipper,a,o);if(this._tile.status===q.INVALID)return[];const l=this._fetchResources(i,o,e);return Promise.all([...l,t]).then((()=>this._processFeatures(s.returnedBuckets)))}_initialize(e){const t=e?.signal;return{signal:t,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(e){const{sourceNameToTileData:t,zoom:s,layers:n,sourceNameToTileClipper:i,sourceNameToUniqueSourceLayerBuckets:r,sourceNameToUniqueSourceLayers:a,returnedBuckets:o,layerIdToBucket:l,referencerUIDToReferencedId:h}=e,c=this._sourceDataMaxLOD;for(let e=n.length-1;e>=0;e--){const u=n[e];if(s<c){if(u.minzoom&&s<Math.floor(u.minzoom)||u.maxzoom&&s>=u.maxzoom)continue}else if(u.maxzoom&&s>=u.maxzoom)continue;if(u.type===p.Dc.BACKGROUND||!this._canParseStyleLayer(u.uid)||!t[u.source]||!i[u.source])continue;const f=t[u.source],d=i[u.source],g=u.sourceLayer,y=f[g];if(y){let e=a[u.source];if(e||(e=a[u.source]=new Set),e.add(u.sourceLayer),u.refLayerId)h.set(u.uid,u.refLayerId);else{const e=this._createBucket(u);if(e){e.layerUIDs=[u.uid],e.layerExtent=y.extent,e.tileClipper=d;let t=r[u.source];t||(t=r[u.source]={});let s=t[g];s||(s=t[g]=[]),s.push(e),o.push(e),l[u.id]=e}}}}}_linkReferences(e){const{layerIdToBucket:t,referencerUIDToReferencedId:s}=e;s.forEach(((e,s)=>{t[e]&&t[e].layerUIDs.push(s)}))}_filterFeatures(e){const{signal:t,sourceNameToTileData:s,sourceNameToUniqueSourceLayerBuckets:i,sourceNameToUniqueSourceLayers:r}=e,a=10*this._level,o=10*(this._level+1),l=[],h=[];for(const e of Object.keys(r))r[e].forEach((t=>{l.push(t),h.push(e)}));for(let e=0;e<l.length;e++){const r=h[e],c=l[e];if(!s[r]||!i[r])continue;const u=s[r][c],f=i[r][c];if(!f||0===f.length)continue;if((0,n.G4)(t))return;let d=0;const g=u.getData();for(;g.nextTag(2);){const e=g.getMessage(),t=new A(e,u,d++);e.release();const s=t.values;if(s){const e=s._minzoom;if(e&&e>=o)continue;const t=s._maxzoom;if(t&&t<=a)continue}for(const e of f)e.pushFeature(t)}}}_fetchResources(e,t,s){const n=[],i=this._tile.getWorkerTileHandler();let r,a;e.length>0&&(r=i.fetchSprites(e,this._client,s),n.push(r));for(const e in t){const r=t[e];r.size>0&&(a=i.fetchGlyphs(this._tile.tileKey,e,r,this._client,s),n.push(a))}return n}_processFeatures(e){const t=e.filter((e=>e.hasFeatures()||this._canParseStyleLayer(e.layer.uid)));for(const e of t)e.processFeatures(e.tileClipper);return t}_parseTileData(e){const t={};for(const s of Object.keys(e)){const n=e[s],i={};for(;n.next();)switch(n.tag()){case 3:{const e=n.getMessage(),t=new L(e);e.release(),i[t.name]=t;break}default:n.skip()}t[s]=i}return t}_createBucket(e){switch(e.type){case p.Dc.BACKGROUND:return null;case p.Dc.FILL:return this._createFillBucket(e);case p.Dc.LINE:return this._createLineBucket(e);case p.Dc.CIRCLE:return this._createCircleBucket(e);case p.Dc.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new N(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new B(e.fillMaterial.getStride()),new D,new v(e.outlineMaterial.getStride()),new D)}_createLineBucket(e){return new z(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new V(e.lineMaterial.getStride()),new D)}_createCircleBucket(e){return new E(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new S(e.circleMaterial.getStride()),new D)}_createSymbolBucket(e){const t=this._tile;return new Z(t.tileKey,e,this._level,new R(e.iconMaterial.getStride()),new D,new R(e.textMaterial.getStride()),new D,t.placementEngine,t.getWorkerTileHandler())}}class Q{constructor(e,t,s,n){this.status=q.INITIALIZED,this.placementEngine=new b,this.tileKey=e,this.refKeys=t,this._workerTileHandler=s,this._styleRepository=n}release(){this.tileKey="",this.refKeys=null,this.status=q.INITIALIZED,this._workerTileHandler=null}async parse(e,t){const s=t?.signal;if(null!=s){const e=()=>{s.removeEventListener("abort",e),this.status=q.INVALID};s.addEventListener("abort",e)}let i;const r={bucketsWithData:[],emptyBuckets:null};try{i=await this._parse(e,t)}catch(e){if((0,n.zf)(e))throw e;return{result:r,transferList:[]}}this.status=q.READY;const a=r.bucketsWithData,o=[];for(const e of i)if(e.hasFeatures()){const t=e.serialize();a.push(t)}else o.push(e.layer.uid);const l=[...a];let h=null;return o.length>0&&(h=Uint32Array.from(o),l.push(h.buffer)),r.emptyBuckets=h,{result:r,transferList:l}}setObsolete(){this.status=q.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,t){const s=e.sourceName2DataAndRefKey;return 0===Object.keys(s).length?[]:(this.status=q.MODIFIED,new $(s,this,t.client,e.sourceDataMaxLOD,this._styleRepository,e.styleLayerUIDs).parse(t))}}var X=s(45013);class ee{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=25}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){return this._styleRepository?.layers??[]}async createTileAndParse(e,t){const{key:s}=e,i={};for(const t of Object.keys(e.sourceName2DataAndRefKey)){const s=e.sourceName2DataAndRefKey[t];i[t]=s.refKey}const r=new Q(s,i,this,this._styleRepository);try{return await r.parse({...e,sourceDataMaxLOD:this._sourceDataMaxLOD},t)}catch(e){if(r.setObsolete(),r.release(),!(0,n.zf)(e))throw e;return null}}updateStyle(e){if(!e||0===e.length||!this._styleRepository)return;const t=this._styleRepository;for(const s of e){const e=s.type,n=s.data;switch(e){case i.$q.PAINTER_CHANGED:t.setPaintProperties(n.layer,n.paint);break;case i.$q.LAYOUT_CHANGED:t.setLayoutProperties(n.layer,n.layout);break;case i.$q.LAYER_REMOVED:t.deleteStyleLayer(n.layer);break;case i.$q.LAYER_CHANGED:t.setStyleLayer(n.layer,n.index);break;case i.$q.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(e){const{style:t,sourceDataMaxLOD:s}=e;this._styleRepository=new X.A(t),this._sourceDataMaxLOD=s,this._spriteInfo={},this._glyphInfo={}}fetchSprites(e,t,s){const n=[],i=this._spriteInfo;for(const t of e)void 0===i[t.name]&&n.push(t);return 0===n.length?Promise.resolve():t.invoke("getSprites",n,{signal:s?.signal}).then((e=>{for(const t in e){const s=e[t];i[t]=s}}))}getSpriteItems(){return this._spriteInfo}fetchGlyphs(e,t,s,n,i){const r=[];let a=this._glyphInfo[t];return a?s.forEach((e=>{a[e]||r.push(e)})):(a=this._glyphInfo[t]=[],s.forEach((e=>r.push(e)))),0===r.length?Promise.resolve():n.invoke("getGlyphs",{tileID:e,font:t,codePoints:r},i).then((e=>{for(let t=0;t<e.length;t++)e[t]&&(a[t]=e[t])}))}getGlyphItems(e){return this._glyphInfo[e]}}},34304:(e,t,s)=>{s.d(t,{DF:()=>l,FD:()=>i,Ov:()=>r,ct:()=>h});let n=1e-6;function i(){return n}const r=Math.random,a=Math.PI/180,o=180/Math.PI;function l(e){return e*a}function h(e){return e*o}Object.freeze(Object.defineProperty({__proto__:null,RANDOM:r,equals:function(e,t){return Math.abs(e-t)<=n*Math.max(1,Math.abs(e),Math.abs(t))},getEpsilon:i,setEpsilon:function(e){n=e},toDegree:h,toRadian:l},Symbol.toStringTag,{value:"Module"}))},40876:(e,t,s)=>{s.d(t,{Eq:()=>d,G1:()=>p,TS:()=>r,Tf:()=>_,V6:()=>i,Vm:()=>g,ay:()=>l,c1:()=>y,c4:()=>a,j5:()=>h,lT:()=>u,oW:()=>c});const n={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function i(e){return!!n[e]||!!n[e.toLowerCase()]}function r(e){return n[e]??n[e.toLowerCase()]}function a(e){return[...r(e)]}function o(e,t,s){s<0&&++s,s>1&&--s;const n=6*s;return n<1?e+(t-e)*n:2*s<1?t:3*s<2?e+(t-e)*(2/3-s)*6:e}function l(e,t,s,n=1){const i=(e%360+360)%360/360,r=s<=.5?s*(t+1):s+t-s*t,a=2*s-r;return[Math.round(255*o(a,r,i+1/3)),Math.round(255*o(a,r,i)),Math.round(255*o(a,r,i-1/3)),n]}function h(e){const t=e.length>5,s=t?8:4,n=(1<<s)-1,i=t?1:17,r=t?9===e.length:5===e.length;let a=Number("0x"+e.slice(1));if(isNaN(a))return null;const o=[0,0,0,1];let l;return r&&(l=a&n,a>>=s,o[3]=i*l/255),l=a&n,a>>=s,o[2]=i*l,l=a&n,a>>=s,o[1]=i*l,l=a&n,a>>=s,o[0]=i*l,o}function c(e){if("#"!==e[0]||isNaN(Number(`0x${e.slice(1)}`)))return null;switch(e.length){case 4:case 5:{const t=parseInt(e.slice(1,2),16),s=parseInt(e.slice(2,3),16),n=parseInt(e.slice(3,4),16),i=5===e.length?15:parseInt(e.slice(4),16);return[t+16*t,s+16*s,n+16*n,(i+16*i)/255]}case 7:case 9:return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16),(7===e.length?255:parseInt(e.slice(7),16))/255];default:return null}}function u(e){const t=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s.\-,%0-9]+)\)/);if(t){const e=t[2].split(/\s*,\s*/),s=t[1];if("rgb"===s&&3===e.length||"rgba"===s&&4===e.length){const t=e[0];if("%"===t.charAt(t.length-1)){const t=e.map((e=>2.56*parseFloat(e)));return 4===e.length&&(t[3]=parseFloat(e[3])),f(t)}return f(e.map((e=>parseFloat(e))))}if("hsl"===s&&3===e.length||"hsla"===s&&4===e.length)return l(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100,parseFloat(e[3]))}return null}function f(e){return e[0]=y(e[0]),e[1]=y(e[1]),e[2]=y(e[2]),e[3]=4===e.length?p(e[3]):1,e}function d(e){let t=i(e)?r(e):null;return t??=u(e),t??=c(e),t}function g(e){const t=d(e);return null!=t?[t[0]/255,t[1]/255,t[2]/255,t[3]]:null}function p(e){return x(e,0,1)}function y(e){return Math.round(x(e,0,255))}function x(e,t,s){return e=Number(e),isNaN(e)?s:e<t?t:e>s?s:e}const _=2.2},51624:(e,t,s)=>{s.d(t,{A:()=>u});var n,i,r=s(44208),a=s(69397),o=s(93687);(i=n||(n={}))[i.varint=0]="varint",i[i.fixed64=1]="fixed64",i[i.delimited=2]="delimited",i[i.fixed32=5]="fixed32",i[i.unknown=99]="unknown";const l=4294967296,h=new TextDecoder("utf-8"),c=(0,r.A)("safari")||(0,r.A)("ios")?6:(0,r.A)("ff")?12:32;class u{constructor(e,t,s=0,i=(e?e.byteLength:0)){this._tag=0,this._dataType=n.unknown,this._init(e,t,s,i)}_init(e,t,s,n){this._data=e,this._dataView=t,this._pos=s,this._end=n}get usedMemory(){return 64+(0,a.Qf)(this._data)}asUnsafe(){return this}clone(){return new u(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;if(e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128)return e;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*l;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*l;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,n){const i=this.getMessage(),r=e(i,t,s,n);return i.release(),r}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=u.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){u.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case n.varint:this._decodeVarint();break;case n.fixed64:this._skip(8);break;case n.delimited:this._skip(this._getLength());break;case n.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t=this._pos,s=0,n=0;if(this._end-t>=10)do{if(n=e[t++],s|=127&n,!(128&n))break;if(n=e[t++],s|=(127&n)<<7,!(128&n))break;if(n=e[t++],s|=(127&n)<<14,!(128&n))break;if(n=e[t++],s|=(127&n)<<21,!(128&n))break;if(n=e[t++],s+=268435456*(127&n),!(128&n))break;if(n=e[t++],s+=34359738368*(127&n),!(128&n))break;if(n=e[t++],s+=4398046511104*(127&n),!(128&n))break;if(n=e[t++],s+=562949953421312*(127&n),!(128&n))break;if(n=e[t++],s+=72057594037927940*(127&n),!(128&n))break;if(n=e[t++],s+=0x8000000000000000*(127&n),!(128&n))break;throw new Error("Varint too long!")}while(0);else{let i=1;for(;t!==this._end&&(n=e[t],128&n);)++t,s+=(127&n)*i,i*=128;if(t===this._end)throw new Error("Varint overrun!");++t,s+=n*i}return this._pos=t,s}_decodeSVarint(){const e=this._data;let t,s=0,n=0;const i=1&e[this._pos];if(n=e[this._pos++],s|=127&n,!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s|=(127&n)<<7,!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s|=(127&n)<<14,!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s|=(127&n)<<21,!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s+=268435456*(127&n),!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s+=34359738368*(127&n),!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s+=4398046511104*(127&n),!(128&n))return i?-(s+1)/2:s/2;if(t=BigInt(s),n=e[this._pos++],t+=0x2000000000000n*BigInt(127&n),!(128&n))return Number(i?-(t+1n)/2n:t/2n);if(n=e[this._pos++],t+=0x100000000000000n*BigInt(127&n),!(128&n))return Number(i?-(t+1n)/2n:t/2n);if(n=e[this._pos++],t+=0x8000000000000000n*BigInt(127&n),!(128&n))return Number(i?-(t+1n)/2n:t/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==n.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>c){const n=e.subarray(t,s);return h.decode(n)}let n="",i="";for(let r=t;r<s;++r){const t=e[r];128&t?i+="%"+t.toString(16):(n+=decodeURIComponent(i)+String.fromCharCode(t),i="")}return i.length&&(n+=decodeURIComponent(i)),n}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}static{this.pool=new o.A(u,void 0,(e=>{e._data=null,e._dataView=null}))}}},69397:(e,t,s)=>{s.d(t,{$B:()=>i,Qf:()=>h,Qh:()=>o,RS:()=>r,ez:()=>f,lM:()=>a,qK:()=>u});var n=s(34275);function i(e){return 32+e.length}const r=16;function a(e){if(!e)return 0;let t=u;for(const s in e)e.hasOwnProperty(s)&&(t+=l(e[s],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return h(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return c(e,8);let s=f;for(let n=0;n<t;n++)s+=l(e[n]);return s}(e);let t=u;for(const s in e)e.hasOwnProperty(s)&&(t+=l(e[s]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?o(e):u;case"string":return i(e);case"number":return r;case"boolean":return 4;default:return 8}}function h(...e){return e.reduce(((e,t)=>e+(t?(0,n.iu)(t)?t.byteLength+d:Array.isArray(t)?c(t,r):0:0)),0)}function c(e,t){return f+e.length*t}const u=32,f=16,d=145},87317:(e,t,s)=>{s.d(t,{a:()=>m,b:()=>c,c:()=>i,e:()=>I,f:()=>g,g:()=>a,h:()=>y,j:()=>d,l:()=>x,n:()=>p,s:()=>r,t:()=>_});var n=s(34304);function i(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function r(e,t,s,n,i){return e[0]=t,e[1]=s,e[2]=n,e[3]=i,e}function a(e,t,s){return e[0]=t[0]+s[0],e[1]=t[1]+s[1],e[2]=t[2]+s[2],e[3]=t[3]+s[3],e}function o(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e[2]=t[2]-s[2],e[3]=t[3]-s[3],e}function l(e,t,s){return e[0]=t[0]*s[0],e[1]=t[1]*s[1],e[2]=t[2]*s[2],e[3]=t[3]*s[3],e}function h(e,t,s){return e[0]=t[0]/s[0],e[1]=t[1]/s[1],e[2]=t[2]/s[2],e[3]=t[3]/s[3],e}function c(e,t,s){return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e}function u(e,t){const s=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],r=t[3]-e[3];return Math.sqrt(s*s+n*n+i*i+r*r)}function f(e,t){const s=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],r=t[3]-e[3];return s*s+n*n+i*i+r*r}function d(e){const t=e[0],s=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+s*s+n*n+i*i)}function g(e){const t=e[0],s=e[1],n=e[2],i=e[3];return t*t+s*s+n*n+i*i}function p(e,t){const s=t[0],n=t[1],i=t[2],r=t[3];let a=s*s+n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a),e[0]=s*a,e[1]=n*a,e[2]=i*a,e[3]=r*a),e}function y(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function x(e,t,s,n){const i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=i+n*(s[0]-i),e[1]=r+n*(s[1]-r),e[2]=a+n*(s[2]-a),e[3]=o+n*(s[3]-o),e}function _(e,t,s){const n=t[0],i=t[1],r=t[2],a=t[3];return e[0]=s[0]*n+s[4]*i+s[8]*r+s[12]*a,e[1]=s[1]*n+s[5]*i+s[9]*r+s[13]*a,e[2]=s[2]*n+s[6]*i+s[10]*r+s[14]*a,e[3]=s[3]*n+s[7]*i+s[11]*r+s[15]*a,e}function m(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function I(e,t){const s=e[0],i=e[1],r=e[2],a=e[3],o=t[0],l=t[1],h=t[2],c=t[3],u=(0,n.FD)();return Math.abs(s-o)<=u*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(i-l)<=u*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(r-h)<=u*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-c)<=u*Math.max(1,Math.abs(a),Math.abs(c))}const b=o,M=l,w=h,k=u,T=f,A=d,P=g;Object.freeze(Object.defineProperty({__proto__:null,add:a,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:i,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:k,distance:u,div:w,divide:h,dot:y,equals:I,exactEquals:m,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:A,length:d,lerp:x,max:function(e,t,s){return e[0]=Math.max(t[0],s[0]),e[1]=Math.max(t[1],s[1]),e[2]=Math.max(t[2],s[2]),e[3]=Math.max(t[3],s[3]),e},min:function(e,t,s){return e[0]=Math.min(t[0],s[0]),e[1]=Math.min(t[1],s[1]),e[2]=Math.min(t[2],s[2]),e[3]=Math.min(t[3],s[3]),e},mul:M,multiply:l,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:p,random:function(e,t=1){const s=n.Ov;let i,r,a,o,l,h;do{i=2*s()-1,r=2*s()-1,l=i*i+r*r}while(l>=1);do{a=2*s()-1,o=2*s()-1,h=a*a+o*o}while(h>=1);const c=Math.sqrt((1-l)/h);return e[0]=t*i,e[1]=t*r,e[2]=t*a*c,e[3]=t*o*c,e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},scale:c,scaleAndAdd:function(e,t,s,n){return e[0]=t[0]+s[0]*n,e[1]=t[1]+s[1]*n,e[2]=t[2]+s[2]*n,e[3]=t[3]+s[3]*n,e},set:r,sqrDist:T,sqrLen:P,squaredDistance:f,squaredLength:g,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:b,subtract:o,transformMat4:_,transformQuat:function(e,t,s){const n=t[0],i=t[1],r=t[2],a=s[0],o=s[1],l=s[2],h=s[3],c=h*n+o*r-l*i,u=h*i+l*n-a*r,f=h*r+a*i-o*n,d=-a*n-o*i-l*r;return e[0]=c*h+d*-a+u*-l-f*-o,e[1]=u*h+d*-o+f*-a-c*-l,e[2]=f*h+d*-l+c*-o-u*-a,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},91829:(e,t,s)=>{function n(){return[0,0,0,0]}function i(e,t,s,n){return[e,t,s,n]}function r(e,t,s,n){return[e,t,s,n]}function a(e,t=[0,0,0,0]){const s=Math.min(4,e.length);for(let n=0;n<s;++n)t[n]=e[n];return t}function o(){return i(1,1,1,1)}function l(){return i(1,0,0,0)}function h(){return i(0,1,0,0)}function c(){return i(0,0,1,0)}function u(){return i(0,0,0,1)}s.d(t,{CN:()=>r,Un:()=>d,ci:()=>a,fA:()=>i,uY:()=>f,vt:()=>n});const f=[0,0,0,0],d=o(),g=l(),p=h(),y=c(),x=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_W:x,UNIT_X:g,UNIT_Y:p,UNIT_Z:y,ZEROS:f,clone:function(e){return[e[0],e[1],e[2],e[3]]},create:n,freeze:r,fromArray:a,fromValues:i,ones:o,unitW:u,unitX:l,unitY:h,unitZ:c,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"}))}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3379],{11764:(e,t,s)=>{s.r(t),s.d(t,{default:()=>ee});var n=s(74887),i=s(89640),r=s(6774),a=s(83027),o=s(13195);function l(e){return 746===e||747===e||!(e<4352)&&(e>=12704&&e<=12735||e>=12544&&e<=12591||e>=65072&&e<=65103&&!(e>=65097&&e<=65103)||e>=63744&&e<=64255||e>=13056&&e<=13311||e>=11904&&e<=12031||e>=12736&&e<=12783||e>=12288&&e<=12351&&!(e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=12800&&e<=13055||e>=12592&&e<=12687||e>=43360&&e<=43391||e>=55216&&e<=55295||e>=4352&&e<=4607||e>=44032&&e<=55215||e>=12352&&e<=12447||e>=12272&&e<=12287||e>=12688&&e<=12703||e>=12032&&e<=12255||e>=12784&&e<=12799||e>=12448&&e<=12543&&12540!==e||e>=65280&&e<=65519&&!(65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||e>=65104&&e<=65135&&!(e>=65112&&e<=65118||e>=65123&&e<=65126)||e>=5120&&e<=5759||e>=6320&&e<=6399||e>=65040&&e<=65055||e>=19904&&e<=19967||e>=40960&&e<=42127||e>=42128&&e<=42191)}function h(e){return!(e<11904)&&(e>=12704&&e<=12735||e>=12544&&e<=12591||e>=65072&&e<=65103||e>=63744&&e<=64255||e>=13056&&e<=13311||e>=11904&&e<=12031||e>=12736&&e<=12783||e>=12288&&e<=12351||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=12800&&e<=13055||e>=65280&&e<=65519||e>=12352&&e<=12447||e>=12272&&e<=12287||e>=12032&&e<=12255||e>=12784&&e<=12799||e>=12448&&e<=12543||e>=65040&&e<=65055||e>=42128&&e<=42191||e>=40960&&e<=42127)}function c(e){switch(e){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function u(e){switch(e){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}var f=s(18989);const d=24;class g{constructor(e,t,s,n,i,r,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=s,this._letterSpacing=n,this._hAnchor=i,this._vAnchor=r,this._justify=a}getShaping(e,t,s){const n=this._letterSpacing,i=this._lineHeight,r=this._justify,a=this._maxWidth,o=[];let f=0,d=0;for(const t of e){const e=t.codePointAt(0);if(null==e)continue;const i=s&&l(e);let r;for(const t of this._glyphItems)if(r=t[e],r)break;o.push({codePoint:e,x:f,y:d,vertical:i,glyphMosaicItem:r}),r&&(f+=r.metrics.advance+n)}let g=f;a>0&&(g=f/Math.max(1,Math.ceil(f/a)));const p=e.includes(""),y=[],x=o.length;for(let e=0;e<x-1;e++){const t=o[e].codePoint,s=h(t);if(c(t)||s){let n=0;if(10===t)n-=1e4;else if(s&&p)n+=150;else{40!==t&&65288!==t||(n+=50);const s=o[e+1].codePoint;41!==s&&65289!==s||(n+=50)}y.push(this._buildBreak(e+1,o[e].x,g,y,n,!1))}}const _=this._optimalBreaks(this._buildBreak(x,f,g,y,0,!0));let m=0;const I=t?-i:i;let b=0;for(let e=0;e<_.length;e++){const t=_[e];let s=b;for(;s<t&&u(o[s].codePoint);)o[s].glyphMosaicItem=null,++s;let n=t-1;for(;n>s&&u(o[n].codePoint);)o[n].glyphMosaicItem=null,--n;if(s<=n){const e=o[s].x;for(let t=s;t<=n;t++)o[t].x-=e,o[t].y=d;let t=o[n].x;o[n].glyphMosaicItem&&(t+=o[n].glyphMosaicItem.metrics.advance),m=Math.max(t,m),r&&this._applyJustification(o,s,n)}b=t,d+=I}if(o.length>0){const e=_.length-1,s=(r-this._hAnchor)*m;let n=(-this._vAnchor*(e+1)+.5)*i;t&&e&&(n+=e*i);for(const e of o)e.x+=s,e.y+=n}return o.filter((e=>e.glyphMosaicItem))}static getTextBox(e,t){if(!e.length)return null;let s=1/0,n=1/0,i=0,r=0;for(const a of e){const e=a.glyphMosaicItem.metrics.advance,o=a.x,l=a.y-17,h=o+e,c=l+t;s=Math.min(s,o),i=Math.max(i,h),n=Math.min(n,l),r=Math.max(r,c)}return{x:s,y:n,width:i-s,height:r-n}}static getBox(e){if(!e.length)return null;let t=1/0,s=1/0,n=0,i=0;for(const r of e){const{height:e,left:a,top:o,width:l}=r.glyphMosaicItem.metrics,h=r.x,c=r.y-(e-Math.abs(o)),u=h+l+a,f=c+e;t=Math.min(t,h),n=Math.max(n,u),s=Math.min(s,c),i=Math.max(i,f)}return{x:t,y:s,width:n-t,height:i-s}}static addDecoration(e,t){const s=e.length;if(0===s)return;let n=e[0].x+e[0].glyphMosaicItem.metrics.left,i=e[0].y;for(let r=1;r<s;r++){const s=e[r];if(s.y!==i){const a=e[r-1].x+e[r-1].glyphMosaicItem.metrics.left+e[r-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:i+t-3,vertical:!1,glyphMosaicItem:{sdf:!0,rect:new f.A(4,0,4,8),metrics:{width:a-n,height:8,left:0,top:0,advance:0},page:0,code:0}}),i=s.y,n=s.x+s.glyphMosaicItem.metrics.left}}const r=e[s-1].x+e[s-1].glyphMosaicItem.metrics.left+e[s-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:i+t-3,vertical:!1,glyphMosaicItem:{sdf:!0,rect:new f.A(4,0,4,8),metrics:{width:r-n,height:8,left:0,top:0,advance:0},page:0,code:0}})}_breakScore(e,t,s,n){const i=(e-t)*(e-t);return n?e<t?i/2:2*i:i+Math.abs(s)*s}_buildBreak(e,t,s,n,i,r){let a=null,o=this._breakScore(t,s,i,r);for(const e of n){const n=t-e.x,l=this._breakScore(n,s,i,r)+e.score;l<=o&&(a=e,o=l)}return{index:e,x:t,score:o,previousBreak:a}}_optimalBreaks(e){return e?this._optimalBreaks(e.previousBreak).concat(e.index):[]}_applyJustification(e,t,s){const n=e[s],i=n.vertical?d:n.glyphMosaicItem?n.glyphMosaicItem.metrics.advance:0,r=(n.x+i)*this._justify;for(let n=t;n<=s;n++)e[n].x-=r}}var p=s(4272);const y=.5;class x{constructor(e,t,s=0,n=-1,i=y){this.x=e,this.y=t,this.angle=s,this.segment=n,this.minzoom=i}}class _{constructor(e,t,s,n,i,r=y,a=o.MG){this.anchor=e,this.labelAngle=t,this.glyphAngle=s,this.page=n,this.alternateVerticalGlyph=i,this.minzoom=r,this.maxzoom=a}}class m{constructor(e,t,s,n,i,r,a,o,l,h,c,u){this.tl=e,this.tr=t,this.bl=s,this.br=n,this.mosaicRect=i,this.labelAngle=r,this.minAngle=a,this.maxAngle=o,this.anchor=l,this.minzoom=h,this.maxzoom=c,this.page=u}}class I{constructor(e){this.shapes=e}}class b{getIconPlacement(e,t,s){const n=new r.bR(e.x,e.y),i=s.rotationAlignment===p.I5.MAP,a=s.keepUpright;let l=s.rotate*o.os;i&&(l+=e.angle);const h=new I([]);return s.allowOverlap&&s.ignorePlacement||(h.iconColliders=[]),this._addIconPlacement(h,n,t,s,l),i&&a&&this._addIconPlacement(h,n,t,s,l+o.Jo),h}_addIconPlacement(e,t,s,n,i){const a=s.rasterizationScale,l=s.width/a,h=s.height/a,c=n.offset;let u=c[0],f=c[1];switch(n.anchor){case p.KI.CENTER:u-=l/2,f-=h/2;break;case p.KI.LEFT:f-=h/2;break;case p.KI.RIGHT:u-=l,f-=h/2;break;case p.KI.TOP:u-=l/2;break;case p.KI.BOTTOM:u-=l/2,f-=h;break;case p.KI.TOP_LEFT:break;case p.KI.BOTTOM_LEFT:f-=h;break;case p.KI.TOP_RIGHT:u-=l;break;case p.KI.BOTTOM_RIGHT:u-=l,f-=h}const d=s.rect,g=2/a,x=u-g,_=f-g,I=x+d.width/a,b=_+d.height/a,M=new r.bR(x,_),w=new r.bR(I,b),k=new r.bR(x,b),T=new r.bR(I,_);if(0!==i){const e=Math.cos(i),t=Math.sin(i);M.rotate(e,t),w.rotate(e,t),k.rotate(e,t),T.rotate(e,t)}const A=new m(M,T,k,w,d,i,0,256,t,y,o.MG,0);if(e.shapes.push(A),!n.allowOverlap||!n.ignorePlacement){const s=n.size,r=n.padding,a={xTile:t.x,yTile:t.y,dxPixels:u*s-r,dyPixels:f*s-r,hard:!n.optional,partIndex:0,width:l*s+2*r,height:h*s+2*r,angle:i,minLod:y,maxLod:o.MG};e.iconColliders.push(a)}}getTextPlacement(e,t,s,n){const i=new r.bR(e.x,e.y),l=n.rotate*o.os,h=n.rotationAlignment===p.I5.MAP,c=n.keepUpright,u=n.padding;let f=y;const x=h?e.angle:0,b=e.segment>=0&&h,M=n.allowOverlap&&n.ignorePlacement?null:[],w=[],k=!b;let T=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,P=T,D=A;const L=(b||h)&&c,V=n.size/d;let B=!1;for(const e of t)if(e.vertical){B=!0;break}let v,R=0,S=0;if(!b&&B){const e=g.getTextBox(t,n.lineHeight*d);switch(n.anchor){case p.KI.LEFT:R=e.height/2,S=-e.width/2;break;case p.KI.RIGHT:R=-e.height/2,S=e.width/2;break;case p.KI.TOP:R=e.height/2,S=e.width/2;break;case p.KI.BOTTOM:R=-e.height/2,S=-e.width/2;break;case p.KI.TOP_LEFT:R=e.height;break;case p.KI.BOTTOM_LEFT:S=-e.width;break;case p.KI.TOP_RIGHT:S=e.width;break;case p.KI.BOTTOM_RIGHT:R=-e.height}}R+=n.offset[0]*d,S+=n.offset[1]*d;for(const d of t){const t=d.glyphMosaicItem;if(!t||t.rect.isEmpty)continue;const g=t.rect,p=t.metrics,I=t.page;if(M&&k){if(void 0!==v&&v!==d.y){let t,s,i,r;B?(t=-D+R,s=T+S,i=D-P,r=A-T):(t=T+R,s=P+S,i=A-T,r=D-P);const a={xTile:e.x,yTile:e.y,dxPixels:t*V-u,dyPixels:s*V-u,hard:!n.optional,partIndex:1,width:i*V+2*u,height:r*V+2*u,angle:l,minLod:y,maxLod:o.MG};M.push(a),T=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,P=T,D=A}v=d.y}const C=[];if(b){const n=.5*t.metrics.width,i=(d.x+p.left-4+n)*V*a.ih;if(f=this._placeGlyph(e,f,i,s,e.segment,1,d.vertical,I,C),c&&(f=this._placeGlyph(e,f,i,s,e.segment,-1,d.vertical,I,C)),f>=2)break}else C.push(new _(i,x,x,I,!1)),h&&c&&C.push(new _(i,x+o.Jo,x+o.Jo,I,!1));const E=d.x+p.left,O=d.y-17-p.top,F=E+p.width,N=O+p.height;let U,z,G,K,q,H,W,j;if(!b&&B)if(d.vertical){const e=(E+F)/2-p.height/2,t=(O+N)/2+p.width/2;U=new r.bR(-t-4+R,e-4+S),z=new r.bR(U.x+g.width,U.y+g.height),G=new r.bR(U.x,z.y),K=new r.bR(z.x,U.y)}else U=new r.bR(4-O+R,E-4+S),z=new r.bR(U.x-g.height,U.y+g.width),G=new r.bR(z.x,U.y),K=new r.bR(U.x,z.y);else U=new r.bR(E-4+R,O-4+S),z=new r.bR(U.x+g.width,U.y+g.height),G=new r.bR(U.x,z.y),K=new r.bR(z.x,U.y);for(const t of C){let s,i,a,o;if(t.alternateVerticalGlyph){if(!q){const e=(O+N)/2+S;q=new r.bR((E+F)/2+R-p.height/2-4,e+p.width/2+4),H=new r.bR(q.x+g.height,q.y-g.width),W=new r.bR(H.x,q.y),j=new r.bR(q.x,H.y)}s=q,i=W,a=j,o=H}else s=U,i=G,a=K,o=z;const h=O,c=N,f=t.glyphAngle+l;if(0!==f){const e=Math.cos(f),t=Math.sin(f);s=s.clone(),i=i?.clone(),a=a?.clone(),o=o?.clone(),s.rotate(e,t),o?.rotate(e,t),i?.rotate(e,t),a?.rotate(e,t)}let y=0,x=256;if(b&&B?d.vertical?t.alternateVerticalGlyph?(y=32,x=96):(y=224,x=32):(y=224,x=96):(y=192,x=64),w.push(new m(s,a,i,o,g,t.labelAngle,y,x,t.anchor,t.minzoom,t.maxzoom,t.page)),M&&(!L||this._legible(t.labelAngle)))if(k)E<T&&(T=E),h<P&&(P=h),F>A&&(A=F),c>D&&(D=c);else if(t.minzoom<2){const s={xTile:e.x,yTile:e.y,dxPixels:(E+R)*V-u,dyPixels:(h+R)*V-u,hard:!n.optional,partIndex:1,width:(F-E)*V+2*u,height:(c-h)*V+2*u,angle:f,minLod:t.minzoom,maxLod:t.maxzoom};M.push(s)}}}if(f>=2)return null;if(M&&k){let t,s,i,r;B?(t=-D+R,s=T+S,i=D-P,r=A-T):(t=T+R,s=P+S,i=A-T,r=D-P);const a={xTile:e.x,yTile:e.y,dxPixels:t*V-u,dyPixels:s*V-u,hard:!n.optional,partIndex:1,width:i*V+2*u,height:r*V+2*u,angle:l,minLod:y,maxLod:o.MG};M.push(a)}const C=new I(w);return M&&M.length>0&&(C.textColliders=M),C}_legible(e){const t=(0,o.z0)(e);return t<65||t>=193}_placeGlyph(e,t,s,n,i,a,l,h,c){let u=a;const f=u<0?(0,o.Wh)(e.angle+o.Jo,o.pJ):e.angle;let d=0;s<0&&(u*=-1,s*=-1,d=o.Jo),u>0&&++i;let g=new r.bR(e.x,e.y),p=n[i],y=o.MG;if(n.length<=i)return y;for(;;){const e=p.x-g.x,r=p.y-g.y,a=Math.sqrt(e*e+r*r),x=Math.max(s/a,t),m=e/a,I=r/a,b=(0,o.Wh)(Math.atan2(I,m)+d,o.pJ);if(c.push(new _(g,f,b,h,!1,x,y)),l&&c.push(new _(g,f,b,h,!0,x,y)),x<=t)return x;g=p.clone();do{if(i+=u,n.length<=i||i<0)return x;p=n[i]}while(g.isEqual(p));let M=p.x-g.x,w=p.y-g.y;const k=Math.sqrt(M*M+w*w);M*=a/k,w*=a/k,g.x-=M,g.y-=w,y=x}}}var M,w,k=s(51624),T=s(15585);(w=M||(M={}))[w.moveTo=1]="moveTo",w[w.lineTo=2]="lineTo",w[w.close=7]="close";class A{constructor(e,t,s=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=s;const n=t.keys,i=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const e=r.getMessage().asUnsafe(),t=this.values;for(;!e.empty();){const s=e.getUInt32(),r=e.getUInt32();t[n[s]]=i[r]}e.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(void 0!==this._geometry)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let s,n;this._pbfGeometry=null,e?e.reset(this.type):s=[];let i,a=M.moveTo,o=0,l=0,h=0;for(;!t.empty();){if(0===o){const e=t.getUInt32();a=7&e,o=e>>3}switch(o--,a){case M.moveTo:l+=t.getSInt32(),h+=t.getSInt32(),e?e.moveTo(l,h):s&&(n&&s.push(n),n=[],n.push(new r.bR(l,h)));break;case M.lineTo:l+=t.getSInt32(),h+=t.getSInt32(),e?e.lineTo(l,h):n&&n.push(new r.bR(l,h));break;case M.close:e?e.close():n&&!n[0].equals(l,h)&&n.push(n[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?i=e.result():s&&(n&&s.push(n),i=s),t.release(),this._geometry=i,i}}var P=s(80081);class D extends P.A{constructor(){super(12)}add(e,t,s){const n=this.array;n.push(e),n.push(t),n.push(s)}}P.A;class L{constructor(e){this.extent=a.vA,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(L._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}class V extends P.A{constructor(e){super(e)}add(e,t,s,n,i,r,a,o,l,h,c,u){const f=this.array;let d=P.A.i1616to32(e,t);f.push(d);const g=31;d=P.A.i8888to32(Math.round(g*s),Math.round(g*n),Math.round(g*i),Math.round(g*r)),f.push(d),d=P.A.i8888to32(Math.round(g*a),Math.round(g*o),Math.round(g*l),Math.round(g*h)),f.push(d),d=P.A.i1616to32(c,0),f.push(d),u&&f.push(...u)}}class B extends P.A{constructor(e){super(e)}add(e,t,s){const n=this.array;n.push(P.A.i1616to32(e,t)),s&&n.push(...s)}}class v extends P.A{constructor(e){super(e)}add(e,t,s,n,i,r,a){const o=this.array,l=this.index;let h=P.A.i1616to32(e,t);return o.push(h),h=P.A.i8888to32(Math.round(15*s),Math.round(15*n),i,r),o.push(h),a&&o.push(...a),l}}class R extends P.A{constructor(e){super(e)}add(e,t,s,n,i,r,a,l,h,c,u,f){const d=this.array;let g=P.A.i1616to32(e,t);d.push(g),g=P.A.i1616to32(Math.round(8*s),Math.round(8*n)),d.push(g),g=P.A.i8888to32(i/4,r/4,l,h),d.push(g),g=P.A.i8888to32(0,(0,o.z0)(a),10*c,Math.min(10*u,255)),d.push(g),f&&d.push(...f)}}class S extends P.A{constructor(e){super(e)}add(e,t,s,n,i){const r=this.array,a=P.A.i1616to32(2*e+s,2*t+n);r.push(a),i&&r.push(...i)}}class C{constructor(e,t,s){this.layerExtent=a.vA,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=s,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,s){}}class E extends C{constructor(e,t,s,n,r){super(e,t,s),this.type=i.NP.CIRCLE,this._circleVertexBuffer=n,this._circleIndexBuffer=r}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,s=this._circleIndexBuffer;this._circleIndexStart=3*s.index,this._circleIndexCount=0;const n=this.layer,i=this.zoom;e&&e.setExtent(this.layerExtent);for(const r of this._features){const a=r.getGeometry(e);if(!a)continue;const o=n.circleMaterial.encodeAttributes(r,i,n);for(const e of a)if(e)for(const n of e){const e=t.index;t.add(n.x,n.y,0,0,o),t.add(n.x,n.y,0,1,o),t.add(n.x,n.y,1,0,o),t.add(n.x,n.y,1,1,o),s.add(e,e+1,e+2),s.add(e+1,e+2,e+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._circleIndexStart,t[n++]=this._circleIndexCount,t[n++]=this._circleVertexBuffer.array.length;for(let e=0;e<this._circleVertexBuffer.array.length;e++)s[n++]=this._circleVertexBuffer.array[e];t[n++]=this._circleIndexBuffer.array.length;for(let e=0;e<this._circleIndexBuffer.array.length;e++)t[n++]=this._circleIndexBuffer.array[e];return t.buffer}}var O=s(98291),F=s(83349);class N extends C{constructor(e,t,s,n,r,a,o){super(e,t,s),this.type=i.NP.FILL,this._patternMap=new Map,this._fillVertexBuffer=n,this._fillIndexBuffer=r,this._outlineVertexBuffer=a,this._outlineIndexBuffer=o}get fillIndexStart(){return this._fillIndexStart}get fillIndexCount(){return this._fillIndexCount}get outlineIndexStart(){return this._outlineIndexStart}get outlineIndexCount(){return this._outlineIndexCount}getResources(e,t,s){const n=this.layer,i=this.zoom,r=n.getPaintProperty("fill-pattern");if(r)if(r.isDataDriven)for(const e of this._features)t(r.getValue(i,e),!0);else t(r.getValue(i),!0)}processFeatures(e){this._fillIndexStart=3*this._fillIndexBuffer.index,this._fillIndexCount=0,this._outlineIndexStart=3*this._outlineIndexBuffer.index,this._outlineIndexCount=0;const t=this.layer,s=this.zoom,{fillMaterial:n,outlineMaterial:i,hasDataDrivenFill:r,hasDataDrivenOutline:a}=t;e&&e.setExtent(this.layerExtent);const o=t.getPaintProperty("fill-pattern"),l=o?.isDataDriven;let h=!o&&t.getPaintValue("fill-antialias",s);if(t.outlineUsesFillColor){if(h&&!t.hasDataDrivenOpacity){const e=t.getPaintValue("fill-opacity",s),n=t.getPaintValue("fill-opacity",s+1);e<1&&n<1&&(h=!1)}if(h&&!t.hasDataDrivenColor){const e=t.getPaintValue("fill-color",s),n=t.getPaintValue("fill-color",s+1);e[3]<1&&n[3]<1&&(h=!1)}}const c=this._features,u=e?.validateTessellation;if(l){const r=[];for(const l of c){const c=o.getValue(s,l),f=this._spriteInfo[c];if(!f?.rect)continue;const d=n.encodeAttributes(l,s,t,f),g=h&&a?i.encodeAttributes(l,s,t):[],p=l.getGeometry(e);r.push({ddFillAttributes:d,ddOutlineAttributes:g,page:f.page,geometry:p}),r.sort(((e,t)=>e.page-t.page));for(const{ddFillAttributes:e,ddOutlineAttributes:s,page:n,geometry:i}of r)this._processFeature(i,h,t.outlineUsesFillColor,e,s,u,n)}}else for(const o of c){const l=r?n.encodeAttributes(o,s,t):null,c=h&&a?i.encodeAttributes(o,s,t):null,f=o.getGeometry(e);this._processFeature(f,h,t.outlineUsesFillColor,l,c,u)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._fillIndexStart,t[n++]=this._fillIndexCount,t[n++]=this._outlineIndexStart,t[n++]=this._outlineIndexCount;const i=this._patternMap,r=i.size;if(t[n++]=r,r>0)for(const[e,[s,r]]of i)t[n++]=e,t[n++]=s,t[n++]=r;t[n++]=this._fillVertexBuffer.array.length;for(let e=0;e<this._fillVertexBuffer.array.length;e++)s[n++]=this._fillVertexBuffer.array[e];t[n++]=this._fillIndexBuffer.array.length;for(let e=0;e<this._fillIndexBuffer.array.length;e++)t[n++]=this._fillIndexBuffer.array[e];t[n++]=this._outlineVertexBuffer.array.length;for(let e=0;e<this._outlineVertexBuffer.array.length;e++)s[n++]=this._outlineVertexBuffer.array[e];t[n++]=this._outlineIndexBuffer.array.length;for(let e=0;e<this._outlineIndexBuffer.array.length;e++)t[n++]=this._outlineIndexBuffer.array[e];return t.buffer}_processFeature(e,t,s,n,i,r,a){if(!e)return;const o=e.length,l=!i||0===i.length;if(t&&(!s||l))for(let t=0;t<o;t++)this._processOutline(e[t],i);let h;for(let t=0;t<o;t++){const s=N._area(e[t]);s>32?(void 0!==h&&this._processFill(e,h,n,r,a),h=[t]):s<-32&&void 0!==h&&h.push(t)}void 0!==h&&this._processFill(e,h,n,r,a)}_processOutline(e,t){const s=this._outlineVertexBuffer,n=this._outlineIndexBuffer,i=n.index;let a,o,l;const h=new r.bR(0,0),c=new r.bR(0,0),u=new r.bR(0,0);let f=-1,d=-1,g=-1,p=-1,y=-1,x=!1,_=e.length;if(_<2)return;const m=e[0];let I=e[_-1];for(;_&&I.isEqual(m);)--_,I=e[_-1];if(!(_-0<2)){for(let i=0;i<_;++i){0===i?(a=e[_-1],o=e[0],l=e[1],h.assignSub(o,a),h.normalize(),h.rightPerpendicular()):(a=o,o=l,l=i!==_-1?e[i+1]:e[0],h.assign(c));const r=this._isClipEdge(a,o);-1===p&&(x=r),c.assignSub(l,o),c.normalize(),c.rightPerpendicular();const m=h.x*c.y-h.y*c.x;u.assignAdd(h,c),u.normalize();const I=-u.x*-h.x+-u.y*-h.y;let b=Math.abs(0!==I?1/I:1);b>8&&(b=8),m>=0?(g=s.add(o.x,o.y,h.x,h.y,0,1,t),-1===p&&(p=g),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),d=s.add(o.x,o.y,b*-u.x,b*-u.y,0,-1,t),-1===y&&(y=d),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),f=d,d=g,g=s.add(o.x,o.y,u.x,u.y,0,1,t),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),d=s.add(o.x,o.y,c.x,c.y,0,1,t),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g)):(g=s.add(o.x,o.y,b*u.x,b*u.y,0,1,t),-1===p&&(p=g),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),d=s.add(o.x,o.y,-h.x,-h.y,0,-1,t),-1===y&&(y=d),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),f=d,d=g,g=s.add(o.x,o.y,-u.x,-u.y,0,-1,t),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g),f=s.add(o.x,o.y,-c.x,-c.y,0,-1,t),f>=0&&d>=0&&g>=0&&!r&&n.add(f,d,g))}f>=0&&d>=0&&p>=0&&!x&&n.add(f,d,p),f>=0&&p>=0&&y>=0&&!x&&n.add(f,y,p),this._outlineIndexCount+=3*(n.index-i)}}_processFill(e,t,s,n,i){let r;t.length>1&&(r=[]);let a=0;for(const s of t)0!==a&&r.push(a),a+=e[s].length;const o=2*a,l=O.A.acquire();for(const s of t){const t=e[s],n=t.length;for(let e=0;e<n;++e)l.push(t[e].x,t[e].y)}const h=(0,F.e)(l,r,2);if(F.e.deviation(l,r,2,h)>0){const n=t.map((t=>e[t].length)),{buffer:r,vertexCount:a}=(0,T.l)(l,n);if(a>0){const e=this._fillVertexBuffer.index;for(let e=0;e<a;e++)this._fillVertexBuffer.add(r[2*e],r[2*e+1],s);for(let t=0;t<a;t+=3){const s=e+t;this._fillIndexBuffer.add(s,s+1,s+2)}if(void 0!==i){const e=this._patternMap,t=e.get(i);t?t[1]+=a:e.set(i,[this._fillIndexStart+this._fillIndexCount,a])}this._fillIndexCount+=a}}else{const e=h.length;if(e>0){const t=this._fillVertexBuffer.index;let n=0;for(;n<o;)this._fillVertexBuffer.add(l[n++],l[n++],s);let r=0;for(;r<e;)this._fillIndexBuffer.add(t+h[r++],t+h[r++],t+h[r++]);if(void 0!==i){const t=this._patternMap,s=t.get(i);s?s[1]+=e:t.set(i,[this._fillIndexStart+this._fillIndexCount,e])}this._fillIndexCount+=e}}O.A.release(l)}_isClipEdge(e,t){return e.x===t.x?e.x<=-64||e.x>=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const s=e.length-1;for(let n=0;n<s;n++)t+=(e[n].x-e[n+1].x)*(e[n].y+e[n+1].y);return t+=(e[s].x-e[0].x)*(e[s].y+e[0].y),.5*t}}var U=s(83773);class z extends C{constructor(e,t,s,n,r){super(e,t,s),this.type=i.NP.LINE,this._tessellationOptions={pixelCoordRatio:8,halfWidth:0,offset:0},this._patternMap=new Map,this.tessellationProperties={_lineVertexBuffer:null,_lineIndexBuffer:null,_ddValues:null},this.tessellationProperties._lineVertexBuffer=n,this.tessellationProperties._lineIndexBuffer=r,this._lineTessellator=new U.i(G(this.tessellationProperties),K(this.tessellationProperties),e.canUseThinTessellation)}get lineIndexStart(){return this._lineIndexStart}get lineIndexCount(){return this._lineIndexCount}getResources(e,t,s){const n=this.layer,i=this.zoom,r=n.getPaintProperty("line-pattern"),a=n.getPaintProperty("line-dasharray"),o=n.getLayoutProperty("line-cap");if(!r&&!a)return;const l=o?.getValue(i)||0,h=o?.isDataDriven,c=r?.isDataDriven,u=a?.isDataDriven;if(c||u)for(const e of this._features)t(c?r.getValue(i,e):this._getDashArrayKey(e,i,n,a,h,o,l));else if(r)t(r.getValue(i));else if(a){const e=a.getValue(i);t(n.getDashKey(e,l))}}processFeatures(e){this._lineIndexStart=3*this.tessellationProperties._lineIndexBuffer.index,this._lineIndexCount=0;const t=this.layer,s=this.zoom,n=this._features,i=this._tessellationOptions,{hasDataDrivenLine:r,lineMaterial:a}=t;e&&e.setExtent(this.layerExtent);const o=t.getPaintProperty("line-pattern"),l=t.getPaintProperty("line-dasharray"),h=o?.isDataDriven,c=l?.isDataDriven;let u;u=t.getLayoutProperty("line-cap");const f=u?.isDataDriven?u:null,d=f?null:t.getLayoutValue("line-cap",s),g=d||0,p=!!f;u=t.getLayoutProperty("line-join");const y=u?.isDataDriven?u:null,x=y?null:t.getLayoutValue("line-join",s);u=t.getLayoutProperty("line-miter-limit");const _=u?.isDataDriven?u:null,m=_?null:t.getLayoutValue("line-miter-limit",s);u=t.getLayoutProperty("line-round-limit");const I=u?.isDataDriven?u:null,b=I?null:t.getLayoutValue("line-round-limit",s);u=t.getPaintProperty("line-width");const M=u?.isDataDriven?u:null,w=M?null:t.getPaintValue("line-width",s);u=t.getPaintProperty("line-offset");const k=u?.isDataDriven?u:null,T=k?null:t.getPaintValue("line-offset",s);if(h||c){const r=[];for(const i of n){const n=h?o.getValue(s,i):this._getDashArrayKey(i,s,t,l,p,f,g),c=this._spriteInfo[n];if(!c?.rect)continue;const u=a.encodeAttributes(i,s,t,c),A=i.getGeometry(e);r.push({ddAttributes:u,page:c.page,cap:f?f.getValue(s,i):d,join:y?y.getValue(s,i):x,miterLimit:_?_.getValue(s,i):m,roundLimit:I?I.getValue(s,i):b,halfWidth:.5*(M?M.getValue(s,i):w),offset:k?k.getValue(s,i):T,geometry:A})}r.sort(((e,t)=>e.page-t.page)),i.textured=!0;for(const{ddAttributes:e,page:t,cap:s,join:n,miterLimit:a,roundLimit:o,halfWidth:l,offset:h,geometry:c}of r)i.capType=s,i.joinType=n,i.miterLimit=a,i.roundLimit=o,i.halfWidth=l,i.offset=h,this._processFeature(c,e,t)}else{if(o){const e=o.getValue(s),t=this._spriteInfo[e];if(!t?.rect)return}i.textured=!(!o&&!l),i.capType=d,i.joinType=x,i.miterLimit=m,i.roundLimit=b,i.halfWidth=.5*w,i.offset=T;for(const o of n){const n=r?a.encodeAttributes(o,s,t):null;f&&(i.capType=f.getValue(s,o)),y&&(i.joinType=y.getValue(s,o)),_&&(i.miterLimit=_.getValue(s,o)),I&&(i.roundLimit=I.getValue(s,o)),M&&(i.halfWidth=.5*M.getValue(s,o)),k&&(i.offset=k.getValue(s,o));const l=o.getGeometry(e);this._processFeature(l,n)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._lineIndexStart,t[n++]=this._lineIndexCount;const i=this._patternMap,r=i.size;if(t[n++]=r,r>0)for(const[e,[s,r]]of i)t[n++]=e,t[n++]=s,t[n++]=r;t[n++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let e=0;e<this.tessellationProperties._lineVertexBuffer.array.length;e++)s[n++]=this.tessellationProperties._lineVertexBuffer.array[e];t[n++]=this.tessellationProperties._lineIndexBuffer.array.length;for(let e=0;e<this.tessellationProperties._lineIndexBuffer.array.length;e++)t[n++]=this.tessellationProperties._lineIndexBuffer.array[e];return t.buffer}_processFeature(e,t,s){if(!e)return;const n=e.length;for(let i=0;i<n;i++)this._processGeometry(e[i],t,s)}_processGeometry(e,t,s){if(e.length<2)return;let n,i,r=e[0],a=1;for(;a<e.length;)n=e[a].x-r.x,i=e[a].y-r.y,n*n+i*i<1e-6?e.splice(a,1):(r=e[a],++a);if(e.length<2)return;const o=this.tessellationProperties._lineIndexBuffer,l=3*o.index;this._tessellationOptions.initialDistance=0,this._tessellationOptions.wrapDistance=65535,this.tessellationProperties._ddValues=t,this._lineTessellator.tessellate(e,this._tessellationOptions);const h=3*o.index-l;if(void 0!==s){const e=this._patternMap,t=e.get(s);t?t[1]+=h:e.set(s,[l+this._lineIndexCount,h])}this._lineIndexCount+=h}_getDashArrayKey(e,t,s,n,i,r,a){const o=i?r.getValue(t,e):a,l=n.getValue(t,e);return s.getDashKey(l,o)}}const G=e=>(t,s,n,i,r,a,o,l,h,c,u)=>(e._lineVertexBuffer.add(t,s,o,l,n,i,r,a,h,c,u,e._ddValues),e._lineVertexBuffer.index-1),K=e=>(t,s,n)=>{e._lineIndexBuffer.add(t,s,n)};var q,H=s(32488),W=s(97768),j=s(799),Y=s(3057);function J(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class Z extends C{constructor(e,t,s,n,r,a,o,l,h){super(t,s,h.getSpriteItems()),this.type=i.NP.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=n,this._iconIndexBuffer=r,this._textVertexBuffer=a,this._textIndexBuffer=o,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}static{this._bidiEngine=new H.A}getResources(e,t,s){const n=this.layer,i=this.zoom;e&&e.setExtent(this.layerExtent);const r=n.getLayoutProperty("icon-image"),a=n.getLayoutProperty("text-field");let o=n.getLayoutProperty("text-transform"),l=n.getLayoutProperty("text-font");const h=[];let c,u,f,d;r&&!r.isDataDriven&&(c=r.getValue(i)),a&&!a.isDataDriven&&(u=a.getValue(i)),o&&o.isDataDriven||(f=n.getLayoutValue("text-transform",i),o=null),l&&l.isDataDriven||(d=n.getLayoutValue("text-font",i),l=null);for(const g of this._features){const y=g.getGeometry(e);if(!y||0===y.length)continue;let x,_;r&&(x=r.isDataDriven?r.getValue(i,g):this._replaceKeys(c,g.values),x&&t(x));let m=!1;if(a&&(_=a.isDataDriven?a.getValue(i,g):this._replaceKeys(u,g.values),_)){switch(_=_.replaceAll("\\n","\n"),o&&(f=o.getValue(i,g)),f){case p.Ms.LOWERCASE:_=_.toLowerCase();break;case p.Ms.UPPERCASE:_=_.toUpperCase()}if(Z._bidiEngine.hasBidiChar(_)){let e;e="rtl"===Z._bidiEngine.checkContextual(_)?"IDNNN":"ICNNN",_=Z._bidiEngine.bidiTransform(_,e,"VLYSN"),m=!0}if(_.length>0){l&&(d=l.getValue(i,g));for(const e of d){let t=s[e];t||(t=s[e]=new Set);for(const e of _){const s=e.codePointAt(0);null!=s&&t.add(s)}}}}if(!x&&!_)continue;const I=n.getLayoutValue("symbol-sort-key",i,g),b={feature:g,sprite:x,label:_,rtl:m,geometry:y,hash:(_?(0,j.Wm)(_):0)^(x?(0,j.Wm)(x):0),priority:I,textFont:d};h.push(b)}this._symbolFeatures=h}processFeatures(e){e&&e.setExtent(this.layerExtent);const t=this.layer,s=this.zoom,n=t.getLayoutValue("symbol-placement",s),i=n!==p.kt.POINT,l=t.getLayoutValue("symbol-spacing",s)*a.ih,h=t.getLayoutProperty("icon-image"),c=t.getLayoutProperty("text-field"),u=h?new Y.aR(t,s,i):null,f=c?new Y.uU(t,s,i):null,y=this._workerTileHandler;let _;h&&(_=y.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const m=[];let I=1;f?.size&&(I=f.size/d);const b=f?f.maxAngle*o.os:0,M=f?f.size*a.ih:0;for(const e of this._symbolFeatures){let t,o;u&&_&&e.sprite&&(t=_[e.sprite],t&&t.sdf&&(this._isIconSDF=!0)),t&&u.update(s,e.feature);let h=0;const c=e.label;if(c){(0,W.Lw)(f),f.update(s,e.feature);const t=i&&f.rotationAlignment===p.I5.MAP?f.keepUpright:f.writingMode&&f.writingMode.includes(p.v9.VERTICAL);let n=.5;switch(f.anchor){case p.KI.TOP_LEFT:case p.KI.LEFT:case p.KI.BOTTOM_LEFT:n=0;break;case p.KI.TOP_RIGHT:case p.KI.RIGHT:case p.KI.BOTTOM_RIGHT:n=1}let r=.5;switch(f.anchor){case p.KI.TOP_LEFT:case p.KI.TOP:case p.KI.TOP_RIGHT:r=0;break;case p.KI.BOTTOM_LEFT:case p.KI.BOTTOM:case p.KI.BOTTOM_RIGHT:r=1}let l=.5;switch(f.justify){case p.O6.AUTO:l=n;break;case p.O6.LEFT:l=0;break;case p.O6.RIGHT:l=1}const u=f.letterSpacing*d,x=i?0:f.maxWidth*d,_=f.lineHeight*d,m=e.textFont.map((e=>y.getGlyphItems(e)));if(o=new g(m,x,_,u,n,r,l).getShaping(c,e.rtl,t),o&&o.length>0){let e=1e30,t=-1e30;for(const s of o)e=Math.min(e,s.x),t=Math.max(t,s.x);h=(t-e+48)*I*a.ih}}for(let s of e.geometry){const c=[];if(n===p.kt.LINE){if(o?.length&&f?.size){const e=f.size*a.ih*(2+Math.min(2,4*Math.abs(f.offset[1])));s=Z._smoothVertices(s,e)}Z._pushAnchors(c,s,l,h)}else n===p.kt.LINE_CENTER?Z._pushCenterAnchor(c,s):e.feature.type===r.dC.Polygon?Z._pushCentroid(c,s):c.push(new x(s[0].x,s[0].y));for(const n of c){if(n.x<0||n.x>a.vA||n.y<0||n.y>a.vA)continue;if(i&&h>0&&f?.rotationAlignment===p.I5.MAP&&!Z._honorsTextMaxAngle(s,n,h,b,M))continue;const r={shaping:o,line:s,iconMosaicItem:t,anchor:n,symbolFeature:e,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};m.push(r),this._processFeature(r,u,f)}}}m.sort(J),this._addPlacedGlyphs(),this._symbolInstances=m}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=Z._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),s=new Int32Array(t.buffer),n=new Float32Array(t.buffer),[i,r,a]=this._sourceTileKey.split("/");let o=0;t[o++]=this.type,t[o++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[o++]=this.layerUIDs[e];t[o++]=this._isIconSDF?1:0,t[o++]=parseFloat(i),t[o++]=parseFloat(r),t[o++]=parseFloat(a),t[o++]=this.markerPageMap.size;for(const[e,[s,n]]of this.markerPageMap)t[o++]=e,t[o++]=s,t[o++]=n;t[o++]=this.glyphsPageMap.size;for(const[e,[s,n]]of this.glyphsPageMap)t[o++]=e,t[o++]=s,t[o++]=n;t[o++]=this._iconVertexBuffer.index/4,t[o++]=this._textVertexBuffer.index/4,o=Z.serializeSymbols(t,s,n,o,this._symbolInstances),t[o++]=this._iconVertexBuffer.array.length;for(let e=0;e<this._iconVertexBuffer.array.length;e++)s[o++]=this._iconVertexBuffer.array[e];t[o++]=this._iconIndexBuffer.array.length;for(let e=0;e<this._iconIndexBuffer.array.length;e++)t[o++]=this._iconIndexBuffer.array[e];t[o++]=this._textVertexBuffer.array.length;for(let e=0;e<this._textVertexBuffer.array.length;e++)s[o++]=this._textVertexBuffer.array[e];t[o++]=this._textIndexBuffer.array.length;for(let e=0;e<this._textIndexBuffer.array.length;e++)t[o++]=this._textIndexBuffer.array[e];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const s of e||[]){t+=5,t+=1;for(const e of s.textColliders)t+=10;for(const e of s.iconColliders)t+=10;t+=1,t+=2*s.textVertexRanges.length,t+=1,t+=2*s.iconVertexRanges.length}return t}static serializeSymbols(e,t,s,n,i){i=i||[],t[n++]=i.length;for(const e of i){t[n++]=e.anchor.x,t[n++]=e.anchor.y,t[n++]=e.symbolFeature.hash,t[n++]=e.symbolFeature.priority,t[n++]=e.symbolFeature.feature.featureIndex,t[n++]=e.textColliders.length+e.iconColliders.length;for(const i of e.textColliders)t[n++]=i.xTile,t[n++]=i.yTile,t[n++]=i.dxPixels,t[n++]=i.dyPixels,t[n++]=i.hard?1:0,t[n++]=i.partIndex,s[n++]=i.minLod,s[n++]=i.maxLod,t[n++]=i.width,t[n++]=i.height;for(const i of e.iconColliders)t[n++]=i.xTile,t[n++]=i.yTile,t[n++]=i.dxPixels,t[n++]=i.dyPixels,t[n++]=i.hard?1:0,t[n++]=i.partIndex,s[n++]=i.minLod,s[n++]=i.maxLod,t[n++]=i.width,t[n++]=i.height;t[n++]=e.textVertexRanges.length;for(const[s,i]of e.textVertexRanges)t[n++]=s,t[n++]=i;t[n++]=e.iconVertexRanges.length;for(const[s,i]of e.iconVertexRanges)t[n++]=s,t[n++]=i}return n}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,((e,s)=>s in t?t[s]:""))}_processFeature(e,t,s){const{line:n,iconMosaicItem:i,shaping:r,anchor:a}=e,l=this.zoom,h=this.layer,c=!!i;let u=!0;c&&(u=t?.optional||!i);const f=r&&r.length>0,d=!f||s?.optional;let g,y;if(c&&(g=this._placementEngine.getIconPlacement(a,i,t)),(g||u)&&(f&&(y=this._placementEngine.getTextPlacement(a,r,n,s)),y||d)){if(g&&y||(d||u?d||y?u||g||(y=null):g=null:(g=null,y=null)),y){const t=h.hasDataDrivenText?h.textMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(e,y.shapes,l,s.rotationAlignment,t),y.textColliders){e.textColliders=y.textColliders;for(const e of y.textColliders){e.minLod=Math.max(l+(0,o.p6)(e.minLod),0),e.maxLod=Math.min(l+(0,o.p6)(e.maxLod),25);const t=e.angle;if(t){const s=Math.cos(t),n=Math.sin(t),i=e.dxPixels*s-e.dyPixels*n,r=e.dxPixels*n+e.dyPixels*s,a=(e.dxPixels+e.width)*s-e.dyPixels*n,o=(e.dxPixels+e.width)*n+e.dyPixels*s,l=e.dxPixels*s-(e.dyPixels+e.height)*n,h=e.dxPixels*n+(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s-(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n+(e.dyPixels+e.height)*s,f=Math.min(i,a,l,c),d=Math.max(i,a,l,c),g=Math.min(r,o,h,u),p=Math.max(r,o,h,u);e.dxPixels=f,e.dyPixels=g,e.width=d-f,e.height=p-g}}}}if(g){const s=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(e,g.shapes,l,i.page,t.rotationAlignment===p.I5.VIEWPORT,s),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(l+(0,o.p6)(e.minLod),0),e.maxLod=Math.min(l+(0,o.p6)(e.maxLod),25);const t=e.angle;if(t){const s=Math.cos(t),n=Math.sin(t),i=e.dxPixels*s-e.dyPixels*n,r=e.dxPixels*n+e.dyPixels*s,a=(e.dxPixels+e.width)*s-e.dyPixels*n,o=(e.dxPixels+e.width)*n+e.dyPixels*s,l=e.dxPixels*s-(e.dyPixels+e.height)*n,h=e.dxPixels*n+(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s-(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n+(e.dyPixels+e.height)*s,f=Math.min(i,a,l,c),d=Math.max(i,a,l,c),g=Math.min(r,o,h,u),p=Math.max(r,o,h,u);e.dxPixels=f,e.dyPixels=g,e.width=d-f,e.height=p-g}}}}}}_addPlacedIcons(e,t,s,n,i,r){const a=Math.max(s-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,c=this._markerMap;for(const u of t){const t=i?0:Math.max(s+(0,o.p6)(u.minzoom),a),f=i?25:Math.min(s+(0,o.p6)(u.maxzoom),25);if(f<=t)continue;const d=u.tl,g=u.tr,p=u.bl,y=u.br,x=u.mosaicRect,_=u.labelAngle,m=u.minAngle,I=u.maxAngle,b=u.anchor,M=l.index,w=x.x,k=x.y,T=w+x.width,A=k+x.height,P=l.index;l.add(b.x,b.y,d.x,d.y,w,k,_,m,I,t,f,r),l.add(b.x,b.y,g.x,g.y,T,k,_,m,I,t,f,r),l.add(b.x,b.y,p.x,p.y,w,A,_,m,I,t,f,r),l.add(b.x,b.y,y.x,y.y,T,A,_,m,I,t,f,r),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===P?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([P,4]),h.add(M,M+1,M+2),h.add(M+1,M+2,M+3),c.has(n)?c.get(n)[1]+=6:c.set(n,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,s=this._glyphMap;for(const[n,i]of this._glyphBufferDataStorage)for(const r of i){const i=e.index,a=r.symbolInstance,o=r.ddAttributes,l=e.index;e.add(r.glyphAnchor[0],r.glyphAnchor[1],r.tl[0],r.tl[1],r.xmin,r.ymin,r.labelAngle,r.minAngle,r.maxAngle,r.minLod,r.maxLod,o),e.add(r.glyphAnchor[0],r.glyphAnchor[1],r.tr[0],r.tr[1],r.xmax,r.ymin,r.labelAngle,r.minAngle,r.maxAngle,r.minLod,r.maxLod,o),e.add(r.glyphAnchor[0],r.glyphAnchor[1],r.bl[0],r.bl[1],r.xmin,r.ymax,r.labelAngle,r.minAngle,r.maxAngle,r.minLod,r.maxLod,o),e.add(r.glyphAnchor[0],r.glyphAnchor[1],r.br[0],r.br[1],r.xmax,r.ymax,r.labelAngle,r.minAngle,r.maxAngle,r.minLod,r.maxLod,o),a.textVertexRanges.length>0&&a.textVertexRanges[0][0]+a.textVertexRanges[0][1]===l?a.textVertexRanges[0][1]+=4:a.textVertexRanges.push([l,4]),t.add(i,i+1,i+2),t.add(i+1,i+2,i+3),s.has(n)?s.get(n)[1]+=6:s.set(n,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,s,n,i){const r=Math.max(s-1,0),a=n===p.I5.VIEWPORT;let l,h,c,u,f,d,g,y,x,_,m;for(const n of t)l=a?0:Math.max(s+(0,o.p6)(n.minzoom),r),h=a?25:Math.min(s+(0,o.p6)(n.maxzoom),25),h<=l||(c=n.tl,u=n.tr,f=n.bl,d=n.br,g=n.labelAngle,y=n.minAngle,x=n.maxAngle,_=n.anchor,m=n.mosaicRect,this._glyphBufferDataStorage.has(n.page)||this._glyphBufferDataStorage.set(n.page,[]),this._glyphBufferDataStorage.get(n.page).push({glyphAnchor:[_.x,_.y],tl:[c.x,c.y],tr:[u.x,u.y],bl:[f.x,f.y],br:[d.x,d.y],xmin:m.x,ymin:m.y,xmax:m.x+m.width,ymax:m.y+m.height,labelAngle:g,minAngle:y,maxAngle:x,minLod:l,maxLod:h,placementLod:r,symbolInstance:e,ddAttributes:i}))}static _pushAnchors(e,t,s,n){s+=n;let i=0;const a=t.length-1;for(let e=0;e<a;e++)i+=r.bR.distance(t[e],t[e+1]);let l=n||s;if(l*=.5,i<=l)return;const h=l/i;let c=0,u=-(s=i/Math.max(Math.round(i/s),1))/2;const f=t.length-1;for(let n=0;n<f;n++){const i=t[n],r=t[n+1],a=r.x-i.x,l=r.y-i.y,f=Math.sqrt(a*a+l*l);let d;for(;u+s<c+f;){u+=s;const t=(u-c)/f,g=(0,o.GW)(i.x,r.x,t),p=(0,o.GW)(i.y,r.y,t);void 0===d&&(d=Math.atan2(l,a)),e.push(new x(g,p,d,n,h))}c+=f}}static _pushCenterAnchor(e,t){let s=0;const n=t.length-1;for(let e=0;e<n;e++)s+=r.bR.distance(t[e],t[e+1]);const i=s/2;let a=0;const l=t.length-1;for(let s=0;s<l;s++){const n=t[s],r=t[s+1],l=r.x-n.x,h=r.y-n.y,c=Math.sqrt(l*l+h*h);if(i<a+c){const t=(i-a)/c,u=(0,o.GW)(n.x,r.x,t),f=(0,o.GW)(n.y,r.y,t),d=Math.atan2(h,l);return void e.push(new x(u,f,d,s,0))}a+=c}}static _deviation(e,t,s){const n=(t.x-e.x)*(s.x-t.x)+(t.y-e.y)*(s.y-t.y),i=(t.x-e.x)*(s.y-t.y)-(t.y-e.y)*(s.x-t.x);return Math.atan2(i,n)}static _honorsTextMaxAngle(e,t,s,n,i){let a=0;const o=s/2;let l=new r.bR(t.x,t.y),h=t.segment+1;for(;a>-o;){if(--h,h<0)return!1;a-=r.bR.distance(e[h],l),l=e[h]}a+=r.bR.distance(e[h],e[h+1]);const c=[];let u=0;const f=e.length;for(;a<o;){const t=e[h];let s,o=h;do{if(++o,o===f)return!1;s=e[o]}while(s.isEqual(t));let l,d=o;do{if(++d,d===f)return!1;l=e[d]}while(l.isEqual(s));const g=this._deviation(t,s,l);for(c.push({deviation:g,distToAnchor:a}),u+=g;a-c[0].distToAnchor>i;)u-=c.shift().deviation;if(Math.abs(u)>n)return!1;a+=r.bR.distance(s,l),h=o}return!0}static _smoothVertices(e,t){if(t<=0)return e;let s=e.length;if(s<3)return e;const n=[];let i=0,a=0;n.push(0);for(let t=1;t<s;t++){const s=r.bR.distance(e[t],e[t-1]);s>0&&(i+=s,n.push(i),a++,a!==t&&(e[a]=e[t]))}if(s=a+1,s<3)return e;t=Math.min(t,.2*i);const o=e[0].x,l=e[0].y,h=e[s-1].x,c=e[s-1].y,u=r.bR.sub(e[0],e[1]);u.normalize(),e[0].x+=t*u.x,e[0].y+=t*u.y,u.assignSub(e[s-1],e[s-2]),u.normalize(),e[s-1].x+=t*u.x,e[s-1].y+=t*u.y,n[0]-=t,n[s-1]+=t;const f=[];f.push(new r.bR(o,l));const d=1e-6,g=.5*t;for(let i=1;i<s-1;i++){let a=0,o=0,l=0;for(let s=i-1;s>=0;s--){const r=g+n[s+1]-n[i];if(r<0)break;const h=n[s+1]-n[s],c=n[i]-n[s]<g?1:r/h;if(c<d)break;const u=c*c,f=c*r-.5*u*h,p=c*h/t,y=e[s+1],x=e[s].x-y.x,_=e[s].y-y.y;a+=p/f*(y.x*c*r+.5*u*(r*x-h*y.x)-u*c*h*x/3),o+=p/f*(y.y*c*r+.5*u*(r*_-h*y.y)-u*c*h*_/3),l+=p}for(let r=i+1;r<s;r++){const s=g-n[r-1]+n[i];if(s<0)break;const h=n[r]-n[r-1],c=n[r]-n[i]<g?1:s/h;if(c<d)break;const u=c*c,f=c*s-.5*u*h,p=c*h/t,y=e[r-1],x=e[r].x-y.x,_=e[r].y-y.y;a+=p/f*(y.x*c*s+.5*u*(s*x-h*y.x)-u*c*h*x/3),o+=p/f*(y.y*c*s+.5*u*(s*_-h*y.y)-u*c*h*_/3),l+=p}f.push(new r.bR(a/l,o/l))}return f.push(new r.bR(h,c)),e[0].x=o,e[0].y=l,e[s-1].x=h,e[s-1].y=c,f}static _pushCentroid(e,t){const s=a.vA,n=a.vA,i=t.length-1;let r=0,o=0,l=0,h=t[0].x,c=t[0].y;h>s&&(h=s),h<0&&(h=0),c>n&&(c=n),c<0&&(c=0);for(let e=1;e<i;e++){let i=t[e].x,a=t[e].y,u=t[e+1].x,f=t[e+1].y;i>s&&(i=s),i<0&&(i=0),a>n&&(a=n),a<0&&(a=0),u>s&&(u=s),u<0&&(u=0),f>n&&(f=n),f<0&&(f=0);const d=(i-h)*(f-c)-(u-h)*(a-c);r+=d*(h+i+u),o+=d*(c+a+f),l+=d}r/=3*l,o/=3*l,isNaN(r)||isNaN(o)||e.push(new x(r,o))}}!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.NO_DATA=1]="NO_DATA",e[e.READY=2]="READY",e[e.MODIFIED=3]="MODIFIED",e[e.INVALID=4]="INVALID"}(q||(q={}));class ${constructor(e,t,s,n,i,a){if(this._pbfTiles={},this._tileClippers={},this._client=s,this._tile=t,this._sourceDataMaxLOD=n,a){this._styleLayerUIDs=new Set;for(const e of a)this._styleLayerUIDs.add(e)}this._styleRepository=i,this._layers=this._styleRepository?.layers??[];const[l,h,c]=t.tileKey.split("/").map(parseFloat);this._level=l;const u=(0,o.IU)(this._level);for(const t of Object.keys(e)){const s=e[t];if(this._pbfTiles[t]=new k.A(new Uint8Array(s.protobuff),new DataView(s.protobuff)),s.refKey){const[e]=s.refKey.split("/").map(parseFloat),n=l-e;if(n>0){const e=(1<<n)-1,s=h&e,i=c&e;this._tileClippers[t]=new r.O3(n,s,i,8,u)}}this._tileClippers[t]||(this._tileClippers[t]=new r.Ox)}}_canParseStyleLayer(e){return!this._styleLayerUIDs||this._styleLayerUIDs.has(e)}async parse(e){const t=(0,T.F)(),s=this._initialize(e),{returnedBuckets:n}=s;this._processLayers(s),this._linkReferences(s),this._filterFeatures(s);const i=[],r=new Set,a=(e,t)=>{r.has(e)||(i.push({name:e,repeat:t}),r.add(e))},o={};for(const e of n)e.getResources(e.tileClipper,a,o);if(this._tile.status===q.INVALID)return[];const l=this._fetchResources(i,o,e);return Promise.all([...l,t]).then((()=>this._processFeatures(s.returnedBuckets)))}_initialize(e){const t=e?.signal;return{signal:t,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(e){const{sourceNameToTileData:t,zoom:s,layers:n,sourceNameToTileClipper:i,sourceNameToUniqueSourceLayerBuckets:r,sourceNameToUniqueSourceLayers:a,returnedBuckets:o,layerIdToBucket:l,referencerUIDToReferencedId:h}=e,c=this._sourceDataMaxLOD;for(let e=n.length-1;e>=0;e--){const u=n[e];if(s<c){if(u.minzoom&&s<Math.floor(u.minzoom)||u.maxzoom&&s>=u.maxzoom)continue}else if(u.maxzoom&&s>=u.maxzoom)continue;if(u.type===p.Dc.BACKGROUND||!this._canParseStyleLayer(u.uid)||!t[u.source]||!i[u.source])continue;const f=t[u.source],d=i[u.source],g=u.sourceLayer,y=f[g];if(y){let e=a[u.source];if(e||(e=a[u.source]=new Set),e.add(u.sourceLayer),u.refLayerId)h.set(u.uid,u.refLayerId);else{const e=this._createBucket(u);if(e){e.layerUIDs=[u.uid],e.layerExtent=y.extent,e.tileClipper=d;let t=r[u.source];t||(t=r[u.source]={});let s=t[g];s||(s=t[g]=[]),s.push(e),o.push(e),l[u.id]=e}}}}}_linkReferences(e){const{layerIdToBucket:t,referencerUIDToReferencedId:s}=e;s.forEach(((e,s)=>{t[e]&&t[e].layerUIDs.push(s)}))}_filterFeatures(e){const{signal:t,sourceNameToTileData:s,sourceNameToUniqueSourceLayerBuckets:i,sourceNameToUniqueSourceLayers:r}=e,a=10*this._level,o=10*(this._level+1),l=[],h=[];for(const e of Object.keys(r))r[e].forEach((t=>{l.push(t),h.push(e)}));for(let e=0;e<l.length;e++){const r=h[e],c=l[e];if(!s[r]||!i[r])continue;const u=s[r][c],f=i[r][c];if(!f||0===f.length)continue;if((0,n.G4)(t))return;let d=0;const g=u.getData();for(;g.nextTag(2);){const e=g.getMessage(),t=new A(e,u,d++);e.release();const s=t.values;if(s){const e=s._minzoom;if(e&&e>=o)continue;const t=s._maxzoom;if(t&&t<=a)continue}for(const e of f)e.pushFeature(t)}}}_fetchResources(e,t,s){const n=[],i=this._tile.getWorkerTileHandler();let r,a;e.length>0&&(r=i.fetchSprites(e,this._client,s),n.push(r));for(const e in t){const r=t[e];r.size>0&&(a=i.fetchGlyphs(this._tile.tileKey,e,r,this._client,s),n.push(a))}return n}_processFeatures(e){const t=e.filter((e=>e.hasFeatures()||this._canParseStyleLayer(e.layer.uid)));for(const e of t)e.processFeatures(e.tileClipper);return t}_parseTileData(e){const t={};for(const s of Object.keys(e)){const n=e[s],i={};for(;n.next();)switch(n.tag()){case 3:{const e=n.getMessage(),t=new L(e);e.release(),i[t.name]=t;break}default:n.skip()}t[s]=i}return t}_createBucket(e){switch(e.type){case p.Dc.BACKGROUND:return null;case p.Dc.FILL:return this._createFillBucket(e);case p.Dc.LINE:return this._createLineBucket(e);case p.Dc.CIRCLE:return this._createCircleBucket(e);case p.Dc.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new N(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new B(e.fillMaterial.getStride()),new D,new v(e.outlineMaterial.getStride()),new D)}_createLineBucket(e){return new z(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new V(e.lineMaterial.getStride()),new D)}_createCircleBucket(e){return new E(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new S(e.circleMaterial.getStride()),new D)}_createSymbolBucket(e){const t=this._tile;return new Z(t.tileKey,e,this._level,new R(e.iconMaterial.getStride()),new D,new R(e.textMaterial.getStride()),new D,t.placementEngine,t.getWorkerTileHandler())}}class Q{constructor(e,t,s,n){this.status=q.INITIALIZED,this.placementEngine=new b,this.tileKey=e,this.refKeys=t,this._workerTileHandler=s,this._styleRepository=n}release(){this.tileKey="",this.refKeys=null,this.status=q.INITIALIZED,this._workerTileHandler=null}async parse(e,t){const s=t?.signal;if(null!=s){const e=()=>{s.removeEventListener("abort",e),this.status=q.INVALID};s.addEventListener("abort",e)}let i;const r={bucketsWithData:[],emptyBuckets:null};try{i=await this._parse(e,t)}catch(e){if((0,n.zf)(e))throw e;return{result:r,transferList:[]}}this.status=q.READY;const a=r.bucketsWithData,o=[];for(const e of i)if(e.hasFeatures()){const t=e.serialize();a.push(t)}else o.push(e.layer.uid);const l=[...a];let h=null;return o.length>0&&(h=Uint32Array.from(o),l.push(h.buffer)),r.emptyBuckets=h,{result:r,transferList:l}}setObsolete(){this.status=q.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,t){const s=e.sourceName2DataAndRefKey;return 0===Object.keys(s).length?[]:(this.status=q.MODIFIED,new $(s,this,t.client,e.sourceDataMaxLOD,this._styleRepository,e.styleLayerUIDs).parse(t))}}var X=s(45013);class ee{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=25}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){return this._styleRepository?.layers??[]}async createTileAndParse(e,t){const{key:s}=e,i={};for(const t of Object.keys(e.sourceName2DataAndRefKey)){const s=e.sourceName2DataAndRefKey[t];i[t]=s.refKey}const r=new Q(s,i,this,this._styleRepository);try{return await r.parse({...e,sourceDataMaxLOD:this._sourceDataMaxLOD},t)}catch(e){if(r.setObsolete(),r.release(),!(0,n.zf)(e))throw e;return null}}updateStyle(e){if(!e||0===e.length||!this._styleRepository)return;const t=this._styleRepository;for(const s of e){const e=s.type,n=s.data;switch(e){case i.$q.PAINTER_CHANGED:t.setPaintProperties(n.layer,n.paint);break;case i.$q.LAYOUT_CHANGED:t.setLayoutProperties(n.layer,n.layout);break;case i.$q.LAYER_REMOVED:t.deleteStyleLayer(n.layer);break;case i.$q.LAYER_CHANGED:t.setStyleLayer(n.layer,n.index);break;case i.$q.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(e){const{style:t,sourceDataMaxLOD:s}=e;this._styleRepository=new X.A(t),this._sourceDataMaxLOD=s,this._spriteInfo={},this._glyphInfo={}}fetchSprites(e,t,s){const n=[],i=this._spriteInfo;for(const t of e)void 0===i[t.name]&&n.push(t);return 0===n.length?Promise.resolve():t.invoke("getSprites",n,{signal:s?.signal}).then((e=>{for(const t in e){const s=e[t];i[t]=s}}))}getSpriteItems(){return this._spriteInfo}fetchGlyphs(e,t,s,n,i){const r=[];let a=this._glyphInfo[t];return a?s.forEach((e=>{a[e]||r.push(e)})):(a=this._glyphInfo[t]=[],s.forEach((e=>r.push(e)))),0===r.length?Promise.resolve():n.invoke("getGlyphs",{tileID:e,font:t,codePoints:r},i).then((e=>{for(let t=0;t<e.length;t++)e[t]&&(a[t]=e[t])}))}getGlyphItems(e){return this._glyphInfo[e]}}},34304:(e,t,s)=>{s.d(t,{DF:()=>l,FD:()=>i,Ov:()=>r,ct:()=>h});let n=1e-6;function i(){return n}const r=Math.random,a=Math.PI/180,o=180/Math.PI;function l(e){return e*a}function h(e){return e*o}Object.freeze(Object.defineProperty({__proto__:null,RANDOM:r,equals:function(e,t){return Math.abs(e-t)<=n*Math.max(1,Math.abs(e),Math.abs(t))},getEpsilon:i,setEpsilon:function(e){n=e},toDegree:h,toRadian:l},Symbol.toStringTag,{value:"Module"}))},40876:(e,t,s)=>{s.d(t,{Eq:()=>d,G1:()=>p,TS:()=>r,Tf:()=>_,V6:()=>i,Vm:()=>g,ay:()=>l,c1:()=>y,c4:()=>a,j5:()=>h,lT:()=>u,oW:()=>c});const n={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function i(e){return!!n[e]||!!n[e.toLowerCase()]}function r(e){return n[e]??n[e.toLowerCase()]}function a(e){return[...r(e)]}function o(e,t,s){s<0&&++s,s>1&&--s;const n=6*s;return n<1?e+(t-e)*n:2*s<1?t:3*s<2?e+(t-e)*(2/3-s)*6:e}function l(e,t,s,n=1){const i=(e%360+360)%360/360,r=s<=.5?s*(t+1):s+t-s*t,a=2*s-r;return[Math.round(255*o(a,r,i+1/3)),Math.round(255*o(a,r,i)),Math.round(255*o(a,r,i-1/3)),n]}function h(e){const t=e.length>5,s=t?8:4,n=(1<<s)-1,i=t?1:17,r=t?9===e.length:5===e.length;let a=Number("0x"+e.slice(1));if(isNaN(a))return null;const o=[0,0,0,1];let l;return r&&(l=a&n,a>>=s,o[3]=i*l/255),l=a&n,a>>=s,o[2]=i*l,l=a&n,a>>=s,o[1]=i*l,l=a&n,a>>=s,o[0]=i*l,o}function c(e){if("#"!==e[0]||isNaN(Number(`0x${e.slice(1)}`)))return null;switch(e.length){case 4:case 5:{const t=parseInt(e.slice(1,2),16),s=parseInt(e.slice(2,3),16),n=parseInt(e.slice(3,4),16),i=5===e.length?15:parseInt(e.slice(4),16);return[t+16*t,s+16*s,n+16*n,(i+16*i)/255]}case 7:case 9:return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16),(7===e.length?255:parseInt(e.slice(7),16))/255];default:return null}}function u(e){const t=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s.\-,%0-9]+)\)/);if(t){const e=t[2].split(/\s*,\s*/),s=t[1];if("rgb"===s&&3===e.length||"rgba"===s&&4===e.length){const t=e[0];if("%"===t.charAt(t.length-1)){const t=e.map((e=>2.56*parseFloat(e)));return 4===e.length&&(t[3]=parseFloat(e[3])),f(t)}return f(e.map((e=>parseFloat(e))))}if("hsl"===s&&3===e.length||"hsla"===s&&4===e.length)return l(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100,parseFloat(e[3]))}return null}function f(e){return e[0]=y(e[0]),e[1]=y(e[1]),e[2]=y(e[2]),e[3]=4===e.length?p(e[3]):1,e}function d(e){let t=i(e)?r(e):null;return t??=u(e),t??=c(e),t}function g(e){const t=d(e);return null!=t?[t[0]/255,t[1]/255,t[2]/255,t[3]]:null}function p(e){return x(e,0,1)}function y(e){return Math.round(x(e,0,255))}function x(e,t,s){return e=Number(e),isNaN(e)?s:e<t?t:e>s?s:e}const _=2.2},51624:(e,t,s)=>{s.d(t,{A:()=>u});var n,i,r=s(44208),a=s(69397),o=s(93687);(i=n||(n={}))[i.varint=0]="varint",i[i.fixed64=1]="fixed64",i[i.delimited=2]="delimited",i[i.fixed32=5]="fixed32",i[i.unknown=99]="unknown";const l=4294967296,h=new TextDecoder("utf-8"),c=(0,r.A)("safari")||(0,r.A)("ios")?6:(0,r.A)("ff")?12:32;class u{constructor(e,t,s=0,i=(e?e.byteLength:0)){this._tag=0,this._dataType=n.unknown,this._init(e,t,s,i)}_init(e,t,s,n){this._data=e,this._dataView=t,this._pos=s,this._end=n}get usedMemory(){return 64+(0,a.Qf)(this._data)}asUnsafe(){return this}clone(){return new u(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;if(e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128)return e;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*l;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*l;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,n){const i=this.getMessage(),r=e(i,t,s,n);return i.release(),r}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=u.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){u.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case n.varint:this._decodeVarint();break;case n.fixed64:this._skip(8);break;case n.delimited:this._skip(this._getLength());break;case n.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t=this._pos,s=0,n=0;if(this._end-t>=10)do{if(n=e[t++],s|=127&n,!(128&n))break;if(n=e[t++],s|=(127&n)<<7,!(128&n))break;if(n=e[t++],s|=(127&n)<<14,!(128&n))break;if(n=e[t++],s|=(127&n)<<21,!(128&n))break;if(n=e[t++],s+=268435456*(127&n),!(128&n))break;if(n=e[t++],s+=34359738368*(127&n),!(128&n))break;if(n=e[t++],s+=4398046511104*(127&n),!(128&n))break;if(n=e[t++],s+=562949953421312*(127&n),!(128&n))break;if(n=e[t++],s+=72057594037927940*(127&n),!(128&n))break;if(n=e[t++],s+=0x8000000000000000*(127&n),!(128&n))break;throw new Error("Varint too long!")}while(0);else{let i=1;for(;t!==this._end&&(n=e[t],128&n);)++t,s+=(127&n)*i,i*=128;if(t===this._end)throw new Error("Varint overrun!");++t,s+=n*i}return this._pos=t,s}_decodeSVarint(){const e=this._data;let t,s=0,n=0;const i=1&e[this._pos];if(n=e[this._pos++],s|=127&n,!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s|=(127&n)<<7,!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s|=(127&n)<<14,!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s|=(127&n)<<21,!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s+=268435456*(127&n),!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s+=34359738368*(127&n),!(128&n))return i?-(s+1)/2:s/2;if(n=e[this._pos++],s+=4398046511104*(127&n),!(128&n))return i?-(s+1)/2:s/2;if(t=BigInt(s),n=e[this._pos++],t+=0x2000000000000n*BigInt(127&n),!(128&n))return Number(i?-(t+1n)/2n:t/2n);if(n=e[this._pos++],t+=0x100000000000000n*BigInt(127&n),!(128&n))return Number(i?-(t+1n)/2n:t/2n);if(n=e[this._pos++],t+=0x8000000000000000n*BigInt(127&n),!(128&n))return Number(i?-(t+1n)/2n:t/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==n.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>c){const n=e.subarray(t,s);return h.decode(n)}let n="",i="";for(let r=t;r<s;++r){const t=e[r];128&t?i+="%"+t.toString(16):(n+=decodeURIComponent(i)+String.fromCharCode(t),i="")}return i.length&&(n+=decodeURIComponent(i)),n}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}static{this.pool=new o.A(u,void 0,(e=>{e._data=null,e._dataView=null}))}}},69397:(e,t,s)=>{s.d(t,{$B:()=>i,Qf:()=>h,Qh:()=>o,RS:()=>r,ez:()=>f,lM:()=>a,qK:()=>u});var n=s(34275);function i(e){return 32+e.length}const r=16;function a(e){if(!e)return 0;let t=u;for(const s in e)e.hasOwnProperty(s)&&(t+=l(e[s],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return h(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return c(e,8);let s=f;for(let n=0;n<t;n++)s+=l(e[n]);return s}(e);let t=u;for(const s in e)e.hasOwnProperty(s)&&(t+=l(e[s]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?o(e):u;case"string":return i(e);case"number":return r;case"boolean":return 4;default:return 8}}function h(...e){return e.reduce(((e,t)=>e+(t?(0,n.iu)(t)?t.byteLength+d:Array.isArray(t)?c(t,r):0:0)),0)}function c(e,t){return f+e.length*t}const u=32,f=16,d=145},87317:(e,t,s)=>{s.d(t,{a:()=>m,b:()=>c,c:()=>i,e:()=>I,f:()=>g,g:()=>a,h:()=>y,j:()=>d,l:()=>x,n:()=>p,s:()=>r,t:()=>_});var n=s(34304);function i(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function r(e,t,s,n,i){return e[0]=t,e[1]=s,e[2]=n,e[3]=i,e}function a(e,t,s){return e[0]=t[0]+s[0],e[1]=t[1]+s[1],e[2]=t[2]+s[2],e[3]=t[3]+s[3],e}function o(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e[2]=t[2]-s[2],e[3]=t[3]-s[3],e}function l(e,t,s){return e[0]=t[0]*s[0],e[1]=t[1]*s[1],e[2]=t[2]*s[2],e[3]=t[3]*s[3],e}function h(e,t,s){return e[0]=t[0]/s[0],e[1]=t[1]/s[1],e[2]=t[2]/s[2],e[3]=t[3]/s[3],e}function c(e,t,s){return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e}function u(e,t){const s=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],r=t[3]-e[3];return Math.sqrt(s*s+n*n+i*i+r*r)}function f(e,t){const s=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],r=t[3]-e[3];return s*s+n*n+i*i+r*r}function d(e){const t=e[0],s=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+s*s+n*n+i*i)}function g(e){const t=e[0],s=e[1],n=e[2],i=e[3];return t*t+s*s+n*n+i*i}function p(e,t){const s=t[0],n=t[1],i=t[2],r=t[3];let a=s*s+n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a),e[0]=s*a,e[1]=n*a,e[2]=i*a,e[3]=r*a),e}function y(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function x(e,t,s,n){const i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=i+n*(s[0]-i),e[1]=r+n*(s[1]-r),e[2]=a+n*(s[2]-a),e[3]=o+n*(s[3]-o),e}function _(e,t,s){const n=t[0],i=t[1],r=t[2],a=t[3];return e[0]=s[0]*n+s[4]*i+s[8]*r+s[12]*a,e[1]=s[1]*n+s[5]*i+s[9]*r+s[13]*a,e[2]=s[2]*n+s[6]*i+s[10]*r+s[14]*a,e[3]=s[3]*n+s[7]*i+s[11]*r+s[15]*a,e}function m(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function I(e,t){const s=e[0],i=e[1],r=e[2],a=e[3],o=t[0],l=t[1],h=t[2],c=t[3],u=(0,n.FD)();return Math.abs(s-o)<=u*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(i-l)<=u*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(r-h)<=u*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-c)<=u*Math.max(1,Math.abs(a),Math.abs(c))}const b=o,M=l,w=h,k=u,T=f,A=d,P=g;Object.freeze(Object.defineProperty({__proto__:null,add:a,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:i,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:k,distance:u,div:w,divide:h,dot:y,equals:I,exactEquals:m,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:A,length:d,lerp:x,max:function(e,t,s){return e[0]=Math.max(t[0],s[0]),e[1]=Math.max(t[1],s[1]),e[2]=Math.max(t[2],s[2]),e[3]=Math.max(t[3],s[3]),e},min:function(e,t,s){return e[0]=Math.min(t[0],s[0]),e[1]=Math.min(t[1],s[1]),e[2]=Math.min(t[2],s[2]),e[3]=Math.min(t[3],s[3]),e},mul:M,multiply:l,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:p,random:function(e,t=1){const s=n.Ov;let i,r,a,o,l,h;do{i=2*s()-1,r=2*s()-1,l=i*i+r*r}while(l>=1);do{a=2*s()-1,o=2*s()-1,h=a*a+o*o}while(h>=1);const c=Math.sqrt((1-l)/h);return e[0]=t*i,e[1]=t*r,e[2]=t*a*c,e[3]=t*o*c,e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},scale:c,scaleAndAdd:function(e,t,s,n){return e[0]=t[0]+s[0]*n,e[1]=t[1]+s[1]*n,e[2]=t[2]+s[2]*n,e[3]=t[3]+s[3]*n,e},set:r,sqrDist:T,sqrLen:P,squaredDistance:f,squaredLength:g,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:b,subtract:o,transformMat4:_,transformQuat:function(e,t,s){const n=t[0],i=t[1],r=t[2],a=s[0],o=s[1],l=s[2],h=s[3],c=h*n+o*r-l*i,u=h*i+l*n-a*r,f=h*r+a*i-o*n,d=-a*n-o*i-l*r;return e[0]=c*h+d*-a+u*-l-f*-o,e[1]=u*h+d*-o+f*-a-c*-l,e[2]=f*h+d*-l+c*-o-u*-a,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},91829:(e,t,s)=>{function n(){return[0,0,0,0]}function i(e){return[e[0],e[1],e[2],e[3]]}function r(e,t,s,n){return[e,t,s,n]}function a(e,t,s,n){return[e,t,s,n]}function o(e,t=[0,0,0,0]){const s=Math.min(4,e.length);for(let n=0;n<s;++n)t[n]=e[n];return t}function l(){return r(1,1,1,1)}function h(){return r(1,0,0,0)}function c(){return r(0,1,0,0)}function u(){return r(0,0,1,0)}function f(){return r(0,0,0,1)}s.d(t,{CN:()=>a,Un:()=>g,ci:()=>o,fA:()=>r,o8:()=>i,uY:()=>d,vt:()=>n});const d=[0,0,0,0],g=l(),p=h(),y=c(),x=u(),_=f();Object.freeze(Object.defineProperty({__proto__:null,ONES:g,UNIT_W:_,UNIT_X:p,UNIT_Y:y,UNIT_Z:x,ZEROS:d,clone:i,create:n,freeze:a,fromArray:o,fromValues:r,ones:l,unitW:f,unitX:h,unitY:c,unitZ:u,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"}))}}]);
|