@luma.gl/core 9.1.0-alpha.14 → 9.1.0-alpha.15

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.
@@ -31,7 +31,7 @@ export class Luma {
31
31
  VERSION =
32
32
  // Version detection using build plugin
33
33
  // @ts-expect-error no-undef
34
- typeof "9.1.0-alpha.14" !== 'undefined' ? "9.1.0-alpha.14" : 'running from source';
34
+ typeof "9.1.0-alpha.15" !== 'undefined' ? "9.1.0-alpha.15" : 'running from source';
35
35
  spector;
36
36
  preregisteredAdapters = new Map();
37
37
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/framebuffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,aAAa,EACd,gDAA6C;AAC9C,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,OAAO,EAAC,qBAAkB;AAClC,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAG3C,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAClE,sBAAsB,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,GAAG,yBAAyB,CAAC,GAAG,IAAI,CAAC;CACrF,CAAC;AAEF;;;GAGG;AACH,8BAAsB,WAAY,SAAQ,QAAQ,CAAC,gBAAgB,CAAC;IAClE,OAAgB,YAAY,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAMtD;IAEF,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;IAED,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,QAAQ,CAAC,gBAAgB,EAAE,WAAW,EAAE,CAAC;IACzC,4CAA4C;IAC5C,QAAQ,CAAC,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;gBAExC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,gBAAqB;IAMxD;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI;IACnD,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IACnD,MAAM,IAAI,IAAI;IAed,gCAAgC;IAChC,SAAS,CAAC,4BAA4B,IAAI,IAAI;IA+B9C,6BAA6B;IAC7B,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAU5D,mCAAmC;IACnC,SAAS,CAAC,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAUnE;;;;OAIG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IA0BhE,iGAAiG;IACjG,SAAS,CAAC,QAAQ,CAAC,iBAAiB,IAAI,IAAI;CAC7C"}
1
+ {"version":3,"file":"framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/framebuffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,aAAa,EACd,gDAA6C;AAC9C,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,OAAO,EAAC,qBAAkB;AAClC,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAG3C,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAClE,sBAAsB,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,GAAG,yBAAyB,CAAC,GAAG,IAAI,CAAC;CACrF,CAAC;AAEF;;;GAGG;AACH,8BAAsB,WAAY,SAAQ,QAAQ,CAAC,gBAAgB,CAAC;IAClE,OAAgB,YAAY,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAMtD;IAEF,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;IAED,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,QAAQ,CAAC,gBAAgB,EAAE,WAAW,EAAE,CAAC;IACzC,4CAA4C;IAC5C,QAAQ,CAAC,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;gBAExC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,gBAAqB;IAMxD;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI;IACnD,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IACnD,MAAM,IAAI,IAAI;IAed,gCAAgC;IAChC,SAAS,CAAC,4BAA4B,IAAI,IAAI;IA+B9C,6BAA6B;IAC7B,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAe5D,mCAAmC;IACnC,SAAS,CAAC,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAWnE;;;;OAIG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IA0BhE,iGAAiG;IACjG,SAAS,CAAC,QAAQ,CAAC,iBAAiB,IAAI,IAAI;CAC7C"}
@@ -79,7 +79,12 @@ export class Framebuffer extends Resource {
79
79
  usage: Texture.RENDER_ATTACHMENT,
80
80
  format,
81
81
  width: this.width,
82
- height: this.height
82
+ height: this.height,
83
+ // TODO deprecated? - luma.gl v8 compatibility
84
+ sampler: {
85
+ magFilter: 'linear',
86
+ minFilter: 'linear'
87
+ }
83
88
  });
84
89
  }
85
90
  /** Create depth stencil texture */
@@ -89,7 +94,8 @@ export class Framebuffer extends Resource {
89
94
  usage: Texture.RENDER_ATTACHMENT,
90
95
  format,
91
96
  width: this.width,
92
- height: this.height
97
+ height: this.height,
98
+ mipmaps: false
93
99
  });
94
100
  }
95
101
  /**
@@ -16,7 +16,7 @@ export type RenderPassProps = ResourceProps & {
16
16
  clearColor?: NumberArray4 | TypedArray | false;
17
17
  /** Whether to disable / discard the output of the rasterizer */
18
18
  discard?: boolean;
19
- /** Clear value for depth attachment, or `load` to preserve the previous value */
19
+ /** Clear value for depth attachment (usually `1`), or `load` to preserve the previous value */
20
20
  clearDepth?: number | false;
21
21
  /** Clear value for stencil attachment, or `load` to preserve the previous value */
22
22
  clearStencil?: number | false;
@@ -1 +1 @@
1
- {"version":3,"file":"render-pass.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/render-pass.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,KAAK,EAAC,oBAAoB,EAAC,+BAA4B;AAE9D,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,WAAW,EAAC,yBAAsB;AAC1C,OAAO,EAAC,QAAQ,EAAC,uBAAoB;AAErC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,yGAAyG;IACzG,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,qEAAqE;IACrE,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAIlC,iFAAiF;IACjF,UAAU,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,KAAK,CAAC;IAC/C,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC9B,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAC7B,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAC7B,2FAA2F;IAC3F,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,8BAAsB,UAAW,SAAQ,QAAQ,CAAC,eAAe,CAAC;IAChE,wCAAwC;IACxC,OAAgB,YAAY,EAAE,QAAQ,CAAC,eAAe,CAAC,CAerD;IAEF,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;gBAEW,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe;IAIlD,gDAAgD;IAChD,QAAQ,CAAC,GAAG,IAAI,IAAI;IAEpB,wGAAwG;IACxG,QAAQ,CAAC,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;IAI9D,gIAAgI;IAChI,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACtD,2FAA2F;IAC3F,QAAQ,CAAC,iBAAiB,IAAI,IAAI;IAElC,kEAAkE;IAClE,QAAQ,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACjD,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,IAAI,IAAI;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CActD"}
1
+ {"version":3,"file":"render-pass.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/render-pass.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,KAAK,EAAC,oBAAoB,EAAC,+BAA4B;AAE9D,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,WAAW,EAAC,yBAAsB;AAC1C,OAAO,EAAC,QAAQ,EAAC,uBAAoB;AAErC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,yGAAyG;IACzG,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,qEAAqE;IACrE,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAIlC,iFAAiF;IACjF,UAAU,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,KAAK,CAAC;IAC/C,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC9B,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAC7B,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAC7B,2FAA2F;IAC3F,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,8BAAsB,UAAW,SAAQ,QAAQ,CAAC,eAAe,CAAC;IAChE,wCAAwC;IACxC,OAAgB,YAAY,EAAE,QAAQ,CAAC,eAAe,CAAC,CAerD;IAEF,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;gBAEW,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe;IAIlD,gDAAgD;IAChD,QAAQ,CAAC,GAAG,IAAI,IAAI;IAEpB,wGAAwG;IACxG,QAAQ,CAAC,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;IAI9D,gIAAgI;IAChI,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACtD,2FAA2F;IAC3F,QAAQ,CAAC,iBAAiB,IAAI,IAAI;IAElC,kEAAkE;IAClE,QAAQ,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACjD,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,IAAI,IAAI;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CActD"}
package/dist/dist.dev.js CHANGED
@@ -2110,7 +2110,12 @@ ${htmlLog}
2110
2110
  usage: Texture.RENDER_ATTACHMENT,
2111
2111
  format,
2112
2112
  width: this.width,
2113
- height: this.height
2113
+ height: this.height,
2114
+ // TODO deprecated? - luma.gl v8 compatibility
2115
+ sampler: {
2116
+ magFilter: "linear",
2117
+ minFilter: "linear"
2118
+ }
2114
2119
  });
2115
2120
  }
2116
2121
  /** Create depth stencil texture */
@@ -2120,7 +2125,8 @@ ${htmlLog}
2120
2125
  usage: Texture.RENDER_ATTACHMENT,
2121
2126
  format,
2122
2127
  width: this.width,
2123
- height: this.height
2128
+ height: this.height,
2129
+ mipmaps: false
2124
2130
  });
2125
2131
  }
