@luma.gl/core 9.0.0-alpha.40 → 9.0.0-alpha.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.dev.js CHANGED
@@ -2596,6 +2596,13 @@ var __exports__ = (() => {
2596
2596
  }
2597
2597
  return true;
2598
2598
  }
2599
+ function arrayCopy(a) {
2600
+ const numberArray = isNumberArray(a);
2601
+ if (numberArray) {
2602
+ return numberArray.slice();
2603
+ }
2604
+ return a;
2605
+ }
2599
2606
 
2600
2607
  // src/lib/uniforms/uniform-block.ts
2601
2608
  var UniformBlock = class {
@@ -2640,7 +2647,7 @@ var __exports__ = (() => {
2640
2647
  if (arrayEqual(this.uniforms[key], value)) {
2641
2648
  return;
2642
2649
  }
2643
- this.uniforms[key] = value;
2650
+ this.uniforms[key] = arrayCopy(value);
2644
2651
  this.modifiedUniforms[key] = true;
2645
2652
  this.modified = true;
2646
2653
  }
package/dist/index.cjs CHANGED
@@ -1719,6 +1719,13 @@ function arrayEqual(a, b, limit = 16) {
1719
1719
  }
1720
1720
  return true;
1721
1721
  }
1722
+ function arrayCopy(a) {
1723
+ const numberArray = isNumberArray(a);
1724
+ if (numberArray) {
1725
+ return numberArray.slice();
1726
+ }
1727
+ return a;
1728
+ }
1722
1729
 
1723
1730
  // src/lib/uniforms/uniform-block.ts
1724
1731
  var UniformBlock = class {
@@ -1731,7 +1738,9 @@ var UniformBlock = class {
1731
1738
  var _a;
1732
1739
  this.name = props == null ? void 0 : props.name;
1733
1740
  if ((props == null ? void 0 : props.name) && (props == null ? void 0 : props.shaderLayout)) {
1734
- const binding = (_a = props == null ? void 0 : props.shaderLayout.bindings) == null ? void 0 : _a.find((binding2) => binding2.type === "uniform" && binding2.name === (props == null ? void 0 : props.name));
1741
+ const binding = (_a = props == null ? void 0 : props.shaderLayout.bindings) == null ? void 0 : _a.find(
1742
+ (binding2) => binding2.type === "uniform" && binding2.name === (props == null ? void 0 : props.name)
1743
+ );
1735
1744
  if (!binding) {
1736
1745
  throw new Error(props == null ? void 0 : props.name);
1737
1746
  }
@@ -1764,7 +1773,7 @@ var UniformBlock = class {
1764
1773
  if (arrayEqual(this.uniforms[key], value)) {
1765
1774
  return;
1766
1775
  }
1767
- this.uniforms[key] = value;
1776
+ this.uniforms[key] = arrayCopy(value);
1768
1777
  this.modifiedUniforms[key] = true;
1769
1778
  this.modified = true;
1770
1779
  }
@@ -1 +1 @@
1
- {"version":3,"file":"uniform-block.d.ts","sourceRoot":"","sources":["../../../src/lib/uniforms/uniform-block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAC,YAAY,EAA8B,WAAW,EAAC,MAAM,mCAAmC,CAAC;AAGxG;;;;GAIG;AACH,qBAAa,YAAY,CAAC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,YAAY,CAAC,CAA+C;IAC9F,gBAAgB,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,OAAO,CAAC,CAA0C;IAC5F,QAAQ,EAAE,OAAO,CAAQ;IAEzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAM;IACzD,WAAW,EAAE,MAAM,GAAG,KAAK,CAAiB;gBAEhC,KAAK,CAAC,EAAE;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAA;KAC1E;IAkBD,4BAA4B;IAC5B,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;IAS/C,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIpC,2BAA2B;IAC3B,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IAO9C,2BAA2B;IAC3B,OAAO,CAAC,WAAW;CAQpB"}
1
+ {"version":3,"file":"uniform-block.d.ts","sourceRoot":"","sources":["../../../src/lib/uniforms/uniform-block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,YAAY,EACZ,WAAW,EAEZ,MAAM,mCAAmC,CAAC;AAG3C;;;;GAIG;AACH,qBAAa,YAAY,CAAC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,YAAY,CAAC,CAA+C;IAC9F,gBAAgB,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,OAAO,CAAC,CAA0C;IAC5F,QAAQ,EAAE,OAAO,CAAQ;IAEzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAM;IACzD,WAAW,EAAE,MAAM,GAAG,KAAK,CAAiB;gBAEhC,KAAK,CAAC,EAAE;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;KAC3E;IAmBD,4BAA4B;IAC5B,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;IAS/C,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIpC,2BAA2B;IAC3B,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IAO9C,2BAA2B;IAC3B,OAAO,CAAC,WAAW;CAQpB"}
@@ -1,4 +1,4 @@
1
- import { arrayEqual } from "../utils/array-equal.js";
1
+ import { arrayEqual, arrayCopy } from "../utils/array-equal.js";
2
2
  export class UniformBlock {
3
3
  constructor(props) {
4
4
  this.name = void 0;
@@ -40,7 +40,7 @@ export class UniformBlock {
40
40
  if (arrayEqual(this.uniforms[key], value)) {
41
41
  return;
42
42
  }
43
- this.uniforms[key] = value;
43
+ this.uniforms[key] = arrayCopy(value);
44
44
  this.modifiedUniforms[key] = true;
45
45
  this.modified = true;
46
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"uniform-block.js","names":["arrayEqual","UniformBlock","constructor","props","name","uniforms","modifiedUniforms","modified","bindingLayout","needsRedraw","shaderLayout","_props$shaderLayout$b","binding","bindings","find","type","Error","uniformBlock","uniform","setUniforms","key","value","Object","entries","_setUniform","setNeedsRedraw","reason","getAllUniforms"],"sources":["../../../src/lib/uniforms/uniform-block.ts"],"sourcesContent":["// luma.gl, MIT license\nimport type {ShaderUniformType} from '../../adapter/types/shader-types';\nimport type {UniformValue} from '../../adapter/types/types';\nimport {ShaderLayout, UniformBufferBindingLayout, UniformInfo} from '../../adapter/types/shader-layout';\nimport { arrayEqual } from '../utils/array-equal';\n\n/** \n * A uniform block holds values of the of uniform values for one uniform block / buffer.\n * It also does some book keeping on what has changed, to minimize unnecessary writes to uniform buffers.\n * @todo - Track changes to individual uniforms (for WebGL1)\n */\nexport class UniformBlock<TUniforms extends Record<string, UniformValue>> {\n name: string;\n\n uniforms: Record<keyof TUniforms, UniformValue> = {} as Record<keyof TUniforms, UniformValue>;\n modifiedUniforms: Record<keyof TUniforms, boolean> = {} as Record<keyof TUniforms, boolean>;\n modified: boolean = true;\n\n readonly bindingLayout: Record<string, UniformInfo> = {};\n needsRedraw: string | false = 'initialized';\n\n constructor(props?: {\n name?: string;\n shaderLayout?: ShaderLayout; \n uniformTypes?: Record<keyof TUniforms, Record<string, ShaderUniformType>>\n }) {\n this.name = props?.name;\n\n // TODO - Extract uniform layout from the shaderLayout object\n if (props?.name && props?.shaderLayout) {\n const binding = props?.shaderLayout.bindings\n ?.find(binding => binding.type === 'uniform' && binding.name === props?.name);\n if (!binding) {\n throw new Error(props?.name);\n }\n\n const uniformBlock = binding as UniformBufferBindingLayout;\n for (const uniform of uniformBlock.uniforms || []) {\n this.bindingLayout[uniform.name] = uniform;\n }\n }\n }\n\n /** Set a map of uniforms */\n setUniforms(uniforms: Partial<TUniforms>): void {\n for (const [key, value] of Object.entries(uniforms)) {\n this._setUniform(key, value);\n if (!this.needsRedraw) {\n this.setNeedsRedraw(`${this.name}.${key}=${value}`);\n }\n }\n }\n\n setNeedsRedraw(reason: string): void {\n this.needsRedraw = this.needsRedraw || reason;\n }\n\n /** Returns all uniforms */\n getAllUniforms(): Record<string, UniformValue> {\n // @ts-expect-error\n this.modifiedUniforms = {};\n this.needsRedraw = false;\n return (this.uniforms || {}) as Record<string, UniformValue>;\n }\n\n /** Set a single uniform */\n private _setUniform(key: keyof TUniforms, value: UniformValue) {\n if (arrayEqual(this.uniforms[key], value)) {\n return;\n }\n this.uniforms[key] = value;\n this.modifiedUniforms[key] = true;\n this.modified = true;\n }\n}\n"],"mappings":"SAISA,UAAU;AAOnB,OAAO,MAAMC,YAAY,CAAiD;EAUxEC,WAAWA,CAACC,KAIX,EAAE;IAAA,KAbHC,IAAI;IAAA,KAEJC,QAAQ,GAA0C,CAAC,CAAC;IAAA,KACpDC,gBAAgB,GAAqC,CAAC,CAAC;IAAA,KACvDC,QAAQ,GAAY,IAAI;IAAA,KAEfC,aAAa,GAAgC,CAAC,CAAC;IAAA,KACxDC,WAAW,GAAmB,aAAa;IAOzC,IAAI,CAACL,IAAI,GAAGD,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,IAAI;IAGvB,IAAID,KAAK,aAALA,KAAK,eAALA,KAAK,CAAEC,IAAI,IAAID,KAAK,aAALA,KAAK,eAALA,KAAK,CAAEO,YAAY,EAAE;MAAA,IAAAC,qBAAA;MACtC,MAAMC,OAAO,GAAGT,KAAK,aAALA,KAAK,gBAAAQ,qBAAA,GAALR,KAAK,CAAEO,YAAY,CAACG,QAAQ,cAAAF,qBAAA,uBAA5BA,qBAAA,CACZG,IAAI,CAACF,OAAO,IAAIA,OAAO,CAACG,IAAI,KAAK,SAAS,IAAIH,OAAO,CAACR,IAAI,MAAKD,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,IAAI,EAAC;MAC/E,IAAI,CAACQ,OAAO,EAAE;QACZ,MAAM,IAAII,KAAK,CAACb,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,IAAI,CAAC;MAC9B;MAEA,MAAMa,YAAY,GAAGL,OAAqC;MAC1D,KAAK,MAAMM,OAAO,IAAID,YAAY,CAACZ,QAAQ,IAAI,EAAE,EAAE;QACjD,IAAI,CAACG,aAAa,CAACU,OAAO,CAACd,IAAI,CAAC,GAAGc,OAAO;MAC5C;IACF;EACF;EAGAC,WAAWA,CAACd,QAA4B,EAAQ;IAC9C,KAAK,MAAM,CAACe,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAAClB,QAAQ,CAAC,EAAE;MACnD,IAAI,CAACmB,WAAW,CAACJ,GAAG,EAAEC,KAAK,CAAC;MAC5B,IAAI,CAAC,IAAI,CAACZ,WAAW,EAAE;QACrB,IAAI,CAACgB,cAAc,CAAE,GAAE,IAAI,CAACrB,IAAK,IAAGgB,GAAI,IAAGC,KAAM,EAAC,CAAC;MACrD;IACF;EACF;EAEAI,cAAcA,CAACC,MAAc,EAAQ;IACnC,IAAI,CAACjB,WAAW,GAAG,IAAI,CAACA,WAAW,IAAIiB,MAAM;EAC/C;EAGAC,cAAcA,CAAA,EAAiC;IAE7C,IAAI,CAACrB,gBAAgB,GAAG,CAAC,CAAC;IAC1B,IAAI,CAACG,WAAW,GAAG,KAAK;IACxB,OAAQ,IAAI,CAACJ,QAAQ,IAAI,CAAC,CAAC;EAC7B;EAGQmB,WAAWA,CAACJ,GAAoB,EAAEC,KAAmB,EAAE;IAC7D,IAAIrB,UAAU,CAAC,IAAI,CAACK,QAAQ,CAACe,GAAG,CAAC,EAAEC,KAAK,CAAC,EAAE;MACzC;IACF;IACA,IAAI,CAAChB,QAAQ,CAACe,GAAG,CAAC,GAAGC,KAAK;IAC1B,IAAI,CAACf,gBAAgB,CAACc,GAAG,CAAC,GAAG,IAAI;IACjC,IAAI,CAACb,QAAQ,GAAG,IAAI;EACtB;AACF"}
1
+ {"version":3,"file":"uniform-block.js","names":["arrayEqual","arrayCopy","UniformBlock","constructor","props","name","uniforms","modifiedUniforms","modified","bindingLayout","needsRedraw","shaderLayout","_props$shaderLayout$b","binding","bindings","find","type","Error","uniformBlock","uniform","setUniforms","key","value","Object","entries","_setUniform","setNeedsRedraw","reason","getAllUniforms"],"sources":["../../../src/lib/uniforms/uniform-block.ts"],"sourcesContent":["// luma.gl, MIT license\nimport type {ShaderUniformType} from '../../adapter/types/shader-types';\nimport type {UniformValue} from '../../adapter/types/types';\nimport {\n ShaderLayout,\n UniformInfo,\n UniformBufferBindingLayout\n} from '../../adapter/types/shader-layout';\nimport {arrayEqual, arrayCopy} from '../utils/array-equal';\n\n/**\n * A uniform block holds values of the of uniform values for one uniform block / buffer.\n * It also does some book keeping on what has changed, to minimize unnecessary writes to uniform buffers.\n * @todo - Track changes to individual uniforms (for WebGL1)\n */\nexport class UniformBlock<TUniforms extends Record<string, UniformValue>> {\n name: string;\n\n uniforms: Record<keyof TUniforms, UniformValue> = {} as Record<keyof TUniforms, UniformValue>;\n modifiedUniforms: Record<keyof TUniforms, boolean> = {} as Record<keyof TUniforms, boolean>;\n modified: boolean = true;\n\n readonly bindingLayout: Record<string, UniformInfo> = {};\n needsRedraw: string | false = 'initialized';\n\n constructor(props?: {\n name?: string;\n shaderLayout?: ShaderLayout;\n uniformTypes?: Record<keyof TUniforms, Record<string, ShaderUniformType>>;\n }) {\n this.name = props?.name;\n\n // TODO - Extract uniform layout from the shaderLayout object\n if (props?.name && props?.shaderLayout) {\n const binding = props?.shaderLayout.bindings?.find(\n binding => binding.type === 'uniform' && binding.name === props?.name\n );\n if (!binding) {\n throw new Error(props?.name);\n }\n\n const uniformBlock = binding as UniformBufferBindingLayout;\n for (const uniform of uniformBlock.uniforms || []) {\n this.bindingLayout[uniform.name] = uniform;\n }\n }\n }\n\n /** Set a map of uniforms */\n setUniforms(uniforms: Partial<TUniforms>): void {\n for (const [key, value] of Object.entries(uniforms)) {\n this._setUniform(key, value);\n if (!this.needsRedraw) {\n this.setNeedsRedraw(`${this.name}.${key}=${value}`);\n }\n }\n }\n\n setNeedsRedraw(reason: string): void {\n this.needsRedraw = this.needsRedraw || reason;\n }\n\n /** Returns all uniforms */\n getAllUniforms(): Record<string, UniformValue> {\n // @ts-expect-error\n this.modifiedUniforms = {};\n this.needsRedraw = false;\n return (this.uniforms || {}) as Record<string, UniformValue>;\n }\n\n /** Set a single uniform */\n private _setUniform(key: keyof TUniforms, value: UniformValue) {\n if (arrayEqual(this.uniforms[key], value)) {\n return;\n }\n this.uniforms[key] = arrayCopy(value);\n this.modifiedUniforms[key] = true;\n this.modified = true;\n }\n}\n"],"mappings":"SAQQA,UAAU,EAAEC,SAAS;AAO7B,OAAO,MAAMC,YAAY,CAAiD;EAUxEC,WAAWA,CAACC,KAIX,EAAE;IAAA,KAbHC,IAAI;IAAA,KAEJC,QAAQ,GAA0C,CAAC,CAAC;IAAA,KACpDC,gBAAgB,GAAqC,CAAC,CAAC;IAAA,KACvDC,QAAQ,GAAY,IAAI;IAAA,KAEfC,aAAa,GAAgC,CAAC,CAAC;IAAA,KACxDC,WAAW,GAAmB,aAAa;IAOzC,IAAI,CAACL,IAAI,GAAGD,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,IAAI;IAGvB,IAAID,KAAK,aAALA,KAAK,eAALA,KAAK,CAAEC,IAAI,IAAID,KAAK,aAALA,KAAK,eAALA,KAAK,CAAEO,YAAY,EAAE;MAAA,IAAAC,qBAAA;MACtC,MAAMC,OAAO,GAAGT,KAAK,aAALA,KAAK,gBAAAQ,qBAAA,GAALR,KAAK,CAAEO,YAAY,CAACG,QAAQ,cAAAF,qBAAA,uBAA5BA,qBAAA,CAA8BG,IAAI,CAChDF,OAAO,IAAIA,OAAO,CAACG,IAAI,KAAK,SAAS,IAAIH,OAAO,CAACR,IAAI,MAAKD,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,IAAI,CACvE,CAAC;MACD,IAAI,CAACQ,OAAO,EAAE;QACZ,MAAM,IAAII,KAAK,CAACb,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,IAAI,CAAC;MAC9B;MAEA,MAAMa,YAAY,GAAGL,OAAqC;MAC1D,KAAK,MAAMM,OAAO,IAAID,YAAY,CAACZ,QAAQ,IAAI,EAAE,EAAE;QACjD,IAAI,CAACG,aAAa,CAACU,OAAO,CAACd,IAAI,CAAC,GAAGc,OAAO;MAC5C;IACF;EACF;EAGAC,WAAWA,CAACd,QAA4B,EAAQ;IAC9C,KAAK,MAAM,CAACe,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAAClB,QAAQ,CAAC,EAAE;MACnD,IAAI,CAACmB,WAAW,CAACJ,GAAG,EAAEC,KAAK,CAAC;MAC5B,IAAI,CAAC,IAAI,CAACZ,WAAW,EAAE;QACrB,IAAI,CAACgB,cAAc,CAAE,GAAE,IAAI,CAACrB,IAAK,IAAGgB,GAAI,IAAGC,KAAM,EAAC,CAAC;MACrD;IACF;EACF;EAEAI,cAAcA,CAACC,MAAc,EAAQ;IACnC,IAAI,CAACjB,WAAW,GAAG,IAAI,CAACA,WAAW,IAAIiB,MAAM;EAC/C;EAGAC,cAAcA,CAAA,EAAiC;IAE7C,IAAI,CAACrB,gBAAgB,GAAG,CAAC,CAAC;IAC1B,IAAI,CAACG,WAAW,GAAG,KAAK;IACxB,OAAQ,IAAI,CAACJ,QAAQ,IAAI,CAAC,CAAC;EAC7B;EAGQmB,WAAWA,CAACJ,GAAoB,EAAEC,KAAmB,EAAE;IAC7D,IAAItB,UAAU,CAAC,IAAI,CAACM,QAAQ,CAACe,GAAG,CAAC,EAAEC,KAAK,CAAC,EAAE;MACzC;IACF;IACA,IAAI,CAAChB,QAAQ,CAACe,GAAG,CAAC,GAAGpB,SAAS,CAACqB,KAAK,CAAC;IACrC,IAAI,CAACf,gBAAgB,CAACc,GAAG,CAAC,GAAG,IAAI;IACjC,IAAI,CAACb,QAAQ,GAAG,IAAI;EACtB;AACF"}
@@ -1,3 +1,5 @@
1
1
  /** Test if two arrays are deep equal, with a length limit that defaults to 16 */
2
2
  export declare function arrayEqual(a: unknown, b: unknown, limit?: number): boolean;
3
+ /** Copy a value */
4
+ export declare function arrayCopy<T>(a: T): T;
3
5
  //# sourceMappingURL=array-equal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"array-equal.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/array-equal.ts"],"names":[],"mappings":"AAKA,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,MAAW,WAiBpE"}
1
+ {"version":3,"file":"array-equal.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/array-equal.ts"],"names":[],"mappings":"AAKA,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,MAAW,WAiBpE;AAED,mBAAmB;AACnB,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAMpC"}
@@ -18,4 +18,11 @@ export function arrayEqual(a, b) {
18
18
  }
19
19
  return true;
20
20
  }
21
+ export function arrayCopy(a) {
22
+ const numberArray = isNumberArray(a);
23
+ if (numberArray) {
24
+ return numberArray.slice();
25
+ }
26
+ return a;
27
+ }
21
28
  //# sourceMappingURL=array-equal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"array-equal.js","names":["isNumberArray","arrayEqual","a","b","limit","arguments","length","undefined","arrayA","arrayB","i"],"sources":["../../../src/lib/utils/array-equal.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {isNumberArray} from '../utils/is-array';\n\n/** Test if two arrays are deep equal, with a length limit that defaults to 16 */\nexport function arrayEqual(a: unknown, b: unknown, limit: number = 16) {\n if (a !== b) {\n return false;\n }\n const arrayA = isNumberArray(a);\n if (!arrayA) {\n return false;\n }\n const arrayB = isNumberArray(b);\n if (arrayB && arrayA.length === arrayB.length) {\n for (let i = 0; i < arrayA.length; ++i) {\n if (arrayB[i] !== arrayA[i]) {\n return false;\n }\n }\n }\n return true;\n}\n"],"mappings":"SAGQA,aAAa;AAGrB,OAAO,SAASC,UAAUA,CAACC,CAAU,EAAEC,CAAU,EAAsB;EAAA,IAApBC,KAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EACnE,IAAIH,CAAC,KAAKC,CAAC,EAAE;IACX,OAAO,KAAK;EACd;EACA,MAAMK,MAAM,GAAGR,aAAa,CAACE,CAAC,CAAC;EAC/B,IAAI,CAACM,MAAM,EAAE;IACX,OAAO,KAAK;EACd;EACA,MAAMC,MAAM,GAAGT,aAAa,CAACG,CAAC,CAAC;EAC/B,IAAIM,MAAM,IAAID,MAAM,CAACF,MAAM,KAAKG,MAAM,CAACH,MAAM,EAAE;IAC7C,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACF,MAAM,EAAE,EAAEI,CAAC,EAAE;MACtC,IAAID,MAAM,CAACC,CAAC,CAAC,KAAKF,MAAM,CAACE,CAAC,CAAC,EAAE;QAC3B,OAAO,KAAK;MACd;IACF;EACF;EACA,OAAO,IAAI;AACb"}
1
+ {"version":3,"file":"array-equal.js","names":["isNumberArray","arrayEqual","a","b","limit","arguments","length","undefined","arrayA","arrayB","i","arrayCopy","numberArray","slice"],"sources":["../../../src/lib/utils/array-equal.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {isNumberArray} from '../utils/is-array';\n\n/** Test if two arrays are deep equal, with a length limit that defaults to 16 */\nexport function arrayEqual(a: unknown, b: unknown, limit: number = 16) {\n if (a !== b) {\n return false;\n }\n const arrayA = isNumberArray(a);\n if (!arrayA) {\n return false;\n }\n const arrayB = isNumberArray(b);\n if (arrayB && arrayA.length === arrayB.length) {\n for (let i = 0; i < arrayA.length; ++i) {\n if (arrayB[i] !== arrayA[i]) {\n return false;\n }\n }\n }\n return true;\n}\n\n/** Copy a value */\nexport function arrayCopy<T>(a: T): T {\n const numberArray = isNumberArray(a);\n if (numberArray) {\n return numberArray.slice() as T;\n }\n return a;\n}\n"],"mappings":"SAGQA,aAAa;AAGrB,OAAO,SAASC,UAAUA,CAACC,CAAU,EAAEC,CAAU,EAAsB;EAAA,IAApBC,KAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EACnE,IAAIH,CAAC,KAAKC,CAAC,EAAE;IACX,OAAO,KAAK;EACd;EACA,MAAMK,MAAM,GAAGR,aAAa,CAACE,CAAC,CAAC;EAC/B,IAAI,CAACM,MAAM,EAAE;IACX,OAAO,KAAK;EACd;EACA,MAAMC,MAAM,GAAGT,aAAa,CAACG,CAAC,CAAC;EAC/B,IAAIM,MAAM,IAAID,MAAM,CAACF,MAAM,KAAKG,MAAM,CAACH,MAAM,EAAE;IAC7C,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACF,MAAM,EAAE,EAAEI,CAAC,EAAE;MACtC,IAAID,MAAM,CAACC,CAAC,CAAC,KAAKF,MAAM,CAACE,CAAC,CAAC,EAAE;QAC3B,OAAO,KAAK;MACd;IACF;EACF;EACA,OAAO,IAAI;AACb;AAGA,OAAO,SAASC,SAASA,CAAIT,CAAI,EAAK;EACpC,MAAMU,WAAW,GAAGZ,aAAa,CAACE,CAAC,CAAC;EACpC,IAAIU,WAAW,EAAE;IACf,OAAOA,WAAW,CAACC,KAAK,CAAC,CAAC;EAC5B;EACA,OAAOX,CAAC;AACV"}
package/dist.min.js CHANGED
@@ -4,18 +4,18 @@
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 ln=Object.create;var yt=Object.defineProperty;var pn=Object.getOwnPropertyDescriptor;var mn=Object.getOwnPropertyNames;var hn=Object.getPrototypeOf,dn=Object.prototype.hasOwnProperty;var Ut=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),gn=(t,r)=>{for(var e in r)yt(t,e,{get:r[e],enumerable:!0})},_e=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of mn(r))!dn.call(t,o)&&o!==e&&yt(t,o,{get:()=>r[o],enumerable:!(n=pn(r,o))||n.enumerable});return t};var Pe=(t,r,e)=>(e=t!=null?ln(hn(t)):{},_e(r||!t||!t.__esModule?yt(e,"default",{value:t,enumerable:!0}):e,t)),yn=t=>_e(yt({},"__esModule",{value:!0}),t);var Le=Ut((oa,G)=>{function Vt(t){return G.exports=Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},G.exports.__esModule=!0,G.exports.default=G.exports,Vt(t)}G.exports=Vt,G.exports.__esModule=!0,G.exports.default=G.exports});var Ue=Ut((ia,H)=>{var Ne=Le().default;function ke(){"use strict";H.exports=ke=function(){return t},H.exports.__esModule=!0,H.exports.default=H.exports;var t={},r=Object.prototype,e=r.hasOwnProperty,n=Object.defineProperty||function(p,f,l){p[f]=l.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(p,f,l){return Object.defineProperty(p,f,{value:l,enumerable:!0,configurable:!0,writable:!0}),p[f]}try{s({},"")}catch{s=function(l,m,v){return l[m]=v}}function c(p,f,l,m){var v=f&&f.prototype instanceof T?f:T,h=Object.create(v.prototype),E=new Nt(m||[]);return n(h,"_invoke",{value:cn(p,l,E)}),h}function O(p,f,l){try{return{type:"normal",arg:p.call(f,l)}}catch(m){return{type:"throw",arg:m}}}t.wrap=c;var _={};function T(){}function I(){}function j(){}var U={};s(U,i,function(){return this});var z=Object.getPrototypeOf,F=z&&z(z(kt([])));F&&F!==r&&e.call(F,i)&&(U=F);var N=j.prototype=T.prototype=Object.create(U);function ft(p){["next","throw","return"].forEach(function(f){s(p,f,function(l){return this._invoke(f,l)})})}function gt(p,f){function l(v,h,E,D){var B=O(p[v],p,h);if(B.type!=="throw"){var q=B.arg,W=q.value;return W&&Ne(W)=="object"&&e.call(W,"__await")?f.resolve(W.__await).then(function(X){l("next",X,E,D)},function(X){l("throw",X,E,D)}):f.resolve(W).then(function(X){q.value=X,E(q)},function(X){return l("throw",X,E,D)})}D(B.arg)}var m;n(this,"_invoke",{value:function(h,E){function D(){return new f(function(B,q){l(h,E,B,q)})}return m=m?m.then(D,D):D()}})}function cn(p,f,l){var m="suspendedStart";return function(v,h){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw h;return{value:void 0,done:!0}}for(l.method=v,l.arg=h;;){var E=l.delegate;if(E){var D=Se(E,l);if(D){if(D===_)continue;return D}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(m==="suspendedStart")throw m="completed",l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);m="executing";var B=O(p,f,l);if(B.type==="normal"){if(m=l.done?"completed":"suspendedYield",B.arg===_)continue;return{value:B.arg,done:l.done}}B.type==="throw"&&(m="completed",l.method="throw",l.arg=B.arg)}}}function Se(p,f){var l=f.method,m=p.iterator[l];if(m===void 0)return f.delegate=null,l==="throw"&&p.iterator.return&&(f.method="return",f.arg=void 0,Se(p,f),f.method==="throw")||l!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+l+"' method")),_;var v=O(m,p.iterator,f.arg);if(v.type==="throw")return f.method="throw",f.arg=v.arg,f.delegate=null,_;var h=v.arg;return h?h.done?(f[p.resultName]=h.value,f.next=p.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,_):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,_)}function fn(p){var f={tryLoc:p[0]};1 in p&&(f.catchLoc=p[1]),2 in p&&(f.finallyLoc=p[2],f.afterLoc=p[3]),this.tryEntries.push(f)}function Lt(p){var f=p.completion||{};f.type="normal",delete f.arg,p.completion=f}function Nt(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(fn,this),this.reset(!0)}function kt(p){if(p||p===""){var f=p[i];if(f)return f.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var l=-1,m=function v(){for(;++l<p.length;)if(e.call(p,l))return v.value=p[l],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}throw new TypeError(Ne(p)+" is not iterable")}return I.prototype=j,n(N,"constructor",{value:j,configurable:!0}),n(j,"constructor",{value:I,configurable:!0}),I.displayName=s(j,u,"GeneratorFunction"),t.isGeneratorFunction=function(p){var f=typeof p=="function"&&p.constructor;return!!f&&(f===I||(f.displayName||f.name)==="GeneratorFunction")},t.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,j):(p.__proto__=j,s(p,u,"GeneratorFunction")),p.prototype=Object.create(N),p},t.awrap=function(p){return{__await:p}},ft(gt.prototype),s(gt.prototype,a,function(){return this}),t.AsyncIterator=gt,t.async=function(p,f,l,m,v){v===void 0&&(v=Promise);var h=new gt(c(p,f,l,m),v);return t.isGeneratorFunction(f)?h:h.next().then(function(E){return E.done?E.value:h.next()})},ft(N),s(N,u,"Generator"),s(N,i,function(){return this}),s(N,"toString",function(){return"[object Generator]"}),t.keys=function(p){var f=Object(p),l=[];for(var m in f)l.push(m);return l.reverse(),function v(){for(;l.length;){var h=l.pop();if(h in f)return v.value=h,v.done=!1,v}return v.done=!0,v}},t.values=kt,Nt.prototype={constructor:Nt,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(Lt),!f)for(var l in this)l.charAt(0)==="t"&&e.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function m(q,W){return E.type="throw",E.arg=f,l.next=q,W&&(l.method="next",l.arg=void 0),!!W}for(var v=this.tryEntries.length-1;v>=0;--v){var h=this.tryEntries[v],E=h.completion;if(h.tryLoc==="root")return m("end");if(h.tryLoc<=this.prev){var D=e.call(h,"catchLoc"),B=e.call(h,"finallyLoc");if(D&&B){if(this.prev<h.catchLoc)return m(h.catchLoc,!0);if(this.prev<h.finallyLoc)return m(h.finallyLoc)}else if(D){if(this.prev<h.catchLoc)return m(h.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return m(h.finallyLoc)}}}},abrupt:function(f,l){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&e.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var h=v;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=l&&l<=h.finallyLoc&&(h=null);var E=h?h.completion:{};return E.type=f,E.arg=l,h?(this.method="next",this.next=h.finallyLoc,_):this.complete(E)},complete:function(f,l){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&l&&(this.next=l),_},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===f)return this.complete(m.completion,m.afterLoc),Lt(m),_}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===f){var v=m.completion;if(v.type==="throw"){var h=v.arg;Lt(m)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,m){return this.delegate={iterator:kt(f),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=void 0),_}},t}H.exports=ke,H.exports.__esModule=!0,H.exports.default=H.exports});var Wt=Ut((aa,Fe)=>{var _t=Ue()();Fe.exports=_t;try{regeneratorRuntime=_t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=_t:Function("r","regeneratorRuntime = r")(_t)}});var Vo={};gn(Vo,{Buffer:()=>C,CanvasContext:()=>re,CommandBuffer:()=>pe,CommandEncoder:()=>le,ComputePass:()=>fe,ComputePipeline:()=>ue,Device:()=>$t,ExternalTexture:()=>ne,Framebuffer:()=>ae,RenderPass:()=>ce,RenderPipeline:()=>se,Resource:()=>y,Sampler:()=>ie,Shader:()=>oe,StatsManager:()=>Gt,Texture:()=>k,UniformBlock:()=>Bt,UniformBufferLayout:()=>Dt,UniformStore:()=>Kr,VERSION:()=>St,VertexArray:()=>de,assert:()=>st,cancelAnimationFrame:()=>un,cast:()=>Jr,checkProps:()=>Qr,decodeShaderAttributeType:()=>Et,decodeShaderUniformType:()=>Ct,decodeTextureFormat:()=>qr,decodeVertexFormat:()=>ht,deepEqual:()=>Mt,fillArray:()=>Gr,formatCompilerLog:()=>$r,formatValue:()=>ge,getAttributeInfosFromLayouts:()=>he,getScratchArray:()=>zr,getScratchArrayBuffer:()=>dt,glsl:()=>Ho,isNumberArray:()=>Q,isObjectEmpty:()=>Ge,isPowerOfTwo:()=>ze,isTypedArray:()=>Ht,loadFile:()=>en,loadImage:()=>nn,loadImageBitmap:()=>rn,loadScript:()=>on,log:()=>S,luma:()=>xt,makeRandomNumberGenerator:()=>Oe,mergeShaderLayout:()=>Lr,random:()=>an,requestAnimationFrame:()=>sn,setPathPrefix:()=>tn,stubRemovedMethods:()=>Zr,uid:()=>it});function Ft(t){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let r=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,e=t||r;return!!(e&&e.indexOf("Electron")>=0)}function R(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ft()}var vn=globalThis.self||globalThis.window||globalThis.global,tt=globalThis.window||globalThis.self||globalThis.global,bn=globalThis.document||{},$=globalThis.process||{},wn=globalThis.console,Xo=globalThis.navigator||{};var vt=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Zo=R();function On(t){try{let r=window[t],e="__storage_test__";return r.setItem(e,e),r.removeItem(e),r}catch{return null}}var bt=class{constructor(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=On(n),this.id=r,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let r={};if(this.storage){let e=this.storage.getItem(this.id);r=e?JSON.parse(e):{}}return Object.assign(this.config,r),this}};function xe(t){let r;return t<10?r="".concat(t.toFixed(2),"ms"):t<100?r="".concat(t.toFixed(1),"ms"):t<1e3?r="".concat(t.toFixed(0),"ms"):r="".concat((t/1e3).toFixed(2),"s"),r}function Te(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,e=Math.max(r-t.length,0);return"".concat(" ".repeat(e)).concat(t)}function wt(t,r,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(e=Math.min(e,n/t.width));let i=t.width*e,a=t.height*e,u=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(o,");"),"background-size:".concat(i,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),u]}var Ot;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ot||(Ot={}));var Sn=10;function Ae(t){return typeof t!="string"?t:(t=t.toUpperCase(),Ot[t]||Ot.WHITE)}function Ee(t,r,e){if(!R&&typeof t=="string"){if(r){let n=Ae(r);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(e){let n=Ae(e);t="\x1B[".concat(n+Sn,"m").concat(t,"\x1B[49m")}}return t}function je(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],e=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(e),o=t;for(let i of n){let a=o[i];typeof a=="function"&&(r.find(u=>i===u)||(o[i]=a.bind(t)))}}function et(t,r){if(!t)throw new Error(r||"Assertion failed")}function J(){let t;if(R()&&tt.performance){var r,e;t=tt===null||tt===void 0||(r=tt.performance)===null||r===void 0||(e=r.now)===null||e===void 0?void 0:e.call(r)}else if("hrtime"in $){var n;let o=$===null||$===void 0||(n=$.hrtime)===null||n===void 0?void 0:n.call($);t=o[0]*1e3+o[1]/1e6}else t=Date.now();return t}var rt={debug:R()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},_n={enabled:!0,level:0};function L(){}var Ce={},Re={once:!0},K=class{constructor(){let{id:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=vt,this._startTs=J(),this._deltaTs=J(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new bt("__probe-".concat(this.id,"__"),_n),this.timeStamp("".concat(this.id," started")),je(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((J()-this._startTs).toPrecision(10))}getDelta(){return Number((J()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,e){this._storage.setConfiguration({[r]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,e){et(r,e)}warn(r){return this._getLogFunction(0,r,rt.warn,arguments,Re)}error(r){return this._getLogFunction(0,r,rt.error,arguments)}deprecated(r,e){return this.warn("`".concat(r,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(r,e){return this.error("`".concat(r,"` has been removed. Use `").concat(e,"` instead"))}probe(r,e){return this._getLogFunction(r,e,rt.log,arguments,{time:!0,once:!0})}log(r,e){return this._getLogFunction(r,e,rt.debug,arguments)}info(r,e){return this._getLogFunction(r,e,console.info,arguments)}once(r,e){return this._getLogFunction(r,e,rt.debug||rt.info,arguments,Re)}table(r,e,n){return e?this._getLogFunction(r,e,console.table||L,n&&[n],{tag:An(e)}):L}image(r){let{logLevel:e,priority:n,image:o,message:i="",scale:a=1}=r;return this._shouldLog(e||n)?R()?Tn({image:o,message:i,scale:a}):xn({image:o,message:i,scale:a}):L}time(r,e){return this._getLogFunction(r,e,console.time?console.time:console.info)}timeEnd(r,e){return this._getLogFunction(r,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,e){return this._getLogFunction(r,e,console.timeStamp||L)}group(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=De({logLevel:r,message:e,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(r,e,Object.assign({},n,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||L)}withGroup(r,e,n){this.group(r,e)();try{n()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=Be(r)}_getLogFunction(r,e,n,o,i){if(this._shouldLog(r)){i=De({logLevel:r,message:e,args:o,opts:i}),n=n||i.method,et(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=J();let a=i.tag||i.message;if(i.once&&a)if(!Ce[a])Ce[a]=J();else return L;return e=Pn(this.id,i.message,i),n.bind(console,e,...i.args)}return L}};K.VERSION=vt;function Be(t){if(!t)return 0;let r;switch(typeof t){case"number":r=t;break;case"object":r=t.logLevel||t.priority||0;break;default:return 0}return et(Number.isFinite(r)&&r>=0),r}function De(t){let{logLevel:r,message:e}=t;t.logLevel=Be(r);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==e;);switch(typeof r){case"string":case"function":e!==void 0&&n.unshift(e),t.message=r;break;case"object":Object.assign(t,r);break;default:}typeof t.message=="function"&&(t.message=t.message());let o=typeof t.message;return et(o==="string"||o==="object"),Object.assign(t,{args:n},t.opts)}function Pn(t,r,e){if(typeof r=="string"){let n=e.time?Te(xe(e.total)):"";r=e.time?"".concat(t,": ").concat(n," ").concat(r):"".concat(t,": ").concat(r),r=Ee(r,e.color,e.background)}return r}function xn(t){let{image:r,message:e="",scale:n=1}=t;return console.warn("removed"),L}function Tn(t){let{image:r,message:e="",scale:n=1}=t;if(typeof r=="string"){let i=new Image;return i.onload=()=>{let a=wt(i,e,n);console.log(...a)},i.src=r,L}let o=r.nodeName||"";if(o.toLowerCase()==="img")return console.log(...wt(r,e,n)),L;if(o.toLowerCase()==="canvas"){let i=new Image;return i.onload=()=>console.log(...wt(i,e,n)),i.src=r.toDataURL(),L}return L}function An(t){for(let r in t)for(let e in t[r])return e||"untitled";return"empty"}var _i=new K({id:"@probe.gl/log"});var S=new K({id:"luma.gl"});function M(t){return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},M(t)}function zt(t,r){if(M(t)!=="object"||t===null)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var n=e.call(t,r||"default");if(M(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function lt(t){var r=zt(t,"string");return M(r)==="symbol"?r:String(r)}function Ie(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lt(n.key),n)}}function d(t,r,e){return r&&Ie(t.prototype,r),e&&Ie(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function pt(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();t=r[0]*1e3+r[1]/1e6}else t=Date.now();return t}var Z=class{constructor(r,e){this.name=void 0,this.type=void 0,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=r,this.type=e,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(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=pt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(pt()-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 nt=class{constructor(r){this.id=void 0,this.stats={},this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:r,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let e of Object.values(this.stats))r(e)}getTable(){let r={};return this.forEach(e=>{r[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),r}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(r){let{name:e,type:n}=r,o=this.stats[e];return o||(r instanceof Z?o=r:o=new Z(e,n),this.stats[e]=o),o}};var Gt=function(){function t(){g(this,t),this.stats=new Map}var r=t.prototype;return r.getStats=function(n){return this.get(n)},r.get=function(n){return this.stats.has(n)||this.stats.set(n,new nt({id:n})),this.stats.get(n)},d(t)}(),ot=new Gt;function En(){var t=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",r="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==t)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(t));return globalThis.luma||(R()&&S.log(1,"luma.gl ".concat(t," - ").concat(r))(),globalThis.luma=globalThis.luma||{VERSION:t,version:t,log:S,stats:ot}),t}var St=En();function Ht(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)?t:null}function Q(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number"?t:null:Ht(t)}function w(t,r,e){return r=lt(r),r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Me(t,r,e,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){e(c);return}u.done?r(s):Promise.resolve(s).then(n,o)}function Y(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(s){Me(i,n,o,a,u,"next",s)}function u(s){Me(i,n,o,a,u,"throw",s)}a(void 0)})}}var Jt=Pe(Wt(),1);var Kt={};function it(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Kt[t]=Kt[t]||1;var r=Kt[t]++;return"".concat(t,"-").concat(r)}function ze(t){return t>0&&(t&t-1)===0}function Ge(t){var r=!0;for(var e in t){r=!1;break}return r}function mt(t,r){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},mt(t,r)}function P(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&mt(t,r)}function Yt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t,r){if(r&&(M(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yt(t)}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(t)}function He(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function jn(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?He(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):He(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var y=function(){function t(e,n,o){if(g(this,t),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!e)throw new Error("no device");this._device=e,this.props=Cn(n,o);var i=this.props.id!=="undefined"?this.props.id:it(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}var r=t.prototype;return r.destroy=function(){this.destroyResource()},r.delete=function(){return this.destroy(),this},r.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},r.getProps=function(){return this.props},r.attachResource=function(n){this._attachedResources.add(n)},r.detachResource=function(n){this._attachedResources.delete(n)},r.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},r.destroyAttachedResources=function(){for(var n=0,o=Object.values(this._attachedResources);n<o.length;n++){var i=o[n];i.destroy()}this._attachedResources=new Set},r.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},r.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("".concat(o,"s Active")).decrementCount()},r.trackAllocatedMemory=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").addCount(n),i.get("".concat(o," Memory")).addCount(n),this.allocatedBytes=n},r.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").subtractCount(this.allocatedBytes),o.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},r.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(o,"s Created")).incrementCount(),n.get("".concat(o,"s Active")).incrementCount()},d(t)}();y.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Cn(t,r){var e=jn({},r);for(var n in t)t[n]!==void 0&&(e[n]=t[n]);return e}var We;function Ve(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function qt(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ve(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ve(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Rn(t){var r=Dn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Dn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}We=Symbol.toStringTag;var C=function(t){P(e,t);var r=Rn(e);function e(o,i){var a;g(this,e);var u=qt({},i);return(i.usage||0)&e.INDEX&&!i.indexType&&(i.data instanceof Uint32Array?u.indexType="uint32":i.data instanceof Uint16Array&&(u.indexType="uint16")),a=r.call(this,o,u,e.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=i.usage||0,a.indexType=u.indexType,a}var n=e.prototype;return n.write=function(i,a){throw new Error("not implemented")},n.readAsync=function(i,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},d(e,[{key:We,get:function(){return"Buffer"}}]),e}(y);C.defaultProps=qt(qt({},y.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});C.MAP_READ=1;C.MAP_WRITE=2;C.COPY_SRC=4;C.COPY_DST=8;C.INDEX=16;C.VERTEX=32;C.UNIFORM=64;C.STORAGE=128;C.INDIRECT=256;C.QUERY_RESOLVE=512;var Ye;function Ke(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Xt(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ke(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Pt={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(S.get("debug")),break:[],gl:null};Ye=Symbol.toStringTag;var $t=function(){function t(e){g(this,t),this.id=void 0,this.statsManager=ot,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Xt(Xt({},Pt),e),this.id=this.props.id||it(this[Symbol.toStringTag].toLowerCase())}var r=t.prototype;return r.loseDevice=function(){return!1},r.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},r.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},r.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},r._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var o=Xt({},n);return(n.usage||0)&C.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?o.indexType="uint32":n.data instanceof Uint16Array?o.indexType="uint16":S.warn("indices buffer content must be of integer type")()),o},d(t,[{key:Ye,get:function(){return"Device"}}]),t}();$t.VERSION=St;function qe(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Xe(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):qe(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Bn(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=In(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
8
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function In(t,r){if(t){if(typeof t=="string")return $e(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return $e(t,r)}}function $e(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var at=new Map,xt=function(){function t(){g(this,t)}return t.registerDevices=function(e){var n=Bn(e),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;st(i.type&&i.isSupported&&i.create),at.set(i.type,i)}}catch(a){n.e(a)}finally{n.f()}},t.getAvailableDevices=function(){return Array.from(at).map(function(e){return e.type})},t.getSupportedDevices=function(){return Array.from(at).filter(function(e){return e.isSupported()}).map(function(e){return e.type})},t.setDefaultDeviceProps=function(e){Object.assign(Pt,e)},t.createDevice=function(){var r=Y(Jt.default.mark(function n(){var o,i,a=arguments;return Jt.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:o=a.length>0&&a[0]!==void 0?a[0]:{},o=Xe(Xe({},Pt),o),o.gl&&(o.type="webgl"),s.t0=o.type,s.next=s.t0==="webgpu"?6:s.t0==="webgl"||s.t0==="webgl1"||s.t0==="webgl2"?12:s.t0==="best-available"?18:24;break;case 6:if(i=at.get("webgpu"),!i){s.next=11;break}return s.next=10,i.create(o);case 10:return s.abrupt("return",s.sent);case 11:return s.abrupt("break",24);case 12:if(i=at.get("webgl"),!i){s.next=17;break}return s.next=16,i.create(o);case 16:return s.abrupt("return",s.sent);case 17:return s.abrupt("break",24);case 18:if(i=at.get("webgl"),!(i&&i.isSupported())){s.next=23;break}return s.next=22,i.create(o);case 22:return s.abrupt("return",s.sent);case 23:return s.abrupt("break",24);case 24:throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.");case 25:case"end":return s.stop()}},n)}));function e(){return r.apply(this,arguments)}return e}(),d(t)}();xt.stats=ot;xt.log=S;function Zt(t){if(Array.isArray(t))return t}function Qt(t,r){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(e=e.call(t)).next,r===0){if(Object(e)!==e)return;s=!1}else for(;!(s=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);s=!0);}catch(O){c=!0,o=O}finally{try{if(!s&&e.return!=null&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}function Tt(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function te(t,r){if(t){if(typeof t=="string")return Tt(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Tt(t,r)}}function ee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(t,r){return Zt(t)||Qt(t,r)||te(t,r)||ee()}function Mn(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Ln(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function Ln(t,r){if(t){if(typeof t=="string")return Je(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Je(t,r)}}function Je(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Ze(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Qe(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ze(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ze(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Nn=R()&&typeof document<"u",At=function(){return Nn&&document.readyState==="complete"},kn={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},re=function(){function t(e){var n=this;if(g(this,t),this.device=void 0,this.id=void 0,this.props=void 0,this.canvas=void 0,this.htmlCanvas=void 0,this.offscreenCanvas=void 0,this.type=void 0,this.width=1,this.height=1,this.resizeObserver=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this.props=Qe(Qe({},kn),e),e=this.props,!R()){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=zn(e.canvas):this.canvas=e.canvas;else{var o,i,a=Gn(e),u=Fn(((o=e)===null||o===void 0?void 0:o.container)||null);u.insertBefore(a,u.firstChild),this.canvas=a,(i=e)!==null&&i!==void 0&&i.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(function(s){var c=Mn(s),O;try{for(c.s();!(O=c.n()).done;){var _=O.value;_.target===n.canvas&&n.update()}}catch(T){c.e(T)}finally{c.f()}}),this.resizeObserver.observe(this.canvas))}var r=t.prototype;return r.getDevicePixelRatio=function(n){if(typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(n=n===void 0?this.props.useDevicePixels:n,!n||n<=0))return 1;if(n===!0){var o=typeof window<"u"&&window.devicePixelRatio;return o||1}return n},r.getPixelSize=function(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":var n=this.getDevicePixelRatio(),o=this.canvas;return o.parentElement?[o.clientWidth*n,o.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},r.getAspect=function(){var n=this.getPixelSize(),o=A(n,2),i=o[0],a=o[1];return i/a},r.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),o=A(n,1),i=o[0],a=this._canvasSizeInfo.clientWidth;return a?i/a:1}catch{return 1}},r.cssToDevicePixels=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),u=A(a,2),s=u[0],c=u[1];return Hn(n,i,s,c,o)},r.setDevicePixelRatio=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var i="width"in o?o.width:this.htmlCanvas.clientWidth,a="height"in o?o.height:this.htmlCanvas.clientHeight;(!i||!a)&&(S.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,i=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var u=this._canvasSizeInfo;if(u.clientWidth!==i||u.clientHeight!==a||u.devicePixelRatio!==n){var s=n,c=Math.floor(i*s),O=Math.floor(a*s);this.htmlCanvas.width=c,this.htmlCanvas.height=O;var _=this.getDrawingBufferSize(),T=A(_,2),I=T[0],j=T[1];(I!==c||j!==O)&&(s=Math.min(I/i,j/a),this.htmlCanvas.width=Math.floor(i*s),this.htmlCanvas.height=Math.floor(a*s),S.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=i,this._canvasSizeInfo.clientHeight=a,this._canvasSizeInfo.devicePixelRatio=n}}},r.getDrawingBufferSize=function(){var n=this.device.gl;if(!n)throw new Error("canvas size");return[n.drawingBufferWidth,n.drawingBufferHeight]},r._setAutoCreatedCanvasId=function(n){var o;((o=this.htmlCanvas)===null||o===void 0?void 0:o.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},d(t,null,[{key:"isPageLoaded",get:function(){return At()}}]),t}();re.pageLoaded=Un();function Un(){return At()||typeof window>"u"?Promise.resolve():new Promise(function(t){window.addEventListener("load",function(){return t()})})}function Fn(t){if(typeof t=="string"){var r=document.getElementById(t);if(!r&&!At())throw new Error("Accessing '".concat(t,"' before page was loaded"));if(!r)throw new Error("".concat(t," is not an HTML element"));return r}else if(t)return t;return document.body}function zn(t){var r=document.getElementById(t);if(!r&&!At())throw new Error("Accessing '".concat(t,"' before page was loaded"));if(!(r instanceof HTMLCanvasElement))throw new Error("'".concat(r,"' is not a canvas element"));return r}function Gn(t){var r=t.width,e=t.height,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=r||1,n.height=e||1,n.style.width=Number.isFinite(r)?"".concat(r,"px"):"100%",n.style.height=Number.isFinite(e)?"".concat(e,"px"):"100%",n}function Hn(t,r,e,n,o){var i=t,a=tr(i[0],r,e),u=er(i[1],r,n,o),s=tr(i[0]+1,r,e),c=s===e-1?s:s-1;s=er(i[1]+1,r,n,o);var O;return o?(s=s===0?s:s+1,O=u,u=s):O=s===n-1?s:s-1,{x:a,y:u,width:Math.max(c-a+1,1),height:Math.max(O-u+1,1)}}function tr(t,r,e){var n=Math.min(Math.round(t*r),e-1);return n}function er(t,r,e,n){return n?Math.max(0,e-1-Math.round(t*r)):Math.min(Math.round(t*r),e-1)}var or;function rr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function nr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?rr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):rr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Vn(t){var r=Wn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Wn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}or=Symbol.toStringTag;var k=function(t){P(e,t);var r=Vn(e);function e(n,o){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.defaultProps;return g(this,e),i=r.call(this,n,o,a),i.dimension=void 0,i.format=void 0,i.width=void 0,i.height=void 0,i.depth=void 0,i.sampler=void 0,i.dimension=i.props.dimension,i.format=i.props.format,i.width=i.props.width,i.height=i.props.height,i.depth=i.props.depth,i}return d(e,[{key:or,get:function(){return"Texture"}}]),e}(y);k.defaultProps=nr(nr({},y.defaultProps),{},{data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,sampler:{},compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0});k.COPY_SRC=1;k.COPY_DST=2;k.TEXTURE_BINDING=4;k.STORAGE_BINDING=8;k.RENDER_ATTACHMENT=16;var sr;function ir(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function ar(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ir(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ir(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Kn(t){var r=Yn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Yn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}sr=Symbol.toStringTag;var ne=function(t){P(e,t);var r=Kn(e);function e(n,o){return g(this,e),r.call(this,n,o,e.defaultProps)}return d(e,[{key:sr,get:function(){return"ExternalTexture"}}]),e}(y);ne.defaultProps=ar(ar({},y.defaultProps),{},{source:null,colorSpace:"srgb"});var fr;function ur(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function cr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ur(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ur(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function qn(t){var r=Xn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Xn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}fr=Symbol.toStringTag;var oe=function(t){P(e,t);var r=qn(e);function e(n,o){var i;return g(this,e),i=r.call(this,n,o,e.defaultProps),i.stage=void 0,i.source=void 0,i.stage=i.props.stage,i.source=i.props.source,i}return d(e,[{key:fr,get:function(){return"Shader"}}]),e}(y);oe.defaultProps=cr(cr({},y.defaultProps),{},{stage:"vertex",source:"",sourceMap:null,language:"auto",shaderType:0});var mr;function lr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function pr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?lr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):lr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function $n(t){var r=Jn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Jn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}mr=Symbol.toStringTag;var ie=function(t){P(e,t);var r=$n(e);function e(n,o){return g(this,e),r.call(this,n,o,e.defaultProps)}return d(e,[{key:mr,get:function(){return"Sampler"}}]),e}(y);ie.defaultProps=pr(pr({},y.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 dr;function hr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function ut(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?hr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):hr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Zn(t){var r=Qn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Qn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}dr=Symbol.toStringTag;var ae=function(t){P(e,t);var r=Zn(e);function e(o){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return g(this,e),i=r.call(this,o,a,e.defaultProps),i.width=void 0,i.height=void 0,i.colorAttachments=[],i.depthStencilAttachment=null,i.width=i.props.width,i.height=i.props.height,i}var n=e.prototype;return n.resize=function(i){var a=!i;if(i){var u=Array.isArray(i)?i:[i.width,i.height],s=A(u,2),c=s[0],O=s[1];a=a||O!==this.height||c!==this.width,this.width=c,this.height=O}a&&(S.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(this.width,"x").concat(this.height))(),this.resizeAttachments(this.width,this.height))},n.autoCreateAttachmentTextures=function(){var i=this;if(this.colorAttachments=this.props.colorAttachments.map(function(u){if(typeof u=="string"){var s=i.createColorTexture(u);return i.attachResource(s),s}return u}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){var a=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(a),this.depthStencilAttachment=a}else this.depthStencilAttachment=this.props.depthStencilAttachment},n.createColorTexture=function(i){return this.device.createTexture({id:"color-attachment",usage:k.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.createDepthStencilTexture=function(i){return this.device.createTexture({id:"depth-stencil-attachment",usage:k.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.resizeAttachments=function(i,a){for(var u=0;u<this.colorAttachments.length;++u)if(this.colorAttachments[u]){var s=this.device._createTexture(ut(ut({},this.colorAttachments[u].props),{},{width:i,height:a}));this.destroyAttachedResource(this.colorAttachments[u]),this.colorAttachments[u]=s,this.attachResource(s)}if(this.depthStencilAttachment){var c=this.device._createTexture(ut(ut({},this.depthStencilAttachment.props),{},{width:i,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=c,this.attachResource(c)}},d(e,[{key:dr,get:function(){return"Framebuffer"}}]),e}(y);ae.defaultProps=ut(ut({},y.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var vr;function gr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function yr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?gr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):gr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function to(t){var r=eo();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function eo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}vr=Symbol.toStringTag;var se=function(t){P(e,t);var r=to(e);function e(n,o){var i;return g(this,e),i=r.call(this,n,o,e.defaultProps),i.hash="",i.vs=void 0,i.fs=void 0,i.shaderLayout=void 0,i.bufferLayout=void 0,i.shaderLayout=i.props.shaderLayout,i.bufferLayout=i.props.bufferLayout||[],i}return d(e,[{key:vr,get:function(){return"RenderPipeline"}}]),e}(y);se.defaultProps=yr(yr({},y.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});var Or;function br(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function wr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?br(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):br(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ro(t){var r=no();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function no(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Or=Symbol.toStringTag;var ue=function(t){P(e,t);var r=ro(e);function e(n,o){var i;return g(this,e),i=r.call(this,n,o,e.defaultProps),i.hash="",i}return d(e,[{key:Or,get:function(){return"ComputePipeline"}}]),e}(y);ue.defaultProps=wr(wr({},y.defaultProps),{},{cs:void 0,csEntryPoint:void 0,csConstants:{},shaderLayout:[]});var Pr;function Sr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function _r(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Sr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Sr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function oo(t){var r=io();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function io(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Pr=Symbol.toStringTag;var ce=function(t){P(e,t);var r=oo(e);function e(n,o){return g(this,e),r.call(this,n,o,e.defaultProps)}return d(e,[{key:Pr,get:function(){return"RenderPass"}}]),e}(y);ce.defaultProps=_r(_r({},y.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});var Tr;function xr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function ao(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?xr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):xr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function so(t){var r=uo();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function uo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Tr=Symbol.toStringTag;var fe=function(t){P(e,t);var r=so(e);function e(n,o){return g(this,e),r.call(this,n,o,y.defaultProps)}return d(e,[{key:Tr,get:function(){return"ComputePass"}}]),e}(y);fe.defaultProps=ao({},y.defaultProps);var jr;function Ar(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Er(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ar(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ar(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function co(t){var r=fo();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function fo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}jr=Symbol.toStringTag;var le=function(t){P(e,t);var r=co(e);function e(o,i){return g(this,e),r.call(this,o,i,e.defaultProps)}var n=e.prototype;return n.pushDebugGroup=function(i){},n.popDebugGroup=function(){},n.insertDebugMarker=function(i){},d(e,[{key:jr,get:function(){return"CommandEncoder"}}]),e}(y);le.defaultProps=Er(Er({},y.defaultProps),{},{measureExecutionTime:void 0});var Rr;function Cr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function lo(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Cr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Cr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function po(t){var r=mo();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function mo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Rr=Symbol.toStringTag;var pe=function(t){P(e,t);var r=po(e);function e(n){return g(this,e),r.call(this,n,e.defaultProps)}return d(e,[{key:Rr,get:function(){return"CommandBuffer"}}]),e}(y);pe.defaultProps=lo({},y.defaultProps);function Et(t){var r=A(go[t],2),e=r[0],n=r[1],o=e==="i32"||e==="u32",i=e!=="u32",a=yo[e]*n,u=ho(e,n);return{dataType:e,components:n,defaultVertexFormat:u,byteLength:a,integer:o,signed:i}}function ho(t,r){var e;switch(t){case"f32":e="float32";break;case"i32":e="sint32";break;case"u32":e="uint32";break;case"f16":return r<=2?"float16x2":"float16x4"}return r===1?e:"".concat(e,"x").concat(r)}var go={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]},yo={f32:4,f16:2,i32:4,u32:4};function jt(t){var r=Dr[t],e=vo(r),n=t.includes("norm"),o=!n&&!t.startsWith("float"),i=t.startsWith("s");return{dataType:Dr[t],byteLength:e,integer:o,signed:i,normalized:n}}function vo(t){var r=bo[t];return r}var Dr={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},bo={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function ht(t){var r;t.endsWith("-webgl")&&(t.replace("-webgl",""),r=!0);var e=t.split("x"),n=A(e,2),o=n[0],i=n[1],a=o,u=i?parseInt(i):1,s=jt(a),c={type:a,components:u,byteLength:s.byteLength*u,integer:s.integer,signed:s.signed,normalized:s.normalized};return r&&(c.webglOnly=!0),c}function Br(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function me(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Br(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Br(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ct(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=wo(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function wo(t,r){if(t){if(typeof t=="string")return Ir(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ir(t,r)}}function Ir(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function he(t,r){var e={},n=ct(t.attributes),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;e[i.name]=Oo(t,r,i.name)}}catch(a){n.e(a)}finally{n.f()}return e}function Mr(t,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=he(t,r),o=new Array(e).fill(null),i=0,a=Object.values(n);i<a.length;i++){var u=a[i];o[u.location]=u}return o}function Oo(t,r,e){var n=So(t,e),o=_o(r,e);if(!n)return null;var i=Et(n.type),a=o?.vertexFormat||i.defaultVertexFormat,u=ht(a);return{attributeName:o?.attributeName||n.name,bufferName:o?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:i.dataType,shaderComponents:i.components,vertexFormat:a,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:i.integer,stepMode:o?.stepMode||n.stepMode,byteOffset:o?.byteOffset||0,byteStride:o?.byteStride||0}}function So(t,r){var e=t.attributes.find(function(n){return n.name===r});return e||S.warn('shader layout attribute "'.concat(r,'" not present in shader')),e||null}function _o(t,r){Po(t);var e=xo(t,r);return e||(e=To(t,r),e)?e:(S.warn('layout for attribute "'.concat(r,'" not present in buffer layout')),null)}function Po(t){var r=ct(t),e;try{for(r.s();!(e=r.n()).done;){var n=e.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&S.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(o){r.e(o)}finally{r.f()}}function xo(t,r){var e=ct(t),n;try{for(e.s();!(n=e.n()).done;){var o=n.value;if(o.format&&o.name===r)return{attributeName:o.name,bufferName:r,stepMode:o.stepMode,vertexFormat:o.format,byteOffset:0,byteStride:o.byteStride||0}}}catch(i){e.e(i)}finally{e.f()}return null}function To(t,r){var e=ct(t),n;try{for(e.s();!(n=e.n()).done;){var o,i=n.value,a=i.byteStride;if(typeof i.byteStride!="number"){var u=ct(i.attributes||[]),s;try{for(u.s();!(s=u.n()).done;){var c=s.value,O=ht(c.format);a+=O.byteLength}}catch(T){u.e(T)}finally{u.f()}}var _=(o=i.attributes)===null||o===void 0?void 0:o.find(function(T){return T.attribute===r});if(_)return{attributeName:_.attribute,bufferName:i.name,stepMode:i.stepMode,vertexFormat:_.format,byteOffset:_.byteOffset,byteStride:a}}}catch(T){e.e(T)}finally{e.f()}return null}function Lr(t,r){var e=me(me({},t),{},{attributes:t.attributes.map(function(a){return me({},a)})}),n=ct(r?.attributes||[]),o;try{var i=function(){var u=o.value,s=e.attributes.find(function(c){return c.name===u.name});s?(s.type=u.type||s.type,s.stepMode=u.stepMode||s.stepMode):S.warn("shader layout attribute ".concat(u.name," not present in shader"))};for(n.s();!(o=n.n()).done;)i()}catch(a){n.e(a)}finally{n.f()}return e}var Ur;function Nr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function kr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Nr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Nr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Ao(t){var r=Eo();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Eo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Ur=Symbol.toStringTag;var de=function(t){P(e,t);var r=Ao(e);function e(n,o){var i;return g(this,e),i=r.call(this,n,o,e.defaultProps),i.maxVertexAttributes=void 0,i.attributeInfos=void 0,i.indexBuffer=null,i.attributes=void 0,i.maxVertexAttributes=n.limits.maxVertexAttributes,i.attributes=new Array(i.maxVertexAttributes).fill(null),i.attributeInfos=Mr(o.renderPipeline.shaderLayout,o.renderPipeline.bufferLayout,i.maxVertexAttributes),i}return d(e,[{key:Ur,get:function(){return"VertexArray"}}]),e}(y);de.defaultProps=kr(kr({},y.defaultProps),{},{renderPipeline:null});function st(t,r){if(!t)throw new Error(r||"luma.gl: assertion failed.")}var jo={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 Ct(t){var r=jo[t];return st(t),r}function Fr(t,r){switch(r){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}var Rt;function dt(t){return(!Rt||Rt.byteLength<t)&&(Rt=new ArrayBuffer(t)),Rt}function zr(t,r){var e=dt(t.BYTES_PER_ELEMENT*r);return new t(e,0,r)}function Gr(t){for(var r=t.target,e=t.source,n=t.start,o=n===void 0?0:n,i=t.count,a=i===void 0?1:i,u=e.length,s=a*u,c=0,O=o;c<u;c++)r[O++]=e[c];for(;c<s;)c<s-c?(r.copyWithin(o+c,o,o+c),c*=2):(r.copyWithin(o+c,o,o+s-c),c=s);return t.target}var Hr=1024,Dt=function(){function t(e){g(this,t),this.layout={},this.byteLength=void 0;for(var n=0,o=0,i=Object.entries(e);o<i.length;o++){var a=A(i[o],2),u=a[0],s=a[1],c=Ct(s),O=c.type,_=c.components;n=Fr(n,_);var T=n;n+=_,this.layout[u]={type:O,size:_,offset:T}}n+=(4-n%4)%4;var I=n*4;this.byteLength=Math.max(I,Hr)}var r=t.prototype;return r.getData=function(n){for(var o=Math.max(this.byteLength,Hr),i=dt(o),a={i32:new Int32Array(i),u32:new Uint32Array(i),f32:new Float32Array(i),f16:new Uint16Array(i)},u=0,s=Object.entries(n);u<s.length;u++){var c=A(s[u],2),O=c[0],_=c[1],T=this.layout[O];if(!T){S.warn("Supplied uniform value ".concat(O," not present in uniform block layout"))();continue}var I=T.type,j=T.size,U=T.offset,z=a[I];if(j===1){if(typeof _!="number"&&typeof _!="boolean"){S.warn("Supplied value for single component uniform ".concat(O," is not a number: ").concat(_))();continue}z[U]=Number(_)}else{var F=Q(_);if(!F){S.warn("Supplied value for multi component / array uniform ".concat(O," is not a numeric array: ").concat(_))();continue}z.set(F,U)}}return new Uint8Array(i)},r.has=function(n){return Boolean(this.layout[n])},r.get=function(n){var o=this.layout[n];return o},d(t)}();function Vr(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(t!==r)return!1;var n=Q(t);if(!n)return!1;var o=Q(r);if(o&&n.length===o.length){for(var i=0;i<n.length;++i)if(o[i]!==n[i])return!1}return!0}function Co(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Ro(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function Ro(t,r){if(t){if(typeof t=="string")return Wr(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Wr(t,r)}}function Wr(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Bt=function(){function t(e){if(g(this,t),this.name=void 0,this.uniforms={},this.modifiedUniforms={},this.modified=!0,this.bindingLayout={},this.needsRedraw="initialized",this.name=e?.name,e!=null&&e.name&&e!==null&&e!==void 0&&e.shaderLayout){var n,o=e==null||(n=e.shaderLayout.bindings)===null||n===void 0?void 0:n.find(function(c){return c.type==="uniform"&&c.name===e?.name});if(!o)throw new Error(e?.name);var i=o,a=Co(i.uniforms||[]),u;try{for(a.s();!(u=a.n()).done;){var s=u.value;this.bindingLayout[s.name]=s}}catch(c){a.e(c)}finally{a.f()}}}var r=t.prototype;return r.setUniforms=function(n){for(var o=0,i=Object.entries(n);o<i.length;o++){var a=A(i[o],2),u=a[0],s=a[1];this._setUniform(u,s),this.needsRedraw||this.setNeedsRedraw("".concat(this.name,".").concat(u,"=").concat(s))}},r.setNeedsRedraw=function(n){this.needsRedraw=this.needsRedraw||n},r.getAllUniforms=function(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}},r._setUniform=function(n,o){Vr(this.uniforms[n],o)||(this.uniforms[n]=o,this.modifiedUniforms[n]=!0,this.modified=!0)},d(t)}();var Kr=function(){function t(e){g(this,t),this.uniformBlocks=void 0,this.uniformBufferLayouts=void 0,this.uniformBuffers=void 0,this.uniformBlocks={},this.uniformBufferLayouts={},this.uniformBuffers={};for(var n=0,o=Object.entries(e);n<o.length;n++){var i=A(o[n],2),a=i[0],u=i[1],s=a,c=new Dt(u.uniformTypes||{});this.uniformBufferLayouts[s]=c;var O=new Bt({name:a});O.setUniforms(u.defaultUniforms||{}),this.uniformBlocks[s]=O}}var r=t.prototype;return r.destroy=function(){for(var n=0,o=Object.values(this.uniformBuffers);n<o.length;n++){var i=o[n];i.destroy()}},r.setUniforms=function(n){for(var o=0,i=Object.entries(n);o<i.length;o++){var a=A(i[o],2),u=a[0],s=a[1];this.uniformBlocks[u].setUniforms(s)}this.updateUniformBuffers()},r.getUniformBufferByteLength=function(n){return this.uniformBufferLayouts[n].byteLength},r.getUniformBufferData=function(n){var o=this.uniformBlocks[n].getAllUniforms();return this.uniformBufferLayouts[n].getData(o)},r.getManagedUniformBuffer=function(n,o){if(!this.uniformBuffers[o]){var i=this.getUniformBufferByteLength(o),a=n.createBuffer({usage:C.UNIFORM,byteLength:i});this.uniformBuffers[o]=a}return this.updateUniformBuffers(),this.uniformBuffers[o]},r.updateUniformBuffer=function(n){var o=this.uniformBlocks[n],i=this.uniformBuffers[n],a=!1;if(i&&o.needsRedraw){a||(a=o.needsRedraw);var u=this.getUniformBufferData(n),s=this.uniformBuffers[n];s.write(u);var c=this.uniformBlocks[n].getAllUniforms();S.log(4,"Writing to uniform buffer ".concat(String(n)),u,c)()}return a},r.updateUniformBuffers=function(){for(var n=!1,o=0,i=Object.keys(this.uniformBlocks);o<i.length;o++){var a=i[o];n||(n=this.updateUniformBuffer(a))}return n&&S.log(3,"UniformStore.updateUniformBuffers(): ".concat(n))(),n},d(t)}();function Yr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Do(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Yr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Yr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Bo=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function qr(t){var r=Bo.exec(t);if(r){var e=A(r,6),n=e[1],o=e[2],i=e[3],a=e[4],u=e[5];if(n){var s="".concat(i).concat(o),c=jt(s);return Do({format:n,components:0,srgb:a==="-srgb",unsized:u==="-unsized",webgl:u==="-webgl"},c)}}return Mo(t)}var Io={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2unorm-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function Mo(t){var r=Io[t];if(!r)throw new Error("Unknown format ".concat(t));return{format:r.format||"",components:r.components||1,byteLength:r.bpp||1,srgb:!1,unsized:!1}}function Lo(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=No(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
13
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function No(t,r){if(t){if(typeof t=="string")return Xr(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Xr(t,r)}}function Xr(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function $r(t,r,e){var n=r.split(/\r?\n/),o="",i=Lo(t),a;try{for(i.s();!(a=i.n()).done;){var u=a.value;o+=ko(u,n,u.lineNum,e)}}catch(s){i.e(s)}finally{i.f()}return o}function ko(t,r,e,n){if(n!=null&&n.showSourceCode){var o=t.linePos>0?"".concat(" ".repeat(t.linePos+5),`^^^
14
- `):"",i=Uo(r,e);return"".concat(i).concat(o).concat(t.type.toUpperCase(),": ").concat(t.message,`
7
+ "use strict";var __exports__=(()=>{var pn=Object.create;var yt=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var hn=Object.getOwnPropertyNames;var dn=Object.getPrototypeOf,gn=Object.prototype.hasOwnProperty;var Ut=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),yn=(t,r)=>{for(var e in r)yt(t,e,{get:r[e],enumerable:!0})},_e=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of hn(r))!gn.call(t,o)&&o!==e&&yt(t,o,{get:()=>r[o],enumerable:!(n=mn(r,o))||n.enumerable});return t};var Pe=(t,r,e)=>(e=t!=null?pn(dn(t)):{},_e(r||!t||!t.__esModule?yt(e,"default",{value:t,enumerable:!0}):e,t)),vn=t=>_e(yt({},"__esModule",{value:!0}),t);var Le=Ut((ia,G)=>{function Vt(t){return G.exports=Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},G.exports.__esModule=!0,G.exports.default=G.exports,Vt(t)}G.exports=Vt,G.exports.__esModule=!0,G.exports.default=G.exports});var Ue=Ut((aa,H)=>{var Ne=Le().default;function ke(){"use strict";H.exports=ke=function(){return t},H.exports.__esModule=!0,H.exports.default=H.exports;var t={},r=Object.prototype,e=r.hasOwnProperty,n=Object.defineProperty||function(p,f,l){p[f]=l.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(p,f,l){return Object.defineProperty(p,f,{value:l,enumerable:!0,configurable:!0,writable:!0}),p[f]}try{s({},"")}catch{s=function(l,m,v){return l[m]=v}}function c(p,f,l,m){var v=f&&f.prototype instanceof T?f:T,h=Object.create(v.prototype),E=new Nt(m||[]);return n(h,"_invoke",{value:fn(p,l,E)}),h}function O(p,f,l){try{return{type:"normal",arg:p.call(f,l)}}catch(m){return{type:"throw",arg:m}}}t.wrap=c;var _={};function T(){}function I(){}function j(){}var U={};s(U,i,function(){return this});var z=Object.getPrototypeOf,F=z&&z(z(kt([])));F&&F!==r&&e.call(F,i)&&(U=F);var N=j.prototype=T.prototype=Object.create(U);function ft(p){["next","throw","return"].forEach(function(f){s(p,f,function(l){return this._invoke(f,l)})})}function gt(p,f){function l(v,h,E,D){var B=O(p[v],p,h);if(B.type!=="throw"){var X=B.arg,W=X.value;return W&&Ne(W)=="object"&&e.call(W,"__await")?f.resolve(W.__await).then(function($){l("next",$,E,D)},function($){l("throw",$,E,D)}):f.resolve(W).then(function($){X.value=$,E(X)},function($){return l("throw",$,E,D)})}D(B.arg)}var m;n(this,"_invoke",{value:function(h,E){function D(){return new f(function(B,X){l(h,E,B,X)})}return m=m?m.then(D,D):D()}})}function fn(p,f,l){var m="suspendedStart";return function(v,h){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw h;return{value:void 0,done:!0}}for(l.method=v,l.arg=h;;){var E=l.delegate;if(E){var D=Se(E,l);if(D){if(D===_)continue;return D}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(m==="suspendedStart")throw m="completed",l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);m="executing";var B=O(p,f,l);if(B.type==="normal"){if(m=l.done?"completed":"suspendedYield",B.arg===_)continue;return{value:B.arg,done:l.done}}B.type==="throw"&&(m="completed",l.method="throw",l.arg=B.arg)}}}function Se(p,f){var l=f.method,m=p.iterator[l];if(m===void 0)return f.delegate=null,l==="throw"&&p.iterator.return&&(f.method="return",f.arg=void 0,Se(p,f),f.method==="throw")||l!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+l+"' method")),_;var v=O(m,p.iterator,f.arg);if(v.type==="throw")return f.method="throw",f.arg=v.arg,f.delegate=null,_;var h=v.arg;return h?h.done?(f[p.resultName]=h.value,f.next=p.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,_):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,_)}function ln(p){var f={tryLoc:p[0]};1 in p&&(f.catchLoc=p[1]),2 in p&&(f.finallyLoc=p[2],f.afterLoc=p[3]),this.tryEntries.push(f)}function Lt(p){var f=p.completion||{};f.type="normal",delete f.arg,p.completion=f}function Nt(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ln,this),this.reset(!0)}function kt(p){if(p||p===""){var f=p[i];if(f)return f.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var l=-1,m=function v(){for(;++l<p.length;)if(e.call(p,l))return v.value=p[l],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}throw new TypeError(Ne(p)+" is not iterable")}return I.prototype=j,n(N,"constructor",{value:j,configurable:!0}),n(j,"constructor",{value:I,configurable:!0}),I.displayName=s(j,u,"GeneratorFunction"),t.isGeneratorFunction=function(p){var f=typeof p=="function"&&p.constructor;return!!f&&(f===I||(f.displayName||f.name)==="GeneratorFunction")},t.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,j):(p.__proto__=j,s(p,u,"GeneratorFunction")),p.prototype=Object.create(N),p},t.awrap=function(p){return{__await:p}},ft(gt.prototype),s(gt.prototype,a,function(){return this}),t.AsyncIterator=gt,t.async=function(p,f,l,m,v){v===void 0&&(v=Promise);var h=new gt(c(p,f,l,m),v);return t.isGeneratorFunction(f)?h:h.next().then(function(E){return E.done?E.value:h.next()})},ft(N),s(N,u,"Generator"),s(N,i,function(){return this}),s(N,"toString",function(){return"[object Generator]"}),t.keys=function(p){var f=Object(p),l=[];for(var m in f)l.push(m);return l.reverse(),function v(){for(;l.length;){var h=l.pop();if(h in f)return v.value=h,v.done=!1,v}return v.done=!0,v}},t.values=kt,Nt.prototype={constructor:Nt,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(Lt),!f)for(var l in this)l.charAt(0)==="t"&&e.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function m(X,W){return E.type="throw",E.arg=f,l.next=X,W&&(l.method="next",l.arg=void 0),!!W}for(var v=this.tryEntries.length-1;v>=0;--v){var h=this.tryEntries[v],E=h.completion;if(h.tryLoc==="root")return m("end");if(h.tryLoc<=this.prev){var D=e.call(h,"catchLoc"),B=e.call(h,"finallyLoc");if(D&&B){if(this.prev<h.catchLoc)return m(h.catchLoc,!0);if(this.prev<h.finallyLoc)return m(h.finallyLoc)}else if(D){if(this.prev<h.catchLoc)return m(h.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return m(h.finallyLoc)}}}},abrupt:function(f,l){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&e.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var h=v;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=l&&l<=h.finallyLoc&&(h=null);var E=h?h.completion:{};return E.type=f,E.arg=l,h?(this.method="next",this.next=h.finallyLoc,_):this.complete(E)},complete:function(f,l){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&l&&(this.next=l),_},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===f)return this.complete(m.completion,m.afterLoc),Lt(m),_}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===f){var v=m.completion;if(v.type==="throw"){var h=v.arg;Lt(m)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,m){return this.delegate={iterator:kt(f),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=void 0),_}},t}H.exports=ke,H.exports.__esModule=!0,H.exports.default=H.exports});var Wt=Ut((sa,Fe)=>{var _t=Ue()();Fe.exports=_t;try{regeneratorRuntime=_t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=_t:Function("r","regeneratorRuntime = r")(_t)}});var Wo={};yn(Wo,{Buffer:()=>C,CanvasContext:()=>re,CommandBuffer:()=>pe,CommandEncoder:()=>le,ComputePass:()=>fe,ComputePipeline:()=>ue,Device:()=>$t,ExternalTexture:()=>ne,Framebuffer:()=>ae,RenderPass:()=>ce,RenderPipeline:()=>se,Resource:()=>y,Sampler:()=>ie,Shader:()=>oe,StatsManager:()=>Gt,Texture:()=>k,UniformBlock:()=>Bt,UniformBufferLayout:()=>Dt,UniformStore:()=>Yr,VERSION:()=>St,VertexArray:()=>de,assert:()=>st,cancelAnimationFrame:()=>cn,cast:()=>Zr,checkProps:()=>tn,decodeShaderAttributeType:()=>Et,decodeShaderUniformType:()=>Ct,decodeTextureFormat:()=>Xr,decodeVertexFormat:()=>ht,deepEqual:()=>Mt,fillArray:()=>Gr,formatCompilerLog:()=>Jr,formatValue:()=>ge,getAttributeInfosFromLayouts:()=>he,getScratchArray:()=>zr,getScratchArrayBuffer:()=>dt,glsl:()=>Vo,isNumberArray:()=>Y,isObjectEmpty:()=>Ge,isPowerOfTwo:()=>ze,isTypedArray:()=>Ht,loadFile:()=>rn,loadImage:()=>on,loadImageBitmap:()=>nn,loadScript:()=>an,log:()=>S,luma:()=>xt,makeRandomNumberGenerator:()=>Oe,mergeShaderLayout:()=>Lr,random:()=>sn,requestAnimationFrame:()=>un,setPathPrefix:()=>en,stubRemovedMethods:()=>Qr,uid:()=>it});function Ft(t){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let r=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,e=t||r;return!!(e&&e.indexOf("Electron")>=0)}function R(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ft()}var bn=globalThis.self||globalThis.window||globalThis.global,tt=globalThis.window||globalThis.self||globalThis.global,wn=globalThis.document||{},J=globalThis.process||{},On=globalThis.console,$o=globalThis.navigator||{};var vt=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Qo=R();function Sn(t){try{let r=window[t],e="__storage_test__";return r.setItem(e,e),r.removeItem(e),r}catch{return null}}var bt=class{constructor(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=Sn(n),this.id=r,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let r={};if(this.storage){let e=this.storage.getItem(this.id);r=e?JSON.parse(e):{}}return Object.assign(this.config,r),this}};function xe(t){let r;return t<10?r="".concat(t.toFixed(2),"ms"):t<100?r="".concat(t.toFixed(1),"ms"):t<1e3?r="".concat(t.toFixed(0),"ms"):r="".concat((t/1e3).toFixed(2),"s"),r}function Te(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,e=Math.max(r-t.length,0);return"".concat(" ".repeat(e)).concat(t)}function wt(t,r,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(e=Math.min(e,n/t.width));let i=t.width*e,a=t.height*e,u=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(o,");"),"background-size:".concat(i,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),u]}var Ot;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ot||(Ot={}));var _n=10;function Ae(t){return typeof t!="string"?t:(t=t.toUpperCase(),Ot[t]||Ot.WHITE)}function Ee(t,r,e){if(!R&&typeof t=="string"){if(r){let n=Ae(r);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(e){let n=Ae(e);t="\x1B[".concat(n+_n,"m").concat(t,"\x1B[49m")}}return t}function je(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],e=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(e),o=t;for(let i of n){let a=o[i];typeof a=="function"&&(r.find(u=>i===u)||(o[i]=a.bind(t)))}}function et(t,r){if(!t)throw new Error(r||"Assertion failed")}function Z(){let t;if(R()&&tt.performance){var r,e;t=tt===null||tt===void 0||(r=tt.performance)===null||r===void 0||(e=r.now)===null||e===void 0?void 0:e.call(r)}else if("hrtime"in J){var n;let o=J===null||J===void 0||(n=J.hrtime)===null||n===void 0?void 0:n.call(J);t=o[0]*1e3+o[1]/1e6}else t=Date.now();return t}var rt={debug:R()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Pn={enabled:!0,level:0};function L(){}var Ce={},Re={once:!0},K=class{constructor(){let{id:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=vt,this._startTs=Z(),this._deltaTs=Z(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new bt("__probe-".concat(this.id,"__"),Pn),this.timeStamp("".concat(this.id," started")),je(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Z()-this._startTs).toPrecision(10))}getDelta(){return Number((Z()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,e){this._storage.setConfiguration({[r]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,e){et(r,e)}warn(r){return this._getLogFunction(0,r,rt.warn,arguments,Re)}error(r){return this._getLogFunction(0,r,rt.error,arguments)}deprecated(r,e){return this.warn("`".concat(r,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(r,e){return this.error("`".concat(r,"` has been removed. Use `").concat(e,"` instead"))}probe(r,e){return this._getLogFunction(r,e,rt.log,arguments,{time:!0,once:!0})}log(r,e){return this._getLogFunction(r,e,rt.debug,arguments)}info(r,e){return this._getLogFunction(r,e,console.info,arguments)}once(r,e){return this._getLogFunction(r,e,rt.debug||rt.info,arguments,Re)}table(r,e,n){return e?this._getLogFunction(r,e,console.table||L,n&&[n],{tag:En(e)}):L}image(r){let{logLevel:e,priority:n,image:o,message:i="",scale:a=1}=r;return this._shouldLog(e||n)?R()?An({image:o,message:i,scale:a}):Tn({image:o,message:i,scale:a}):L}time(r,e){return this._getLogFunction(r,e,console.time?console.time:console.info)}timeEnd(r,e){return this._getLogFunction(r,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,e){return this._getLogFunction(r,e,console.timeStamp||L)}group(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=De({logLevel:r,message:e,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(r,e,Object.assign({},n,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||L)}withGroup(r,e,n){this.group(r,e)();try{n()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=Be(r)}_getLogFunction(r,e,n,o,i){if(this._shouldLog(r)){i=De({logLevel:r,message:e,args:o,opts:i}),n=n||i.method,et(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Z();let a=i.tag||i.message;if(i.once&&a)if(!Ce[a])Ce[a]=Z();else return L;return e=xn(this.id,i.message,i),n.bind(console,e,...i.args)}return L}};K.VERSION=vt;function Be(t){if(!t)return 0;let r;switch(typeof t){case"number":r=t;break;case"object":r=t.logLevel||t.priority||0;break;default:return 0}return et(Number.isFinite(r)&&r>=0),r}function De(t){let{logLevel:r,message:e}=t;t.logLevel=Be(r);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==e;);switch(typeof r){case"string":case"function":e!==void 0&&n.unshift(e),t.message=r;break;case"object":Object.assign(t,r);break;default:}typeof t.message=="function"&&(t.message=t.message());let o=typeof t.message;return et(o==="string"||o==="object"),Object.assign(t,{args:n},t.opts)}function xn(t,r,e){if(typeof r=="string"){let n=e.time?Te(xe(e.total)):"";r=e.time?"".concat(t,": ").concat(n," ").concat(r):"".concat(t,": ").concat(r),r=Ee(r,e.color,e.background)}return r}function Tn(t){let{image:r,message:e="",scale:n=1}=t;return console.warn("removed"),L}function An(t){let{image:r,message:e="",scale:n=1}=t;if(typeof r=="string"){let i=new Image;return i.onload=()=>{let a=wt(i,e,n);console.log(...a)},i.src=r,L}let o=r.nodeName||"";if(o.toLowerCase()==="img")return console.log(...wt(r,e,n)),L;if(o.toLowerCase()==="canvas"){let i=new Image;return i.onload=()=>console.log(...wt(i,e,n)),i.src=r.toDataURL(),L}return L}function En(t){for(let r in t)for(let e in t[r])return e||"untitled";return"empty"}var Pi=new K({id:"@probe.gl/log"});var S=new K({id:"luma.gl"});function M(t){return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},M(t)}function zt(t,r){if(M(t)!=="object"||t===null)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var n=e.call(t,r||"default");if(M(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function lt(t){var r=zt(t,"string");return M(r)==="symbol"?r:String(r)}function Ie(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lt(n.key),n)}}function d(t,r,e){return r&&Ie(t.prototype,r),e&&Ie(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function pt(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();t=r[0]*1e3+r[1]/1e6}else t=Date.now();return t}var Q=class{constructor(r,e){this.name=void 0,this.type=void 0,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=r,this.type=e,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(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=pt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(pt()-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 nt=class{constructor(r){this.id=void 0,this.stats={},this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:r,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let e of Object.values(this.stats))r(e)}getTable(){let r={};return this.forEach(e=>{r[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),r}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(r){let{name:e,type:n}=r,o=this.stats[e];return o||(r instanceof Q?o=r:o=new Q(e,n),this.stats[e]=o),o}};var Gt=function(){function t(){g(this,t),this.stats=new Map}var r=t.prototype;return r.getStats=function(n){return this.get(n)},r.get=function(n){return this.stats.has(n)||this.stats.set(n,new nt({id:n})),this.stats.get(n)},d(t)}(),ot=new Gt;function jn(){var t=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",r="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==t)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(t));return globalThis.luma||(R()&&S.log(1,"luma.gl ".concat(t," - ").concat(r))(),globalThis.luma=globalThis.luma||{VERSION:t,version:t,log:S,stats:ot}),t}var St=jn();function Ht(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)?t:null}function Y(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number"?t:null:Ht(t)}function w(t,r,e){return r=lt(r),r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Me(t,r,e,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){e(c);return}u.done?r(s):Promise.resolve(s).then(n,o)}function q(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(s){Me(i,n,o,a,u,"next",s)}function u(s){Me(i,n,o,a,u,"throw",s)}a(void 0)})}}var Jt=Pe(Wt(),1);var Kt={};function it(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Kt[t]=Kt[t]||1;var r=Kt[t]++;return"".concat(t,"-").concat(r)}function ze(t){return t>0&&(t&t-1)===0}function Ge(t){var r=!0;for(var e in t){r=!1;break}return r}function mt(t,r){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},mt(t,r)}function P(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&mt(t,r)}function Yt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t,r){if(r&&(M(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yt(t)}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(t)}function He(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Cn(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?He(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):He(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var y=function(){function t(e,n,o){if(g(this,t),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!e)throw new Error("no device");this._device=e,this.props=Rn(n,o);var i=this.props.id!=="undefined"?this.props.id:it(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}var r=t.prototype;return r.destroy=function(){this.destroyResource()},r.delete=function(){return this.destroy(),this},r.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},r.getProps=function(){return this.props},r.attachResource=function(n){this._attachedResources.add(n)},r.detachResource=function(n){this._attachedResources.delete(n)},r.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},r.destroyAttachedResources=function(){for(var n=0,o=Object.values(this._attachedResources);n<o.length;n++){var i=o[n];i.destroy()}this._attachedResources=new Set},r.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},r.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("".concat(o,"s Active")).decrementCount()},r.trackAllocatedMemory=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").addCount(n),i.get("".concat(o," Memory")).addCount(n),this.allocatedBytes=n},r.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").subtractCount(this.allocatedBytes),o.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},r.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(o,"s Created")).incrementCount(),n.get("".concat(o,"s Active")).incrementCount()},d(t)}();y.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Rn(t,r){var e=Cn({},r);for(var n in t)t[n]!==void 0&&(e[n]=t[n]);return e}var We;function Ve(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function qt(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ve(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ve(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Dn(t){var r=Bn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Bn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}We=Symbol.toStringTag;var C=function(t){P(e,t);var r=Dn(e);function e(o,i){var a;g(this,e);var u=qt({},i);return(i.usage||0)&e.INDEX&&!i.indexType&&(i.data instanceof Uint32Array?u.indexType="uint32":i.data instanceof Uint16Array&&(u.indexType="uint16")),a=r.call(this,o,u,e.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=i.usage||0,a.indexType=u.indexType,a}var n=e.prototype;return n.write=function(i,a){throw new Error("not implemented")},n.readAsync=function(i,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},d(e,[{key:We,get:function(){return"Buffer"}}]),e}(y);C.defaultProps=qt(qt({},y.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});C.MAP_READ=1;C.MAP_WRITE=2;C.COPY_SRC=4;C.COPY_DST=8;C.INDEX=16;C.VERTEX=32;C.UNIFORM=64;C.STORAGE=128;C.INDIRECT=256;C.QUERY_RESOLVE=512;var Ye;function Ke(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Xt(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ke(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Pt={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(S.get("debug")),break:[],gl:null};Ye=Symbol.toStringTag;var $t=function(){function t(e){g(this,t),this.id=void 0,this.statsManager=ot,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Xt(Xt({},Pt),e),this.id=this.props.id||it(this[Symbol.toStringTag].toLowerCase())}var r=t.prototype;return r.loseDevice=function(){return!1},r.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},r.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},r.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},r._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var o=Xt({},n);return(n.usage||0)&C.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?o.indexType="uint32":n.data instanceof Uint16Array?o.indexType="uint16":S.warn("indices buffer content must be of integer type")()),o},d(t,[{key:Ye,get:function(){return"Device"}}]),t}();$t.VERSION=St;function qe(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Xe(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):qe(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function In(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Mn(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function Mn(t,r){if(t){if(typeof t=="string")return $e(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return $e(t,r)}}function $e(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var at=new Map,xt=function(){function t(){g(this,t)}return t.registerDevices=function(e){var n=In(e),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;st(i.type&&i.isSupported&&i.create),at.set(i.type,i)}}catch(a){n.e(a)}finally{n.f()}},t.getAvailableDevices=function(){return Array.from(at).map(function(e){return e.type})},t.getSupportedDevices=function(){return Array.from(at).filter(function(e){return e.isSupported()}).map(function(e){return e.type})},t.setDefaultDeviceProps=function(e){Object.assign(Pt,e)},t.createDevice=function(){var r=q(Jt.default.mark(function n(){var o,i,a=arguments;return Jt.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:o=a.length>0&&a[0]!==void 0?a[0]:{},o=Xe(Xe({},Pt),o),o.gl&&(o.type="webgl"),s.t0=o.type,s.next=s.t0==="webgpu"?6:s.t0==="webgl"||s.t0==="webgl1"||s.t0==="webgl2"?12:s.t0==="best-available"?18:24;break;case 6:if(i=at.get("webgpu"),!i){s.next=11;break}return s.next=10,i.create(o);case 10:return s.abrupt("return",s.sent);case 11:return s.abrupt("break",24);case 12:if(i=at.get("webgl"),!i){s.next=17;break}return s.next=16,i.create(o);case 16:return s.abrupt("return",s.sent);case 17:return s.abrupt("break",24);case 18:if(i=at.get("webgl"),!(i&&i.isSupported())){s.next=23;break}return s.next=22,i.create(o);case 22:return s.abrupt("return",s.sent);case 23:return s.abrupt("break",24);case 24:throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.");case 25:case"end":return s.stop()}},n)}));function e(){return r.apply(this,arguments)}return e}(),d(t)}();xt.stats=ot;xt.log=S;function Zt(t){if(Array.isArray(t))return t}function Qt(t,r){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(e=e.call(t)).next,r===0){if(Object(e)!==e)return;s=!1}else for(;!(s=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);s=!0);}catch(O){c=!0,o=O}finally{try{if(!s&&e.return!=null&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}function Tt(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function te(t,r){if(t){if(typeof t=="string")return Tt(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Tt(t,r)}}function ee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(t,r){return Zt(t)||Qt(t,r)||te(t,r)||ee()}function Ln(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Nn(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function Nn(t,r){if(t){if(typeof t=="string")return Je(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Je(t,r)}}function Je(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Ze(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Qe(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ze(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ze(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var kn=R()&&typeof document<"u",At=function(){return kn&&document.readyState==="complete"},Un={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},re=function(){function t(e){var n=this;if(g(this,t),this.device=void 0,this.id=void 0,this.props=void 0,this.canvas=void 0,this.htmlCanvas=void 0,this.offscreenCanvas=void 0,this.type=void 0,this.width=1,this.height=1,this.resizeObserver=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this.props=Qe(Qe({},Un),e),e=this.props,!R()){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=Gn(e.canvas):this.canvas=e.canvas;else{var o,i,a=Hn(e),u=zn(((o=e)===null||o===void 0?void 0:o.container)||null);u.insertBefore(a,u.firstChild),this.canvas=a,(i=e)!==null&&i!==void 0&&i.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(function(s){var c=Ln(s),O;try{for(c.s();!(O=c.n()).done;){var _=O.value;_.target===n.canvas&&n.update()}}catch(T){c.e(T)}finally{c.f()}}),this.resizeObserver.observe(this.canvas))}var r=t.prototype;return r.getDevicePixelRatio=function(n){if(typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(n=n===void 0?this.props.useDevicePixels:n,!n||n<=0))return 1;if(n===!0){var o=typeof window<"u"&&window.devicePixelRatio;return o||1}return n},r.getPixelSize=function(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":var n=this.getDevicePixelRatio(),o=this.canvas;return o.parentElement?[o.clientWidth*n,o.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},r.getAspect=function(){var n=this.getPixelSize(),o=A(n,2),i=o[0],a=o[1];return i/a},r.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),o=A(n,1),i=o[0],a=this._canvasSizeInfo.clientWidth;return a?i/a:1}catch{return 1}},r.cssToDevicePixels=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),u=A(a,2),s=u[0],c=u[1];return Vn(n,i,s,c,o)},r.setDevicePixelRatio=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var i="width"in o?o.width:this.htmlCanvas.clientWidth,a="height"in o?o.height:this.htmlCanvas.clientHeight;(!i||!a)&&(S.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,i=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var u=this._canvasSizeInfo;if(u.clientWidth!==i||u.clientHeight!==a||u.devicePixelRatio!==n){var s=n,c=Math.floor(i*s),O=Math.floor(a*s);this.htmlCanvas.width=c,this.htmlCanvas.height=O;var _=this.getDrawingBufferSize(),T=A(_,2),I=T[0],j=T[1];(I!==c||j!==O)&&(s=Math.min(I/i,j/a),this.htmlCanvas.width=Math.floor(i*s),this.htmlCanvas.height=Math.floor(a*s),S.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=i,this._canvasSizeInfo.clientHeight=a,this._canvasSizeInfo.devicePixelRatio=n}}},r.getDrawingBufferSize=function(){var n=this.device.gl;if(!n)throw new Error("canvas size");return[n.drawingBufferWidth,n.drawingBufferHeight]},r._setAutoCreatedCanvasId=function(n){var o;((o=this.htmlCanvas)===null||o===void 0?void 0:o.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},d(t,null,[{key:"isPageLoaded",get:function(){return At()}}]),t}();re.pageLoaded=Fn();function Fn(){return At()||typeof window>"u"?Promise.resolve():new Promise(function(t){window.addEventListener("load",function(){return t()})})}function zn(t){if(typeof t=="string"){var r=document.getElementById(t);if(!r&&!At())throw new Error("Accessing '".concat(t,"' before page was loaded"));if(!r)throw new Error("".concat(t," is not an HTML element"));return r}else if(t)return t;return document.body}function Gn(t){var r=document.getElementById(t);if(!r&&!At())throw new Error("Accessing '".concat(t,"' before page was loaded"));if(!(r instanceof HTMLCanvasElement))throw new Error("'".concat(r,"' is not a canvas element"));return r}function Hn(t){var r=t.width,e=t.height,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=r||1,n.height=e||1,n.style.width=Number.isFinite(r)?"".concat(r,"px"):"100%",n.style.height=Number.isFinite(e)?"".concat(e,"px"):"100%",n}function Vn(t,r,e,n,o){var i=t,a=tr(i[0],r,e),u=er(i[1],r,n,o),s=tr(i[0]+1,r,e),c=s===e-1?s:s-1;s=er(i[1]+1,r,n,o);var O;return o?(s=s===0?s:s+1,O=u,u=s):O=s===n-1?s:s-1,{x:a,y:u,width:Math.max(c-a+1,1),height:Math.max(O-u+1,1)}}function tr(t,r,e){var n=Math.min(Math.round(t*r),e-1);return n}function er(t,r,e,n){return n?Math.max(0,e-1-Math.round(t*r)):Math.min(Math.round(t*r),e-1)}var or;function rr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function nr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?rr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):rr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Wn(t){var r=Kn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Kn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}or=Symbol.toStringTag;var k=function(t){P(e,t);var r=Wn(e);function e(n,o){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.defaultProps;return g(this,e),i=r.call(this,n,o,a),i.dimension=void 0,i.format=void 0,i.width=void 0,i.height=void 0,i.depth=void 0,i.sampler=void 0,i.dimension=i.props.dimension,i.format=i.props.format,i.width=i.props.width,i.height=i.props.height,i.depth=i.props.depth,i}return d(e,[{key:or,get:function(){return"Texture"}}]),e}(y);k.defaultProps=nr(nr({},y.defaultProps),{},{data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,sampler:{},compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0});k.COPY_SRC=1;k.COPY_DST=2;k.TEXTURE_BINDING=4;k.STORAGE_BINDING=8;k.RENDER_ATTACHMENT=16;var sr;function ir(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function ar(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ir(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ir(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Yn(t){var r=qn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function qn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}sr=Symbol.toStringTag;var ne=function(t){P(e,t);var r=Yn(e);function e(n,o){return g(this,e),r.call(this,n,o,e.defaultProps)}return d(e,[{key:sr,get:function(){return"ExternalTexture"}}]),e}(y);ne.defaultProps=ar(ar({},y.defaultProps),{},{source:null,colorSpace:"srgb"});var fr;function ur(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function cr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ur(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ur(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Xn(t){var r=$n();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function $n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}fr=Symbol.toStringTag;var oe=function(t){P(e,t);var r=Xn(e);function e(n,o){var i;return g(this,e),i=r.call(this,n,o,e.defaultProps),i.stage=void 0,i.source=void 0,i.stage=i.props.stage,i.source=i.props.source,i}return d(e,[{key:fr,get:function(){return"Shader"}}]),e}(y);oe.defaultProps=cr(cr({},y.defaultProps),{},{stage:"vertex",source:"",sourceMap:null,language:"auto",shaderType:0});var mr;function lr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function pr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?lr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):lr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Jn(t){var r=Zn();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Zn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}mr=Symbol.toStringTag;var ie=function(t){P(e,t);var r=Jn(e);function e(n,o){return g(this,e),r.call(this,n,o,e.defaultProps)}return d(e,[{key:mr,get:function(){return"Sampler"}}]),e}(y);ie.defaultProps=pr(pr({},y.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 dr;function hr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function ut(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?hr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):hr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Qn(t){var r=to();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function to(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}dr=Symbol.toStringTag;var ae=function(t){P(e,t);var r=Qn(e);function e(o){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return g(this,e),i=r.call(this,o,a,e.defaultProps),i.width=void 0,i.height=void 0,i.colorAttachments=[],i.depthStencilAttachment=null,i.width=i.props.width,i.height=i.props.height,i}var n=e.prototype;return n.resize=function(i){var a=!i;if(i){var u=Array.isArray(i)?i:[i.width,i.height],s=A(u,2),c=s[0],O=s[1];a=a||O!==this.height||c!==this.width,this.width=c,this.height=O}a&&(S.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(this.width,"x").concat(this.height))(),this.resizeAttachments(this.width,this.height))},n.autoCreateAttachmentTextures=function(){var i=this;if(this.colorAttachments=this.props.colorAttachments.map(function(u){if(typeof u=="string"){var s=i.createColorTexture(u);return i.attachResource(s),s}return u}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){var a=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(a),this.depthStencilAttachment=a}else this.depthStencilAttachment=this.props.depthStencilAttachment},n.createColorTexture=function(i){return this.device.createTexture({id:"color-attachment",usage:k.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.createDepthStencilTexture=function(i){return this.device.createTexture({id:"depth-stencil-attachment",usage:k.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.resizeAttachments=function(i,a){for(var u=0;u<this.colorAttachments.length;++u)if(this.colorAttachments[u]){var s=this.device._createTexture(ut(ut({},this.colorAttachments[u].props),{},{width:i,height:a}));this.destroyAttachedResource(this.colorAttachments[u]),this.colorAttachments[u]=s,this.attachResource(s)}if(this.depthStencilAttachment){var c=this.device._createTexture(ut(ut({},this.depthStencilAttachment.props),{},{width:i,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=c,this.attachResource(c)}},d(e,[{key:dr,get:function(){return"Framebuffer"}}]),e}(y);ae.defaultProps=ut(ut({},y.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var vr;function gr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function yr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?gr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):gr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function eo(t){var r=ro();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function ro(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}vr=Symbol.toStringTag;var se=function(t){P(e,t);var r=eo(e);function e(n,o){var i;return g(this,e),i=r.call(this,n,o,e.defaultProps),i.hash="",i.vs=void 0,i.fs=void 0,i.shaderLayout=void 0,i.bufferLayout=void 0,i.shaderLayout=i.props.shaderLayout,i.bufferLayout=i.props.bufferLayout||[],i}return d(e,[{key:vr,get:function(){return"RenderPipeline"}}]),e}(y);se.defaultProps=yr(yr({},y.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});var Or;function br(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function wr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?br(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):br(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function no(t){var r=oo();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function oo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Or=Symbol.toStringTag;var ue=function(t){P(e,t);var r=no(e);function e(n,o){var i;return g(this,e),i=r.call(this,n,o,e.defaultProps),i.hash="",i}return d(e,[{key:Or,get:function(){return"ComputePipeline"}}]),e}(y);ue.defaultProps=wr(wr({},y.defaultProps),{},{cs:void 0,csEntryPoint:void 0,csConstants:{},shaderLayout:[]});var Pr;function Sr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function _r(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Sr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Sr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function io(t){var r=ao();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function ao(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Pr=Symbol.toStringTag;var ce=function(t){P(e,t);var r=io(e);function e(n,o){return g(this,e),r.call(this,n,o,e.defaultProps)}return d(e,[{key:Pr,get:function(){return"RenderPass"}}]),e}(y);ce.defaultProps=_r(_r({},y.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});var Tr;function xr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function so(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?xr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):xr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function uo(t){var r=co();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function co(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Tr=Symbol.toStringTag;var fe=function(t){P(e,t);var r=uo(e);function e(n,o){return g(this,e),r.call(this,n,o,y.defaultProps)}return d(e,[{key:Tr,get:function(){return"ComputePass"}}]),e}(y);fe.defaultProps=so({},y.defaultProps);var jr;function Ar(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Er(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ar(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ar(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function fo(t){var r=lo();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function lo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}jr=Symbol.toStringTag;var le=function(t){P(e,t);var r=fo(e);function e(o,i){return g(this,e),r.call(this,o,i,e.defaultProps)}var n=e.prototype;return n.pushDebugGroup=function(i){},n.popDebugGroup=function(){},n.insertDebugMarker=function(i){},d(e,[{key:jr,get:function(){return"CommandEncoder"}}]),e}(y);le.defaultProps=Er(Er({},y.defaultProps),{},{measureExecutionTime:void 0});var Rr;function Cr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function po(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Cr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Cr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function mo(t){var r=ho();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function ho(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Rr=Symbol.toStringTag;var pe=function(t){P(e,t);var r=mo(e);function e(n){return g(this,e),r.call(this,n,e.defaultProps)}return d(e,[{key:Rr,get:function(){return"CommandBuffer"}}]),e}(y);pe.defaultProps=po({},y.defaultProps);function Et(t){var r=A(yo[t],2),e=r[0],n=r[1],o=e==="i32"||e==="u32",i=e!=="u32",a=vo[e]*n,u=go(e,n);return{dataType:e,components:n,defaultVertexFormat:u,byteLength:a,integer:o,signed:i}}function go(t,r){var e;switch(t){case"f32":e="float32";break;case"i32":e="sint32";break;case"u32":e="uint32";break;case"f16":return r<=2?"float16x2":"float16x4"}return r===1?e:"".concat(e,"x").concat(r)}var yo={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]},vo={f32:4,f16:2,i32:4,u32:4};function jt(t){var r=Dr[t],e=bo(r),n=t.includes("norm"),o=!n&&!t.startsWith("float"),i=t.startsWith("s");return{dataType:Dr[t],byteLength:e,integer:o,signed:i,normalized:n}}function bo(t){var r=wo[t];return r}var Dr={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},wo={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function ht(t){var r;t.endsWith("-webgl")&&(t.replace("-webgl",""),r=!0);var e=t.split("x"),n=A(e,2),o=n[0],i=n[1],a=o,u=i?parseInt(i):1,s=jt(a),c={type:a,components:u,byteLength:s.byteLength*u,integer:s.integer,signed:s.signed,normalized:s.normalized};return r&&(c.webglOnly=!0),c}function Br(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function me(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Br(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Br(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ct(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Oo(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function Oo(t,r){if(t){if(typeof t=="string")return Ir(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ir(t,r)}}function Ir(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function he(t,r){var e={},n=ct(t.attributes),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;e[i.name]=So(t,r,i.name)}}catch(a){n.e(a)}finally{n.f()}return e}function Mr(t,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=he(t,r),o=new Array(e).fill(null),i=0,a=Object.values(n);i<a.length;i++){var u=a[i];o[u.location]=u}return o}function So(t,r,e){var n=_o(t,e),o=Po(r,e);if(!n)return null;var i=Et(n.type),a=o?.vertexFormat||i.defaultVertexFormat,u=ht(a);return{attributeName:o?.attributeName||n.name,bufferName:o?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:i.dataType,shaderComponents:i.components,vertexFormat:a,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:i.integer,stepMode:o?.stepMode||n.stepMode,byteOffset:o?.byteOffset||0,byteStride:o?.byteStride||0}}function _o(t,r){var e=t.attributes.find(function(n){return n.name===r});return e||S.warn('shader layout attribute "'.concat(r,'" not present in shader')),e||null}function Po(t,r){xo(t);var e=To(t,r);return e||(e=Ao(t,r),e)?e:(S.warn('layout for attribute "'.concat(r,'" not present in buffer layout')),null)}function xo(t){var r=ct(t),e;try{for(r.s();!(e=r.n()).done;){var n=e.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&S.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(o){r.e(o)}finally{r.f()}}function To(t,r){var e=ct(t),n;try{for(e.s();!(n=e.n()).done;){var o=n.value;if(o.format&&o.name===r)return{attributeName:o.name,bufferName:r,stepMode:o.stepMode,vertexFormat:o.format,byteOffset:0,byteStride:o.byteStride||0}}}catch(i){e.e(i)}finally{e.f()}return null}function Ao(t,r){var e=ct(t),n;try{for(e.s();!(n=e.n()).done;){var o,i=n.value,a=i.byteStride;if(typeof i.byteStride!="number"){var u=ct(i.attributes||[]),s;try{for(u.s();!(s=u.n()).done;){var c=s.value,O=ht(c.format);a+=O.byteLength}}catch(T){u.e(T)}finally{u.f()}}var _=(o=i.attributes)===null||o===void 0?void 0:o.find(function(T){return T.attribute===r});if(_)return{attributeName:_.attribute,bufferName:i.name,stepMode:i.stepMode,vertexFormat:_.format,byteOffset:_.byteOffset,byteStride:a}}}catch(T){e.e(T)}finally{e.f()}return null}function Lr(t,r){var e=me(me({},t),{},{attributes:t.attributes.map(function(a){return me({},a)})}),n=ct(r?.attributes||[]),o;try{var i=function(){var u=o.value,s=e.attributes.find(function(c){return c.name===u.name});s?(s.type=u.type||s.type,s.stepMode=u.stepMode||s.stepMode):S.warn("shader layout attribute ".concat(u.name," not present in shader"))};for(n.s();!(o=n.n()).done;)i()}catch(a){n.e(a)}finally{n.f()}return e}var Ur;function Nr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function kr(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Nr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Nr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Eo(t){var r=jo();return function(){var n=b(t),o;if(r){var i=b(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function jo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Ur=Symbol.toStringTag;var de=function(t){P(e,t);var r=Eo(e);function e(n,o){var i;return g(this,e),i=r.call(this,n,o,e.defaultProps),i.maxVertexAttributes=void 0,i.attributeInfos=void 0,i.indexBuffer=null,i.attributes=void 0,i.maxVertexAttributes=n.limits.maxVertexAttributes,i.attributes=new Array(i.maxVertexAttributes).fill(null),i.attributeInfos=Mr(o.renderPipeline.shaderLayout,o.renderPipeline.bufferLayout,i.maxVertexAttributes),i}return d(e,[{key:Ur,get:function(){return"VertexArray"}}]),e}(y);de.defaultProps=kr(kr({},y.defaultProps),{},{renderPipeline:null});function st(t,r){if(!t)throw new Error(r||"luma.gl: assertion failed.")}var Co={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 Ct(t){var r=Co[t];return st(t),r}function Fr(t,r){switch(r){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}var Rt;function dt(t){return(!Rt||Rt.byteLength<t)&&(Rt=new ArrayBuffer(t)),Rt}function zr(t,r){var e=dt(t.BYTES_PER_ELEMENT*r);return new t(e,0,r)}function Gr(t){for(var r=t.target,e=t.source,n=t.start,o=n===void 0?0:n,i=t.count,a=i===void 0?1:i,u=e.length,s=a*u,c=0,O=o;c<u;c++)r[O++]=e[c];for(;c<s;)c<s-c?(r.copyWithin(o+c,o,o+c),c*=2):(r.copyWithin(o+c,o,o+s-c),c=s);return t.target}var Hr=1024,Dt=function(){function t(e){g(this,t),this.layout={},this.byteLength=void 0;for(var n=0,o=0,i=Object.entries(e);o<i.length;o++){var a=A(i[o],2),u=a[0],s=a[1],c=Ct(s),O=c.type,_=c.components;n=Fr(n,_);var T=n;n+=_,this.layout[u]={type:O,size:_,offset:T}}n+=(4-n%4)%4;var I=n*4;this.byteLength=Math.max(I,Hr)}var r=t.prototype;return r.getData=function(n){for(var o=Math.max(this.byteLength,Hr),i=dt(o),a={i32:new Int32Array(i),u32:new Uint32Array(i),f32:new Float32Array(i),f16:new Uint16Array(i)},u=0,s=Object.entries(n);u<s.length;u++){var c=A(s[u],2),O=c[0],_=c[1],T=this.layout[O];if(!T){S.warn("Supplied uniform value ".concat(O," not present in uniform block layout"))();continue}var I=T.type,j=T.size,U=T.offset,z=a[I];if(j===1){if(typeof _!="number"&&typeof _!="boolean"){S.warn("Supplied value for single component uniform ".concat(O," is not a number: ").concat(_))();continue}z[U]=Number(_)}else{var F=Y(_);if(!F){S.warn("Supplied value for multi component / array uniform ".concat(O," is not a numeric array: ").concat(_))();continue}z.set(F,U)}}return new Uint8Array(i)},r.has=function(n){return Boolean(this.layout[n])},r.get=function(n){var o=this.layout[n];return o},d(t)}();function Vr(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(t!==r)return!1;var n=Y(t);if(!n)return!1;var o=Y(r);if(o&&n.length===o.length){for(var i=0;i<n.length;++i)if(o[i]!==n[i])return!1}return!0}function Wr(t){var r=Y(t);return r?r.slice():t}function Ro(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Do(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function Do(t,r){if(t){if(typeof t=="string")return Kr(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Kr(t,r)}}function Kr(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Bt=function(){function t(e){if(g(this,t),this.name=void 0,this.uniforms={},this.modifiedUniforms={},this.modified=!0,this.bindingLayout={},this.needsRedraw="initialized",this.name=e?.name,e!=null&&e.name&&e!==null&&e!==void 0&&e.shaderLayout){var n,o=e==null||(n=e.shaderLayout.bindings)===null||n===void 0?void 0:n.find(function(c){return c.type==="uniform"&&c.name===e?.name});if(!o)throw new Error(e?.name);var i=o,a=Ro(i.uniforms||[]),u;try{for(a.s();!(u=a.n()).done;){var s=u.value;this.bindingLayout[s.name]=s}}catch(c){a.e(c)}finally{a.f()}}}var r=t.prototype;return r.setUniforms=function(n){for(var o=0,i=Object.entries(n);o<i.length;o++){var a=A(i[o],2),u=a[0],s=a[1];this._setUniform(u,s),this.needsRedraw||this.setNeedsRedraw("".concat(this.name,".").concat(u,"=").concat(s))}},r.setNeedsRedraw=function(n){this.needsRedraw=this.needsRedraw||n},r.getAllUniforms=function(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}},r._setUniform=function(n,o){Vr(this.uniforms[n],o)||(this.uniforms[n]=Wr(o),this.modifiedUniforms[n]=!0,this.modified=!0)},d(t)}();var Yr=function(){function t(e){g(this,t),this.uniformBlocks=void 0,this.uniformBufferLayouts=void 0,this.uniformBuffers=void 0,this.uniformBlocks={},this.uniformBufferLayouts={},this.uniformBuffers={};for(var n=0,o=Object.entries(e);n<o.length;n++){var i=A(o[n],2),a=i[0],u=i[1],s=a,c=new Dt(u.uniformTypes||{});this.uniformBufferLayouts[s]=c;var O=new Bt({name:a});O.setUniforms(u.defaultUniforms||{}),this.uniformBlocks[s]=O}}var r=t.prototype;return r.destroy=function(){for(var n=0,o=Object.values(this.uniformBuffers);n<o.length;n++){var i=o[n];i.destroy()}},r.setUniforms=function(n){for(var o=0,i=Object.entries(n);o<i.length;o++){var a=A(i[o],2),u=a[0],s=a[1];this.uniformBlocks[u].setUniforms(s)}this.updateUniformBuffers()},r.getUniformBufferByteLength=function(n){return this.uniformBufferLayouts[n].byteLength},r.getUniformBufferData=function(n){var o=this.uniformBlocks[n].getAllUniforms();return this.uniformBufferLayouts[n].getData(o)},r.getManagedUniformBuffer=function(n,o){if(!this.uniformBuffers[o]){var i=this.getUniformBufferByteLength(o),a=n.createBuffer({usage:C.UNIFORM,byteLength:i});this.uniformBuffers[o]=a}return this.updateUniformBuffers(),this.uniformBuffers[o]},r.updateUniformBuffer=function(n){var o=this.uniformBlocks[n],i=this.uniformBuffers[n],a=!1;if(i&&o.needsRedraw){a||(a=o.needsRedraw);var u=this.getUniformBufferData(n),s=this.uniformBuffers[n];s.write(u);var c=this.uniformBlocks[n].getAllUniforms();S.log(4,"Writing to uniform buffer ".concat(String(n)),u,c)()}return a},r.updateUniformBuffers=function(){for(var n=!1,o=0,i=Object.keys(this.uniformBlocks);o<i.length;o++){var a=i[o];n||(n=this.updateUniformBuffer(a))}return n&&S.log(3,"UniformStore.updateUniformBuffers(): ".concat(n))(),n},d(t)}();function qr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function Bo(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?qr(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):qr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Io=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function Xr(t){var r=Io.exec(t);if(r){var e=A(r,6),n=e[1],o=e[2],i=e[3],a=e[4],u=e[5];if(n){var s="".concat(i).concat(o),c=jt(s);return Bo({format:n,components:0,srgb:a==="-srgb",unsized:u==="-unsized",webgl:u==="-webgl"},c)}}return Lo(t)}var Mo={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2unorm-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function Lo(t){var r=Mo[t];if(!r)throw new Error("Unknown format ".concat(t));return{format:r.format||"",components:r.components||1,byteLength:r.bpp||1,srgb:!1,unsized:!1}}function No(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ko(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var c=e.next();return i=c.done,c},e:function(c){a=!0,u=c},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function ko(t,r){if(t){if(typeof t=="string")return $r(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return $r(t,r)}}function $r(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Jr(t,r,e){var n=r.split(/\r?\n/),o="",i=No(t),a;try{for(i.s();!(a=i.n()).done;){var u=a.value;o+=Uo(u,n,u.lineNum,e)}}catch(s){i.e(s)}finally{i.f()}return o}function Uo(t,r,e,n){if(n!=null&&n.showSourceCode){var o=t.linePos>0?"".concat(" ".repeat(t.linePos+5),`^^^
14
+ `):"",i=Fo(r,e);return"".concat(i).concat(o).concat(t.type.toUpperCase(),": ").concat(t.message,`
15
15
 
16
16
  `)}return"".concat(t.type.toUpperCase(),": ").concat(t.message,`
17
- `)}function Uo(t,r){for(var e="",n=r-2;n<=r;n++){var o=t[n];o!==void 0&&(e+="".concat(Fo(String(n),4),": ").concat(o,`
18
- `))}return e}function Fo(t,r){for(var e="",n=t.length;n<r;++n)e+=" ";return e+t}function Jr(t){return t}function zo(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.maxElts,n=e===void 0?16:e,o=r.size,i=o===void 0?1:o,a="[",u=0;u<t.length&&u<n;++u)u>0&&(a+=",".concat(u%i===0?" ":"")),a+=ge(t[u],r);var s=t.length>n?"...":"]";return"".concat(a).concat(s)}function ge(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=1e-16,n=r.isInteger,o=n===void 0?!1:n;if(Array.isArray(t)||ArrayBuffer.isView(t))return zo(t,r);if(typeof t!="number")return String(t);if(Math.abs(t)<e)return o?"0":"0.";if(o||Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);var i=t.toPrecision(2),a=i.indexOf(".0");return a===i.length-2?i.slice(0,-1):i}function Zr(t,r,e,n){var o="See luma.gl ".concat(e," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),i=Object.getPrototypeOf(t);n.forEach(function(a){i.methodName||(i[a]=function(){throw S.removed("Calling removed method ".concat(r,".").concat(a,": "),o)(),new Error(a)})})}function Qr(t,r,e){var n=e.removedProps,o=n===void 0?{}:n,i=e.deprecatedProps,a=i===void 0?{}:i,u=e.replacedProps,s=u===void 0?{}:u;for(var c in o)if(c in r){var O=o[c],_=O?"".concat(t,".").concat(o[c]):"N/A";S.removed("".concat(t,".").concat(c),_)()}for(var T in a)if(T in r){var I=a[T];S.deprecated("".concat(t,".").concat(T),"".concat(t,".").concat(I))()}for(var j=null,U=0,z=Object.entries(s);U<z.length;U++){var F=A(z[U],2),N=F[0],ft=F[1];N in r&&(S.deprecated("".concat(t,".").concat(N),"".concat(t,".").concat(ft))(),j=j||Object.assign({},r),j[ft]=r[N],delete j[N])}return j||r}var V=Pe(Wt(),1),It="";function tn(t){It=t}function en(t,r){return ye.apply(this,arguments)}function ye(){return ye=Y(V.default.mark(function t(r,e){var n,o;return V.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=r.startsWith("http")?r:It+r,n=e?.dataType||"text",a.next=4,fetch(r,e);case 4:return o=a.sent,a.next=7,o[n]();case 7:return a.abrupt("return",a.sent);case 8:case"end":return a.stop()}},t)})),ye.apply(this,arguments)}function rn(t,r){return ve.apply(this,arguments)}function ve(){return ve=Y(V.default.mark(function t(r,e){var n;return V.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=new Image,n.crossOrigin=e?.crossOrigin||"anonymous",n.src=r.startsWith("http")?r:It+r,i.next=5,n.decode();case 5:return i.next=7,createImageBitmap(n);case 7:return i.abrupt("return",i.sent);case 8:case"end":return i.stop()}},t)})),ve.apply(this,arguments)}function nn(t,r){return be.apply(this,arguments)}function be(){return be=Y(V.default.mark(function t(r,e){return V.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Promise(function(i,a){try{var u=new Image;u.onload=function(){return i(u)},u.onerror=function(){return a(new Error("Could not load image ".concat(r,".")))},u.crossOrigin=e?.crossOrigin||"anonymous",u.src=r.startsWith("http")?r:It+r}catch(s){a(s)}}));case 1:case"end":return o.stop()}},t)})),be.apply(this,arguments)}function on(t,r){return we.apply(this,arguments)}function we(){return we=Y(V.default.mark(function t(r,e){var n,o;return V.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=document.getElementsByTagName("head")[0],n){a.next=3;break}throw new Error("loadScript");case 3:return o=document.createElement("script"),o.setAttribute("type","text/javascript"),o.setAttribute("src",r),e&&(o.id=e),a.abrupt("return",new Promise(function(u,s){o.onload=u,o.onerror=function(c){return s(new Error("Unable to load script '".concat(r,"': ").concat(c)))},n.appendChild(o)}));case 8:case"end":return a.stop()}},t)})),we.apply(this,arguments)}function Oe(){var t=1,r=1;return function(){return t=Math.sin(r*17.23),r=Math.cos(t*27.92),Go(Math.abs(t*r)*1432.71)}}function Go(t){return t-Math.floor(t)}var an=Oe();function Mt(t,r,e){if(t===r)return!0;if(!e||!t||!r)return!1;if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var n=0;n<t.length;n++)if(!Mt(t[n],r[n],e-1))return!1;return!0}if(Array.isArray(r))return!1;if(M(t)==="object"&&M(r)==="object"){var o=Object.keys(t),i=Object.keys(r);if(o.length!==i.length)return!1;for(var a=0,u=o;a<u.length;a++){var s=u[a];if(!r.hasOwnProperty(s)||!Mt(t[s],r[s],e-1))return!1}return!0}return!1}function sn(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function un(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var Ho=function(r){return"".concat(r)};return yn(Vo);})();
17
+ `)}function Fo(t,r){for(var e="",n=r-2;n<=r;n++){var o=t[n];o!==void 0&&(e+="".concat(zo(String(n),4),": ").concat(o,`
18
+ `))}return e}function zo(t,r){for(var e="",n=t.length;n<r;++n)e+=" ";return e+t}function Zr(t){return t}function Go(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.maxElts,n=e===void 0?16:e,o=r.size,i=o===void 0?1:o,a="[",u=0;u<t.length&&u<n;++u)u>0&&(a+=",".concat(u%i===0?" ":"")),a+=ge(t[u],r);var s=t.length>n?"...":"]";return"".concat(a).concat(s)}function ge(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=1e-16,n=r.isInteger,o=n===void 0?!1:n;if(Array.isArray(t)||ArrayBuffer.isView(t))return Go(t,r);if(typeof t!="number")return String(t);if(Math.abs(t)<e)return o?"0":"0.";if(o||Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);var i=t.toPrecision(2),a=i.indexOf(".0");return a===i.length-2?i.slice(0,-1):i}function Qr(t,r,e,n){var o="See luma.gl ".concat(e," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),i=Object.getPrototypeOf(t);n.forEach(function(a){i.methodName||(i[a]=function(){throw S.removed("Calling removed method ".concat(r,".").concat(a,": "),o)(),new Error(a)})})}function tn(t,r,e){var n=e.removedProps,o=n===void 0?{}:n,i=e.deprecatedProps,a=i===void 0?{}:i,u=e.replacedProps,s=u===void 0?{}:u;for(var c in o)if(c in r){var O=o[c],_=O?"".concat(t,".").concat(o[c]):"N/A";S.removed("".concat(t,".").concat(c),_)()}for(var T in a)if(T in r){var I=a[T];S.deprecated("".concat(t,".").concat(T),"".concat(t,".").concat(I))()}for(var j=null,U=0,z=Object.entries(s);U<z.length;U++){var F=A(z[U],2),N=F[0],ft=F[1];N in r&&(S.deprecated("".concat(t,".").concat(N),"".concat(t,".").concat(ft))(),j=j||Object.assign({},r),j[ft]=r[N],delete j[N])}return j||r}var V=Pe(Wt(),1),It="";function en(t){It=t}function rn(t,r){return ye.apply(this,arguments)}function ye(){return ye=q(V.default.mark(function t(r,e){var n,o;return V.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=r.startsWith("http")?r:It+r,n=e?.dataType||"text",a.next=4,fetch(r,e);case 4:return o=a.sent,a.next=7,o[n]();case 7:return a.abrupt("return",a.sent);case 8:case"end":return a.stop()}},t)})),ye.apply(this,arguments)}function nn(t,r){return ve.apply(this,arguments)}function ve(){return ve=q(V.default.mark(function t(r,e){var n;return V.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=new Image,n.crossOrigin=e?.crossOrigin||"anonymous",n.src=r.startsWith("http")?r:It+r,i.next=5,n.decode();case 5:return i.next=7,createImageBitmap(n);case 7:return i.abrupt("return",i.sent);case 8:case"end":return i.stop()}},t)})),ve.apply(this,arguments)}function on(t,r){return be.apply(this,arguments)}function be(){return be=q(V.default.mark(function t(r,e){return V.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Promise(function(i,a){try{var u=new Image;u.onload=function(){return i(u)},u.onerror=function(){return a(new Error("Could not load image ".concat(r,".")))},u.crossOrigin=e?.crossOrigin||"anonymous",u.src=r.startsWith("http")?r:It+r}catch(s){a(s)}}));case 1:case"end":return o.stop()}},t)})),be.apply(this,arguments)}function an(t,r){return we.apply(this,arguments)}function we(){return we=q(V.default.mark(function t(r,e){var n,o;return V.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=document.getElementsByTagName("head")[0],n){a.next=3;break}throw new Error("loadScript");case 3:return o=document.createElement("script"),o.setAttribute("type","text/javascript"),o.setAttribute("src",r),e&&(o.id=e),a.abrupt("return",new Promise(function(u,s){o.onload=u,o.onerror=function(c){return s(new Error("Unable to load script '".concat(r,"': ").concat(c)))},n.appendChild(o)}));case 8:case"end":return a.stop()}},t)})),we.apply(this,arguments)}function Oe(){var t=1,r=1;return function(){return t=Math.sin(r*17.23),r=Math.cos(t*27.92),Ho(Math.abs(t*r)*1432.71)}}function Ho(t){return t-Math.floor(t)}var sn=Oe();function Mt(t,r,e){if(t===r)return!0;if(!e||!t||!r)return!1;if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var n=0;n<t.length;n++)if(!Mt(t[n],r[n],e-1))return!1;return!0}if(Array.isArray(r))return!1;if(M(t)==="object"&&M(r)==="object"){var o=Object.keys(t),i=Object.keys(r);if(o.length!==i.length)return!1;for(var a=0,u=o;a<u.length;a++){var s=u[a];if(!r.hasOwnProperty(s)||!Mt(t[s],r[s],e-1))return!1}return!0}return!1}function un(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function cn(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var Vo=function(r){return"".concat(r)};return vn(Wo);})();
19
19
  /*! Bundled license information:
20
20
 
21
21
  @babel/runtime/helpers/regeneratorRuntime.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/core",
3
- "version": "9.0.0-alpha.40",
3
+ "version": "9.0.0-alpha.42",
4
4
  "description": "luma.gl API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,5 +42,5 @@
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "@types/offscreencanvas": "^2019.6.4"
44
44
  },
45
- "gitHead": "5a6f2bc7a4d24a65b74ae905844ad5bfc36c5645"
45
+ "gitHead": "61f38eaaa9cc42fa08d1c00690e370fa85681e30"
46
46
  }
@@ -1,10 +1,14 @@
1
1
  // luma.gl, MIT license
2
2
  import type {ShaderUniformType} from '../../adapter/types/shader-types';
3
3
  import type {UniformValue} from '../../adapter/types/types';
4
- import {ShaderLayout, UniformBufferBindingLayout, UniformInfo} from '../../adapter/types/shader-layout';
5
- import { arrayEqual } from '../utils/array-equal';
4
+ import {
5
+ ShaderLayout,
6
+ UniformInfo,
7
+ UniformBufferBindingLayout
8
+ } from '../../adapter/types/shader-layout';
9
+ import {arrayEqual, arrayCopy} from '../utils/array-equal';
6
10
 
7
- /**
11
+ /**
8
12
  * A uniform block holds values of the of uniform values for one uniform block / buffer.
9
13
  * It also does some book keeping on what has changed, to minimize unnecessary writes to uniform buffers.
10
14
  * @todo - Track changes to individual uniforms (for WebGL1)
@@ -21,15 +25,16 @@ export class UniformBlock<TUniforms extends Record<string, UniformValue>> {
21
25
 
22
26
  constructor(props?: {
23
27
  name?: string;
24
- shaderLayout?: ShaderLayout;
25
- uniformTypes?: Record<keyof TUniforms, Record<string, ShaderUniformType>>
28
+ shaderLayout?: ShaderLayout;
29
+ uniformTypes?: Record<keyof TUniforms, Record<string, ShaderUniformType>>;
26
30
  }) {
27
31
  this.name = props?.name;
28
32
 
29
33
  // TODO - Extract uniform layout from the shaderLayout object
30
34
  if (props?.name && props?.shaderLayout) {
31
- const binding = props?.shaderLayout.bindings
32
- ?.find(binding => binding.type === 'uniform' && binding.name === props?.name);
35
+ const binding = props?.shaderLayout.bindings?.find(
36
+ binding => binding.type === 'uniform' && binding.name === props?.name
37
+ );
33
38
  if (!binding) {
34
39
  throw new Error(props?.name);
35
40
  }
@@ -68,7 +73,7 @@ export class UniformBlock<TUniforms extends Record<string, UniformValue>> {
68
73
  if (arrayEqual(this.uniforms[key], value)) {
69
74
  return;
70
75
  }
71
- this.uniforms[key] = value;
76
+ this.uniforms[key] = arrayCopy(value);
72
77
  this.modifiedUniforms[key] = true;
73
78
  this.modified = true;
74
79
  }
@@ -22,3 +22,12 @@ export function arrayEqual(a: unknown, b: unknown, limit: number = 16) {
22
22
  }
23
23
  return true;
24
24
  }
25
+
26
+ /** Copy a value */
27
+ export function arrayCopy<T>(a: T): T {
28
+ const numberArray = isNumberArray(a);
29
+ if (numberArray) {
30
+ return numberArray.slice() as T;
31
+ }
32
+ return a;
33
+ }