@luma.gl/webgl 9.0.0-alpha.48 → 9.0.0-alpha.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist.min.js CHANGED
@@ -6,12 +6,12 @@
6
6
  else root['luma'] = factory();})(globalThis, function () {
7
7
  var __exports__=(()=>{var Mn=Object.defineProperty;var Bc=Object.getOwnPropertyDescriptor;var Ic=Object.getOwnPropertyNames;var Fc=Object.prototype.hasOwnProperty;var Dc=(e,t)=>{for(var r in t)Mn(e,r,{get:t[r],enumerable:!0})},Cc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ic(t))!Fc.call(e,i)&&i!==r&&Mn(e,i,{get:()=>t[i],enumerable:!(n=Bc(t,i))||n.enumerable});return e};var Wc=e=>Cc(Mn({},"__esModule",{value:!0}),e);var Xv={};Dc(Xv,{Accessor:()=>En,WEBGLBuffer:()=>pe,WEBGLCommandEncoder:()=>Gn,WEBGLFramebuffer:()=>Te,WEBGLRenderPass:()=>Pn,WEBGLRenderPipeline:()=>Ln,WEBGLRenderbuffer:()=>wt,WEBGLResource:()=>pr,WEBGLSampler:()=>ke,WEBGLShader:()=>On,WEBGLTexture:()=>se,WEBGLTransformFeedback:()=>Dn,WEBGLVertexArray:()=>In,WebGLCanvasContext:()=>wn,WebGLDevice:()=>le,WebGLResource:()=>pr,_TEXTURE_FORMATS:()=>Me,_checkFloat32ColorAttachment:()=>on,assertWebGL2Context:()=>ru,assertWebGLContext:()=>Qr,clear:()=>Pc,convertGLToTextureFormat:()=>Ne,copyToTexture:()=>jc,getGLParameters:()=>tn,getShaderLayout:()=>Tn,getWebGL2Context:()=>Xt,isWebGL:()=>mo,isWebGL2:()=>z,polyfillContext:()=>en,popContextState:()=>ge,pushContextState:()=>_e,readPixelsToArray:()=>Ac,readPixelsToBuffer:()=>Lc,registerHeadlessGL:()=>ci,resetGLParameters:()=>bu,setDeviceParameters:()=>fn,setGLParameters:()=>be,trackContextState:()=>er,withDeviceParameters:()=>Nu,withGLParameters:()=>ve});function It(e){return It=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},It(e)}function ui(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ui(Object(r),!0).forEach(function(n){Mc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ui(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mc(e,t,r){return t=Nc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nc(e){var t=kc(e,"string");return It(t)==="symbol"?t:String(t)}function kc(e,t){if(It(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(It(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vc="Failed to create WebGL context in Node.js, headless gl returned null",Uc=" luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",zc={width:1,height:1,debug:!0,throwOnError:!1},vr=null;function ci(e){vr=e}function si(){return vr!==null}function li(e){e=fi(fi({},zc),e);var t=e,r=t.width,n=t.height,i=t.webgl1,o=t.webgl2;if(o&&!i)throw new Error("headless-gl does not support WebGL2");if(!vr)throw new Error(Uc);var a=vr(r,n,e);if(!a)throw new Error(Vc);return a}function Ft(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 J(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ft()}var Hc=globalThis.self||globalThis.window||globalThis.global,ze=globalThis.window||globalThis.self||globalThis.global,$c=globalThis.document||{},Be=globalThis.process||{},Xc=globalThis.console,pi=globalThis.navigator||{};var wr=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",tw=J();var Nn=globalThis;function _r(e){if(!e&&!J())return"Node";if(Ft(e))return"Electron";let t=e||pi.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Nn.chrome?"Chrome":Nn.safari?"Safari":Nn.mozInnerScreenX?"Firefox":"Unknown"}function Kc(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Or=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=Kc(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 di(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 hi(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 Sr(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let o=e.width*r,a=e.height*r,u=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),u]}var Pr;(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"})(Pr||(Pr={}));var Yc=10;function mi(e){return typeof e!="string"?e:(e=e.toUpperCase(),Pr[e]||Pr.WHITE)}function yi(e,t,r){if(!J&&typeof e=="string"){if(t){let n=mi(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=mi(r);e="\x1B[".concat(n+Yc,"m").concat(e,"\x1B[49m")}}return e}function bi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let o of n){let a=i[o];typeof a=="function"&&(t.find(u=>o===u)||(i[o]=a.bind(e)))}}function He(e,t){if(!e)throw new Error(t||"Assertion failed")}function Ie(){let e;if(J()&&ze.performance){var t,r;e=ze===null||ze===void 0||(t=ze.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Be){var n;let i=Be===null||Be===void 0||(n=Be.hrtime)===null||n===void 0?void 0:n.call(Be);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var $e={debug:J()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},qc={enabled:!0,level:0};function me(){}var gi={},vi={once:!0},Re=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=wr,this._startTs=Ie(),this._deltaTs=Ie(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Or("__probe-".concat(this.id,"__"),qc),this.timeStamp("".concat(this.id," started")),bi(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((Ie()-this._startTs).toPrecision(10))}getDelta(){return Number((Ie()-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){He(t,r)}warn(t){return this._getLogFunction(0,t,$e.warn,arguments,vi)}error(t){return this._getLogFunction(0,t,$e.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,$e.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,$e.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,$e.debug||$e.info,arguments,vi)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||me,n&&[n],{tag:es(r)}):me}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=t;return this._shouldLog(r||n)?J()?Jc({image:i,message:o,scale:a}):Zc({image:i,message:o,scale:a}):me}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||me)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=wi({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}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||me)}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()>=_i(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=wi({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,He(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Ie();let a=o.tag||o.message;if(o.once&&a)if(!gi[a])gi[a]=Ie();else return me;return r=Qc(this.id,o.message,o),n.bind(console,r,...o.args)}return me}};Re.VERSION=wr;function _i(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 He(Number.isFinite(t)&&t>=0),t}function wi(e){let{logLevel:t,message:r}=e;e.logLevel=_i(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 i=typeof e.message;return He(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function Qc(e,t,r){if(typeof t=="string"){let n=r.time?hi(di(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=yi(t,r.color,r.background)}return t}function Zc(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),me}function Jc(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let a=Sr(o,r,n);console.log(...a)},o.src=t,me}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Sr(t,r,n)),me;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Sr(o,r,n)),o.src=t.toDataURL(),me}return me}function es(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Gw=new Re({id:"@probe.gl/log"});var B=new Re({id:"luma.gl"});function Dt(){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 Fe=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=Dt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Dt()-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 Xe=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,i=this.stats[r];return i||(t instanceof Fe?i=t:i=new Fe(r,n),this.stats[r]=i),i}};function Ct(e){return Ct=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},Ct(e)}function Oi(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,rs(n.key),n)}}function ts(e,t,r){return t&&Oi(e.prototype,t),r&&Oi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rs(e){var t=ns(e,"string");return Ct(t)==="symbol"?t:String(t)}function ns(e,t){if(Ct(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ct(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function os(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var is=function(){function e(){os(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 Xe({id:n})),this.stats.get(n)},ts(e)}(),xr=new is;function as(){var e=typeof __VERSION__<"u"?__VERSION__:"untranspiled 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||(J()&&B.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:B,stats:xr}),e}var Si=as();function us(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function Pi(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:us(e)}var kn={};function we(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";kn[e]=kn[e]||1;var t=kn[e]++;return"".concat(e,"-").concat(t)}function Er(e){return e>0&&(e&e-1)===0}function Ke(e){var t=!0;for(var r in e){t=!1;break}return t}function Wt(e){return Wt=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},Wt(e)}function xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xi(Object(r),!0).forEach(function(n){cs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cs(e,t,r){return t=Ti(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ei(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,Ti(n.key),n)}}function ss(e,t,r){return t&&Ei(e.prototype,t),r&&Ei(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ti(e){var t=ls(e,"string");return Wt(t)==="symbol"?t:String(t)}function ls(e,t){if(Wt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Wt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ps(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var K=function(){function e(r,n,i){if(ps(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=ds(n,i);var o=this.props.id!=="undefined"?this.props.id:we(this[Symbol.toStringTag]);this.props.id=o,this.id=o,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,i=Object.values(this._attachedResources);n<i.length;n++){var o=i[n];o.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"),i=this[Symbol.toStringTag];n.get("".concat(i,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").addCount(n),o.get("".concat(i," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").subtractCount(this.allocatedBytes),i.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(i,"s Created")).incrementCount(),n.get("".concat(i,"s Active")).incrementCount()},ss(e)}();K.defaultProps={id:"undefined",handle:void 0,userData:void 0};function ds(e,t){var r=fs({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}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 ji;function Ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?Ai(Object(r),!0).forEach(function(n){hs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ai(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hs(e,t,r){return t=Ri(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ms(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Li(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,Ri(n.key),n)}}function ys(e,t,r){return t&&Li(e.prototype,t),r&&Li(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ri(e){var t=bs(e,"string");return Ye(t)==="symbol"?t:String(t)}function bs(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 gs(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&&Un(e,t)}function Un(e,t){return Un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Un(e,t)}function vs(e){var t=Os();return function(){var n=Tr(e),i;if(t){var o=Tr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ws(this,i)}}function ws(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 _s(e)}function _s(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Os(){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 Tr(e){return Tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tr(e)}ji=Symbol.toStringTag;var te=function(e){gs(r,e);var t=vs(r);function r(i,o){var a;ms(this,r);var u=Vn({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?u.indexType="uint32":o.data instanceof Uint16Array&&(u.indexType="uint16")),a=t.call(this,i,u,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=o.usage||0,a.indexType=u.indexType,a}var n=r.prototype;return n.write=function(o,a){throw new Error("not implemented")},n.readAsync=function(o,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},ys(r,[{key:ji,get:function(){return"Buffer"}}]),r}(K);te.defaultProps=Vn(Vn({},K.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});te.MAP_READ=1;te.MAP_WRITE=2;te.COPY_SRC=4;te.COPY_DST=8;te.INDEX=16;te.VERTEX=32;te.UNIFORM=64;te.STORAGE=128;te.INDIRECT=256;te.QUERY_RESOLVE=512;function Mt(e){return Mt=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},Mt(e)}var Ii;function Gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gi(Object(r),!0).forEach(function(n){Ss(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ss(e,t,r){return t=Fi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ps(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bi(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,Fi(n.key),n)}}function xs(e,t,r){return t&&Bi(e.prototype,t),r&&Bi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fi(e){var t=Es(e,"string");return Mt(t)==="symbol"?t:String(t)}function Es(e,t){if(Mt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Ii=Symbol.toStringTag;var qe=function(){function e(r){Ps(this,e),this.id=void 0,this.statsManager=xr,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=zn(zn({},e.defaultProps),r),this.id=this.props.id||we(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._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var i=zn({},n);return(n.usage||0)&te.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":B.warn("indices buffer content must be of integer type")()),i},xs(e,[{key:Ii,get:function(){return"Device"}}]),e}();qe.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(B.get("debug")),break:[],gl:null};qe.VERSION=Si;function Nt(e){return Nt=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},Nt(e)}function Ar(e,t){return Ls(e)||As(e,t)||Vi(e,t)||Ts()}function Ts(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
8
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function As(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Ls(e){if(Array.isArray(e))return e}function js(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Vi(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}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 o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Vi(e,t){if(e){if(typeof e=="string")return Di(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 Di(e,t)}}function Di(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 Ci(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ci(Object(r),!0).forEach(function(n){Rs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rs(e,t,r){return t=Ui(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mi(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,Ui(n.key),n)}}function Bs(e,t,r){return t&&Mi(e.prototype,t),r&&Mi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ui(e){var t=Is(e,"string");return Nt(t)==="symbol"?t:String(t)}function Is(e,t){if(Nt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fs=J()&&typeof document<"u",Lr=function(){return Fs&&document.readyState==="complete"},Ds={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},Qe=function(){function e(r){var n=this;if(Gs(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=Wi(Wi({},Ds),r),r=this.props,!J()){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=Ms(r.canvas):this.canvas=r.canvas;else{var i,o,a=Ns(r),u=Ws(((i=r)===null||i===void 0?void 0:i.container)||null);u.insertBefore(a,u.firstChild),this.canvas=a,(o=r)!==null&&o!==void 0&&o.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(c){var p=js(c),b;try{for(p.s();!(b=p.n()).done;){var g=b.value;g.target===n.canvas&&n.update()}}catch(v){p.e(v)}finally{p.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 i=typeof window<"u"&&window.devicePixelRatio;return i||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(),i=this.canvas;return i.parentElement?[i.clientWidth*n,i.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},t.getAspect=function(){var n=this.getPixelSize(),i=Ar(n,2),o=i[0],a=i[1];return o/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),i=Ar(n,1),o=i[0],a=this._canvasSizeInfo.clientWidth;return a?o/a:1}catch{return 1}},t.cssToDevicePixels=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),u=Ar(a,2),c=u[0],p=u[1];return ks(n,o,c,p,i)},t.setDevicePixelRatio=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var o="width"in i?i.width:this.htmlCanvas.clientWidth,a="height"in i?i.height:this.htmlCanvas.clientHeight;(!o||!a)&&(B.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,o=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var u=this._canvasSizeInfo;if(u.clientWidth!==o||u.clientHeight!==a||u.devicePixelRatio!==n){var c=n,p=Math.floor(o*c),b=Math.floor(a*c);this.htmlCanvas.width=p,this.htmlCanvas.height=b;var g=this.getDrawingBufferSize(),v=Ar(g,2),O=v[0],w=v[1];(O!==p||w!==b)&&(c=Math.min(O/o,w/a),this.htmlCanvas.width=Math.floor(o*c),this.htmlCanvas.height=Math.floor(a*c),B.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=o,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 i;((i=this.htmlCanvas)===null||i===void 0?void 0:i.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},Bs(e,null,[{key:"isPageLoaded",get:function(){return Lr()}}]),e}();Qe.pageLoaded=Cs();function Cs(){return Lr()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Ws(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!Lr())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 Ms(e){var t=document.getElementById(e);if(!t&&!Lr())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("'".concat(t,"' is not a canvas element"));return t}function Ns(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 ks(e,t,r,n,i){var o=e,a=Ni(o[0],t,r),u=ki(o[1],t,n,i),c=Ni(o[0]+1,t,r),p=c===r-1?c:c-1;c=ki(o[1]+1,t,n,i);var b;return i?(c=c===0?c:c+1,b=u,u=c):b=c===n-1?c:c-1,{x:a,y:u,width:Math.max(p-a+1,1),height:Math.max(b-u+1,1)}}function Ni(e,t,r){var n=Math.min(Math.round(e*t),r-1);return n}function ki(e,t,r,n){return n?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}function Ze(e){return Ze=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},Ze(e)}var Xi;function zi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zi(Object(r),!0).forEach(function(n){Vs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vs(e,t,r){return t=Ki(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $i(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,Ki(n.key),n)}}function zs(e,t,r){return t&&$i(e.prototype,t),r&&$i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ki(e){var t=Hs(e,"string");return Ze(t)==="symbol"?t:String(t)}function Hs(e,t){if(Ze(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ze(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $s(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&&Hn(e,t)}function Hn(e,t){return Hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Hn(e,t)}function Xs(e){var t=qs();return function(){var n=jr(e),i;if(t){var o=jr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ks(this,i)}}function Ks(e,t){if(t&&(Ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ys(e)}function Ys(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qs(){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 jr(e){return jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jr(e)}Xi=Symbol.toStringTag;var ae=function(e){$s(r,e);var t=Xs(r);function r(n,i){var o,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return Us(this,r),o=t.call(this,n,i,a),o.dimension=void 0,o.format=void 0,o.width=void 0,o.height=void 0,o.depth=void 0,o.sampler=void 0,o.dimension=o.props.dimension,o.format=o.props.format,o.width=o.props.width,o.height=o.props.height,o.depth=o.props.depth,o}return zs(r,[{key:Xi,get:function(){return"Texture"}}]),r}(K);ae.defaultProps=Hi(Hi({},K.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});ae.COPY_SRC=1;ae.COPY_DST=2;ae.TEXTURE_BINDING=4;ae.STORAGE_BINDING=8;ae.RENDER_ATTACHMENT=16;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)}var Zi;function Yi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function qi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yi(Object(r),!0).forEach(function(n){Qs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qs(e,t,r){return t=Ji(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qi(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,Ji(n.key),n)}}function Js(e,t,r){return t&&Qi(e.prototype,t),r&&Qi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ji(e){var t=el(e,"string");return Je(t)==="symbol"?t:String(t)}function el(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 tl(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&&$n(e,t)}function $n(e,t){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},$n(e,t)}function rl(e){var t=il();return function(){var n=Rr(e),i;if(t){var o=Rr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return nl(this,i)}}function nl(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 ol(e)}function ol(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function il(){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 Rr(e){return Rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rr(e)}Zi=Symbol.toStringTag;var Gr=function(e){tl(r,e);var t=rl(r);function r(n,i){var o;return Zs(this,r),o=t.call(this,n,i,r.defaultProps),o.stage=void 0,o.source=void 0,o.stage=o.props.stage,o.source=o.props.source,o}return Js(r,[{key:Zi,get:function(){return"Shader"}}]),r}(K);Gr.defaultProps=qi(qi({},K.defaultProps),{},{stage:"vertex",source:"",sourceMap:null,language:"auto",shaderType:0});function et(e){return et=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},et(e)}var na;function ea(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ea(Object(r),!0).forEach(function(n){al(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function al(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 ul(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ra(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,oa(n.key),n)}}function fl(e,t,r){return t&&ra(e.prototype,t),r&&ra(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function oa(e){var t=cl(e,"string");return et(t)==="symbol"?t:String(t)}function cl(e,t){if(et(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(et(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sl(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&&Xn(e,t)}function Xn(e,t){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Xn(e,t)}function ll(e){var t=hl();return function(){var n=Br(e),i;if(t){var o=Br(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return pl(this,i)}}function pl(e,t){if(t&&(et(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dl(e)}function dl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hl(){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 Br(e){return Br=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Br(e)}na=Symbol.toStringTag;var Ir=function(e){sl(r,e);var t=ll(r);function r(n,i){return ul(this,r),t.call(this,n,i,r.defaultProps)}return fl(r,[{key:na,get:function(){return"Sampler"}}]),r}(K);Ir.defaultProps=ta(ta({},K.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 rt(e){return rt=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},rt(e)}var fa;function ia(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ia(Object(r),!0).forEach(function(n){ml(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ia(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ml(e,t,r){return t=ca(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yl(e,t){return wl(e)||vl(e,t)||gl(e,t)||bl()}function bl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Vi(e,t){if(e){if(typeof e=="string")return Di(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 Di(e,t)}}function Di(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 Ci(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ci(Object(r),!0).forEach(function(n){Rs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rs(e,t,r){return t=Ui(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mi(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,Ui(n.key),n)}}function Bs(e,t,r){return t&&Mi(e.prototype,t),r&&Mi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ui(e){var t=Is(e,"string");return Nt(t)==="symbol"?t:String(t)}function Is(e,t){if(Nt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fs=J()&&typeof document<"u",Lr=function(){return Fs&&document.readyState==="complete"},Ds={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},Qe=function(){function e(r){var n=this;if(Gs(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=Wi(Wi({},Ds),r),r=this.props,!J()){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=Ms(r.canvas):this.canvas=r.canvas;else{var i,o,a=Ns(r),u=Ws(((i=r)===null||i===void 0?void 0:i.container)||null);u.insertBefore(a,u.firstChild),this.canvas=a,(o=r)!==null&&o!==void 0&&o.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(c){var p=js(c),b;try{for(p.s();!(b=p.n()).done;){var g=b.value;g.target===n.canvas&&n.update()}}catch(v){p.e(v)}finally{p.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 i=typeof window<"u"&&window.devicePixelRatio;return i||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(),i=this.canvas;return i.parentElement?[i.clientWidth*n,i.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},t.getAspect=function(){var n=this.getPixelSize(),i=Ar(n,2),o=i[0],a=i[1];return o/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),i=Ar(n,1),o=i[0],a=this._canvasSizeInfo.clientWidth;return a?o/a:1}catch{return 1}},t.cssToDevicePixels=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),u=Ar(a,2),c=u[0],p=u[1];return ks(n,o,c,p,i)},t.setDevicePixelRatio=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var o="width"in i?i.width:this.htmlCanvas.clientWidth,a="height"in i?i.height:this.htmlCanvas.clientHeight;(!o||!a)&&(B.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,o=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var u=this._canvasSizeInfo;if(u.clientWidth!==o||u.clientHeight!==a||u.devicePixelRatio!==n){var c=n,p=Math.floor(o*c),b=Math.floor(a*c);this.htmlCanvas.width=p,this.htmlCanvas.height=b;var g=this.getDrawingBufferSize(),v=Ar(g,2),O=v[0],w=v[1];(O!==p||w!==b)&&(c=Math.min(O/o,w/a),this.htmlCanvas.width=Math.floor(o*c),this.htmlCanvas.height=Math.floor(a*c),B.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=o,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 i;((i=this.htmlCanvas)===null||i===void 0?void 0:i.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},Bs(e,null,[{key:"isPageLoaded",get:function(){return Lr()}}]),e}();Qe.pageLoaded=Cs();function Cs(){return Lr()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Ws(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!Lr())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 Ms(e){var t=document.getElementById(e);if(!t&&!Lr())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 Ns(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 ks(e,t,r,n,i){var o=e,a=Ni(o[0],t,r),u=ki(o[1],t,n,i),c=Ni(o[0]+1,t,r),p=c===r-1?c:c-1;c=ki(o[1]+1,t,n,i);var b;return i?(c=c===0?c:c+1,b=u,u=c):b=c===n-1?c:c-1,{x:a,y:u,width:Math.max(p-a+1,1),height:Math.max(b-u+1,1)}}function Ni(e,t,r){var n=Math.min(Math.round(e*t),r-1);return n}function ki(e,t,r,n){return n?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}function Ze(e){return Ze=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},Ze(e)}var Xi;function zi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zi(Object(r),!0).forEach(function(n){Vs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vs(e,t,r){return t=Ki(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $i(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,Ki(n.key),n)}}function zs(e,t,r){return t&&$i(e.prototype,t),r&&$i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ki(e){var t=Hs(e,"string");return Ze(t)==="symbol"?t:String(t)}function Hs(e,t){if(Ze(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ze(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $s(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&&Hn(e,t)}function Hn(e,t){return Hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Hn(e,t)}function Xs(e){var t=qs();return function(){var n=jr(e),i;if(t){var o=jr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ks(this,i)}}function Ks(e,t){if(t&&(Ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ys(e)}function Ys(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qs(){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 jr(e){return jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jr(e)}Xi=Symbol.toStringTag;var ae=function(e){$s(r,e);var t=Xs(r);function r(n,i){var o,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return Us(this,r),o=t.call(this,n,i,a),o.dimension=void 0,o.format=void 0,o.width=void 0,o.height=void 0,o.depth=void 0,o.sampler=void 0,o.dimension=o.props.dimension,o.format=o.props.format,o.width=o.props.width,o.height=o.props.height,o.depth=o.props.depth,o}return zs(r,[{key:Xi,get:function(){return"Texture"}}]),r}(K);ae.defaultProps=Hi(Hi({},K.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});ae.COPY_SRC=1;ae.COPY_DST=2;ae.TEXTURE_BINDING=4;ae.STORAGE_BINDING=8;ae.RENDER_ATTACHMENT=16;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)}var Zi;function Yi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function qi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yi(Object(r),!0).forEach(function(n){Qs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qs(e,t,r){return t=Ji(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qi(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,Ji(n.key),n)}}function Js(e,t,r){return t&&Qi(e.prototype,t),r&&Qi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ji(e){var t=el(e,"string");return Je(t)==="symbol"?t:String(t)}function el(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 tl(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&&$n(e,t)}function $n(e,t){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},$n(e,t)}function rl(e){var t=il();return function(){var n=Rr(e),i;if(t){var o=Rr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return nl(this,i)}}function nl(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 ol(e)}function ol(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function il(){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 Rr(e){return Rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rr(e)}Zi=Symbol.toStringTag;var Gr=function(e){tl(r,e);var t=rl(r);function r(n,i){var o;return Zs(this,r),o=t.call(this,n,i,r.defaultProps),o.stage=void 0,o.source=void 0,o.stage=o.props.stage,o.source=o.props.source,o}return Js(r,[{key:Zi,get:function(){return"Shader"}}]),r}(K);Gr.defaultProps=qi(qi({},K.defaultProps),{},{stage:"vertex",source:"",sourceMap:null,language:"auto",shaderType:0});function et(e){return et=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},et(e)}var na;function ea(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ea(Object(r),!0).forEach(function(n){al(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function al(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 ul(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ra(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,oa(n.key),n)}}function fl(e,t,r){return t&&ra(e.prototype,t),r&&ra(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function oa(e){var t=cl(e,"string");return et(t)==="symbol"?t:String(t)}function cl(e,t){if(et(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(et(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sl(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&&Xn(e,t)}function Xn(e,t){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Xn(e,t)}function ll(e){var t=hl();return function(){var n=Br(e),i;if(t){var o=Br(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return pl(this,i)}}function pl(e,t){if(t&&(et(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dl(e)}function dl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hl(){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 Br(e){return Br=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Br(e)}na=Symbol.toStringTag;var Ir=function(e){sl(r,e);var t=ll(r);function r(n,i){return ul(this,r),t.call(this,n,i,r.defaultProps)}return fl(r,[{key:na,get:function(){return"Sampler"}}]),r}(K);Ir.defaultProps=ta(ta({},K.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 rt(e){return rt=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},rt(e)}var fa;function ia(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ia(Object(r),!0).forEach(function(n){ml(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ia(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ml(e,t,r){return t=ca(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yl(e,t){return wl(e)||vl(e,t)||gl(e,t)||bl()}function bl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
10
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gl(e,t){if(e){if(typeof e=="string")return aa(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 aa(e,t)}}function aa(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 vl(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function wl(e){if(Array.isArray(e))return e}function _l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ua(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,ca(n.key),n)}}function Ol(e,t,r){return t&&ua(e.prototype,t),r&&ua(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ca(e){var t=Sl(e,"string");return rt(t)==="symbol"?t:String(t)}function Sl(e,t){if(rt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pl(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&&Kn(e,t)}function Kn(e,t){return Kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Kn(e,t)}function xl(e){var t=Al();return function(){var n=Fr(e),i;if(t){var o=Fr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return El(this,i)}}function El(e,t){if(t&&(rt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tl(e)}function Tl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Al(){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 Fr(e){return Fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fr(e)}fa=Symbol.toStringTag;var nt=function(e){Pl(r,e);var t=xl(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _l(this,r),o=t.call(this,i,a,r.defaultProps),o.width=void 0,o.height=void 0,o.colorAttachments=[],o.depthStencilAttachment=null,o.width=o.props.width,o.height=o.props.height,o}var n=r.prototype;return n.resize=function(o){var a=!o;if(o){var u=Array.isArray(o)?o:[o.width,o.height],c=yl(u,2),p=c[0],b=c[1];a=a||b!==this.height||p!==this.width,this.width=p,this.height=b}a&&(B.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 o=this;if(this.colorAttachments=this.props.colorAttachments.map(function(u){if(typeof u=="string"){var c=o.createColorTexture(u);return o.attachResource(c),c}return u}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){var a=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(a),this.depthStencilAttachment=a}else this.depthStencilAttachment=this.props.depthStencilAttachment},n.createColorTexture=function(o){return this.device.createTexture({id:"color-attachment",usage:ae.RENDER_ATTACHMENT,format:o,width:this.width,height:this.height})},n.createDepthStencilTexture=function(o){return this.device.createTexture({id:"depth-stencil-attachment",usage:ae.RENDER_ATTACHMENT,format:o,width:this.width,height:this.height})},n.resizeAttachments=function(o,a){for(var u=0;u<this.colorAttachments.length;++u)if(this.colorAttachments[u]){var c=this.device._createTexture(tt(tt({},this.colorAttachments[u].props),{},{width:o,height:a}));this.destroyAttachedResource(this.colorAttachments[u]),this.colorAttachments[u]=c,this.attachResource(c)}if(this.depthStencilAttachment){var p=this.device._createTexture(tt(tt({},this.depthStencilAttachment.props),{},{width:o,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=p,this.attachResource(p)}},Ol(r,[{key:fa,get:function(){return"Framebuffer"}}]),r}(K);nt.defaultProps=tt(tt({},K.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});function ot(e){return ot=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},ot(e)}var da;function sa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function la(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sa(Object(r),!0).forEach(function(n){Ll(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ll(e,t,r){return t=ha(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pa(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,ha(n.key),n)}}function Rl(e,t,r){return t&&pa(e.prototype,t),r&&pa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ha(e){var t=Gl(e,"string");return ot(t)==="symbol"?t:String(t)}function Gl(e,t){if(ot(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ot(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bl(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&&Yn(e,t)}function Yn(e,t){return Yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Yn(e,t)}function Il(e){var t=Cl();return function(){var n=Dr(e),i;if(t){var o=Dr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Fl(this,i)}}function Fl(e,t){if(t&&(ot(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dl(e)}function Dl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cl(){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 Dr(e){return Dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dr(e)}da=Symbol.toStringTag;var Cr=function(e){Bl(r,e);var t=Il(r);function r(n,i){var o;return jl(this,r),o=t.call(this,n,i,r.defaultProps),o.hash="",o.vs=void 0,o.fs=void 0,o.shaderLayout=void 0,o.bufferLayout=void 0,o.shaderLayout=o.props.shaderLayout,o.bufferLayout=o.props.bufferLayout||[],o}return Rl(r,[{key:da,get:function(){return"RenderPipeline"}}]),r}(K);Cr.defaultProps=la(la({},K.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function it(e){return it=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},it(e)}var ga;function ma(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ya(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ma(Object(r),!0).forEach(function(n){Wl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ma(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wl(e,t,r){return t=va(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ml(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ba(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,va(n.key),n)}}function Nl(e,t,r){return t&&ba(e.prototype,t),r&&ba(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function va(e){var t=kl(e,"string");return it(t)==="symbol"?t:String(t)}function kl(e,t){if(it(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(it(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vl(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&&qn(e,t)}function qn(e,t){return qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},qn(e,t)}function Ul(e){var t=$l();return function(){var n=Wr(e),i;if(t){var o=Wr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return zl(this,i)}}function zl(e,t){if(t&&(it(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hl(e)}function Hl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $l(){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 Wr(e){return Wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wr(e)}ga=Symbol.toStringTag;var Mr=function(e){Vl(r,e);var t=Ul(r);function r(n,i){return Ml(this,r),t.call(this,n,i,r.defaultProps)}return Nl(r,[{key:ga,get:function(){return"RenderPass"}}]),r}(K);Mr.defaultProps=ya(ya({},K.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});function at(e){return at=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},at(e)}var Sa;function wa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wa(Object(r),!0).forEach(function(n){Xl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xl(e,t,r){return t=Pa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oa(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,Pa(n.key),n)}}function Yl(e,t,r){return t&&Oa(e.prototype,t),r&&Oa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pa(e){var t=ql(e,"string");return at(t)==="symbol"?t:String(t)}function ql(e,t){if(at(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(at(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ql(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&&Qn(e,t)}function Qn(e,t){return Qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qn(e,t)}function Zl(e){var t=tp();return function(){var n=Nr(e),i;if(t){var o=Nr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Jl(this,i)}}function Jl(e,t){if(t&&(at(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ep(e)}function ep(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tp(){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 Nr(e){return Nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nr(e)}Sa=Symbol.toStringTag;var kr=function(e){Ql(r,e);var t=Zl(r);function r(i,o){return Kl(this,r),t.call(this,i,o,r.defaultProps)}var n=r.prototype;return n.pushDebugGroup=function(o){},n.popDebugGroup=function(){},n.insertDebugMarker=function(o){},Yl(r,[{key:Sa,get:function(){return"CommandEncoder"}}]),r}(K);kr.defaultProps=_a(_a({},K.defaultProps),{},{measureExecutionTime:void 0});function ut(e){return ut=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},ut(e)}var Ta;function xa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xa(Object(r),!0).forEach(function(n){np(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function np(e,t,r){return t=Aa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function op(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ea(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,Aa(n.key),n)}}function ip(e,t,r){return t&&Ea(e.prototype,t),r&&Ea(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aa(e){var t=ap(e,"string");return ut(t)==="symbol"?t:String(t)}function ap(e,t){if(ut(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ut(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function up(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&&Zn(e,t)}function Zn(e,t){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zn(e,t)}function fp(e){var t=lp();return function(){var n=Vr(e),i;if(t){var o=Vr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return cp(this,i)}}function cp(e,t){if(t&&(ut(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sp(e)}function sp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lp(){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 Vr(e){return Vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vr(e)}Ta=Symbol.toStringTag;var Ur=function(e){up(r,e);var t=fp(r);function r(n,i){return op(this,r),t.call(this,n,i,r.defaultProps)}return ip(r,[{key:Ta,get:function(){return"CommandBuffer"}}]),r}(K);Ur.defaultProps=rp({},K.defaultProps);function pp(e,t){return yp(e)||mp(e,t)||hp(e,t)||dp()}function dp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
11
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hp(e,t){if(e){if(typeof e=="string")return La(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 La(e,t)}}function La(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 mp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function yp(e){if(Array.isArray(e))return e}function ja(e){var t=pp(gp[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",a=vp[r]*n,u=bp(r,n);return{dataType:r,components:n,defaultVertexFormat:u,byteLength:a,integer:i,signed:o}}function bp(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 gp={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]},vp={f32:4,f16:2,i32:4,u32:4};function zr(e){var t=Ra[e],r=wp(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:Ra[e],byteLength:r,integer:i,signed:o,normalized:n}}function wp(e){var t=_p[e];return t}var Ra={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},_p={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Op(e,t){return Ep(e)||xp(e,t)||Pp(e,t)||Sp()}function Sp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
12
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pp(e,t){if(e){if(typeof e=="string")return Ga(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 Ga(e,t)}}function Ga(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 xp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Ep(e){if(Array.isArray(e))return e}function Jn(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=Op(r,2),i=n[0],o=n[1],a=i,u=o?parseInt(o):1,c=zr(a),p={type:a,components:u,byteLength:c.byteLength*u,integer:c.integer,signed:c.signed,normalized:c.normalized};return t&&(p.webglOnly=!0),p}function kt(e){return kt=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},kt(e)}function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function eo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ba(Object(r),!0).forEach(function(n){Tp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tp(e,t,r){return t=Ap(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ap(e){var t=Lp(e,"string");return kt(t)==="symbol"?t:String(t)}function Lp(e,t){if(kt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(kt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ft(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=jp(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
13
13
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function jp(e,t){if(e){if(typeof e=="string")return Ia(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 Ia(e,t)}}function Ia(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 Fa(e,t){var r={},n=ft(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=Rp(e,t,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Da(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=Fa(e,t),i=new Array(r).fill(null),o=0,a=Object.values(n);o<a.length;o++){var u=a[o];i[u.location]=u}return i}function Rp(e,t,r){var n=Gp(e,r),i=Bp(t,r);if(!n)return null;var o=ja(n.type),a=i?.vertexFormat||o.defaultVertexFormat,u=Jn(a);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:a,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Gp(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||B.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function Bp(e,t){Ip(e);var r=Fp(e,t);return r||(r=Dp(e,t),r)?r:(B.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Ip(e){var t=ft(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&B.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function Fp(e,t){var r=ft(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.format&&i.name===t)return{attributeName:i.name,bufferName:t,stepMode:i.stepMode,vertexFormat:i.format,byteOffset:0,byteStride:i.byteStride||0}}}catch(o){r.e(o)}finally{r.f()}return null}function Dp(e,t){var r=ft(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var u=ft(o.attributes||[]),c;try{for(u.s();!(c=u.n()).done;){var p=c.value,b=Jn(p.format);a+=b.byteLength}}catch(v){u.e(v)}finally{u.f()}}var g=(i=o.attributes)===null||i===void 0?void 0:i.find(function(v){return v.attribute===t});if(g)return{attributeName:g.attribute,bufferName:o.name,stepMode:o.stepMode,vertexFormat:g.format,byteOffset:g.byteOffset,byteStride:a}}}catch(v){r.e(v)}finally{r.f()}return null}function to(e,t){var r=eo(eo({},e),{},{attributes:e.attributes.map(function(a){return eo({},a)})}),n=ft(t?.attributes||[]),i;try{var o=function(){var u=i.value,c=r.attributes.find(function(p){return p.name===u.name});c?(c.type=u.type||c.type,c.stepMode=u.stepMode||c.stepMode):B.warn("shader layout attribute ".concat(u.name," not present in shader"))};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}function ct(e){return ct=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},ct(e)}var Na;function Ca(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ca(Object(r),!0).forEach(function(n){Cp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ca(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cp(e,t,r){return t=ka(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ma(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,ka(n.key),n)}}function Mp(e,t,r){return t&&Ma(e.prototype,t),r&&Ma(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ka(e){var t=Np(e,"string");return ct(t)==="symbol"?t:String(t)}function Np(e,t){if(ct(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ct(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kp(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&&ro(e,t)}function ro(e,t){return ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ro(e,t)}function Vp(e){var t=Hp();return function(){var n=Hr(e),i;if(t){var o=Hr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Up(this,i)}}function Up(e,t){if(t&&(ct(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zp(e)}function zp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hp(){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 Hr(e){return Hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hr(e)}Na=Symbol.toStringTag;var $r=function(e){kp(r,e);var t=Vp(r);function r(n,i){var o;return Wp(this,r),o=t.call(this,n,i,r.defaultProps),o.maxVertexAttributes=void 0,o.attributeInfos=void 0,o.indexBuffer=null,o.attributes=void 0,o.maxVertexAttributes=n.limits.maxVertexAttributes,o.attributes=new Array(o.maxVertexAttributes).fill(null),o.attributeInfos=Da(i.renderPipeline.shaderLayout,i.renderPipeline.bufferLayout,o.maxVertexAttributes),o}return Mp(r,[{key:Na,get:function(){return"VertexArray"}}]),r}(K);$r.defaultProps=Wa(Wa({},K.defaultProps),{},{renderPipeline:null});function st(e){return st=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},st(e)}var Ha;function Va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ua(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){$p(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $p(e,t,r){return t=$a(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function za(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,$a(n.key),n)}}function Kp(e,t,r){return t&&za(e.prototype,t),r&&za(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $a(e){var t=Yp(e,"string");return st(t)==="symbol"?t:String(t)}function Yp(e,t){if(st(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(st(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qp(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&&no(e,t)}function no(e,t){return no=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},no(e,t)}function Qp(e){var t=ed();return function(){var n=Xr(e),i;if(t){var o=Xr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Zp(this,i)}}function Zp(e,t){if(t&&(st(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jp(e)}function Jp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ed(){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 Xr(e){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xr(e)}Ha=Symbol.toStringTag;var Kr=function(e){qp(r,e);var t=Qp(r);function r(n,i){return Xp(this,r),t.call(this,n,i,r.defaultProps)}return Kp(r,[{key:Ha,get:function(){return"TransformFeedback"}}]),r}(K);Kr.defaultProps=Ua(Ua({},K.defaultProps),{},{layout:void 0,buffers:{}});function M(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var Yr;function Xa(e){return(!Yr||Yr.byteLength<e)&&(Yr=new ArrayBuffer(e)),Yr}function oo(e,t){var r=Xa(e.BYTES_PER_ELEMENT*t);return new e(r,0,t)}function io(e){for(var t=e.target,r=e.source,n=e.start,i=n===void 0?0:n,o=e.count,a=o===void 0?1:o,u=r.length,c=a*u,p=0,b=i;p<u;p++)t[b++]=r[p];for(;p<c;)p<c-p?(t.copyWithin(i+p,i,i+p),p*=2):(t.copyWithin(i+p,i,i+c-p),p=c);return e.target}function Vt(e){return Vt=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},Vt(e)}function Ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function td(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ka(Object(r),!0).forEach(function(n){rd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ka(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rd(e,t,r){return t=nd(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nd(e){var t=od(e,"string");return Vt(t)==="symbol"?t:String(t)}function od(e,t){if(Vt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Vt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function id(e,t){return cd(e)||fd(e,t)||ud(e,t)||ad()}function ad(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ud(e,t){if(e){if(typeof e=="string")return Ya(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 Ya(e,t)}}function Ya(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 fd(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function cd(e){if(Array.isArray(e))return e}var sd=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function qr(e){var t=sd.exec(e);if(t){var r=id(t,6),n=r[1],i=r[2],o=r[3],a=r[4],u=r[5];if(n){var c="".concat(o).concat(i),p=zr(c);return td({format:n,components:0,srgb:a==="-srgb",unsized:u==="-unsized",webgl:u==="-webgl"},p)}}return pd(e)}var ld={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2unorm-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function pd(e){var t=ld[e];if(!t)throw new Error("Unknown format ".concat(e));return{format:t.format||"",components:t.components||1,byteLength:t.bpp||1,srgb:!1,unsized:!1}}function dd(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=hd(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ud(e,t){if(e){if(typeof e=="string")return Ya(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 Ya(e,t)}}function Ya(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 fd(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function cd(e){if(Array.isArray(e))return e}var sd=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function qr(e){var t=sd.exec(e);if(t){var r=id(t,6),n=r[1],i=r[2],o=r[3],a=r[4],u=r[5];if(n){var c="".concat(o).concat(i),p=zr(c);return td({format:n,components:n.length,srgb:a==="-srgb",unsized:u==="-unsized",webgl:u==="-webgl"},p)}}return pd(e)}var ld={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2unorm-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function pd(e){var t,r=ld[e];if(!r)throw new Error("Unknown format ".concat(e));return{format:r.format||"",components:r.components||((t=r.format)===null||t===void 0?void 0:t.length)||1,byteLength:r.bpp||1,srgb:!1,unsized:!1}}function dd(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=hd(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
15
15
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function hd(e,t){if(e){if(typeof e=="string")return qa(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 qa(e,t)}}function qa(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 ao(e,t,r){var n=t.split(/\r?\n/),i="",o=dd(e),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;i+=md(u,n,u.lineNum,r)}}catch(c){o.e(c)}finally{o.f()}return i}function md(e,t,r,n){if(n!=null&&n.showSourceCode){var i=e.linePos>0?"".concat(" ".repeat(e.linePos+5),`^^^
16
16
  `):"",o=yd(t,r);return"".concat(o).concat(i).concat(e.type.toUpperCase(),": ").concat(e.message,`
17
17
 
@@ -41,7 +41,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
41
41
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yb(e,t){if(e){if(typeof e=="string")return Hf(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 Hf(e,t)}}function Hf(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 qb(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Qb(e){if(Array.isArray(e))return e}function ee(e,t,r){return t=Zb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zb(e){var t=Jb(e,"string");return mr(t)==="symbol"?t:String(t)}function Jb(e,t){if(mr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xf(e){return eg.includes(e)}var eg=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],Kf=(Q={},ee(Q,5126,[5126,1,"float","f32","float32"]),ee(Q,35664,[5126,2,"vec2","vec2<f32>","float32x2"]),ee(Q,35665,[5126,3,"vec3","vec3<f32>","float32x3"]),ee(Q,35666,[5126,4,"vec4","vec4<f32>","float32x4"]),ee(Q,5124,[5124,1,"int","i32","sint32"]),ee(Q,35667,[5124,2,"ivec2","vec2<i32>","sint32x2"]),ee(Q,35668,[5124,3,"ivec3","vec3<i32>","sint32x3"]),ee(Q,35669,[5124,4,"ivec4","vec4<i32>","sint32x4"]),ee(Q,5125,[5125,1,"uint","u32","uint32"]),ee(Q,36294,[5125,2,"uvec2","vec2<u32>","uint32x2"]),ee(Q,36295,[5125,3,"uvec3","vec3<u32>","uint32x3"]),ee(Q,36296,[5125,4,"uvec4","vec4<u32>","uint32x4"]),ee(Q,35670,[5126,1,"bool","f32","float32"]),ee(Q,35671,[5126,2,"bvec2","vec2<f32>","float32x2"]),ee(Q,35672,[5126,3,"bvec3","vec3<f32>","float32x3"]),ee(Q,35673,[5126,4,"bvec4","vec4<f32>","float32x4"]),ee(Q,35674,[5126,8,"mat2","mat2x2<f32>"]),ee(Q,35685,[5126,8,"mat2x3","mat2x3<f32>"]),ee(Q,35686,[5126,8,"mat2x4","mat2x4<f32>"]),ee(Q,35687,[5126,12,"mat3x2","mat3x2<f32>"]),ee(Q,35675,[5126,12,"mat3","mat3x3<f32>"]),ee(Q,35688,[5126,12,"mat3x4","mat3x4<f32>"]),ee(Q,35689,[5126,16,"mat4x2","mat4x2<f32>"]),ee(Q,35690,[5126,16,"mat4x3","mat4x3<f32>"]),ee(Q,35676,[5126,16,"mat4","mat4x4<f32>"]),Q);function qo(e){var t=Kf[e];if(!t)throw new Error("uniform");var r=$f(t,4),n=r[0],i=r[1],o=r[3];return{format:o,components:i,glType:n}}function Yf(e){var t=Kf[e];if(!t)throw new Error("attribute");var r=$f(t,5),n=r[1],i=r[3],o=r[4],a=i;return{attributeType:a,vertexFormat:o,components:n}}var ie;function yr(e){return yr=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},yr(e)}function tg(e,t){return ig(e)||og(e,t)||ng(e,t)||rg()}function rg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
42
42
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ng(e,t){if(e){if(typeof e=="string")return qf(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 qf(e,t)}}function qf(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 og(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function ig(e){if(Array.isArray(e))return e}function Qf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qf(Object(r),!0).forEach(function(n){fe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fe(e,t,r){return t=ag(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ag(e){var t=ug(e,"string");return yr(t)==="symbol"?t:String(t)}function ug(e,t){if(yr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tn(e,t){var r={attributes:[],bindings:[]};r.attributes=fg(e,t);for(var n=lg(e,t),i=0,o=n;i<o.length;i++){var a=o[i],u=a.uniforms.map(function(x){return{name:x.name,format:x.format,byteOffset:x.byteOffset,byteStride:x.byteStride,arrayLength:x.arrayLength}});r.bindings.push({type:"uniform",name:a.name,location:a.location,visibility:(a.vertex?1:0)&(a.fragment?2:0),minBindingSize:a.byteLength,uniforms:u})}for(var c=sg(e,t),p=0,b=0,g=c;b<g.length;b++){var v=g[b];if(Xf(v.type)){var O=dg(v.type),w=O.viewDimension,P=O.sampleType;r.bindings.push({type:"texture",name:v.name,location:p,viewDimension:w,sampleType:P}),v.textureUnit=p,p+=1}}c.length&&(r.uniforms=c);var A=cg(e,t);return A!=null&&A.length&&(r.varyings=A),r}function fg(e,t){for(var r=[],n=e.getProgramParameter(t,35721),i=0;i<n;i++){var o=e.getActiveAttrib(t,i);if(!o)throw new Error("activeInfo");var a=o.name,u=o.type,c=e.getAttribLocation(t,a);if(c>=0){var p=Yf(u),b=p.attributeType,g=/instance/i.test(a)?"instance":"vertex";r.push({name:a,location:c,stepMode:g,type:b})}}return r.sort(function(v,O){return v.location-O.location}),r}function cg(e,t){if(!z(e))return[];for(var r=e,n=[],i=e.getProgramParameter(t,35971),o=0;o<i;o++){var a=r.getTransformFeedbackVarying(t,o);if(!a)throw new Error("activeInfo");var u=a.name,c=a.type,p=a.size,b=qo(c),g=b.glType,v=b.components,O=new En({type:g,size:p*v}),w={location:o,name:u,accessor:O};n.push(w)}return n.sort(function(P,A){return P.location-A.location}),n}function sg(e,t){for(var r=[],n=e.getProgramParameter(t,35718),i=0;i<n;i++){var o=e.getActiveUniform(t,i);if(!o)throw new Error("activeInfo");var a=o.name,u=o.size,c=o.type,p=hg(a),b=p.name,g=p.isArray,v=e.getUniformLocation(t,b),O={location:v,name:b,size:u,type:c,isArray:g};if(r.push(O),O.size>1)for(var w=0;w<O.size;w++){var P="".concat(b,"[").concat(w,"]");v=e.getUniformLocation(t,P);var A=Zf(Zf({},O),{},{name:P,location:v});r.push(A)}}return r}function lg(e,t){if(!z(e))return[];for(var r=e,n=function(A,x){return r.getActiveUniformBlockParameter(t,A,x)},i=[],o=r.getProgramParameter(t,35382),a=0;a<o;a++){for(var u={name:r.getActiveUniformBlockName(t,a)||"",location:n(a,35391),byteLength:n(a,35392),vertex:n(a,35396),fragment:n(a,35398),uniformCount:n(a,35394),uniforms:[]},c=n(a,35395)||[],p=r.getActiveUniforms(t,c,35383),b=r.getActiveUniforms(t,c,35384),g=r.getActiveUniforms(t,c,35387),v=r.getActiveUniforms(t,c,35388),O=0;O<u.uniformCount;++O){var w=r.getActiveUniform(t,c[O]);if(!w)throw new Error("activeInfo");u.uniforms.push({name:w.name,format:qo(p[O]).format,type:p[O],arrayLength:b[O],byteOffset:g[O],byteStride:v[O]})}i.push(u)}return i.sort(function(P,A){return P.location-A.location}),i}var pg=(ie={},fe(ie,35678,["2d","float"]),fe(ie,35680,["cube","float"]),fe(ie,35679,["3d","float"]),fe(ie,35682,["3d","depth"]),fe(ie,36289,["2d-array","float"]),fe(ie,36292,["2d-array","depth"]),fe(ie,36293,["cube","float"]),fe(ie,36298,["2d","sint"]),fe(ie,36299,["3d","sint"]),fe(ie,36300,["cube","sint"]),fe(ie,36303,["2d-array","uint"]),fe(ie,36306,["2d","uint"]),fe(ie,36307,["3d","uint"]),fe(ie,36308,["cube","uint"]),fe(ie,36311,["2d-array","uint"]),ie);function dg(e){var t=pg[e];if(!t)throw new Error("sampler");var r=tg(t,2),n=r[0],i=r[1];return{viewDimension:n,sampleType:i}}function hg(e){if(e[e.length-1]!=="]")return{name:e,length:1,isArray:!1};var t=/([^[]*)(\[[0-9]+\])?/,r=t.exec(e);if(!r||r.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(e));return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function Jf(e,t,r,n){var i=e,o=n;o===!0&&(o=1),o===!1&&(o=0);var a=typeof o=="number"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof n!="number")throw new Error("samplers must be set to integers");return e.uniform1i(t,n);case 5126:return e.uniform1fv(t,a);case 35664:return e.uniform2fv(t,a);case 35665:return e.uniform3fv(t,a);case 35666:return e.uniform4fv(t,a);case 5124:return e.uniform1iv(t,a);case 35667:return e.uniform2iv(t,a);case 35668:return e.uniform3iv(t,a);case 35669:return e.uniform4iv(t,a);case 35670:return e.uniform1iv(t,a);case 35671:return e.uniform2iv(t,a);case 35672:return e.uniform3iv(t,a);case 35673:return e.uniform4iv(t,a);case 5125:return i.uniform1uiv(t,a,1);case 36294:return i.uniform2uiv(t,a,2);case 36295:return i.uniform3uiv(t,a,3);case 36296:return i.uniform4uiv(t,a,4);case 35674:return e.uniformMatrix2fv(t,!1,a);case 35675:return e.uniformMatrix3fv(t,!1,a);case 35676:return e.uniformMatrix4fv(t,!1,a);case 35685:return i.uniformMatrix2x3fv(t,!1,a);case 35686:return i.uniformMatrix2x4fv(t,!1,a);case 35687:return i.uniformMatrix3x2fv(t,!1,a);case 35688:return i.uniformMatrix3x4fv(t,!1,a);case 35689:return i.uniformMatrix4x2fv(t,!1,a);case 35690:return i.uniformMatrix4x3fv(t,!1,a)}throw new Error("Illegal uniform")}function ec(e){switch(e){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(e)}}function tc(e){switch(e){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(e)}}function Tt(e){return Tt=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},Tt(e)}function rc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=uc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
43
43
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function nc(e,t){return bg(e)||yg(e,t)||uc(e,t)||mg()}function mg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
44
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uc(e,t){if(e){if(typeof e=="string")return oc(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 oc(e,t)}}function oc(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 yg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function bg(e){if(Array.isArray(e))return e}function ic(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,vg(n.key),n)}}function gg(e,t,r){return t&&ic(e.prototype,t),r&&ic(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vg(e){var t=wg(e,"string");return Tt(t)==="symbol"?t:String(t)}function wg(e,t){if(Tt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Tt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Og(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&&Qo(e,t)}function Qo(e,t){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qo(e,t)}function Sg(e){var t=Eg();return function(){var n=An(e),i;if(t){var o=An(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Pg(this,i)}}function Pg(e,t){if(t&&(Tt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xg(e)}function xg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eg(){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 An(e){return An=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},An(e)}var ac=4,Ln=function(e){Og(r,e);var t=Sg(r);function r(i,o){var a;_g(this,r),a=t.call(this,i,o),a.device=void 0,a.handle=void 0,a.vs=void 0,a.fs=void 0,a.introspectedLayout=void 0,a.uniforms={},a.bindings={},a.varyings=null,a._uniformCount=0,a._uniformSetters={},a.device=i,a.handle=a.props.handle||a.device.gl.createProgram(),a.device.setSpectorMetadata(a.handle,{id:a.props.id}),a.vs=o.vs,a.fs=o.fs;var u=o.varyings,c=o.bufferMode,p=c===void 0?35981:c;if(u&&u.length>0){var b;a.device.assertWebGL2(),a.varyings=u,(b=a.device.gl2)===null||b===void 0||b.transformFeedbackVaryings(a.handle,u,p)}return a._compileAndLink(),a.introspectedLayout=Tn(a.device.gl,a.handle),a.shaderLayout=to(a.introspectedLayout,o.shaderLayout),a}var n=r.prototype;return n.destroy=function(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)},n.setBindings=function(o){for(var a=this,u=function(){var v=nc(p[c],2),O=v[0],w=v[1],P=a.shaderLayout.bindings.find(function(x){return x.name===O})||a.shaderLayout.bindings.find(function(x){return x.name==="".concat(O,"Uniforms")});if(!P){var A=a.shaderLayout.bindings.map(function(x){return'"'.concat(x.name,'"')}).join(", ");return B.warn('Unknown binding "'.concat(O,'" in render pipeline "').concat(a.id,'", expected one of ').concat(A))(),"continue"}switch(w||B.warn('Unsetting binding "'.concat(O,'" in render pipeline "').concat(a.id,'"'))(),P.type){case"uniform":if(!(w instanceof pe)&&!(w.buffer instanceof pe))throw new Error("buffer value");break;case"texture":if(!(w instanceof se||w instanceof Te))throw new Error("texture value");break;case"sampler":B.warn("Ignoring sampler ".concat(O))();break;default:throw new Error(P.type)}a.bindings[O]=w},c=0,p=Object.entries(o);c<p.length;c++)var b=u()},n.setUniforms=function(o){var a=uo(o),u=a.bindings;Object.keys(u).forEach(function(c){B.warn('Unsupported value "'.concat(u[c],'" used in setUniforms() for key ').concat(c,". Use setBindings() instead?"))()}),Object.assign(this.uniforms,o)},n.draw=function(o){var a,u=this,c=o.renderPass,p=o.vertexArray,b=o.vertexCount,g=o.instanceCount,v=o.firstVertex,O=v===void 0?0:v,w=o.transformFeedback,P=ec(this.props.topology),A=Boolean(p.indexBuffer),x=(a=p.indexBuffer)===null||a===void 0?void 0:a.glIndexType,T=Number(g)>0;if(!this._areTexturesRenderable()||b===0)return!1;this.device.gl.useProgram(this.handle),p.bindBeforeRender(c),w&&w.begin(this.props.topology),this._applyBindings(),this._applyUniforms();var R=c;return Mu(this.device,this.props.parameters,R.glParameters,function(){if(A&&T){var j;(j=u.device.gl2)===null||j===void 0||j.drawElementsInstanced(P,b||0,x,O,g||0)}else if(A)u.device.gl.drawElements(P,b||0,x,O);else if(T){var k;(k=u.device.gl2)===null||k===void 0||k.drawArraysInstanced(P,O,b||0,g||0)}else u.device.gl.drawArrays(P,O,b||0);w&&w.end()}),p.unbindAfterRender(c),!0},n._compileAndLink=function(){var o=this.device.gl;o.attachShader(this.handle,this.vs.handle),o.attachShader(this.handle,this.fs.handle),B.time(ac,"linkProgram for ".concat(this.id))(),o.linkProgram(this.handle),B.timeEnd(ac,"linkProgram for ".concat(this.id))(),!o.debug&&B.level;var a=o.getProgramParameter(this.handle,35714);if(!a)throw new Error("Error linking: ".concat(o.getProgramInfoLog(this.handle)));o.validateProgram(this.handle);var u=o.getProgramParameter(this.handle,35715);if(!u)throw new Error("Error validating: ".concat(o.getProgramInfoLog(this.handle)))},n._areTexturesRenderable=function(){for(var o=!0,a=0,u=Object.entries(this.bindings);a<u.length;a++){var c=nc(u[a],2),p=c[1];p instanceof se&&(p.update(),o=o&&p.loaded)}return o},n._applyBindings=function(){this.device.gl.useProgram(this.handle);var o=this.device.gl2;if(!o)throw new Error("bindings");var a=0,u=0,c=rc(this.shaderLayout.bindings),p;try{for(c.s();!(p=c.n()).done;){var b=p.value,g=this.bindings[b.name]||this.bindings[b.name.replace(/Uniforms$/,"")];if(!g)throw new Error("No value for binding ".concat(b.name," in ").concat(this.id));switch(b.type){case"uniform":var v=b.name,O=o.getUniformBlockIndex(this.handle,v);if(O===4294967295)throw new Error("Invalid uniform block name ".concat(v));o.uniformBlockBinding(this.handle,u,O),g instanceof pe?o.bindBufferBase(35345,u,g.handle):o.bindBufferRange(35345,u,g.buffer.handle,g.offset||0,g.size||g.buffer.byteLength-g.offset),u+=1;break;case"texture":if(!(g instanceof se||g instanceof Te))throw new Error("texture");var w=void 0;if(g instanceof se)w=g;else if(g instanceof Te&&g.colorAttachments[0]instanceof se)B.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),w=g.colorAttachments[0];else throw new Error("No texture");o.activeTexture(33984+a),o.bindTexture(w.target,w.handle),a+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error("binding type '".concat(b.type,"' not supported in WebGL"))}}}catch(P){c.e(P)}finally{c.f()}},n._applyUniforms=function(){var o=rc(this.shaderLayout.uniforms||[]),a;try{for(o.s();!(a=o.n()).done;){var u,c=a.value,p=c.name,b=c.location,g=c.type,v=c.textureUnit,O=(u=this.uniforms[p])!==null&&u!==void 0?u:v;O!==void 0&&Jf(this.device.gl,b,g,O)}}catch(w){o.e(w)}finally{o.f()}},gg(r)}(Cr);function At(e){return At=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},At(e)}function Tg(e,t){return jg(e)||Lg(e,t)||sc(e,t)||Ag()}function Ag(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
44
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uc(e,t){if(e){if(typeof e=="string")return oc(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 oc(e,t)}}function oc(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 yg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function bg(e){if(Array.isArray(e))return e}function ic(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,vg(n.key),n)}}function gg(e,t,r){return t&&ic(e.prototype,t),r&&ic(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vg(e){var t=wg(e,"string");return Tt(t)==="symbol"?t:String(t)}function wg(e,t){if(Tt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Tt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Og(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&&Qo(e,t)}function Qo(e,t){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qo(e,t)}function Sg(e){var t=Eg();return function(){var n=An(e),i;if(t){var o=An(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Pg(this,i)}}function Pg(e,t){if(t&&(Tt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xg(e)}function xg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eg(){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 An(e){return An=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},An(e)}var ac=4,Ln=function(e){Og(r,e);var t=Sg(r);function r(i,o){var a;_g(this,r),a=t.call(this,i,o),a.device=void 0,a.handle=void 0,a.vs=void 0,a.fs=void 0,a.introspectedLayout=void 0,a.uniforms={},a.bindings={},a.varyings=null,a._uniformCount=0,a._uniformSetters={},a.device=i,a.handle=a.props.handle||a.device.gl.createProgram(),a.device.setSpectorMetadata(a.handle,{id:a.props.id}),a.vs=o.vs,a.fs=o.fs;var u=o.varyings,c=o.bufferMode,p=c===void 0?35981:c;if(u&&u.length>0){var b;a.device.assertWebGL2(),a.varyings=u,(b=a.device.gl2)===null||b===void 0||b.transformFeedbackVaryings(a.handle,u,p)}return a._compileAndLink(),a.introspectedLayout=Tn(a.device.gl,a.handle),a.shaderLayout=to(a.introspectedLayout,o.shaderLayout),a}var n=r.prototype;return n.destroy=function(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)},n.setBindings=function(o){for(var a=this,u=function(){var v=nc(p[c],2),O=v[0],w=v[1],P=a.shaderLayout.bindings.find(function(x){return x.name===O})||a.shaderLayout.bindings.find(function(x){return x.name==="".concat(O,"Uniforms")});if(!P){var A=a.shaderLayout.bindings.map(function(x){return'"'.concat(x.name,'"')}).join(", ");return B.warn('Unknown binding "'.concat(O,'" in render pipeline "').concat(a.id,'", expected one of ').concat(A))(),"continue"}switch(w||B.warn('Unsetting binding "'.concat(O,'" in render pipeline "').concat(a.id,'"'))(),P.type){case"uniform":if(!(w instanceof pe)&&!(w.buffer instanceof pe))throw new Error("buffer value");break;case"texture":if(!(w instanceof se||w instanceof Te))throw new Error("texture value");break;case"sampler":B.warn("Ignoring sampler ".concat(O))();break;default:throw new Error(P.type)}a.bindings[O]=w},c=0,p=Object.entries(o);c<p.length;c++)var b=u()},n.setUniforms=function(o){var a=uo(o),u=a.bindings;Object.keys(u).forEach(function(c){B.warn('Unsupported value "'.concat(JSON.stringify(u[c]),'" used in setUniforms() for key ').concat(c,". Use setBindings() instead?"))()}),Object.assign(this.uniforms,o)},n.draw=function(o){var a,u=this,c=o.renderPass,p=o.vertexArray,b=o.vertexCount,g=o.instanceCount,v=o.firstVertex,O=v===void 0?0:v,w=o.transformFeedback,P=ec(this.props.topology),A=Boolean(p.indexBuffer),x=(a=p.indexBuffer)===null||a===void 0?void 0:a.glIndexType,T=Number(g)>0;if(!this._areTexturesRenderable()||b===0)return!1;this.device.gl.useProgram(this.handle),p.bindBeforeRender(c),w&&w.begin(this.props.topology),this._applyBindings(),this._applyUniforms();var R=c;return Mu(this.device,this.props.parameters,R.glParameters,function(){if(A&&T){var j;(j=u.device.gl2)===null||j===void 0||j.drawElementsInstanced(P,b||0,x,O,g||0)}else if(A)u.device.gl.drawElements(P,b||0,x,O);else if(T){var k;(k=u.device.gl2)===null||k===void 0||k.drawArraysInstanced(P,O,b||0,g||0)}else u.device.gl.drawArrays(P,O,b||0);w&&w.end()}),p.unbindAfterRender(c),!0},n._compileAndLink=function(){var o=this.device.gl;o.attachShader(this.handle,this.vs.handle),o.attachShader(this.handle,this.fs.handle),B.time(ac,"linkProgram for ".concat(this.id))(),o.linkProgram(this.handle),B.timeEnd(ac,"linkProgram for ".concat(this.id))(),!o.debug&&B.level;var a=o.getProgramParameter(this.handle,35714);if(!a)throw new Error("Error linking: ".concat(o.getProgramInfoLog(this.handle)));o.validateProgram(this.handle);var u=o.getProgramParameter(this.handle,35715);if(!u)throw new Error("Error validating: ".concat(o.getProgramInfoLog(this.handle)))},n._areTexturesRenderable=function(){for(var o=!0,a=0,u=Object.entries(this.bindings);a<u.length;a++){var c=nc(u[a],2),p=c[1];p instanceof se&&(p.update(),o=o&&p.loaded)}return o},n._applyBindings=function(){this.device.gl.useProgram(this.handle);var o=this.device.gl2;if(!o)throw new Error("bindings");var a=0,u=0,c=rc(this.shaderLayout.bindings),p;try{for(c.s();!(p=c.n()).done;){var b=p.value,g=this.bindings[b.name]||this.bindings[b.name.replace(/Uniforms$/,"")];if(!g)throw new Error("No value for binding ".concat(b.name," in ").concat(this.id));switch(b.type){case"uniform":var v=b.name,O=o.getUniformBlockIndex(this.handle,v);if(O===4294967295)throw new Error("Invalid uniform block name ".concat(v));o.uniformBlockBinding(this.handle,u,O),g instanceof pe?o.bindBufferBase(35345,u,g.handle):o.bindBufferRange(35345,u,g.buffer.handle,g.offset||0,g.size||g.buffer.byteLength-g.offset),u+=1;break;case"texture":if(!(g instanceof se||g instanceof Te))throw new Error("texture");var w=void 0;if(g instanceof se)w=g;else if(g instanceof Te&&g.colorAttachments[0]instanceof se)B.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),w=g.colorAttachments[0];else throw new Error("No texture");o.activeTexture(33984+a),o.bindTexture(w.target,w.handle),a+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error("binding type '".concat(b.type,"' not supported in WebGL"))}}}catch(P){c.e(P)}finally{c.f()}},n._applyUniforms=function(){var o=rc(this.shaderLayout.uniforms||[]),a;try{for(o.s();!(a=o.n()).done;){var u,c=a.value,p=c.name,b=c.location,g=c.type,v=c.textureUnit,O=(u=this.uniforms[p])!==null&&u!==void 0?u:v;O!==void 0&&Jf(this.device.gl,b,g,O)}}catch(w){o.e(w)}finally{o.f()}},gg(r)}(Cr);function At(e){return At=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},At(e)}function Tg(e,t){return jg(e)||Lg(e,t)||sc(e,t)||Ag()}function Ag(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
45
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function jg(e){if(Array.isArray(e))return e}function Rg(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=sc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
46
46
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function sc(e,t){if(e){if(typeof e=="string")return fc(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 fc(e,t)}}function fc(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 cc(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,Bg(n.key),n)}}function Gg(e,t,r){return t&&cc(e.prototype,t),r&&cc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bg(e){var t=Ig(e,"string");return At(t)==="symbol"?t:String(t)}function Ig(e,t){if(At(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(At(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dg(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&&Zo(e,t)}function Zo(e,t){return Zo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zo(e,t)}function Cg(e){var t=Ng();return function(){var n=jn(e),i;if(t){var o=jn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Wg(this,i)}}function Wg(e,t){if(t&&(At(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mg(e)}function Mg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ng(){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 jn(e){return jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jn(e)}var lc=function(e){Dg(r,e);var t=Cg(r);function r(i){var o;return Fg(this,r),o=t.call(this,i,{}),o.device=void 0,o.commands=[],o.device=i,o}var n=r.prototype;return n.submitCommands=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.commands,a=Rg(o),u;try{for(a.s();!(u=a.n()).done;){var c=u.value;switch(c.name){case"copy-buffer-to-buffer":kg(this.device,c.options);break;case"copy-buffer-to-texture":Vg(this.device,c.options);break;case"copy-texture-to-buffer":Ug(this.device,c.options);break;case"copy-texture-to-texture":zg(this.device,c.options);break}}}catch(p){a.e(p)}finally{a.f()}},Gg(r)}(Ur);function kg(e,t){var r=t.source,n=t.destination,i=e.assertWebGL2();if(i){var o,a;i.bindBuffer(36662,r.handle),i.bindBuffer(36663,n.handle),i.copyBufferSubData(36662,36663,(o=t.sourceOffset)!==null&&o!==void 0?o:0,(a=t.destinationOffset)!==null&&a!==void 0?a:0,t.size),i.bindBuffer(36662,null),i.bindBuffer(36663,null)}else throw new Error("copyBufferToBuffer not implemented in WebGL1")}function Vg(e,t){throw new Error("Not implemented")}function Ug(e,t){var r=t.source,n=t.mipLevel,i=n===void 0?0:n,o=t.aspect,a=o===void 0?"all":o,u=t.width,c=u===void 0?t.source.width:u,p=t.height,b=p===void 0?t.source.height:p,g=t.depthOrArrayLayers,v=g===void 0?0:g,O=t.origin,w=O===void 0?[0,0]:O,P=t.destination,A=t.byteOffset,x=A===void 0?0:A,T=t.bytesPerRow,R=t.rowsPerImage;if(a!=="all")throw new Error("not supported");if(i!==0||v!==0||T||R)throw new Error("not implemented");var j=e.assertWebGL2(),k=pc(r),F=k.framebuffer,X=k.destroyFramebuffer;try{var N=P,V=c||F.width,W=b||F.height,H=mt(F.texture.format,!0),l=H.dataFormat,f=H.type;j.bindBuffer(35051,N.handle),j.bindFramebuffer(36160,F.handle),j.readPixels(w[0],w[1],V,W,l,f,x)}finally{j.bindBuffer(35051,null),j.bindFramebuffer(36160,null),X&&F.destroy()}}function zg(e,t){var r=t.source,n=t.origin,i=n===void 0?[0,0]:n,o=t.destination,a=t.width,u=a===void 0?t.destination.width:a,c=t.height,p=c===void 0?t.destination.width:c,b=0,g=6408,v=pc(r),O=v.framebuffer,w=v.destroyFramebuffer,P=Tg(i,2),A=P[0],x=P[1],T=!1;e.gl.bindFramebuffer(36160,O.handle);var R=null,j;if(o instanceof se)R=o,u=Number.isFinite(u)?u:R.width,p=Number.isFinite(p)?p:R.height,R.bind(0),j=R.destination;else throw new Error("whoops");return T||e.gl.copyTexImage2D(j,b,g,A,x,u,p,0),R&&R.unbind(),w&&O.destroy(),R}function pc(e){if(e instanceof ae){var t=e.width,r=e.height,n=e.id,i=e.device.createFramebuffer({id:"framebuffer-for-".concat(n),width:t,height:r,colorAttachments:[e]});return{framebuffer:i,destroyFramebuffer:!0}}return{framebuffer:e,destroyFramebuffer:!1}}function Lt(e){return Lt=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},Lt(e)}function dc(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,$g(n.key),n)}}function Hg(e,t,r){return t&&dc(e.prototype,t),r&&dc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $g(e){var t=Xg(e,"string");return Lt(t)==="symbol"?t:String(t)}function Xg(e,t){if(Lt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Lt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yg(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&&Jo(e,t)}function Jo(e,t){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Jo(e,t)}function qg(e){var t=Jg();return function(){var n=Rn(e),i;if(t){var o=Rn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qg(this,i)}}function Qg(e,t){if(t&&(Lt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zg(e)}function Zg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jg(){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 Rn(e){return Rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rn(e)}var Gn=function(e){Yg(r,e);var t=qg(r);function r(i,o){var a;return Kg(this,r),a=t.call(this,i,o),a.device=void 0,a.commandBuffer=void 0,a.device=i,a.commandBuffer=new lc(i),a}var n=r.prototype;return n.destroy=function(){},n.finish=function(){this.commandBuffer.submitCommands()},n.copyBufferToBuffer=function(o){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:o})},n.copyBufferToTexture=function(o){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:o})},n.copyTextureToBuffer=function(o){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:o})},n.copyTextureToTexture=function(o){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:o})},n.pushDebugGroup=function(o){},n.popDebugGroup=function(){},n.insertDebugMarker=function(o){},Hg(r)}(kr);function jt(e){return jt=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},jt(e)}var mc;function ev(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hc(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,rv(n.key),n)}}function tv(e,t,r){return t&&hc(e.prototype,t),r&&hc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rv(e){var t=nv(e,"string");return jt(t)==="symbol"?t:String(t)}function nv(e,t){if(jt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bn(){return typeof Reflect<"u"&&Reflect.get?Bn=Reflect.get.bind():Bn=function(t,r,n){var i=ov(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Bn.apply(this,arguments)}function ov(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Rt(e),e!==null););return e}function iv(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&&ei(e,t)}function ei(e,t){return ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ei(e,t)}function av(e){var t=cv();return function(){var n=Rt(e),i;if(t){var o=Rt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return uv(this,i)}}function uv(e,t){if(t&&(jt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fv(e)}function fv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cv(){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)}mc=Symbol.toStringTag;var In=function(e){iv(r,e);var t=av(r);r.isConstantAttributeZeroSupported=function(o){return o.info.type==="webgl2"||_r()==="Chrome"};function r(i,o){var a;return ev(this,r),a=t.call(this,i,o),a.device=void 0,a.handle=void 0,a.buffer=null,a.bufferValue=null,a.init=!1,a.device=i,a.handle=a.device.gl2.createVertexArray(),a}var n=r.prototype;return n.destroy=function(){if(Bn(Rt(r.prototype),"destroy",this).call(this),this.buffer){var o;(o=this.buffer)===null||o===void 0||o.destroy()}this.handle&&(this.device.gl2.deleteVertexArray(this.handle),this.handle=void 0)},n.setIndexBuffer=function(o){var a=o;if(a&&a.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl2.bindVertexArray(this.handle),this.device.gl2.bindBuffer(34963,a?a.handle:null),this.indexBuffer=a},n.setBuffer=function(o,a){var u=a;if(u.glTarget===34963)throw new Error("Use .setIndexBuffer()");var c=this._getAccessor(o),p=c.size,b=c.type,g=c.stride,v=c.offset,O=c.normalized,w=c.integer,P=c.divisor;this.device.gl2.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,u.handle),w?(this.device.assertWebGL2(),this.device.gl2.vertexAttribIPointer(o,p,b,g,v)):this.device.gl.vertexAttribPointer(o,p,b,O,g,v),this.device.gl.enableVertexAttribArray(o),this.device.gl2.vertexAttribDivisor(o,P||0),this.attributes[o]=u},n.setConstant=function(o,a){this._enable(o,!1),this.attributes[o]=a},n.bindBeforeRender=function(){if(this.device.gl2.bindVertexArray(this.handle),!this.init){var o=this.indexBuffer;this.device.gl2.bindBuffer(34963,o?.handle||null),this.init=!0}this._applyConstantAttributes()},n.unbindAfterRender=function(){this.device.gl2.bindVertexArray(null)},n._applyConstantAttributes=function(){for(var o=0;o<this.maxVertexAttributes;++o){var a=this.attributes[o];ArrayBuffer.isView(a)&&this.device.setConstantAttribute(o,a)}},n._getAccessor=function(o){var a=this.attributeInfos[o];if(!a)throw new Error("Unknown attribute location ".concat(o));var u=rn(a.bufferDataType);return{size:a.bufferComponents,type:u,stride:a.byteStride,offset:a.byteOffset,normalized:a.normalized,integer:a.integer,divisor:a.stepMode==="instance"?1:0}},n._enable=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,u=r.isConstantAttributeZeroSupported(this.device),c=u||o!==0;(a||c)&&(o=Number(o),this.device.gl2.bindVertexArray(this.handle),a?this.device.gl.enableVertexAttribArray(o):this.device.gl.disableVertexAttribArray(o),this.device.gl2.bindVertexArray(null))},n.getConstantBuffer=function(o,a){var u=sv(a),c=u.byteLength*o,p=u.length*o;if(this.buffer&&c!==this.buffer.byteLength)throw new Error("Buffer size is immutable, byte length ".concat(c," !== ").concat(this.buffer.byteLength,"."));var b=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:c}),b=b||!lv(u,this.bufferValue),b){var g=oo(a.constructor,p);io({target:g,source:u,start:0,count:p}),this.buffer.write(g),this.bufferValue=a}return this.buffer},tv(r,[{key:mc,get:function(){return"VertexArray"}}]),r}($r);function sv(e){return Array.isArray(e)?new Float32Array(e):e}function lv(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}function Gt(e){return Gt=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},Gt(e)}function pv(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=dv(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
47
47
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function dv(e,t){if(e){if(typeof e=="string")return yc(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 yc(e,t)}}function yc(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 bc(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,mv(n.key),n)}}function hv(e,t,r){return t&&bc(e.prototype,t),r&&bc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mv(e){var t=yv(e,"string");return Gt(t)==="symbol"?t:String(t)}function yv(e,t){if(Gt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Gt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fn(){return typeof Reflect<"u"&&Reflect.get?Fn=Reflect.get.bind():Fn=function(t,r,n){var i=gv(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Fn.apply(this,arguments)}function gv(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Bt(e),e!==null););return e}function vv(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&&ti(e,t)}function ti(e,t){return ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ti(e,t)}function wv(e){var t=Ov();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _v(this,i)}}function _v(e,t){if(t&&(Gt(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 Ov(){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 Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bt(e)}var Dn=function(e){vv(r,e);var t=wv(r);function r(i,o){var a;return bv(this,r),a=t.call(this,i,o),a.device=void 0,a.gl2=void 0,a.handle=void 0,a.layout=void 0,a.buffers={},a.unusedBuffers={},a.bindOnUse=!0,a._bound=!1,i.assertWebGL2(),a.device=i,a.gl2=i.gl2,a.handle=a.props.handle||a.gl2.createTransformFeedback(),a.layout=a.props.layout,o.buffers&&a.setBuffers(o.buffers),Object.seal(vc(a)),a}var n=r.prototype;return n.destroy=function(){this.gl2.deleteTransformFeedback(this.handle),Fn(Bt(r.prototype),"destroy",this).call(this)},n.begin=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"point-list";this.gl2.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl2.beginTransformFeedback(tc(o))},n.end=function(){this.gl2.endTransformFeedback(),this.bindOnUse||this._unbindBuffers(),this.gl2.bindTransformFeedback(36386,null)},n.setBuffers=function(o){var a=this;this.buffers={},this.unusedBuffers={},this.bind(function(){for(var u in o)a.setBuffer(u,o[u])})},n.setBuffer=function(o,a){var u=this._getVaryingIndex(o),c=this._getBufferRange(a),p=c.buffer,b=c.byteLength,g=c.byteOffset;if(u<0){this.unusedBuffers[o]=p,B.warn("".concat(this.id," unusedBuffers varying buffer ").concat(o))();return}this.buffers[u]={buffer:p,byteLength:b,byteOffset:g},this.bindOnUse||this._bindBuffer(u,p,g,b)},n.getBuffer=function(o){if(gc(o))return this.buffers[o]||null;var a=this._getVaryingIndex(o);return a>=0?this.buffers[a]:null},n.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof o!="function")return this.gl2.bindTransformFeedback(36386,o),this;var a;return this._bound?a=o():(this.gl2.bindTransformFeedback(36386,this.handle),this._bound=!0,a=o(),this._bound=!1,this.gl2.bindTransformFeedback(36386,null)),a},n.unbind=function(){this.bind(null)},n._getBufferRange=function(o){if(o instanceof pe)return{buffer:o,byteOffset:0,byteLength:o.byteLength};var a=o.buffer,u=o.byteOffset,c=u===void 0?0:u,p=o.byteLength,b=p===void 0?o.buffer.byteLength:p;return{buffer:a,byteOffset:c,byteLength:b}},n._getVaryingIndex=function(o){if(gc(o))return Number(o);var a=pv(this.layout.varyings),u;try{for(a.s();!(u=a.n()).done;){var c=u.value;if(o===c.name)return c.location}}catch(p){a.e(p)}finally{a.f()}return-1},n._bindBuffers=function(){for(var o in this.buffers){var a=this._getBufferRange(this.buffers[o]),u=a.buffer,c=a.byteLength,p=a.byteOffset;this._bindBuffer(Number(o),u,p,c)}},n._unbindBuffers=function(){for(var o in this.buffers)this.gl2.bindBufferBase(35982,Number(o),null)},n._bindBuffer=function(o,a){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,c=arguments.length>3?arguments[3]:void 0,p=a&&a.handle;!p||c===void 0?this.gl2.bindBufferBase(35982,o,p):this.gl2.bindBufferRange(35982,o,p,u,c)},hv(r)}(Kr);function gc(e){return typeof e=="number"?Number.isInteger(e):/^\d+$/.test(e)}function Ue(e){return Ue=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},Ue(e)}function wc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wc(Object(r),!0).forEach(function(n){Sv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sv(e,t,r){return t=Sc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ri(){"use strict";ri=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(l,f,s){l[f]=s.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{c({},"")}catch{c=function(s,d,m){return s[d]=m}}function p(l,f,s,d){var m=f&&f.prototype instanceof v?f:v,h=Object.create(m.prototype),_=new V(d||[]);return n(h,"_invoke",{value:k(l,s,_)}),h}function b(l,f,s){try{return{type:"normal",arg:l.call(f,s)}}catch(d){return{type:"throw",arg:d}}}e.wrap=p;var g={};function v(){}function O(){}function w(){}var P={};c(P,o,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(W([])));x&&x!==t&&r.call(x,o)&&(P=x);var T=w.prototype=v.prototype=Object.create(P);function R(l){["next","throw","return"].forEach(function(f){c(l,f,function(s){return this._invoke(f,s)})})}function j(l,f){function s(m,h,_,S){var E=b(l[m],l,h);if(E.type!=="throw"){var D=E.arg,I=D.value;return I&&Ue(I)=="object"&&r.call(I,"__await")?f.resolve(I.__await).then(function(C){s("next",C,_,S)},function(C){s("throw",C,_,S)}):f.resolve(I).then(function(C){D.value=C,_(D)},function(C){return s("throw",C,_,S)})}S(E.arg)}var d;n(this,"_invoke",{value:function(h,_){function S(){return new f(function(E,D){s(h,_,E,D)})}return d=d?d.then(S,S):S()}})}function k(l,f,s){var d="suspendedStart";return function(m,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(m==="throw")throw h;return H()}for(s.method=m,s.arg=h;;){var _=s.delegate;if(_){var S=F(_,s);if(S){if(S===g)continue;return S}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(d==="suspendedStart")throw d="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);d="executing";var E=b(l,f,s);if(E.type==="normal"){if(d=s.done?"completed":"suspendedYield",E.arg===g)continue;return{value:E.arg,done:s.done}}E.type==="throw"&&(d="completed",s.method="throw",s.arg=E.arg)}}}function F(l,f){var s=f.method,d=l.iterator[s];if(d===void 0)return f.delegate=null,s==="throw"&&l.iterator.return&&(f.method="return",f.arg=void 0,F(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var m=b(d,l.iterator,f.arg);if(m.type==="throw")return f.method="throw",f.arg=m.arg,f.delegate=null,g;var h=m.arg;return h?h.done?(f[l.resultName]=h.value,f.next=l.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,g):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,g)}function X(l){var f={tryLoc:l[0]};1 in l&&(f.catchLoc=l[1]),2 in l&&(f.finallyLoc=l[2],f.afterLoc=l[3]),this.tryEntries.push(f)}function N(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(X,this),this.reset(!0)}function W(l){if(l){var f=l[o];if(f)return f.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,d=function m(){for(;++s<l.length;)if(r.call(l,s))return m.value=l[s],m.done=!1,m;return m.value=void 0,m.done=!0,m};return d.next=d}}return{next:H}}function H(){return{value:void 0,done:!0}}return O.prototype=w,n(T,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:O,configurable:!0}),O.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===O||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,w):(l.__proto__=w,c(l,u,"GeneratorFunction")),l.prototype=Object.create(T),l},e.awrap=function(l){return{__await:l}},R(j.prototype),c(j.prototype,a,function(){return this}),e.AsyncIterator=j,e.async=function(l,f,s,d,m){m===void 0&&(m=Promise);var h=new j(p(l,f,s,d),m);return e.isGeneratorFunction(f)?h:h.next().then(function(_){return _.done?_.value:h.next()})},R(T),c(T,u,"Generator"),c(T,o,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(l){var f=Object(l),s=[];for(var d in f)s.push(d);return s.reverse(),function m(){for(;s.length;){var h=s.pop();if(h in f)return m.value=h,m.done=!1,m}return m.done=!0,m}},e.values=W,V.prototype={constructor:V,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!f)for(var s in this)s.charAt(0)==="t"&&r.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(D,I){return _.type="throw",_.arg=f,s.next=D,I&&(s.method="next",s.arg=void 0),!!I}for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m],_=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var S=r.call(h,"catchLoc"),E=r.call(h,"finallyLoc");if(S&&E){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(S){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return d(h.finallyLoc)}}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc<=this.prev&&r.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var h=m;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=f,_.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(_)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),g},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),N(d),g}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var m=d.completion;if(m.type==="throw"){var h=m.arg;N(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:W(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function _c(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(p){r(p);return}u.done?t(c):Promise.resolve(c).then(n,i)}function Pv(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){_c(o,n,i,a,u,"next",c)}function u(c){_c(o,n,i,a,u,"throw",c)}a(void 0)})}}function xv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oc(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,Sc(n.key),n)}}function Ev(e,t,r){return t&&Oc(e.prototype,t),r&&Oc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sc(e){var t=Tv(e,"string");return Ue(t)==="symbol"?t:String(t)}function Tv(e,t){if(Ue(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ue(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Av(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&&ni(e,t)}function ni(e,t){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ni(e,t)}function Lv(e){var t=Rv();return function(){var n=Wn(e),i;if(t){var o=Wn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return jv(this,i)}}function jv(e,t){if(t&&(Ue(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oi(e)}function oi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rv(){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 Wn(e){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wn(e)}var Cn=1,le=function(e){Av(r,e);var t=Lv(r);r.isSupported=function(){return typeof WebGLRenderingContext<"u"||si()},r.attach=function(o){if(o instanceof r)return o;if(o?.device instanceof qe)return o.device;if(!Gv(o))throw new Error("Invalid WebGLRenderingContext");return new r({gl:o})},r.create=function(){var i=Pv(ri().mark(function a(){var u,c,p=arguments;return ri().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(u=p.length>0&&p[0]!==void 0?p[0]:{},B.groupCollapsed(Cn,"WebGLDevice created"),typeof u.canvas!="string"){g.next=5;break}return g.next=5,Qe.pageLoaded;case 5:if(!(B.get("debug")||u.debug)){g.next=8;break}return g.next=8,jf();case 8:if(c=u.spector,!(B.get("spector")||c)){g.next=12;break}return g.next=12,_f();case 12:if(B.probe(Cn+1,"DOM is loaded")(),!(u.gl&&u.gl.device)){g.next=15;break}return g.abrupt("return",r.attach(u.gl));case 15:return g.abrupt("return",new r(u));case 16:case"end":return g.stop()}},a)}));function o(){return i.apply(this,arguments)}return o}();function r(i){var o,a;xv(this,r),a=t.call(this,Ae(Ae({},i),{},{id:i.id||we("webgl-device")})),a.info=void 0,a.canvasContext=void 0,a.handle=void 0,a.lost=void 0,a._resolveContextLost=void 0,a._features=void 0,a._limits=void 0,a.renderPass=null,a.gl=void 0,a.gl2=null,a.debug=!1,a.isWebGL1=void 0,a.isWebGL2=void 0,a._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},a._extensions={},a._polyfilled=!1,a.spector=void 0,a._webglLimits=void 0,a._constants=void 0;var u=(o=i.gl)===null||o===void 0?void 0:o.device;if(u)throw new Error("WebGL context already attached to device ".concat(u.id));a.canvasContext=new wn(oi(a),i),a.lost=new Promise(function(A){a._resolveContextLost=A});var c=function(x){var T,R;return(T=(R=a)._resolveContextLost)===null||T===void 0?void 0:T.call(R,{reason:"destroyed",message:"Computer entered sleep mode, or too many apps or browser tabs are using the GPU."})},p=i.gl||null;if(p=p||(J()?Ou(a.canvasContext.canvas,Ae(Ae({},i),{},{onContextLost:c})):null),p=p||(J()?null:li(Ae(Ae({},i),{},{onContextLost:c}))),!p)throw new Error("WebGL context creation failed");a.handle=p,a.gl=a.handle,a.gl2=a.gl,a.isWebGL2=Bv(a.gl),a.isWebGL1=!a.isWebGL2,a.info=Su(a.gl),a.gl.device=oi(a),a.gl._version=a.isWebGL2?2:1,en(a.gl);var b=i.enable,g=b===void 0?!0:b,v=i.copyState,O=v===void 0?!1:v;if(er(a.gl,{enable:g,copyState:O,log:function(){for(var x=arguments.length,T=new Array(x),R=0;R<x;R++)T[R]=arguments[R];return B.log.apply(B,[1].concat(T))()}}),J()&&i.debug&&(a.gl=Rf(a.gl,Ae(Ae({},i),{},{webgl2:a.isWebGL2,throwOnError:!0})),a.gl2=a.gl,a.debug=!0,B.level=Math.max(B.level,1),B.warn("WebGL debug mode activated. Performance reduced.")()),J()&&i.spector){var w=a.handle.canvas||i.canvas;a.spector=Of(Ae(Ae({},a.props),{},{canvas:w}))}var P="Created ".concat(a.info.type).concat(a.debug?" debug":""," context: ").concat(a.info.vendor,", ").concat(a.info.renderer," for canvas: ").concat(a.canvasContext.id);return B.probe(Cn,P)(),B.groupEnd(Cn)(),a}var n=r.prototype;return n.destroy=function(){var o=this.gl.getExtension("STACKGL_destroy_context");o&&o.destroy()},n.getSize=function(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]},n.isTextureFormatSupported=function(o){return ar(this.gl,o)},n.isTextureFormatFilterable=function(o){return Lu(this.gl,o)},n.isTextureFormatRenderable=function(o){return ju(this.gl,o)},n.assertWebGL2=function(){if(!this.gl2)throw new Error("Requires WebGL2");return this.gl2},n.createCanvasContext=function(o){throw new Error("WebGL only supports a single canvas")},n.createBuffer=function(o){var a=this._getBufferProps(o);return new pe(this,a)},n._createTexture=function(o){return new se(this,o)},n.createExternalTexture=function(o){throw new Error("createExternalTexture() not implemented")},n.createSampler=function(o){return new ke(this,o)},n.createShader=function(o){return new On(this,o)},n.createFramebuffer=function(o){return new Te(this,o)},n.createRenderPipeline=function(o){return new Ln(this,o)},n.createVertexArray=function(o){return new In(this,o)},n.beginRenderPass=function(o){return new Pn(this,o)},n.createComputePipeline=function(o){throw new Error("ComputePipeline not supported in WebGL")},n.beginComputePass=function(o){throw new Error("ComputePass not supported in WebGL")},n.createTransformFeedback=function(o){return new Dn(this,o)},n.getDefaultRenderPass=function(){return this.renderPass=this.renderPass||this.beginRenderPass({framebuffer:this.canvasContext.getCurrentFramebuffer()}),this.renderPass},n.createCommandEncoder=function(o){return new Gn(this,o)},n.submit=function(){var o;(o=this.renderPass)===null||o===void 0||o.end(),this.renderPass=null},n.loseDevice=function(){var o,a=!1,u=this.gl.getExtension("WEBGL_lose_context");return u&&(a=!0,u.loseContext()),(o=this._resolveContextLost)===null||o===void 0||o.call(this,{reason:"destroyed",message:"Application triggered context loss"}),a},n.pushState=function(){_e(this.gl)},n.popState=function(){ge(this.gl)},n.setSpectorMetadata=function(o,a){o.__SPECTOR_Metadata=a},n.getGLKey=function(o,a){a=a||this.gl2||this.gl;var u=Number(o);for(var c in a)if(a[c]===u)return"GL.".concat(c);return String(o)},n.setConstantAttribute=function(o,a){this._constants=this._constants||new Array(this.limits.maxVertexAttributes).fill(null);var u=this._constants[o];switch(u&&Cv(u,a)&&B.info(1,"setConstantAttribute(".concat(o,") could have been skipped, value unchanged"))(),this._constants[o]=a,a.constructor){case Float32Array:Iv(this,o,a);break;case Int32Array:Fv(this,o,a);break;case Uint32Array:Dv(this,o,a);break;default:M(!1)}},Ev(r,[{key:"features",get:function(){return this._features=this._features||Iu(this.gl),this._features}},{key:"limits",get:function(){return this._limits=this._limits||Du(this.gl),this._limits}},{key:"isLost",get:function(){return this.gl.isContextLost()}},{key:"webglLimits",get:function(){return this._webglLimits=this._webglLimits||Cu(this.gl),this._webglLimits}}]),r}(qe);le.type="webgl";function Gv(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Bv(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Iv(e,t,r){switch(r.length){case 1:e.gl.vertexAttrib1fv(t,r);break;case 2:e.gl.vertexAttrib2fv(t,r);break;case 3:e.gl.vertexAttrib3fv(t,r);break;case 4:e.gl.vertexAttrib4fv(t,r);break;default:M(!1)}}function Fv(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4iv(t,r)}function Dv(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4uiv(t,r)}function Cv(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}var Wv=256,Mv=1024,Nv=16384;var kv="clear: bad arguments";function Pc(e,t){var r=le.attach(e),n=t||{},i=n.framebuffer,o=i===void 0?null:i,a=n.color,u=a===void 0?null:a,c=n.depth,p=c===void 0?null:c,b=n.stencil,g=b===void 0?null:b,v={};o&&(v.framebuffer=o);var O=0;u&&(O|=Nv,u!==!0&&(v.clearColor=u)),p&&(O|=Wv,p!==!0&&(v.clearDepth=p)),g&&(O|=Mv,p!==!0&&(v.clearStencil=p)),M(O!==0,kv),ve(r.gl,v,function(){r.gl.clear(O)})}function ii(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return M(!1),0}}function xc(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return M(!1),0}}function br(e){return br=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},br(e)}function Ec(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ec(Object(r),!0).forEach(function(n){Vv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ec(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vv(e,t,r){return t=Uv(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uv(e){var t=zv(e,"string");return br(t)==="symbol"?t:String(t)}function zv(e,t){if(br(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(br(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ac(e,t){var r,n=t||{},i=n.sourceX,o=i===void 0?0:i,a=n.sourceY,u=a===void 0?0:a,c=n.sourceFormat,p=c===void 0?6408:c,b=n.sourceAttachment,g=b===void 0?36064:b,v=t||{},O=v.target,w=O===void 0?null:O,P=v.sourceWidth,A=v.sourceHeight,x=v.sourceType,T=ai(e),R=T.framebuffer,j=T.deleteFramebuffer;M(R);var k=R,F=k.gl,X=k.handle;P=P||R.width,A=A||R.height;var N=g-36064;x=x||((r=R.colorAttachments[N])===null||r===void 0?void 0:r.type)||5121,w=$v(w,x,p,P,A),x=x||Uf(w);var V=F.bindFramebuffer(36160,X);return F.readPixels(o,u,P,A,p,x,w),F.bindFramebuffer(36160,V||null),j&&R.destroy(),w}function Lc(e,t){var r=t||{},n=r.sourceX,i=n===void 0?0:n,o=r.sourceY,a=o===void 0?0:o,u=r.sourceFormat,c=u===void 0?6408:u,p=r.targetByteOffset,b=p===void 0?0:p,g=t||{},v=g.target,O=g.sourceWidth,w=g.sourceHeight,P=g.sourceType,A=ai(e),x=A.framebuffer,T=A.deleteFramebuffer;M(x),O=O||x.width,w=w||x.height;var R=x;if(P=P||5121,!v){var j=ii(c),k=xc(P),F=b+O*w*j*k;v=R.device.createBuffer({byteLength:F})}var X=e.device.createCommandEncoder();return X.copyTextureToBuffer({source:e,width:O,height:w,origin:[i,a],destination:v,byteOffset:b}),X.destroy(),T&&x.destroy(),v}function jc(e,t,r){var n=r||{},i=n.sourceX,o=i===void 0?0:i,a=n.sourceY,u=a===void 0?0:a,c=n.targetMipmaplevel,p=c===void 0?0:c,b=n.targetInternalFormat,g=b===void 0?6408:b,v=r||{},O=v.targetX,w=v.targetY,P=v.targetZ,A=v.width,x=v.height,T=ai(e),R=T.framebuffer,j=T.deleteFramebuffer;M(R);var k=R,F=k.device,X=k.handle,N=typeof O<"u"||typeof w<"u"||typeof P<"u";O=O||0,w=w||0,P=P||0;var V=F.gl.bindFramebuffer(36160,X);M(t);var W=null,H;if(t instanceof ae?(W=t,A=Number.isFinite(A)?A:W.width,x=Number.isFinite(x)?x:W.height,W.bind(0),H=W.target):H=t,!N)F.gl.copyTexImage2D(H,p,g,o,u,A,x,0);else switch(H){case 3553:case 34067:F.gl.copyTexSubImage2D(H,p,O,w,o,u,A,x);break;case 35866:case 32879:F.assertWebGL2(),F.gl2.copyTexSubImage3D(H,p,O,w,P,o,u,A,x);break;default:}return W&&W.unbind(),F.gl.bindFramebuffer(36160,V||null),j&&R.destroy(),W}function ai(e){return e instanceof nt?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Hv(e),deleteFramebuffer:!0}}function Hv(e,t){var r=e.device,n=e.width,i=e.height,o=e.id,a=r.createFramebuffer(Tc(Tc({},t),{},{id:"framebuffer-for-".concat(o),width:n,height:i,colorAttachments:[e]}));return a}function $v(e,t,r,n,i){if(e)return e;t=t||5121;var o=dr(t,{clamped:!1}),a=ii(r);return new o(n*i*a)}return Wc(Xv);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/webgl",
3
- "version": "9.0.0-alpha.48",
3
+ "version": "9.0.0-alpha.50",
4
4
  "description": "WebGL2 adapter for the luma.gl API",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,12 +44,12 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@babel/runtime": "^7.0.0",
47
- "@luma.gl/constants": "9.0.0-alpha.48",
48
- "@luma.gl/core": "9.0.0-alpha.48",
47
+ "@luma.gl/constants": "9.0.0-alpha.50",
48
+ "@luma.gl/core": "9.0.0-alpha.50",
49
49
  "@probe.gl/env": "^4.0.2"
50
50
  },
51
51
  "devDependencies": {
52
- "@luma.gl/test-utils": "9.0.0-alpha.48"
52
+ "@luma.gl/test-utils": "9.0.0-alpha.50"
53
53
  },
54
- "gitHead": "e57479712693a82ec918382020dd2593035e29b0"
54
+ "gitHead": "83899806fcfab67f97cc8b308f81e4844a05ca05"
55
55
  }