maplibre-gl-components 0.12.0 → 0.12.1
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/dist/{ControlGrid-BHj06tuI.cjs → ControlGrid-3Y_umzvK.cjs} +5 -5
- package/dist/{ControlGrid-CcOIR0lI.js → ControlGrid-CeKq8xm8.js} +18 -18
- package/dist/{deflate-BeG874Ez.js → deflate-CCnKrMSU.js} +1 -1
- package/dist/{deflate-Buv4KFPQ.cjs → deflate-Dj9xAuf-.cjs} +1 -1
- package/dist/{geotiff-D9Jxidvv.cjs → geotiff-C-MHEjS3.cjs} +2 -2
- package/dist/{geotiff-CY9Ly-G7.js → geotiff-CkM7wOor.js} +8 -8
- package/dist/{index-CsAfY_en.cjs → index-C8CBe27l.cjs} +1 -1
- package/dist/{index-CkoU3LUr.js → index-Dv6tRl9f.js} +2 -2
- package/dist/index-GVloud5I.js +4 -0
- package/dist/{index-ChPRo5p6.cjs → index-rhQrpZSD.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{jpeg-K5f1PGmj.cjs → jpeg-Cr0iCWxG.cjs} +1 -1
- package/dist/{jpeg-DxFhLjr0.js → jpeg-D2rka1FK.js} +1 -1
- package/dist/{lerc-BKz5PmNT.js → lerc-BuHKAAJ5.js} +2 -2
- package/dist/{lerc-DBi1jyo4.cjs → lerc-Du5hw3rN.cjs} +1 -1
- package/dist/{lzw-1pa4hURZ.cjs → lzw-BHeSwe4R.cjs} +1 -1
- package/dist/{lzw-_5PJSl3d.js → lzw-CIvsR7yQ.js} +1 -1
- package/dist/maplibre-gl-components.css +1 -1
- package/dist/{packbits-D8NpPMS2.cjs → packbits-C9seKA6S.cjs} +1 -1
- package/dist/{packbits-DB0-GTif.js → packbits-CGqapXxr.js} +1 -1
- package/dist/{raw-Ady0oBU-.cjs → raw-BOD2Kcq8.cjs} +1 -1
- package/dist/{raw-DaYOG1dh.js → raw-Cxjry7D7.js} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/{webimage-B65eRBzD.js → webimage-BDD8ZjeE.js} +1 -1
- package/dist/{webimage-CI-Xhwi8.cjs → webimage-BaGAucPQ.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-Bhn2Pjz_.js +0 -4
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
color.b = clamp((color.b - rescaleFloat.minVal) / range, 0.0, 1.0);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
`},uniformTypes:{minVal:"f32",maxVal:"f32",isSingleBand:"f32"},getUniforms:i=>({minVal:i.minVal,maxVal:i.maxVal,isSingleBand:i.isSingleBand})};function hQ(i,e){return i&&(Array.isArray(i)?i.map(t=>hQ(t,e)):typeof i.clone=="function"?i.clone({opacity:e}):i)}function _de(i){let e=i.replace("#","");return e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function Ade(i){const t=new Uint8ClampedArray(1024),n=i.map(s=>({pos:s.position,rgb:_de(s.color)}));for(let s=0;s<256;s++){const r=s/255;let o=n[0],a=n[n.length-1];for(let u=0;u<n.length-1;u++)if(r>=n[u].pos&&r<=n[u+1].pos){o=n[u],a=n[u+1];break}const l=a.pos-o.pos,h=l>0?(r-o.pos)/l:0;t[s*4]=o.rgb[0]+(a.rgb[0]-o.rgb[0])*h,t[s*4+1]=o.rgb[1]+(a.rgb[1]-o.rgb[1])*h,t[s*4+2]=o.rgb[2]+(a.rgb[2]-o.rgb[2])*h,t[s*4+3]=255}return new ImageData(t,256,1)}const yde=["none","bone","bwr","cividis","cool","coolwarm","gray","hot","inferno","jet","magma","ocean","plasma","rainbow","RdBu","RdYlBu","RdYlGn","seismic","spectral","terrain","turbo","viridis"],vde={position:"top-right",className:"",visible:!0,collapsed:!0,beforeId:"",defaultUrl:"",loadDefaultUrl:!1,defaultBands:"1",defaultColormap:"none",defaultRescaleMin:0,defaultRescaleMax:255,defaultNodata:0,defaultLayerName:"",defaultOpacity:1,defaultPickable:!0,panelWidth:300,maxHeight:500,backgroundColor:"rgba(255, 255, 255, 0.95)",borderRadius:4,opacity:1,fontSize:13,fontColor:"#333",minzoom:0,maxzoom:24},bde='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>';class k3{_container;_button;_panel;_options;_state;_eventHandlers=new Map;_map;_handleZoom;_zoomVisible=!0;_deckOverlay;_cogLayers=new Map;_cogLayerPropsMap=new Map;_layerCounter=0;_activePopup;_mapClickHandler;constructor(e){this._options={...vde,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed,url:this._options.defaultUrl,bands:this._options.defaultBands,colormap:this._options.defaultColormap,rescaleMin:this._options.defaultRescaleMin,rescaleMax:this._options.defaultRescaleMax,nodata:this._options.defaultNodata,layerName:this._options.defaultLayerName,layerOpacity:this._options.defaultOpacity,pickable:this._options.defaultPickable,hasLayer:!1,layerCount:0,layers:[],loading:!1,error:null,status:null}}onAdd(e){if(this._map=e,this._container=this._createContainer(),this._render(),this._handleZoom=()=>this._checkZoomVisibility(),this._map.on("zoom",this._handleZoom),this._checkZoomVisibility(),this._setupClickHandler(),this._options.loadDefaultUrl&&this._options.defaultUrl){const t=()=>{this._addLayer()};this._map.isStyleLoaded()?setTimeout(t,100):this._map.once("idle",t)}return this._container}onRemove(){if(this._removeLayer(),this._map&&this._handleZoom&&(this._map.off("zoom",this._handleZoom),this._handleZoom=void 0),this._map&&this._mapClickHandler&&(this._map.off("click",this._mapClickHandler),this._mapClickHandler=void 0),this._activePopup&&(this._activePopup.remove(),this._activePopup=void 0),this._deckOverlay&&this._map){try{this._map.removeControl(this._deckOverlay)}catch{}this._deckOverlay=void 0}this._map=void 0,this._container?.parentNode?.removeChild(this._container),this._container=void 0,this._button=void 0,this._panel=void 0,this._eventHandlers.clear()}show(){this._state.visible||(this._state.visible=!0,this._updateDisplayState(),this._emit("show"))}hide(){this._state.visible&&(this._state.visible=!1,this._updateDisplayState(),this._emit("hide"))}expand(){this._state.collapsed&&(this._state.collapsed=!1,this._render(),this._emit("expand"))}collapse(){this._state.collapsed||(this._state.collapsed=!0,this._render(),this._emit("collapse"))}toggle(){this._state.collapsed?this.expand():this.collapse()}getState(){return{...this._state}}update(e){this._options={...this._options,...e},e.visible!==void 0&&(this._state.visible=e.visible),e.collapsed!==void 0&&(this._state.collapsed=e.collapsed),this._render(),this._emit("update")}on(e,t){this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t)}off(e,t){this._eventHandlers.get(e)?.delete(t)}async addLayer(e){e&&(this._state.url=e),await this._addLayer()}removeLayer(e){this._removeLayer(e),this._render()}getLayerIds(){return Array.from(this._cogLayers.keys())}getLayerOpacity(e){const t=this._cogLayers.get(e);return!t||!t.props?null:t.props.opacity??1}setLayerOpacity(e,t){const n=this._cogLayers.get(e);if(!n||typeof n.clone!="function")return;const s=Math.max(0,Math.min(1,t)),r=n.clone({opacity:s});this._cogLayers.set(e,r),this._deckOverlay&&this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._map&&this._map.triggerRepaint()}getLayerVisibility(e){const t=this.getLayerOpacity(e);return t!==null&&t>0}setLayerVisibility(e,t,n=1){t?this.setLayerOpacity(e,n):this.setLayerOpacity(e,0)}getLayerUrl(e){return this._cogLayerPropsMap.get(e)?.geotiff??null}_emit(e,t){const n=this._eventHandlers.get(e);if(n){const s={type:e,state:this.getState(),...t};n.forEach(r=>r(s))}}_checkZoomVisibility(){if(!this._map)return;const e=this._map.getZoom(),{minzoom:t,maxzoom:n}=this._options,s=e>=t&&e<=n;s!==this._zoomVisible&&(this._zoomVisible=s,this._updateDisplayState())}_updateDisplayState(){if(!this._container)return;const e=this._state.visible&&this._zoomVisible;this._container.style.display=e?"block":"none"}_createContainer(){const e=document.createElement("div");return e.className=`maplibregl-ctrl maplibre-gl-cog-layer${this._options.className?` ${this._options.className}`:""}`,this._state.visible&&this._zoomVisible||(e.style.display="none"),Object.assign(e.style,{backgroundColor:this._options.backgroundColor,borderRadius:`${this._options.borderRadius}px`,boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.1)"}),this._options.opacity!==1&&(e.style.opacity=String(this._options.opacity)),e}_render(){if(!this._container)return;const e=this._container.querySelector(".maplibre-gl-cog-layer-panel"),t=e?e.scrollTop:0;if(this._container.innerHTML="",this._state.collapsed?this._renderCollapsed():this._renderExpanded(),this._updateDisplayState(),t>0){const n=this._container.querySelector(".maplibre-gl-cog-layer-panel");n&&(n.scrollTop=t)}}_renderCollapsed(){this._container&&(this._button=document.createElement("button"),this._button.type="button",this._button.className=`maplibre-gl-cog-layer-button${this._state.hasLayer?" maplibre-gl-cog-layer-button--active":""}`,this._button.title="COG Layer",this._button.setAttribute("aria-label","COG Layer"),this._button.innerHTML=bde,this._button.addEventListener("click",()=>this.expand()),this._container.appendChild(this._button),this._panel=void 0)}_renderExpanded(){if(!this._container)return;const e=document.createElement("div");e.className="maplibre-gl-cog-layer-panel",e.style.width=`${this._options.panelWidth}px`,this._options.maxHeight&&this._options.maxHeight>0&&(e.style.maxHeight=`${this._options.maxHeight}px`,e.style.overflowY="auto"),this._panel=e;const t=document.createElement("div");t.className="maplibre-gl-cog-layer-header";const n=document.createElement("span");n.className="maplibre-gl-cog-layer-title",n.textContent="COG Layer",t.appendChild(n);const s=document.createElement("button");s.className="maplibre-gl-cog-layer-close",s.innerHTML="×",s.title="Close",s.addEventListener("click",()=>this.collapse()),t.appendChild(s),e.appendChild(t);const r=this._createFormGroup("COG URL","url"),o=document.createElement("input");o.type="text",o.className="maplibre-gl-cog-layer-input",o.style.color="#000",o.placeholder="https://example.com/cog.tif",o.value=this._state.url,o.addEventListener("input",()=>{this._state.url=o.value}),r.appendChild(o),e.appendChild(r);const a=this._createFormGroup("Bands (comma-separated)","bands"),l=document.createElement("input");l.type="text",l.className="maplibre-gl-cog-layer-input",l.style.color="#000",l.placeholder="1 or 1,2,3",l.value=this._state.bands,l.addEventListener("input",()=>{this._state.bands=l.value}),a.appendChild(l),e.appendChild(a);const h=this._createFormGroup("Colormap","colormap"),u=document.createElement("select");u.className="maplibre-gl-cog-layer-select",u.style.color="#000";for(const W of yde){const q=document.createElement("option");q.value=W,q.textContent=W,W===this._state.colormap&&(q.selected=!0),u.appendChild(q)}u.addEventListener("change",()=>{this._state.colormap=u.value,this._updateColormapPreview()}),h.appendChild(u);const d=document.createElement("div");d.className="maplibre-gl-cog-layer-colormap-preview",d.id="cog-colormap-preview",this._updateColormapPreviewElement(d),h.appendChild(d),e.appendChild(h);const g=document.createElement("div");g.className="maplibre-gl-cog-layer-row";const m=this._createFormGroup("Rescale Min","rescale-min"),v=document.createElement("input");v.type="number",v.className="maplibre-gl-cog-layer-input",v.style.color="#000",v.value=String(this._state.rescaleMin),v.addEventListener("input",()=>{this._state.rescaleMin=Number(v.value)||0}),m.appendChild(v),g.appendChild(m);const b=this._createFormGroup("Rescale Max","rescale-max"),w=document.createElement("input");w.type="number",w.className="maplibre-gl-cog-layer-input",w.style.color="#000",w.value=String(this._state.rescaleMax),w.addEventListener("input",()=>{this._state.rescaleMax=Number(w.value)||0}),b.appendChild(w),g.appendChild(b),e.appendChild(g);const x=this._createFormGroup("Nodata","nodata"),I=document.createElement("input");I.type="number",I.className="maplibre-gl-cog-layer-input",I.style.color="#000",I.placeholder="e.g. 0 or -9999",I.value=this._state.nodata!==void 0?String(this._state.nodata):"",I.addEventListener("input",()=>{this._state.nodata=I.value!==""?Number(I.value):void 0}),x.appendChild(I),e.appendChild(x);const T=this._createFormGroup("Opacity","opacity"),R=document.createElement("div");R.className="maplibre-gl-cog-layer-slider-row";const F=document.createElement("input");F.type="range",F.className="maplibre-gl-cog-layer-slider",F.min="0",F.max="100",F.value=String(Math.round(this._state.layerOpacity*100));const z=document.createElement("span");z.className="maplibre-gl-cog-layer-slider-value",z.textContent=`${Math.round(this._state.layerOpacity*100)}%`,F.addEventListener("input",()=>{const W=Number(F.value);this._state.layerOpacity=W/100,z.textContent=`${W}%`,this._updateOpacity()}),R.appendChild(F),R.appendChild(z),T.appendChild(R),e.appendChild(T);const U=document.createElement("div");U.className="maplibre-gl-cog-layer-form-group maplibre-gl-cog-layer-checkbox-group";const N=document.createElement("label");N.className="maplibre-gl-cog-layer-checkbox-label";const L=document.createElement("input");L.type="checkbox",L.className="maplibre-gl-cog-layer-checkbox",L.checked=this._state.pickable,L.addEventListener("change",()=>{this._state.pickable=L.checked,this._updatePickable()}),N.appendChild(L);const k=document.createElement("span");k.textContent="Pickable (click to show pixel value)",N.appendChild(k),U.appendChild(N),e.appendChild(U);const D=this._createFormGroup("Layer Name","layer-name"),Y=document.createElement("input");Y.type="text",Y.className="maplibre-gl-cog-layer-input",Y.style.color="#000",Y.placeholder="Optional custom layer name",Y.value=this._state.layerName,Y.addEventListener("input",()=>{this._state.layerName=Y.value}),D.appendChild(Y),e.appendChild(D);const Z=this._createFormGroup("Before Layer ID (optional)","before-id"),j=document.createElement("input");j.type="text",j.className="maplibre-gl-cog-layer-input",j.style.color="#000",j.placeholder="e.g. labels or water",j.value=this._options.beforeId||"",j.addEventListener("input",()=>{this._options.beforeId=j.value||""}),Z.appendChild(j),e.appendChild(Z);const Q=document.createElement("div");Q.className="maplibre-gl-cog-layer-buttons";const $=document.createElement("button");if($.className="maplibre-gl-cog-layer-btn maplibre-gl-cog-layer-btn--primary",$.textContent="Add Layer",$.disabled=this._state.loading,$.addEventListener("click",()=>this._addLayer()),Q.appendChild($),e.appendChild(Q),this._state.loading?this._appendStatus("Loading COG...","info"):this._state.error?this._appendStatus(this._state.error,"error"):this._state.status&&this._appendStatus(this._state.status,"success"),this._cogLayers.size>0){const W=document.createElement("div");W.className="maplibre-gl-cog-layer-list";const q=document.createElement("div");q.className="maplibre-gl-cog-layer-list-header",q.textContent=`Layers (${this._cogLayers.size})`,W.appendChild(q);for(const[ee]of this._cogLayers){const ne=this._cogLayerPropsMap.get(ee);if(!ne)continue;const oe=document.createElement("div");oe.className="maplibre-gl-cog-layer-list-item";const ue=document.createElement("span");ue.className="maplibre-gl-cog-layer-list-label";const pe=ne.geotiff,ae=ne._layerName;let ye;if(ae)ye=ae;else try{ye=new URL(pe).pathname.split("/").pop()||pe}catch{ye=pe}ue.textContent=ye,ue.title=pe,oe.appendChild(ue);const Me=document.createElement("button");Me.className="maplibre-gl-cog-layer-list-remove",Me.innerHTML="×",Me.title="Remove layer",Me.addEventListener("click",()=>{this._removeLayer(ee),this._render()}),oe.appendChild(Me),W.appendChild(oe)}e.appendChild(W)}this._container.appendChild(e),this._button=void 0}_createFormGroup(e,t){const n=document.createElement("div");n.className="maplibre-gl-cog-layer-form-group";const s=document.createElement("label");return s.textContent=e,s.htmlFor=`cog-layer-${t}`,n.appendChild(s),n}_appendStatus(e,t){if(!this._panel)return;const n=document.createElement("div");n.className=`maplibre-gl-cog-layer-status maplibre-gl-cog-layer-status--${t}`,n.textContent=e,this._panel.appendChild(n)}_updateColormapPreview(){const e=document.getElementById("cog-colormap-preview");e&&this._updateColormapPreviewElement(e)}_updateColormapPreviewElement(e){if(this._state.colormap==="none")e.style.background="linear-gradient(to right, #888, #888)",e.style.display="none";else{const n=Pu(this._state.colormap).map(s=>s.color).join(", ");e.style.background=`linear-gradient(to right, ${n})`,e.style.display="block"}}async _ensureOverlay(){if(this._deckOverlay||!this._map)return;const{MapboxOverlay:e}=await Promise.resolve().then(()=>require("./index-CsAfY_en.cjs"));this._deckOverlay=new e({interleaved:!!this._options.beforeId,layers:[]}),this._map.addControl(this._deckOverlay)}_setupClickHandler(){if(!this._map||this._mapClickHandler)return;const e=this._map;this._mapClickHandler=t=>{if(!this._state.pickable||this._cogLayers.size===0)return;this._activePopup&&this._activePopup.remove();const{lngLat:n}=t,s=Array.from(this._cogLayers.keys()),r=this._cogLayerPropsMap.get(s[0]);let o='<div class="maplibre-gl-cog-layer-popup">';o+='<table class="maplibre-gl-cog-layer-popup-table">',o+=`<tr><td><strong>Layers</strong></td><td>${s.length} COG layer(s)</td></tr>`,o+=`<tr><td><strong>Lng</strong></td><td>${n.lng.toFixed(6)}</td></tr>`,o+=`<tr><td><strong>Lat</strong></td><td>${n.lat.toFixed(6)}</td></tr>`,r&&(o+=`<tr><td><strong>Rescale</strong></td><td>${r._rescaleMin} - ${r._rescaleMax}</td></tr>`,r._colormap&&r._colormap!=="none"&&(o+=`<tr><td><strong>Colormap</strong></td><td>${r._colormap}</td></tr>`)),o+="</table>",o+="</div>",this._activePopup=new Dr.Popup({closeButton:!0,maxWidth:"280px"}).setLngLat(n).setHTML(o).addTo(e);const a=this._activePopup.getElement();a&&(a.style.zIndex="1000")},e.on("click",this._mapClickHandler)}_updatePickable(){if(this._deckOverlay){for(const[,e]of this._cogLayerPropsMap)e.pickable=this._state.pickable;this._rebuildLayers()}}async _rebuildLayers(){if(this._deckOverlay)try{const{COGLayer:e}=await Promise.resolve().then(()=>require("./index-ChPRo5p6.cjs"));this._patchCOGLayerForFloat(e),this._patchCOGLayerForOpacity(e);const t=[];for(const[n,s]of this._cogLayerPropsMap){const r=new e(s);this._cogLayers.set(n,r),t.push(r)}this._deckOverlay.setProps({layers:t})}catch(e){console.error("Failed to rebuild layers:",e)}}async _registerCommonProjections(e){e.defs("EPSG:3978","+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +type=crs"),e.defs("EPSG:3979","+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=-0.991,1.9072,0.5129,-1.25033e-07,-4.6785e-08,-5.6529e-08,0 +units=m +no_defs +type=crs")}_buildGeoKeysParser(e){let t=null;return Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs")).then(n=>{t=n.default||n,typeof t=="function"&&this._registerCommonProjections(t)}),async n=>{try{const s=e.toProj4(n);if(s&&s.proj4){let r=s.proj4;if(r=r.replace(/\+axis=\w+\s*/g,""),!t){const a=await Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs"));t=a.default||a,typeof t=="function"&&await this._registerCommonProjections(t)}let o={};if(typeof t=="function")try{t.defs("custom",r),o=t.defs("custom")||{}}catch{}return{def:r,parsed:o,coordinatesUnits:s.coordinatesUnits||"metre"}}}catch{}return null}}_patchCOGLayerForFloat(e){if(e.__floatPatched)return;e.__floatPatched=!0;const t=e.prototype._parseGeoTIFF;e.prototype._parseGeoTIFF=async function(){try{await t.call(this);const n=this.props._nodata;if(n!=null&&!isNaN(n)){const{FilterNoDataVal:s}=await Promise.resolve().then(()=>require("./index-B-Nr9y7J.cjs")),r=this.state.defaultRenderTile;if(typeof r=="function"){const o=a=>{const h=r(a).filter(u=>u.module!==s);return h.splice(1,0,{module:s,props:{value:n}}),h};this.setState({defaultRenderTile:o})}}}catch(n){if(!(n instanceof Error?n.message:String(n)).includes("non-unsigned integers not yet supported"))throw n;const{fromUrl:r}=await Promise.resolve().then(()=>require("./geotiff-D9Jxidvv.cjs")).then(ee=>ee.geotiff),{parseCOGTileMatrixSet:o,texture:a}=await Promise.resolve().then(()=>require("./index-ChPRo5p6.cjs")),{CreateTexture:l,FilterNoDataVal:h}=await Promise.resolve().then(()=>require("./index-B-Nr9y7J.cjs")),u=await Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs")),d=u.default||u,g=this.props.geotiff,m=typeof g=="string"?await r(g):g,v=this.props.geoKeysParser,b=await o(m,v),w=await m.getImage(),x=await m.getImageCount(),I=[];for(let ee=0;ee<x;ee++)I.push(await m.getImage(ee));const T=await v(w.getGeoKeys());if(!T)throw new Error("Could not determine source projection from GeoTIFF geo keys");const R=d(T.def,"EPSG:4326"),F=(ee,ne)=>R.forward([ee,ne],!1),z=(ee,ne)=>R.inverse([ee,ne],!1);if(this.props.onGeoTIFFLoad){const ee=w.getBoundingBox(),ne=[R.forward([ee[0],ee[1]]),R.forward([ee[2],ee[1]]),R.forward([ee[2],ee[3]]),R.forward([ee[0],ee[3]])],oe=ne.map(ae=>ae[0]),ue=ne.map(ae=>ae[1]),pe={west:Math.min(...oe),south:Math.min(...ue),east:Math.max(...oe),north:Math.max(...ue)};this.props.onGeoTIFFLoad(m,{projection:T,geographicBounds:pe})}const U=w.getFileDirectory(),{BitsPerSample:N,SampleFormat:L,SamplesPerPixel:k,GDAL_NODATA:D}=U;let Y=null;if(D){const ee=D[D.length-1]==="\0"?D.slice(0,-1):D;ee.length>0&&(Y=parseFloat(ee))}const Z=async(ee,ne)=>{const{device:oe}=ne,ue=await ee.readRasters({...ne,interleave:!0});let pe=ue,ae=k;if(k===3){const Ne=ue.width*ue.height,me=new Float32Array(Ne*4);for(let Ke=0;Ke<Ne;Ke++)me[Ke*4]=ue[Ke*3],me[Ke*4+1]=ue[Ke*3+1],me[Ke*4+2]=ue[Ke*3+2],me[Ke*4+3]=1;pe=me,pe.width=ue.width,pe.height=ue.height,ae=4}const ye=a.inferTextureFormat(ae,N,L);return{texture:oe.createTexture({data:pe,format:ye,width:ue.width,height:ue.height,sampler:{magFilter:"nearest",minFilter:"nearest"}}),height:ue.height,width:ue.width}},j=this;let Q=null,$=null;const{Colormap:W}=await Promise.resolve().then(()=>require("./index-B-Nr9y7J.cjs")),q=ee=>{const ne=[{module:l,props:{textureName:ee.texture}}],oe=j.props._nodata!==void 0&&j.props._nodata!==null&&!isNaN(j.props._nodata)?j.props._nodata:Y;oe!==null&&ne.push({module:h,props:{value:oe}});const ue=j.props._rescaleMin??0,pe=j.props._rescaleMax??255;ne.push({module:mde,props:{minVal:ue,maxVal:pe,isSingleBand:k===1?1:0}});const ae=j.props._colormap;if(ae&&ae!=="none"){if(ae!==Q){const ye=Pu(ae),Me=Ade(ye);$=j.context.device.createTexture({data:Me.data,format:"rgba8unorm",width:Me.width,height:Me.height,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),Q=ae}ne.push({module:W,props:{colormapTexture:$}})}return ne};this.setState({metadata:b,forwardReproject:F,inverseReproject:z,images:I,defaultGetTileData:Z,defaultRenderTile:q})}}}_patchCOGLayerForOpacity(e){if(e.__opacityPatched)return;e.__opacityPatched=!0;const t=e.prototype._renderSubLayers;e.prototype._renderSubLayers=function(...n){const s=t.apply(this,n),r=this.props.opacity;return r==null?s:hQ(s,Math.max(0,Math.min(1,r)))}}async _addLayer(){if(!this._map||!this._state.url){this._state.error="Please enter a COG URL.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{await this._ensureOverlay();const{COGLayer:e}=await Promise.resolve().then(()=>require("./index-ChPRo5p6.cjs"));this._patchCOGLayerForFloat(e),this._patchCOGLayerForOpacity(e);const t=this._map,n={geotiff:this._state.url,opacity:this._state.layerOpacity,pickable:this._state.pickable,_rescaleMin:this._state.rescaleMin,_rescaleMax:this._state.rescaleMax,_colormap:this._state.colormap,_nodata:this._state.nodata,...(()=>{if(this._options.beforeId){if(t.getLayer(this._options.beforeId))return{beforeId:this._options.beforeId};console.warn(`[CogLayerControl] beforeId "${this._options.beforeId}" not found in map layers, adding layer on top`)}return{}})(),onGeoTIFFLoad:(a,l)=>{try{if(l&&l.geographicBounds){const{west:h,south:u,east:d,north:g}=l.geographicBounds;t.fitBounds([[h,u],[d,g]],{padding:50,duration:1e3})}}catch{}}};try{const a=await Promise.resolve().then(()=>require("./main-dist-Bymiy5aM.cjs")),l=a.default||a;l&&typeof l.toProj4=="function"&&(n.geoKeysParser=this._buildGeoKeysParser(l))}catch{}const s=`cog-layer-${this._layerCounter++}`;n.id=s;const r=this._state.layerName?.trim();r&&(n._layerName=r),this._cogLayerPropsMap.set(s,n);const o=new e(n);this._cogLayers.set(s,o),this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.layers=this._buildLayerInfoList(),this._state.loading=!1,this._state.status="COG layer added successfully.",this._state.layerName="",this._render(),this._emit("layeradd",{url:this._state.url,layerId:s})}catch(e){this._state.loading=!1,this._state.error=`Failed to load COG: ${e instanceof Error?e.message:String(e)}`,this._render(),this._emit("error",{error:this._state.error})}}_removeLayer(e){e?(this._cogLayers.delete(e),this._cogLayerPropsMap.delete(e),this._deckOverlay&&this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.layers=this._buildLayerInfoList(),this._state.status=null,this._state.error=null,this._emit("layerremove",{layerId:e})):(this._deckOverlay&&this._deckOverlay.setProps({layers:[]}),this._cogLayers.clear(),this._cogLayerPropsMap.clear(),this._state.hasLayer=!1,this._state.layerCount=0,this._state.layers=[],this._state.status=null,this._state.error=null,this._emit("layerremove"))}_updateOpacity(){if(!this._deckOverlay||this._cogLayers.size===0)return;const e=this._state.layerOpacity;for(const[t,n]of this._cogLayers)typeof n.clone=="function"&&this._cogLayers.set(t,n.clone({opacity:e}));this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._map&&this._map.triggerRepaint()}_buildLayerInfoList(){const e=[];for(const[t,n]of this._cogLayerPropsMap)e.push({id:t,name:n._layerName||void 0,url:n.geotiff,bands:"1",colormap:n._colormap||"none",rescaleMin:n._rescaleMin??0,rescaleMax:n._rescaleMax??255,nodata:n._nodata,opacity:n.opacity??1});return e}}const xde={position:"bottom-left",className:"",visible:!0,collapsed:!1,width:250,height:180,zoomOffset:-5,style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",viewportRectColor:"#0078d7",viewportRectOpacity:.2,toggleable:!0,interactive:!1,minzoom:0,maxzoom:24},wde='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><rect x="7" y="7" width="10" height="10" rx="1" stroke-dasharray="2 2"/></svg>',Ix="maplibre-minimap-viewport",Ede="maplibre-minimap-viewport-fill",Cde="maplibre-minimap-viewport-line";class uQ{_container;_button;_panel;_options;_state;_eventHandlers=new Map;_map;_minimapMap;_handleMove;_handleZoom;_zoomVisible=!0;_isDragging=!1;_dragStartLngLat;_dragCleanup;constructor(e){this._options={...xde,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed}}getDefaultPosition(){return this._options.position}onAdd(e){return this._map=e,this._container=this._createContainer(),this._handleZoom=()=>this._checkZoomVisibility(),this._map.on("zoom",this._handleZoom),this._state.collapsed||this._showPanel(),this._state.visible||(this._container.style.display="none"),this._container}onRemove(){this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=void 0),this._isDragging=!1,this._dragStartLngLat=void 0,this._minimapMap&&(this._minimapMap.remove(),this._minimapMap=void 0),this._map&&this._handleMove&&this._map.off("move",this._handleMove),this._map&&this._handleZoom&&this._map.off("zoom",this._handleZoom),this._container?.parentNode&&this._container.parentNode.removeChild(this._container),this._container=void 0,this._button=void 0,this._panel=void 0,this._map=void 0}on(e,t){return this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t),this}off(e,t){return this._eventHandlers.get(e)?.delete(t),this}_emit(e){const t=this._eventHandlers.get(e);if(t){const n={type:e,state:this.getState()};t.forEach(s=>s(n))}}_createContainer(){const e=document.createElement("div");return e.classList.add("maplibregl-ctrl","maplibre-gl-minimap-control"),this._options.className&&e.classList.add(this._options.className),this._options.toggleable&&(this._button=document.createElement("button"),this._button.type="button",this._button.className="minimap-button",this._button.title="Toggle minimap",this._button.innerHTML=wde,this._button.addEventListener("click",()=>this.toggle()),e.appendChild(this._button)),e}_showPanel(){if(!this._container||!this._map||this._panel)return;this._panel=document.createElement("div"),this._panel.className="minimap-panel",this._panel.style.width=`${this._options.width}px`,this._panel.style.height=`${this._options.height}px`;const e=document.createElement("div");e.className="minimap-map",this._panel.appendChild(e),this._container.appendChild(this._panel);const t=this._map.getCenter(),n=this._map.getZoom(),s=Math.max(0,n+this._options.zoomOffset);if(this._minimapMap=new Dr.Map({container:e,style:this._options.style,center:t,zoom:s,interactive:!1,attributionControl:!1}),this._minimapMap.on("load",()=>{this._addViewportRect(),this._updateViewportRect()}),this._handleMove=()=>{this._isDragging||(this._syncMinimap(),this._updateViewportRect())},this._map.on("move",this._handleMove),this._options.interactive&&this._minimapMap){const r=this._minimapMap._canvas;r.style.cursor="pointer";let o=null,a=!1,l=null;const h=g=>{if(!this._minimapMap||!this._map)return;g.preventDefault(),this._isDragging=!0,a=!1,o={x:g.clientX,y:g.clientY},r.style.cursor="grabbing";const m=r.getBoundingClientRect(),v=g.clientX-m.left,b=g.clientY-m.top;this._dragStartLngLat=this._minimapMap.unproject([v,b]),l=this._map.getCenter()},u=g=>{if(!this._isDragging||!this._minimapMap||!this._map||!this._dragStartLngLat||!l)return;if(o&&!a){const T=g.clientX-o.x,R=g.clientY-o.y;(Math.abs(T)>3||Math.abs(R)>3)&&(a=!0)}if(!a)return;const m=r.getBoundingClientRect(),v=g.clientX-m.left,b=g.clientY-m.top,w=this._minimapMap.unproject([v,b]),x=w.lng-this._dragStartLngLat.lng,I=w.lat-this._dragStartLngLat.lat;this._map.setCenter([l.lng+x,l.lat+I]),this._updateViewportRect()},d=g=>{if(this._isDragging&&!a&&this._minimapMap&&this._map){const m=r.getBoundingClientRect(),v=g.clientX-m.left,b=g.clientY-m.top,w=this._minimapMap.unproject([v,b]);this._map.flyTo({center:w})}this._isDragging=!1,a=!1,o=null,l=null,this._dragStartLngLat=void 0,r.style.cursor="pointer",this._syncMinimap(),this._updateViewportRect()};r.addEventListener("mousedown",h),document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),this._dragCleanup=()=>{r.removeEventListener("mousedown",h),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d)}}}_hidePanel(){this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=void 0),this._isDragging=!1,this._dragStartLngLat=void 0,this._minimapMap&&(this._minimapMap.remove(),this._minimapMap=void 0),this._map&&this._handleMove&&(this._map.off("move",this._handleMove),this._handleMove=void 0),this._panel&&(this._panel.remove(),this._panel=void 0)}_syncMinimap(){if(!this._minimapMap||!this._map)return;const e=this._map.getCenter(),t=Math.max(0,this._map.getZoom()+this._options.zoomOffset);this._minimapMap.jumpTo({center:e,zoom:t})}_addViewportRect(){this._minimapMap&&(this._minimapMap.addSource(Ix,{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[]]},properties:{}}}),this._minimapMap.addLayer({id:Ede,type:"fill",source:Ix,paint:{"fill-color":this._options.viewportRectColor,"fill-opacity":this._options.viewportRectOpacity}}),this._minimapMap.addLayer({id:Cde,type:"line",source:Ix,paint:{"line-color":this._options.viewportRectColor,"line-width":2}}))}_updateViewportRect(){if(!this._minimapMap||!this._map)return;const e=this._minimapMap.getSource(Ix);if(!e||!("setData"in e))return;const t=this._map.getBounds(),n=t.getSouthWest(),s=t.getNorthEast(),r=t.getNorthWest(),o=t.getSouthEast(),a=[[n.lng,n.lat],[o.lng,o.lat],[s.lng,s.lat],[r.lng,r.lat],[n.lng,n.lat]];e.setData({type:"Feature",geometry:{type:"Polygon",coordinates:[a]},properties:{}})}_checkZoomVisibility(){if(!this._map||!this._container)return;const e=this._map.getZoom(),t=this._zoomVisible;this._zoomVisible=e>=this._options.minzoom&&e<=this._options.maxzoom,t!==this._zoomVisible&&(this._container.style.display=this._zoomVisible&&this._state.visible?"":"none")}show(){return this._state.visible=!0,this._container&&(this._container.style.display=this._zoomVisible?"":"none"),this._emit("show"),this}hide(){return this._state.visible=!1,this._container&&(this._container.style.display="none"),this._emit("hide"),this}expand(){return this._state.collapsed?(this._state.collapsed=!1,this._showPanel(),this._emit("expand"),this):this}collapse(){return this._state.collapsed?this:(this._state.collapsed=!0,this._hidePanel(),this._emit("collapse"),this)}toggle(){return this._state.collapsed?this.expand():this.collapse()}getState(){return{...this._state}}}const Sde={position:"top-right",className:"",visible:!0,collapsed:!0,defaultMode:"distance",distanceUnit:"kilometers",areaUnit:"square-kilometers",lineColor:"#3b82f6",lineWidth:3,fillColor:"rgba(59, 130, 246, 0.2)",pointColor:"#ef4444",pointRadius:6,showSegments:!0,showTotal:!0,precision:2,panelWidth:240,maxHeight:500,backgroundColor:"rgba(255, 255, 255, 0.95)",borderRadius:4,opacity:1,fontSize:12,fontColor:"#333",minzoom:0,maxzoom:24},cF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"/><path d="m14.5 12.5 2-2"/><path d="m11.5 9.5 2-2"/><path d="m8.5 6.5 2-2"/><path d="m17.5 15.5 2-2"/></svg>',hF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3v4l-4 0"/><path d="M4 7l16 14"/><path d="M16 21v-4l4 0"/></svg>',uF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>',dF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',Ide='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>',Xf={meters:{label:"Meters",factor:1},kilometers:{label:"Kilometers",factor:.001},miles:{label:"Miles",factor:621371e-9},feet:{label:"Feet",factor:3.28084},yards:{label:"Yards",factor:1.09361},"nautical-miles":{label:"Nautical Miles",factor:539957e-9}},zg={"square-meters":{label:"Square Meters",factor:1},"square-kilometers":{label:"Square Kilometers",factor:1e-6},"square-miles":{label:"Square Miles",factor:3861e-10},hectares:{label:"Hectares",factor:1e-4},acres:{label:"Acres",factor:247105e-9},"square-feet":{label:"Square Feet",factor:10.7639}};function Mde(i,e){const n=i.lat*Math.PI/180,s=e.lat*Math.PI/180,r=(e.lat-i.lat)*Math.PI/180,o=(e.lng-i.lng)*Math.PI/180,a=Math.sin(r/2)*Math.sin(r/2)+Math.cos(n)*Math.cos(s)*Math.sin(o/2)*Math.sin(o/2);return 6371e3*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}function Tde(i){if(i.length<3)return 0;const e=6371e3;let t=0;for(let n=0;n<i.length;n++){const s=(n+1)%i.length,r=i[n].lat*Math.PI/180,o=i[s].lat*Math.PI/180,a=i[n].lng*Math.PI/180,l=i[s].lng*Math.PI/180;t+=(l-a)*(2+Math.sin(r)+Math.sin(o))}return t=Math.abs(t*e*e/2),t}class dQ{_container;_button;_panel;_options;_state;_eventHandlers=new Map;_map;_handleZoom;_zoomVisible=!0;_sourceId;_lineLayerId;_fillLayerId;_resultValueEl;_resultUnitEl;_segmentListEl;_instructionsEl;_measurementsListEl;_boundClickHandler;_boundMoveHandler;_boundDblClickHandler;_boundKeyHandler;_markers=[];constructor(e){this._options={...Sde,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed,mode:this._options.defaultMode,distanceUnit:this._options.distanceUnit,areaUnit:this._options.areaUnit,isDrawing:!1,currentPoints:[],currentValue:0,currentSegments:[],measurements:[]};const t=$u("measure");this._sourceId=`${t}-source`,this._lineLayerId=`${t}-line`,this._fillLayerId=`${t}-fill`}onAdd(e){return this._map=e,this._container=this._createContainer(),e.isStyleLoaded()?this._setupMapSources():e.once("styledata",()=>this._setupMapSources()),this._setupZoomHandler(),this._state.collapsed||this._showPanel(),this._container}onRemove(){this._stopDrawing(),this._cleanupMapSources(),this._clearMarkers(),this._handleZoom&&this._map&&this._map.off("zoom",this._handleZoom),this._container?.remove(),this._container=void 0,this._map=void 0}getDefaultPosition(){return this._options.position}on(e,t){return this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t),this}off(e,t){return this._eventHandlers.get(e)?.delete(t),this}_emit(e,t){const n=this._eventHandlers.get(e);if(n){const s={type:e,state:{...this._state},...t};n.forEach(r=>r(s))}}_createContainer(){const e=document.createElement("div");return e.className=`maplibregl-ctrl maplibre-gl-measure-control ${this._options.className}`,e.style.opacity=String(this._options.opacity),this._state.visible||(e.style.display="none"),this._button=document.createElement("button"),this._button.type="button",this._button.className="measure-button",this._button.title="Measure distances and areas",this._button.innerHTML=cF,this._button.addEventListener("click",()=>this._togglePanel()),e.appendChild(this._button),e}_createPanel(){const e=document.createElement("div");e.className=`measure-panel ${this._options.position.includes("left")?"right":"left"}`,e.style.width=`${this._options.panelWidth}px`,this._options.maxHeight&&this._options.maxHeight>0&&(e.style.maxHeight=`${this._options.maxHeight}px`,e.style.overflowY="auto"),e.style.background=this._options.backgroundColor,e.style.borderRadius=`${this._options.borderRadius}px`,e.style.fontSize=`${this._options.fontSize}px`,e.style.color=this._options.fontColor;const t=document.createElement("div");t.className="measure-header",t.innerHTML=`
|
|
106
|
+
`},uniformTypes:{minVal:"f32",maxVal:"f32",isSingleBand:"f32"},getUniforms:i=>({minVal:i.minVal,maxVal:i.maxVal,isSingleBand:i.isSingleBand})};function hQ(i,e){return i&&(Array.isArray(i)?i.map(t=>hQ(t,e)):typeof i.clone=="function"?i.clone({opacity:e}):i)}function _de(i){let e=i.replace("#","");return e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function Ade(i){const t=new Uint8ClampedArray(1024),n=i.map(s=>({pos:s.position,rgb:_de(s.color)}));for(let s=0;s<256;s++){const r=s/255;let o=n[0],a=n[n.length-1];for(let u=0;u<n.length-1;u++)if(r>=n[u].pos&&r<=n[u+1].pos){o=n[u],a=n[u+1];break}const l=a.pos-o.pos,h=l>0?(r-o.pos)/l:0;t[s*4]=o.rgb[0]+(a.rgb[0]-o.rgb[0])*h,t[s*4+1]=o.rgb[1]+(a.rgb[1]-o.rgb[1])*h,t[s*4+2]=o.rgb[2]+(a.rgb[2]-o.rgb[2])*h,t[s*4+3]=255}return new ImageData(t,256,1)}const yde=["none","bone","bwr","cividis","cool","coolwarm","gray","hot","inferno","jet","magma","ocean","plasma","rainbow","RdBu","RdYlBu","RdYlGn","seismic","spectral","terrain","turbo","viridis"],vde={position:"top-right",className:"",visible:!0,collapsed:!0,beforeId:"",defaultUrl:"",loadDefaultUrl:!1,defaultBands:"1",defaultColormap:"none",defaultRescaleMin:0,defaultRescaleMax:255,defaultNodata:0,defaultLayerName:"",defaultOpacity:1,defaultPickable:!0,panelWidth:300,maxHeight:500,backgroundColor:"rgba(255, 255, 255, 0.95)",borderRadius:4,opacity:1,fontSize:13,fontColor:"#333",minzoom:0,maxzoom:24},bde='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>';class k3{_container;_button;_panel;_options;_state;_eventHandlers=new Map;_map;_handleZoom;_zoomVisible=!0;_deckOverlay;_cogLayers=new Map;_cogLayerPropsMap=new Map;_layerCounter=0;_activePopup;_mapClickHandler;constructor(e){this._options={...vde,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed,url:this._options.defaultUrl,bands:this._options.defaultBands,colormap:this._options.defaultColormap,rescaleMin:this._options.defaultRescaleMin,rescaleMax:this._options.defaultRescaleMax,nodata:this._options.defaultNodata,layerName:this._options.defaultLayerName,layerOpacity:this._options.defaultOpacity,pickable:this._options.defaultPickable,hasLayer:!1,layerCount:0,layers:[],loading:!1,error:null,status:null}}onAdd(e){if(this._map=e,this._container=this._createContainer(),this._render(),this._handleZoom=()=>this._checkZoomVisibility(),this._map.on("zoom",this._handleZoom),this._checkZoomVisibility(),this._setupClickHandler(),this._options.loadDefaultUrl&&this._options.defaultUrl){const t=()=>{this._addLayer()};this._map.isStyleLoaded()?setTimeout(t,100):this._map.once("idle",t)}return this._container}onRemove(){if(this._removeLayer(),this._map&&this._handleZoom&&(this._map.off("zoom",this._handleZoom),this._handleZoom=void 0),this._map&&this._mapClickHandler&&(this._map.off("click",this._mapClickHandler),this._mapClickHandler=void 0),this._activePopup&&(this._activePopup.remove(),this._activePopup=void 0),this._deckOverlay&&this._map){try{this._map.removeControl(this._deckOverlay)}catch{}this._deckOverlay=void 0}this._map=void 0,this._container?.parentNode?.removeChild(this._container),this._container=void 0,this._button=void 0,this._panel=void 0,this._eventHandlers.clear()}show(){this._state.visible||(this._state.visible=!0,this._updateDisplayState(),this._emit("show"))}hide(){this._state.visible&&(this._state.visible=!1,this._updateDisplayState(),this._emit("hide"))}expand(){this._state.collapsed&&(this._state.collapsed=!1,this._render(),this._emit("expand"))}collapse(){this._state.collapsed||(this._state.collapsed=!0,this._render(),this._emit("collapse"))}toggle(){this._state.collapsed?this.expand():this.collapse()}getState(){return{...this._state}}update(e){this._options={...this._options,...e},e.visible!==void 0&&(this._state.visible=e.visible),e.collapsed!==void 0&&(this._state.collapsed=e.collapsed),this._render(),this._emit("update")}on(e,t){this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t)}off(e,t){this._eventHandlers.get(e)?.delete(t)}async addLayer(e){e&&(this._state.url=e),await this._addLayer()}removeLayer(e){this._removeLayer(e),this._render()}getLayerIds(){return Array.from(this._cogLayers.keys())}getLayerOpacity(e){const t=this._cogLayers.get(e);return!t||!t.props?null:t.props.opacity??1}setLayerOpacity(e,t){const n=this._cogLayers.get(e);if(!n||typeof n.clone!="function")return;const s=Math.max(0,Math.min(1,t)),r=n.clone({opacity:s});this._cogLayers.set(e,r),this._deckOverlay&&this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._map&&this._map.triggerRepaint()}getLayerVisibility(e){const t=this.getLayerOpacity(e);return t!==null&&t>0}setLayerVisibility(e,t,n=1){t?this.setLayerOpacity(e,n):this.setLayerOpacity(e,0)}getLayerUrl(e){return this._cogLayerPropsMap.get(e)?.geotiff??null}_emit(e,t){const n=this._eventHandlers.get(e);if(n){const s={type:e,state:this.getState(),...t};n.forEach(r=>r(s))}}_checkZoomVisibility(){if(!this._map)return;const e=this._map.getZoom(),{minzoom:t,maxzoom:n}=this._options,s=e>=t&&e<=n;s!==this._zoomVisible&&(this._zoomVisible=s,this._updateDisplayState())}_updateDisplayState(){if(!this._container)return;const e=this._state.visible&&this._zoomVisible;this._container.style.display=e?"block":"none"}_createContainer(){const e=document.createElement("div");return e.className=`maplibregl-ctrl maplibre-gl-cog-layer${this._options.className?` ${this._options.className}`:""}`,this._state.visible&&this._zoomVisible||(e.style.display="none"),Object.assign(e.style,{backgroundColor:this._options.backgroundColor,borderRadius:`${this._options.borderRadius}px`,boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.1)"}),this._options.opacity!==1&&(e.style.opacity=String(this._options.opacity)),e}_render(){if(!this._container)return;const e=this._container.querySelector(".maplibre-gl-cog-layer-panel"),t=e?e.scrollTop:0;if(this._container.innerHTML="",this._state.collapsed?this._renderCollapsed():this._renderExpanded(),this._updateDisplayState(),t>0){const n=this._container.querySelector(".maplibre-gl-cog-layer-panel");n&&(n.scrollTop=t)}}_renderCollapsed(){this._container&&(this._button=document.createElement("button"),this._button.type="button",this._button.className=`maplibre-gl-cog-layer-button${this._state.hasLayer?" maplibre-gl-cog-layer-button--active":""}`,this._button.title="COG Layer",this._button.setAttribute("aria-label","COG Layer"),this._button.innerHTML=bde,this._button.addEventListener("click",()=>this.expand()),this._container.appendChild(this._button),this._panel=void 0)}_renderExpanded(){if(!this._container)return;const e=document.createElement("div");e.className="maplibre-gl-cog-layer-panel",e.style.width=`${this._options.panelWidth}px`,this._options.maxHeight&&this._options.maxHeight>0&&(e.style.maxHeight=`${this._options.maxHeight}px`,e.style.overflowY="auto"),this._panel=e;const t=document.createElement("div");t.className="maplibre-gl-cog-layer-header";const n=document.createElement("span");n.className="maplibre-gl-cog-layer-title",n.textContent="COG Layer",t.appendChild(n);const s=document.createElement("button");s.className="maplibre-gl-cog-layer-close",s.innerHTML="×",s.title="Close",s.addEventListener("click",()=>this.collapse()),t.appendChild(s),e.appendChild(t);const r=this._createFormGroup("COG URL","url"),o=document.createElement("input");o.type="text",o.className="maplibre-gl-cog-layer-input",o.style.color="#000",o.placeholder="https://example.com/cog.tif",o.value=this._state.url,o.addEventListener("input",()=>{this._state.url=o.value}),r.appendChild(o),e.appendChild(r);const a=this._createFormGroup("Bands (comma-separated)","bands"),l=document.createElement("input");l.type="text",l.className="maplibre-gl-cog-layer-input",l.style.color="#000",l.placeholder="1 or 1,2,3",l.value=this._state.bands,l.addEventListener("input",()=>{this._state.bands=l.value}),a.appendChild(l),e.appendChild(a);const h=this._createFormGroup("Colormap","colormap"),u=document.createElement("select");u.className="maplibre-gl-cog-layer-select",u.style.color="#000";for(const W of yde){const q=document.createElement("option");q.value=W,q.textContent=W,W===this._state.colormap&&(q.selected=!0),u.appendChild(q)}u.addEventListener("change",()=>{this._state.colormap=u.value,this._updateColormapPreview()}),h.appendChild(u);const d=document.createElement("div");d.className="maplibre-gl-cog-layer-colormap-preview",d.id="cog-colormap-preview",this._updateColormapPreviewElement(d),h.appendChild(d),e.appendChild(h);const g=document.createElement("div");g.className="maplibre-gl-cog-layer-row";const m=this._createFormGroup("Rescale Min","rescale-min"),v=document.createElement("input");v.type="number",v.className="maplibre-gl-cog-layer-input",v.style.color="#000",v.value=String(this._state.rescaleMin),v.addEventListener("input",()=>{this._state.rescaleMin=Number(v.value)||0}),m.appendChild(v),g.appendChild(m);const b=this._createFormGroup("Rescale Max","rescale-max"),w=document.createElement("input");w.type="number",w.className="maplibre-gl-cog-layer-input",w.style.color="#000",w.value=String(this._state.rescaleMax),w.addEventListener("input",()=>{this._state.rescaleMax=Number(w.value)||0}),b.appendChild(w),g.appendChild(b),e.appendChild(g);const x=this._createFormGroup("Nodata","nodata"),I=document.createElement("input");I.type="number",I.className="maplibre-gl-cog-layer-input",I.style.color="#000",I.placeholder="e.g. 0 or -9999",I.value=this._state.nodata!==void 0?String(this._state.nodata):"",I.addEventListener("input",()=>{this._state.nodata=I.value!==""?Number(I.value):void 0}),x.appendChild(I),e.appendChild(x);const T=this._createFormGroup("Opacity","opacity"),R=document.createElement("div");R.className="maplibre-gl-cog-layer-slider-row";const F=document.createElement("input");F.type="range",F.className="maplibre-gl-cog-layer-slider",F.min="0",F.max="100",F.value=String(Math.round(this._state.layerOpacity*100));const z=document.createElement("span");z.className="maplibre-gl-cog-layer-slider-value",z.textContent=`${Math.round(this._state.layerOpacity*100)}%`,F.addEventListener("input",()=>{const W=Number(F.value);this._state.layerOpacity=W/100,z.textContent=`${W}%`,this._updateOpacity()}),R.appendChild(F),R.appendChild(z),T.appendChild(R),e.appendChild(T);const U=document.createElement("div");U.className="maplibre-gl-cog-layer-form-group maplibre-gl-cog-layer-checkbox-group";const N=document.createElement("label");N.className="maplibre-gl-cog-layer-checkbox-label";const L=document.createElement("input");L.type="checkbox",L.className="maplibre-gl-cog-layer-checkbox",L.checked=this._state.pickable,L.addEventListener("change",()=>{this._state.pickable=L.checked,this._updatePickable()}),N.appendChild(L);const k=document.createElement("span");k.textContent="Pickable (click to show pixel value)",N.appendChild(k),U.appendChild(N),e.appendChild(U);const D=this._createFormGroup("Layer Name","layer-name"),Y=document.createElement("input");Y.type="text",Y.className="maplibre-gl-cog-layer-input",Y.style.color="#000",Y.placeholder="Optional custom layer name",Y.value=this._state.layerName,Y.addEventListener("input",()=>{this._state.layerName=Y.value}),D.appendChild(Y),e.appendChild(D);const Z=this._createFormGroup("Before Layer ID (optional)","before-id"),j=document.createElement("input");j.type="text",j.className="maplibre-gl-cog-layer-input",j.style.color="#000",j.placeholder="e.g. labels or water",j.value=this._options.beforeId||"",j.addEventListener("input",()=>{this._options.beforeId=j.value||""}),Z.appendChild(j),e.appendChild(Z);const Q=document.createElement("div");Q.className="maplibre-gl-cog-layer-buttons";const $=document.createElement("button");if($.className="maplibre-gl-cog-layer-btn maplibre-gl-cog-layer-btn--primary",$.textContent="Add Layer",$.disabled=this._state.loading,$.addEventListener("click",()=>this._addLayer()),Q.appendChild($),e.appendChild(Q),this._state.loading?this._appendStatus("Loading COG...","info"):this._state.error?this._appendStatus(this._state.error,"error"):this._state.status&&this._appendStatus(this._state.status,"success"),this._cogLayers.size>0){const W=document.createElement("div");W.className="maplibre-gl-cog-layer-list";const q=document.createElement("div");q.className="maplibre-gl-cog-layer-list-header",q.textContent=`Layers (${this._cogLayers.size})`,W.appendChild(q);for(const[ee]of this._cogLayers){const ne=this._cogLayerPropsMap.get(ee);if(!ne)continue;const oe=document.createElement("div");oe.className="maplibre-gl-cog-layer-list-item";const ue=document.createElement("span");ue.className="maplibre-gl-cog-layer-list-label";const pe=ne.geotiff,ae=ne._layerName;let ye;if(ae)ye=ae;else try{ye=new URL(pe).pathname.split("/").pop()||pe}catch{ye=pe}ue.textContent=ye,ue.title=pe,oe.appendChild(ue);const Me=document.createElement("button");Me.className="maplibre-gl-cog-layer-list-remove",Me.innerHTML="×",Me.title="Remove layer",Me.addEventListener("click",()=>{this._removeLayer(ee),this._render()}),oe.appendChild(Me),W.appendChild(oe)}e.appendChild(W)}this._container.appendChild(e),this._button=void 0}_createFormGroup(e,t){const n=document.createElement("div");n.className="maplibre-gl-cog-layer-form-group";const s=document.createElement("label");return s.textContent=e,s.htmlFor=`cog-layer-${t}`,n.appendChild(s),n}_appendStatus(e,t){if(!this._panel)return;const n=document.createElement("div");n.className=`maplibre-gl-cog-layer-status maplibre-gl-cog-layer-status--${t}`,n.textContent=e,this._panel.appendChild(n)}_updateColormapPreview(){const e=document.getElementById("cog-colormap-preview");e&&this._updateColormapPreviewElement(e)}_updateColormapPreviewElement(e){if(this._state.colormap==="none")e.style.background="linear-gradient(to right, #888, #888)",e.style.display="none";else{const n=Pu(this._state.colormap).map(s=>s.color).join(", ");e.style.background=`linear-gradient(to right, ${n})`,e.style.display="block"}}async _ensureOverlay(){if(this._deckOverlay||!this._map)return;const{MapboxOverlay:e}=await Promise.resolve().then(()=>require("./index-C8CBe27l.cjs"));this._deckOverlay=new e({interleaved:!!this._options.beforeId,layers:[]}),this._map.addControl(this._deckOverlay)}_setupClickHandler(){if(!this._map||this._mapClickHandler)return;const e=this._map;this._mapClickHandler=t=>{if(!this._state.pickable||this._cogLayers.size===0)return;this._activePopup&&this._activePopup.remove();const{lngLat:n}=t,s=Array.from(this._cogLayers.keys()),r=this._cogLayerPropsMap.get(s[0]);let o='<div class="maplibre-gl-cog-layer-popup">';o+='<table class="maplibre-gl-cog-layer-popup-table">',o+=`<tr><td><strong>Layers</strong></td><td>${s.length} COG layer(s)</td></tr>`,o+=`<tr><td><strong>Lng</strong></td><td>${n.lng.toFixed(6)}</td></tr>`,o+=`<tr><td><strong>Lat</strong></td><td>${n.lat.toFixed(6)}</td></tr>`,r&&(o+=`<tr><td><strong>Rescale</strong></td><td>${r._rescaleMin} - ${r._rescaleMax}</td></tr>`,r._colormap&&r._colormap!=="none"&&(o+=`<tr><td><strong>Colormap</strong></td><td>${r._colormap}</td></tr>`)),o+="</table>",o+="</div>",this._activePopup=new Dr.Popup({closeButton:!0,maxWidth:"280px"}).setLngLat(n).setHTML(o).addTo(e);const a=this._activePopup.getElement();a&&(a.style.zIndex="1000")},e.on("click",this._mapClickHandler)}_updatePickable(){if(this._deckOverlay){for(const[,e]of this._cogLayerPropsMap)e.pickable=this._state.pickable;this._rebuildLayers()}}async _rebuildLayers(){if(this._deckOverlay)try{const{COGLayer:e}=await Promise.resolve().then(()=>require("./index-rhQrpZSD.cjs"));this._patchCOGLayerForFloat(e),this._patchCOGLayerForOpacity(e);const t=[];for(const[n,s]of this._cogLayerPropsMap){const r=new e(s);this._cogLayers.set(n,r),t.push(r)}this._deckOverlay.setProps({layers:t})}catch(e){console.error("Failed to rebuild layers:",e)}}async _registerCommonProjections(e){e.defs("EPSG:3978","+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +type=crs"),e.defs("EPSG:3979","+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=-0.991,1.9072,0.5129,-1.25033e-07,-4.6785e-08,-5.6529e-08,0 +units=m +no_defs +type=crs")}_buildGeoKeysParser(e){let t=null;return Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs")).then(n=>{t=n.default||n,typeof t=="function"&&this._registerCommonProjections(t)}),async n=>{try{const s=e.toProj4(n);if(s&&s.proj4){let r=s.proj4;if(r=r.replace(/\+axis=\w+\s*/g,""),!t){const a=await Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs"));t=a.default||a,typeof t=="function"&&await this._registerCommonProjections(t)}let o={};if(typeof t=="function")try{t.defs("custom",r),o=t.defs("custom")||{}}catch{}return{def:r,parsed:o,coordinatesUnits:s.coordinatesUnits||"metre"}}}catch{}return null}}_patchCOGLayerForFloat(e){if(e.__floatPatched)return;e.__floatPatched=!0;const t=e.prototype._parseGeoTIFF;e.prototype._parseGeoTIFF=async function(){try{await t.call(this);const n=this.props._nodata;if(n!=null&&!isNaN(n)){const{FilterNoDataVal:s}=await Promise.resolve().then(()=>require("./index-B-Nr9y7J.cjs")),r=this.state.defaultRenderTile;if(typeof r=="function"){const o=a=>{const h=r(a).filter(u=>u.module!==s);return h.splice(1,0,{module:s,props:{value:n}}),h};this.setState({defaultRenderTile:o})}}}catch(n){if(!(n instanceof Error?n.message:String(n)).includes("non-unsigned integers not yet supported"))throw n;const{fromUrl:r}=await Promise.resolve().then(()=>require("./geotiff-C-MHEjS3.cjs")).then(ee=>ee.geotiff),{parseCOGTileMatrixSet:o,texture:a}=await Promise.resolve().then(()=>require("./index-rhQrpZSD.cjs")),{CreateTexture:l,FilterNoDataVal:h}=await Promise.resolve().then(()=>require("./index-B-Nr9y7J.cjs")),u=await Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs")),d=u.default||u,g=this.props.geotiff,m=typeof g=="string"?await r(g):g,v=this.props.geoKeysParser,b=await o(m,v),w=await m.getImage(),x=await m.getImageCount(),I=[];for(let ee=0;ee<x;ee++)I.push(await m.getImage(ee));const T=await v(w.getGeoKeys());if(!T)throw new Error("Could not determine source projection from GeoTIFF geo keys");const R=d(T.def,"EPSG:4326"),F=(ee,ne)=>R.forward([ee,ne],!1),z=(ee,ne)=>R.inverse([ee,ne],!1);if(this.props.onGeoTIFFLoad){const ee=w.getBoundingBox(),ne=[R.forward([ee[0],ee[1]]),R.forward([ee[2],ee[1]]),R.forward([ee[2],ee[3]]),R.forward([ee[0],ee[3]])],oe=ne.map(ae=>ae[0]),ue=ne.map(ae=>ae[1]),pe={west:Math.min(...oe),south:Math.min(...ue),east:Math.max(...oe),north:Math.max(...ue)};this.props.onGeoTIFFLoad(m,{projection:T,geographicBounds:pe})}const U=w.getFileDirectory(),{BitsPerSample:N,SampleFormat:L,SamplesPerPixel:k,GDAL_NODATA:D}=U;let Y=null;if(D){const ee=D[D.length-1]==="\0"?D.slice(0,-1):D;ee.length>0&&(Y=parseFloat(ee))}const Z=async(ee,ne)=>{const{device:oe}=ne,ue=await ee.readRasters({...ne,interleave:!0});let pe=ue,ae=k;if(k===3){const Ne=ue.width*ue.height,me=new Float32Array(Ne*4);for(let Ke=0;Ke<Ne;Ke++)me[Ke*4]=ue[Ke*3],me[Ke*4+1]=ue[Ke*3+1],me[Ke*4+2]=ue[Ke*3+2],me[Ke*4+3]=1;pe=me,pe.width=ue.width,pe.height=ue.height,ae=4}const ye=a.inferTextureFormat(ae,N,L);return{texture:oe.createTexture({data:pe,format:ye,width:ue.width,height:ue.height,sampler:{magFilter:"nearest",minFilter:"nearest"}}),height:ue.height,width:ue.width}},j=this;let Q=null,$=null;const{Colormap:W}=await Promise.resolve().then(()=>require("./index-B-Nr9y7J.cjs")),q=ee=>{const ne=[{module:l,props:{textureName:ee.texture}}],oe=j.props._nodata!==void 0&&j.props._nodata!==null&&!isNaN(j.props._nodata)?j.props._nodata:Y;oe!==null&&ne.push({module:h,props:{value:oe}});const ue=j.props._rescaleMin??0,pe=j.props._rescaleMax??255;ne.push({module:mde,props:{minVal:ue,maxVal:pe,isSingleBand:k===1?1:0}});const ae=j.props._colormap;if(ae&&ae!=="none"){if(ae!==Q){const ye=Pu(ae),Me=Ade(ye);$=j.context.device.createTexture({data:Me.data,format:"rgba8unorm",width:Me.width,height:Me.height,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),Q=ae}ne.push({module:W,props:{colormapTexture:$}})}return ne};this.setState({metadata:b,forwardReproject:F,inverseReproject:z,images:I,defaultGetTileData:Z,defaultRenderTile:q})}}}_patchCOGLayerForOpacity(e){if(e.__opacityPatched)return;e.__opacityPatched=!0;const t=e.prototype._renderSubLayers;e.prototype._renderSubLayers=function(...n){const s=t.apply(this,n),r=this.props.opacity;return r==null?s:hQ(s,Math.max(0,Math.min(1,r)))}}async _addLayer(){if(!this._map||!this._state.url){this._state.error="Please enter a COG URL.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{await this._ensureOverlay();const{COGLayer:e}=await Promise.resolve().then(()=>require("./index-rhQrpZSD.cjs"));this._patchCOGLayerForFloat(e),this._patchCOGLayerForOpacity(e);const t=this._map,n={geotiff:this._state.url,opacity:this._state.layerOpacity,pickable:this._state.pickable,_rescaleMin:this._state.rescaleMin,_rescaleMax:this._state.rescaleMax,_colormap:this._state.colormap,_nodata:this._state.nodata,...(()=>{if(this._options.beforeId){if(t.getLayer(this._options.beforeId))return{beforeId:this._options.beforeId};console.warn(`[CogLayerControl] beforeId "${this._options.beforeId}" not found in map layers, adding layer on top`)}return{}})(),onGeoTIFFLoad:(a,l)=>{try{if(l&&l.geographicBounds){const{west:h,south:u,east:d,north:g}=l.geographicBounds;t.fitBounds([[h,u],[d,g]],{padding:50,duration:1e3})}}catch{}}};try{const a=await Promise.resolve().then(()=>require("./main-dist-Bymiy5aM.cjs")),l=a.default||a;l&&typeof l.toProj4=="function"&&(n.geoKeysParser=this._buildGeoKeysParser(l))}catch{}const s=`cog-layer-${this._layerCounter++}`;n.id=s;const r=this._state.layerName?.trim();r&&(n._layerName=r),this._cogLayerPropsMap.set(s,n);const o=new e(n);this._cogLayers.set(s,o),this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.layers=this._buildLayerInfoList(),this._state.loading=!1,this._state.status="COG layer added successfully.",this._state.layerName="",this._render(),this._emit("layeradd",{url:this._state.url,layerId:s})}catch(e){this._state.loading=!1,this._state.error=`Failed to load COG: ${e instanceof Error?e.message:String(e)}`,this._render(),this._emit("error",{error:this._state.error})}}_removeLayer(e){e?(this._cogLayers.delete(e),this._cogLayerPropsMap.delete(e),this._deckOverlay&&this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.layers=this._buildLayerInfoList(),this._state.status=null,this._state.error=null,this._emit("layerremove",{layerId:e})):(this._deckOverlay&&this._deckOverlay.setProps({layers:[]}),this._cogLayers.clear(),this._cogLayerPropsMap.clear(),this._state.hasLayer=!1,this._state.layerCount=0,this._state.layers=[],this._state.status=null,this._state.error=null,this._emit("layerremove"))}_updateOpacity(){if(!this._deckOverlay||this._cogLayers.size===0)return;const e=this._state.layerOpacity;for(const[t,n]of this._cogLayers)typeof n.clone=="function"&&this._cogLayers.set(t,n.clone({opacity:e}));this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._map&&this._map.triggerRepaint()}_buildLayerInfoList(){const e=[];for(const[t,n]of this._cogLayerPropsMap)e.push({id:t,name:n._layerName||void 0,url:n.geotiff,bands:"1",colormap:n._colormap||"none",rescaleMin:n._rescaleMin??0,rescaleMax:n._rescaleMax??255,nodata:n._nodata,opacity:n.opacity??1});return e}}const xde={position:"bottom-left",className:"",visible:!0,collapsed:!1,width:250,height:180,zoomOffset:-5,style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",viewportRectColor:"#0078d7",viewportRectOpacity:.2,toggleable:!0,interactive:!1,minzoom:0,maxzoom:24},wde='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><rect x="7" y="7" width="10" height="10" rx="1" stroke-dasharray="2 2"/></svg>',Ix="maplibre-minimap-viewport",Ede="maplibre-minimap-viewport-fill",Cde="maplibre-minimap-viewport-line";class uQ{_container;_button;_panel;_options;_state;_eventHandlers=new Map;_map;_minimapMap;_handleMove;_handleZoom;_zoomVisible=!0;_isDragging=!1;_dragStartLngLat;_dragCleanup;constructor(e){this._options={...xde,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed}}getDefaultPosition(){return this._options.position}onAdd(e){return this._map=e,this._container=this._createContainer(),this._handleZoom=()=>this._checkZoomVisibility(),this._map.on("zoom",this._handleZoom),this._state.collapsed||this._showPanel(),this._state.visible||(this._container.style.display="none"),this._container}onRemove(){this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=void 0),this._isDragging=!1,this._dragStartLngLat=void 0,this._minimapMap&&(this._minimapMap.remove(),this._minimapMap=void 0),this._map&&this._handleMove&&this._map.off("move",this._handleMove),this._map&&this._handleZoom&&this._map.off("zoom",this._handleZoom),this._container?.parentNode&&this._container.parentNode.removeChild(this._container),this._container=void 0,this._button=void 0,this._panel=void 0,this._map=void 0}on(e,t){return this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t),this}off(e,t){return this._eventHandlers.get(e)?.delete(t),this}_emit(e){const t=this._eventHandlers.get(e);if(t){const n={type:e,state:this.getState()};t.forEach(s=>s(n))}}_createContainer(){const e=document.createElement("div");return e.classList.add("maplibregl-ctrl","maplibre-gl-minimap-control"),this._options.className&&e.classList.add(this._options.className),this._options.toggleable&&(this._button=document.createElement("button"),this._button.type="button",this._button.className="minimap-button",this._button.title="Toggle minimap",this._button.innerHTML=wde,this._button.addEventListener("click",()=>this.toggle()),e.appendChild(this._button)),e}_showPanel(){if(!this._container||!this._map||this._panel)return;this._panel=document.createElement("div"),this._panel.className="minimap-panel",this._panel.style.width=`${this._options.width}px`,this._panel.style.height=`${this._options.height}px`;const e=document.createElement("div");e.className="minimap-map",this._panel.appendChild(e),this._container.appendChild(this._panel);const t=this._map.getCenter(),n=this._map.getZoom(),s=Math.max(0,n+this._options.zoomOffset);if(this._minimapMap=new Dr.Map({container:e,style:this._options.style,center:t,zoom:s,interactive:!1,attributionControl:!1}),this._minimapMap.on("load",()=>{this._addViewportRect(),this._updateViewportRect()}),this._handleMove=()=>{this._isDragging||(this._syncMinimap(),this._updateViewportRect())},this._map.on("move",this._handleMove),this._options.interactive&&this._minimapMap){const r=this._minimapMap._canvas;r.style.cursor="pointer";let o=null,a=!1,l=null;const h=g=>{if(!this._minimapMap||!this._map)return;g.preventDefault(),this._isDragging=!0,a=!1,o={x:g.clientX,y:g.clientY},r.style.cursor="grabbing";const m=r.getBoundingClientRect(),v=g.clientX-m.left,b=g.clientY-m.top;this._dragStartLngLat=this._minimapMap.unproject([v,b]),l=this._map.getCenter()},u=g=>{if(!this._isDragging||!this._minimapMap||!this._map||!this._dragStartLngLat||!l)return;if(o&&!a){const T=g.clientX-o.x,R=g.clientY-o.y;(Math.abs(T)>3||Math.abs(R)>3)&&(a=!0)}if(!a)return;const m=r.getBoundingClientRect(),v=g.clientX-m.left,b=g.clientY-m.top,w=this._minimapMap.unproject([v,b]),x=w.lng-this._dragStartLngLat.lng,I=w.lat-this._dragStartLngLat.lat;this._map.setCenter([l.lng+x,l.lat+I]),this._updateViewportRect()},d=g=>{if(this._isDragging&&!a&&this._minimapMap&&this._map){const m=r.getBoundingClientRect(),v=g.clientX-m.left,b=g.clientY-m.top,w=this._minimapMap.unproject([v,b]);this._map.flyTo({center:w})}this._isDragging=!1,a=!1,o=null,l=null,this._dragStartLngLat=void 0,r.style.cursor="pointer",this._syncMinimap(),this._updateViewportRect()};r.addEventListener("mousedown",h),document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),this._dragCleanup=()=>{r.removeEventListener("mousedown",h),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d)}}}_hidePanel(){this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=void 0),this._isDragging=!1,this._dragStartLngLat=void 0,this._minimapMap&&(this._minimapMap.remove(),this._minimapMap=void 0),this._map&&this._handleMove&&(this._map.off("move",this._handleMove),this._handleMove=void 0),this._panel&&(this._panel.remove(),this._panel=void 0)}_syncMinimap(){if(!this._minimapMap||!this._map)return;const e=this._map.getCenter(),t=Math.max(0,this._map.getZoom()+this._options.zoomOffset);this._minimapMap.jumpTo({center:e,zoom:t})}_addViewportRect(){this._minimapMap&&(this._minimapMap.addSource(Ix,{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[]]},properties:{}}}),this._minimapMap.addLayer({id:Ede,type:"fill",source:Ix,paint:{"fill-color":this._options.viewportRectColor,"fill-opacity":this._options.viewportRectOpacity}}),this._minimapMap.addLayer({id:Cde,type:"line",source:Ix,paint:{"line-color":this._options.viewportRectColor,"line-width":2}}))}_updateViewportRect(){if(!this._minimapMap||!this._map)return;const e=this._minimapMap.getSource(Ix);if(!e||!("setData"in e))return;const t=this._map.getBounds(),n=t.getSouthWest(),s=t.getNorthEast(),r=t.getNorthWest(),o=t.getSouthEast(),a=[[n.lng,n.lat],[o.lng,o.lat],[s.lng,s.lat],[r.lng,r.lat],[n.lng,n.lat]];e.setData({type:"Feature",geometry:{type:"Polygon",coordinates:[a]},properties:{}})}_checkZoomVisibility(){if(!this._map||!this._container)return;const e=this._map.getZoom(),t=this._zoomVisible;this._zoomVisible=e>=this._options.minzoom&&e<=this._options.maxzoom,t!==this._zoomVisible&&(this._container.style.display=this._zoomVisible&&this._state.visible?"":"none")}show(){return this._state.visible=!0,this._container&&(this._container.style.display=this._zoomVisible?"":"none"),this._emit("show"),this}hide(){return this._state.visible=!1,this._container&&(this._container.style.display="none"),this._emit("hide"),this}expand(){return this._state.collapsed?(this._state.collapsed=!1,this._showPanel(),this._emit("expand"),this):this}collapse(){return this._state.collapsed?this:(this._state.collapsed=!0,this._hidePanel(),this._emit("collapse"),this)}toggle(){return this._state.collapsed?this.expand():this.collapse()}getState(){return{...this._state}}}const Sde={position:"top-right",className:"",visible:!0,collapsed:!0,defaultMode:"distance",distanceUnit:"kilometers",areaUnit:"square-kilometers",lineColor:"#3b82f6",lineWidth:3,fillColor:"rgba(59, 130, 246, 0.2)",pointColor:"#ef4444",pointRadius:6,showSegments:!0,showTotal:!0,precision:2,panelWidth:240,maxHeight:500,backgroundColor:"rgba(255, 255, 255, 0.95)",borderRadius:4,opacity:1,fontSize:12,fontColor:"#333",minzoom:0,maxzoom:24},cF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"/><path d="m14.5 12.5 2-2"/><path d="m11.5 9.5 2-2"/><path d="m8.5 6.5 2-2"/><path d="m17.5 15.5 2-2"/></svg>',hF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3v4l-4 0"/><path d="M4 7l16 14"/><path d="M16 21v-4l4 0"/></svg>',uF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>',dF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',Ide='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>',Xf={meters:{label:"Meters",factor:1},kilometers:{label:"Kilometers",factor:.001},miles:{label:"Miles",factor:621371e-9},feet:{label:"Feet",factor:3.28084},yards:{label:"Yards",factor:1.09361},"nautical-miles":{label:"Nautical Miles",factor:539957e-9}},zg={"square-meters":{label:"Square Meters",factor:1},"square-kilometers":{label:"Square Kilometers",factor:1e-6},"square-miles":{label:"Square Miles",factor:3861e-10},hectares:{label:"Hectares",factor:1e-4},acres:{label:"Acres",factor:247105e-9},"square-feet":{label:"Square Feet",factor:10.7639}};function Mde(i,e){const n=i.lat*Math.PI/180,s=e.lat*Math.PI/180,r=(e.lat-i.lat)*Math.PI/180,o=(e.lng-i.lng)*Math.PI/180,a=Math.sin(r/2)*Math.sin(r/2)+Math.cos(n)*Math.cos(s)*Math.sin(o/2)*Math.sin(o/2);return 6371e3*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}function Tde(i){if(i.length<3)return 0;const e=6371e3;let t=0;for(let n=0;n<i.length;n++){const s=(n+1)%i.length,r=i[n].lat*Math.PI/180,o=i[s].lat*Math.PI/180,a=i[n].lng*Math.PI/180,l=i[s].lng*Math.PI/180;t+=(l-a)*(2+Math.sin(r)+Math.sin(o))}return t=Math.abs(t*e*e/2),t}class dQ{_container;_button;_panel;_options;_state;_eventHandlers=new Map;_map;_handleZoom;_zoomVisible=!0;_sourceId;_lineLayerId;_fillLayerId;_resultValueEl;_resultUnitEl;_segmentListEl;_instructionsEl;_measurementsListEl;_boundClickHandler;_boundMoveHandler;_boundDblClickHandler;_boundKeyHandler;_markers=[];constructor(e){this._options={...Sde,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed,mode:this._options.defaultMode,distanceUnit:this._options.distanceUnit,areaUnit:this._options.areaUnit,isDrawing:!1,currentPoints:[],currentValue:0,currentSegments:[],measurements:[]};const t=$u("measure");this._sourceId=`${t}-source`,this._lineLayerId=`${t}-line`,this._fillLayerId=`${t}-fill`}onAdd(e){return this._map=e,this._container=this._createContainer(),e.isStyleLoaded()?this._setupMapSources():e.once("styledata",()=>this._setupMapSources()),this._setupZoomHandler(),this._state.collapsed||this._showPanel(),this._container}onRemove(){this._stopDrawing(),this._cleanupMapSources(),this._clearMarkers(),this._handleZoom&&this._map&&this._map.off("zoom",this._handleZoom),this._container?.remove(),this._container=void 0,this._map=void 0}getDefaultPosition(){return this._options.position}on(e,t){return this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t),this}off(e,t){return this._eventHandlers.get(e)?.delete(t),this}_emit(e,t){const n=this._eventHandlers.get(e);if(n){const s={type:e,state:{...this._state},...t};n.forEach(r=>r(s))}}_createContainer(){const e=document.createElement("div");return e.className=`maplibregl-ctrl maplibre-gl-measure-control ${this._options.className}`,e.style.opacity=String(this._options.opacity),this._state.visible||(e.style.display="none"),this._button=document.createElement("button"),this._button.type="button",this._button.className="measure-button",this._button.title="Measure distances and areas",this._button.innerHTML=cF,this._button.addEventListener("click",()=>this._togglePanel()),e.appendChild(this._button),e}_createPanel(){const e=document.createElement("div");e.className=`measure-panel ${this._options.position.includes("left")?"right":"left"}`,e.style.width=`${this._options.panelWidth}px`,this._options.maxHeight&&this._options.maxHeight>0&&(e.style.maxHeight=`${this._options.maxHeight}px`,e.style.overflowY="auto"),e.style.background=this._options.backgroundColor,e.style.borderRadius=`${this._options.borderRadius}px`,e.style.fontSize=`${this._options.fontSize}px`,e.style.color=this._options.fontColor;const t=document.createElement("div");t.className="measure-header",t.innerHTML=`
|
|
107
107
|
<span>Measure</span>
|
|
108
108
|
<button type="button" class="measure-close" title="Close">${dF}</button>
|
|
109
109
|
`,t.querySelector(".measure-close")?.addEventListener("click",()=>this._togglePanel()),e.appendChild(t);const n=document.createElement("div");n.className="measure-content";const s=document.createElement("div");s.className="measure-mode-toggle",s.innerHTML=`
|
|
@@ -223,12 +223,12 @@
|
|
|
223
223
|
</div>
|
|
224
224
|
<div><strong>Date:</strong> ${this._state.stacItem.properties?.datetime||"N/A"}</div>
|
|
225
225
|
<div><strong>Assets:</strong> ${this._state.assets.length} available</div>
|
|
226
|
-
`,e.appendChild(l)}if(this._cogLayers.size>0){const l=document.createElement("div");l.className="maplibre-gl-stac-layer-list";const h=document.createElement("div");h.className="maplibre-gl-stac-layer-list-header",h.textContent=`Layers (${this._cogLayers.size})`,l.appendChild(h);for(const[u]of this._cogLayers){const d=document.createElement("div");d.className="maplibre-gl-stac-layer-list-item";const g=document.createElement("span");g.className="maplibre-gl-stac-layer-list-label";const v=this._cogLayerPropsMap.get(u)?._layerName;g.textContent=v||u,g.title=u,d.appendChild(g);const b=document.createElement("button");b.className="maplibre-gl-stac-layer-list-remove",b.innerHTML="×",b.title="Remove layer",b.addEventListener("click",()=>{this._removeLayer(u),this._render()}),d.appendChild(b),l.appendChild(d)}e.appendChild(l)}this._container.appendChild(e),this._panel=e,this._button=void 0}_createFormGroup(e,t){const n=document.createElement("div");n.className="maplibre-gl-stac-layer-form-group";const s=document.createElement("label");return s.textContent=e,s.htmlFor=`stac-layer-${t}`,n.appendChild(s),n}_appendStatus(e,t,n){const s=document.createElement("div");s.className=`maplibre-gl-stac-layer-status maplibre-gl-stac-layer-status--${n}`,s.textContent=t,e.appendChild(s)}_autoSetRescale(){if(!this._state.selectedAsset)return;const e=this._state.assets.find(n=>n.key===this._state.selectedAsset);if(!e)return;const t=e.dataType?.toLowerCase();t==="uint16"?(this._state.rescaleMin=0,this._state.rescaleMax=1e4):t==="int16"?(this._state.rescaleMin=-32768,this._state.rescaleMax=32767):t==="float32"||t==="float64"?(this._state.rescaleMin=0,this._state.rescaleMax=1):t==="uint8"&&(this._state.rescaleMin=0,this._state.rescaleMax=255)}_updateColormapPreview(){const e=this._colormapPreview;if(!e)return;if(this._state.colormap==="none"){e.style.display="none";return}const t=Pu(this._state.colormap);if(t&&t.length>0){const n=t.map(s=>s.color).join(", ");e.style.background=`linear-gradient(to right, ${n})`,e.style.display="block"}else e.style.display="none"}async _fetchStacItem(){if(!this._state.stacUrl){this._state.error="Please enter a STAC item URL.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._state.stacItem=null,this._state.assets=[],this._state.selectedAsset=null,this._render();try{const e=await fetch(this._state.stacUrl);if(!e.ok)throw new Error(`Failed to fetch: ${e.status} ${e.statusText}`);const t=await e.text(),n=JSON.parse(t);if(n.type!=="Feature"||!n.assets)throw new Error("Invalid STAC item: missing 'type: Feature' or 'assets'");this._state.stacItem=n;const s=[],r=t.match(/"assets"\s*:\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/);if(r){const h=r[1].matchAll(/"([^"]+)"\s*:\s*\{/g);for(const u of h)s.push(u[1])}const o=s.length>0?s:Object.keys(n.assets),a=[];for(const l of o){const h=n.assets[l];if(!h)continue;const u=h;if(u.type?.includes("geotiff")||u.type?.includes("image/tiff")||u.href?.endsWith(".tif")||u.href?.endsWith(".tiff")){const d=u["raster:bands"]?.[0],g=u["eo:bands"]?.[0];a.push({key:l,href:u.href,type:u.type||"image/tiff",title:u.title||l,dataType:d?.data_type||u.data_type,nodata:d?.nodata??u.nodata,scale:d?.scale,offset:d?.offset,centerWavelength:g?.center_wavelength,commonName:g?.common_name})}}a.sort((l,h)=>l.centerWavelength!==void 0&&h.centerWavelength!==void 0?l.centerWavelength-h.centerWavelength:l.centerWavelength!==void 0?-1:h.centerWavelength!==void 0?1:0),this._state.assets=a,this._state.loading=!1,this._state.status=`Found ${a.length} COG asset(s)`,this._emit("stacload",{url:this._state.stacUrl})}catch(e){this._state.loading=!1,this._state.error=`Failed to load STAC: ${e instanceof Error?e.message:String(e)}`,this._emit("error",{error:this._state.error})}this._render()}async _ensureOverlay(){if(this._deckOverlay||!this._map)return;const{MapboxOverlay:e}=await Promise.resolve().then(()=>require("./index-CsAfY_en.cjs"));this._deckOverlay=new e({interleaved:!!this._options.beforeId,layers:[]}),this._map.addControl(this._deckOverlay)}_setupClickHandler(){if(!this._map||this._mapClickHandler)return;const e=this._map;this._mapClickHandler=t=>{if(!this._state.pickable||this._cogLayers.size===0)return;this._activePopup&&this._activePopup.remove();const{lngLat:n}=t,s=Array.from(this._cogLayers.keys()),r=this._cogLayerPropsMap.get(s[0]);let o='<div class="maplibre-gl-stac-layer-popup">';o+='<table class="maplibre-gl-stac-layer-popup-table">',o+=`<tr><td><strong>Layers</strong></td><td>${s.length} STAC layer(s)</td></tr>`,o+=`<tr><td><strong>Lng</strong></td><td>${n.lng.toFixed(6)}</td></tr>`,o+=`<tr><td><strong>Lat</strong></td><td>${n.lat.toFixed(6)}</td></tr>`,r&&(o+=`<tr><td><strong>Rescale</strong></td><td>${r._rescaleMin} - ${r._rescaleMax}</td></tr>`,r._colormap&&r._colormap!=="none"&&(o+=`<tr><td><strong>Colormap</strong></td><td>${r._colormap}</td></tr>`)),o+="</table></div>",this._activePopup=new Dr.Popup({closeButton:!0,maxWidth:"280px"}).setLngLat(n).setHTML(o).addTo(e);const a=this._activePopup.getElement();a&&(a.style.zIndex="1000")},e.on("click",this._mapClickHandler)}async _addLayer(){if(!this._map){this._state.error="Map not available.",this._render();return}if(this._state.rgbMode){const[t,n,s]=this._state.rgbAssets;if(!t||!n||!s){this._state.error="Please select assets for all RGB bands.",this._render();return}const r=this._state.assets.find(l=>l.key===t),o=this._state.assets.find(l=>l.key===n),a=this._state.assets.find(l=>l.key===s);if(!r||!o||!a){this._state.error="One or more selected assets not found.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{await this._ensureOverlay();const{COGLayer:l}=await Promise.resolve().then(()=>require("./index-ChPRo5p6.cjs")),{fromUrl:h}=await Promise.resolve().then(()=>require("./geotiff-D9Jxidvv.cjs")).then(D=>D.geotiff);this._patchCOGLayer(l);const u=`stac-${this._state.stacItem?.id||"layer"}-rgb-${this._layerCounter++}`,[d,g,m]=await Promise.all([h(r.href),h(o.href),h(a.href)]),v=await d.getImageCount(),b=await g.getImageCount(),w=await m.getImageCount(),x=[],I=[],T=[];for(let D=0;D<v;D++)x.push(await d.getImage(D));for(let D=0;D<b;D++)I.push(await g.getImage(D));for(let D=0;D<w;D++)T.push(await m.getImage(D));const R=this._state.rescaleMin,F=this._state.rescaleMax,z=F-R,U={id:u,geotiff:d,opacity:this._state.layerOpacity,pickable:this._state.pickable,_rescaleMin:R,_rescaleMax:F,_isRgb:!0,_preRescaled:!0,getTileData:async(D,Y)=>{const{window:Z,pool:j,device:Q}=Y,$=D.getWidth(),W=D.getHeight();let q=I[0],ee=T[0];for(const qe of I)if(qe.getWidth()===$&&qe.getHeight()===W){q=qe;break}for(const qe of T)if(qe.getWidth()===$&&qe.getHeight()===W){ee=qe;break}const ne={window:Z,pool:j,interleave:!1},[oe,ue,pe]=await Promise.all([D.readRasters(ne),q.readRasters(ne),ee.readRasters(ne)]),ae=oe.width,ye=oe.height,Me=oe[0],Ne=ue[0],me=pe[0],Ke=new Uint8ClampedArray(ae*ye*4);for(let qe=0;qe<ae*ye;qe++){const le=Me[qe],ot=Ne[qe],ve=me[qe];if(le===0&&ot===0&&ve===0)Ke[qe*4]=0,Ke[qe*4+1]=0,Ke[qe*4+2]=0,Ke[qe*4+3]=0;else{const mt=Math.max(0,Math.min(255,(le-R)/z*255)),yt=Math.max(0,Math.min(255,(ot-R)/z*255)),Ie=Math.max(0,Math.min(255,(ve-R)/z*255));Ke[qe*4]=mt,Ke[qe*4+1]=yt,Ke[qe*4+2]=Ie,Ke[qe*4+3]=255}}return{texture:Q.createTexture({data:Ke,format:"rgba8unorm",width:ae,height:ye,sampler:{magFilter:"nearest",minFilter:"nearest"}}),width:ae,height:ye,_preRescaled:!0}}},N=await this._buildGeoKeysParser();N&&(U.geoKeysParser=N);const L=this._state.layerName?.trim();L&&(U._layerName=L),this._cogLayerPropsMap.set(u,U);const k=new l(U);if(this._cogLayers.set(u,k),this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.stacItem?.bbox){const[D,Y,Z,j]=this._state.stacItem.bbox;this._map.fitBounds([[D,Y],[Z,j]],{padding:50,duration:1e3})}this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.loading=!1,this._state.status=`Added RGB layer: ${t}, ${n}, ${s}`,this._state.layerName="",this._render(),this._emit("layeradd",{layerId:u,assetKey:`${t},${n},${s}`,url:r.href,layerName:L||void 0})}catch(l){this._state.loading=!1,this._state.error=`Failed to add RGB layer: ${l instanceof Error?l.message:String(l)}`,this._render(),this._emit("error",{error:this._state.error})}return}if(!this._state.selectedAsset){this._state.error="Please select an asset.",this._render();return}const e=this._state.assets.find(t=>t.key===this._state.selectedAsset);if(!e){this._state.error="Selected asset not found.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{await this._ensureOverlay();const{COGLayer:t}=await Promise.resolve().then(()=>require("./index-ChPRo5p6.cjs"));this._patchCOGLayer(t);const n=`stac-${this._state.stacItem?.id||"layer"}-${e.key}-${this._layerCounter++}`,s={id:n,geotiff:e.href,opacity:this._state.layerOpacity,pickable:this._state.pickable,_rescaleMin:this._state.rescaleMin,_rescaleMax:this._state.rescaleMax,_colormap:this._state.colormap},r=this._state.layerName?.trim();r&&(s._layerName=r);const o=await this._buildGeoKeysParser();o&&(s.geoKeysParser=o),this._cogLayerPropsMap.set(n,s);const a=new t(s);if(this._cogLayers.set(n,a),this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.stacItem?.bbox){const[l,h,u,d]=this._state.stacItem.bbox;this._map.fitBounds([[l,h],[u,d]],{padding:50,duration:1e3})}this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.loading=!1,this._state.status=`Added layer: ${e.title||e.key}`,this._state.layerName="",this._render(),this._emit("layeradd",{layerId:n,assetKey:e.key,url:e.href,layerName:r||void 0})}catch(t){this._state.loading=!1,this._state.error=`Failed to add layer: ${t instanceof Error?t.message:String(t)}`,this._render(),this._emit("error",{error:this._state.error})}}_updateOpacity(){if(!this._deckOverlay)return;for(const[,t]of this._cogLayerPropsMap)t.opacity=this._state.layerOpacity;const e=Array.from(this._cogLayers.entries()).map(([t])=>{const n=this._cogLayerPropsMap.get(t);return this._cogLayers.get(t).clone(n)});this._deckOverlay.setProps({layers:e})}_updateRescaleAndColormap(){if(!this._deckOverlay||this._cogLayers.size===0)return;for(const[,t]of this._cogLayerPropsMap)t._isRgb||(t._rescaleMin=this._state.rescaleMin,t._rescaleMax=this._state.rescaleMax,t._colormap=this._state.colormap);const e=Array.from(this._cogLayers.entries()).map(([t])=>{const n=this._cogLayerPropsMap.get(t);return this._cogLayers.get(t).clone(n)});this._deckOverlay.setProps({layers:e})}_removeLayer(e){this._map&&(this._cogLayers.delete(e),this._cogLayerPropsMap.delete(e),this._deckOverlay&&this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.status=null,this._state.error=null,this._emit("layerremove",{layerId:e}))}_removeAllLayers(){for(const[e]of this._cogLayers)this._removeLayer(e)}_patchCOGLayer(e){if(e.__stacPatched)return;e.__stacPatched=!0;const t=e.prototype._renderSubLayers;e.prototype._renderSubLayers=function(...n){const s=t.apply(this,n),r=this.props.opacity;return r==null?s:mQ(s,Math.max(0,Math.min(1,r)))},e.prototype._parseGeoTIFF=async function(){const{fromUrl:n}=await Promise.resolve().then(()=>require("./geotiff-D9Jxidvv.cjs")).then(ee=>ee.geotiff),{parseCOGTileMatrixSet:s,texture:r}=await Promise.resolve().then(()=>require("./index-ChPRo5p6.cjs")),{CreateTexture:o,FilterNoDataVal:a,Colormap:l}=await Promise.resolve().then(()=>require("./index-B-Nr9y7J.cjs")),h=await Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs")),u=h.default||h,d=this.props.geotiff,g=typeof d=="string"?await n(d):d,m=this.props.geoKeysParser;let v;try{v=await s(g,m)}catch{v=await s(g,void 0)}const b=await g.getImage(),w=await g.getImageCount(),x=[];for(let ee=0;ee<w;ee++)x.push(await g.getImage(ee));const I=m?await m(b.getGeoKeys()):null;let T=null,R=null;if(I&&typeof u=="function"){const ee=u(I.def,"EPSG:4326");if(T=(ne,oe)=>ee.forward([ne,oe],!1),R=(ne,oe)=>ee.inverse([ne,oe],!1),this.props.onGeoTIFFLoad){const ne=b.getBoundingBox(),oe=[ee.forward([ne[0],ne[1]]),ee.forward([ne[2],ne[1]]),ee.forward([ne[2],ne[3]]),ee.forward([ne[0],ne[3]])],ue=oe.map(ye=>ye[0]),pe=oe.map(ye=>ye[1]),ae={west:Math.min(...ue),south:Math.min(...pe),east:Math.max(...ue),north:Math.max(...pe)};this.props.onGeoTIFFLoad(g,{projection:I,geographicBounds:ae})}}const F=b.getFileDirectory(),{BitsPerSample:z,SampleFormat:U,SamplesPerPixel:N,GDAL_NODATA:L}=F;let k=null;if(L){const ee=L[L.length-1]==="\0"?L.slice(0,-1):L;ee.length>0&&(k=parseFloat(ee))}const D=this,Y=D.props._rescaleMin??0,Z=D.props._rescaleMax??1e4,j=async(ee,ne)=>{const{device:oe}=ne,ue=await ee.readRasters({...ne,interleave:!0}),pe=typeof z=="object"&&z?.[0]!==void 0?z[0]:z,ae=ue.width*ue.height;if(N===1&&pe===16){const Ne=new Uint8ClampedArray(ae*4),me=Z-Y,Ke=D.props._colormap;let ze=null;Ke&&Ke!=="none"&&(ze=Pu(Ke));for(let le=0;le<ae;le++){const ot=ue[le];if(ot===0||ot===k)Ne[le*4]=0,Ne[le*4+1]=0,Ne[le*4+2]=0,Ne[le*4+3]=0;else{const ve=Math.max(0,Math.min(1,(ot-Y)/me));if(ze){const mt=Xde(ze,ve);Ne[le*4]=mt[0],Ne[le*4+1]=mt[1],Ne[le*4+2]=mt[2],Ne[le*4+3]=255}else{const mt=Math.round(ve*255);Ne[le*4]=mt,Ne[le*4+1]=mt,Ne[le*4+2]=mt,Ne[le*4+3]=255}}}return{texture:oe.createTexture({data:Ne,format:"rgba8unorm",width:ue.width,height:ue.height,sampler:{magFilter:"nearest",minFilter:"nearest"}}),height:ue.height,width:ue.width,_preRescaled:!0,_colormapApplied:!!ze}}if(N===3){const Ne=new Uint8ClampedArray(ae*4);for(let Ke=0;Ke<ae;Ke++){const ze=ue[Ke*3],qe=ue[Ke*3+1],le=ue[Ke*3+2];ze===0&&qe===0&&le===0?(Ne[Ke*4]=0,Ne[Ke*4+1]=0,Ne[Ke*4+2]=0,Ne[Ke*4+3]=0):(Ne[Ke*4]=ze,Ne[Ke*4+1]=qe,Ne[Ke*4+2]=le,Ne[Ke*4+3]=255)}return{texture:oe.createTexture({data:Ne,format:"rgba8unorm",width:ue.width,height:ue.height,sampler:{magFilter:"nearest",minFilter:"nearest"}}),height:ue.height,width:ue.width,_preRescaled:!0}}const ye=r.inferTextureFormat(N,z,U);return{texture:oe.createTexture({data:ue,format:ye,width:ue.width,height:ue.height,sampler:{magFilter:"nearest",minFilter:"nearest"}}),height:ue.height,width:ue.width}},Q=this;let $=null,W=null;const q=ee=>{const ne=[{module:o,props:{textureName:ee.texture}}];if(!ee._preRescaled){k!==null&&ne.push({module:a,props:{value:k}});const ue=Q.props._rescaleMin??0,pe=Q.props._rescaleMax??255;ne.push({module:jde,props:{minVal:ue,maxVal:pe,isSingleBand:N===1?1:0}})}const oe=Q.props._colormap;if(oe&&oe!=="none"&&!ee._colormapApplied){if(oe!==$){const ue=Pu(oe),pe=Yde(ue);W=Q.context.device.createTexture({data:pe.data,format:"rgba8unorm",width:pe.width,height:pe.height,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),$=oe}ne.push({module:l,props:{colormapTexture:W}})}return ne};Q.setState({metadata:v,forwardReproject:T,inverseReproject:R,images:x,defaultGetTileData:j,defaultRenderTile:q})}}async _registerCommonProjections(e){e.defs("EPSG:3978","+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +type=crs"),e.defs("EPSG:3979","+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=-0.991,1.9072,0.5129,-1.25033e-07,-4.6785e-08,-5.6529e-08,0 +units=m +no_defs +type=crs")}async _buildGeoKeysParser(){try{const e=await Promise.resolve().then(()=>require("./main-dist-Bymiy5aM.cjs")),t=e.default||e;if(!t||typeof t.toProj4!="function")return console.warn("geotiff-geokeys-to-proj4 not available or invalid"),null;const n=await Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs")),s=n.default||n;return typeof s=="function"&&await this._registerCommonProjections(s),async r=>{try{const o=t.toProj4(r);if(o&&o.proj4){let a=o.proj4;a=a.replace(/\+axis=\w+\s*/g,"");let l={};if(typeof s=="function")try{s.defs("custom",a),l=s.defs("custom")||{}}catch(h){console.error("STAC proj4 parsing error:",h)}return{def:a,parsed:l,coordinatesUnits:o.coordinatesUnits||"metre"}}}catch(o){console.error("STAC geoKeysParser error:",o)}return null}}catch(e){return console.error("STAC _buildGeoKeysParser error:",e),null}}}const efe=[{name:"Element84 Earth Search",url:"https://earth-search.aws.element84.com/v1"},{name:"Microsoft Planetary Computer",url:"https://planetarycomputer.microsoft.com/api/stac/v1"}],tfe=["viridis","plasma","inferno","magma","cividis","coolwarm","bwr","seismic","RdBu","RdYlBu","RdYlGn","spectral","jet","rainbow","turbo","terrain","ocean","hot","cool","gray","bone"],nfe={position:"top-right",className:"",visible:!0,collapsed:!0,panelWidth:360,maxHeight:500,backgroundColor:"rgba(255, 255, 255, 0.95)",borderRadius:4,opacity:1,fontSize:13,fontColor:"#1a1a1a",catalogs:efe,maxItems:20,defaultRescaleMin:0,defaultRescaleMax:1e4,defaultColormap:"viridis",defaultRgbMode:!0,showFootprints:!0,minzoom:0,maxzoom:24},ife=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
226
|
+
`,e.appendChild(l)}if(this._cogLayers.size>0){const l=document.createElement("div");l.className="maplibre-gl-stac-layer-list";const h=document.createElement("div");h.className="maplibre-gl-stac-layer-list-header",h.textContent=`Layers (${this._cogLayers.size})`,l.appendChild(h);for(const[u]of this._cogLayers){const d=document.createElement("div");d.className="maplibre-gl-stac-layer-list-item";const g=document.createElement("span");g.className="maplibre-gl-stac-layer-list-label";const v=this._cogLayerPropsMap.get(u)?._layerName;g.textContent=v||u,g.title=u,d.appendChild(g);const b=document.createElement("button");b.className="maplibre-gl-stac-layer-list-remove",b.innerHTML="×",b.title="Remove layer",b.addEventListener("click",()=>{this._removeLayer(u),this._render()}),d.appendChild(b),l.appendChild(d)}e.appendChild(l)}this._container.appendChild(e),this._panel=e,this._button=void 0}_createFormGroup(e,t){const n=document.createElement("div");n.className="maplibre-gl-stac-layer-form-group";const s=document.createElement("label");return s.textContent=e,s.htmlFor=`stac-layer-${t}`,n.appendChild(s),n}_appendStatus(e,t,n){const s=document.createElement("div");s.className=`maplibre-gl-stac-layer-status maplibre-gl-stac-layer-status--${n}`,s.textContent=t,e.appendChild(s)}_autoSetRescale(){if(!this._state.selectedAsset)return;const e=this._state.assets.find(n=>n.key===this._state.selectedAsset);if(!e)return;const t=e.dataType?.toLowerCase();t==="uint16"?(this._state.rescaleMin=0,this._state.rescaleMax=1e4):t==="int16"?(this._state.rescaleMin=-32768,this._state.rescaleMax=32767):t==="float32"||t==="float64"?(this._state.rescaleMin=0,this._state.rescaleMax=1):t==="uint8"&&(this._state.rescaleMin=0,this._state.rescaleMax=255)}_updateColormapPreview(){const e=this._colormapPreview;if(!e)return;if(this._state.colormap==="none"){e.style.display="none";return}const t=Pu(this._state.colormap);if(t&&t.length>0){const n=t.map(s=>s.color).join(", ");e.style.background=`linear-gradient(to right, ${n})`,e.style.display="block"}else e.style.display="none"}async _fetchStacItem(){if(!this._state.stacUrl){this._state.error="Please enter a STAC item URL.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._state.stacItem=null,this._state.assets=[],this._state.selectedAsset=null,this._render();try{const e=await fetch(this._state.stacUrl);if(!e.ok)throw new Error(`Failed to fetch: ${e.status} ${e.statusText}`);const t=await e.text(),n=JSON.parse(t);if(n.type!=="Feature"||!n.assets)throw new Error("Invalid STAC item: missing 'type: Feature' or 'assets'");this._state.stacItem=n;const s=[],r=t.match(/"assets"\s*:\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/);if(r){const h=r[1].matchAll(/"([^"]+)"\s*:\s*\{/g);for(const u of h)s.push(u[1])}const o=s.length>0?s:Object.keys(n.assets),a=[];for(const l of o){const h=n.assets[l];if(!h)continue;const u=h;if(u.type?.includes("geotiff")||u.type?.includes("image/tiff")||u.href?.endsWith(".tif")||u.href?.endsWith(".tiff")){const d=u["raster:bands"]?.[0],g=u["eo:bands"]?.[0];a.push({key:l,href:u.href,type:u.type||"image/tiff",title:u.title||l,dataType:d?.data_type||u.data_type,nodata:d?.nodata??u.nodata,scale:d?.scale,offset:d?.offset,centerWavelength:g?.center_wavelength,commonName:g?.common_name})}}a.sort((l,h)=>l.centerWavelength!==void 0&&h.centerWavelength!==void 0?l.centerWavelength-h.centerWavelength:l.centerWavelength!==void 0?-1:h.centerWavelength!==void 0?1:0),this._state.assets=a,this._state.loading=!1,this._state.status=`Found ${a.length} COG asset(s)`,this._emit("stacload",{url:this._state.stacUrl})}catch(e){this._state.loading=!1,this._state.error=`Failed to load STAC: ${e instanceof Error?e.message:String(e)}`,this._emit("error",{error:this._state.error})}this._render()}async _ensureOverlay(){if(this._deckOverlay||!this._map)return;const{MapboxOverlay:e}=await Promise.resolve().then(()=>require("./index-C8CBe27l.cjs"));this._deckOverlay=new e({interleaved:!!this._options.beforeId,layers:[]}),this._map.addControl(this._deckOverlay)}_setupClickHandler(){if(!this._map||this._mapClickHandler)return;const e=this._map;this._mapClickHandler=t=>{if(!this._state.pickable||this._cogLayers.size===0)return;this._activePopup&&this._activePopup.remove();const{lngLat:n}=t,s=Array.from(this._cogLayers.keys()),r=this._cogLayerPropsMap.get(s[0]);let o='<div class="maplibre-gl-stac-layer-popup">';o+='<table class="maplibre-gl-stac-layer-popup-table">',o+=`<tr><td><strong>Layers</strong></td><td>${s.length} STAC layer(s)</td></tr>`,o+=`<tr><td><strong>Lng</strong></td><td>${n.lng.toFixed(6)}</td></tr>`,o+=`<tr><td><strong>Lat</strong></td><td>${n.lat.toFixed(6)}</td></tr>`,r&&(o+=`<tr><td><strong>Rescale</strong></td><td>${r._rescaleMin} - ${r._rescaleMax}</td></tr>`,r._colormap&&r._colormap!=="none"&&(o+=`<tr><td><strong>Colormap</strong></td><td>${r._colormap}</td></tr>`)),o+="</table></div>",this._activePopup=new Dr.Popup({closeButton:!0,maxWidth:"280px"}).setLngLat(n).setHTML(o).addTo(e);const a=this._activePopup.getElement();a&&(a.style.zIndex="1000")},e.on("click",this._mapClickHandler)}async _addLayer(){if(!this._map){this._state.error="Map not available.",this._render();return}if(this._state.rgbMode){const[t,n,s]=this._state.rgbAssets;if(!t||!n||!s){this._state.error="Please select assets for all RGB bands.",this._render();return}const r=this._state.assets.find(l=>l.key===t),o=this._state.assets.find(l=>l.key===n),a=this._state.assets.find(l=>l.key===s);if(!r||!o||!a){this._state.error="One or more selected assets not found.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{await this._ensureOverlay();const{COGLayer:l}=await Promise.resolve().then(()=>require("./index-rhQrpZSD.cjs")),{fromUrl:h}=await Promise.resolve().then(()=>require("./geotiff-C-MHEjS3.cjs")).then(D=>D.geotiff);this._patchCOGLayer(l);const u=`stac-${this._state.stacItem?.id||"layer"}-rgb-${this._layerCounter++}`,[d,g,m]=await Promise.all([h(r.href),h(o.href),h(a.href)]),v=await d.getImageCount(),b=await g.getImageCount(),w=await m.getImageCount(),x=[],I=[],T=[];for(let D=0;D<v;D++)x.push(await d.getImage(D));for(let D=0;D<b;D++)I.push(await g.getImage(D));for(let D=0;D<w;D++)T.push(await m.getImage(D));const R=this._state.rescaleMin,F=this._state.rescaleMax,z=F-R,U={id:u,geotiff:d,opacity:this._state.layerOpacity,pickable:this._state.pickable,_rescaleMin:R,_rescaleMax:F,_isRgb:!0,_preRescaled:!0,getTileData:async(D,Y)=>{const{window:Z,pool:j,device:Q}=Y,$=D.getWidth(),W=D.getHeight();let q=I[0],ee=T[0];for(const qe of I)if(qe.getWidth()===$&&qe.getHeight()===W){q=qe;break}for(const qe of T)if(qe.getWidth()===$&&qe.getHeight()===W){ee=qe;break}const ne={window:Z,pool:j,interleave:!1},[oe,ue,pe]=await Promise.all([D.readRasters(ne),q.readRasters(ne),ee.readRasters(ne)]),ae=oe.width,ye=oe.height,Me=oe[0],Ne=ue[0],me=pe[0],Ke=new Uint8ClampedArray(ae*ye*4);for(let qe=0;qe<ae*ye;qe++){const le=Me[qe],ot=Ne[qe],ve=me[qe];if(le===0&&ot===0&&ve===0)Ke[qe*4]=0,Ke[qe*4+1]=0,Ke[qe*4+2]=0,Ke[qe*4+3]=0;else{const mt=Math.max(0,Math.min(255,(le-R)/z*255)),yt=Math.max(0,Math.min(255,(ot-R)/z*255)),Ie=Math.max(0,Math.min(255,(ve-R)/z*255));Ke[qe*4]=mt,Ke[qe*4+1]=yt,Ke[qe*4+2]=Ie,Ke[qe*4+3]=255}}return{texture:Q.createTexture({data:Ke,format:"rgba8unorm",width:ae,height:ye,sampler:{magFilter:"nearest",minFilter:"nearest"}}),width:ae,height:ye,_preRescaled:!0}}},N=await this._buildGeoKeysParser();N&&(U.geoKeysParser=N);const L=this._state.layerName?.trim();L&&(U._layerName=L),this._cogLayerPropsMap.set(u,U);const k=new l(U);if(this._cogLayers.set(u,k),this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.stacItem?.bbox){const[D,Y,Z,j]=this._state.stacItem.bbox;this._map.fitBounds([[D,Y],[Z,j]],{padding:50,duration:1e3})}this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.loading=!1,this._state.status=`Added RGB layer: ${t}, ${n}, ${s}`,this._state.layerName="",this._render(),this._emit("layeradd",{layerId:u,assetKey:`${t},${n},${s}`,url:r.href,layerName:L||void 0})}catch(l){this._state.loading=!1,this._state.error=`Failed to add RGB layer: ${l instanceof Error?l.message:String(l)}`,this._render(),this._emit("error",{error:this._state.error})}return}if(!this._state.selectedAsset){this._state.error="Please select an asset.",this._render();return}const e=this._state.assets.find(t=>t.key===this._state.selectedAsset);if(!e){this._state.error="Selected asset not found.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{await this._ensureOverlay();const{COGLayer:t}=await Promise.resolve().then(()=>require("./index-rhQrpZSD.cjs"));this._patchCOGLayer(t);const n=`stac-${this._state.stacItem?.id||"layer"}-${e.key}-${this._layerCounter++}`,s={id:n,geotiff:e.href,opacity:this._state.layerOpacity,pickable:this._state.pickable,_rescaleMin:this._state.rescaleMin,_rescaleMax:this._state.rescaleMax,_colormap:this._state.colormap},r=this._state.layerName?.trim();r&&(s._layerName=r);const o=await this._buildGeoKeysParser();o&&(s.geoKeysParser=o),this._cogLayerPropsMap.set(n,s);const a=new t(s);if(this._cogLayers.set(n,a),this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.stacItem?.bbox){const[l,h,u,d]=this._state.stacItem.bbox;this._map.fitBounds([[l,h],[u,d]],{padding:50,duration:1e3})}this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.loading=!1,this._state.status=`Added layer: ${e.title||e.key}`,this._state.layerName="",this._render(),this._emit("layeradd",{layerId:n,assetKey:e.key,url:e.href,layerName:r||void 0})}catch(t){this._state.loading=!1,this._state.error=`Failed to add layer: ${t instanceof Error?t.message:String(t)}`,this._render(),this._emit("error",{error:this._state.error})}}_updateOpacity(){if(!this._deckOverlay)return;for(const[,t]of this._cogLayerPropsMap)t.opacity=this._state.layerOpacity;const e=Array.from(this._cogLayers.entries()).map(([t])=>{const n=this._cogLayerPropsMap.get(t);return this._cogLayers.get(t).clone(n)});this._deckOverlay.setProps({layers:e})}_updateRescaleAndColormap(){if(!this._deckOverlay||this._cogLayers.size===0)return;for(const[,t]of this._cogLayerPropsMap)t._isRgb||(t._rescaleMin=this._state.rescaleMin,t._rescaleMax=this._state.rescaleMax,t._colormap=this._state.colormap);const e=Array.from(this._cogLayers.entries()).map(([t])=>{const n=this._cogLayerPropsMap.get(t);return this._cogLayers.get(t).clone(n)});this._deckOverlay.setProps({layers:e})}_removeLayer(e){this._map&&(this._cogLayers.delete(e),this._cogLayerPropsMap.delete(e),this._deckOverlay&&this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())}),this._state.hasLayer=this._cogLayers.size>0,this._state.layerCount=this._cogLayers.size,this._state.status=null,this._state.error=null,this._emit("layerremove",{layerId:e}))}_removeAllLayers(){for(const[e]of this._cogLayers)this._removeLayer(e)}_patchCOGLayer(e){if(e.__stacPatched)return;e.__stacPatched=!0;const t=e.prototype._renderSubLayers;e.prototype._renderSubLayers=function(...n){const s=t.apply(this,n),r=this.props.opacity;return r==null?s:mQ(s,Math.max(0,Math.min(1,r)))},e.prototype._parseGeoTIFF=async function(){const{fromUrl:n}=await Promise.resolve().then(()=>require("./geotiff-C-MHEjS3.cjs")).then(ee=>ee.geotiff),{parseCOGTileMatrixSet:s,texture:r}=await Promise.resolve().then(()=>require("./index-rhQrpZSD.cjs")),{CreateTexture:o,FilterNoDataVal:a,Colormap:l}=await Promise.resolve().then(()=>require("./index-B-Nr9y7J.cjs")),h=await Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs")),u=h.default||h,d=this.props.geotiff,g=typeof d=="string"?await n(d):d,m=this.props.geoKeysParser;let v;try{v=await s(g,m)}catch{v=await s(g,void 0)}const b=await g.getImage(),w=await g.getImageCount(),x=[];for(let ee=0;ee<w;ee++)x.push(await g.getImage(ee));const I=m?await m(b.getGeoKeys()):null;let T=null,R=null;if(I&&typeof u=="function"){const ee=u(I.def,"EPSG:4326");if(T=(ne,oe)=>ee.forward([ne,oe],!1),R=(ne,oe)=>ee.inverse([ne,oe],!1),this.props.onGeoTIFFLoad){const ne=b.getBoundingBox(),oe=[ee.forward([ne[0],ne[1]]),ee.forward([ne[2],ne[1]]),ee.forward([ne[2],ne[3]]),ee.forward([ne[0],ne[3]])],ue=oe.map(ye=>ye[0]),pe=oe.map(ye=>ye[1]),ae={west:Math.min(...ue),south:Math.min(...pe),east:Math.max(...ue),north:Math.max(...pe)};this.props.onGeoTIFFLoad(g,{projection:I,geographicBounds:ae})}}const F=b.getFileDirectory(),{BitsPerSample:z,SampleFormat:U,SamplesPerPixel:N,GDAL_NODATA:L}=F;let k=null;if(L){const ee=L[L.length-1]==="\0"?L.slice(0,-1):L;ee.length>0&&(k=parseFloat(ee))}const D=this,Y=D.props._rescaleMin??0,Z=D.props._rescaleMax??1e4,j=async(ee,ne)=>{const{device:oe}=ne,ue=await ee.readRasters({...ne,interleave:!0}),pe=typeof z=="object"&&z?.[0]!==void 0?z[0]:z,ae=ue.width*ue.height;if(N===1&&pe===16){const Ne=new Uint8ClampedArray(ae*4),me=Z-Y,Ke=D.props._colormap;let ze=null;Ke&&Ke!=="none"&&(ze=Pu(Ke));for(let le=0;le<ae;le++){const ot=ue[le];if(ot===0||ot===k)Ne[le*4]=0,Ne[le*4+1]=0,Ne[le*4+2]=0,Ne[le*4+3]=0;else{const ve=Math.max(0,Math.min(1,(ot-Y)/me));if(ze){const mt=Xde(ze,ve);Ne[le*4]=mt[0],Ne[le*4+1]=mt[1],Ne[le*4+2]=mt[2],Ne[le*4+3]=255}else{const mt=Math.round(ve*255);Ne[le*4]=mt,Ne[le*4+1]=mt,Ne[le*4+2]=mt,Ne[le*4+3]=255}}}return{texture:oe.createTexture({data:Ne,format:"rgba8unorm",width:ue.width,height:ue.height,sampler:{magFilter:"nearest",minFilter:"nearest"}}),height:ue.height,width:ue.width,_preRescaled:!0,_colormapApplied:!!ze}}if(N===3){const Ne=new Uint8ClampedArray(ae*4);for(let Ke=0;Ke<ae;Ke++){const ze=ue[Ke*3],qe=ue[Ke*3+1],le=ue[Ke*3+2];ze===0&&qe===0&&le===0?(Ne[Ke*4]=0,Ne[Ke*4+1]=0,Ne[Ke*4+2]=0,Ne[Ke*4+3]=0):(Ne[Ke*4]=ze,Ne[Ke*4+1]=qe,Ne[Ke*4+2]=le,Ne[Ke*4+3]=255)}return{texture:oe.createTexture({data:Ne,format:"rgba8unorm",width:ue.width,height:ue.height,sampler:{magFilter:"nearest",minFilter:"nearest"}}),height:ue.height,width:ue.width,_preRescaled:!0}}const ye=r.inferTextureFormat(N,z,U);return{texture:oe.createTexture({data:ue,format:ye,width:ue.width,height:ue.height,sampler:{magFilter:"nearest",minFilter:"nearest"}}),height:ue.height,width:ue.width}},Q=this;let $=null,W=null;const q=ee=>{const ne=[{module:o,props:{textureName:ee.texture}}];if(!ee._preRescaled){k!==null&&ne.push({module:a,props:{value:k}});const ue=Q.props._rescaleMin??0,pe=Q.props._rescaleMax??255;ne.push({module:jde,props:{minVal:ue,maxVal:pe,isSingleBand:N===1?1:0}})}const oe=Q.props._colormap;if(oe&&oe!=="none"&&!ee._colormapApplied){if(oe!==$){const ue=Pu(oe),pe=Yde(ue);W=Q.context.device.createTexture({data:pe.data,format:"rgba8unorm",width:pe.width,height:pe.height,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),$=oe}ne.push({module:l,props:{colormapTexture:W}})}return ne};Q.setState({metadata:v,forwardReproject:T,inverseReproject:R,images:x,defaultGetTileData:j,defaultRenderTile:q})}}async _registerCommonProjections(e){e.defs("EPSG:3978","+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +type=crs"),e.defs("EPSG:3979","+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=-0.991,1.9072,0.5129,-1.25033e-07,-4.6785e-08,-5.6529e-08,0 +units=m +no_defs +type=crs")}async _buildGeoKeysParser(){try{const e=await Promise.resolve().then(()=>require("./main-dist-Bymiy5aM.cjs")),t=e.default||e;if(!t||typeof t.toProj4!="function")return console.warn("geotiff-geokeys-to-proj4 not available or invalid"),null;const n=await Promise.resolve().then(()=>require("./index-IrsIiQNM.cjs")),s=n.default||n;return typeof s=="function"&&await this._registerCommonProjections(s),async r=>{try{const o=t.toProj4(r);if(o&&o.proj4){let a=o.proj4;a=a.replace(/\+axis=\w+\s*/g,"");let l={};if(typeof s=="function")try{s.defs("custom",a),l=s.defs("custom")||{}}catch(h){console.error("STAC proj4 parsing error:",h)}return{def:a,parsed:l,coordinatesUnits:o.coordinatesUnits||"metre"}}}catch(o){console.error("STAC geoKeysParser error:",o)}return null}}catch(e){return console.error("STAC _buildGeoKeysParser error:",e),null}}}const efe=[{name:"Element84 Earth Search",url:"https://earth-search.aws.element84.com/v1"},{name:"Microsoft Planetary Computer",url:"https://planetarycomputer.microsoft.com/api/stac/v1"}],tfe=["viridis","plasma","inferno","magma","cividis","coolwarm","bwr","seismic","RdBu","RdYlBu","RdYlGn","spectral","jet","rainbow","turbo","terrain","ocean","hot","cool","gray","bone"],nfe={position:"top-right",className:"",visible:!0,collapsed:!0,panelWidth:360,maxHeight:500,backgroundColor:"rgba(255, 255, 255, 0.95)",borderRadius:4,opacity:1,fontSize:13,fontColor:"#1a1a1a",catalogs:efe,maxItems:20,defaultRescaleMin:0,defaultRescaleMax:1e4,defaultColormap:"viridis",defaultRgbMode:!0,showFootprints:!0,minzoom:0,maxzoom:24},ife=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
227
227
|
<circle cx="11" cy="11" r="8"/>
|
|
228
228
|
<path d="m21 21-4.3-4.3"/>
|
|
229
229
|
<path d="M11 8v6"/>
|
|
230
230
|
<path d="M8 11h6"/>
|
|
231
|
-
</svg>`;class AQ{_container;_button;_panel;_options;_state;_eventHandlers=new Map;_map;_handleZoom;_zoomVisible=!0;_footprintSourceId="stac-search-footprints";_footprintLayerId="stac-search-footprints-layer";_footprintOutlineLayerId="stac-search-footprints-outline";_footprintHighlightLayerId="stac-search-footprints-highlight";_footprintHighlightOutlineLayerId="stac-search-footprints-highlight-outline";_showCustomUrlInput=!1;_deckOverlay;_cogLayers=new Map;_layerCounter=0;constructor(e){this._options={...nfe,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed,catalogs:this._options.catalogs,selectedCatalog:this._options.catalogs.length>0?this._options.catalogs[0]:null,collections:[],selectedCollection:null,startDate:null,endDate:null,maxItems:this._options.maxItems,queryFilter:"",items:[],selectedItem:null,rescaleMin:this._options.defaultRescaleMin,rescaleMax:this._options.defaultRescaleMax,isRgbMode:this._options.defaultRgbMode,colormap:this._options.defaultColormap,availableAssets:[],selectedBand:null,rgbBands:{r:null,g:null,b:null},hasLayer:!1,loading:!1,error:null,status:null}}onAdd(e){return this._map=e,this._container=this._createContainer(),this._render(),this._handleZoom=()=>this._checkZoomVisibility(),this._map.on("zoom",this._handleZoom),this._checkZoomVisibility(),this._container}onRemove(){if(this._removeFootprints(),this._removeAllLayers(),this._map&&this._handleZoom&&(this._map.off("zoom",this._handleZoom),this._handleZoom=void 0),this._deckOverlay&&this._map){try{this._map.removeControl(this._deckOverlay)}catch{}this._deckOverlay=void 0}this._map=void 0,this._container?.parentNode?.removeChild(this._container),this._container=void 0,this._button=void 0,this._panel=void 0}getDefaultPosition(){return this._options.position}expand(){this._state.collapsed&&(this._state.collapsed=!1,this._render(),this._emit("expand",{}))}collapse(){this._state.collapsed||(this._state.collapsed=!0,this._render(),this._emit("collapse",{}))}toggle(){this._state.collapsed?this.expand():this.collapse()}show(){this._state.visible||(this._state.visible=!0,this._updateDisplayState(),this._emit("show",{}))}hide(){this._state.visible&&(this._state.visible=!1,this._updateDisplayState(),this._emit("hide",{}))}getState(){return{...this._state}}update(e){this._options={...this._options,...e},e.visible!==void 0&&(this._state.visible=e.visible),e.collapsed!==void 0&&(this._state.collapsed=e.collapsed),e.catalogs&&(this._state.catalogs=e.catalogs,e.catalogs.length>0&&!this._state.selectedCatalog&&(this._state.selectedCatalog=e.catalogs[0])),this._render()}on(e,t){this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t)}off(e,t){this._eventHandlers.get(e)?.delete(t)}getSelectedItem(){return this._state.selectedItem}getItems(){return[...this._state.items]}_emit(e,t){const n=this._eventHandlers.get(e);if(!n)return;const s={type:e,state:this._state,...t};for(const r of n)r(s)}_checkZoomVisibility(){if(!this._map)return;const e=this._map.getZoom(),t=this._zoomVisible;this._zoomVisible=e>=this._options.minzoom&&e<=this._options.maxzoom,t!==this._zoomVisible&&this._updateDisplayState()}_updateDisplayState(){if(!this._container)return;const e=this._state.visible&&this._zoomVisible;this._container.style.display=e?"block":"none"}_createContainer(){const e=document.createElement("div");return e.className=`maplibregl-ctrl maplibre-gl-stac-search ${this._options.className||""}`,this._options.backgroundColor&&(e.style.background=this._options.backgroundColor),this._options.borderRadius!==void 0&&(e.style.borderRadius=`${this._options.borderRadius}px`),this._options.opacity!==1&&(e.style.opacity=String(this._options.opacity)),e}_render(){if(!this._container)return;const t=this._container.querySelector(".maplibre-gl-stac-search-panel")?.scrollTop??0;if(this._container.innerHTML="",this._state.collapsed)this._renderCollapsed();else{this._renderExpanded();const n=this._container.querySelector(".maplibre-gl-stac-search-panel");n&&t>0&&(n.scrollTop=t)}}_renderCollapsed(){if(!this._container)return;const e=document.createElement("button");e.className=`maplibre-gl-stac-search-button${this._state.hasLayer?" maplibre-gl-stac-search-button--active":""}`,e.innerHTML=ife,e.title="STAC Search",e.addEventListener("click",()=>this.expand()),this._container.appendChild(e),this._button=e}_renderExpanded(){if(!this._container)return;const e=document.createElement("div");e.className="maplibre-gl-stac-search-panel",e.style.width=`${this._options.panelWidth}px`,this._options.maxHeight&&this._options.maxHeight>0&&(e.style.maxHeight=`${this._options.maxHeight}px`,e.style.overflowY="auto"),this._options.fontSize&&(e.style.fontSize=`${this._options.fontSize}px`),this._options.fontColor&&(e.style.color=this._options.fontColor);const t=document.createElement("div");t.className="maplibre-gl-stac-search-header";const n=document.createElement("span");n.className="maplibre-gl-stac-search-title",n.textContent="STAC Search",t.appendChild(n);const s=document.createElement("button");s.className="maplibre-gl-stac-search-close",s.innerHTML="×",s.addEventListener("click",()=>this.collapse()),t.appendChild(s),e.appendChild(t);const r=this._createFormGroup("Catalog","catalog"),o=document.createElement("select");o.id="stac-search-catalog",o.className="maplibre-gl-stac-search-select",o.style.color="#000";for(const L of this._state.catalogs){const k=document.createElement("option");k.value=L.url,k.textContent=L.name,k.selected=this._state.selectedCatalog?.url===L.url,o.appendChild(k)}const a=document.createElement("option");if(a.value="__custom__",a.textContent="── Custom URL ──",a.selected=this._showCustomUrlInput||this._state.selectedCatalog?.name==="__custom__",o.appendChild(a),o.addEventListener("change",()=>{if(o.value==="__custom__"){this._showCustomUrlInput=!0,this._render();return}this._showCustomUrlInput=!1;const L=this._state.catalogs.find(k=>k.url===o.value);L&&(this._state.selectedCatalog=L,this._state.collections=[],this._state.selectedCollection=null,this._state.items=[],this._state.selectedItem=null,this._emit("catalogselect",{catalog:L}),this._render())}),r.appendChild(o),this._showCustomUrlInput||this._state.selectedCatalog?.name==="__custom__"){const L=document.createElement("div");L.className="maplibre-gl-stac-search-custom-url-row";const k=document.createElement("input");k.type="text",k.id="stac-search-custom-url",k.className="maplibre-gl-stac-search-input",k.style.color="#000",k.placeholder="https://stac-api.example.com/v1",k.value=this._state.selectedCatalog?.name==="__custom__"?this._state.selectedCatalog.url:"";const D=document.createElement("button");D.className="maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--secondary",D.textContent="Use",D.addEventListener("click",()=>{const Y=k.value.trim();Y&&(this._showCustomUrlInput=!1,this._state.selectedCatalog={name:"__custom__",url:Y},this._state.collections=[],this._state.selectedCollection=null,this._state.items=[],this._state.selectedItem=null,this._emit("catalogselect",{catalog:this._state.selectedCatalog}),this._render())}),L.appendChild(k),L.appendChild(D),r.appendChild(L)}e.appendChild(r);const l=this._createFormGroup("Collection","collection"),h=document.createElement("div");h.className="maplibre-gl-stac-search-row";const u=document.createElement("button");u.className="maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--secondary",u.textContent="Collections",u.disabled=this._state.loading||!this._state.selectedCatalog,u.addEventListener("click",()=>this._fetchCollections()),h.appendChild(u);const d=document.createElement("select");if(d.id="stac-search-collection",d.className="maplibre-gl-stac-search-select maplibre-gl-stac-search-select--flex",d.style.color="#000",d.disabled=this._state.collections.length===0,this._state.collections.length===0){const L=document.createElement("option");L.value="",L.textContent="-- Click Collections --",d.appendChild(L)}else for(const L of this._state.collections){const k=document.createElement("option");k.value=L.id,k.textContent=L.title||L.id,k.selected=this._state.selectedCollection?.id===L.id,d.appendChild(k)}d.addEventListener("change",()=>{const L=this._state.collections.find(k=>k.id===d.value);L&&(this._state.selectedCollection=L,this._state.items=[],this._state.selectedItem=null,this._emit("collectionselect",{collection:L}),this._render())}),h.appendChild(d),l.appendChild(h),e.appendChild(l);const g=this._createFormGroup("Date Range","date"),m=document.createElement("div");m.className="maplibre-gl-stac-search-date-row";const v=document.createElement("input");v.type="date",v.id="stac-search-start-date",v.className="maplibre-gl-stac-search-input maplibre-gl-stac-search-input--half",v.style.color="#000",v.value=this._state.startDate||"",v.addEventListener("change",()=>{this._state.startDate=v.value||null});const b=document.createElement("input");b.type="date",b.id="stac-search-end-date",b.className="maplibre-gl-stac-search-input maplibre-gl-stac-search-input--half",b.style.color="#000",b.value=this._state.endDate||"",b.addEventListener("change",()=>{this._state.endDate=b.value||null}),m.appendChild(v),m.appendChild(b),g.appendChild(m),e.appendChild(g);const w=this._createFormGroup("Max Items","maxitems"),x=document.createElement("input");x.type="number",x.id="stac-search-maxitems",x.className="maplibre-gl-stac-search-input",x.style.color="#000",x.min="1",x.max="100",x.value=String(this._state.maxItems),x.addEventListener("change",()=>{this._state.maxItems=Math.max(1,Math.min(100,Number(x.value)||20))}),w.appendChild(x),e.appendChild(w);const I=this._createFormGroup("Query Filter (optional)","query"),T=document.createElement("input");T.type="text",T.id="stac-search-query",T.className="maplibre-gl-stac-search-input",T.style.color="#000",T.placeholder='{"eo:cloud_cover": {"lt": 10}}',T.value=this._state.queryFilter,T.addEventListener("change",()=>{this._state.queryFilter=T.value.trim()}),I.appendChild(T);const R=document.createElement("div");R.className="maplibre-gl-stac-search-hint",R.textContent="JSON filter, e.g., cloud cover < 10%",I.appendChild(R),e.appendChild(I);const F=document.createElement("div");F.className="maplibre-gl-stac-search-form-group";const z=document.createElement("button");z.className="maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--primary",z.textContent="Search Items",z.disabled=this._state.loading||!this._state.selectedCollection,z.addEventListener("click",()=>this._searchItems()),F.appendChild(z);const U=document.createElement("div");U.className="maplibre-gl-stac-search-hint-row";const N=document.createElement("div");if(N.className="maplibre-gl-stac-search-hint",N.textContent="Uses current map bounds",U.appendChild(N),this._state.items.length>0){const L=document.createElement("button");L.className="maplibre-gl-stac-search-btn-clear-footprints",L.textContent="Clear Footprints",L.title="Remove footprints from map",L.addEventListener("click",()=>{this._removeFootprints(),this._state.items=[],this._state.selectedItem=null,this._render()}),U.appendChild(L)}if(F.appendChild(U),e.appendChild(F),this._state.items.length>0){const L=this._createFormGroup("Select Item","item"),k=document.createElement("select");k.id="stac-search-item",k.className="maplibre-gl-stac-search-select",k.style.color="#000";for(const ue of this._state.items){const pe=document.createElement("option");pe.value=ue.id;const ae=ue.datetime?new Date(ue.datetime).toLocaleDateString():"";pe.textContent=`${ue.id}${ae?` (${ae})`:""}`,pe.selected=this._state.selectedItem?.id===ue.id,k.appendChild(pe)}k.addEventListener("change",()=>{const ue=this._state.items.find(pe=>pe.id===k.value);ue&&(this._state.selectedItem=ue,this._updateAvailableAssets(ue),this._updateFootprintHighlight(),this._emit("itemselect",{item:ue}),this._render())}),L.appendChild(k),e.appendChild(L);const D=this._createFormGroup("Visualization Mode","mode"),Y=document.createElement("div");Y.className="maplibre-gl-stac-search-mode-row";const Z=document.createElement("button");Z.className=`maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--toggle ${this._state.isRgbMode?"":"active"}`,Z.textContent="Single Band",Z.addEventListener("click",()=>{this._state.isRgbMode=!1,this._render()});const j=document.createElement("button");j.className=`maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--toggle ${this._state.isRgbMode?"active":""}`,j.textContent="RGB Composite",j.addEventListener("click",()=>{this._state.isRgbMode=!0,this._render()}),Y.appendChild(Z),Y.appendChild(j),D.appendChild(Y),e.appendChild(D);const Q=this._state.availableAssets;if(this._state.isRgbMode){const ue=this._createFormGroup("RGB Bands","rgb"),pe=document.createElement("div");pe.className="maplibre-gl-stac-search-rgb-row";const ae=[{key:"r",label:"R"},{key:"g",label:"G"},{key:"b",label:"B"}];for(const ye of ae){const Me=document.createElement("div");Me.className="maplibre-gl-stac-search-rgb-channel";const Ne=document.createElement("label");Ne.textContent=ye.label,Ne.className="maplibre-gl-stac-search-rgb-label",Me.appendChild(Ne);const me=document.createElement("select");me.className="maplibre-gl-stac-search-select maplibre-gl-stac-search-select--small",me.style.color="#000";for(const Ke of Q){const ze=document.createElement("option");ze.value=Ke,ze.textContent=Ke,ze.selected=this._state.rgbBands[ye.key]===Ke,me.appendChild(ze)}me.addEventListener("change",()=>{this._state.rgbBands[ye.key]=me.value}),Me.appendChild(me),pe.appendChild(Me)}ue.appendChild(pe),e.appendChild(ue)}else{const ue=this._createFormGroup("Band","band"),pe=document.createElement("select");pe.id="stac-search-band",pe.className="maplibre-gl-stac-search-select",pe.style.color="#000";for(const Ne of Q){const me=document.createElement("option");me.value=Ne,me.textContent=Ne,me.selected=this._state.selectedBand===Ne,pe.appendChild(me)}pe.addEventListener("change",()=>{this._state.selectedBand=pe.value}),ue.appendChild(pe),e.appendChild(ue);const ae=this._createFormGroup("Colormap","colormap"),ye=document.createElement("select");ye.id="stac-search-colormap",ye.className="maplibre-gl-stac-search-select",ye.style.color="#000";const Me=document.createElement("option");Me.value="none",Me.textContent="None (Grayscale)",Me.selected=this._state.colormap==="none",ye.appendChild(Me);for(const Ne of tfe){const me=document.createElement("option");me.value=Ne,me.textContent=Ne,me.selected=this._state.colormap===Ne,ye.appendChild(me)}ye.addEventListener("change",()=>{this._state.colormap=ye.value}),ae.appendChild(ye),e.appendChild(ae)}const $=this._createFormGroup("Rescale Range","rescale"),W=document.createElement("div");W.className="maplibre-gl-stac-search-rescale-row";const q=document.createElement("input");q.type="number",q.className="maplibre-gl-stac-search-input maplibre-gl-stac-search-input--half",q.style.color="#000",q.placeholder="Min",q.value=String(this._state.rescaleMin),q.addEventListener("change",()=>{this._state.rescaleMin=Number(q.value)||0});const ee=document.createElement("input");ee.type="number",ee.className="maplibre-gl-stac-search-input maplibre-gl-stac-search-input--half",ee.style.color="#000",ee.placeholder="Max",ee.value=String(this._state.rescaleMax),ee.addEventListener("change",()=>{this._state.rescaleMax=Number(ee.value)||1e4}),W.appendChild(q),W.appendChild(ee),$.appendChild(W),e.appendChild($);const ne=document.createElement("div");ne.className="maplibre-gl-stac-search-form-group";const oe=document.createElement("button");oe.className="maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--primary",oe.textContent="Display Item",oe.disabled=this._state.loading||!this._state.selectedItem,oe.addEventListener("click",()=>this._displayItem()),ne.appendChild(oe),e.appendChild(ne)}if(this._state.loading?this._appendStatus(e,"Loading...","info"):this._state.error?this._appendStatus(e,this._state.error,"error"):this._state.status&&this._appendStatus(e,this._state.status,"success"),this._cogLayers.size>0){const L=document.createElement("div");L.className="maplibre-gl-stac-search-list";const k=document.createElement("div");k.className="maplibre-gl-stac-search-list-header-row";const D=document.createElement("div");D.className="maplibre-gl-stac-search-list-header",D.textContent=`Layers (${this._cogLayers.size})`,k.appendChild(D);const Y=document.createElement("button");Y.className="maplibre-gl-stac-search-btn-clear",Y.textContent="Clear All",Y.title="Remove all layers",Y.addEventListener("click",()=>{this._removeAllLayers(),this._render()}),k.appendChild(Y),L.appendChild(k);for(const[Z]of this._cogLayers){const j=document.createElement("div");j.className="maplibre-gl-stac-search-list-item";const Q=document.createElement("span");Q.className="maplibre-gl-stac-search-list-label",Q.textContent=Z,j.appendChild(Q);const $=document.createElement("button");$.className="maplibre-gl-stac-search-list-remove",$.innerHTML="×",$.title="Remove layer",$.addEventListener("click",()=>{this._removeLayer(Z),this._render()}),j.appendChild($),L.appendChild(j)}e.appendChild(L)}this._container.appendChild(e),this._panel=e,this._button=void 0}_createFormGroup(e,t){const n=document.createElement("div");n.className="maplibre-gl-stac-search-form-group";const s=document.createElement("label");return s.textContent=e,s.htmlFor=`stac-search-${t}`,n.appendChild(s),n}_appendStatus(e,t,n){const s=document.createElement("div");s.className=`maplibre-gl-stac-search-status maplibre-gl-stac-search-status--${n}`,s.textContent=t,e.appendChild(s)}async _fetchCollections(){if(!this._state.selectedCatalog){this._state.error="Please select a catalog.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{const e=`${this._state.selectedCatalog.url}/collections`,t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch: ${t.status} ${t.statusText}`);const s=((await t.json()).collections||[]).map(r=>({id:r.id,title:r.title,description:r.description}));s.sort((r,o)=>{const a=r.title||r.id,l=o.title||o.id;return a.localeCompare(l)}),this._state.collections=s,this._state.selectedCollection=s.length>0?s[0]:null,this._state.loading=!1,this._state.status=`Found ${s.length} collection(s)`,this._emit("collectionsload",{})}catch(e){this._state.loading=!1,this._state.error=`Failed to load collections: ${e instanceof Error?e.message:String(e)}`,this._emit("error",{error:this._state.error})}this._render()}async _searchItems(){if(!this._state.selectedCatalog||!this._state.selectedCollection){this._state.error="Please select a catalog and collection.",this._render();return}if(!this._map){this._state.error="Map not available.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{const e=this._map.getBounds(),t=[e.getWest(),e.getSouth(),e.getEast(),e.getNorth()],n=`${this._state.selectedCatalog.url}/search`,s={collections:[this._state.selectedCollection.id],bbox:t,limit:this._state.maxItems};if(this._state.startDate||this._state.endDate){const l=this._state.startDate||"1900-01-01",h=this._state.endDate||new Date().toISOString().split("T")[0];s.datetime=`${l}T00:00:00Z/${h}T23:59:59Z`}if(this._state.queryFilter)try{const l=JSON.parse(this._state.queryFilter);s.query=l}catch{console.warn("Invalid query filter JSON:",this._state.queryFilter)}const r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!r.ok)throw new Error(`Search failed: ${r.status} ${r.statusText}`);const o=await r.json(),a=(o.features||[]).map(l=>{const h=l.links?.find(u=>u.rel==="self")?.href;return{id:l.id,datetime:l.properties?.datetime,geometry:l.geometry,bbox:l.bbox,selfLink:h,properties:l.properties,assets:l.assets}});this._state.items=a,this._state.selectedItem=a.length>0?a[0]:null,this._state.selectedItem&&this._updateAvailableAssets(this._state.selectedItem),this._state.loading=!1,this._state.status=`Found ${a.length} item(s)`,this._emit("search",{}),this._options.showFootprints&&a.length>0&&this._addFootprints(o.features||[])}catch(e){this._state.loading=!1,this._state.error=`Search failed: ${e instanceof Error?e.message:String(e)}`,this._emit("error",{error:this._state.error})}this._render()}_addFootprints(e){if(!this._map)return;this._removeFootprints();const t={type:"FeatureCollection",features:e.map(n=>({type:"Feature",geometry:n.geometry,properties:{id:n.id,datetime:n.properties?.datetime}}))};this._map.addSource(this._footprintSourceId,{type:"geojson",data:t}),this._map.addLayer({id:this._footprintLayerId,type:"fill",source:this._footprintSourceId,paint:{"fill-color":"#0078d7","fill-opacity":.1}}),this._map.addLayer({id:this._footprintOutlineLayerId,type:"line",source:this._footprintSourceId,paint:{"line-color":"#0078d7","line-width":2}}),this._map.addLayer({id:this._footprintHighlightLayerId,type:"fill",source:this._footprintSourceId,paint:{"fill-color":"#ff6b00","fill-opacity":.3},filter:["==",["get","id"],""]}),this._map.addLayer({id:this._footprintHighlightOutlineLayerId,type:"line",source:this._footprintSourceId,paint:{"line-color":"#ff6b00","line-width":3},filter:["==",["get","id"],""]}),this._updateFootprintHighlight(),this._map.on("click",this._footprintLayerId,n=>{if(n.features&&n.features.length>0){const s=n.features[0].properties?.id,r=this._state.items.find(o=>o.id===s);r&&(this._state.selectedItem=r,this._updateFootprintHighlight(),this._emit("itemselect",{item:r}),this._render())}}),this._map.on("mouseenter",this._footprintLayerId,()=>{this._map&&(this._map.getCanvas().style.cursor="pointer")}),this._map.on("mouseleave",this._footprintLayerId,()=>{this._map&&(this._map.getCanvas().style.cursor="")})}_removeFootprints(){this._map&&(this._map.getLayer(this._footprintHighlightOutlineLayerId)&&this._map.removeLayer(this._footprintHighlightOutlineLayerId),this._map.getLayer(this._footprintHighlightLayerId)&&this._map.removeLayer(this._footprintHighlightLayerId),this._map.getLayer(this._footprintOutlineLayerId)&&this._map.removeLayer(this._footprintOutlineLayerId),this._map.getLayer(this._footprintLayerId)&&this._map.removeLayer(this._footprintLayerId),this._map.getSource(this._footprintSourceId)&&this._map.removeSource(this._footprintSourceId))}_updateAvailableAssets(e){const t=[],n=new Set(["red","green","blue","nir","nir08","nir09","swir","swir16","swir22","coastal","data","visual","image","thumbnail","overview","B01","B02","B03","B04","B05","B06","B07","B08","B8A","B09","B10","B11","B12","AOT","WVP","SCL","SR_B1","SR_B2","SR_B3","SR_B4","SR_B5","SR_B6","SR_B7","ST_B10","lwir","lwir11","rgbir","raster","dem","dsm","dtm","elevation"]);if(e.assets)for(const[s,r]of Object.entries(e.assets)){const o=r,a=o.href||"",l=o.type||"",h=l.includes("geotiff")||l.includes("image/tiff")||l.includes("image/")||l.includes("application/x-hdf")||a.endsWith(".tif")||a.endsWith(".tiff")||a.endsWith(".jp2"),u=n.has(s)||n.has(s.toLowerCase()),d=s.includes("metadata")||s.includes("xml")||s.includes("json")||l.includes("application/json")||l.includes("application/xml")||l.includes("text/");(h||u)&&!d&&t.push(s)}if(t.sort(),this._state.availableAssets=t,t.length>0){(!this._state.selectedBand||!t.includes(this._state.selectedBand))&&(this._state.selectedBand=t[0]);const s=this._findDefaultRgbBands(t);(!this._state.rgbBands.r||!t.includes(this._state.rgbBands.r))&&(this._state.rgbBands.r=s.r),(!this._state.rgbBands.g||!t.includes(this._state.rgbBands.g))&&(this._state.rgbBands.g=s.g),(!this._state.rgbBands.b||!t.includes(this._state.rgbBands.b))&&(this._state.rgbBands.b=s.b)}}_findDefaultRgbBands(e){const t=[{r:"B04",g:"B03",b:"B02"},{r:"red",g:"green",b:"blue"},{r:"SR_B4",g:"SR_B3",b:"SR_B2"},{r:"B4",g:"B3",b:"B2"},{r:"visual",g:"visual",b:"visual"}];for(const n of t)if(e.includes(n.r)&&e.includes(n.g)&&e.includes(n.b))return n;return{r:e[0]||"",g:e[1]||e[0]||"",b:e[2]||e[0]||""}}_updateFootprintHighlight(){if(!this._map)return;const e=this._state.selectedItem?.id||"",t=["==",["get","id"],e];this._map.getLayer(this._footprintHighlightLayerId)&&this._map.setFilter(this._footprintHighlightLayerId,t),this._map.getLayer(this._footprintHighlightOutlineLayerId)&&this._map.setFilter(this._footprintHighlightOutlineLayerId,t)}_isPlanetaryComputer(){return this._state.selectedCatalog?.url?.includes("planetarycomputer.microsoft.com")??!1}_getDefaultAssets(e){return e.includes("sentinel-2")?"B04,B03,B02":e.includes("landsat")?"red,green,blue":e.includes("naip")?"image":e.includes("aster")?"VNIR":"data"}_getDefaultRescale(e){return e.includes("sentinel-2")?"0,3000&rescale=0,3000&rescale=0,3000":e.includes("landsat")?"0,20000&rescale=0,20000&rescale=0,20000":e.includes("dem")||e.includes("elevation")||e.includes("cop-dem")?"0,4000":e.includes("naip")||e.includes("aster")?"0,255&rescale=0,255&rescale=0,255":"0,10000"}async _displayItem(){if(!this._state.selectedItem){this._state.error="Please select an item.",this._render();return}if(!this._map){this._state.error="Map not available.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{if(this._isPlanetaryComputer()&&this._state.selectedCollection){await this._displayPlanetaryComputerItem();return}let e=this._state.selectedItem.selfLink;if(!e&&this._state.selectedCatalog&&this._state.selectedCollection&&(e=`${this._state.selectedCatalog.url}/collections/${this._state.selectedCollection.id}/items/${this._state.selectedItem.id}`),!e)throw new Error("Cannot determine item URL");const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch item: ${t.status}`);const n=await t.json();let s=null,r=null;const o=["visual","true-color","rgb","thumbnail"];for(const a of o)if(n.assets?.[a]){const l=n.assets[a];if(l.type?.includes("geotiff")||l.type?.includes("image/tiff")||l.href?.endsWith(".tif")){s=a,r=l.href;break}}if(!r)for(const[a,l]of Object.entries(n.assets||{})){const h=l;if(h.type?.includes("geotiff")||h.type?.includes("image/tiff")||h.href?.endsWith(".tif")){s=a,r=h.href;break}}if(!r)throw new Error("No COG/GeoTIFF asset found in item");if(await this._addCogLayer(r,n,s||"default"),n.bbox){const[a,l,h,u]=n.bbox;this._map.fitBounds([[a,l],[h,u]],{padding:50,duration:1e3})}this._state.hasLayer=this._cogLayers.size>0,this._state.loading=!1,this._state.status=`Displayed: ${this._state.selectedItem.id}`,this._emit("display",{item:this._state.selectedItem})}catch(e){this._state.loading=!1,this._state.error=`Failed to display: ${e instanceof Error?e.message:String(e)}`,this._emit("error",{error:this._state.error})}this._render()}async _displayPlanetaryComputerItem(){if(!this._map||!this._state.selectedItem||!this._state.selectedCollection)throw new Error("Missing required state for PC display");const e=this._state.selectedCollection.id,t=this._state.selectedItem.id,n="https://planetarycomputer.microsoft.com/api/data/v1";let s,r,o="";if(this._state.isRgbMode){const{r:u,g:d,b:g}=this._state.rgbBands;if(u&&d&&g){s=`assets=${u}&assets=${d}&assets=${g}`;const m=`${this._state.rescaleMin},${this._state.rescaleMax}`;r=`rescale=${m}&rescale=${m}&rescale=${m}`}else s=this._getDefaultAssets(e).split(",").map(v=>`assets=${v}`).join("&"),r=this._getDefaultRescale(e).split("&").map(v=>v.startsWith("rescale=")?v:`rescale=${v}`).join("&")}else s=`assets=${this._state.selectedBand||"data"}`,r=`rescale=${this._state.rescaleMin},${this._state.rescaleMax}`,this._state.colormap&&this._state.colormap!=="none"&&(o=`&colormap_name=${this._state.colormap}`);const a=`${n}/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x.png?collection=${encodeURIComponent(e)}&item=${encodeURIComponent(t)}&${s}&${r}${o}`,l=`stac-search-pc-${t}-${this._layerCounter++}`,h=`${l}-source`;if(this._map.addSource(h,{type:"raster",tiles:[a],tileSize:256,attribution:"Microsoft Planetary Computer"}),this._map.addLayer({id:l,type:"raster",source:h,paint:{"raster-opacity":1}}),this._cogLayers.set(l,{sourceId:h,layerId:l,type:"raster"}),this._state.selectedItem.bbox){const[u,d,g,m]=this._state.selectedItem.bbox;this._map.fitBounds([[u,d],[g,m]],{padding:50,duration:1e3})}this._state.hasLayer=this._cogLayers.size>0,this._state.loading=!1,this._state.status=`Displayed: ${this._state.selectedItem.id}`,this._emit("display",{item:this._state.selectedItem}),this._render()}async _ensureOverlay(){if(this._deckOverlay||!this._map)return;const{MapboxOverlay:e}=await Promise.resolve().then(()=>require("./index-CsAfY_en.cjs"));this._deckOverlay=new e({interleaved:!1,layers:[]}),this._map.addControl(this._deckOverlay)}_convertS3ToHttps(e){if(!e.startsWith("s3://"))return e;const t=e.match(/^s3:\/\/([^/]+)\/(.+)$/);if(!t)return e;const[,n,s]=t,o={"deafrica-sentinel-2":"af-south-1","deafrica-landsat":"af-south-1","deafrica-services":"af-south-1","dea-public-data":"ap-southeast-2","dea-public-data-dev":"ap-southeast-2"}[n]||"us-east-1";return`https://${n}.s3.${o}.amazonaws.com/${s}`}async _addCogLayer(e,t,n){await this._ensureOverlay();const s=this._convertS3ToHttps(e),{COGLayer:r}=await Promise.resolve().then(()=>require("./index-ChPRo5p6.cjs")),o=`stac-search-${t.id}-${n}-${this._layerCounter++}`,a=new r({id:o,geotiff:s,opacity:1});this._cogLayers.set(o,a),this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())})}_removeLayer(e){const t=this._cogLayers.get(e);if(t&&this._map&&t.type==="raster"&&t.sourceId&&(this._map.getLayer(t.layerId)&&this._map.removeLayer(t.layerId),this._map.getSource(t.sourceId)&&this._map.removeSource(t.sourceId)),this._cogLayers.delete(e),this._deckOverlay){const n=Array.from(this._cogLayers.values()).filter(s=>s.type!=="raster");this._deckOverlay.setProps({layers:n})}this._state.hasLayer=this._cogLayers.size>0,this._cogLayers.size===0&&(this._state.status=null),this._render()}_removeAllLayers(){const e=Array.from(this._cogLayers.keys());for(const t of e)this._removeLayer(t);this._state.status=null,this._render()}}const sfe=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
231
|
+
</svg>`;class AQ{_container;_button;_panel;_options;_state;_eventHandlers=new Map;_map;_handleZoom;_zoomVisible=!0;_footprintSourceId="stac-search-footprints";_footprintLayerId="stac-search-footprints-layer";_footprintOutlineLayerId="stac-search-footprints-outline";_footprintHighlightLayerId="stac-search-footprints-highlight";_footprintHighlightOutlineLayerId="stac-search-footprints-highlight-outline";_showCustomUrlInput=!1;_deckOverlay;_cogLayers=new Map;_layerCounter=0;constructor(e){this._options={...nfe,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed,catalogs:this._options.catalogs,selectedCatalog:this._options.catalogs.length>0?this._options.catalogs[0]:null,collections:[],selectedCollection:null,startDate:null,endDate:null,maxItems:this._options.maxItems,queryFilter:"",items:[],selectedItem:null,rescaleMin:this._options.defaultRescaleMin,rescaleMax:this._options.defaultRescaleMax,isRgbMode:this._options.defaultRgbMode,colormap:this._options.defaultColormap,availableAssets:[],selectedBand:null,rgbBands:{r:null,g:null,b:null},hasLayer:!1,loading:!1,error:null,status:null}}onAdd(e){return this._map=e,this._container=this._createContainer(),this._render(),this._handleZoom=()=>this._checkZoomVisibility(),this._map.on("zoom",this._handleZoom),this._checkZoomVisibility(),this._container}onRemove(){if(this._removeFootprints(),this._removeAllLayers(),this._map&&this._handleZoom&&(this._map.off("zoom",this._handleZoom),this._handleZoom=void 0),this._deckOverlay&&this._map){try{this._map.removeControl(this._deckOverlay)}catch{}this._deckOverlay=void 0}this._map=void 0,this._container?.parentNode?.removeChild(this._container),this._container=void 0,this._button=void 0,this._panel=void 0}getDefaultPosition(){return this._options.position}expand(){this._state.collapsed&&(this._state.collapsed=!1,this._render(),this._emit("expand",{}))}collapse(){this._state.collapsed||(this._state.collapsed=!0,this._render(),this._emit("collapse",{}))}toggle(){this._state.collapsed?this.expand():this.collapse()}show(){this._state.visible||(this._state.visible=!0,this._updateDisplayState(),this._emit("show",{}))}hide(){this._state.visible&&(this._state.visible=!1,this._updateDisplayState(),this._emit("hide",{}))}getState(){return{...this._state}}update(e){this._options={...this._options,...e},e.visible!==void 0&&(this._state.visible=e.visible),e.collapsed!==void 0&&(this._state.collapsed=e.collapsed),e.catalogs&&(this._state.catalogs=e.catalogs,e.catalogs.length>0&&!this._state.selectedCatalog&&(this._state.selectedCatalog=e.catalogs[0])),this._render()}on(e,t){this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t)}off(e,t){this._eventHandlers.get(e)?.delete(t)}getSelectedItem(){return this._state.selectedItem}getItems(){return[...this._state.items]}_emit(e,t){const n=this._eventHandlers.get(e);if(!n)return;const s={type:e,state:this._state,...t};for(const r of n)r(s)}_checkZoomVisibility(){if(!this._map)return;const e=this._map.getZoom(),t=this._zoomVisible;this._zoomVisible=e>=this._options.minzoom&&e<=this._options.maxzoom,t!==this._zoomVisible&&this._updateDisplayState()}_updateDisplayState(){if(!this._container)return;const e=this._state.visible&&this._zoomVisible;this._container.style.display=e?"block":"none"}_createContainer(){const e=document.createElement("div");return e.className=`maplibregl-ctrl maplibre-gl-stac-search ${this._options.className||""}`,this._options.backgroundColor&&(e.style.background=this._options.backgroundColor),this._options.borderRadius!==void 0&&(e.style.borderRadius=`${this._options.borderRadius}px`),this._options.opacity!==1&&(e.style.opacity=String(this._options.opacity)),e}_render(){if(!this._container)return;const t=this._container.querySelector(".maplibre-gl-stac-search-panel")?.scrollTop??0;if(this._container.innerHTML="",this._state.collapsed)this._renderCollapsed();else{this._renderExpanded();const n=this._container.querySelector(".maplibre-gl-stac-search-panel");n&&t>0&&(n.scrollTop=t)}}_renderCollapsed(){if(!this._container)return;const e=document.createElement("button");e.className=`maplibre-gl-stac-search-button${this._state.hasLayer?" maplibre-gl-stac-search-button--active":""}`,e.innerHTML=ife,e.title="STAC Search",e.addEventListener("click",()=>this.expand()),this._container.appendChild(e),this._button=e}_renderExpanded(){if(!this._container)return;const e=document.createElement("div");e.className="maplibre-gl-stac-search-panel",e.style.width=`${this._options.panelWidth}px`,this._options.maxHeight&&this._options.maxHeight>0&&(e.style.maxHeight=`${this._options.maxHeight}px`,e.style.overflowY="auto"),this._options.fontSize&&(e.style.fontSize=`${this._options.fontSize}px`),this._options.fontColor&&(e.style.color=this._options.fontColor);const t=document.createElement("div");t.className="maplibre-gl-stac-search-header";const n=document.createElement("span");n.className="maplibre-gl-stac-search-title",n.textContent="STAC Search",t.appendChild(n);const s=document.createElement("button");s.className="maplibre-gl-stac-search-close",s.innerHTML="×",s.addEventListener("click",()=>this.collapse()),t.appendChild(s),e.appendChild(t);const r=this._createFormGroup("Catalog","catalog"),o=document.createElement("select");o.id="stac-search-catalog",o.className="maplibre-gl-stac-search-select",o.style.color="#000";for(const L of this._state.catalogs){const k=document.createElement("option");k.value=L.url,k.textContent=L.name,k.selected=this._state.selectedCatalog?.url===L.url,o.appendChild(k)}const a=document.createElement("option");if(a.value="__custom__",a.textContent="── Custom URL ──",a.selected=this._showCustomUrlInput||this._state.selectedCatalog?.name==="__custom__",o.appendChild(a),o.addEventListener("change",()=>{if(o.value==="__custom__"){this._showCustomUrlInput=!0,this._render();return}this._showCustomUrlInput=!1;const L=this._state.catalogs.find(k=>k.url===o.value);L&&(this._state.selectedCatalog=L,this._state.collections=[],this._state.selectedCollection=null,this._state.items=[],this._state.selectedItem=null,this._emit("catalogselect",{catalog:L}),this._render())}),r.appendChild(o),this._showCustomUrlInput||this._state.selectedCatalog?.name==="__custom__"){const L=document.createElement("div");L.className="maplibre-gl-stac-search-custom-url-row";const k=document.createElement("input");k.type="text",k.id="stac-search-custom-url",k.className="maplibre-gl-stac-search-input",k.style.color="#000",k.placeholder="https://stac-api.example.com/v1",k.value=this._state.selectedCatalog?.name==="__custom__"?this._state.selectedCatalog.url:"";const D=document.createElement("button");D.className="maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--secondary",D.textContent="Use",D.addEventListener("click",()=>{const Y=k.value.trim();Y&&(this._showCustomUrlInput=!1,this._state.selectedCatalog={name:"__custom__",url:Y},this._state.collections=[],this._state.selectedCollection=null,this._state.items=[],this._state.selectedItem=null,this._emit("catalogselect",{catalog:this._state.selectedCatalog}),this._render())}),L.appendChild(k),L.appendChild(D),r.appendChild(L)}e.appendChild(r);const l=this._createFormGroup("Collection","collection"),h=document.createElement("div");h.className="maplibre-gl-stac-search-row";const u=document.createElement("button");u.className="maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--secondary",u.textContent="Collections",u.disabled=this._state.loading||!this._state.selectedCatalog,u.addEventListener("click",()=>this._fetchCollections()),h.appendChild(u);const d=document.createElement("select");if(d.id="stac-search-collection",d.className="maplibre-gl-stac-search-select maplibre-gl-stac-search-select--flex",d.style.color="#000",d.disabled=this._state.collections.length===0,this._state.collections.length===0){const L=document.createElement("option");L.value="",L.textContent="-- Click Collections --",d.appendChild(L)}else for(const L of this._state.collections){const k=document.createElement("option");k.value=L.id,k.textContent=L.title||L.id,k.selected=this._state.selectedCollection?.id===L.id,d.appendChild(k)}d.addEventListener("change",()=>{const L=this._state.collections.find(k=>k.id===d.value);L&&(this._state.selectedCollection=L,this._state.items=[],this._state.selectedItem=null,this._emit("collectionselect",{collection:L}),this._render())}),h.appendChild(d),l.appendChild(h),e.appendChild(l);const g=this._createFormGroup("Date Range","date"),m=document.createElement("div");m.className="maplibre-gl-stac-search-date-row";const v=document.createElement("input");v.type="date",v.id="stac-search-start-date",v.className="maplibre-gl-stac-search-input maplibre-gl-stac-search-input--half",v.style.color="#000",v.value=this._state.startDate||"",v.addEventListener("change",()=>{this._state.startDate=v.value||null});const b=document.createElement("input");b.type="date",b.id="stac-search-end-date",b.className="maplibre-gl-stac-search-input maplibre-gl-stac-search-input--half",b.style.color="#000",b.value=this._state.endDate||"",b.addEventListener("change",()=>{this._state.endDate=b.value||null}),m.appendChild(v),m.appendChild(b),g.appendChild(m),e.appendChild(g);const w=this._createFormGroup("Max Items","maxitems"),x=document.createElement("input");x.type="number",x.id="stac-search-maxitems",x.className="maplibre-gl-stac-search-input",x.style.color="#000",x.min="1",x.max="100",x.value=String(this._state.maxItems),x.addEventListener("change",()=>{this._state.maxItems=Math.max(1,Math.min(100,Number(x.value)||20))}),w.appendChild(x),e.appendChild(w);const I=this._createFormGroup("Query Filter (optional)","query"),T=document.createElement("input");T.type="text",T.id="stac-search-query",T.className="maplibre-gl-stac-search-input",T.style.color="#000",T.placeholder='{"eo:cloud_cover": {"lt": 10}}',T.value=this._state.queryFilter,T.addEventListener("change",()=>{this._state.queryFilter=T.value.trim()}),I.appendChild(T);const R=document.createElement("div");R.className="maplibre-gl-stac-search-hint",R.textContent="JSON filter, e.g., cloud cover < 10%",I.appendChild(R),e.appendChild(I);const F=document.createElement("div");F.className="maplibre-gl-stac-search-form-group";const z=document.createElement("button");z.className="maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--primary",z.textContent="Search Items",z.disabled=this._state.loading||!this._state.selectedCollection,z.addEventListener("click",()=>this._searchItems()),F.appendChild(z);const U=document.createElement("div");U.className="maplibre-gl-stac-search-hint-row";const N=document.createElement("div");if(N.className="maplibre-gl-stac-search-hint",N.textContent="Uses current map bounds",U.appendChild(N),this._state.items.length>0){const L=document.createElement("button");L.className="maplibre-gl-stac-search-btn-clear-footprints",L.textContent="Clear Footprints",L.title="Remove footprints from map",L.addEventListener("click",()=>{this._removeFootprints(),this._state.items=[],this._state.selectedItem=null,this._render()}),U.appendChild(L)}if(F.appendChild(U),e.appendChild(F),this._state.items.length>0){const L=this._createFormGroup("Select Item","item"),k=document.createElement("select");k.id="stac-search-item",k.className="maplibre-gl-stac-search-select",k.style.color="#000";for(const ue of this._state.items){const pe=document.createElement("option");pe.value=ue.id;const ae=ue.datetime?new Date(ue.datetime).toLocaleDateString():"";pe.textContent=`${ue.id}${ae?` (${ae})`:""}`,pe.selected=this._state.selectedItem?.id===ue.id,k.appendChild(pe)}k.addEventListener("change",()=>{const ue=this._state.items.find(pe=>pe.id===k.value);ue&&(this._state.selectedItem=ue,this._updateAvailableAssets(ue),this._updateFootprintHighlight(),this._emit("itemselect",{item:ue}),this._render())}),L.appendChild(k),e.appendChild(L);const D=this._createFormGroup("Visualization Mode","mode"),Y=document.createElement("div");Y.className="maplibre-gl-stac-search-mode-row";const Z=document.createElement("button");Z.className=`maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--toggle ${this._state.isRgbMode?"":"active"}`,Z.textContent="Single Band",Z.addEventListener("click",()=>{this._state.isRgbMode=!1,this._render()});const j=document.createElement("button");j.className=`maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--toggle ${this._state.isRgbMode?"active":""}`,j.textContent="RGB Composite",j.addEventListener("click",()=>{this._state.isRgbMode=!0,this._render()}),Y.appendChild(Z),Y.appendChild(j),D.appendChild(Y),e.appendChild(D);const Q=this._state.availableAssets;if(this._state.isRgbMode){const ue=this._createFormGroup("RGB Bands","rgb"),pe=document.createElement("div");pe.className="maplibre-gl-stac-search-rgb-row";const ae=[{key:"r",label:"R"},{key:"g",label:"G"},{key:"b",label:"B"}];for(const ye of ae){const Me=document.createElement("div");Me.className="maplibre-gl-stac-search-rgb-channel";const Ne=document.createElement("label");Ne.textContent=ye.label,Ne.className="maplibre-gl-stac-search-rgb-label",Me.appendChild(Ne);const me=document.createElement("select");me.className="maplibre-gl-stac-search-select maplibre-gl-stac-search-select--small",me.style.color="#000";for(const Ke of Q){const ze=document.createElement("option");ze.value=Ke,ze.textContent=Ke,ze.selected=this._state.rgbBands[ye.key]===Ke,me.appendChild(ze)}me.addEventListener("change",()=>{this._state.rgbBands[ye.key]=me.value}),Me.appendChild(me),pe.appendChild(Me)}ue.appendChild(pe),e.appendChild(ue)}else{const ue=this._createFormGroup("Band","band"),pe=document.createElement("select");pe.id="stac-search-band",pe.className="maplibre-gl-stac-search-select",pe.style.color="#000";for(const Ne of Q){const me=document.createElement("option");me.value=Ne,me.textContent=Ne,me.selected=this._state.selectedBand===Ne,pe.appendChild(me)}pe.addEventListener("change",()=>{this._state.selectedBand=pe.value}),ue.appendChild(pe),e.appendChild(ue);const ae=this._createFormGroup("Colormap","colormap"),ye=document.createElement("select");ye.id="stac-search-colormap",ye.className="maplibre-gl-stac-search-select",ye.style.color="#000";const Me=document.createElement("option");Me.value="none",Me.textContent="None (Grayscale)",Me.selected=this._state.colormap==="none",ye.appendChild(Me);for(const Ne of tfe){const me=document.createElement("option");me.value=Ne,me.textContent=Ne,me.selected=this._state.colormap===Ne,ye.appendChild(me)}ye.addEventListener("change",()=>{this._state.colormap=ye.value}),ae.appendChild(ye),e.appendChild(ae)}const $=this._createFormGroup("Rescale Range","rescale"),W=document.createElement("div");W.className="maplibre-gl-stac-search-rescale-row";const q=document.createElement("input");q.type="number",q.className="maplibre-gl-stac-search-input maplibre-gl-stac-search-input--half",q.style.color="#000",q.placeholder="Min",q.value=String(this._state.rescaleMin),q.addEventListener("change",()=>{this._state.rescaleMin=Number(q.value)||0});const ee=document.createElement("input");ee.type="number",ee.className="maplibre-gl-stac-search-input maplibre-gl-stac-search-input--half",ee.style.color="#000",ee.placeholder="Max",ee.value=String(this._state.rescaleMax),ee.addEventListener("change",()=>{this._state.rescaleMax=Number(ee.value)||1e4}),W.appendChild(q),W.appendChild(ee),$.appendChild(W),e.appendChild($);const ne=document.createElement("div");ne.className="maplibre-gl-stac-search-form-group";const oe=document.createElement("button");oe.className="maplibre-gl-stac-search-btn maplibre-gl-stac-search-btn--primary",oe.textContent="Display Item",oe.disabled=this._state.loading||!this._state.selectedItem,oe.addEventListener("click",()=>this._displayItem()),ne.appendChild(oe),e.appendChild(ne)}if(this._state.loading?this._appendStatus(e,"Loading...","info"):this._state.error?this._appendStatus(e,this._state.error,"error"):this._state.status&&this._appendStatus(e,this._state.status,"success"),this._cogLayers.size>0){const L=document.createElement("div");L.className="maplibre-gl-stac-search-list";const k=document.createElement("div");k.className="maplibre-gl-stac-search-list-header-row";const D=document.createElement("div");D.className="maplibre-gl-stac-search-list-header",D.textContent=`Layers (${this._cogLayers.size})`,k.appendChild(D);const Y=document.createElement("button");Y.className="maplibre-gl-stac-search-btn-clear",Y.textContent="Clear All",Y.title="Remove all layers",Y.addEventListener("click",()=>{this._removeAllLayers(),this._render()}),k.appendChild(Y),L.appendChild(k);for(const[Z]of this._cogLayers){const j=document.createElement("div");j.className="maplibre-gl-stac-search-list-item";const Q=document.createElement("span");Q.className="maplibre-gl-stac-search-list-label",Q.textContent=Z,j.appendChild(Q);const $=document.createElement("button");$.className="maplibre-gl-stac-search-list-remove",$.innerHTML="×",$.title="Remove layer",$.addEventListener("click",()=>{this._removeLayer(Z),this._render()}),j.appendChild($),L.appendChild(j)}e.appendChild(L)}this._container.appendChild(e),this._panel=e,this._button=void 0}_createFormGroup(e,t){const n=document.createElement("div");n.className="maplibre-gl-stac-search-form-group";const s=document.createElement("label");return s.textContent=e,s.htmlFor=`stac-search-${t}`,n.appendChild(s),n}_appendStatus(e,t,n){const s=document.createElement("div");s.className=`maplibre-gl-stac-search-status maplibre-gl-stac-search-status--${n}`,s.textContent=t,e.appendChild(s)}async _fetchCollections(){if(!this._state.selectedCatalog){this._state.error="Please select a catalog.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{const e=`${this._state.selectedCatalog.url}/collections`,t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch: ${t.status} ${t.statusText}`);const s=((await t.json()).collections||[]).map(r=>({id:r.id,title:r.title,description:r.description}));s.sort((r,o)=>{const a=r.title||r.id,l=o.title||o.id;return a.localeCompare(l)}),this._state.collections=s,this._state.selectedCollection=s.length>0?s[0]:null,this._state.loading=!1,this._state.status=`Found ${s.length} collection(s)`,this._emit("collectionsload",{})}catch(e){this._state.loading=!1,this._state.error=`Failed to load collections: ${e instanceof Error?e.message:String(e)}`,this._emit("error",{error:this._state.error})}this._render()}async _searchItems(){if(!this._state.selectedCatalog||!this._state.selectedCollection){this._state.error="Please select a catalog and collection.",this._render();return}if(!this._map){this._state.error="Map not available.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{const e=this._map.getBounds(),t=[e.getWest(),e.getSouth(),e.getEast(),e.getNorth()],n=`${this._state.selectedCatalog.url}/search`,s={collections:[this._state.selectedCollection.id],bbox:t,limit:this._state.maxItems};if(this._state.startDate||this._state.endDate){const l=this._state.startDate||"1900-01-01",h=this._state.endDate||new Date().toISOString().split("T")[0];s.datetime=`${l}T00:00:00Z/${h}T23:59:59Z`}if(this._state.queryFilter)try{const l=JSON.parse(this._state.queryFilter);s.query=l}catch{console.warn("Invalid query filter JSON:",this._state.queryFilter)}const r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!r.ok)throw new Error(`Search failed: ${r.status} ${r.statusText}`);const o=await r.json(),a=(o.features||[]).map(l=>{const h=l.links?.find(u=>u.rel==="self")?.href;return{id:l.id,datetime:l.properties?.datetime,geometry:l.geometry,bbox:l.bbox,selfLink:h,properties:l.properties,assets:l.assets}});this._state.items=a,this._state.selectedItem=a.length>0?a[0]:null,this._state.selectedItem&&this._updateAvailableAssets(this._state.selectedItem),this._state.loading=!1,this._state.status=`Found ${a.length} item(s)`,this._emit("search",{}),this._options.showFootprints&&a.length>0&&this._addFootprints(o.features||[])}catch(e){this._state.loading=!1,this._state.error=`Search failed: ${e instanceof Error?e.message:String(e)}`,this._emit("error",{error:this._state.error})}this._render()}_addFootprints(e){if(!this._map)return;this._removeFootprints();const t={type:"FeatureCollection",features:e.map(n=>({type:"Feature",geometry:n.geometry,properties:{id:n.id,datetime:n.properties?.datetime}}))};this._map.addSource(this._footprintSourceId,{type:"geojson",data:t}),this._map.addLayer({id:this._footprintLayerId,type:"fill",source:this._footprintSourceId,paint:{"fill-color":"#0078d7","fill-opacity":.1}}),this._map.addLayer({id:this._footprintOutlineLayerId,type:"line",source:this._footprintSourceId,paint:{"line-color":"#0078d7","line-width":2}}),this._map.addLayer({id:this._footprintHighlightLayerId,type:"fill",source:this._footprintSourceId,paint:{"fill-color":"#ff6b00","fill-opacity":.3},filter:["==",["get","id"],""]}),this._map.addLayer({id:this._footprintHighlightOutlineLayerId,type:"line",source:this._footprintSourceId,paint:{"line-color":"#ff6b00","line-width":3},filter:["==",["get","id"],""]}),this._updateFootprintHighlight(),this._map.on("click",this._footprintLayerId,n=>{if(n.features&&n.features.length>0){const s=n.features[0].properties?.id,r=this._state.items.find(o=>o.id===s);r&&(this._state.selectedItem=r,this._updateFootprintHighlight(),this._emit("itemselect",{item:r}),this._render())}}),this._map.on("mouseenter",this._footprintLayerId,()=>{this._map&&(this._map.getCanvas().style.cursor="pointer")}),this._map.on("mouseleave",this._footprintLayerId,()=>{this._map&&(this._map.getCanvas().style.cursor="")})}_removeFootprints(){this._map&&(this._map.getLayer(this._footprintHighlightOutlineLayerId)&&this._map.removeLayer(this._footprintHighlightOutlineLayerId),this._map.getLayer(this._footprintHighlightLayerId)&&this._map.removeLayer(this._footprintHighlightLayerId),this._map.getLayer(this._footprintOutlineLayerId)&&this._map.removeLayer(this._footprintOutlineLayerId),this._map.getLayer(this._footprintLayerId)&&this._map.removeLayer(this._footprintLayerId),this._map.getSource(this._footprintSourceId)&&this._map.removeSource(this._footprintSourceId))}_updateAvailableAssets(e){const t=[],n=new Set(["red","green","blue","nir","nir08","nir09","swir","swir16","swir22","coastal","data","visual","image","thumbnail","overview","B01","B02","B03","B04","B05","B06","B07","B08","B8A","B09","B10","B11","B12","AOT","WVP","SCL","SR_B1","SR_B2","SR_B3","SR_B4","SR_B5","SR_B6","SR_B7","ST_B10","lwir","lwir11","rgbir","raster","dem","dsm","dtm","elevation"]);if(e.assets)for(const[s,r]of Object.entries(e.assets)){const o=r,a=o.href||"",l=o.type||"",h=l.includes("geotiff")||l.includes("image/tiff")||l.includes("image/")||l.includes("application/x-hdf")||a.endsWith(".tif")||a.endsWith(".tiff")||a.endsWith(".jp2"),u=n.has(s)||n.has(s.toLowerCase()),d=s.includes("metadata")||s.includes("xml")||s.includes("json")||l.includes("application/json")||l.includes("application/xml")||l.includes("text/");(h||u)&&!d&&t.push(s)}if(t.sort(),this._state.availableAssets=t,t.length>0){(!this._state.selectedBand||!t.includes(this._state.selectedBand))&&(this._state.selectedBand=t[0]);const s=this._findDefaultRgbBands(t);(!this._state.rgbBands.r||!t.includes(this._state.rgbBands.r))&&(this._state.rgbBands.r=s.r),(!this._state.rgbBands.g||!t.includes(this._state.rgbBands.g))&&(this._state.rgbBands.g=s.g),(!this._state.rgbBands.b||!t.includes(this._state.rgbBands.b))&&(this._state.rgbBands.b=s.b)}}_findDefaultRgbBands(e){const t=[{r:"B04",g:"B03",b:"B02"},{r:"red",g:"green",b:"blue"},{r:"SR_B4",g:"SR_B3",b:"SR_B2"},{r:"B4",g:"B3",b:"B2"},{r:"visual",g:"visual",b:"visual"}];for(const n of t)if(e.includes(n.r)&&e.includes(n.g)&&e.includes(n.b))return n;return{r:e[0]||"",g:e[1]||e[0]||"",b:e[2]||e[0]||""}}_updateFootprintHighlight(){if(!this._map)return;const e=this._state.selectedItem?.id||"",t=["==",["get","id"],e];this._map.getLayer(this._footprintHighlightLayerId)&&this._map.setFilter(this._footprintHighlightLayerId,t),this._map.getLayer(this._footprintHighlightOutlineLayerId)&&this._map.setFilter(this._footprintHighlightOutlineLayerId,t)}_isPlanetaryComputer(){return this._state.selectedCatalog?.url?.includes("planetarycomputer.microsoft.com")??!1}_getDefaultAssets(e){return e.includes("sentinel-2")?"B04,B03,B02":e.includes("landsat")?"red,green,blue":e.includes("naip")?"image":e.includes("aster")?"VNIR":"data"}_getDefaultRescale(e){return e.includes("sentinel-2")?"0,3000&rescale=0,3000&rescale=0,3000":e.includes("landsat")?"0,20000&rescale=0,20000&rescale=0,20000":e.includes("dem")||e.includes("elevation")||e.includes("cop-dem")?"0,4000":e.includes("naip")||e.includes("aster")?"0,255&rescale=0,255&rescale=0,255":"0,10000"}async _displayItem(){if(!this._state.selectedItem){this._state.error="Please select an item.",this._render();return}if(!this._map){this._state.error="Map not available.",this._render();return}this._state.loading=!0,this._state.error=null,this._state.status=null,this._render();try{if(this._isPlanetaryComputer()&&this._state.selectedCollection){await this._displayPlanetaryComputerItem();return}let e=this._state.selectedItem.selfLink;if(!e&&this._state.selectedCatalog&&this._state.selectedCollection&&(e=`${this._state.selectedCatalog.url}/collections/${this._state.selectedCollection.id}/items/${this._state.selectedItem.id}`),!e)throw new Error("Cannot determine item URL");const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch item: ${t.status}`);const n=await t.json();let s=null,r=null;const o=["visual","true-color","rgb","thumbnail"];for(const a of o)if(n.assets?.[a]){const l=n.assets[a];if(l.type?.includes("geotiff")||l.type?.includes("image/tiff")||l.href?.endsWith(".tif")){s=a,r=l.href;break}}if(!r)for(const[a,l]of Object.entries(n.assets||{})){const h=l;if(h.type?.includes("geotiff")||h.type?.includes("image/tiff")||h.href?.endsWith(".tif")){s=a,r=h.href;break}}if(!r)throw new Error("No COG/GeoTIFF asset found in item");if(await this._addCogLayer(r,n,s||"default"),n.bbox){const[a,l,h,u]=n.bbox;this._map.fitBounds([[a,l],[h,u]],{padding:50,duration:1e3})}this._state.hasLayer=this._cogLayers.size>0,this._state.loading=!1,this._state.status=`Displayed: ${this._state.selectedItem.id}`,this._emit("display",{item:this._state.selectedItem})}catch(e){this._state.loading=!1,this._state.error=`Failed to display: ${e instanceof Error?e.message:String(e)}`,this._emit("error",{error:this._state.error})}this._render()}async _displayPlanetaryComputerItem(){if(!this._map||!this._state.selectedItem||!this._state.selectedCollection)throw new Error("Missing required state for PC display");const e=this._state.selectedCollection.id,t=this._state.selectedItem.id,n="https://planetarycomputer.microsoft.com/api/data/v1";let s,r,o="";if(this._state.isRgbMode){const{r:u,g:d,b:g}=this._state.rgbBands;if(u&&d&&g){s=`assets=${u}&assets=${d}&assets=${g}`;const m=`${this._state.rescaleMin},${this._state.rescaleMax}`;r=`rescale=${m}&rescale=${m}&rescale=${m}`}else s=this._getDefaultAssets(e).split(",").map(v=>`assets=${v}`).join("&"),r=this._getDefaultRescale(e).split("&").map(v=>v.startsWith("rescale=")?v:`rescale=${v}`).join("&")}else s=`assets=${this._state.selectedBand||"data"}`,r=`rescale=${this._state.rescaleMin},${this._state.rescaleMax}`,this._state.colormap&&this._state.colormap!=="none"&&(o=`&colormap_name=${this._state.colormap}`);const a=`${n}/item/tiles/WebMercatorQuad/{z}/{x}/{y}@1x.png?collection=${encodeURIComponent(e)}&item=${encodeURIComponent(t)}&${s}&${r}${o}`,l=`stac-search-pc-${t}-${this._layerCounter++}`,h=`${l}-source`;if(this._map.addSource(h,{type:"raster",tiles:[a],tileSize:256,attribution:"Microsoft Planetary Computer"}),this._map.addLayer({id:l,type:"raster",source:h,paint:{"raster-opacity":1}}),this._cogLayers.set(l,{sourceId:h,layerId:l,type:"raster"}),this._state.selectedItem.bbox){const[u,d,g,m]=this._state.selectedItem.bbox;this._map.fitBounds([[u,d],[g,m]],{padding:50,duration:1e3})}this._state.hasLayer=this._cogLayers.size>0,this._state.loading=!1,this._state.status=`Displayed: ${this._state.selectedItem.id}`,this._emit("display",{item:this._state.selectedItem}),this._render()}async _ensureOverlay(){if(this._deckOverlay||!this._map)return;const{MapboxOverlay:e}=await Promise.resolve().then(()=>require("./index-C8CBe27l.cjs"));this._deckOverlay=new e({interleaved:!1,layers:[]}),this._map.addControl(this._deckOverlay)}_convertS3ToHttps(e){if(!e.startsWith("s3://"))return e;const t=e.match(/^s3:\/\/([^/]+)\/(.+)$/);if(!t)return e;const[,n,s]=t,o={"deafrica-sentinel-2":"af-south-1","deafrica-landsat":"af-south-1","deafrica-services":"af-south-1","dea-public-data":"ap-southeast-2","dea-public-data-dev":"ap-southeast-2"}[n]||"us-east-1";return`https://${n}.s3.${o}.amazonaws.com/${s}`}async _addCogLayer(e,t,n){await this._ensureOverlay();const s=this._convertS3ToHttps(e),{COGLayer:r}=await Promise.resolve().then(()=>require("./index-rhQrpZSD.cjs")),o=`stac-search-${t.id}-${n}-${this._layerCounter++}`,a=new r({id:o,geotiff:s,opacity:1});this._cogLayers.set(o,a),this._deckOverlay.setProps({layers:Array.from(this._cogLayers.values())})}_removeLayer(e){const t=this._cogLayers.get(e);if(t&&this._map&&t.type==="raster"&&t.sourceId&&(this._map.getLayer(t.layerId)&&this._map.removeLayer(t.layerId),this._map.getSource(t.sourceId)&&this._map.removeSource(t.sourceId)),this._cogLayers.delete(e),this._deckOverlay){const n=Array.from(this._cogLayers.values()).filter(s=>s.type!=="raster");this._deckOverlay.setProps({layers:n})}this._state.hasLayer=this._cogLayers.size>0,this._cogLayers.size===0&&(this._state.status=null),this._render()}_removeAllLayers(){const e=Array.from(this._cogLayers.keys());for(const t of e)this._removeLayer(t);this._state.status=null,this._render()}}const sfe=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
232
232
|
<circle cx="5" cy="5" r="3" fill="currentColor"/>
|
|
233
233
|
<polyline points="12 4 20 4 20 12" stroke-width="2"/>
|
|
234
234
|
<polygon points="4 14 12 11 18 16 14 22 6 22 4 14" fill="currentColor" fill-opacity="0.25"/>
|
|
@@ -7087,7 +7087,7 @@ void main() {
|
|
|
7087
7087
|
|
|
7088
7088
|
}
|
|
7089
7089
|
|
|
7090
|
-
}`;class V8e{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const s=new wa,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new zc({vertexShader:z8e,fragmentShader:$8e,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new mo(new $k(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}let G8e=class extends pg{constructor(e,t){super();const n=this;let s=null,r=1,o=null,a="local-floor",l=1,h=null,u=null,d=null,g=null,m=null,v=null;const b=new V8e,w=t.getContextAttributes();let x=null,I=null;const T=[],R=[],F=new Ci;let z=null;const U=new Eo;U.viewport=new Ii;const N=new Eo;N.viewport=new Ii;const L=[U,N],k=new tFe;let D=null,Y=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ae){let ye=T[ae];return ye===void 0&&(ye=new JT,T[ae]=ye),ye.getTargetRaySpace()},this.getControllerGrip=function(ae){let ye=T[ae];return ye===void 0&&(ye=new JT,T[ae]=ye),ye.getGripSpace()},this.getHand=function(ae){let ye=T[ae];return ye===void 0&&(ye=new JT,T[ae]=ye),ye.getHandSpace()};function Z(ae){const ye=R.indexOf(ae.inputSource);if(ye===-1)return;const Me=T[ye];Me!==void 0&&(Me.update(ae.inputSource,ae.frame,h||o),Me.dispatchEvent({type:ae.type,data:ae.inputSource}))}function j(){s.removeEventListener("select",Z),s.removeEventListener("selectstart",Z),s.removeEventListener("selectend",Z),s.removeEventListener("squeeze",Z),s.removeEventListener("squeezestart",Z),s.removeEventListener("squeezeend",Z),s.removeEventListener("end",j),s.removeEventListener("inputsourceschange",Q);for(let ae=0;ae<T.length;ae++){const ye=R[ae];ye!==null&&(R[ae]=null,T[ae].disconnect(ye))}D=null,Y=null,b.reset(),e.setRenderTarget(x),m=null,g=null,d=null,s=null,I=null,pe.stop(),n.isPresenting=!1,e.setPixelRatio(z),e.setSize(F.width,F.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ae){r=ae,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ae){a=ae,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||o},this.setReferenceSpace=function(ae){h=ae},this.getBaseLayer=function(){return g!==null?g:m},this.getBinding=function(){return d},this.getFrame=function(){return v},this.getSession=function(){return s},this.setSession=async function(ae){if(s=ae,s!==null){if(x=e.getRenderTarget(),s.addEventListener("select",Z),s.addEventListener("selectstart",Z),s.addEventListener("selectend",Z),s.addEventListener("squeeze",Z),s.addEventListener("squeezestart",Z),s.addEventListener("squeezeend",Z),s.addEventListener("end",j),s.addEventListener("inputsourceschange",Q),w.xrCompatible!==!0&&await t.makeXRCompatible(),z=e.getPixelRatio(),e.getSize(F),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Me=null,Ne=null,me=null;w.depth&&(me=w.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Me=w.stencil?Gv:Vv,Ne=w.stencil?$v:za);const Ke={colorFormat:t.RGBA8,depthFormat:me,scaleFactor:r};d=new XRWebGLBinding(s,t),g=d.createProjectionLayer(Ke),s.updateRenderState({layers:[g]}),e.setPixelRatio(1),e.setSize(g.textureWidth,g.textureHeight,!1),I=new Ph(g.textureWidth,g.textureHeight,{format:go,type:ba,depthTexture:new aY(g.textureWidth,g.textureHeight,Ne,void 0,void 0,void 0,void 0,void 0,void 0,Me),stencilBuffer:w.stencil,colorSpace:e.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}else{const Me={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:r};m=new XRWebGLLayer(s,t,Me),s.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),I=new Ph(m.framebufferWidth,m.framebufferHeight,{format:go,type:ba,colorSpace:e.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}I.isXRRenderTarget=!0,this.setFoveation(l),h=null,o=await s.requestReferenceSpace(a),pe.setContext(s),pe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return b.getDepthTexture()};function Q(ae){for(let ye=0;ye<ae.removed.length;ye++){const Me=ae.removed[ye],Ne=R.indexOf(Me);Ne>=0&&(R[Ne]=null,T[Ne].disconnect(Me))}for(let ye=0;ye<ae.added.length;ye++){const Me=ae.added[ye];let Ne=R.indexOf(Me);if(Ne===-1){for(let Ke=0;Ke<T.length;Ke++)if(Ke>=R.length){R.push(Me),Ne=Ke;break}else if(R[Ke]===null){R[Ke]=Me,Ne=Ke;break}if(Ne===-1)break}const me=T[Ne];me&&me.connect(Me)}}const $=new $e,W=new $e;function q(ae,ye,Me){$.setFromMatrixPosition(ye.matrixWorld),W.setFromMatrixPosition(Me.matrixWorld);const Ne=$.distanceTo(W),me=ye.projectionMatrix.elements,Ke=Me.projectionMatrix.elements,ze=me[14]/(me[10]-1),qe=me[14]/(me[10]+1),le=(me[9]+1)/me[5],ot=(me[9]-1)/me[5],ve=(me[8]-1)/me[0],mt=(Ke[8]+1)/Ke[0],yt=ze*ve,Ie=ze*mt,Ae=Ne/(-ve+mt),Fe=Ae*-ve;if(ye.matrixWorld.decompose(ae.position,ae.quaternion,ae.scale),ae.translateX(Fe),ae.translateZ(Ae),ae.matrixWorld.compose(ae.position,ae.quaternion,ae.scale),ae.matrixWorldInverse.copy(ae.matrixWorld).invert(),me[10]===-1)ae.projectionMatrix.copy(ye.projectionMatrix),ae.projectionMatrixInverse.copy(ye.projectionMatrixInverse);else{const dt=ze+Ae,vt=qe+Ae,Yt=yt-Fe,we=Ie+(Ne-Fe),se=le*qe/vt*dt,He=ot*qe/vt*dt;ae.projectionMatrix.makePerspective(Yt,we,se,He,dt,vt),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert()}}function ee(ae,ye){ye===null?ae.matrixWorld.copy(ae.matrix):ae.matrixWorld.multiplyMatrices(ye.matrixWorld,ae.matrix),ae.matrixWorldInverse.copy(ae.matrixWorld).invert()}this.updateCamera=function(ae){if(s===null)return;let ye=ae.near,Me=ae.far;b.texture!==null&&(b.depthNear>0&&(ye=b.depthNear),b.depthFar>0&&(Me=b.depthFar)),k.near=N.near=U.near=ye,k.far=N.far=U.far=Me,(D!==k.near||Y!==k.far)&&(s.updateRenderState({depthNear:k.near,depthFar:k.far}),D=k.near,Y=k.far),U.layers.mask=ae.layers.mask|2,N.layers.mask=ae.layers.mask|4,k.layers.mask=U.layers.mask|N.layers.mask;const Ne=ae.parent,me=k.cameras;ee(k,Ne);for(let Ke=0;Ke<me.length;Ke++)ee(me[Ke],Ne);me.length===2?q(k,U,N):k.projectionMatrix.copy(U.projectionMatrix),ne(ae,k,Ne)};function ne(ae,ye,Me){Me===null?ae.matrix.copy(ye.matrixWorld):(ae.matrix.copy(Me.matrixWorld),ae.matrix.invert(),ae.matrix.multiply(ye.matrixWorld)),ae.matrix.decompose(ae.position,ae.quaternion,ae.scale),ae.updateMatrixWorld(!0),ae.projectionMatrix.copy(ye.projectionMatrix),ae.projectionMatrixInverse.copy(ye.projectionMatrixInverse),ae.isPerspectiveCamera&&(ae.fov=i0*2*Math.atan(1/ae.projectionMatrix.elements[5]),ae.zoom=1)}this.getCamera=function(){return k},this.getFoveation=function(){if(!(g===null&&m===null))return l},this.setFoveation=function(ae){l=ae,g!==null&&(g.fixedFoveation=ae),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=ae)},this.hasDepthSensing=function(){return b.texture!==null},this.getDepthSensingMesh=function(){return b.getMesh(k)};let oe=null;function ue(ae,ye){if(u=ye.getViewerPose(h||o),v=ye,u!==null){const Me=u.views;m!==null&&(e.setRenderTargetFramebuffer(I,m.framebuffer),e.setRenderTarget(I));let Ne=!1;Me.length!==k.cameras.length&&(k.cameras.length=0,Ne=!0);for(let ze=0;ze<Me.length;ze++){const qe=Me[ze];let le=null;if(m!==null)le=m.getViewport(qe);else{const ve=d.getViewSubImage(g,qe);le=ve.viewport,ze===0&&(e.setRenderTargetTextures(I,ve.colorTexture,ve.depthStencilTexture),e.setRenderTarget(I))}let ot=L[ze];ot===void 0&&(ot=new Eo,ot.layers.enable(ze),ot.viewport=new Ii,L[ze]=ot),ot.matrix.fromArray(qe.transform.matrix),ot.matrix.decompose(ot.position,ot.quaternion,ot.scale),ot.projectionMatrix.fromArray(qe.projectionMatrix),ot.projectionMatrixInverse.copy(ot.projectionMatrix).invert(),ot.viewport.set(le.x,le.y,le.width,le.height),ze===0&&(k.matrix.copy(ot.matrix),k.matrix.decompose(k.position,k.quaternion,k.scale)),Ne===!0&&k.cameras.push(ot)}const me=s.enabledFeatures;if(me&&me.includes("depth-sensing")&&s.depthUsage=="gpu-optimized"&&d){const ze=d.getDepthInformation(Me[0]);ze&&ze.isValid&&ze.texture&&b.init(e,ze,s.renderState)}}for(let Me=0;Me<T.length;Me++){const Ne=R[Me],me=T[Me];Ne!==null&&me!==void 0&&me.update(Ne,ye,h||o)}oe&&oe(ae,ye),ye.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ye}),v=null}const pe=new fY;pe.setAnimationLoop(ue),this.setAnimationLoop=function(ae){oe=ae},this.dispose=function(){}}};const up=new gf,H8e=new Qn;function Q8e(i,e){function t(w,x){w.matrixAutoUpdate===!0&&w.updateMatrix(),x.value.copy(w.matrix)}function n(w,x){x.color.getRGB(w.fogColor.value,Jj(i)),x.isFog?(w.fogNear.value=x.near,w.fogFar.value=x.far):x.isFogExp2&&(w.fogDensity.value=x.density)}function s(w,x,I,T,R){x.isMeshBasicMaterial||x.isMeshLambertMaterial?r(w,x):x.isMeshToonMaterial?(r(w,x),d(w,x)):x.isMeshPhongMaterial?(r(w,x),u(w,x)):x.isMeshStandardMaterial?(r(w,x),g(w,x),x.isMeshPhysicalMaterial&&m(w,x,R)):x.isMeshMatcapMaterial?(r(w,x),v(w,x)):x.isMeshDepthMaterial?r(w,x):x.isMeshDistanceMaterial?(r(w,x),b(w,x)):x.isMeshNormalMaterial?r(w,x):x.isLineBasicMaterial?(o(w,x),x.isLineDashedMaterial&&a(w,x)):x.isPointsMaterial?l(w,x,I,T):x.isSpriteMaterial?h(w,x):x.isShadowMaterial?(w.color.value.copy(x.color),w.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function r(w,x){w.opacity.value=x.opacity,x.color&&w.diffuse.value.copy(x.color),x.emissive&&w.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(w.map.value=x.map,t(x.map,w.mapTransform)),x.alphaMap&&(w.alphaMap.value=x.alphaMap,t(x.alphaMap,w.alphaMapTransform)),x.bumpMap&&(w.bumpMap.value=x.bumpMap,t(x.bumpMap,w.bumpMapTransform),w.bumpScale.value=x.bumpScale,x.side===Ua&&(w.bumpScale.value*=-1)),x.normalMap&&(w.normalMap.value=x.normalMap,t(x.normalMap,w.normalMapTransform),w.normalScale.value.copy(x.normalScale),x.side===Ua&&w.normalScale.value.negate()),x.displacementMap&&(w.displacementMap.value=x.displacementMap,t(x.displacementMap,w.displacementMapTransform),w.displacementScale.value=x.displacementScale,w.displacementBias.value=x.displacementBias),x.emissiveMap&&(w.emissiveMap.value=x.emissiveMap,t(x.emissiveMap,w.emissiveMapTransform)),x.specularMap&&(w.specularMap.value=x.specularMap,t(x.specularMap,w.specularMapTransform)),x.alphaTest>0&&(w.alphaTest.value=x.alphaTest);const I=e.get(x),T=I.envMap,R=I.envMapRotation;T&&(w.envMap.value=T,up.copy(R),up.x*=-1,up.y*=-1,up.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(up.y*=-1,up.z*=-1),w.envMapRotation.value.setFromMatrix4(H8e.makeRotationFromEuler(up)),w.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,w.reflectivity.value=x.reflectivity,w.ior.value=x.ior,w.refractionRatio.value=x.refractionRatio),x.lightMap&&(w.lightMap.value=x.lightMap,w.lightMapIntensity.value=x.lightMapIntensity,t(x.lightMap,w.lightMapTransform)),x.aoMap&&(w.aoMap.value=x.aoMap,w.aoMapIntensity.value=x.aoMapIntensity,t(x.aoMap,w.aoMapTransform))}function o(w,x){w.diffuse.value.copy(x.color),w.opacity.value=x.opacity,x.map&&(w.map.value=x.map,t(x.map,w.mapTransform))}function a(w,x){w.dashSize.value=x.dashSize,w.totalSize.value=x.dashSize+x.gapSize,w.scale.value=x.scale}function l(w,x,I,T){w.diffuse.value.copy(x.color),w.opacity.value=x.opacity,w.size.value=x.size*I,w.scale.value=T*.5,x.map&&(w.map.value=x.map,t(x.map,w.uvTransform)),x.alphaMap&&(w.alphaMap.value=x.alphaMap,t(x.alphaMap,w.alphaMapTransform)),x.alphaTest>0&&(w.alphaTest.value=x.alphaTest)}function h(w,x){w.diffuse.value.copy(x.color),w.opacity.value=x.opacity,w.rotation.value=x.rotation,x.map&&(w.map.value=x.map,t(x.map,w.mapTransform)),x.alphaMap&&(w.alphaMap.value=x.alphaMap,t(x.alphaMap,w.alphaMapTransform)),x.alphaTest>0&&(w.alphaTest.value=x.alphaTest)}function u(w,x){w.specular.value.copy(x.specular),w.shininess.value=Math.max(x.shininess,1e-4)}function d(w,x){x.gradientMap&&(w.gradientMap.value=x.gradientMap)}function g(w,x){w.metalness.value=x.metalness,x.metalnessMap&&(w.metalnessMap.value=x.metalnessMap,t(x.metalnessMap,w.metalnessMapTransform)),w.roughness.value=x.roughness,x.roughnessMap&&(w.roughnessMap.value=x.roughnessMap,t(x.roughnessMap,w.roughnessMapTransform)),x.envMap&&(w.envMapIntensity.value=x.envMapIntensity)}function m(w,x,I){w.ior.value=x.ior,x.sheen>0&&(w.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),w.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(w.sheenColorMap.value=x.sheenColorMap,t(x.sheenColorMap,w.sheenColorMapTransform)),x.sheenRoughnessMap&&(w.sheenRoughnessMap.value=x.sheenRoughnessMap,t(x.sheenRoughnessMap,w.sheenRoughnessMapTransform))),x.clearcoat>0&&(w.clearcoat.value=x.clearcoat,w.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(w.clearcoatMap.value=x.clearcoatMap,t(x.clearcoatMap,w.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(w.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,t(x.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(w.clearcoatNormalMap.value=x.clearcoatNormalMap,t(x.clearcoatNormalMap,w.clearcoatNormalMapTransform),w.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Ua&&w.clearcoatNormalScale.value.negate())),x.dispersion>0&&(w.dispersion.value=x.dispersion),x.iridescence>0&&(w.iridescence.value=x.iridescence,w.iridescenceIOR.value=x.iridescenceIOR,w.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],w.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(w.iridescenceMap.value=x.iridescenceMap,t(x.iridescenceMap,w.iridescenceMapTransform)),x.iridescenceThicknessMap&&(w.iridescenceThicknessMap.value=x.iridescenceThicknessMap,t(x.iridescenceThicknessMap,w.iridescenceThicknessMapTransform))),x.transmission>0&&(w.transmission.value=x.transmission,w.transmissionSamplerMap.value=I.texture,w.transmissionSamplerSize.value.set(I.width,I.height),x.transmissionMap&&(w.transmissionMap.value=x.transmissionMap,t(x.transmissionMap,w.transmissionMapTransform)),w.thickness.value=x.thickness,x.thicknessMap&&(w.thicknessMap.value=x.thicknessMap,t(x.thicknessMap,w.thicknessMapTransform)),w.attenuationDistance.value=x.attenuationDistance,w.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(w.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(w.anisotropyMap.value=x.anisotropyMap,t(x.anisotropyMap,w.anisotropyMapTransform))),w.specularIntensity.value=x.specularIntensity,w.specularColor.value.copy(x.specularColor),x.specularColorMap&&(w.specularColorMap.value=x.specularColorMap,t(x.specularColorMap,w.specularColorMapTransform)),x.specularIntensityMap&&(w.specularIntensityMap.value=x.specularIntensityMap,t(x.specularIntensityMap,w.specularIntensityMapTransform))}function v(w,x){x.matcap&&(w.matcap.value=x.matcap)}function b(w,x){const I=e.get(x).light;w.referencePosition.value.setFromMatrixPosition(I.matrixWorld),w.nearDistance.value=I.shadow.camera.near,w.farDistance.value=I.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function W8e(i,e,t,n){let s={},r={},o=[];const a=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(I,T){const R=T.program;n.uniformBlockBinding(I,R)}function h(I,T){let R=s[I.id];R===void 0&&(v(I),R=u(I),s[I.id]=R,I.addEventListener("dispose",w));const F=T.program;n.updateUBOMapping(I,F);const z=e.render.frame;r[I.id]!==z&&(g(I),r[I.id]=z)}function u(I){const T=d();I.__bindingPointIndex=T;const R=i.createBuffer(),F=I.__size,z=I.usage;return i.bindBuffer(i.UNIFORM_BUFFER,R),i.bufferData(i.UNIFORM_BUFFER,F,z),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,T,R),R}function d(){for(let I=0;I<a;I++)if(o.indexOf(I)===-1)return o.push(I),I;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function g(I){const T=s[I.id],R=I.uniforms,F=I.__cache;i.bindBuffer(i.UNIFORM_BUFFER,T);for(let z=0,U=R.length;z<U;z++){const N=Array.isArray(R[z])?R[z]:[R[z]];for(let L=0,k=N.length;L<k;L++){const D=N[L];if(m(D,z,L,F)===!0){const Y=D.__offset,Z=Array.isArray(D.value)?D.value:[D.value];let j=0;for(let Q=0;Q<Z.length;Q++){const $=Z[Q],W=b($);typeof $=="number"||typeof $=="boolean"?(D.__data[0]=$,i.bufferSubData(i.UNIFORM_BUFFER,Y+j,D.__data)):$.isMatrix3?(D.__data[0]=$.elements[0],D.__data[1]=$.elements[1],D.__data[2]=$.elements[2],D.__data[3]=0,D.__data[4]=$.elements[3],D.__data[5]=$.elements[4],D.__data[6]=$.elements[5],D.__data[7]=0,D.__data[8]=$.elements[6],D.__data[9]=$.elements[7],D.__data[10]=$.elements[8],D.__data[11]=0):($.toArray(D.__data,j),j+=W.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,Y,D.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function m(I,T,R,F){const z=I.value,U=T+"_"+R;if(F[U]===void 0)return typeof z=="number"||typeof z=="boolean"?F[U]=z:F[U]=z.clone(),!0;{const N=F[U];if(typeof z=="number"||typeof z=="boolean"){if(N!==z)return F[U]=z,!0}else if(N.equals(z)===!1)return N.copy(z),!0}return!1}function v(I){const T=I.uniforms;let R=0;const F=16;for(let U=0,N=T.length;U<N;U++){const L=Array.isArray(T[U])?T[U]:[T[U]];for(let k=0,D=L.length;k<D;k++){const Y=L[k],Z=Array.isArray(Y.value)?Y.value:[Y.value];for(let j=0,Q=Z.length;j<Q;j++){const $=Z[j],W=b($),q=R%F,ee=q%W.boundary,ne=q+ee;R+=ee,ne!==0&&F-ne<W.storage&&(R+=F-ne),Y.__data=new Float32Array(W.storage/Float32Array.BYTES_PER_ELEMENT),Y.__offset=R,R+=W.storage}}}const z=R%F;return z>0&&(R+=F-z),I.__size=R,I.__cache={},this}function b(I){const T={boundary:0,storage:0};return typeof I=="number"||typeof I=="boolean"?(T.boundary=4,T.storage=4):I.isVector2?(T.boundary=8,T.storage=8):I.isVector3||I.isColor?(T.boundary=16,T.storage=12):I.isVector4?(T.boundary=16,T.storage=16):I.isMatrix3?(T.boundary=48,T.storage=48):I.isMatrix4?(T.boundary=64,T.storage=64):I.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",I),T}function w(I){const T=I.target;T.removeEventListener("dispose",w);const R=o.indexOf(T.__bindingPointIndex);o.splice(R,1),i.deleteBuffer(s[T.id]),delete s[T.id],delete r[T.id]}function x(){for(const I in s)i.deleteBuffer(s[I]);o=[],s={},r={}}return{bind:l,update:h,dispose:x}}let q8e=class{constructor(e={}){const{canvas:t=Q4e(),context:n=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:h=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:g=!1}=e;this.isWebGLRenderer=!0;let m;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=n.getContextAttributes().alpha}else m=o;const v=new Uint32Array(4),b=new Int32Array(4);let w=null,x=null;const I=[],T=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=tf,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const R=this;let F=!1;this._outputColorSpace=jr;let z=0,U=0,N=null,L=-1,k=null;const D=new Ii,Y=new Ii;let Z=null;const j=new ei(0);let Q=0,$=t.width,W=t.height,q=1,ee=null,ne=null;const oe=new Ii(0,0,$,W),ue=new Ii(0,0,$,W);let pe=!1;const ae=new Uk;let ye=!1,Me=!1;const Ne=new Qn,me=new Qn,Ke=new $e,ze=new Ii,qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let le=!1;function ot(){return N===null?q:1}let ve=n;function mt(_e,Qe){return t.getContext(_e,Qe)}try{const _e={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:h,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Mk}`),t.addEventListener("webglcontextlost",fn,!1),t.addEventListener("webglcontextrestored",Gt,!1),t.addEventListener("webglcontextcreationerror",St,!1),ve===null){const Qe="webgl2";if(ve=mt(Qe,_e),ve===null)throw mt(Qe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(_e){throw console.error("THREE.WebGLRenderer: "+_e.message),_e}let yt,Ie,Ae,Fe,dt,vt,Yt,we,se,He,je,Ce,Oe,ut,ht,st,zt,Et,Jt,Ft,cn,Xt,Pn,Ge;function sn(){yt=new i5e(ve),yt.init(),Xt=new U8e(ve,yt),Ie=new XUe(ve,yt,e,Xt),Ae=new F8e(ve,yt),Ie.reverseDepthBuffer&&g&&Ae.buffers.depth.setReversed(!0),Fe=new o5e(ve),dt=new E8e,vt=new O8e(ve,yt,Ae,dt,Ie,Xt,Fe),Yt=new JUe(R),we=new n5e(R),se=new dFe(ve),Pn=new jUe(ve,se),He=new s5e(ve,se,Fe,Pn),je=new l5e(ve,He,se,Fe),Jt=new a5e(ve,Ie,vt),st=new ZUe(dt),Ce=new w8e(R,Yt,we,yt,Ie,Pn,st),Oe=new Q8e(R,dt),ut=new S8e,ht=new P8e(yt),Et=new qUe(R,Yt,we,Ae,je,m,l),zt=new N8e(R,je,Ie),Ge=new W8e(ve,Fe,Ie,Ae),Ft=new YUe(ve,yt,Fe),cn=new r5e(ve,yt,Fe),Fe.programs=Ce.programs,R.capabilities=Ie,R.extensions=yt,R.properties=dt,R.renderLists=ut,R.shadowMap=zt,R.state=Ae,R.info=Fe}sn();const kt=new G8e(R,ve);this.xr=kt,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const _e=yt.get("WEBGL_lose_context");_e&&_e.loseContext()},this.forceContextRestore=function(){const _e=yt.get("WEBGL_lose_context");_e&&_e.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(_e){_e!==void 0&&(q=_e,this.setSize($,W,!1))},this.getSize=function(_e){return _e.set($,W)},this.setSize=function(_e,Qe,At=!0){if(kt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=_e,W=Qe,t.width=Math.floor(_e*q),t.height=Math.floor(Qe*q),At===!0&&(t.style.width=_e+"px",t.style.height=Qe+"px"),this.setViewport(0,0,_e,Qe)},this.getDrawingBufferSize=function(_e){return _e.set($*q,W*q).floor()},this.setDrawingBufferSize=function(_e,Qe,At){$=_e,W=Qe,q=At,t.width=Math.floor(_e*At),t.height=Math.floor(Qe*At),this.setViewport(0,0,_e,Qe)},this.getCurrentViewport=function(_e){return _e.copy(D)},this.getViewport=function(_e){return _e.copy(oe)},this.setViewport=function(_e,Qe,At,_t){_e.isVector4?oe.set(_e.x,_e.y,_e.z,_e.w):oe.set(_e,Qe,At,_t),Ae.viewport(D.copy(oe).multiplyScalar(q).round())},this.getScissor=function(_e){return _e.copy(ue)},this.setScissor=function(_e,Qe,At,_t){_e.isVector4?ue.set(_e.x,_e.y,_e.z,_e.w):ue.set(_e,Qe,At,_t),Ae.scissor(Y.copy(ue).multiplyScalar(q).round())},this.getScissorTest=function(){return pe},this.setScissorTest=function(_e){Ae.setScissorTest(pe=_e)},this.setOpaqueSort=function(_e){ee=_e},this.setTransparentSort=function(_e){ne=_e},this.getClearColor=function(_e){return _e.copy(Et.getClearColor())},this.setClearColor=function(){Et.setClearColor(...arguments)},this.getClearAlpha=function(){return Et.getClearAlpha()},this.setClearAlpha=function(){Et.setClearAlpha(...arguments)},this.clear=function(_e=!0,Qe=!0,At=!0){let _t=0;if(_e){let Ye=!1;if(N!==null){const Nt=N.texture.format;Ye=Nt===ku||Nt===BS||Nt===Lk}if(Ye){const Nt=N.texture.type,Qt=Nt===ba||Nt===za||Nt===zv||Nt===$v||Nt===Rk||Nt===Bk,gn=Et.getClearColor(),nn=Et.getClearAlpha(),Dn=gn.r,$n=gn.g,Vn=gn.b;Qt?(v[0]=Dn,v[1]=$n,v[2]=Vn,v[3]=nn,ve.clearBufferuiv(ve.COLOR,0,v)):(b[0]=Dn,b[1]=$n,b[2]=Vn,b[3]=nn,ve.clearBufferiv(ve.COLOR,0,b))}else _t|=ve.COLOR_BUFFER_BIT}Qe&&(_t|=ve.DEPTH_BUFFER_BIT),At&&(_t|=ve.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ve.clear(_t)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",fn,!1),t.removeEventListener("webglcontextrestored",Gt,!1),t.removeEventListener("webglcontextcreationerror",St,!1),Et.dispose(),ut.dispose(),ht.dispose(),dt.dispose(),Yt.dispose(),we.dispose(),je.dispose(),Pn.dispose(),Ge.dispose(),Ce.dispose(),kt.dispose(),kt.removeEventListener("sessionstart",Qa),kt.removeEventListener("sessionend",Po),Pe.stop()};function fn(_e){_e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function Gt(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1;const _e=Fe.autoReset,Qe=zt.enabled,At=zt.autoUpdate,_t=zt.needsUpdate,Ye=zt.type;sn(),Fe.autoReset=_e,zt.enabled=Qe,zt.autoUpdate=At,zt.needsUpdate=_t,zt.type=Ye}function St(_e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",_e.statusMessage)}function An(_e){const Qe=_e.target;Qe.removeEventListener("dispose",An),yn(Qe)}function yn(_e){Tt(_e),dt.remove(_e)}function Tt(_e){const Qe=dt.get(_e).programs;Qe!==void 0&&(Qe.forEach(function(At){Ce.releaseProgram(At)}),_e.isShaderMaterial&&Ce.releaseShaderCache(_e))}this.renderBufferDirect=function(_e,Qe,At,_t,Ye,Nt){Qe===null&&(Qe=qe);const Qt=Ye.isMesh&&Ye.matrixWorld.determinant()<0,gn=hi(_e,Qe,At,_t,Ye);Ae.setMaterial(_t,Qt);let nn=At.index,Dn=1;if(_t.wireframe===!0){if(nn=He.getWireframeAttribute(At),nn===void 0)return;Dn=2}const $n=At.drawRange,Vn=At.attributes.position;let li=$n.start*Dn,vi=($n.start+$n.count)*Dn;Nt!==null&&(li=Math.max(li,Nt.start*Dn),vi=Math.min(vi,(Nt.start+Nt.count)*Dn)),nn!==null?(li=Math.max(li,0),vi=Math.min(vi,nn.count)):Vn!=null&&(li=Math.max(li,0),vi=Math.min(vi,Vn.count));const ls=vi-li;if(ls<0||ls===1/0)return;Pn.setup(Ye,_t,gn,At,nn);let Fi,Hi=Ft;if(nn!==null&&(Fi=se.get(nn),Hi=cn,Hi.setIndex(Fi)),Ye.isMesh)_t.wireframe===!0?(Ae.setLineWidth(_t.wireframeLinewidth*ot()),Hi.setMode(ve.LINES)):Hi.setMode(ve.TRIANGLES);else if(Ye.isLine){let Gn=_t.linewidth;Gn===void 0&&(Gn=1),Ae.setLineWidth(Gn*ot()),Ye.isLineSegments?Hi.setMode(ve.LINES):Ye.isLineLoop?Hi.setMode(ve.LINE_LOOP):Hi.setMode(ve.LINE_STRIP)}else Ye.isPoints?Hi.setMode(ve.POINTS):Ye.isSprite&&Hi.setMode(ve.TRIANGLES);if(Ye.isBatchedMesh)if(Ye._multiDrawInstances!==null)L_("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Hi.renderMultiDrawInstances(Ye._multiDrawStarts,Ye._multiDrawCounts,Ye._multiDrawCount,Ye._multiDrawInstances);else if(yt.get("WEBGL_multi_draw"))Hi.renderMultiDraw(Ye._multiDrawStarts,Ye._multiDrawCounts,Ye._multiDrawCount);else{const Gn=Ye._multiDrawStarts,ns=Ye._multiDrawCounts,bi=Ye._multiDrawCount,bs=nn?se.get(nn).bytesPerElement:1,xs=dt.get(_t).currentProgram.getUniforms();for(let mr=0;mr<bi;mr++)xs.setValue(ve,"_gl_DrawID",mr),Hi.render(Gn[mr]/bs,ns[mr])}else if(Ye.isInstancedMesh)Hi.renderInstances(li,ls,Ye.count);else if(At.isInstancedBufferGeometry){const Gn=At._maxInstanceCount!==void 0?At._maxInstanceCount:1/0,ns=Math.min(At.instanceCount,Gn);Hi.renderInstances(li,ls,ns)}else Hi.render(li,ls)};function oi(_e,Qe,At){_e.transparent===!0&&_e.side===Mc&&_e.forceSinglePass===!1?(_e.side=Ua,_e.needsUpdate=!0,Fn(_e,Qe,At),_e.side=ju,_e.needsUpdate=!0,Fn(_e,Qe,At),_e.side=Mc):Fn(_e,Qe,At)}this.compile=function(_e,Qe,At=null){At===null&&(At=_e),x=ht.get(At),x.init(Qe),T.push(x),At.traverseVisible(function(Ye){Ye.isLight&&Ye.layers.test(Qe.layers)&&(x.pushLight(Ye),Ye.castShadow&&x.pushShadow(Ye))}),_e!==At&&_e.traverseVisible(function(Ye){Ye.isLight&&Ye.layers.test(Qe.layers)&&(x.pushLight(Ye),Ye.castShadow&&x.pushShadow(Ye))}),x.setupLights();const _t=new Set;return _e.traverse(function(Ye){if(!(Ye.isMesh||Ye.isPoints||Ye.isLine||Ye.isSprite))return;const Nt=Ye.material;if(Nt)if(Array.isArray(Nt))for(let Qt=0;Qt<Nt.length;Qt++){const gn=Nt[Qt];oi(gn,At,Ye),_t.add(gn)}else oi(Nt,At,Ye),_t.add(Nt)}),x=T.pop(),_t},this.compileAsync=function(_e,Qe,At=null){const _t=this.compile(_e,Qe,At);return new Promise(Ye=>{function Nt(){if(_t.forEach(function(Qt){dt.get(Qt).currentProgram.isReady()&&_t.delete(Qt)}),_t.size===0){Ye(_e);return}setTimeout(Nt,10)}yt.get("KHR_parallel_shader_compile")!==null?Nt():setTimeout(Nt,10)})};let Ms=null;function js(_e){Ms&&Ms(_e)}function Qa(){Pe.stop()}function Po(){Pe.start()}const Pe=new fY;Pe.setAnimationLoop(js),typeof self<"u"&&Pe.setContext(self),this.setAnimationLoop=function(_e){Ms=_e,kt.setAnimationLoop(_e),_e===null?Pe.stop():Pe.start()},kt.addEventListener("sessionstart",Qa),kt.addEventListener("sessionend",Po),this.render=function(_e,Qe){if(Qe!==void 0&&Qe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;if(_e.matrixWorldAutoUpdate===!0&&_e.updateMatrixWorld(),Qe.parent===null&&Qe.matrixWorldAutoUpdate===!0&&Qe.updateMatrixWorld(),kt.enabled===!0&&kt.isPresenting===!0&&(kt.cameraAutoUpdate===!0&&kt.updateCamera(Qe),Qe=kt.getCamera()),_e.isScene===!0&&_e.onBeforeRender(R,_e,Qe,N),x=ht.get(_e,T.length),x.init(Qe),T.push(x),me.multiplyMatrices(Qe.projectionMatrix,Qe.matrixWorldInverse),ae.setFromProjectionMatrix(me),Me=this.localClippingEnabled,ye=st.init(this.clippingPlanes,Me),w=ut.get(_e,I.length),w.init(),I.push(w),kt.enabled===!0&&kt.isPresenting===!0){const Nt=R.xr.getDepthSensingMesh();Nt!==null&&Xe(Nt,Qe,-1/0,R.sortObjects)}Xe(_e,Qe,0,R.sortObjects),w.finish(),R.sortObjects===!0&&w.sort(ee,ne),le=kt.enabled===!1||kt.isPresenting===!1||kt.hasDepthSensing()===!1,le&&Et.addToRenderList(w,_e),this.info.render.frame++,ye===!0&&st.beginShadows();const At=x.state.shadowsArray;zt.render(At,_e,Qe),ye===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset();const _t=w.opaque,Ye=w.transmissive;if(x.setupLights(),Qe.isArrayCamera){const Nt=Qe.cameras;if(Ye.length>0)for(let Qt=0,gn=Nt.length;Qt<gn;Qt++){const nn=Nt[Qt];lt(_t,Ye,_e,nn)}le&&Et.render(_e);for(let Qt=0,gn=Nt.length;Qt<gn;Qt++){const nn=Nt[Qt];wt(w,_e,nn,nn.viewport)}}else Ye.length>0&<(_t,Ye,_e,Qe),le&&Et.render(_e),wt(w,_e,Qe);N!==null&&U===0&&(vt.updateMultisampleRenderTarget(N),vt.updateRenderTargetMipmap(N)),_e.isScene===!0&&_e.onAfterRender(R,_e,Qe),Pn.resetDefaultState(),L=-1,k=null,T.pop(),T.length>0?(x=T[T.length-1],ye===!0&&st.setGlobalState(R.clippingPlanes,x.state.camera)):x=null,I.pop(),I.length>0?w=I[I.length-1]:w=null};function Xe(_e,Qe,At,_t){if(_e.visible===!1)return;if(_e.layers.test(Qe.layers)){if(_e.isGroup)At=_e.renderOrder;else if(_e.isLOD)_e.autoUpdate===!0&&_e.update(Qe);else if(_e.isLight)x.pushLight(_e),_e.castShadow&&x.pushShadow(_e);else if(_e.isSprite){if(!_e.frustumCulled||ae.intersectsSprite(_e)){_t&&ze.setFromMatrixPosition(_e.matrixWorld).applyMatrix4(me);const Qt=je.update(_e),gn=_e.material;gn.visible&&w.push(_e,Qt,gn,At,ze.z,null)}}else if((_e.isMesh||_e.isLine||_e.isPoints)&&(!_e.frustumCulled||ae.intersectsObject(_e))){const Qt=je.update(_e),gn=_e.material;if(_t&&(_e.boundingSphere!==void 0?(_e.boundingSphere===null&&_e.computeBoundingSphere(),ze.copy(_e.boundingSphere.center)):(Qt.boundingSphere===null&&Qt.computeBoundingSphere(),ze.copy(Qt.boundingSphere.center)),ze.applyMatrix4(_e.matrixWorld).applyMatrix4(me)),Array.isArray(gn)){const nn=Qt.groups;for(let Dn=0,$n=nn.length;Dn<$n;Dn++){const Vn=nn[Dn],li=gn[Vn.materialIndex];li&&li.visible&&w.push(_e,Qt,li,At,ze.z,Vn)}}else gn.visible&&w.push(_e,Qt,gn,At,ze.z,null)}}const Nt=_e.children;for(let Qt=0,gn=Nt.length;Qt<gn;Qt++)Xe(Nt[Qt],Qe,At,_t)}function wt(_e,Qe,At,_t){const Ye=_e.opaque,Nt=_e.transmissive,Qt=_e.transparent;x.setupLightsView(At),ye===!0&&st.setGlobalState(R.clippingPlanes,At),_t&&Ae.viewport(D.copy(_t)),Ye.length>0&&Rt(Ye,Qe,At),Nt.length>0&&Rt(Nt,Qe,At),Qt.length>0&&Rt(Qt,Qe,At),Ae.buffers.depth.setTest(!0),Ae.buffers.depth.setMask(!0),Ae.buffers.color.setMask(!0),Ae.setPolygonOffset(!1)}function lt(_e,Qe,At,_t){if((At.isScene===!0?At.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[_t.id]===void 0&&(x.state.transmissionRenderTarget[_t.id]=new Ph(1,1,{generateMipmaps:!0,type:yt.has("EXT_color_buffer_half_float")||yt.has("EXT_color_buffer_float")?Lb:ba,minFilter:Mu,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:$i.workingColorSpace}));const Nt=x.state.transmissionRenderTarget[_t.id],Qt=_t.viewport||D;Nt.setSize(Qt.z*R.transmissionResolutionScale,Qt.w*R.transmissionResolutionScale);const gn=R.getRenderTarget(),nn=R.getActiveCubeFace(),Dn=R.getActiveMipmapLevel();R.setRenderTarget(Nt),R.getClearColor(j),Q=R.getClearAlpha(),Q<1&&R.setClearColor(16777215,.5),R.clear(),le&&Et.render(At);const $n=R.toneMapping;R.toneMapping=tf;const Vn=_t.viewport;if(_t.viewport!==void 0&&(_t.viewport=void 0),x.setupLightsView(_t),ye===!0&&st.setGlobalState(R.clippingPlanes,_t),Rt(_e,At,_t),vt.updateMultisampleRenderTarget(Nt),vt.updateRenderTargetMipmap(Nt),yt.has("WEBGL_multisampled_render_to_texture")===!1){let li=!1;for(let vi=0,ls=Qe.length;vi<ls;vi++){const Fi=Qe[vi],Hi=Fi.object,Gn=Fi.geometry,ns=Fi.material,bi=Fi.group;if(ns.side===Mc&&Hi.layers.test(_t.layers)){const bs=ns.side;ns.side=Ua,ns.needsUpdate=!0,Bn(Hi,At,_t,Gn,ns,bi),ns.side=bs,ns.needsUpdate=!0,li=!0}}li===!0&&(vt.updateMultisampleRenderTarget(Nt),vt.updateRenderTargetMipmap(Nt))}R.setRenderTarget(gn,nn,Dn),R.setClearColor(j,Q),Vn!==void 0&&(_t.viewport=Vn),R.toneMapping=$n}function Rt(_e,Qe,At){const _t=Qe.isScene===!0?Qe.overrideMaterial:null;for(let Ye=0,Nt=_e.length;Ye<Nt;Ye++){const Qt=_e[Ye],gn=Qt.object,nn=Qt.geometry,Dn=Qt.group;let $n=Qt.material;$n.allowOverride===!0&&_t!==null&&($n=_t),gn.layers.test(At.layers)&&Bn(gn,Qe,At,nn,$n,Dn)}}function Bn(_e,Qe,At,_t,Ye,Nt){_e.onBeforeRender(R,Qe,At,_t,Ye,Nt),_e.modelViewMatrix.multiplyMatrices(At.matrixWorldInverse,_e.matrixWorld),_e.normalMatrix.getNormalMatrix(_e.modelViewMatrix),Ye.onBeforeRender(R,Qe,At,_t,_e,Nt),Ye.transparent===!0&&Ye.side===Mc&&Ye.forceSinglePass===!1?(Ye.side=Ua,Ye.needsUpdate=!0,R.renderBufferDirect(At,Qe,_t,Ye,_e,Nt),Ye.side=ju,Ye.needsUpdate=!0,R.renderBufferDirect(At,Qe,_t,Ye,_e,Nt),Ye.side=Mc):R.renderBufferDirect(At,Qe,_t,Ye,_e,Nt),_e.onAfterRender(R,Qe,At,_t,Ye,Nt)}function Fn(_e,Qe,At){Qe.isScene!==!0&&(Qe=qe);const _t=dt.get(_e),Ye=x.state.lights,Nt=x.state.shadowsArray,Qt=Ye.state.version,gn=Ce.getParameters(_e,Ye.state,Nt,Qe,At),nn=Ce.getProgramCacheKey(gn);let Dn=_t.programs;_t.environment=_e.isMeshStandardMaterial?Qe.environment:null,_t.fog=Qe.fog,_t.envMap=(_e.isMeshStandardMaterial?we:Yt).get(_e.envMap||_t.environment),_t.envMapRotation=_t.environment!==null&&_e.envMap===null?Qe.environmentRotation:_e.envMapRotation,Dn===void 0&&(_e.addEventListener("dispose",An),Dn=new Map,_t.programs=Dn);let $n=Dn.get(nn);if($n!==void 0){if(_t.currentProgram===$n&&_t.lightsStateVersion===Qt)return si(_e,gn),$n}else gn.uniforms=Ce.getUniforms(_e),_e.onBeforeCompile(gn,R),$n=Ce.acquireProgram(gn,nn),Dn.set(nn,$n),_t.uniforms=gn.uniforms;const Vn=_t.uniforms;return(!_e.isShaderMaterial&&!_e.isRawShaderMaterial||_e.clipping===!0)&&(Vn.clippingPlanes=st.uniform),si(_e,gn),_t.needsLights=ii(_e),_t.lightsStateVersion=Qt,_t.needsLights&&(Vn.ambientLightColor.value=Ye.state.ambient,Vn.lightProbe.value=Ye.state.probe,Vn.directionalLights.value=Ye.state.directional,Vn.directionalLightShadows.value=Ye.state.directionalShadow,Vn.spotLights.value=Ye.state.spot,Vn.spotLightShadows.value=Ye.state.spotShadow,Vn.rectAreaLights.value=Ye.state.rectArea,Vn.ltc_1.value=Ye.state.rectAreaLTC1,Vn.ltc_2.value=Ye.state.rectAreaLTC2,Vn.pointLights.value=Ye.state.point,Vn.pointLightShadows.value=Ye.state.pointShadow,Vn.hemisphereLights.value=Ye.state.hemi,Vn.directionalShadowMap.value=Ye.state.directionalShadowMap,Vn.directionalShadowMatrix.value=Ye.state.directionalShadowMatrix,Vn.spotShadowMap.value=Ye.state.spotShadowMap,Vn.spotLightMatrix.value=Ye.state.spotLightMatrix,Vn.spotLightMap.value=Ye.state.spotLightMap,Vn.pointShadowMap.value=Ye.state.pointShadowMap,Vn.pointShadowMatrix.value=Ye.state.pointShadowMatrix),_t.currentProgram=$n,_t.uniformsList=null,$n}function pn(_e){if(_e.uniformsList===null){const Qe=_e.currentProgram.getUniforms();_e.uniformsList=ME.seqWithValue(Qe.seq,_e.uniforms)}return _e.uniformsList}function si(_e,Qe){const At=dt.get(_e);At.outputColorSpace=Qe.outputColorSpace,At.batching=Qe.batching,At.batchingColor=Qe.batchingColor,At.instancing=Qe.instancing,At.instancingColor=Qe.instancingColor,At.instancingMorph=Qe.instancingMorph,At.skinning=Qe.skinning,At.morphTargets=Qe.morphTargets,At.morphNormals=Qe.morphNormals,At.morphColors=Qe.morphColors,At.morphTargetsCount=Qe.morphTargetsCount,At.numClippingPlanes=Qe.numClippingPlanes,At.numIntersection=Qe.numClipIntersection,At.vertexAlphas=Qe.vertexAlphas,At.vertexTangents=Qe.vertexTangents,At.toneMapping=Qe.toneMapping}function hi(_e,Qe,At,_t,Ye){Qe.isScene!==!0&&(Qe=qe),vt.resetTextureUnits();const Nt=Qe.fog,Qt=_t.isMeshStandardMaterial?Qe.environment:null,gn=N===null?R.outputColorSpace:N.isXRRenderTarget===!0?N.texture.colorSpace:xa,nn=(_t.isMeshStandardMaterial?we:Yt).get(_t.envMap||Qt),Dn=_t.vertexColors===!0&&!!At.attributes.color&&At.attributes.color.itemSize===4,$n=!!At.attributes.tangent&&(!!_t.normalMap||_t.anisotropy>0),Vn=!!At.morphAttributes.position,li=!!At.morphAttributes.normal,vi=!!At.morphAttributes.color;let ls=tf;_t.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(ls=R.toneMapping);const Fi=At.morphAttributes.position||At.morphAttributes.normal||At.morphAttributes.color,Hi=Fi!==void 0?Fi.length:0,Gn=dt.get(_t),ns=x.state.lights;if(ye===!0&&(Me===!0||_e!==k)){const _r=_e===k&&_t.id===L;st.setState(_t,_e,_r)}let bi=!1;_t.version===Gn.__version?(Gn.needsLights&&Gn.lightsStateVersion!==ns.state.version||Gn.outputColorSpace!==gn||Ye.isBatchedMesh&&Gn.batching===!1||!Ye.isBatchedMesh&&Gn.batching===!0||Ye.isBatchedMesh&&Gn.batchingColor===!0&&Ye.colorTexture===null||Ye.isBatchedMesh&&Gn.batchingColor===!1&&Ye.colorTexture!==null||Ye.isInstancedMesh&&Gn.instancing===!1||!Ye.isInstancedMesh&&Gn.instancing===!0||Ye.isSkinnedMesh&&Gn.skinning===!1||!Ye.isSkinnedMesh&&Gn.skinning===!0||Ye.isInstancedMesh&&Gn.instancingColor===!0&&Ye.instanceColor===null||Ye.isInstancedMesh&&Gn.instancingColor===!1&&Ye.instanceColor!==null||Ye.isInstancedMesh&&Gn.instancingMorph===!0&&Ye.morphTexture===null||Ye.isInstancedMesh&&Gn.instancingMorph===!1&&Ye.morphTexture!==null||Gn.envMap!==nn||_t.fog===!0&&Gn.fog!==Nt||Gn.numClippingPlanes!==void 0&&(Gn.numClippingPlanes!==st.numPlanes||Gn.numIntersection!==st.numIntersection)||Gn.vertexAlphas!==Dn||Gn.vertexTangents!==$n||Gn.morphTargets!==Vn||Gn.morphNormals!==li||Gn.morphColors!==vi||Gn.toneMapping!==ls||Gn.morphTargetsCount!==Hi)&&(bi=!0):(bi=!0,Gn.__version=_t.version);let bs=Gn.currentProgram;bi===!0&&(bs=Fn(_t,Qe,Ye));let xs=!1,mr=!1,Lo=!1;const is=bs.getUniforms(),Sr=Gn.uniforms;if(Ae.useProgram(bs.program)&&(xs=!0,mr=!0,Lo=!0),_t.id!==L&&(L=_t.id,mr=!0),xs||k!==_e){Ae.buffers.depth.getReversed()?(Ne.copy(_e.projectionMatrix),q4e(Ne),j4e(Ne),is.setValue(ve,"projectionMatrix",Ne)):is.setValue(ve,"projectionMatrix",_e.projectionMatrix),is.setValue(ve,"viewMatrix",_e.matrixWorldInverse);const Ar=is.map.cameraPosition;Ar!==void 0&&Ar.setValue(ve,Ke.setFromMatrixPosition(_e.matrixWorld)),Ie.logarithmicDepthBuffer&&is.setValue(ve,"logDepthBufFC",2/(Math.log(_e.far+1)/Math.LN2)),(_t.isMeshPhongMaterial||_t.isMeshToonMaterial||_t.isMeshLambertMaterial||_t.isMeshBasicMaterial||_t.isMeshStandardMaterial||_t.isShaderMaterial)&&is.setValue(ve,"isOrthographic",_e.isOrthographicCamera===!0),k!==_e&&(k=_e,mr=!0,Lo=!0)}if(Ye.isSkinnedMesh){is.setOptional(ve,Ye,"bindMatrix"),is.setOptional(ve,Ye,"bindMatrixInverse");const _r=Ye.skeleton;_r&&(_r.boneTexture===null&&_r.computeBoneTexture(),is.setValue(ve,"boneTexture",_r.boneTexture,vt))}Ye.isBatchedMesh&&(is.setOptional(ve,Ye,"batchingTexture"),is.setValue(ve,"batchingTexture",Ye._matricesTexture,vt),is.setOptional(ve,Ye,"batchingIdTexture"),is.setValue(ve,"batchingIdTexture",Ye._indirectTexture,vt),is.setOptional(ve,Ye,"batchingColorTexture"),Ye._colorsTexture!==null&&is.setValue(ve,"batchingColorTexture",Ye._colorsTexture,vt));const lr=At.morphAttributes;if((lr.position!==void 0||lr.normal!==void 0||lr.color!==void 0)&&Jt.update(Ye,At,bs),(mr||Gn.receiveShadow!==Ye.receiveShadow)&&(Gn.receiveShadow=Ye.receiveShadow,is.setValue(ve,"receiveShadow",Ye.receiveShadow)),_t.isMeshGouraudMaterial&&_t.envMap!==null&&(Sr.envMap.value=nn,Sr.flipEnvMap.value=nn.isCubeTexture&&nn.isRenderTargetTexture===!1?-1:1),_t.isMeshStandardMaterial&&_t.envMap===null&&Qe.environment!==null&&(Sr.envMapIntensity.value=Qe.environmentIntensity),mr&&(is.setValue(ve,"toneMappingExposure",R.toneMappingExposure),Gn.needsLights&&Kn(Sr,Lo),Nt&&_t.fog===!0&&Oe.refreshFogUniforms(Sr,Nt),Oe.refreshMaterialUniforms(Sr,_t,q,W,x.state.transmissionRenderTarget[_e.id]),ME.upload(ve,pn(Gn),Sr,vt)),_t.isShaderMaterial&&_t.uniformsNeedUpdate===!0&&(ME.upload(ve,pn(Gn),Sr,vt),_t.uniformsNeedUpdate=!1),_t.isSpriteMaterial&&is.setValue(ve,"center",Ye.center),is.setValue(ve,"modelViewMatrix",Ye.modelViewMatrix),is.setValue(ve,"normalMatrix",Ye.normalMatrix),is.setValue(ve,"modelMatrix",Ye.matrixWorld),_t.isShaderMaterial||_t.isRawShaderMaterial){const _r=_t.uniformsGroups;for(let Ar=0,zr=_r.length;Ar<zr;Ar++){const Ca=_r[Ar];Ge.update(Ca,bs),Ge.bind(Ca,bs)}}return bs}function Kn(_e,Qe){_e.ambientLightColor.needsUpdate=Qe,_e.lightProbe.needsUpdate=Qe,_e.directionalLights.needsUpdate=Qe,_e.directionalLightShadows.needsUpdate=Qe,_e.pointLights.needsUpdate=Qe,_e.pointLightShadows.needsUpdate=Qe,_e.spotLights.needsUpdate=Qe,_e.spotLightShadows.needsUpdate=Qe,_e.rectAreaLights.needsUpdate=Qe,_e.hemisphereLights.needsUpdate=Qe}function ii(_e){return _e.isMeshLambertMaterial||_e.isMeshToonMaterial||_e.isMeshPhongMaterial||_e.isMeshStandardMaterial||_e.isShadowMaterial||_e.isShaderMaterial&&_e.lights===!0}this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return N},this.setRenderTargetTextures=function(_e,Qe,At){const _t=dt.get(_e);_t.__autoAllocateDepthBuffer=_e.resolveDepthBuffer===!1,_t.__autoAllocateDepthBuffer===!1&&(_t.__useRenderToTexture=!1),dt.get(_e.texture).__webglTexture=Qe,dt.get(_e.depthTexture).__webglTexture=_t.__autoAllocateDepthBuffer?void 0:At,_t.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(_e,Qe){const At=dt.get(_e);At.__webglFramebuffer=Qe,At.__useDefaultFramebuffer=Qe===void 0};const zi=ve.createFramebuffer();this.setRenderTarget=function(_e,Qe=0,At=0){N=_e,z=Qe,U=At;let _t=!0,Ye=null,Nt=!1,Qt=!1;if(_e){const nn=dt.get(_e);if(nn.__useDefaultFramebuffer!==void 0)Ae.bindFramebuffer(ve.FRAMEBUFFER,null),_t=!1;else if(nn.__webglFramebuffer===void 0)vt.setupRenderTarget(_e);else if(nn.__hasExternalTextures)vt.rebindTextures(_e,dt.get(_e.texture).__webglTexture,dt.get(_e.depthTexture).__webglTexture);else if(_e.depthBuffer){const Vn=_e.depthTexture;if(nn.__boundDepthTexture!==Vn){if(Vn!==null&&dt.has(Vn)&&(_e.width!==Vn.image.width||_e.height!==Vn.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");vt.setupDepthRenderbuffer(_e)}}const Dn=_e.texture;(Dn.isData3DTexture||Dn.isDataArrayTexture||Dn.isCompressedArrayTexture)&&(Qt=!0);const $n=dt.get(_e).__webglFramebuffer;_e.isWebGLCubeRenderTarget?(Array.isArray($n[Qe])?Ye=$n[Qe][At]:Ye=$n[Qe],Nt=!0):_e.samples>0&&vt.useMultisampledRTT(_e)===!1?Ye=dt.get(_e).__webglMultisampledFramebuffer:Array.isArray($n)?Ye=$n[At]:Ye=$n,D.copy(_e.viewport),Y.copy(_e.scissor),Z=_e.scissorTest}else D.copy(oe).multiplyScalar(q).floor(),Y.copy(ue).multiplyScalar(q).floor(),Z=pe;if(At!==0&&(Ye=zi),Ae.bindFramebuffer(ve.FRAMEBUFFER,Ye)&&_t&&Ae.drawBuffers(_e,Ye),Ae.viewport(D),Ae.scissor(Y),Ae.setScissorTest(Z),Nt){const nn=dt.get(_e.texture);ve.framebufferTexture2D(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_CUBE_MAP_POSITIVE_X+Qe,nn.__webglTexture,At)}else if(Qt){const nn=dt.get(_e.texture),Dn=Qe;ve.framebufferTextureLayer(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,nn.__webglTexture,At,Dn)}else if(_e!==null&&At!==0){const nn=dt.get(_e.texture);ve.framebufferTexture2D(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_2D,nn.__webglTexture,At)}L=-1},this.readRenderTargetPixels=function(_e,Qe,At,_t,Ye,Nt,Qt,gn=0){if(!(_e&&_e.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nn=dt.get(_e).__webglFramebuffer;if(_e.isWebGLCubeRenderTarget&&Qt!==void 0&&(nn=nn[Qt]),nn){Ae.bindFramebuffer(ve.FRAMEBUFFER,nn);try{const Dn=_e.textures[gn],$n=Dn.format,Vn=Dn.type;if(!Ie.textureFormatReadable($n)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ie.textureTypeReadable(Vn)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Qe>=0&&Qe<=_e.width-_t&&At>=0&&At<=_e.height-Ye&&(_e.textures.length>1&&ve.readBuffer(ve.COLOR_ATTACHMENT0+gn),ve.readPixels(Qe,At,_t,Ye,Xt.convert($n),Xt.convert(Vn),Nt))}finally{const Dn=N!==null?dt.get(N).__webglFramebuffer:null;Ae.bindFramebuffer(ve.FRAMEBUFFER,Dn)}}},this.readRenderTargetPixelsAsync=async function(_e,Qe,At,_t,Ye,Nt,Qt,gn=0){if(!(_e&&_e.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let nn=dt.get(_e).__webglFramebuffer;if(_e.isWebGLCubeRenderTarget&&Qt!==void 0&&(nn=nn[Qt]),nn)if(Qe>=0&&Qe<=_e.width-_t&&At>=0&&At<=_e.height-Ye){Ae.bindFramebuffer(ve.FRAMEBUFFER,nn);const Dn=_e.textures[gn],$n=Dn.format,Vn=Dn.type;if(!Ie.textureFormatReadable($n))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ie.textureTypeReadable(Vn))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const li=ve.createBuffer();ve.bindBuffer(ve.PIXEL_PACK_BUFFER,li),ve.bufferData(ve.PIXEL_PACK_BUFFER,Nt.byteLength,ve.STREAM_READ),_e.textures.length>1&&ve.readBuffer(ve.COLOR_ATTACHMENT0+gn),ve.readPixels(Qe,At,_t,Ye,Xt.convert($n),Xt.convert(Vn),0);const vi=N!==null?dt.get(N).__webglFramebuffer:null;Ae.bindFramebuffer(ve.FRAMEBUFFER,vi);const ls=ve.fenceSync(ve.SYNC_GPU_COMMANDS_COMPLETE,0);return ve.flush(),await W4e(ve,ls,4),ve.bindBuffer(ve.PIXEL_PACK_BUFFER,li),ve.getBufferSubData(ve.PIXEL_PACK_BUFFER,0,Nt),ve.deleteBuffer(li),ve.deleteSync(ls),Nt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(_e,Qe=null,At=0){const _t=Math.pow(2,-At),Ye=Math.floor(_e.image.width*_t),Nt=Math.floor(_e.image.height*_t),Qt=Qe!==null?Qe.x:0,gn=Qe!==null?Qe.y:0;vt.setTexture2D(_e,0),ve.copyTexSubImage2D(ve.TEXTURE_2D,At,0,0,Qt,gn,Ye,Nt),Ae.unbindTexture()};const Cr=ve.createFramebuffer(),ai=ve.createFramebuffer();this.copyTextureToTexture=function(_e,Qe,At=null,_t=null,Ye=0,Nt=null){Nt===null&&(Ye!==0?(L_("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Nt=Ye,Ye=0):Nt=0);let Qt,gn,nn,Dn,$n,Vn,li,vi,ls;const Fi=_e.isCompressedTexture?_e.mipmaps[Nt]:_e.image;if(At!==null)Qt=At.max.x-At.min.x,gn=At.max.y-At.min.y,nn=At.isBox3?At.max.z-At.min.z:1,Dn=At.min.x,$n=At.min.y,Vn=At.isBox3?At.min.z:0;else{const lr=Math.pow(2,-Ye);Qt=Math.floor(Fi.width*lr),gn=Math.floor(Fi.height*lr),_e.isDataArrayTexture?nn=Fi.depth:_e.isData3DTexture?nn=Math.floor(Fi.depth*lr):nn=1,Dn=0,$n=0,Vn=0}_t!==null?(li=_t.x,vi=_t.y,ls=_t.z):(li=0,vi=0,ls=0);const Hi=Xt.convert(Qe.format),Gn=Xt.convert(Qe.type);let ns;Qe.isData3DTexture?(vt.setTexture3D(Qe,0),ns=ve.TEXTURE_3D):Qe.isDataArrayTexture||Qe.isCompressedArrayTexture?(vt.setTexture2DArray(Qe,0),ns=ve.TEXTURE_2D_ARRAY):(vt.setTexture2D(Qe,0),ns=ve.TEXTURE_2D),ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,Qe.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Qe.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,Qe.unpackAlignment);const bi=ve.getParameter(ve.UNPACK_ROW_LENGTH),bs=ve.getParameter(ve.UNPACK_IMAGE_HEIGHT),xs=ve.getParameter(ve.UNPACK_SKIP_PIXELS),mr=ve.getParameter(ve.UNPACK_SKIP_ROWS),Lo=ve.getParameter(ve.UNPACK_SKIP_IMAGES);ve.pixelStorei(ve.UNPACK_ROW_LENGTH,Fi.width),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,Fi.height),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,Dn),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,$n),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,Vn);const is=_e.isDataArrayTexture||_e.isData3DTexture,Sr=Qe.isDataArrayTexture||Qe.isData3DTexture;if(_e.isDepthTexture){const lr=dt.get(_e),_r=dt.get(Qe),Ar=dt.get(lr.__renderTarget),zr=dt.get(_r.__renderTarget);Ae.bindFramebuffer(ve.READ_FRAMEBUFFER,Ar.__webglFramebuffer),Ae.bindFramebuffer(ve.DRAW_FRAMEBUFFER,zr.__webglFramebuffer);for(let Ca=0;Ca<nn;Ca++)is&&(ve.framebufferTextureLayer(ve.READ_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,dt.get(_e).__webglTexture,Ye,Vn+Ca),ve.framebufferTextureLayer(ve.DRAW_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,dt.get(Qe).__webglTexture,Nt,ls+Ca)),ve.blitFramebuffer(Dn,$n,Qt,gn,li,vi,Qt,gn,ve.DEPTH_BUFFER_BIT,ve.NEAREST);Ae.bindFramebuffer(ve.READ_FRAMEBUFFER,null),Ae.bindFramebuffer(ve.DRAW_FRAMEBUFFER,null)}else if(Ye!==0||_e.isRenderTargetTexture||dt.has(_e)){const lr=dt.get(_e),_r=dt.get(Qe);Ae.bindFramebuffer(ve.READ_FRAMEBUFFER,Cr),Ae.bindFramebuffer(ve.DRAW_FRAMEBUFFER,ai);for(let Ar=0;Ar<nn;Ar++)is?ve.framebufferTextureLayer(ve.READ_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,lr.__webglTexture,Ye,Vn+Ar):ve.framebufferTexture2D(ve.READ_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_2D,lr.__webglTexture,Ye),Sr?ve.framebufferTextureLayer(ve.DRAW_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,_r.__webglTexture,Nt,ls+Ar):ve.framebufferTexture2D(ve.DRAW_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_2D,_r.__webglTexture,Nt),Ye!==0?ve.blitFramebuffer(Dn,$n,Qt,gn,li,vi,Qt,gn,ve.COLOR_BUFFER_BIT,ve.NEAREST):Sr?ve.copyTexSubImage3D(ns,Nt,li,vi,ls+Ar,Dn,$n,Qt,gn):ve.copyTexSubImage2D(ns,Nt,li,vi,Dn,$n,Qt,gn);Ae.bindFramebuffer(ve.READ_FRAMEBUFFER,null),Ae.bindFramebuffer(ve.DRAW_FRAMEBUFFER,null)}else Sr?_e.isDataTexture||_e.isData3DTexture?ve.texSubImage3D(ns,Nt,li,vi,ls,Qt,gn,nn,Hi,Gn,Fi.data):Qe.isCompressedArrayTexture?ve.compressedTexSubImage3D(ns,Nt,li,vi,ls,Qt,gn,nn,Hi,Fi.data):ve.texSubImage3D(ns,Nt,li,vi,ls,Qt,gn,nn,Hi,Gn,Fi):_e.isDataTexture?ve.texSubImage2D(ve.TEXTURE_2D,Nt,li,vi,Qt,gn,Hi,Gn,Fi.data):_e.isCompressedTexture?ve.compressedTexSubImage2D(ve.TEXTURE_2D,Nt,li,vi,Fi.width,Fi.height,Hi,Fi.data):ve.texSubImage2D(ve.TEXTURE_2D,Nt,li,vi,Qt,gn,Hi,Gn,Fi);ve.pixelStorei(ve.UNPACK_ROW_LENGTH,bi),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,bs),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,xs),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,mr),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,Lo),Nt===0&&Qe.generateMipmaps&&ve.generateMipmap(ns),Ae.unbindTexture()},this.copyTextureToTexture3D=function(_e,Qe,At=null,_t=null,Ye=0){return L_('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(_e,Qe,At,_t,Ye)},this.initRenderTarget=function(_e){dt.get(_e).__webglFramebuffer===void 0&&vt.setupRenderTarget(_e)},this.initTexture=function(_e){_e.isCubeTexture?vt.setTextureCube(_e,0):_e.isData3DTexture?vt.setTexture3D(_e,0):_e.isDataArrayTexture||_e.isCompressedArrayTexture?vt.setTexture2DArray(_e,0):vt.setTexture2D(_e,0),Ae.unbindTexture()},this.resetState=function(){z=0,U=0,N=null,Ae.reset(),Pn.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Tu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=$i._getDrawingBufferColorSpace(e),t.unpackColorSpace=$i._getUnpackColorSpace()}};function Hz(i,e){if(e===_4e)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===BB||e===Nj){let t=i.getIndex();if(t===null){const o=[],a=i.getAttribute("position");if(a!==void 0){for(let l=0;l<a.count;l++)o.push(l);i.setIndex(o),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,s=[];if(e===BB)for(let o=1;o<=n;o++)s.push(t.getX(0)),s.push(t.getX(o)),s.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(s.push(t.getX(o)),s.push(t.getX(o+1)),s.push(t.getX(o+2))):(s.push(t.getX(o+2)),s.push(t.getX(o+1)),s.push(t.getX(o)));s.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=i.clone();return r.setIndex(s),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class j8e extends gg{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new K8e(t)}),this.register(function(t){return new e6e(t)}),this.register(function(t){return new c6e(t)}),this.register(function(t){return new h6e(t)}),this.register(function(t){return new u6e(t)}),this.register(function(t){return new n6e(t)}),this.register(function(t){return new i6e(t)}),this.register(function(t){return new s6e(t)}),this.register(function(t){return new r6e(t)}),this.register(function(t){return new J8e(t)}),this.register(function(t){return new o6e(t)}),this.register(function(t){return new t6e(t)}),this.register(function(t){return new l6e(t)}),this.register(function(t){return new a6e(t)}),this.register(function(t){return new X8e(t)}),this.register(function(t){return new d6e(t)}),this.register(function(t){return new f6e(t)})}load(e,t,n,s){const r=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const h=cv.extractUrlBase(e);o=cv.resolveURL(h,this.path)}else o=cv.extractUrlBase(e);this.manager.itemStart(e);const a=function(h){s?s(h):console.error(h),r.manager.itemError(e),r.manager.itemEnd(e)},l=new Gk(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(h){try{r.parse(h,o,function(u){t(u),r.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,s){let r;const o={},a={},l=new TextDecoder;if(typeof e=="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===AY){try{o[Pi.KHR_BINARY_GLTF]=new p6e(e)}catch(d){s&&s(d);return}r=JSON.parse(o[Pi.KHR_BINARY_GLTF].content)}else r=JSON.parse(l.decode(e));else r=e;if(r.asset===void 0||r.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const h=new I6e(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const d=this.pluginCallbacks[u](h);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[d.name]=d,o[d.name]=!0}if(r.extensionsUsed)for(let u=0;u<r.extensionsUsed.length;++u){const d=r.extensionsUsed[u],g=r.extensionsRequired||[];switch(d){case Pi.KHR_MATERIALS_UNLIT:o[d]=new Z8e;break;case Pi.KHR_DRACO_MESH_COMPRESSION:o[d]=new g6e(r,this.dracoLoader);break;case Pi.KHR_TEXTURE_TRANSFORM:o[d]=new m6e;break;case Pi.KHR_MESH_QUANTIZATION:o[d]=new _6e;break;default:g.indexOf(d)>=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}h.setExtensions(o),h.setPlugins(a),h.parse(n,s)}parseAsync(e,t){const n=this;return new Promise(function(s,r){n.parse(e,t,s,r)})}}function Y8e(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Pi={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class X8e{constructor(e){this.parser=e,this.name=Pi.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,s=t.length;n<s;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let s=t.cache.get(n);if(s)return s;const r=t.json,l=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let h;const u=new ei(16777215);l.color!==void 0&&u.setRGB(l.color[0],l.color[1],l.color[2],xa);const d=l.range!==void 0?l.range:0;switch(l.type){case"directional":h=new uY(u),h.target.position.set(0,0,-1),h.add(h.target);break;case"point":h=new XDe(u),h.distance=d;break;case"spot":h=new jDe(u),h.distance=d,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,h.angle=l.spot.outerConeAngle,h.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,h.target.position.set(0,0,-1),h.add(h.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return h.position.set(0,0,0),xu(h,l),l.intensity!==void 0&&(h.intensity=l.intensity),h.name=t.createUniqueName(l.name||"light_"+e),s=Promise.resolve(h),t.cache.add(n,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],a=(r.extensions&&r.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(l){return n._getNodeRef(t.cache,a,l)})}}class Z8e{constructor(){this.name=Pi.KHR_MATERIALS_UNLIT}getMaterialType(){return Bp}extendParams(e,t,n){const s=[];e.color=new ei(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const o=r.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],xa),e.opacity=o[3]}r.baseColorTexture!==void 0&&s.push(n.assignTexture(e,"map",r.baseColorTexture,jr))}return Promise.all(s)}}class J8e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name].emissiveStrength;return r!==void 0&&(t.emissiveIntensity=r),Promise.resolve()}}class K8e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(r.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ci(a,a)}return Promise.all(r)}}class e6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return t.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}}class t6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(r)}}class n6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new ei(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=s.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],xa)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&r.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,jr)),o.sheenRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(r)}}class i6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&r.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(r)}}class s6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&r.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new ei().setRGB(a[0],a[1],a[2],xa),Promise.all(r)}}class r6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class o6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&r.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new ei().setRGB(a[0],a[1],a[2],xa),o.specularColorTexture!==void 0&&r.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,jr)),Promise.all(r)}}class a6e{constructor(e){this.parser=e,this.name=Pi.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&r.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(r)}}class l6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&r.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(r)}}class c6e{constructor(e){this.parser=e,this.name=Pi.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,s=n.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const r=s.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class h6e{constructor(e){this.parser=e,this.name=Pi.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=n.textureLoader;if(a.uri){const h=n.options.manager.getHandler(a.uri);h!==null&&(l=h)}return n.loadTextureImage(e,o.source,l)}}class u6e{constructor(e){this.parser=e,this.name=Pi.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=n.textureLoader;if(a.uri){const h=n.options.manager.getHandler(a.uri);h!==null&&(l=h)}return n.loadTextureImage(e,o.source,l)}}class d6e{constructor(e){this.name=Pi.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const s=n.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const l=s.byteOffset||0,h=s.byteLength||0,u=s.count,d=s.byteStride,g=new Uint8Array(a,l,h);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,d,g,s.mode,s.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(u*d);return o.decodeGltfBuffer(new Uint8Array(m),u,d,g,s.mode,s.filter),m})})}else return null}}class f6e{constructor(e){this.name=Pi.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const s=t.meshes[n.mesh];for(const h of s.primitives)if(h.mode!==Ol.TRIANGLES&&h.mode!==Ol.TRIANGLE_STRIP&&h.mode!==Ol.TRIANGLE_FAN&&h.mode!==void 0)return null;const o=n.extensions[this.name].attributes,a=[],l={};for(const h in o)a.push(this.parser.getDependency("accessor",o[h]).then(u=>(l[h]=u,l[h])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(h=>{const u=h.pop(),d=u.isGroup?u.children:[u],g=h[0].count,m=[];for(const v of d){const b=new Qn,w=new $e,x=new pr,I=new $e(1,1,1),T=new wDe(v.geometry,v.material,g);for(let R=0;R<g;R++)l.TRANSLATION&&w.fromBufferAttribute(l.TRANSLATION,R),l.ROTATION&&x.fromBufferAttribute(l.ROTATION,R),l.SCALE&&I.fromBufferAttribute(l.SCALE,R),T.setMatrixAt(R,b.compose(w,x,I));for(const R in l)if(R==="_COLOR_0"){const F=l[R];T.instanceColor=new UC(F.array,F.itemSize,F.normalized)}else R!=="TRANSLATION"&&R!=="ROTATION"&&R!=="SCALE"&&v.geometry.setAttribute(R,l[R]);gr.prototype.copy.call(T,v),this.parser.assignFinalMaterial(T),m.push(T)}return u.isGroup?(u.clear(),u.add(...m),u):m[0]}))}}const AY="glTF",XA=12,Qz={JSON:1313821514,BIN:5130562};class p6e{constructor(e){this.name=Pi.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,XA),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==AY)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-XA,r=new DataView(e,XA);let o=0;for(;o<s;){const a=r.getUint32(o,!0);o+=4;const l=r.getUint32(o,!0);if(o+=4,l===Qz.JSON){const h=new Uint8Array(e,XA+o,a);this.content=n.decode(h)}else if(l===Qz.BIN){const h=XA+o;this.body=e.slice(h,h+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class g6e{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Pi.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,s=this.dracoLoader,r=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},l={},h={};for(const u in o){const d=FB[u]||u.toLowerCase();a[d]=o[u]}for(const u in e.attributes){const d=FB[u]||u.toLowerCase();if(o[u]!==void 0){const g=n.accessors[e.attributes[u]],m=N_[g.componentType];h[d]=m.name,l[d]=g.normalized===!0}}return t.getDependency("bufferView",r).then(function(u){return new Promise(function(d,g){s.decodeDracoFile(u,function(m){for(const v in m.attributes){const b=m.attributes[v],w=l[v];w!==void 0&&(b.normalized=w)}d(m)},a,h,xa,g)})})}}class m6e{constructor(){this.name=Pi.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class _6e{constructor(){this.name=Pi.KHR_MESH_QUANTIZATION}}class yY extends kb{constructor(e,t,n,s){super(e,t,n,s)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s*3+s;for(let o=0;o!==s;o++)t[o]=n[r+o];return t}interpolate_(e,t,n,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=a*2,h=a*3,u=s-t,d=(n-t)/u,g=d*d,m=g*d,v=e*h,b=v-h,w=-2*m+3*g,x=m-g,I=1-w,T=x-g+d;for(let R=0;R!==a;R++){const F=o[b+R+a],z=o[b+R+l]*u,U=o[v+R+a],N=o[v+R]*u;r[R]=I*F+T*z+w*U+x*N}return r}}const A6e=new pr;class y6e extends yY{interpolate_(e,t,n,s){const r=super.interpolate_(e,t,n,s);return A6e.fromArray(r).normalize().toArray(r),r}}const Ol={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},N_={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Wz={9728:Zr,9729:pl,9984:Ij,9985:vE,9986:Ry,9987:Mu},qz={33071:qd,33648:NC,10497:n0},d2={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},FB={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},wd={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},v6e={CUBICSPLINE:void 0,LINEAR:Qv,STEP:Hv},f2={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function b6e(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new qv({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ju})),i.DefaultMaterial}function dp(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function xu(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function x6e(i,e,t){let n=!1,s=!1,r=!1;for(let h=0,u=e.length;h<u;h++){const d=e[h];if(d.POSITION!==void 0&&(n=!0),d.NORMAL!==void 0&&(s=!0),d.COLOR_0!==void 0&&(r=!0),n&&s&&r)break}if(!n&&!s&&!r)return Promise.resolve(i);const o=[],a=[],l=[];for(let h=0,u=e.length;h<u;h++){const d=e[h];if(n){const g=d.POSITION!==void 0?t.getDependency("accessor",d.POSITION):i.attributes.position;o.push(g)}if(s){const g=d.NORMAL!==void 0?t.getDependency("accessor",d.NORMAL):i.attributes.normal;a.push(g)}if(r){const g=d.COLOR_0!==void 0?t.getDependency("accessor",d.COLOR_0):i.attributes.color;l.push(g)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(h){const u=h[0],d=h[1],g=h[2];return n&&(i.morphAttributes.position=u),s&&(i.morphAttributes.normal=d),r&&(i.morphAttributes.color=g),i.morphTargetsRelative=!0,i})}function w6e(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,s=t.length;n<s;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function E6e(i){let e;const t=i.extensions&&i.extensions[Pi.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+p2(t.attributes):e=i.indices+":"+p2(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,s=i.targets.length;n<s;n++)e+=":"+p2(i.targets[n]);return e}function p2(i){let e="";const t=Object.keys(i).sort();for(let n=0,s=t.length;n<s;n++)e+=t[n]+":"+i[t[n]]+";";return e}function OB(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function C6e(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const S6e=new Qn;class I6e{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Y8e,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,s=-1,r=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);s=n&&l?parseInt(l[1],10):-1,r=a.indexOf("Firefox")>-1,o=r?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&s<17||r&&o<98?this.textureLoader=new WDe(this.options.manager):this.textureLoader=new eFe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Gk(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:n,userData:{}};return dp(r,a,s),xu(a,s),Promise.all(n._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let s=0,r=t.length;s<r;s++){const o=t[s].joints;for(let a=0,l=o.length;a<l;a++)e[o[a]].isBone=!0}for(let s=0,r=e.length;s<r;s++){const o=e[s];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const s=n.clone(),r=(o,a)=>{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[h,u]of o.children.entries())r(u,a.children[h])};return r(n,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const s=e(t[n]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let s=0;s<t.length;s++){const r=e(t[s]);r&&n.push(r)}return n}getDependency(e,t){const n=e+":"+t;let s=this.cache.get(n);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":s=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(n,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(r,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Pi.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(r,o){n.load(cv.resolveURL(t.uri,s.path),r,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const s=t.byteLength||0,r=t.byteOffset||0;return n.slice(r,r+s)})}loadAccessor(e){const t=this,n=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const o=d2[s.type],a=N_[s.componentType],l=s.normalized===!0,h=new a(s.count*o);return Promise.resolve(new Io(h,o,l))}const r=[];return s.bufferView!==void 0?r.push(this.getDependency("bufferView",s.bufferView)):r.push(null),s.sparse!==void 0&&(r.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(r).then(function(o){const a=o[0],l=d2[s.type],h=N_[s.componentType],u=h.BYTES_PER_ELEMENT,d=u*l,g=s.byteOffset||0,m=s.bufferView!==void 0?n.bufferViews[s.bufferView].byteStride:void 0,v=s.normalized===!0;let b,w;if(m&&m!==d){const x=Math.floor(g/m),I="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+x+":"+s.count;let T=t.cache.get(I);T||(b=new h(a,x*m,s.count*m/u),T=new _De(b,m/u),t.cache.add(I,T)),w=new ADe(T,l,g%m/u,v)}else a===null?b=new h(s.count*l):b=new h(a,g,s.count*l),w=new Io(b,l,v);if(s.sparse!==void 0){const x=d2.SCALAR,I=N_[s.sparse.indices.componentType],T=s.sparse.indices.byteOffset||0,R=s.sparse.values.byteOffset||0,F=new I(o[1],T,s.sparse.count*x),z=new h(o[2],R,s.sparse.count*l);a!==null&&(w=new Io(w.array.slice(),w.itemSize,w.normalized)),w.normalized=!1;for(let U=0,N=F.length;U<N;U++){const L=F[U];if(w.setX(L,z[U*l]),l>=2&&w.setY(L,z[U*l+1]),l>=3&&w.setZ(L,z[U*l+2]),l>=4&&w.setW(L,z[U*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}w.normalized=v}return w})}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const l=n.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){const s=this,r=this.json,o=r.textures[e],a=r.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const h=this.loadImageSource(t,n).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const g=(r.samplers||{})[o.sampler]||{};return u.magFilter=Wz[g.magFilter]||pl,u.minFilter=Wz[g.minFilter]||Mu,u.wrapS=qz[g.wrapS]||n0,u.wrapT=qz[g.wrapT]||n0,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Zr&&u.minFilter!==pl,s.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=h,h}loadImageSource(e,t){const n=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=s.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",h=!1;if(o.bufferView!==void 0)l=n.getDependency("bufferView",o.bufferView).then(function(d){h=!0;const g=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(g),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(g,m){let v=g;t.isImageBitmapLoader===!0&&(v=function(b){const w=new wa(b);w.needsUpdate=!0,g(w)}),t.load(cv.resolveURL(d,r.path),v,void 0,m)})}).then(function(d){return h===!0&&a.revokeObjectURL(l),xu(d,o),d.userData.mimeType=o.mimeType||C6e(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,t,n,s){const r=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),r.extensions[Pi.KHR_TEXTURE_TRANSFORM]){const a=n.extensions!==void 0?n.extensions[Pi.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[Pi.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return s!==void 0&&(o.colorSpace=s),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+n.uuid;let l=this.cache.get(a);l||(l=new oY,Dc.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){const a="LineBasicMaterial:"+n.uuid;let l=this.cache.get(a);l||(l=new rY,Dc.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,this.cache.add(a,l)),n=l}if(s||r||o){let a="ClonedMaterial:"+n.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),s&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}e.material=n}getMaterialType(){return qv}loadMaterial(e){const t=this,n=this.json,s=this.extensions,r=n.materials[e];let o;const a={},l=r.extensions||{},h=[];if(l[Pi.KHR_MATERIALS_UNLIT]){const d=s[Pi.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),h.push(d.extendParams(a,r,t))}else{const d=r.pbrMetallicRoughness||{};if(a.color=new ei(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const g=d.baseColorFactor;a.color.setRGB(g[0],g[1],g[2],xa),a.opacity=g[3]}d.baseColorTexture!==void 0&&h.push(t.assignTexture(a,"map",d.baseColorTexture,jr)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(h.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),h.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(g){return g.getMaterialType&&g.getMaterialType(e)}),h.push(Promise.all(this._invokeAll(function(g){return g.extendMaterialParams&&g.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Mc);const u=r.alphaMode||f2.OPAQUE;if(u===f2.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===f2.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==Bp&&(h.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Ci(1,1),r.normalTexture.scale!==void 0)){const d=r.normalTexture.scale;a.normalScale.set(d,d)}if(r.occlusionTexture!==void 0&&o!==Bp&&(h.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==Bp){const d=r.emissiveFactor;a.emissive=new ei().setRGB(d[0],d[1],d[2],xa)}return r.emissiveTexture!==void 0&&o!==Bp&&h.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,jr)),Promise.all(h).then(function(){const d=new o(a);return r.name&&(d.name=r.name),xu(d,r),t.associations.set(d,{materials:e}),r.extensions&&dp(s,d,r),d})}createUniqueName(e){const t=tr.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,s=this.primitiveCache;function r(a){return n[Pi.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return jz(l,a,t)})}const o=[];for(let a=0,l=e.length;a<l;a++){const h=e[a],u=E6e(h),d=s[u];if(d)o.push(d.promise);else{let g;h.extensions&&h.extensions[Pi.KHR_DRACO_MESH_COMPRESSION]?g=r(h):g=jz(new Qc,h,t),s[u]={primitive:h,promise:g},o.push(g)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,s=this.extensions,r=n.meshes[e],o=r.primitives,a=[];for(let l=0,h=o.length;l<h;l++){const u=o[l].material===void 0?b6e(this.cache):this.getDependency("material",o[l].material);a.push(u)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(l){const h=l.slice(0,l.length-1),u=l[l.length-1],d=[];for(let m=0,v=u.length;m<v;m++){const b=u[m],w=o[m];let x;const I=h[m];if(w.mode===Ol.TRIANGLES||w.mode===Ol.TRIANGLE_STRIP||w.mode===Ol.TRIANGLE_FAN||w.mode===void 0)x=r.isSkinnedMesh===!0?new vDe(b,I):new mo(b,I),x.isSkinnedMesh===!0&&x.normalizeSkinWeights(),w.mode===Ol.TRIANGLE_STRIP?x.geometry=Hz(x.geometry,Nj):w.mode===Ol.TRIANGLE_FAN&&(x.geometry=Hz(x.geometry,BB));else if(w.mode===Ol.LINES)x=new IDe(b,I);else if(w.mode===Ol.LINE_STRIP)x=new zk(b,I);else if(w.mode===Ol.LINE_LOOP)x=new MDe(b,I);else if(w.mode===Ol.POINTS)x=new TDe(b,I);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+w.mode);Object.keys(x.geometry.morphAttributes).length>0&&w6e(x,r),x.name=t.createUniqueName(r.name||"mesh_"+e),xu(x,r),w.extensions&&dp(s,x,w),t.assignFinalMaterial(x),d.push(x)}for(let m=0,v=d.length;m<v;m++)t.associations.set(d[m],{meshes:e,primitives:m});if(d.length===1)return r.extensions&&dp(s,d[0],r),d[0];const g=new Ch;r.extensions&&dp(s,g,r),t.associations.set(g,{meshes:e});for(let m=0,v=d.length;m<v;m++)g.add(d[m]);return g})}loadCamera(e){let t;const n=this.json.cameras[e],s=n[n.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Eo(Ap.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):n.type==="orthographic"&&(t=new kS(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),xu(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let s=0,r=t.joints.length;s<r;s++)n.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(s){const r=s.pop(),o=s,a=[],l=[];for(let h=0,u=o.length;h<u;h++){const d=o[h];if(d){a.push(d);const g=new Qn;r!==null&&g.fromArray(r.array,h*16),l.push(g)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[h])}return new Ok(a,l)})}loadAnimation(e){const t=this.json,n=this,s=t.animations[e],r=s.name?s.name:"animation_"+e,o=[],a=[],l=[],h=[],u=[];for(let d=0,g=s.channels.length;d<g;d++){const m=s.channels[d],v=s.samplers[m.sampler],b=m.target,w=b.node,x=s.parameters!==void 0?s.parameters[v.input]:v.input,I=s.parameters!==void 0?s.parameters[v.output]:v.output;b.node!==void 0&&(o.push(this.getDependency("node",w)),a.push(this.getDependency("accessor",x)),l.push(this.getDependency("accessor",I)),h.push(v),u.push(b))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l),Promise.all(h),Promise.all(u)]).then(function(d){const g=d[0],m=d[1],v=d[2],b=d[3],w=d[4],x=[];for(let I=0,T=g.length;I<T;I++){const R=g[I],F=m[I],z=v[I],U=b[I],N=w[I];if(R===void 0)continue;R.updateMatrix&&R.updateMatrix();const L=n._createAnimationTracks(R,F,z,U,N);if(L)for(let k=0;k<L.length;k++)x.push(L[k])}return new UDe(r,void 0,x)})}createNodeMesh(e){const t=this.json,n=this,s=t.nodes[e];return s.mesh===void 0?null:n.getDependency("mesh",s.mesh).then(function(r){const o=n._getNodeRef(n.meshCache,s.mesh,r);return s.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let l=0,h=s.weights.length;l<h;l++)a.morphTargetInfluences[l]=s.weights[l]}),o})}loadNode(e){const t=this.json,n=this,s=t.nodes[e],r=n._loadNodeShallow(e),o=[],a=s.children||[];for(let h=0,u=a.length;h<u;h++)o.push(n.getDependency("node",a[h]));const l=s.skin===void 0?Promise.resolve(null):n.getDependency("skin",s.skin);return Promise.all([r,Promise.all(o),l]).then(function(h){const u=h[0],d=h[1],g=h[2];g!==null&&u.traverse(function(m){m.isSkinnedMesh&&m.bind(g,S6e)});for(let m=0,v=d.length;m<v;m++)u.add(d[m]);return u})}_loadNodeShallow(e){const t=this.json,n=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const r=t.nodes[e],o=r.name?s.createUniqueName(r.name):"",a=[],l=s._invokeOne(function(h){return h.createNodeMesh&&h.createNodeMesh(e)});return l&&a.push(l),r.camera!==void 0&&a.push(s.getDependency("camera",r.camera).then(function(h){return s._getNodeRef(s.cameraCache,r.camera,h)})),s._invokeAll(function(h){return h.createNodeAttachment&&h.createNodeAttachment(e)}).forEach(function(h){a.push(h)}),this.nodeCache[e]=Promise.all(a).then(function(h){let u;if(r.isBone===!0?u=new sY:h.length>1?u=new Ch:h.length===1?u=h[0]:u=new gr,u!==h[0])for(let d=0,g=h.length;d<g;d++)u.add(h[d]);if(r.name&&(u.userData.name=r.name,u.name=o),xu(u,r),r.extensions&&dp(n,u,r),r.matrix!==void 0){const d=new Qn;d.fromArray(r.matrix),u.applyMatrix4(d)}else r.translation!==void 0&&u.position.fromArray(r.translation),r.rotation!==void 0&&u.quaternion.fromArray(r.rotation),r.scale!==void 0&&u.scale.fromArray(r.scale);if(!s.associations.has(u))s.associations.set(u,{});else if(r.mesh!==void 0&&s.meshCache.refs[r.mesh]>1){const d=s.associations.get(u);s.associations.set(u,{...d})}return s.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],s=this,r=new Ch;n.name&&(r.name=s.createUniqueName(n.name)),xu(r,n),n.extensions&&dp(t,r,n);const o=n.nodes||[],a=[];for(let l=0,h=o.length;l<h;l++)a.push(s.getDependency("node",o[l]));return Promise.all(a).then(function(l){for(let u=0,d=l.length;u<d;u++)r.add(l[u]);const h=u=>{const d=new Map;for(const[g,m]of s.associations)(g instanceof Dc||g instanceof wa)&&d.set(g,m);return u.traverse(g=>{const m=s.associations.get(g);m!=null&&d.set(g,m)}),d};return s.associations=h(r),r})}_createAnimationTracks(e,t,n,s,r){const o=[],a=e.name?e.name:e.uuid,l=[];wd[r.path]===wd.weights?e.traverse(function(g){g.morphTargetInfluences&&l.push(g.name?g.name:g.uuid)}):l.push(a);let h;switch(wd[r.path]){case wd.weights:h=r0;break;case wd.rotation:h=o0;break;case wd.translation:case wd.scale:h=a0;break;default:n.itemSize===1?h=r0:h=a0;break}const u=s.interpolation!==void 0?v6e[s.interpolation]:Qv,d=this._getArrayFromAccessor(n);for(let g=0,m=l.length;g<m;g++){const v=new h(l[g]+"."+wd[r.path],t.array,d,u);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(v),o.push(v)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=OB(t.constructor),s=new Float32Array(t.length);for(let r=0,o=t.length;r<o;r++)s[r]=t[r]*n;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const s=this instanceof o0?y6e:yY;return new s(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function M6e(i,e,t){const n=e.attributes,s=new yl;if(n.POSITION!==void 0){const a=t.json.accessors[n.POSITION],l=a.min,h=a.max;if(l!==void 0&&h!==void 0){if(s.set(new $e(l[0],l[1],l[2]),new $e(h[0],h[1],h[2])),a.normalized){const u=OB(N_[a.componentType]);s.min.multiplyScalar(u),s.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const r=e.targets;if(r!==void 0){const a=new $e,l=new $e;for(let h=0,u=r.length;h<u;h++){const d=r[h];if(d.POSITION!==void 0){const g=t.json.accessors[d.POSITION],m=g.min,v=g.max;if(m!==void 0&&v!==void 0){if(l.setX(Math.max(Math.abs(m[0]),Math.abs(v[0]))),l.setY(Math.max(Math.abs(m[1]),Math.abs(v[1]))),l.setZ(Math.max(Math.abs(m[2]),Math.abs(v[2]))),g.normalized){const b=OB(N_[g.componentType]);l.multiplyScalar(b)}a.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(a)}i.boundingBox=s;const o=new Oh;s.getCenter(o.center),o.radius=s.min.distanceTo(s.max)/2,i.boundingSphere=o}function jz(i,e,t){const n=e.attributes,s=[];function r(o,a){return t.getDependency("accessor",o).then(function(l){i.setAttribute(a,l)})}for(const o in n){const a=FB[o]||o.toLowerCase();a in i.attributes||s.push(r(n[o],a))}if(e.indices!==void 0&&!i.index){const o=t.getDependency("accessor",e.indices).then(function(a){i.setIndex(a)});s.push(o)}return $i.workingColorSpace!==xa&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${$i.workingColorSpace}" not supported.`),xu(i,e),M6e(i,e,t),Promise.all(s).then(function(){return e.targets!==void 0?x6e(i,e.targets,t):i})}var bp=63710088e-1,hv=2*Math.PI*bp,wo=Math.PI/180,Am=1024e3/hv,T6e=512,R6e=class{static clamp(i,e,t){return Math.min(t,Math.max(e,i))}static makePerspectiveMatrix(i,e,t,n){let s=1/Math.tan(i/2),r=1/(t-n);return[s/e,0,0,0,0,s,0,0,0,0,(n+t)*r,-1,0,0,2*n*t*r,0]}static mercatorXFromLng(i){return(180+i)/360}static mercatorYFromLat(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}static getViewInfo(i,e,t){let n=i.fov*wo,s=i.pitch*wo,r=null;if(Array.isArray(e)&&(r={lng:e[0],lat:e[1],alt:e[2]||0}),typeof e=="string"){let d=e.split(",");r={lng:+d[0],lat:+d[1],alt:+d[2]||0}}let o=Math.max(t.x,t.y,t.z)/(2*Math.tan(n/2))*Math.cos(s)+r.alt,a=Math.abs(Math.cos(s)*i.cameraToCenterDistance),l=hv*Math.abs(Math.cos(r.lat*wo)),h=a/o*l,u=Math.round(Math.log2(h/i.tileSize));return{center:[r.lng,r.lat],cameraHeight:o,zoom:u}}static getHeightByZoom(i,e,t,n){let s=Math.abs(Math.cos(n*wo)*i.cameraToCenterDistance),r=hv*Math.abs(Math.cos(t*wo)),o=Math.pow(2,e)*i.tileSize;return s*r/o}static getZoomByHeight(i,e,t,n){let s=Math.abs(Math.cos(n*wo)*i.cameraToCenterDistance),r=hv*Math.abs(Math.cos(t*wo)),o=s/e*r;return Math.round(Math.log2(o/i.tileSize))}},Pp=R6e,Yz=new Qn,Xz=new Qn,Zz=85.051129,B6e=class{constructor(i,e,t){as(this,"_map"),as(this,"_world"),as(this,"_camera"),as(this,"_translateCenter"),as(this,"_worldSizeRatio"),this._map=i,this._world=e,this._camera=t,this._translateCenter=new Qn().makeTranslation(1024e3/2,-1024e3/2,0),this._worldSizeRatio=T6e/1024e3,this._map.on("move",()=>{this.syncCamera(!1)}),this._map.on("resize",()=>{this.syncCamera(!0)})}syncCamera(i){let e=this._map.transform,t=e.pitch*wo,n=e.bearing*wo;if(i){let d=e.fov*wo,g=e.centerOffset||new $e;this._camera.aspect=e.width/e.height,Yz.elements=Pp.makePerspectiveMatrix(d,this._camera.aspect,e.height/50,e.farZ),this._camera.projectionMatrix=Yz,this._camera.projectionMatrix.elements[8]=-g.x*2/e.width,this._camera.projectionMatrix.elements[9]=g.y*2/e.height}Xz.makeTranslation(0,0,e.cameraToCenterDistance);let s=new Qn().premultiply(Xz).premultiply(new Qn().makeRotationX(t)).premultiply(new Qn().makeRotationZ(-n));e.elevation&&(s.elements[14]=e.cameraToCenterDistance*Math.cos(t)),this._camera.matrixWorld.copy(s);let r=e.scale*this._worldSizeRatio,o=new Qn().makeScale(r,r,r),a=e.x,l=e.y;if(!a||!l){let d=e.center,g=Pp.clamp(d.lat,-Zz,Zz);a=Pp.mercatorXFromLng(d.lng)*e.worldSize,l=Pp.mercatorYFromLat(g)*e.worldSize}let h=new Qn().makeTranslation(-a,l,0),u=new Qn().makeRotationZ(Math.PI);this._world.matrix=new Qn().premultiply(u).premultiply(this._translateCenter).premultiply(o).premultiply(h)}},P6e=B6e,L6e=class{constructor(i,e){as(this,"_id"),as(this,"_mapScene"),as(this,"_cameraSync"),this._id=i,this._mapScene=e,this._cameraSync=new P6e(this._mapScene.map,this._mapScene.world,this._mapScene.camera)}get id(){return this._id}get type(){return"custom"}get renderingMode(){return"3d"}onAdd(){this._cameraSync.syncCamera(!0)}render(){this._mapScene.render()}onRemove(){this._cameraSync=null,this._mapScene=null}},k6e=L6e,N6e=class{static projectedMercatorUnitsPerMeter(){return this.projectedUnitsPerMeter(0)}static projectedUnitsPerMeter(i){return Math.abs(1024e3/Math.cos(wo*i)/hv)}static lngLatToVector3(i,e,t){let n=[0,0,0];return Array.isArray(i)?(n=[-bp*wo*i[0]*Am,-bp*Math.log(Math.tan(Math.PI*.25+.5*wo*i[1]))*Am],i[2]?n.push(i[2]*this.projectedUnitsPerMeter(i[1])):n.push(0)):(n=[-bp*wo*i*Am,-bp*Math.log(Math.tan(Math.PI*.25+.5*wo*(e||0)))*Am],t?n.push(t*this.projectedUnitsPerMeter(e||0)):n.push(0)),new $e(n[0],n[1],n[2])}static vector3ToLngLat(i){let e=[0,0,0];return i&&(e[0]=-i.x/(bp*wo*Am),e[1]=2*(Math.atan(Math.exp(i.y/(Am*-bp)))-Math.PI/4)/wo,e[2]=i.z/this.projectedUnitsPerMeter(e[1])),e}},t_=N6e,D6e={scene:null,camera:null,renderer:null,renderLoop:null,preserveDrawingBuffer:!1},F6e=class{constructor(i,e={}){if(as(this,"_map"),as(this,"_options"),as(this,"_canvas"),as(this,"_scene"),as(this,"_camera"),as(this,"_renderer"),as(this,"_lights"),as(this,"_world"),as(this,"_event"),!i)throw"missing map";this._map=i,this._options={...D6e,...e},this._canvas=i.getCanvas(),this._scene=this._options.scene||new mDe,this._camera=this._options.camera||new Eo(this._map.transform.fov,this._map.transform.width/this._map.transform.height,.001,1e21),this._camera.matrixAutoUpdate=!1,this._renderer=this._options.renderer||new q8e({alpha:!0,antialias:!0,preserveDrawingBuffer:this._options.preserveDrawingBuffer,canvas:this._canvas,context:this._canvas.getContext("webgl2")}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._canvas.clientWidth,this._canvas.clientHeight),this._renderer.autoClear=!1,this._lights=new Ch,this._lights.name="lights",this._scene.add(this._lights),this._world=new Ch,this._world.name="world",this._world.userData={isWorld:!0,name:"world"},this._world.position.set(1024e3/2,1024e3/2,0),this._world.matrixAutoUpdate=!1,this._scene.add(this._world),this._map.on("render",this._onMapRender.bind(this)),this._event=new pg}get map(){return this._map}get canvas(){return this._canvas}get camera(){return this._camera}get scene(){return this._scene}get lights(){return this._lights}get world(){return this._world}get renderer(){return this._renderer}_onMapRender(){this._map.getLayer("map_scene_layer")||this._map.addLayer(new k6e("map_scene_layer",this))}render(){if(this._options.renderLoop)this._options.renderLoop(this);else{let i={center:this._map.getCenter(),scene:this._scene,camera:this._camera,renderer:this._renderer};this._event.dispatchEvent({type:"preReset",frameState:i}),this.renderer.resetState(),this._event.dispatchEvent({type:"postReset",frameState:i}),this._event.dispatchEvent({type:"preRender",frameState:i}),this.renderer.render(this._scene,this._camera),this._event.dispatchEvent({type:"postRender",frameState:i})}return this}addLight(i){return this._lights.add(i.delegate||i),this}removeLight(i){return this._lights.remove(i.delegate||i),this}addObject(i){let e="delegate"in i?i.delegate:i;return this._world.add(e),this}removeObject(i){let e="delegate"in i?i.delegate:i;return this._world.remove(e),e.traverse(t=>{t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(n=>n.dispose()):t.material.dispose()),t.texture&&t.texture.dispose()}),this}getViewPosition(){let i=this._map.transform,e=i.center;return{position:[e.lng,e.lat,Pp.getHeightByZoom(i,i.zoom,e.lat,i.pitch)],heading:i.bearing,pitch:i.pitch}}flyTo(i,e,t){if(i&&i.position){t&&this._map.once("moveend",t);let n=i.size;n||(n=new $e,new yl().setFromObject(i.delegate||i,!0).getSize(n));let s=Pp.getViewInfo(this._map.transform,t_.vector3ToLngLat(i.position),n);this._map.flyTo({center:s.center,zoom:s.zoom,duration:(e||3)*1e3})}return this}zoomTo(i,e){return this.flyTo(i,0,e)}flyToPosition(i,e=[0,0,0],t,n=3){return t&&this._map.once("moveend",t),this._map.flyTo({center:[i[0],i[1]],zoom:Pp.getZoomByHeight(this._map.transform,i[2],i[1],e[1]||0),bearing:e[0],pitch:e[1],duration:n*1e3}),this}zoomToPosition(i,e=[0,0,0],t){return this.flyToPosition(i,e,t,0)}on(i,e){return this._event.addEventListener(i,e),this}off(i,e){return this._event.removeEventListener(i,e),this}},O6e=class{static createRTCGroup(i,e,t){let n=new Ch;if(n.name="rtc",n.position.copy(t_.lngLatToVector3(i)),e?(n.rotateX(e[0]||0),n.rotateY(e[1]||0),n.rotateZ(e[2]||0)):(n.rotateX(Math.PI/2),n.rotateY(Math.PI)),t)n.scale.set(t[0]||1,t[1]||1,t[2]||1);else{let s=1;Array.isArray(i)&&(s=t_.projectedUnitsPerMeter(i[1])),n.scale.set(s,s,s)}return n}static createMercatorRTCGroup(i,e,t){let n=this.createRTCGroup(i,e,t);if(!t){let s=1,r=t_.projectedMercatorUnitsPerMeter();Array.isArray(i)&&(s=t_.projectedUnitsPerMeter(i[1])),n.scale.set(r,r,s)}return n}static createShadowGround(i,e,t){let n=new $k(e||100,t||100),s=new RDe({opacity:.5,transparent:!0}),r=new mo(n,s);return r.position.copy(t_.lngLatToVector3(i)),r.receiveShadow=!0,r.name="shadow-ground",r}},Jz=O6e;const U6e=new kS(-1,1,1,-1,0,1);class z6e extends Qc{constructor(){super(),this.setAttribute("position",new Fc([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Fc([0,2,0,0,2,0],2))}}const $6e=new z6e;class vY{constructor(e){this._mesh=new mo($6e,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,U6e)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}var fo=Uint8Array,uv=Uint16Array,V6e=Int32Array,bY=new fo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xY=new fo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),G6e=new fo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wY=function(i,e){for(var t=new uv(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var s=new V6e(t[30]),n=1;n<30;++n)for(var r=t[n];r<t[n+1];++r)s[r]=r-t[n]<<5|n;return{b:t,r:s}},EY=wY(bY,2),CY=EY.b,H6e=EY.r;CY[28]=258,H6e[258]=28;var Q6e=wY(xY,0),W6e=Q6e.b,SY=new uv(32768);for(var Os=0;Os<32768;++Os){var Ed=(Os&43690)>>1|(Os&21845)<<1;Ed=(Ed&52428)>>2|(Ed&13107)<<2,Ed=(Ed&61680)>>4|(Ed&3855)<<4,SY[Os]=((Ed&65280)>>8|(Ed&255)<<8)>>1}var dv=function(i,e,t){for(var n=i.length,s=0,r=new uv(e);s<n;++s)i[s]&&++r[i[s]-1];var o=new uv(e);for(s=1;s<e;++s)o[s]=o[s-1]+r[s-1]<<1;var a;{a=new uv(1<<e);var l=15-e;for(s=0;s<n;++s)if(i[s])for(var h=s<<4|i[s],u=e-i[s],d=o[i[s]-1]++<<u,g=d|(1<<u)-1;d<=g;++d)a[SY[d]>>l]=h}return a},Nb=new fo(288);for(var Os=0;Os<144;++Os)Nb[Os]=8;for(var Os=144;Os<256;++Os)Nb[Os]=9;for(var Os=256;Os<280;++Os)Nb[Os]=7;for(var Os=280;Os<288;++Os)Nb[Os]=8;var IY=new fo(32);for(var Os=0;Os<32;++Os)IY[Os]=5;var q6e=dv(Nb,9),j6e=dv(IY,5),g2=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},vc=function(i,e,t){var n=e/8|0;return(i[n]|i[n+1]<<8)>>(e&7)&t},m2=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},MY=function(i){return(i+7)/8|0},D_=function(i,e,t){return(e==null||e<0)&&(e=0),(t==null||t>i.length)&&(t=i.length),new fo(i.subarray(e,t))},Y6e=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ha=function(i,e,t){var n=new Error(e||Y6e[i]);if(n.code=i,Error.captureStackTrace&&Error.captureStackTrace(n,ha),!t)throw n;return n},TY=function(i,e,t,n){var s=i.length,r=n?n.length:0;if(!s||e.f&&!e.l)return t||new fo(0);var o=!t,a=o||e.i!=2,l=e.i;o&&(t=new fo(s*3));var h=function(qe){var le=t.length;if(qe>le){var ot=new fo(Math.max(le*2,qe));ot.set(t),t=ot}},u=e.f||0,d=e.p||0,g=e.b||0,m=e.l,v=e.d,b=e.m,w=e.n,x=s*8;do{if(!m){u=vc(i,d,1);var I=vc(i,d+1,3);if(d+=3,I)if(I==1)m=q6e,v=j6e,b=9,w=5;else if(I==2){var z=vc(i,d,31)+257,U=vc(i,d+10,15)+4,N=z+vc(i,d+5,31)+1;d+=14;for(var L=new fo(N),k=new fo(19),D=0;D<U;++D)k[G6e[D]]=vc(i,d+D*3,7);d+=U*3;for(var Y=g2(k),Z=(1<<Y)-1,j=dv(k,Y),D=0;D<N;){var Q=j[vc(i,d,Z)];d+=Q&15;var T=Q>>4;if(T<16)L[D++]=T;else{var $=0,W=0;for(T==16?(W=3+vc(i,d,3),d+=2,$=L[D-1]):T==17?(W=3+vc(i,d,7),d+=3):T==18&&(W=11+vc(i,d,127),d+=7);W--;)L[D++]=$}}var q=L.subarray(0,z),ee=L.subarray(z);b=g2(q),w=g2(ee),m=dv(q,b),v=dv(ee,w)}else ha(1);else{var T=MY(d)+4,R=i[T-4]|i[T-3]<<8,F=T+R;if(F>s){l&&ha(0);break}a&&h(g+R),t.set(i.subarray(T,F),g),e.b=g+=R,e.p=d=F*8,e.f=u;continue}if(d>x){l&&ha(0);break}}a&&h(g+131072);for(var ne=(1<<b)-1,oe=(1<<w)-1,ue=d;;ue=d){var $=m[m2(i,d)&ne],pe=$>>4;if(d+=$&15,d>x){l&&ha(0);break}if($||ha(2),pe<256)t[g++]=pe;else if(pe==256){ue=d,m=null;break}else{var ae=pe-254;if(pe>264){var D=pe-257,ye=bY[D];ae=vc(i,d,(1<<ye)-1)+CY[D],d+=ye}var Me=v[m2(i,d)&oe],Ne=Me>>4;Me||ha(3),d+=Me&15;var ee=W6e[Ne];if(Ne>3){var ye=xY[Ne];ee+=m2(i,d)&(1<<ye)-1,d+=ye}if(d>x){l&&ha(0);break}a&&h(g+131072);var me=g+ae;if(g<ee){var Ke=r-ee,ze=Math.min(ee,me);for(Ke+g<0&&ha(3);g<ze;++g)t[g]=n[Ke+g]}for(;g<me;++g)t[g]=t[g-ee]}}e.l=m,e.p=ue,e.b=g,e.f=u,m&&(u=1,e.m=b,e.d=v,e.n=w)}while(!u);return g!=t.length&&o?D_(t,0,g):t.subarray(0,g)},X6e=new fo(0),Ah=function(i,e){return i[e]|i[e+1]<<8},Ic=function(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0},_2=function(i,e){return Ic(i,e)+Ic(i,e+4)*4294967296},Z6e=function(i){(i[0]!=31||i[1]!=139||i[2]!=8)&&ha(6,"invalid gzip data");var e=i[3],t=10;e&4&&(t+=(i[10]|i[11]<<8)+2);for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!i[t++]);return t+(e&2)},A2=(function(){function i(e,t){typeof e=="function"&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new fo(32768),this.p=new fo(0),n&&this.o.set(n)}return i.prototype.e=function(e){if(this.ondata||ha(5),this.d&&ha(4),!this.p.length)this.p=e;else if(e.length){var t=new fo(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},i.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=TY(this.p,this.s,this.o);this.ondata(D_(n,t,this.s.b),this.d),this.o=D_(n,this.s.b-32768),this.s.b=this.o.length,this.p=D_(this.p,this.s.p/8|0),this.s.p&=7},i.prototype.push=function(e,t){this.e(e),this.c(t)},i})();function J6e(i,e){return TY(i,{i:2},e&&e.out,e&&e.dictionary)}var K6e=(function(){function i(e,t){this.v=1,this.r=0,A2.call(this,e,t)}return i.prototype.push=function(e,t){if(A2.prototype.e.call(this,e),this.r+=e.length,this.v){var n=this.p.subarray(this.v-1),s=n.length>3?Z6e(n):4;if(s>n.length){if(!t)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(s),this.v=0}A2.prototype.c.call(this,t),this.s.f&&!this.s.l&&!t&&(this.v=MY(this.s.p)+9,this.s={i:0},this.o=new fo(0),this.push(new fo(0),t))},i})(),UB=typeof TextDecoder<"u"&&new TextDecoder,eze=0;try{UB.decode(X6e,{stream:!0}),eze=1}catch{}var tze=function(i){for(var e="",t=0;;){var n=i[t++],s=(n>127)+(n>223)+(n>239);if(t+s>i.length)return{s:e,r:D_(i,t-1)};s?s==3?(n=((n&15)<<18|(i[t++]&63)<<12|(i[t++]&63)<<6|i[t++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):s&1?e+=String.fromCharCode((n&31)<<6|i[t++]&63):e+=String.fromCharCode((n&15)<<12|(i[t++]&63)<<6|i[t++]&63):e+=String.fromCharCode(n)}};function nze(i,e){if(e){for(var t="",n=0;n<i.length;n+=16384)t+=String.fromCharCode.apply(null,i.subarray(n,n+16384));return t}else{if(UB)return UB.decode(i);var s=tze(i),r=s.s,t=s.r;return t.length&&ha(8),r}}var ize=function(i,e){return e+30+Ah(i,e+26)+Ah(i,e+28)},sze=function(i,e,t){var n=Ah(i,e+28),s=nze(i.subarray(e+46,e+46+n),!(Ah(i,e+8)&2048)),r=e+46+n,o=Ic(i,e+20),a=t&&o==4294967295?rze(i,r):[o,Ic(i,e+24),Ic(i,e+42)],l=a[0],h=a[1],u=a[2];return[Ah(i,e+10),l,h,s,r+Ah(i,e+30)+Ah(i,e+32),u]},rze=function(i,e){for(;Ah(i,e)!=1;e+=4+Ah(i,e+2));return[_2(i,e+12),_2(i,e+4),_2(i,e+20)]};function oze(i,e){for(var t={},n=i.length-22;Ic(i,n)!=101010256;--n)(!n||i.length-n>65558)&&ha(13);var s=Ah(i,n+8);if(!s)return{};var r=Ic(i,n+16),o=r==4294967295||s==65535;if(o){var a=Ic(i,n-12);o=Ic(i,a)==101075792,o&&(s=Ic(i,a+32),r=Ic(i,a+48))}for(var l=e&&e.filter,h=0;h<s;++h){var u=sze(i,r,o),d=u[0],g=u[1],m=u[2],v=u[3],b=u[4],w=u[5],x=ize(i,w);r=b,(!l||l({name:v,size:g,originalSize:m,compression:d}))&&(d?d==8?t[v]=J6e(i.subarray(x,x+g),{out:new fo(m)}):ha(14,"unknown compression type "+d):t[v]=D_(i,x,x+g))}return t}let Du;const RY=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&RY.decode();let Py=null;function aze(){return(Py===null||Py.byteLength===0)&&(Py=new Uint8Array(Du.memory.buffer)),Py}function lze(i,e){return i=i>>>0,RY.decode(aze().subarray(i,i+e))}function cze(i,e,t,n,s,r,o,a,l,h,u,d,g){return Du.raycast_splats(i,e,t,n,s,r,o,a,l,h,u,d,g)}async function hze(i,e){if(typeof Response=="function"&&i instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(i,e)}catch(n){if(i.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const t=await i.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(i,e);return t instanceof WebAssembly.Instance?{instance:t,module:i}:t}}function uze(){const i={};return i.wbg={},i.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},i.wbg.__wbg_length_3b4f022188ae8db6=function(e){return e.length},i.wbg.__wbg_length_6ca527665d89694d=function(e){return e.length},i.wbg.__wbg_length_8cfd2c6409af88ad=function(e){return e.length},i.wbg.__wbg_new_9fee97a409b32b68=function(e){return new Uint16Array(e)},i.wbg.__wbg_new_e3b321dcfef89fc7=function(e){return new Uint32Array(e)},i.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354=function(e,t,n){return new Float32Array(e,t>>>0,n>>>0)},i.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(e,t,n){return new Uint32Array(e,t>>>0,n>>>0)},i.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return new Float32Array(e>>>0)},i.wbg.__wbg_set_10bad9bee0e9c58b=function(e,t,n){e.set(t,n>>>0)},i.wbg.__wbg_set_d23661d19148b229=function(e,t,n){e.set(t,n>>>0)},i.wbg.__wbg_set_f4f1f0daa30696fc=function(e,t,n){e.set(t,n>>>0)},i.wbg.__wbg_subarray_3aaeec89bb2544f0=function(e,t,n){return e.subarray(t>>>0,n>>>0)},i.wbg.__wbg_subarray_769e1e0f81bb259b=function(e,t,n){return e.subarray(t>>>0,n>>>0)},i.wbg.__wbindgen_init_externref_table=function(){const e=Du.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},i.wbg.__wbindgen_memory=function(){return Du.memory},i.wbg.__wbindgen_throw=function(e,t){throw new Error(lze(e,t))},i}function dze(i,e){return Du=i.exports,BY.__wbindgen_wasm_module=e,Py=null,Du.__wbindgen_start(),Du}async function BY(i){if(Du!==void 0)return Du;typeof i<"u"&&(Object.getPrototypeOf(i)===Object.prototype?{module_or_path:i}=i:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof i>"u"&&(i=new URL("data:application/wasm;base64,AGFzbQEAAAABzAEeYAJ/fwF/YAJ/fwBgA39/fwF/YAF/AX9gA39/fwBgAX8AYAV/f39/fwBgA29/fwFvYAV/f39/fwF/YAFvAW9gA29vfwBgAW8Bf2AAAX9gBH9/f38AYAAAYAR/f39/AX9gA39vbwF/YAF/AW9gAAFvYAF9AX1gBn9/f39/fwBgDX19fX19fX19f29/fX0Bb2AGf39/f39/AX9gBX9/fH9/AGAEf3x/fwBgBX9/fX9/AGAEf31/fwBgBX9/fn9/AGAEf35/fwBgAn19AX0C8gQRA3diZx1fX3diZ19idWZmZXJfNjA5Y2MzZWVlNTFlZDE1OAAJA3diZxpfX3diZ19uZXdfOWZlZTk3YTQwOWIzMmI2OAAJA3diZxpfX3diZ19zZXRfZjRmMWYwZGFhMzA2OTZmYwAKA3diZx1fX3diZ19sZW5ndGhfOGNmZDJjNjQwOWFm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MAAABmAAAAFwAAADB4MDAwMTAyMDMwNDA1MDYwNzA4MDkxMDExMTIxMzE0MTUxNjE3MTgxOTIwMjEyMjIzMjQyNTI2MjcyODI5MzAzMTMyMzMzNDM1MzYzNzM4Mzk0MDQxNDI0MzQ0NDU0NjQ3NDg0OTUwNTE1MjUzNTQ1NTU2NTc1ODU5NjA2MTYyNjM2NDY1NjY2NzY4Njk3MDcxNzI3Mzc0NzU3Njc3Nzg3OTgwODE4MjgzODQ4NTg2ODc4ODg5OTA5MTkyOTM5NDk1OTY5Nzk4OTlyYW5nZSBzdGFydCBpbmRleCAgb3V0IG9mIHJhbmdlIGZvciBzbGljZSBvZiBsZW5ndGggAACiCBAAEgAAALQIEAAiAAAAcmFuZ2UgZW5kIGluZGV4IOgIEAAQAAAAtAgQACIAAAAAAAA/AAAAvwBBqJLAAAsBFABwCXByb2R1Y2VycwIIbGFuZ3VhZ2UBBFJ1c3QADHByb2Nlc3NlZC1ieQMFcnVzdGMdMS44My4wICg5MGIzNWE2MjMgMjAyNC0xMS0yNikGd2FscnVzBjAuMjMuMwx3YXNtLWJpbmRnZW4HMC4yLjEwMABJD3RhcmdldF9mZWF0dXJlcwQrD211dGFibGUtZ2xvYmFscysIc2lnbi1leHQrD3JlZmVyZW5jZS10eXBlcysKbXVsdGl2YWx1ZQ==",typeof document>"u"?require("url").pathToFileURL(__filename).href:ZI&&ZI.tagName.toUpperCase()==="SCRIPT"&&ZI.src||new URL("ControlGrid-BHj06tuI.cjs",document.baseURI).href));const e=uze();(typeof i=="string"||typeof Request=="function"&&i instanceof Request||typeof URL=="function"&&i instanceof URL)&&(i=fetch(i));const{instance:t,module:n}=await hze(await i,e);return dze(t,n)}const Yu=-12,Xu=9,fze=-30,y2=Math.exp(fze),pze=11,gze=11,Cs=1<<pze,Lp=1<<gze,mze=1;function _ze(i){return i==="bool"||i==="bvec2"||i==="bvec3"||i==="bvec4"}function kp(i){return i==="int"||i==="ivec2"||i==="ivec3"||i==="ivec4"}function Np(i){return i==="uint"||i==="uvec2"||i==="uvec3"||i==="uvec4"}function Aze(i){return i==="float"||i==="vec2"||i==="vec3"||i==="vec4"}function yze(i){return i==="mat2"||i==="mat2x2"||i==="mat2x3"||i==="mat2x4"||i==="mat3"||i==="mat3x2"||i==="mat3x3"||i==="mat3x4"||i==="mat4"||i==="mat4x2"||i==="mat4x3"||i==="mat4x4"}function jv(i){return Aze(i)||yze(i)}function ym(i){return i==="mat2"||i==="mat2x2"}function vm(i){return i==="mat3"||i==="mat3x3"}function bm(i){return i==="mat4"||i==="mat4x4"}function vze(i){switch(i){case"vec2":return"float";case"vec3":return"float";case"vec4":return"float";case"ivec2":return"int";case"ivec3":return"int";case"ivec4":return"int";case"uvec2":return"uint";case"uvec3":return"uint";case"uvec4":return"uint";default:throw new Error(`Invalid vector type: ${i}`)}}function bze(i){switch(i){case"vec2":case"ivec2":case"uvec2":return 2;case"vec3":case"ivec3":case"uvec3":return 3;case"vec4":case"ivec4":case"uvec4":return 4;default:throw new Error(`Invalid vector type: ${i}`)}}function Gr(i){return Math.trunc(i).toString()}function Hr(i){return`${Math.max(0,Math.trunc(i)).toString()}u`}function ji(i){return i===Number.POSITIVE_INFINITY?"INFINITY":i===Number.NEGATIVE_INFINITY?"-INFINITY":Number.isInteger(i)?i.toFixed(1):i.toString()}function Bu(i){return i instanceof Dp?i.type:i.dynoOut().type}class Dp{constructor(e){this.__isDynoValue=!0,this.type=e}}class $a extends Dp{constructor(e,t){super(e.outTypes[t]),this.dyno=e,this.key=t}}class TE extends Dp{constructor(e,t){super(e),this.literal=t}getLiteral(){return this.literal}}class xze extends TE{constructor(e,t){super(e,""),this.value=t}getLiteral(){const{type:e,value:t}=this;switch(e){case"bool":return t?"true":"false";case"uint":return Hr(t);case"int":return Gr(t);case"float":return ji(t);case"bvec2":{const n=t;return`bvec2(${n[0]}, ${n[1]})`}case"uvec2":{if(t instanceof Ci)return`uvec2(${Hr(t.x)}, ${Hr(t.y)})`;const n=t;return`uvec2(${Hr(n[0])}, ${Hr(n[1])})`}case"ivec2":{if(t instanceof Ci)return`ivec2(${Gr(t.x)}, ${Gr(t.y)})`;const n=t;return`ivec2(${Gr(n[0])}, ${Gr(n[1])})`}case"vec2":{if(t instanceof Ci)return`vec2(${ji(t.x)}, ${ji(t.y)})`;const n=t;return`vec2(${ji(n[0])}, ${ji(n[1])})`}case"bvec3":{const n=t;return`bvec3(${n[0]}, ${n[1]}, ${n[2]})`}case"uvec3":{if(t instanceof $e)return`uvec3(${Hr(t.x)}, ${Hr(t.y)}, ${Hr(t.z)})`;const n=t;return`uvec3(${Hr(n[0])}, ${Hr(n[1])}, ${Hr(n[2])})`}case"ivec3":{if(t instanceof $e)return`ivec3(${Gr(t.x)}, ${Gr(t.y)}, ${Gr(t.z)})`;const n=t;return`ivec3(${Gr(n[0])}, ${Gr(n[1])}, ${Gr(n[2])})`}case"vec3":{if(t instanceof $e)return`vec3(${ji(t.x)}, ${ji(t.y)}, ${ji(t.z)})`;const n=t;return`vec3(${ji(n[0])}, ${ji(n[1])}, ${ji(n[2])})`}case"bvec4":{const n=t;return`bvec4(${n[0]}, ${n[1]}, ${n[2]}, ${n[3]})`}case"uvec4":{if(t instanceof Ii)return`uvec4(${Hr(t.x)}, ${Hr(t.y)}, ${Hr(t.z)}, ${Hr(t.w)})`;const n=t;return`uvec4(${Hr(n[0])}, ${Hr(n[1])}, ${Hr(n[2])}, ${Hr(n[3])})`}case"ivec4":{if(t instanceof Ii)return`ivec4(${Gr(t.x)}, ${Gr(t.y)}, ${Gr(t.z)}, ${Gr(t.w)})`;const n=t;return`ivec4(${Gr(n[0])}, ${Gr(n[1])}, ${Gr(n[2])}, ${Gr(n[3])})`}case"vec4":{if(t instanceof Ii)return`vec4(${ji(t.x)}, ${ji(t.y)}, ${ji(t.z)}, ${ji(t.w)})`;if(t instanceof pr)return`vec4(${ji(t.x)}, ${ji(t.y)}, ${ji(t.z)}, ${ji(t.w)})`;const n=t;return`vec4(${ji(n[0])}, ${ji(n[1])}, ${ji(n[2])}, ${ji(n[3])})`}case"mat2":case"mat2x2":{const n=t,s=n instanceof NS?n.elements:t,r=new Array(4).fill(0).map((o,a)=>ji(s[a]));return`${e}(${r.join(", ")})`}case"mat2x3":{const n=t,s=new Array(6).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat2x4":{const n=t,s=new Array(8).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat3":case"mat3x3":{const n=t,s=n instanceof wi?n.elements:t,r=new Array(9).fill(0).map((o,a)=>ji(s[a]));return`${e}(${r.join(", ")})`}case"mat3x2":{const n=t,s=new Array(6).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat3x4":{const n=t,s=new Array(12).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat4":case"mat4x4":{const n=t,s=n instanceof Qn?n.elements:t,r=new Array(16).fill(0).map((o,a)=>ji(s[a]));return`${e}(${r.join(", ")})`}case"mat4x2":{const n=t,s=new Array(8).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat4x3":{const n=t,s=new Array(12).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}default:throw new Error(`Type not implemented: ${String(e)}`)}}}function fv(i,e){return new xze(i,e)}function H1(i){const e=String(i);if(_ze(i))return`${e}(false)`;if(jv(i))return`${e}(0.0)`;if(kp(i))return`${e}(0)`;if(Np(i))return`${e}(0u)`;throw new Error(`Type not implemented: ${e}`)}const Kz=" ";class wze{constructor({indent:e}={}){this.globals=new Set,this.statements=[],this.uniforms={},this.declares=new Set,this.updaters=[],this.sequence=0,this.indent=Kz,this.indent=e??Kz}nextSequence(){return this.sequence++}}class _o{constructor({inTypes:e,outTypes:t,inputs:n,update:s,globals:r,statements:o,generate:a}){this.inTypes=e??{},this.outTypes=t??{},this.inputs=n??{},this.update=s,this.globals=r,this.statements=o,this.generate=a??(({inputs:l,outputs:h,compile:u})=>{var d,g;return{globals:(d=this.globals)==null?void 0:d.call(this,{inputs:l,outputs:h,compile:u}),statements:(g=this.statements)==null?void 0:g.call(this,{inputs:l,outputs:h,compile:u})}})}get outputs(){const e={};for(const t in this.outTypes)e[t]=new $a(this,t);return e}apply(e){return Object.assign(this.inputs,e),this.outputs}compile({inputs:e,outputs:t,compile:n}){const s=[`// ${this.constructor.name}(${Object.values(e).join(", ")}) => (${Object.values(t).join(", ")})`],r=[];for(const h in t){const u=t[h];u&&!n.declares.has(u)&&(n.declares.add(u),r.push(h))}const{globals:o,statements:a,uniforms:l}=this.generate({inputs:e,outputs:t,compile:n});for(const h of o??[])n.globals.add(h);for(const h in l)n.uniforms[h]=l[h];this.update&&n.updaters.push(this.update);for(const h of r){const u=t[h];u&&(n.uniforms[u]||s.push(`${PY(u,this.outTypes[h])};`))}return a?.length&&(s.push("{"),s.push(...a.map(h=>n.indent+h)),s.push("}")),s}}class Eze extends _o{constructor({inTypes:e,outTypes:t,inputs:n,update:s,globals:r,construct:o}){super({inTypes:e,outTypes:t,inputs:n,update:s,globals:r,generate:a=>this.generateBlock(a)}),this.construct=o}generateBlock({inputs:e,outputs:t,compile:n}){var s,r;const o={},a={};for(const w in e)e[w]!=null&&(o[w]=new TE(this.inTypes[w],e[w]));for(const w in t)t[w]!=null&&(a[w]=new Dp(this.outTypes[w]));const l={roots:[]},h=this.construct(o,a,l);for(const w of((s=this.globals)==null?void 0:s.call(this,{inputs:e,outputs:t,compile:n}))??[])n.globals.add(w);const u=[],d=new Map;function g(w,x,I){let T=d.get(w);if(!T){T={sequence:n.nextSequence(),outNames:new Map,newOuts:new Set},d.set(w,T);for(const R in w.inputs){let F=w.inputs[R];for(;F;){if(F instanceof Dp){F instanceof $a&&g(F.dyno,F.key);break}F=F.dynoOut()}}u.push(w)}x&&(I||T.newOuts.add(x),T.outNames.set(x,I??`${x}_${T.sequence}`))}for(const w of l.roots)g(w);for(const w in a){let x=h?.[w]??a[w];for(;x;){if(x instanceof Dp){x instanceof $a&&g(x.dyno,x.key,t[w]);break}x=x.dynoOut()}a[w]=x}const m=[];for(const w of u){const x={},I={};for(const F in w.inputs){let z=w.inputs[F];for(;z;){if(z instanceof Dp){if(z instanceof TE)x[F]=z.getLiteral();else if(z instanceof $a){const U=(r=d.get(z.dyno))==null?void 0:r.outNames.get(z.key);if(!U)throw new Error(`Source not found for ${z.dyno.constructor.name}.${z.key}`);x[F]=U}break}z=z.dynoOut()}}const T=d.get(w)??{outNames:new Map};for(const[F,z]of T.outNames.entries())I[F]=z;const R=w.compile({inputs:x,outputs:I,compile:n});m.push(R)}const v=[];for(const w in t)a[w]instanceof TE&&v.push(`${t[w]} = ${a[w].getLiteral()};`);return v.length>0&&m.push(v),{statements:m.flatMap((w,x)=>x===0?w:["",...w])}}}function Zu(i,e,t,{update:n,globals:s}={}){return new Eze({inTypes:i,outTypes:e,construct:t,update:n,globals:s})}function FS({inTypes:i,outTypes:e,inputs:t,update:n,globals:s,statements:r,generate:o}){return new _o({inTypes:i,outTypes:e,inputs:t,update:n,globals:s,statements:r,generate:o})}function PY(i,e,t){const n=typeof e=="string"?e:e.type;if(!n)throw new Error(`Invalid DynoType: ${String(e)}`);return`${n} ${i}${t!=null?`[${t}]`:""}`}function zh(i){var e;let t=!1;const n=i.split(`
|
|
7090
|
+
}`;class V8e{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const s=new wa,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new zc({vertexShader:z8e,fragmentShader:$8e,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new mo(new $k(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}let G8e=class extends pg{constructor(e,t){super();const n=this;let s=null,r=1,o=null,a="local-floor",l=1,h=null,u=null,d=null,g=null,m=null,v=null;const b=new V8e,w=t.getContextAttributes();let x=null,I=null;const T=[],R=[],F=new Ci;let z=null;const U=new Eo;U.viewport=new Ii;const N=new Eo;N.viewport=new Ii;const L=[U,N],k=new tFe;let D=null,Y=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ae){let ye=T[ae];return ye===void 0&&(ye=new JT,T[ae]=ye),ye.getTargetRaySpace()},this.getControllerGrip=function(ae){let ye=T[ae];return ye===void 0&&(ye=new JT,T[ae]=ye),ye.getGripSpace()},this.getHand=function(ae){let ye=T[ae];return ye===void 0&&(ye=new JT,T[ae]=ye),ye.getHandSpace()};function Z(ae){const ye=R.indexOf(ae.inputSource);if(ye===-1)return;const Me=T[ye];Me!==void 0&&(Me.update(ae.inputSource,ae.frame,h||o),Me.dispatchEvent({type:ae.type,data:ae.inputSource}))}function j(){s.removeEventListener("select",Z),s.removeEventListener("selectstart",Z),s.removeEventListener("selectend",Z),s.removeEventListener("squeeze",Z),s.removeEventListener("squeezestart",Z),s.removeEventListener("squeezeend",Z),s.removeEventListener("end",j),s.removeEventListener("inputsourceschange",Q);for(let ae=0;ae<T.length;ae++){const ye=R[ae];ye!==null&&(R[ae]=null,T[ae].disconnect(ye))}D=null,Y=null,b.reset(),e.setRenderTarget(x),m=null,g=null,d=null,s=null,I=null,pe.stop(),n.isPresenting=!1,e.setPixelRatio(z),e.setSize(F.width,F.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ae){r=ae,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ae){a=ae,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||o},this.setReferenceSpace=function(ae){h=ae},this.getBaseLayer=function(){return g!==null?g:m},this.getBinding=function(){return d},this.getFrame=function(){return v},this.getSession=function(){return s},this.setSession=async function(ae){if(s=ae,s!==null){if(x=e.getRenderTarget(),s.addEventListener("select",Z),s.addEventListener("selectstart",Z),s.addEventListener("selectend",Z),s.addEventListener("squeeze",Z),s.addEventListener("squeezestart",Z),s.addEventListener("squeezeend",Z),s.addEventListener("end",j),s.addEventListener("inputsourceschange",Q),w.xrCompatible!==!0&&await t.makeXRCompatible(),z=e.getPixelRatio(),e.getSize(F),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Me=null,Ne=null,me=null;w.depth&&(me=w.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Me=w.stencil?Gv:Vv,Ne=w.stencil?$v:za);const Ke={colorFormat:t.RGBA8,depthFormat:me,scaleFactor:r};d=new XRWebGLBinding(s,t),g=d.createProjectionLayer(Ke),s.updateRenderState({layers:[g]}),e.setPixelRatio(1),e.setSize(g.textureWidth,g.textureHeight,!1),I=new Ph(g.textureWidth,g.textureHeight,{format:go,type:ba,depthTexture:new aY(g.textureWidth,g.textureHeight,Ne,void 0,void 0,void 0,void 0,void 0,void 0,Me),stencilBuffer:w.stencil,colorSpace:e.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}else{const Me={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:r};m=new XRWebGLLayer(s,t,Me),s.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),I=new Ph(m.framebufferWidth,m.framebufferHeight,{format:go,type:ba,colorSpace:e.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}I.isXRRenderTarget=!0,this.setFoveation(l),h=null,o=await s.requestReferenceSpace(a),pe.setContext(s),pe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return b.getDepthTexture()};function Q(ae){for(let ye=0;ye<ae.removed.length;ye++){const Me=ae.removed[ye],Ne=R.indexOf(Me);Ne>=0&&(R[Ne]=null,T[Ne].disconnect(Me))}for(let ye=0;ye<ae.added.length;ye++){const Me=ae.added[ye];let Ne=R.indexOf(Me);if(Ne===-1){for(let Ke=0;Ke<T.length;Ke++)if(Ke>=R.length){R.push(Me),Ne=Ke;break}else if(R[Ke]===null){R[Ke]=Me,Ne=Ke;break}if(Ne===-1)break}const me=T[Ne];me&&me.connect(Me)}}const $=new $e,W=new $e;function q(ae,ye,Me){$.setFromMatrixPosition(ye.matrixWorld),W.setFromMatrixPosition(Me.matrixWorld);const Ne=$.distanceTo(W),me=ye.projectionMatrix.elements,Ke=Me.projectionMatrix.elements,ze=me[14]/(me[10]-1),qe=me[14]/(me[10]+1),le=(me[9]+1)/me[5],ot=(me[9]-1)/me[5],ve=(me[8]-1)/me[0],mt=(Ke[8]+1)/Ke[0],yt=ze*ve,Ie=ze*mt,Ae=Ne/(-ve+mt),Fe=Ae*-ve;if(ye.matrixWorld.decompose(ae.position,ae.quaternion,ae.scale),ae.translateX(Fe),ae.translateZ(Ae),ae.matrixWorld.compose(ae.position,ae.quaternion,ae.scale),ae.matrixWorldInverse.copy(ae.matrixWorld).invert(),me[10]===-1)ae.projectionMatrix.copy(ye.projectionMatrix),ae.projectionMatrixInverse.copy(ye.projectionMatrixInverse);else{const dt=ze+Ae,vt=qe+Ae,Yt=yt-Fe,we=Ie+(Ne-Fe),se=le*qe/vt*dt,He=ot*qe/vt*dt;ae.projectionMatrix.makePerspective(Yt,we,se,He,dt,vt),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert()}}function ee(ae,ye){ye===null?ae.matrixWorld.copy(ae.matrix):ae.matrixWorld.multiplyMatrices(ye.matrixWorld,ae.matrix),ae.matrixWorldInverse.copy(ae.matrixWorld).invert()}this.updateCamera=function(ae){if(s===null)return;let ye=ae.near,Me=ae.far;b.texture!==null&&(b.depthNear>0&&(ye=b.depthNear),b.depthFar>0&&(Me=b.depthFar)),k.near=N.near=U.near=ye,k.far=N.far=U.far=Me,(D!==k.near||Y!==k.far)&&(s.updateRenderState({depthNear:k.near,depthFar:k.far}),D=k.near,Y=k.far),U.layers.mask=ae.layers.mask|2,N.layers.mask=ae.layers.mask|4,k.layers.mask=U.layers.mask|N.layers.mask;const Ne=ae.parent,me=k.cameras;ee(k,Ne);for(let Ke=0;Ke<me.length;Ke++)ee(me[Ke],Ne);me.length===2?q(k,U,N):k.projectionMatrix.copy(U.projectionMatrix),ne(ae,k,Ne)};function ne(ae,ye,Me){Me===null?ae.matrix.copy(ye.matrixWorld):(ae.matrix.copy(Me.matrixWorld),ae.matrix.invert(),ae.matrix.multiply(ye.matrixWorld)),ae.matrix.decompose(ae.position,ae.quaternion,ae.scale),ae.updateMatrixWorld(!0),ae.projectionMatrix.copy(ye.projectionMatrix),ae.projectionMatrixInverse.copy(ye.projectionMatrixInverse),ae.isPerspectiveCamera&&(ae.fov=i0*2*Math.atan(1/ae.projectionMatrix.elements[5]),ae.zoom=1)}this.getCamera=function(){return k},this.getFoveation=function(){if(!(g===null&&m===null))return l},this.setFoveation=function(ae){l=ae,g!==null&&(g.fixedFoveation=ae),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=ae)},this.hasDepthSensing=function(){return b.texture!==null},this.getDepthSensingMesh=function(){return b.getMesh(k)};let oe=null;function ue(ae,ye){if(u=ye.getViewerPose(h||o),v=ye,u!==null){const Me=u.views;m!==null&&(e.setRenderTargetFramebuffer(I,m.framebuffer),e.setRenderTarget(I));let Ne=!1;Me.length!==k.cameras.length&&(k.cameras.length=0,Ne=!0);for(let ze=0;ze<Me.length;ze++){const qe=Me[ze];let le=null;if(m!==null)le=m.getViewport(qe);else{const ve=d.getViewSubImage(g,qe);le=ve.viewport,ze===0&&(e.setRenderTargetTextures(I,ve.colorTexture,ve.depthStencilTexture),e.setRenderTarget(I))}let ot=L[ze];ot===void 0&&(ot=new Eo,ot.layers.enable(ze),ot.viewport=new Ii,L[ze]=ot),ot.matrix.fromArray(qe.transform.matrix),ot.matrix.decompose(ot.position,ot.quaternion,ot.scale),ot.projectionMatrix.fromArray(qe.projectionMatrix),ot.projectionMatrixInverse.copy(ot.projectionMatrix).invert(),ot.viewport.set(le.x,le.y,le.width,le.height),ze===0&&(k.matrix.copy(ot.matrix),k.matrix.decompose(k.position,k.quaternion,k.scale)),Ne===!0&&k.cameras.push(ot)}const me=s.enabledFeatures;if(me&&me.includes("depth-sensing")&&s.depthUsage=="gpu-optimized"&&d){const ze=d.getDepthInformation(Me[0]);ze&&ze.isValid&&ze.texture&&b.init(e,ze,s.renderState)}}for(let Me=0;Me<T.length;Me++){const Ne=R[Me],me=T[Me];Ne!==null&&me!==void 0&&me.update(Ne,ye,h||o)}oe&&oe(ae,ye),ye.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ye}),v=null}const pe=new fY;pe.setAnimationLoop(ue),this.setAnimationLoop=function(ae){oe=ae},this.dispose=function(){}}};const up=new gf,H8e=new Qn;function Q8e(i,e){function t(w,x){w.matrixAutoUpdate===!0&&w.updateMatrix(),x.value.copy(w.matrix)}function n(w,x){x.color.getRGB(w.fogColor.value,Jj(i)),x.isFog?(w.fogNear.value=x.near,w.fogFar.value=x.far):x.isFogExp2&&(w.fogDensity.value=x.density)}function s(w,x,I,T,R){x.isMeshBasicMaterial||x.isMeshLambertMaterial?r(w,x):x.isMeshToonMaterial?(r(w,x),d(w,x)):x.isMeshPhongMaterial?(r(w,x),u(w,x)):x.isMeshStandardMaterial?(r(w,x),g(w,x),x.isMeshPhysicalMaterial&&m(w,x,R)):x.isMeshMatcapMaterial?(r(w,x),v(w,x)):x.isMeshDepthMaterial?r(w,x):x.isMeshDistanceMaterial?(r(w,x),b(w,x)):x.isMeshNormalMaterial?r(w,x):x.isLineBasicMaterial?(o(w,x),x.isLineDashedMaterial&&a(w,x)):x.isPointsMaterial?l(w,x,I,T):x.isSpriteMaterial?h(w,x):x.isShadowMaterial?(w.color.value.copy(x.color),w.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function r(w,x){w.opacity.value=x.opacity,x.color&&w.diffuse.value.copy(x.color),x.emissive&&w.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(w.map.value=x.map,t(x.map,w.mapTransform)),x.alphaMap&&(w.alphaMap.value=x.alphaMap,t(x.alphaMap,w.alphaMapTransform)),x.bumpMap&&(w.bumpMap.value=x.bumpMap,t(x.bumpMap,w.bumpMapTransform),w.bumpScale.value=x.bumpScale,x.side===Ua&&(w.bumpScale.value*=-1)),x.normalMap&&(w.normalMap.value=x.normalMap,t(x.normalMap,w.normalMapTransform),w.normalScale.value.copy(x.normalScale),x.side===Ua&&w.normalScale.value.negate()),x.displacementMap&&(w.displacementMap.value=x.displacementMap,t(x.displacementMap,w.displacementMapTransform),w.displacementScale.value=x.displacementScale,w.displacementBias.value=x.displacementBias),x.emissiveMap&&(w.emissiveMap.value=x.emissiveMap,t(x.emissiveMap,w.emissiveMapTransform)),x.specularMap&&(w.specularMap.value=x.specularMap,t(x.specularMap,w.specularMapTransform)),x.alphaTest>0&&(w.alphaTest.value=x.alphaTest);const I=e.get(x),T=I.envMap,R=I.envMapRotation;T&&(w.envMap.value=T,up.copy(R),up.x*=-1,up.y*=-1,up.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(up.y*=-1,up.z*=-1),w.envMapRotation.value.setFromMatrix4(H8e.makeRotationFromEuler(up)),w.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,w.reflectivity.value=x.reflectivity,w.ior.value=x.ior,w.refractionRatio.value=x.refractionRatio),x.lightMap&&(w.lightMap.value=x.lightMap,w.lightMapIntensity.value=x.lightMapIntensity,t(x.lightMap,w.lightMapTransform)),x.aoMap&&(w.aoMap.value=x.aoMap,w.aoMapIntensity.value=x.aoMapIntensity,t(x.aoMap,w.aoMapTransform))}function o(w,x){w.diffuse.value.copy(x.color),w.opacity.value=x.opacity,x.map&&(w.map.value=x.map,t(x.map,w.mapTransform))}function a(w,x){w.dashSize.value=x.dashSize,w.totalSize.value=x.dashSize+x.gapSize,w.scale.value=x.scale}function l(w,x,I,T){w.diffuse.value.copy(x.color),w.opacity.value=x.opacity,w.size.value=x.size*I,w.scale.value=T*.5,x.map&&(w.map.value=x.map,t(x.map,w.uvTransform)),x.alphaMap&&(w.alphaMap.value=x.alphaMap,t(x.alphaMap,w.alphaMapTransform)),x.alphaTest>0&&(w.alphaTest.value=x.alphaTest)}function h(w,x){w.diffuse.value.copy(x.color),w.opacity.value=x.opacity,w.rotation.value=x.rotation,x.map&&(w.map.value=x.map,t(x.map,w.mapTransform)),x.alphaMap&&(w.alphaMap.value=x.alphaMap,t(x.alphaMap,w.alphaMapTransform)),x.alphaTest>0&&(w.alphaTest.value=x.alphaTest)}function u(w,x){w.specular.value.copy(x.specular),w.shininess.value=Math.max(x.shininess,1e-4)}function d(w,x){x.gradientMap&&(w.gradientMap.value=x.gradientMap)}function g(w,x){w.metalness.value=x.metalness,x.metalnessMap&&(w.metalnessMap.value=x.metalnessMap,t(x.metalnessMap,w.metalnessMapTransform)),w.roughness.value=x.roughness,x.roughnessMap&&(w.roughnessMap.value=x.roughnessMap,t(x.roughnessMap,w.roughnessMapTransform)),x.envMap&&(w.envMapIntensity.value=x.envMapIntensity)}function m(w,x,I){w.ior.value=x.ior,x.sheen>0&&(w.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),w.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(w.sheenColorMap.value=x.sheenColorMap,t(x.sheenColorMap,w.sheenColorMapTransform)),x.sheenRoughnessMap&&(w.sheenRoughnessMap.value=x.sheenRoughnessMap,t(x.sheenRoughnessMap,w.sheenRoughnessMapTransform))),x.clearcoat>0&&(w.clearcoat.value=x.clearcoat,w.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(w.clearcoatMap.value=x.clearcoatMap,t(x.clearcoatMap,w.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(w.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,t(x.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(w.clearcoatNormalMap.value=x.clearcoatNormalMap,t(x.clearcoatNormalMap,w.clearcoatNormalMapTransform),w.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Ua&&w.clearcoatNormalScale.value.negate())),x.dispersion>0&&(w.dispersion.value=x.dispersion),x.iridescence>0&&(w.iridescence.value=x.iridescence,w.iridescenceIOR.value=x.iridescenceIOR,w.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],w.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(w.iridescenceMap.value=x.iridescenceMap,t(x.iridescenceMap,w.iridescenceMapTransform)),x.iridescenceThicknessMap&&(w.iridescenceThicknessMap.value=x.iridescenceThicknessMap,t(x.iridescenceThicknessMap,w.iridescenceThicknessMapTransform))),x.transmission>0&&(w.transmission.value=x.transmission,w.transmissionSamplerMap.value=I.texture,w.transmissionSamplerSize.value.set(I.width,I.height),x.transmissionMap&&(w.transmissionMap.value=x.transmissionMap,t(x.transmissionMap,w.transmissionMapTransform)),w.thickness.value=x.thickness,x.thicknessMap&&(w.thicknessMap.value=x.thicknessMap,t(x.thicknessMap,w.thicknessMapTransform)),w.attenuationDistance.value=x.attenuationDistance,w.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(w.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(w.anisotropyMap.value=x.anisotropyMap,t(x.anisotropyMap,w.anisotropyMapTransform))),w.specularIntensity.value=x.specularIntensity,w.specularColor.value.copy(x.specularColor),x.specularColorMap&&(w.specularColorMap.value=x.specularColorMap,t(x.specularColorMap,w.specularColorMapTransform)),x.specularIntensityMap&&(w.specularIntensityMap.value=x.specularIntensityMap,t(x.specularIntensityMap,w.specularIntensityMapTransform))}function v(w,x){x.matcap&&(w.matcap.value=x.matcap)}function b(w,x){const I=e.get(x).light;w.referencePosition.value.setFromMatrixPosition(I.matrixWorld),w.nearDistance.value=I.shadow.camera.near,w.farDistance.value=I.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function W8e(i,e,t,n){let s={},r={},o=[];const a=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(I,T){const R=T.program;n.uniformBlockBinding(I,R)}function h(I,T){let R=s[I.id];R===void 0&&(v(I),R=u(I),s[I.id]=R,I.addEventListener("dispose",w));const F=T.program;n.updateUBOMapping(I,F);const z=e.render.frame;r[I.id]!==z&&(g(I),r[I.id]=z)}function u(I){const T=d();I.__bindingPointIndex=T;const R=i.createBuffer(),F=I.__size,z=I.usage;return i.bindBuffer(i.UNIFORM_BUFFER,R),i.bufferData(i.UNIFORM_BUFFER,F,z),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,T,R),R}function d(){for(let I=0;I<a;I++)if(o.indexOf(I)===-1)return o.push(I),I;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function g(I){const T=s[I.id],R=I.uniforms,F=I.__cache;i.bindBuffer(i.UNIFORM_BUFFER,T);for(let z=0,U=R.length;z<U;z++){const N=Array.isArray(R[z])?R[z]:[R[z]];for(let L=0,k=N.length;L<k;L++){const D=N[L];if(m(D,z,L,F)===!0){const Y=D.__offset,Z=Array.isArray(D.value)?D.value:[D.value];let j=0;for(let Q=0;Q<Z.length;Q++){const $=Z[Q],W=b($);typeof $=="number"||typeof $=="boolean"?(D.__data[0]=$,i.bufferSubData(i.UNIFORM_BUFFER,Y+j,D.__data)):$.isMatrix3?(D.__data[0]=$.elements[0],D.__data[1]=$.elements[1],D.__data[2]=$.elements[2],D.__data[3]=0,D.__data[4]=$.elements[3],D.__data[5]=$.elements[4],D.__data[6]=$.elements[5],D.__data[7]=0,D.__data[8]=$.elements[6],D.__data[9]=$.elements[7],D.__data[10]=$.elements[8],D.__data[11]=0):($.toArray(D.__data,j),j+=W.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,Y,D.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function m(I,T,R,F){const z=I.value,U=T+"_"+R;if(F[U]===void 0)return typeof z=="number"||typeof z=="boolean"?F[U]=z:F[U]=z.clone(),!0;{const N=F[U];if(typeof z=="number"||typeof z=="boolean"){if(N!==z)return F[U]=z,!0}else if(N.equals(z)===!1)return N.copy(z),!0}return!1}function v(I){const T=I.uniforms;let R=0;const F=16;for(let U=0,N=T.length;U<N;U++){const L=Array.isArray(T[U])?T[U]:[T[U]];for(let k=0,D=L.length;k<D;k++){const Y=L[k],Z=Array.isArray(Y.value)?Y.value:[Y.value];for(let j=0,Q=Z.length;j<Q;j++){const $=Z[j],W=b($),q=R%F,ee=q%W.boundary,ne=q+ee;R+=ee,ne!==0&&F-ne<W.storage&&(R+=F-ne),Y.__data=new Float32Array(W.storage/Float32Array.BYTES_PER_ELEMENT),Y.__offset=R,R+=W.storage}}}const z=R%F;return z>0&&(R+=F-z),I.__size=R,I.__cache={},this}function b(I){const T={boundary:0,storage:0};return typeof I=="number"||typeof I=="boolean"?(T.boundary=4,T.storage=4):I.isVector2?(T.boundary=8,T.storage=8):I.isVector3||I.isColor?(T.boundary=16,T.storage=12):I.isVector4?(T.boundary=16,T.storage=16):I.isMatrix3?(T.boundary=48,T.storage=48):I.isMatrix4?(T.boundary=64,T.storage=64):I.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",I),T}function w(I){const T=I.target;T.removeEventListener("dispose",w);const R=o.indexOf(T.__bindingPointIndex);o.splice(R,1),i.deleteBuffer(s[T.id]),delete s[T.id],delete r[T.id]}function x(){for(const I in s)i.deleteBuffer(s[I]);o=[],s={},r={}}return{bind:l,update:h,dispose:x}}let q8e=class{constructor(e={}){const{canvas:t=Q4e(),context:n=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:h=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:g=!1}=e;this.isWebGLRenderer=!0;let m;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=n.getContextAttributes().alpha}else m=o;const v=new Uint32Array(4),b=new Int32Array(4);let w=null,x=null;const I=[],T=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=tf,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const R=this;let F=!1;this._outputColorSpace=jr;let z=0,U=0,N=null,L=-1,k=null;const D=new Ii,Y=new Ii;let Z=null;const j=new ei(0);let Q=0,$=t.width,W=t.height,q=1,ee=null,ne=null;const oe=new Ii(0,0,$,W),ue=new Ii(0,0,$,W);let pe=!1;const ae=new Uk;let ye=!1,Me=!1;const Ne=new Qn,me=new Qn,Ke=new $e,ze=new Ii,qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let le=!1;function ot(){return N===null?q:1}let ve=n;function mt(_e,Qe){return t.getContext(_e,Qe)}try{const _e={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:h,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Mk}`),t.addEventListener("webglcontextlost",fn,!1),t.addEventListener("webglcontextrestored",Gt,!1),t.addEventListener("webglcontextcreationerror",St,!1),ve===null){const Qe="webgl2";if(ve=mt(Qe,_e),ve===null)throw mt(Qe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(_e){throw console.error("THREE.WebGLRenderer: "+_e.message),_e}let yt,Ie,Ae,Fe,dt,vt,Yt,we,se,He,je,Ce,Oe,ut,ht,st,zt,Et,Jt,Ft,cn,Xt,Pn,Ge;function sn(){yt=new i5e(ve),yt.init(),Xt=new U8e(ve,yt),Ie=new XUe(ve,yt,e,Xt),Ae=new F8e(ve,yt),Ie.reverseDepthBuffer&&g&&Ae.buffers.depth.setReversed(!0),Fe=new o5e(ve),dt=new E8e,vt=new O8e(ve,yt,Ae,dt,Ie,Xt,Fe),Yt=new JUe(R),we=new n5e(R),se=new dFe(ve),Pn=new jUe(ve,se),He=new s5e(ve,se,Fe,Pn),je=new l5e(ve,He,se,Fe),Jt=new a5e(ve,Ie,vt),st=new ZUe(dt),Ce=new w8e(R,Yt,we,yt,Ie,Pn,st),Oe=new Q8e(R,dt),ut=new S8e,ht=new P8e(yt),Et=new qUe(R,Yt,we,Ae,je,m,l),zt=new N8e(R,je,Ie),Ge=new W8e(ve,Fe,Ie,Ae),Ft=new YUe(ve,yt,Fe),cn=new r5e(ve,yt,Fe),Fe.programs=Ce.programs,R.capabilities=Ie,R.extensions=yt,R.properties=dt,R.renderLists=ut,R.shadowMap=zt,R.state=Ae,R.info=Fe}sn();const kt=new G8e(R,ve);this.xr=kt,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const _e=yt.get("WEBGL_lose_context");_e&&_e.loseContext()},this.forceContextRestore=function(){const _e=yt.get("WEBGL_lose_context");_e&&_e.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(_e){_e!==void 0&&(q=_e,this.setSize($,W,!1))},this.getSize=function(_e){return _e.set($,W)},this.setSize=function(_e,Qe,At=!0){if(kt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=_e,W=Qe,t.width=Math.floor(_e*q),t.height=Math.floor(Qe*q),At===!0&&(t.style.width=_e+"px",t.style.height=Qe+"px"),this.setViewport(0,0,_e,Qe)},this.getDrawingBufferSize=function(_e){return _e.set($*q,W*q).floor()},this.setDrawingBufferSize=function(_e,Qe,At){$=_e,W=Qe,q=At,t.width=Math.floor(_e*At),t.height=Math.floor(Qe*At),this.setViewport(0,0,_e,Qe)},this.getCurrentViewport=function(_e){return _e.copy(D)},this.getViewport=function(_e){return _e.copy(oe)},this.setViewport=function(_e,Qe,At,_t){_e.isVector4?oe.set(_e.x,_e.y,_e.z,_e.w):oe.set(_e,Qe,At,_t),Ae.viewport(D.copy(oe).multiplyScalar(q).round())},this.getScissor=function(_e){return _e.copy(ue)},this.setScissor=function(_e,Qe,At,_t){_e.isVector4?ue.set(_e.x,_e.y,_e.z,_e.w):ue.set(_e,Qe,At,_t),Ae.scissor(Y.copy(ue).multiplyScalar(q).round())},this.getScissorTest=function(){return pe},this.setScissorTest=function(_e){Ae.setScissorTest(pe=_e)},this.setOpaqueSort=function(_e){ee=_e},this.setTransparentSort=function(_e){ne=_e},this.getClearColor=function(_e){return _e.copy(Et.getClearColor())},this.setClearColor=function(){Et.setClearColor(...arguments)},this.getClearAlpha=function(){return Et.getClearAlpha()},this.setClearAlpha=function(){Et.setClearAlpha(...arguments)},this.clear=function(_e=!0,Qe=!0,At=!0){let _t=0;if(_e){let Ye=!1;if(N!==null){const Nt=N.texture.format;Ye=Nt===ku||Nt===BS||Nt===Lk}if(Ye){const Nt=N.texture.type,Qt=Nt===ba||Nt===za||Nt===zv||Nt===$v||Nt===Rk||Nt===Bk,gn=Et.getClearColor(),nn=Et.getClearAlpha(),Dn=gn.r,$n=gn.g,Vn=gn.b;Qt?(v[0]=Dn,v[1]=$n,v[2]=Vn,v[3]=nn,ve.clearBufferuiv(ve.COLOR,0,v)):(b[0]=Dn,b[1]=$n,b[2]=Vn,b[3]=nn,ve.clearBufferiv(ve.COLOR,0,b))}else _t|=ve.COLOR_BUFFER_BIT}Qe&&(_t|=ve.DEPTH_BUFFER_BIT),At&&(_t|=ve.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ve.clear(_t)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",fn,!1),t.removeEventListener("webglcontextrestored",Gt,!1),t.removeEventListener("webglcontextcreationerror",St,!1),Et.dispose(),ut.dispose(),ht.dispose(),dt.dispose(),Yt.dispose(),we.dispose(),je.dispose(),Pn.dispose(),Ge.dispose(),Ce.dispose(),kt.dispose(),kt.removeEventListener("sessionstart",Qa),kt.removeEventListener("sessionend",Po),Pe.stop()};function fn(_e){_e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function Gt(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1;const _e=Fe.autoReset,Qe=zt.enabled,At=zt.autoUpdate,_t=zt.needsUpdate,Ye=zt.type;sn(),Fe.autoReset=_e,zt.enabled=Qe,zt.autoUpdate=At,zt.needsUpdate=_t,zt.type=Ye}function St(_e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",_e.statusMessage)}function An(_e){const Qe=_e.target;Qe.removeEventListener("dispose",An),yn(Qe)}function yn(_e){Tt(_e),dt.remove(_e)}function Tt(_e){const Qe=dt.get(_e).programs;Qe!==void 0&&(Qe.forEach(function(At){Ce.releaseProgram(At)}),_e.isShaderMaterial&&Ce.releaseShaderCache(_e))}this.renderBufferDirect=function(_e,Qe,At,_t,Ye,Nt){Qe===null&&(Qe=qe);const Qt=Ye.isMesh&&Ye.matrixWorld.determinant()<0,gn=hi(_e,Qe,At,_t,Ye);Ae.setMaterial(_t,Qt);let nn=At.index,Dn=1;if(_t.wireframe===!0){if(nn=He.getWireframeAttribute(At),nn===void 0)return;Dn=2}const $n=At.drawRange,Vn=At.attributes.position;let li=$n.start*Dn,vi=($n.start+$n.count)*Dn;Nt!==null&&(li=Math.max(li,Nt.start*Dn),vi=Math.min(vi,(Nt.start+Nt.count)*Dn)),nn!==null?(li=Math.max(li,0),vi=Math.min(vi,nn.count)):Vn!=null&&(li=Math.max(li,0),vi=Math.min(vi,Vn.count));const ls=vi-li;if(ls<0||ls===1/0)return;Pn.setup(Ye,_t,gn,At,nn);let Fi,Hi=Ft;if(nn!==null&&(Fi=se.get(nn),Hi=cn,Hi.setIndex(Fi)),Ye.isMesh)_t.wireframe===!0?(Ae.setLineWidth(_t.wireframeLinewidth*ot()),Hi.setMode(ve.LINES)):Hi.setMode(ve.TRIANGLES);else if(Ye.isLine){let Gn=_t.linewidth;Gn===void 0&&(Gn=1),Ae.setLineWidth(Gn*ot()),Ye.isLineSegments?Hi.setMode(ve.LINES):Ye.isLineLoop?Hi.setMode(ve.LINE_LOOP):Hi.setMode(ve.LINE_STRIP)}else Ye.isPoints?Hi.setMode(ve.POINTS):Ye.isSprite&&Hi.setMode(ve.TRIANGLES);if(Ye.isBatchedMesh)if(Ye._multiDrawInstances!==null)L_("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Hi.renderMultiDrawInstances(Ye._multiDrawStarts,Ye._multiDrawCounts,Ye._multiDrawCount,Ye._multiDrawInstances);else if(yt.get("WEBGL_multi_draw"))Hi.renderMultiDraw(Ye._multiDrawStarts,Ye._multiDrawCounts,Ye._multiDrawCount);else{const Gn=Ye._multiDrawStarts,ns=Ye._multiDrawCounts,bi=Ye._multiDrawCount,bs=nn?se.get(nn).bytesPerElement:1,xs=dt.get(_t).currentProgram.getUniforms();for(let mr=0;mr<bi;mr++)xs.setValue(ve,"_gl_DrawID",mr),Hi.render(Gn[mr]/bs,ns[mr])}else if(Ye.isInstancedMesh)Hi.renderInstances(li,ls,Ye.count);else if(At.isInstancedBufferGeometry){const Gn=At._maxInstanceCount!==void 0?At._maxInstanceCount:1/0,ns=Math.min(At.instanceCount,Gn);Hi.renderInstances(li,ls,ns)}else Hi.render(li,ls)};function oi(_e,Qe,At){_e.transparent===!0&&_e.side===Mc&&_e.forceSinglePass===!1?(_e.side=Ua,_e.needsUpdate=!0,Fn(_e,Qe,At),_e.side=ju,_e.needsUpdate=!0,Fn(_e,Qe,At),_e.side=Mc):Fn(_e,Qe,At)}this.compile=function(_e,Qe,At=null){At===null&&(At=_e),x=ht.get(At),x.init(Qe),T.push(x),At.traverseVisible(function(Ye){Ye.isLight&&Ye.layers.test(Qe.layers)&&(x.pushLight(Ye),Ye.castShadow&&x.pushShadow(Ye))}),_e!==At&&_e.traverseVisible(function(Ye){Ye.isLight&&Ye.layers.test(Qe.layers)&&(x.pushLight(Ye),Ye.castShadow&&x.pushShadow(Ye))}),x.setupLights();const _t=new Set;return _e.traverse(function(Ye){if(!(Ye.isMesh||Ye.isPoints||Ye.isLine||Ye.isSprite))return;const Nt=Ye.material;if(Nt)if(Array.isArray(Nt))for(let Qt=0;Qt<Nt.length;Qt++){const gn=Nt[Qt];oi(gn,At,Ye),_t.add(gn)}else oi(Nt,At,Ye),_t.add(Nt)}),x=T.pop(),_t},this.compileAsync=function(_e,Qe,At=null){const _t=this.compile(_e,Qe,At);return new Promise(Ye=>{function Nt(){if(_t.forEach(function(Qt){dt.get(Qt).currentProgram.isReady()&&_t.delete(Qt)}),_t.size===0){Ye(_e);return}setTimeout(Nt,10)}yt.get("KHR_parallel_shader_compile")!==null?Nt():setTimeout(Nt,10)})};let Ms=null;function js(_e){Ms&&Ms(_e)}function Qa(){Pe.stop()}function Po(){Pe.start()}const Pe=new fY;Pe.setAnimationLoop(js),typeof self<"u"&&Pe.setContext(self),this.setAnimationLoop=function(_e){Ms=_e,kt.setAnimationLoop(_e),_e===null?Pe.stop():Pe.start()},kt.addEventListener("sessionstart",Qa),kt.addEventListener("sessionend",Po),this.render=function(_e,Qe){if(Qe!==void 0&&Qe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;if(_e.matrixWorldAutoUpdate===!0&&_e.updateMatrixWorld(),Qe.parent===null&&Qe.matrixWorldAutoUpdate===!0&&Qe.updateMatrixWorld(),kt.enabled===!0&&kt.isPresenting===!0&&(kt.cameraAutoUpdate===!0&&kt.updateCamera(Qe),Qe=kt.getCamera()),_e.isScene===!0&&_e.onBeforeRender(R,_e,Qe,N),x=ht.get(_e,T.length),x.init(Qe),T.push(x),me.multiplyMatrices(Qe.projectionMatrix,Qe.matrixWorldInverse),ae.setFromProjectionMatrix(me),Me=this.localClippingEnabled,ye=st.init(this.clippingPlanes,Me),w=ut.get(_e,I.length),w.init(),I.push(w),kt.enabled===!0&&kt.isPresenting===!0){const Nt=R.xr.getDepthSensingMesh();Nt!==null&&Xe(Nt,Qe,-1/0,R.sortObjects)}Xe(_e,Qe,0,R.sortObjects),w.finish(),R.sortObjects===!0&&w.sort(ee,ne),le=kt.enabled===!1||kt.isPresenting===!1||kt.hasDepthSensing()===!1,le&&Et.addToRenderList(w,_e),this.info.render.frame++,ye===!0&&st.beginShadows();const At=x.state.shadowsArray;zt.render(At,_e,Qe),ye===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset();const _t=w.opaque,Ye=w.transmissive;if(x.setupLights(),Qe.isArrayCamera){const Nt=Qe.cameras;if(Ye.length>0)for(let Qt=0,gn=Nt.length;Qt<gn;Qt++){const nn=Nt[Qt];lt(_t,Ye,_e,nn)}le&&Et.render(_e);for(let Qt=0,gn=Nt.length;Qt<gn;Qt++){const nn=Nt[Qt];wt(w,_e,nn,nn.viewport)}}else Ye.length>0&<(_t,Ye,_e,Qe),le&&Et.render(_e),wt(w,_e,Qe);N!==null&&U===0&&(vt.updateMultisampleRenderTarget(N),vt.updateRenderTargetMipmap(N)),_e.isScene===!0&&_e.onAfterRender(R,_e,Qe),Pn.resetDefaultState(),L=-1,k=null,T.pop(),T.length>0?(x=T[T.length-1],ye===!0&&st.setGlobalState(R.clippingPlanes,x.state.camera)):x=null,I.pop(),I.length>0?w=I[I.length-1]:w=null};function Xe(_e,Qe,At,_t){if(_e.visible===!1)return;if(_e.layers.test(Qe.layers)){if(_e.isGroup)At=_e.renderOrder;else if(_e.isLOD)_e.autoUpdate===!0&&_e.update(Qe);else if(_e.isLight)x.pushLight(_e),_e.castShadow&&x.pushShadow(_e);else if(_e.isSprite){if(!_e.frustumCulled||ae.intersectsSprite(_e)){_t&&ze.setFromMatrixPosition(_e.matrixWorld).applyMatrix4(me);const Qt=je.update(_e),gn=_e.material;gn.visible&&w.push(_e,Qt,gn,At,ze.z,null)}}else if((_e.isMesh||_e.isLine||_e.isPoints)&&(!_e.frustumCulled||ae.intersectsObject(_e))){const Qt=je.update(_e),gn=_e.material;if(_t&&(_e.boundingSphere!==void 0?(_e.boundingSphere===null&&_e.computeBoundingSphere(),ze.copy(_e.boundingSphere.center)):(Qt.boundingSphere===null&&Qt.computeBoundingSphere(),ze.copy(Qt.boundingSphere.center)),ze.applyMatrix4(_e.matrixWorld).applyMatrix4(me)),Array.isArray(gn)){const nn=Qt.groups;for(let Dn=0,$n=nn.length;Dn<$n;Dn++){const Vn=nn[Dn],li=gn[Vn.materialIndex];li&&li.visible&&w.push(_e,Qt,li,At,ze.z,Vn)}}else gn.visible&&w.push(_e,Qt,gn,At,ze.z,null)}}const Nt=_e.children;for(let Qt=0,gn=Nt.length;Qt<gn;Qt++)Xe(Nt[Qt],Qe,At,_t)}function wt(_e,Qe,At,_t){const Ye=_e.opaque,Nt=_e.transmissive,Qt=_e.transparent;x.setupLightsView(At),ye===!0&&st.setGlobalState(R.clippingPlanes,At),_t&&Ae.viewport(D.copy(_t)),Ye.length>0&&Rt(Ye,Qe,At),Nt.length>0&&Rt(Nt,Qe,At),Qt.length>0&&Rt(Qt,Qe,At),Ae.buffers.depth.setTest(!0),Ae.buffers.depth.setMask(!0),Ae.buffers.color.setMask(!0),Ae.setPolygonOffset(!1)}function lt(_e,Qe,At,_t){if((At.isScene===!0?At.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[_t.id]===void 0&&(x.state.transmissionRenderTarget[_t.id]=new Ph(1,1,{generateMipmaps:!0,type:yt.has("EXT_color_buffer_half_float")||yt.has("EXT_color_buffer_float")?Lb:ba,minFilter:Mu,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:$i.workingColorSpace}));const Nt=x.state.transmissionRenderTarget[_t.id],Qt=_t.viewport||D;Nt.setSize(Qt.z*R.transmissionResolutionScale,Qt.w*R.transmissionResolutionScale);const gn=R.getRenderTarget(),nn=R.getActiveCubeFace(),Dn=R.getActiveMipmapLevel();R.setRenderTarget(Nt),R.getClearColor(j),Q=R.getClearAlpha(),Q<1&&R.setClearColor(16777215,.5),R.clear(),le&&Et.render(At);const $n=R.toneMapping;R.toneMapping=tf;const Vn=_t.viewport;if(_t.viewport!==void 0&&(_t.viewport=void 0),x.setupLightsView(_t),ye===!0&&st.setGlobalState(R.clippingPlanes,_t),Rt(_e,At,_t),vt.updateMultisampleRenderTarget(Nt),vt.updateRenderTargetMipmap(Nt),yt.has("WEBGL_multisampled_render_to_texture")===!1){let li=!1;for(let vi=0,ls=Qe.length;vi<ls;vi++){const Fi=Qe[vi],Hi=Fi.object,Gn=Fi.geometry,ns=Fi.material,bi=Fi.group;if(ns.side===Mc&&Hi.layers.test(_t.layers)){const bs=ns.side;ns.side=Ua,ns.needsUpdate=!0,Bn(Hi,At,_t,Gn,ns,bi),ns.side=bs,ns.needsUpdate=!0,li=!0}}li===!0&&(vt.updateMultisampleRenderTarget(Nt),vt.updateRenderTargetMipmap(Nt))}R.setRenderTarget(gn,nn,Dn),R.setClearColor(j,Q),Vn!==void 0&&(_t.viewport=Vn),R.toneMapping=$n}function Rt(_e,Qe,At){const _t=Qe.isScene===!0?Qe.overrideMaterial:null;for(let Ye=0,Nt=_e.length;Ye<Nt;Ye++){const Qt=_e[Ye],gn=Qt.object,nn=Qt.geometry,Dn=Qt.group;let $n=Qt.material;$n.allowOverride===!0&&_t!==null&&($n=_t),gn.layers.test(At.layers)&&Bn(gn,Qe,At,nn,$n,Dn)}}function Bn(_e,Qe,At,_t,Ye,Nt){_e.onBeforeRender(R,Qe,At,_t,Ye,Nt),_e.modelViewMatrix.multiplyMatrices(At.matrixWorldInverse,_e.matrixWorld),_e.normalMatrix.getNormalMatrix(_e.modelViewMatrix),Ye.onBeforeRender(R,Qe,At,_t,_e,Nt),Ye.transparent===!0&&Ye.side===Mc&&Ye.forceSinglePass===!1?(Ye.side=Ua,Ye.needsUpdate=!0,R.renderBufferDirect(At,Qe,_t,Ye,_e,Nt),Ye.side=ju,Ye.needsUpdate=!0,R.renderBufferDirect(At,Qe,_t,Ye,_e,Nt),Ye.side=Mc):R.renderBufferDirect(At,Qe,_t,Ye,_e,Nt),_e.onAfterRender(R,Qe,At,_t,Ye,Nt)}function Fn(_e,Qe,At){Qe.isScene!==!0&&(Qe=qe);const _t=dt.get(_e),Ye=x.state.lights,Nt=x.state.shadowsArray,Qt=Ye.state.version,gn=Ce.getParameters(_e,Ye.state,Nt,Qe,At),nn=Ce.getProgramCacheKey(gn);let Dn=_t.programs;_t.environment=_e.isMeshStandardMaterial?Qe.environment:null,_t.fog=Qe.fog,_t.envMap=(_e.isMeshStandardMaterial?we:Yt).get(_e.envMap||_t.environment),_t.envMapRotation=_t.environment!==null&&_e.envMap===null?Qe.environmentRotation:_e.envMapRotation,Dn===void 0&&(_e.addEventListener("dispose",An),Dn=new Map,_t.programs=Dn);let $n=Dn.get(nn);if($n!==void 0){if(_t.currentProgram===$n&&_t.lightsStateVersion===Qt)return si(_e,gn),$n}else gn.uniforms=Ce.getUniforms(_e),_e.onBeforeCompile(gn,R),$n=Ce.acquireProgram(gn,nn),Dn.set(nn,$n),_t.uniforms=gn.uniforms;const Vn=_t.uniforms;return(!_e.isShaderMaterial&&!_e.isRawShaderMaterial||_e.clipping===!0)&&(Vn.clippingPlanes=st.uniform),si(_e,gn),_t.needsLights=ii(_e),_t.lightsStateVersion=Qt,_t.needsLights&&(Vn.ambientLightColor.value=Ye.state.ambient,Vn.lightProbe.value=Ye.state.probe,Vn.directionalLights.value=Ye.state.directional,Vn.directionalLightShadows.value=Ye.state.directionalShadow,Vn.spotLights.value=Ye.state.spot,Vn.spotLightShadows.value=Ye.state.spotShadow,Vn.rectAreaLights.value=Ye.state.rectArea,Vn.ltc_1.value=Ye.state.rectAreaLTC1,Vn.ltc_2.value=Ye.state.rectAreaLTC2,Vn.pointLights.value=Ye.state.point,Vn.pointLightShadows.value=Ye.state.pointShadow,Vn.hemisphereLights.value=Ye.state.hemi,Vn.directionalShadowMap.value=Ye.state.directionalShadowMap,Vn.directionalShadowMatrix.value=Ye.state.directionalShadowMatrix,Vn.spotShadowMap.value=Ye.state.spotShadowMap,Vn.spotLightMatrix.value=Ye.state.spotLightMatrix,Vn.spotLightMap.value=Ye.state.spotLightMap,Vn.pointShadowMap.value=Ye.state.pointShadowMap,Vn.pointShadowMatrix.value=Ye.state.pointShadowMatrix),_t.currentProgram=$n,_t.uniformsList=null,$n}function pn(_e){if(_e.uniformsList===null){const Qe=_e.currentProgram.getUniforms();_e.uniformsList=ME.seqWithValue(Qe.seq,_e.uniforms)}return _e.uniformsList}function si(_e,Qe){const At=dt.get(_e);At.outputColorSpace=Qe.outputColorSpace,At.batching=Qe.batching,At.batchingColor=Qe.batchingColor,At.instancing=Qe.instancing,At.instancingColor=Qe.instancingColor,At.instancingMorph=Qe.instancingMorph,At.skinning=Qe.skinning,At.morphTargets=Qe.morphTargets,At.morphNormals=Qe.morphNormals,At.morphColors=Qe.morphColors,At.morphTargetsCount=Qe.morphTargetsCount,At.numClippingPlanes=Qe.numClippingPlanes,At.numIntersection=Qe.numClipIntersection,At.vertexAlphas=Qe.vertexAlphas,At.vertexTangents=Qe.vertexTangents,At.toneMapping=Qe.toneMapping}function hi(_e,Qe,At,_t,Ye){Qe.isScene!==!0&&(Qe=qe),vt.resetTextureUnits();const Nt=Qe.fog,Qt=_t.isMeshStandardMaterial?Qe.environment:null,gn=N===null?R.outputColorSpace:N.isXRRenderTarget===!0?N.texture.colorSpace:xa,nn=(_t.isMeshStandardMaterial?we:Yt).get(_t.envMap||Qt),Dn=_t.vertexColors===!0&&!!At.attributes.color&&At.attributes.color.itemSize===4,$n=!!At.attributes.tangent&&(!!_t.normalMap||_t.anisotropy>0),Vn=!!At.morphAttributes.position,li=!!At.morphAttributes.normal,vi=!!At.morphAttributes.color;let ls=tf;_t.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(ls=R.toneMapping);const Fi=At.morphAttributes.position||At.morphAttributes.normal||At.morphAttributes.color,Hi=Fi!==void 0?Fi.length:0,Gn=dt.get(_t),ns=x.state.lights;if(ye===!0&&(Me===!0||_e!==k)){const _r=_e===k&&_t.id===L;st.setState(_t,_e,_r)}let bi=!1;_t.version===Gn.__version?(Gn.needsLights&&Gn.lightsStateVersion!==ns.state.version||Gn.outputColorSpace!==gn||Ye.isBatchedMesh&&Gn.batching===!1||!Ye.isBatchedMesh&&Gn.batching===!0||Ye.isBatchedMesh&&Gn.batchingColor===!0&&Ye.colorTexture===null||Ye.isBatchedMesh&&Gn.batchingColor===!1&&Ye.colorTexture!==null||Ye.isInstancedMesh&&Gn.instancing===!1||!Ye.isInstancedMesh&&Gn.instancing===!0||Ye.isSkinnedMesh&&Gn.skinning===!1||!Ye.isSkinnedMesh&&Gn.skinning===!0||Ye.isInstancedMesh&&Gn.instancingColor===!0&&Ye.instanceColor===null||Ye.isInstancedMesh&&Gn.instancingColor===!1&&Ye.instanceColor!==null||Ye.isInstancedMesh&&Gn.instancingMorph===!0&&Ye.morphTexture===null||Ye.isInstancedMesh&&Gn.instancingMorph===!1&&Ye.morphTexture!==null||Gn.envMap!==nn||_t.fog===!0&&Gn.fog!==Nt||Gn.numClippingPlanes!==void 0&&(Gn.numClippingPlanes!==st.numPlanes||Gn.numIntersection!==st.numIntersection)||Gn.vertexAlphas!==Dn||Gn.vertexTangents!==$n||Gn.morphTargets!==Vn||Gn.morphNormals!==li||Gn.morphColors!==vi||Gn.toneMapping!==ls||Gn.morphTargetsCount!==Hi)&&(bi=!0):(bi=!0,Gn.__version=_t.version);let bs=Gn.currentProgram;bi===!0&&(bs=Fn(_t,Qe,Ye));let xs=!1,mr=!1,Lo=!1;const is=bs.getUniforms(),Sr=Gn.uniforms;if(Ae.useProgram(bs.program)&&(xs=!0,mr=!0,Lo=!0),_t.id!==L&&(L=_t.id,mr=!0),xs||k!==_e){Ae.buffers.depth.getReversed()?(Ne.copy(_e.projectionMatrix),q4e(Ne),j4e(Ne),is.setValue(ve,"projectionMatrix",Ne)):is.setValue(ve,"projectionMatrix",_e.projectionMatrix),is.setValue(ve,"viewMatrix",_e.matrixWorldInverse);const Ar=is.map.cameraPosition;Ar!==void 0&&Ar.setValue(ve,Ke.setFromMatrixPosition(_e.matrixWorld)),Ie.logarithmicDepthBuffer&&is.setValue(ve,"logDepthBufFC",2/(Math.log(_e.far+1)/Math.LN2)),(_t.isMeshPhongMaterial||_t.isMeshToonMaterial||_t.isMeshLambertMaterial||_t.isMeshBasicMaterial||_t.isMeshStandardMaterial||_t.isShaderMaterial)&&is.setValue(ve,"isOrthographic",_e.isOrthographicCamera===!0),k!==_e&&(k=_e,mr=!0,Lo=!0)}if(Ye.isSkinnedMesh){is.setOptional(ve,Ye,"bindMatrix"),is.setOptional(ve,Ye,"bindMatrixInverse");const _r=Ye.skeleton;_r&&(_r.boneTexture===null&&_r.computeBoneTexture(),is.setValue(ve,"boneTexture",_r.boneTexture,vt))}Ye.isBatchedMesh&&(is.setOptional(ve,Ye,"batchingTexture"),is.setValue(ve,"batchingTexture",Ye._matricesTexture,vt),is.setOptional(ve,Ye,"batchingIdTexture"),is.setValue(ve,"batchingIdTexture",Ye._indirectTexture,vt),is.setOptional(ve,Ye,"batchingColorTexture"),Ye._colorsTexture!==null&&is.setValue(ve,"batchingColorTexture",Ye._colorsTexture,vt));const lr=At.morphAttributes;if((lr.position!==void 0||lr.normal!==void 0||lr.color!==void 0)&&Jt.update(Ye,At,bs),(mr||Gn.receiveShadow!==Ye.receiveShadow)&&(Gn.receiveShadow=Ye.receiveShadow,is.setValue(ve,"receiveShadow",Ye.receiveShadow)),_t.isMeshGouraudMaterial&&_t.envMap!==null&&(Sr.envMap.value=nn,Sr.flipEnvMap.value=nn.isCubeTexture&&nn.isRenderTargetTexture===!1?-1:1),_t.isMeshStandardMaterial&&_t.envMap===null&&Qe.environment!==null&&(Sr.envMapIntensity.value=Qe.environmentIntensity),mr&&(is.setValue(ve,"toneMappingExposure",R.toneMappingExposure),Gn.needsLights&&Kn(Sr,Lo),Nt&&_t.fog===!0&&Oe.refreshFogUniforms(Sr,Nt),Oe.refreshMaterialUniforms(Sr,_t,q,W,x.state.transmissionRenderTarget[_e.id]),ME.upload(ve,pn(Gn),Sr,vt)),_t.isShaderMaterial&&_t.uniformsNeedUpdate===!0&&(ME.upload(ve,pn(Gn),Sr,vt),_t.uniformsNeedUpdate=!1),_t.isSpriteMaterial&&is.setValue(ve,"center",Ye.center),is.setValue(ve,"modelViewMatrix",Ye.modelViewMatrix),is.setValue(ve,"normalMatrix",Ye.normalMatrix),is.setValue(ve,"modelMatrix",Ye.matrixWorld),_t.isShaderMaterial||_t.isRawShaderMaterial){const _r=_t.uniformsGroups;for(let Ar=0,zr=_r.length;Ar<zr;Ar++){const Ca=_r[Ar];Ge.update(Ca,bs),Ge.bind(Ca,bs)}}return bs}function Kn(_e,Qe){_e.ambientLightColor.needsUpdate=Qe,_e.lightProbe.needsUpdate=Qe,_e.directionalLights.needsUpdate=Qe,_e.directionalLightShadows.needsUpdate=Qe,_e.pointLights.needsUpdate=Qe,_e.pointLightShadows.needsUpdate=Qe,_e.spotLights.needsUpdate=Qe,_e.spotLightShadows.needsUpdate=Qe,_e.rectAreaLights.needsUpdate=Qe,_e.hemisphereLights.needsUpdate=Qe}function ii(_e){return _e.isMeshLambertMaterial||_e.isMeshToonMaterial||_e.isMeshPhongMaterial||_e.isMeshStandardMaterial||_e.isShadowMaterial||_e.isShaderMaterial&&_e.lights===!0}this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return N},this.setRenderTargetTextures=function(_e,Qe,At){const _t=dt.get(_e);_t.__autoAllocateDepthBuffer=_e.resolveDepthBuffer===!1,_t.__autoAllocateDepthBuffer===!1&&(_t.__useRenderToTexture=!1),dt.get(_e.texture).__webglTexture=Qe,dt.get(_e.depthTexture).__webglTexture=_t.__autoAllocateDepthBuffer?void 0:At,_t.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(_e,Qe){const At=dt.get(_e);At.__webglFramebuffer=Qe,At.__useDefaultFramebuffer=Qe===void 0};const zi=ve.createFramebuffer();this.setRenderTarget=function(_e,Qe=0,At=0){N=_e,z=Qe,U=At;let _t=!0,Ye=null,Nt=!1,Qt=!1;if(_e){const nn=dt.get(_e);if(nn.__useDefaultFramebuffer!==void 0)Ae.bindFramebuffer(ve.FRAMEBUFFER,null),_t=!1;else if(nn.__webglFramebuffer===void 0)vt.setupRenderTarget(_e);else if(nn.__hasExternalTextures)vt.rebindTextures(_e,dt.get(_e.texture).__webglTexture,dt.get(_e.depthTexture).__webglTexture);else if(_e.depthBuffer){const Vn=_e.depthTexture;if(nn.__boundDepthTexture!==Vn){if(Vn!==null&&dt.has(Vn)&&(_e.width!==Vn.image.width||_e.height!==Vn.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");vt.setupDepthRenderbuffer(_e)}}const Dn=_e.texture;(Dn.isData3DTexture||Dn.isDataArrayTexture||Dn.isCompressedArrayTexture)&&(Qt=!0);const $n=dt.get(_e).__webglFramebuffer;_e.isWebGLCubeRenderTarget?(Array.isArray($n[Qe])?Ye=$n[Qe][At]:Ye=$n[Qe],Nt=!0):_e.samples>0&&vt.useMultisampledRTT(_e)===!1?Ye=dt.get(_e).__webglMultisampledFramebuffer:Array.isArray($n)?Ye=$n[At]:Ye=$n,D.copy(_e.viewport),Y.copy(_e.scissor),Z=_e.scissorTest}else D.copy(oe).multiplyScalar(q).floor(),Y.copy(ue).multiplyScalar(q).floor(),Z=pe;if(At!==0&&(Ye=zi),Ae.bindFramebuffer(ve.FRAMEBUFFER,Ye)&&_t&&Ae.drawBuffers(_e,Ye),Ae.viewport(D),Ae.scissor(Y),Ae.setScissorTest(Z),Nt){const nn=dt.get(_e.texture);ve.framebufferTexture2D(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_CUBE_MAP_POSITIVE_X+Qe,nn.__webglTexture,At)}else if(Qt){const nn=dt.get(_e.texture),Dn=Qe;ve.framebufferTextureLayer(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,nn.__webglTexture,At,Dn)}else if(_e!==null&&At!==0){const nn=dt.get(_e.texture);ve.framebufferTexture2D(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_2D,nn.__webglTexture,At)}L=-1},this.readRenderTargetPixels=function(_e,Qe,At,_t,Ye,Nt,Qt,gn=0){if(!(_e&&_e.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nn=dt.get(_e).__webglFramebuffer;if(_e.isWebGLCubeRenderTarget&&Qt!==void 0&&(nn=nn[Qt]),nn){Ae.bindFramebuffer(ve.FRAMEBUFFER,nn);try{const Dn=_e.textures[gn],$n=Dn.format,Vn=Dn.type;if(!Ie.textureFormatReadable($n)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ie.textureTypeReadable(Vn)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Qe>=0&&Qe<=_e.width-_t&&At>=0&&At<=_e.height-Ye&&(_e.textures.length>1&&ve.readBuffer(ve.COLOR_ATTACHMENT0+gn),ve.readPixels(Qe,At,_t,Ye,Xt.convert($n),Xt.convert(Vn),Nt))}finally{const Dn=N!==null?dt.get(N).__webglFramebuffer:null;Ae.bindFramebuffer(ve.FRAMEBUFFER,Dn)}}},this.readRenderTargetPixelsAsync=async function(_e,Qe,At,_t,Ye,Nt,Qt,gn=0){if(!(_e&&_e.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let nn=dt.get(_e).__webglFramebuffer;if(_e.isWebGLCubeRenderTarget&&Qt!==void 0&&(nn=nn[Qt]),nn)if(Qe>=0&&Qe<=_e.width-_t&&At>=0&&At<=_e.height-Ye){Ae.bindFramebuffer(ve.FRAMEBUFFER,nn);const Dn=_e.textures[gn],$n=Dn.format,Vn=Dn.type;if(!Ie.textureFormatReadable($n))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ie.textureTypeReadable(Vn))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const li=ve.createBuffer();ve.bindBuffer(ve.PIXEL_PACK_BUFFER,li),ve.bufferData(ve.PIXEL_PACK_BUFFER,Nt.byteLength,ve.STREAM_READ),_e.textures.length>1&&ve.readBuffer(ve.COLOR_ATTACHMENT0+gn),ve.readPixels(Qe,At,_t,Ye,Xt.convert($n),Xt.convert(Vn),0);const vi=N!==null?dt.get(N).__webglFramebuffer:null;Ae.bindFramebuffer(ve.FRAMEBUFFER,vi);const ls=ve.fenceSync(ve.SYNC_GPU_COMMANDS_COMPLETE,0);return ve.flush(),await W4e(ve,ls,4),ve.bindBuffer(ve.PIXEL_PACK_BUFFER,li),ve.getBufferSubData(ve.PIXEL_PACK_BUFFER,0,Nt),ve.deleteBuffer(li),ve.deleteSync(ls),Nt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(_e,Qe=null,At=0){const _t=Math.pow(2,-At),Ye=Math.floor(_e.image.width*_t),Nt=Math.floor(_e.image.height*_t),Qt=Qe!==null?Qe.x:0,gn=Qe!==null?Qe.y:0;vt.setTexture2D(_e,0),ve.copyTexSubImage2D(ve.TEXTURE_2D,At,0,0,Qt,gn,Ye,Nt),Ae.unbindTexture()};const Cr=ve.createFramebuffer(),ai=ve.createFramebuffer();this.copyTextureToTexture=function(_e,Qe,At=null,_t=null,Ye=0,Nt=null){Nt===null&&(Ye!==0?(L_("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Nt=Ye,Ye=0):Nt=0);let Qt,gn,nn,Dn,$n,Vn,li,vi,ls;const Fi=_e.isCompressedTexture?_e.mipmaps[Nt]:_e.image;if(At!==null)Qt=At.max.x-At.min.x,gn=At.max.y-At.min.y,nn=At.isBox3?At.max.z-At.min.z:1,Dn=At.min.x,$n=At.min.y,Vn=At.isBox3?At.min.z:0;else{const lr=Math.pow(2,-Ye);Qt=Math.floor(Fi.width*lr),gn=Math.floor(Fi.height*lr),_e.isDataArrayTexture?nn=Fi.depth:_e.isData3DTexture?nn=Math.floor(Fi.depth*lr):nn=1,Dn=0,$n=0,Vn=0}_t!==null?(li=_t.x,vi=_t.y,ls=_t.z):(li=0,vi=0,ls=0);const Hi=Xt.convert(Qe.format),Gn=Xt.convert(Qe.type);let ns;Qe.isData3DTexture?(vt.setTexture3D(Qe,0),ns=ve.TEXTURE_3D):Qe.isDataArrayTexture||Qe.isCompressedArrayTexture?(vt.setTexture2DArray(Qe,0),ns=ve.TEXTURE_2D_ARRAY):(vt.setTexture2D(Qe,0),ns=ve.TEXTURE_2D),ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,Qe.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Qe.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,Qe.unpackAlignment);const bi=ve.getParameter(ve.UNPACK_ROW_LENGTH),bs=ve.getParameter(ve.UNPACK_IMAGE_HEIGHT),xs=ve.getParameter(ve.UNPACK_SKIP_PIXELS),mr=ve.getParameter(ve.UNPACK_SKIP_ROWS),Lo=ve.getParameter(ve.UNPACK_SKIP_IMAGES);ve.pixelStorei(ve.UNPACK_ROW_LENGTH,Fi.width),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,Fi.height),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,Dn),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,$n),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,Vn);const is=_e.isDataArrayTexture||_e.isData3DTexture,Sr=Qe.isDataArrayTexture||Qe.isData3DTexture;if(_e.isDepthTexture){const lr=dt.get(_e),_r=dt.get(Qe),Ar=dt.get(lr.__renderTarget),zr=dt.get(_r.__renderTarget);Ae.bindFramebuffer(ve.READ_FRAMEBUFFER,Ar.__webglFramebuffer),Ae.bindFramebuffer(ve.DRAW_FRAMEBUFFER,zr.__webglFramebuffer);for(let Ca=0;Ca<nn;Ca++)is&&(ve.framebufferTextureLayer(ve.READ_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,dt.get(_e).__webglTexture,Ye,Vn+Ca),ve.framebufferTextureLayer(ve.DRAW_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,dt.get(Qe).__webglTexture,Nt,ls+Ca)),ve.blitFramebuffer(Dn,$n,Qt,gn,li,vi,Qt,gn,ve.DEPTH_BUFFER_BIT,ve.NEAREST);Ae.bindFramebuffer(ve.READ_FRAMEBUFFER,null),Ae.bindFramebuffer(ve.DRAW_FRAMEBUFFER,null)}else if(Ye!==0||_e.isRenderTargetTexture||dt.has(_e)){const lr=dt.get(_e),_r=dt.get(Qe);Ae.bindFramebuffer(ve.READ_FRAMEBUFFER,Cr),Ae.bindFramebuffer(ve.DRAW_FRAMEBUFFER,ai);for(let Ar=0;Ar<nn;Ar++)is?ve.framebufferTextureLayer(ve.READ_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,lr.__webglTexture,Ye,Vn+Ar):ve.framebufferTexture2D(ve.READ_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_2D,lr.__webglTexture,Ye),Sr?ve.framebufferTextureLayer(ve.DRAW_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,_r.__webglTexture,Nt,ls+Ar):ve.framebufferTexture2D(ve.DRAW_FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_2D,_r.__webglTexture,Nt),Ye!==0?ve.blitFramebuffer(Dn,$n,Qt,gn,li,vi,Qt,gn,ve.COLOR_BUFFER_BIT,ve.NEAREST):Sr?ve.copyTexSubImage3D(ns,Nt,li,vi,ls+Ar,Dn,$n,Qt,gn):ve.copyTexSubImage2D(ns,Nt,li,vi,Dn,$n,Qt,gn);Ae.bindFramebuffer(ve.READ_FRAMEBUFFER,null),Ae.bindFramebuffer(ve.DRAW_FRAMEBUFFER,null)}else Sr?_e.isDataTexture||_e.isData3DTexture?ve.texSubImage3D(ns,Nt,li,vi,ls,Qt,gn,nn,Hi,Gn,Fi.data):Qe.isCompressedArrayTexture?ve.compressedTexSubImage3D(ns,Nt,li,vi,ls,Qt,gn,nn,Hi,Fi.data):ve.texSubImage3D(ns,Nt,li,vi,ls,Qt,gn,nn,Hi,Gn,Fi):_e.isDataTexture?ve.texSubImage2D(ve.TEXTURE_2D,Nt,li,vi,Qt,gn,Hi,Gn,Fi.data):_e.isCompressedTexture?ve.compressedTexSubImage2D(ve.TEXTURE_2D,Nt,li,vi,Fi.width,Fi.height,Hi,Fi.data):ve.texSubImage2D(ve.TEXTURE_2D,Nt,li,vi,Qt,gn,Hi,Gn,Fi);ve.pixelStorei(ve.UNPACK_ROW_LENGTH,bi),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,bs),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,xs),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,mr),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,Lo),Nt===0&&Qe.generateMipmaps&&ve.generateMipmap(ns),Ae.unbindTexture()},this.copyTextureToTexture3D=function(_e,Qe,At=null,_t=null,Ye=0){return L_('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(_e,Qe,At,_t,Ye)},this.initRenderTarget=function(_e){dt.get(_e).__webglFramebuffer===void 0&&vt.setupRenderTarget(_e)},this.initTexture=function(_e){_e.isCubeTexture?vt.setTextureCube(_e,0):_e.isData3DTexture?vt.setTexture3D(_e,0):_e.isDataArrayTexture||_e.isCompressedArrayTexture?vt.setTexture2DArray(_e,0):vt.setTexture2D(_e,0),Ae.unbindTexture()},this.resetState=function(){z=0,U=0,N=null,Ae.reset(),Pn.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Tu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=$i._getDrawingBufferColorSpace(e),t.unpackColorSpace=$i._getUnpackColorSpace()}};function Hz(i,e){if(e===_4e)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===BB||e===Nj){let t=i.getIndex();if(t===null){const o=[],a=i.getAttribute("position");if(a!==void 0){for(let l=0;l<a.count;l++)o.push(l);i.setIndex(o),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,s=[];if(e===BB)for(let o=1;o<=n;o++)s.push(t.getX(0)),s.push(t.getX(o)),s.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(s.push(t.getX(o)),s.push(t.getX(o+1)),s.push(t.getX(o+2))):(s.push(t.getX(o+2)),s.push(t.getX(o+1)),s.push(t.getX(o)));s.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=i.clone();return r.setIndex(s),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class j8e extends gg{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new K8e(t)}),this.register(function(t){return new e6e(t)}),this.register(function(t){return new c6e(t)}),this.register(function(t){return new h6e(t)}),this.register(function(t){return new u6e(t)}),this.register(function(t){return new n6e(t)}),this.register(function(t){return new i6e(t)}),this.register(function(t){return new s6e(t)}),this.register(function(t){return new r6e(t)}),this.register(function(t){return new J8e(t)}),this.register(function(t){return new o6e(t)}),this.register(function(t){return new t6e(t)}),this.register(function(t){return new l6e(t)}),this.register(function(t){return new a6e(t)}),this.register(function(t){return new X8e(t)}),this.register(function(t){return new d6e(t)}),this.register(function(t){return new f6e(t)})}load(e,t,n,s){const r=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const h=cv.extractUrlBase(e);o=cv.resolveURL(h,this.path)}else o=cv.extractUrlBase(e);this.manager.itemStart(e);const a=function(h){s?s(h):console.error(h),r.manager.itemError(e),r.manager.itemEnd(e)},l=new Gk(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(h){try{r.parse(h,o,function(u){t(u),r.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,s){let r;const o={},a={},l=new TextDecoder;if(typeof e=="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===AY){try{o[Pi.KHR_BINARY_GLTF]=new p6e(e)}catch(d){s&&s(d);return}r=JSON.parse(o[Pi.KHR_BINARY_GLTF].content)}else r=JSON.parse(l.decode(e));else r=e;if(r.asset===void 0||r.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const h=new I6e(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const d=this.pluginCallbacks[u](h);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[d.name]=d,o[d.name]=!0}if(r.extensionsUsed)for(let u=0;u<r.extensionsUsed.length;++u){const d=r.extensionsUsed[u],g=r.extensionsRequired||[];switch(d){case Pi.KHR_MATERIALS_UNLIT:o[d]=new Z8e;break;case Pi.KHR_DRACO_MESH_COMPRESSION:o[d]=new g6e(r,this.dracoLoader);break;case Pi.KHR_TEXTURE_TRANSFORM:o[d]=new m6e;break;case Pi.KHR_MESH_QUANTIZATION:o[d]=new _6e;break;default:g.indexOf(d)>=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}h.setExtensions(o),h.setPlugins(a),h.parse(n,s)}parseAsync(e,t){const n=this;return new Promise(function(s,r){n.parse(e,t,s,r)})}}function Y8e(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Pi={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class X8e{constructor(e){this.parser=e,this.name=Pi.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,s=t.length;n<s;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let s=t.cache.get(n);if(s)return s;const r=t.json,l=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let h;const u=new ei(16777215);l.color!==void 0&&u.setRGB(l.color[0],l.color[1],l.color[2],xa);const d=l.range!==void 0?l.range:0;switch(l.type){case"directional":h=new uY(u),h.target.position.set(0,0,-1),h.add(h.target);break;case"point":h=new XDe(u),h.distance=d;break;case"spot":h=new jDe(u),h.distance=d,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,h.angle=l.spot.outerConeAngle,h.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,h.target.position.set(0,0,-1),h.add(h.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return h.position.set(0,0,0),xu(h,l),l.intensity!==void 0&&(h.intensity=l.intensity),h.name=t.createUniqueName(l.name||"light_"+e),s=Promise.resolve(h),t.cache.add(n,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],a=(r.extensions&&r.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(l){return n._getNodeRef(t.cache,a,l)})}}class Z8e{constructor(){this.name=Pi.KHR_MATERIALS_UNLIT}getMaterialType(){return Bp}extendParams(e,t,n){const s=[];e.color=new ei(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const o=r.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],xa),e.opacity=o[3]}r.baseColorTexture!==void 0&&s.push(n.assignTexture(e,"map",r.baseColorTexture,jr))}return Promise.all(s)}}class J8e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name].emissiveStrength;return r!==void 0&&(t.emissiveIntensity=r),Promise.resolve()}}class K8e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(r.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ci(a,a)}return Promise.all(r)}}class e6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return t.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}}class t6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(r)}}class n6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new ei(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=s.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],xa)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&r.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,jr)),o.sheenRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(r)}}class i6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&r.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(r)}}class s6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&r.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new ei().setRGB(a[0],a[1],a[2],xa),Promise.all(r)}}class r6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class o6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&r.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new ei().setRGB(a[0],a[1],a[2],xa),o.specularColorTexture!==void 0&&r.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,jr)),Promise.all(r)}}class a6e{constructor(e){this.parser=e,this.name=Pi.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&r.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(r)}}class l6e{constructor(e){this.parser=e,this.name=Pi.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Uh}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&r.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(r)}}class c6e{constructor(e){this.parser=e,this.name=Pi.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,s=n.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const r=s.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class h6e{constructor(e){this.parser=e,this.name=Pi.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=n.textureLoader;if(a.uri){const h=n.options.manager.getHandler(a.uri);h!==null&&(l=h)}return n.loadTextureImage(e,o.source,l)}}class u6e{constructor(e){this.parser=e,this.name=Pi.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=n.textureLoader;if(a.uri){const h=n.options.manager.getHandler(a.uri);h!==null&&(l=h)}return n.loadTextureImage(e,o.source,l)}}class d6e{constructor(e){this.name=Pi.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const s=n.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const l=s.byteOffset||0,h=s.byteLength||0,u=s.count,d=s.byteStride,g=new Uint8Array(a,l,h);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,d,g,s.mode,s.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(u*d);return o.decodeGltfBuffer(new Uint8Array(m),u,d,g,s.mode,s.filter),m})})}else return null}}class f6e{constructor(e){this.name=Pi.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const s=t.meshes[n.mesh];for(const h of s.primitives)if(h.mode!==Ol.TRIANGLES&&h.mode!==Ol.TRIANGLE_STRIP&&h.mode!==Ol.TRIANGLE_FAN&&h.mode!==void 0)return null;const o=n.extensions[this.name].attributes,a=[],l={};for(const h in o)a.push(this.parser.getDependency("accessor",o[h]).then(u=>(l[h]=u,l[h])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(h=>{const u=h.pop(),d=u.isGroup?u.children:[u],g=h[0].count,m=[];for(const v of d){const b=new Qn,w=new $e,x=new pr,I=new $e(1,1,1),T=new wDe(v.geometry,v.material,g);for(let R=0;R<g;R++)l.TRANSLATION&&w.fromBufferAttribute(l.TRANSLATION,R),l.ROTATION&&x.fromBufferAttribute(l.ROTATION,R),l.SCALE&&I.fromBufferAttribute(l.SCALE,R),T.setMatrixAt(R,b.compose(w,x,I));for(const R in l)if(R==="_COLOR_0"){const F=l[R];T.instanceColor=new UC(F.array,F.itemSize,F.normalized)}else R!=="TRANSLATION"&&R!=="ROTATION"&&R!=="SCALE"&&v.geometry.setAttribute(R,l[R]);gr.prototype.copy.call(T,v),this.parser.assignFinalMaterial(T),m.push(T)}return u.isGroup?(u.clear(),u.add(...m),u):m[0]}))}}const AY="glTF",XA=12,Qz={JSON:1313821514,BIN:5130562};class p6e{constructor(e){this.name=Pi.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,XA),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==AY)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-XA,r=new DataView(e,XA);let o=0;for(;o<s;){const a=r.getUint32(o,!0);o+=4;const l=r.getUint32(o,!0);if(o+=4,l===Qz.JSON){const h=new Uint8Array(e,XA+o,a);this.content=n.decode(h)}else if(l===Qz.BIN){const h=XA+o;this.body=e.slice(h,h+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class g6e{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Pi.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,s=this.dracoLoader,r=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},l={},h={};for(const u in o){const d=FB[u]||u.toLowerCase();a[d]=o[u]}for(const u in e.attributes){const d=FB[u]||u.toLowerCase();if(o[u]!==void 0){const g=n.accessors[e.attributes[u]],m=N_[g.componentType];h[d]=m.name,l[d]=g.normalized===!0}}return t.getDependency("bufferView",r).then(function(u){return new Promise(function(d,g){s.decodeDracoFile(u,function(m){for(const v in m.attributes){const b=m.attributes[v],w=l[v];w!==void 0&&(b.normalized=w)}d(m)},a,h,xa,g)})})}}class m6e{constructor(){this.name=Pi.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class _6e{constructor(){this.name=Pi.KHR_MESH_QUANTIZATION}}class yY extends kb{constructor(e,t,n,s){super(e,t,n,s)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s*3+s;for(let o=0;o!==s;o++)t[o]=n[r+o];return t}interpolate_(e,t,n,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=a*2,h=a*3,u=s-t,d=(n-t)/u,g=d*d,m=g*d,v=e*h,b=v-h,w=-2*m+3*g,x=m-g,I=1-w,T=x-g+d;for(let R=0;R!==a;R++){const F=o[b+R+a],z=o[b+R+l]*u,U=o[v+R+a],N=o[v+R]*u;r[R]=I*F+T*z+w*U+x*N}return r}}const A6e=new pr;class y6e extends yY{interpolate_(e,t,n,s){const r=super.interpolate_(e,t,n,s);return A6e.fromArray(r).normalize().toArray(r),r}}const Ol={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},N_={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Wz={9728:Zr,9729:pl,9984:Ij,9985:vE,9986:Ry,9987:Mu},qz={33071:qd,33648:NC,10497:n0},d2={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},FB={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},wd={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},v6e={CUBICSPLINE:void 0,LINEAR:Qv,STEP:Hv},f2={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function b6e(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new qv({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ju})),i.DefaultMaterial}function dp(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function xu(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function x6e(i,e,t){let n=!1,s=!1,r=!1;for(let h=0,u=e.length;h<u;h++){const d=e[h];if(d.POSITION!==void 0&&(n=!0),d.NORMAL!==void 0&&(s=!0),d.COLOR_0!==void 0&&(r=!0),n&&s&&r)break}if(!n&&!s&&!r)return Promise.resolve(i);const o=[],a=[],l=[];for(let h=0,u=e.length;h<u;h++){const d=e[h];if(n){const g=d.POSITION!==void 0?t.getDependency("accessor",d.POSITION):i.attributes.position;o.push(g)}if(s){const g=d.NORMAL!==void 0?t.getDependency("accessor",d.NORMAL):i.attributes.normal;a.push(g)}if(r){const g=d.COLOR_0!==void 0?t.getDependency("accessor",d.COLOR_0):i.attributes.color;l.push(g)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(h){const u=h[0],d=h[1],g=h[2];return n&&(i.morphAttributes.position=u),s&&(i.morphAttributes.normal=d),r&&(i.morphAttributes.color=g),i.morphTargetsRelative=!0,i})}function w6e(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,s=t.length;n<s;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function E6e(i){let e;const t=i.extensions&&i.extensions[Pi.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+p2(t.attributes):e=i.indices+":"+p2(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,s=i.targets.length;n<s;n++)e+=":"+p2(i.targets[n]);return e}function p2(i){let e="";const t=Object.keys(i).sort();for(let n=0,s=t.length;n<s;n++)e+=t[n]+":"+i[t[n]]+";";return e}function OB(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function C6e(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const S6e=new Qn;class I6e{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Y8e,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,s=-1,r=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);s=n&&l?parseInt(l[1],10):-1,r=a.indexOf("Firefox")>-1,o=r?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&s<17||r&&o<98?this.textureLoader=new WDe(this.options.manager):this.textureLoader=new eFe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Gk(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:n,userData:{}};return dp(r,a,s),xu(a,s),Promise.all(n._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let s=0,r=t.length;s<r;s++){const o=t[s].joints;for(let a=0,l=o.length;a<l;a++)e[o[a]].isBone=!0}for(let s=0,r=e.length;s<r;s++){const o=e[s];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const s=n.clone(),r=(o,a)=>{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[h,u]of o.children.entries())r(u,a.children[h])};return r(n,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const s=e(t[n]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let s=0;s<t.length;s++){const r=e(t[s]);r&&n.push(r)}return n}getDependency(e,t){const n=e+":"+t;let s=this.cache.get(n);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":s=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(n,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(r,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Pi.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(r,o){n.load(cv.resolveURL(t.uri,s.path),r,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const s=t.byteLength||0,r=t.byteOffset||0;return n.slice(r,r+s)})}loadAccessor(e){const t=this,n=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const o=d2[s.type],a=N_[s.componentType],l=s.normalized===!0,h=new a(s.count*o);return Promise.resolve(new Io(h,o,l))}const r=[];return s.bufferView!==void 0?r.push(this.getDependency("bufferView",s.bufferView)):r.push(null),s.sparse!==void 0&&(r.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(r).then(function(o){const a=o[0],l=d2[s.type],h=N_[s.componentType],u=h.BYTES_PER_ELEMENT,d=u*l,g=s.byteOffset||0,m=s.bufferView!==void 0?n.bufferViews[s.bufferView].byteStride:void 0,v=s.normalized===!0;let b,w;if(m&&m!==d){const x=Math.floor(g/m),I="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+x+":"+s.count;let T=t.cache.get(I);T||(b=new h(a,x*m,s.count*m/u),T=new _De(b,m/u),t.cache.add(I,T)),w=new ADe(T,l,g%m/u,v)}else a===null?b=new h(s.count*l):b=new h(a,g,s.count*l),w=new Io(b,l,v);if(s.sparse!==void 0){const x=d2.SCALAR,I=N_[s.sparse.indices.componentType],T=s.sparse.indices.byteOffset||0,R=s.sparse.values.byteOffset||0,F=new I(o[1],T,s.sparse.count*x),z=new h(o[2],R,s.sparse.count*l);a!==null&&(w=new Io(w.array.slice(),w.itemSize,w.normalized)),w.normalized=!1;for(let U=0,N=F.length;U<N;U++){const L=F[U];if(w.setX(L,z[U*l]),l>=2&&w.setY(L,z[U*l+1]),l>=3&&w.setZ(L,z[U*l+2]),l>=4&&w.setW(L,z[U*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}w.normalized=v}return w})}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const l=n.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){const s=this,r=this.json,o=r.textures[e],a=r.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const h=this.loadImageSource(t,n).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const g=(r.samplers||{})[o.sampler]||{};return u.magFilter=Wz[g.magFilter]||pl,u.minFilter=Wz[g.minFilter]||Mu,u.wrapS=qz[g.wrapS]||n0,u.wrapT=qz[g.wrapT]||n0,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Zr&&u.minFilter!==pl,s.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=h,h}loadImageSource(e,t){const n=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=s.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",h=!1;if(o.bufferView!==void 0)l=n.getDependency("bufferView",o.bufferView).then(function(d){h=!0;const g=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(g),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(g,m){let v=g;t.isImageBitmapLoader===!0&&(v=function(b){const w=new wa(b);w.needsUpdate=!0,g(w)}),t.load(cv.resolveURL(d,r.path),v,void 0,m)})}).then(function(d){return h===!0&&a.revokeObjectURL(l),xu(d,o),d.userData.mimeType=o.mimeType||C6e(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,t,n,s){const r=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),r.extensions[Pi.KHR_TEXTURE_TRANSFORM]){const a=n.extensions!==void 0?n.extensions[Pi.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[Pi.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return s!==void 0&&(o.colorSpace=s),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+n.uuid;let l=this.cache.get(a);l||(l=new oY,Dc.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){const a="LineBasicMaterial:"+n.uuid;let l=this.cache.get(a);l||(l=new rY,Dc.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,this.cache.add(a,l)),n=l}if(s||r||o){let a="ClonedMaterial:"+n.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),s&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}e.material=n}getMaterialType(){return qv}loadMaterial(e){const t=this,n=this.json,s=this.extensions,r=n.materials[e];let o;const a={},l=r.extensions||{},h=[];if(l[Pi.KHR_MATERIALS_UNLIT]){const d=s[Pi.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),h.push(d.extendParams(a,r,t))}else{const d=r.pbrMetallicRoughness||{};if(a.color=new ei(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const g=d.baseColorFactor;a.color.setRGB(g[0],g[1],g[2],xa),a.opacity=g[3]}d.baseColorTexture!==void 0&&h.push(t.assignTexture(a,"map",d.baseColorTexture,jr)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(h.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),h.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(g){return g.getMaterialType&&g.getMaterialType(e)}),h.push(Promise.all(this._invokeAll(function(g){return g.extendMaterialParams&&g.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Mc);const u=r.alphaMode||f2.OPAQUE;if(u===f2.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===f2.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==Bp&&(h.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Ci(1,1),r.normalTexture.scale!==void 0)){const d=r.normalTexture.scale;a.normalScale.set(d,d)}if(r.occlusionTexture!==void 0&&o!==Bp&&(h.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==Bp){const d=r.emissiveFactor;a.emissive=new ei().setRGB(d[0],d[1],d[2],xa)}return r.emissiveTexture!==void 0&&o!==Bp&&h.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,jr)),Promise.all(h).then(function(){const d=new o(a);return r.name&&(d.name=r.name),xu(d,r),t.associations.set(d,{materials:e}),r.extensions&&dp(s,d,r),d})}createUniqueName(e){const t=tr.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,s=this.primitiveCache;function r(a){return n[Pi.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return jz(l,a,t)})}const o=[];for(let a=0,l=e.length;a<l;a++){const h=e[a],u=E6e(h),d=s[u];if(d)o.push(d.promise);else{let g;h.extensions&&h.extensions[Pi.KHR_DRACO_MESH_COMPRESSION]?g=r(h):g=jz(new Qc,h,t),s[u]={primitive:h,promise:g},o.push(g)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,s=this.extensions,r=n.meshes[e],o=r.primitives,a=[];for(let l=0,h=o.length;l<h;l++){const u=o[l].material===void 0?b6e(this.cache):this.getDependency("material",o[l].material);a.push(u)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(l){const h=l.slice(0,l.length-1),u=l[l.length-1],d=[];for(let m=0,v=u.length;m<v;m++){const b=u[m],w=o[m];let x;const I=h[m];if(w.mode===Ol.TRIANGLES||w.mode===Ol.TRIANGLE_STRIP||w.mode===Ol.TRIANGLE_FAN||w.mode===void 0)x=r.isSkinnedMesh===!0?new vDe(b,I):new mo(b,I),x.isSkinnedMesh===!0&&x.normalizeSkinWeights(),w.mode===Ol.TRIANGLE_STRIP?x.geometry=Hz(x.geometry,Nj):w.mode===Ol.TRIANGLE_FAN&&(x.geometry=Hz(x.geometry,BB));else if(w.mode===Ol.LINES)x=new IDe(b,I);else if(w.mode===Ol.LINE_STRIP)x=new zk(b,I);else if(w.mode===Ol.LINE_LOOP)x=new MDe(b,I);else if(w.mode===Ol.POINTS)x=new TDe(b,I);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+w.mode);Object.keys(x.geometry.morphAttributes).length>0&&w6e(x,r),x.name=t.createUniqueName(r.name||"mesh_"+e),xu(x,r),w.extensions&&dp(s,x,w),t.assignFinalMaterial(x),d.push(x)}for(let m=0,v=d.length;m<v;m++)t.associations.set(d[m],{meshes:e,primitives:m});if(d.length===1)return r.extensions&&dp(s,d[0],r),d[0];const g=new Ch;r.extensions&&dp(s,g,r),t.associations.set(g,{meshes:e});for(let m=0,v=d.length;m<v;m++)g.add(d[m]);return g})}loadCamera(e){let t;const n=this.json.cameras[e],s=n[n.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Eo(Ap.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):n.type==="orthographic"&&(t=new kS(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),xu(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let s=0,r=t.joints.length;s<r;s++)n.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(s){const r=s.pop(),o=s,a=[],l=[];for(let h=0,u=o.length;h<u;h++){const d=o[h];if(d){a.push(d);const g=new Qn;r!==null&&g.fromArray(r.array,h*16),l.push(g)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[h])}return new Ok(a,l)})}loadAnimation(e){const t=this.json,n=this,s=t.animations[e],r=s.name?s.name:"animation_"+e,o=[],a=[],l=[],h=[],u=[];for(let d=0,g=s.channels.length;d<g;d++){const m=s.channels[d],v=s.samplers[m.sampler],b=m.target,w=b.node,x=s.parameters!==void 0?s.parameters[v.input]:v.input,I=s.parameters!==void 0?s.parameters[v.output]:v.output;b.node!==void 0&&(o.push(this.getDependency("node",w)),a.push(this.getDependency("accessor",x)),l.push(this.getDependency("accessor",I)),h.push(v),u.push(b))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l),Promise.all(h),Promise.all(u)]).then(function(d){const g=d[0],m=d[1],v=d[2],b=d[3],w=d[4],x=[];for(let I=0,T=g.length;I<T;I++){const R=g[I],F=m[I],z=v[I],U=b[I],N=w[I];if(R===void 0)continue;R.updateMatrix&&R.updateMatrix();const L=n._createAnimationTracks(R,F,z,U,N);if(L)for(let k=0;k<L.length;k++)x.push(L[k])}return new UDe(r,void 0,x)})}createNodeMesh(e){const t=this.json,n=this,s=t.nodes[e];return s.mesh===void 0?null:n.getDependency("mesh",s.mesh).then(function(r){const o=n._getNodeRef(n.meshCache,s.mesh,r);return s.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let l=0,h=s.weights.length;l<h;l++)a.morphTargetInfluences[l]=s.weights[l]}),o})}loadNode(e){const t=this.json,n=this,s=t.nodes[e],r=n._loadNodeShallow(e),o=[],a=s.children||[];for(let h=0,u=a.length;h<u;h++)o.push(n.getDependency("node",a[h]));const l=s.skin===void 0?Promise.resolve(null):n.getDependency("skin",s.skin);return Promise.all([r,Promise.all(o),l]).then(function(h){const u=h[0],d=h[1],g=h[2];g!==null&&u.traverse(function(m){m.isSkinnedMesh&&m.bind(g,S6e)});for(let m=0,v=d.length;m<v;m++)u.add(d[m]);return u})}_loadNodeShallow(e){const t=this.json,n=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const r=t.nodes[e],o=r.name?s.createUniqueName(r.name):"",a=[],l=s._invokeOne(function(h){return h.createNodeMesh&&h.createNodeMesh(e)});return l&&a.push(l),r.camera!==void 0&&a.push(s.getDependency("camera",r.camera).then(function(h){return s._getNodeRef(s.cameraCache,r.camera,h)})),s._invokeAll(function(h){return h.createNodeAttachment&&h.createNodeAttachment(e)}).forEach(function(h){a.push(h)}),this.nodeCache[e]=Promise.all(a).then(function(h){let u;if(r.isBone===!0?u=new sY:h.length>1?u=new Ch:h.length===1?u=h[0]:u=new gr,u!==h[0])for(let d=0,g=h.length;d<g;d++)u.add(h[d]);if(r.name&&(u.userData.name=r.name,u.name=o),xu(u,r),r.extensions&&dp(n,u,r),r.matrix!==void 0){const d=new Qn;d.fromArray(r.matrix),u.applyMatrix4(d)}else r.translation!==void 0&&u.position.fromArray(r.translation),r.rotation!==void 0&&u.quaternion.fromArray(r.rotation),r.scale!==void 0&&u.scale.fromArray(r.scale);if(!s.associations.has(u))s.associations.set(u,{});else if(r.mesh!==void 0&&s.meshCache.refs[r.mesh]>1){const d=s.associations.get(u);s.associations.set(u,{...d})}return s.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],s=this,r=new Ch;n.name&&(r.name=s.createUniqueName(n.name)),xu(r,n),n.extensions&&dp(t,r,n);const o=n.nodes||[],a=[];for(let l=0,h=o.length;l<h;l++)a.push(s.getDependency("node",o[l]));return Promise.all(a).then(function(l){for(let u=0,d=l.length;u<d;u++)r.add(l[u]);const h=u=>{const d=new Map;for(const[g,m]of s.associations)(g instanceof Dc||g instanceof wa)&&d.set(g,m);return u.traverse(g=>{const m=s.associations.get(g);m!=null&&d.set(g,m)}),d};return s.associations=h(r),r})}_createAnimationTracks(e,t,n,s,r){const o=[],a=e.name?e.name:e.uuid,l=[];wd[r.path]===wd.weights?e.traverse(function(g){g.morphTargetInfluences&&l.push(g.name?g.name:g.uuid)}):l.push(a);let h;switch(wd[r.path]){case wd.weights:h=r0;break;case wd.rotation:h=o0;break;case wd.translation:case wd.scale:h=a0;break;default:n.itemSize===1?h=r0:h=a0;break}const u=s.interpolation!==void 0?v6e[s.interpolation]:Qv,d=this._getArrayFromAccessor(n);for(let g=0,m=l.length;g<m;g++){const v=new h(l[g]+"."+wd[r.path],t.array,d,u);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(v),o.push(v)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=OB(t.constructor),s=new Float32Array(t.length);for(let r=0,o=t.length;r<o;r++)s[r]=t[r]*n;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const s=this instanceof o0?y6e:yY;return new s(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function M6e(i,e,t){const n=e.attributes,s=new yl;if(n.POSITION!==void 0){const a=t.json.accessors[n.POSITION],l=a.min,h=a.max;if(l!==void 0&&h!==void 0){if(s.set(new $e(l[0],l[1],l[2]),new $e(h[0],h[1],h[2])),a.normalized){const u=OB(N_[a.componentType]);s.min.multiplyScalar(u),s.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const r=e.targets;if(r!==void 0){const a=new $e,l=new $e;for(let h=0,u=r.length;h<u;h++){const d=r[h];if(d.POSITION!==void 0){const g=t.json.accessors[d.POSITION],m=g.min,v=g.max;if(m!==void 0&&v!==void 0){if(l.setX(Math.max(Math.abs(m[0]),Math.abs(v[0]))),l.setY(Math.max(Math.abs(m[1]),Math.abs(v[1]))),l.setZ(Math.max(Math.abs(m[2]),Math.abs(v[2]))),g.normalized){const b=OB(N_[g.componentType]);l.multiplyScalar(b)}a.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(a)}i.boundingBox=s;const o=new Oh;s.getCenter(o.center),o.radius=s.min.distanceTo(s.max)/2,i.boundingSphere=o}function jz(i,e,t){const n=e.attributes,s=[];function r(o,a){return t.getDependency("accessor",o).then(function(l){i.setAttribute(a,l)})}for(const o in n){const a=FB[o]||o.toLowerCase();a in i.attributes||s.push(r(n[o],a))}if(e.indices!==void 0&&!i.index){const o=t.getDependency("accessor",e.indices).then(function(a){i.setIndex(a)});s.push(o)}return $i.workingColorSpace!==xa&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${$i.workingColorSpace}" not supported.`),xu(i,e),M6e(i,e,t),Promise.all(s).then(function(){return e.targets!==void 0?x6e(i,e.targets,t):i})}var bp=63710088e-1,hv=2*Math.PI*bp,wo=Math.PI/180,Am=1024e3/hv,T6e=512,R6e=class{static clamp(i,e,t){return Math.min(t,Math.max(e,i))}static makePerspectiveMatrix(i,e,t,n){let s=1/Math.tan(i/2),r=1/(t-n);return[s/e,0,0,0,0,s,0,0,0,0,(n+t)*r,-1,0,0,2*n*t*r,0]}static mercatorXFromLng(i){return(180+i)/360}static mercatorYFromLat(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}static getViewInfo(i,e,t){let n=i.fov*wo,s=i.pitch*wo,r=null;if(Array.isArray(e)&&(r={lng:e[0],lat:e[1],alt:e[2]||0}),typeof e=="string"){let d=e.split(",");r={lng:+d[0],lat:+d[1],alt:+d[2]||0}}let o=Math.max(t.x,t.y,t.z)/(2*Math.tan(n/2))*Math.cos(s)+r.alt,a=Math.abs(Math.cos(s)*i.cameraToCenterDistance),l=hv*Math.abs(Math.cos(r.lat*wo)),h=a/o*l,u=Math.round(Math.log2(h/i.tileSize));return{center:[r.lng,r.lat],cameraHeight:o,zoom:u}}static getHeightByZoom(i,e,t,n){let s=Math.abs(Math.cos(n*wo)*i.cameraToCenterDistance),r=hv*Math.abs(Math.cos(t*wo)),o=Math.pow(2,e)*i.tileSize;return s*r/o}static getZoomByHeight(i,e,t,n){let s=Math.abs(Math.cos(n*wo)*i.cameraToCenterDistance),r=hv*Math.abs(Math.cos(t*wo)),o=s/e*r;return Math.round(Math.log2(o/i.tileSize))}},Pp=R6e,Yz=new Qn,Xz=new Qn,Zz=85.051129,B6e=class{constructor(i,e,t){as(this,"_map"),as(this,"_world"),as(this,"_camera"),as(this,"_translateCenter"),as(this,"_worldSizeRatio"),this._map=i,this._world=e,this._camera=t,this._translateCenter=new Qn().makeTranslation(1024e3/2,-1024e3/2,0),this._worldSizeRatio=T6e/1024e3,this._map.on("move",()=>{this.syncCamera(!1)}),this._map.on("resize",()=>{this.syncCamera(!0)})}syncCamera(i){let e=this._map.transform,t=e.pitch*wo,n=e.bearing*wo;if(i){let d=e.fov*wo,g=e.centerOffset||new $e;this._camera.aspect=e.width/e.height,Yz.elements=Pp.makePerspectiveMatrix(d,this._camera.aspect,e.height/50,e.farZ),this._camera.projectionMatrix=Yz,this._camera.projectionMatrix.elements[8]=-g.x*2/e.width,this._camera.projectionMatrix.elements[9]=g.y*2/e.height}Xz.makeTranslation(0,0,e.cameraToCenterDistance);let s=new Qn().premultiply(Xz).premultiply(new Qn().makeRotationX(t)).premultiply(new Qn().makeRotationZ(-n));e.elevation&&(s.elements[14]=e.cameraToCenterDistance*Math.cos(t)),this._camera.matrixWorld.copy(s);let r=e.scale*this._worldSizeRatio,o=new Qn().makeScale(r,r,r),a=e.x,l=e.y;if(!a||!l){let d=e.center,g=Pp.clamp(d.lat,-Zz,Zz);a=Pp.mercatorXFromLng(d.lng)*e.worldSize,l=Pp.mercatorYFromLat(g)*e.worldSize}let h=new Qn().makeTranslation(-a,l,0),u=new Qn().makeRotationZ(Math.PI);this._world.matrix=new Qn().premultiply(u).premultiply(this._translateCenter).premultiply(o).premultiply(h)}},P6e=B6e,L6e=class{constructor(i,e){as(this,"_id"),as(this,"_mapScene"),as(this,"_cameraSync"),this._id=i,this._mapScene=e,this._cameraSync=new P6e(this._mapScene.map,this._mapScene.world,this._mapScene.camera)}get id(){return this._id}get type(){return"custom"}get renderingMode(){return"3d"}onAdd(){this._cameraSync.syncCamera(!0)}render(){this._mapScene.render()}onRemove(){this._cameraSync=null,this._mapScene=null}},k6e=L6e,N6e=class{static projectedMercatorUnitsPerMeter(){return this.projectedUnitsPerMeter(0)}static projectedUnitsPerMeter(i){return Math.abs(1024e3/Math.cos(wo*i)/hv)}static lngLatToVector3(i,e,t){let n=[0,0,0];return Array.isArray(i)?(n=[-bp*wo*i[0]*Am,-bp*Math.log(Math.tan(Math.PI*.25+.5*wo*i[1]))*Am],i[2]?n.push(i[2]*this.projectedUnitsPerMeter(i[1])):n.push(0)):(n=[-bp*wo*i*Am,-bp*Math.log(Math.tan(Math.PI*.25+.5*wo*(e||0)))*Am],t?n.push(t*this.projectedUnitsPerMeter(e||0)):n.push(0)),new $e(n[0],n[1],n[2])}static vector3ToLngLat(i){let e=[0,0,0];return i&&(e[0]=-i.x/(bp*wo*Am),e[1]=2*(Math.atan(Math.exp(i.y/(Am*-bp)))-Math.PI/4)/wo,e[2]=i.z/this.projectedUnitsPerMeter(e[1])),e}},t_=N6e,D6e={scene:null,camera:null,renderer:null,renderLoop:null,preserveDrawingBuffer:!1},F6e=class{constructor(i,e={}){if(as(this,"_map"),as(this,"_options"),as(this,"_canvas"),as(this,"_scene"),as(this,"_camera"),as(this,"_renderer"),as(this,"_lights"),as(this,"_world"),as(this,"_event"),!i)throw"missing map";this._map=i,this._options={...D6e,...e},this._canvas=i.getCanvas(),this._scene=this._options.scene||new mDe,this._camera=this._options.camera||new Eo(this._map.transform.fov,this._map.transform.width/this._map.transform.height,.001,1e21),this._camera.matrixAutoUpdate=!1,this._renderer=this._options.renderer||new q8e({alpha:!0,antialias:!0,preserveDrawingBuffer:this._options.preserveDrawingBuffer,canvas:this._canvas,context:this._canvas.getContext("webgl2")}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._canvas.clientWidth,this._canvas.clientHeight),this._renderer.autoClear=!1,this._lights=new Ch,this._lights.name="lights",this._scene.add(this._lights),this._world=new Ch,this._world.name="world",this._world.userData={isWorld:!0,name:"world"},this._world.position.set(1024e3/2,1024e3/2,0),this._world.matrixAutoUpdate=!1,this._scene.add(this._world),this._map.on("render",this._onMapRender.bind(this)),this._event=new pg}get map(){return this._map}get canvas(){return this._canvas}get camera(){return this._camera}get scene(){return this._scene}get lights(){return this._lights}get world(){return this._world}get renderer(){return this._renderer}_onMapRender(){this._map.getLayer("map_scene_layer")||this._map.addLayer(new k6e("map_scene_layer",this))}render(){if(this._options.renderLoop)this._options.renderLoop(this);else{let i={center:this._map.getCenter(),scene:this._scene,camera:this._camera,renderer:this._renderer};this._event.dispatchEvent({type:"preReset",frameState:i}),this.renderer.resetState(),this._event.dispatchEvent({type:"postReset",frameState:i}),this._event.dispatchEvent({type:"preRender",frameState:i}),this.renderer.render(this._scene,this._camera),this._event.dispatchEvent({type:"postRender",frameState:i})}return this}addLight(i){return this._lights.add(i.delegate||i),this}removeLight(i){return this._lights.remove(i.delegate||i),this}addObject(i){let e="delegate"in i?i.delegate:i;return this._world.add(e),this}removeObject(i){let e="delegate"in i?i.delegate:i;return this._world.remove(e),e.traverse(t=>{t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(n=>n.dispose()):t.material.dispose()),t.texture&&t.texture.dispose()}),this}getViewPosition(){let i=this._map.transform,e=i.center;return{position:[e.lng,e.lat,Pp.getHeightByZoom(i,i.zoom,e.lat,i.pitch)],heading:i.bearing,pitch:i.pitch}}flyTo(i,e,t){if(i&&i.position){t&&this._map.once("moveend",t);let n=i.size;n||(n=new $e,new yl().setFromObject(i.delegate||i,!0).getSize(n));let s=Pp.getViewInfo(this._map.transform,t_.vector3ToLngLat(i.position),n);this._map.flyTo({center:s.center,zoom:s.zoom,duration:(e||3)*1e3})}return this}zoomTo(i,e){return this.flyTo(i,0,e)}flyToPosition(i,e=[0,0,0],t,n=3){return t&&this._map.once("moveend",t),this._map.flyTo({center:[i[0],i[1]],zoom:Pp.getZoomByHeight(this._map.transform,i[2],i[1],e[1]||0),bearing:e[0],pitch:e[1],duration:n*1e3}),this}zoomToPosition(i,e=[0,0,0],t){return this.flyToPosition(i,e,t,0)}on(i,e){return this._event.addEventListener(i,e),this}off(i,e){return this._event.removeEventListener(i,e),this}},O6e=class{static createRTCGroup(i,e,t){let n=new Ch;if(n.name="rtc",n.position.copy(t_.lngLatToVector3(i)),e?(n.rotateX(e[0]||0),n.rotateY(e[1]||0),n.rotateZ(e[2]||0)):(n.rotateX(Math.PI/2),n.rotateY(Math.PI)),t)n.scale.set(t[0]||1,t[1]||1,t[2]||1);else{let s=1;Array.isArray(i)&&(s=t_.projectedUnitsPerMeter(i[1])),n.scale.set(s,s,s)}return n}static createMercatorRTCGroup(i,e,t){let n=this.createRTCGroup(i,e,t);if(!t){let s=1,r=t_.projectedMercatorUnitsPerMeter();Array.isArray(i)&&(s=t_.projectedUnitsPerMeter(i[1])),n.scale.set(r,r,s)}return n}static createShadowGround(i,e,t){let n=new $k(e||100,t||100),s=new RDe({opacity:.5,transparent:!0}),r=new mo(n,s);return r.position.copy(t_.lngLatToVector3(i)),r.receiveShadow=!0,r.name="shadow-ground",r}},Jz=O6e;const U6e=new kS(-1,1,1,-1,0,1);class z6e extends Qc{constructor(){super(),this.setAttribute("position",new Fc([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Fc([0,2,0,0,2,0],2))}}const $6e=new z6e;class vY{constructor(e){this._mesh=new mo($6e,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,U6e)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}var fo=Uint8Array,uv=Uint16Array,V6e=Int32Array,bY=new fo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xY=new fo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),G6e=new fo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wY=function(i,e){for(var t=new uv(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var s=new V6e(t[30]),n=1;n<30;++n)for(var r=t[n];r<t[n+1];++r)s[r]=r-t[n]<<5|n;return{b:t,r:s}},EY=wY(bY,2),CY=EY.b,H6e=EY.r;CY[28]=258,H6e[258]=28;var Q6e=wY(xY,0),W6e=Q6e.b,SY=new uv(32768);for(var Os=0;Os<32768;++Os){var Ed=(Os&43690)>>1|(Os&21845)<<1;Ed=(Ed&52428)>>2|(Ed&13107)<<2,Ed=(Ed&61680)>>4|(Ed&3855)<<4,SY[Os]=((Ed&65280)>>8|(Ed&255)<<8)>>1}var dv=function(i,e,t){for(var n=i.length,s=0,r=new uv(e);s<n;++s)i[s]&&++r[i[s]-1];var o=new uv(e);for(s=1;s<e;++s)o[s]=o[s-1]+r[s-1]<<1;var a;{a=new uv(1<<e);var l=15-e;for(s=0;s<n;++s)if(i[s])for(var h=s<<4|i[s],u=e-i[s],d=o[i[s]-1]++<<u,g=d|(1<<u)-1;d<=g;++d)a[SY[d]>>l]=h}return a},Nb=new fo(288);for(var Os=0;Os<144;++Os)Nb[Os]=8;for(var Os=144;Os<256;++Os)Nb[Os]=9;for(var Os=256;Os<280;++Os)Nb[Os]=7;for(var Os=280;Os<288;++Os)Nb[Os]=8;var IY=new fo(32);for(var Os=0;Os<32;++Os)IY[Os]=5;var q6e=dv(Nb,9),j6e=dv(IY,5),g2=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},vc=function(i,e,t){var n=e/8|0;return(i[n]|i[n+1]<<8)>>(e&7)&t},m2=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},MY=function(i){return(i+7)/8|0},D_=function(i,e,t){return(e==null||e<0)&&(e=0),(t==null||t>i.length)&&(t=i.length),new fo(i.subarray(e,t))},Y6e=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ha=function(i,e,t){var n=new Error(e||Y6e[i]);if(n.code=i,Error.captureStackTrace&&Error.captureStackTrace(n,ha),!t)throw n;return n},TY=function(i,e,t,n){var s=i.length,r=n?n.length:0;if(!s||e.f&&!e.l)return t||new fo(0);var o=!t,a=o||e.i!=2,l=e.i;o&&(t=new fo(s*3));var h=function(qe){var le=t.length;if(qe>le){var ot=new fo(Math.max(le*2,qe));ot.set(t),t=ot}},u=e.f||0,d=e.p||0,g=e.b||0,m=e.l,v=e.d,b=e.m,w=e.n,x=s*8;do{if(!m){u=vc(i,d,1);var I=vc(i,d+1,3);if(d+=3,I)if(I==1)m=q6e,v=j6e,b=9,w=5;else if(I==2){var z=vc(i,d,31)+257,U=vc(i,d+10,15)+4,N=z+vc(i,d+5,31)+1;d+=14;for(var L=new fo(N),k=new fo(19),D=0;D<U;++D)k[G6e[D]]=vc(i,d+D*3,7);d+=U*3;for(var Y=g2(k),Z=(1<<Y)-1,j=dv(k,Y),D=0;D<N;){var Q=j[vc(i,d,Z)];d+=Q&15;var T=Q>>4;if(T<16)L[D++]=T;else{var $=0,W=0;for(T==16?(W=3+vc(i,d,3),d+=2,$=L[D-1]):T==17?(W=3+vc(i,d,7),d+=3):T==18&&(W=11+vc(i,d,127),d+=7);W--;)L[D++]=$}}var q=L.subarray(0,z),ee=L.subarray(z);b=g2(q),w=g2(ee),m=dv(q,b),v=dv(ee,w)}else ha(1);else{var T=MY(d)+4,R=i[T-4]|i[T-3]<<8,F=T+R;if(F>s){l&&ha(0);break}a&&h(g+R),t.set(i.subarray(T,F),g),e.b=g+=R,e.p=d=F*8,e.f=u;continue}if(d>x){l&&ha(0);break}}a&&h(g+131072);for(var ne=(1<<b)-1,oe=(1<<w)-1,ue=d;;ue=d){var $=m[m2(i,d)&ne],pe=$>>4;if(d+=$&15,d>x){l&&ha(0);break}if($||ha(2),pe<256)t[g++]=pe;else if(pe==256){ue=d,m=null;break}else{var ae=pe-254;if(pe>264){var D=pe-257,ye=bY[D];ae=vc(i,d,(1<<ye)-1)+CY[D],d+=ye}var Me=v[m2(i,d)&oe],Ne=Me>>4;Me||ha(3),d+=Me&15;var ee=W6e[Ne];if(Ne>3){var ye=xY[Ne];ee+=m2(i,d)&(1<<ye)-1,d+=ye}if(d>x){l&&ha(0);break}a&&h(g+131072);var me=g+ae;if(g<ee){var Ke=r-ee,ze=Math.min(ee,me);for(Ke+g<0&&ha(3);g<ze;++g)t[g]=n[Ke+g]}for(;g<me;++g)t[g]=t[g-ee]}}e.l=m,e.p=ue,e.b=g,e.f=u,m&&(u=1,e.m=b,e.d=v,e.n=w)}while(!u);return g!=t.length&&o?D_(t,0,g):t.subarray(0,g)},X6e=new fo(0),Ah=function(i,e){return i[e]|i[e+1]<<8},Ic=function(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0},_2=function(i,e){return Ic(i,e)+Ic(i,e+4)*4294967296},Z6e=function(i){(i[0]!=31||i[1]!=139||i[2]!=8)&&ha(6,"invalid gzip data");var e=i[3],t=10;e&4&&(t+=(i[10]|i[11]<<8)+2);for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!i[t++]);return t+(e&2)},A2=(function(){function i(e,t){typeof e=="function"&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new fo(32768),this.p=new fo(0),n&&this.o.set(n)}return i.prototype.e=function(e){if(this.ondata||ha(5),this.d&&ha(4),!this.p.length)this.p=e;else if(e.length){var t=new fo(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},i.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=TY(this.p,this.s,this.o);this.ondata(D_(n,t,this.s.b),this.d),this.o=D_(n,this.s.b-32768),this.s.b=this.o.length,this.p=D_(this.p,this.s.p/8|0),this.s.p&=7},i.prototype.push=function(e,t){this.e(e),this.c(t)},i})();function J6e(i,e){return TY(i,{i:2},e&&e.out,e&&e.dictionary)}var K6e=(function(){function i(e,t){this.v=1,this.r=0,A2.call(this,e,t)}return i.prototype.push=function(e,t){if(A2.prototype.e.call(this,e),this.r+=e.length,this.v){var n=this.p.subarray(this.v-1),s=n.length>3?Z6e(n):4;if(s>n.length){if(!t)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(s),this.v=0}A2.prototype.c.call(this,t),this.s.f&&!this.s.l&&!t&&(this.v=MY(this.s.p)+9,this.s={i:0},this.o=new fo(0),this.push(new fo(0),t))},i})(),UB=typeof TextDecoder<"u"&&new TextDecoder,eze=0;try{UB.decode(X6e,{stream:!0}),eze=1}catch{}var tze=function(i){for(var e="",t=0;;){var n=i[t++],s=(n>127)+(n>223)+(n>239);if(t+s>i.length)return{s:e,r:D_(i,t-1)};s?s==3?(n=((n&15)<<18|(i[t++]&63)<<12|(i[t++]&63)<<6|i[t++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):s&1?e+=String.fromCharCode((n&31)<<6|i[t++]&63):e+=String.fromCharCode((n&15)<<12|(i[t++]&63)<<6|i[t++]&63):e+=String.fromCharCode(n)}};function nze(i,e){if(e){for(var t="",n=0;n<i.length;n+=16384)t+=String.fromCharCode.apply(null,i.subarray(n,n+16384));return t}else{if(UB)return UB.decode(i);var s=tze(i),r=s.s,t=s.r;return t.length&&ha(8),r}}var ize=function(i,e){return e+30+Ah(i,e+26)+Ah(i,e+28)},sze=function(i,e,t){var n=Ah(i,e+28),s=nze(i.subarray(e+46,e+46+n),!(Ah(i,e+8)&2048)),r=e+46+n,o=Ic(i,e+20),a=t&&o==4294967295?rze(i,r):[o,Ic(i,e+24),Ic(i,e+42)],l=a[0],h=a[1],u=a[2];return[Ah(i,e+10),l,h,s,r+Ah(i,e+30)+Ah(i,e+32),u]},rze=function(i,e){for(;Ah(i,e)!=1;e+=4+Ah(i,e+2));return[_2(i,e+12),_2(i,e+4),_2(i,e+20)]};function oze(i,e){for(var t={},n=i.length-22;Ic(i,n)!=101010256;--n)(!n||i.length-n>65558)&&ha(13);var s=Ah(i,n+8);if(!s)return{};var r=Ic(i,n+16),o=r==4294967295||s==65535;if(o){var a=Ic(i,n-12);o=Ic(i,a)==101075792,o&&(s=Ic(i,a+32),r=Ic(i,a+48))}for(var l=e&&e.filter,h=0;h<s;++h){var u=sze(i,r,o),d=u[0],g=u[1],m=u[2],v=u[3],b=u[4],w=u[5],x=ize(i,w);r=b,(!l||l({name:v,size:g,originalSize:m,compression:d}))&&(d?d==8?t[v]=J6e(i.subarray(x,x+g),{out:new fo(m)}):ha(14,"unknown compression type "+d):t[v]=D_(i,x,x+g))}return t}let Du;const RY=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&RY.decode();let Py=null;function aze(){return(Py===null||Py.byteLength===0)&&(Py=new Uint8Array(Du.memory.buffer)),Py}function lze(i,e){return i=i>>>0,RY.decode(aze().subarray(i,i+e))}function cze(i,e,t,n,s,r,o,a,l,h,u,d,g){return Du.raycast_splats(i,e,t,n,s,r,o,a,l,h,u,d,g)}async function hze(i,e){if(typeof Response=="function"&&i instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(i,e)}catch(n){if(i.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const t=await i.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(i,e);return t instanceof WebAssembly.Instance?{instance:t,module:i}:t}}function uze(){const i={};return i.wbg={},i.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},i.wbg.__wbg_length_3b4f022188ae8db6=function(e){return e.length},i.wbg.__wbg_length_6ca527665d89694d=function(e){return e.length},i.wbg.__wbg_length_8cfd2c6409af88ad=function(e){return e.length},i.wbg.__wbg_new_9fee97a409b32b68=function(e){return new Uint16Array(e)},i.wbg.__wbg_new_e3b321dcfef89fc7=function(e){return new Uint32Array(e)},i.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354=function(e,t,n){return new Float32Array(e,t>>>0,n>>>0)},i.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(e,t,n){return new Uint32Array(e,t>>>0,n>>>0)},i.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return new Float32Array(e>>>0)},i.wbg.__wbg_set_10bad9bee0e9c58b=function(e,t,n){e.set(t,n>>>0)},i.wbg.__wbg_set_d23661d19148b229=function(e,t,n){e.set(t,n>>>0)},i.wbg.__wbg_set_f4f1f0daa30696fc=function(e,t,n){e.set(t,n>>>0)},i.wbg.__wbg_subarray_3aaeec89bb2544f0=function(e,t,n){return e.subarray(t>>>0,n>>>0)},i.wbg.__wbg_subarray_769e1e0f81bb259b=function(e,t,n){return e.subarray(t>>>0,n>>>0)},i.wbg.__wbindgen_init_externref_table=function(){const e=Du.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},i.wbg.__wbindgen_memory=function(){return Du.memory},i.wbg.__wbindgen_throw=function(e,t){throw new Error(lze(e,t))},i}function dze(i,e){return Du=i.exports,BY.__wbindgen_wasm_module=e,Py=null,Du.__wbindgen_start(),Du}async function BY(i){if(Du!==void 0)return Du;typeof i<"u"&&(Object.getPrototypeOf(i)===Object.prototype?{module_or_path:i}=i:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof i>"u"&&(i=new URL("data:application/wasm;base64,AGFzbQEAAAABzAEeYAJ/fwF/YAJ/fwBgA39/fwF/YAF/AX9gA39/fwBgAX8AYAV/f39/fwBgA29/fwFvYAV/f39/fwF/YAFvAW9gA29vfwBgAW8Bf2AAAX9gBH9/f38AYAAAYAR/f39/AX9gA39vbwF/YAF/AW9gAAFvYAF9AX1gBn9/f39/fwBgDX19fX19fX19f29/fX0Bb2AGf39/f39/AX9gBX9/fH9/AGAEf3x/fwBgBX9/fX9/AGAEf31/fwBgBX9/fn9/AGAEf35/fwBgAn19AX0C8gQRA3diZx1fX3di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AAQAAAAJwcQABcAAAA+BxAACQAAACByaWdodGAgZmFpbGVkOiAKICBsZWZ0OiAAAAAXBxAAEAAAAGAHEAAQAAAAcAcQAAkAAAA+BxAACQAAADogAAABAAAAAAAAAJwHEAACAAAAfSB9Y29yZS9zcmMvZm10L251bS5ycwAAswcQABMAAABmAAAAFwAAADB4MDAwMTAyMDMwNDA1MDYwNzA4MDkxMDExMTIxMzE0MTUxNjE3MTgxOTIwMjEyMjIzMjQyNTI2MjcyODI5MzAzMTMyMzMzNDM1MzYzNzM4Mzk0MDQxNDI0MzQ0NDU0NjQ3NDg0OTUwNTE1MjUzNTQ1NTU2NTc1ODU5NjA2MTYyNjM2NDY1NjY2NzY4Njk3MDcxNzI3Mzc0NzU3Njc3Nzg3OTgwODE4MjgzODQ4NTg2ODc4ODg5OTA5MTkyOTM5NDk1OTY5Nzk4OTlyYW5nZSBzdGFydCBpbmRleCAgb3V0IG9mIHJhbmdlIGZvciBzbGljZSBvZiBsZW5ndGggAACiCBAAEgAAALQIEAAiAAAAcmFuZ2UgZW5kIGluZGV4IOgIEAAQAAAAtAgQACIAAAAAAAA/AAAAvwBBqJLAAAsBFABwCXByb2R1Y2VycwIIbGFuZ3VhZ2UBBFJ1c3QADHByb2Nlc3NlZC1ieQMFcnVzdGMdMS44My4wICg5MGIzNWE2MjMgMjAyNC0xMS0yNikGd2FscnVzBjAuMjMuMwx3YXNtLWJpbmRnZW4HMC4yLjEwMABJD3RhcmdldF9mZWF0dXJlcwQrD211dGFibGUtZ2xvYmFscysIc2lnbi1leHQrD3JlZmVyZW5jZS10eXBlcysKbXVsdGl2YWx1ZQ==",typeof document>"u"?require("url").pathToFileURL(__filename).href:ZI&&ZI.tagName.toUpperCase()==="SCRIPT"&&ZI.src||new URL("ControlGrid-3Y_umzvK.cjs",document.baseURI).href));const e=uze();(typeof i=="string"||typeof Request=="function"&&i instanceof Request||typeof URL=="function"&&i instanceof URL)&&(i=fetch(i));const{instance:t,module:n}=await hze(await i,e);return dze(t,n)}const Yu=-12,Xu=9,fze=-30,y2=Math.exp(fze),pze=11,gze=11,Cs=1<<pze,Lp=1<<gze,mze=1;function _ze(i){return i==="bool"||i==="bvec2"||i==="bvec3"||i==="bvec4"}function kp(i){return i==="int"||i==="ivec2"||i==="ivec3"||i==="ivec4"}function Np(i){return i==="uint"||i==="uvec2"||i==="uvec3"||i==="uvec4"}function Aze(i){return i==="float"||i==="vec2"||i==="vec3"||i==="vec4"}function yze(i){return i==="mat2"||i==="mat2x2"||i==="mat2x3"||i==="mat2x4"||i==="mat3"||i==="mat3x2"||i==="mat3x3"||i==="mat3x4"||i==="mat4"||i==="mat4x2"||i==="mat4x3"||i==="mat4x4"}function jv(i){return Aze(i)||yze(i)}function ym(i){return i==="mat2"||i==="mat2x2"}function vm(i){return i==="mat3"||i==="mat3x3"}function bm(i){return i==="mat4"||i==="mat4x4"}function vze(i){switch(i){case"vec2":return"float";case"vec3":return"float";case"vec4":return"float";case"ivec2":return"int";case"ivec3":return"int";case"ivec4":return"int";case"uvec2":return"uint";case"uvec3":return"uint";case"uvec4":return"uint";default:throw new Error(`Invalid vector type: ${i}`)}}function bze(i){switch(i){case"vec2":case"ivec2":case"uvec2":return 2;case"vec3":case"ivec3":case"uvec3":return 3;case"vec4":case"ivec4":case"uvec4":return 4;default:throw new Error(`Invalid vector type: ${i}`)}}function Gr(i){return Math.trunc(i).toString()}function Hr(i){return`${Math.max(0,Math.trunc(i)).toString()}u`}function ji(i){return i===Number.POSITIVE_INFINITY?"INFINITY":i===Number.NEGATIVE_INFINITY?"-INFINITY":Number.isInteger(i)?i.toFixed(1):i.toString()}function Bu(i){return i instanceof Dp?i.type:i.dynoOut().type}class Dp{constructor(e){this.__isDynoValue=!0,this.type=e}}class $a extends Dp{constructor(e,t){super(e.outTypes[t]),this.dyno=e,this.key=t}}class TE extends Dp{constructor(e,t){super(e),this.literal=t}getLiteral(){return this.literal}}class xze extends TE{constructor(e,t){super(e,""),this.value=t}getLiteral(){const{type:e,value:t}=this;switch(e){case"bool":return t?"true":"false";case"uint":return Hr(t);case"int":return Gr(t);case"float":return ji(t);case"bvec2":{const n=t;return`bvec2(${n[0]}, ${n[1]})`}case"uvec2":{if(t instanceof Ci)return`uvec2(${Hr(t.x)}, ${Hr(t.y)})`;const n=t;return`uvec2(${Hr(n[0])}, ${Hr(n[1])})`}case"ivec2":{if(t instanceof Ci)return`ivec2(${Gr(t.x)}, ${Gr(t.y)})`;const n=t;return`ivec2(${Gr(n[0])}, ${Gr(n[1])})`}case"vec2":{if(t instanceof Ci)return`vec2(${ji(t.x)}, ${ji(t.y)})`;const n=t;return`vec2(${ji(n[0])}, ${ji(n[1])})`}case"bvec3":{const n=t;return`bvec3(${n[0]}, ${n[1]}, ${n[2]})`}case"uvec3":{if(t instanceof $e)return`uvec3(${Hr(t.x)}, ${Hr(t.y)}, ${Hr(t.z)})`;const n=t;return`uvec3(${Hr(n[0])}, ${Hr(n[1])}, ${Hr(n[2])})`}case"ivec3":{if(t instanceof $e)return`ivec3(${Gr(t.x)}, ${Gr(t.y)}, ${Gr(t.z)})`;const n=t;return`ivec3(${Gr(n[0])}, ${Gr(n[1])}, ${Gr(n[2])})`}case"vec3":{if(t instanceof $e)return`vec3(${ji(t.x)}, ${ji(t.y)}, ${ji(t.z)})`;const n=t;return`vec3(${ji(n[0])}, ${ji(n[1])}, ${ji(n[2])})`}case"bvec4":{const n=t;return`bvec4(${n[0]}, ${n[1]}, ${n[2]}, ${n[3]})`}case"uvec4":{if(t instanceof Ii)return`uvec4(${Hr(t.x)}, ${Hr(t.y)}, ${Hr(t.z)}, ${Hr(t.w)})`;const n=t;return`uvec4(${Hr(n[0])}, ${Hr(n[1])}, ${Hr(n[2])}, ${Hr(n[3])})`}case"ivec4":{if(t instanceof Ii)return`ivec4(${Gr(t.x)}, ${Gr(t.y)}, ${Gr(t.z)}, ${Gr(t.w)})`;const n=t;return`ivec4(${Gr(n[0])}, ${Gr(n[1])}, ${Gr(n[2])}, ${Gr(n[3])})`}case"vec4":{if(t instanceof Ii)return`vec4(${ji(t.x)}, ${ji(t.y)}, ${ji(t.z)}, ${ji(t.w)})`;if(t instanceof pr)return`vec4(${ji(t.x)}, ${ji(t.y)}, ${ji(t.z)}, ${ji(t.w)})`;const n=t;return`vec4(${ji(n[0])}, ${ji(n[1])}, ${ji(n[2])}, ${ji(n[3])})`}case"mat2":case"mat2x2":{const n=t,s=n instanceof NS?n.elements:t,r=new Array(4).fill(0).map((o,a)=>ji(s[a]));return`${e}(${r.join(", ")})`}case"mat2x3":{const n=t,s=new Array(6).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat2x4":{const n=t,s=new Array(8).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat3":case"mat3x3":{const n=t,s=n instanceof wi?n.elements:t,r=new Array(9).fill(0).map((o,a)=>ji(s[a]));return`${e}(${r.join(", ")})`}case"mat3x2":{const n=t,s=new Array(6).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat3x4":{const n=t,s=new Array(12).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat4":case"mat4x4":{const n=t,s=n instanceof Qn?n.elements:t,r=new Array(16).fill(0).map((o,a)=>ji(s[a]));return`${e}(${r.join(", ")})`}case"mat4x2":{const n=t,s=new Array(8).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}case"mat4x3":{const n=t,s=new Array(12).fill(0).map((r,o)=>ji(n[o]));return`${e}(${s.join(", ")})`}default:throw new Error(`Type not implemented: ${String(e)}`)}}}function fv(i,e){return new xze(i,e)}function H1(i){const e=String(i);if(_ze(i))return`${e}(false)`;if(jv(i))return`${e}(0.0)`;if(kp(i))return`${e}(0)`;if(Np(i))return`${e}(0u)`;throw new Error(`Type not implemented: ${e}`)}const Kz=" ";class wze{constructor({indent:e}={}){this.globals=new Set,this.statements=[],this.uniforms={},this.declares=new Set,this.updaters=[],this.sequence=0,this.indent=Kz,this.indent=e??Kz}nextSequence(){return this.sequence++}}class _o{constructor({inTypes:e,outTypes:t,inputs:n,update:s,globals:r,statements:o,generate:a}){this.inTypes=e??{},this.outTypes=t??{},this.inputs=n??{},this.update=s,this.globals=r,this.statements=o,this.generate=a??(({inputs:l,outputs:h,compile:u})=>{var d,g;return{globals:(d=this.globals)==null?void 0:d.call(this,{inputs:l,outputs:h,compile:u}),statements:(g=this.statements)==null?void 0:g.call(this,{inputs:l,outputs:h,compile:u})}})}get outputs(){const e={};for(const t in this.outTypes)e[t]=new $a(this,t);return e}apply(e){return Object.assign(this.inputs,e),this.outputs}compile({inputs:e,outputs:t,compile:n}){const s=[`// ${this.constructor.name}(${Object.values(e).join(", ")}) => (${Object.values(t).join(", ")})`],r=[];for(const h in t){const u=t[h];u&&!n.declares.has(u)&&(n.declares.add(u),r.push(h))}const{globals:o,statements:a,uniforms:l}=this.generate({inputs:e,outputs:t,compile:n});for(const h of o??[])n.globals.add(h);for(const h in l)n.uniforms[h]=l[h];this.update&&n.updaters.push(this.update);for(const h of r){const u=t[h];u&&(n.uniforms[u]||s.push(`${PY(u,this.outTypes[h])};`))}return a?.length&&(s.push("{"),s.push(...a.map(h=>n.indent+h)),s.push("}")),s}}class Eze extends _o{constructor({inTypes:e,outTypes:t,inputs:n,update:s,globals:r,construct:o}){super({inTypes:e,outTypes:t,inputs:n,update:s,globals:r,generate:a=>this.generateBlock(a)}),this.construct=o}generateBlock({inputs:e,outputs:t,compile:n}){var s,r;const o={},a={};for(const w in e)e[w]!=null&&(o[w]=new TE(this.inTypes[w],e[w]));for(const w in t)t[w]!=null&&(a[w]=new Dp(this.outTypes[w]));const l={roots:[]},h=this.construct(o,a,l);for(const w of((s=this.globals)==null?void 0:s.call(this,{inputs:e,outputs:t,compile:n}))??[])n.globals.add(w);const u=[],d=new Map;function g(w,x,I){let T=d.get(w);if(!T){T={sequence:n.nextSequence(),outNames:new Map,newOuts:new Set},d.set(w,T);for(const R in w.inputs){let F=w.inputs[R];for(;F;){if(F instanceof Dp){F instanceof $a&&g(F.dyno,F.key);break}F=F.dynoOut()}}u.push(w)}x&&(I||T.newOuts.add(x),T.outNames.set(x,I??`${x}_${T.sequence}`))}for(const w of l.roots)g(w);for(const w in a){let x=h?.[w]??a[w];for(;x;){if(x instanceof Dp){x instanceof $a&&g(x.dyno,x.key,t[w]);break}x=x.dynoOut()}a[w]=x}const m=[];for(const w of u){const x={},I={};for(const F in w.inputs){let z=w.inputs[F];for(;z;){if(z instanceof Dp){if(z instanceof TE)x[F]=z.getLiteral();else if(z instanceof $a){const U=(r=d.get(z.dyno))==null?void 0:r.outNames.get(z.key);if(!U)throw new Error(`Source not found for ${z.dyno.constructor.name}.${z.key}`);x[F]=U}break}z=z.dynoOut()}}const T=d.get(w)??{outNames:new Map};for(const[F,z]of T.outNames.entries())I[F]=z;const R=w.compile({inputs:x,outputs:I,compile:n});m.push(R)}const v=[];for(const w in t)a[w]instanceof TE&&v.push(`${t[w]} = ${a[w].getLiteral()};`);return v.length>0&&m.push(v),{statements:m.flatMap((w,x)=>x===0?w:["",...w])}}}function Zu(i,e,t,{update:n,globals:s}={}){return new Eze({inTypes:i,outTypes:e,construct:t,update:n,globals:s})}function FS({inTypes:i,outTypes:e,inputs:t,update:n,globals:s,statements:r,generate:o}){return new _o({inTypes:i,outTypes:e,inputs:t,update:n,globals:s,statements:r,generate:o})}function PY(i,e,t){const n=typeof e=="string"?e:e.type;if(!n)throw new Error(`Invalid DynoType: ${String(e)}`);return`${n} ${i}${t!=null?`[${t}]`:""}`}function zh(i){var e;let t=!1;const n=i.split(`
|
|
7091
7091
|
`).map(o=>{const a=o.trimEnd();return t?a:a.length>0?(t=!0,a):null}).filter(o=>o!=null);for(;n.length>0&&n[n.length-1].length===0;)n.pop();if(n.length===0)return[];const s=(e=n[0].match(/^\s*/))==null?void 0:e[0];if(!s)return n;const r=new RegExp(`^${s}`);return n.map(o=>o.replace(r,""))}function Ha(i){return zh(i).join(`
|
|
7092
7092
|
`)}class OS extends _o{constructor({a:e,outKey:t,outTypeFunc:n}){const s={a:Bu(e)},r=n(Bu(e)),o={[t]:r};super({inTypes:s,outTypes:o,inputs:{a:e}}),this.outKey=t}dynoOut(){return new $a(this,this.outKey)}}class US extends _o{constructor({a:e,b:t,outKey:n,outTypeFunc:s}){const r={a:Bu(e),b:Bu(t)},o=s(Bu(e),Bu(t)),a={[n]:o};super({inTypes:r,outTypes:a,inputs:{a:e,b:t}}),this.outKey=n}dynoOut(){return new $a(this,this.outKey)}}const to={type:"Gsplat"},zS={type:"PackedSplats"},pv=(i,e)=>new Sze({packedSplats:i,index:e}),Cze=(i,e,t,n)=>new Ize({packedSplats:i,index:e,base:t,count:n}),RE=i=>new Mze({gsplat:i}),v2=({gsplat:i,flags:e,index:t,center:n,scales:s,quaternion:r,rgba:o,rgb:a,opacity:l,x:h,y:u,z:d,r:g,g:m,b:v})=>new Tze({gsplat:i,flags:e,index:t,center:n,scales:s,quaternion:r,rgba:o,rgb:a,opacity:l,x:h,y:u,z:d,r:g,g:m,b:v}),LY=(i,{scale:e,rotate:t,translate:n,recolor:s})=>new Rze({gsplat:i,scale:e,rotate:t,translate:n,recolor:s}),$h=Ha(`
|
|
7093
7093
|
struct Gsplat {
|
|
@@ -19606,4 +19606,4 @@ void main()
|
|
|
19606
19606
|
<rect x="2" y="2" width="6" height="6" rx="1" stroke-dasharray="2 1"/>
|
|
19607
19607
|
</svg>
|
|
19608
19608
|
</span>
|
|
19609
|
-
`,t.addEventListener("click",()=>this.toggle()),e.appendChild(t),e}_createPanel(){const e=document.createElement("div");e.className="usgs-lidar-control-panel",e.style.width=`${this._options.panelWidth}px`,e.style.maxHeight=`${this._options.maxHeight}px`;const t=document.createElement("div");t.className="usgs-lidar-control-header";const n=document.createElement("span");n.className="usgs-lidar-control-title",n.textContent=this._options.title;const s=document.createElement("button");s.className="usgs-lidar-control-close",s.type="button",s.setAttribute("aria-label","Close panel"),s.innerHTML="×",s.addEventListener("click",()=>this.collapse()),t.appendChild(n),t.appendChild(s),this._panelBuilder=new est({onSearchByExtent:()=>this.searchByExtent(),onStartDrawing:()=>this.startDrawing(),onStopDrawing:()=>this.stopDrawing(),onSearchByDrawn:()=>{this._state.drawnBbox&&this.searchByBbox(this._state.drawnBbox)},onClearDrawn:()=>this.clearDrawnBbox(),onItemSelect:o=>this.toggleItemSelection(o),onItemLoad:o=>{this.loadItem(o).catch(()=>{})},onLoadSelected:()=>{this.loadSelectedItems().catch(()=>{})},onCopySignedUrls:()=>{this.copySignedUrls().catch(o=>{console.error("Failed to copy signed URLs:",o)})},onDownloadSelected:()=>{this.downloadSelected().catch(o=>{console.error("Failed to download selected:",o)})},onClearResults:()=>this.clearResults(),onUnloadItem:o=>this.unloadItem(o),onClearLoaded:()=>this.clearLoadedItems(),onPointSizeChange:o=>this.setPointSize(o),onOpacityChange:o=>this.setOpacity(o),onColorSchemeChange:o=>this.setColorScheme(o),onZOffsetChange:o=>this.setZOffset(o),onPickableChange:o=>this.setPickable(o),onElevationRangeChange:o=>this.setElevationRange(o),onClassificationToggle:(o,a)=>this.setClassificationVisibility(o,a),onClassificationShowAll:()=>this.showAllClassifications(),onClassificationHideAll:()=>this.hideAllClassifications(),onDataSourceChange:o=>this.setDataSource(o),onColormapChange:o=>this.setColormap(o),onColorRangeChange:o=>this.setColorRange(o),onShowMetadata:o=>this.showMetadata(o),onCrossSectionPanel:()=>this.getCrossSectionPanel()},this._state);const r=this._panelBuilder.build();return e.appendChild(t),e.appendChild(r),e}_setupEventListeners(){var e;const t=n=>{var s,r,o,a,l;const h=n.target;if((s=this._container)!=null&&s.contains(h)||(r=this._panel)!=null&&r.contains(h)||(a=(o=this._mapContainer)==null?void 0:o.querySelector(".maplibregl-canvas"))!=null&&a.contains(h))return;const u=document.querySelector(".lidar-metadata-backdrop, .lidar-chart-popup-backdrop");u?.contains(h)||(l=h.closest)!=null&&l.call(h,".lidar-metadata-backdrop, .lidar-metadata-panel, .lidar-chart-popup-backdrop, .lidar-chart-popup")||this._state.collapsed||this.collapse()};document.addEventListener("click",t,!0),window.addEventListener("resize",()=>{this._state.collapsed||this._updatePanelPosition()}),(e=this._map)==null||e.on("resize",()=>{this._state.collapsed||this._updatePanelPosition()})}_getControlPosition(){var e;const t=(e=this._container)==null?void 0:e.parentElement;return t?t.classList.contains("maplibregl-ctrl-top-left")?"top-left":t.classList.contains("maplibregl-ctrl-top-right")?"top-right":t.classList.contains("maplibregl-ctrl-bottom-left")?"bottom-left":t.classList.contains("maplibregl-ctrl-bottom-right")?"bottom-right":"top-right":"top-right"}_updatePanelPosition(){if(!this._container||!this._panel||!this._mapContainer)return;const e=this._container.querySelector(".usgs-lidar-control-toggle");if(!e)return;const t=e.getBoundingClientRect(),n=this._mapContainer.getBoundingClientRect(),s=this._getControlPosition(),r=t.top-n.top,o=n.bottom-t.bottom,a=t.left-n.left,l=n.right-t.right,h=5;switch(this._panel.style.top="",this._panel.style.bottom="",this._panel.style.left="",this._panel.style.right="",s){case"top-left":this._panel.style.top=`${r+t.height+h}px`,this._panel.style.left=`${a}px`;break;case"top-right":this._panel.style.top=`${r+t.height+h}px`,this._panel.style.right=`${l}px`;break;case"bottom-left":this._panel.style.bottom=`${o+t.height+h}px`,this._panel.style.left=`${a}px`;break;case"bottom-right":this._panel.style.bottom=`${o+t.height+h}px`,this._panel.style.right=`${l}px`;break}}getPanelElement(){return this._panel??null}}var nst=Object.defineProperty,ist=(i,e,t)=>e in i?nst(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,qw=(i,e,t)=>ist(i,typeof e!="symbol"?e+"":e,t);class PK{constructor(e){qw(this,"type","usgs-lidar"),qw(this,"_usgsControl"),qw(this,"_changeCallbacks",[]),qw(this,"_unsubscribe"),this._usgsControl=e,this._setupEventListeners()}_setupEventListeners(){const e=n=>{var s;if((s=n.pointCloud)!=null&&s.id){const r=this._usgsControl.getState();for(const[o,a]of r.loadedItems.entries())if(a.id===n.pointCloud.id){this._notifyLayerAdded(o);break}}},t=n=>{n.itemId&&this._notifyLayerRemoved(n.itemId)};this._usgsControl.on("loadcomplete",e),this._usgsControl.on("unload",t),this._unsubscribe=()=>{this._usgsControl.off("loadcomplete",e),this._usgsControl.off("unload",t)}}getLayerIds(){const e=this._usgsControl.getState();return Array.from(e.loadedItems.keys())}getLayerState(e){var t;const n=this._usgsControl.getState(),s=n.loadedItems.get(e);if(!s)return null;const r=this._usgsControl.getLidarControl(),o=r?._pointCloudManager,a=o?.getPointCloudVisibility(s.id)??!0,l=o?.getPointCloudOpacity(s.id)??((t=n.lidarState)==null?void 0:t.opacity)??1;return{visible:a,opacity:l,name:this.getName(e),isCustomLayer:!0,customLayerType:"usgs-lidar"}}setVisibility(e,t){const s=this._usgsControl.getState().loadedItems.get(e);if(!s)return;const r=this._usgsControl.getLidarControl(),o=r?._pointCloudManager;o?.setPointCloudVisibility(s.id,t)}setOpacity(e,t){const s=this._usgsControl.getState().loadedItems.get(e);if(!s)return;const r=this._usgsControl.getLidarControl(),o=r?._pointCloudManager;o?.setPointCloudOpacity(s.id,t)}getName(e){const n=this._usgsControl.getState().loadedItems.get(e);return n?n.name:e.replace(/[-_]/g," ").replace(/\b\w/g,s=>s.toUpperCase())}getSymbolType(e){return"circle"}onLayerChange(e){return this._changeCallbacks.push(e),()=>{const t=this._changeCallbacks.indexOf(e);t>=0&&this._changeCallbacks.splice(t,1)}}_notifyLayerAdded(e){this._changeCallbacks.forEach(t=>t("add",e))}_notifyLayerRemoved(e){this._changeCallbacks.forEach(t=>t("remove",e))}destroy(){var e;(e=this._unsubscribe)==null||e.call(this),this._changeCallbacks=[]}}const sst={title:"",position:"top-right",className:"",visible:!0,collapsible:!0,collapsed:!0,rows:1,columns:3,showRowColumnControls:!0,controls:[],backgroundColor:"rgba(255, 255, 255, 0.9)",padding:10,borderRadius:4,opacity:1,gap:6,minzoom:0,maxzoom:24,basemapStyleUrl:void 0,excludeLayers:void 0},rst='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',ost='<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29"><path d="m10.5 14 4-8 4 8z" fill="#333"/><path d="m10.5 16 4 8 4-8z" fill="#ccc"/></svg>';class ast{_map;_container;_icon;_rotateHandler;onAdd(e){this._map=e,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group";const t=document.createElement("button");return t.className="maplibregl-ctrl-compass",t.type="button",t.title="Reset bearing to north",t.setAttribute("aria-label","Reset bearing to north"),this._icon=document.createElement("span"),this._icon.className="maplibregl-ctrl-icon",this._icon.setAttribute("aria-hidden","true"),this._icon.style.backgroundImage=`url("data:image/svg+xml,${encodeURIComponent(ost)}")`,this._icon.style.backgroundSize="contain",this._icon.style.width="29px",this._icon.style.height="29px",this._icon.style.display="block",t.appendChild(this._icon),t.addEventListener("click",()=>this._map?.resetNorth()),this._container.appendChild(t),this._rotateHandler=()=>{this._icon&&this._map&&(this._icon.style.transform=`rotate(${-this._map.getBearing()}deg)`)},this._map.on("rotate",this._rotateHandler),this._rotateHandler(),this._container}onRemove(){this._map&&this._rotateHandler&&this._map.off("rotate",this._rotateHandler),this._container?.parentNode?.removeChild(this._container),this._map=void 0,this._container=void 0,this._icon=void 0}}const P3="maplibre-gl-components-terrain-dem",lst="https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png";class cst{_inner;_addSource(e){e.getSource(P3)||e.addSource(P3,{type:"raster-dem",tiles:[lst],tileSize:256,encoding:"terrarium"})}onAdd(e){return e.isStyleLoaded()?this._addSource(e):e.once("styledata",()=>this._addSource(e)),this._inner=new Dr.TerrainControl({source:P3}),this._inner.onAdd(e)}onRemove(){this._inner?.onRemove(),this._inner=void 0}}const hst={fullscreen:"Toggle fullscreen",globe:"Toggle globe projection",north:"Reset bearing to north",terrain:"Toggle terrain",search:"Search places",viewState:"View map state",inspect:"Inspect features",vectorDataset:"Add vector dataset",basemap:"Basemaps",cogLayer:"COG Layer",minimap:"Toggle minimap",measure:"Measure distances and areas",bookmark:"Bookmarks",print:"Export map",zarrLayer:"Zarr Layer",pmtilesLayer:"PMTiles Layer",stacLayer:"STAC Layer",stacSearch:"STAC Search",addVector:"Add vector layer",geoEditor:"Geo Editor",lidar:"LiDAR Layer",planetaryComputer:"Planetary Computer",gaussianSplat:"Gaussian Splat",streetView:"Street View",swipe:"Layer Swipe",usgsLidar:"USGS LiDAR"};class ust{_container;_gridEl;_options;_state;_children=[];_eventHandlers=new Map;_map;_handleZoom;_zoomVisible=!0;_floatingEntry=null;_floatingPanel=null;_clickInGrid=!1;_docCaptureHandler;_docBubbleHandler;constructor(e){this._options={...sst,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed,rows:this._options.rows,columns:this._options.columns},(e?.controls??this._options.controls??[]).forEach(s=>this._children.push({control:s,element:null,expandable:this._isExpandable(s),collapsedSnapshot:null,expandHandler:null,collapseHandler:null,_placeholder:null,_externalPanel:null,_externalPanelParent:null,_savedPositionMethods:null}));const n=e?.defaultControls??[];for(const s of n){const r=this._createDefaultControl(s);r&&this._children.push({control:r,element:null,expandable:this._isExpandable(r),collapsedSnapshot:null,expandHandler:null,collapseHandler:null,_placeholder:null,_externalPanel:null,_externalPanelParent:null,_savedPositionMethods:null,tooltip:hst[s]})}this._autoGrowRows()}_createDefaultControl(e){switch(e){case"fullscreen":return new Dr.FullscreenControl;case"globe":return new Dr.GlobeControl;case"north":return new ast;case"terrain":return new cst;case"search":return new YH({collapsed:!0});case"viewState":return new cQ({collapsed:!0,enableBBox:!0});case"inspect":return new lQ;case"vectorDataset":return new aQ;case"basemap":return new jH({collapsed:!0});case"cogLayer":return new k3({collapsed:!0,defaultUrl:"https://data.source.coop/giswqs/opengeos/nlcd_2021_land_cover_30m.tif",defaultColormap:"none",defaultRescaleMin:0,defaultRescaleMax:4e3});case"minimap":return new uQ({collapsed:!0,interactive:!0});case"measure":return new dQ({collapsed:!0});case"bookmark":return new fQ({collapsed:!0});case"print":return new pQ({collapsed:!0});case"zarrLayer":return new N3({collapsed:!0,defaultUrl:"https://carbonplan-maps.s3.us-west-2.amazonaws.com/v2/demo/4d/tavg-prec-month",defaultVariable:"climate",defaultColormap:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],defaultClim:[0,300],defaultSelector:{band:"prec",month:1},defaultOpacity:.8});case"pmtilesLayer":return new D3({collapsed:!0,defaultUrl:"https://pmtiles.io/protomaps(vector)ODbL_firenze.pmtiles",defaultOpacity:.8,defaultFillColor:"steelblue",defaultLineColor:"#333"});case"stacLayer":return new F3({collapsed:!0,defaultUrl:"https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_10SEG_20251229_0_L2A",defaultRescaleMin:0,defaultRescaleMax:255,defaultColormap:"none"});case"stacSearch":return new AQ({collapsed:!0,catalogs:[{name:"Element84 Earth Search",url:"https://earth-search.aws.element84.com/v1"},{name:"Microsoft Planetary Computer",url:"https://planetarycomputer.microsoft.com/api/stac/v1"}],maxItems:20,defaultRescaleMin:0,defaultRescaleMax:1e4,showFootprints:!0});case"addVector":return new O3({collapsed:!0,defaultUrl:"https://flatgeobuf.org/test/data/UScounties.fgb"});case"geoEditor":return new eR({collapsed:!0,columns:2});case"lidar":return new kC({collapsed:!0,maxHeight:500});case"planetaryComputer":return new qR({collapsed:!0,maxHeight:500});case"gaussianSplat":return new jB({collapsed:!0,maxHeight:500});case"streetView":return new TK({collapsed:!0,maxHeight:500});case"swipe":return new RK({collapsed:!0,maxHeight:500,active:!1,basemapStyle:this._options.basemapStyleUrl,excludeLayers:this._options.excludeLayers});case"usgsLidar":return new BP({collapsed:!0,maxHeight:500});default:return null}}onAdd(e){return this._map=e,this._container=this._createContainer(),this._handleZoom=()=>this._checkZoomVisibility(),this._map.on("zoom",this._handleZoom),this._checkZoomVisibility(),this._docCaptureHandler=t=>{const n=t.target,s=this._container?.contains(n),r=this._floatingPanel?.contains(n);this._clickInGrid=!!(s&&!r)},this._docBubbleHandler=()=>{this._clickInGrid=!1},document.addEventListener("click",this._docCaptureHandler,!0),document.addEventListener("click",this._docBubbleHandler,!1),this._render(),this._mountChildren(),this._container}onRemove(){this._docCaptureHandler&&(document.removeEventListener("click",this._docCaptureHandler,!0),this._docCaptureHandler=void 0),this._docBubbleHandler&&(document.removeEventListener("click",this._docBubbleHandler,!1),this._docBubbleHandler=void 0),this._map&&this._handleZoom&&(this._map.off("zoom",this._handleZoom),this._handleZoom=void 0),this._unmountChildren(),this._map=void 0,this._container?.parentNode?.removeChild(this._container),this._container=void 0,this._gridEl=void 0,this._children=[],this._eventHandlers.clear()}addControl(e){if(this._children.some(n=>n.control===e))return;const t={control:e,element:null,expandable:this._isExpandable(e),collapsedSnapshot:null,expandHandler:null,collapseHandler:null,_placeholder:null,_externalPanel:null,_externalPanelParent:null,_savedPositionMethods:null};this._children.push(t),this._autoGrowRows(),this._map&&this._gridEl&&(t.element=e.onAdd(this._map),t.expandable&&(t.collapsedSnapshot=t.element.cloneNode(!0),this._attachExpandListeners(t)),this._gridEl.appendChild(t.element)),this._emit("controladd",e)}removeControl(e){const t=this._children.findIndex(s=>s.control===e);if(t===-1)return;const n=this._children[t];this._floatingEntry===n&&this._clearFloating(),this._detachExpandListeners(n),n._placeholder?.parentNode&&n._placeholder.parentNode.removeChild(n._placeholder),n.element?.parentNode&&n.element.parentNode.removeChild(n.element),this._map&&e.onRemove(this._map),this._children.splice(t,1),this._emit("controlremove",e)}setRows(e){const t=Math.max(1,Math.min(12,Math.round(e)));this._state.rows!==t&&(this._state.rows=t,this._applyGridStyle(),this._emit("update"))}setColumns(e){const t=Math.max(1,Math.min(12,Math.round(e)));this._state.columns!==t&&(this._state.columns=t,this._applyGridStyle(),this._emit("update"))}getControls(){return this._children.map(e=>e.control)}getAdapters(){const e=[];for(const t of this._children){const n=t.control;n instanceof k3?e.push(new yQ(n)):n instanceof N3?e.push(new vQ(n)):n instanceof D3?e.push(new bQ(n)):n instanceof F3?e.push(new wQ(n)):n instanceof O3?e.push(new xQ(n)):n instanceof kC?e.push(new bj(n)):n instanceof qR?e.push(new wj(n)):n instanceof jB?e.push(new sX(n)):n instanceof BP?e.push(new PK(n)):n instanceof eR&&e.push(new mW(n))}return e}show(){this._state.visible||(this._state.visible=!0,this._updateDisplayState(),this._emit("show"))}hide(){this._state.visible&&(this._state.visible=!1,this._updateDisplayState(),this._emit("hide"))}expand(){this._state.collapsed&&(this._state.collapsed=!1,this._render(),this._emit("expand"))}collapse(){this._state.collapsed||(this._state.collapsed=!0,this._render(),this._emit("collapse"))}toggle(){this._state.collapsed?this.expand():this.collapse()}getState(){return{...this._state}}update(e){this._options={...this._options,...e},e.visible!==void 0&&(this._state.visible=e.visible),e.collapsed!==void 0&&(this._state.collapsed=e.collapsed),e.rows!==void 0&&(this._state.rows=Math.max(1,Math.min(12,e.rows))),e.columns!==void 0&&(this._state.columns=Math.max(1,Math.min(12,e.columns))),this._render(),this._emit("update")}on(e,t){this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t)}off(e,t){this._eventHandlers.get(e)?.delete(t)}_emit(e,t){const n=this._eventHandlers.get(e);if(n){const s={type:e,state:this.getState(),control:t};n.forEach(r=>r(s))}}_checkZoomVisibility(){if(!this._map)return;const e=this._map.getZoom(),{minzoom:t,maxzoom:n}=this._options,s=e>=t&&e<=n;s!==this._zoomVisible&&(this._zoomVisible=s,this._updateDisplayState())}_updateDisplayState(){if(!this._container)return;const e=this._state.visible&&this._zoomVisible;this._container.style.display=e?"block":"none"}_createContainer(){const e=document.createElement("div");return e.className=`maplibregl-ctrl maplibre-gl-control-grid${this._options.className?` ${this._options.className}`:""}`,this._state.visible&&this._zoomVisible||(e.style.display="none"),e.addEventListener("click",n=>n.stopPropagation()),e}_autoGrowRows(){const e=this._state.rows*this._state.columns;this._children.length>e&&(this._state.rows=Math.ceil(this._children.length/this._state.columns),this._applyGridStyle())}_applyGridStyle(){if(!this._gridEl)return;if(this._state.collapsed){this._gridEl.style.display="none";return}const e=this._options.gap;this._gridEl.style.display="grid",this._gridEl.style.gridTemplateColumns=`repeat(${this._state.columns}, auto)`,this._gridEl.style.gridTemplateRows=`repeat(${this._state.rows}, auto)`,this._gridEl.style.gap=`${e}px`,this._gridEl.style.width="100%",this._gridEl.style.justifyContent="center",this._gridEl.style.alignContent="center",this._gridEl.style.justifyItems="center",this._gridEl.style.alignItems="center"}_mountChildren(){!this._map||!this._gridEl||this._children.forEach(e=>{e.element||(e.element=e.control.onAdd(this._map),e.tooltip&&this._applyTooltip(e.element,e.tooltip),e.expandable&&!e.collapsedSnapshot&&(e.collapsedSnapshot=e.element.cloneNode(!0)),this._attachExpandListeners(e)),this._floatingEntry===e?this._mountAsFloating(e):e.element.parentNode!==this._gridEl&&this._gridEl.appendChild(e.element)})}_applyTooltip(e,t){const n=e.querySelector("button");n&&!n.title&&(n.title=t)}_unmountChildren(){this._clearFloating();const e=this._map;this._children.forEach(t=>{this._detachExpandListeners(t),t._placeholder?.parentNode&&t._placeholder.parentNode.removeChild(t._placeholder),t._placeholder=null,t.element?.parentNode&&t.element.parentNode.removeChild(t.element),e&&t.control.onRemove(e)}),this._children=this._children.map(t=>({control:t.control,element:null,expandable:t.expandable,collapsedSnapshot:null,expandHandler:null,collapseHandler:null,_placeholder:null,_externalPanel:null,_externalPanelParent:null,_savedPositionMethods:null}))}_isExpandable(e){const t=e;return typeof t.on=="function"&&typeof t.collapse=="function"}_attachExpandListeners(e){if(!e.expandable)return;const t=e.control;e.expandHandler=()=>this._onChildExpand(e),e.collapseHandler=()=>this._onChildCollapse(e),t.on("expand",e.expandHandler),t.on("collapse",e.collapseHandler)}_detachExpandListeners(e){if(!e.expandable)return;const t=e.control;e.expandHandler&&t.off("expand",e.expandHandler),e.collapseHandler&&t.off("collapse",e.collapseHandler),e.expandHandler=null,e.collapseHandler=null}_onChildExpand(e){if(this._floatingEntry&&this._floatingEntry!==e&&this._collapseFloatingChild(),!e.element||!this._gridEl)return;const t=e.collapsedSnapshot?e.collapsedSnapshot.cloneNode(!0):document.createElement("div");t.classList.add("maplibre-gl-control-grid-placeholder--active"),t.addEventListener("click",()=>{e.control.collapse(),this._floatingEntry===e&&this._onChildCollapse(e)}),e._placeholder=t,this._gridEl.replaceChild(t,e.element);const n=this._ensureFloatingPanel();n.appendChild(e.element),this._floatingEntry=e,this._relocateExternalPanel(e,n),this._hideFloatingButton(e)}_onChildCollapse(e){if(this._floatingEntry!==e)return;this._showFloatingButton(e),this._restoreExternalPanel(e),e._placeholder&&e.element&&this._gridEl&&(e._placeholder.parentNode===this._gridEl?this._gridEl.replaceChild(e.element,e._placeholder):this._gridEl.appendChild(e.element)),e._placeholder=null,this._floatingPanel&&(this._floatingPanel.style.display="none"),this._floatingEntry=null;const t=e.control;typeof t.collapse=="function"&&t.collapse(),e.element&&(e.collapsedSnapshot=e.element.cloneNode(!0))}_mountAsFloating(e){if(!this._gridEl||!e.element)return;const t=e.collapsedSnapshot?e.collapsedSnapshot.cloneNode(!0):document.createElement("div");t.classList.add("maplibre-gl-control-grid-placeholder--active"),t.addEventListener("click",()=>{e.control.collapse(),this._floatingEntry===e&&this._onChildCollapse(e)}),e._placeholder=t,this._gridEl.appendChild(t);const n=this._ensureFloatingPanel();n.appendChild(e.element),this._relocateExternalPanel(e,n),e._externalPanel&&(n.style.right="0px"),this._hideFloatingButton(e)}_ensureFloatingPanel(){this._floatingPanel||(this._floatingPanel=document.createElement("div"),this._floatingPanel.className="maplibre-gl-control-grid-floating-panel",this._floatingPanel.addEventListener("click",r=>r.stopPropagation())),this._container&&this._floatingPanel.parentNode!==this._container&&this._container.appendChild(this._floatingPanel);const e=this._state.collapsed&&(this._options.title||this._options.collapsible),t=Math.max(0,this._options.padding-1),n=Math.max(0,this._options.padding-10),s=e?t-n:t;return this._floatingPanel.style.right=`-${s}px`,this._floatingPanel.style.display="block",this._floatingPanel}_clearFloating(){this._floatingEntry&&(this._showFloatingButton(this._floatingEntry),this._restoreExternalPanel(this._floatingEntry),this._floatingEntry._placeholder=null),this._floatingEntry=null,this._floatingPanel&&(this._floatingPanel.remove(),this._floatingPanel=null)}_collapseFloatingChild(){this._floatingEntry&&this._onChildCollapse(this._floatingEntry)}_hideFloatingButton(e){if(e._externalPanel)return;const t=e.control;if(t._button&&(t._button.style.display="none",e.element)){const n=e.element.classList.contains("maplibregl-ctrl-group");n&&(e.element.classList.remove("maplibregl-ctrl-group"),e.element.dataset.hadCtrlGroup="1"),!n&&!e.element.dataset.hadCtrlGroup&&(e.element.style.marginRight="0")}}_showFloatingButton(e){const t=e.control;t._button&&(t._button.style.display="",e.element&&(e.element.dataset.hadCtrlGroup?(e.element.classList.add("maplibregl-ctrl-group"),delete e.element.dataset.hadCtrlGroup):e.element.style.marginRight=""))}_relocateExternalPanel(e,t){const n=e.control;let s=null;if(typeof n.getPanelElement=="function"?s=n.getPanelElement():n._panel instanceof HTMLElement?s=n._panel:n._panel&&typeof n._panel.getElement=="function"&&(s=n._panel.getElement()),!s||!e.element||e.element.contains(s)||e._externalPanel)return;e._externalPanelParent=s.parentNode,e._externalPanel=s,s.classList.add("maplibre-gl-control-grid-relocated");const r=["_updatePanelPosition","updatePanelPosition"];e._savedPositionMethods={};for(const l of r)typeof n[l]=="function"&&(e._savedPositionMethods[l]=n[l].bind(n),n[l]=()=>{});const o=n._panel;o&&typeof o.positionRelativeTo=="function"&&(e._savedPositionMethods["_panel.positionRelativeTo"]=o.positionRelativeTo.bind(o),o.positionRelativeTo=()=>{}),typeof n.collapse=="function"&&(e._savedPositionMethods.collapse=n.collapse.bind(n),n.collapse=()=>{this._floatingEntry===e&&!this._clickInGrid&&this._onChildCollapse(e)});const a=(l,h)=>s.style.setProperty(l,h,"important");a("position","static"),a("top","auto"),a("bottom","auto"),a("left","auto"),a("right","auto"),a("z-index","auto"),t.appendChild(s),t.style.right="0px",e.element&&(e.element.style.display="none")}_restoreExternalPanel(e){if(!e._externalPanel||!e._externalPanelParent)return;const t=e._externalPanel;t.classList.remove("maplibre-gl-control-grid-relocated");const n=["position","top","bottom","left","right","z-index"];for(const s of n)t.style.removeProperty(s);if(e._externalPanelParent.appendChild(t),e._externalPanel=null,e._externalPanelParent=null,e._savedPositionMethods){const s=e.control;for(const[r,o]of Object.entries(e._savedPositionMethods))if(r==="_panel.positionRelativeTo"){const a=s._panel;a&&(a.positionRelativeTo=o)}else s[r]=o;e._savedPositionMethods=null}e.element&&(e.element.style.display="")}_render(){if(!this._container)return;const{title:e,collapsible:t,backgroundColor:n,opacity:s,borderRadius:r,padding:o,showRowColumnControls:a}=this._options;this._container.innerHTML="",this._state.collapsed?this._container.classList.add("maplibre-gl-control-grid--collapsed"):this._container.classList.remove("maplibre-gl-control-grid--collapsed");const l=this._state.collapsed&&(e||t),h=l?0:o,u=l?0:o,d=l?0:Math.max(0,o-4),g=this._state.visible&&this._zoomVisible;if(Object.assign(this._container.style,{backgroundColor:n,opacity:String(s),borderRadius:`${r}px`,padding:`${h}px ${d}px ${h}px ${u}px`,boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.1)",display:g?"block":"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',color:"#1a1a1a"}),t||e){const v=document.createElement("div");if(v.className="maplibre-gl-control-grid-header",Object.assign(v.style,{display:"flex",alignItems:"center",justifyContent:this._state.collapsed?"center":"space-between",flexWrap:"wrap",gap:"6px",paddingBottom:(this._state.collapsed,"0"),cursor:t?"pointer":"default"}),this._state.collapsed&&t){const b=document.createElement("span");b.className="maplibre-gl-control-grid-wrench",b.innerHTML=rst,Object.assign(b.style,{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"29px",height:"29px",lineHeight:"0",boxSizing:"border-box"}),b.setAttribute("aria-label","Map tools"),v.appendChild(b),v.addEventListener("click",()=>this.toggle())}else{const b=document.createElement("div");if(b.style.display="flex",b.style.alignItems="center",b.style.gap="6px",e){const w=document.createElement("span");w.className="maplibre-gl-control-grid-title",w.textContent=e,w.style.fontWeight="600",w.style.color="#333",b.appendChild(w)}if(a&&!this._state.collapsed){const w=document.createElement("label");w.style.display="inline-flex",w.style.alignItems="center",w.style.gap="2px",w.style.fontSize="11px",w.style.color="#333",w.innerHTML="R:";const x=document.createElement("input");x.type="number",x.min="1",x.max="12",x.value=String(this._state.rows),x.style.width="40px",x.style.padding="2px 2px",x.style.boxSizing="border-box",x.style.textAlign="center",x.style.color="#333",x.addEventListener("change",()=>this.setRows(Number(x.value)||1)),w.appendChild(x);const I=document.createElement("label");I.style.display="inline-flex",I.style.alignItems="center",I.style.gap="2px",I.style.fontSize="11px",I.style.color="#333",I.innerHTML="C:";const T=document.createElement("input");T.type="number",T.min="1",T.max="12",T.value=String(this._state.columns),T.style.width="40px",T.style.padding="2px 2px",T.style.boxSizing="border-box",T.style.textAlign="center",T.style.color="#333",T.addEventListener("change",()=>this.setColumns(Number(T.value)||1)),I.appendChild(T),b.appendChild(w),b.appendChild(I)}if(v.appendChild(b),t){const w=document.createElement("span");w.className="maplibre-gl-control-grid-toggle",w.innerHTML="▼",Object.assign(w.style,{fontSize:"10px",userSelect:"none",color:"#333"}),v.appendChild(w),v.addEventListener("click",x=>{(!a||!b.contains(x.target))&&this.toggle()})}}this._container.appendChild(v)}const m=document.createElement("div");m.className="maplibre-gl-control-grid-content",Object.assign(m.style,{display:this._state.collapsed?"none":"block"}),this._gridEl=m,this._applyGridStyle(),this._container.appendChild(m),this._mountChildren()}}exports.ADVANCED_EXTENSIONS=JH;exports.ALL_EXTENSIONS=KH;exports.ARRAY_TYPE=cf;exports.AddVectorAdapter=xQ;exports.AddVectorControl=O3;exports.BasemapControl=jH;exports.BookmarkControl=fQ;exports.COLORMAPS=wv;exports.COORDINATE_SYSTEM=Ni;exports.CSV_EXTENSIONS=GP;exports.CogLayerAdapter=yQ;exports.CogLayerControl=k3;exports.Colorbar=Zue;exports.CompositeLayer=wS;exports.ControlGrid=ust;exports.DUCKDB_EXTENSIONS=ZH;exports.DXF_EXTENSIONS=QP;exports.EPSILON=qy;exports.FLATGEOBUF_EXTENSIONS=zP;exports.GEOJSON_EXTENSIONS=dS;exports.GEOPACKAGE_EXTENSIONS=NP;exports.GEOPARQUET_EXTENSIONS=DP;exports.GML_EXTENSIONS=$P;exports.GOOGLE_BASEMAPS=qH;exports.GPX_EXTENSIONS=UP;exports.GaussianSplatControl=jB;exports.GaussianSplatLayerAdapter=sX;exports.GeoEditor=eR;exports.GeoEditorLayerAdapter=mW;exports.GeoJsonLayer=IS;exports.Geometry=uf;exports.GlobeViewport=bS;exports.HtmlControl=tde;exports.InspectControl=lQ;exports.KML_EXTENSIONS=FP;exports.KMZ_EXTENSIONS=OP;exports.Layer=Fh;exports.Legend=Kue;exports.LidarControl=kC;exports.LidarLayerAdapter=bj;exports.MapboxOverlay=G7;exports.MathArray=BL;exports.Matrix=N9;exports.Matrix4=Jl;exports.MeasureControl=dQ;exports.MinimapControl=uQ;exports.Model=Al;exports.PHONG_FS=z9;exports.PHONG_VS=U9;exports.PHONG_WGSL=$9;exports.PMTilesLayerAdapter=bQ;exports.PMTilesLayerControl=D3;exports.PathLayer=CS;exports.PlanetaryComputerControl=qR;exports.PlanetaryComputerLayerAdapter=wj;exports.PrintControl=pQ;exports.RdBu=RH;exports.RdYlBu=BH;exports.RdYlGn=PH;exports.SHAPEFILE_EXTENSIONS=kP;exports.SHPJS_EXTENSIONS=XH;exports.SearchControl=YH;exports.SolidPolygonLayer=SS;exports.StacLayerAdapter=wQ;exports.StacLayerControl=F3;exports.StacSearchControl=AQ;exports.Stats=bb;exports.StreetViewControl=TK;exports.SwipeControl=RK;exports.TOPOJSON_EXTENSIONS=VP;exports.TerrainControl=ode;exports.Texture=Vl;exports.UsgsLidarControl=BP;exports.UsgsLidarLayerAdapter=PK;exports.Vector=E9;exports.Vector3=Wu;exports.VectorDatasetControl=aQ;exports.ViewStateControl=cQ;exports.WebMercatorViewport=hf;exports.XLSX_EXTENSIONS=HP;exports.XYZSERVICES_URL=PP;exports.ZarrLayerAdapter=vQ;exports.ZarrLayerControl=N3;exports.add=Uve;exports.assert=uR;exports.assert$1=fr;exports.bone=VH;exports.buildTileUrl=zE;exports.bwr=MH;exports.checkNumber=La;exports.checkVector=oE;exports.cividis=SH;exports.clamp=Hue;exports.classNames=que;exports.config=_l;exports.cool=zH;exports.coolwarm=IH;exports.create=I9;exports.createIterable=Sb;exports.cross=T9;exports.debounce=Que;exports.defaultLogger=Ei;exports.detectFormat=eQ;exports.dot=Gve;exports.dot$1=M9;exports.equals=W_;exports.fetchProviders=Yue;exports.filterBasemaps=WH;exports.flatten=Rh;exports.formatNumericValue=HH;exports.fromValues=gve;exports.generateId=$u;exports.generateThumbnailUrl=jue;exports.getAcceptedExtensions=qP;exports.getColormap=Pu;exports.getColormapNames=Gue;exports.getDefaultExportFromCjs=tq;exports.getFileExtension=WP;exports.getFormatDescription=cde;exports.getFormatDisplayName=rQ;exports.getScaling=Rve;exports.gray=$H;exports.groupBasemaps=QH;exports.hot=UH;exports.inferno=EH;exports.isArray=Zp;exports.isValidColormap=GH;exports.isValidExtension=sQ;exports.jet=kH;exports.len=L9;exports.length=zve;exports.lerp=Hve;exports.lighting=jy;exports.lngLatToWorld=j_;exports.magma=CH;exports.normalize=yve;exports.normalize$1=Vve;exports.normalize$2=nq;exports.ocean=OH;exports.parseProviders=LP;exports.picking=ug;exports.plasma=wH;exports.project32=hg;exports.rainbow=NH;exports.readFileAsBuffer=iQ;exports.replaceInRange=sq;exports.requiresConversion=nQ;exports.requiresDuckDB=tQ;exports.scale=kL;exports.seismic=TH;exports.spectral=LH;exports.squaredLength=$ve;exports.terrain=FH;exports.throttle=Wue;exports.transformMat3=R9;exports.transformMat3$1=lve;exports.transformMat4=PL;exports.transformQuat=B9;exports.transformQuat$1=Qve;exports.turbo=DH;exports.vec4_transformMat2=dve;exports.vec4_transformMat3=fve;exports.viridis=xH;exports.worldToLngLat=Jp;
|
|
19609
|
+
`,t.addEventListener("click",()=>this.toggle()),e.appendChild(t),e}_createPanel(){const e=document.createElement("div");e.className="usgs-lidar-control-panel",e.style.width=`${this._options.panelWidth}px`,e.style.maxHeight=`${this._options.maxHeight}px`;const t=document.createElement("div");t.className="usgs-lidar-control-header";const n=document.createElement("span");n.className="usgs-lidar-control-title",n.textContent=this._options.title;const s=document.createElement("button");s.className="usgs-lidar-control-close",s.type="button",s.setAttribute("aria-label","Close panel"),s.innerHTML="×",s.addEventListener("click",()=>this.collapse()),t.appendChild(n),t.appendChild(s),this._panelBuilder=new est({onSearchByExtent:()=>this.searchByExtent(),onStartDrawing:()=>this.startDrawing(),onStopDrawing:()=>this.stopDrawing(),onSearchByDrawn:()=>{this._state.drawnBbox&&this.searchByBbox(this._state.drawnBbox)},onClearDrawn:()=>this.clearDrawnBbox(),onItemSelect:o=>this.toggleItemSelection(o),onItemLoad:o=>{this.loadItem(o).catch(()=>{})},onLoadSelected:()=>{this.loadSelectedItems().catch(()=>{})},onCopySignedUrls:()=>{this.copySignedUrls().catch(o=>{console.error("Failed to copy signed URLs:",o)})},onDownloadSelected:()=>{this.downloadSelected().catch(o=>{console.error("Failed to download selected:",o)})},onClearResults:()=>this.clearResults(),onUnloadItem:o=>this.unloadItem(o),onClearLoaded:()=>this.clearLoadedItems(),onPointSizeChange:o=>this.setPointSize(o),onOpacityChange:o=>this.setOpacity(o),onColorSchemeChange:o=>this.setColorScheme(o),onZOffsetChange:o=>this.setZOffset(o),onPickableChange:o=>this.setPickable(o),onElevationRangeChange:o=>this.setElevationRange(o),onClassificationToggle:(o,a)=>this.setClassificationVisibility(o,a),onClassificationShowAll:()=>this.showAllClassifications(),onClassificationHideAll:()=>this.hideAllClassifications(),onDataSourceChange:o=>this.setDataSource(o),onColormapChange:o=>this.setColormap(o),onColorRangeChange:o=>this.setColorRange(o),onShowMetadata:o=>this.showMetadata(o),onCrossSectionPanel:()=>this.getCrossSectionPanel()},this._state);const r=this._panelBuilder.build();return e.appendChild(t),e.appendChild(r),e}_setupEventListeners(){var e;const t=n=>{var s,r,o,a,l;const h=n.target;if((s=this._container)!=null&&s.contains(h)||(r=this._panel)!=null&&r.contains(h)||(a=(o=this._mapContainer)==null?void 0:o.querySelector(".maplibregl-canvas"))!=null&&a.contains(h))return;const u=document.querySelector(".lidar-metadata-backdrop, .lidar-chart-popup-backdrop");u?.contains(h)||(l=h.closest)!=null&&l.call(h,".lidar-metadata-backdrop, .lidar-metadata-panel, .lidar-chart-popup-backdrop, .lidar-chart-popup")||this._state.collapsed||this.collapse()};document.addEventListener("click",t,!0),window.addEventListener("resize",()=>{this._state.collapsed||this._updatePanelPosition()}),(e=this._map)==null||e.on("resize",()=>{this._state.collapsed||this._updatePanelPosition()})}_getControlPosition(){var e;const t=(e=this._container)==null?void 0:e.parentElement;return t?t.classList.contains("maplibregl-ctrl-top-left")?"top-left":t.classList.contains("maplibregl-ctrl-top-right")?"top-right":t.classList.contains("maplibregl-ctrl-bottom-left")?"bottom-left":t.classList.contains("maplibregl-ctrl-bottom-right")?"bottom-right":"top-right":"top-right"}_updatePanelPosition(){if(!this._container||!this._panel||!this._mapContainer)return;const e=this._container.querySelector(".usgs-lidar-control-toggle");if(!e)return;const t=e.getBoundingClientRect(),n=this._mapContainer.getBoundingClientRect(),s=this._getControlPosition(),r=t.top-n.top,o=n.bottom-t.bottom,a=t.left-n.left,l=n.right-t.right,h=5;switch(this._panel.style.top="",this._panel.style.bottom="",this._panel.style.left="",this._panel.style.right="",s){case"top-left":this._panel.style.top=`${r+t.height+h}px`,this._panel.style.left=`${a}px`;break;case"top-right":this._panel.style.top=`${r+t.height+h}px`,this._panel.style.right=`${l}px`;break;case"bottom-left":this._panel.style.bottom=`${o+t.height+h}px`,this._panel.style.left=`${a}px`;break;case"bottom-right":this._panel.style.bottom=`${o+t.height+h}px`,this._panel.style.right=`${l}px`;break}}getPanelElement(){return this._panel??null}}var nst=Object.defineProperty,ist=(i,e,t)=>e in i?nst(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,qw=(i,e,t)=>ist(i,typeof e!="symbol"?e+"":e,t);class PK{constructor(e){qw(this,"type","usgs-lidar"),qw(this,"_usgsControl"),qw(this,"_changeCallbacks",[]),qw(this,"_unsubscribe"),this._usgsControl=e,this._setupEventListeners()}_setupEventListeners(){const e=n=>{var s;if((s=n.pointCloud)!=null&&s.id){const r=this._usgsControl.getState();for(const[o,a]of r.loadedItems.entries())if(a.id===n.pointCloud.id){this._notifyLayerAdded(o);break}}},t=n=>{n.itemId&&this._notifyLayerRemoved(n.itemId)};this._usgsControl.on("loadcomplete",e),this._usgsControl.on("unload",t),this._unsubscribe=()=>{this._usgsControl.off("loadcomplete",e),this._usgsControl.off("unload",t)}}getLayerIds(){const e=this._usgsControl.getState();return Array.from(e.loadedItems.keys())}getLayerState(e){var t;const n=this._usgsControl.getState(),s=n.loadedItems.get(e);if(!s)return null;const r=this._usgsControl.getLidarControl(),o=r?._pointCloudManager,a=o?.getPointCloudVisibility(s.id)??!0,l=o?.getPointCloudOpacity(s.id)??((t=n.lidarState)==null?void 0:t.opacity)??1;return{visible:a,opacity:l,name:this.getName(e),isCustomLayer:!0,customLayerType:"usgs-lidar"}}setVisibility(e,t){const s=this._usgsControl.getState().loadedItems.get(e);if(!s)return;const r=this._usgsControl.getLidarControl(),o=r?._pointCloudManager;o?.setPointCloudVisibility(s.id,t)}setOpacity(e,t){const s=this._usgsControl.getState().loadedItems.get(e);if(!s)return;const r=this._usgsControl.getLidarControl(),o=r?._pointCloudManager;o?.setPointCloudOpacity(s.id,t)}getName(e){const n=this._usgsControl.getState().loadedItems.get(e);return n?n.name:e.replace(/[-_]/g," ").replace(/\b\w/g,s=>s.toUpperCase())}getSymbolType(e){return"circle"}onLayerChange(e){return this._changeCallbacks.push(e),()=>{const t=this._changeCallbacks.indexOf(e);t>=0&&this._changeCallbacks.splice(t,1)}}_notifyLayerAdded(e){this._changeCallbacks.forEach(t=>t("add",e))}_notifyLayerRemoved(e){this._changeCallbacks.forEach(t=>t("remove",e))}destroy(){var e;(e=this._unsubscribe)==null||e.call(this),this._changeCallbacks=[]}}const sst={title:"",position:"top-right",className:"",visible:!0,collapsible:!0,collapsed:!0,rows:1,columns:3,showRowColumnControls:!0,controls:[],backgroundColor:"rgba(255, 255, 255, 0.9)",padding:10,borderRadius:4,opacity:1,gap:6,minzoom:0,maxzoom:24,basemapStyleUrl:void 0,excludeLayers:void 0},rst='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',ost='<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29"><path d="m10.5 14 4-8 4 8z" fill="#333"/><path d="m10.5 16 4 8 4-8z" fill="#ccc"/></svg>';class ast{_map;_container;_icon;_rotateHandler;onAdd(e){this._map=e,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group";const t=document.createElement("button");return t.className="maplibregl-ctrl-compass",t.type="button",t.title="Reset bearing to north",t.setAttribute("aria-label","Reset bearing to north"),this._icon=document.createElement("span"),this._icon.className="maplibregl-ctrl-icon",this._icon.setAttribute("aria-hidden","true"),this._icon.style.backgroundImage=`url("data:image/svg+xml,${encodeURIComponent(ost)}")`,this._icon.style.backgroundSize="contain",this._icon.style.width="29px",this._icon.style.height="29px",this._icon.style.display="block",t.appendChild(this._icon),t.addEventListener("click",()=>this._map?.resetNorth()),this._container.appendChild(t),this._rotateHandler=()=>{this._icon&&this._map&&(this._icon.style.transform=`rotate(${-this._map.getBearing()}deg)`)},this._map.on("rotate",this._rotateHandler),this._rotateHandler(),this._container}onRemove(){this._map&&this._rotateHandler&&this._map.off("rotate",this._rotateHandler),this._container?.parentNode?.removeChild(this._container),this._map=void 0,this._container=void 0,this._icon=void 0}}const P3="maplibre-gl-components-terrain-dem",lst="https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png";class cst{_inner;_addSource(e){e.getSource(P3)||e.addSource(P3,{type:"raster-dem",tiles:[lst],tileSize:256,encoding:"terrarium"})}onAdd(e){return e.isStyleLoaded()?this._addSource(e):e.once("styledata",()=>this._addSource(e)),this._inner=new Dr.TerrainControl({source:P3}),this._inner.onAdd(e)}onRemove(){this._inner?.onRemove(),this._inner=void 0}}const hst={fullscreen:"Toggle fullscreen",globe:"Toggle globe projection",north:"Reset bearing to north",terrain:"Toggle terrain",search:"Search places",viewState:"View map state",inspect:"Inspect features",vectorDataset:"Add vector dataset",basemap:"Basemaps",cogLayer:"COG Layer",minimap:"Toggle minimap",measure:"Measure distances and areas",bookmark:"Bookmarks",print:"Export map",zarrLayer:"Zarr Layer",pmtilesLayer:"PMTiles Layer",stacLayer:"STAC Layer",stacSearch:"STAC Search",addVector:"Add vector layer",geoEditor:"Geo Editor",lidar:"LiDAR Layer",planetaryComputer:"Planetary Computer",gaussianSplat:"Gaussian Splat",streetView:"Street View",swipe:"Layer Swipe",usgsLidar:"USGS LiDAR"};class ust{_container;_gridEl;_options;_state;_children=[];_eventHandlers=new Map;_map;_handleZoom;_zoomVisible=!0;_floatingEntry=null;_floatingPanel=null;_clickInGrid=!1;_docCaptureHandler;_docBubbleHandler;constructor(e){this._options={...sst,...e},this._state={visible:this._options.visible,collapsed:this._options.collapsed,rows:this._options.rows,columns:this._options.columns},(e?.controls??this._options.controls??[]).forEach(s=>this._children.push({control:s,element:null,expandable:this._isExpandable(s),collapsedSnapshot:null,expandHandler:null,collapseHandler:null,_placeholder:null,_externalPanel:null,_externalPanelParent:null,_savedPositionMethods:null}));const n=e?.defaultControls??[];for(const s of n){const r=this._createDefaultControl(s);r&&this._children.push({control:r,element:null,expandable:this._isExpandable(r),collapsedSnapshot:null,expandHandler:null,collapseHandler:null,_placeholder:null,_externalPanel:null,_externalPanelParent:null,_savedPositionMethods:null,tooltip:hst[s]})}this._autoGrowRows()}_createDefaultControl(e){switch(e){case"fullscreen":return new Dr.FullscreenControl;case"globe":return new Dr.GlobeControl;case"north":return new ast;case"terrain":return new cst;case"search":return new YH({collapsed:!0});case"viewState":return new cQ({collapsed:!0,enableBBox:!0});case"inspect":return new lQ;case"vectorDataset":return new aQ;case"basemap":return new jH({collapsed:!0});case"cogLayer":return new k3({collapsed:!0,defaultUrl:"https://data.source.coop/giswqs/opengeos/nlcd_2021_land_cover_30m.tif",defaultColormap:"none",defaultRescaleMin:0,defaultRescaleMax:4e3});case"minimap":return new uQ({collapsed:!0,interactive:!0});case"measure":return new dQ({collapsed:!0});case"bookmark":return new fQ({collapsed:!0});case"print":return new pQ({collapsed:!0});case"zarrLayer":return new N3({collapsed:!0,defaultUrl:"https://carbonplan-maps.s3.us-west-2.amazonaws.com/v2/demo/4d/tavg-prec-month",defaultVariable:"climate",defaultColormap:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],defaultClim:[0,300],defaultSelector:{band:"prec",month:1},defaultOpacity:.8});case"pmtilesLayer":return new D3({collapsed:!0,defaultUrl:"https://pmtiles.io/protomaps(vector)ODbL_firenze.pmtiles",defaultOpacity:.8,defaultFillColor:"steelblue",defaultLineColor:"#333"});case"stacLayer":return new F3({collapsed:!0,defaultUrl:"https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_10SEG_20251229_0_L2A",defaultRescaleMin:0,defaultRescaleMax:255,defaultColormap:"none"});case"stacSearch":return new AQ({collapsed:!0,catalogs:[{name:"Element84 Earth Search",url:"https://earth-search.aws.element84.com/v1"},{name:"Microsoft Planetary Computer",url:"https://planetarycomputer.microsoft.com/api/stac/v1"}],maxItems:20,defaultRescaleMin:0,defaultRescaleMax:1e4,showFootprints:!0});case"addVector":return new O3({collapsed:!0,defaultUrl:"https://flatgeobuf.org/test/data/UScounties.fgb"});case"geoEditor":return new eR({collapsed:!0,columns:2});case"lidar":return new kC({collapsed:!0,maxHeight:500});case"planetaryComputer":return new qR({collapsed:!0,maxHeight:500});case"gaussianSplat":return new jB({collapsed:!0,maxHeight:500});case"streetView":return new TK({collapsed:!0,maxHeight:500});case"swipe":return new RK({collapsed:!0,maxHeight:500,active:!1,basemapStyle:this._options.basemapStyleUrl,excludeLayers:this._options.excludeLayers});case"usgsLidar":return new BP({collapsed:!0,maxHeight:500});default:return null}}onAdd(e){return this._map=e,this._container=this._createContainer(),this._handleZoom=()=>this._checkZoomVisibility(),this._map.on("zoom",this._handleZoom),this._checkZoomVisibility(),this._docCaptureHandler=t=>{const n=t.target,s=this._container?.contains(n),r=this._floatingPanel?.contains(n);this._clickInGrid=!!(s&&!r)},this._docBubbleHandler=()=>{this._clickInGrid=!1},document.addEventListener("click",this._docCaptureHandler,!0),document.addEventListener("click",this._docBubbleHandler,!1),this._render(),this._mountChildren(),this._container}onRemove(){this._docCaptureHandler&&(document.removeEventListener("click",this._docCaptureHandler,!0),this._docCaptureHandler=void 0),this._docBubbleHandler&&(document.removeEventListener("click",this._docBubbleHandler,!1),this._docBubbleHandler=void 0),this._map&&this._handleZoom&&(this._map.off("zoom",this._handleZoom),this._handleZoom=void 0),this._unmountChildren(),this._map=void 0,this._container?.parentNode?.removeChild(this._container),this._container=void 0,this._gridEl=void 0,this._children=[],this._eventHandlers.clear()}addControl(e){if(this._children.some(n=>n.control===e))return;const t={control:e,element:null,expandable:this._isExpandable(e),collapsedSnapshot:null,expandHandler:null,collapseHandler:null,_placeholder:null,_externalPanel:null,_externalPanelParent:null,_savedPositionMethods:null};this._children.push(t),this._autoGrowRows(),this._map&&this._gridEl&&(t.element=e.onAdd(this._map),t.expandable&&(t.collapsedSnapshot=t.element.cloneNode(!0),this._attachExpandListeners(t)),this._gridEl.appendChild(t.element)),this._emit("controladd",e)}removeControl(e){const t=this._children.findIndex(s=>s.control===e);if(t===-1)return;const n=this._children[t];this._floatingEntry===n&&this._clearFloating(),this._detachExpandListeners(n),n._placeholder?.parentNode&&n._placeholder.parentNode.removeChild(n._placeholder),n.element?.parentNode&&n.element.parentNode.removeChild(n.element),this._map&&e.onRemove(this._map),this._children.splice(t,1),this._emit("controlremove",e)}setRows(e){const t=Math.max(1,Math.min(12,Math.round(e)));this._state.rows!==t&&(this._state.rows=t,this._applyGridStyle(),this._emit("update"))}setColumns(e){const t=Math.max(1,Math.min(12,Math.round(e)));this._state.columns!==t&&(this._state.columns=t,this._applyGridStyle(),this._emit("update"))}getControls(){return this._children.map(e=>e.control)}getAdapters(){const e=[];for(const t of this._children){const n=t.control;n instanceof k3?e.push(new yQ(n)):n instanceof N3?e.push(new vQ(n)):n instanceof D3?e.push(new bQ(n)):n instanceof F3?e.push(new wQ(n)):n instanceof O3?e.push(new xQ(n)):n instanceof kC?e.push(new bj(n)):n instanceof qR?e.push(new wj(n)):n instanceof jB?e.push(new sX(n)):n instanceof BP?e.push(new PK(n)):n instanceof eR&&e.push(new mW(n))}return e}show(){this._state.visible||(this._state.visible=!0,this._updateDisplayState(),this._emit("show"))}hide(){this._state.visible&&(this._state.visible=!1,this._updateDisplayState(),this._emit("hide"))}expand(){this._state.collapsed&&(this._state.collapsed=!1,this._render(),this._emit("expand"))}collapse(){this._state.collapsed||(this._state.collapsed=!0,this._render(),this._emit("collapse"))}toggle(){this._state.collapsed?this.expand():this.collapse()}getState(){return{...this._state}}update(e){this._options={...this._options,...e},e.visible!==void 0&&(this._state.visible=e.visible),e.collapsed!==void 0&&(this._state.collapsed=e.collapsed),e.rows!==void 0&&(this._state.rows=Math.max(1,Math.min(12,e.rows))),e.columns!==void 0&&(this._state.columns=Math.max(1,Math.min(12,e.columns))),this._render(),this._emit("update")}on(e,t){this._eventHandlers.has(e)||this._eventHandlers.set(e,new Set),this._eventHandlers.get(e).add(t)}off(e,t){this._eventHandlers.get(e)?.delete(t)}_emit(e,t){const n=this._eventHandlers.get(e);if(n){const s={type:e,state:this.getState(),control:t};n.forEach(r=>r(s))}}_checkZoomVisibility(){if(!this._map)return;const e=this._map.getZoom(),{minzoom:t,maxzoom:n}=this._options,s=e>=t&&e<=n;s!==this._zoomVisible&&(this._zoomVisible=s,this._updateDisplayState())}_updateDisplayState(){if(!this._container)return;const e=this._state.visible&&this._zoomVisible;this._container.style.display=e?"block":"none"}_createContainer(){const e=document.createElement("div");return e.className=`maplibregl-ctrl maplibre-gl-control-grid${this._options.className?` ${this._options.className}`:""}`,this._state.visible&&this._zoomVisible||(e.style.display="none"),e.addEventListener("click",n=>n.stopPropagation()),e}_autoGrowRows(){const e=this._state.rows*this._state.columns;this._children.length>e&&(this._state.rows=Math.ceil(this._children.length/this._state.columns),this._applyGridStyle())}_applyGridStyle(){if(!this._gridEl)return;if(this._state.collapsed){this._gridEl.style.display="none";return}const e=this._options.gap;this._gridEl.style.display="grid",this._gridEl.style.gridTemplateColumns=`repeat(${this._state.columns}, auto)`,this._gridEl.style.gridTemplateRows=`repeat(${this._state.rows}, auto)`,this._gridEl.style.gap=`${e}px`,this._gridEl.style.width="100%",this._gridEl.style.justifyContent="center",this._gridEl.style.alignContent="center",this._gridEl.style.justifyItems="center",this._gridEl.style.alignItems="center"}_mountChildren(){!this._map||!this._gridEl||this._children.forEach(e=>{e.element||(e.element=e.control.onAdd(this._map),e.tooltip&&this._applyTooltip(e.element,e.tooltip),e.expandable&&!e.collapsedSnapshot&&(e.collapsedSnapshot=e.element.cloneNode(!0)),this._attachExpandListeners(e)),this._floatingEntry===e?this._mountAsFloating(e):e.element.parentNode!==this._gridEl&&this._gridEl.appendChild(e.element)})}_applyTooltip(e,t){const n=e.querySelector("button");n&&!n.title&&(n.title=t)}_unmountChildren(){this._clearFloating();const e=this._map;this._children.forEach(t=>{this._detachExpandListeners(t),t._placeholder?.parentNode&&t._placeholder.parentNode.removeChild(t._placeholder),t._placeholder=null,t.element?.parentNode&&t.element.parentNode.removeChild(t.element),e&&t.control.onRemove(e)}),this._children=this._children.map(t=>({control:t.control,element:null,expandable:t.expandable,collapsedSnapshot:null,expandHandler:null,collapseHandler:null,_placeholder:null,_externalPanel:null,_externalPanelParent:null,_savedPositionMethods:null}))}_isExpandable(e){const t=e;return typeof t.on=="function"&&typeof t.collapse=="function"}_attachExpandListeners(e){if(!e.expandable)return;const t=e.control;e.expandHandler=()=>this._onChildExpand(e),e.collapseHandler=()=>this._onChildCollapse(e),t.on("expand",e.expandHandler),t.on("collapse",e.collapseHandler)}_detachExpandListeners(e){if(!e.expandable)return;const t=e.control;e.expandHandler&&t.off("expand",e.expandHandler),e.collapseHandler&&t.off("collapse",e.collapseHandler),e.expandHandler=null,e.collapseHandler=null}_onChildExpand(e){if(this._floatingEntry&&this._floatingEntry!==e&&this._collapseFloatingChild(),!e.element||!this._gridEl)return;const t=e.collapsedSnapshot?e.collapsedSnapshot.cloneNode(!0):document.createElement("div");t.classList.add("maplibre-gl-control-grid-placeholder--active"),t.addEventListener("click",()=>{e.control.collapse(),this._floatingEntry===e&&this._onChildCollapse(e)}),e._placeholder=t,this._gridEl.replaceChild(t,e.element);const n=this._ensureFloatingPanel();n.appendChild(e.element),this._floatingEntry=e,this._relocateExternalPanel(e,n),this._hideFloatingButton(e)}_onChildCollapse(e){if(this._floatingEntry!==e)return;this._showFloatingButton(e),this._restoreExternalPanel(e),e._placeholder&&e.element&&this._gridEl&&(e._placeholder.parentNode===this._gridEl?this._gridEl.replaceChild(e.element,e._placeholder):this._gridEl.appendChild(e.element)),e._placeholder=null,this._floatingPanel&&(this._floatingPanel.style.display="none"),this._floatingEntry=null;const t=e.control;typeof t.collapse=="function"&&t.collapse(),e.element&&(e.collapsedSnapshot=e.element.cloneNode(!0))}_mountAsFloating(e){if(!this._gridEl||!e.element)return;const t=e.collapsedSnapshot?e.collapsedSnapshot.cloneNode(!0):document.createElement("div");t.classList.add("maplibre-gl-control-grid-placeholder--active"),t.addEventListener("click",()=>{e.control.collapse(),this._floatingEntry===e&&this._onChildCollapse(e)}),e._placeholder=t,this._gridEl.appendChild(t);const n=this._ensureFloatingPanel();n.appendChild(e.element),this._relocateExternalPanel(e,n),e._externalPanel&&(n.style.right="0px"),this._hideFloatingButton(e)}_ensureFloatingPanel(){this._floatingPanel||(this._floatingPanel=document.createElement("div"),this._floatingPanel.className="maplibre-gl-control-grid-floating-panel",this._floatingPanel.addEventListener("click",r=>r.stopPropagation())),this._container&&this._floatingPanel.parentNode!==this._container&&this._container.appendChild(this._floatingPanel);const e=this._state.collapsed&&(this._options.title||this._options.collapsible),t=Math.max(0,this._options.padding-1),n=Math.max(0,this._options.padding-10),s=e?t-n:t;return this._floatingPanel.style.right=`-${s}px`,this._floatingPanel.style.display="block",this._floatingPanel}_clearFloating(){this._floatingEntry&&(this._showFloatingButton(this._floatingEntry),this._restoreExternalPanel(this._floatingEntry),this._floatingEntry._placeholder=null),this._floatingEntry=null,this._floatingPanel&&(this._floatingPanel.remove(),this._floatingPanel=null)}_collapseFloatingChild(){this._floatingEntry&&this._onChildCollapse(this._floatingEntry)}_hideFloatingButton(e){if(e._externalPanel)return;const t=e.control;if(t._button&&(t._button.style.display="none",e.element)){const n=e.element.classList.contains("maplibregl-ctrl-group");n&&(e.element.classList.remove("maplibregl-ctrl-group"),e.element.dataset.hadCtrlGroup="1"),!n&&!e.element.dataset.hadCtrlGroup&&(e.element.style.marginRight="0")}}_showFloatingButton(e){const t=e.control;t._button&&(t._button.style.display="",e.element&&(e.element.dataset.hadCtrlGroup?(e.element.classList.add("maplibregl-ctrl-group"),delete e.element.dataset.hadCtrlGroup):e.element.style.marginRight=""))}_relocateExternalPanel(e,t){const n=e.control;let s=null;if(typeof n.getPanelElement=="function"?s=n.getPanelElement():n._panel instanceof HTMLElement?s=n._panel:n._panel&&typeof n._panel.getElement=="function"&&(s=n._panel.getElement()),!s||!e.element||e.element.contains(s)||e._externalPanel)return;e._externalPanelParent=s.parentNode,e._externalPanel=s,s.classList.add("maplibre-gl-control-grid-relocated");const r=["_updatePanelPosition","updatePanelPosition"];e._savedPositionMethods={};for(const l of r)typeof n[l]=="function"&&(e._savedPositionMethods[l]=n[l].bind(n),n[l]=()=>{});const o=n._panel;o&&typeof o.positionRelativeTo=="function"&&(e._savedPositionMethods["_panel.positionRelativeTo"]=o.positionRelativeTo.bind(o),o.positionRelativeTo=()=>{}),typeof n.collapse=="function"&&(e._savedPositionMethods.collapse=n.collapse.bind(n),n.collapse=()=>{this._floatingEntry===e&&!this._clickInGrid&&this._onChildCollapse(e)});const a=(l,h)=>s.style.setProperty(l,h,"important");a("position","static"),a("top","auto"),a("bottom","auto"),a("left","auto"),a("right","auto"),a("z-index","auto"),t.appendChild(s),t.style.right="0px",e.element&&(e.element.style.display="none")}_restoreExternalPanel(e){if(!e._externalPanel||!e._externalPanelParent)return;const t=e._externalPanel;t.classList.remove("maplibre-gl-control-grid-relocated");const n=["position","top","bottom","left","right","z-index"];for(const s of n)t.style.removeProperty(s);if(e._externalPanelParent.appendChild(t),e._externalPanel=null,e._externalPanelParent=null,e._savedPositionMethods){const s=e.control;for(const[r,o]of Object.entries(e._savedPositionMethods))if(r==="_panel.positionRelativeTo"){const a=s._panel;a&&(a.positionRelativeTo=o)}else s[r]=o;e._savedPositionMethods=null}e.element&&(e.element.style.display="")}_render(){if(!this._container)return;const{title:e,collapsible:t,backgroundColor:n,opacity:s,borderRadius:r,padding:o,showRowColumnControls:a}=this._options;this._container.innerHTML="",this._state.collapsed?this._container.classList.add("maplibre-gl-control-grid--collapsed"):this._container.classList.remove("maplibre-gl-control-grid--collapsed");const l=this._state.collapsed&&(e||t),h=l?0:o,u=l?0:o,d=l?0:Math.max(0,o-4),g=this._state.visible&&this._zoomVisible;if(Object.assign(this._container.style,{backgroundColor:n,opacity:String(s),borderRadius:`${r}px`,padding:`${h}px ${d}px ${h}px ${u}px`,boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.1)",display:g?"block":"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',color:"var(--mlc-grid-text-color, #1a1a1a)"}),t||e){const v=document.createElement("div");if(v.className="maplibre-gl-control-grid-header",Object.assign(v.style,{display:"flex",alignItems:"center",justifyContent:this._state.collapsed?"center":"space-between",flexWrap:"wrap",gap:"6px",paddingBottom:(this._state.collapsed,"0"),cursor:t?"pointer":"default"}),this._state.collapsed&&t){const b=document.createElement("span");b.className="maplibre-gl-control-grid-wrench",b.innerHTML=rst,Object.assign(b.style,{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"29px",height:"29px",lineHeight:"0",boxSizing:"border-box"}),b.setAttribute("aria-label","Map tools"),v.appendChild(b),v.addEventListener("click",()=>this.toggle())}else{const b=document.createElement("div");if(b.style.display="flex",b.style.alignItems="center",b.style.gap="6px",e){const w=document.createElement("span");w.className="maplibre-gl-control-grid-title",w.textContent=e,w.style.fontWeight="600",w.style.color="var(--mlc-grid-text-color, #333)",b.appendChild(w)}if(a&&!this._state.collapsed){const w=document.createElement("label");w.style.display="inline-flex",w.style.alignItems="center",w.style.gap="2px",w.style.fontSize="11px",w.style.color="var(--mlc-grid-text-color, #333)",w.innerHTML="R:";const x=document.createElement("input");x.type="number",x.min="1",x.max="12",x.value=String(this._state.rows),x.style.width="40px",x.style.padding="2px 2px",x.style.boxSizing="border-box",x.style.textAlign="center",x.style.color="var(--mlc-grid-text-color, #333)",x.addEventListener("change",()=>this.setRows(Number(x.value)||1)),w.appendChild(x);const I=document.createElement("label");I.style.display="inline-flex",I.style.alignItems="center",I.style.gap="2px",I.style.fontSize="11px",I.style.color="var(--mlc-grid-text-color, #333)",I.innerHTML="C:";const T=document.createElement("input");T.type="number",T.min="1",T.max="12",T.value=String(this._state.columns),T.style.width="40px",T.style.padding="2px 2px",T.style.boxSizing="border-box",T.style.textAlign="center",T.style.color="var(--mlc-grid-text-color, #333)",T.addEventListener("change",()=>this.setColumns(Number(T.value)||1)),I.appendChild(T),b.appendChild(w),b.appendChild(I)}if(v.appendChild(b),t){const w=document.createElement("span");w.className="maplibre-gl-control-grid-toggle",w.innerHTML="▼",Object.assign(w.style,{fontSize:"10px",userSelect:"none",color:"var(--mlc-grid-text-color, #333)"}),v.appendChild(w),v.addEventListener("click",x=>{(!a||!b.contains(x.target))&&this.toggle()})}}this._container.appendChild(v)}const m=document.createElement("div");m.className="maplibre-gl-control-grid-content",Object.assign(m.style,{display:this._state.collapsed?"none":"block"}),this._gridEl=m,this._applyGridStyle(),this._container.appendChild(m),this._mountChildren()}}exports.ADVANCED_EXTENSIONS=JH;exports.ALL_EXTENSIONS=KH;exports.ARRAY_TYPE=cf;exports.AddVectorAdapter=xQ;exports.AddVectorControl=O3;exports.BasemapControl=jH;exports.BookmarkControl=fQ;exports.COLORMAPS=wv;exports.COORDINATE_SYSTEM=Ni;exports.CSV_EXTENSIONS=GP;exports.CogLayerAdapter=yQ;exports.CogLayerControl=k3;exports.Colorbar=Zue;exports.CompositeLayer=wS;exports.ControlGrid=ust;exports.DUCKDB_EXTENSIONS=ZH;exports.DXF_EXTENSIONS=QP;exports.EPSILON=qy;exports.FLATGEOBUF_EXTENSIONS=zP;exports.GEOJSON_EXTENSIONS=dS;exports.GEOPACKAGE_EXTENSIONS=NP;exports.GEOPARQUET_EXTENSIONS=DP;exports.GML_EXTENSIONS=$P;exports.GOOGLE_BASEMAPS=qH;exports.GPX_EXTENSIONS=UP;exports.GaussianSplatControl=jB;exports.GaussianSplatLayerAdapter=sX;exports.GeoEditor=eR;exports.GeoEditorLayerAdapter=mW;exports.GeoJsonLayer=IS;exports.Geometry=uf;exports.GlobeViewport=bS;exports.HtmlControl=tde;exports.InspectControl=lQ;exports.KML_EXTENSIONS=FP;exports.KMZ_EXTENSIONS=OP;exports.Layer=Fh;exports.Legend=Kue;exports.LidarControl=kC;exports.LidarLayerAdapter=bj;exports.MapboxOverlay=G7;exports.MathArray=BL;exports.Matrix=N9;exports.Matrix4=Jl;exports.MeasureControl=dQ;exports.MinimapControl=uQ;exports.Model=Al;exports.PHONG_FS=z9;exports.PHONG_VS=U9;exports.PHONG_WGSL=$9;exports.PMTilesLayerAdapter=bQ;exports.PMTilesLayerControl=D3;exports.PathLayer=CS;exports.PlanetaryComputerControl=qR;exports.PlanetaryComputerLayerAdapter=wj;exports.PrintControl=pQ;exports.RdBu=RH;exports.RdYlBu=BH;exports.RdYlGn=PH;exports.SHAPEFILE_EXTENSIONS=kP;exports.SHPJS_EXTENSIONS=XH;exports.SearchControl=YH;exports.SolidPolygonLayer=SS;exports.StacLayerAdapter=wQ;exports.StacLayerControl=F3;exports.StacSearchControl=AQ;exports.Stats=bb;exports.StreetViewControl=TK;exports.SwipeControl=RK;exports.TOPOJSON_EXTENSIONS=VP;exports.TerrainControl=ode;exports.Texture=Vl;exports.UsgsLidarControl=BP;exports.UsgsLidarLayerAdapter=PK;exports.Vector=E9;exports.Vector3=Wu;exports.VectorDatasetControl=aQ;exports.ViewStateControl=cQ;exports.WebMercatorViewport=hf;exports.XLSX_EXTENSIONS=HP;exports.XYZSERVICES_URL=PP;exports.ZarrLayerAdapter=vQ;exports.ZarrLayerControl=N3;exports.add=Uve;exports.assert=uR;exports.assert$1=fr;exports.bone=VH;exports.buildTileUrl=zE;exports.bwr=MH;exports.checkNumber=La;exports.checkVector=oE;exports.cividis=SH;exports.clamp=Hue;exports.classNames=que;exports.config=_l;exports.cool=zH;exports.coolwarm=IH;exports.create=I9;exports.createIterable=Sb;exports.cross=T9;exports.debounce=Que;exports.defaultLogger=Ei;exports.detectFormat=eQ;exports.dot=Gve;exports.dot$1=M9;exports.equals=W_;exports.fetchProviders=Yue;exports.filterBasemaps=WH;exports.flatten=Rh;exports.formatNumericValue=HH;exports.fromValues=gve;exports.generateId=$u;exports.generateThumbnailUrl=jue;exports.getAcceptedExtensions=qP;exports.getColormap=Pu;exports.getColormapNames=Gue;exports.getDefaultExportFromCjs=tq;exports.getFileExtension=WP;exports.getFormatDescription=cde;exports.getFormatDisplayName=rQ;exports.getScaling=Rve;exports.gray=$H;exports.groupBasemaps=QH;exports.hot=UH;exports.inferno=EH;exports.isArray=Zp;exports.isValidColormap=GH;exports.isValidExtension=sQ;exports.jet=kH;exports.len=L9;exports.length=zve;exports.lerp=Hve;exports.lighting=jy;exports.lngLatToWorld=j_;exports.magma=CH;exports.normalize=yve;exports.normalize$1=Vve;exports.normalize$2=nq;exports.ocean=OH;exports.parseProviders=LP;exports.picking=ug;exports.plasma=wH;exports.project32=hg;exports.rainbow=NH;exports.readFileAsBuffer=iQ;exports.replaceInRange=sq;exports.requiresConversion=nQ;exports.requiresDuckDB=tQ;exports.scale=kL;exports.seismic=TH;exports.spectral=LH;exports.squaredLength=$ve;exports.terrain=FH;exports.throttle=Wue;exports.transformMat3=R9;exports.transformMat3$1=lve;exports.transformMat4=PL;exports.transformQuat=B9;exports.transformQuat$1=Qve;exports.turbo=DH;exports.vec4_transformMat2=dve;exports.vec4_transformMat3=fve;exports.viridis=xH;exports.worldToLngLat=Jp;
|