deck.gl 9.1.11 → 9.1.12

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/dist.dev.js CHANGED
@@ -29711,7 +29711,8 @@ ${props.source}` };
29711
29711
  framebuffer: outputBuffer,
29712
29712
  parameters: { viewport: [0, 0, ...texSize] },
29713
29713
  clearColor: clearCanvas ? [0, 0, 0, 0] : false,
29714
- clearDepth: 1
29714
+ clearDepth: 1,
29715
+ clearStencil: false
29715
29716
  });
29716
29717
  this.model.draw(renderPass);
29717
29718
  renderPass.end();
@@ -51271,7 +51272,7 @@ void main(void) {
51271
51272
  fontAtlasManager: new FontAtlasManager()
51272
51273
  };
51273
51274
  if (this.props.maxWidth > 0) {
51274
- log_default.warn("v8.9 breaking change: TextLayer maxWidth is now relative to text size")();
51275
+ log_default.once(1, "v8.9 breaking change: TextLayer maxWidth is now relative to text size")();
51275
51276
  }
51276
51277
  }
51277
51278
  // eslint-disable-next-line complexity
package/dist.min.js CHANGED
@@ -15,7 +15,7 @@
15
15
  } catch (error) {
16
16
  console.error(error);
17
17
  throw error;
18
- }`}function O_(e,t=!0,r){let n=r||new Set;if(e){if(h3(e))n.add(e);else if(h3(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let s in e)O_(e[s],t,n)}}return r===void 0?Array.from(n):[]}function h3(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var L_=()=>{},Es=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&me||typeof ra<"u"&&!me}constructor(t){let{name:r,source:n,url:s}=t;Me(n||s),this.name=r,this.source=n,this.url=s,this.onMessage=L_,this.onError=i=>console.log(i),this.worker=me?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=L_,this.onError=L_,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||O_(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=c3({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new ra(n,{eval:!1})}else if(this.source)t=new ra(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var El=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return Es.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(s,i,o)=>s.done(o),n=(s,i)=>s.error(i)){let s=new Promise(i=>(this.jobQueue.push({name:t,onMessage:r,onError:n,onStart:i}),this));return this._startQueuedJob(),await s}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let n=new Ml(r.name,t);t.onMessage=s=>r.onMessage(n,s.type,s.payload),t.onError=s=>r.onError(n,s),r.onStart(n);try{await n.result}catch(s){console.error(`Worker exception: ${s}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!me||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new Es({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return a3?this.maxMobileConcurrency:this.maxConcurrency}};var xz={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Ri=class{props;workerPools=new Map;static isSupported(){return Es.isSupported()}static getWorkerFarm(t={}){return Ri._workerFarm=Ri._workerFarm||new Ri({}),Ri._workerFarm.setProps(t),Ri._workerFarm}constructor(t){this.props={...xz},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:n,url:s}=t,i=this.workerPools.get(r);return i||(i=new El({name:r,source:n,url:s}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},bs=Ri;W(bs,"_workerFarm");function N_(e,t={}){let r=t[e.id]||{},n=me?`${e.id}-worker.js`:`${e.id}-worker-node.js`,s=r.workerUrl;if(!s&&e.id==="compression"&&(s=t.workerUrl),t._workerType==="test"&&(me?s=`modules/${e.module}/dist/${n}`:s=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!s){let i=e.version;i==="latest"&&(i=i3);let o=i?`@${i}`:"";s=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return Me(s),s}function B_(e,t=Al){Me(e,"no worker provided");let r=e.version;return!(!t||!r)}var F_={};async function an(e,t=null,r={},n=null){return t&&(e=f3(e,t,r,n)),F_[e]=F_[e]||yz(e),await F_[e]}function f3(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:me?r.CDN?(Me(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Al}/dist/libs/${n}`):Tl?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function yz(e){if(e.endsWith("wasm"))return await Tz(e);if(!me)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(Tl)return importScripts(e);let t=await Mz(e);return Az(t,e)}function Az(e,t){if(!me){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(Tl)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function Tz(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return me||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function Mz(e){let{readFileAsText:t}=globalThis.loaders||{};return me||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function D_(e,t){return!bs.isSupported()||!me&&!t?._nodeWorkers?!1:e.worker&&t?.worker}async function k_(e,t,r,n,s){let i=e.id,o=N_(e,r),c=bs.getWorkerFarm(r).getWorkerPool({name:i,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let l=await c.startJob("process-on-worker",Ez.bind(null,s));return l.postMessage("process",{input:t,options:r,context:n}),await(await l.result).result}async function Ez(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:s,input:i,options:o}=n;try{let a=await e(i,o);t.postMessage("done",{id:s,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";t.postMessage("error",{id:s,error:c})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function d3(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?u3(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?u3(e,0,t):""}function u3(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(t+i));return s}function U_(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${d3(e)}"`)}}function z_(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),s=new Uint8Array(t);for(let i=0;i<n.length;++i)if(n[i]!==s[i])return!1;return!0}function V_(...e){return p3(e)}function p3(e){let t=e.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),r=t.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(r),s=0;for(let i of t)n.set(i,s),s+=i.byteLength;return n.buffer}function bl(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,a)=>o+a.length,0),s=new r(n),i=0;for(let o of t)s.set(o,i),i+=o.length;return s}function Ii(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function Ss(e,t){return nt(e>=0),nt(t>0),e+(t-1)&~(t-1)}function H_(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,i=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,i)}return t.set(n,r),r+Ss(n.byteLength,4)}async function W_(e){let t=[];for await(let r of e)t.push(r);return V_(...t)}function Sl(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Oi=class{constructor(t,r){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Sl(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Sl()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var we=class{constructor(t){this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t,r="count"){return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,s=this.stats[r];return s||(t instanceof Oi?s=t:s=new Oi(r,n),this.stats[r]=s),s}};var bz="Queued Requests",Sz="Active Requests",vz="Cancelled Requests",wz="Queued Requests Ever",Cz="Active Requests Ever",Pz={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},vs=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...Pz,...t},this.stats=new we({id:this.props.id}),this.stats.get(bz),this.stats.get(Sz),this.stats.get(vz),this.stats.get(wz),this.stats.get(Cz)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let n={handle:t,priority:0,getPriority:r},s=new Promise(i=>(n.resolve=i,n));return this.requestQueue.push(n),this.requestMap.set(t,s),this._issueNewRequests(),s}_issueRequest(t){let{handle:r,resolve:n}=t,s=!1,i=()=>{s||(s=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let n=t[r];this._updateRequest(n)||(t.splice(r,1),this.requestMap.delete(n.handle),r--)}t.sort((r,n)=>r.priority-n.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var Rz="",m3={};function G_(e){for(let t in m3)if(e.startsWith(t)){let r=m3[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Rz}${e}`),e}function g3(e){return e&&typeof e=="object"&&e.isBuffer}function bd(e){if(g3(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var or={};Nt(or,{dirname:()=>Oz,filename:()=>Iz,join:()=>Lz,resolve:()=>Nz});function _3(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function Iz(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function Oz(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function Lz(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function Nz(...e){let t=[];for(let i=0;i<e.length;i++)t[i]=e[i];let r="",n=!1,s;for(let i=t.length-1;i>=-1&&!n;i--){let o;i>=0?o=t[i]:(s===void 0&&(s=_3()),o=s),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===vl)}return r=Bz(r,!n),n?`/${r}`:r.length>0?r:"."}var vl=47,j_=46;function Bz(e,t){let r="",n=-1,s=0,i,o=!1;for(let a=0;a<=e.length;++a){if(a<e.length)i=e.charCodeAt(a);else{if(i===vl)break;i=vl}if(i===vl){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==j_||r.charCodeAt(r.length-2)!==j_){if(r.length>2){let c=r.length-1,l=c;for(;l>=0&&r.charCodeAt(l)!==vl;--l);if(l!==c){r=l===-1?"":r.slice(0,l),n=a,s=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,o=!1}n=a,s=0}else i===j_&&s!==-1?++s:s=-1}return r}var Sd=class{fetch;loadOptions;_needsRefresh=!0;props;constructor(t){this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=Fz(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let r=this._needsRefresh;return t&&(this._needsRefresh=!1),r}};function Fz(e){let t=e?.fetch;if(t&&typeof t=="function")return(n,s)=>t(n,s);let r=e?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var mr=class extends Sd{};W(mr,"type","template"),W(mr,"testURL",t=>!1);var Dz=e=>typeof e=="boolean",wl=e=>typeof e=="function",Li=e=>e!==null&&typeof e=="object",q_=e=>Li(e)&&e.constructor==={}.constructor;var x3=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",y3=e=>e&&typeof e[Symbol.asyncIterator]=="function";var gr=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var _r=e=>typeof Blob<"u"&&e instanceof Blob,A3=e=>e&&typeof e=="object"&&e.isBuffer;var kz=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Li(e)&&wl(e.tee)&&wl(e.cancel)&&wl(e.getReader);var Uz=e=>Li(e)&&wl(e.read)&&wl(e.pipe)&&Dz(e.readable),vd=e=>kz(e)||Uz(e);var wd=class extends Error{constructor(t,r){super(t),this.reason=r.reason,this.url=r.url,this.response=r.response}reason;url;response};var zz=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Vz=/^([-\w.]+\/[-\w.+]+)/;function Y_(e,t){return e.toLowerCase()===t.toLowerCase()}function T3(e){let t=Vz.exec(e);return t?t[1]:e}function X_(e){let t=zz.exec(e);return t?t[1]:""}var M3=/\?.*/;function E3(e){let t=e.match(M3);return t&&t[0]}function na(e){return e.replace(M3,"")}function b3(e){if(e.length<50)return e;let t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function Ni(e){return gr(e)?e.url:_r(e)?e.name||"":typeof e=="string"?e:""}function Cl(e){if(gr(e)){let t=e,r=t.headers.get("content-type")||"",n=na(t.url);return T3(r)||X_(n)}return _r(e)?e.type||"":typeof e=="string"?X_(e):""}function S3(e){return gr(e)?e.headers["content-length"]||-1:_r(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Cd(e){if(gr(e))return e;let t={},r=S3(e);r>=0&&(t["content-length"]=String(r));let n=Ni(e),s=Cl(e);s&&(t["content-type"]=s);let i=await Wz(e);i&&(t["x-first-bytes"]=i),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function v3(e){if(!e.ok)throw await Hz(e)}async function Hz(e){let t=b3(e.url),r=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;r=r.length>100?`${r.slice(0,100)}...`:r;let n={reason:e.statusText,url:e.url,response:e};try{let s=e.headers.get("Content-Type");n.reason=s?.includes("application/json")?await e.json():e.text()}catch{}return new wd(r,n)}async function Wz(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let s=new FileReader;s.onload=i=>n(i?.target?.result),s.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${Gz(r)}`}return null}function Gz(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function jz(e){return!qz(e)&&!Yz(e)}function qz(e){return e.startsWith("http:")||e.startsWith("https:")}function Yz(e){return e.startsWith("data:")}async function sa(e,t){if(typeof e=="string"){let r=G_(e);return jz(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await Cd(e)}var $_=new Ke({id:"loaders.gl"}),Pd=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Rd=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var K_={fetch:null,mimeType:void 0,nothrow:!1,log:new Rd,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:kn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},w3={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function Z_(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function J_(){let e=Z_();return e.globalOptions=e.globalOptions||{...K_},e.globalOptions}function R3(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],Xz(e,r),Kz(t,e,n)}function Xz(e,t){C3(e,null,K_,w3,t);for(let r of t){let n=e&&e[r.id]||{},s=r.options&&r.options[r.id]||{},i=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};C3(n,r.id,s,i,t)}}function C3(e,t,r,n,s){let i=t||"Top level",o=t?`${t}.`:"";for(let a in e){let c=!t&&Li(e[a]),l=a==="baseUri"&&!t,h=a==="workerUrl"&&t;if(!(a in r)&&!l&&!h){if(a in n)$_.warn(`${i} loader option '${o}${a}' no longer supported, use '${n[a]}'`)();else if(!c){let f=$z(a,s);$_.warn(`${i} loader option '${o}${a}' not recognized. ${f}`)()}}}}function $z(e,t){let r=e.toLowerCase(),n="";for(let s of t)for(let i in s.options){if(e===i)return`Did you mean '${s.id}.${i}'?`;let o=i.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${s.id}.${i}'?`)}return n}function Kz(e,t,r){let s={...e.options||{}};return Zz(s,r),s.log===null&&(s.log=new Pd),P3(s,J_()),P3(s,t),s}function P3(e,t){for(let r in t)if(r in t){let n=t[r];q_(n)&&q_(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Zz(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function Pl(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function Rl(e){nt(e,"null loader"),nt(Pl(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var I3=()=>{let e=Z_();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Il(e){let t=I3();e=Array.isArray(e)?e:[e];for(let r of e){let n=Rl(r);t.find(s=>n===s)||t.unshift(n)}}function O3(){return I3()}var L3=new Ke({id:"loaders.gl"});var Jz=/\.([^.]+)$/;async function F3(e,t=[],r,n){if(!D3(e))return null;let s=N3(e,t,{...r,nothrow:!0},n);if(s)return s;if(_r(e)&&(e=await e.slice(0,10).arrayBuffer(),s=N3(e,t,r,n)),!s&&!r?.nothrow)throw new Error(k3(e));return s}function N3(e,t=[],r,n){if(!D3(e))return null;if(t&&!Array.isArray(t))return Rl(t);let s=[];t&&(s=s.concat(t)),r?.ignoreRegisteredLoaders||s.push(...O3()),tV(s);let i=Qz(e,s,r,n);if(!i&&!r?.nothrow)throw new Error(k3(e));return i}function Qz(e,t,r,n){let s=Ni(e),i=Cl(e),o=na(s)||n?.url,a=null,c="";return r?.mimeType&&(a=Q_(t,r?.mimeType),c=`match forced by supplied MIME type ${r?.mimeType}`),a=a||eV(t,o),c=c||(a?`matched url ${o}`:""),a=a||Q_(t,i),c=c||(a?`matched MIME type ${i}`:""),a=a||nV(t,e),c=c||(a?`matched initial data ${U3(e)}`:""),r?.fallbackMimeType&&(a=a||Q_(t,r?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${i}`:"")),c&&L3.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function D3(e){return!(e instanceof Response&&e.status===204)}function k3(e){let t=Ni(e),r=Cl(e),n="No valid loader found (";n+=t?`${or.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let s=e?U3(e):"";return n+=s?` first bytes: "${s}"`:"first bytes: not available",n+=")",n}function tV(e){for(let t of e)Rl(t)}function eV(e,t){let r=t&&Jz.exec(t),n=r&&r[1];return n?rV(e,n):null}function rV(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function Q_(e,t){for(let r of e)if(r.mimeTypes?.some(n=>Y_(t,n))||Y_(t,`application/x.${r.id}`))return r;return null}function nV(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(sV(t,r))return r}else if(ArrayBuffer.isView(t)){if(B3(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&B3(t,0,r))return r;return null}function sV(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function B3(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(s=>iV(e,t,r,s))}function iV(e,t,r,n){if(n instanceof ArrayBuffer)return z_(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let s=tx(e,t,n.length);return n===s;default:return!1}}function U3(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?tx(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?tx(e,0,t):""}function tx(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(t+i));return s}function*z3(e,t){let r=t?.chunkSize||262144,n=0,s=new TextEncoder;for(;n<e.length;){let i=Math.min(e.length-n,r),o=e.slice(n,n+i);n+=i,yield s.encode(o)}}function*V3(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let s=Math.min(e.byteLength-n,r),i=new ArrayBuffer(s),o=new Uint8Array(e,n,s);new Uint8Array(i).set(o),n+=s,yield i}}async function*H3(e,t){let r=t?.chunkSize||1048576,n=0;for(;n<e.size;){let s=n+r,i=await e.slice(n,s).arrayBuffer();n=s,yield i}}function ex(e,t){return kn?oV(e,t):aV(e,t)}async function*oV(e,t){let r=e.getReader(),n;try{for(;;){let s=n||r.read();t?._streamReadAhead&&(n=r.read());let{done:i,value:o}=await s;if(i)return;yield bd(o)}}catch{r.releaseLock()}}async function*aV(e,t){for await(let r of e)yield bd(r)}function W3(e,t){if(typeof e=="string")return z3(e,t);if(e instanceof ArrayBuffer)return V3(e,t);if(_r(e))return H3(e,t);if(vd(e))return ex(e,t);if(gr(e))return ex(e.body,t);throw new Error("makeIterator")}var G3="Cannot convert supplied data type";function cV(e,t,r){if(t.text&&typeof e=="string")return e;if(A3(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,s=e.byteLength||e.length;return(e.byteOffset!==0||s!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+s)),n}throw new Error(G3)}async function j3(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return cV(e,t,r);if(_r(e)&&(e=await Cd(e)),gr(e)){let s=e;return await v3(s),t.binary?await s.arrayBuffer():await s.text()}if(vd(e)&&(e=W3(e,r)),x3(e)||y3(e))return W_(e);throw new Error(G3)}function Id(e,t){let r=J_(),n=e||r;return typeof n.fetch=="function"?n.fetch:Li(n.fetch)?s=>sa(s,n.fetch):t?.fetch?t?.fetch:sa}function q3(e,t,r){if(r)return r;let n={fetch:Id(t,e),...e};if(n.url){let s=na(n.url);n.baseUrl=s,n.queryString=E3(n.url),n.filename=or.filename(s),n.baseUrl=or.dirname(s)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Y3(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function ws(e,t,r,n){t&&!Array.isArray(t)&&!Pl(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let s=Ni(e),o=Y3(t,n),a=await F3(e,o,r);return a?(r=R3(r,a,o,s),n=q3({url:s,_parse:ws,loaders:o},r,n||null),await lV(a,e,r,n)):null}async function lV(e,t,r,n){if(B_(e),r=yl(e.options,r),gr(t)){let i=t,{ok:o,redirected:a,status:c,statusText:l,type:h,url:f}=i,u=Object.fromEntries(i.headers.entries());n.response={headers:u,ok:o,redirected:a,status:c,statusText:l,type:h,url:f}}t=await j3(t,e,r);let s=e;if(s.parseTextSync&&typeof t=="string")return s.parseTextSync(t,r,n);if(D_(e,r))return await k_(e,t,r,n,ws);if(s.parseText&&typeof t=="string")return await s.parseText(t,r,n);if(s.parse)return await s.parse(t,r,n);throw Me(!s.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function X3(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Un(e){let t=1/0,r=1/0,n=1/0,s=-1/0,i=-1/0,o=-1/0,a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let l=0;l<c;l+=3){let h=a[l],f=a[l+1],u=a[l+2];t=h<t?h:t,r=f<r?f:r,n=u<n?u:n,s=h>s?h:s,i=f>i?f:i,o=u>o?u:o}return[[t,r,n],[s,i,o]]}function rx(e,t,r){let n=X3(t.value),s=r||$3(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:s}}function $3(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}async function se(e,t,r,n){let s,i;!Array.isArray(t)&&!Pl(t)?(s=[],i=t,n=void 0):(s=t,i=r);let o=Id(i),a=e;return typeof e=="string"&&(a=await o(e)),_r(e)&&(a=await o(e)),Array.isArray(s)?await ws(a,s,i):await ws(a,s,i)}var K3="4.2.1";var hV=globalThis.loaders?.parseImageNode,nx=typeof Image<"u",sx=typeof ImageBitmap<"u",fV=Boolean(hV),ix=kn?!0:fV;function Z3(e){switch(e){case"auto":return sx||nx||ix;case"imagebitmap":return sx;case"image":return nx;case"data":return ix;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function J3(){if(sx)return"imagebitmap";if(nx)return"image";if(ix)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Q3(e){let t=uV(e);if(!t)throw new Error("Not an image");return t}function Ol(e){switch(Q3(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function uV(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var dV=/^data:image\/svg\+xml/,pV=/\.svg((\?|#).*)?$/;function Od(e){return e&&(dV.test(e)||pV.test(e))}function tS(e,t){if(Od(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return ox(e,t)}function ox(e,t){if(Od(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Ld(e,t,r){let n=tS(e,r),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await mV(i||n,t)}finally{i&&s.revokeObjectURL(i)}}async function mV(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var gV={},eS=!0;async function rS(e,t,r){let n;Od(r)?n=await Ld(e,t,r):n=ox(e,r);let s=t&&t.imagebitmap;return await _V(n,s)}async function _V(e,t=null){if((xV(t)||!eS)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),eS=!1}return await createImageBitmap(e)}function xV(e){for(let t in e||gV)return!1;return!0}function nS(e){return!MV(e,"ftyp",4)||!(e[8]&96)?null:yV(e)}function yV(e){switch(AV(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function AV(e,t,r){return String.fromCharCode(...e.slice(t,r))}function TV(e){return[...e].map(t=>t.charCodeAt(0))}function MV(e,t,r=0){let n=TV(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var cn=!1,Ll=!0;function Bi(e){let t=Nl(e);return bV(t)||wV(t)||SV(t)||vV(t)||EV(t)}function EV(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=nS(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function bV(e){let t=Nl(e);return t.byteLength>=24&&t.getUint32(0,cn)===2303741511?{mimeType:"image/png",width:t.getUint32(16,cn),height:t.getUint32(20,cn)}:null}function SV(e){let t=Nl(e);return t.byteLength>=10&&t.getUint32(0,cn)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Ll),height:t.getUint16(8,Ll)}:null}function vV(e){let t=Nl(e);return t.byteLength>=14&&t.getUint16(0,cn)===16973&&t.getUint32(2,Ll)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Ll),height:t.getUint32(22,Ll)}:null}function wV(e){let t=Nl(e);if(!(t.byteLength>=3&&t.getUint16(0,cn)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=CV(),i=2;for(;i+9<t.byteLength;){let o=t.getUint16(i,cn);if(s.has(o))return{mimeType:"image/jpeg",height:t.getUint16(i+5,cn),width:t.getUint16(i+7,cn)};if(!n.has(o))return null;i+=2,i+=t.getUint16(i,cn)}return null}function CV(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Nl(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function sS(e,t){let{mimeType:r}=Bi(e)||{},n=globalThis.loaders?.parseImageNode;return nt(n),await n(e,r)}async function iS(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:i}=r||{},o=PV(s),a;switch(o){case"imagebitmap":a=await rS(e,t,i);break;case"image":a=await Ld(e,t,i);break;case"data":a=await sS(e,t);break;default:nt(!1)}return s==="data"&&(a=Ol(a)),a}function PV(e){switch(e){case"auto":case"data":return J3();default:return Z3(e),e}}var RV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],IV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],OV={image:{type:"auto",decode:!0}},ln={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:K3,mimeTypes:IV,extensions:RV,parse:iS,tests:[e=>Boolean(Bi(new DataView(e)))],options:OV};var ax={};function cx(e){if(ax[e]===void 0){let t=kn?NV(e):LV(e);ax[e]=t}return ax[e]}function LV(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function NV(e){switch(e){case"image/avif":case"image/webp":return BV(e);default:return!0}}function BV(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var FV=new Ke({id:"deck"}),k=FV;var lx={};function Nd(e){lx=e}function jt(e,t,r,n){k.level>0&&lx[e]&&lx[e].call(null,t,r,n)}function DV(e){let t=e[0],r=e[e.length-1];return t==="{"&&r==="}"||t==="["&&r==="]"}var oS={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:DV,parseTextSync:JSON.parse};function kV(){let e="9.1.11",t=globalThis.deck&&globalThis.deck.VERSION;if(t&&t!==e)throw new Error(`deck.gl - multiple versions detected: ${t} vs ${e}`);return t||(k.log(1,`deck.gl ${e}`)(),globalThis.deck={...globalThis.deck,VERSION:e,version:e,log:k,_registerLoggers:Nd},Il([oS,[ln,{imagebitmap:{premultiplyAlpha:"none"}}]])),e}var Bd=kV();function Fd(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}var hx={number:{type:"number",validate(e,t){return Number.isFinite(e)&&typeof t=="object"&&(t.max===void 0||e<=t.max)&&(t.min===void 0||e>=t.min)}},array:{type:"array",validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function cS(e){let t={};for(let[r,n]of Object.entries(e))t[r]=UV(n);return t}function UV(e){let t=aS(e);if(t!=="object")return{value:e,...hx[t],type:t};if(typeof e=="object")return e?e.type!==void 0?{...e,...hx[e.type],type:e.type}:e.value===void 0?{type:"object",value:e}:(t=aS(e.value),{...e,...hx[t],type:t}):{type:"object",value:null};throw new Error("props")}function aS(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}var lS=`#ifdef MODULE_LOGDEPTH
18
+ }`}function O_(e,t=!0,r){let n=r||new Set;if(e){if(h3(e))n.add(e);else if(h3(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let s in e)O_(e[s],t,n)}}return r===void 0?Array.from(n):[]}function h3(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var L_=()=>{},Es=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&me||typeof ra<"u"&&!me}constructor(t){let{name:r,source:n,url:s}=t;Me(n||s),this.name=r,this.source=n,this.url=s,this.onMessage=L_,this.onError=i=>console.log(i),this.worker=me?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=L_,this.onError=L_,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||O_(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=c3({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new ra(n,{eval:!1})}else if(this.source)t=new ra(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var El=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return Es.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(s,i,o)=>s.done(o),n=(s,i)=>s.error(i)){let s=new Promise(i=>(this.jobQueue.push({name:t,onMessage:r,onError:n,onStart:i}),this));return this._startQueuedJob(),await s}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let n=new Ml(r.name,t);t.onMessage=s=>r.onMessage(n,s.type,s.payload),t.onError=s=>r.onError(n,s),r.onStart(n);try{await n.result}catch(s){console.error(`Worker exception: ${s}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!me||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new Es({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return a3?this.maxMobileConcurrency:this.maxConcurrency}};var xz={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Ri=class{props;workerPools=new Map;static isSupported(){return Es.isSupported()}static getWorkerFarm(t={}){return Ri._workerFarm=Ri._workerFarm||new Ri({}),Ri._workerFarm.setProps(t),Ri._workerFarm}constructor(t){this.props={...xz},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:n,url:s}=t,i=this.workerPools.get(r);return i||(i=new El({name:r,source:n,url:s}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},bs=Ri;W(bs,"_workerFarm");function N_(e,t={}){let r=t[e.id]||{},n=me?`${e.id}-worker.js`:`${e.id}-worker-node.js`,s=r.workerUrl;if(!s&&e.id==="compression"&&(s=t.workerUrl),t._workerType==="test"&&(me?s=`modules/${e.module}/dist/${n}`:s=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!s){let i=e.version;i==="latest"&&(i=i3);let o=i?`@${i}`:"";s=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return Me(s),s}function B_(e,t=Al){Me(e,"no worker provided");let r=e.version;return!(!t||!r)}var F_={};async function an(e,t=null,r={},n=null){return t&&(e=f3(e,t,r,n)),F_[e]=F_[e]||yz(e),await F_[e]}function f3(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:me?r.CDN?(Me(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Al}/dist/libs/${n}`):Tl?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function yz(e){if(e.endsWith("wasm"))return await Tz(e);if(!me)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(Tl)return importScripts(e);let t=await Mz(e);return Az(t,e)}function Az(e,t){if(!me){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(Tl)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function Tz(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return me||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function Mz(e){let{readFileAsText:t}=globalThis.loaders||{};return me||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function D_(e,t){return!bs.isSupported()||!me&&!t?._nodeWorkers?!1:e.worker&&t?.worker}async function k_(e,t,r,n,s){let i=e.id,o=N_(e,r),c=bs.getWorkerFarm(r).getWorkerPool({name:i,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let l=await c.startJob("process-on-worker",Ez.bind(null,s));return l.postMessage("process",{input:t,options:r,context:n}),await(await l.result).result}async function Ez(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:s,input:i,options:o}=n;try{let a=await e(i,o);t.postMessage("done",{id:s,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";t.postMessage("error",{id:s,error:c})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function d3(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?u3(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?u3(e,0,t):""}function u3(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(t+i));return s}function U_(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${d3(e)}"`)}}function z_(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),s=new Uint8Array(t);for(let i=0;i<n.length;++i)if(n[i]!==s[i])return!1;return!0}function V_(...e){return p3(e)}function p3(e){let t=e.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),r=t.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(r),s=0;for(let i of t)n.set(i,s),s+=i.byteLength;return n.buffer}function bl(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,a)=>o+a.length,0),s=new r(n),i=0;for(let o of t)s.set(o,i),i+=o.length;return s}function Ii(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function Ss(e,t){return nt(e>=0),nt(t>0),e+(t-1)&~(t-1)}function H_(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,i=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,i)}return t.set(n,r),r+Ss(n.byteLength,4)}async function W_(e){let t=[];for await(let r of e)t.push(r);return V_(...t)}function Sl(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Oi=class{constructor(t,r){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Sl(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Sl()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var we=class{constructor(t){this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t,r="count"){return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,s=this.stats[r];return s||(t instanceof Oi?s=t:s=new Oi(r,n),this.stats[r]=s),s}};var bz="Queued Requests",Sz="Active Requests",vz="Cancelled Requests",wz="Queued Requests Ever",Cz="Active Requests Ever",Pz={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},vs=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...Pz,...t},this.stats=new we({id:this.props.id}),this.stats.get(bz),this.stats.get(Sz),this.stats.get(vz),this.stats.get(wz),this.stats.get(Cz)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let n={handle:t,priority:0,getPriority:r},s=new Promise(i=>(n.resolve=i,n));return this.requestQueue.push(n),this.requestMap.set(t,s),this._issueNewRequests(),s}_issueRequest(t){let{handle:r,resolve:n}=t,s=!1,i=()=>{s||(s=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let n=t[r];this._updateRequest(n)||(t.splice(r,1),this.requestMap.delete(n.handle),r--)}t.sort((r,n)=>r.priority-n.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var Rz="",m3={};function G_(e){for(let t in m3)if(e.startsWith(t)){let r=m3[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Rz}${e}`),e}function g3(e){return e&&typeof e=="object"&&e.isBuffer}function bd(e){if(g3(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var or={};Nt(or,{dirname:()=>Oz,filename:()=>Iz,join:()=>Lz,resolve:()=>Nz});function _3(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function Iz(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function Oz(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function Lz(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function Nz(...e){let t=[];for(let i=0;i<e.length;i++)t[i]=e[i];let r="",n=!1,s;for(let i=t.length-1;i>=-1&&!n;i--){let o;i>=0?o=t[i]:(s===void 0&&(s=_3()),o=s),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===vl)}return r=Bz(r,!n),n?`/${r}`:r.length>0?r:"."}var vl=47,j_=46;function Bz(e,t){let r="",n=-1,s=0,i,o=!1;for(let a=0;a<=e.length;++a){if(a<e.length)i=e.charCodeAt(a);else{if(i===vl)break;i=vl}if(i===vl){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==j_||r.charCodeAt(r.length-2)!==j_){if(r.length>2){let c=r.length-1,l=c;for(;l>=0&&r.charCodeAt(l)!==vl;--l);if(l!==c){r=l===-1?"":r.slice(0,l),n=a,s=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,o=!1}n=a,s=0}else i===j_&&s!==-1?++s:s=-1}return r}var Sd=class{fetch;loadOptions;_needsRefresh=!0;props;constructor(t){this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=Fz(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let r=this._needsRefresh;return t&&(this._needsRefresh=!1),r}};function Fz(e){let t=e?.fetch;if(t&&typeof t=="function")return(n,s)=>t(n,s);let r=e?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var mr=class extends Sd{};W(mr,"type","template"),W(mr,"testURL",t=>!1);var Dz=e=>typeof e=="boolean",wl=e=>typeof e=="function",Li=e=>e!==null&&typeof e=="object",q_=e=>Li(e)&&e.constructor==={}.constructor;var x3=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",y3=e=>e&&typeof e[Symbol.asyncIterator]=="function";var gr=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var _r=e=>typeof Blob<"u"&&e instanceof Blob,A3=e=>e&&typeof e=="object"&&e.isBuffer;var kz=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Li(e)&&wl(e.tee)&&wl(e.cancel)&&wl(e.getReader);var Uz=e=>Li(e)&&wl(e.read)&&wl(e.pipe)&&Dz(e.readable),vd=e=>kz(e)||Uz(e);var wd=class extends Error{constructor(t,r){super(t),this.reason=r.reason,this.url=r.url,this.response=r.response}reason;url;response};var zz=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Vz=/^([-\w.]+\/[-\w.+]+)/;function Y_(e,t){return e.toLowerCase()===t.toLowerCase()}function T3(e){let t=Vz.exec(e);return t?t[1]:e}function X_(e){let t=zz.exec(e);return t?t[1]:""}var M3=/\?.*/;function E3(e){let t=e.match(M3);return t&&t[0]}function na(e){return e.replace(M3,"")}function b3(e){if(e.length<50)return e;let t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function Ni(e){return gr(e)?e.url:_r(e)?e.name||"":typeof e=="string"?e:""}function Cl(e){if(gr(e)){let t=e,r=t.headers.get("content-type")||"",n=na(t.url);return T3(r)||X_(n)}return _r(e)?e.type||"":typeof e=="string"?X_(e):""}function S3(e){return gr(e)?e.headers["content-length"]||-1:_r(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Cd(e){if(gr(e))return e;let t={},r=S3(e);r>=0&&(t["content-length"]=String(r));let n=Ni(e),s=Cl(e);s&&(t["content-type"]=s);let i=await Wz(e);i&&(t["x-first-bytes"]=i),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function v3(e){if(!e.ok)throw await Hz(e)}async function Hz(e){let t=b3(e.url),r=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;r=r.length>100?`${r.slice(0,100)}...`:r;let n={reason:e.statusText,url:e.url,response:e};try{let s=e.headers.get("Content-Type");n.reason=s?.includes("application/json")?await e.json():e.text()}catch{}return new wd(r,n)}async function Wz(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let s=new FileReader;s.onload=i=>n(i?.target?.result),s.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${Gz(r)}`}return null}function Gz(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function jz(e){return!qz(e)&&!Yz(e)}function qz(e){return e.startsWith("http:")||e.startsWith("https:")}function Yz(e){return e.startsWith("data:")}async function sa(e,t){if(typeof e=="string"){let r=G_(e);return jz(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await Cd(e)}var $_=new Ke({id:"loaders.gl"}),Pd=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Rd=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var K_={fetch:null,mimeType:void 0,nothrow:!1,log:new Rd,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:kn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},w3={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function Z_(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function J_(){let e=Z_();return e.globalOptions=e.globalOptions||{...K_},e.globalOptions}function R3(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],Xz(e,r),Kz(t,e,n)}function Xz(e,t){C3(e,null,K_,w3,t);for(let r of t){let n=e&&e[r.id]||{},s=r.options&&r.options[r.id]||{},i=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};C3(n,r.id,s,i,t)}}function C3(e,t,r,n,s){let i=t||"Top level",o=t?`${t}.`:"";for(let a in e){let c=!t&&Li(e[a]),l=a==="baseUri"&&!t,h=a==="workerUrl"&&t;if(!(a in r)&&!l&&!h){if(a in n)$_.warn(`${i} loader option '${o}${a}' no longer supported, use '${n[a]}'`)();else if(!c){let f=$z(a,s);$_.warn(`${i} loader option '${o}${a}' not recognized. ${f}`)()}}}}function $z(e,t){let r=e.toLowerCase(),n="";for(let s of t)for(let i in s.options){if(e===i)return`Did you mean '${s.id}.${i}'?`;let o=i.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${s.id}.${i}'?`)}return n}function Kz(e,t,r){let s={...e.options||{}};return Zz(s,r),s.log===null&&(s.log=new Pd),P3(s,J_()),P3(s,t),s}function P3(e,t){for(let r in t)if(r in t){let n=t[r];q_(n)&&q_(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Zz(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function Pl(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function Rl(e){nt(e,"null loader"),nt(Pl(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var I3=()=>{let e=Z_();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Il(e){let t=I3();e=Array.isArray(e)?e:[e];for(let r of e){let n=Rl(r);t.find(s=>n===s)||t.unshift(n)}}function O3(){return I3()}var L3=new Ke({id:"loaders.gl"});var Jz=/\.([^.]+)$/;async function F3(e,t=[],r,n){if(!D3(e))return null;let s=N3(e,t,{...r,nothrow:!0},n);if(s)return s;if(_r(e)&&(e=await e.slice(0,10).arrayBuffer(),s=N3(e,t,r,n)),!s&&!r?.nothrow)throw new Error(k3(e));return s}function N3(e,t=[],r,n){if(!D3(e))return null;if(t&&!Array.isArray(t))return Rl(t);let s=[];t&&(s=s.concat(t)),r?.ignoreRegisteredLoaders||s.push(...O3()),tV(s);let i=Qz(e,s,r,n);if(!i&&!r?.nothrow)throw new Error(k3(e));return i}function Qz(e,t,r,n){let s=Ni(e),i=Cl(e),o=na(s)||n?.url,a=null,c="";return r?.mimeType&&(a=Q_(t,r?.mimeType),c=`match forced by supplied MIME type ${r?.mimeType}`),a=a||eV(t,o),c=c||(a?`matched url ${o}`:""),a=a||Q_(t,i),c=c||(a?`matched MIME type ${i}`:""),a=a||nV(t,e),c=c||(a?`matched initial data ${U3(e)}`:""),r?.fallbackMimeType&&(a=a||Q_(t,r?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${i}`:"")),c&&L3.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function D3(e){return!(e instanceof Response&&e.status===204)}function k3(e){let t=Ni(e),r=Cl(e),n="No valid loader found (";n+=t?`${or.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let s=e?U3(e):"";return n+=s?` first bytes: "${s}"`:"first bytes: not available",n+=")",n}function tV(e){for(let t of e)Rl(t)}function eV(e,t){let r=t&&Jz.exec(t),n=r&&r[1];return n?rV(e,n):null}function rV(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function Q_(e,t){for(let r of e)if(r.mimeTypes?.some(n=>Y_(t,n))||Y_(t,`application/x.${r.id}`))return r;return null}function nV(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(sV(t,r))return r}else if(ArrayBuffer.isView(t)){if(B3(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&B3(t,0,r))return r;return null}function sV(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function B3(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(s=>iV(e,t,r,s))}function iV(e,t,r,n){if(n instanceof ArrayBuffer)return z_(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let s=tx(e,t,n.length);return n===s;default:return!1}}function U3(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?tx(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?tx(e,0,t):""}function tx(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(t+i));return s}function*z3(e,t){let r=t?.chunkSize||262144,n=0,s=new TextEncoder;for(;n<e.length;){let i=Math.min(e.length-n,r),o=e.slice(n,n+i);n+=i,yield s.encode(o)}}function*V3(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let s=Math.min(e.byteLength-n,r),i=new ArrayBuffer(s),o=new Uint8Array(e,n,s);new Uint8Array(i).set(o),n+=s,yield i}}async function*H3(e,t){let r=t?.chunkSize||1048576,n=0;for(;n<e.size;){let s=n+r,i=await e.slice(n,s).arrayBuffer();n=s,yield i}}function ex(e,t){return kn?oV(e,t):aV(e,t)}async function*oV(e,t){let r=e.getReader(),n;try{for(;;){let s=n||r.read();t?._streamReadAhead&&(n=r.read());let{done:i,value:o}=await s;if(i)return;yield bd(o)}}catch{r.releaseLock()}}async function*aV(e,t){for await(let r of e)yield bd(r)}function W3(e,t){if(typeof e=="string")return z3(e,t);if(e instanceof ArrayBuffer)return V3(e,t);if(_r(e))return H3(e,t);if(vd(e))return ex(e,t);if(gr(e))return ex(e.body,t);throw new Error("makeIterator")}var G3="Cannot convert supplied data type";function cV(e,t,r){if(t.text&&typeof e=="string")return e;if(A3(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,s=e.byteLength||e.length;return(e.byteOffset!==0||s!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+s)),n}throw new Error(G3)}async function j3(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return cV(e,t,r);if(_r(e)&&(e=await Cd(e)),gr(e)){let s=e;return await v3(s),t.binary?await s.arrayBuffer():await s.text()}if(vd(e)&&(e=W3(e,r)),x3(e)||y3(e))return W_(e);throw new Error(G3)}function Id(e,t){let r=J_(),n=e||r;return typeof n.fetch=="function"?n.fetch:Li(n.fetch)?s=>sa(s,n.fetch):t?.fetch?t?.fetch:sa}function q3(e,t,r){if(r)return r;let n={fetch:Id(t,e),...e};if(n.url){let s=na(n.url);n.baseUrl=s,n.queryString=E3(n.url),n.filename=or.filename(s),n.baseUrl=or.dirname(s)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Y3(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function ws(e,t,r,n){t&&!Array.isArray(t)&&!Pl(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let s=Ni(e),o=Y3(t,n),a=await F3(e,o,r);return a?(r=R3(r,a,o,s),n=q3({url:s,_parse:ws,loaders:o},r,n||null),await lV(a,e,r,n)):null}async function lV(e,t,r,n){if(B_(e),r=yl(e.options,r),gr(t)){let i=t,{ok:o,redirected:a,status:c,statusText:l,type:h,url:f}=i,u=Object.fromEntries(i.headers.entries());n.response={headers:u,ok:o,redirected:a,status:c,statusText:l,type:h,url:f}}t=await j3(t,e,r);let s=e;if(s.parseTextSync&&typeof t=="string")return s.parseTextSync(t,r,n);if(D_(e,r))return await k_(e,t,r,n,ws);if(s.parseText&&typeof t=="string")return await s.parseText(t,r,n);if(s.parse)return await s.parse(t,r,n);throw Me(!s.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function X3(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Un(e){let t=1/0,r=1/0,n=1/0,s=-1/0,i=-1/0,o=-1/0,a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let l=0;l<c;l+=3){let h=a[l],f=a[l+1],u=a[l+2];t=h<t?h:t,r=f<r?f:r,n=u<n?u:n,s=h>s?h:s,i=f>i?f:i,o=u>o?u:o}return[[t,r,n],[s,i,o]]}function rx(e,t,r){let n=X3(t.value),s=r||$3(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:s}}function $3(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}async function se(e,t,r,n){let s,i;!Array.isArray(t)&&!Pl(t)?(s=[],i=t,n=void 0):(s=t,i=r);let o=Id(i),a=e;return typeof e=="string"&&(a=await o(e)),_r(e)&&(a=await o(e)),Array.isArray(s)?await ws(a,s,i):await ws(a,s,i)}var K3="4.2.1";var hV=globalThis.loaders?.parseImageNode,nx=typeof Image<"u",sx=typeof ImageBitmap<"u",fV=Boolean(hV),ix=kn?!0:fV;function Z3(e){switch(e){case"auto":return sx||nx||ix;case"imagebitmap":return sx;case"image":return nx;case"data":return ix;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function J3(){if(sx)return"imagebitmap";if(nx)return"image";if(ix)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Q3(e){let t=uV(e);if(!t)throw new Error("Not an image");return t}function Ol(e){switch(Q3(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function uV(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var dV=/^data:image\/svg\+xml/,pV=/\.svg((\?|#).*)?$/;function Od(e){return e&&(dV.test(e)||pV.test(e))}function tS(e,t){if(Od(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return ox(e,t)}function ox(e,t){if(Od(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Ld(e,t,r){let n=tS(e,r),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await mV(i||n,t)}finally{i&&s.revokeObjectURL(i)}}async function mV(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var gV={},eS=!0;async function rS(e,t,r){let n;Od(r)?n=await Ld(e,t,r):n=ox(e,r);let s=t&&t.imagebitmap;return await _V(n,s)}async function _V(e,t=null){if((xV(t)||!eS)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),eS=!1}return await createImageBitmap(e)}function xV(e){for(let t in e||gV)return!1;return!0}function nS(e){return!MV(e,"ftyp",4)||!(e[8]&96)?null:yV(e)}function yV(e){switch(AV(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function AV(e,t,r){return String.fromCharCode(...e.slice(t,r))}function TV(e){return[...e].map(t=>t.charCodeAt(0))}function MV(e,t,r=0){let n=TV(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var cn=!1,Ll=!0;function Bi(e){let t=Nl(e);return bV(t)||wV(t)||SV(t)||vV(t)||EV(t)}function EV(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=nS(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function bV(e){let t=Nl(e);return t.byteLength>=24&&t.getUint32(0,cn)===2303741511?{mimeType:"image/png",width:t.getUint32(16,cn),height:t.getUint32(20,cn)}:null}function SV(e){let t=Nl(e);return t.byteLength>=10&&t.getUint32(0,cn)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Ll),height:t.getUint16(8,Ll)}:null}function vV(e){let t=Nl(e);return t.byteLength>=14&&t.getUint16(0,cn)===16973&&t.getUint32(2,Ll)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Ll),height:t.getUint32(22,Ll)}:null}function wV(e){let t=Nl(e);if(!(t.byteLength>=3&&t.getUint16(0,cn)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=CV(),i=2;for(;i+9<t.byteLength;){let o=t.getUint16(i,cn);if(s.has(o))return{mimeType:"image/jpeg",height:t.getUint16(i+5,cn),width:t.getUint16(i+7,cn)};if(!n.has(o))return null;i+=2,i+=t.getUint16(i,cn)}return null}function CV(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Nl(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function sS(e,t){let{mimeType:r}=Bi(e)||{},n=globalThis.loaders?.parseImageNode;return nt(n),await n(e,r)}async function iS(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:i}=r||{},o=PV(s),a;switch(o){case"imagebitmap":a=await rS(e,t,i);break;case"image":a=await Ld(e,t,i);break;case"data":a=await sS(e,t);break;default:nt(!1)}return s==="data"&&(a=Ol(a)),a}function PV(e){switch(e){case"auto":case"data":return J3();default:return Z3(e),e}}var RV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],IV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],OV={image:{type:"auto",decode:!0}},ln={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:K3,mimeTypes:IV,extensions:RV,parse:iS,tests:[e=>Boolean(Bi(new DataView(e)))],options:OV};var ax={};function cx(e){if(ax[e]===void 0){let t=kn?NV(e):LV(e);ax[e]=t}return ax[e]}function LV(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function NV(e){switch(e){case"image/avif":case"image/webp":return BV(e);default:return!0}}function BV(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var FV=new Ke({id:"deck"}),k=FV;var lx={};function Nd(e){lx=e}function jt(e,t,r,n){k.level>0&&lx[e]&&lx[e].call(null,t,r,n)}function DV(e){let t=e[0],r=e[e.length-1];return t==="{"&&r==="}"||t==="["&&r==="]"}var oS={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:DV,parseTextSync:JSON.parse};function kV(){let e="9.1.12",t=globalThis.deck&&globalThis.deck.VERSION;if(t&&t!==e)throw new Error(`deck.gl - multiple versions detected: ${t} vs ${e}`);return t||(k.log(1,`deck.gl ${e}`)(),globalThis.deck={...globalThis.deck,VERSION:e,version:e,log:k,_registerLoggers:Nd},Il([oS,[ln,{imagebitmap:{premultiplyAlpha:"none"}}]])),e}var Bd=kV();function Fd(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}var hx={number:{type:"number",validate(e,t){return Number.isFinite(e)&&typeof t=="object"&&(t.max===void 0||e<=t.max)&&(t.min===void 0||e>=t.min)}},array:{type:"array",validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function cS(e){let t={};for(let[r,n]of Object.entries(e))t[r]=UV(n);return t}function UV(e){let t=aS(e);if(t!=="object")return{value:e,...hx[t],type:t};if(typeof e=="object")return e?e.type!==void 0?{...e,...hx[e.type],type:e.type}:e.value===void 0?{type:"object",value:e}:(t=aS(e.value),{...e,...hx[t],type:t}):{type:"object",value:null};throw new Error("props")}function aS(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}var lS=`#ifdef MODULE_LOGDEPTH
19
19
  logdepth_adjustPosition(gl_Position);
20
20
  #endif
21
21
  `,hS=`#ifdef MODULE_MATERIAL
@@ -2773,7 +2773,7 @@ void main(void) {
2773
2773
  ${r.source}`}),super(t,{id:r.id||Re("clip-space"),...r,vs:Z7,vertexCount:4,geometry:new it({topology:"triangle-strip",vertexCount:4,attributes:{clipSpacePositions:{size:2,value:new Float32Array(cC)},texCoords:{size:2,value:new Float32Array(n)},coordinates:{size:2,value:new Float32Array(n)}}})})}};var br=class{id;matrix=new K;display=!0;position=new D;rotation=new D;scale=new D(1,1,1);userData={};props={};constructor(t={}){let{id:r}=t;this.id=r||Re(this.constructor.name),this._setScenegraphNodeProps(t)}getBounds(){return null}destroy(){}delete(){this.destroy()}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(t){return this.position=t,this}setRotation(t){return this.rotation=t,this}setScale(t){return this.scale=t,this}setMatrix(t,r=!0){r?this.matrix.copy(t):this.matrix=t}setMatrixComponents(t){let{position:r,rotation:n,scale:s,update:i=!0}=t;return r&&this.setPosition(r),n&&this.setRotation(n),s&&this.setScale(s),i&&this.updateMatrix(),this}updateMatrix(){let t=this.position,r=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(r),this.matrix.scale(n),this}update(t={}){let{position:r,rotation:n,scale:s}=t;return r&&this.setPosition(r),n&&this.setRotation(n),s&&this.setScale(s),this.updateMatrix(),this}getCoordinateUniforms(t,r){r=r||this.matrix;let n=new K(t).multiplyRight(r),s=n.invert(),i=s.transpose();return{viewMatrix:t,modelMatrix:r,objectMatrix:r,worldMatrix:n,worldInverseMatrix:s,worldInverseTransposeMatrix:i}}_setScenegraphNodeProps(t){"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}};var hr=class extends br{children;constructor(t={}){t=Array.isArray(t)?{children:t}:t;let{children:r=[]}=t;F.assert(r.every(n=>n instanceof br),"every child must an instance of ScenegraphNode"),super(t),this.children=r}getBounds(){let t=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse((r,{worldMatrix:n})=>{let s=r.getBounds();if(!s)return;let[i,o]=s,a=new D(i).add(o).divide([2,2,2]);n.transformAsPoint(a,a);let c=new D(o).subtract(i).divide([2,2,2]);n.transformAsVector(c,c);for(let l=0;l<8;l++){let h=new D(l&1?-1:1,l&2?-1:1,l&4?-1:1).multiply(c).add(a);for(let f=0;f<3;f++)t[0][f]=Math.min(t[0][f],h[f]),t[1][f]=Math.max(t[1][f],h[f])}}),Number.isFinite(t[0][0])?t:null}destroy(){this.children.forEach(t=>t.destroy()),this.removeAll(),super.destroy()}add(...t){for(let r of t)Array.isArray(r)?this.add(...r):this.children.push(r);return this}remove(t){let r=this.children,n=r.indexOf(t);return n>-1&&r.splice(n,1),this}removeAll(){return this.children=[],this}traverse(t,{worldMatrix:r=new K}={}){let n=new K(r).multiplyRight(this.matrix);for(let s of this.children)s instanceof hr?s.traverse(t,{worldMatrix:n}):t(s,{worldMatrix:n})}};var mn=class extends br{model;bounds=null;managedResources;constructor(t){super(t),this.model=t.model,this.managedResources=t.managedResources||[],this.bounds=t.bounds||null,this.setProps(t)}destroy(){this.model&&(this.model.destroy(),this.model=null),this.managedResources.forEach(t=>t.destroy()),this.managedResources=[]}getBounds(){return this.bounds}draw(t){return this.model.draw(t)}};var Zn=class extends it{constructor(t={}){let{id:r=Re("cube-geometry"),indices:n=!0}=t;super(n?{...t,id:r,topology:"triangle-list",indices:{size:1,value:J7},attributes:{...iq,...t.attributes}}:{...t,id:r,topology:"triangle-list",indices:void 0,attributes:{...oq,...t.attributes}})}},J7=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Q7=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),tq=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),eq=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),rq=new Float32Array([1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),nq=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),sq=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),iq={POSITION:{size:3,value:Q7},NORMAL:{size:3,value:tq},TEXCOORD_0:{size:2,value:eq}},oq={POSITION:{size:3,value:rq},TEXCOORD_0:{size:2,value:nq},COLOR_0:{size:3,value:sq}};var Ch=class extends it{constructor(t={}){let{id:r=Re("sphere-geometry")}=t,{indices:n,attributes:s}=aq(t);super({...t,id:r,topology:"triangle-list",indices:n,attributes:{...s,...t.attributes}})}};function aq(e){let{nlat:t=10,nlong:r=10}=e,i=Math.PI-0,o=0,c=2*Math.PI-o,l=(t+1)*(r+1),h=(_,y,x,A,M)=>e.radius||1,f=new Float32Array(l*3),u=new Float32Array(l*3),d=new Float32Array(l*2),p=l>65535?Uint32Array:Uint16Array,m=new p(t*r*6);for(let _=0;_<=t;_++)for(let y=0;y<=r;y++){let x=y/r,A=_/t,M=y+_*(r+1),E=M*2,w=M*3,v=c*x,b=i*A,T=Math.sin(v),I=Math.cos(v),B=Math.sin(b),N=Math.cos(b),C=I*B,V=N,tt=T*B,J=h(C,V,tt,x,A);f[w+0]=J*C,f[w+1]=J*V,f[w+2]=J*tt,u[w+0]=C,u[w+1]=V,u[w+2]=tt,d[E+0]=x,d[E+1]=1-A}let g=r+1;for(let _=0;_<r;_++)for(let y=0;y<t;y++){let x=(_*t+y)*6;m[x+0]=y*g+_,m[x+1]=y*g+_+1,m[x+2]=(y+1)*g+_,m[x+3]=(y+1)*g+_,m[x+4]=y*g+_+1,m[x+5]=(y+1)*g+_+1}return{indices:{size:1,value:m},attributes:{POSITION:{size:3,value:f},NORMAL:{size:3,value:u},TEXCOORD_0:{size:2,value:d}}}}var cq=`uniform screenUniforms {
2774
2774
  vec2 texSize;
2775
2775
  } screen;
2776
- `,lC={name:"screen",fs:cq,uniformTypes:{texSize:"vec2<f32>"}};var Ph=class extends Xi{constructor(t,r){super(t,r);let{module:n,fs:s,id:i}=r,o={depthWriteEnabled:!1,depthCompare:"always"};this.model=new wh(t,{id:i,fs:s,modules:[n,lC],parameters:o})}render(t){this._renderPass(this.device,t)}delete(){this.model.destroy(),this.model=null}_renderPass(t,r){let{clearCanvas:n,inputBuffer:s,outputBuffer:i}=r,o=[s.width,s.height],a={texSrc:s.colorAttachments[0],texSize:o};this.model.shaderInputs.setProps({screen:a,...r.moduleProps});let c=this.device.beginRenderPass({framebuffer:i,parameters:{viewport:[0,0,...o]},clearColor:n?[0,0,0,0]:!1,clearDepth:1});this.model.draw(c),c.end()}};var Rh=class{constructor(t,r){this.id=`${t.name}-pass`,this.props=r,Dd(t),this.module=t}setup({device:t}){this.passes=lq(t,this.module,this.id)}setProps(t){this.props=t}preRender(){}postRender(t){let r=this.passes,{target:n}=t,s=t.inputBuffer,i=t.swapBuffer;for(let o=0;o<r.length;o++){let a=o===r.length-1,c=n!==void 0&&a;c&&(i=n);let l=!c||Boolean(t.clearCanvas),h={},f=this.module.passes[o].uniforms;h[this.module.name]={...this.props,...f},r[o].render({clearCanvas:l,inputBuffer:s,outputBuffer:i,moduleProps:h});let u=i;i=s,s=u}return s}cleanup(){if(this.passes){for(let t of this.passes)t.delete();this.passes=void 0}}};function lq(e,t,r){return t.passes.map((n,s)=>{let i=uq(t,n),o=`${r}-${s}`;return new Ph(e,{id:o,module:t,fs:i})})}var hC=`#version 300 es
2776
+ `,lC={name:"screen",fs:cq,uniformTypes:{texSize:"vec2<f32>"}};var Ph=class extends Xi{constructor(t,r){super(t,r);let{module:n,fs:s,id:i}=r,o={depthWriteEnabled:!1,depthCompare:"always"};this.model=new wh(t,{id:i,fs:s,modules:[n,lC],parameters:o})}render(t){this._renderPass(this.device,t)}delete(){this.model.destroy(),this.model=null}_renderPass(t,r){let{clearCanvas:n,inputBuffer:s,outputBuffer:i}=r,o=[s.width,s.height],a={texSrc:s.colorAttachments[0],texSize:o};this.model.shaderInputs.setProps({screen:a,...r.moduleProps});let c=this.device.beginRenderPass({framebuffer:i,parameters:{viewport:[0,0,...o]},clearColor:n?[0,0,0,0]:!1,clearDepth:1,clearStencil:!1});this.model.draw(c),c.end()}};var Rh=class{constructor(t,r){this.id=`${t.name}-pass`,this.props=r,Dd(t),this.module=t}setup({device:t}){this.passes=lq(t,this.module,this.id)}setProps(t){this.props=t}preRender(){}postRender(t){let r=this.passes,{target:n}=t,s=t.inputBuffer,i=t.swapBuffer;for(let o=0;o<r.length;o++){let a=o===r.length-1,c=n!==void 0&&a;c&&(i=n);let l=!c||Boolean(t.clearCanvas),h={},f=this.module.passes[o].uniforms;h[this.module.name]={...this.props,...f},r[o].render({clearCanvas:l,inputBuffer:s,outputBuffer:i,moduleProps:h});let u=i;i=s,s=u}return s}cleanup(){if(this.passes){for(let t of this.passes)t.delete();this.passes=void 0}}};function lq(e,t,r){return t.passes.map((n,s)=>{let i=uq(t,n),o=`${r}-${s}`;return new Ph(e,{id:o,module:t,fs:i})})}var hC=`#version 300 es
2777
2777
  uniform sampler2D texSrc;
2778
2778
 
2779
2779
  in vec2 position;
@@ -4450,7 +4450,7 @@ fragColor = vFillColor;
4450
4450
  }
4451
4451
  DECKGL_FILTER_COLOR(fragColor, geometry);
4452
4452
  }
4453
- `;var iK={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,borderRadius:{type:"object",value:0},padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:e=>e.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}},Ff=class extends ut{getShaders(){return super.getShaders({vs:OI,fs:LI,modules:[st,Tt,II]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){super.updateState(t);let{changeFlags:r}=t;r.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:t}){let{billboard:r,sizeScale:n,sizeUnits:s,sizeMinPixels:i,sizeMaxPixels:o,getLineWidth:a}=this.props,{padding:c,borderRadius:l}=this.props;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),Array.isArray(l)||(l=[l,l,l,l]);let h=this.state.model,f={billboard:r,stroked:Boolean(a),borderRadius:l,padding:c,sizeUnits:St[s],sizeScale:n,sizeMinPixels:i,sizeMaxPixels:o};h.shaderInputs.setProps({textBackground:f}),h.draw(this.context.renderPass)}_getModel(){let t=[0,0,1,0,0,1,1,1];return new X(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new it({topology:"triangle-strip",vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(t)}}}),isInstanced:!0})}};Ff.defaultProps=iK;Ff.layerName="TextBackgroundLayer";var Ag=Ff;var NI={start:1,middle:0,end:-1},BI={top:1,center:0,bottom:-1},PA=[0,0,0,255],oK=1,aK={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:PA},getBorderWidth:{type:"accessor",value:0},backgroundBorderRadius:{type:"object",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:xo.characterSet},fontFamily:xo.fontFamily,fontWeight:xo.fontWeight,lineHeight:oK,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:PA},fontSettings:{type:"object",value:{},compare:1},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:e=>e.text},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:PA},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}},Df=class extends Dt{constructor(){super(...arguments),this.getBoundingRect=(t,r)=>{let{size:[n,s]}=this.transformParagraph(t,r),{fontSize:i}=this.state.fontAtlasManager.props;n/=i,s/=i;let{getTextAnchor:o,getAlignmentBaseline:a}=this.props,c=NI[typeof o=="function"?o(t,r):o],l=BI[typeof a=="function"?a(t,r):a];return[(c-1)*n/2,(l-1)*s/2,n,s]},this.getIconOffsets=(t,r)=>{let{getTextAnchor:n,getAlignmentBaseline:s}=this.props,{x:i,y:o,rowWidth:a,size:[c,l]}=this.transformParagraph(t,r),h=NI[typeof n=="function"?n(t,r):n],f=BI[typeof s=="function"?s(t,r):s],u=i.length,d=new Array(u*2),p=0;for(let m=0;m<u;m++){let g=(1-h)*(c-a[m])/2;d[p++]=(h-1)*c/2+g+i[m],d[p++]=(f-1)*l/2+o[m]}return d}}initializeState(){this.state={styleVersion:0,fontAtlasManager:new Bf},this.props.maxWidth>0&&k.warn("v8.9 breaking change: TextLayer maxWidth is now relative to text size")()}updateState(t){let{props:r,oldProps:n,changeFlags:s}=t;(s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getText))&&this._updateText(),(this._updateFontAtlas()||r.lineHeight!==n.lineHeight||r.wordBreak!==n.wordBreak||r.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(){let{fontSettings:t,fontFamily:r,fontWeight:n}=this.props,{fontAtlasManager:s,characterSet:i}=this.state,o={...t,characterSet:i,fontFamily:r,fontWeight:n};if(!s.mapping)return s.setProps(o),!0;for(let a in o)if(o[a]!==s.props[a])return s.setProps(o),!0;return!1}_updateText(){let{data:t,characterSet:r}=this.props,n=t.attributes?.getText,{getText:s}=this.props,i=t.startIndices,o,a=r==="auto"&&new Set;if(n&&i){let{texts:c,characterCount:l}=EI({...ArrayBuffer.isView(n)?{value:n}:n,length:t.length,startIndices:i,characterSet:a});o=l,s=(h,{index:f})=>c[f]}else{let{iterable:c,objectInfo:l}=$t(t);i=[0],o=0;for(let h of c){l.index++;let f=Array.from(s(h,l)||"");a&&f.forEach(a.add,a),o+=f.length,i.push(o)}}this.setState({getText:s,startIndices:i,numInstances:o,characterSet:a||r})}transformParagraph(t,r){let{fontAtlasManager:n}=this.state,s=n.mapping,i=this.state.getText,{wordBreak:o,lineHeight:a,maxWidth:c}=this.props,l=i(t,r)||"";return MI(l,a,o,c*n.props.fontSize,s)}renderLayers(){let{startIndices:t,numInstances:r,getText:n,fontAtlasManager:{scale:s,atlas:i,mapping:o},styleVersion:a}=this.state,{data:c,_dataDiff:l,getPosition:h,getColor:f,getSize:u,getAngle:d,getPixelOffset:p,getBackgroundColor:m,getBorderColor:g,getBorderWidth:_,backgroundBorderRadius:y,backgroundPadding:x,background:A,billboard:M,fontSettings:E,outlineWidth:w,outlineColor:v,sizeScale:b,sizeUnits:T,sizeMinPixels:I,sizeMaxPixels:B,transitions:N,updateTriggers:C}=this.props,V=this.getSubLayerClass("characters",xg),tt=this.getSubLayerClass("background",Ag);return[A&&new tt({getFillColor:m,getLineColor:g,getLineWidth:_,borderRadius:y,padding:x,getPosition:h,getSize:u,getAngle:d,getPixelOffset:p,billboard:M,sizeScale:b,sizeUnits:T,sizeMinPixels:I,sizeMaxPixels:B,transitions:N&&{getPosition:N.getPosition,getAngle:N.getAngle,getSize:N.getSize,getFillColor:N.getBackgroundColor,getLineColor:N.getBorderColor,getLineWidth:N.getBorderWidth,getPixelOffset:N.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:C.getPosition,getAngle:C.getAngle,getSize:C.getSize,getFillColor:C.getBackgroundColor,getLineColor:C.getBorderColor,getLineWidth:C.getBorderWidth,getPixelOffset:C.getPixelOffset,getBoundingRect:{getText:C.getText,getTextAnchor:C.getTextAnchor,getAlignmentBaseline:C.getAlignmentBaseline,styleVersion:a}}}),{data:c.attributes&&c.attributes.background?{length:c.length,attributes:c.attributes.background}:c,_dataDiff:l,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new V({sdf:E.sdf,smoothing:Number.isFinite(E.smoothing)?E.smoothing:xo.smoothing,outlineWidth:w/(E.radius||xo.radius),outlineColor:v,iconAtlas:i,iconMapping:o,getPosition:h,getColor:f,getSize:u,getAngle:d,getPixelOffset:p,billboard:M,sizeScale:b*s,sizeUnits:T,sizeMinPixels:I*s,sizeMaxPixels:B*s,transitions:N&&{getPosition:N.getPosition,getAngle:N.getAngle,getColor:N.getColor,getSize:N.getSize,getPixelOffset:N.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{all:C.getText,getPosition:C.getPosition,getAngle:C.getAngle,getColor:C.getColor,getSize:C.getSize,getPixelOffset:C.getPixelOffset,getIconOffsets:{getTextAnchor:C.getTextAnchor,getAlignmentBaseline:C.getAlignmentBaseline,styleVersion:a}}}),{data:c,_dataDiff:l,startIndices:t,numInstances:r,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(t){PI(t)}};Df.defaultProps=aK;Df.layerName="TextLayer";var Tg=Df;var kf={circle:{type:ng,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:Za,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:Tg,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},Uf={type:bn,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},Mg={type:ri,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",_full3d:"_full3d",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function rc({type:e,props:t}){let r={};for(let n in t)r[n]=e.defaultProps[t[n]];return r}function Eg(e,t){let{transitions:r,updateTriggers:n}=e.props,s={updateTriggers:{},transitions:r&&{getPosition:r.geometry}};for(let i in t){let o=t[i],a=e.props[i];i.startsWith("get")&&(a=e.getSubLayerAccessor(a),s.updateTriggers[o]=n[i],r&&(s.transitions[o]=r[i])),s[o]=a}return s}function DI(e){if(Array.isArray(e))return e;switch(k.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return k.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}function RA(e,t,r={}){let n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:s=0,endRow:i=e.length}=r;for(let o=s;o<i;o++){let a=e[o],{geometry:c}=a;if(c)if(c.type==="GeometryCollection"){k.assert(Array.isArray(c.geometries),"GeoJSON does not have geometries array");let{geometries:l}=c;for(let h=0;h<l.length;h++){let f=l[h];FI(f,n,t,a,o)}}else FI(c,n,t,a,o)}return n}function FI(e,t,r,n,s){let{type:i,coordinates:o}=e,{pointFeatures:a,lineFeatures:c,polygonFeatures:l,polygonOutlineFeatures:h}=t;if(!lK(i,o)){k.warn(`${i} coordinates are malformed`)();return}switch(i){case"Point":a.push(r({geometry:e},n,s));break;case"MultiPoint":o.forEach(f=>{a.push(r({geometry:{type:"Point",coordinates:f}},n,s))});break;case"LineString":c.push(r({geometry:e},n,s));break;case"MultiLineString":o.forEach(f=>{c.push(r({geometry:{type:"LineString",coordinates:f}},n,s))});break;case"Polygon":l.push(r({geometry:e},n,s)),o.forEach(f=>{h.push(r({geometry:{type:"LineString",coordinates:f}},n,s))});break;case"MultiPolygon":o.forEach(f=>{l.push(r({geometry:{type:"Polygon",coordinates:f}},n,s)),f.forEach(u=>{h.push(r({geometry:{type:"LineString",coordinates:u}},n,s))})});break;default:}}var cK={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function lK(e,t){let r=cK[e];for(k.assert(r,`Unknown GeoJSON type ${e}`);t&&--r>0;)t=t[0];return t&&Number.isFinite(t[0])}function kI(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function bg(e){return e.geometry.coordinates}function UI(e,t){let r=kI(),{pointFeatures:n,lineFeatures:s,polygonFeatures:i,polygonOutlineFeatures:o}=e;return r.points.data=n,r.points._dataDiff=t.pointFeatures&&(()=>t.pointFeatures),r.points.getPosition=bg,r.lines.data=s,r.lines._dataDiff=t.lineFeatures&&(()=>t.lineFeatures),r.lines.getPath=bg,r.polygons.data=i,r.polygons._dataDiff=t.polygonFeatures&&(()=>t.polygonFeatures),r.polygons.getPolygon=bg,r.polygonsOutline.data=o,r.polygonsOutline._dataDiff=t.polygonOutlineFeatures&&(()=>t.polygonOutlineFeatures),r.polygonsOutline.getPath=bg,r}function zI(e,t){let r=kI(),{points:n,lines:s,polygons:i}=e,o=uI(e,t);return r.points.data={length:n.positions.value.length/n.positions.size,attributes:{...n.attributes,getPosition:n.positions,instancePickingColors:{size:4,value:o.points}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},r.lines.data={length:s.pathIndices.value.length-1,startIndices:s.pathIndices.value,attributes:{...s.attributes,getPath:s.positions,instancePickingColors:{size:4,value:o.lines}},properties:s.properties,numericProps:s.numericProps,featureIds:s.featureIds},r.lines._pathType="open",r.polygons.data={length:i.polygonIndices.value.length-1,startIndices:i.polygonIndices.value,attributes:{...i.attributes,getPolygon:i.positions,pickingColors:{size:4,value:o.polygons}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.polygons._normalize=!1,i.triangles&&(r.polygons.data.attributes.indices=i.triangles.value),r.polygonsOutline.data={length:i.primitivePolygonIndices.value.length-1,startIndices:i.primitivePolygonIndices.value,attributes:{...i.attributes,getPath:i.positions,instancePickingColors:{size:4,value:o.polygons}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.polygonsOutline._pathType="open",r}var hK=["points","linestrings","polygons"],fK={...rc(kf.circle),...rc(kf.icon),...rc(kf.text),...rc(Uf),...rc(Mg),stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:e=>e.properties.icon},getText:{type:"accessor",value:e=>e.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}},zf=class extends Dt{initializeState(){this.state={layerProps:{},features:{},featuresDiff:{}}}updateState({props:t,changeFlags:r}){if(!r.dataChanged)return;let{data:n}=this.props,s=n&&"points"in n&&"polygons"in n&&"lines"in n;this.setState({binary:s}),s?this._updateStateBinary({props:t,changeFlags:r}):this._updateStateJSON({props:t,changeFlags:r})}_updateStateBinary({props:t,changeFlags:r}){let n=zI(t.data,this.encodePickingColor);this.setState({layerProps:n})}_updateStateJSON({props:t,changeFlags:r}){let n=DI(t.data),s=this.getSubLayerRow.bind(this),i={},o={};if(Array.isArray(r.dataChanged)){let c=this.state.features;for(let l in c)i[l]=c[l].slice(),o[l]=[];for(let l of r.dataChanged){let h=RA(n,s,l);for(let f in c)o[f].push(_g({data:i[f],getIndex:u=>u.__source.index,dataRange:l,replace:h[f]}))}}else i=RA(n,s);let a=UI(i,o);this.setState({features:i,featuresDiff:o,layerProps:a})}getPickingInfo(t){let r=super.getPickingInfo(t),{index:n,sourceLayer:s}=r;return r.featureType=hK.find(i=>s.id.startsWith(`${this.id}-${i}-`)),n>=0&&s.id.startsWith(`${this.id}-points-text`)&&this.state.binary&&(r.index=this.props.data.points.globalFeatureIds.value[n]),r}_updateAutoHighlight(t){let r=`${this.id}-points-`,n=t.featureType==="points";for(let s of this.getSubLayers())s.id.startsWith(r)===n&&s.updateAutoHighlight(t)}_renderPolygonLayer(){let{extruded:t,wireframe:r}=this.props,{layerProps:n}=this.state,s="polygons-fill",i=this.shouldRenderSubLayer(s,n.polygons?.data)&&this.getSubLayerClass(s,Mg.type);if(i){let o=Eg(this,Mg.props),a=t&&r;return a||delete o.getLineColor,o.updateTriggers.lineColors=a,new i(o,this.getSubLayerProps({id:s,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){let{extruded:t,stroked:r}=this.props,{layerProps:n}=this.state,s="polygons-stroke",i="linestrings",o=!t&&r&&this.shouldRenderSubLayer(s,n.polygonsOutline?.data)&&this.getSubLayerClass(s,Uf.type),a=this.shouldRenderSubLayer(i,n.lines?.data)&&this.getSubLayerClass(i,Uf.type);if(o||a){let c=Eg(this,Uf.props);return[o&&new o(c,this.getSubLayerProps({id:s,updateTriggers:c.updateTriggers}),n.polygonsOutline),a&&new a(c,this.getSubLayerProps({id:i,updateTriggers:c.updateTriggers}),n.lines)]}return null}_renderPointLayers(){let{pointType:t}=this.props,{layerProps:r,binary:n}=this.state,{highlightedObjectIndex:s}=this.props;!n&&Number.isFinite(s)&&(s=r.points.data.findIndex(a=>a.__source.index===s));let i=new Set(t.split("+")),o=[];for(let a of i){let c=`points-${a}`,l=kf[a],h=l&&this.shouldRenderSubLayer(c,r.points?.data)&&this.getSubLayerClass(c,l.type);if(h){let f=Eg(this,l.props),u=r.points;if(a==="text"&&n){let{instancePickingColors:d,...p}=u.data.attributes;u={...u,data:{...u.data,attributes:p}}}o.push(new h(f,this.getSubLayerProps({id:c,updateTriggers:f.updateTriggers,highlightedObjectIndex:s}),u))}}return o}renderLayers(){let{extruded:t}=this.props,r=this._renderPolygonLayer(),n=this._renderLineLayers(),s=this._renderPointLayers();return[!t&&r,n,s,t&&r]}getSubLayerAccessor(t){let{binary:r}=this.state;return!r||typeof t!="function"?super.getSubLayerAccessor(t):(n,s)=>{let{data:i,index:o}=s,a=fI(i,o);return t(a,s)}}};zf.layerName="GeoJsonLayer";zf.defaultProps=fK;var yo=zf;function uK(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function Sg(e){if(Array.isArray(e))return e.map(t=>Sg(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[uK(r)]=Sg(n);return t}return e}var yO=Dn(xO(),1);function UA(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(s,i,o,a)=>Boolean(t?.arrayPaths?.some(l=>i===l)),...t?._fastXML},n=TZ(e,r);return t?.uncapitalizeKeys?Sg(n):n}function TZ(e,t){return new yO.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var MZ="4.2.1",$r={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:MZ,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:EZ,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>UA(new TextDecoder().decode(e),{...$r.options.xml,...t?.xml}),parseTextSync:(e,t)=>UA(e,{...$r.options.xml,...t?.xml})};function EZ(e){return e.startsWith("<?xml")}function AO(e,t){let r=$r.parseTextSync?.(e,t),n=r?.ServiceExceptionReport?.ServiceException||r?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return typeof n=="string"?n:n.value||n.code||"Unknown error"}var bZ="4.2.1",Wf={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:bZ,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:SZ,options:{wms:{throwOnError:!1}},parse:async(e,t)=>zA(new TextDecoder().decode(e),t),parseSync:(e,t)=>zA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>zA(e,t)};function SZ(e){return e.startsWith("<?xml")}function zA(e,t){let r={...Wf.options.wms,...t?.wms},n=AO(e,r),s=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(s);return s}function To(e){return Array.isArray(e)?e:e?[e]:[]}function Gf(e){let t=To(e);return t.length>0&&t.every(r=>typeof r=="string")?t:[]}function jf(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseFloat(e);default:return}}function wg(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseInt(e,10);default:return}}function Mo(e){switch(e){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function VA(e,t){let r=$r.parseTextSync?.(e,t),n=r.WMT_MS_Capabilities||r.WMS_Capabilities||r,s=vZ(n);if(t?.inheritedLayerProps)for(let i of s.layers)MO(i,null);return t?.includeRawJSON&&(s.json=n),t?.includeXMLText&&(s.xml=e),s}function vZ(e){let t={version:String(e.version||""),name:String(e.Service?.Name||"unnamed"),title:e.Service?.Title?String(e.Service?.Title):void 0,abstract:e.Service?.Abstract?String(e.Service?.Abstract):void 0,keywords:Gf(e.Service?.KeywordList?.Keyword),fees:e.Service?.Fees?JSON.stringify(e.Service?.Fees):void 0,accessConstraints:e.Service?.AccessConstraints?JSON.stringify(e.Service?.AccessConstraints):void 0,layerLimit:wg(e.Service?.LayerLimit),maxWidth:wg(e.Service?.maxWidth),maxHeight:wg(e.Service?.maxHeight),layers:[],requests:wZ(e.Capability?.Request),exceptions:CZ(e.Exception)},r=To(e.Capability?.Layer);for(let n of r)t.layers.push(TO(n));for(let[n,s]of Object.entries(t))s===void 0&&delete t[n];return t}function wZ(e){let t={};for(let[r,n]of Object.entries(e||{})){let s=Gf(n?.Format);t[r]={mimeTypes:s}}return t}function CZ(e){if(To(e?.Format).length>0)return{mimeTypes:Gf(e)}}function TO(e){let t={title:String(e?.Title||""),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:Gf(e.KeywordList?.Keyword)},r=e?.CRS||e?.SRS;r&&Array.isArray(r)&&r.every(l=>typeof l=="string")&&(t.crs=r);let n=e?.EX_GeographicBoundingBox&&PZ(e?.EX_GeographicBoundingBox);n&&(t.geographicBoundingBox=n),n=e?.LatLonBoundingBox&&RZ(e?.LatLonBoundingBox),n&&(t.geographicBoundingBox=n);let s=e?.BoundingBox&&IZ(e?.BoundingBox);s&&s.length>0&&(t.boundingBoxes=s);let o=To(e?.Dimension).map(l=>LZ(l));o.length&&(t.dimensions=o),e?.opaque&&(t.opaque=Mo(e?.opaque)),e?.cascaded&&(t.cascaded=Mo(e?.cascaded)),e?.queryable&&(t.queryable=Mo(e?.queryable));let a=To(e?.Layer),c=[];for(let l of a)c.push(TO(l));c.length>0&&(t.layers=c);for(let[l,h]of Object.entries(t))h===void 0&&delete t[l];return t}function PZ(e){let{westBoundLongitude:t,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:s}=e;return[[t,s],[n,r]]}function RZ(e){let{minx:t,miny:r,maxx:n,maxy:s}=e;return[[t,r],[n,s]]}function IZ(e){return To(e).map(r=>OZ(r))}function OZ(e){let{CRS:t,SRS:r,minx:n,miny:s,maxx:i,maxy:o,resx:a,resy:c}=e,l={crs:t||r,boundingBox:[[jf(n),jf(s)],[jf(i),jf(o)]]};return a&&(l.xResolution=a),c&&(l.yResolution=c),l}function LZ(e){let{name:t,units:r,value:n}=e,s={name:t,units:r,extent:n};return e.unitSymbol&&(s.unitSymbol=e.unitSymbol),e.default&&(s.defaultValue=e.default),e.multipleValues&&(s.multipleValues=Mo(e.multipleValues)),e.nearestValue&&(s.nearestValue=Mo(e.nearestValue)),e.current&&(s.current=Mo(e.current)),s}function MO(e,t){t?.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=[...t.geographicBoundingBox]),t?.crs&&!e.crs&&(e.crs=[...t.crs]),t?.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=[...t.boundingBoxes]),t?.dimensions&&!e.dimensions&&(e.dimensions=[...t.dimensions]);for(let r of e.layers||[])MO(r,e)}var NZ="4.2.1",nc={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:NZ,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:BZ,options:{wms:{}},parse:async(e,t)=>VA(new TextDecoder().decode(e),t?.wms),parseTextSync:(e,t)=>VA(e,t?.wms)};function BZ(e){return e.startsWith("<?xml")}function HA(e,t){let n=($r.parseTextSync?.(e,t)).FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(n)?n:[n]).map(i=>FZ(i))}}function FZ(e){return{attributes:e||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var EO={...nc,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(e,t)=>HA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>HA(e,t)};function WA(e,t){return $r.parseTextSync?.(e,t)}var bO={...nc,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(e,t)=>WA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>WA(e,t)};function SO(e,t){let{type:r="auto"}=e,n=r==="auto"?kZ(e.url,t):DZ(r,t);if(!n)throw new Error("Not a valid image source type");return n.create(e)}function DZ(e,t){for(let r of t)if(r.type===e)return r;return null}function kZ(e,t){for(let r of t)if(r.testURL&&r.testURL(e))return r;return null}var vO={type:"wms",testURL:e=>e.toLowerCase().includes("wms"),create:e=>new GA(e)},GA=class extends mr{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(t){super(t),this.url=t.url,this.data=t.url,this.substituteCRS84=t.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters},this.vendorParameters=t.vendorParameters||{}}async getMetadata(){let t=await this.getCapabilities();return this.normalizeMetadata(t)}async getImage(t){let{boundingBox:r,bbox:n,...s}=t,i={bbox:r?[...r[0],...r[1]]:n,...s};return await this.getMap(i)}normalizeMetadata(t){return t}async getCapabilities(t,r){let n=this.getCapabilitiesURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);let o=await nc.parse(i,this.loadOptions);return this.capabilities=o,o}async getMap(t,r){let n=this.getMapURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);try{return await ln.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}async getFeatureInfo(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),await EO.parse(i,this.loadOptions)}async getFeatureInfoText(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),new TextDecoder().decode(i)}async describeLayer(t,r){let n=this.describeLayerURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),await bO.parse(i,this.loadOptions)}async getLegendGraphic(t,r){let n=this.getLegendGraphicURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);try{return await ln.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}getCapabilitiesURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(t,r){t=this._getWMS130Parameters(t);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(t,r){t=this._getWMS130Parameters(t);let{boundingBox:n,bbox:s}=t;t.bbox=n?[...n[0],...n[1]]:s;let i={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetFeatureInfo",i,r)}describeLayerURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(t){let[r,n]=t.split("?"),s=n.split("&"),i={};for(let o of s){let[a,c]=o.split("=");i[a]=c}return{url:r,parameters:i}}_getWMSUrl(t,r,n){let s=this.url,i=!0,o={service:"WMS",version:r.version,request:t,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,l]of Object.entries(o))(!a.includes(c)||l)&&(s+=i?"?":"&",i=!1,s+=this._getURLParameter(c,l,r));return encodeURI(s)}_getWMS130Parameters(t){let r={...t};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(t,r,n){switch(t){case"crs":n.version!=="1.3.0"?t="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(t="crs");break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;case"x":n.version==="1.3.0"&&(t="i");break;case"y":n.version==="1.3.0"&&(t="j");break;default:}return t=t.toUpperCase(),Array.isArray(r)?`${t}=${r.join(",")}`:`${t}=${r?String(r):""}`}_flipBoundingBox(t,r){if(!Array.isArray(t)||t.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),s=t;return n?[s[1],s[0],s[3],s[2]]:s}async _fetchArrayBuffer(t){let r=await this.fetch(t),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(t,r){let n=t.headers["content-type"];if(!t.ok||Wf.mimeTypes.includes(n)){let s=yl(this.loadOptions,{wms:{throwOnError:!0}}),i=Wf.parseSync?.(r,s);throw new Error(i)}}_parseError(t){let r=Wf.parseSync?.(t,this.loadOptions);return new Error(r)}};var sc=class extends mr{constructor(t){super(t)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(t){let r=this.getGranularParameters(t),n=this.getURLFromTemplate(r),i=await(await this.fetch(n)).arrayBuffer();return await ln.parse(i)}getGranularParameters(t){let[[r,n],[s,i]]=t.boundingBox;return{...t,east:r,north:n,south:i,west:s}}getURLFromTemplate(t){let r=this.props.url;for(let[n,s]of Object.entries(t))r=r.replace(`\${${n}}`,String(s)),r=r.replace(`{${n}}`,String(s));return r}};W(sc,"type","template"),W(sc,"testURL",t=>t.toLowerCase().includes("{"));var jA=class extends sc{data;constructor(t){super(t),this.data=t.url}async getMetadata(){return await this.metadata()}async getImage(t){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(t){throw new Error("not implemented")}metadataURL(t){return`${this.props.url}?f=pjson`}exportImageURL(t){let r=`bbox=${t.bbox[0]},${t.bbox[1]},${t.bbox[2]},${t.bbox[3]}`,n=`size=${t.width},${t.height}`,s={...t,bbox:r,size:n};return delete s.width,delete s.height,this.getUrl("exportImage",s)}getUrl(t,r,n){let s=`${this.props.url}/${t}`,i=!0;for(let[o,a]of Object.entries(r))s+=i?"?":"&",i=!1,Array.isArray(a)?s+=`${o.toUpperCase()}=${a.join(",")}`:s+=`${o.toUpperCase()}=${a?String(a):""}`;return s}async checkResponse(t){if(!t.ok)throw new Error("error")}},wO={type:"arcgis-image-server",testURL:e=>e.toLowerCase().includes("ImageServer"),create:e=>new jA(e)};var UZ=[vO,wO];function qA(e){return SO(e,UZ)}var CO=6378137*Math.PI;function YA(e){let t=Kt(e);return t[0]=(t[0]/256-1)*CO,t[1]=(t[1]/256-1)*CO,t}var zZ={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(e,t)=>console.error(t,e)}},ic=class extends Dt{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:t,props:r,oldProps:n}){let{viewport:s}=this.context;t.dataChanged||r.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(r),this._loadMetadata(),this.debounce(()=>this.loadImage(s,"image source changed"),0)):Q(r.layers,n.layers,1)?t.viewportChanged&&this.debounce(()=>this.loadImage(s,"viewport changed")):this.debounce(()=>this.loadImage(s,"layers changed"),0)}finalizeState(){}renderLayers(){let{bounds:t,image:r,lastRequestParameters:n}=this.state;return r&&new eg({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:n.srs==="EPSG:4326"?H.LNGLAT:H.CARTESIAN,bounds:t,image:r})}async getFeatureInfoText(t,r){let{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:t,y:r,info_format:"application/vnd.ogc.gml"}):""}_createImageSource(t){if(t.data instanceof mr)return t.data;if(typeof t.data=="string")return qA({url:t.data,loadOptions:t.loadOptions,type:t.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){let{imageSource:t}=this.state;try{this.state.loadCounter++;let r=await t.getMetadata();this.state.imageSource===t&&this.getCurrentLayer()?.props.onMetadataLoad(r)}catch(r){this.getCurrentLayer()?.props.onMetadataLoadError(r)}finally{this.state.loadCounter--}}async loadImage(t,r){let{layers:n,serviceType:s}=this.props;if(s==="wms"&&n.length===0)return;let i=t.getBounds(),{width:o,height:a}=t,c=this.getRequestId(),{srs:l}=this.props;l==="auto"&&(l=t.resolution?"EPSG:4326":"EPSG:3857");let h={width:o,height:a,boundingBox:[[i[0],i[1]],[i[2],i[3]]],layers:n,crs:l};if(l==="EPSG:3857"){let f=YA([i[0],i[1]]),u=YA([i[2],i[3]]);h.boundingBox=[f,u]}try{this.state.loadCounter++,this.props.onImageLoadStart(c);let f=await this.state.imageSource.getImage(h);this.state.lastRequestId<c&&(this.getCurrentLayer()?.props.onImageLoad(c),this.setState({image:f,bounds:i,lastRequestParameters:h,lastRequestId:c}))}catch(f){this.raiseError(f,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(c,f)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(t,r=500){clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(()=>t(),r)}};ic.layerName="WMSLayer";ic.defaultProps=zZ;var VZ={getHeight:{type:"accessor",value:0},greatCircle:!0},qf=class extends tg{};qf.layerName="GreatCircleLayer";qf.defaultProps=VZ;var PO=qf;var HZ={...ni.defaultProps},Yf=class extends Dt{indexToBounds(){return null}renderLayers(){let{elevationScale:t,extruded:r,wireframe:n,filled:s,stroked:i,lineWidthUnits:o,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:h,lineMiterLimit:f,lineDashJustified:u,getElevation:d,getFillColor:p,getLineColor:m,getLineWidth:g}=this.props,{updateTriggers:_,material:y,transitions:x}=this.props,A=this.getSubLayerClass("cell",ni),{updateTriggers:M,...E}=this.indexToBounds()||{};return new A({filled:s,wireframe:n,extruded:r,elevationScale:t,stroked:i,lineWidthUnits:o,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:h,lineMiterLimit:f,lineDashJustified:u,material:y,transitions:x,getElevation:d,getFillColor:p,getLineColor:m,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:_&&{...M,getElevation:_.getElevation,getFillColor:_.getFillColor,getLineColor:_.getLineColor,getLineWidth:_.getLineWidth}}),E)}};Yf.layerName="GeoCellLayer";Yf.defaultProps=HZ;var Sn=Yf;var Cg=Dn(XA(),1),WZ=3,GZ=30,jZ=2*GZ+1,IO=180/Math.PI;function LO(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function OO(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function NO(e){return[OO(e[0]),OO(e[1])]}function BO(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function FO([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*IO,n*IO]}function DO(e){let t=Cg.default.fromString(e,!0,10).toString(2);for(;t.length<WZ+jZ;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),i=s.length/2,o=Cg.default.fromString(n,!0,2).toString(10),a=Cg.default.fromString(s,!0,2).toString(4);for(;a.length<i;)a="0"+a;return`${o}/${a}`}function qZ(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function kO(e){let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,i=[0,0],o;for(let a=s-1;a>=0;a--){o=s-a;let c=n[a],l=0,h=0;c==="1"?h=1:c==="2"?(l=1,h=1):c==="3"&&(l=1);let f=Math.pow(2,o-1);qZ(f,i,l,h),i[0]+=f*l,i[1]+=f*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:o}}var UO=Dn(XA(),1);function YZ(e){let t=e.padEnd(16,"0");return UO.default.fromString(t,16)}var XZ=100;function $Z({face:e,ij:t,level:r}){let n=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(XZ*Math.pow(2,-r))),i=new Float64Array(4*s*2+2),o=0,a=0;for(let c=0;c<4;c++){let l=n[c].slice(0),h=n[c+1],f=(h[0]-l[0])/s,u=(h[1]-l[1])/s;for(let d=0;d<s;d++){l[0]+=f,l[1]+=u;let p=LO(t,r,l),m=NO(p),g=BO(e,m),_=FO(g);Math.abs(_[1])>89.999&&(_[0]=a);let y=_[0]-a;_[0]+=y>180?-360:y<-180?360:0,i[o++]=_[0],i[o++]=_[1],a=_[0]}}return i[o++]=i[0],i[o++]=i[1],i}function KZ(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=YZ(e)}return DO(e.toString())}function zO(e){let t=KZ(e),r=kO(t);return $Z(r)}var ZZ={getS2Token:{type:"accessor",value:e=>e.token}},$f=class extends Sn{indexToBounds(){let{data:t,getS2Token:r}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(n,s)=>zO(r(n,s))}}};$f.layerName="S2Layer";$f.defaultProps=ZZ;var VO=$f;var $A=512;function JZ(e,t){let r=0,n=0,s=1<<e.length,i=s/$A;for(let o=0;o<e.length;o++){s>>=1;let a=parseInt(e[o]);a%2&&(r|=s),a>1&&(n|=s)}return[[r/i,$A-n/i],[(r+t)/i,$A-(n+t)/i]]}function HO(e,t=1){let[r,n]=JZ(e,t),[s,i]=Ee(r),[o,a]=Ee(n);return[o,i,o,a,s,a,s,i,o,i]}var QZ={getQuadkey:{type:"accessor",value:e=>e.quadkey}},Kf=class extends Sn{indexToBounds(){let{data:t,extruded:r,getQuadkey:n}=this.props,s=r?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(i,o)=>HO(n(i,o),s),updateTriggers:{getPolygon:s}}}};Kf.layerName="QuadkeyLayer";Kf.defaultProps=QZ;var WO=Kf;var Eo=class{constructor(t){this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,"west"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){let t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}async _loadData({getData:t,requestScheduler:r,onLoad:n,onError:s}){let{index:i,id:o,bbox:a,userData:c,zoom:l}=this,h=this._loaderId;this._abortController=new AbortController;let{signal:f}=this._abortController,u=await r.scheduleRequest(this,m=>m.isSelected?1:-1);if(!u){this._isCancelled=!0;return}if(this._isCancelled){u.done();return}let d=null,p;try{d=await t({index:i,id:o,bbox:a,userData:c,zoom:l,signal:f})}catch(m){p=m||!0}finally{u.done()}if(h===this._loaderId){if(this._loader=void 0,this.content=d,this._isCancelled&&!d){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,p?s(p,this):n(this)}}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}};var Jt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var GO=new D,tJ=new D,ii=class{constructor(t=[0,0,0],r=[0,0,0],n){n=n||GO.copy(t).add(r).scale(.5),this.center=new D(n),this.halfDiagonal=new D(r).subtract(this.center),this.minimum=new D(t),this.maximum=new D(r)}clone(){return new ii(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){let{halfDiagonal:r}=this,n=tJ.from(t.normal),s=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),i=this.center.dot(n)+t.distance;return i-s>0?Jt.INSIDE:i+s<0?Jt.OUTSIDE:Jt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=GO.from(t).subtract(this.center),{halfDiagonal:n}=this,s=0,i;return i=Math.abs(r.x)-n.x,i>0&&(s+=i*i),i=Math.abs(r.y)-n.y,i>0&&(s+=i*i),i=Math.abs(r.z)-n.z,i>0&&(s+=i*i),s}};var Zf=new D,jO=new D,oi=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new D,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Zf.from(r),this.center=new D().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new oi(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,i=t.radius,o=Zf.copy(s).subtract(r),a=o.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return t.clone();let c=(n+a+i)*.5;return jO.copy(o).scale((-n+c)/a).add(r),this.center.copy(jO),this.radius=c,this}expand(t){let n=Zf.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=qt.getScaling(Zf,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Zf.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,i=t.normal.dot(r)+t.distance;return i<-n?Jt.OUTSIDE:i<n?Jt.INTERSECTING:Jt.INSIDE}};var eJ=new D,rJ=new D,Pg=new D,Rg=new D,Ig=new D,nJ=new D,sJ=new D,cs={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},bo=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new D().from(t),this.halfAxes=new zt(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new D(t).len(),new D(r).len(),new D(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new D(t).normalize(),i=new D(r).normalize(),o=new D(n).normalize();return new Vs().fromMatrix3(new zt([...s,...i,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Vs(n),i=new zt().fromQuaternion(s);return i[0]=i[0]*r[0],i[1]=i[1]*r[0],i[2]=i[2]*r[0],i[3]=i[3]*r[1],i[4]=i[4]*r[1],i[5]=i[5]*r[1],i[6]=i[6]*r[2],i[7]=i[7]*r[2],i[8]=i[8]*r[2],this.center=new D().from(t),this.halfAxes=i,this}clone(){return new bo(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new oi){let r=this.halfAxes,n=r.getColumn(0,Pg),s=r.getColumn(1,Rg),i=r.getColumn(2,Ig),o=eJ.copy(n).add(s).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,i=n.x,o=n.y,a=n.z,c=Math.abs(i*s[cs.COLUMN0ROW0]+o*s[cs.COLUMN0ROW1]+a*s[cs.COLUMN0ROW2])+Math.abs(i*s[cs.COLUMN1ROW0]+o*s[cs.COLUMN1ROW1]+a*s[cs.COLUMN1ROW2])+Math.abs(i*s[cs.COLUMN2ROW0]+o*s[cs.COLUMN2ROW1]+a*s[cs.COLUMN2ROW2]),l=n.dot(r)+t.distance;return l<=-c?Jt.OUTSIDE:l>=c?Jt.INSIDE:Jt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=rJ.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,Pg),i=n.getColumn(1,Rg),o=n.getColumn(2,Ig),a=s.magnitude(),c=i.magnitude(),l=o.magnitude();s.normalize(),i.normalize(),o.normalize();let h=0,f;return f=Math.abs(r.dot(s))-a,f>0&&(h+=f*f),f=Math.abs(r.dot(i))-c,f>0&&(h+=f*f),f=Math.abs(r.dot(o))-l,f>0&&(h+=f*f),h}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,c=a.getColumn(0,Pg),l=a.getColumn(1,Rg),h=a.getColumn(2,Ig),f=nJ.copy(c).add(l).add(h).add(o),u=sJ.copy(f).subtract(t),d=r.dot(u);return s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).add(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).subtract(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).subtract(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).add(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).add(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).subtract(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).subtract(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),n[0]=s,n[1]=i,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,Pg);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,Rg);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,Ig);return s.transformAsPoint(t),this.halfAxes=new zt([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var qO=new D,YO=new D,Kr=class{constructor(t=[0,0,1],r=0){this.normal=new D,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return un(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=qO.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),un(Ut(this.normal.len(),1)),this.distance=s,this}clone(){return new Kr(this.normal,this.distance)}equals(t){return Ut(this.distance,t.distance)&&Ut(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=YO.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=qO.from(t),s=this.getPointDistance(n),i=YO.copy(this.normal).scale(s);return n.subtract(i).to(r)}};var XO=[new D([1,0,0]),new D([0,1,0]),new D([0,0,1])],$O=new D,iJ=new D,er=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*XO.length;let r=t.center,n=t.radius,s=0;for(let i of XO){let o=this.planes[s],a=this.planes[s+1];o||(o=this.planes[s]=new Kr),a||(a=this.planes[s+1]=new Kr);let c=$O.copy(i).scale(-n).add(r);o.fromPointNormal(c,i);let l=$O.copy(i).scale(n).add(r),h=iJ.copy(i).negate();a.fromPointNormal(l,h),s+=2}return this}computeVisibility(t){let r=Jt.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case Jt.OUTSIDE:return Jt.OUTSIDE;case Jt.INTERSECTING:r=Jt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(un(Number.isFinite(r),"parentPlaneMask is required."),r===er.MASK_OUTSIDE||r===er.MASK_INSIDE)return r;let n=er.MASK_INSIDE,s=this.planes;for(let i=0;i<this.planes.length;++i){let o=i<31?1<<i:0;if(i<31&&!(r&o))continue;let a=s[i],c=t.intersectPlane(a);if(c===Jt.OUTSIDE)return er.MASK_OUTSIDE;c===Jt.INTERSECTING&&(n|=o)}return n}};er.MASK_OUTSIDE=4294967295;er.MASK_INSIDE=0;er.MASK_INDETERMINATE=2147483647;var P6t=new D,R6t=new D,I6t=new D,O6t=new D,L6t=new D;var U6t=new D,z6t=new D,V6t=new D,H6t=new D,W6t=new D,G6t=new D,j6t=new D,q6t=new D,Y6t=new D,X6t=new D,$6t=new D,K6t=new D;var vn=new zt,aJ=new zt,cJ=new zt,Og=new zt,KO=new zt;function JA(e,t={}){let r=va.EPSILON20,n=10,s=0,i=0,o=aJ,a=cJ;o.identity(),a.copy(e);let c=r*lJ(a);for(;i<n&&hJ(a)>c;)fJ(a,Og),KO.copy(Og).transpose(),a.multiplyRight(Og),a.multiplyLeft(KO),o.multiplyRight(Og),++s>2&&(++i,s=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function lJ(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var KA=[1,0,0],ZA=[2,2,1];function hJ(e){let t=0;for(let r=0;r<3;++r){let n=e[vn.getElementIndex(ZA[r],KA[r])];t+=2*n*n}return Math.sqrt(t)}function fJ(e,t){let r=va.EPSILON15,n=0,s=1;for(let l=0;l<3;++l){let h=Math.abs(e[vn.getElementIndex(ZA[l],KA[l])]);h>n&&(s=l,n=h)}let i=KA[s],o=ZA[s],a=1,c=0;if(Math.abs(e[vn.getElementIndex(o,i)])>r){let l=e[vn.getElementIndex(o,o)],h=e[vn.getElementIndex(i,i)],f=e[vn.getElementIndex(o,i)],u=(l-h)/2/f,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),c=d*a}return zt.IDENTITY.to(t),t[vn.getElementIndex(i,i)]=t[vn.getElementIndex(o,o)]=a,t[vn.getElementIndex(o,i)]=c,t[vn.getElementIndex(i,o)]=-c,t}var ai=new D,uJ=new D,dJ=new D,pJ=new D,mJ=new D,gJ=new zt,_J={diagonal:new zt,unitary:new zt};function QA(e,t=new bo){if(!e||e.length===0)return t.halfAxes=new zt([0,0,0,0,0,0,0,0,0]),t.center=new D,t;let r=e.length,n=new D(0,0,0);for(let b of e)n.add(b);let s=1/r;n.multiplyByScalar(s);let i=0,o=0,a=0,c=0,l=0,h=0;for(let b of e){let T=ai.copy(b).subtract(n);i+=T.x*T.x,o+=T.x*T.y,a+=T.x*T.z,c+=T.y*T.y,l+=T.y*T.z,h+=T.z*T.z}i*=s,o*=s,a*=s,c*=s,l*=s,h*=s;let f=gJ;f[0]=i,f[1]=o,f[2]=a,f[3]=o,f[4]=c,f[5]=l,f[6]=a,f[7]=l,f[8]=h;let{unitary:u}=JA(f,_J),d=t.halfAxes.copy(u),p=d.getColumn(0,dJ),m=d.getColumn(1,pJ),g=d.getColumn(2,mJ),_=-Number.MAX_VALUE,y=-Number.MAX_VALUE,x=-Number.MAX_VALUE,A=Number.MAX_VALUE,M=Number.MAX_VALUE,E=Number.MAX_VALUE;for(let b of e)ai.copy(b),_=Math.max(ai.dot(p),_),y=Math.max(ai.dot(m),y),x=Math.max(ai.dot(g),x),A=Math.min(ai.dot(p),A),M=Math.min(ai.dot(m),M),E=Math.min(ai.dot(g),E);p=p.multiplyByScalar(.5*(A+_)),m=m.multiplyByScalar(.5*(M+y)),g=g.multiplyByScalar(.5*(E+x)),t.center.copy(p).add(m).add(g);let w=uJ.set(_-A,y-M,x-E).multiplyByScalar(.5),v=new zt([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(v),t}var oc=512,ZO=3,JO=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],QO=JO.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),xJ=QO.concat([[.25,.5],[.75,.5]]),ci=class{constructor(t,r,n){this.x=t,this.y=r,this.z=n}get children(){if(!this._children){let t=this.x*2,r=this.y*2,n=this.z+1;this._children=[new ci(t,r,n),new ci(t,r+1,n),new ci(t+1,r,n),new ci(t+1,r+1,n)]}return this._children}update(t){let{viewport:r,cullingVolume:n,elevationBounds:s,minZ:i,maxZ:o,bounds:a,offset:c,project:l}=t,h=this.getBoundingVolume(s,c,l);if(a&&!this.insideBounds(a)||n.computeVisibility(h)<0)return!1;if(!this.childVisible){let{z:u}=this;if(u<o&&u>=i){let d=h.distanceTo(r.cameraPosition)*r.scale/r.height;u+=Math.floor(Math.log2(d))}if(u>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(let u of this.children)u.update(t);return!0}getSelected(t=[]){if(this.selected&&t.push(this),this._children)for(let r of this._children)r.getSelected(t);return t}insideBounds([t,r,n,s]){let i=Math.pow(2,this.z),o=oc/i;return this.x*o<n&&this.y*o<s&&(this.x+1)*o>t&&(this.y+1)*o>r}getBoundingVolume(t,r,n){if(n){let c=this.z<1?xJ:this.z<2?QO:JO,l=[];for(let h of c){let f=Lg(this.x+h[0],this.y+h[1],this.z);f[2]=t[0],l.push(n(f)),t[0]!==t[1]&&(f[2]=t[1],l.push(n(f)))}return QA(l)}let s=Math.pow(2,this.z),i=oc/s,o=this.x*i+r*oc,a=oc-(this.y+1)*i;return new ii([o,a,t[0]],[o+i,a+i,t[1]])}};function tL(e,t,r,n){let s=e instanceof Xr&&e.resolution?e.projectPosition:null,i=Object.values(e.getFrustumPlanes()).map(({normal:d,distance:p})=>new Kr(d.clone().negate(),p)),o=new er(i),a=e.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,l=r&&r[1]*a||0,h=e instanceof Pe&&e.pitch<=60?t:0;if(n){let[d,p,m,g]=n,_=Kt([d,g]),y=Kt([m,p]);n=[_[0],oc-_[1],y[0],oc-y[1]]}let f=new ci(0,0,0),u={viewport:e,project:s,cullingVolume:o,elevationBounds:[c,l],minZ:h,maxZ:t,bounds:n,offset:0};if(f.update(u),e instanceof Pe&&e.subViewports&&e.subViewports.length>1){for(u.offset=-1;f.update(u)&&!(--u.offset<-ZO););for(u.offset=1;f.update(u)&&!(++u.offset>ZO););}return f.getSelected()}var ls=512,yJ=[-1/0,-1/0,1/0,1/0],li={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(r=>typeof r=="string"),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;let r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function rL(e,t){let r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min(...r.map(s=>s[0])),Math.min(...r.map(s=>s[1])),Math.max(...r.map(s=>s[0])),Math.max(...r.map(s=>s[1]))]}function AJ(e){return Math.abs(e.split("").reduce((t,r)=>(t<<5)-t+r.charCodeAt(0)|0,0))}function wn(e,t){if(!e||!e.length)return null;let{index:r,id:n}=t;if(Array.isArray(e)){let i=AJ(n)%e.length;e=e[i]}let s=e;for(let i of Object.keys(r)){let o=new RegExp(`{${i}}`,"g");s=s.replace(o,String(r[i]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(s=s.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),s}function TJ(e,t,r){let n;if(t&&t.length===2){let[s,i]=t,o=e.getBounds({z:s}),a=e.getBounds({z:i});n=[Math.min(o[0],a[0]),Math.min(o[1],a[1]),Math.max(o[2],a[2]),Math.max(o[3],a[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}function nL({viewport:e,z:t,cullRect:r}){return(e.subViewports||[e]).map(s=>tT(s,t||0,r))}function tT(e,t,r){if(!Array.isArray(t)){let i=r.x-e.x,o=r.y-e.y,{width:a,height:c}=r,l={targetZ:t},h=e.unproject([i,o],l),f=e.unproject([i+a,o],l),u=e.unproject([i,o+c],l),d=e.unproject([i+a,o+c],l);return[Math.min(h[0],f[0],u[0],d[0]),Math.min(h[1],f[1],u[1],d[1]),Math.max(h[0],f[0],u[0],d[0]),Math.max(h[1],f[1],u[1],d[1])]}let n=tT(e,t[0],r),s=tT(e,t[1],r);return[Math.min(n[0],s[0]),Math.min(n[1],s[1]),Math.max(n[2],s[2]),Math.max(n[3],s[3])]}function MJ(e,t,r){return r?rL(e,r).map(s=>s*t/ls):e.map(n=>n*t/ls)}function eT(e,t){return Math.pow(2,e)*ls/t}function Lg(e,t,r){let n=eT(r,ls),s=e/n*360-180,i=Math.PI-2*Math.PI*t/n,o=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[s,o]}function eL(e,t,r,n){let s=eT(r,n);return[e/s*ls,t/s*ls]}function rT(e,t,r,n,s=ls){if(e.isGeospatial){let[l,h]=Lg(t,r,n),[f,u]=Lg(t+1,r+1,n);return{west:l,north:h,east:f,south:u}}let[i,o]=eL(t,r,n,s),[a,c]=eL(t+1,r+1,n,s);return{left:i,top:o,right:a,bottom:c}}function EJ(e,t,r,n,s){let i=TJ(e,null,n),o=eT(t,r),[a,c,l,h]=MJ(i,o,s),f=[];for(let u=Math.floor(a);u<l;u++)for(let d=Math.floor(c);d<h;d++)f.push({x:u,y:d,z:t});return f}function nT({viewport:e,maxZoom:t,minZoom:r,zRange:n,extent:s,tileSize:i=ls,modelMatrix:o,modelMatrixInverse:a,zoomOffset:c=0}){let l=e.isGeospatial?Math.round(e.zoom+Math.log2(ls/i))+c:Math.ceil(e.zoom)+c;if(typeof r=="number"&&Number.isFinite(r)&&l<r){if(!s)return[];l=r}typeof t=="number"&&Number.isFinite(t)&&l>t&&(l=t);let h=s;return o&&a&&s&&!e.isGeospatial&&(h=rL(s,o)),e.isGeospatial?tL(e,l,n,s):EJ(e,l,i,h||yJ,a)}function sT(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function iT(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function sL(e){let t={},r;return n=>{for(let s in n)if(!bJ(n[s],t[s])){r=e(n),t=n;break}return r}}function bJ(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}var iL=1,Ng=2,SJ="never",vJ="no-overlap",Jf="best-available",wJ=5,CJ={[Jf]:RJ,[vJ]:IJ,[SJ]:()=>{}},PJ={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}},So=class{constructor(t){this._getCullBounds=sL(nL),this.opts={...PJ,...t},this.setOptions(this.opts),this.onTileLoad=r=>{this.opts.onTileLoad?.(r),this.opts.maxCacheByteSize!==null&&(this._cacheByteSize+=r.byteLength,this._resizeCache())},this._requestScheduler=new vs({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new K,this._modelMatrixInverse=new K}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(t=>t.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(t=>t.needsReload)}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(let t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(let t of this._cache.keys()){let r=this._cache.get(t);!this._selectedTiles||!this._selectedTiles.includes(r)?this._cache.delete(t):r.setNeedsReload()}}update(t,{zRange:r,modelMatrix:n}={zRange:null,modelMatrix:null}){let s=n?new K(n):new K,i=!s.equals(this._modelMatrix);if(!this._viewport||!t.equals(this._viewport)||!Ut(this._zRange,r)||i){i&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=t,this._zRange=r;let a=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=a.map(c=>this._getTile(c,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(a=>this._getTile(a.index,!0)));let o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(t,r){if(!t.isVisible)return!1;if(r&&this._viewport){let n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:r}),{bbox:s}=t;for(let[i,o,a,c]of n){let l;if("west"in s)l=s.west<a&&s.east>i&&s.south<c&&s.north>o;else{let h=Math.min(s.top,s.bottom),f=Math.max(s.top,s.bottom);l=s.left<a&&s.right>i&&h<c&&f>o}if(l)return!0}return!1}return!0}getTileIndices({viewport:t,maxZoom:r,minZoom:n,zRange:s,modelMatrix:i,modelMatrixInverse:o}){let{tileSize:a,extent:c,zoomOffset:l}=this.opts;return nT({viewport:t,maxZoom:r,minZoom:n,zRange:s,tileSize:a,extent:c,modelMatrix:i,modelMatrixInverse:o,zoomOffset:l})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getTileZoom(t){return t.z}getTileMetadata(t){let{tileSize:r}=this.opts;return{bbox:rT(this._viewport,t.x,t.y,t.z,r)}}getParentIndex(t){let r=Math.floor(t.x/2),n=Math.floor(t.y/2),s=t.z-1;return{x:r,y:n,z:s}}updateTileStates(){let t=this.opts.refinementStrategy||Jf,r=new Array(this._cache.size),n=0;for(let s of this._cache.values())r[n++]=s.isVisible,s.isSelected=!1,s.isVisible=!1;for(let s of this._selectedTiles)s.isSelected=!0,s.isVisible=!0;(typeof t=="function"?t:CJ[t])(Array.from(this._cache.values())),n=0;for(let s of this._cache.values())if(r[n++]!==s.isVisible)return!0;return!1}_pruneRequests(){let{maxRequests:t=0}=this.opts,r=[],n=0;for(let s of this._cache.values())s.isLoading&&(n++,!s.isSelected&&!s.isVisible&&r.push(s));for(;t>0&&n>t&&r.length>0;)r.shift().abort(),n--}_rebuildTree(){let{_cache:t}=this;for(let r of t.values())r.parent=null,r.children&&(r.children.length=0);for(let r of t.values()){let n=this._getNearestAncestor(r);r.parent=n,n?.children&&n.children.push(r)}}_resizeCache(){let{_cache:t,opts:r}=this,n=r.maxCacheSize??(r.maxCacheByteSize!==null?1/0:wJ*this.selectedTiles.length),s=r.maxCacheByteSize??1/0;if(t.size>n||this._cacheByteSize>s){for(let[o,a]of t)if(!a.isVisible&&!a.isSelected&&(this._cacheByteSize-=r.maxCacheByteSize!==null?a.byteLength:0,t.delete(o),this.opts.onTileUnload?.(a)),t.size<=n&&this._cacheByteSize<=s)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((o,a)=>o.zoom-a.zoom),this._dirty=!1)}_getTile(t,r){let n=this.getTileId(t),s=this._cache.get(n),i=!1;return!s&&r?(s=new Eo(t),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:n,zoom:this.getTileZoom(s.index)}),i=!0,this._cache.set(n,s),this._dirty=!0):s&&s.needsReload&&(i=!0),s&&i&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s}_getNearestAncestor(t){let{_minZoom:r=0}=this,n=t.index;for(;this.getTileZoom(n)>r;){n=this.getParentIndex(n);let s=this._getTile(n);if(s)return s}return null}};function RJ(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&!oL(t)&&oT(t);for(let t of e)t.isVisible=Boolean(t.state&Ng)}function IJ(e){for(let r of e)r.state=0;for(let r of e)r.isSelected&&oL(r);let t=Array.from(e).sort((r,n)=>r.zoom-n.zoom);for(let r of t)if(r.isVisible=Boolean(r.state&Ng),r.children&&(r.isVisible||r.state&iL))for(let n of r.children)n.state=iL;else r.isSelected&&oT(r)}function oL(e){let t=e;for(;t;){if(t.isLoaded||t.content)return t.state|=Ng,!0;t=t.parent}return!1}function oT(e){for(let t of e.children)t.isLoaded||t.content?t.state|=Ng:oT(t)}var OJ={TilesetClass:So,data:{type:"data",value:[]},dataComparator:li.equal,renderSubLayers:{type:"function",value:e=>new yo(e)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:e=>{}},onTileUnload:{type:"function",value:e=>{}},onTileError:{type:"function",value:e=>console.error(e)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Jf,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0},Qf=class extends Dt{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return Boolean(this.state?.tileset?.selectedTiles?.every(t=>t.isLoaded&&t.layers&&t.layers.every(r=>r.isLoaded)))}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState({changeFlags:t}){let{tileset:r}=this.state,n=t.propsOrDataChanged||t.updateTriggersChanged,s=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),s?r.reloadAll():r.tiles.forEach(i=>{i.layers=null})):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}_getTilesetOptions(){let{tileSize:t,maxCacheSize:r,maxCacheByteSize:n,refinementStrategy:s,extent:i,maxZoom:o,minZoom:a,maxRequests:c,debounceTime:l,zoomOffset:h}=this.props;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:o,minZoom:a,tileSize:t,refinementStrategy:s,extent:i,maxRequests:c,debounceTime:l,zoomOffset:h,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){let t=this.state.tileset,{zRange:r,modelMatrix:n}=this.props,s=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),{isLoaded:i}=t,o=this.state.isLoaded!==i,a=this.state.frameNumber!==s;i&&(o||a)&&this._onViewportLoad(),a&&this.setState({frameNumber:s}),this.state.isLoaded=i}_onViewportLoad(){let{tileset:t}=this.state,{onViewportLoad:r}=this.props;r&&r(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,r){this.props.onTileError(t),r.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){let{data:r,getTileData:n,fetch:s}=this.props,{signal:i}=t;return t.url=typeof r=="string"||Array.isArray(r)?wn(r,t):null,n?n(t):s&&t.url?s(t.url,{propName:"data",layer:this,signal:i}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let r=t.sourceLayer,n=r.props.tile,s=t.info;return s.picked&&(s.tile=n),s.sourceTile=n,s.sourceTileSubLayer=r,s}_updateAutoHighlight(t){t.sourceTileSubLayer.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map(t=>{let r=this.getSubLayerPropsByTile(t);if(!(!t.isLoaded&&!t.content))if(t.layers)r&&t.layers[0]&&Object.keys(r).some(n=>t.layers[0].props[n]!==r[n])&&(t.layers=t.layers.map(n=>n.clone(r)));else{let n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=We(n,Boolean).map(s=>s.clone({tile:t,...r}))}return t.layers})}filterSubLayer({layer:t,cullRect:r}){let{tile:n}=t.props;return this.state.tileset.isTileVisible(n,r)}};Qf.defaultProps=OJ;Qf.layerName="TileLayer";var vo=Qf;var aL=`uniform tripsUniforms {
4453
+ `;var iK={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,borderRadius:{type:"object",value:0},padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:e=>e.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}},Ff=class extends ut{getShaders(){return super.getShaders({vs:OI,fs:LI,modules:[st,Tt,II]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){super.updateState(t);let{changeFlags:r}=t;r.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:t}){let{billboard:r,sizeScale:n,sizeUnits:s,sizeMinPixels:i,sizeMaxPixels:o,getLineWidth:a}=this.props,{padding:c,borderRadius:l}=this.props;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),Array.isArray(l)||(l=[l,l,l,l]);let h=this.state.model,f={billboard:r,stroked:Boolean(a),borderRadius:l,padding:c,sizeUnits:St[s],sizeScale:n,sizeMinPixels:i,sizeMaxPixels:o};h.shaderInputs.setProps({textBackground:f}),h.draw(this.context.renderPass)}_getModel(){let t=[0,0,1,0,0,1,1,1];return new X(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new it({topology:"triangle-strip",vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(t)}}}),isInstanced:!0})}};Ff.defaultProps=iK;Ff.layerName="TextBackgroundLayer";var Ag=Ff;var NI={start:1,middle:0,end:-1},BI={top:1,center:0,bottom:-1},PA=[0,0,0,255],oK=1,aK={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:PA},getBorderWidth:{type:"accessor",value:0},backgroundBorderRadius:{type:"object",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:xo.characterSet},fontFamily:xo.fontFamily,fontWeight:xo.fontWeight,lineHeight:oK,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:PA},fontSettings:{type:"object",value:{},compare:1},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:e=>e.text},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:PA},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}},Df=class extends Dt{constructor(){super(...arguments),this.getBoundingRect=(t,r)=>{let{size:[n,s]}=this.transformParagraph(t,r),{fontSize:i}=this.state.fontAtlasManager.props;n/=i,s/=i;let{getTextAnchor:o,getAlignmentBaseline:a}=this.props,c=NI[typeof o=="function"?o(t,r):o],l=BI[typeof a=="function"?a(t,r):a];return[(c-1)*n/2,(l-1)*s/2,n,s]},this.getIconOffsets=(t,r)=>{let{getTextAnchor:n,getAlignmentBaseline:s}=this.props,{x:i,y:o,rowWidth:a,size:[c,l]}=this.transformParagraph(t,r),h=NI[typeof n=="function"?n(t,r):n],f=BI[typeof s=="function"?s(t,r):s],u=i.length,d=new Array(u*2),p=0;for(let m=0;m<u;m++){let g=(1-h)*(c-a[m])/2;d[p++]=(h-1)*c/2+g+i[m],d[p++]=(f-1)*l/2+o[m]}return d}}initializeState(){this.state={styleVersion:0,fontAtlasManager:new Bf},this.props.maxWidth>0&&k.once(1,"v8.9 breaking change: TextLayer maxWidth is now relative to text size")()}updateState(t){let{props:r,oldProps:n,changeFlags:s}=t;(s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getText))&&this._updateText(),(this._updateFontAtlas()||r.lineHeight!==n.lineHeight||r.wordBreak!==n.wordBreak||r.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(){let{fontSettings:t,fontFamily:r,fontWeight:n}=this.props,{fontAtlasManager:s,characterSet:i}=this.state,o={...t,characterSet:i,fontFamily:r,fontWeight:n};if(!s.mapping)return s.setProps(o),!0;for(let a in o)if(o[a]!==s.props[a])return s.setProps(o),!0;return!1}_updateText(){let{data:t,characterSet:r}=this.props,n=t.attributes?.getText,{getText:s}=this.props,i=t.startIndices,o,a=r==="auto"&&new Set;if(n&&i){let{texts:c,characterCount:l}=EI({...ArrayBuffer.isView(n)?{value:n}:n,length:t.length,startIndices:i,characterSet:a});o=l,s=(h,{index:f})=>c[f]}else{let{iterable:c,objectInfo:l}=$t(t);i=[0],o=0;for(let h of c){l.index++;let f=Array.from(s(h,l)||"");a&&f.forEach(a.add,a),o+=f.length,i.push(o)}}this.setState({getText:s,startIndices:i,numInstances:o,characterSet:a||r})}transformParagraph(t,r){let{fontAtlasManager:n}=this.state,s=n.mapping,i=this.state.getText,{wordBreak:o,lineHeight:a,maxWidth:c}=this.props,l=i(t,r)||"";return MI(l,a,o,c*n.props.fontSize,s)}renderLayers(){let{startIndices:t,numInstances:r,getText:n,fontAtlasManager:{scale:s,atlas:i,mapping:o},styleVersion:a}=this.state,{data:c,_dataDiff:l,getPosition:h,getColor:f,getSize:u,getAngle:d,getPixelOffset:p,getBackgroundColor:m,getBorderColor:g,getBorderWidth:_,backgroundBorderRadius:y,backgroundPadding:x,background:A,billboard:M,fontSettings:E,outlineWidth:w,outlineColor:v,sizeScale:b,sizeUnits:T,sizeMinPixels:I,sizeMaxPixels:B,transitions:N,updateTriggers:C}=this.props,V=this.getSubLayerClass("characters",xg),tt=this.getSubLayerClass("background",Ag);return[A&&new tt({getFillColor:m,getLineColor:g,getLineWidth:_,borderRadius:y,padding:x,getPosition:h,getSize:u,getAngle:d,getPixelOffset:p,billboard:M,sizeScale:b,sizeUnits:T,sizeMinPixels:I,sizeMaxPixels:B,transitions:N&&{getPosition:N.getPosition,getAngle:N.getAngle,getSize:N.getSize,getFillColor:N.getBackgroundColor,getLineColor:N.getBorderColor,getLineWidth:N.getBorderWidth,getPixelOffset:N.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:C.getPosition,getAngle:C.getAngle,getSize:C.getSize,getFillColor:C.getBackgroundColor,getLineColor:C.getBorderColor,getLineWidth:C.getBorderWidth,getPixelOffset:C.getPixelOffset,getBoundingRect:{getText:C.getText,getTextAnchor:C.getTextAnchor,getAlignmentBaseline:C.getAlignmentBaseline,styleVersion:a}}}),{data:c.attributes&&c.attributes.background?{length:c.length,attributes:c.attributes.background}:c,_dataDiff:l,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new V({sdf:E.sdf,smoothing:Number.isFinite(E.smoothing)?E.smoothing:xo.smoothing,outlineWidth:w/(E.radius||xo.radius),outlineColor:v,iconAtlas:i,iconMapping:o,getPosition:h,getColor:f,getSize:u,getAngle:d,getPixelOffset:p,billboard:M,sizeScale:b*s,sizeUnits:T,sizeMinPixels:I*s,sizeMaxPixels:B*s,transitions:N&&{getPosition:N.getPosition,getAngle:N.getAngle,getColor:N.getColor,getSize:N.getSize,getPixelOffset:N.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{all:C.getText,getPosition:C.getPosition,getAngle:C.getAngle,getColor:C.getColor,getSize:C.getSize,getPixelOffset:C.getPixelOffset,getIconOffsets:{getTextAnchor:C.getTextAnchor,getAlignmentBaseline:C.getAlignmentBaseline,styleVersion:a}}}),{data:c,_dataDiff:l,startIndices:t,numInstances:r,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(t){PI(t)}};Df.defaultProps=aK;Df.layerName="TextLayer";var Tg=Df;var kf={circle:{type:ng,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:Za,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:Tg,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},Uf={type:bn,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},Mg={type:ri,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",_full3d:"_full3d",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function rc({type:e,props:t}){let r={};for(let n in t)r[n]=e.defaultProps[t[n]];return r}function Eg(e,t){let{transitions:r,updateTriggers:n}=e.props,s={updateTriggers:{},transitions:r&&{getPosition:r.geometry}};for(let i in t){let o=t[i],a=e.props[i];i.startsWith("get")&&(a=e.getSubLayerAccessor(a),s.updateTriggers[o]=n[i],r&&(s.transitions[o]=r[i])),s[o]=a}return s}function DI(e){if(Array.isArray(e))return e;switch(k.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return k.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}function RA(e,t,r={}){let n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:s=0,endRow:i=e.length}=r;for(let o=s;o<i;o++){let a=e[o],{geometry:c}=a;if(c)if(c.type==="GeometryCollection"){k.assert(Array.isArray(c.geometries),"GeoJSON does not have geometries array");let{geometries:l}=c;for(let h=0;h<l.length;h++){let f=l[h];FI(f,n,t,a,o)}}else FI(c,n,t,a,o)}return n}function FI(e,t,r,n,s){let{type:i,coordinates:o}=e,{pointFeatures:a,lineFeatures:c,polygonFeatures:l,polygonOutlineFeatures:h}=t;if(!lK(i,o)){k.warn(`${i} coordinates are malformed`)();return}switch(i){case"Point":a.push(r({geometry:e},n,s));break;case"MultiPoint":o.forEach(f=>{a.push(r({geometry:{type:"Point",coordinates:f}},n,s))});break;case"LineString":c.push(r({geometry:e},n,s));break;case"MultiLineString":o.forEach(f=>{c.push(r({geometry:{type:"LineString",coordinates:f}},n,s))});break;case"Polygon":l.push(r({geometry:e},n,s)),o.forEach(f=>{h.push(r({geometry:{type:"LineString",coordinates:f}},n,s))});break;case"MultiPolygon":o.forEach(f=>{l.push(r({geometry:{type:"Polygon",coordinates:f}},n,s)),f.forEach(u=>{h.push(r({geometry:{type:"LineString",coordinates:u}},n,s))})});break;default:}}var cK={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function lK(e,t){let r=cK[e];for(k.assert(r,`Unknown GeoJSON type ${e}`);t&&--r>0;)t=t[0];return t&&Number.isFinite(t[0])}function kI(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function bg(e){return e.geometry.coordinates}function UI(e,t){let r=kI(),{pointFeatures:n,lineFeatures:s,polygonFeatures:i,polygonOutlineFeatures:o}=e;return r.points.data=n,r.points._dataDiff=t.pointFeatures&&(()=>t.pointFeatures),r.points.getPosition=bg,r.lines.data=s,r.lines._dataDiff=t.lineFeatures&&(()=>t.lineFeatures),r.lines.getPath=bg,r.polygons.data=i,r.polygons._dataDiff=t.polygonFeatures&&(()=>t.polygonFeatures),r.polygons.getPolygon=bg,r.polygonsOutline.data=o,r.polygonsOutline._dataDiff=t.polygonOutlineFeatures&&(()=>t.polygonOutlineFeatures),r.polygonsOutline.getPath=bg,r}function zI(e,t){let r=kI(),{points:n,lines:s,polygons:i}=e,o=uI(e,t);return r.points.data={length:n.positions.value.length/n.positions.size,attributes:{...n.attributes,getPosition:n.positions,instancePickingColors:{size:4,value:o.points}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},r.lines.data={length:s.pathIndices.value.length-1,startIndices:s.pathIndices.value,attributes:{...s.attributes,getPath:s.positions,instancePickingColors:{size:4,value:o.lines}},properties:s.properties,numericProps:s.numericProps,featureIds:s.featureIds},r.lines._pathType="open",r.polygons.data={length:i.polygonIndices.value.length-1,startIndices:i.polygonIndices.value,attributes:{...i.attributes,getPolygon:i.positions,pickingColors:{size:4,value:o.polygons}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.polygons._normalize=!1,i.triangles&&(r.polygons.data.attributes.indices=i.triangles.value),r.polygonsOutline.data={length:i.primitivePolygonIndices.value.length-1,startIndices:i.primitivePolygonIndices.value,attributes:{...i.attributes,getPath:i.positions,instancePickingColors:{size:4,value:o.polygons}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.polygonsOutline._pathType="open",r}var hK=["points","linestrings","polygons"],fK={...rc(kf.circle),...rc(kf.icon),...rc(kf.text),...rc(Uf),...rc(Mg),stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:e=>e.properties.icon},getText:{type:"accessor",value:e=>e.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}},zf=class extends Dt{initializeState(){this.state={layerProps:{},features:{},featuresDiff:{}}}updateState({props:t,changeFlags:r}){if(!r.dataChanged)return;let{data:n}=this.props,s=n&&"points"in n&&"polygons"in n&&"lines"in n;this.setState({binary:s}),s?this._updateStateBinary({props:t,changeFlags:r}):this._updateStateJSON({props:t,changeFlags:r})}_updateStateBinary({props:t,changeFlags:r}){let n=zI(t.data,this.encodePickingColor);this.setState({layerProps:n})}_updateStateJSON({props:t,changeFlags:r}){let n=DI(t.data),s=this.getSubLayerRow.bind(this),i={},o={};if(Array.isArray(r.dataChanged)){let c=this.state.features;for(let l in c)i[l]=c[l].slice(),o[l]=[];for(let l of r.dataChanged){let h=RA(n,s,l);for(let f in c)o[f].push(_g({data:i[f],getIndex:u=>u.__source.index,dataRange:l,replace:h[f]}))}}else i=RA(n,s);let a=UI(i,o);this.setState({features:i,featuresDiff:o,layerProps:a})}getPickingInfo(t){let r=super.getPickingInfo(t),{index:n,sourceLayer:s}=r;return r.featureType=hK.find(i=>s.id.startsWith(`${this.id}-${i}-`)),n>=0&&s.id.startsWith(`${this.id}-points-text`)&&this.state.binary&&(r.index=this.props.data.points.globalFeatureIds.value[n]),r}_updateAutoHighlight(t){let r=`${this.id}-points-`,n=t.featureType==="points";for(let s of this.getSubLayers())s.id.startsWith(r)===n&&s.updateAutoHighlight(t)}_renderPolygonLayer(){let{extruded:t,wireframe:r}=this.props,{layerProps:n}=this.state,s="polygons-fill",i=this.shouldRenderSubLayer(s,n.polygons?.data)&&this.getSubLayerClass(s,Mg.type);if(i){let o=Eg(this,Mg.props),a=t&&r;return a||delete o.getLineColor,o.updateTriggers.lineColors=a,new i(o,this.getSubLayerProps({id:s,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){let{extruded:t,stroked:r}=this.props,{layerProps:n}=this.state,s="polygons-stroke",i="linestrings",o=!t&&r&&this.shouldRenderSubLayer(s,n.polygonsOutline?.data)&&this.getSubLayerClass(s,Uf.type),a=this.shouldRenderSubLayer(i,n.lines?.data)&&this.getSubLayerClass(i,Uf.type);if(o||a){let c=Eg(this,Uf.props);return[o&&new o(c,this.getSubLayerProps({id:s,updateTriggers:c.updateTriggers}),n.polygonsOutline),a&&new a(c,this.getSubLayerProps({id:i,updateTriggers:c.updateTriggers}),n.lines)]}return null}_renderPointLayers(){let{pointType:t}=this.props,{layerProps:r,binary:n}=this.state,{highlightedObjectIndex:s}=this.props;!n&&Number.isFinite(s)&&(s=r.points.data.findIndex(a=>a.__source.index===s));let i=new Set(t.split("+")),o=[];for(let a of i){let c=`points-${a}`,l=kf[a],h=l&&this.shouldRenderSubLayer(c,r.points?.data)&&this.getSubLayerClass(c,l.type);if(h){let f=Eg(this,l.props),u=r.points;if(a==="text"&&n){let{instancePickingColors:d,...p}=u.data.attributes;u={...u,data:{...u.data,attributes:p}}}o.push(new h(f,this.getSubLayerProps({id:c,updateTriggers:f.updateTriggers,highlightedObjectIndex:s}),u))}}return o}renderLayers(){let{extruded:t}=this.props,r=this._renderPolygonLayer(),n=this._renderLineLayers(),s=this._renderPointLayers();return[!t&&r,n,s,t&&r]}getSubLayerAccessor(t){let{binary:r}=this.state;return!r||typeof t!="function"?super.getSubLayerAccessor(t):(n,s)=>{let{data:i,index:o}=s,a=fI(i,o);return t(a,s)}}};zf.layerName="GeoJsonLayer";zf.defaultProps=fK;var yo=zf;function uK(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function Sg(e){if(Array.isArray(e))return e.map(t=>Sg(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[uK(r)]=Sg(n);return t}return e}var yO=Dn(xO(),1);function UA(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(s,i,o,a)=>Boolean(t?.arrayPaths?.some(l=>i===l)),...t?._fastXML},n=TZ(e,r);return t?.uncapitalizeKeys?Sg(n):n}function TZ(e,t){return new yO.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var MZ="4.2.1",$r={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:MZ,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:EZ,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>UA(new TextDecoder().decode(e),{...$r.options.xml,...t?.xml}),parseTextSync:(e,t)=>UA(e,{...$r.options.xml,...t?.xml})};function EZ(e){return e.startsWith("<?xml")}function AO(e,t){let r=$r.parseTextSync?.(e,t),n=r?.ServiceExceptionReport?.ServiceException||r?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return typeof n=="string"?n:n.value||n.code||"Unknown error"}var bZ="4.2.1",Wf={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:bZ,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:SZ,options:{wms:{throwOnError:!1}},parse:async(e,t)=>zA(new TextDecoder().decode(e),t),parseSync:(e,t)=>zA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>zA(e,t)};function SZ(e){return e.startsWith("<?xml")}function zA(e,t){let r={...Wf.options.wms,...t?.wms},n=AO(e,r),s=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(s);return s}function To(e){return Array.isArray(e)?e:e?[e]:[]}function Gf(e){let t=To(e);return t.length>0&&t.every(r=>typeof r=="string")?t:[]}function jf(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseFloat(e);default:return}}function wg(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseInt(e,10);default:return}}function Mo(e){switch(e){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function VA(e,t){let r=$r.parseTextSync?.(e,t),n=r.WMT_MS_Capabilities||r.WMS_Capabilities||r,s=vZ(n);if(t?.inheritedLayerProps)for(let i of s.layers)MO(i,null);return t?.includeRawJSON&&(s.json=n),t?.includeXMLText&&(s.xml=e),s}function vZ(e){let t={version:String(e.version||""),name:String(e.Service?.Name||"unnamed"),title:e.Service?.Title?String(e.Service?.Title):void 0,abstract:e.Service?.Abstract?String(e.Service?.Abstract):void 0,keywords:Gf(e.Service?.KeywordList?.Keyword),fees:e.Service?.Fees?JSON.stringify(e.Service?.Fees):void 0,accessConstraints:e.Service?.AccessConstraints?JSON.stringify(e.Service?.AccessConstraints):void 0,layerLimit:wg(e.Service?.LayerLimit),maxWidth:wg(e.Service?.maxWidth),maxHeight:wg(e.Service?.maxHeight),layers:[],requests:wZ(e.Capability?.Request),exceptions:CZ(e.Exception)},r=To(e.Capability?.Layer);for(let n of r)t.layers.push(TO(n));for(let[n,s]of Object.entries(t))s===void 0&&delete t[n];return t}function wZ(e){let t={};for(let[r,n]of Object.entries(e||{})){let s=Gf(n?.Format);t[r]={mimeTypes:s}}return t}function CZ(e){if(To(e?.Format).length>0)return{mimeTypes:Gf(e)}}function TO(e){let t={title:String(e?.Title||""),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:Gf(e.KeywordList?.Keyword)},r=e?.CRS||e?.SRS;r&&Array.isArray(r)&&r.every(l=>typeof l=="string")&&(t.crs=r);let n=e?.EX_GeographicBoundingBox&&PZ(e?.EX_GeographicBoundingBox);n&&(t.geographicBoundingBox=n),n=e?.LatLonBoundingBox&&RZ(e?.LatLonBoundingBox),n&&(t.geographicBoundingBox=n);let s=e?.BoundingBox&&IZ(e?.BoundingBox);s&&s.length>0&&(t.boundingBoxes=s);let o=To(e?.Dimension).map(l=>LZ(l));o.length&&(t.dimensions=o),e?.opaque&&(t.opaque=Mo(e?.opaque)),e?.cascaded&&(t.cascaded=Mo(e?.cascaded)),e?.queryable&&(t.queryable=Mo(e?.queryable));let a=To(e?.Layer),c=[];for(let l of a)c.push(TO(l));c.length>0&&(t.layers=c);for(let[l,h]of Object.entries(t))h===void 0&&delete t[l];return t}function PZ(e){let{westBoundLongitude:t,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:s}=e;return[[t,s],[n,r]]}function RZ(e){let{minx:t,miny:r,maxx:n,maxy:s}=e;return[[t,r],[n,s]]}function IZ(e){return To(e).map(r=>OZ(r))}function OZ(e){let{CRS:t,SRS:r,minx:n,miny:s,maxx:i,maxy:o,resx:a,resy:c}=e,l={crs:t||r,boundingBox:[[jf(n),jf(s)],[jf(i),jf(o)]]};return a&&(l.xResolution=a),c&&(l.yResolution=c),l}function LZ(e){let{name:t,units:r,value:n}=e,s={name:t,units:r,extent:n};return e.unitSymbol&&(s.unitSymbol=e.unitSymbol),e.default&&(s.defaultValue=e.default),e.multipleValues&&(s.multipleValues=Mo(e.multipleValues)),e.nearestValue&&(s.nearestValue=Mo(e.nearestValue)),e.current&&(s.current=Mo(e.current)),s}function MO(e,t){t?.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=[...t.geographicBoundingBox]),t?.crs&&!e.crs&&(e.crs=[...t.crs]),t?.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=[...t.boundingBoxes]),t?.dimensions&&!e.dimensions&&(e.dimensions=[...t.dimensions]);for(let r of e.layers||[])MO(r,e)}var NZ="4.2.1",nc={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:NZ,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:BZ,options:{wms:{}},parse:async(e,t)=>VA(new TextDecoder().decode(e),t?.wms),parseTextSync:(e,t)=>VA(e,t?.wms)};function BZ(e){return e.startsWith("<?xml")}function HA(e,t){let n=($r.parseTextSync?.(e,t)).FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(n)?n:[n]).map(i=>FZ(i))}}function FZ(e){return{attributes:e||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var EO={...nc,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(e,t)=>HA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>HA(e,t)};function WA(e,t){return $r.parseTextSync?.(e,t)}var bO={...nc,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(e,t)=>WA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>WA(e,t)};function SO(e,t){let{type:r="auto"}=e,n=r==="auto"?kZ(e.url,t):DZ(r,t);if(!n)throw new Error("Not a valid image source type");return n.create(e)}function DZ(e,t){for(let r of t)if(r.type===e)return r;return null}function kZ(e,t){for(let r of t)if(r.testURL&&r.testURL(e))return r;return null}var vO={type:"wms",testURL:e=>e.toLowerCase().includes("wms"),create:e=>new GA(e)},GA=class extends mr{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(t){super(t),this.url=t.url,this.data=t.url,this.substituteCRS84=t.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters},this.vendorParameters=t.vendorParameters||{}}async getMetadata(){let t=await this.getCapabilities();return this.normalizeMetadata(t)}async getImage(t){let{boundingBox:r,bbox:n,...s}=t,i={bbox:r?[...r[0],...r[1]]:n,...s};return await this.getMap(i)}normalizeMetadata(t){return t}async getCapabilities(t,r){let n=this.getCapabilitiesURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);let o=await nc.parse(i,this.loadOptions);return this.capabilities=o,o}async getMap(t,r){let n=this.getMapURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);try{return await ln.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}async getFeatureInfo(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),await EO.parse(i,this.loadOptions)}async getFeatureInfoText(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),new TextDecoder().decode(i)}async describeLayer(t,r){let n=this.describeLayerURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),await bO.parse(i,this.loadOptions)}async getLegendGraphic(t,r){let n=this.getLegendGraphicURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);try{return await ln.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}getCapabilitiesURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(t,r){t=this._getWMS130Parameters(t);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(t,r){t=this._getWMS130Parameters(t);let{boundingBox:n,bbox:s}=t;t.bbox=n?[...n[0],...n[1]]:s;let i={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetFeatureInfo",i,r)}describeLayerURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(t){let[r,n]=t.split("?"),s=n.split("&"),i={};for(let o of s){let[a,c]=o.split("=");i[a]=c}return{url:r,parameters:i}}_getWMSUrl(t,r,n){let s=this.url,i=!0,o={service:"WMS",version:r.version,request:t,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,l]of Object.entries(o))(!a.includes(c)||l)&&(s+=i?"?":"&",i=!1,s+=this._getURLParameter(c,l,r));return encodeURI(s)}_getWMS130Parameters(t){let r={...t};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(t,r,n){switch(t){case"crs":n.version!=="1.3.0"?t="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(t="crs");break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;case"x":n.version==="1.3.0"&&(t="i");break;case"y":n.version==="1.3.0"&&(t="j");break;default:}return t=t.toUpperCase(),Array.isArray(r)?`${t}=${r.join(",")}`:`${t}=${r?String(r):""}`}_flipBoundingBox(t,r){if(!Array.isArray(t)||t.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),s=t;return n?[s[1],s[0],s[3],s[2]]:s}async _fetchArrayBuffer(t){let r=await this.fetch(t),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(t,r){let n=t.headers["content-type"];if(!t.ok||Wf.mimeTypes.includes(n)){let s=yl(this.loadOptions,{wms:{throwOnError:!0}}),i=Wf.parseSync?.(r,s);throw new Error(i)}}_parseError(t){let r=Wf.parseSync?.(t,this.loadOptions);return new Error(r)}};var sc=class extends mr{constructor(t){super(t)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(t){let r=this.getGranularParameters(t),n=this.getURLFromTemplate(r),i=await(await this.fetch(n)).arrayBuffer();return await ln.parse(i)}getGranularParameters(t){let[[r,n],[s,i]]=t.boundingBox;return{...t,east:r,north:n,south:i,west:s}}getURLFromTemplate(t){let r=this.props.url;for(let[n,s]of Object.entries(t))r=r.replace(`\${${n}}`,String(s)),r=r.replace(`{${n}}`,String(s));return r}};W(sc,"type","template"),W(sc,"testURL",t=>t.toLowerCase().includes("{"));var jA=class extends sc{data;constructor(t){super(t),this.data=t.url}async getMetadata(){return await this.metadata()}async getImage(t){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(t){throw new Error("not implemented")}metadataURL(t){return`${this.props.url}?f=pjson`}exportImageURL(t){let r=`bbox=${t.bbox[0]},${t.bbox[1]},${t.bbox[2]},${t.bbox[3]}`,n=`size=${t.width},${t.height}`,s={...t,bbox:r,size:n};return delete s.width,delete s.height,this.getUrl("exportImage",s)}getUrl(t,r,n){let s=`${this.props.url}/${t}`,i=!0;for(let[o,a]of Object.entries(r))s+=i?"?":"&",i=!1,Array.isArray(a)?s+=`${o.toUpperCase()}=${a.join(",")}`:s+=`${o.toUpperCase()}=${a?String(a):""}`;return s}async checkResponse(t){if(!t.ok)throw new Error("error")}},wO={type:"arcgis-image-server",testURL:e=>e.toLowerCase().includes("ImageServer"),create:e=>new jA(e)};var UZ=[vO,wO];function qA(e){return SO(e,UZ)}var CO=6378137*Math.PI;function YA(e){let t=Kt(e);return t[0]=(t[0]/256-1)*CO,t[1]=(t[1]/256-1)*CO,t}var zZ={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(e,t)=>console.error(t,e)}},ic=class extends Dt{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:t,props:r,oldProps:n}){let{viewport:s}=this.context;t.dataChanged||r.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(r),this._loadMetadata(),this.debounce(()=>this.loadImage(s,"image source changed"),0)):Q(r.layers,n.layers,1)?t.viewportChanged&&this.debounce(()=>this.loadImage(s,"viewport changed")):this.debounce(()=>this.loadImage(s,"layers changed"),0)}finalizeState(){}renderLayers(){let{bounds:t,image:r,lastRequestParameters:n}=this.state;return r&&new eg({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:n.srs==="EPSG:4326"?H.LNGLAT:H.CARTESIAN,bounds:t,image:r})}async getFeatureInfoText(t,r){let{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:t,y:r,info_format:"application/vnd.ogc.gml"}):""}_createImageSource(t){if(t.data instanceof mr)return t.data;if(typeof t.data=="string")return qA({url:t.data,loadOptions:t.loadOptions,type:t.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){let{imageSource:t}=this.state;try{this.state.loadCounter++;let r=await t.getMetadata();this.state.imageSource===t&&this.getCurrentLayer()?.props.onMetadataLoad(r)}catch(r){this.getCurrentLayer()?.props.onMetadataLoadError(r)}finally{this.state.loadCounter--}}async loadImage(t,r){let{layers:n,serviceType:s}=this.props;if(s==="wms"&&n.length===0)return;let i=t.getBounds(),{width:o,height:a}=t,c=this.getRequestId(),{srs:l}=this.props;l==="auto"&&(l=t.resolution?"EPSG:4326":"EPSG:3857");let h={width:o,height:a,boundingBox:[[i[0],i[1]],[i[2],i[3]]],layers:n,crs:l};if(l==="EPSG:3857"){let f=YA([i[0],i[1]]),u=YA([i[2],i[3]]);h.boundingBox=[f,u]}try{this.state.loadCounter++,this.props.onImageLoadStart(c);let f=await this.state.imageSource.getImage(h);this.state.lastRequestId<c&&(this.getCurrentLayer()?.props.onImageLoad(c),this.setState({image:f,bounds:i,lastRequestParameters:h,lastRequestId:c}))}catch(f){this.raiseError(f,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(c,f)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(t,r=500){clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(()=>t(),r)}};ic.layerName="WMSLayer";ic.defaultProps=zZ;var VZ={getHeight:{type:"accessor",value:0},greatCircle:!0},qf=class extends tg{};qf.layerName="GreatCircleLayer";qf.defaultProps=VZ;var PO=qf;var HZ={...ni.defaultProps},Yf=class extends Dt{indexToBounds(){return null}renderLayers(){let{elevationScale:t,extruded:r,wireframe:n,filled:s,stroked:i,lineWidthUnits:o,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:h,lineMiterLimit:f,lineDashJustified:u,getElevation:d,getFillColor:p,getLineColor:m,getLineWidth:g}=this.props,{updateTriggers:_,material:y,transitions:x}=this.props,A=this.getSubLayerClass("cell",ni),{updateTriggers:M,...E}=this.indexToBounds()||{};return new A({filled:s,wireframe:n,extruded:r,elevationScale:t,stroked:i,lineWidthUnits:o,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:h,lineMiterLimit:f,lineDashJustified:u,material:y,transitions:x,getElevation:d,getFillColor:p,getLineColor:m,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:_&&{...M,getElevation:_.getElevation,getFillColor:_.getFillColor,getLineColor:_.getLineColor,getLineWidth:_.getLineWidth}}),E)}};Yf.layerName="GeoCellLayer";Yf.defaultProps=HZ;var Sn=Yf;var Cg=Dn(XA(),1),WZ=3,GZ=30,jZ=2*GZ+1,IO=180/Math.PI;function LO(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function OO(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function NO(e){return[OO(e[0]),OO(e[1])]}function BO(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function FO([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*IO,n*IO]}function DO(e){let t=Cg.default.fromString(e,!0,10).toString(2);for(;t.length<WZ+jZ;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),i=s.length/2,o=Cg.default.fromString(n,!0,2).toString(10),a=Cg.default.fromString(s,!0,2).toString(4);for(;a.length<i;)a="0"+a;return`${o}/${a}`}function qZ(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function kO(e){let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,i=[0,0],o;for(let a=s-1;a>=0;a--){o=s-a;let c=n[a],l=0,h=0;c==="1"?h=1:c==="2"?(l=1,h=1):c==="3"&&(l=1);let f=Math.pow(2,o-1);qZ(f,i,l,h),i[0]+=f*l,i[1]+=f*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:o}}var UO=Dn(XA(),1);function YZ(e){let t=e.padEnd(16,"0");return UO.default.fromString(t,16)}var XZ=100;function $Z({face:e,ij:t,level:r}){let n=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(XZ*Math.pow(2,-r))),i=new Float64Array(4*s*2+2),o=0,a=0;for(let c=0;c<4;c++){let l=n[c].slice(0),h=n[c+1],f=(h[0]-l[0])/s,u=(h[1]-l[1])/s;for(let d=0;d<s;d++){l[0]+=f,l[1]+=u;let p=LO(t,r,l),m=NO(p),g=BO(e,m),_=FO(g);Math.abs(_[1])>89.999&&(_[0]=a);let y=_[0]-a;_[0]+=y>180?-360:y<-180?360:0,i[o++]=_[0],i[o++]=_[1],a=_[0]}}return i[o++]=i[0],i[o++]=i[1],i}function KZ(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=YZ(e)}return DO(e.toString())}function zO(e){let t=KZ(e),r=kO(t);return $Z(r)}var ZZ={getS2Token:{type:"accessor",value:e=>e.token}},$f=class extends Sn{indexToBounds(){let{data:t,getS2Token:r}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(n,s)=>zO(r(n,s))}}};$f.layerName="S2Layer";$f.defaultProps=ZZ;var VO=$f;var $A=512;function JZ(e,t){let r=0,n=0,s=1<<e.length,i=s/$A;for(let o=0;o<e.length;o++){s>>=1;let a=parseInt(e[o]);a%2&&(r|=s),a>1&&(n|=s)}return[[r/i,$A-n/i],[(r+t)/i,$A-(n+t)/i]]}function HO(e,t=1){let[r,n]=JZ(e,t),[s,i]=Ee(r),[o,a]=Ee(n);return[o,i,o,a,s,a,s,i,o,i]}var QZ={getQuadkey:{type:"accessor",value:e=>e.quadkey}},Kf=class extends Sn{indexToBounds(){let{data:t,extruded:r,getQuadkey:n}=this.props,s=r?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(i,o)=>HO(n(i,o),s),updateTriggers:{getPolygon:s}}}};Kf.layerName="QuadkeyLayer";Kf.defaultProps=QZ;var WO=Kf;var Eo=class{constructor(t){this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,"west"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){let t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}async _loadData({getData:t,requestScheduler:r,onLoad:n,onError:s}){let{index:i,id:o,bbox:a,userData:c,zoom:l}=this,h=this._loaderId;this._abortController=new AbortController;let{signal:f}=this._abortController,u=await r.scheduleRequest(this,m=>m.isSelected?1:-1);if(!u){this._isCancelled=!0;return}if(this._isCancelled){u.done();return}let d=null,p;try{d=await t({index:i,id:o,bbox:a,userData:c,zoom:l,signal:f})}catch(m){p=m||!0}finally{u.done()}if(h===this._loaderId){if(this._loader=void 0,this.content=d,this._isCancelled&&!d){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,p?s(p,this):n(this)}}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}};var Jt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var GO=new D,tJ=new D,ii=class{constructor(t=[0,0,0],r=[0,0,0],n){n=n||GO.copy(t).add(r).scale(.5),this.center=new D(n),this.halfDiagonal=new D(r).subtract(this.center),this.minimum=new D(t),this.maximum=new D(r)}clone(){return new ii(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){let{halfDiagonal:r}=this,n=tJ.from(t.normal),s=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),i=this.center.dot(n)+t.distance;return i-s>0?Jt.INSIDE:i+s<0?Jt.OUTSIDE:Jt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=GO.from(t).subtract(this.center),{halfDiagonal:n}=this,s=0,i;return i=Math.abs(r.x)-n.x,i>0&&(s+=i*i),i=Math.abs(r.y)-n.y,i>0&&(s+=i*i),i=Math.abs(r.z)-n.z,i>0&&(s+=i*i),s}};var Zf=new D,jO=new D,oi=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new D,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Zf.from(r),this.center=new D().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new oi(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,i=t.radius,o=Zf.copy(s).subtract(r),a=o.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return t.clone();let c=(n+a+i)*.5;return jO.copy(o).scale((-n+c)/a).add(r),this.center.copy(jO),this.radius=c,this}expand(t){let n=Zf.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=qt.getScaling(Zf,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Zf.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,i=t.normal.dot(r)+t.distance;return i<-n?Jt.OUTSIDE:i<n?Jt.INTERSECTING:Jt.INSIDE}};var eJ=new D,rJ=new D,Pg=new D,Rg=new D,Ig=new D,nJ=new D,sJ=new D,cs={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},bo=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new D().from(t),this.halfAxes=new zt(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new D(t).len(),new D(r).len(),new D(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new D(t).normalize(),i=new D(r).normalize(),o=new D(n).normalize();return new Vs().fromMatrix3(new zt([...s,...i,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Vs(n),i=new zt().fromQuaternion(s);return i[0]=i[0]*r[0],i[1]=i[1]*r[0],i[2]=i[2]*r[0],i[3]=i[3]*r[1],i[4]=i[4]*r[1],i[5]=i[5]*r[1],i[6]=i[6]*r[2],i[7]=i[7]*r[2],i[8]=i[8]*r[2],this.center=new D().from(t),this.halfAxes=i,this}clone(){return new bo(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new oi){let r=this.halfAxes,n=r.getColumn(0,Pg),s=r.getColumn(1,Rg),i=r.getColumn(2,Ig),o=eJ.copy(n).add(s).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,i=n.x,o=n.y,a=n.z,c=Math.abs(i*s[cs.COLUMN0ROW0]+o*s[cs.COLUMN0ROW1]+a*s[cs.COLUMN0ROW2])+Math.abs(i*s[cs.COLUMN1ROW0]+o*s[cs.COLUMN1ROW1]+a*s[cs.COLUMN1ROW2])+Math.abs(i*s[cs.COLUMN2ROW0]+o*s[cs.COLUMN2ROW1]+a*s[cs.COLUMN2ROW2]),l=n.dot(r)+t.distance;return l<=-c?Jt.OUTSIDE:l>=c?Jt.INSIDE:Jt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=rJ.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,Pg),i=n.getColumn(1,Rg),o=n.getColumn(2,Ig),a=s.magnitude(),c=i.magnitude(),l=o.magnitude();s.normalize(),i.normalize(),o.normalize();let h=0,f;return f=Math.abs(r.dot(s))-a,f>0&&(h+=f*f),f=Math.abs(r.dot(i))-c,f>0&&(h+=f*f),f=Math.abs(r.dot(o))-l,f>0&&(h+=f*f),h}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,c=a.getColumn(0,Pg),l=a.getColumn(1,Rg),h=a.getColumn(2,Ig),f=nJ.copy(c).add(l).add(h).add(o),u=sJ.copy(f).subtract(t),d=r.dot(u);return s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).add(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).subtract(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).subtract(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).add(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).add(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).subtract(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).subtract(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),n[0]=s,n[1]=i,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,Pg);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,Rg);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,Ig);return s.transformAsPoint(t),this.halfAxes=new zt([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var qO=new D,YO=new D,Kr=class{constructor(t=[0,0,1],r=0){this.normal=new D,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return un(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=qO.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),un(Ut(this.normal.len(),1)),this.distance=s,this}clone(){return new Kr(this.normal,this.distance)}equals(t){return Ut(this.distance,t.distance)&&Ut(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=YO.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=qO.from(t),s=this.getPointDistance(n),i=YO.copy(this.normal).scale(s);return n.subtract(i).to(r)}};var XO=[new D([1,0,0]),new D([0,1,0]),new D([0,0,1])],$O=new D,iJ=new D,er=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*XO.length;let r=t.center,n=t.radius,s=0;for(let i of XO){let o=this.planes[s],a=this.planes[s+1];o||(o=this.planes[s]=new Kr),a||(a=this.planes[s+1]=new Kr);let c=$O.copy(i).scale(-n).add(r);o.fromPointNormal(c,i);let l=$O.copy(i).scale(n).add(r),h=iJ.copy(i).negate();a.fromPointNormal(l,h),s+=2}return this}computeVisibility(t){let r=Jt.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case Jt.OUTSIDE:return Jt.OUTSIDE;case Jt.INTERSECTING:r=Jt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(un(Number.isFinite(r),"parentPlaneMask is required."),r===er.MASK_OUTSIDE||r===er.MASK_INSIDE)return r;let n=er.MASK_INSIDE,s=this.planes;for(let i=0;i<this.planes.length;++i){let o=i<31?1<<i:0;if(i<31&&!(r&o))continue;let a=s[i],c=t.intersectPlane(a);if(c===Jt.OUTSIDE)return er.MASK_OUTSIDE;c===Jt.INTERSECTING&&(n|=o)}return n}};er.MASK_OUTSIDE=4294967295;er.MASK_INSIDE=0;er.MASK_INDETERMINATE=2147483647;var P6t=new D,R6t=new D,I6t=new D,O6t=new D,L6t=new D;var U6t=new D,z6t=new D,V6t=new D,H6t=new D,W6t=new D,G6t=new D,j6t=new D,q6t=new D,Y6t=new D,X6t=new D,$6t=new D,K6t=new D;var vn=new zt,aJ=new zt,cJ=new zt,Og=new zt,KO=new zt;function JA(e,t={}){let r=va.EPSILON20,n=10,s=0,i=0,o=aJ,a=cJ;o.identity(),a.copy(e);let c=r*lJ(a);for(;i<n&&hJ(a)>c;)fJ(a,Og),KO.copy(Og).transpose(),a.multiplyRight(Og),a.multiplyLeft(KO),o.multiplyRight(Og),++s>2&&(++i,s=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function lJ(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var KA=[1,0,0],ZA=[2,2,1];function hJ(e){let t=0;for(let r=0;r<3;++r){let n=e[vn.getElementIndex(ZA[r],KA[r])];t+=2*n*n}return Math.sqrt(t)}function fJ(e,t){let r=va.EPSILON15,n=0,s=1;for(let l=0;l<3;++l){let h=Math.abs(e[vn.getElementIndex(ZA[l],KA[l])]);h>n&&(s=l,n=h)}let i=KA[s],o=ZA[s],a=1,c=0;if(Math.abs(e[vn.getElementIndex(o,i)])>r){let l=e[vn.getElementIndex(o,o)],h=e[vn.getElementIndex(i,i)],f=e[vn.getElementIndex(o,i)],u=(l-h)/2/f,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),c=d*a}return zt.IDENTITY.to(t),t[vn.getElementIndex(i,i)]=t[vn.getElementIndex(o,o)]=a,t[vn.getElementIndex(o,i)]=c,t[vn.getElementIndex(i,o)]=-c,t}var ai=new D,uJ=new D,dJ=new D,pJ=new D,mJ=new D,gJ=new zt,_J={diagonal:new zt,unitary:new zt};function QA(e,t=new bo){if(!e||e.length===0)return t.halfAxes=new zt([0,0,0,0,0,0,0,0,0]),t.center=new D,t;let r=e.length,n=new D(0,0,0);for(let b of e)n.add(b);let s=1/r;n.multiplyByScalar(s);let i=0,o=0,a=0,c=0,l=0,h=0;for(let b of e){let T=ai.copy(b).subtract(n);i+=T.x*T.x,o+=T.x*T.y,a+=T.x*T.z,c+=T.y*T.y,l+=T.y*T.z,h+=T.z*T.z}i*=s,o*=s,a*=s,c*=s,l*=s,h*=s;let f=gJ;f[0]=i,f[1]=o,f[2]=a,f[3]=o,f[4]=c,f[5]=l,f[6]=a,f[7]=l,f[8]=h;let{unitary:u}=JA(f,_J),d=t.halfAxes.copy(u),p=d.getColumn(0,dJ),m=d.getColumn(1,pJ),g=d.getColumn(2,mJ),_=-Number.MAX_VALUE,y=-Number.MAX_VALUE,x=-Number.MAX_VALUE,A=Number.MAX_VALUE,M=Number.MAX_VALUE,E=Number.MAX_VALUE;for(let b of e)ai.copy(b),_=Math.max(ai.dot(p),_),y=Math.max(ai.dot(m),y),x=Math.max(ai.dot(g),x),A=Math.min(ai.dot(p),A),M=Math.min(ai.dot(m),M),E=Math.min(ai.dot(g),E);p=p.multiplyByScalar(.5*(A+_)),m=m.multiplyByScalar(.5*(M+y)),g=g.multiplyByScalar(.5*(E+x)),t.center.copy(p).add(m).add(g);let w=uJ.set(_-A,y-M,x-E).multiplyByScalar(.5),v=new zt([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(v),t}var oc=512,ZO=3,JO=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],QO=JO.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),xJ=QO.concat([[.25,.5],[.75,.5]]),ci=class{constructor(t,r,n){this.x=t,this.y=r,this.z=n}get children(){if(!this._children){let t=this.x*2,r=this.y*2,n=this.z+1;this._children=[new ci(t,r,n),new ci(t,r+1,n),new ci(t+1,r,n),new ci(t+1,r+1,n)]}return this._children}update(t){let{viewport:r,cullingVolume:n,elevationBounds:s,minZ:i,maxZ:o,bounds:a,offset:c,project:l}=t,h=this.getBoundingVolume(s,c,l);if(a&&!this.insideBounds(a)||n.computeVisibility(h)<0)return!1;if(!this.childVisible){let{z:u}=this;if(u<o&&u>=i){let d=h.distanceTo(r.cameraPosition)*r.scale/r.height;u+=Math.floor(Math.log2(d))}if(u>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(let u of this.children)u.update(t);return!0}getSelected(t=[]){if(this.selected&&t.push(this),this._children)for(let r of this._children)r.getSelected(t);return t}insideBounds([t,r,n,s]){let i=Math.pow(2,this.z),o=oc/i;return this.x*o<n&&this.y*o<s&&(this.x+1)*o>t&&(this.y+1)*o>r}getBoundingVolume(t,r,n){if(n){let c=this.z<1?xJ:this.z<2?QO:JO,l=[];for(let h of c){let f=Lg(this.x+h[0],this.y+h[1],this.z);f[2]=t[0],l.push(n(f)),t[0]!==t[1]&&(f[2]=t[1],l.push(n(f)))}return QA(l)}let s=Math.pow(2,this.z),i=oc/s,o=this.x*i+r*oc,a=oc-(this.y+1)*i;return new ii([o,a,t[0]],[o+i,a+i,t[1]])}};function tL(e,t,r,n){let s=e instanceof Xr&&e.resolution?e.projectPosition:null,i=Object.values(e.getFrustumPlanes()).map(({normal:d,distance:p})=>new Kr(d.clone().negate(),p)),o=new er(i),a=e.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,l=r&&r[1]*a||0,h=e instanceof Pe&&e.pitch<=60?t:0;if(n){let[d,p,m,g]=n,_=Kt([d,g]),y=Kt([m,p]);n=[_[0],oc-_[1],y[0],oc-y[1]]}let f=new ci(0,0,0),u={viewport:e,project:s,cullingVolume:o,elevationBounds:[c,l],minZ:h,maxZ:t,bounds:n,offset:0};if(f.update(u),e instanceof Pe&&e.subViewports&&e.subViewports.length>1){for(u.offset=-1;f.update(u)&&!(--u.offset<-ZO););for(u.offset=1;f.update(u)&&!(++u.offset>ZO););}return f.getSelected()}var ls=512,yJ=[-1/0,-1/0,1/0,1/0],li={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(r=>typeof r=="string"),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;let r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function rL(e,t){let r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min(...r.map(s=>s[0])),Math.min(...r.map(s=>s[1])),Math.max(...r.map(s=>s[0])),Math.max(...r.map(s=>s[1]))]}function AJ(e){return Math.abs(e.split("").reduce((t,r)=>(t<<5)-t+r.charCodeAt(0)|0,0))}function wn(e,t){if(!e||!e.length)return null;let{index:r,id:n}=t;if(Array.isArray(e)){let i=AJ(n)%e.length;e=e[i]}let s=e;for(let i of Object.keys(r)){let o=new RegExp(`{${i}}`,"g");s=s.replace(o,String(r[i]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(s=s.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),s}function TJ(e,t,r){let n;if(t&&t.length===2){let[s,i]=t,o=e.getBounds({z:s}),a=e.getBounds({z:i});n=[Math.min(o[0],a[0]),Math.min(o[1],a[1]),Math.max(o[2],a[2]),Math.max(o[3],a[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}function nL({viewport:e,z:t,cullRect:r}){return(e.subViewports||[e]).map(s=>tT(s,t||0,r))}function tT(e,t,r){if(!Array.isArray(t)){let i=r.x-e.x,o=r.y-e.y,{width:a,height:c}=r,l={targetZ:t},h=e.unproject([i,o],l),f=e.unproject([i+a,o],l),u=e.unproject([i,o+c],l),d=e.unproject([i+a,o+c],l);return[Math.min(h[0],f[0],u[0],d[0]),Math.min(h[1],f[1],u[1],d[1]),Math.max(h[0],f[0],u[0],d[0]),Math.max(h[1],f[1],u[1],d[1])]}let n=tT(e,t[0],r),s=tT(e,t[1],r);return[Math.min(n[0],s[0]),Math.min(n[1],s[1]),Math.max(n[2],s[2]),Math.max(n[3],s[3])]}function MJ(e,t,r){return r?rL(e,r).map(s=>s*t/ls):e.map(n=>n*t/ls)}function eT(e,t){return Math.pow(2,e)*ls/t}function Lg(e,t,r){let n=eT(r,ls),s=e/n*360-180,i=Math.PI-2*Math.PI*t/n,o=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[s,o]}function eL(e,t,r,n){let s=eT(r,n);return[e/s*ls,t/s*ls]}function rT(e,t,r,n,s=ls){if(e.isGeospatial){let[l,h]=Lg(t,r,n),[f,u]=Lg(t+1,r+1,n);return{west:l,north:h,east:f,south:u}}let[i,o]=eL(t,r,n,s),[a,c]=eL(t+1,r+1,n,s);return{left:i,top:o,right:a,bottom:c}}function EJ(e,t,r,n,s){let i=TJ(e,null,n),o=eT(t,r),[a,c,l,h]=MJ(i,o,s),f=[];for(let u=Math.floor(a);u<l;u++)for(let d=Math.floor(c);d<h;d++)f.push({x:u,y:d,z:t});return f}function nT({viewport:e,maxZoom:t,minZoom:r,zRange:n,extent:s,tileSize:i=ls,modelMatrix:o,modelMatrixInverse:a,zoomOffset:c=0}){let l=e.isGeospatial?Math.round(e.zoom+Math.log2(ls/i))+c:Math.ceil(e.zoom)+c;if(typeof r=="number"&&Number.isFinite(r)&&l<r){if(!s)return[];l=r}typeof t=="number"&&Number.isFinite(t)&&l>t&&(l=t);let h=s;return o&&a&&s&&!e.isGeospatial&&(h=rL(s,o)),e.isGeospatial?tL(e,l,n,s):EJ(e,l,i,h||yJ,a)}function sT(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function iT(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function sL(e){let t={},r;return n=>{for(let s in n)if(!bJ(n[s],t[s])){r=e(n),t=n;break}return r}}function bJ(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}var iL=1,Ng=2,SJ="never",vJ="no-overlap",Jf="best-available",wJ=5,CJ={[Jf]:RJ,[vJ]:IJ,[SJ]:()=>{}},PJ={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}},So=class{constructor(t){this._getCullBounds=sL(nL),this.opts={...PJ,...t},this.setOptions(this.opts),this.onTileLoad=r=>{this.opts.onTileLoad?.(r),this.opts.maxCacheByteSize!==null&&(this._cacheByteSize+=r.byteLength,this._resizeCache())},this._requestScheduler=new vs({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new K,this._modelMatrixInverse=new K}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(t=>t.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(t=>t.needsReload)}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(let t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(let t of this._cache.keys()){let r=this._cache.get(t);!this._selectedTiles||!this._selectedTiles.includes(r)?this._cache.delete(t):r.setNeedsReload()}}update(t,{zRange:r,modelMatrix:n}={zRange:null,modelMatrix:null}){let s=n?new K(n):new K,i=!s.equals(this._modelMatrix);if(!this._viewport||!t.equals(this._viewport)||!Ut(this._zRange,r)||i){i&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=t,this._zRange=r;let a=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=a.map(c=>this._getTile(c,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(a=>this._getTile(a.index,!0)));let o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(t,r){if(!t.isVisible)return!1;if(r&&this._viewport){let n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:r}),{bbox:s}=t;for(let[i,o,a,c]of n){let l;if("west"in s)l=s.west<a&&s.east>i&&s.south<c&&s.north>o;else{let h=Math.min(s.top,s.bottom),f=Math.max(s.top,s.bottom);l=s.left<a&&s.right>i&&h<c&&f>o}if(l)return!0}return!1}return!0}getTileIndices({viewport:t,maxZoom:r,minZoom:n,zRange:s,modelMatrix:i,modelMatrixInverse:o}){let{tileSize:a,extent:c,zoomOffset:l}=this.opts;return nT({viewport:t,maxZoom:r,minZoom:n,zRange:s,tileSize:a,extent:c,modelMatrix:i,modelMatrixInverse:o,zoomOffset:l})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getTileZoom(t){return t.z}getTileMetadata(t){let{tileSize:r}=this.opts;return{bbox:rT(this._viewport,t.x,t.y,t.z,r)}}getParentIndex(t){let r=Math.floor(t.x/2),n=Math.floor(t.y/2),s=t.z-1;return{x:r,y:n,z:s}}updateTileStates(){let t=this.opts.refinementStrategy||Jf,r=new Array(this._cache.size),n=0;for(let s of this._cache.values())r[n++]=s.isVisible,s.isSelected=!1,s.isVisible=!1;for(let s of this._selectedTiles)s.isSelected=!0,s.isVisible=!0;(typeof t=="function"?t:CJ[t])(Array.from(this._cache.values())),n=0;for(let s of this._cache.values())if(r[n++]!==s.isVisible)return!0;return!1}_pruneRequests(){let{maxRequests:t=0}=this.opts,r=[],n=0;for(let s of this._cache.values())s.isLoading&&(n++,!s.isSelected&&!s.isVisible&&r.push(s));for(;t>0&&n>t&&r.length>0;)r.shift().abort(),n--}_rebuildTree(){let{_cache:t}=this;for(let r of t.values())r.parent=null,r.children&&(r.children.length=0);for(let r of t.values()){let n=this._getNearestAncestor(r);r.parent=n,n?.children&&n.children.push(r)}}_resizeCache(){let{_cache:t,opts:r}=this,n=r.maxCacheSize??(r.maxCacheByteSize!==null?1/0:wJ*this.selectedTiles.length),s=r.maxCacheByteSize??1/0;if(t.size>n||this._cacheByteSize>s){for(let[o,a]of t)if(!a.isVisible&&!a.isSelected&&(this._cacheByteSize-=r.maxCacheByteSize!==null?a.byteLength:0,t.delete(o),this.opts.onTileUnload?.(a)),t.size<=n&&this._cacheByteSize<=s)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((o,a)=>o.zoom-a.zoom),this._dirty=!1)}_getTile(t,r){let n=this.getTileId(t),s=this._cache.get(n),i=!1;return!s&&r?(s=new Eo(t),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:n,zoom:this.getTileZoom(s.index)}),i=!0,this._cache.set(n,s),this._dirty=!0):s&&s.needsReload&&(i=!0),s&&i&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s}_getNearestAncestor(t){let{_minZoom:r=0}=this,n=t.index;for(;this.getTileZoom(n)>r;){n=this.getParentIndex(n);let s=this._getTile(n);if(s)return s}return null}};function RJ(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&!oL(t)&&oT(t);for(let t of e)t.isVisible=Boolean(t.state&Ng)}function IJ(e){for(let r of e)r.state=0;for(let r of e)r.isSelected&&oL(r);let t=Array.from(e).sort((r,n)=>r.zoom-n.zoom);for(let r of t)if(r.isVisible=Boolean(r.state&Ng),r.children&&(r.isVisible||r.state&iL))for(let n of r.children)n.state=iL;else r.isSelected&&oT(r)}function oL(e){let t=e;for(;t;){if(t.isLoaded||t.content)return t.state|=Ng,!0;t=t.parent}return!1}function oT(e){for(let t of e.children)t.isLoaded||t.content?t.state|=Ng:oT(t)}var OJ={TilesetClass:So,data:{type:"data",value:[]},dataComparator:li.equal,renderSubLayers:{type:"function",value:e=>new yo(e)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:e=>{}},onTileUnload:{type:"function",value:e=>{}},onTileError:{type:"function",value:e=>console.error(e)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Jf,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0},Qf=class extends Dt{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return Boolean(this.state?.tileset?.selectedTiles?.every(t=>t.isLoaded&&t.layers&&t.layers.every(r=>r.isLoaded)))}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState({changeFlags:t}){let{tileset:r}=this.state,n=t.propsOrDataChanged||t.updateTriggersChanged,s=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),s?r.reloadAll():r.tiles.forEach(i=>{i.layers=null})):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}_getTilesetOptions(){let{tileSize:t,maxCacheSize:r,maxCacheByteSize:n,refinementStrategy:s,extent:i,maxZoom:o,minZoom:a,maxRequests:c,debounceTime:l,zoomOffset:h}=this.props;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:o,minZoom:a,tileSize:t,refinementStrategy:s,extent:i,maxRequests:c,debounceTime:l,zoomOffset:h,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){let t=this.state.tileset,{zRange:r,modelMatrix:n}=this.props,s=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),{isLoaded:i}=t,o=this.state.isLoaded!==i,a=this.state.frameNumber!==s;i&&(o||a)&&this._onViewportLoad(),a&&this.setState({frameNumber:s}),this.state.isLoaded=i}_onViewportLoad(){let{tileset:t}=this.state,{onViewportLoad:r}=this.props;r&&r(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,r){this.props.onTileError(t),r.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){let{data:r,getTileData:n,fetch:s}=this.props,{signal:i}=t;return t.url=typeof r=="string"||Array.isArray(r)?wn(r,t):null,n?n(t):s&&t.url?s(t.url,{propName:"data",layer:this,signal:i}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let r=t.sourceLayer,n=r.props.tile,s=t.info;return s.picked&&(s.tile=n),s.sourceTile=n,s.sourceTileSubLayer=r,s}_updateAutoHighlight(t){t.sourceTileSubLayer.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map(t=>{let r=this.getSubLayerPropsByTile(t);if(!(!t.isLoaded&&!t.content))if(t.layers)r&&t.layers[0]&&Object.keys(r).some(n=>t.layers[0].props[n]!==r[n])&&(t.layers=t.layers.map(n=>n.clone(r)));else{let n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=We(n,Boolean).map(s=>s.clone({tile:t,...r}))}return t.layers})}filterSubLayer({layer:t,cullRect:r}){let{tile:n}=t.props;return this.state.tileset.isTileVisible(n,r)}};Qf.defaultProps=OJ;Qf.layerName="TileLayer";var vo=Qf;var aL=`uniform tripsUniforms {
4454
4454
  bool fadeTrail;
4455
4455
  float trailLength;
4456
4456
  float currentTime;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A suite of 3D-enabled data visualization overlays, suitable for react-map-gl",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.1.11",
6
+ "version": "9.1.12",
7
7
  "keywords": [
8
8
  "webgl",
9
9
  "visualization",
@@ -39,19 +39,19 @@
39
39
  "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
40
40
  },
41
41
  "dependencies": {
42
- "@deck.gl/aggregation-layers": "9.1.11",
43
- "@deck.gl/arcgis": "9.1.11",
44
- "@deck.gl/carto": "9.1.11",
45
- "@deck.gl/core": "9.1.11",
46
- "@deck.gl/extensions": "9.1.11",
47
- "@deck.gl/geo-layers": "9.1.11",
48
- "@deck.gl/google-maps": "9.1.11",
49
- "@deck.gl/json": "9.1.11",
50
- "@deck.gl/layers": "9.1.11",
51
- "@deck.gl/mapbox": "9.1.11",
52
- "@deck.gl/mesh-layers": "9.1.11",
53
- "@deck.gl/react": "9.1.11",
54
- "@deck.gl/widgets": "9.1.11",
42
+ "@deck.gl/aggregation-layers": "9.1.12",
43
+ "@deck.gl/arcgis": "9.1.12",
44
+ "@deck.gl/carto": "9.1.12",
45
+ "@deck.gl/core": "9.1.12",
46
+ "@deck.gl/extensions": "9.1.12",
47
+ "@deck.gl/geo-layers": "9.1.12",
48
+ "@deck.gl/google-maps": "9.1.12",
49
+ "@deck.gl/json": "9.1.12",
50
+ "@deck.gl/layers": "9.1.12",
51
+ "@deck.gl/mapbox": "9.1.12",
52
+ "@deck.gl/mesh-layers": "9.1.12",
53
+ "@deck.gl/react": "9.1.12",
54
+ "@deck.gl/widgets": "9.1.12",
55
55
  "@loaders.gl/core": "^4.2.0",
56
56
  "@luma.gl/core": "^9.1.5",
57
57
  "@luma.gl/engine": "^9.1.5"
@@ -72,5 +72,5 @@
72
72
  "optional": true
73
73
  }
74
74
  },
75
- "gitHead": "13816c3da4f7deab1538dbc590d5267349a512e2"
75
+ "gitHead": "ed876a5eee0f612cd876244b0b2835ab871733ac"
76
76
  }