@iqmo/browser
Version:
Browser Stlite
29 lines (25 loc) • 2.74 MB
JavaScript
var sG=Object.defineProperty,aG=(e,t,i)=>t in e?sG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,z=(e,t,i)=>aG(e,typeof t!="symbol"?t+"":t,i);import{r as Ie,ar as wi,bl as ge,g as Jh,bm as Nu,_ as BB,a$ as lG,j as ir,bn as Kv,bo as Qv,bp as cG,bq as uG,br as TB,b6 as hG,bs as fG,c as SB,C as IB,b5 as MB,Q as Zv,bt as PB,b2 as dG,z as pG,bu as AG,bv as RB}from"./index-C9lG8Cnd.js";import{_ as po,C as gG}from"./slicedToArray-CgEX-vVM.js";import{a as Uu,b as Gu,_ as Yv,c as _d,d as $v}from"./inherits-tTYlOvxq.js";import{T as mG,a as yG}from"./Toolbar-CicI5PGk.js";import{E as FB,w as _G}from"./withFullScreenWrapper-mfur2-_a.js";import{u as vG}from"./useBasicWidgetState-C76uodSh.js";import{u as bG,s as xG}from"./threshold-CT01Jj2z.js";import{a as wG}from"./index-qCq0L4jN.js";function CG(e,t){for(var i=0;i<t.length;i++){const n=t[i];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(n,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const zu={};function Jm(e,t){if(!e)throw new Error(t||"loader assertion failed.")}const qv=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),OB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);OB&&parseFloat(OB[1]);const t1=globalThis,Xm=globalThis.process||{};function EG(e){var t,i;if(typeof window<"u"&&((t=window.process)==null?void 0:t.type)==="renderer"||typeof process<"u"&&(i=process.versions)!=null&&i.electron)return!0;const n=typeof navigator<"u"&&navigator.userAgent;return!!(n&&n.indexOf("Electron")>=0)}function e1(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||EG()}const LB="4.0.7";function BG(e){try{const t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch{return null}}let TG=class{constructor(e,t,i="sessionStorage"){this.storage=BG(i),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function SG(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function IG(e,t=8){const i=Math.max(t-e.length,0);return`${" ".repeat(i)}${e}`}var Km;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Km||(Km={}));const MG=10;function DB(e){return typeof e!="string"?e:(e=e.toUpperCase(),Km[e]||Km.WHITE)}function PG(e,t,i){return!e1&&typeof e=="string"&&(t&&(e=`\x1B[${DB(t)}m${e}\x1B[39m`),i&&(e=`\x1B[${DB(i)+MG}m${e}\x1B[49m`)),e}function RG(e,t=["constructor"]){const i=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(i),r=e;for(const s of n){const o=r[s];typeof o=="function"&&(t.find(l=>s===l)||(r[s]=o.bind(e)))}}function i1(e,t){if(!e)throw new Error("Assertion failed")}function vd(){var e,t,i;let n;if(e1()&&t1.performance)n=(t=(e=t1==null?void 0:t1.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Xm){const r=(i=Xm==null?void 0:Xm.hrtime)==null?void 0:i.call(Xm);n=r[0]*1e3+r[1]/1e6}else n=Date.now();return n}const bd={debug:e1()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},FG={enabled:!0,level:0};function xd(){}const kB={},NB={once:!0};let UB=class{constructor({id:e}={id:""}){this.VERSION=LB,this._startTs=vd(),this._deltaTs=vd(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new TG(`__probe-${this.id}__`,FG),this.timeStamp(`${this.id} started`),RG(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((vd()-this._startTs).toPrecision(10))}getDelta(){return Number((vd()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,bd.warn,arguments,NB)}error(e){return this._getLogFunction(0,e,bd.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,bd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,bd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,bd.debug||bd.info,arguments,NB)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||xd,i&&[i],{tag:LG(t)}):xd}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||xd)}group(e,t,i={collapsed:!1}){const n=zB({logLevel:e,message:t,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||xd)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=GB(e)}_getLogFunction(e,t,i,n,r){if(this._shouldLog(e)){r=zB({logLevel:e,message:t,args:n,opts:r}),i=i||r.method,i1(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=vd();const s=r.tag||r.message;if(r.once&&s)if(!kB[s])kB[s]=vd();else return xd;return t=OG(this.id,r.message,r),i.bind(console,t,...r.args)}return xd}};UB.VERSION=LB;function GB(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return i1(Number.isFinite(t)&&t>=0),t}function zB(e){const{logLevel:t,message:i}=e;e.logLevel=GB(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==i;);switch(typeof t){case"string":case"function":i!==void 0&&n.unshift(i),e.message=t;break;case"object":Object.assign(e,t);break}typeof e.message=="function"&&(e.message=e.message());const r=typeof e.message;return i1(r==="string"||r==="object"),Object.assign(e,{args:n},e.opts)}function OG(e,t,i){if(typeof t=="string"){const n=i.time?IG(SG(i.total)):"";t=i.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=PG(t,i.color,i.background)}return t}function LG(e){for(const t in e)for(const i in e[t])return i||"untitled";return"empty"}const n1="4.3.1",DG=n1[0]>="0"&&n1[0]<="9"?`v${n1}`:"";function kG(){const e=new UB({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=DG,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}const NG=kG();function UG(e,t){return VB(e||{},t)}function VB(e,t,i=0){if(i>3)return t;const n={...e};for(const[r,s]of Object.entries(t))s&&typeof s=="object"&&!Array.isArray(s)?n[r]=VB(n[r]||{},t[r],i+1):n[r]=t[r];return n}const GG="latest";function zG(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.1"),globalThis._loadersgl_.version}const VG=zG();function Vu(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}const Xh=typeof process!="object"||String(process)!=="[object process]"||process.browser,jG=typeof window<"u"&&typeof window.orientation<"u",jB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);jB&&parseFloat(jB[1]);let HG=class{constructor(e,t){z(this,"name"),z(this,"workerThread"),z(this,"isRunning",!0),z(this,"result"),z(this,"_resolve",()=>{}),z(this,"_reject",()=>{}),this.name=e,this.workerThread=t,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Vu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Vu(this.isRunning),this.isRunning=!1,this._reject(e)}},r1=class{terminate(){}};const o1=new Map;function WG(e){Vu(e.source&&!e.url||!e.source&&e.url);let t=o1.get(e.source||e.url);return t||(e.url&&(t=JG(e.url),o1.set(e.url,t)),e.source&&(t=HB(e.source),o1.set(e.source,t))),Vu(t),t}function JG(e){if(!e.startsWith("http"))return e;const t=XG(e);return HB(t)}function HB(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function XG(e){return`try {
importScripts('${e}');
} catch (error) {
console.error(error);
throw error;
}`}function WB(e,t=!0,i){const n=i||new Set;if(e){if(JB(e))n.add(e);else if(JB(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&typeof e=="object")for(const r in e)WB(e[r],t,n)}return i===void 0?Array.from(n):[]}function JB(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}const s1=()=>{};let a1=class{constructor(e){z(this,"name"),z(this,"source"),z(this,"url"),z(this,"terminated",!1),z(this,"worker"),z(this,"onMessage"),z(this,"onError"),z(this,"_loadableURL","");const{name:t,source:i,url:n}=e;Vu(i||n),this.name=t,this.source=i,this.url=n,this.onMessage=s1,this.onError=r=>console.log(r),this.worker=Xh?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&Xh||typeof r1<"u"&&!Xh}destroy(){this.onMessage=s1,this.onError=s1,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||WB(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=WG({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){const t=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new r1(t,{eval:!1})}else if(this.source)e=new r1(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}},KG=class{constructor(e){z(this,"name","unnamed"),z(this,"source"),z(this,"url"),z(this,"maxConcurrency",1),z(this,"maxMobileConcurrency",1),z(this,"onDebug",()=>{}),z(this,"reuseWorkers",!0),z(this,"props",{}),z(this,"jobQueue",[]),z(this,"idleQueue",[]),z(this,"count",0),z(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return a1.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,t=(n,r,s)=>n.done(s),i=(n,r)=>n.error(r)){const n=new Promise(r=>(this.jobQueue.push({name:e,onMessage:t,onError:i,onStart:r}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const i=new HG(t.name,e);e.onMessage=n=>t.onMessage(i,n.type,n.payload),e.onError=n=>t.onError(i,n),t.onStart(i);try{await i.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Xh||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new a1({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return jG?this.maxMobileConcurrency:this.maxConcurrency}};const QG={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};var ju;let XB=(ju=class{constructor(e){z(this,"props"),z(this,"workerPools",new Map),this.props={...QG},this.setProps(e),this.workerPools=new Map}static isSupported(){return a1.isSupported()}static getWorkerFarm(e={}){return ju._workerFarm=ju._workerFarm||new ju({}),ju._workerFarm.setProps(e),ju._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:n}=e;let r=this.workerPools.get(t);return r||(r=new KG({name:t,source:i,url:n}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},z(ju,"_workerFarm"),ju);function ZG(e,t={}){const i=t[e.id]||{},n=Xh?`${e.id}-worker.js`:`${e.id}-worker-node.js`;let r=i.workerUrl;if(!r&&e.id==="compression"&&(r=t.workerUrl),t._workerType==="test"&&(Xh?r=`modules/${e.module}/dist/${n}`:r=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!r){let s=e.version;s==="latest"&&(s=GG);const o=s?`@${s}`:"";r=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return Vu(r),r}function YG(e,t=VG){Vu(e,"no worker provided");const i=e.version;return!(!t||!i)}function $G(e,t){return!XB.isSupported()||!Xh&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function qG(e,t,i,n,r){const s=e.id,o=ZG(e,i),l=XB.getWorkerFarm(i).getWorkerPool({name:s,url:o});i=JSON.parse(JSON.stringify(i)),n=JSON.parse(JSON.stringify(n||{}));const h=await l.startJob("process-on-worker",tz.bind(null,r));return h.postMessage("process",{input:t,options:i,context:n}),await(await h.result).result}async function tz(e,t,i,n){switch(i){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":const{id:r,input:s,options:o}=n;try{const l=await e(s,o);t.postMessage("done",{id:r,result:l})}catch(l){const h=l instanceof Error?l.message:"unknown error";t.postMessage("error",{id:r,error:h})}break;default:console.warn(`parse-with-worker unknown message ${i}`)}}function ez(e,t,i){if(i=i||e.byteLength,e.byteLength<i||t.byteLength<i)return!1;const n=new Uint8Array(e),r=new Uint8Array(t);for(let s=0;s<n.length;++s)if(n[s]!==r[s])return!1;return!0}function iz(...e){return nz(e)}function nz(e){const t=e.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),i=t.reduce((s,o)=>s+o.byteLength,0),n=new Uint8Array(i);let r=0;for(const s of t)n.set(s,r),r+=s.byteLength;return n.buffer}async function rz(e){const t=[];for await(const i of e)t.push(i);return iz(...t)}let oz="";const KB={};function sz(e){for(const t in KB)if(e.startsWith(t)){const i=KB[t];e=e.replace(t,i)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${oz}${e}`),e}function az(e){return e&&typeof e=="object"&&e.isBuffer}function QB(e){if(az(e)||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"){const t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function ZB(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function lz(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}const cz=e=>typeof e=="boolean",GA=e=>typeof e=="function",zA=e=>e!==null&&typeof e=="object",YB=e=>zA(e)&&e.constructor==={}.constructor,uz=e=>!!e&&typeof e[Symbol.iterator]=="function",hz=e=>e&&typeof e[Symbol.asyncIterator]=="function",Kh=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,Qh=e=>typeof Blob<"u"&&e instanceof Blob,fz=e=>e&&typeof e=="object"&&e.isBuffer,dz=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||zA(e)&&GA(e.tee)&&GA(e.cancel)&&GA(e.getReader),pz=e=>zA(e)&&GA(e.read)&&GA(e.pipe)&&cz(e.readable),$B=e=>dz(e)||pz(e);let Az=class extends Error{constructor(e,t){super(e),z(this,"reason"),z(this,"url"),z(this,"response"),this.reason=t.reason,this.url=t.url,this.response=t.response}};const gz=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,mz=/^([-\w.]+\/[-\w.+]+)/;function qB(e,t){return e.toLowerCase()===t.toLowerCase()}function yz(e){const t=mz.exec(e);return t?t[1]:e}function tT(e){const t=gz.exec(e);return t?t[1]:""}const eT=/\?.*/;function _z(e){const t=e.match(eT);return t&&t[0]}function l1(e){return e.replace(eT,"")}function vz(e){if(e.length<50)return e;const t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function Qm(e){return Kh(e)?e.url:Qh(e)?e.name||"":typeof e=="string"?e:""}function c1(e){if(Kh(e)){const t=e,i=t.headers.get("content-type")||"",n=l1(t.url);return yz(i)||tT(n)}return Qh(e)?e.type||"":typeof e=="string"?tT(e):""}function bz(e){return Kh(e)?e.headers["content-length"]||-1:Qh(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function iT(e){if(Kh(e))return e;const t={},i=bz(e);i>=0&&(t["content-length"]=String(i));const n=Qm(e),r=c1(e);r&&(t["content-type"]=r);const s=await Cz(e);s&&(t["x-first-bytes"]=s),typeof e=="string"&&(e=new TextEncoder().encode(e));const o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function xz(e){if(!e.ok)throw await wz(e)}async function wz(e){const t=vz(e.url);let i=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;i=i.length>100?`${i.slice(0,100)}...`:i;const n={reason:e.statusText,url:e.url,response:e};try{const r=e.headers.get("Content-Type");n.reason=!e.bodyUsed&&r!=null&&r.includes("application/json")?await e.json():await e.text()}catch{}return new Az(i,n)}async function Cz(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){const t=e.slice(0,5);return await new Promise(i=>{const n=new FileReader;n.onload=r=>{var s;return i((s=r==null?void 0:r.target)==null?void 0:s.result)},n.readAsDataURL(t)})}if(e instanceof ArrayBuffer){const t=e.slice(0,5);return`data:base64,${Ez(t)}`}return null}function Ez(e){let t="";const i=new Uint8Array(e);for(let n=0;n<i.byteLength;n++)t+=String.fromCharCode(i[n]);return btoa(t)}function Bz(e){return!Tz(e)&&!Sz(e)}function Tz(e){return e.startsWith("http:")||e.startsWith("https:")}function Sz(e){return e.startsWith("data:")}async function nT(e,t){var i,n;if(typeof e=="string"){const r=sz(e);return Bz(r)&&(i=globalThis.loaders)!=null&&i.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(r,t):await fetch(r,t)}return await iT(e)}const u1=globalThis,Zm=globalThis.process||{};function Iz(e){var t,i;if(typeof window<"u"&&((t=window.process)==null?void 0:t.type)==="renderer"||typeof process<"u"&&(i=process.versions)!=null&&i.electron)return!0;const n=typeof navigator<"u"&&navigator.userAgent;return!!(n&&n.indexOf("Electron")>=0)}function h1(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||Iz()}const rT="4.0.7";function Mz(e){try{const t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch{return null}}let Pz=class{constructor(e,t,i="sessionStorage"){this.storage=Mz(i),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function Rz(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function Fz(e,t=8){const i=Math.max(t-e.length,0);return`${" ".repeat(i)}${e}`}var Ym;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ym||(Ym={}));const Oz=10;function oT(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ym[e]||Ym.WHITE)}function Lz(e,t,i){return!h1&&typeof e=="string"&&(t&&(e=`\x1B[${oT(t)}m${e}\x1B[39m`),i&&(e=`\x1B[${oT(i)+Oz}m${e}\x1B[49m`)),e}function Dz(e,t=["constructor"]){const i=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(i),r=e;for(const s of n){const o=r[s];typeof o=="function"&&(t.find(l=>s===l)||(r[s]=o.bind(e)))}}function f1(e,t){if(!e)throw new Error("Assertion failed")}function wd(){var e,t,i;let n;if(h1()&&u1.performance)n=(t=(e=u1==null?void 0:u1.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Zm){const r=(i=Zm==null?void 0:Zm.hrtime)==null?void 0:i.call(Zm);n=r[0]*1e3+r[1]/1e6}else n=Date.now();return n}const Cd={debug:h1()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},kz={enabled:!0,level:0};function Ed(){}const sT={},aT={once:!0};let lT=class{constructor({id:e}={id:""}){this.VERSION=rT,this._startTs=wd(),this._deltaTs=wd(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new Pz(`__probe-${this.id}__`,kz),this.timeStamp(`${this.id} started`),Dz(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((wd()-this._startTs).toPrecision(10))}getDelta(){return Number((wd()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Cd.warn,arguments,aT)}error(e){return this._getLogFunction(0,e,Cd.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,Cd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Cd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,Cd.debug||Cd.info,arguments,aT)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||Ed,i&&[i],{tag:Uz(t)}):Ed}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||Ed)}group(e,t,i={collapsed:!1}){const n=uT({logLevel:e,message:t,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Ed)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=cT(e)}_getLogFunction(e,t,i,n,r){if(this._shouldLog(e)){r=uT({logLevel:e,message:t,args:n,opts:r}),i=i||r.method,f1(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=wd();const s=r.tag||r.message;if(r.once&&s)if(!sT[s])sT[s]=wd();else return Ed;return t=Nz(this.id,r.message,r),i.bind(console,t,...r.args)}return Ed}};lT.VERSION=rT;function cT(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return f1(Number.isFinite(t)&&t>=0),t}function uT(e){const{logLevel:t,message:i}=e;e.logLevel=cT(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==i;);switch(typeof t){case"string":case"function":i!==void 0&&n.unshift(i),e.message=t;break;case"object":Object.assign(e,t);break}typeof e.message=="function"&&(e.message=e.message());const r=typeof e.message;return f1(r==="string"||r==="object"),Object.assign(e,{args:n},e.opts)}function Nz(e,t,i){if(typeof t=="string"){const n=i.time?Fz(Rz(i.total)):"";t=i.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=Lz(t,i.color,i.background)}return t}function Uz(e){for(const t in e)for(const i in e[t])return i||"untitled";return"empty"}const hT=new lT({id:"loaders.gl"});let Gz=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},zz=class{constructor(){z(this,"console"),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}};const fT={fetch:null,mimeType:void 0,nothrow:!1,log:new zz,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:qv,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Vz={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 dT(){globalThis.loaders=globalThis.loaders||{};const{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function pT(){const e=dT();return e.globalOptions=e.globalOptions||{...fT},e.globalOptions}function jz(e,t,i,n){return i=i||[],i=Array.isArray(i)?i:[i],Hz(e,i),Jz(t,e,n)}function Hz(e,t){AT(e,null,fT,Vz,t);for(const i of t){const n=e&&e[i.id]||{},r=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};AT(n,i.id,r,s,t)}}function AT(e,t,i,n,r){const s=t||"Top level",o=t?`${t}.`:"";for(const l in e){const h=!t&&zA(e[l]),A=l==="baseUri"&&!t,v=l==="workerUrl"&&t;if(!(l in i)&&!A&&!v){if(l in n)hT.warn(`${s} loader option '${o}${l}' no longer supported, use '${n[l]}'`)();else if(!h){const w=Wz(l,r);hT.warn(`${s} loader option '${o}${l}' not recognized. ${w}`)()}}}}function Wz(e,t){const i=e.toLowerCase();let n="";for(const r of t)for(const s in r.options){if(e===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(i.startsWith(o)||o.startsWith(i))&&(n=n||`Did you mean '${r.id}.${s}'?`)}return n}function Jz(e,t,i){const n={...e.options||{}};return Xz(n,i),n.log===null&&(n.log=new Gz),gT(n,pT()),gT(n,t),n}function gT(e,t){for(const i in t)if(i in t){const n=t[i];YB(n)&&YB(e[i])?e[i]={...e[i],...t[i]}:e[i]=t[i]}}function Xz(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function d1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function p1(e){Jm(e,"null loader"),Jm(d1(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}const mT=()=>{const e=dT();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Kz(e){const t=mT();e=Array.isArray(e)?e:[e];for(const i of e){const n=p1(i);t.find(r=>n===r)||t.unshift(n)}}function Qz(){return mT()}const Zz=/\.([^.]+)$/;async function Yz(e,t=[],i,n){if(!_T(e))return null;let r=yT(e,t,{...i,nothrow:!0},n);if(r)return r;if(Qh(e)&&(e=await e.slice(0,10).arrayBuffer(),r=yT(e,t,i,n)),!r&&!(i!=null&&i.nothrow))throw new Error(vT(e));return r}function yT(e,t=[],i,n){if(!_T(e))return null;if(t&&!Array.isArray(t))return p1(t);let r=[];t&&(r=r.concat(t)),i!=null&&i.ignoreRegisteredLoaders||r.push(...Qz()),qz(r);const s=$z(e,r,i,n);if(!s&&!(i!=null&&i.nothrow))throw new Error(vT(e));return s}function $z(e,t,i,n){const r=Qm(e),s=c1(e),o=l1(r)||(n==null?void 0:n.url);let l=null,h="";return i!=null&&i.mimeType&&(l=A1(t,i==null?void 0:i.mimeType),h=`match forced by supplied MIME type ${i==null?void 0:i.mimeType}`),l=l||t7(t,o),h=h||(l?`matched url ${o}`:""),l=l||A1(t,s),h=h||(l?`matched MIME type ${s}`:""),l=l||i7(t,e),h=h||(l?`matched initial data ${xT(e)}`:""),i!=null&&i.fallbackMimeType&&(l=l||A1(t,i==null?void 0:i.fallbackMimeType),h=h||(l?`matched fallback MIME type ${s}`:"")),h&&NG.log(1,`selectLoader selected ${l==null?void 0:l.name}: ${h}.`),l}function _T(e){return!(e instanceof Response&&e.status===204)}function vT(e){const t=Qm(e),i=c1(e);let n="No valid loader found (";n+=t?`${ZB(t)}, `:"no url provided, ",n+=`MIME type: ${i?`"${i}"`:"not provided"}, `;const r=e?xT(e):"";return n+=r?` first bytes: "${r}"`:"first bytes: not available",n+=")",n}function qz(e){for(const t of e)p1(t)}function t7(e,t){const i=t&&Zz.exec(t),n=i&&i[1];return n?e7(e,n):null}function e7(e,t){t=t.toLowerCase();for(const i of e)for(const n of i.extensions)if(n.toLowerCase()===t)return i;return null}function A1(e,t){var i;for(const n of e)if((i=n.mimeTypes)!=null&&i.some(r=>qB(t,r))||qB(t,`application/x.${n.id}`))return n;return null}function i7(e,t){if(!t)return null;for(const i of e)if(typeof t=="string"){if(n7(t,i))return i}else if(ArrayBuffer.isView(t)){if(bT(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer&&bT(t,0,i))return i;return null}function n7(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>e.startsWith(i))}function bT(e,t,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some(n=>r7(e,t,i,n))}function r7(e,t,i,n){if(n instanceof ArrayBuffer)return ez(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":const r=g1(e,t,n.length);return n===r;default:return!1}}function xT(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?g1(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?g1(e,0,t):""}function g1(e,t,i){if(e.byteLength<t+i)return"";const n=new DataView(e);let r="";for(let s=0;s<i;s++)r+=String.fromCharCode(n.getUint8(t+s));return r}const o7=256*1024;function*s7(e,t){const i=(t==null?void 0:t.chunkSize)||o7;let n=0;const r=new TextEncoder;for(;n<e.length;){const s=Math.min(e.length-n,i),o=e.slice(n,n+s);n+=s,yield r.encode(o)}}const a7=256*1024;function*l7(e,t={}){const{chunkSize:i=a7}=t;let n=0;for(;n<e.byteLength;){const r=Math.min(e.byteLength-n,i),s=new ArrayBuffer(r),o=new Uint8Array(e,n,r);new Uint8Array(s).set(o),n+=r,yield s}}const c7=1024*1024;async function*u7(e,t){const i=(t==null?void 0:t.chunkSize)||c7;let n=0;for(;n<e.size;){const r=n+i,s=await e.slice(n,r).arrayBuffer();n=r,yield s}}function wT(e,t){return qv?h7(e,t):f7(e)}async function*h7(e,t){const i=e.getReader();let n;try{for(;;){const r=n||i.read();t!=null&&t._streamReadAhead&&(n=i.read());const{done:s,value:o}=await r;if(s)return;yield QB(o)}}catch{i.releaseLock()}}async function*f7(e,t){for await(const i of e)yield QB(i)}function d7(e,t){if(typeof e=="string")return s7(e,t);if(e instanceof ArrayBuffer)return l7(e,t);if(Qh(e))return u7(e,t);if($B(e))return wT(e,t);if(Kh(e))return wT(e.body,t);throw new Error("makeIterator")}const CT="Cannot convert supplied data type";function p7(e,t,i){if(t.text&&typeof e=="string")return e;if(fz(e)&&(e=e.buffer),e instanceof ArrayBuffer){const 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;const r=e.byteLength||e.length;return(e.byteOffset!==0||r!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+r)),n}throw new Error(CT)}async function A7(e,t,i){const n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return p7(e,t);if(Qh(e)&&(e=await iT(e)),Kh(e)){const r=e;return await xz(r),t.binary?await r.arrayBuffer():await r.text()}if($B(e)&&(e=d7(e,i)),uz(e)||hz(e))return rz(e);throw new Error(CT)}function ET(e,t){const i=pT(),n=e||i;return typeof n.fetch=="function"?n.fetch:zA(n.fetch)?r=>nT(r,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:nT}function g7(e,t,i){if(i)return i;const n={fetch:ET(t,e),...e};if(n.url){const r=l1(n.url);n.baseUrl=r,n.queryString=_z(n.url),n.filename=ZB(r),n.baseUrl=lz(r)}return Array.isArray(n.loaders)||(n.loaders=null),n}function m7(e,t){if(e&&!Array.isArray(e))return e;let i;if(e&&(i=Array.isArray(e)?e:[e]),t&&t.loaders){const n=Array.isArray(t.loaders)?t.loaders:[t.loaders];i=i?[...i,...n]:n}return i&&i.length?i:void 0}async function $m(e,t,i,n){t&&!Array.isArray(t)&&!d1(t)&&(n=void 0,i=t,t=void 0),e=await e,i=i||{};const r=Qm(e),s=m7(t,n),o=await Yz(e,s,i);return o?(i=jz(i,o,s,r),n=g7({url:r,_parse:$m,loaders:s},i,n||null),await y7(o,e,i,n)):null}async function y7(e,t,i,n){if(YG(e),i=UG(e.options,i),Kh(t)){const s=t,{ok:o,redirected:l,status:h,statusText:A,type:v,url:w}=s,S=Object.fromEntries(s.headers.entries());n.response={headers:S,ok:o,redirected:l,status:h,statusText:A,type:v,url:w}}t=await A7(t,e,i);const r=e;if(r.parseTextSync&&typeof t=="string")return r.parseTextSync(t,i,n);if($G(e,i))return await qG(e,t,i,n,$m);if(r.parseText&&typeof t=="string")return await r.parseText(t,i,n);if(r.parse)return await r.parse(t,i,n);throw Vu(!r.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function m1(e,t,i,n){let r,s;!Array.isArray(t)&&!d1(t)?(r=[],s=t):(r=t,s=i);const o=ET(s);let l=e;return typeof e=="string"&&(l=await o(e)),Qh(e)&&(l=await o(e)),Array.isArray(r)?await $m(l,r,s):await $m(l,r,s)}const _7="4.3.1";var BT;const v7=(BT=globalThis.loaders)==null?void 0:BT.parseImageNode,y1=typeof Image<"u",_1=typeof ImageBitmap<"u",b7=!!v7,v1=qv?!0:b7;function x7(e){switch(e){case"auto":return _1||y1||v1;case"imagebitmap":return _1;case"image":return y1;case"data":return v1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function w7(){if(_1)return"imagebitmap";if(y1)return"image";if(v1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function C7(e){const t=B7(e);if(!t)throw new Error("Not an image");return t}function E7(e){switch(C7(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("getImageData");return t.width=e.width,t.height=e.height,i.drawImage(e,0,0),i.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function B7(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}const T7=/^data:image\/svg\+xml/,S7=/\.svg((\?|#).*)?$/;function b1(e){return e&&(T7.test(e)||S7.test(e))}function I7(e,t){if(b1(t)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return TT(e,t)}function TT(e,t){if(b1(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function ST(e,t,i){const n=I7(e,i),r=self.URL||self.webkitURL,s=typeof n!="string"&&r.createObjectURL(n);try{return await M7(s||n,t)}finally{s&&r.revokeObjectURL(s)}}async function M7(e,t){const i=new Image;return i.src=e,t.image&&t.image.decode&&i.decode?(await i.decode(),i):await new Promise((n,r)=>{try{i.onload=()=>n(i),i.onerror=s=>{const o=s instanceof Error?s.message:"error";r(new Error(o))}}catch(s){r(s)}})}const P7={};let IT=!0;async function R7(e,t,i){let n;b1(i)?n=await ST(e,t,i):n=TT(e,i);const r=t&&t.imagebitmap;return await F7(n,r)}async function F7(e,t=null){if((O7(t)||!IT)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(i){console.warn(i),IT=!1}return await createImageBitmap(e)}function O7(e){for(const t in e||P7)return!1;return!0}function L7(e){return!U7(e,"ftyp",4)||(e[8]&96)===0?null:D7(e)}function D7(e){switch(k7(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function k7(e,t,i){return String.fromCharCode(...e.slice(t,i))}function N7(e){return[...e].map(t=>t.charCodeAt(0))}function U7(e,t,i=0){const n=N7(t);for(let r=0;r<n.length;++r)if(n[r]!==e[r+i])return!1;return!0}const ec=!1,VA=!0;function MT(e){const t=jA(e);return z7(t)||H7(t)||V7(t)||j7(t)||G7(t)}function G7(e){const t=new Uint8Array(e instanceof DataView?e.buffer:e),i=L7(t);return i?{mimeType:i.mimeType,width:0,height:0}:null}function z7(e){const t=jA(e);return t.byteLength>=24&&t.getUint32(0,ec)===2303741511?{mimeType:"image/png",width:t.getUint32(16,ec),height:t.getUint32(20,ec)}:null}function V7(e){const t=jA(e);return t.byteLength>=10&&t.getUint32(0,ec)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,VA),height:t.getUint16(8,VA)}:null}function j7(e){const t=jA(e);return t.byteLength>=14&&t.getUint16(0,ec)===16973&&t.getUint32(2,VA)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,VA),height:t.getUint32(22,VA)}:null}function H7(e){const t=jA(e);if(!(t.byteLength>=3&&t.getUint16(0,ec)===65496&&t.getUint8(2)===255))return null;const{tableMarkers:i,sofMarkers:n}=W7();let r=2;for(;r+9<t.byteLength;){const s=t.getUint16(r,ec);if(n.has(s))return{mimeType:"image/jpeg",height:t.getUint16(r+5,ec),width:t.getUint16(r+7,ec)};if(!i.has(s))return null;r+=2,r+=t.getUint16(r,ec)}return null}function W7(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function jA(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 J7(e,t){var i;const{mimeType:n}=MT(e)||{},r=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Jm(r),await r(e,n)}async function X7(e,t,i){t=t||{};const n=(t.image||{}).type||"auto",{url:r}=i||{},s=K7(n);let o;switch(s){case"imagebitmap":o=await R7(e,t,r);break;case"image":o=await ST(e,t,r);break;case"data":o=await J7(e);break;default:Jm(!1)}return n==="data"&&(o=E7(o)),o}function K7(e){switch(e){case"auto":case"data":return w7();default:return x7(e),e}}const Q7=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Z7=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Y7={image:{type:"auto",decode:!0}},$7={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:_7,mimeTypes:Z7,extensions:Q7,parse:X7,tests:[e=>!!MT(new DataView(e))],options:Y7},Bd=globalThis,Hu=globalThis.process||{},q7=globalThis.navigator||{};function PT(e){var t,i;if(typeof window<"u"&&((t=window.process)==null?void 0:t.type)==="renderer"||typeof process<"u"&&(i=process.versions)!=null&&i.electron)return!0;const n=typeof navigator<"u"&&navigator.userAgent;return!!(n&&n.indexOf("Electron")>=0)}function ic(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||PT()}function tV(e){return ic()?PT()?"Electron":(q7.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const qm="4.1.0";function eV(e){try{const t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch{return null}}let iV=class{constructor(e,t,i="sessionStorage"){this.storage=eV(i),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function nV(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function rV(e,t=8){const i=Math.max(t-e.length,0);return`${" ".repeat(i)}${e}`}var t0;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(t0||(t0={}));const oV=10;function RT(e){return typeof e!="string"?e:(e=e.toUpperCase(),t0[e]||t0.WHITE)}function sV(e,t,i){return!ic&&typeof e=="string"&&(t&&(e=`\x1B[${RT(t)}m${e}\x1B[39m`),i&&(e=`\x1B[${RT(i)+oV}m${e}\x1B[49m`)),e}function aV(e,t=["constructor"]){const i=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(i),r=e;for(const s of n){const o=r[s];typeof o=="function"&&(t.find(l=>s===l)||(r[s]=o.bind(e)))}}function x1(e,t){if(!e)throw new Error("Assertion failed")}function Td(){var e,t,i;let n;if(ic()&&Bd.performance)n=(t=(e=Bd==null?void 0:Bd.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Hu){const r=(i=Hu==null?void 0:Hu.hrtime)==null?void 0:i.call(Hu);n=r[0]*1e3+r[1]/1e6}else n=Date.now();return n}const Sd={debug:ic()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},lV={enabled:!0,level:0};function Id(){}const FT={},OT={once:!0};let LT=class{constructor({id:e}={id:""}){this.VERSION=qm,this._startTs=Td(),this._deltaTs=Td(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new iV(`__probe-${this.id}__`,lV),this.timeStamp(`${this.id} started`),aV(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Td()-this._startTs).toPrecision(10))}getDelta(){return Number((Td()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Sd.warn,arguments,OT)}error(e){return this._getLogFunction(0,e,Sd.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,Sd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Sd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,Sd.debug||Sd.info,arguments,OT)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||Id,i&&[i],{tag:uV(t)}):Id}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||Id)}group(e,t,i={collapsed:!1}){const n=kT({logLevel:e,message:t,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Id)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=DT(e)}_getLogFunction(e,t,i,n,r){if(this._shouldLog(e)){r=kT({logLevel:e,message:t,args:n,opts:r}),i=i||r.method,x1(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Td();const s=r.tag||r.message;if(r.once&&s)if(!FT[s])FT[s]=Td();else return Id;return t=cV(this.id,r.message,r),i.bind(console,t,...r.args)}return Id}};LT.VERSION=qm;function DT(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return x1(Number.isFinite(t)&&t>=0),t}function kT(e){const{logLevel:t,message:i}=e;e.logLevel=DT(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==i;);switch(typeof t){case"string":case"function":i!==void 0&&n.unshift(i),e.message=t;break;case"object":Object.assign(e,t);break}typeof e.message=="function"&&(e.message=e.message());const r=typeof e.message;return x1(r==="string"||r==="object"),Object.assign(e,{args:n},e.opts)}function cV(e,t,i){if(typeof t=="string"){const n=i.time?rV(nV(i.total)):"";t=i.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=sV(t,i.color,i.background)}return t}function uV(e){for(const t in e)for(const i in e[t])return i||"untitled";return"empty"}const Zi=new LT({id:"deck"});let w1={};function hV(e){w1=e}function As(e,t,i,n){Zi.level>0&&w1[e]&&w1[e].call(null,t,i,n)}function fV(e){const t=e[0],i=e[e.length-1];return t==="{"&&i==="}"||t==="["&&i==="]"}const dV={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:fV,parseTextSync:JSON.parse};function pV(){const 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||(Zi.log(1,`deck.gl ${e}`)(),globalThis.deck={...globalThis.deck,VERSION:e,version:e,log:Zi,_registerLoggers:hV},Kz([dV,[$7,{imagebitmap:{premultiplyAlpha:"none"}}]])),e}const AV=pV();function C1(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}const E1={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 gV(e){const t={};for(const[i,n]of Object.entries(e))t[i]=mV(n);return t}function mV(e){let t=NT(e);if(t!=="object")return{value:e,...E1[t],type:t};if(typeof e=="object")return e?e.type!==void 0?{...e,...E1[e.type],type:e.type}:e.value===void 0?{type:"object",value:e}:(t=NT(e.value),{...e,...E1[t],type:t}):{type:"object",value:null};throw new Error("props")}function NT(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}const yV=`#ifdef MODULE_LOGDEPTH
logdepth_adjustPosition(gl_Position);
#endif
`,_V=`#ifdef MODULE_MATERIAL
fragColor = material_filterColor(fragColor);
#endif
#ifdef MODULE_LIGHTING
fragColor = lighting_filterColor(fragColor);
#endif
#ifdef MODULE_FOG
fragColor = fog_filterColor(fragColor);
#endif
#ifdef MODULE_PICKING
fragColor = picking_filterHighlightColor(fragColor);
fragColor = picking_filterPickingColor(fragColor);
#endif
#ifdef MODULE_LOGDEPTH
logdepth_setFragDepth();
#endif
`,vV={vertex:yV,fragment:_V},UT=/void\s+main\s*\([^)]*\)\s*\{\n?/,GT=/}\n?[^{}]*$/,B1=[],e0="__LUMA_INJECT_DECLARATIONS__";function bV(e){const t={vertex:{},fragment:{}};for(const i in e){let n=e[i];const r=xV(i);typeof n=="string"&&(n={order:0,injection:n}),t[r][i]=n}return t}function xV(e){const t=e.slice(0,2);switch(t){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(t)}}function i0(e,t,i,n=!1){const r=t==="vertex";for(const