2126
2132
  /**
package/dist/dist.min.js CHANGED
@@ -4,15 +4,15 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['luma'] = factory();
6
6
  else root['luma'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var Z=Object.defineProperty;var ct=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var ft=Object.prototype.hasOwnProperty;var lt=(r,e,t)=>e in r?Z(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var dt=(r,e)=>{for(var t in e)Z(r,t,{get:e[t],enumerable:!0})},ht=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ut(e))!ft.call(r,n)&&n!==t&&Z(r,n,{get:()=>e[n],enumerable:!(s=ct(e,n))||s.enumerable});return r};var mt=r=>ht(Z({},"__esModule",{value:!0}),r);var a=(r,e,t)=>(lt(r,typeof e!="symbol"?e+"":e,t),t);var er={};dt(er,{Adapter:()=>ie,Buffer:()=>d,CanvasContext:()=>I,CommandBuffer:()=>W,CommandEncoder:()=>V,ComputePass:()=>G,ComputePipeline:()=>k,Device:()=>T,DeviceFeatures:()=>se,DeviceLimits:()=>re,ExternalTexture:()=>$,Framebuffer:()=>U,QuerySet:()=>X,RenderPass:()=>z,RenderPipeline:()=>H,Resource:()=>c,Sampler:()=>N,Shader:()=>F,Texture:()=>h,TextureView:()=>D,TransformFeedback:()=>Y,UniformBlock:()=>L,UniformBufferLayout:()=>_,UniformStore:()=>le,VertexArray:()=>j,decodeShaderAttributeType:()=>ce,decodeShaderUniformType:()=>ue,decodeTextureFormat:()=>Oe,decodeVertexFormat:()=>O,getAttributeInfosFromLayouts:()=>Le,getDataTypeFromTypedArray:()=>Ie,getScratchArray:()=>rt,getTypedArrayFromDataType:()=>it,getVertexFormatFromAttribute:()=>at,log:()=>l,luma:()=>Ye});function M(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var x=class{constructor(e,t){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=e,this.type=t,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(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=M(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(M()-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 S=class{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let t of Object.values(this.stats))e(t)}getTable(){let e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){let{name:t,type:s}=e,n=this.stats[t];return n||(e instanceof x?n=e:n=new x(t,s),this.stats[t]=n),n}};var de=class{stats=new Map;getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new S({id:e})),this.stats.get(e)}},q=new de;var K=globalThis,pt=globalThis.document||{},Q=globalThis.process||{},gt=globalThis.console,hr=globalThis.navigator||{};function De(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,t=r||e;return Boolean(t&&t.indexOf("Electron")>=0)}function p(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||De()}var he="4.0.7";function bt(r){try{let e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}var J=class{constructor(e,t,s="sessionStorage"){this.storage=bt(s),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){let t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function $e(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function Fe(r,e=8){let t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var ee;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ee||(ee={}));var xt=10;function Ne(r){return typeof r!="string"?r:(r=r.toUpperCase(),ee[r]||ee.WHITE)}function Ue(r,e,t){return!p&&typeof r=="string"&&(e&&(r=`\x1B[${Ne(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${Ne(t)+xt}m${r}\x1B[49m`)),r}function He(r,e=["constructor"]){let t=Object.getPrototypeOf(r),s=Object.getOwnPropertyNames(t),n=r;for(let o of s){let i=n[o];typeof i=="function"&&(e.find(u=>o===u)||(n[o]=i.bind(r)))}}function B(r,e){if(!r)throw new Error(e||"Assertion failed")}function w(){let r;if(p()&&K.performance)r=K?.performance?.now?.();else if("hrtime"in Q){let e=Q?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var A={debug:p()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},wt={enabled:!0,level:0};function v(){}var ze={},ke={once:!0},y=class{constructor({id:e}={id:""}){this.VERSION=he,this._startTs=w(),this._deltaTs=w(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new J(`__probe-${this.id}__`,wt),this.timeStamp(`${this.id} started`),He(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((w()-this._startTs).toPrecision(10))}getDelta(){return Number((w()-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,A.warn,arguments,ke)}error(e){return this._getLogFunction(0,e,A.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,A.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,A.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,A.debug||A.info,arguments,ke)}table(e,t,s){return t?this._getLogFunction(e,t,console.table||v,s&&[s],{tag:St(t)}):v}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||v)}group(e,t,s={collapsed:!1}){let n=Ge({logLevel:e,message:t,opts:s}),{collapsed:o}=s;return n.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,s={}){return this.group(e,t,Object.assign({},s,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||v)}withGroup(e,t,s){this.group(e,t)();try{s()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Ve(e)}_getLogFunction(e,t,s,n,o){if(this._shouldLog(e)){o=Ge({logLevel:e,message:t,args:n,opts:o}),s=s||o.method,B(s),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=w();let i=o.tag||o.message;if(o.once&&i)if(!ze[i])ze[i]=w();else return v;return t=Tt(this.id,o.message,o),s.bind(console,t,...o.args)}return v}};y.VERSION=he;function Ve(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return B(Number.isFinite(e)&&e>=0),e}function Ge(r){let{logLevel:e,message:t}=r;r.logLevel=Ve(e);let s=r.args?Array.from(r.args):[];for(;s.length&&s.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&s.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break;default:}typeof r.message=="function"&&(r.message=r.message());let n=typeof r.message;return B(n==="string"||n==="object"),Object.assign(r,{args:s},r.opts)}function Tt(r,e,t){if(typeof e=="string"){let s=t.time?Fe($e(t.total)):"";e=t.time?`${r}: ${s} ${e}`:`${r}: ${e}`,e=Ue(e,t.color,t.background)}return e}function St(r){for(let e in r)for(let t in r[e])return t||"untitled";return"empty"}globalThis.probe={};var Ur=new y({id:"@probe.gl/log"});var l=new y({id:"luma.gl"});var me={};function E(r="id"){me[r]=me[r]||1;let e=me[r]++;return`${r}-${e}`}var c=class{id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(e,t,s){if(!e)throw new Error("no device");this._device=e,this.props=At(t,s);let n=this.props.id!=="undefined"?this.props.id:E(this[Symbol.toStringTag]);this.props.id=n,this.id=n,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}toString(){return`${this[Symbol.toStringTag]||this.constructor.name}(${this.id})`}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(let e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(e,t=this[Symbol.toStringTag]){let s=this._device.statsManager.getStats("Resource Counts");s.get("GPU Memory").addCount(e),s.get(`${t} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){let t=this._device.statsManager.getStats("Resource Counts");t.get("GPU Memory").subtractCount(this.allocatedBytes),t.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}};a(c,"defaultProps",{id:"undefined",handle:void 0,userData:void 0});function At(r,e){let t={...e};for(let s in r)r[s]!==void 0&&(t[s]=r[s]);return t}var R=class extends c{get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(e,t){let s={...t};(t.usage||0)&R.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?s.indexType="uint32":t.data instanceof Uint16Array&&(s.indexType="uint16")),super(e,s,R.defaultProps),this.usage=t.usage||0,this.indexType=s.indexType,this.updateTimestamp=e.incrementTimestamp()}readSyncWebGL(e,t){throw new Error("not implemented")}debugData=new ArrayBuffer(0);_setDebugData(e,t,s){let n=ArrayBuffer.isView(e)?e.buffer:e,o=Math.min(e?e.byteLength:s,R.DEBUG_DATA_MAX_LENGTH);n===null?this.debugData=new ArrayBuffer(o):t===0&&s===n.byteLength?this.debugData=n.slice(0,o):this.debugData=n.slice(t,t+o)}},d=R;a(d,"defaultProps",{...c.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),a(d,"MAP_READ",1),a(d,"MAP_WRITE",2),a(d,"COPY_SRC",4),a(d,"COPY_DST",8),a(d,"INDEX",16),a(d,"VERTEX",32),a(d,"UNIFORM",64),a(d,"STORAGE",128),a(d,"INDIRECT",256),a(d,"QUERY_RESOLVE",512),a(d,"DEBUG_DATA_MAX_LENGTH",32);function te(r){let e=We[r],t=vt(e),s=r.includes("norm"),n=!s&&!r.startsWith("float"),o=r.startsWith("s");return{dataType:We[r],byteLength:t,integer:n,signed:o,normalized:s}}function vt(r){return Et[r]}var We={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Et={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};var Pt=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],_t=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;function pe(r){return Pt.some(e=>r.startsWith(e))}function Oe(r){let e=_t.exec(r);if(e){let[,t,s,n,o,i]=e;if(r){let u=`${n}${s}`,f=te(u),m={channels:t,components:t.length,bitsPerChannel:f.byteLength*8,bytesPerPixel:f.byteLength*t.length,dataType:f.dataType,integer:f.integer,signed:f.signed,normalized:f.normalized};return i==="-webgl"&&(m.webgl=!0),o==="-srgb"&&(m.srgb=!0),m}}return Ct(r)}var Lt={"rgba4unorm-webgl":{channels:"rgba",bytesPerPixel:2,packed:!0},"rgb565unorm-webgl":{channels:"rgb",bytesPerPixel:2,packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bytesPerPixel:2,packed:!0},rgb9e5ufloat:{channels:"rgb",bytesPerPixel:4,packed:!0},rg11b10ufloat:{channels:"rgb",bytesPerPixel:4,packed:!0},rgb10a2unorm:{channels:"rgba",bytesPerPixel:4,packed:!0},"rgb10a2uint-webgl":{channels:"rgba",bytesPerPixel:4,packed:!0},stencil8:{components:1,bytesPerPixel:1,a:"stencil",dataType:"uint8"},depth16unorm:{components:1,bytesPerPixel:2,a:"depth",dataType:"uint16"},depth24plus:{components:1,bytesPerPixel:3,a:"depth",dataType:"uint32"},depth32float:{components:1,bytesPerPixel:4,a:"depth",dataType:"float32"},"depth24plus-stencil8":{components:2,bytesPerPixel:4,a:"depth-stencil",packed:!0},"depth32float-stencil8":{components:2,bytesPerPixel:4,a:"depth-stencil",packed:!0}};function Ct(r){if(pe(r)){let s={channels:"rgb",components:3,bytesPerPixel:1,srgb:!1,compressed:!0},n=Mt(r);return n&&(s.blockWidth=n.blockWidth,s.blockHeight=n.blockHeight),s}let e=Lt[r];if(!e)throw new Error(`Unknown format ${r}`);let t={...e,channels:e.channels||"",components:e.components||e.channels?.length||1,bytesPerPixel:e.bytesPerPixel||1,srgb:!1};return e.packed&&(t.packed=e.packed),t}function Mt(r){let t=/.*-(\d+)x(\d+)-.*/.exec(r);if(t){let[,s,n]=t;return{blockWidth:Number(s),blockHeight:Number(n)}}return null}var re=class{},se=class{features;disabledFeatures;constructor(e=[],t){this.features=new Set(e),this.disabledFeatures=t||{}}*[Symbol.iterator](){yield*this.features}has(e){return!this.disabledFeatures?.[e]&&this.features.has(e)}},ge=class{get[Symbol.toStringTag](){return"Device"}constructor(e){this.props={...ge.defaultProps,...e},this.id=this.props.id||E(this[Symbol.toStringTag].toLowerCase())}id;props;userData={};statsManager=q;_lumaData={};isTextureFormatCompressed(e){return pe(e)}loseDevice(){return!1}error(e){this.props.onError(e)}getCanvasContext(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}readPixelsToArrayWebGL(e,t){throw new Error("not implemented")}readPixelsToBufferWebGL(e,t){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,t){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}timestamp=0;incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}_getBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t={...e};return(e.usage||0)&d.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array?t.indexType="uint16":l.warn("indices buffer content must be of integer type")()),t}},T=ge;a(T,"defaultProps",{id:null,canvas:null,container:null,manageState:!0,width:800,height:600,requestMaxLimits:!0,onError:e=>l.error(e.message),gl:null,debug:Boolean(l.get("debug")),break:l.get("break")||[],debugWithSpectorJS:void 0,spectorUrl:void 0,initalizeFeatures:!0,disabledFeatures:{"compilation-status-async-webgl":!0},_factoryDestroyPolicy:"unused"});var Bt="set luma.log.level=1 (or higher) to trace rendering",je="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",oe=class{stats=q;log=l;VERSION="9.1.0-alpha.14";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw l.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),l.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");l.error("This version of luma.gl has already been initialized")()}l.log(1,`${this.VERSION} - ${Bt}`)(),globalThis.luma=this}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this.getAdapterMap(e);return Array.from(t).map(([,s])=>s).filter(s=>s.isSupported?.()).map(s=>s.type)}getBestAvailableAdapter(e=[]){let t=this.getAdapterMap(e);return t.get("webgpu")?.isSupported?.()?"webgpu":t.get("webgl")?.isSupported?.()?"webgl":null}setDefaultDeviceProps(e){Object.assign(oe.defaultProps,e)}async createDevice(e={}){e={...oe.defaultProps,...e};let t=this.getAdapterMap(e.adapters),s=e.type||"";s==="best-available"&&(s=this.getBestAvailableAdapter(e.adapters)||s);let i=await(this.getAdapterMap(e.adapters)||t).get(s)?.create?.(e);if(i)return i;throw new Error(je)}async attachDevice(e){let t=this.getAdapterMap(e.adapters),s="";e.handle instanceof WebGL2RenderingContext&&(s="webgl"),e.handle===null&&(s="unknown");let o=await t.get(s)?.attach?.(null);if(o)return o;throw new Error(je)}enforceWebGL2(e=!0,t=[]){let n=this.getAdapterMap(t).get("webgl");n||l.warn("enforceWebGL2: webgl adapter not found")(),n?.enforceWebGL2?.(e)}getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let s of e)t.set(s.type,s);return t}registerDevices(e){l.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(let t of e){let s=t.adapter;s&&this.preregisteredAdapters.set(s.type,s)}}},ne=oe;a(ne,"defaultProps",{...T.defaultProps,type:"best-available",adapters:void 0});var Ye=new ne;var ie=class{};var Rt=p()&&typeof document<"u",ae=()=>Rt&&document.readyState==="complete",It={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},I=class{id;props;canvas;htmlCanvas;offscreenCanvas;type;width=1;height=1;resizeObserver;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};static get isPageLoaded(){return ae()}constructor(e){if(this.props={...It,...e},e=this.props,!p()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=Ft(e.canvas):this.canvas=e.canvas;else{let t=Nt(e),s=$t(e?.container||null);s.insertBefore(t,s.firstChild),this.canvas=t,e?.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(t=>{for(let s of t)s.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":let e=this.getDevicePixelRatio(),t=this.canvas;return t.parentElement?[t.clientWidth*e,t.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){let[e,t]=this.getPixelSize();return e/t}cssToDeviceRatio(){try{let[e]=this.getDrawingBufferSize(),{clientWidth:t}=this._canvasSizeInfo;return t?e/t:1}catch{return 1}}cssToDevicePixels(e,t=!0){let s=this.cssToDeviceRatio(),[n,o]=this.getDrawingBufferSize();return Ut(e,s,n,o,t)}setDevicePixelRatio(e,t={}){if(!this.htmlCanvas)return;let s="width"in t?t.width:this.htmlCanvas.clientWidth,n="height"in t?t.height:this.htmlCanvas.clientHeight;(!s||!n)&&(l.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,s=this.htmlCanvas.width||1,n=this.htmlCanvas.height||1);let o=this._canvasSizeInfo;if(o.clientWidth!==s||o.clientHeight!==n||o.devicePixelRatio!==e){let i=e,u=Math.floor(s*i),f=Math.floor(n*i);if(this.htmlCanvas.width=u,this.htmlCanvas.height=f,this.device.gl){let[g,C]=this.getDrawingBufferSize();(g!==u||C!==f)&&(i=Math.min(g/s,C/n),this.htmlCanvas.width=Math.floor(s*i),this.htmlCanvas.height=Math.floor(n*i),l.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=s,this._canvasSizeInfo.clientHeight=n,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){let e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}};a(I,"pageLoaded",Dt());function Dt(){return ae()||typeof window>"u"?Promise.resolve():new Promise(r=>{window.addEventListener("load",()=>r())})}function $t(r){if(typeof r=="string"){let e=document.getElementById(r);if(!e&&!ae())throw new Error(`Accessing '${r}' before page was loaded`);if(!e)throw new Error(`${r} is not an HTML element`);return e}else if(r)return r;return document.body}function Ft(r){let e=document.getElementById(r);if(!e&&!ae())throw new Error(`Accessing '${r}' before page was loaded`);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function Nt(r){let{width:e,height:t}=r,s=document.createElement("canvas");return s.id="lumagl-auto-created-canvas",s.width=e||1,s.height=t||1,s.style.width=Number.isFinite(e)?`${e}px`:"100%",s.style.height=Number.isFinite(t)?`${t}px`:"100%",s}function Ut(r,e,t,s,n){let o=r,i=Xe(o[0],e,t),u=Ze(o[1],e,s,n),f=Xe(o[0]+1,e,t),m=f===t-1?f:f-1;f=Ze(o[1]+1,e,s,n);let g;return n?(f=f===0?f:f+1,g=u,u=f):g=f===s-1?f:f-1,{x:i,y:u,width:Math.max(m-i+1,1),height:Math.max(g-u+1,1)}}function Xe(r,e,t){return Math.min(Math.round(r*e),t-1)}function Ze(r,e,t,s){return s?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}var b=class extends c{get[Symbol.toStringTag](){return"Texture"}dimension;format;width;height;depth;mipLevels;updateTimestamp;static isExternalImage(e){return typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement||typeof VideoFrame<"u"&&e instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}static getExternalImageSize(e){if(typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height};if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};if(typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(typeof VideoFrame<"u"&&e instanceof VideoFrame)return{width:e.displayWidth,height:e.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(e){let t=e?.data;return ArrayBuffer.isView(t)}static getTextureDataSize(e){if(!e||ArrayBuffer.isView(e))return null;if(Array.isArray(e))return b.getTextureDataSize(e[0]);if(b.isExternalImage(e))return b.getExternalImageSize(e);if(e&&typeof e=="object"&&e.constructor===Object){let s=Object.values(e)[0];return{width:s.width,height:s.height}}throw new Error("texture size deduction failed")}static getMipLevelCount(e,t){return Math.floor(Math.log2(Math.max(e,t)))+1}static getCubeFaceDepth(e){switch(e){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(e)}}constructor(e,t){if(super(e,t,b.defaultProps),this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){let s=b.getTextureDataSize(this.props.data);this.width=s?.width||1,this.height=s?.height||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?b.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=e.incrementTimestamp()}createResizedTexture(e){return this.device.createTexture({...this.props,...e})}static _fixProps(e){let t={...e},{width:s,height:n}=t;return typeof s=="number"&&(t.width=Math.max(1,Math.ceil(s))),typeof n=="number"&&(t.height=Math.max(1,Math.ceil(n))),t}},h=b;a(h,"COPY_SRC",1),a(h,"COPY_DST",2),a(h,"TEXTURE",4),a(h,"STORAGE",8),a(h,"RENDER_ATTACHMENT",16),a(h,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),a(h,"defaultProps",{...c.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0}),a(h,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1});var ye=class extends c{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,ye.defaultProps)}},D=ye;a(D,"defaultProps",{...c.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});var be=class extends c{get[Symbol.toStringTag](){return"ExternalTexture"}constructor(e,t){super(e,t,be.defaultProps)}},$=be;a($,"defaultProps",{...c.defaultProps,source:void 0,colorSpace:"srgb"});function Ke(r,e,t){let s="",n=e.split(/\r?\n/),o=r.slice().sort((i,u)=>i.lineNum-u.lineNum);switch(t?.showSourceCode||"no"){case"all":let i=0;for(let u=1;u<=n.length;u++)for(s+=Qe(n[u-1],u,t);o.length>i&&o[i].lineNum===u;){let f=o[i++];s+=qe(f,n,f.lineNum,{...t,inlineSource:!1})}return s;case"issues":case"no":for(let u of r)s+=qe(u,n,u.lineNum,{inlineSource:t?.showSourceCode!=="no"});return s}}function qe(r,e,t,s){if(s?.inlineSource){let n=Ht(e,t),o=r.linePos>0?`${" ".repeat(r.linePos+5)}^^^
7
+ "use strict";var __exports__=(()=>{var Z=Object.defineProperty;var ct=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var ft=Object.prototype.hasOwnProperty;var lt=(r,e,t)=>e in r?Z(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var dt=(r,e)=>{for(var t in e)Z(r,t,{get:e[t],enumerable:!0})},ht=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ut(e))!ft.call(r,n)&&n!==t&&Z(r,n,{get:()=>e[n],enumerable:!(s=ct(e,n))||s.enumerable});return r};var mt=r=>ht(Z({},"__esModule",{value:!0}),r);var a=(r,e,t)=>(lt(r,typeof e!="symbol"?e+"":e,t),t);var er={};dt(er,{Adapter:()=>oe,Buffer:()=>d,CanvasContext:()=>I,CommandBuffer:()=>W,CommandEncoder:()=>V,ComputePass:()=>G,ComputePipeline:()=>k,Device:()=>T,DeviceFeatures:()=>se,DeviceLimits:()=>re,ExternalTexture:()=>$,Framebuffer:()=>U,QuerySet:()=>X,RenderPass:()=>z,RenderPipeline:()=>H,Resource:()=>c,Sampler:()=>N,Shader:()=>F,Texture:()=>h,TextureView:()=>D,TransformFeedback:()=>Y,UniformBlock:()=>L,UniformBufferLayout:()=>_,UniformStore:()=>le,VertexArray:()=>j,decodeShaderAttributeType:()=>ce,decodeShaderUniformType:()=>ue,decodeTextureFormat:()=>Oe,decodeVertexFormat:()=>O,getAttributeInfosFromLayouts:()=>Le,getDataTypeFromTypedArray:()=>Ie,getScratchArray:()=>rt,getTypedArrayFromDataType:()=>ot,getVertexFormatFromAttribute:()=>at,log:()=>l,luma:()=>Ye});function M(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var x=class{constructor(e,t){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=e,this.type=t,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(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=M(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(M()-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 S=class{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let t of Object.values(this.stats))e(t)}getTable(){let e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){let{name:t,type:s}=e,n=this.stats[t];return n||(e instanceof x?n=e:n=new x(t,s),this.stats[t]=n),n}};var de=class{stats=new Map;getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new S({id:e})),this.stats.get(e)}},q=new de;var K=globalThis,pt=globalThis.document||{},Q=globalThis.process||{},gt=globalThis.console,hr=globalThis.navigator||{};function De(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,t=r||e;return Boolean(t&&t.indexOf("Electron")>=0)}function p(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||De()}var he="4.0.7";function bt(r){try{let e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}var J=class{constructor(e,t,s="sessionStorage"){this.storage=bt(s),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){let t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function $e(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function Fe(r,e=8){let t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var ee;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ee||(ee={}));var xt=10;function Ne(r){return typeof r!="string"?r:(r=r.toUpperCase(),ee[r]||ee.WHITE)}function Ue(r,e,t){return!p&&typeof r=="string"&&(e&&(r=`\x1B[${Ne(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${Ne(t)+xt}m${r}\x1B[49m`)),r}function He(r,e=["constructor"]){let t=Object.getPrototypeOf(r),s=Object.getOwnPropertyNames(t),n=r;for(let i of s){let o=n[i];typeof o=="function"&&(e.find(u=>i===u)||(n[i]=o.bind(r)))}}function B(r,e){if(!r)throw new Error(e||"Assertion failed")}function w(){let r;if(p()&&K.performance)r=K?.performance?.now?.();else if("hrtime"in Q){let e=Q?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var A={debug:p()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},wt={enabled:!0,level:0};function v(){}var ze={},ke={once:!0},y=class{constructor({id:e}={id:""}){this.VERSION=he,this._startTs=w(),this._deltaTs=w(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new J(`__probe-${this.id}__`,wt),this.timeStamp(`${this.id} started`),He(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((w()-this._startTs).toPrecision(10))}getDelta(){return Number((w()-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,A.warn,arguments,ke)}error(e){return this._getLogFunction(0,e,A.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,A.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,A.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,A.debug||A.info,arguments,ke)}table(e,t,s){return t?this._getLogFunction(e,t,console.table||v,s&&[s],{tag:St(t)}):v}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||v)}group(e,t,s={collapsed:!1}){let n=Ge({logLevel:e,message:t,opts:s}),{collapsed:i}=s;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,s={}){return this.group(e,t,Object.assign({},s,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||v)}withGroup(e,t,s){this.group(e,t)();try{s()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Ve(e)}_getLogFunction(e,t,s,n,i){if(this._shouldLog(e)){i=Ge({logLevel:e,message:t,args:n,opts:i}),s=s||i.method,B(s),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=w();let o=i.tag||i.message;if(i.once&&o)if(!ze[o])ze[o]=w();else return v;return t=Tt(this.id,i.message,i),s.bind(console,t,...i.args)}return v}};y.VERSION=he;function Ve(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return B(Number.isFinite(e)&&e>=0),e}function Ge(r){let{logLevel:e,message:t}=r;r.logLevel=Ve(e);let s=r.args?Array.from(r.args):[];for(;s.length&&s.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&s.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break;default:}typeof r.message=="function"&&(r.message=r.message());let n=typeof r.message;return B(n==="string"||n==="object"),Object.assign(r,{args:s},r.opts)}function Tt(r,e,t){if(typeof e=="string"){let s=t.time?Fe($e(t.total)):"";e=t.time?`${r}: ${s} ${e}`:`${r}: ${e}`,e=Ue(e,t.color,t.background)}return e}function St(r){for(let e in r)for(let t in r[e])return t||"untitled";return"empty"}globalThis.probe={};var Ur=new y({id:"@probe.gl/log"});var l=new y({id:"luma.gl"});var me={};function E(r="id"){me[r]=me[r]||1;let e=me[r]++;return`${r}-${e}`}var c=class{id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(e,t,s){if(!e)throw new Error("no device");this._device=e,this.props=At(t,s);let n=this.props.id!=="undefined"?this.props.id:E(this[Symbol.toStringTag]);this.props.id=n,this.id=n,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}toString(){return`${this[Symbol.toStringTag]||this.constructor.name}(${this.id})`}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(let e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(e,t=this[Symbol.toStringTag]){let s=this._device.statsManager.getStats("Resource Counts");s.get("GPU Memory").addCount(e),s.get(`${t} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){let t=this._device.statsManager.getStats("Resource Counts");t.get("GPU Memory").subtractCount(this.allocatedBytes),t.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}};a(c,"defaultProps",{id:"undefined",handle:void 0,userData:void 0});function At(r,e){let t={...e};for(let s in r)r[s]!==void 0&&(t[s]=r[s]);return t}var R=class extends c{get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(e,t){let s={...t};(t.usage||0)&R.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?s.indexType="uint32":t.data instanceof Uint16Array&&(s.indexType="uint16")),super(e,s,R.defaultProps),this.usage=t.usage||0,this.indexType=s.indexType,this.updateTimestamp=e.incrementTimestamp()}readSyncWebGL(e,t){throw new Error("not implemented")}debugData=new ArrayBuffer(0);_setDebugData(e,t,s){let n=ArrayBuffer.isView(e)?e.buffer:e,i=Math.min(e?e.byteLength:s,R.DEBUG_DATA_MAX_LENGTH);n===null?this.debugData=new ArrayBuffer(i):t===0&&s===n.byteLength?this.debugData=n.slice(0,i):this.debugData=n.slice(t,t+i)}},d=R;a(d,"defaultProps",{...c.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),a(d,"MAP_READ",1),a(d,"MAP_WRITE",2),a(d,"COPY_SRC",4),a(d,"COPY_DST",8),a(d,"INDEX",16),a(d,"VERTEX",32),a(d,"UNIFORM",64),a(d,"STORAGE",128),a(d,"INDIRECT",256),a(d,"QUERY_RESOLVE",512),a(d,"DEBUG_DATA_MAX_LENGTH",32);function te(r){let e=We[r],t=vt(e),s=r.includes("norm"),n=!s&&!r.startsWith("float"),i=r.startsWith("s");return{dataType:We[r],byteLength:t,integer:n,signed:i,normalized:s}}function vt(r){return Et[r]}var We={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Et={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};var Pt=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],_t=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;function pe(r){return Pt.some(e=>r.startsWith(e))}function Oe(r){let e=_t.exec(r);if(e){let[,t,s,n,i,o]=e;if(r){let u=`${n}${s}`,f=te(u),m={channels:t,components:t.length,bitsPerChannel:f.byteLength*8,bytesPerPixel:f.byteLength*t.length,dataType:f.dataType,integer:f.integer,signed:f.signed,normalized:f.normalized};return o==="-webgl"&&(m.webgl=!0),i==="-srgb"&&(m.srgb=!0),m}}return Ct(r)}var Lt={"rgba4unorm-webgl":{channels:"rgba",bytesPerPixel:2,packed:!0},"rgb565unorm-webgl":{channels:"rgb",bytesPerPixel:2,packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bytesPerPixel:2,packed:!0},rgb9e5ufloat:{channels:"rgb",bytesPerPixel:4,packed:!0},rg11b10ufloat:{channels:"rgb",bytesPerPixel:4,packed:!0},rgb10a2unorm:{channels:"rgba",bytesPerPixel:4,packed:!0},"rgb10a2uint-webgl":{channels:"rgba",bytesPerPixel:4,packed:!0},stencil8:{components:1,bytesPerPixel:1,a:"stencil",dataType:"uint8"},depth16unorm:{components:1,bytesPerPixel:2,a:"depth",dataType:"uint16"},depth24plus:{components:1,bytesPerPixel:3,a:"depth",dataType:"uint32"},depth32float:{components:1,bytesPerPixel:4,a:"depth",dataType:"float32"},"depth24plus-stencil8":{components:2,bytesPerPixel:4,a:"depth-stencil",packed:!0},"depth32float-stencil8":{components:2,bytesPerPixel:4,a:"depth-stencil",packed:!0}};function Ct(r){if(pe(r)){let s={channels:"rgb",components:3,bytesPerPixel:1,srgb:!1,compressed:!0},n=Mt(r);return n&&(s.blockWidth=n.blockWidth,s.blockHeight=n.blockHeight),s}let e=Lt[r];if(!e)throw new Error(`Unknown format ${r}`);let t={...e,channels:e.channels||"",components:e.components||e.channels?.length||1,bytesPerPixel:e.bytesPerPixel||1,srgb:!1};return e.packed&&(t.packed=e.packed),t}function Mt(r){let t=/.*-(\d+)x(\d+)-.*/.exec(r);if(t){let[,s,n]=t;return{blockWidth:Number(s),blockHeight:Number(n)}}return null}var re=class{},se=class{features;disabledFeatures;constructor(e=[],t){this.features=new Set(e),this.disabledFeatures=t||{}}*[Symbol.iterator](){yield*this.features}has(e){return!this.disabledFeatures?.[e]&&this.features.has(e)}},ge=class{get[Symbol.toStringTag](){return"Device"}constructor(e){this.props={...ge.defaultProps,...e},this.id=this.props.id||E(this[Symbol.toStringTag].toLowerCase())}id;props;userData={};statsManager=q;_lumaData={};isTextureFormatCompressed(e){return pe(e)}loseDevice(){return!1}error(e){this.props.onError(e)}getCanvasContext(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}readPixelsToArrayWebGL(e,t){throw new Error("not implemented")}readPixelsToBufferWebGL(e,t){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,t){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}timestamp=0;incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}_getBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t={...e};return(e.usage||0)&d.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array?t.indexType="uint16":l.warn("indices buffer content must be of integer type")()),t}},T=ge;a(T,"defaultProps",{id:null,canvas:null,container:null,manageState:!0,width:800,height:600,requestMaxLimits:!0,onError:e=>l.error(e.message),gl:null,debug:Boolean(l.get("debug")),break:l.get("break")||[],debugWithSpectorJS:void 0,spectorUrl:void 0,initalizeFeatures:!0,disabledFeatures:{"compilation-status-async-webgl":!0},_factoryDestroyPolicy:"unused"});var Bt="set luma.log.level=1 (or higher) to trace rendering",je="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",ie=class{stats=q;log=l;VERSION="9.1.0-alpha.15";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw l.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),l.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");l.error("This version of luma.gl has already been initialized")()}l.log(1,`${this.VERSION} - ${Bt}`)(),globalThis.luma=this}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this.getAdapterMap(e);return Array.from(t).map(([,s])=>s).filter(s=>s.isSupported?.()).map(s=>s.type)}getBestAvailableAdapter(e=[]){let t=this.getAdapterMap(e);return t.get("webgpu")?.isSupported?.()?"webgpu":t.get("webgl")?.isSupported?.()?"webgl":null}setDefaultDeviceProps(e){Object.assign(ie.defaultProps,e)}async createDevice(e={}){e={...ie.defaultProps,...e};let t=this.getAdapterMap(e.adapters),s=e.type||"";s==="best-available"&&(s=this.getBestAvailableAdapter(e.adapters)||s);let o=await(this.getAdapterMap(e.adapters)||t).get(s)?.create?.(e);if(o)return o;throw new Error(je)}async attachDevice(e){let t=this.getAdapterMap(e.adapters),s="";e.handle instanceof WebGL2RenderingContext&&(s="webgl"),e.handle===null&&(s="unknown");let i=await t.get(s)?.attach?.(null);if(i)return i;throw new Error(je)}enforceWebGL2(e=!0,t=[]){let n=this.getAdapterMap(t).get("webgl");n||l.warn("enforceWebGL2: webgl adapter not found")(),n?.enforceWebGL2?.(e)}getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let s of e)t.set(s.type,s);return t}registerDevices(e){l.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(let t of e){let s=t.adapter;s&&this.preregisteredAdapters.set(s.type,s)}}},ne=ie;a(ne,"defaultProps",{...T.defaultProps,type:"best-available",adapters:void 0});var Ye=new ne;var oe=class{};var Rt=p()&&typeof document<"u",ae=()=>Rt&&document.readyState==="complete",It={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},I=class{id;props;canvas;htmlCanvas;offscreenCanvas;type;width=1;height=1;resizeObserver;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};static get isPageLoaded(){return ae()}constructor(e){if(this.props={...It,...e},e=this.props,!p()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=Ft(e.canvas):this.canvas=e.canvas;else{let t=Nt(e),s=$t(e?.container||null);s.insertBefore(t,s.firstChild),this.canvas=t,e?.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(t=>{for(let s of t)s.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":let e=this.getDevicePixelRatio(),t=this.canvas;return t.parentElement?[t.clientWidth*e,t.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){let[e,t]=this.getPixelSize();return e/t}cssToDeviceRatio(){try{let[e]=this.getDrawingBufferSize(),{clientWidth:t}=this._canvasSizeInfo;return t?e/t:1}catch{return 1}}cssToDevicePixels(e,t=!0){let s=this.cssToDeviceRatio(),[n,i]=this.getDrawingBufferSize();return Ut(e,s,n,i,t)}setDevicePixelRatio(e,t={}){if(!this.htmlCanvas)return;let s="width"in t?t.width:this.htmlCanvas.clientWidth,n="height"in t?t.height:this.htmlCanvas.clientHeight;(!s||!n)&&(l.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,s=this.htmlCanvas.width||1,n=this.htmlCanvas.height||1);let i=this._canvasSizeInfo;if(i.clientWidth!==s||i.clientHeight!==n||i.devicePixelRatio!==e){let o=e,u=Math.floor(s*o),f=Math.floor(n*o);if(this.htmlCanvas.width=u,this.htmlCanvas.height=f,this.device.gl){let[g,C]=this.getDrawingBufferSize();(g!==u||C!==f)&&(o=Math.min(g/s,C/n),this.htmlCanvas.width=Math.floor(s*o),this.htmlCanvas.height=Math.floor(n*o),l.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=s,this._canvasSizeInfo.clientHeight=n,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){let e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}};a(I,"pageLoaded",Dt());function Dt(){return ae()||typeof window>"u"?Promise.resolve():new Promise(r=>{window.addEventListener("load",()=>r())})}function $t(r){if(typeof r=="string"){let e=document.getElementById(r);if(!e&&!ae())throw new Error(`Accessing '${r}' before page was loaded`);if(!e)throw new Error(`${r} is not an HTML element`);return e}else if(r)return r;return document.body}function Ft(r){let e=document.getElementById(r);if(!e&&!ae())throw new Error(`Accessing '${r}' before page was loaded`);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function Nt(r){let{width:e,height:t}=r,s=document.createElement("canvas");return s.id="lumagl-auto-created-canvas",s.width=e||1,s.height=t||1,s.style.width=Number.isFinite(e)?`${e}px`:"100%",s.style.height=Number.isFinite(t)?`${t}px`:"100%",s}function Ut(r,e,t,s,n){let i=r,o=Xe(i[0],e,t),u=Ze(i[1],e,s,n),f=Xe(i[0]+1,e,t),m=f===t-1?f:f-1;f=Ze(i[1]+1,e,s,n);let g;return n?(f=f===0?f:f+1,g=u,u=f):g=f===s-1?f:f-1,{x:o,y:u,width:Math.max(m-o+1,1),height:Math.max(g-u+1,1)}}function Xe(r,e,t){return Math.min(Math.round(r*e),t-1)}function Ze(r,e,t,s){return s?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}var b=class extends c{get[Symbol.toStringTag](){return"Texture"}dimension;format;width;height;depth;mipLevels;updateTimestamp;static isExternalImage(e){return typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement||typeof VideoFrame<"u"&&e instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}static getExternalImageSize(e){if(typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height};if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};if(typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(typeof VideoFrame<"u"&&e instanceof VideoFrame)return{width:e.displayWidth,height:e.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(e){let t=e?.data;return ArrayBuffer.isView(t)}static getTextureDataSize(e){if(!e||ArrayBuffer.isView(e))return null;if(Array.isArray(e))return b.getTextureDataSize(e[0]);if(b.isExternalImage(e))return b.getExternalImageSize(e);if(e&&typeof e=="object"&&e.constructor===Object){let s=Object.values(e)[0];return{width:s.width,height:s.height}}throw new Error("texture size deduction failed")}static getMipLevelCount(e,t){return Math.floor(Math.log2(Math.max(e,t)))+1}static getCubeFaceDepth(e){switch(e){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(e)}}constructor(e,t){if(super(e,t,b.defaultProps),this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){let s=b.getTextureDataSize(this.props.data);this.width=s?.width||1,this.height=s?.height||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?b.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=e.incrementTimestamp()}createResizedTexture(e){return this.device.createTexture({...this.props,...e})}static _fixProps(e){let t={...e},{width:s,height:n}=t;return typeof s=="number"&&(t.width=Math.max(1,Math.ceil(s))),typeof n=="number"&&(t.height=Math.max(1,Math.ceil(n))),t}},h=b;a(h,"COPY_SRC",1),a(h,"COPY_DST",2),a(h,"TEXTURE",4),a(h,"STORAGE",8),a(h,"RENDER_ATTACHMENT",16),a(h,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),a(h,"defaultProps",{...c.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0}),a(h,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1});var ye=class extends c{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,ye.defaultProps)}},D=ye;a(D,"defaultProps",{...c.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});var be=class extends c{get[Symbol.toStringTag](){return"ExternalTexture"}constructor(e,t){super(e,t,be.defaultProps)}},$=be;a($,"defaultProps",{...c.defaultProps,source:void 0,colorSpace:"srgb"});function Ke(r,e,t){let s="",n=e.split(/\r?\n/),i=r.slice().sort((o,u)=>o.lineNum-u.lineNum);switch(t?.showSourceCode||"no"){case"all":let o=0;for(let u=1;u<=n.length;u++)for(s+=Qe(n[u-1],u,t);i.length>o&&i[o].lineNum===u;){let f=i[o++];s+=qe(f,n,f.lineNum,{...t,inlineSource:!1})}return s;case"issues":case"no":for(let u of r)s+=qe(u,n,u.lineNum,{inlineSource:t?.showSourceCode!=="no"});return s}}function qe(r,e,t,s){if(s?.inlineSource){let n=Ht(e,t),i=r.linePos>0?`${" ".repeat(r.linePos+5)}^^^
8
8
  `:"";return`
9
- ${n}${o}${r.type.toUpperCase()}: ${r.message}
9
+ ${n}${i}${r.type.toUpperCase()}: ${r.message}
10
10
 
11
- `}return s?.html?`<div class='luma-compiler-log-error' style="color:red;"><b> ${r.type.toUpperCase()}: ${r.message}</b></div>`:`${r.type.toUpperCase()}: ${r.message}`}function Ht(r,e,t){let s="";for(let n=e-2;n<=e;n++){let o=r[n-1];o!==void 0&&(s+=Qe(o,e,t))}return s}function Qe(r,e,t){let s=t?.html?kt(r):r;return`${zt(String(e),4)}: ${s}${t?.html?"<br/>":`
12
- `}`}function zt(r,e){let t="";for(let s=r.length;s<e;++s)t+=" ";return t+r}function kt(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}var xe=class extends c{get[Symbol.toStringTag](){return"Shader"}stage;source;compilationStatus="pending";constructor(e,t){super(e,{id:Gt(t),...t},xe.defaultProps),this.stage=this.props.stage,this.source=this.props.source}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(e=this.props.debug){switch(e){case"never":return;case"errors":if(this.compilationStatus==="success")return;break;case"warnings":case"always":break}let t=await this.getCompilationInfo();this.props.debug==="warnings"&&t?.length===0||this._displayShaderLog(t)}_displayShaderLog(e){if(typeof document>"u"||!document?.createElement)return;let t=Je(this.source),s=`${this.stage} ${t}`,n=Ke(e,this.source,{showSourceCode:"all",html:!0}),o=this.getTranslatedSource();o&&(n+=`<br /><br /><h1>Translated Source</h1><br /><br /><code style="user-select:text;"><pre>${o}</pre></code>`);let i=document.createElement("Button");i.innerHTML=`
11
+ `}return s?.html?`<div class='luma-compiler-log-error' style="color:red;"><b> ${r.type.toUpperCase()}: ${r.message}</b></div>`:`${r.type.toUpperCase()}: ${r.message}`}function Ht(r,e,t){let s="";for(let n=e-2;n<=e;n++){let i=r[n-1];i!==void 0&&(s+=Qe(i,e,t))}return s}function Qe(r,e,t){let s=t?.html?kt(r):r;return`${zt(String(e),4)}: ${s}${t?.html?"<br/>":`
12
+ `}`}function zt(r,e){let t="";for(let s=r.length;s<e;++s)t+=" ";return t+r}function kt(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}var xe=class extends c{get[Symbol.toStringTag](){return"Shader"}stage;source;compilationStatus="pending";constructor(e,t){super(e,{id:Gt(t),...t},xe.defaultProps),this.stage=this.props.stage,this.source=this.props.source}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(e=this.props.debug){switch(e){case"never":return;case"errors":if(this.compilationStatus==="success")return;break;case"warnings":case"always":break}let t=await this.getCompilationInfo();this.props.debug==="warnings"&&t?.length===0||this._displayShaderLog(t)}_displayShaderLog(e){if(typeof document>"u"||!document?.createElement)return;let t=Je(this.source),s=`${this.stage} ${t}`,n=Ke(e,this.source,{showSourceCode:"all",html:!0}),i=this.getTranslatedSource();i&&(n+=`<br /><br /><h1>Translated Source</h1><br /><br /><code style="user-select:text;"><pre>${i}</pre></code>`);let o=document.createElement("Button");o.innerHTML=`
13
13
  <h1>Shader Compilation Error in ${s}</h1><br /><br />
14
14
  <code style="user-select:text;"><pre>
15
15
  ${n}
16
- </pre></code>`,i.style.top="10px",i.style.left="10px",i.style.position="absolute",i.style.zIndex="9999",i.style.width="100%",i.style.textAlign="left",document.body.appendChild(i),document.getElementsByClassName("luma-compiler-log-error")[0]?.scrollIntoView(),i.onclick=()=>{let f=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(f)}}},F=xe;a(F,"defaultProps",{...c.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Gt(r){return Je(r.source)||r.id||E(`unnamed ${r.stage}-shader`)}function Je(r,e="unnamed"){let s=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(r);return s?s[1]:e}var we=class extends c{get[Symbol.toStringTag](){return"Sampler"}constructor(e,t){super(e,t,we.defaultProps)}},N=we;a(N,"defaultProps",{...c.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var Te=class extends c{get[Symbol.toStringTag](){return"Framebuffer"}width;height;constructor(e,t={}){super(e,t,Te.defaultProps),this.width=this.props.width,this.height=this.props.height}resize(e){let t=!e;if(e){let[s,n]=Array.isArray(e)?e:[e.width,e.height];t=t||n!==this.height||s!==this.width,this.width=s,this.height=n}t&&(l.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map(t=>{if(typeof t=="string"){let s=this.createColorTexture(t);return this.attachResource(s),s.view}return t instanceof h?t.view:t});let e=this.props.depthStencilAttachment;if(e)if(typeof e=="string"){let t=this.createDepthStencilTexture(e);this.attachResource(t),this.depthStencilAttachment=t.view}else e instanceof h?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e){return this.device.createTexture({id:"color-attachment",usage:h.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}createDepthStencilTexture(e){return this.device.createTexture({id:"depth-stencil-attachment",usage:h.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}resizeAttachments(e,t){for(let s=0;s<this.colorAttachments.length;++s)if(this.colorAttachments[s]){let n=this.colorAttachments[s].texture.createResizedTexture({width:e,height:t});this.destroyAttachedResource(this.colorAttachments[s]),this.colorAttachments[s]=n.view,this.attachResource(n.view)}if(this.depthStencilAttachment){let s=this.depthStencilAttachment.texture.createResizedTexture({width:e,height:t});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=s.view,this.attachResource(s)}this.updateAttachments()}},U=Te;a(U,"defaultProps",{...c.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var Se=class extends c{get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(e,t){super(e,t,Se.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}setUniformsWebGL(e){throw new Error("Use uniform blocks")}},H=Se;a(H,"defaultProps",{...c.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}});var Ae=class extends c{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,t){super(e,t,Ae.defaultProps)}},z=Ae;a(z,"defaultProps",{...c.defaultProps,framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var ve=class extends c{get[Symbol.toStringTag](){return"ComputePipeline"}hash="";shaderLayout;constructor(e,t){super(e,t,ve.defaultProps),this.shaderLayout=t.shaderLayout}},k=ve;a(k,"defaultProps",{...c.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});var Ee=class extends c{get[Symbol.toStringTag](){return"ComputePass"}constructor(e,t){super(e,t,Ee.defaultProps)}},G=Ee;a(G,"defaultProps",{...c.defaultProps,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var Pe=class extends c{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,t){super(e,t,Pe.defaultProps)}},V=Pe;a(V,"defaultProps",{...c.defaultProps,measureExecutionTime:void 0});var _e=class extends c{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,t){super(e,t,_e.defaultProps)}},W=_e;a(W,"defaultProps",{...c.defaultProps});function ce(r){let[e,t]=Wt[r],s=e==="i32"||e==="u32",n=e!=="u32",o=Ot[e]*t,i=Vt(e,t);return{dataType:e,components:t,defaultVertexFormat:i,byteLength:o,integer:s,signed:n}}function Vt(r,e){let t;switch(r){case"f32":t="float32";break;case"i32":t="sint32";break;case"u32":t="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?t:`${t}x${e}`}var Wt={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},Ot={f32:4,f16:2,i32:4,u32:4};function O(r){let e;r.endsWith("-webgl")&&(r.replace("-webgl",""),e=!0);let[t,s]=r.split("x"),n=t,o=s?parseInt(s):1,i=te(n),u={type:n,components:o,byteLength:i.byteLength*o,integer:i.integer,signed:i.signed,normalized:i.normalized};return e&&(u.webglOnly=!0),u}function Le(r,e){let t={};for(let s of r.attributes){let n=jt(r,e,s.name);n&&(t[s.name]=n)}return t}function et(r,e,t=16){let s=Le(r,e),n=new Array(t).fill(null);for(let o of Object.values(s))n[o.location]=o;return n}function jt(r,e,t){let s=Yt(r,t),n=Xt(e,t);if(!s)return null;let o=ce(s.type),i=n?.vertexFormat||o.defaultVertexFormat,u=O(i);return{attributeName:n?.attributeName||s.name,bufferName:n?.bufferName||s.name,location:s.location,shaderType:s.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:i,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:o.integer,stepMode:n?.stepMode||s.stepMode||"vertex",byteOffset:n?.byteOffset||0,byteStride:n?.byteStride||0}}function Yt(r,e){let t=r.attributes.find(s=>s.name===e);return t||l.warn(`shader layout attribute "${e}" not present in shader`),t||null}function Xt(r,e){Zt(r);let t=qt(r,e);return t||(t=Kt(r,e),t)?t:(l.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function Zt(r){for(let e of r)(e.attributes&&e.format||!e.attributes&&!e.format)&&l.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function qt(r,e){for(let t of r)if(t.format&&t.name===e)return{attributeName:t.name,bufferName:e,stepMode:t.stepMode,vertexFormat:t.format,byteOffset:0,byteStride:t.byteStride||0};return null}function Kt(r,e){for(let t of r){let s=t.byteStride;if(typeof t.byteStride!="number")for(let o of t.attributes||[]){let i=O(o.format);s+=i.byteLength}let n=t.attributes?.find(o=>o.attribute===e);if(n)return{attributeName:n.attribute,bufferName:t.name,stepMode:t.stepMode,vertexFormat:n.format,byteOffset:n.byteOffset,byteStride:s}}return null}var Ce=class extends c{get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(e,t){super(e,t,Ce.defaultProps),this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);let{shaderLayout:s,bufferLayout:n}=t.renderPipeline||{};if(!s||!n)throw new Error("VertexArray");this.attributeInfos=et(s,n,this.maxVertexAttributes)}setConstantWebGL(e,t){throw new Error("constant attributes not supported")}},j=Ce;a(j,"defaultProps",{...c.defaultProps,renderPipeline:null});var Me=class extends c{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,t){super(e,t,Me.defaultProps)}},Y=Me;a(Y,"defaultProps",{...c.defaultProps,layout:void 0,buffers:{}});var Be=class extends c{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,t){super(e,t,Be.defaultProps)}},X=Be;a(X,"defaultProps",{...c.defaultProps,type:void 0,count:void 0});var Qt={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function ue(r){return Qt[r]}function tt(r,e){switch(e){case 1:return r;case 2:return r+r%2;default:return r+(4-r%4)%4}}var fe;function Re(r){return(!fe||fe.byteLength<r)&&(fe=new ArrayBuffer(r)),fe}function rt(r,e){let t=Re(r.BYTES_PER_ELEMENT*e);return new r(t,0,e)}function Jt(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function P(r){return Array.isArray(r)?r.length===0||typeof r[0]=="number":Jt(r)}var st=1024,_=class{layout={};byteLength;constructor(e){let t=0;for(let[n,o]of Object.entries(e)){let i=ue(o),{type:u,components:f}=i;t=tt(t,f);let m=t;t+=f,this.layout[n]={type:u,size:f,offset:m}}t+=(4-t%4)%4;let s=t*4;this.byteLength=Math.max(s,st)}getData(e){let t=Math.max(this.byteLength,st),s=Re(t),n={i32:new Int32Array(s),u32:new Uint32Array(s),f32:new Float32Array(s),f16:new Uint16Array(s)};for(let[o,i]of Object.entries(e)){let u=this.layout[o];if(!u){l.warn(`Supplied uniform value ${o} not present in uniform block layout`)();continue}let{type:f,size:m,offset:g}=u,C=n[f];if(m===1){if(typeof i!="number"&&typeof i!="boolean"){l.warn(`Supplied value for single component uniform ${o} is not a number: ${i}`)();continue}C[g]=Number(i)}else{if(!P(i)){l.warn(`Supplied value for multi component / array uniform ${o} is not a numeric array: ${i}`)();continue}C.set(i,g)}}return new Uint8Array(s)}has(e){return Boolean(this.layout[e])}get(e){return this.layout[e]}};function nt(r,e,t=16){if(r!==e)return!1;let s=r,n=e;if(!P(s))return!1;if(P(n)&&s.length===n.length){for(let o=0;o<s.length;++o)if(n[o]!==s[o])return!1}return!0}function ot(r){return P(r)?r.slice():r}var L=class{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw="initialized";constructor(e){if(this.name=e?.name||"unnamed",e?.name&&e?.shaderLayout){let t=e?.shaderLayout.bindings?.find(n=>n.type==="uniform"&&n.name===e?.name);if(!t)throw new Error(e?.name);let s=t;for(let n of s.uniforms||[])this.bindingLayout[n.name]=n}}setUniforms(e){for(let[t,s]of Object.entries(e))this._setUniform(t,s),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${s}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){nt(this.uniforms[e],t)||(this.uniforms[e]=ot(t),this.modifiedUniforms[e]=!0,this.modified=!0)}};var le=class{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(e){for(let[t,s]of Object.entries(e)){let n=t,o=new _(s.uniformTypes||{});this.uniformBufferLayouts.set(n,o);let i=new L({name:t});i.setUniforms(s.defaultUniforms||{}),this.uniformBlocks.set(n,i)}}destroy(){for(let e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(let[t,s]of Object.entries(e))this.uniformBlocks.get(t)?.setUniforms(s);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e)?.byteLength||0}getUniformBufferData(e){let t=this.uniformBlocks.get(e)?.getAllUniforms()||{};return this.uniformBufferLayouts.get(e)?.getData(t)}createUniformBuffer(e,t,s){s&&this.setUniforms(s);let n=this.getUniformBufferByteLength(t),o=e.createBuffer({usage:d.UNIFORM|d.COPY_DST,byteLength:n}),i=this.getUniformBufferData(t);return o.write(i),o}getManagedUniformBuffer(e,t){if(!this.uniformBuffers.get(t)){let s=this.getUniformBufferByteLength(t),n=e.createBuffer({usage:d.UNIFORM|d.COPY_DST,byteLength:s});this.uniformBuffers.set(t,n)}return this.uniformBuffers.get(t)}updateUniformBuffers(){let e=!1;for(let t of this.uniformBlocks.keys()){let s=this.updateUniformBuffer(t);e||=s}return e&&l.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let t=this.uniformBlocks.get(e),s=this.uniformBuffers.get(e),n=!1;if(s&&t?.needsRedraw){n||=t.needsRedraw;let o=this.getUniformBufferData(e);this.uniformBuffers.get(e)?.write(o);let u=this.uniformBlocks.get(e)?.getAllUniforms();l.log(4,`Writing to uniform buffer ${String(e)}`,o,u)()}return n}};function Ie(r){let e=ArrayBuffer.isView(r)?r.constructor:r;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function it(r){switch(r){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(r)}}function at(r,e,t){if(!e||e>4)throw new Error(`size ${e}`);let s=e,n=Ie(r);if(n==="uint8"||n==="sint8"){if(s===1||s===3)throw new Error(`size: ${e}`);return t&&(n=n.replace("int","norm")),`${n}x${s}`}if(n==="uint16"||n==="sint16"){if(s===1||s===3)throw new Error(`size: ${e}`);return t&&(n=n.replace("int","norm")),`${n}x${s}`}return s===1?n:`${n}x${s}`}return mt(er);})();
16
+ </pre></code>`,o.style.top="10px",o.style.left="10px",o.style.position="absolute",o.style.zIndex="9999",o.style.width="100%",o.style.textAlign="left",document.body.appendChild(o),document.getElementsByClassName("luma-compiler-log-error")[0]?.scrollIntoView(),o.onclick=()=>{let f=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(f)}}},F=xe;a(F,"defaultProps",{...c.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Gt(r){return Je(r.source)||r.id||E(`unnamed ${r.stage}-shader`)}function Je(r,e="unnamed"){let s=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(r);return s?s[1]:e}var we=class extends c{get[Symbol.toStringTag](){return"Sampler"}constructor(e,t){super(e,t,we.defaultProps)}},N=we;a(N,"defaultProps",{...c.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var Te=class extends c{get[Symbol.toStringTag](){return"Framebuffer"}width;height;constructor(e,t={}){super(e,t,Te.defaultProps),this.width=this.props.width,this.height=this.props.height}resize(e){let t=!e;if(e){let[s,n]=Array.isArray(e)?e:[e.width,e.height];t=t||n!==this.height||s!==this.width,this.width=s,this.height=n}t&&(l.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map(t=>{if(typeof t=="string"){let s=this.createColorTexture(t);return this.attachResource(s),s.view}return t instanceof h?t.view:t});let e=this.props.depthStencilAttachment;if(e)if(typeof e=="string"){let t=this.createDepthStencilTexture(e);this.attachResource(t),this.depthStencilAttachment=t.view}else e instanceof h?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e){return this.device.createTexture({id:"color-attachment",usage:h.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(e){return this.device.createTexture({id:"depth-stencil-attachment",usage:h.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(e,t){for(let s=0;s<this.colorAttachments.length;++s)if(this.colorAttachments[s]){let n=this.colorAttachments[s].texture.createResizedTexture({width:e,height:t});this.destroyAttachedResource(this.colorAttachments[s]),this.colorAttachments[s]=n.view,this.attachResource(n.view)}if(this.depthStencilAttachment){let s=this.depthStencilAttachment.texture.createResizedTexture({width:e,height:t});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=s.view,this.attachResource(s)}this.updateAttachments()}},U=Te;a(U,"defaultProps",{...c.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var Se=class extends c{get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(e,t){super(e,t,Se.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}setUniformsWebGL(e){throw new Error("Use uniform blocks")}},H=Se;a(H,"defaultProps",{...c.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}});var Ae=class extends c{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,t){super(e,t,Ae.defaultProps)}},z=Ae;a(z,"defaultProps",{...c.defaultProps,framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var ve=class extends c{get[Symbol.toStringTag](){return"ComputePipeline"}hash="";shaderLayout;constructor(e,t){super(e,t,ve.defaultProps),this.shaderLayout=t.shaderLayout}},k=ve;a(k,"defaultProps",{...c.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});var Ee=class extends c{get[Symbol.toStringTag](){return"ComputePass"}constructor(e,t){super(e,t,Ee.defaultProps)}},G=Ee;a(G,"defaultProps",{...c.defaultProps,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var Pe=class extends c{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,t){super(e,t,Pe.defaultProps)}},V=Pe;a(V,"defaultProps",{...c.defaultProps,measureExecutionTime:void 0});var _e=class extends c{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,t){super(e,t,_e.defaultProps)}},W=_e;a(W,"defaultProps",{...c.defaultProps});function ce(r){let[e,t]=Wt[r],s=e==="i32"||e==="u32",n=e!=="u32",i=Ot[e]*t,o=Vt(e,t);return{dataType:e,components:t,defaultVertexFormat:o,byteLength:i,integer:s,signed:n}}function Vt(r,e){let t;switch(r){case"f32":t="float32";break;case"i32":t="sint32";break;case"u32":t="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?t:`${t}x${e}`}var Wt={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},Ot={f32:4,f16:2,i32:4,u32:4};function O(r){let e;r.endsWith("-webgl")&&(r.replace("-webgl",""),e=!0);let[t,s]=r.split("x"),n=t,i=s?parseInt(s):1,o=te(n),u={type:n,components:i,byteLength:o.byteLength*i,integer:o.integer,signed:o.signed,normalized:o.normalized};return e&&(u.webglOnly=!0),u}function Le(r,e){let t={};for(let s of r.attributes){let n=jt(r,e,s.name);n&&(t[s.name]=n)}return t}function et(r,e,t=16){let s=Le(r,e),n=new Array(t).fill(null);for(let i of Object.values(s))n[i.location]=i;return n}function jt(r,e,t){let s=Yt(r,t),n=Xt(e,t);if(!s)return null;let i=ce(s.type),o=n?.vertexFormat||i.defaultVertexFormat,u=O(o);return{attributeName:n?.attributeName||s.name,bufferName:n?.bufferName||s.name,location:s.location,shaderType:s.type,shaderDataType:i.dataType,shaderComponents:i.components,vertexFormat:o,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:i.integer,stepMode:n?.stepMode||s.stepMode||"vertex",byteOffset:n?.byteOffset||0,byteStride:n?.byteStride||0}}function Yt(r,e){let t=r.attributes.find(s=>s.name===e);return t||l.warn(`shader layout attribute "${e}" not present in shader`),t||null}function Xt(r,e){Zt(r);let t=qt(r,e);return t||(t=Kt(r,e),t)?t:(l.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function Zt(r){for(let e of r)(e.attributes&&e.format||!e.attributes&&!e.format)&&l.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function qt(r,e){for(let t of r)if(t.format&&t.name===e)return{attributeName:t.name,bufferName:e,stepMode:t.stepMode,vertexFormat:t.format,byteOffset:0,byteStride:t.byteStride||0};return null}function Kt(r,e){for(let t of r){let s=t.byteStride;if(typeof t.byteStride!="number")for(let i of t.attributes||[]){let o=O(i.format);s+=o.byteLength}let n=t.attributes?.find(i=>i.attribute===e);if(n)return{attributeName:n.attribute,bufferName:t.name,stepMode:t.stepMode,vertexFormat:n.format,byteOffset:n.byteOffset,byteStride:s}}return null}var Ce=class extends c{get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(e,t){super(e,t,Ce.defaultProps),this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);let{shaderLayout:s,bufferLayout:n}=t.renderPipeline||{};if(!s||!n)throw new Error("VertexArray");this.attributeInfos=et(s,n,this.maxVertexAttributes)}setConstantWebGL(e,t){throw new Error("constant attributes not supported")}},j=Ce;a(j,"defaultProps",{...c.defaultProps,renderPipeline:null});var Me=class extends c{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,t){super(e,t,Me.defaultProps)}},Y=Me;a(Y,"defaultProps",{...c.defaultProps,layout:void 0,buffers:{}});var Be=class extends c{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,t){super(e,t,Be.defaultProps)}},X=Be;a(X,"defaultProps",{...c.defaultProps,type:void 0,count:void 0});var Qt={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function ue(r){return Qt[r]}function tt(r,e){switch(e){case 1:return r;case 2:return r+r%2;default:return r+(4-r%4)%4}}var fe;function Re(r){return(!fe||fe.byteLength<r)&&(fe=new ArrayBuffer(r)),fe}function rt(r,e){let t=Re(r.BYTES_PER_ELEMENT*e);return new r(t,0,e)}function Jt(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function P(r){return Array.isArray(r)?r.length===0||typeof r[0]=="number":Jt(r)}var st=1024,_=class{layout={};byteLength;constructor(e){let t=0;for(let[n,i]of Object.entries(e)){let o=ue(i),{type:u,components:f}=o;t=tt(t,f);let m=t;t+=f,this.layout[n]={type:u,size:f,offset:m}}t+=(4-t%4)%4;let s=t*4;this.byteLength=Math.max(s,st)}getData(e){let t=Math.max(this.byteLength,st),s=Re(t),n={i32:new Int32Array(s),u32:new Uint32Array(s),f32:new Float32Array(s),f16:new Uint16Array(s)};for(let[i,o]of Object.entries(e)){let u=this.layout[i];if(!u){l.warn(`Supplied uniform value ${i} not present in uniform block layout`)();continue}let{type:f,size:m,offset:g}=u,C=n[f];if(m===1){if(typeof o!="number"&&typeof o!="boolean"){l.warn(`Supplied value for single component uniform ${i} is not a number: ${o}`)();continue}C[g]=Number(o)}else{if(!P(o)){l.warn(`Supplied value for multi component / array uniform ${i} is not a numeric array: ${o}`)();continue}C.set(o,g)}}return new Uint8Array(s)}has(e){return Boolean(this.layout[e])}get(e){return this.layout[e]}};function nt(r,e,t=16){if(r!==e)return!1;let s=r,n=e;if(!P(s))return!1;if(P(n)&&s.length===n.length){for(let i=0;i<s.length;++i)if(n[i]!==s[i])return!1}return!0}function it(r){return P(r)?r.slice():r}var L=class{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw="initialized";constructor(e){if(this.name=e?.name||"unnamed",e?.name&&e?.shaderLayout){let t=e?.shaderLayout.bindings?.find(n=>n.type==="uniform"&&n.name===e?.name);if(!t)throw new Error(e?.name);let s=t;for(let n of s.uniforms||[])this.bindingLayout[n.name]=n}}setUniforms(e){for(let[t,s]of Object.entries(e))this._setUniform(t,s),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${s}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){nt(this.uniforms[e],t)||(this.uniforms[e]=it(t),this.modifiedUniforms[e]=!0,this.modified=!0)}};var le=class{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(e){for(let[t,s]of Object.entries(e)){let n=t,i=new _(s.uniformTypes||{});this.uniformBufferLayouts.set(n,i);let o=new L({name:t});o.setUniforms(s.defaultUniforms||{}),this.uniformBlocks.set(n,o)}}destroy(){for(let e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(let[t,s]of Object.entries(e))this.uniformBlocks.get(t)?.setUniforms(s);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e)?.byteLength||0}getUniformBufferData(e){let t=this.uniformBlocks.get(e)?.getAllUniforms()||{};return this.uniformBufferLayouts.get(e)?.getData(t)}createUniformBuffer(e,t,s){s&&this.setUniforms(s);let n=this.getUniformBufferByteLength(t),i=e.createBuffer({usage:d.UNIFORM|d.COPY_DST,byteLength:n}),o=this.getUniformBufferData(t);return i.write(o),i}getManagedUniformBuffer(e,t){if(!this.uniformBuffers.get(t)){let s=this.getUniformBufferByteLength(t),n=e.createBuffer({usage:d.UNIFORM|d.COPY_DST,byteLength:s});this.uniformBuffers.set(t,n)}return this.uniformBuffers.get(t)}updateUniformBuffers(){let e=!1;for(let t of this.uniformBlocks.keys()){let s=this.updateUniformBuffer(t);e||=s}return e&&l.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let t=this.uniformBlocks.get(e),s=this.uniformBuffers.get(e),n=!1;if(s&&t?.needsRedraw){n||=t.needsRedraw;let i=this.getUniformBufferData(e);this.uniformBuffers.get(e)?.write(i);let u=this.uniformBlocks.get(e)?.getAllUniforms();l.log(4,`Writing to uniform buffer ${String(e)}`,i,u)()}return n}};function Ie(r){let e=ArrayBuffer.isView(r)?r.constructor:r;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function ot(r){switch(r){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(r)}}function at(r,e,t){if(!e||e>4)throw new Error(`size ${e}`);let s=e,n=Ie(r);if(n==="uint8"||n==="sint8"){if(s===1||s===3)throw new Error(`size: ${e}`);return t&&(n=n.replace("int","norm")),`${n}x${s}`}if(n==="uint16"||n==="sint16"){if(s===1||s===3)throw new Error(`size: ${e}`);return t&&(n=n.replace("int","norm")),`${n}x${s}`}return s===1?n:`${n}x${s}`}return mt(er);})();
17
17
  return __exports__;
18
18
  });
package/dist/index.cjs CHANGED
@@ -622,7 +622,7 @@ var _Luma = class {
622
622
  VERSION = (
623
623
  // Version detection using build plugin
624
624
  // @ts-expect-error no-undef
625
- true ? "9.1.0-alpha.14" : "running from source"
625
+ true ? "9.1.0-alpha.15" : "running from source"
626
626
  );
627
627
  spector;
628
628
  preregisteredAdapters = /* @__PURE__ */ new Map();
@@ -1488,7 +1488,12 @@ var _Framebuffer = class extends Resource {
1488
1488
  usage: Texture.RENDER_ATTACHMENT,
1489
1489
  format,
1490
1490
  width: this.width,
1491
- height: this.height
1491
+ height: this.height,
1492
+ // TODO deprecated? - luma.gl v8 compatibility
1493
+ sampler: {
1494
+ magFilter: "linear",
1495
+ minFilter: "linear"
1496
+ }
1492
1497
  });
1493
1498
  }
1494
1499
  /** Create depth stencil texture */
@@ -1498,7 +1503,8 @@ var _Framebuffer = class extends Resource {
1498
1503
  usage: Texture.RENDER_ATTACHMENT,
1499
1504
  format,
1500
1505
  width: this.width,
1501
- height: this.height
1506
+ height: this.height,
1507
+ mipmaps: false
1502
1508
  });
1503
1509
  }
1504
1510
  /**