@luma.gl/webgpu 9.0.0-alpha.9 → 9.0.0-beta.2
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/LICENSE +3 -1
- package/dist/adapter/helpers/accessor-to-format.js.map +1 -1
- package/dist/adapter/helpers/convert-texture-format.d.ts +2 -2
- package/dist/adapter/helpers/convert-texture-format.d.ts.map +1 -1
- package/dist/adapter/helpers/convert-texture-format.js +0 -1
- package/dist/adapter/helpers/convert-texture-format.js.map +1 -1
- package/dist/adapter/helpers/generate-mipmaps.d.ts +1 -1
- package/dist/adapter/helpers/generate-mipmaps.js +20 -15
- package/dist/adapter/helpers/generate-mipmaps.js.map +1 -1
- package/dist/adapter/helpers/get-bind-group.d.ts +4 -4
- package/dist/adapter/helpers/get-bind-group.d.ts.map +1 -1
- package/dist/adapter/helpers/get-bind-group.js +11 -18
- package/dist/adapter/helpers/get-bind-group.js.map +1 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts +5 -5
- package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.js +39 -43
- package/dist/adapter/helpers/get-vertex-buffer-layout.js.map +1 -1
- package/dist/adapter/helpers/webgpu-parameters.d.ts +2 -2
- package/dist/adapter/helpers/webgpu-parameters.d.ts.map +1 -1
- package/dist/adapter/helpers/webgpu-parameters.js +14 -20
- package/dist/adapter/helpers/webgpu-parameters.js.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.d.ts +14 -5
- package/dist/adapter/resources/webgpu-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.js +19 -29
- package/dist/adapter/resources/webgpu-buffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.d.ts +7 -14
- package/dist/adapter/resources/webgpu-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.js +13 -27
- package/dist/adapter/resources/webgpu-command-encoder.js.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.d.ts +5 -5
- package/dist/adapter/resources/webgpu-compute-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.js +13 -27
- package/dist/adapter/resources/webgpu-compute-pass.js.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts +4 -4
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.js +8 -13
- package/dist/adapter/resources/webgpu-compute-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgpu-external-texture.d.ts +5 -5
- package/dist/adapter/resources/webgpu-external-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-external-texture.js +6 -14
- package/dist/adapter/resources/webgpu-external-texture.js.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.d.ts +4 -21
- package/dist/adapter/resources/webgpu-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.js +4 -105
- package/dist/adapter/resources/webgpu-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-query.js.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.d.ts +12 -7
- package/dist/adapter/resources/webgpu-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.js +53 -36
- package/dist/adapter/resources/webgpu-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts +15 -22
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.js +46 -118
- package/dist/adapter/resources/webgpu-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgpu-sampler.d.ts +5 -5
- package/dist/adapter/resources/webgpu-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-sampler.js +8 -14
- package/dist/adapter/resources/webgpu-sampler.js.map +1 -1
- package/dist/adapter/resources/webgpu-shader.d.ts +9 -9
- package/dist/adapter/resources/webgpu-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-shader.js +16 -29
- package/dist/adapter/resources/webgpu-shader.js.map +1 -1
- package/dist/adapter/resources/webgpu-texture.d.ts +18 -8
- package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture.js +38 -33
- package/dist/adapter/resources/webgpu-texture.js.map +1 -1
- package/dist/adapter/resources/webgpu-vertex-array.d.ts +26 -0
- package/dist/adapter/resources/webgpu-vertex-array.d.ts.map +1 -0
- package/dist/adapter/resources/webgpu-vertex-array.js +45 -0
- package/dist/adapter/resources/webgpu-vertex-array.js.map +1 -0
- package/dist/adapter/webgpu-canvas-context.d.ts +17 -12
- package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgpu-canvas-context.js +26 -47
- package/dist/adapter/webgpu-canvas-context.js.map +1 -1
- package/dist/adapter/webgpu-device.d.ts +34 -17
- package/dist/adapter/webgpu-device.d.ts.map +1 -1
- package/dist/adapter/webgpu-device.js +94 -103
- package/dist/adapter/webgpu-device.js.map +1 -1
- package/dist/adapter/webgpu-types.js.map +1 -1
- package/dist/dist.dev.js +3142 -0
- package/dist/glsl/glsllang.js +0 -1
- package/dist/glsl/glsllang.js.map +1 -1
- package/dist/index.cjs +1550 -0
- package/dist/index.d.ts +5 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist.min.js +30 -0
- package/package.json +18 -9
- package/src/adapter/helpers/accessor-to-format.ts +1 -2
- package/src/adapter/helpers/convert-texture-format.ts +1 -1
- package/src/adapter/helpers/generate-mipmaps.ts +2 -2
- package/src/adapter/helpers/get-bind-group.ts +23 -13
- package/src/adapter/helpers/get-vertex-buffer-layout.ts +65 -39
- package/src/adapter/helpers/webgpu-parameters.ts +20 -14
- package/src/adapter/resources/webgpu-buffer.ts +63 -8
- package/src/adapter/resources/webgpu-command-encoder.ts +68 -48
- package/src/adapter/resources/webgpu-compute-pass.ts +13 -12
- package/src/adapter/resources/webgpu-compute-pipeline.ts +8 -7
- package/src/adapter/resources/webgpu-external-texture.ts +5 -5
- package/src/adapter/resources/webgpu-framebuffer.ts +8 -109
- package/src/adapter/resources/webgpu-query.ts +3 -3
- package/src/adapter/resources/webgpu-render-pass.ts +68 -15
- package/src/adapter/resources/webgpu-render-pipeline.ts +117 -97
- package/src/adapter/resources/webgpu-sampler.ts +6 -6
- package/src/adapter/resources/webgpu-shader.ts +25 -16
- package/src/adapter/resources/webgpu-texture.ts +54 -25
- package/src/adapter/resources/webgpu-vertex-array.ts +83 -0
- package/src/adapter/webgpu-canvas-context.ts +51 -26
- package/src/adapter/webgpu-device.ts +144 -48
- package/src/index.ts +7 -9
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/bundle.js.map +0 -1
- package/dist/init.d.ts +0 -2
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -4
- package/dist/init.js.map +0 -1
- package/src/bundle.ts +0 -4
- package/src/init.ts +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { default as WebGPUSampler } from './adapter/resources/webgpu-sampler';
|
|
7
|
-
export { default as WebGPUShader } from './adapter/resources/webgpu-shader';
|
|
1
|
+
export { WebGPUDevice } from './adapter/webgpu-device';
|
|
2
|
+
export { WebGPUBuffer } from './adapter/resources/webgpu-buffer';
|
|
3
|
+
export { WebGPUTexture } from './adapter/resources/webgpu-texture';
|
|
4
|
+
export { WebGPUSampler } from './adapter/resources/webgpu-sampler';
|
|
5
|
+
export { WebGPUShader } from './adapter/resources/webgpu-shader';
|
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { default as WebGPUSampler } from './adapter/resources/webgpu-sampler';
|
|
7
|
-
export { default as WebGPUShader } from './adapter/resources/webgpu-shader';
|
|
1
|
+
export { WebGPUDevice } from "./adapter/webgpu-device.js";
|
|
2
|
+
export { WebGPUBuffer } from "./adapter/resources/webgpu-buffer.js";
|
|
3
|
+
export { WebGPUTexture } from "./adapter/resources/webgpu-texture.js";
|
|
4
|
+
export { WebGPUSampler } from "./adapter/resources/webgpu-sampler.js";
|
|
5
|
+
export { WebGPUShader } from "./adapter/resources/webgpu-shader.js";
|
|
8
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["WebGPUDevice","WebGPUBuffer","WebGPUTexture","WebGPUSampler","WebGPUShader"],"sources":["../src/index.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n// WEBGPU ADAPTER\nexport {WebGPUDevice} from './adapter/webgpu-device';\n\n// WEBGPU CLASSES (typically not accessed directly)\nexport {WebGPUBuffer} from './adapter/resources/webgpu-buffer';\nexport {WebGPUTexture} from './adapter/resources/webgpu-texture';\nexport {WebGPUSampler} from './adapter/resources/webgpu-sampler';\nexport {WebGPUShader} from './adapter/resources/webgpu-shader';\n"],"mappings":"SAIQA,YAAY;AAAA,SAGZC,YAAY;AAAA,SACZC,aAAa;AAAA,SACbC,aAAa;AAAA,SACbC,YAAY"}
|
package/dist.min.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if (typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
|
+
else if (typeof exports === 'object') exports['luma'] = factory();
|
|
6
|
+
else root['luma'] = factory();})(globalThis, function () {
|
|
7
|
+
var __exports__=(()=>{var Dt=Object.defineProperty;var Qo=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ti=Object.prototype.hasOwnProperty;var ri=(e,t)=>{for(var r in t)Dt(e,r,{get:t[r],enumerable:!0})},ni=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ei(t))!ti.call(e,o)&&o!==r&&Dt(e,o,{get:()=>t[o],enumerable:!(n=Qo(t,o))||n.enumerable});return e};var oi=e=>ni(Dt({},"__esModule",{value:!0}),e);var pl={};ri(pl,{WebGPUBuffer:()=>bt,WebGPUDevice:()=>mr,WebGPUSampler:()=>K,WebGPUShader:()=>St,WebGPUTexture:()=>_t});function Le(e){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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function M(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Le()}var ii=globalThis.self||globalThis.window||globalThis.global,oe=globalThis.window||globalThis.self||globalThis.global,ai=globalThis.document||{},Z=globalThis.process||{},ui=globalThis.console,vr=globalThis.navigator||{};var Ve=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",gl=M();var Bt=globalThis;function He(e){if(!e&&!M())return"Node";if(Le(e))return"Electron";let t=e||vr.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Bt.chrome?"Chrome":Bt.safari?"Safari":Bt.mozInnerScreenX?"Firefox":"Unknown"}function fi(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Ke=class{constructor(t,r){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=fi(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function br(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function gr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function $e(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let i=e.width*r,a=e.height*r,l=["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(t," %c+"),l]}var Ye;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ye||(Ye={}));var ci=10;function wr(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ye[e]||Ye.WHITE)}function _r(e,t,r){if(!M&&typeof e=="string"){if(t){let n=wr(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=wr(r);e="\x1B[".concat(n+ci,"m").concat(e,"\x1B[49m")}}return e}function Or(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let i of n){let a=o[i];typeof a=="function"&&(t.find(l=>i===l)||(o[i]=a.bind(e)))}}function ie(e,t){if(!e)throw new Error(t||"Assertion failed")}function J(){let e;if(M()&&oe.performance){var t,r;e=oe===null||oe===void 0||(t=oe.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Z){var n;let o=Z===null||Z===void 0||(n=Z.hrtime)===null||n===void 0?void 0:n.call(Z);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var ae={debug:M()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},si={enabled:!0,level:0};function H(){}var Pr={},Sr={once:!0},X=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Ve,this._startTs=J(),this._deltaTs=J(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Ke("__probe-".concat(this.id,"__"),si),this.timeStamp("".concat(this.id," started")),Or(this),Object.seal(this)}set level(t){this.setLevel(t)}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(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){ie(t,r)}warn(t){return this._getLogFunction(0,t,ae.warn,arguments,Sr)}error(t){return this._getLogFunction(0,t,ae.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,ae.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,ae.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,ae.debug||ae.info,arguments,Sr)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||H,n&&[n],{tag:di(r)}):H}image(t){let{logLevel:r,priority:n,image:o,message:i="",scale:a=1}=t;return this._shouldLog(r||n)?M()?hi({image:o,message:i,scale:a}):pi({image:o,message:i,scale:a}):H}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||H)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Tr({logLevel:t,message:r,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||H)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=jr(t)}_getLogFunction(t,r,n,o,i){if(this._shouldLog(t)){i=Tr({logLevel:t,message:r,args:o,opts:i}),n=n||i.method,ie(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=J();let a=i.tag||i.message;if(i.once&&a)if(!Pr[a])Pr[a]=J();else return H;return r=li(this.id,i.message,i),n.bind(console,r,...i.args)}return H}};X.VERSION=Ve;function jr(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return ie(Number.isFinite(t)&&t>=0),t}function Tr(e){let{logLevel:t,message:r}=e;e.logLevel=jr(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let o=typeof e.message;return ie(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function li(e,t,r){if(typeof t=="string"){let n=r.time?gr(br(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=_r(t,r.color,r.background)}return t}function pi(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),H}function hi(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let i=new Image;return i.onload=()=>{let a=$e(i,r,n);console.log(...a)},i.src=t,H}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...$e(t,r,n)),H;if(o.toLowerCase()==="canvas"){let i=new Image;return i.onload=()=>console.log(...$e(i,r,n)),i.src=t.toDataURL(),H}return H}function di(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var ql=new X({id:"@probe.gl/log"});var S=new X({id:"luma.gl"});function De(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Q=class{constructor(t,r){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=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=De(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(De()-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 ue=class{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,o=this.stats[r];return o||(t instanceof Q?o=t:o=new Q(r,n),this.stats[r]=o),o}};function Be(e){return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(e)}function Er(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mi(n.key),n)}}function yi(e,t,r){return t&&Er(e.prototype,t),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mi(e){var t=vi(e,"string");return Be(t)==="symbol"?t:String(t)}function vi(e,t){if(Be(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var gi=function(){function e(){bi(this,e),this.stats=new Map}var t=e.prototype;return t.getStats=function(n){return this.get(n)},t.get=function(n){return this.stats.has(n)||this.stats.set(n,new ue({id:n})),this.stats.get(n)},yi(e)}(),Xe=new gi;function wi(){var e=typeof __VERSION__<"u"?__VERSION__:"running from source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==e)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(e));return globalThis.luma||(M()&&S.log(1,"".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:S,stats:Xe}),e}var xr=wi();var Gt={};function Y(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Gt[e]=Gt[e]||1;var t=Gt[e]++;return"".concat(e,"-").concat(t)}function Nt(e){var t=!0;for(var r in e){t=!1;break}return t}function Ge(e){return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(e)}function Rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rr(Object(r),!0).forEach(function(n){Oi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oi(e,t,r){return t=Ir(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ar(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ir(n.key),n)}}function Pi(e,t,r){return t&&Ar(e.prototype,t),r&&Ar(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ir(e){var t=Si(e,"string");return Ge(t)==="symbol"?t:String(t)}function Si(e,t){if(Ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ti(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var E=function(){function e(r,n,o){if(Ti(this,e),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,!r)throw new Error("no device");this._device=r,this.props=ji(n,o);var i=this.props.id!=="undefined"?this.props.id:Y(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}var t=e.prototype;return t.destroy=function(){this.destroyResource()},t.delete=function(){return this.destroy(),this},t.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},t.getProps=function(){return this.props},t.attachResource=function(n){this._attachedResources.add(n)},t.detachResource=function(n){this._attachedResources.delete(n)},t.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},t.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},t.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},t.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("".concat(o,"s Active")).decrementCount()},t.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},t.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},t.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()},Pi(e)}();E.defaultProps={id:"undefined",handle:void 0,userData:void 0};function ji(e,t){var r=_i({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function fe(e){return fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(e)}var Br;function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lr(Object(r),!0).forEach(function(n){Ei(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ei(e,t,r){return t=Gr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Gr(n.key),n)}}function Ri(e,t,r){return t&&Dr(e.prototype,t),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gr(e){var t=Ai(e,"string");return fe(t)==="symbol"?t:String(t)}function Ai(e,t){if(fe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ii(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kt(e,t)}function kt(e,t){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},kt(e,t)}function Li(e){var t=Gi();return function(){var n=qe(e),o;if(t){var i=qe(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Di(this,o)}}function Di(e,t){if(t&&(fe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bi(e)}function Bi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gi(){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}}function qe(e){return qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qe(e)}Br=Symbol.toStringTag;var N=function(e){Ii(r,e);var t=Li(r);function r(o,i){var a;xi(this,r);var l=Ct({},i);return(i.usage||0)&r.INDEX&&!i.indexType&&(i.data instanceof Uint32Array?l.indexType="uint32":i.data instanceof Uint16Array&&(l.indexType="uint16")),a=t.call(this,o,l,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.debugData=new ArrayBuffer(0),a.usage=i.usage||0,a.indexType=l.indexType,a}var n=r.prototype;return n.readSyncWebGL2=function(i,a){throw new Error("not implemented")},n._setDebugData=function(i,a,l){var s=ArrayBuffer.isView(i)?i.buffer:i,h=Math.min(i?i.byteLength:l,r.DEBUG_DATA_MAX_LENGTH);i===null?this.debugData=new ArrayBuffer(h):a===0&&l===i.byteLength?this.debugData=s.slice(0,h):this.debugData=s.slice(a,a+h)},Ri(r,[{key:Br,get:function(){return"Buffer"}}]),r}(E);N.defaultProps=Ct(Ct({},E.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});N.MAP_READ=1;N.MAP_WRITE=2;N.COPY_SRC=4;N.COPY_DST=8;N.INDEX=16;N.VERTEX=32;N.UNIFORM=64;N.STORAGE=128;N.INDIRECT=256;N.QUERY_RESOLVE=512;N.DEBUG_DATA_MAX_LENGTH=32;function Ne(e){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}var kr;function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nr(Object(r),!0).forEach(function(n){Ni(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ni(e,t,r){return t=Mr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mr(n.key),n)}}function ki(e,t,r){return t&&Cr(e.prototype,t),r&&Cr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mr(e){var t=Mi(e,"string");return Ne(t)==="symbol"?t:String(t)}function Mi(e,t){if(Ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}kr=Symbol.toStringTag;var Ce=function(){function e(r){Ci(this,e),this.id=void 0,this.statsManager=Xe,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Mt(Mt({},e.defaultProps),r),this.id=this.props.id||Y(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t.readPixelsToArrayWebGL=function(n,o){throw new Error("not implemented")},t.readPixelsToBufferWebGL2=function(n,o){throw new Error("not implemented")},t.setParametersWebGL=function(n){throw new Error("not implemented")},t.withParametersWebGL=function(n,o){throw new Error("not implemented")},t.clearWebGL=function(n){throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var o=Mt({},n);return(n.usage||0)&N.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},ki(e,[{key:kr,get:function(){return"Device"}}]),e}();Ce.defaultProps={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};Ce.VERSION=xr;function ke(e){return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ke(e)}function Ze(e,t){return Fi(e)||Wi(e,t)||Kr(e,t)||Ui()}function Ui(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
8
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wi(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function Fi(e){if(Array.isArray(e))return e}function zi(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Kr(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(h){throw h},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var h=r.next();return i=h.done,h},e:function(h){a=!0,l=h},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function Kr(e,t){if(e){if(typeof e=="string")return Ur(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ur(e,t)}}function Ur(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wr(Object(r),!0).forEach(function(n){Vi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vi(e,t,r){return t=$r(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$r(n.key),n)}}function Ki(e,t,r){return t&&zr(e.prototype,t),r&&zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $r(e){var t=$i(e,"string");return ke(t)==="symbol"?t:String(t)}function $i(e,t){if(ke(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ke(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yi=M()&&typeof document<"u",Je=function(){return Yi&&document.readyState==="complete"},Xi={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},ce=function(){function e(r){var n=this;if(Hi(this,e),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=Fr(Fr({},Xi),r),r=this.props,!M()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(r.canvas)typeof r.canvas=="string"?this.canvas=Ji(r.canvas):this.canvas=r.canvas;else{var o,i,a=Qi(r),l=Zi(((o=r)===null||o===void 0?void 0:o.container)||null);l.insertBefore(a,l.firstChild),this.canvas=a,(i=r)!==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&&r.autoResize&&(this.resizeObserver=new ResizeObserver(function(s){var h=zi(s),b;try{for(h.s();!(b=h.n()).done;){var m=b.value;m.target===n.canvas&&n.update()}}catch(w){h.e(w)}finally{h.f()}}),this.resizeObserver.observe(this.canvas))}var t=e.prototype;return t.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},t.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)}},t.getAspect=function(){var n=this.getPixelSize(),o=Ze(n,2),i=o[0],a=o[1];return i/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),o=Ze(n,1),i=o[0],a=this._canvasSizeInfo.clientWidth;return a?i/a:1}catch{return 1}},t.cssToDevicePixels=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),l=Ze(a,2),s=l[0],h=l[1];return ea(n,i,s,h,o)},t.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 l=this._canvasSizeInfo;if(l.clientWidth!==i||l.clientHeight!==a||l.devicePixelRatio!==n){var s=n,h=Math.floor(i*s),b=Math.floor(a*s);this.htmlCanvas.width=h,this.htmlCanvas.height=b;var m=this.getDrawingBufferSize(),w=Ze(m,2),O=w[0],P=w[1];(O!==h||P!==b)&&(s=Math.min(O/i,P/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}}},t.getDrawingBufferSize=function(){var n=this.device.gl;if(!n)throw new Error("canvas size");return[n.drawingBufferWidth,n.drawingBufferHeight]},t._setAutoCreatedCanvasId=function(n){var o;((o=this.htmlCanvas)===null||o===void 0?void 0:o.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},Ki(e,null,[{key:"isPageLoaded",get:function(){return Je()}}]),e}();ce.pageLoaded=qi();function qi(){return Je()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Zi(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!Je())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!t)throw new Error("".concat(e," is not an HTML element"));return t}else if(e)return e;return document.body}function Ji(e){var t=document.getElementById(e);if(!t&&!Je())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return t}function Qi(e){var t=e.width,r=e.height,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=t||1,n.height=r||1,n.style.width=Number.isFinite(t)?"".concat(t,"px"):"100%",n.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",n}function ea(e,t,r,n,o){var i=e,a=Vr(i[0],t,r),l=Hr(i[1],t,n,o),s=Vr(i[0]+1,t,r),h=s===r-1?s:s-1;s=Hr(i[1]+1,t,n,o);var b;return o?(s=s===0?s:s+1,b=l,l=s):b=s===n-1?s:s-1,{x:a,y:l,width:Math.max(h-a+1,1),height:Math.max(b-l+1,1)}}function Vr(e,t,r){var n=Math.min(Math.round(e*t),r-1);return n}function Hr(e,t,r,n){return n?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}function se(e){return se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(e)}var Zr;function Yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yr(Object(r),!0).forEach(function(n){ta(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ta(e,t,r){return t=Jr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jr(n.key),n)}}function na(e,t,r){return t&&qr(e.prototype,t),r&&qr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jr(e){var t=oa(e,"string");return se(t)==="symbol"?t:String(t)}function oa(e,t){if(se(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(se(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ia(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ut(e,t)}function Ut(e,t){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ut(e,t)}function aa(e){var t=ca();return function(){var n=Qe(e),o;if(t){var i=Qe(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ua(this,o)}}function ua(e,t){if(t&&(se(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fa(e)}function fa(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ca(){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}}function Qe(e){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qe(e)}Zr=Symbol.toStringTag;var V=function(e){ia(r,e);var t=aa(r);function r(n,o){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return ra(this,r),i=t.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 na(r,[{key:Zr,get:function(){return"Texture"}}]),r}(E);V.defaultProps=Xr(Xr({},E.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});V.COPY_SRC=1;V.COPY_DST=2;V.TEXTURE_BINDING=4;V.STORAGE_BINDING=8;V.RENDER_ATTACHMENT=16;function le(e){return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(e)}var rn;function Qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function en(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qr(Object(r),!0).forEach(function(n){sa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sa(e,t,r){return t=nn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function la(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nn(n.key),n)}}function pa(e,t,r){return t&&tn(e.prototype,t),r&&tn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function nn(e){var t=ha(e,"string");return le(t)==="symbol"?t:String(t)}function ha(e,t){if(le(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function da(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wt(e,t)}function Wt(e,t){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Wt(e,t)}function ya(e){var t=ba();return function(){var n=et(e),o;if(t){var i=et(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ma(this,o)}}function ma(e,t){if(t&&(le(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return va(e)}function va(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ba(){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}}function et(e){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},et(e)}rn=Symbol.toStringTag;var tt=function(e){da(r,e);var t=ya(r);function r(n,o){return la(this,r),t.call(this,n,o,r.defaultProps)}return pa(r,[{key:rn,get:function(){return"ExternalTexture"}}]),r}(E);tt.defaultProps=en(en({},E.defaultProps),{},{source:null,colorSpace:"srgb"});function Me(e){return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Me(e)}function ga(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=wa(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(h){throw h},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,l;return{s:function(){r=r.call(e)},n:function(){var h=r.next();return i=h.done,h},e:function(h){a=!0,l=h},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function wa(e,t){if(e){if(typeof e=="string")return on(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return on(e,t)}}function on(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function an(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?an(Object(r),!0).forEach(function(n){_a(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):an(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _a(e,t,r){return t=Oa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oa(e){var t=Pa(e,"string");return Me(t)==="symbol"?t:String(t)}function Pa(e,t){if(Me(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cn(e,t,r){var n="",o=t.split(/\r?\n/),i=e.slice().sort(function(w,O){return w.lineNum-O.lineNum});switch(r?.showSourceCode||"no"){case"all":for(var a=0,l=1;l<=o.length;l++)for(n+=sn(o[l-1],l,r);i.length>a&&i[a].lineNum===l;){var s=i[a++];n+=fn(s,o,s.lineNum,un(un({},r),{},{inlineSource:!1}))}return n;case"issues":case"no":var h=ga(e),b;try{for(h.s();!(b=h.n()).done;){var m=b.value;n+=fn(m,o,m.lineNum,{inlineSource:r?.showSourceCode!=="no"})}}catch(w){h.e(w)}finally{h.f()}return n}}function fn(e,t,r,n){if(n!=null&&n.inlineSource){var o=Sa(t,r),i=e.linePos>0?"".concat(" ".repeat(e.linePos+5),`^^^
|
|
11
|
+
`):"";return`
|
|
12
|
+
`.concat(o).concat(i).concat(e.type.toUpperCase(),": ").concat(e.message,`
|
|
13
|
+
|
|
14
|
+
`)}return n!=null&&n.html?`<div class='luma-compiler-log-error' style="color:red;"><b> `.concat(e.type.toUpperCase(),": ").concat(e.message,"</b></div>"):"".concat(e.type.toUpperCase(),": ").concat(e.message)}function Sa(e,t,r){for(var n="",o=t-2;o<=t;o++){var i=e[o-1];i!==void 0&&(n+=sn(i,t,r))}return n}function sn(e,t,r){var n=r!=null&&r.html?ja(e):e;return"".concat(Ta(String(t),4),": ").concat(n).concat(r!=null&&r.html?"<br/>":`
|
|
15
|
+
`)}function Ta(e,t){for(var r="",n=e.length;n<t;++n)r+=" ";return r+e}function ja(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Ft(e,t){return{name:Ea(e,t),language:"glsl",version:xa(e)}}function Ea(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=r.exec(e);return n?n[1]:t}function xa(e){var t=100,r=e.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(t=n)}return t}function ee(e){return ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ee(e)}var dn;function zt(){"use strict";zt=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(c,u,f){c[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(c,u,f){return Object.defineProperty(c,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[u]}try{s({},"")}catch{s=function(f,p,y){return f[p]=y}}function h(c,u,f,p){var y=u&&u.prototype instanceof w?u:w,d=Object.create(y.prototype),v=new L(p||[]);return n(d,"_invoke",{value:W(c,f,v)}),d}function b(c,u,f){try{return{type:"normal",arg:c.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=h;var m={};function w(){}function O(){}function P(){}var I={};s(I,i,function(){return this});var D=Object.getPrototypeOf,A=D&&D(D(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=w.prototype=Object.create(I);function B(c){["next","throw","return"].forEach(function(u){s(c,u,function(f){return this._invoke(u,f)})})}function G(c,u){function f(y,d,v,g){var _=b(c[y],c,d);if(_.type!=="throw"){var x=_.arg,j=x.value;return j&&ee(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,g)},function(R){f("throw",R,v,g)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,g)})}g(_.arg)}var p;n(this,"_invoke",{value:function(d,v){function g(){return new u(function(_,x){f(d,v,_,x)})}return p=p?p.then(g,g):g()}})}function W(c,u,f){var p="suspendedStart";return function(y,d){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw d;return z()}for(f.method=y,f.arg=d;;){var v=f.delegate;if(v){var g=U(v,f);if(g){if(g===m)continue;return g}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var _=b(c,u,f);if(_.type==="normal"){if(p=f.done?"completed":"suspendedYield",_.arg===m)continue;return{value:_.arg,done:f.done}}_.type==="throw"&&(p="completed",f.method="throw",f.arg=_.arg)}}}function U(c,u){var f=u.method,p=c.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&c.iterator.return&&(u.method="return",u.arg=void 0,U(c,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,c.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var d=y.arg;return d?d.done?(u[c.resultName]=d.value,u.next=c.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):d:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function F(c){var u={tryLoc:c[0]};1 in c&&(u.catchLoc=c[1]),2 in c&&(u.finallyLoc=c[2],u.afterLoc=c[3]),this.tryEntries.push(u)}function C(c){var u=c.completion||{};u.type="normal",delete u.arg,c.completion=u}function L(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(F,this),this.reset(!0)}function k(c){if(c){var u=c[i];if(u)return u.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,p=function y(){for(;++f<c.length;)if(r.call(c,f))return y.value=c[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:z}}function z(){return{value:void 0,done:!0}}return O.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:O,configurable:!0}),O.displayName=s(P,l,"GeneratorFunction"),e.isGeneratorFunction=function(c){var u=typeof c=="function"&&c.constructor;return!!u&&(u===O||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,P):(c.__proto__=P,s(c,l,"GeneratorFunction")),c.prototype=Object.create(T),c},e.awrap=function(c){return{__await:c}},B(G.prototype),s(G.prototype,a,function(){return this}),e.AsyncIterator=G,e.async=function(c,u,f,p,y){y===void 0&&(y=Promise);var d=new G(h(c,u,f,p),y);return e.isGeneratorFunction(u)?d:d.next().then(function(v){return v.done?v.value:d.next()})},B(T),s(T,l,"Generator"),s(T,i,function(){return this}),s(T,"toString",function(){return"[object Generator]"}),e.keys=function(c){var u=Object(c),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var d=f.pop();if(d in u)return y.value=d,y.done=!1,y}return y.done=!0,y}},e.values=k,L.prototype={constructor:L,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var d=this.tryEntries[y],v=d.completion;if(d.tryLoc==="root")return p("end");if(d.tryLoc<=this.prev){var g=r.call(d,"catchLoc"),_=r.call(d,"finallyLoc");if(g&&_){if(this.prev<d.catchLoc)return p(d.catchLoc,!0);if(this.prev<d.finallyLoc)return p(d.finallyLoc)}else if(g){if(this.prev<d.catchLoc)return p(d.catchLoc,!0)}else{if(!_)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return p(d.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var d=y;break}}d&&(u==="break"||u==="continue")&&d.tryLoc<=f&&f<=d.finallyLoc&&(d=null);var v=d?d.completion:{};return v.type=u,v.arg=f,d?(this.method="next",this.next=d.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var d=y.arg;C(p)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function ln(e,t,r,n,o,i,a){try{var l=e[i](a),s=l.value}catch(h){r(h);return}l.done?t(s):Promise.resolve(s).then(n,o)}function Ra(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(s){ln(i,n,o,a,l,"next",s)}function l(s){ln(i,n,o,a,l,"throw",s)}a(void 0)})}}function pn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Vt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pn(Object(r),!0).forEach(function(n){Aa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Aa(e,t,r){return t=yn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ia(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yn(n.key),n)}}function La(e,t,r){return t&&hn(e.prototype,t),r&&hn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function yn(e){var t=Da(e,"string");return ee(t)==="symbol"?t:String(t)}function Da(e,t){if(ee(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ba(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ht(e,t)}function Ht(e,t){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ht(e,t)}function Ga(e){var t=ka();return function(){var n=rt(e),o;if(t){var i=rt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Na(this,o)}}function Na(e,t){if(t&&(ee(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ca(e)}function Ca(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ka(){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}}function rt(e){return rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rt(e)}dn=Symbol.toStringTag;var nt=function(e){Ba(r,e);var t=Ga(r);function r(o,i){var a;return Ia(this,r),a=t.call(this,o,Vt({id:Ma(i)},i),r.defaultProps),a.stage=void 0,a.source=void 0,a.compilationStatus="pending",a.stage=a.props.stage,a.source=a.props.source,a}var n=r.prototype;return n.getCompilationInfoSync=function(){return null},n.debugShader=function(){var o=Ra(zt().mark(function a(){var l;return zt().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:h.t0=this.props.debug,h.next=h.t0==="never"?3:h.t0==="errors"?4:h.t0==="warnings"||h.t0==="always"?7:8;break;case 3:return h.abrupt("return");case 4:if(this.compilationStatus!=="success"){h.next=6;break}return h.abrupt("return");case 6:return h.abrupt("break",8);case 7:return h.abrupt("break",8);case 8:return h.next=10,this.getCompilationInfo();case 10:if(l=h.sent,!(this.props.debug==="warnings"&&l?.length===0)){h.next=13;break}return h.abrupt("return");case 13:this._displayShaderLog(l);case 14:case"end":return h.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n._displayShaderLog=function(i){var a,l,s=this;if(!(typeof document>"u"||!((a=document)!==null&&a!==void 0&&a.createElement))){var h=Ft(this.source).name,b="".concat(this.stage," ").concat(h),m=cn(i,this.source,{showSourceCode:"all",html:!0}),w=document.createElement("Button");w.innerHTML=`
|
|
16
|
+
<h1>Shader Compilation Error in `.concat(b,`</h1><br /><br />
|
|
17
|
+
<code style="user-select:text;"><pre>
|
|
18
|
+
`).concat(m,`
|
|
19
|
+
</pre></code>`),w.style.top="10px",w.style.left="10px",w.style.position="absolute",w.style.zIndex="9999",w.style.width="100%",w.style.textAlign="left",document.body.appendChild(w);var O=document.getElementsByClassName("luma-compiler-log-error");(l=O[0])!==null&&l!==void 0&&l.scrollIntoView&&O[0].scrollIntoView(),w.onclick=function(){var P="data:text/plain,".concat(encodeURIComponent(s.source));navigator.clipboard.writeText(P)}}},La(r,[{key:dn,get:function(){return"Shader"}}]),r}(E);nt.defaultProps=Vt(Vt({},E.defaultProps),{},{language:"auto",stage:"vertex",source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Ma(e){return Ft(e.source).name||e.id||Y("unnamed ".concat(e.stage,"-shader"))}function pe(e){return pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(e)}var gn;function mn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function vn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mn(Object(r),!0).forEach(function(n){Ua(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ua(e,t,r){return t=wn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wn(n.key),n)}}function Fa(e,t,r){return t&&bn(e.prototype,t),r&&bn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wn(e){var t=za(e,"string");return pe(t)==="symbol"?t:String(t)}function za(e,t){if(pe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Va(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kt(e,t)}function Kt(e,t){return Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Kt(e,t)}function Ha(e){var t=Ya();return function(){var n=ot(e),o;if(t){var i=ot(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ka(this,o)}}function Ka(e,t){if(t&&(pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $a(e)}function $a(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ya(){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}}function ot(e){return ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ot(e)}gn=Symbol.toStringTag;var he=function(e){Va(r,e);var t=Ha(r);function r(n,o){return Wa(this,r),t.call(this,n,o,r.defaultProps)}return Fa(r,[{key:gn,get:function(){return"Sampler"}}]),r}(E);he.defaultProps=vn(vn({},E.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});function ye(e){return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}var Sn;function _n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_n(Object(r),!0).forEach(function(n){Xa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_n(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xa(e,t,r){return t=Tn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qa(e,t){return eu(e)||Qa(e,t)||Ja(e,t)||Za()}function Za(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
20
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ja(e,t){if(e){if(typeof e=="string")return On(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return On(e,t)}}function On(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Qa(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function eu(e){if(Array.isArray(e))return e}function tu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tn(n.key),n)}}function ru(e,t,r){return t&&Pn(e.prototype,t),r&&Pn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tn(e){var t=nu(e,"string");return ye(t)==="symbol"?t:String(t)}function nu(e,t){if(ye(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ye(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ou(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$t(e,t)}function $t(e,t){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$t(e,t)}function iu(e){var t=fu();return function(){var n=it(e),o;if(t){var i=it(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return au(this,o)}}function au(e,t){if(t&&(ye(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uu(e)}function uu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fu(){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}}function it(e){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},it(e)}Sn=Symbol.toStringTag;var at=function(e){ou(r,e);var t=iu(r);function r(o){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return tu(this,r),i=t.call(this,o,a,r.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=r.prototype;return n.resize=function(i){var a=!i;if(i){var l=Array.isArray(i)?i:[i.width,i.height],s=qa(l,2),h=s[0],b=s[1];a=a||b!==this.height||h!==this.width,this.width=h,this.height=b}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(l){if(typeof l=="string"){var s=i.createColorTexture(l);return i.attachResource(s),s}return l}),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:V.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.createDepthStencilTexture=function(i){return this.device.createTexture({id:"depth-stencil-attachment",usage:V.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.resizeAttachments=function(i,a){for(var l=0;l<this.colorAttachments.length;++l)if(this.colorAttachments[l]){var s=this.device._createTexture(de(de({},this.colorAttachments[l].props),{},{width:i,height:a}));this.destroyAttachedResource(this.colorAttachments[l]),this.colorAttachments[l]=s,this.attachResource(s)}if(this.depthStencilAttachment){var h=this.device._createTexture(de(de({},this.depthStencilAttachment.props),{},{width:i,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=h,this.attachResource(h)}},ru(r,[{key:Sn,get:function(){return"Framebuffer"}}]),r}(E);at.defaultProps=de(de({},E.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});function me(e){return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(e)}var Rn;function jn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function En(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jn(Object(r),!0).forEach(function(n){cu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cu(e,t,r){return t=An(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function su(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,An(n.key),n)}}function lu(e,t,r){return t&&xn(e.prototype,t),r&&xn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function An(e){var t=pu(e,"string");return me(t)==="symbol"?t:String(t)}function pu(e,t){if(me(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yt(e,t)}function Yt(e,t){return Yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Yt(e,t)}function du(e){var t=vu();return function(){var n=ut(e),o;if(t){var i=ut(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return yu(this,o)}}function yu(e,t){if(t&&(me(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mu(e)}function mu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vu(){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}}function ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ut(e)}Rn=Symbol.toStringTag;var ft=function(e){hu(r,e);var t=du(r);function r(n,o){var i;return su(this,r),i=t.call(this,n,o,r.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 lu(r,[{key:Rn,get:function(){return"RenderPipeline"}}]),r}(E);ft.defaultProps=En(En({},E.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function ve(e){return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(e)}var Bn;function In(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ln(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?In(Object(r),!0).forEach(function(n){bu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):In(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bu(e,t,r){return t=Gn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Gn(n.key),n)}}function wu(e,t,r){return t&&Dn(e.prototype,t),r&&Dn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gn(e){var t=_u(e,"string");return ve(t)==="symbol"?t:String(t)}function _u(e,t){if(ve(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ve(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ou(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xt(e,t)}function Xt(e,t){return Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Xt(e,t)}function Pu(e){var t=ju();return function(){var n=ct(e),o;if(t){var i=ct(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Su(this,o)}}function Su(e,t){if(t&&(ve(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tu(e)}function Tu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ju(){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}}function ct(e){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ct(e)}Bn=Symbol.toStringTag;var st=function(e){Ou(r,e);var t=Pu(r);function r(n,o){var i;return gu(this,r),i=t.call(this,n,o,r.defaultProps),i.hash="",i}return wu(r,[{key:Bn,get:function(){return"ComputePipeline"}}]),r}(E);st.defaultProps=Ln(Ln({},E.defaultProps),{},{cs:void 0,csEntryPoint:void 0,csConstants:{},shaderLayout:[]});function be(e){return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},be(e)}var Mn;function Nn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Cn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nn(Object(r),!0).forEach(function(n){Eu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Eu(e,t,r){return t=Un(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Un(n.key),n)}}function Ru(e,t,r){return t&&kn(e.prototype,t),r&&kn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Un(e){var t=Au(e,"string");return be(t)==="symbol"?t:String(t)}function Au(e,t){if(be(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qt(e,t)}function qt(e,t){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},qt(e,t)}function Lu(e){var t=Gu();return function(){var n=lt(e),o;if(t){var i=lt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Du(this,o)}}function Du(e,t){if(t&&(be(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bu(e)}function Bu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gu(){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}}function lt(e){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lt(e)}Mn=Symbol.toStringTag;var pt=function(e){Iu(r,e);var t=Lu(r);function r(n,o){return xu(this,r),t.call(this,n,o,r.defaultProps)}return Ru(r,[{key:Mn,get:function(){return"RenderPass"}}]),r}(E);pt.defaultProps=Cn(Cn({},E.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});function ge(e){return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(e)}var zn;function Wn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Nu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wn(Object(r),!0).forEach(function(n){Cu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cu(e,t,r){return t=Vn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ku(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vn(n.key),n)}}function Mu(e,t,r){return t&&Fn(e.prototype,t),r&&Fn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vn(e){var t=Uu(e,"string");return ge(t)==="symbol"?t:String(t)}function Uu(e,t){if(ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zt(e,t)}function Zt(e,t){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Zt(e,t)}function Fu(e){var t=Hu();return function(){var n=ht(e),o;if(t){var i=ht(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return zu(this,o)}}function zu(e,t){if(t&&(ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vu(e)}function Vu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hu(){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}}function ht(e){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ht(e)}zn=Symbol.toStringTag;var dt=function(e){Wu(r,e);var t=Fu(r);function r(n,o){return ku(this,r),t.call(this,n,o,E.defaultProps)}return Mu(r,[{key:zn,get:function(){return"ComputePass"}}]),r}(E);dt.defaultProps=Nu({},E.defaultProps);function Ku(e,t){return qu(e)||Xu(e,t)||Yu(e,t)||$u()}function $u(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
21
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yu(e,t){if(e){if(typeof e=="string")return Hn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hn(e,t)}}function Hn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function qu(e){if(Array.isArray(e))return e}function Kn(e){var t=Ku(Ju[e],2),r=t[0],n=t[1],o=r==="i32"||r==="u32",i=r!=="u32",a=Qu[r]*n,l=Zu(r,n);return{dataType:r,components:n,defaultVertexFormat:l,byteLength:a,integer:o,signed:i}}function Zu(e,t){var r;switch(e){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return t<=2?"float16x2":"float16x4"}return t===1?r:"".concat(r,"x").concat(t)}var Ju={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]},Qu={f32:4,f16:2,i32:4,u32:4};function Yn(e){var t=$n[e],r=ef(t),n=e.includes("norm"),o=!n&&!e.startsWith("float"),i=e.startsWith("s");return{dataType:$n[e],byteLength:r,integer:o,signed:i,normalized:n}}function ef(e){var t=tf[e];return t}var $n={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},tf={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function rf(e,t){return uf(e)||af(e,t)||of(e,t)||nf()}function nf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
22
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function of(e,t){if(e){if(typeof e=="string")return Xn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xn(e,t)}}function Xn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function af(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function uf(e){if(Array.isArray(e))return e}function q(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=rf(r,2),o=n[0],i=n[1],a=o,l=i?parseInt(i):1,s=Yn(a),h={type:a,components:l,byteLength:s.byteLength*l,integer:s.integer,signed:s.signed,normalized:s.normalized};return t&&(h.webglOnly=!0),h}function Ue(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ff(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(h){throw h},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
23
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var h=r.next();return i=h.done,h},e:function(h){a=!0,l=h},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function ff(e,t){if(e){if(typeof e=="string")return qn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qn(e,t)}}function qn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cf(e,t){var r={},n=Ue(e.attributes),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;r[i.name]=sf(e,t,i.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Zn(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=cf(e,t),o=new Array(r).fill(null),i=0,a=Object.values(n);i<a.length;i++){var l=a[i];o[l.location]=l}return o}function sf(e,t,r){var n=lf(e,r),o=pf(t,r);if(!n)return null;var i=Kn(n.type),a=o?.vertexFormat||i.defaultVertexFormat,l=q(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:l.type,bufferComponents:l.components,normalized:l.normalized,integer:i.integer,stepMode:o?.stepMode||n.stepMode,byteOffset:o?.byteOffset||0,byteStride:o?.byteStride||0}}function lf(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||S.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function pf(e,t){hf(e);var r=df(e,t);return r||(r=yf(e,t),r)?r:(S.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function hf(e){var t=Ue(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&S.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(o){t.e(o)}finally{t.f()}}function df(e,t){var r=Ue(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.format&&o.name===t)return{attributeName:o.name,bufferName:t,stepMode:o.stepMode,vertexFormat:o.format,byteOffset:0,byteStride:o.byteStride||0}}}catch(i){r.e(i)}finally{r.f()}return null}function yf(e,t){var r=Ue(e),n;try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=i.byteStride;if(typeof i.byteStride!="number"){var l=Ue(i.attributes||[]),s;try{for(l.s();!(s=l.n()).done;){var h=s.value,b=q(h.format);a+=b.byteLength}}catch(w){l.e(w)}finally{l.f()}}var m=(o=i.attributes)===null||o===void 0?void 0:o.find(function(w){return w.attribute===t});if(m)return{attributeName:m.attribute,bufferName:i.name,stepMode:i.stepMode,vertexFormat:m.format,byteOffset:m.byteOffset,byteStride:a}}}catch(w){r.e(w)}finally{r.f()}return null}function we(e){return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(e)}var to;function Jn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Qn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jn(Object(r),!0).forEach(function(n){mf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mf(e,t,r){return t=ro(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ro(n.key),n)}}function bf(e,t,r){return t&&eo(e.prototype,t),r&&eo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ro(e){var t=gf(e,"string");return we(t)==="symbol"?t:String(t)}function gf(e,t){if(we(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(we(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jt(e,t)}function Jt(e,t){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Jt(e,t)}function _f(e){var t=Sf();return function(){var n=yt(e),o;if(t){var i=yt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Of(this,o)}}function Of(e,t){if(t&&(we(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pf(e)}function Pf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sf(){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}}function yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yt(e)}to=Symbol.toStringTag;var mt=function(e){wf(r,e);var t=_f(r);function r(n,o){var i;return vf(this,r),i=t.call(this,n,o,r.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=Zn(o.renderPipeline.shaderLayout,o.renderPipeline.bufferLayout,i.maxVertexAttributes),i}return bf(r,[{key:to,get:function(){return"VertexArray"}}]),r}(E);mt.defaultProps=Qn(Qn({},E.defaultProps),{},{renderPipeline:null});function te(e){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(e)}function Qt(){"use strict";Qt=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(c,u,f){c[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(c,u,f){return Object.defineProperty(c,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[u]}try{s({},"")}catch{s=function(f,p,y){return f[p]=y}}function h(c,u,f,p){var y=u&&u.prototype instanceof w?u:w,d=Object.create(y.prototype),v=new L(p||[]);return n(d,"_invoke",{value:W(c,f,v)}),d}function b(c,u,f){try{return{type:"normal",arg:c.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=h;var m={};function w(){}function O(){}function P(){}var I={};s(I,i,function(){return this});var D=Object.getPrototypeOf,A=D&&D(D(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=w.prototype=Object.create(I);function B(c){["next","throw","return"].forEach(function(u){s(c,u,function(f){return this._invoke(u,f)})})}function G(c,u){function f(y,d,v,g){var _=b(c[y],c,d);if(_.type!=="throw"){var x=_.arg,j=x.value;return j&&te(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,g)},function(R){f("throw",R,v,g)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,g)})}g(_.arg)}var p;n(this,"_invoke",{value:function(d,v){function g(){return new u(function(_,x){f(d,v,_,x)})}return p=p?p.then(g,g):g()}})}function W(c,u,f){var p="suspendedStart";return function(y,d){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw d;return z()}for(f.method=y,f.arg=d;;){var v=f.delegate;if(v){var g=U(v,f);if(g){if(g===m)continue;return g}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var _=b(c,u,f);if(_.type==="normal"){if(p=f.done?"completed":"suspendedYield",_.arg===m)continue;return{value:_.arg,done:f.done}}_.type==="throw"&&(p="completed",f.method="throw",f.arg=_.arg)}}}function U(c,u){var f=u.method,p=c.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&c.iterator.return&&(u.method="return",u.arg=void 0,U(c,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,c.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var d=y.arg;return d?d.done?(u[c.resultName]=d.value,u.next=c.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):d:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function F(c){var u={tryLoc:c[0]};1 in c&&(u.catchLoc=c[1]),2 in c&&(u.finallyLoc=c[2],u.afterLoc=c[3]),this.tryEntries.push(u)}function C(c){var u=c.completion||{};u.type="normal",delete u.arg,c.completion=u}function L(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(F,this),this.reset(!0)}function k(c){if(c){var u=c[i];if(u)return u.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,p=function y(){for(;++f<c.length;)if(r.call(c,f))return y.value=c[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:z}}function z(){return{value:void 0,done:!0}}return O.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:O,configurable:!0}),O.displayName=s(P,l,"GeneratorFunction"),e.isGeneratorFunction=function(c){var u=typeof c=="function"&&c.constructor;return!!u&&(u===O||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,P):(c.__proto__=P,s(c,l,"GeneratorFunction")),c.prototype=Object.create(T),c},e.awrap=function(c){return{__await:c}},B(G.prototype),s(G.prototype,a,function(){return this}),e.AsyncIterator=G,e.async=function(c,u,f,p,y){y===void 0&&(y=Promise);var d=new G(h(c,u,f,p),y);return e.isGeneratorFunction(u)?d:d.next().then(function(v){return v.done?v.value:d.next()})},B(T),s(T,l,"Generator"),s(T,i,function(){return this}),s(T,"toString",function(){return"[object Generator]"}),e.keys=function(c){var u=Object(c),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var d=f.pop();if(d in u)return y.value=d,y.done=!1,y}return y.done=!0,y}},e.values=k,L.prototype={constructor:L,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var d=this.tryEntries[y],v=d.completion;if(d.tryLoc==="root")return p("end");if(d.tryLoc<=this.prev){var g=r.call(d,"catchLoc"),_=r.call(d,"finallyLoc");if(g&&_){if(this.prev<d.catchLoc)return p(d.catchLoc,!0);if(this.prev<d.finallyLoc)return p(d.finallyLoc)}else if(g){if(this.prev<d.catchLoc)return p(d.catchLoc,!0)}else{if(!_)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return p(d.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var d=y;break}}d&&(u==="break"||u==="continue")&&d.tryLoc<=f&&f<=d.finallyLoc&&(d=null);var v=d?d.completion:{};return v.type=u,v.arg=f,d?(this.method="next",this.next=d.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var d=y.arg;C(p)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function no(e,t,r,n,o,i,a){try{var l=e[i](a),s=l.value}catch(h){r(h);return}l.done?t(s):Promise.resolve(s).then(n,o)}function Tf(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(s){no(i,n,o,a,l,"next",s)}function l(s){no(i,n,o,a,l,"throw",s)}a(void 0)})}}function oo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ef(n.key),n)}}function jf(e,t,r){return t&&oo(e.prototype,t),r&&oo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ef(e){var t=xf(e,"string");return te(t)==="symbol"?t:String(t)}function xf(e,t){if(te(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(te(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Af(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&er(e,t)}function er(e,t){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},er(e,t)}function If(e){var t=Bf();return function(){var n=vt(e),o;if(t){var i=vt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Lf(this,o)}}function Lf(e,t){if(t&&(te(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Df(e)}function Df(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bf(){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}}function vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vt(e)}function Gf(e){var t;return e.byteLength||((t=e.data)===null||t===void 0?void 0:t.byteLength)||0}var bt=function(e){Af(r,e);var t=If(r);function r(o,i){var a;Rf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.byteLength=void 0,a.device=o,a.byteLength=Gf(i);var l=Boolean(i.data),s=Math.ceil(a.byteLength/4)*4;return a.handle=a.props.handle||a.device.handle.createBuffer({size:s,usage:a.props.usage||GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST,mappedAtCreation:a.props.mappedAtCreation||l,label:a.props.id}),i.data&&a._writeMapped(i.data),l&&!i.mappedAtCreation&&a.handle.unmap(),a}var n=r.prototype;return n.destroy=function(){this.handle.destroy()},n.write=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.device.handle.queue.writeBuffer(this.handle,a,i.buffer,i.byteOffset,i.byteLength)},n.readAsync=function(){var o=Tf(Qt().mark(function a(){var l,s,h,b,m,w=arguments;return Qt().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return l=w.length>0&&w[0]!==void 0?w[0]:0,s=w.length>1&&w[1]!==void 0?w[1]:this.byteLength,h=new r(this.device,{usage:N.MAP_READ|N.COPY_DST,byteLength:s}),b=this.device.handle.createCommandEncoder(),b.copyBufferToBuffer(this.handle,l,h.handle,0,s),this.device.handle.queue.submit([b.finish()]),P.next=8,h.handle.mapAsync(GPUMapMode.READ,l,s);case 8:return m=h.handle.getMappedRange().slice(0),h.handle.unmap(),h.destroy(),P.abrupt("return",new Uint8Array(m));case 12:case"end":return P.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n._writeMapped=function(i){var a=this.handle.getMappedRange();new i.constructor(a).set(i)},n.mapAsync=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=arguments.length>2?arguments[2]:void 0;return this.handle.mapAsync(i,a,l)},n.getMappedRange=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1?arguments[1]:void 0;return this.handle.getMappedRange(i,a)},n.unmap=function(){this.handle.unmap()},jf(r)}(N);function _e(e){if(e.includes("webgl"))throw new Error("webgl-only format");return e}function Oe(e){return Oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(e)}function io(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Nf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?io(Object(r),!0).forEach(function(n){Cf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):io(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cf(e,t,r){return t=uo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ao(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,uo(n.key),n)}}function kf(e,t,r){return t&&ao(e.prototype,t),r&&ao(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function uo(e){var t=Mf(e,"string");return Oe(t)==="symbol"?t:String(t)}function Mf(e,t){if(Oe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Oe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tr(e,t)}function tr(e,t){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},tr(e,t)}function Ff(e){var t=Hf();return function(){var n=gt(e),o;if(t){var i=gt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return zf(this,o)}}function zf(e,t){if(t&&(Oe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vf(e)}function Vf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hf(){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}}function gt(e){return gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gt(e)}var K=function(e){Wf(r,e);var t=Ff(r);function r(o,i){var a;Uf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o;var l=Nf({},a.props);return l.type!=="comparison-sampler"&&delete l.compare,a.handle=a.handle||a.device.handle.createSampler(l),a.handle.label=a.props.id,a}var n=r.prototype;return n.destroy=function(){},kf(r)}(he);function Pe(e){return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pe(e)}function fo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function co(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fo(Object(r),!0).forEach(function(n){Kf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kf(e,t,r){return t=lo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function so(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lo(n.key),n)}}function $f(e,t,r){return t&&so(e.prototype,t),r&&so(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lo(e){var t=Yf(e,"string");return Pe(t)==="symbol"?t:String(t)}function Yf(e,t){if(Pe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rr(e,t)}function rr(e,t){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},rr(e,t)}function Zf(e){var t=Qf();return function(){var n=wt(e),o;if(t){var i=wt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return po(this,o)}}function po(e,t){if(t&&(Pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jf(e)}function Jf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qf(){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}}function wt(e){return wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wt(e)}var ec={"1d":"1d","2d":"2d","2d-array":"2d",cube:"2d","cube-array":"2d","3d":"3d"},_t=function(e){qf(r,e);var t=Zf(r);function r(o,i){var a;return Xf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.view=void 0,a.sampler=void 0,a.height=1,a.width=1,a.device=o,i.data instanceof Promise?(i.data.then(function(l){a.props=co(co({},i),{},{data:l}),a.initialize(a.props)}),po(a)):(a.initialize(i),a)}var n=r.prototype;return n.initialize=function(i){var a;this.handle=this.props.handle||this.createHandle(),(a=this.handle).label||(a.label=this.id),this.props.data&&this.setData({data:this.props.data}),this.width=this.handle.width,this.height=this.handle.height,this.sampler=i.sampler instanceof K?i.sampler:new K(this.device,i.sampler),this.view=this.createView()},n.createHandle=function(){var i,a,l=this.props.width||((i=this.props.data)===null||i===void 0?void 0:i.width)||1,s=this.props.height||((a=this.props.data)===null||a===void 0?void 0:a.height)||1;return this.device.handle.createTexture({label:this.id,size:{width:l,height:s,depthOrArrayLayers:this.props.depth},dimension:ec[this.props.dimension],format:_e(this.props.format),usage:this.props.usage,mipLevelCount:this.props.mipLevels,sampleCount:this.props.samples})},n.destroy=function(){this.handle.destroy()},n.setSampler=function(i){return this.sampler=i instanceof K?i:new K(this.device,i),this},n.setData=function(i){return this.setImage({source:i.data})},n.setImage=function(i){var a=i.source,l=i.width,s=l===void 0?i.source.width:l,h=i.height,b=h===void 0?i.source.height:h,m=i.depth,w=m===void 0?1:m,O=i.sourceX,P=O===void 0?0:O,I=i.sourceY,D=I===void 0?0:I,A=i.mipLevel,T=A===void 0?0:A,B=i.x,G=B===void 0?0:B,W=i.y,U=W===void 0?0:W,F=i.z,C=F===void 0?0:F,L=i.aspect,k=L===void 0?"all":L,z=i.colorSpace,c=z===void 0?"srgb":z,u=i.premultipliedAlpha,f=u===void 0?!1:u;return this.device.handle.queue.copyExternalImageToTexture({source:a,origin:[P,D]},{texture:this.handle,origin:[G,U,C],mipLevel:T,aspect:k,colorSpace:c,premultipliedAlpha:f},[s,b,w]),{width:s,height:b}},n.createView=function(){return this.handle.createView({label:this.id})},$f(r)}(V);function Se(e){return Se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(e)}function ho(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,rc(n.key),n)}}function tc(e,t,r){return t&&ho(e.prototype,t),r&&ho(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rc(e){var t=nc(e,"string");return Se(t)==="symbol"?t:String(t)}function nc(e,t){if(Se(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Se(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ic(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nr(e,t)}function nr(e,t){return nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},nr(e,t)}function ac(e){var t=cc();return function(){var n=Ot(e),o;if(t){var i=Ot(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return uc(this,o)}}function uc(e,t){if(t&&(Se(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fc(e)}function fc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cc(){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}}function Ot(e){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ot(e)}var yo=function(e){ic(r,e);var t=ac(r);function r(o,i){var a;return oc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.sampler=void 0,a.device=o,a.handle=a.props.handle||a.device.handle.importExternalTexture({source:i.source,colorSpace:i.colorSpace}),a.sampler=null,a}var n=r.prototype;return n.destroy=function(){},n.setSampler=function(i){return this.sampler=i instanceof K?i:new K(this.device,i),this},tc(r)}(tt);function re(e){return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},re(e)}function We(){"use strict";We=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(c,u,f){c[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(c,u,f){return Object.defineProperty(c,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[u]}try{s({},"")}catch{s=function(f,p,y){return f[p]=y}}function h(c,u,f,p){var y=u&&u.prototype instanceof w?u:w,d=Object.create(y.prototype),v=new L(p||[]);return n(d,"_invoke",{value:W(c,f,v)}),d}function b(c,u,f){try{return{type:"normal",arg:c.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=h;var m={};function w(){}function O(){}function P(){}var I={};s(I,i,function(){return this});var D=Object.getPrototypeOf,A=D&&D(D(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=w.prototype=Object.create(I);function B(c){["next","throw","return"].forEach(function(u){s(c,u,function(f){return this._invoke(u,f)})})}function G(c,u){function f(y,d,v,g){var _=b(c[y],c,d);if(_.type!=="throw"){var x=_.arg,j=x.value;return j&&re(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,g)},function(R){f("throw",R,v,g)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,g)})}g(_.arg)}var p;n(this,"_invoke",{value:function(d,v){function g(){return new u(function(_,x){f(d,v,_,x)})}return p=p?p.then(g,g):g()}})}function W(c,u,f){var p="suspendedStart";return function(y,d){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw d;return z()}for(f.method=y,f.arg=d;;){var v=f.delegate;if(v){var g=U(v,f);if(g){if(g===m)continue;return g}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var _=b(c,u,f);if(_.type==="normal"){if(p=f.done?"completed":"suspendedYield",_.arg===m)continue;return{value:_.arg,done:f.done}}_.type==="throw"&&(p="completed",f.method="throw",f.arg=_.arg)}}}function U(c,u){var f=u.method,p=c.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&c.iterator.return&&(u.method="return",u.arg=void 0,U(c,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,c.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var d=y.arg;return d?d.done?(u[c.resultName]=d.value,u.next=c.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):d:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function F(c){var u={tryLoc:c[0]};1 in c&&(u.catchLoc=c[1]),2 in c&&(u.finallyLoc=c[2],u.afterLoc=c[3]),this.tryEntries.push(u)}function C(c){var u=c.completion||{};u.type="normal",delete u.arg,c.completion=u}function L(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(F,this),this.reset(!0)}function k(c){if(c){var u=c[i];if(u)return u.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,p=function y(){for(;++f<c.length;)if(r.call(c,f))return y.value=c[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:z}}function z(){return{value:void 0,done:!0}}return O.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:O,configurable:!0}),O.displayName=s(P,l,"GeneratorFunction"),e.isGeneratorFunction=function(c){var u=typeof c=="function"&&c.constructor;return!!u&&(u===O||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,P):(c.__proto__=P,s(c,l,"GeneratorFunction")),c.prototype=Object.create(T),c},e.awrap=function(c){return{__await:c}},B(G.prototype),s(G.prototype,a,function(){return this}),e.AsyncIterator=G,e.async=function(c,u,f,p,y){y===void 0&&(y=Promise);var d=new G(h(c,u,f,p),y);return e.isGeneratorFunction(u)?d:d.next().then(function(v){return v.done?v.value:d.next()})},B(T),s(T,l,"Generator"),s(T,i,function(){return this}),s(T,"toString",function(){return"[object Generator]"}),e.keys=function(c){var u=Object(c),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var d=f.pop();if(d in u)return y.value=d,y.done=!1,y}return y.done=!0,y}},e.values=k,L.prototype={constructor:L,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var d=this.tryEntries[y],v=d.completion;if(d.tryLoc==="root")return p("end");if(d.tryLoc<=this.prev){var g=r.call(d,"catchLoc"),_=r.call(d,"finallyLoc");if(g&&_){if(this.prev<d.catchLoc)return p(d.catchLoc,!0);if(this.prev<d.finallyLoc)return p(d.finallyLoc)}else if(g){if(this.prev<d.catchLoc)return p(d.catchLoc,!0)}else{if(!_)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return p(d.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var d=y;break}}d&&(u==="break"||u==="continue")&&d.tryLoc<=f&&f<=d.finallyLoc&&(d=null);var v=d?d.completion:{};return v.type=u,v.arg=f,d?(this.method="next",this.next=d.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var d=y.arg;C(p)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function mo(e,t,r,n,o,i,a){try{var l=e[i](a),s=l.value}catch(h){r(h);return}l.done?t(s):Promise.resolve(s).then(n,o)}function vo(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(s){mo(i,n,o,a,l,"next",s)}function l(s){mo(i,n,o,a,l,"throw",s)}a(void 0)})}}function bo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lc(n.key),n)}}function sc(e,t,r){return t&&bo(e.prototype,t),r&&bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lc(e){var t=pc(e,"string");return re(t)==="symbol"?t:String(t)}function pc(e,t){if(re(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(re(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&or(e,t)}function or(e,t){return or=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},or(e,t)}function yc(e){var t=bc();return function(){var n=Pt(e),o;if(t){var i=Pt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return mc(this,o)}}function mc(e,t){if(t&&(re(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vc(e)}function vc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bc(){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}}function Pt(e){return Pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Pt(e)}var St=function(e){dc(r,e);var t=yc(r);function r(o,i){var a;return hc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o,a.device.handle.pushErrorScope("validation"),a.handle=a.props.handle||a.createHandle(),a.handle.label=a.props.id,a._checkCompilationError(a.device.handle.popErrorScope()),a}var n=r.prototype;return n._checkCompilationError=function(){var o=vo(We().mark(function a(l){var s,h;return We().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,l;case 2:if(s=m.sent,!s){m.next=10;break}return this.debugShader(),m.next=7,this.getCompilationInfo();case 7:throw h=m.sent,S.error("Shader compilation error: ".concat(s.message),h)(),new Error("Shader compilation error: ".concat(s.message));case 10:case"end":return m.stop()}},a,this)}));function i(a){return o.apply(this,arguments)}return i}(),n.destroy=function(){},n.getCompilationInfo=function(){var o=vo(We().mark(function a(){var l;return We().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,this.handle.getCompilationInfo();case 2:return l=h.sent,h.abrupt("return",l.messages);case 4:case"end":return h.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n.createHandle=function(){var i=this,a=this.props,l=a.source,s=a.stage,h=this.props.language;switch(h==="auto"&&(h=l.includes("->")?"wgsl":"glsl"),h){case"wgsl":return this.device.handle.createShaderModule({code:l});case"glsl":return this.device.handle.createShaderModule({code:l,transform:function(m){return i.device.glslang.compileGLSL(m,s)}});default:throw new Error(h)}},sc(r)}(nt);function Fe(e){return Fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(e)}function gc(e,t){return Pc(e)||Oc(e,t)||_c(e,t)||wc()}function wc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
24
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _c(e,t){if(e){if(typeof e=="string")return go(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return go(e,t)}}function go(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Oc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function Pc(e){if(Array.isArray(e))return e}function wo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _o(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wo(Object(r),!0).forEach(function(n){Sc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sc(e,t,r){return t=Tc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tc(e){var t=jc(e,"string");return Fe(t)==="symbol"?t:String(t)}function jc(e,t){if(Fe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $(e){return e.depthStencil=e.depthStencil||{format:"depth24plus",stencilFront:{},stencilBack:{},depthWriteEnabled:!1,depthCompare:"less-equal"},e.depthStencil}var Ec={cullMode:function(t,r,n){n.primitive=n.primitive||{},n.primitive.cullMode=r},frontFace:function(t,r,n){n.primitive=n.primitive||{},n.primitive.frontFace=r},depthWriteEnabled:function(t,r,n){var o=$(n);o.depthWriteEnabled=r},depthCompare:function(t,r,n){var o=$(n);o.depthCompare=r},depthFormat:function(t,r,n){var o=$(n);o.format=r},depthBias:function(t,r,n){var o=$(n);o.depthBias=r},depthBiasSlopeScale:function(t,r,n){var o=$(n);o.depthBiasSlopeScale=r},depthBiasClamp:function(t,r,n){var o=$(n);o.depthBiasClamp=r},stencilReadMask:function(t,r,n){var o=$(n);o.stencilReadMask=r},stencilWriteMask:function(t,r,n){var o=$(n);o.stencilWriteMask=r},stencilCompare:function(t,r,n){var o=$(n);o.stencilFront.compare=r,o.stencilBack.compare=r},stencilPassOperation:function(t,r,n){var o=$(n);o.stencilFront.passOp=r,o.stencilBack.passOp=r},stencilFailOperation:function(t,r,n){var o=$(n);o.stencilFront.failOp=r,o.stencilBack.failOp=r},stencilDepthFailOperation:function(t,r,n){var o=$(n);o.stencilFront.depthFailOp=r,o.stencilBack.depthFailOp=r},sampleCount:function(t,r,n){n.multisample=n.multisample||{},n.multisample.count=r},sampleMask:function(t,r,n){n.multisample=n.multisample||{},n.multisample.mask=r},sampleAlphaToCoverageEnabled:function(t,r,n){n.multisample=n.multisample||{},n.multisample.alphaToCoverageEnabled=r},colorMask:function(t,r,n){var o=Oo(n);o[0].writeMask=r},blendColorOperation:function(t,r,n){Oo(n)}},xc={primitive:{cullMode:"back",topology:"triangle-list"},vertex:{module:void 0,entryPoint:"main"},fragment:{module:void 0,entryPoint:"main",targets:[]},layout:"auto"};function Po(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Object.assign(e,_o(_o({},xc),e)),Rc(e,t)}function Rc(e,t){for(var r=0,n=Object.entries(t);r<n.length;r++){var o=gc(n[r],2),i=o[0],a=o[1],l=Ec[i];if(!l)throw new Error("Illegal parameter ".concat(i));l(i,a,e)}}function Oo(e){var t,r,n,o;if(e.fragment.targets=((t=e.fragment)===null||t===void 0?void 0:t.targets)||[],!Array.isArray((r=e.fragment)===null||r===void 0?void 0:r.targets))throw new Error("colorstate");if(((n=e.fragment)===null||n===void 0||(n=n.targets)===null||n===void 0?void 0:n.length)===0){var i;(i=e.fragment.targets)===null||i===void 0||i.push({})}return(o=e.fragment)===null||o===void 0?void 0:o.targets}function Ac(e,t){return Bc(e)||Dc(e,t)||Lc(e,t)||Ic()}function Ic(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
25
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lc(e,t){if(e){if(typeof e=="string")return So(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return So(e,t)}}function So(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Dc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function Bc(e){if(Array.isArray(e))return e}function jo(e,t,r,n){var o=Nc(n,r);return e.createBindGroup({layout:t,entries:o})}function Gc(e,t){var r=e.bindings.find(function(n){return n.name===t||"".concat(n.name,"uniforms")===t.toLocaleLowerCase()});return r||S.warn("Binding ".concat(t," not set: Not found in shader layout."))(),r}function Nc(e,t){for(var r=[],n=0,o=Object.entries(e);n<o.length;n++){var i=Ac(o[n],2),a=i[0],l=i[1],s=Gc(t,a);s&&r.push(Cc(l,s.location))}return r}function Cc(e,t){if(e instanceof N)return{binding:t,resource:{buffer:e.handle}};if(e instanceof he)return{binding:t,resource:e.handle};if(e instanceof V)return{binding:t,resource:e.handle.createView({label:"bind-group-auto-created"})};throw new Error("invalid binding")}function ir(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=kc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(h){throw h},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var h=r.next();return i=h.done,h},e:function(h){a=!0,l=h},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function kc(e,t){if(e){if(typeof e=="string")return Eo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Eo(e,t)}}function Eo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ar(e){if(e.endsWith("-webgl"))throw new Error("WebGPU does not support vertex format ".concat(e));return e}function Ro(e,t){var r=[],n=new Set,o=ir(t),i;try{for(o.s();!(i=o.n()).done;){var a=i.value,l=[],s="vertex",h=0;if(a.attributes){var b=ir(a.attributes),m;try{for(b.s();!(m=b.n()).done;){var w=m.value,O=w.attribute,P=xo(e,O,n);s=P.stepMode||(P.name.startsWith("instance")?"instance":"vertex"),l.push({format:ar(w.format||a.format),offset:w.byteOffset,shaderLocation:P.location}),h+=q(a.format).byteLength}}catch(B){b.e(B)}finally{b.f()}}else{var I=xo(e,a.name,n);if(!I)continue;h=q(a.format).byteLength,s=I.stepMode||(I.name.startsWith("instance")?"instance":"vertex"),l.push({format:ar(a.format),offset:0,shaderLocation:I.location})}r.push({arrayStride:a.byteStride||h,stepMode:s,attributes:l})}}catch(B){o.e(B)}finally{o.f()}var D=ir(e.attributes),A;try{for(D.s();!(A=D.n()).done;){var T=A.value;n.has(T.name)||r.push({arrayStride:q("float32x3").byteLength,stepMode:T.stepMode||(T.name.startsWith("instance")?"instance":"vertex"),attributes:[{format:ar("float32x3"),offset:0,shaderLocation:T.location}]})}}catch(B){D.e(B)}finally{D.f()}return r}function xo(e,t,r){var n=e.attributes.find(function(o){return o.name===t});if(!n)return S.warn("Unknown attribute ".concat(t))(),null;if(r.has(t))throw new Error("Duplicate attribute ".concat(t));return r.add(t),n}function Te(e){return Te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Te(e)}function Ao(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Uc(n.key),n)}}function Mc(e,t,r){return t&&Ao(e.prototype,t),r&&Ao(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uc(e){var t=Wc(e,"string");return Te(t)==="symbol"?t:String(t)}function Wc(e,t){if(Te(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Te(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ur(e,t)}function ur(e,t){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ur(e,t)}function Vc(e){var t=$c();return function(){var n=Tt(e),o;if(t){var i=Tt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Hc(this,o)}}function Hc(e,t){if(t&&(Te(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kc(e)}function Kc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $c(){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}}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tt(e)}var Io=function(e){zc(r,e);var t=Vc(r);function r(o,i){var a;if(Fc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.vs=void 0,a.fs=null,a._bindGroupLayout=null,a._bindGroup=null,a.device=o,a.handle=a.props.handle,!a.handle){var l=a._getRenderPipelineDescriptor();S.groupCollapsed(1,"new WebGPURenderPipeline(".concat(a.id,")"))(),S.probe(1,JSON.stringify(l,null,2))(),S.groupEnd(1)(),a.handle=a.device.handle.createRenderPipeline(l)}return a.handle.label=a.props.id,a.vs=i.vs,a.fs=i.fs,a}var n=r.prototype;return n.destroy=function(){},n.setBindings=function(i){Object.assign(this.props.bindings,i)},n.setUniforms=function(i){if(!Nt(i))throw new Error("WebGPU does not support uniforms")},n.draw=function(i){var a=i.renderPass||this.device.getDefaultRenderPass();a.handle.setPipeline(this.handle);var l=this._getBindGroup();l&&a.handle.setBindGroup(0,l),i.vertexArray.bindBeforeRender(i.renderPass),i.indexCount?a.handle.drawIndexed(i.indexCount,i.instanceCount,i.firstIndex,i.baseVertex,i.firstInstance):a.handle.draw(i.vertexCount||0,i.instanceCount||1,i.firstInstance),i.vertexArray.unbindAfterRender(i.renderPass)},n._getBindGroup=function(){return this._bindGroupLayout=this._bindGroupLayout||this.handle.getBindGroupLayout(0),this._bindGroup=this._bindGroup||jo(this.device.handle,this._bindGroupLayout,this.props.shaderLayout,this.props.bindings),this._bindGroup},n._getRenderPipelineDescriptor=function(){var i={module:this.props.vs.handle,entryPoint:this.props.vsEntryPoint||"main",buffers:Ro(this.props.shaderLayout,this.props.bufferLayout)},a;if(this.props.fs){var l;a={module:this.props.fs.handle,entryPoint:this.props.fsEntryPoint||"main",targets:[{format:_e((l=this.device)===null||l===void 0||(l=l.canvasContext)===null||l===void 0?void 0:l.format)}]}}switch(this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":throw new Error("WebGPU does not support primitive topology ".concat(this.props.topology));default:}var s={vertex:i,fragment:a,primitive:{topology:this.props.topology},layout:"auto"};return Po(s,this.props.parameters),s},Mc(r)}(ft);function je(e){return je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(e)}function Lo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xc(n.key),n)}}function Yc(e,t,r){return t&&Lo(e.prototype,t),r&&Lo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xc(e){var t=qc(e,"string");return je(t)==="symbol"?t:String(t)}function qc(e,t){if(je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fr(e,t)}function fr(e,t){return fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},fr(e,t)}function Qc(e){var t=rs();return function(){var n=jt(e),o;if(t){var i=jt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return es(this,o)}}function es(e,t){if(t&&(je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ts(e)}function ts(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rs(){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}}function jt(e){return jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jt(e)}var Do=function(e){Jc(r,e);var t=Qc(r);function r(o,i){var a;Zc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o;var l=a.props.cs;return a.handle=a.props.handle||a.device.handle.createComputePipeline({label:a.props.id,compute:{module:l.handle,entryPoint:a.props.csEntryPoint},layout:"auto"}),a}var n=r.prototype;return n._getBindGroupLayout=function(){return this.handle.getBindGroupLayout(0)},Yc(r)}(st);function Ee(e){return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(e)}function Bo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,os(n.key),n)}}function ns(e,t,r){return t&&Bo(e.prototype,t),r&&Bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function os(e){var t=is(e,"string");return Ee(t)==="symbol"?t:String(t)}function is(e,t){if(Ee(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function as(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function us(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cr(e,t)}function cr(e,t){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},cr(e,t)}function fs(e){var t=ls();return function(){var n=Et(e),o;if(t){var i=Et(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return cs(this,o)}}function cs(e,t){if(t&&(Ee(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ss(e)}function ss(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ls(){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}}function Et(e){return Et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Et(e)}var Go=function(e){us(r,e);var t=fs(r);function r(o){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};as(this,r),i=t.call(this,o,a),i.device=void 0,i.handle=void 0,i.pipeline=null,i.device=o;var l=a.framebuffer||o.canvasContext.getCurrentFramebuffer(),s=i.getRenderPassDescriptor(l);return S.groupCollapsed(3,"new WebGPURenderPass(".concat(i.id,")"))(),S.probe(3,JSON.stringify(s,null,2))(),S.groupEnd(3)(),i.handle=i.props.handle||o.commandEncoder.beginRenderPass(s),i.handle.label=i.props.id,i}var n=r.prototype;return n.destroy=function(){},n.end=function(){this.handle.end()},n.setPipeline=function(i){this.pipeline=i,this.handle.setPipeline(this.pipeline.handle)},n.setBindings=function(i){var a,l;(a=this.pipeline)===null||a===void 0||a.setBindings(i);var s=(l=this.pipeline)===null||l===void 0?void 0:l._getBindGroup();s&&this.handle.setBindGroup(0,s)},n.setIndexBuffer=function(i,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0;this.handle.setIndexBuffer(i.handle,a,l,s)},n.setVertexBuffer=function(i,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;this.handle.setVertexBuffer(i,a.handle,l)},n.draw=function(i){i.indexCount?this.handle.drawIndexed(i.indexCount,i.instanceCount,i.firstIndex,i.baseVertex,i.firstInstance):this.handle.draw(i.vertexCount||0,i.instanceCount||1,i.firstIndex,i.firstInstance)},n.drawIndirect=function(){},n.setParameters=function(i){var a=i.blendConstant,l=i.stencilReference,s=i.scissorRect,h=i.viewport;a&&this.handle.setBlendConstant(a),l&&this.handle.setStencilReference(l),s&&this.handle.setScissorRect(s[0],s[1],s[2],s[3]),h&&this.handle.setViewport(h[0],h[1],h[2],h[3],h[4],h[5])},n.pushDebugGroup=function(i){this.handle.pushDebugGroup(i)},n.popDebugGroup=function(){this.handle.popDebugGroup()},n.insertDebugMarker=function(i){this.handle.insertDebugMarker(i)},n.getRenderPassDescriptor=function(i){var a=this,l={colorAttachments:[]};if(l.colorAttachments=i.colorAttachments.map(function(m){return{loadOp:a.props.clearColor!==!1?"clear":"load",colorClearValue:a.props.clearColor||[0,0,0,0],storeOp:a.props.discard?"discard":"store",view:m.createView()}}),i.depthStencilAttachment){l.depthStencilAttachment={view:i.depthStencilAttachment.createView()};var s=l.depthStencilAttachment;this.props.depthReadOnly&&(s.depthReadOnly=!0),s.depthClearValue=this.props.clearDepth||0;var h=!0;h&&(s.depthLoadOp=this.props.clearDepth!==!1?"clear":"load",s.depthStoreOp="store");var b=!1;b&&(s.stencilLoadOp=this.props.clearStencil!==!1?"clear":"load",s.stencilStoreOp="store")}return l},ns(r)}(pt);function xe(e){return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(e)}function No(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hs(n.key),n)}}function ps(e,t,r){return t&&No(e.prototype,t),r&&No(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hs(e){var t=ds(e,"string");return xe(t)==="symbol"?t:String(t)}function ds(e,t){if(xe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ys(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ms(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sr(e,t)}function sr(e,t){return sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sr(e,t)}function vs(e){var t=ws();return function(){var n=xt(e),o;if(t){var i=xt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return bs(this,o)}}function bs(e,t){if(t&&(xe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gs(e)}function gs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ws(){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}}function xt(e){return xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xt(e)}var Co=function(e){ms(r,e);var t=vs(r);function r(o,i){var a,l;return ys(this,r),l=t.call(this,o,i),l.device=void 0,l.handle=void 0,l._bindGroupLayout=null,l.device=o,l.handle=l.props.handle||((a=o.commandEncoder)===null||a===void 0?void 0:a.beginComputePass({label:l.props.id})),l}var n=r.prototype;return n.destroy=function(){},n.end=function(){this.handle.end()},n.setPipeline=function(i){var a=i;this.handle.setPipeline(a.handle),this._bindGroupLayout=a._getBindGroupLayout()},n.setBindings=function(i){throw new Error("fix me")},n.dispatch=function(i,a,l){this.handle.dispatchWorkgroups(i,a,l)},n.dispatchIndirect=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=i;this.handle.dispatchWorkgroupsIndirect(l.handle,a)},n.pushDebugGroup=function(i){this.handle.pushDebugGroup(i)},n.popDebugGroup=function(){this.handle.popDebugGroup()},n.insertDebugMarker=function(i){this.handle.insertDebugMarker(i)},ps(r)}(dt);function Re(e){return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(e)}var Mo;function _s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ko(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ps(n.key),n)}}function Os(e,t,r){return t&&ko(e.prototype,t),r&&ko(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ps(e){var t=Ss(e,"string");return Re(t)==="symbol"?t:String(t)}function Ss(e,t){if(Re(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Re(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ts(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lr(e,t)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},lr(e,t)}function js(e){var t=Rs();return function(){var n=Rt(e),o;if(t){var i=Rt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Es(this,o)}}function Es(e,t){if(t&&(Re(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xs(e)}function xs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rs(){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}}function Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rt(e)}Mo=Symbol.toStringTag;var Uo=function(e){Ts(r,e);var t=js(r);r.isConstantAttributeZeroSupported=function(i){return i.info.type==="webgl2"||He()==="Chrome"};function r(o,i){var a;return _s(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o,a}var n=r.prototype;return n.destroy=function(){},n.setIndexBuffer=function(i){this.indexBuffer=i},n.setBuffer=function(i,a){this.attributes[i]=a},n.setConstant=function(i,a){S.warn("".concat(this.id," constant attributes not supported on WebGPU"))},n.bindBeforeRender=function(i,a,l){var s=i,h=this.indexBuffer;h!=null&&h.handle&&(S.warn("setting index buffer",h?.handle,h?.indexType)(),s.handle.setIndexBuffer(h?.handle,h?.indexType));for(var b=0;b<this.maxVertexAttributes;b++){var m=this.attributes[b];m!=null&&m.handle&&(S.warn("setting vertex buffer ".concat(b),m?.handle)(),s.handle.setVertexBuffer(b,m?.handle))}},n.unbindAfterRender=function(i){},Os(r,[{key:Mo,get:function(){return"WebGPUVertexArray"}}]),r}(mt);function Ae(e){return Ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(e)}function Wo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Is(n.key),n)}}function As(e,t,r){return t&&Wo(e.prototype,t),r&&Wo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Is(e){var t=Ls(e,"string");return Ae(t)==="symbol"?t:String(t)}function Ls(e,t){if(Ae(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ae(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ds(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bs(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pr(e,t)}function pr(e,t){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},pr(e,t)}function Gs(e){var t=ks();return function(){var n=At(e),o;if(t){var i=At(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ns(this,o)}}function Ns(e,t){if(t&&(Ae(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cs(e)}function Cs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ks(){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}}function At(e){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},At(e)}var Fo=function(e){Bs(r,e);var t=Gs(r);function r(n,o){var i;return Ds(this,r),i=t.call(this,n,o),i.device=void 0,i.device=n,i.autoCreateAttachmentTextures(),i}return As(r)}(at);function Ie(e){return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(e)}function Ms(e,t){return zs(e)||Fs(e,t)||Ws(e,t)||Us()}function Us(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
27
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ws(e,t){if(e){if(typeof e=="string")return zo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zo(e,t)}}function zo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fs(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function zs(e){if(Array.isArray(e))return e}function Vo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hs(n.key),n)}}function Vs(e,t,r){return t&&Vo(e.prototype,t),r&&Vo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hs(e){var t=Ks(e,"string");return Ie(t)==="symbol"?t:String(t)}function Ks(e,t){if(Ie(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ie(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ys(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hr(e,t)}function hr(e,t){return hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},hr(e,t)}function Xs(e){var t=Js();return function(){var n=It(e),o;if(t){var i=It(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return qs(this,o)}}function qs(e,t){if(t&&(Ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zs(e)}function Zs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Js(){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}}function It(e){return It=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},It(e)}var dr=function(e){Ys(r,e);var t=Xs(r);function r(o,i,a){var l;return $s(this,r),l=t.call(this,a),l.device=void 0,l.gpuCanvasContext=void 0,l.format=navigator.gpu.getPreferredCanvasFormat(),l.depthStencilFormat="depth24plus",l.depthStencilAttachment=null,l.device=o,l.width=-1,l.height=-1,l._setAutoCreatedCanvasId("".concat(l.device.id,"-canvas")),l.gpuCanvasContext=l.canvas.getContext("webgpu"),l.format="bgra8unorm",l}var n=r.prototype;return n.destroy=function(){this.gpuCanvasContext.unconfigure()},n.getCurrentFramebuffer=function(){this.update();var i=this.getCurrentTexture();return this.width=i.width,this.height=i.height,this._createDepthStencilAttachment(),new Fo(this.device,{colorAttachments:[i],depthStencilAttachment:this.depthStencilAttachment})},n.update=function(){var i=this.getPixelSize(),a=Ms(i,2),l=a[0],s=a[1],h=l!==this.width||s!==this.height;h&&(this.width=l,this.height=s,this.depthStencilAttachment&&(this.depthStencilAttachment.destroy(),this.depthStencilAttachment=null),this.gpuCanvasContext.configure({device:this.device.handle,format:_e(this.format),colorSpace:this.props.colorSpace,alphaMode:this.props.alphaMode}),S.log(1,"Resized to ".concat(this.width,"x").concat(this.height,"px"))())},n.resize=function(i){this.update()},n.getCurrentTexture=function(){return this.device._createTexture({id:"".concat(this.id,"#color-texture"),handle:this.gpuCanvasContext.getCurrentTexture()})},n._createDepthStencilAttachment=function(){return this.depthStencilAttachment||(this.depthStencilAttachment=this.device.createTexture({id:"".concat(this.id,"#depth-stencil-texture"),format:this.depthStencilFormat,width:this.width,height:this.height,usage:GPUTextureUsage.RENDER_ATTACHMENT})),this.depthStencilAttachment},Vs(r)}(ce);function ne(e){return ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ne(e)}function Qs(e,t){return nl(e)||rl(e,t)||tl(e,t)||el()}function el(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
28
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tl(e,t){if(e){if(typeof e=="string")return Ho(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ho(e,t)}}function Ho(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rl(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function nl(e){if(Array.isArray(e))return e}function Ko(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $o(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ko(Object(r),!0).forEach(function(n){ol(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ko(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ol(e,t,r){return t=Zo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ze(){"use strict";ze=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(c,u,f){c[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(c,u,f){return Object.defineProperty(c,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[u]}try{s({},"")}catch{s=function(f,p,y){return f[p]=y}}function h(c,u,f,p){var y=u&&u.prototype instanceof w?u:w,d=Object.create(y.prototype),v=new L(p||[]);return n(d,"_invoke",{value:W(c,f,v)}),d}function b(c,u,f){try{return{type:"normal",arg:c.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=h;var m={};function w(){}function O(){}function P(){}var I={};s(I,i,function(){return this});var D=Object.getPrototypeOf,A=D&&D(D(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=w.prototype=Object.create(I);function B(c){["next","throw","return"].forEach(function(u){s(c,u,function(f){return this._invoke(u,f)})})}function G(c,u){function f(y,d,v,g){var _=b(c[y],c,d);if(_.type!=="throw"){var x=_.arg,j=x.value;return j&&ne(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,g)},function(R){f("throw",R,v,g)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,g)})}g(_.arg)}var p;n(this,"_invoke",{value:function(d,v){function g(){return new u(function(_,x){f(d,v,_,x)})}return p=p?p.then(g,g):g()}})}function W(c,u,f){var p="suspendedStart";return function(y,d){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw d;return z()}for(f.method=y,f.arg=d;;){var v=f.delegate;if(v){var g=U(v,f);if(g){if(g===m)continue;return g}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var _=b(c,u,f);if(_.type==="normal"){if(p=f.done?"completed":"suspendedYield",_.arg===m)continue;return{value:_.arg,done:f.done}}_.type==="throw"&&(p="completed",f.method="throw",f.arg=_.arg)}}}function U(c,u){var f=u.method,p=c.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&c.iterator.return&&(u.method="return",u.arg=void 0,U(c,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,c.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var d=y.arg;return d?d.done?(u[c.resultName]=d.value,u.next=c.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):d:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function F(c){var u={tryLoc:c[0]};1 in c&&(u.catchLoc=c[1]),2 in c&&(u.finallyLoc=c[2],u.afterLoc=c[3]),this.tryEntries.push(u)}function C(c){var u=c.completion||{};u.type="normal",delete u.arg,c.completion=u}function L(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(F,this),this.reset(!0)}function k(c){if(c){var u=c[i];if(u)return u.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,p=function y(){for(;++f<c.length;)if(r.call(c,f))return y.value=c[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:z}}function z(){return{value:void 0,done:!0}}return O.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:O,configurable:!0}),O.displayName=s(P,l,"GeneratorFunction"),e.isGeneratorFunction=function(c){var u=typeof c=="function"&&c.constructor;return!!u&&(u===O||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,P):(c.__proto__=P,s(c,l,"GeneratorFunction")),c.prototype=Object.create(T),c},e.awrap=function(c){return{__await:c}},B(G.prototype),s(G.prototype,a,function(){return this}),e.AsyncIterator=G,e.async=function(c,u,f,p,y){y===void 0&&(y=Promise);var d=new G(h(c,u,f,p),y);return e.isGeneratorFunction(u)?d:d.next().then(function(v){return v.done?v.value:d.next()})},B(T),s(T,l,"Generator"),s(T,i,function(){return this}),s(T,"toString",function(){return"[object Generator]"}),e.keys=function(c){var u=Object(c),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var d=f.pop();if(d in u)return y.value=d,y.done=!1,y}return y.done=!0,y}},e.values=k,L.prototype={constructor:L,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var d=this.tryEntries[y],v=d.completion;if(d.tryLoc==="root")return p("end");if(d.tryLoc<=this.prev){var g=r.call(d,"catchLoc"),_=r.call(d,"finallyLoc");if(g&&_){if(this.prev<d.catchLoc)return p(d.catchLoc,!0);if(this.prev<d.finallyLoc)return p(d.finallyLoc)}else if(g){if(this.prev<d.catchLoc)return p(d.catchLoc,!0)}else{if(!_)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return p(d.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var d=y;break}}d&&(u==="break"||u==="continue")&&d.tryLoc<=f&&f<=d.finallyLoc&&(d=null);var v=d?d.completion:{};return v.type=u,v.arg=f,d?(this.method="next",this.next=d.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var d=y.arg;C(p)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function Yo(e,t,r,n,o,i,a){try{var l=e[i](a),s=l.value}catch(h){r(h);return}l.done?t(s):Promise.resolve(s).then(n,o)}function Xo(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(s){Yo(i,n,o,a,l,"next",s)}function l(s){Yo(i,n,o,a,l,"throw",s)}a(void 0)})}}function il(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zo(n.key),n)}}function al(e,t,r){return t&&qo(e.prototype,t),r&&qo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zo(e){var t=ul(e,"string");return ne(t)==="symbol"?t:String(t)}function ul(e,t){if(ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yr(e,t)}function yr(e,t){return yr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},yr(e,t)}function cl(e){var t=ll();return function(){var n=Lt(e),o;if(t){var i=Lt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return sl(this,o)}}function sl(e,t){if(t&&(ne(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jo(e)}function Jo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ll(){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}}function Lt(e){return Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lt(e)}var mr=function(e){fl(r,e);var t=cl(r);r.isSupported=function(){return Boolean(typeof navigator<"u"&&navigator.gpu)},r.create=function(){var o=Xo(ze().mark(function a(l){var s,h,b,m;return ze().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(navigator.gpu){O.next=2;break}throw new Error("WebGPU not available. Open in Chrome Canary and turn on chrome://flags/#enable-unsafe-webgpu");case 2:return S.groupCollapsed(1,"WebGPUDevice created")(),O.next=5,navigator.gpu.requestAdapter({powerPreference:"high-performance"});case 5:if(s=O.sent,s){O.next=8;break}throw new Error("Failed to request WebGPU adapter");case 8:return O.next=10,s.requestAdapterInfo();case 10:return h=O.sent,S.probe(2,"Adapter available",h)(),O.next=14,s.requestDevice({requiredFeatures:s.features});case 14:if(b=O.sent,S.probe(1,"GPUDevice available")(),typeof l.canvas!="string"){O.next=20;break}return O.next=19,ce.pageLoaded;case 19:S.probe(1,"DOM is loaded")();case 20:return m=new r(b,s,h,l),S.probe(1,"Device created. For more info, set chrome://flags/#enable-webgpu-developer-features")(),S.table(1,m.info)(),S.groupEnd(1)(),O.abrupt("return",m);case 25:case"end":return O.stop()}},a)}));function i(a){return o.apply(this,arguments)}return i}();function r(o,i,a,l){var s;il(this,r),s=t.call(this,$o($o({},l),{},{id:l.id||Y("webgpu-device")})),s.handle=void 0,s.adapter=void 0,s.lost=void 0,s.canvasContext=null,s.commandEncoder=null,s.renderPass=null,s._info=void 0,s._isLost=!1,s.features=void 0,s.handle=o,s.adapter=i;var h=(a.driver||"").split(" Version "),b=Qs(h,2),m=b[0],w=b[1],O=a.vendor||s.adapter.__brand||"unknown",P=m||"",I=w||"",D=O==="apple"?"apple":"unknown",A=a.architecture||"unknown",T=a.backend||"unknown",B=(a.type||"").split(" ")[0].toLowerCase()||"unknown";return s._info={type:"webgpu",vendor:O,renderer:P,version:I,gpu:D,gpuType:B,gpuBackend:T,gpuArchitecture:A,shadingLanguage:"wgsl",shadingLanguageVersion:100},s.lost=new Promise(function(){var G=Xo(ze().mark(function W(U){var F;return ze().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return L.next=2,s.handle.lost;case 2:F=L.sent,s._isLost=!0,U({reason:"destroyed",message:F.message});case 5:case"end":return L.stop()}},W)}));return function(W){return G.apply(this,arguments)}}()),s.canvasContext=new dr(Jo(s),s.adapter,{canvas:l.canvas,height:l.height,width:l.width,container:l.container}),s.features=s._getFeatures(),s}var n=r.prototype;return n.destroy=function(){this.handle.destroy()},n.isTextureFormatSupported=function(i){return!i.includes("webgl")},n.isTextureFormatFilterable=function(i){return this.isTextureFormatSupported(i)},n.isTextureFormatRenderable=function(i){return this.isTextureFormatSupported(i)},n.createBuffer=function(i){var a=this._getBufferProps(i);return new bt(this,a)},n._createTexture=function(i){return new _t(this,i)},n.createExternalTexture=function(i){return new yo(this,i)},n.createShader=function(i){return new St(this,i)},n.createSampler=function(i){return new K(this,i)},n.createRenderPipeline=function(i){return new Io(this,i)},n.createFramebuffer=function(i){throw new Error("Not implemented")},n.createComputePipeline=function(i){return new Do(this,i)},n.createVertexArray=function(i){return new Uo(this,i)},n.beginRenderPass=function(i){return this.commandEncoder=this.commandEncoder||this.handle.createCommandEncoder(),new Go(this,i)},n.beginComputePass=function(i){return this.commandEncoder=this.commandEncoder||this.handle.createCommandEncoder(),new Co(this,i)},n.createTransformFeedback=function(i){throw new Error("Transform feedback not supported in WebGPU")},n.createCanvasContext=function(i){return new dr(this,this.adapter,i)},n.getDefaultRenderPass=function(){throw new Error("a")},n.submit=function(){var i,a=(i=this.commandEncoder)===null||i===void 0?void 0:i.finish();a&&this.handle.queue.submit([a]),this.commandEncoder=null},n._getFeatures=function(){var i=new Set(this.handle.features);return i.has("depth-clamping")&&(i.delete("depth-clamping"),i.add("depth-clip-control")),i.has("texture-compression-bc")&&i.add("texture-compression-bc5-webgl"),i.add("webgpu"),i.add("timer-query-webgl"),i.add("vertex-array-object-webgl1"),i.add("instanced-rendering-webgl1"),i.add("multiple-render-targets-webgl1"),i.add("index-uint32-webgl1"),i.add("blend-minmax-webgl1"),i.add("texture-blend-float-webgl1"),i.add("texture-formats-srgb-webgl1"),i.add("texture-formats-depth-webgl1"),i.add("texture-formats-float32-webgl1"),i.add("texture-formats-float16-webgl1"),i.add("texture-filter-linear-float32-webgl"),i.add("texture-filter-linear-float16-webgl"),i.add("texture-filter-anisotropic-webgl"),i.add("texture-renderable-rgba32float-webgl"),i.add("texture-renderable-float32-webgl"),i.add("texture-renderable-float16-webgl"),i.add("glsl-frag-data"),i.add("glsl-frag-depth"),i.add("glsl-derivatives"),i.add("glsl-texture-lod"),i},n.copyExternalImageToTexture=function(i){var a,l=i.source,s=i.sourceX,h=s===void 0?0:s,b=i.sourceY,m=b===void 0?0:b,w=i.texture,O=i.mipLevel,P=O===void 0?0:O,I=i.aspect,D=I===void 0?"all":I,A=i.colorSpace,T=A===void 0?"display-p3":A,B=i.premultipliedAlpha,G=B===void 0?!1:B,W=i.width,U=W===void 0?w.width:W,F=i.height,C=F===void 0?w.height:F,L=i.depth,k=L===void 0?1:L,z=w;(a=this.handle)===null||a===void 0||a.queue.copyExternalImageToTexture({source:l,origin:[h,m]},{texture:z.handle,origin:[0,0,0],mipLevel:P,aspect:D,colorSpace:T,premultipliedAlpha:G},[U,C,k])},al(r,[{key:"info",get:function(){return this._info}},{key:"limits",get:function(){return this.handle.limits}},{key:"isLost",get:function(){return this._isLost}}]),r}(Ce);mr.type="webgpu";return oi(pl);})();
|
|
29
|
+
return __exports__;
|
|
30
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/webgpu",
|
|
3
|
-
"version": "9.0.0-
|
|
3
|
+
"version": "9.0.0-beta.2",
|
|
4
4
|
"description": "WebGPU adapter for the luma.gl API",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
@@ -13,24 +14,32 @@
|
|
|
13
14
|
"animation",
|
|
14
15
|
"3d"
|
|
15
16
|
],
|
|
16
|
-
"types": "
|
|
17
|
-
"main": "dist/index.
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
|
+
"main": "dist/index.cjs",
|
|
18
19
|
"module": "dist/index.js",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"require": "./dist/index.cjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
19
27
|
"files": [
|
|
20
28
|
"src",
|
|
21
29
|
"dist",
|
|
30
|
+
"dist.min.js",
|
|
22
31
|
"README.md"
|
|
23
32
|
],
|
|
24
33
|
"sideEffects": false,
|
|
25
34
|
"scripts": {
|
|
26
|
-
"
|
|
27
|
-
"build
|
|
35
|
+
"build-bundle": "ocular-bundle ./src/index.ts",
|
|
36
|
+
"pre-build": "npm run build-bundle && npm run build-bundle -- --env=dev"
|
|
28
37
|
},
|
|
29
38
|
"dependencies": {
|
|
30
39
|
"@babel/runtime": "^7.0.0",
|
|
31
|
-
"@luma.gl/
|
|
32
|
-
"@
|
|
33
|
-
"
|
|
40
|
+
"@luma.gl/core": "9.0.0-beta.2",
|
|
41
|
+
"@probe.gl/env": "^4.0.2",
|
|
42
|
+
"@webgpu/types": "^0.1.34"
|
|
34
43
|
},
|
|
35
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "d90ddd6231c3d405d88dfb9e8c232c4dfefcc056"
|
|
36
45
|
}
|