@luma.gl/webgl 8.5.12 → 8.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.js +29 -29
- package/dist/dist.min.js +1 -1
- package/dist/es5/init.js +1 -1
- package/dist/esm/init.js +1 -1
- package/package.json +4 -4
package/dist/dist.js
CHANGED
|
@@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
98
98
|
|
|
99
99
|
/***/ "../../node_modules/@probe.gl/env/dist/esm/index.js":
|
|
100
100
|
/*!********************************************************************************!*\
|
|
101
|
-
!*** /Users/
|
|
101
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/index.js ***!
|
|
102
102
|
\********************************************************************************/
|
|
103
103
|
/*! exports provided: VERSION, self, window, global, document, process, console, isBrowser, isBrowserMainThread, getBrowser, isMobile, isElectron, assert */
|
|
104
104
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -149,7 +149,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
149
149
|
|
|
150
150
|
/***/ "../../node_modules/@probe.gl/env/dist/esm/lib/get-browser.js":
|
|
151
151
|
/*!******************************************************************************************!*\
|
|
152
|
-
!*** /Users/
|
|
152
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/lib/get-browser.js ***!
|
|
153
153
|
\******************************************************************************************/
|
|
154
154
|
/*! exports provided: isMobile, default */
|
|
155
155
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -209,7 +209,7 @@ function getBrowser(mockUserAgent) {
|
|
|
209
209
|
|
|
210
210
|
/***/ "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js":
|
|
211
211
|
/*!**************************************************************************************!*\
|
|
212
|
-
!*** /Users/
|
|
212
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/lib/globals.js ***!
|
|
213
213
|
\**************************************************************************************/
|
|
214
214
|
/*! exports provided: self, window, global, document, process, console */
|
|
215
215
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -243,7 +243,7 @@ const console_ = console;
|
|
|
243
243
|
|
|
244
244
|
/***/ "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js":
|
|
245
245
|
/*!*****************************************************************************************!*\
|
|
246
|
-
!*** /Users/
|
|
246
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/lib/is-browser.js ***!
|
|
247
247
|
\*****************************************************************************************/
|
|
248
248
|
/*! exports provided: default, isBrowserMainThread */
|
|
249
249
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -268,7 +268,7 @@ function isBrowserMainThread() {
|
|
|
268
268
|
|
|
269
269
|
/***/ "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js":
|
|
270
270
|
/*!******************************************************************************************!*\
|
|
271
|
-
!*** /Users/
|
|
271
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/lib/is-electron.js ***!
|
|
272
272
|
\******************************************************************************************/
|
|
273
273
|
/*! exports provided: default */
|
|
274
274
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -301,7 +301,7 @@ function isElectron(mockUserAgent) {
|
|
|
301
301
|
|
|
302
302
|
/***/ "../../node_modules/@probe.gl/env/dist/esm/utils/assert.js":
|
|
303
303
|
/*!***************************************************************************************!*\
|
|
304
|
-
!*** /Users/
|
|
304
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/utils/assert.js ***!
|
|
305
305
|
\***************************************************************************************/
|
|
306
306
|
/*! exports provided: default */
|
|
307
307
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -320,7 +320,7 @@ function assert(condition, message) {
|
|
|
320
320
|
|
|
321
321
|
/***/ "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js":
|
|
322
322
|
/*!****************************************************************************************!*\
|
|
323
|
-
!*** /Users/
|
|
323
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/utils/globals.js ***!
|
|
324
324
|
\****************************************************************************************/
|
|
325
325
|
/*! exports provided: self, window, global, document, process, console, VERSION, isBrowser */
|
|
326
326
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -345,7 +345,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
345
345
|
|
|
346
346
|
|
|
347
347
|
|
|
348
|
-
const VERSION = true ? "8.5.
|
|
348
|
+
const VERSION = true ? "8.5.12" : undefined;
|
|
349
349
|
const isBrowser = Object(_lib_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"])();
|
|
350
350
|
//# sourceMappingURL=globals.js.map
|
|
351
351
|
|
|
@@ -353,7 +353,7 @@ const isBrowser = Object(_lib_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"]
|
|
|
353
353
|
|
|
354
354
|
/***/ "../../node_modules/@probe.gl/stats/dist/esm/index.js":
|
|
355
355
|
/*!**********************************************************************************!*\
|
|
356
|
-
!*** /Users/
|
|
356
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/stats/dist/esm/index.js ***!
|
|
357
357
|
\**********************************************************************************/
|
|
358
358
|
/*! exports provided: Stats, Stat, _getHiResTimestamp */
|
|
359
359
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -378,7 +378,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
378
378
|
|
|
379
379
|
/***/ "../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js":
|
|
380
380
|
/*!*************************************************************************************!*\
|
|
381
|
-
!*** /Users/
|
|
381
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js ***!
|
|
382
382
|
\*************************************************************************************/
|
|
383
383
|
/*! exports provided: default */
|
|
384
384
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -517,7 +517,7 @@ class Stat {
|
|
|
517
517
|
|
|
518
518
|
/***/ "../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js":
|
|
519
519
|
/*!**************************************************************************************!*\
|
|
520
|
-
!*** /Users/
|
|
520
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js ***!
|
|
521
521
|
\**************************************************************************************/
|
|
522
522
|
/*! exports provided: default */
|
|
523
523
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -610,7 +610,7 @@ class Stats {
|
|
|
610
610
|
|
|
611
611
|
/***/ "../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js":
|
|
612
612
|
/*!***************************************************************************************************!*\
|
|
613
|
-
!*** /Users/
|
|
613
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js ***!
|
|
614
614
|
\***************************************************************************************************/
|
|
615
615
|
/*! exports provided: default */
|
|
616
616
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -639,7 +639,7 @@ function getHiResTimestamp() {
|
|
|
639
639
|
|
|
640
640
|
/***/ "../../node_modules/probe.gl/dist/esm/env/get-browser.js":
|
|
641
641
|
/*!*************************************************************************************!*\
|
|
642
|
-
!*** /Users/
|
|
642
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/env/get-browser.js ***!
|
|
643
643
|
\*************************************************************************************/
|
|
644
644
|
/*! exports provided: isMobile, default */
|
|
645
645
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -700,7 +700,7 @@ function getBrowser(mockUserAgent) {
|
|
|
700
700
|
|
|
701
701
|
/***/ "../../node_modules/probe.gl/dist/esm/env/globals.js":
|
|
702
702
|
/*!*********************************************************************************!*\
|
|
703
|
-
!*** /Users/
|
|
703
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/env/globals.js ***!
|
|
704
704
|
\*********************************************************************************/
|
|
705
705
|
/*! exports provided: self, window, global, document, process, console */
|
|
706
706
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -734,7 +734,7 @@ const console_ = console;
|
|
|
734
734
|
|
|
735
735
|
/***/ "../../node_modules/probe.gl/dist/esm/env/is-browser.js":
|
|
736
736
|
/*!************************************************************************************!*\
|
|
737
|
-
!*** /Users/
|
|
737
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/env/is-browser.js ***!
|
|
738
738
|
\************************************************************************************/
|
|
739
739
|
/*! exports provided: default, isBrowserMainThread */
|
|
740
740
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -759,7 +759,7 @@ function isBrowserMainThread() {
|
|
|
759
759
|
|
|
760
760
|
/***/ "../../node_modules/probe.gl/dist/esm/env/is-electron.js":
|
|
761
761
|
/*!*************************************************************************************!*\
|
|
762
|
-
!*** /Users/
|
|
762
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/env/is-electron.js ***!
|
|
763
763
|
\*************************************************************************************/
|
|
764
764
|
/*! exports provided: default */
|
|
765
765
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -792,7 +792,7 @@ function isElectron(mockUserAgent) {
|
|
|
792
792
|
|
|
793
793
|
/***/ "../../node_modules/probe.gl/dist/esm/index.js":
|
|
794
794
|
/*!***************************************************************************!*\
|
|
795
|
-
!*** /Users/
|
|
795
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/index.js ***!
|
|
796
796
|
\***************************************************************************/
|
|
797
797
|
/*! exports provided: VERSION, self, window, global, document, process, console, isBrowser, isBrowserMainThread, getBrowser, isMobile, isElectron, assert, Log, COLOR, default, addColor, leftPad, rightPad, autobind, LocalStorage, getHiResTimestamp, Stats, Stat */
|
|
798
798
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -884,7 +884,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
884
884
|
|
|
885
885
|
/***/ "../../node_modules/probe.gl/dist/esm/init.js":
|
|
886
886
|
/*!**************************************************************************!*\
|
|
887
|
-
!*** /Users/
|
|
887
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/init.js ***!
|
|
888
888
|
\**************************************************************************/
|
|
889
889
|
/*! no exports provided */
|
|
890
890
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -900,7 +900,7 @@ _utils_globals__WEBPACK_IMPORTED_MODULE_0__["global"].probe = {};
|
|
|
900
900
|
|
|
901
901
|
/***/ "../../node_modules/probe.gl/dist/esm/lib/log.js":
|
|
902
902
|
/*!*****************************************************************************!*\
|
|
903
|
-
!*** /Users/
|
|
903
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/lib/log.js ***!
|
|
904
904
|
\*****************************************************************************/
|
|
905
905
|
/*! exports provided: default, normalizeArguments */
|
|
906
906
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1335,7 +1335,7 @@ function logImageInBrowser({
|
|
|
1335
1335
|
|
|
1336
1336
|
/***/ "../../node_modules/probe.gl/dist/esm/utils/assert.js":
|
|
1337
1337
|
/*!**********************************************************************************!*\
|
|
1338
|
-
!*** /Users/
|
|
1338
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/utils/assert.js ***!
|
|
1339
1339
|
\**********************************************************************************/
|
|
1340
1340
|
/*! exports provided: default */
|
|
1341
1341
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1354,7 +1354,7 @@ function assert(condition, message) {
|
|
|
1354
1354
|
|
|
1355
1355
|
/***/ "../../node_modules/probe.gl/dist/esm/utils/autobind.js":
|
|
1356
1356
|
/*!************************************************************************************!*\
|
|
1357
|
-
!*** /Users/
|
|
1357
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/utils/autobind.js ***!
|
|
1358
1358
|
\************************************************************************************/
|
|
1359
1359
|
/*! exports provided: autobind */
|
|
1360
1360
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1380,7 +1380,7 @@ function autobind(obj, predefined = ['constructor']) {
|
|
|
1380
1380
|
|
|
1381
1381
|
/***/ "../../node_modules/probe.gl/dist/esm/utils/color.js":
|
|
1382
1382
|
/*!*********************************************************************************!*\
|
|
1383
|
-
!*** /Users/
|
|
1383
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/utils/color.js ***!
|
|
1384
1384
|
\*********************************************************************************/
|
|
1385
1385
|
/*! exports provided: COLOR, addColor */
|
|
1386
1386
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1435,7 +1435,7 @@ function addColor(string, color, background) {
|
|
|
1435
1435
|
|
|
1436
1436
|
/***/ "../../node_modules/probe.gl/dist/esm/utils/formatters.js":
|
|
1437
1437
|
/*!**************************************************************************************!*\
|
|
1438
|
-
!*** /Users/
|
|
1438
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/utils/formatters.js ***!
|
|
1439
1439
|
\**************************************************************************************/
|
|
1440
1440
|
/*! exports provided: formatTime, leftPad, rightPad, formatValue, formatImage */
|
|
1441
1441
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1538,7 +1538,7 @@ function formatImage(image, message, scale, maxWidth = 600) {
|
|
|
1538
1538
|
|
|
1539
1539
|
/***/ "../../node_modules/probe.gl/dist/esm/utils/globals.js":
|
|
1540
1540
|
/*!***********************************************************************************!*\
|
|
1541
|
-
!*** /Users/
|
|
1541
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/utils/globals.js ***!
|
|
1542
1542
|
\***********************************************************************************/
|
|
1543
1543
|
/*! exports provided: self, window, global, document, process, console, VERSION, isBrowser */
|
|
1544
1544
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1563,7 +1563,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1563
1563
|
|
|
1564
1564
|
|
|
1565
1565
|
|
|
1566
|
-
const VERSION = true ? "8.5.
|
|
1566
|
+
const VERSION = true ? "8.5.12" : undefined;
|
|
1567
1567
|
const isBrowser = Object(_env_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"])();
|
|
1568
1568
|
//# sourceMappingURL=globals.js.map
|
|
1569
1569
|
|
|
@@ -1571,7 +1571,7 @@ const isBrowser = Object(_env_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"]
|
|
|
1571
1571
|
|
|
1572
1572
|
/***/ "../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js":
|
|
1573
1573
|
/*!********************************************************************************************!*\
|
|
1574
|
-
!*** /Users/
|
|
1574
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js ***!
|
|
1575
1575
|
\********************************************************************************************/
|
|
1576
1576
|
/*! exports provided: default */
|
|
1577
1577
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1601,7 +1601,7 @@ function getHiResTimestamp() {
|
|
|
1601
1601
|
|
|
1602
1602
|
/***/ "../../node_modules/probe.gl/dist/esm/utils/local-storage.js":
|
|
1603
1603
|
/*!*****************************************************************************************!*\
|
|
1604
|
-
!*** /Users/
|
|
1604
|
+
!*** /Users/missx/Source/luma.gl/node_modules/probe.gl/dist/esm/utils/local-storage.js ***!
|
|
1605
1605
|
\*****************************************************************************************/
|
|
1606
1606
|
/*! exports provided: default */
|
|
1607
1607
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1670,7 +1670,7 @@ class LocalStorage {
|
|
|
1670
1670
|
|
|
1671
1671
|
/***/ "../../node_modules/process/browser.js":
|
|
1672
1672
|
/*!*******************************************************************!*\
|
|
1673
|
-
!*** /Users/
|
|
1673
|
+
!*** /Users/missx/Source/luma.gl/node_modules/process/browser.js ***!
|
|
1674
1674
|
\*******************************************************************/
|
|
1675
1675
|
/*! no static exports found */
|
|
1676
1676
|
/***/ (function(module, exports) {
|
|
@@ -12546,7 +12546,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12546
12546
|
// Version detection using babel plugin
|
|
12547
12547
|
/* global __VERSION__ */
|
|
12548
12548
|
// @ts-ignore
|
|
12549
|
-
const VERSION = true ? "8.5.
|
|
12549
|
+
const VERSION = true ? "8.5.12" : undefined;
|
|
12550
12550
|
|
|
12551
12551
|
const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
|
|
12552
12552
|
// Assign luma.log.level in console to control logging: \
|
package/dist/dist.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e,r){var n=r(27),i=r(28),a=r(19),o=r(29);t.exports=function(t){return n(t)||i(t)||a(t)||o()}},function(t,e,r){var n=r(20);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e,r){var n=r(8),i=r(7);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?i(t):e}},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=r(32),i=r(33),a=r(19),o=r(34);t.exports=function(t,e){return n(t)||i(t,e)||a(t,e)||o()}},function(t,e,r){"use strict";(function(t,n){r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return u}));var i=r(8),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document,process:"object"===(void 0===n?"undefined":r.n(i)()(n))&&n},o=a.window||a.self||a.global,u=a.process||{};console}).call(this,r(30),r(11))},function(t,e){var r,n,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var s,c=[],l=!1,f=-1;function h(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=u(h);l=!0;for(var e=c.length;e;){for(s=c,c=[];++f<e;)s&&s[f].run();f=-1,e=c.length}s=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new g(t,e)),1!==c.length||l||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){var n=r(37);function i(e,r,a){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,r){var i=n(t,e);if(i){var a=Object.getOwnPropertyDescriptor(i,e);return a.get?a.get.call(r):a.value}},i(e,r,a||e)}t.exports=i},function(t,e,r){"use strict";(function(t){function n(){var e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if(void 0!==t&&t.hrtime){var r=t.hrtime();e=1e3*r[0]+r[1]/1e6}else e=Date.now();return e}r.d(e,"a",(function(){return n}))}).call(this,r(11))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return o}));var n=r(8),i=r.n(n),a=r(15);function o(){return!("object"===(void 0===t?"undefined":i()(t))&&"[object process]"===String(t)&&!t.browser)||Object(a.a)()}}).call(this,r(11))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return a}));var n=r(8),i=r.n(n);function a(e){if("undefined"!=typeof window&&"object"===i()(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"===i()(t.versions)&&Boolean(t.versions.electron))return!0;var r="object"===("undefined"==typeof navigator?"undefined":i()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||r;return!!(n&&n.indexOf("Electron")>=0)}}).call(this,r(11))},function(t,e,r){t.exports=r(36)},,function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e,r){var n=r(18);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return a}));var n=r(8),i=r.n(n);function a(e){if("undefined"!=typeof window&&"object"===i()(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"===i()(t.versions)&&Boolean(t.versions.electron))return!0;var r="object"===("undefined"==typeof navigator?"undefined":i()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||r;return!!(n&&n.indexOf("Electron")>=0)}}).call(this,r(11))},function(t,e,r){var n=r(20),i=r(35);function a(e,r,o){return i()?t.exports=a=Reflect.construct:t.exports=a=function(t,e,r){var i=[null];i.push.apply(i,e);var a=new(Function.bind.apply(t,i));return r&&n(a,r.prototype),a},a.apply(null,arguments)}t.exports=a},function(t,e){function r(t,e,r,n,i,a,o){try{var u=t[a](o),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,a){var o=t.apply(e,n);function u(t){r(o,i,a,u,s,"next",t)}function s(t){r(o,i,a,u,s,"throw",t)}u(void 0)}))}}},function(t,e,r){var n=r(38);globalThis.luma=globalThis.luma||{},t.exports=Object.assign(globalThis.luma,n)},,,function(t,e,r){var n=r(18);t.exports=function(t){if(Array.isArray(t))return n(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,u=t[Symbol.iterator]();!(n=(o=u.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(i)throw a}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),o=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var u=_(o,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,o),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function f(){}function h(){}function d(){}var g={};g[i]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(T([])));y&&y!==e&&r.call(y,i)&&(g=y);var m=d.prototype=f.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function p(t,e){var n;this._invoke=function(i,a){function o(){return new e((function(n,o){!function n(i,a,o,u){var s=c(t[i],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,o,u)}),(function(t){n("throw",t,o,u)})):e.resolve(f).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,u)}))}u(s.arg)}(i,a,n,o)}))}return n=n?n.then(o,o):o()}}function _(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function T(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=m.constructor=d,d.constructor=h,h.displayName=u(d,o,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,o,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(p.prototype),p.prototype[a]=function(){return this},t.AsyncIterator=p,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var o=new p(s(e,r,n,i),a);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},b(m),u(m,o,"Generator"),m[i]=function(){return this},m.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,w.prototype={constructor:w,reset:function(t){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(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n=r(3);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}},function(t,e,r){"use strict";r.r(e),r.d(e,"lumaStats",(function(){return jt})),r.d(e,"requestAnimationFrame",(function(){return Nt})),r.d(e,"cancelAnimationFrame",(function(){return Ct})),r.d(e,"cloneTextureFrom",(function(){return Or})),r.d(e,"getKeyValue",(function(){return qt})),r.d(e,"getKey",(function(){return Qt})),r.d(e,"getContextInfo",(function(){return Ir})),r.d(e,"getGLContextInfo",(function(){return Rr})),r.d(e,"getContextLimits",(function(){return Fr})),r.d(e,"FEATURES",(function(){return vr})),r.d(e,"hasFeature",(function(){return pr})),r.d(e,"hasFeatures",(function(){return _r})),r.d(e,"getFeatures",(function(){return Ar})),r.d(e,"canCompileGLGSExtension",(function(){return Dr})),r.d(e,"Accessor",(function(){return ge})),r.d(e,"Buffer",(function(){return xe})),r.d(e,"Shader",(function(){return zr})),r.d(e,"VertexShader",(function(){return Hr})),r.d(e,"FragmentShader",(function(){return Xr})),r.d(e,"Program",(function(){return _n})),r.d(e,"Framebuffer",(function(){return kr})),r.d(e,"Renderbuffer",(function(){return nr})),r.d(e,"Texture2D",(function(){return Me})),r.d(e,"TextureCube",(function(){return We})),r.d(e,"clear",(function(){return ir})),r.d(e,"clearBuffer",(function(){return ar})),r.d(e,"readPixelsToArray",(function(){return ur})),r.d(e,"readPixelsToBuffer",(function(){return sr})),r.d(e,"copyToDataUrl",(function(){return cr})),r.d(e,"copyToImage",(function(){return lr})),r.d(e,"copyToTexture",(function(){return fr})),r.d(e,"blit",(function(){return hr})),r.d(e,"Query",(function(){return Tn})),r.d(e,"Texture3D",(function(){return Qe})),r.d(e,"TransformFeedback",(function(){return kn})),r.d(e,"VertexArrayObject",(function(){return Bn})),r.d(e,"VertexArray",(function(){return jn})),r.d(e,"UniformBufferLayout",(function(){return Nn})),r.d(e,"setPathPrefix",(function(){return De})),r.d(e,"loadFile",(function(){return je})),r.d(e,"loadImage",(function(){return Ne})),r.d(e,"getShaderName",(function(){return jr})),r.d(e,"getShaderVersion",(function(){return Cn})),r.d(e,"log",(function(){return j})),r.d(e,"assert",(function(){return Yt})),r.d(e,"uid",(function(){return Jt})),r.d(e,"isObjectEmpty",(function(){return Zt})),r.d(e,"parseUniformName",(function(){return rn})),r.d(e,"getUniformSetter",(function(){return en})),r.d(e,"getDebugTableForUniforms",(function(){return zn})),r.d(e,"getDebugTableForVertexArray",(function(){return Xn})),r.d(e,"getDebugTableForProgramConfiguration",(function(){return $n}));var n=r(2),i=r.n(n),a=r(1),o=r.n(a),u=r(8),s=r.n(u),c=r(4),l=r.n(c),f=r(0),h=r.n(f),d=r(14),g=Object(d.a)();function v(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}var y=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";i()(this,t),this.storage=v(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return o()(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function m(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var a=t.width*r,o=t.height*r,u=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),u]}var b={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function p(t){return"string"==typeof t?b[t.toUpperCase()]||b.WHITE:t}function _(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return A(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return A(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function x(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),a=_(i);try{var o=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(a.s();!(e=a.n()).done;)o()}catch(t){a.e(t)}finally{a.f()}}function w(t,e){if(!t)throw new Error(e||"Assertion failed")}var T=r(10);function E(){var t;if(g&&T.b.performance)t=T.b.performance.now();else if(T.a.hrtime){var e=T.a.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var k={debug:g&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},S={enabled:!0,level:0};function O(){}var L={},F={once:!0};function R(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}var I=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=e.id;i()(this,t),this.id=r,this.VERSION="8.5.11",this._startTs=E(),this._deltaTs=E(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new y("__probe-".concat(this.id,"__"),S),this.userData={},this.timeStamp("".concat(this.id," started")),x(this),Object.seal(this)}return o()(t,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((E()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((E()-this._deltaTs).toPrecision(10))}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"assert",value:function(t,e){w(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,k.warn,arguments,F)}},{key:"error",value:function(t){return this._getLogFunction(0,t,k.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,k.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,k.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){return this._getLogFunction(t,e,k.debug||k.info,arguments,F)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||O,r&&[r],{tag:R(e)}):O}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,a=t.message,o=void 0===a?"":a,u=t.scale,s=void 0===u?1:u;return this._shouldLog(e||n)?g?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,a=void 0===i?1:i;if("string"==typeof e){var o=new Image;return o.onload=function(){var t,e=m(o,n,a);(t=console).log.apply(t,l()(e))},o.src=e,O}var u=e.nodeName||"";if("img"===u.toLowerCase()){var s;return(s=console).log.apply(s,l()(m(e,n,a))),O}if("canvas"===u.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,l()(m(c,n,a)))},c.src=e.toDataURL(),O}return O}({image:i,message:o,scale:s}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,a=null;try{a=r(31)}catch(t){}if(a)return function(){return a(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return O}({image:i,message:o,scale:s}):O}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(h()({},t,e))}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||O)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=P({logLevel:t,message:e,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||O)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=B(t)}},{key:"_getLogFunction",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(t)){var a;i=P({logLevel:t,message:e,args:n,opts:i}),w(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=E();var o=i.tag||i.message;if(i.once){if(L[o])return O;L[o]=E()}return e=D(this.id,i.message,i),(a=r).bind.apply(a,[console,e].concat(l()(i.args)))}return O}},{key:"level",set:function(t){this.setLevel(t)},get:function(){return this.getLevel()}},{key:"priority",set:function(t){this.level=t},get:function(){return this.level}}]),t}();function B(t){if(!t)return 0;var e;switch(s()(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return w(Number.isFinite(e)&&e>=0),e}function P(t){var e=t.logLevel,r=t.message;t.logLevel=B(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(t.args=n,s()(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=s()(t.message);return w("string"===i||"object"===i),Object.assign(t,t.opts)}function D(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((u=r.total)<10?"".concat(u.toFixed(2),"ms"):u<100?"".concat(u.toFixed(1),"ms"):u<1e3?"".concat(u.toFixed(0),"ms"):"".concat((u/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,a=r.color,o=r.background,g||"string"!=typeof i||(a&&(a=p(a),i="[".concat(a,"m").concat(i,"[39m")),o&&(a=p(o),i="[".concat(o+10,"m").concat(i,"[49m"))),e=i}var i,a,o,u;return e}I.VERSION="8.5.11";var j=new I({id:"luma.gl"});function N(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function C(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function M(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function U(t){return N(C(t),"Invalid WebGLRenderingContext"),t}function V(t){return N(M(t),"Requires WebGL2"),t}var G={};function z(t,e){var r;G[t]=!0,void 0!==e&&(r=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var H=function t(e){var r=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new t.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};(H.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var X,W=function(t){var e=this;this.gl=t,function(t){var e=t.getError;t.getError=function(){var r;do{0!==(r=e.apply(t))&&(G[r]=!0)}while(0!==r);for(r in G)if(G[r])return delete G[r],parseInt(r,10);return 0}}(t);var r=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:r.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){var n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);var i=n.attribs[t];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){var n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);var i=n.attribs[t];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,n){switch(t){case 34962:e.currentArrayBuffer=n;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,n){var i=e.currentVertexArrayObject,a=i.attribs[t];switch(n){case 34975:return a.buffer;case 34338:return a.enabled;case 34339:return a.size;case 34340:return a.stride;case 34341:return a.type;case 34922:return a.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,n,i,a,o,u){var s=e.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,t);var c=s.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=n,c.type=i,c.normalized=a,c.stride=o,c.offset=u,c.recache(),r.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(function(){var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()}),!0),this.reset_()};W.prototype.VERTEX_ARRAY_BINDING_OES=34229,W.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;var e=this.gl;this.maxVertexAttribs=e.getParameter(34921),this.defaultVertexArrayObject=new H(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},W.prototype.createVertexArrayOES=function(){var t=new H(this);return this.vertexArrayObjects.push(t),t},W.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},W.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof H&&t.hasBeenBound&&t.ext===this)},W.prototype.bindVertexArrayOES=function(t){var e=this.gl;if(!t||t.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(e,34963,i.elementArrayBuffer);for(var a=this.currentArrayBuffer,o=Math.max(n?n.maxAttrib:0,i.maxAttrib),u=0;u<=o;u++){var s=i.attribs[u],c=n?n.attribs[u]:null;if(n&&s.enabled===c.enabled||(s.enabled?r.enableVertexAttribArray.call(e,u):r.disableVertexAttribArray.call(e,u)),s.enabled){var l=!1;n&&s.buffer===c.buffer||(a!==s.buffer&&(r.bindBuffer.call(e,34962,s.buffer),a=s.buffer),l=!0),(l||s.cached!==c.cached)&&r.vertexAttribPointer.call(e,u,s.size,s.type,s.normalized,s.stride,s.offset)}}this.currentArrayBuffer!==a&&r.bindBuffer.call(e,34962,this.currentArrayBuffer)}}else z(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var Y,q=function(t){return M(t)?void 0:0},Q=(X={},h()(X,3074,(function(t){return M(t)?void 0:36064})),h()(X,35723,(function(t){return M(t)?void 0:4352})),h()(X,35977,q),h()(X,32937,q),h()(X,36795,(function(t,e){var r=M(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?e(r.GPU_DISJOINT_EXT):0})),h()(X,37445,(function(t,e){var r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),h()(X,37446,(function(t,e){var r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),h()(X,34047,(function(t,e){var r=t.luma.extensions.EXT_texture_filter_anisotropic;return r?e(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),h()(X,32883,q),h()(X,35071,q),h()(X,37447,q),h()(X,36063,(function(t,e){if(!M(t)){var r=t.getExtension("WEBGL_draw_buffers");return r?e(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),h()(X,35379,q),h()(X,35374,q),h()(X,35377,q),h()(X,34852,(function(t){if(!M(t)){var e=t.getExtension("WEBGL_draw_buffers");return e?e.MAX_DRAW_BUFFERS_WEBGL:0}})),h()(X,36203,(function(t){return t.getExtension("OES_element_index")?2147483647:65535})),h()(X,33001,(function(t){return t.getExtension("OES_element_index")?16777216:65535})),h()(X,33e3,(function(t){return 16777216})),h()(X,37157,q),h()(X,35373,q),h()(X,35657,q),h()(X,36183,q),h()(X,37137,q),h()(X,34045,q),h()(X,35978,q),h()(X,35979,q),h()(X,35968,q),h()(X,35376,q),h()(X,35375,q),h()(X,35659,q),h()(X,37154,q),h()(X,35371,q),h()(X,35658,q),h()(X,35076,q),h()(X,35077,q),h()(X,35380,q),X);var $=(Y={},h()(Y,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){N(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),h()(Y,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,e){N(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),h()(Y,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){N(!1)}}),h()(Y,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){N(!1)},deleteQuery:function(){N(!1)},beginQuery:function(){N(!1)},endQuery:function(){},getQuery:function(t,e){return this.getQueryObject(t,e)},getQueryParameter:function(t,e){return this.getQueryObject(t,e)},getQueryObject:function(){}}),Y),J={readBuffer:function(t,e,r){M(t)&&e(r)},getVertexAttrib:function(t,e,r,n){var i,a=function(t,e){return{webgl2:M(t),ext:t.getExtension(e)}}(t,"ANGLE_instanced_arrays"),o=a.webgl2,u=a.ext;switch(n){case 35069:i=!!o&&void 0;break;case 35070:i=o||u?void 0:0}return void 0!==i?i:e(r,n)},getProgramParameter:function(t,e,r,n){if(!M(t))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return e(r,n)},getInternalformatParameter:function(t,e,r,n,i){if(!M(t))switch(i){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(r,n,i)},getTexParameter:function(t,e,r,n){switch(n){case 34046:var i=t.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(r,n)},getParameter:function(t,e,r){var n=Q[r],i="function"==typeof n?n(t,e,r):n;return void 0!==i?i:e(r)},hint:function(t,e,r,n){return e(r,n)}};function K(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tt(t,e){var r=e.extension,n=e.target,i=e.target2,a=$[r];N(a);for(var o=a.meta,u=(void 0===o?{}:o).suffix,s=void 0===u?"":u,c=t.getExtension(r),l=function(){var e=h[f],r="".concat(e).concat(s),o=null;"meta"===e||"function"==typeof t[e]||(c&&"function"==typeof c[r]?o=function(){return c[r].apply(c,arguments)}:"function"==typeof a[e]&&(o=a[e].bind(n))),o&&(n[e]=o,i[e]=o)},f=0,h=Object.keys(a);f<h.length;f++)l()}globalThis.polyfillContext=function(t){t.luma=t.luma||{};var e=t.luma;return e.polyfilled||(!function(t){if("function"!=typeof t.createVertexArray){var e=t.getSupportedExtensions;t.getSupportedExtensions=function(){var t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};var r=t.getExtension;t.getExtension=function(e){var n=r.call(this,e);return n||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new W(this)),this.__OESVertexArrayObject))}}}(t),function(t){t.luma.extensions={};var e,r=K(t.getSupportedExtensions()||[]);try{for(r.s();!(e=r.n()).done;){var n=e.value;t.luma[n]=t.getExtension(n)}}catch(t){r.e(t)}finally{r.f()}}(t),function(t,e){var r,n=K(Object.getOwnPropertyNames(e));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&tt(t,{extension:i,target:t.luma,target2:t})}}catch(t){n.e(t)}finally{n.f()}}(t,$),function(t,e){var r=e.target,n=e.target2;Object.keys(J).forEach((function(e){if("function"==typeof J[e]){var i=t[e]?t[e].bind(t):function(){},a=J[e].bind(null,t,i);r[e]=a,n[e]=a}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};var et,rt,nt,it=r(9),at=r.n(it),ot=(et={},h()(et,3042,!1),h()(et,32773,new Float32Array([0,0,0,0])),h()(et,32777,32774),h()(et,34877,32774),h()(et,32969,1),h()(et,32968,0),h()(et,32971,1),h()(et,32970,0),h()(et,3106,new Float32Array([0,0,0,0])),h()(et,3107,[!0,!0,!0,!0]),h()(et,2884,!1),h()(et,2885,1029),h()(et,2929,!1),h()(et,2931,1),h()(et,2932,513),h()(et,2928,new Float32Array([0,1])),h()(et,2930,!0),h()(et,3024,!0),h()(et,36006,null),h()(et,2886,2305),h()(et,33170,4352),h()(et,2849,1),h()(et,32823,!1),h()(et,32824,0),h()(et,10752,0),h()(et,32938,1),h()(et,32939,!1),h()(et,3089,!1),h()(et,3088,new Int32Array([0,0,1024,1024])),h()(et,2960,!1),h()(et,2961,0),h()(et,2968,4294967295),h()(et,36005,4294967295),h()(et,2962,519),h()(et,2967,0),h()(et,2963,4294967295),h()(et,34816,519),h()(et,36003,0),h()(et,36004,4294967295),h()(et,2964,7680),h()(et,2965,7680),h()(et,2966,7680),h()(et,34817,7680),h()(et,34818,7680),h()(et,34819,7680),h()(et,2978,[0,0,1024,1024]),h()(et,3333,4),h()(et,3317,4),h()(et,37440,!1),h()(et,37441,!1),h()(et,37443,37444),h()(et,35723,4352),h()(et,36010,null),h()(et,35977,!1),h()(et,3330,0),h()(et,3332,0),h()(et,3331,0),h()(et,3314,0),h()(et,32878,0),h()(et,3316,0),h()(et,3315,0),h()(et,32877,0),et),ut=function(t,e,r){return e?t.enable(r):t.disable(r)},st=function(t,e,r){return t.hint(r,e)},ct=function(t,e,r){return t.pixelStorei(r,e)};function lt(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var ft=(rt={},h()(rt,3042,ut),h()(rt,32773,(function(t,e){return t.blendColor.apply(t,l()(e))})),h()(rt,32777,"blendEquation"),h()(rt,34877,"blendEquation"),h()(rt,32969,"blendFunc"),h()(rt,32968,"blendFunc"),h()(rt,32971,"blendFunc"),h()(rt,32970,"blendFunc"),h()(rt,3106,(function(t,e){return t.clearColor.apply(t,l()(e))})),h()(rt,3107,(function(t,e){return t.colorMask.apply(t,l()(e))})),h()(rt,2884,ut),h()(rt,2885,(function(t,e){return t.cullFace(e)})),h()(rt,2929,ut),h()(rt,2931,(function(t,e){return t.clearDepth(e)})),h()(rt,2932,(function(t,e){return t.depthFunc(e)})),h()(rt,2928,(function(t,e){return t.depthRange.apply(t,l()(e))})),h()(rt,2930,(function(t,e){return t.depthMask(e)})),h()(rt,3024,ut),h()(rt,35723,st),h()(rt,36006,(function(t,e){var r=M(t)?36009:36160;return t.bindFramebuffer(r,e)})),h()(rt,2886,(function(t,e){return t.frontFace(e)})),h()(rt,33170,st),h()(rt,2849,(function(t,e){return t.lineWidth(e)})),h()(rt,32823,ut),h()(rt,32824,"polygonOffset"),h()(rt,10752,"polygonOffset"),h()(rt,35977,ut),h()(rt,32938,"sampleCoverage"),h()(rt,32939,"sampleCoverage"),h()(rt,3089,ut),h()(rt,3088,(function(t,e){return t.scissor.apply(t,l()(e))})),h()(rt,2960,ut),h()(rt,2961,(function(t,e){return t.clearStencil(e)})),h()(rt,2968,(function(t,e){return t.stencilMaskSeparate(1028,e)})),h()(rt,36005,(function(t,e){return t.stencilMaskSeparate(1029,e)})),h()(rt,2962,"stencilFuncFront"),h()(rt,2967,"stencilFuncFront"),h()(rt,2963,"stencilFuncFront"),h()(rt,34816,"stencilFuncBack"),h()(rt,36003,"stencilFuncBack"),h()(rt,36004,"stencilFuncBack"),h()(rt,2964,"stencilOpFront"),h()(rt,2965,"stencilOpFront"),h()(rt,2966,"stencilOpFront"),h()(rt,34817,"stencilOpBack"),h()(rt,34818,"stencilOpBack"),h()(rt,34819,"stencilOpBack"),h()(rt,2978,(function(t,e){return t.viewport.apply(t,l()(e))})),h()(rt,3333,ct),h()(rt,3317,ct),h()(rt,37440,ct),h()(rt,37441,ct),h()(rt,37443,ct),h()(rt,3330,ct),h()(rt,3332,ct),h()(rt,3331,ct),h()(rt,36010,(function(t,e){return t.bindFramebuffer(36008,e)})),h()(rt,3314,ct),h()(rt,32878,ct),h()(rt,3316,ct),h()(rt,3315,ct),h()(rt,32877,ct),h()(rt,"framebuffer",(function(t,e){var r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)})),h()(rt,"blend",(function(t,e){return e?t.enable(3042):t.disable(3042)})),h()(rt,"blendColor",(function(t,e){return t.blendColor.apply(t,l()(e))})),h()(rt,"blendEquation",(function(t,e){e=lt(e)?e:[e,e],t.blendEquationSeparate.apply(t,l()(e))})),h()(rt,"blendFunc",(function(t,e){e=lt(e)&&2===e.length?[].concat(l()(e),l()(e)):e,t.blendFuncSeparate.apply(t,l()(e))})),h()(rt,"clearColor",(function(t,e){return t.clearColor.apply(t,l()(e))})),h()(rt,"clearDepth",(function(t,e){return t.clearDepth(e)})),h()(rt,"clearStencil",(function(t,e){return t.clearStencil(e)})),h()(rt,"colorMask",(function(t,e){return t.colorMask.apply(t,l()(e))})),h()(rt,"cull",(function(t,e){return e?t.enable(2884):t.disable(2884)})),h()(rt,"cullFace",(function(t,e){return t.cullFace(e)})),h()(rt,"depthTest",(function(t,e){return e?t.enable(2929):t.disable(2929)})),h()(rt,"depthFunc",(function(t,e){return t.depthFunc(e)})),h()(rt,"depthMask",(function(t,e){return t.depthMask(e)})),h()(rt,"depthRange",(function(t,e){return t.depthRange.apply(t,l()(e))})),h()(rt,"dither",(function(t,e){return e?t.enable(3024):t.disable(3024)})),h()(rt,"derivativeHint",(function(t,e){t.hint(35723,e)})),h()(rt,"frontFace",(function(t,e){return t.frontFace(e)})),h()(rt,"mipmapHint",(function(t,e){return t.hint(33170,e)})),h()(rt,"lineWidth",(function(t,e){return t.lineWidth(e)})),h()(rt,"polygonOffsetFill",(function(t,e){return e?t.enable(32823):t.disable(32823)})),h()(rt,"polygonOffset",(function(t,e){return t.polygonOffset.apply(t,l()(e))})),h()(rt,"sampleCoverage",(function(t,e){return t.sampleCoverage.apply(t,l()(e))})),h()(rt,"scissorTest",(function(t,e){return e?t.enable(3089):t.disable(3089)})),h()(rt,"scissor",(function(t,e){return t.scissor.apply(t,l()(e))})),h()(rt,"stencilTest",(function(t,e){return e?t.enable(2960):t.disable(2960)})),h()(rt,"stencilMask",(function(t,e){var r=e=lt(e)?e:[e,e],n=at()(r,2),i=n[0],a=n[1];t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,a)})),h()(rt,"stencilFunc",(function(t,e){var r=e=lt(e)&&3===e.length?[].concat(l()(e),l()(e)):e,n=at()(r,6),i=n[0],a=n[1],o=n[2],u=n[3],s=n[4],c=n[5];t.stencilFuncSeparate(1028,i,a,o),t.stencilFuncSeparate(1029,u,s,c)})),h()(rt,"stencilOp",(function(t,e){var r=e=lt(e)&&3===e.length?[].concat(l()(e),l()(e)):e,n=at()(r,6),i=n[0],a=n[1],o=n[2],u=n[3],s=n[4],c=n[5];t.stencilOpSeparate(1028,i,a,o),t.stencilOpSeparate(1029,u,s,c)})),h()(rt,"viewport",(function(t,e){return t.viewport.apply(t,l()(e))})),rt);function ht(t,e,r){return void 0!==e[t]?e[t]:r[t]}var dt={blendEquation:function(t,e,r){return t.blendEquationSeparate(ht(32777,e,r),ht(34877,e,r))},blendFunc:function(t,e,r){return t.blendFuncSeparate(ht(32969,e,r),ht(32968,e,r),ht(32971,e,r),ht(32970,e,r))},polygonOffset:function(t,e,r){return t.polygonOffset(ht(32824,e,r),ht(10752,e,r))},sampleCoverage:function(t,e,r){return t.sampleCoverage(ht(32938,e,r),ht(32939,e,r))},stencilFuncFront:function(t,e,r){return t.stencilFuncSeparate(1028,ht(2962,e,r),ht(2967,e,r),ht(2963,e,r))},stencilFuncBack:function(t,e,r){return t.stencilFuncSeparate(1029,ht(34816,e,r),ht(36003,e,r),ht(36004,e,r))},stencilOpFront:function(t,e,r){return t.stencilOpSeparate(1028,ht(2964,e,r),ht(2965,e,r),ht(2966,e,r))},stencilOpBack:function(t,e,r){return t.stencilOpSeparate(1029,ht(34817,e,r),ht(34818,e,r),ht(34819,e,r))}},gt={enable:function(t,e){return t(h()({},e,!0))},disable:function(t,e){return t(h()({},e,!1))},pixelStorei:function(t,e,r){return t(h()({},e,r))},hint:function(t,e,r){return t(h()({},e,r))},bindFramebuffer:function(t,e,r){var n;switch(e){case 36160:return t((n={},h()(n,36006,r),h()(n,36010,r),n));case 36009:return t(h()({},36006,r));case 36008:return t(h()({},36010,r));default:return null}},blendColor:function(t,e,r,n,i){return t(h()({},32773,new Float32Array([e,r,n,i])))},blendEquation:function(t,e){var r;return t((r={},h()(r,32777,e),h()(r,34877,e),r))},blendEquationSeparate:function(t,e,r){var n;return t((n={},h()(n,32777,e),h()(n,34877,r),n))},blendFunc:function(t,e,r){var n;return t((n={},h()(n,32969,e),h()(n,32968,r),h()(n,32971,e),h()(n,32970,r),n))},blendFuncSeparate:function(t,e,r,n,i){var a;return t((a={},h()(a,32969,e),h()(a,32968,r),h()(a,32971,n),h()(a,32970,i),a))},clearColor:function(t,e,r,n,i){return t(h()({},3106,new Float32Array([e,r,n,i])))},clearDepth:function(t,e){return t(h()({},2931,e))},clearStencil:function(t,e){return t(h()({},2961,e))},colorMask:function(t,e,r,n,i){return t(h()({},3107,[e,r,n,i]))},cullFace:function(t,e){return t(h()({},2885,e))},depthFunc:function(t,e){return t(h()({},2932,e))},depthRange:function(t,e,r){return t(h()({},2928,new Float32Array([e,r])))},depthMask:function(t,e){return t(h()({},2930,e))},frontFace:function(t,e){return t(h()({},2886,e))},lineWidth:function(t,e){return t(h()({},2849,e))},polygonOffset:function(t,e,r){var n;return t((n={},h()(n,32824,e),h()(n,10752,r),n))},sampleCoverage:function(t,e,r){var n;return t((n={},h()(n,32938,e),h()(n,32939,r),n))},scissor:function(t,e,r,n,i){return t(h()({},3088,new Int32Array([e,r,n,i])))},stencilMask:function(t,e){var r;return t((r={},h()(r,2968,e),h()(r,36005,e),r))},stencilMaskSeparate:function(t,e,r){return t(h()({},1028===e?2968:36005,r))},stencilFunc:function(t,e,r,n){var i;return t((i={},h()(i,2962,e),h()(i,2967,r),h()(i,2963,n),h()(i,34816,e),h()(i,36003,r),h()(i,36004,n),i))},stencilFuncSeparate:function(t,e,r,n,i){var a;return t((a={},h()(a,1028===e?2962:34816,r),h()(a,1028===e?2967:36003,n),h()(a,1028===e?2963:36004,i),a))},stencilOp:function(t,e,r,n){var i;return t((i={},h()(i,2964,e),h()(i,2965,r),h()(i,2966,n),h()(i,34817,e),h()(i,34818,r),h()(i,34819,n),i))},stencilOpSeparate:function(t,e,r,n,i){var a;return t((a={},h()(a,1028===e?2964:34817,r),h()(a,1028===e?2965:34818,n),h()(a,1028===e?2966:34819,i),a))},viewport:function(t,e,r,n,i){return t(h()({},2978,[e,r,n,i]))}},vt=function(t,e){return t.isEnabled(e)},yt=(nt={},h()(nt,3042,vt),h()(nt,2884,vt),h()(nt,2929,vt),h()(nt,3024,vt),h()(nt,32823,vt),h()(nt,32926,vt),h()(nt,32928,vt),h()(nt,3089,vt),h()(nt,2960,vt),h()(nt,35977,vt),nt);function mt(t){for(var e in t)return!1;return!0}function bt(t,e){if(t===e)return!0;var r=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&n&&t.length===e.length){for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function pt(t,e){var r=t[e].bind(t);t[e]=function(){var e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:r.apply(void 0,arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function _t(t,e,r){var n=t[e].bind(t);t[e]=function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];var o=r.apply(void 0,[t.state._updateCache].concat(i)),u=o.valueChanged,s=o.oldValue;return u&&n.apply(void 0,i),s},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}function At(t){var e=t.useProgram.bind(t);t.useProgram=function(r){t.state.program!==r&&(e(r),t.state.program=r)}}var xt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,a=void 0!==n&&n,o=r.log,u=void 0===o?function(){}:o;i()(this,t),this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=a?Ot(e):Object.assign({},ot),this.log=u,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return o()(t,[{key:"push",value:function(){this.stateStack.push({})}},{key:"pop",value:function(){N(this.stateStack.length>0);var t=this.stateStack[this.stateStack.length-1];St(this.gl,t),this.stateStack.pop()}},{key:"_updateCache",value:function(t){var e,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in t){N(void 0!==i);var a=t[i],o=this.cache[i];bt(a,o)||(r=!0,e=o,n&&!(i in n)&&(n[i]=o),this.cache[i]=a)}return{valueChanged:r,oldValue:e}}}]),t}();function wt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.enable,n=void 0===r||r,i=e.copyState;if(N(void 0!==i),!t.state){var a=globalThis.polyfillContext;for(var o in a&&a(t),t.state=new xt(t,{copyState:i}),At(t),gt){var u=gt[o];_t(t,o,u)}pt(t,"getParameter"),pt(t,"isEnabled")}return t.state.enable=n,t}function Tt(t){N(t.state),t.state.pop()}function Et(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return kt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function St(t,e){if(N(C(t),"setParameters requires a WebGL context"),!mt(e)){var r={};for(var n in e){var i=Number(n),a=ft[n];a&&("string"==typeof a?r[a]=!0:a(t,e[n],i))}var o=t.state&&t.state.cache;if(o)for(var u in r){(0,dt[u])(t,e,o)}}}function Ot(t,e){if("number"==typeof(e=e||ot)){var r=e,n=yt[r];return n?n(t,r):t.getParameter(r)}var i,a={},o=Et(Array.isArray(e)?e:Object.keys(e));try{for(o.s();!(i=o.n()).done;){var u=i.value,s=yt[u];a[u]=s?s(t,Number(u)):t.getParameter(Number(u))}}catch(t){o.e(t)}finally{o.f()}return a}function Lt(t,e,r){if(mt(e))return r(t);var n,i=e.nocatch,a=void 0===i||i;if(function(t){t.state||wt(t,{copyState:!1}),t.state.push()}(t),St(t,e),a)n=r(t),Tt(t);else try{n=r(t)}finally{Tt(t)}return n}var Ft=r(40);var Rt=Object(Ft.a)();function It(t){var e=t.getParameter(7936),r=t.getParameter(7937),n=t.getExtension("WEBGL_debug_renderer_info");return{vendor:n&&t.getParameter(n.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:n&&t.getParameter(n.UNMASKED_RENDERER_WEBGL||7937)||r,vendorMasked:e,rendererMasked:r,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}var Bt=r(13),Pt=function(){function t(e,r){i()(this,t),this.name=e,this.type=r,this.sampleSize=1,this.reset()}return o()(t,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Object(Bt.a)(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Object(Bt.a)()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){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}},{key:"_checkSampling",value:function(){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)}}]),t}(),Dt=function(){function t(e){var r=e.id,n=e.stats;i()(this,t),this.id=r,this.stats={},this._initializeStats(n),Object.seal(this)}return o()(t,[{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var e in this.stats)t(this.stats[e])}},{key:"getTable",value:function(){var t={};return this.forEach((function(e){t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}},{key:"_initializeStats",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){return t._getOrCreate(e)}))}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var e=t.name,r=t.type;return this.stats[e]||(this.stats[e]=t instanceof Pt?t:new Pt(e,r)),this.stats[e]}},{key:"size",get:function(){return Object.keys(this.stats).length}}]),t}(),jt=new(function(){function t(){i()(this,t),this.stats=new Map}return o()(t,[{key:"get",value:function(t){return this.stats.has(t)||this.stats.set(t,new Dt({id:t})),this.stats.get(t)}}]),t}());if(globalThis.luma&&"8.5.11"!==globalThis.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat("8.5.11"));globalThis.luma||(Object(Ft.a)()&&j.log(1,"luma.gl ".concat("8.5.11"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:"8.5.11",version:"8.5.11",log:j,stats:jt,globals:{modules:{},nodeIO:{}}});globalThis.luma;function Nt(t){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function Ct(t){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var Mt=r(7),Ut=r.n(Mt),Vt=r(5),Gt=r.n(Vt),zt=r(6),Ht=r.n(zt),Xt=r(3),Wt=r.n(Xt);function Yt(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function qt(t,e){if("string"!=typeof e)return e;var r=Number(e);if(!isNaN(r))return r;var n=t[e=e.replace(/^.*\./,"")];return Yt(void 0!==n,"Accessing undefined constant GL.".concat(e)),n}function Qt(t,e){for(var r in e=Number(e),t)if(t[r]===e)return"GL.".concat(r);return String(e)}var $t={};function Jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";$t[t]=$t[t]||1;var e=$t[t]++;return"".concat(t,"-").concat(e)}function Kt(t){return Yt("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Zt(t){var e=!0;for(var r in t){e=!1;break}return e}function te(t,e,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(t);n.forEach((function(t){a.methodName||(a[t]=function(){throw j.removed("Calling removed method ".concat(e,".").concat(t,": "),i)(),new Error(t)})}))}function ee(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return re(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return re(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function re(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ne="Resource subclass must define virtual methods",ie=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t),U(e);var n=r.id,a=r.userData,o=void 0===a?{}:a;this.gl=e,this.gl2=e,this.id=n||Jt(this[Symbol.toStringTag]),this.userData=o,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return o()(t,[{key:Symbol.toStringTag,get:function(){return"Resource"}}]),o()(t,[{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.deleteChildren,r=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(t){return t.delete()})),this}},{key:"bind",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Yt(t=qt(this.gl,t));var r=this.constructor.PARAMETERS||{},n=r[t];if(n){var i=M(this.gl),a=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!a){var o=n.webgl1,u="webgl2"in n?n.webgl2:n.webgl1,s=i?u:o;return s}}return this._getParameter(t,e)}},{key:"getParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.parameters,n=e.keys,i=this.constructor.PARAMETERS||{},a=M(this.gl),o={},u=r||Object.keys(i),s=ee(u);try{for(s.s();!(t=s.n()).done;){var c=t.value,l=i[c],f=l&&(!("webgl2"in l)||a)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?Qt(this.gl,c):c;o[h]=this.getParameter(c,e),n&&"GLenum"===l.type&&(o[h]=Qt(this.gl,o[h]))}}}catch(t){s.e(t)}finally{s.f()}return o}},{key:"setParameter",value:function(t,e){Yt(t=qt(this.gl,t));var r=(this.constructor.PARAMETERS||{})[t];if(r){var n=M(this.gl);if(!((!("webgl2"in r)||n)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(e=qt(e))}return this._setParameter(t,e),this}},{key:"setParameters",value:function(t){for(var e in t)this.setParameter(e,t[e]);return this}},{key:"stubRemovedMethods",value:function(t,e,r){return te(this,t,e,r)}},{key:"initialize",value:function(t){}},{key:"_createHandle",value:function(){throw new Error(ne)}},{key:"_deleteHandle",value:function(){throw new Error(ne)}},{key:"_bindHandle",value:function(t){throw new Error(ne)}},{key:"_getOptsFromHandle",value:function(){throw new Error(ne)}},{key:"_getParameter",value:function(t,e){throw new Error(ne)}},{key:"_setParameter",value:function(t,e){throw new Error(ne)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var t=this[Symbol.toStringTag],e=jt.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var t=this[Symbol.toStringTag];jt.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],r=jt.get("Memory Usage");r.get("GPU Memory").addCount(t),r.get("".concat(e," Memory")).addCount(t),this.byteLength=t}},{key:"_trackDeallocatedMemory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=jt.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get("".concat(t," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),t}(),ae=r(22),oe=r.n(ae);function ue(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function se(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.clamped,n=void 0===r||r;switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function ce(t){var e=t.data,r=t.width,n=t.height,i=t.bytesPerPixel,a=void 0===i?4:i,o=t.temp,u=r*a;o=o||new Uint8Array(u);for(var s=0;s<n/2;++s){var c=s*u,l=(n-s-1)*u;o.set(e.subarray(c,c+u)),e.copyWithin(c,l,l+u),e.set(o,l)}}function le(t){for(var e=t.data,r=t.width,n=t.height,i=Math.round(r/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),u=0;u<a;u++)for(var s=0;s<i;s++)for(var c=0;c<4;c++)o[4*(u*i+s)+c]=e[4*(2*u*r+2*s)+c];return{data:o,width:i,height:a}}function fe(t,e,r){var n=r.removedProps,i=void 0===n?{}:n,a=r.deprecatedProps,o=void 0===a?{}:a,u=r.replacedProps,s=void 0===u?{}:u;for(var c in i)if(c in e){var l=i[c]?"".concat(t,".").concat(i[c]):"N/A";j.removed("".concat(t,".").concat(c),l)()}for(var f in o)if(f in e){var h=o[f];j.deprecated("".concat(t,".").concat(f),"".concat(t,".").concat(h))()}var d=null;for(var g in s)if(g in e){var v=s[g];j.deprecated("".concat(t,".").concat(g),"".concat(t,".").concat(v))(),(d=d||Object.assign({},e))[v]=e[g],delete d[g]}return d||e}var he={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},de={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},ge=function(){function t(){var e=this;i()(this,t);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];n.forEach((function(t){return e._assign(t)})),Object.freeze(this)}return o()(t,null,[{key:"getBytesPerElement",value:function(t){return se(t.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(t){return Yt(t.size),se(t.type||5126).BYTES_PER_ELEMENT*t.size}},{key:"resolve",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return oe()(t,[he].concat(r))}}]),o()(t,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"_assign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(t=fe("Accessor",t,de)).type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"==typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return t.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return t.getBytesPerVertex(this)}}]),t}();function ve(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var ye,me,be,pe={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},_e={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:pe},Ae={removedProps:pe},xe=function(t){Gt()(r,t);var e=ve(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=a.target||(n.gl.webgl2?36662:34962),n.initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Buffer"}}]),o()(r,[{key:"getElementCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ge.getBytesPerElement(t))}},{key:"getVertexCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ge.getBytesPerVertex(t))}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=fe("Buffer",t,_e),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}},{key:"setProps",value:function(t){return"accessor"in(t=fe("Buffer",t,Ae))&&this.setAccessor(t.accessor),this}},{key:"setAccessor",value:function(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new ge(t),this}},{key:"reallocate",value:function(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}},{key:"setData",value:function(t){return this.initialize(t)}},{key:"subData",value:function(t){ArrayBuffer.isView(t)&&(t={data:t});var e=t,r=e.data,n=e.offset,i=void 0===n?0:n,a=e.srcOffset,o=void 0===a?0:a,u=t.byteLength||t.length;Yt(r);var s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==o||void 0!==u?(V(this.gl),this.gl.bufferSubData(this.target,i,r,o,u)):this.gl.bufferSubData(s,i,r),this.gl.bindBuffer(s,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(t){var e=t.sourceBuffer,r=t.readOffset,n=void 0===r?0:r,i=t.writeOffset,a=void 0===i?0:i,o=t.size,u=this.gl;return V(u),u.bindBuffer(36662,e.handle),u.bindBuffer(36663,this.handle),u.copyBufferSubData(36662,36663,n,a,o),u.bindBuffer(36662,null),u.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dstData,r=void 0===e?null:e,n=t.srcByteOffset,i=void 0===n?0:n,a=t.dstOffset,o=void 0===a?0:a,u=t.length,s=void 0===u?0:u;V(this.gl);var c,l,f=se(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=o;r?c=(l=r.length)-d:l=d+(c=Math.min(h,s||h));var g=Math.min(h,c);return Yt((s=s||g)<=g),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,o,s),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?this.target:e,n=t.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=t.offset,o=void 0===a?0:a,u=t.size;return 35345===r||35982===r?void 0!==u?this.gl.bindBufferRange(r,i,this.handle,o,u):(Yt(0===o),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?this.target:e,n=t.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=35345===r||35982===r;return a?this.gl.bindBufferBase(r,i,null):this.gl.bindBuffer(r,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;Yt(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,e,t),this.gl.bindBuffer(n,null),this.debugData=t.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=ue(t);return Yt(i),this.setAccessor(new ge(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Yt(t>=0),this._trackDeallocatedMemory();var r=t;0===t&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,e),this.gl.bindBuffer(n,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(t){var e=t/se(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}},{key:"_inferType",value:function(t){this.accessor.type||this.setAccessor(new ge(this.accessor,{type:ue(t)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(t){this.gl.bindBuffer(this.target,this.handle);var e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}},{key:"setByteLength",value:function(t){return j.deprecated("setByteLength","reallocate")(),this.reallocate(t)}},{key:"updateAccessor",value:function(t){return j.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ge(this.accessor,t),this}},{key:"type",get:function(){return j.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return j.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),r}(ie),we=(ye={},h()(ye,6407,{dataFormat:6407,types:[5121,33635]}),h()(ye,6408,{dataFormat:6408,types:[5121,32819,32820]}),h()(ye,6406,{dataFormat:6406,types:[5121]}),h()(ye,6409,{dataFormat:6409,types:[5121]}),h()(ye,6410,{dataFormat:6410,types:[5121]}),h()(ye,33326,{dataFormat:6403,types:[5126],gl2:!0}),h()(ye,33328,{dataFormat:33319,types:[5126],gl2:!0}),h()(ye,34837,{dataFormat:6407,types:[5126],gl2:!0}),h()(ye,34836,{dataFormat:6408,types:[5126],gl2:!0}),ye),Te=(me={},h()(me,6403,1),h()(me,36244,1),h()(me,33319,2),h()(me,33320,2),h()(me,6407,3),h()(me,36248,3),h()(me,6408,4),h()(me,36249,4),h()(me,6402,1),h()(me,34041,1),h()(me,6406,1),h()(me,6409,1),h()(me,6410,2),me),Ee=(be={},h()(be,5126,4),h()(be,5125,4),h()(be,5124,4),h()(be,5123,2),h()(be,5122,2),h()(be,5131,2),h()(be,5120,1),h()(be,5121,1),be);function ke(t,e){var r=we[e];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=M(t)&&r.gl2||r.gl1;return"string"==typeof n?t.getExtension(n):n}function Se(t,e){var r=we[e];switch(r&&r.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}function Oe(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Le(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Le(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Re=[9729,9728],Ie=globalThis.WebGLBuffer||function(){},Be=function(t){Gt()(r,t);var e=Fe(r);function r(t,n){var a;i()(this,r);var o=n.id,u=void 0===o?Jt("texture"):o,s=n.handle,c=n.target;return(a=e.call(this,t,{id:u,handle:s})).target=c,a.textureUnit=void 0,a.loaded=!1,a.width=void 0,a.height=void 0,a.depth=void 0,a.format=void 0,a.type=void 0,a.dataFormat=void 0,a.border=void 0,a.textureUnit=void 0,a.mipmaps=void 0,a}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Texture"}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.format,n=e.linearFiltering,i=!0;return r&&(i=(i=i&&ke(t,r))&&(!n||Se(t,r))),i}}]),o()(r,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.data;if(r instanceof Promise)return r.then((function(r){return t.initialize(Object.assign({},e,{pixels:r,data:r}))})),this;var n="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement;if(n&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",(function(){return t.initialize(e)})),this;var i=e.pixels,a=void 0===i?null:i,o=e.format,u=void 0===o?6408:o,s=e.border,c=void 0===s?0:s,l=e.recreate,f=void 0!==l&&l,h=e.parameters,d=void 0===h?{}:h,g=e.pixelStore,v=void 0===g?{}:g,y=e.textureUnit,m=void 0===y?void 0:y;r||(r=a);var b=e.width,p=e.height,_=e.dataFormat,A=e.type,x=e.compressed,w=void 0!==x&&x,T=e.mipmaps,E=void 0===T||T,k=e.depth,S=void 0===k?0:k,O=this._deduceParameters({format:u,type:A,dataFormat:_,compressed:w,data:r,width:b,height:p});return b=O.width,p=O.height,w=O.compressed,_=O.dataFormat,A=O.type,this.width=b,this.height=p,this.depth=S,this.format=u,this.type=A,this.dataFormat=_,this.border=c,this.textureUnit=m,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),E&&this._isNPOT()&&(j.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),E=!1,this._updateForNPOT(d)),this.mipmaps=E,this.setImageData({data:r,width:b,height:p,depth:S,format:u,type:A,dataFormat:_,border:c,mipmaps:E,parameters:v,compressed:w}),E&&this.generateMipmap(),this.setParameters(d),f&&(this.data=r),n&&(this._video={video:r,parameters:d,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var t=this._video,e=t.video,r=t.parameters;if(t.lastTime===e.currentTime||e.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:e,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=e.currentTime}}},{key:"resize",value:function(t){var e=t.height,r=t.width,n=t.mipmaps,i=void 0!==n&&n;return r!==this.width||e!==this.height?this.initialize({width:r,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(j.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Lt(this.gl,e,(function(){t.gl.generateMipmap(t.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(t){this._trackDeallocatedMemory("Texture");var e=t.target,r=void 0===e?this.target:e,n=t.pixels,i=void 0===n?null:n,a=t.level,o=void 0===a?0:a,u=t.format,s=void 0===u?this.format:u,c=t.border,l=void 0===c?this.border:c,f=t.offset,h=void 0===f?0:f,d=t.parameters,g=void 0===d?{}:d,v=t.data,y=void 0===v?null:v,m=t.type,b=void 0===m?this.type:m,p=t.width,_=void 0===p?this.width:p,A=t.height,x=void 0===A?this.height:A,w=t.dataFormat,T=void 0===w?this.dataFormat:w,E=t.compressed,k=void 0!==E&&E;y||(y=i);var S=this._deduceParameters({format:s,type:b,dataFormat:T,compressed:k,data:y,width:_,height:x});b=S.type,T=S.dataFormat,k=S.compressed,_=S.width,x=S.height;var O=this.gl;O.bindTexture(this.target,this.handle);var L,F,R=this._getDataType({data:y,compressed:k});y=R.data,L=R.dataType;var I=0;if(Lt(this.gl,g,(function(){switch(L){case"null":O.texImage2D(r,o,s,_,x,l,T,b,y);break;case"typed-array":O.texImage2D(r,o,s,_,x,l,T,b,y,h);break;case"buffer":(F=V(O)).bindBuffer(35052,y.handle||y),F.texImage2D(r,o,s,_,x,l,T,b,h),F.bindBuffer(35052,null);break;case"browser-object":M(O)?O.texImage2D(r,o,s,_,x,l,T,b,y):O.texImage2D(r,o,s,T,b,y);break;case"compressed":var t,e=Oe(y.entries());try{for(e.s();!(t=e.n()).done;){var n=at()(t.value,2),i=n[0],a=n[1];O.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data),I+=a.levelSize}}catch(t){e.e(t)}finally{e.f()}break;default:Yt(!1,"Unknown image data type")}})),"compressed"===L)this._trackAllocatedMemory(I,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var B=Te[this.dataFormat]||4,P=Ee[this.type]||1;this._trackAllocatedMemory(this.width*this.height*B*P,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(t){var e=this,r=t.target,n=void 0===r?this.target:r,i=t.pixels,a=void 0===i?null:i,o=t.data,u=void 0===o?null:o,s=t.x,c=void 0===s?0:s,l=t.y,f=void 0===l?0:l,h=t.width,d=void 0===h?this.width:h,g=t.height,v=void 0===g?this.height:g,y=t.level,m=void 0===y?0:y,b=t.format,p=void 0===b?this.format:b,_=t.type,A=void 0===_?this.type:_,x=t.dataFormat,w=void 0===x?this.dataFormat:x,T=t.compressed,E=void 0!==T&&T,k=t.offset,S=void 0===k?0:k,O=t.border,L=(void 0===O&&this.border,t.parameters),F=void 0===L?{}:L,R=this._deduceParameters({format:p,type:A,dataFormat:w,compressed:E,data:u,width:d,height:v});if(A=R.type,w=R.dataFormat,E=R.compressed,d=R.width,v=R.height,Yt(0===this.depth,"texSubImage not supported for 3D textures"),u||(u=a),u&&u.data){var I=u;u=I.data,d=I.shape[0],v=I.shape[1]}u instanceof xe&&(u=u.handle),this.gl.bindTexture(this.target,this.handle),Lt(this.gl,F,(function(){if(E)e.gl.compressedTexSubImage2D(n,m,c,f,d,v,p,u);else if(null===u)e.gl.texSubImage2D(n,m,c,f,d,v,w,A,null);else if(ArrayBuffer.isView(u))e.gl.texSubImage2D(n,m,c,f,d,v,w,A,u,S);else if(u instanceof Ie){var t=V(e.gl);t.bindBuffer(35052,u),t.texSubImage2D(n,m,c,f,d,v,w,A,S),t.bindBuffer(35052,null)}else if(M(e.gl)){V(e.gl).texSubImage2D(n,m,c,f,d,v,w,A,u)}else e.gl.texSubImage2D(n,m,c,f,w,A,u)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){return j.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}},{key:"_getDataType",value:function(t){var e=t.data,r=t.compressed;return void 0!==r&&r?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof xe?{data:e.handle,dataType:"buffer"}:e instanceof Ie?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(t){var e=t.format,r=t.data,n=t.width,i=t.height,a=t.dataFormat,o=t.type,u=t.compressed,s=we[e];a=a||s&&s.dataFormat,o=o||s&&s.types[0],u=u||s&&s.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:a,type:o,compressed:u,width:n=c.width,height:i=c.height,format:e,data:r}}},{key:"_deduceImageSize",value:function(t,e,r){var n;return Yt(n="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:r}:{width:e>=0?e:1,height:r>=0?r:1},"Could not deduced texture size"),Yt(void 0===e||n.width===e,"Deduced texture width does not match supplied width"),Yt(void 0===r||n.height===r,"Deduced texture height does not match supplied height"),n}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}},{key:"_setParameter",value:function(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Yt(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!M(this.gl)&&(!(!this.width||!this.height)&&(!Kt(this.width)||!Kt(this.height)))}},{key:"_updateForNPOT",value:function(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(t,e){if(this._isNPOT())switch(t){case 10241:-1===Re.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}]),r}(ie),Pe="";function De(t){Pe=t}function je(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Yt("string"==typeof t),t=Pe+t;var r=e.dataType||"text";return fetch(t,e).then((function(t){return t[r]()}))}function Ne(t,e){return Yt("string"==typeof t),t=Pe+t,new Promise((function(r,n){try{var i=new Image;i.onload=function(){return r(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(t,".")))},i.crossOrigin=e&&e.crossOrigin||"anonymous",i.src=t}catch(t){n(t)}}))}function Ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Me=function(t){Gt()(r,t);var e=Ce(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),U(t),(a instanceof Promise||"string"==typeof a)&&(a={data:a}),"string"==typeof a.data&&(a=Object.assign({},a,{data:Ne(a.data)})),(n=e.call(this,t,Object.assign({},a,{target:3553}))).initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(t,e){return Be.isSupported(t,e)}}]),r}(Be),Ue=r(16),Ve=r.n(Ue),Ge=r(23),ze=r.n(Ge);function He(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Xe=[34069,34070,34071,34072,34073,34074],We=function(t){Gt()(n,t);var e,r=He(n);function n(t){var e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,n),U(t),(e=r.call(this,t,Object.assign({},a,{target:34067}))).initialize(a),Object.seal(Ut()(e)),e}return o()(n,[{key:Symbol.toStringTag,get:function(){return"TextureCube"}}]),o()(n,[{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.mipmaps,n=void 0===r||r,i=e.parameters,a=void 0===i?{}:i;return this.opts=e,this.setCubeMapImageData(e).then((function(){t.loaded=!0,n&&t.generateMipmap(e),t.setParameters(a)})),this}},{key:"subImage",value:function(t){var e=t.face,r=t.data,n=t.x,i=void 0===n?0:n,a=t.y,o=void 0===a?0:a,u=t.mipmapLevel,s=void 0===u?0:u;return this._subImage({target:e,data:r,x:i,y:o,mipmapLevel:s})}},{key:"setCubeMapImageData",value:(e=ze()(Ve.a.mark((function t(e){var r,n,i,a,o,u,s,c,l,f,h,d,g,v=this;return Ve.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.width,n=e.height,i=e.pixels,a=e.data,o=e.border,u=void 0===o?0:o,s=e.format,c=void 0===s?6408:s,l=e.type,f=void 0===l?5121:l,h=this.gl,d=i||a,t.next=5,Promise.all(Xe.map((function(t){var e=d[t];return Promise.all(Array.isArray(e)?e:[e])})));case 5:g=t.sent,this.bind(),Xe.forEach((function(t,e){g[e].length>1&&!1!==v.opts.mipmaps&&j.warn("".concat(v.id," has mipmap and multiple LODs."))(),g[e].forEach((function(e,i){r&&n?h.texImage2D(t,i,c,r,n,u,c,f,e):h.texImage2D(t,i,c,c,f,e)}))})),this.unbind();case 9:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"setImageDataForFace",value:function(t){var e=this,r=t.face,n=t.width,i=t.height,a=t.pixels,o=t.data,u=t.border,s=void 0===u?0:u,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,g=a||o;return this.bind(),g instanceof Promise?g.then((function(n){return e.setImageDataForFace(Object.assign({},t,{face:r,data:n,pixels:n}))})):this.width||this.height?d.texImage2D(r,0,l,n,i,s,l,h,g):d.texImage2D(r,0,l,l,h,g),this}}]),n}(Be);function Ye(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}We.FACES=Xe;var qe,Qe=function(t){Gt()(r,t);var e=Ye(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),V(t),a=Object.assign({depth:1},a,{target:32879,unpackFlipY:!1}),(n=e.call(this,t,a)).initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Texture3D"}}],[{key:"isSupported",value:function(t){return M(t)}}]),o()(r,[{key:"setImageData",value:function(t){var e=this,r=t.level,n=void 0===r?0:r,i=t.dataFormat,a=void 0===i?6408:i,o=t.width,u=t.height,s=t.depth,c=void 0===s?1:s,l=t.border,f=void 0===l?0:l,h=t.format,d=t.type,g=void 0===d?5121:d,v=t.offset,y=void 0===v?0:v,m=t.data,b=t.parameters,p=void 0===b?{}:b;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Lt(this.gl,p,(function(){ArrayBuffer.isView(m)&&e.gl.texImage3D(e.target,n,a,o,u,c,f,h,g,m),m instanceof xe&&(e.gl.bindBuffer(35052,m.handle),e.gl.texImage3D(e.target,n,a,o,u,c,f,h,g,y))})),m&&m.byteLength)this._trackAllocatedMemory(m.byteLength,"Texture");else{var _=Te[this.dataFormat]||4,A=Ee[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*_*A,"Texture")}return this.loaded=!0,this}}]),r}(Be),$e=r(12),Je=r.n($e),Ke="EXT_color_buffer_float",Ze=(qe={},h()(qe,33189,{bpp:2}),h()(qe,33190,{gl2:!0,bpp:3}),h()(qe,36012,{gl2:!0,bpp:4}),h()(qe,36168,{bpp:1}),h()(qe,34041,{bpp:4}),h()(qe,35056,{gl2:!0,bpp:4}),h()(qe,36013,{gl2:!0,bpp:5}),h()(qe,32854,{bpp:2}),h()(qe,36194,{bpp:2}),h()(qe,32855,{bpp:2}),h()(qe,33321,{gl2:!0,bpp:1}),h()(qe,33330,{gl2:!0,bpp:1}),h()(qe,33329,{gl2:!0,bpp:1}),h()(qe,33332,{gl2:!0,bpp:2}),h()(qe,33331,{gl2:!0,bpp:2}),h()(qe,33334,{gl2:!0,bpp:4}),h()(qe,33333,{gl2:!0,bpp:4}),h()(qe,33323,{gl2:!0,bpp:2}),h()(qe,33336,{gl2:!0,bpp:2}),h()(qe,33335,{gl2:!0,bpp:2}),h()(qe,33338,{gl2:!0,bpp:4}),h()(qe,33337,{gl2:!0,bpp:4}),h()(qe,33340,{gl2:!0,bpp:8}),h()(qe,33339,{gl2:!0,bpp:8}),h()(qe,32849,{gl2:!0,bpp:3}),h()(qe,32856,{gl2:!0,bpp:4}),h()(qe,32857,{gl2:!0,bpp:4}),h()(qe,36220,{gl2:!0,bpp:4}),h()(qe,36238,{gl2:!0,bpp:4}),h()(qe,36975,{gl2:!0,bpp:4}),h()(qe,36214,{gl2:!0,bpp:8}),h()(qe,36232,{gl2:!0,bpp:8}),h()(qe,36226,{gl2:!0,bpp:16}),h()(qe,36208,{gl2:!0,bpp:16}),h()(qe,33325,{gl2:Ke,bpp:2}),h()(qe,33327,{gl2:Ke,bpp:4}),h()(qe,34842,{gl2:Ke,bpp:8}),h()(qe,33326,{gl2:Ke,bpp:4}),h()(qe,33328,{gl2:Ke,bpp:8}),h()(qe,34836,{gl2:Ke,bpp:16}),h()(qe,35898,{gl2:Ke,bpp:4}),qe);function tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}function er(t,e,r){var n=r[e];if(!n)return!1;var i=M(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}var rr,nr=function(t){Gt()(r,t);var e=tr(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Renderbuffer"}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=e.format;return!r||er(t,r,Ze)}},{key:"getSamplesForFormat",value:function(t,e){var r=e.format;return t.getInternalformatParameter(36161,r,32937)}}]),o()(r,[{key:"initialize",value:function(t){var e=t.format,r=t.width,n=void 0===r?1:r,i=t.height,a=void 0===i?1:i,o=t.samples,u=void 0===o?0:o;return Yt(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==u&&M(this.gl)?this.gl.renderbufferStorageMultisample(36161,u,e,n,a):this.gl.renderbufferStorage(36161,e,n,a),this.format=e,this.width=n,this.height=a,this.samples=u,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Ze[this.format].bpp),this}},{key:"resize",value:function(t){var e=t.width,r=t.height;return e!==this.width||r!==this.height?this.initialize({width:e,height:r,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(t){this.gl.bindRenderbuffer(36161,t)}},{key:"_syncHandle",value:function(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}]),r}(ie);function ir(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.framebuffer,n=void 0===r?null:r,i=e.color,a=void 0===i?null:i,o=e.depth,u=void 0===o?null:o,s=e.stencil,c=void 0===s?null:s,l={};n&&(l.framebuffer=n);var f=0;a&&(f|=16384,!0!==a&&(l.clearColor=a)),u&&(f|=256,!0!==u&&(l.clearDepth=u)),c&&(f|=1024,!0!==u&&(l.clearStencil=u)),Yt(0!==f,"clear: bad arguments"),Lt(t,l,(function(){t.clear(f)}))}function ar(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.framebuffer,n=void 0===r?null:r,i=e.buffer,a=void 0===i?6144:i,o=e.drawBuffer,u=void 0===o?0:o,s=e.value,c=void 0===s?[0,0,0,0]:s;V(t),Lt(t,{framebuffer:n},(function(){switch(a){case 6144:switch(c.constructor){case Int32Array:t.clearBufferiv(a,u,c);break;case Uint32Array:t.clearBufferuiv(a,u,c);break;case Float32Array:default:t.clearBufferfv(a,u,c)}break;case 6145:t.clearBufferfv(6145,0,[c]);break;case 6146:t.clearBufferiv(6146,0,[c]);break;case 34041:var e=at()(c,2),r=e[0],n=e[1];t.clearBufferfi(34041,0,r,n);break;default:Yt(!1,"clear: bad arguments")}}))}function or(t){switch(t){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 Yt(!1),0}}function ur(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceX,n=void 0===r?0:r,i=e.sourceY,a=void 0===i?0:i,o=e.sourceFormat,u=void 0===o?6408:o,s=e.sourceAttachment,c=void 0===s?36064:s,l=e.target,f=void 0===l?null:l,h=e.sourceWidth,d=e.sourceHeight,g=e.sourceType,v=dr(t),y=v.framebuffer,m=v.deleteFramebuffer;Yt(y);var b=y.gl,p=y.handle,_=y.attachments;h=h||y.width,d=d||y.height,36064===c&&null===p&&(c=1028),Yt(_[c]),f=gr(f,g=g||_[c].type,u,h,d),g=g||ue(f);var A=b.bindFramebuffer(36160,p);return b.readPixels(n,a,h,d,u,g,f),b.bindFramebuffer(36160,A||null),m&&y.delete(),f}function sr(t,e){var r=e.sourceX,n=void 0===r?0:r,i=e.sourceY,a=void 0===i?0:i,o=e.sourceFormat,u=void 0===o?6408:o,s=e.target,c=void 0===s?null:s,l=e.targetByteOffset,f=void 0===l?0:l,h=e.sourceWidth,d=e.sourceHeight,g=e.sourceType,v=dr(t),y=v.framebuffer,m=v.deleteFramebuffer;Yt(y),h=h||y.width,d=d||y.height;var b=V(y.gl);if(g=g||(c?c.type:5121),!c){var p=or(u),_=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Yt(!1),0}}(g);c=new xe(b,{byteLength:f+h*d*p*_,accessor:{type:g,size:p}})}return c.bind({target:35051}),Lt(b,{framebuffer:y},(function(){b.readPixels(n,a,h,d,u,g,f)})),c.unbind({target:35051}),m&&y.delete(),c}function cr(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceAttachment,n=void 0===r?36064:r,i=e.targetMaxHeight,a=void 0===i?Number.MAX_SAFE_INTEGER:i,o=ur(t,{sourceAttachment:n}),u=t.width,s=t.height;s>a;){var c=le({data:o,width:u,height:s});o=c.data,u=c.width,s=c.height}ce({data:o,width:u,height:s});var l=document.createElement("canvas");l.width=u,l.height=s;var f=l.getContext("2d"),h=f.createImageData(u,s);return h.data.set(o),f.putImageData(h,0,0),l.toDataURL()}function lr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceAttachment,n=void 0===r?36064:r,i=e.targetImage,a=void 0===i?null:i,o=cr(t,{sourceAttachment:n});return(a=a||new Image).src=o,a}function fr(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.sourceX,i=void 0===n?0:n,a=r.sourceY,o=void 0===a?0:a,u=r.targetMipmaplevel,s=void 0===u?0:u,c=r.targetInternalFormat,l=void 0===c?6408:c,f=r.targetX,h=r.targetY,d=r.targetZ,g=r.width,v=r.height,y=dr(t),m=y.framebuffer,b=y.deleteFramebuffer;Yt(m);var p=m.gl,_=m.handle,A=void 0!==f||void 0!==h||void 0!==d;f=f||0,h=h||0,d=d||0;var x=p.bindFramebuffer(36160,_);Yt(e);var w=null;if(e instanceof Be&&(w=e,g=Number.isFinite(g)?g:w.width,v=Number.isFinite(v)?v:w.height,w.bind(0),e=w.target),A)switch(e){case 3553:case 34067:p.copyTexSubImage2D(e,s,f,h,i,o,g,v);break;case 35866:case 32879:var T=V(p);T.copyTexSubImage3D(e,s,f,h,d,i,o,g,v)}else p.copyTexImage2D(e,s,l,i,o,g,v,0);return w&&w.unbind(),p.bindFramebuffer(36160,x||null),b&&m.delete(),w}function hr(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.sourceX0,i=void 0===n?0:n,a=r.sourceY0,o=void 0===a?0:a,u=r.targetX0,s=void 0===u?0:u,c=r.targetY0,l=void 0===c?0:c,f=r.color,h=void 0===f||f,d=r.depth,g=void 0!==d&&d,v=r.stencil,y=void 0!==v&&v,m=r.filter,b=void 0===m?9728:m,p=r.sourceX1,_=r.sourceY1,A=r.targetX1,x=r.targetY1,w=r.sourceAttachment,T=void 0===w?36064:w,E=r.mask,k=void 0===E?0:E,S=dr(t),O=S.framebuffer,L=S.deleteFramebuffer,F=dr(e),R=F.framebuffer,I=F.deleteFramebuffer;Yt(O),Yt(R);var B=R.gl,P=R.handle,D=R.width,N=R.height,C=R.readBuffer,M=V(B);O.handle||36064!==T||(T=1028),h&&(k|=16384),g&&(k|=256),y&&(k|=1024),(L||I)&&1280&k&&(k=16384,j.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Yt(k),p=void 0===p?O.width:p,_=void 0===_?O.height:_,A=void 0===A?D:A,x=void 0===x?N:x;var U=B.bindFramebuffer(36009,P),G=B.bindFramebuffer(36008,O.handle);return M.readBuffer(T),M.blitFramebuffer(i,o,p,_,s,l,A,x,k,b),M.readBuffer(C),M.bindFramebuffer(36008,G||null),M.bindFramebuffer(36009,U||null),L&&O.delete(),I&&R.delete(),R}function dr(t){return t instanceof kr?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:(e=t,n=e.gl,i=e.width,a=e.height,o=e.id,u=new kr(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:h()({},36064,e)})),u),deleteFramebuffer:!0};var e,r,n,i,a,o,u}function gr(t,e,r,n,i){return t||new(se(e=e||5121,{clamped:!1}))(n*i*or(r))}var vr={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};var yr=(rr={},h()(rr,vr.WEBGL2,[!1,!0]),h()(rr,vr.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),h()(rr,vr.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),h()(rr,vr.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),h()(rr,vr.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),h()(rr,vr.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),h()(rr,vr.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),h()(rr,vr.FLOAT_BLEND,["EXT_float_blend"]),h()(rr,vr.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),h()(rr,vr.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),h()(rr,vr.TEXTURE_FLOAT,["OES_texture_float",!0]),h()(rr,vr.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),h()(rr,vr.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),h()(rr,vr.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),h()(rr,vr.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),h()(rr,vr.COLOR_ATTACHMENT_RGBA32F,[function(t){var e=new Me(t,{format:6408,type:5126,dataFormat:6408}),r=new kr(t,{id:"test-framebuffer",check:!1,attachments:h()({},36064,e)}),n=r.getStatus();return e.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),h()(rr,vr.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),h()(rr,vr.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),h()(rr,vr.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),h()(rr,vr.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),h()(rr,vr.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),h()(rr,vr.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),rr);function mr(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return br(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return br(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function pr(t,e){return _r(t,e)}function _r(t,e){return(e=Array.isArray(e)?e:[e]).every((function(e){return xr(t,e)}))}function Ar(t){for(var e in t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},yr)void 0===t.luma.caps[e]&&(t.luma.caps[e]=xr(t,e));return t.luma.caps}function xr(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){var r,n=yr[e];Yt(n,e);var i=M(t)&&n[1]||n[0];if("function"==typeof i)r=i(t);else if(Array.isArray(i)){r=!0;var a,o=mr(i);try{for(o.s();!(a=o.n()).done;){var u=a.value;r=r&&Boolean(t.getExtension(u))}}catch(t){o.e(t)}finally{o.f()}}else"string"==typeof i?r=Boolean(t.getExtension(i)):"boolean"==typeof i?r=i:Yt(!1);return r}(t,e)),t.luma.caps[e]||j.log(2,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}function wr(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Tr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tr(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Er(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var kr=function(t){Gt()(r,t);var e=Er(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.ownResources=[],n.initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var t=V(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var t=V(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.colorBufferFloat,n=e.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new r(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}}]),o()(r,[{key:"initialize",value:function(t){var e=t.width,r=void 0===e?1:e,n=t.height,i=void 0===n?1:n,a=t.attachments,o=void 0===a?null:a,u=t.color,s=void 0===u||u,c=t.depth,l=void 0===c||c,f=t.stencil,h=void 0!==f&&f,d=t.check,g=void 0===d||d,v=t.readBuffer,y=void 0===v?void 0:v,m=t.drawBuffers,b=void 0===m?void 0:m;if(Yt(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,o)for(var p in o){var _=o[p];(Array.isArray(_)?_[0]:_).resize({width:r,height:i})}else o=this._createDefaultAttachments(s,l,h,r,i);this.update({clearAttachments:!0,attachments:o,readBuffer:y,drawBuffers:b}),o&&g&&this.checkStatus()}},{key:"delete",value:function(){var t,e=wr(this.ownResources);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}return Je()(Wt()(r.prototype),"delete",this).call(this),this}},{key:"update",value:function(t){var e=t.attachments,r=void 0===e?{}:e,n=t.readBuffer,i=t.drawBuffers,a=t.clearAttachments,o=void 0!==a&&a,u=t.resizeAttachments,s=void 0===u||u;this.attach(r,{clearAttachments:o,resizeAttachments:s});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),i&&this._setDrawBuffers(i),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.width,r=t.height;if(null===this.handle)return Yt(void 0===e&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===e&&(e=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),e!==this.width&&r!==this.height&&j.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:e,height:r});return this.width=e,this.height=r,this}},{key:"attach",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,a=r.resizeAttachments,o=void 0===a||a,u={};i&&Object.keys(this.attachments).forEach((function(t){u[t]=null})),Object.assign(u,t);var s=this.gl.bindFramebuffer(36160,this.handle);for(var c in u){Yt(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=u[l],h=f;if(h)if(h instanceof nr)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=at()(f,3),g=d[0],v=d[1],y=void 0===v?0:v,m=d[2],b=void 0===m?0:m;h=g,this._attachTexture({attachment:l,texture:g,layer:y,level:b})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((function(t){return!e.attachments[t]})).forEach((function(t){delete e.attachments[t]}))}},{key:"checkStatus",value:function(){this.gl;var t=this.getStatus();if(36053!==t)throw new Error(function(t){return(kr.STATUS||{})[t]||"Framebuffer error ".concat(t)}(t));return this}},{key:"getStatus",value:function(){var t=this.gl,e=t.bindFramebuffer(36160,this.handle),r=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),r}},{key:"clear",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.color,n=e.depth,i=e.stencil,a=e.drawBuffers,o=void 0===a?[]:a,u=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&ir(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(e,r){ar(t.gl,{drawBuffer:r,value:e})})),this.gl.bindFramebuffer(36160,u||null),this}},{key:"readPixels",value:function(){return j.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){return j.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){return j.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){return j.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){return j.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){return j.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(t){var e=t.attachments,r=void 0===e?[]:e,n=t.x,i=void 0===n?0:n,a=t.y,o=void 0===a?0:a,u=t.width,s=t.height,c=V(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===o&&void 0===u&&void 0===s?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,o,u,s),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(t,e,r){var n=this._getAttachmentParameterFallback(e);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=Qt(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},a=wr(n);try{for(a.s();!(t=a.n()).done;){var o=t.value,u=r?Qt(this.gl,o):o;i[u]=this.getAttachmentParameter(e,o,r)}}catch(t){a.e(t)}finally{a.f()}return i}},{key:"getParameters",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=Object.keys(this.attachments),r={},n=0,i=e;n<i.length;n++){var a=i[n],o=Number(a),u=t?Qt(this.gl,o):o;r[u]=this.getAttachmentParameters(o,t)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(cr(this),"luma-debug-texture"),this}},{key:"log",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>j.level||"undefined"==typeof window)return this;e=e||"Framebuffer ".concat(this.id);var r=cr(this,{targetMaxHeight:100});return j.image({logLevel:t,message:e,image:r},e)(),this}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?36160:e;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?36160:e;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(t,e,r,n,i){var a,o=null;t&&((o=o||{})[36064]=new Me(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},h()(a,10241,9729),h()(a,10240,9729),h()(a,10242,33071),h()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return e&&r?((o=o||{})[33306]=new nr(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):e?((o=o||{})[36096]=new nr(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&Yt(!1),o}},{key:"_unattach",value:function(t){var e=this.attachments[t];e&&(e instanceof nr?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}},{key:"_attachRenderbuffer",value:function(t){var e=t.attachment,r=void 0===e?36064:e,n=t.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(t){var e=t.attachment,r=void 0===e?36064:e,n=t.texture,i=t.layer,a=t.level,o=this.gl;switch(o.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:V(o).framebufferTextureLayer(36160,r,n.target,a,i);break;case 34067:var u=function(t){return t<34069?t+34069:t}(i);o.framebufferTexture2D(36160,r,u,n.handle,a);break;case 3553:o.framebufferTexture2D(36160,r,3553,n.handle,a);break;default:Yt(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(t){var e,r=M(e=this.gl)?e:null;r?r.readBuffer(t):Yt(36064===t||1029===t,"Multiple render targets not supported"),this.readBuffer=t}},{key:"_setDrawBuffers",value:function(t){var e=this.gl,r=V(e);if(r)r.drawBuffers(t);else{var n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Yt(1===t.length&&(36064===t[0]||1029===t[0]),"Multiple render targets not supported")}this.drawBuffers=t}},{key:"_getAttachmentParameterFallback",value:function(t){var e=Ar(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(t){return this.gl.bindFramebuffer(36160,t)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}}]),r}(ie);var Sr;function Or(t,e){Yt(t instanceof Me||t instanceof We||t instanceof Qe);var r=t.constructor,n=t.gl,i=t.width,a=t.height,o=t.format,u=t.type,s=t.dataFormat,c=t.border,l=t.mipmaps;return new r(n,Object.assign({width:i,height:a,format:o,type:u,dataFormat:s,border:c,mipmaps:l},e))}kr.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var Lr=(Sr={},h()(Sr,33902,{gl1:new Float32Array([1,1])}),h()(Sr,33901,{gl1:new Float32Array([1,1])}),h()(Sr,3379,{gl1:64,gl2:2048}),h()(Sr,34076,{gl1:16}),h()(Sr,34930,{gl1:8}),h()(Sr,35661,{gl1:8}),h()(Sr,35660,{gl1:0}),h()(Sr,34024,{gl1:1}),h()(Sr,36348,{gl1:8}),h()(Sr,34921,{gl1:8}),h()(Sr,36347,{gl1:128}),h()(Sr,36349,{gl1:16}),h()(Sr,3386,{gl1:new Int32Array([0,0])}),h()(Sr,32883,{gl1:0,gl2:256}),h()(Sr,35071,{gl1:0,gl2:256}),h()(Sr,37447,{gl1:0,gl2:0}),h()(Sr,36063,{gl1:0,gl2:4}),h()(Sr,35379,{gl1:0,gl2:0}),h()(Sr,35374,{gl1:0,gl2:0}),h()(Sr,35377,{gl1:0,gl2:0}),h()(Sr,34852,{gl1:0,gl2:4}),h()(Sr,36203,{gl1:0,gl2:0}),h()(Sr,33001,{gl1:0,gl2:0}),h()(Sr,33e3,{gl1:0,gl2:0}),h()(Sr,37157,{gl1:0,gl2:0}),h()(Sr,35373,{gl1:0,gl2:0}),h()(Sr,35657,{gl1:0,gl2:0}),h()(Sr,36183,{gl1:0,gl2:0}),h()(Sr,37137,{gl1:0,gl2:0}),h()(Sr,34045,{gl1:0,gl2:0}),h()(Sr,35978,{gl1:0,gl2:0}),h()(Sr,35979,{gl1:0,gl2:0}),h()(Sr,35968,{gl1:0,gl2:0}),h()(Sr,35376,{gl1:0,gl2:0}),h()(Sr,35375,{gl1:0,gl2:0}),h()(Sr,35659,{gl1:0,gl2:0}),h()(Sr,37154,{gl1:0,gl2:0}),h()(Sr,35371,{gl1:0,gl2:0}),h()(Sr,35658,{gl1:0,gl2:0}),h()(Sr,35076,{gl1:0,gl2:-8,negative:!0}),h()(Sr,35077,{gl1:0,gl2:7}),h()(Sr,35380,{gl1:0,gl2:0}),Sr);function Fr(t){if(t.luma=t.luma||{},!t.luma.limits){t.luma.limits={},t.luma.webgl1MinLimits={},t.luma.webgl2MinLimits={};var e=M(t);for(var r in Lr){var n=Lr[r],i=n.gl1,a="gl2"in n?n.gl2:n.gl1,o=e?a:i,u="gl2"in n&&!e||"extension"in n&&!t.getExtension(n.extension)?o:t.getParameter(r);t.luma.limits[r]=u,t.luma.webgl1MinLimits[r]=i,t.luma.webgl2MinLimits[r]=a}}return t.luma.limits}function Rr(t){t.luma=t.luma||{};var e,r=It(t);t.luma.info||(t.luma.info=(e={},h()(e,37445,r.vendor),h()(e,37446,r.renderer),h()(e,7936,r.vendorMasked),h()(e,7937,r.rendererMasked),h()(e,7938,r.version),h()(e,35724,r.shadingLanguageVersion),e));return t.luma.info}function Ir(t){return Object.assign(It(t),{limits:Fr(t),info:Rr(t),webgl1MinLimits:t.luma.webgl1MinLimits,webgl2MinLimits:t.luma.webgl2MinLimits})}function Br(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="undefined"!=typeof window&&window.navigator||{},r=t.userAgent||e.userAgent||"",n=-1!==r.indexOf("MSIE "),i=-1!==r.indexOf("Trident/");return n||i}var Pr={};function Dr(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yr[e];if(Yt(n,e),!Br(r))return!0;if(e in Pr)return Pr[e];var i=n[0],a="#extension GL_".concat(i," : enable\nvoid main(void) {}"),o=t.createShader(35633);t.shaderSource(o,a),t.compileShader(o);var u=t.getShaderParameter(o,35713);return t.deleteShader(o),Pr[e]=u,u}function jr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=t.match(r);return n?n[1]:e}function Nr(t,e,r,n){for(var i=t.split(/\r?\n/),a={},o={},u=n||jr(e)||"(unnamed)",s="".concat(function(t){switch(t){case 35632:return"fragment";case 35633:return"vertex";default:return"unknown type"}}(r)," shader ").concat(u),c=0;c<i.length;c++){var l=i[c];if(!(l.length<=1)){var f=l.split(":"),h=f[0],d=parseInt(f[2],10);if(isNaN(d))throw new Error("GLSL compilation error in ".concat(s,": ").concat(t));"WARNING"!==h?a[d]=l:o[d]=l}}var g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",n=t.split(/\r?\n/),i=String(n.length+e-1).length;return n.map((function(t,n){var a=String(n+e),o=a.length;return Mr(a,i-o)+r+t}))}(e);return{shaderName:s,errors:Cr(a,g),warnings:Cr(o,g)}}function Cr(t,e){for(var r="",n=0;n<e.length;n++){var i=e[n];if((t[n+3]||t[n+2]||t[n+1])&&(r+="".concat(i,"\n"),t[n+1])){var a=t[n+1],o=a.split(":",3),u=o[0],s=parseInt(o[1],10)||0,c=a.substring(o.join(":").length+1).trim();r+=Mr("^^^ ".concat(u,": ").concat(c,"\n\n"),s)}}return r}function Mr(t,e){for(var r="",n=0;n<e;++n)r+=" ";return"".concat(r).concat(t)}function Ur(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Vr,Gr,zr=function(t){Gt()(r,t);var e=Ur(r);function r(t,n){var a;i()(this,r),U(t),Yt("string"==typeof n.source,"Shader: GLSL source code must be a JavaScript string");var o=jr(n.source,null)||n.id||Jt("unnamed ".concat(r.getTypeName(n.shaderType)));return(a=e.call(this,t,{id:o})).shaderType=n.shaderType,a.source=n.source,a.initialize(n),a}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Shader"}}],[{key:"getTypeName",value:function(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Yt(!1),"unknown"}}}]),o()(r,[{key:"initialize",value:function(t){var e=t.source,r=jr(e,null);r&&(this.id=Jt(r)),this._compile(e)}},{key:"getParameter",value:function(t){return this.gl.getShaderParameter(this.handle,t)}},{key:"toString",value:function(){return"".concat(r.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return jr(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}},{key:"_compile",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);var e=this.getParameter(35713);if(!e){var r=this.gl.getShaderInfoLog(this.handle),n=Nr(r,this.source,this.shaderType,this.id),i=n.shaderName,a=n.errors,o=n.warnings;throw j.error("GLSL compilation errors in ".concat(i,"\n").concat(a))(),j.warn("GLSL compilation warnings in ".concat(i,"\n").concat(o))(),new Error("GLSL compilation errors in ".concat(i))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),r}(ie),Hr=function(t){Gt()(r,t);var e=Ur(r);function r(t,n){return i()(this,r),"string"==typeof n&&(n={source:n}),e.call(this,t,Object.assign({},n,{shaderType:35633}))}return o()(r,[{key:Symbol.toStringTag,get:function(){return"VertexShader"}}]),o()(r,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),r}(zr),Xr=function(t){Gt()(r,t);var e=Ur(r);function r(t,n){return i()(this,r),"string"==typeof n&&(n={source:n}),e.call(this,t,Object.assign({},n,{shaderType:35632}))}return o()(r,[{key:Symbol.toStringTag,get:function(){return"FragmentShader"}}]),o()(r,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),r}(zr),Wr=(Vr={},h()(Vr,5126,sn.bind(null,"uniform1fv",Kr,1,cn)),h()(Vr,35664,sn.bind(null,"uniform2fv",Kr,2,cn)),h()(Vr,35665,sn.bind(null,"uniform3fv",Kr,3,cn)),h()(Vr,35666,sn.bind(null,"uniform4fv",Kr,4,cn)),h()(Vr,5124,sn.bind(null,"uniform1iv",Zr,1,cn)),h()(Vr,35667,sn.bind(null,"uniform2iv",Zr,2,cn)),h()(Vr,35668,sn.bind(null,"uniform3iv",Zr,3,cn)),h()(Vr,35669,sn.bind(null,"uniform4iv",Zr,4,cn)),h()(Vr,35670,sn.bind(null,"uniform1iv",Zr,1,cn)),h()(Vr,35671,sn.bind(null,"uniform2iv",Zr,2,cn)),h()(Vr,35672,sn.bind(null,"uniform3iv",Zr,3,cn)),h()(Vr,35673,sn.bind(null,"uniform4iv",Zr,4,cn)),h()(Vr,35674,sn.bind(null,"uniformMatrix2fv",Kr,4,ln)),h()(Vr,35675,sn.bind(null,"uniformMatrix3fv",Kr,9,ln)),h()(Vr,35676,sn.bind(null,"uniformMatrix4fv",Kr,16,ln)),h()(Vr,35678,un),h()(Vr,35680,un),h()(Vr,5125,sn.bind(null,"uniform1uiv",tn,1,cn)),h()(Vr,36294,sn.bind(null,"uniform2uiv",tn,2,cn)),h()(Vr,36295,sn.bind(null,"uniform3uiv",tn,3,cn)),h()(Vr,36296,sn.bind(null,"uniform4uiv",tn,4,cn)),h()(Vr,35685,sn.bind(null,"uniformMatrix2x3fv",Kr,6,ln)),h()(Vr,35686,sn.bind(null,"uniformMatrix2x4fv",Kr,8,ln)),h()(Vr,35687,sn.bind(null,"uniformMatrix3x2fv",Kr,6,ln)),h()(Vr,35688,sn.bind(null,"uniformMatrix3x4fv",Kr,12,ln)),h()(Vr,35689,sn.bind(null,"uniformMatrix4x2fv",Kr,8,ln)),h()(Vr,35690,sn.bind(null,"uniformMatrix4x3fv",Kr,12,ln)),h()(Vr,35678,un),h()(Vr,35680,un),h()(Vr,35679,un),h()(Vr,35682,un),h()(Vr,36289,un),h()(Vr,36292,un),h()(Vr,36293,un),h()(Vr,36298,un),h()(Vr,36299,un),h()(Vr,36300,un),h()(Vr,36303,un),h()(Vr,36306,un),h()(Vr,36307,un),h()(Vr,36308,un),h()(Vr,36311,un),Vr),Yr={},qr={},Qr={},$r=[0];function Jr(t,e,r,n){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&($r[0]=t,t=$r);var i=t.length;if(i%e&&j.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof r)return t;var a=n[i];a||(a=new r(i),n[i]=a);for(var o=0;o<i;o++)a[o]=t[o];return a}function Kr(t,e){return Jr(t,e,Float32Array,Yr)}function Zr(t,e){return Jr(t,e,Int32Array,qr)}function tn(t,e){return Jr(t,e,Uint32Array,Qr)}function en(t,e,r){var n=Wr[r.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(r.type));return n().bind(null,t,e)}function rn(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};var e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function nn(t,e,r){for(var n in t){var i=t[n];if((!r||Boolean(r[n]))&&!an(i))throw e=e?"".concat(e," "):"",console.error("".concat(e," Bad uniform ").concat(n),i),new Error("".concat(e," Bad uniform ").concat(n))}return!0}function an(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;for(var e=Math.min(t.length,16),r=0;r<e;++r)if(!Number.isFinite(t[r]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof Be||(t instanceof nr||t instanceof kr&&Boolean(t.texture))))}function on(t,e,r){if(Array.isArray(r)||ArrayBuffer.isView(r))if(t[e])for(var n=t[e],i=0,a=r.length;i<a;++i)n[i]=r[i];else t[e]=r.slice();else t[e]=r}function un(){var t=null;return function(e,r,n){var i=t!==n;return i&&(e.uniform1i(r,n),t=n),i}}function sn(t,e,r,n){var i=null,a=null;return function(o,u,s){var c=e(s,r),l=c.length,f=!1;if(null===i)i=new Float32Array(l),a=l,f=!0;else{Yt(a===l,"Uniform length cannot change.");for(var h=0;h<l;++h)if(c[h]!==i[h]){f=!0;break}}return f&&(n(o,t,u,c),i.set(c)),f}}function cn(t,e,r,n){t[e](r,n)}function ln(t,e,r,n){t[e](r,!1,n)}var fn=(Gr={},h()(Gr,5126,[5126,1,"float"]),h()(Gr,35664,[5126,2,"vec2"]),h()(Gr,35665,[5126,3,"vec3"]),h()(Gr,35666,[5126,4,"vec4"]),h()(Gr,5124,[5124,1,"int"]),h()(Gr,35667,[5124,2,"ivec2"]),h()(Gr,35668,[5124,3,"ivec3"]),h()(Gr,35669,[5124,4,"ivec4"]),h()(Gr,5125,[5125,1,"uint"]),h()(Gr,36294,[5125,2,"uvec2"]),h()(Gr,36295,[5125,3,"uvec3"]),h()(Gr,36296,[5125,4,"uvec4"]),h()(Gr,35670,[5126,1,"bool"]),h()(Gr,35671,[5126,2,"bvec2"]),h()(Gr,35672,[5126,3,"bvec3"]),h()(Gr,35673,[5126,4,"bvec4"]),h()(Gr,35674,[5126,8,"mat2"]),h()(Gr,35685,[5126,8,"mat2x3"]),h()(Gr,35686,[5126,8,"mat2x4"]),h()(Gr,35675,[5126,12,"mat3"]),h()(Gr,35687,[5126,12,"mat3x2"]),h()(Gr,35688,[5126,12,"mat3x4"]),h()(Gr,35676,[5126,16,"mat4"]),h()(Gr,35689,[5126,16,"mat4x2"]),h()(Gr,35690,[5126,16,"mat4x3"]),Gr);function hn(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Yt(!1),0}}function dn(t){var e=fn[t];if(!e)return null;var r=at()(e,2);return{type:r[0],components:r[1]}}function gn(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=5126}for(var r in fn){var n=at()(fn[r],3),i=n[0],a=n[1],o=n[2];if(i===t&&a===e)return{glType:r,name:o}}return null}var vn=function(){function t(e){i()(this,t),this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}return o()(t,[{key:"getAttributeInfo",value:function(t){var e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}},{key:"getAttributeLocation",value:function(t){var e=this.getAttributeInfo(t);return e?e.location:-1}},{key:"getAttributeAccessor",value:function(t){var e=this.getAttributeInfo(t);return e?e.accessor:null}},{key:"getVaryingInfo",value:function(t){var e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}},{key:"getVaryingIndex",value:function(t){var e=this.getVaryingInfo();return e?e.location:-1}},{key:"getVaryingAccessor",value:function(t){var e=this.getVaryingInfo();return e?e.accessor:null}},{key:"_readAttributesFromProgram",value:function(t){for(var e=t.gl,r=e.getProgramParameter(t.handle,35721),n=0;n<r;n++){var i=e.getActiveAttrib(t.handle,n),a=i.name,o=i.type,u=i.size,s=e.getAttribLocation(t.handle,a);s>=0&&this._addAttribute(s,a,o,u)}this.attributeInfos.sort((function(t,e){return t.location-e.location}))}},{key:"_readVaryingsFromProgram",value:function(t){var e=t.gl;if(M(e)){for(var r=e.getProgramParameter(t.handle,35971),n=0;n<r;n++){var i=e.getTransformFeedbackVarying(t.handle,n),a=i.name,o=i.type,u=i.size;this._addVarying(n,a,o,u)}this.varyingInfos.sort((function(t,e){return t.location-e.location}))}}},{key:"_addAttribute",value:function(t,e,r,n){var i=dn(r),a={type:i.type,size:n*i.components};this._inferProperties(t,e,a);var o={location:t,name:e,accessor:new ge(a)};this.attributeInfos.push(o),this.attributeInfosByLocation[t]=o,this.attributeInfosByName[o.name]=o}},{key:"_inferProperties",value:function(t,e,r){/instance/i.test(e)&&(r.divisor=1)}},{key:"_addVarying",value:function(t,e,r,n){var i=dn(r),a=i.type,o=i.components,u={location:t,name:e,accessor:new ge({type:a,size:n*o})};this.varyingInfos.push(u),this.varyingInfosByName[u.name]=u}}]),t}();function yn(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return mn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var pn=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"],_n=function(t){Gt()(r,t);var e=bn(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).stubRemovedMethods("Program","v6.0",pn),n._isCached=!1,n.initialize(a),Object.seal(Ut()(n)),n._setId(a.id),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Program"}}]),o()(r,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.hash,r=t.vs,n=t.fs,i=t.varyings,a=t.bufferMode,o=void 0===a?35981:a;return this.hash=e||"",this.vs="string"==typeof r?new Hr(this.gl,{id:"".concat(t.id,"-vs"),source:r}):r,this.fs="string"==typeof n?new Xr(this.gl,{id:"".concat(t.id,"-fs"),source:n}):n,Yt(this.vs instanceof Hr),Yt(this.fs instanceof Xr),this.uniforms={},this._textureUniforms={},i&&i.length>0&&(V(this.gl),this.varyings=i,this.gl2.transformFeedbackVaryings(this.handle,i,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new vn(this),this.setProps(t)}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Je()(Wt()(r.prototype),"delete",this).call(this,t)}},{key:"setProps",value:function(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}},{key:"draw",value:function(t){var e=this,r=t.logPriority,n=t.drawMode,i=void 0===n?4:n,a=t.vertexCount,o=t.offset,u=void 0===o?0:o,s=t.start,c=t.end,l=t.isIndexed,f=void 0!==l&&l,h=t.indexType,d=void 0===h?5123:h,g=t.instanceCount,v=void 0===g?0:g,y=t.isInstanced,m=void 0===y?v>0:y,b=t.vertexArray,p=void 0===b?null:b,_=t.transformFeedback,A=t.framebuffer,x=t.parameters,w=void 0===x?{}:x,T=t.uniforms,E=t.samplers;if((T||E)&&(j.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(T||{})),j.priority>=r){var k=A?A.id:"default",S="mode=".concat(Qt(this.gl,i)," verts=").concat(a," ")+"instances=".concat(v," indexType=").concat(Qt(this.gl,d)," ")+"isInstanced=".concat(m," isIndexed=").concat(f," ")+"Framebuffer=".concat(k);j.log(r,S)()}return Yt(p),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===a||m&&0===v)&&(p.bindForDraw(a,v,(function(){if(void 0!==A&&(w=Object.assign({},w,{framebuffer:A})),_){var t=hn(i);_.begin(t)}e._bindTextures(),Lt(e.gl,w,(function(){f&&m?e.gl2.drawElementsInstanced(i,a,d,u,v):f&&M(e.gl)&&!isNaN(s)&&!isNaN(c)?e.gl2.drawRangeElements(i,s,c,a,d,u):f?e.gl.drawElements(i,a,d,u):m?e.gl2.drawArraysInstanced(i,u,a,v):e.gl.drawArrays(i,u,a)})),_&&_.end()})),!0)}},{key:"setUniforms",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in j.priority>=2&&nn(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle),t){var r=t[e],n=this._uniformSetters[e];if(n){var i=r,a=!1;if(i instanceof kr&&(i=i.texture),i instanceof Be)if(a=this.uniforms[e]!==r){void 0===n.textureIndex&&(n.textureIndex=this._textureIndexCounter++);var o=i,u=n.textureIndex;o.bind(u),i=u,this._textureUniforms[e]=o}else i=n.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(n(i)||a)&&on(this.uniforms,e,r)}}return this}},{key:"_areTexturesRenderable",value:function(){var t=!0;for(var e in this._textureUniforms){var r=this._textureUniforms[e];r.update(),t=t&&r.loaded}return t}},{key:"_bindTextures",value:function(){for(var t in this._textureUniforms){var e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(t){var e,r={},n=yn(this.gl.getAttachedShaders(t));try{for(n.s();!(e=n.n()).done;){var i=e.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:r.vs=new Hr({handle:i});break;case 35632:r.fs=new Xr({handle:i})}}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"_getParameter",value:function(t){return this.gl.getProgramParameter(this.handle,t)}},{key:"_setId",value:function(t){if(!t){var e=this._getName();this.id=Jt(e)}}},{key:"_getName",value:function(){var t=this.vs.getName()||this.fs.getName();return t=(t=t.replace(/shader/i,""))?"".concat(t,"-program"):"program"}},{key:"_compileAndLink",value:function(){var t=this.gl;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),j.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),j.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||j.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var t=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var e=0;e<this._uniformCount;e++){var r=this.gl.getActiveUniform(this.handle,e),n=rn(r.name).name,i=t.getUniformLocation(this.handle,n);if(this._uniformSetters[n]=en(t,i,r),r.size>1)for(var a=0;a<r.size;a++)i=t.getUniformLocation(this.handle,"".concat(n,"[").concat(a,"]")),this._uniformSetters["".concat(n,"[").concat(a,"]")]=en(t,i,r)}this._textureIndexCounter=0}},{key:"getActiveUniforms",value:function(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}},{key:"getUniformBlockIndex",value:function(t){return this.gl2.getUniformBlockIndex(this.handle,t)}},{key:"getActiveUniformBlockParameter",value:function(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}},{key:"uniformBlockBinding",value:function(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}]),r}(ie);function An(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return xn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Tn=function(t){Gt()(r,t);var e=wn(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Query"}}],[{key:"isSupported",value:function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=M(t),i=_r(t,vr.TIMER_QUERY),a=n||i,o=An(r);try{for(o.s();!(e=o.n()).done;){var u=e.value;switch(u){case"queries":a=a&&n;break;case"timers":a=a&&i;break;default:Yt(!1)}}}catch(t){o.e(t)}finally{o.f()}return a}}]),o()(r,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.conservative,r=void 0!==e&&e;return this.begin(r?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}},{key:"end",value:function(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}},{key:"isTimerDisjoint",value:function(){return this.gl2.getParameter(36795)}},{key:"getResult",value:function(){return this.gl2.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var r=0;return this._pollingPromise=new Promise((function(n,i){requestAnimationFrame((function a(){t.isResultAvailable()?(n(t.getResult()),t._pollingPromise=null):r++>e?(i("Timed out"),t._pollingPromise=null):requestAnimationFrame(a)}))})),this._pollingPromise}},{key:"_createHandle",value:function(){return r.isSupported(this.gl)?this.gl2.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl2.deleteQuery(this.handle)}}]),r}(ie);function En(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var kn=function(t){Gt()(r,t);var e=En(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),V(t),(n=e.call(this,t,a)).initialize(a),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"TransformFeedback"}}],[{key:"isSupported",value:function(t){return M(t)}}]),o()(r,[{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Zt(this.buffers)||this.bind((function(){return t._unbindBuffers()})),this.setProps(e),this}},{key:"setProps",value:function(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}},{key:"setBuffers",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind((function(){for(var r in e)t.setBuffer(r,e[r])})),this}},{key:"setBuffer",value:function(t,e){var r=this,n=this._getVaryingIndex(t),i=this._getBufferParams(e),a=i.buffer,o=i.byteSize,u=i.byteOffset;return n<0?(this.unused[t]=a,j.warn((function(){return"".concat(r.id," unused varying buffer ").concat(t)}))(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,a,u,o),this)}},{key:"begin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(t){var e,r,n;return t instanceof xe==!1?(n=t.buffer,r=t.byteSize,e=t.byteOffset):n=t,void 0===e&&void 0===r||(e=e||0,r=r||n.byteLength-e),{buffer:n,byteOffset:e,byteSize:r}}},{key:"_getVaryingInfo",value:function(t){return this.configuration&&this.configuration.getVaryingInfo(t)}},{key:"_getVaryingIndex",value:function(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;var e=Number(t);return Number.isFinite(e)?e:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var t in this.buffers){var e=this._getBufferParams(this.buffers[t]),r=e.buffer,n=e.byteSize,i=e.byteOffset;this._bindBuffer(t,r,i,n)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var t in this.buffers)this._bindBuffer(t,null)}},{key:"_bindBuffer",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,i=e&&e.handle;return i&&void 0!==n?this.gl.bindBufferRange(35982,t,i,r,n):this.gl.bindBufferBase(35982,t,i),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(t){this.gl.bindTransformFeedback(36386,this.handle)}}]),r}(ie),Sn=null;function On(t,e){var r;return new t((r=t.BYTES_PER_ELEMENT*e,(!Sn||Sn.byteLength<r)&&(Sn=new ArrayBuffer(r)),Sn),0,e)}var Ln=r(15);function Fn(t){if(!t&&!Object(d.a)())return"Node";if(Object(Ln.a)(t))return"Electron";var e="undefined"!=typeof navigator?navigator:{},r=t||e.userAgent||"";if(r.indexOf("Edge")>-1)return"Edge";var n=-1!==r.indexOf("MSIE "),i=-1!==r.indexOf("Trident/");return n||i?"IE":T.b.chrome?"Chrome":T.b.safari?"Safari":T.b.mozInnerScreenX?"Firefox":"Unknown"}function Rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var In="elements must be GL.ELEMENT_ARRAY_BUFFER",Bn=function(t){Gt()(r,t);var e=Rn(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,r);var o=a.id||a.program&&a.program.id;return(n=e.call(this,t,Object.assign({},a,{id:o}))).buffer=null,n.bufferValue=null,n.isDefaultArray=a.isDefaultArray||!1,n.gl2=t,n.initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"VertexArrayObject"}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!e.constantAttributeZero||(M(t)||"Chrome"===Fn())}},{key:"getDefaultArray",value:function(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new r(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(t){return r.MAX_ATTRIBUTES=r.MAX_ATTRIBUTES||t.getParameter(34921),r.MAX_ATTRIBUTES}},{key:"setConstant",value:function(t,e,n){switch(n.constructor){case Float32Array:r._setConstantFloatArray(t,e,n);break;case Int32Array:r._setConstantIntArray(t,e,n);break;case Uint32Array:r._setConstantUintArray(t,e,n);break;default:Yt(!1)}}}]),o()(r,[{key:"delete",value:function(){return Je()(Wt()(r.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete(),this}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}},{key:"setProps",value:function(t){return this}},{key:"setElementBuffer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Yt(!e||34963===e.target,In),this.bind((function(){t.gl.bindBuffer(34963,e?e.handle:null)})),this}},{key:"setBuffer",value:function(t,e,r){if(34963===e.target)return this.setElementBuffer(e,r);var n=r.size,i=r.type,a=r.stride,o=r.offset,u=r.normalized,s=r.integer,c=r.divisor,l=this.gl,f=this.gl2;return t=Number(t),this.bind((function(){l.bindBuffer(34962,e.handle),s?(Yt(M(l)),f.vertexAttribIPointer(t,n,i,a,o)):l.vertexAttribPointer(t,n,i,u,a,o),l.enableVertexAttribArray(t),f.vertexAttribDivisor(t,c||0)})),this}},{key:"enable",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!n&&0===t&&!r.isSupported(this.gl,{constantAttributeZero:!0});return i||(t=Number(t),this.bind((function(){return n?e.gl.enableVertexAttribArray(t):e.gl.disableVertexAttribArray(t)}))),this}},{key:"getConstantBuffer",value:function(t,e){var r=this._normalizeConstantArrayValue(e),n=r.byteLength*t,i=r.length*t,a=!this.buffer;if(this.buffer=this.buffer||new xe(this.gl,n),a=(a=a||this.buffer.reallocate(n))||!this._compareConstantArrayValues(r,this.bufferValue)){var o=On(e.constructor,i);!function(t){for(var e=t.target,r=t.source,n=t.start,i=void 0===n?0:n,a=t.count,o=void 0===a?1:a,u=r.length,s=o*u,c=0,l=i;c<u;c++)e[l++]=r[c];for(;c<s;)c<s-c?(e.copyWithin(i+c,i,i+c),c*=2):(e.copyWithin(i+c,i,i+s-c),c=s)}({target:o,source:r,start:0,count:i}),this.buffer.subData(o),this.bufferValue=e}return this.buffer}},{key:"_normalizeConstantArrayValue",value:function(t){return Array.isArray(t)?new Float32Array(t):t}},{key:"_compareConstantArrayValues",value:function(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}},{key:"_createHandle",value:function(){return this.gl.createVertexArray()}},{key:"_deleteHandle",value:function(t){return this.gl2.deleteVertexArray(t),[this.elements]}},{key:"_bindHandle",value:function(t){this.gl2.bindVertexArray(t)}},{key:"_getParameter",value:function(t,e){var r=this,n=e.location;return Yt(Number.isFinite(n)),this.bind((function(){switch(t){case 34373:return r.gl.getVertexAttribOffset(n,t);default:return r.gl.getVertexAttrib(n,t)}}))}},{key:"MAX_ATTRIBUTES",get:function(){return r.getMaxAttributes(this.gl)}}],[{key:"_setConstantFloatArray",value:function(t,e,r){switch(r.length){case 1:t.vertexAttrib1fv(e,r);break;case 2:t.vertexAttrib2fv(e,r);break;case 3:t.vertexAttrib3fv(e,r);break;case 4:t.vertexAttrib4fv(e,r);break;default:Yt(!1)}}},{key:"_setConstantIntArray",value:function(t,e,r){switch(Yt(M(t)),r.length){case 1:t.vertexAttribI1iv(e,r);break;case 2:t.vertexAttribI2iv(e,r);break;case 3:t.vertexAttribI3iv(e,r);break;case 4:t.vertexAttribI4iv(e,r);break;default:Yt(!1)}}},{key:"_setConstantUintArray",value:function(t,e,r){switch(Yt(M(t)),r.length){case 1:t.vertexAttribI1uiv(e,r);break;case 2:t.vertexAttribI2uiv(e,r);break;case 3:t.vertexAttribI3uiv(e,r);break;case 4:t.vertexAttribI4uiv(e,r);break;default:Yt(!1)}}}]),r}(ie),Pn=/^(.+)__LOCATION_([0-9]+)$/,Dn=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],jn=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t);var n=r.id||r.program&&r.program.id;this.id=n,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Bn(e),te(this,"VertexArray","v6.0",Dn),this.initialize(r),Object.seal(this)}return o()(t,[{key:"delete",value:function(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}},{key:"reset",value:function(){this.elements=null,this.elementsAccessor=null;var t=this.vertexArrayObject.MAX_ATTRIBUTES;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}},{key:"setProps",value:function(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}},{key:"clearDrawParams",value:function(){this.drawParams=null}},{key:"getDrawParams",value:function(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}},{key:"setAttributes",value:function(t){var e=this;return Object.assign(this.attributes,t),this.vertexArrayObject.bind((function(){for(var r in t){var n=t[r];e._setAttribute(r,n)}e.gl.bindBuffer(34962,null)})),this}},{key:"setElementBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}},{key:"setBuffer",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,r);var n=this._resolveLocationAndAccessor(t,e,e.accessor,r),i=n.location,a=n.accessor;return i>=0&&(this.values[i]=e,this.accessors[i]=a,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,a)),this}},{key:"setConstant",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},r)),i=n.location,a=n.accessor;return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=a,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}},{key:"unbindBuffers",value:function(){var t=this;return this.vertexArrayObject.bind((function(){t.elements&&t.vertexArrayObject.setElementBuffer(null),t.buffer=t.buffer||new xe(t.gl,{accessor:{size:4}});for(var e=0;e<t.vertexArrayObject.MAX_ATTRIBUTES;e++)t.values[e]instanceof xe&&(t.gl.disableVertexAttribArray(e),t.gl.bindBuffer(34962,t.buffer.handle),t.gl.vertexAttribPointer(e,1,5126,!1,0,0))})),this}},{key:"bindBuffers",value:function(){var t=this;return this.vertexArrayObject.bind((function(){t.elements&&t.setElementBuffer(t.elements);for(var e=0;e<t.vertexArrayObject.MAX_ATTRIBUTES;e++){var r=t.values[e];r instanceof xe&&t.setBuffer(e,r)}})),this}},{key:"bindForDraw",value:function(t,e,r){var n,i=this;return this.vertexArrayObject.bind((function(){i._setConstantAttributes(t,e),n=r()})),n}},{key:"_resolveLocationAndAccessor",value:function(t,e,r,n){var i=this,a={location:-1,accessor:null},o=this._getAttributeIndex(t),u=o.location,s=o.name;if(!Number.isFinite(u)||u<0)return this.unused[t]=e,j.once(3,(function(){return"unused value ".concat(t," in ").concat(i.id)}))(),a;var c=this._getAttributeInfo(s||u);if(!c)return a;var l=this.accessors[u]||{},f=ge.resolve(c.accessor,l,r,n),h=f.size,d=f.type;return Yt(Number.isFinite(h)&&Number.isFinite(d)),{location:u,accessor:f}}},{key:"_getAttributeInfo",value:function(t){return this.configuration&&this.configuration.getAttributeInfo(t)}},{key:"_getAttributeIndex",value:function(t){var e=Number(t);if(Number.isFinite(e))return{location:e};var r=Pn.exec(t),n=r?r[1]:t,i=r?Number(r[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(n)+i,name:n}:{location:-1}}},{key:"_setAttribute",value:function(t,e){if(e instanceof xe)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof xe){var r=e[0],n=e[1];this.setBuffer(t,r,n)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){var i=e;this.setConstant(t,i)}else{if(!(e.buffer instanceof xe))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");var a=e;this.setBuffer(t,a.buffer,a)}}},{key:"_setConstantAttributes",value:function(t,e){var r=Math.max(0|t,0|e),n=this.values[0];ArrayBuffer.isView(n)&&this._setConstantAttributeZero(n,r);for(var i=1;i<this.vertexArrayObject.MAX_ATTRIBUTES;i++)n=this.values[i],ArrayBuffer.isView(n)&&this._setConstantAttribute(i,n)}},{key:"_setConstantAttributeZero",value:function(t,e){if(Bn.isSupported(this.gl,{constantAttributeZero:!0}))this._setConstantAttribute(0,t);else{var r=this.vertexArrayObject.getConstantBuffer(e,t);this.vertexArrayObject.setBuffer(0,r,this.accessors[0])}}},{key:"_setConstantAttribute",value:function(t,e){Bn.setConstant(this.gl,t,e)}},{key:"_updateDrawParams",value:function(){for(var t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0},e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}},{key:"_updateDrawParamsForLocation",value:function(t,e){var r=this.values[e],n=this.accessors[e];if(r){var i=n.divisor>0;if(t.isInstanced=t.isInstanced||i,r instanceof xe){var a=r;if(i){var o=a.getVertexCount(n);t.instanceCount=Math.min(t.instanceCount,o)}else{var u=a.getVertexCount(n);t.vertexCount=Math.min(t.vertexCount,u)}}}}},{key:"setElements",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return j.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}]),t}(),Nn=function(){function t(e){var r;for(var n in i()(this,t),this.layout={},this.size=0,e)this._addUniform(n,e[n]);this.size+=(4-this.size%4)%4;var a=new Float32Array(this.size);this.typedArray=(r={},h()(r,5126,a),h()(r,5124,new Int32Array(a.buffer)),h()(r,5125,new Uint32Array(a.buffer)),r)}return o()(t,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[5126]}},{key:"getSubData",value:function(t){var e,r;if(void 0===t)e=this.data,r=0;else{var n=this.offsets[t],i=n+this.sizes[t];e=this.data.subarray(n,i),r=4*n}return{data:e,offset:r}}},{key:"setUniforms",value:function(t){for(var e in t)this._setValue(e,t[e]);return this}},{key:"_setValue",value:function(t,e){var r=this.layout[t];Yt(r,"UniformLayoutStd140 illegal argument");var n=this.typedArray[r.type];1===r.size?n[r.offset]=e:n.set(e,r.offset)}},{key:"_addUniform",value:function(t,e){var r=dn(e);Yt(r,"UniformBufferLayout illegal argument");var n=r.type,i=r.components;this.size=this._alignTo(this.size,i);var a=this.size;this.size+=i,this.layout[t]={type:n,size:i,offset:a}}},{key:"_alignTo",value:function(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}}]),t}();function Cn(t){var e=100,r=t.match(/[^\s]+/g);if(r.length>=2&&"#version"===r[0]){var n=parseInt(r[1],10);Number.isFinite(n)&&(e=n)}return e}function Mn(t,e){for(var r=e.maxElts,n=void 0===r?16:r,i=e.size,a=void 0===i?1:i,o="[",u=0;u<t.length&&u<n;++u)u>0&&(o+=",".concat(u%a==0?" ":"")),o+=Un(t[u],e);var s=t.length>n?"...":"]";return"".concat(o).concat(s)}function Un(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=1e-16,n=e.isInteger,i=void 0!==n&&n;if(Array.isArray(t)||ArrayBuffer.isView(t))return Mn(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<r)return i?"0":"0.";if(i)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);var a=t.toPrecision(2),o=a.indexOf(".0");return o===a.length-2?a.slice(0,-1):a}function Vn(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Gn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Gn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zn(t){var e=t.header,r=void 0===e?"Uniforms":e,n=t.program,i=t.uniforms,a=t.undefinedOnly,o=void 0!==a&&a;Yt(n);var u,s=n._uniformSetters,c={},l=Object.keys(s).sort(),f=0,d=Vn(l);try{for(d.s();!(u=d.n()).done;){var g=u.value;g.match(".*_.*")||g.match(".*Matrix")||Hn({table:c,header:r,uniforms:i,uniformName:g,undefinedOnly:o})&&f++}}catch(t){d.e(t)}finally{d.f()}var v,y=Vn(l);try{for(y.s();!(v=y.n()).done;){var m=v.value;m.match(".*Matrix")&&Hn({table:c,header:r,uniforms:i,uniformName:m,undefinedOnly:o})&&f++}}catch(t){y.e(t)}finally{y.f()}var b,p=Vn(l);try{for(p.s();!(b=p.n()).done;){var _=b.value;c[_]||Hn({table:c,header:r,uniforms:i,uniformName:_,undefinedOnly:o})&&f++}}catch(t){p.e(t)}finally{p.f()}var A=0,x={};if(!o)for(var w in i){var T=i[w];c[w]||(A++,x[w]=h()({Type:"NOT USED: ".concat(T)},r,Un(T)))}return{table:c,count:f,unusedTable:x,unusedCount:A}}function Hn(t){var e,r=t.table,n=t.header,i=t.uniforms,a=t.uniformName,o=t.undefinedOnly,u=i[a],s=function(t){return null!=t}(u);return(!o||!s)&&(r[a]=(e={},h()(e,n,s?Un(u):"N/A"),h()(e,"Uniform Type",s?u:"NOT PROVIDED"),e),!0)}function Xn(t){var e=t.vertexArray,r=t.header,n=void 0===r?"Attributes":r;if(!e.configuration)return{};var i={};e.elements&&(i.ELEMENT_ARRAY_BUFFER=Wn(e,e.elements,null,n));var a=e.values;for(var o in a){var u=e._getAttributeInfo(o);if(u){var s="".concat(o,": ").concat(u.name),c=e.accessors[u.location];c&&(s="".concat(o,": ").concat(Yn(u.name,c))),i[s]=Wn(e,a[o],c,n)}}return i}function Wn(t,e,r,n){var i,a,o=t.gl;if(!e)return a={},h()(a,n,"null"),h()(a,"Format ","N/A"),a;var u,s,c,l="NOT PROVIDED",f=1,d=0,g=0;if(r&&(l=r.type,f=r.size,u=-1!==(l=String(l).replace("Array","")).indexOf("nt")),e instanceof xe){var v,y,m=e,b=m.getDebugData(),p=b.data;if(s=b.changed?"*":"",c=p,d=(g=m.byteLength)/p.BYTES_PER_ELEMENT/f,r){var _=r.divisor>0;y="".concat(_?"I ":"P "," ").concat(d," (x").concat(f,"=").concat(g," bytes ").concat(Qt(o,l),")")}else u=!0,y="".concat(g," bytes");return v={},h()(v,n,"".concat(s).concat(Un(c,{size:f,isInteger:u}))),h()(v,"Format ",y),v}return c=e,f=e.length,u=-1!==(l=String(e.constructor.name).replace("Array","")).indexOf("nt"),i={},h()(i,n,"".concat(Un(c,{size:f,isInteger:u})," (constant)")),h()(i,"Format ","".concat(f,"x").concat(l," (constant)")),i}function Yn(t,e){var r=gn(e.type,e.size);return r?"".concat(t," (").concat(r.name,")"):t}function qn(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Qn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Qn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $n(t){var e,r={},n="Accessors for ".concat(t.id),i=qn(t.attributeInfos);try{for(i.s();!(e=i.n()).done;){var a=e.value;if(a){var o=Jn(a);r["in ".concat(o)]=h()({},n,JSON.stringify(a.accessor))}}}catch(t){i.e(t)}finally{i.f()}var u,s=qn(t.varyingInfos);try{for(s.s();!(u=s.n()).done;){var c=u.value;if(c){var l=Jn(c);r["out ".concat(l)]=h()({},n,JSON.stringify(c.accessor))}}}catch(t){s.e(t)}finally{s.f()}return r}function Jn(t){var e=t.accessor,r=gn(e.type,e.size);return r?"".concat(r.name," ").concat(t.name):t.name}},,function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return o}));var n=r(8),i=r.n(n),a=r(21);function o(){return!("object"===(void 0===t?"undefined":i()(t))&&"[object process]"===String(t)&&!t.browser)||Object(a.a)()}}).call(this,r(11))}])}));
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e,r){var n=r(27),i=r(28),a=r(19),o=r(29);t.exports=function(t){return n(t)||i(t)||a(t)||o()}},function(t,e,r){var n=r(20);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e,r){var n=r(8),i=r(7);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?i(t):e}},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=r(32),i=r(33),a=r(19),o=r(34);t.exports=function(t,e){return n(t)||i(t,e)||a(t,e)||o()}},function(t,e,r){"use strict";(function(t,n){r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return u}));var i=r(8),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document,process:"object"===(void 0===n?"undefined":r.n(i)()(n))&&n},o=a.window||a.self||a.global,u=a.process||{};console}).call(this,r(30),r(11))},function(t,e){var r,n,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var s,c=[],l=!1,f=-1;function h(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=u(h);l=!0;for(var e=c.length;e;){for(s=c,c=[];++f<e;)s&&s[f].run();f=-1,e=c.length}s=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new g(t,e)),1!==c.length||l||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){var n=r(37);function i(e,r,a){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,r){var i=n(t,e);if(i){var a=Object.getOwnPropertyDescriptor(i,e);return a.get?a.get.call(r):a.value}},i(e,r,a||e)}t.exports=i},function(t,e,r){"use strict";(function(t){function n(){var e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if(void 0!==t&&t.hrtime){var r=t.hrtime();e=1e3*r[0]+r[1]/1e6}else e=Date.now();return e}r.d(e,"a",(function(){return n}))}).call(this,r(11))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return o}));var n=r(8),i=r.n(n),a=r(15);function o(){return!("object"===(void 0===t?"undefined":i()(t))&&"[object process]"===String(t)&&!t.browser)||Object(a.a)()}}).call(this,r(11))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return a}));var n=r(8),i=r.n(n);function a(e){if("undefined"!=typeof window&&"object"===i()(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"===i()(t.versions)&&Boolean(t.versions.electron))return!0;var r="object"===("undefined"==typeof navigator?"undefined":i()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||r;return!!(n&&n.indexOf("Electron")>=0)}}).call(this,r(11))},function(t,e,r){t.exports=r(36)},,function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e,r){var n=r(18);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return a}));var n=r(8),i=r.n(n);function a(e){if("undefined"!=typeof window&&"object"===i()(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"===i()(t.versions)&&Boolean(t.versions.electron))return!0;var r="object"===("undefined"==typeof navigator?"undefined":i()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||r;return!!(n&&n.indexOf("Electron")>=0)}}).call(this,r(11))},function(t,e,r){var n=r(20),i=r(35);function a(e,r,o){return i()?t.exports=a=Reflect.construct:t.exports=a=function(t,e,r){var i=[null];i.push.apply(i,e);var a=new(Function.bind.apply(t,i));return r&&n(a,r.prototype),a},a.apply(null,arguments)}t.exports=a},function(t,e){function r(t,e,r,n,i,a,o){try{var u=t[a](o),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,a){var o=t.apply(e,n);function u(t){r(o,i,a,u,s,"next",t)}function s(t){r(o,i,a,u,s,"throw",t)}u(void 0)}))}}},function(t,e,r){var n=r(38);globalThis.luma=globalThis.luma||{},t.exports=Object.assign(globalThis.luma,n)},,,function(t,e,r){var n=r(18);t.exports=function(t){if(Array.isArray(t))return n(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,u=t[Symbol.iterator]();!(n=(o=u.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(i)throw a}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),o=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var u=_(o,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,o),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function f(){}function h(){}function d(){}var g={};g[i]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(T([])));y&&y!==e&&r.call(y,i)&&(g=y);var m=d.prototype=f.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function p(t,e){var n;this._invoke=function(i,a){function o(){return new e((function(n,o){!function n(i,a,o,u){var s=c(t[i],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,o,u)}),(function(t){n("throw",t,o,u)})):e.resolve(f).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,u)}))}u(s.arg)}(i,a,n,o)}))}return n=n?n.then(o,o):o()}}function _(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function T(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=m.constructor=d,d.constructor=h,h.displayName=u(d,o,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,o,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(p.prototype),p.prototype[a]=function(){return this},t.AsyncIterator=p,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var o=new p(s(e,r,n,i),a);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},b(m),u(m,o,"Generator"),m[i]=function(){return this},m.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,w.prototype={constructor:w,reset:function(t){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(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n=r(3);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}},function(t,e,r){"use strict";r.r(e),r.d(e,"lumaStats",(function(){return jt})),r.d(e,"requestAnimationFrame",(function(){return Nt})),r.d(e,"cancelAnimationFrame",(function(){return Ct})),r.d(e,"cloneTextureFrom",(function(){return Or})),r.d(e,"getKeyValue",(function(){return qt})),r.d(e,"getKey",(function(){return Qt})),r.d(e,"getContextInfo",(function(){return Ir})),r.d(e,"getGLContextInfo",(function(){return Rr})),r.d(e,"getContextLimits",(function(){return Fr})),r.d(e,"FEATURES",(function(){return vr})),r.d(e,"hasFeature",(function(){return pr})),r.d(e,"hasFeatures",(function(){return _r})),r.d(e,"getFeatures",(function(){return Ar})),r.d(e,"canCompileGLGSExtension",(function(){return Dr})),r.d(e,"Accessor",(function(){return ge})),r.d(e,"Buffer",(function(){return xe})),r.d(e,"Shader",(function(){return zr})),r.d(e,"VertexShader",(function(){return Hr})),r.d(e,"FragmentShader",(function(){return Xr})),r.d(e,"Program",(function(){return _n})),r.d(e,"Framebuffer",(function(){return kr})),r.d(e,"Renderbuffer",(function(){return nr})),r.d(e,"Texture2D",(function(){return Me})),r.d(e,"TextureCube",(function(){return We})),r.d(e,"clear",(function(){return ir})),r.d(e,"clearBuffer",(function(){return ar})),r.d(e,"readPixelsToArray",(function(){return ur})),r.d(e,"readPixelsToBuffer",(function(){return sr})),r.d(e,"copyToDataUrl",(function(){return cr})),r.d(e,"copyToImage",(function(){return lr})),r.d(e,"copyToTexture",(function(){return fr})),r.d(e,"blit",(function(){return hr})),r.d(e,"Query",(function(){return Tn})),r.d(e,"Texture3D",(function(){return Qe})),r.d(e,"TransformFeedback",(function(){return kn})),r.d(e,"VertexArrayObject",(function(){return Bn})),r.d(e,"VertexArray",(function(){return jn})),r.d(e,"UniformBufferLayout",(function(){return Nn})),r.d(e,"setPathPrefix",(function(){return De})),r.d(e,"loadFile",(function(){return je})),r.d(e,"loadImage",(function(){return Ne})),r.d(e,"getShaderName",(function(){return jr})),r.d(e,"getShaderVersion",(function(){return Cn})),r.d(e,"log",(function(){return j})),r.d(e,"assert",(function(){return Yt})),r.d(e,"uid",(function(){return Jt})),r.d(e,"isObjectEmpty",(function(){return Zt})),r.d(e,"parseUniformName",(function(){return rn})),r.d(e,"getUniformSetter",(function(){return en})),r.d(e,"getDebugTableForUniforms",(function(){return zn})),r.d(e,"getDebugTableForVertexArray",(function(){return Xn})),r.d(e,"getDebugTableForProgramConfiguration",(function(){return $n}));var n=r(2),i=r.n(n),a=r(1),o=r.n(a),u=r(8),s=r.n(u),c=r(4),l=r.n(c),f=r(0),h=r.n(f),d=r(14),g=Object(d.a)();function v(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}var y=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";i()(this,t),this.storage=v(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return o()(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function m(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var a=t.width*r,o=t.height*r,u=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),u]}var b={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function p(t){return"string"==typeof t?b[t.toUpperCase()]||b.WHITE:t}function _(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return A(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return A(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function x(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),a=_(i);try{var o=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(a.s();!(e=a.n()).done;)o()}catch(t){a.e(t)}finally{a.f()}}function w(t,e){if(!t)throw new Error(e||"Assertion failed")}var T=r(10);function E(){var t;if(g&&T.b.performance)t=T.b.performance.now();else if(T.a.hrtime){var e=T.a.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var k={debug:g&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},S={enabled:!0,level:0};function O(){}var L={},F={once:!0};function R(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}var I=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=e.id;i()(this,t),this.id=r,this.VERSION="8.5.12",this._startTs=E(),this._deltaTs=E(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new y("__probe-".concat(this.id,"__"),S),this.userData={},this.timeStamp("".concat(this.id," started")),x(this),Object.seal(this)}return o()(t,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((E()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((E()-this._deltaTs).toPrecision(10))}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"assert",value:function(t,e){w(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,k.warn,arguments,F)}},{key:"error",value:function(t){return this._getLogFunction(0,t,k.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,k.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,k.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){return this._getLogFunction(t,e,k.debug||k.info,arguments,F)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||O,r&&[r],{tag:R(e)}):O}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,a=t.message,o=void 0===a?"":a,u=t.scale,s=void 0===u?1:u;return this._shouldLog(e||n)?g?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,a=void 0===i?1:i;if("string"==typeof e){var o=new Image;return o.onload=function(){var t,e=m(o,n,a);(t=console).log.apply(t,l()(e))},o.src=e,O}var u=e.nodeName||"";if("img"===u.toLowerCase()){var s;return(s=console).log.apply(s,l()(m(e,n,a))),O}if("canvas"===u.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,l()(m(c,n,a)))},c.src=e.toDataURL(),O}return O}({image:i,message:o,scale:s}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,a=null;try{a=r(31)}catch(t){}if(a)return function(){return a(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return O}({image:i,message:o,scale:s}):O}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(h()({},t,e))}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||O)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=P({logLevel:t,message:e,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||O)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=B(t)}},{key:"_getLogFunction",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(t)){var a;i=P({logLevel:t,message:e,args:n,opts:i}),w(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=E();var o=i.tag||i.message;if(i.once){if(L[o])return O;L[o]=E()}return e=D(this.id,i.message,i),(a=r).bind.apply(a,[console,e].concat(l()(i.args)))}return O}},{key:"level",set:function(t){this.setLevel(t)},get:function(){return this.getLevel()}},{key:"priority",set:function(t){this.level=t},get:function(){return this.level}}]),t}();function B(t){if(!t)return 0;var e;switch(s()(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return w(Number.isFinite(e)&&e>=0),e}function P(t){var e=t.logLevel,r=t.message;t.logLevel=B(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(t.args=n,s()(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=s()(t.message);return w("string"===i||"object"===i),Object.assign(t,t.opts)}function D(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((u=r.total)<10?"".concat(u.toFixed(2),"ms"):u<100?"".concat(u.toFixed(1),"ms"):u<1e3?"".concat(u.toFixed(0),"ms"):"".concat((u/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,a=r.color,o=r.background,g||"string"!=typeof i||(a&&(a=p(a),i="[".concat(a,"m").concat(i,"[39m")),o&&(a=p(o),i="[".concat(o+10,"m").concat(i,"[49m"))),e=i}var i,a,o,u;return e}I.VERSION="8.5.12";var j=new I({id:"luma.gl"});function N(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function C(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function M(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function U(t){return N(C(t),"Invalid WebGLRenderingContext"),t}function V(t){return N(M(t),"Requires WebGL2"),t}var G={};function z(t,e){var r;G[t]=!0,void 0!==e&&(r=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var H=function t(e){var r=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new t.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};(H.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var X,W=function(t){var e=this;this.gl=t,function(t){var e=t.getError;t.getError=function(){var r;do{0!==(r=e.apply(t))&&(G[r]=!0)}while(0!==r);for(r in G)if(G[r])return delete G[r],parseInt(r,10);return 0}}(t);var r=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:r.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){var n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);var i=n.attribs[t];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){var n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);var i=n.attribs[t];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,n){switch(t){case 34962:e.currentArrayBuffer=n;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,n){var i=e.currentVertexArrayObject,a=i.attribs[t];switch(n){case 34975:return a.buffer;case 34338:return a.enabled;case 34339:return a.size;case 34340:return a.stride;case 34341:return a.type;case 34922:return a.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,n,i,a,o,u){var s=e.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,t);var c=s.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=n,c.type=i,c.normalized=a,c.stride=o,c.offset=u,c.recache(),r.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(function(){var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()}),!0),this.reset_()};W.prototype.VERTEX_ARRAY_BINDING_OES=34229,W.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;var e=this.gl;this.maxVertexAttribs=e.getParameter(34921),this.defaultVertexArrayObject=new H(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},W.prototype.createVertexArrayOES=function(){var t=new H(this);return this.vertexArrayObjects.push(t),t},W.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},W.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof H&&t.hasBeenBound&&t.ext===this)},W.prototype.bindVertexArrayOES=function(t){var e=this.gl;if(!t||t.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(e,34963,i.elementArrayBuffer);for(var a=this.currentArrayBuffer,o=Math.max(n?n.maxAttrib:0,i.maxAttrib),u=0;u<=o;u++){var s=i.attribs[u],c=n?n.attribs[u]:null;if(n&&s.enabled===c.enabled||(s.enabled?r.enableVertexAttribArray.call(e,u):r.disableVertexAttribArray.call(e,u)),s.enabled){var l=!1;n&&s.buffer===c.buffer||(a!==s.buffer&&(r.bindBuffer.call(e,34962,s.buffer),a=s.buffer),l=!0),(l||s.cached!==c.cached)&&r.vertexAttribPointer.call(e,u,s.size,s.type,s.normalized,s.stride,s.offset)}}this.currentArrayBuffer!==a&&r.bindBuffer.call(e,34962,this.currentArrayBuffer)}}else z(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var Y,q=function(t){return M(t)?void 0:0},Q=(X={},h()(X,3074,(function(t){return M(t)?void 0:36064})),h()(X,35723,(function(t){return M(t)?void 0:4352})),h()(X,35977,q),h()(X,32937,q),h()(X,36795,(function(t,e){var r=M(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?e(r.GPU_DISJOINT_EXT):0})),h()(X,37445,(function(t,e){var r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),h()(X,37446,(function(t,e){var r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),h()(X,34047,(function(t,e){var r=t.luma.extensions.EXT_texture_filter_anisotropic;return r?e(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),h()(X,32883,q),h()(X,35071,q),h()(X,37447,q),h()(X,36063,(function(t,e){if(!M(t)){var r=t.getExtension("WEBGL_draw_buffers");return r?e(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),h()(X,35379,q),h()(X,35374,q),h()(X,35377,q),h()(X,34852,(function(t){if(!M(t)){var e=t.getExtension("WEBGL_draw_buffers");return e?e.MAX_DRAW_BUFFERS_WEBGL:0}})),h()(X,36203,(function(t){return t.getExtension("OES_element_index")?2147483647:65535})),h()(X,33001,(function(t){return t.getExtension("OES_element_index")?16777216:65535})),h()(X,33e3,(function(t){return 16777216})),h()(X,37157,q),h()(X,35373,q),h()(X,35657,q),h()(X,36183,q),h()(X,37137,q),h()(X,34045,q),h()(X,35978,q),h()(X,35979,q),h()(X,35968,q),h()(X,35376,q),h()(X,35375,q),h()(X,35659,q),h()(X,37154,q),h()(X,35371,q),h()(X,35658,q),h()(X,35076,q),h()(X,35077,q),h()(X,35380,q),X);var $=(Y={},h()(Y,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){N(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),h()(Y,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,e){N(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),h()(Y,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){N(!1)}}),h()(Y,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){N(!1)},deleteQuery:function(){N(!1)},beginQuery:function(){N(!1)},endQuery:function(){},getQuery:function(t,e){return this.getQueryObject(t,e)},getQueryParameter:function(t,e){return this.getQueryObject(t,e)},getQueryObject:function(){}}),Y),J={readBuffer:function(t,e,r){M(t)&&e(r)},getVertexAttrib:function(t,e,r,n){var i,a=function(t,e){return{webgl2:M(t),ext:t.getExtension(e)}}(t,"ANGLE_instanced_arrays"),o=a.webgl2,u=a.ext;switch(n){case 35069:i=!!o&&void 0;break;case 35070:i=o||u?void 0:0}return void 0!==i?i:e(r,n)},getProgramParameter:function(t,e,r,n){if(!M(t))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return e(r,n)},getInternalformatParameter:function(t,e,r,n,i){if(!M(t))switch(i){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(r,n,i)},getTexParameter:function(t,e,r,n){switch(n){case 34046:var i=t.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(r,n)},getParameter:function(t,e,r){var n=Q[r],i="function"==typeof n?n(t,e,r):n;return void 0!==i?i:e(r)},hint:function(t,e,r,n){return e(r,n)}};function K(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tt(t,e){var r=e.extension,n=e.target,i=e.target2,a=$[r];N(a);for(var o=a.meta,u=(void 0===o?{}:o).suffix,s=void 0===u?"":u,c=t.getExtension(r),l=function(){var e=h[f],r="".concat(e).concat(s),o=null;"meta"===e||"function"==typeof t[e]||(c&&"function"==typeof c[r]?o=function(){return c[r].apply(c,arguments)}:"function"==typeof a[e]&&(o=a[e].bind(n))),o&&(n[e]=o,i[e]=o)},f=0,h=Object.keys(a);f<h.length;f++)l()}globalThis.polyfillContext=function(t){t.luma=t.luma||{};var e=t.luma;return e.polyfilled||(!function(t){if("function"!=typeof t.createVertexArray){var e=t.getSupportedExtensions;t.getSupportedExtensions=function(){var t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};var r=t.getExtension;t.getExtension=function(e){var n=r.call(this,e);return n||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new W(this)),this.__OESVertexArrayObject))}}}(t),function(t){t.luma.extensions={};var e,r=K(t.getSupportedExtensions()||[]);try{for(r.s();!(e=r.n()).done;){var n=e.value;t.luma[n]=t.getExtension(n)}}catch(t){r.e(t)}finally{r.f()}}(t),function(t,e){var r,n=K(Object.getOwnPropertyNames(e));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&tt(t,{extension:i,target:t.luma,target2:t})}}catch(t){n.e(t)}finally{n.f()}}(t,$),function(t,e){var r=e.target,n=e.target2;Object.keys(J).forEach((function(e){if("function"==typeof J[e]){var i=t[e]?t[e].bind(t):function(){},a=J[e].bind(null,t,i);r[e]=a,n[e]=a}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};var et,rt,nt,it=r(9),at=r.n(it),ot=(et={},h()(et,3042,!1),h()(et,32773,new Float32Array([0,0,0,0])),h()(et,32777,32774),h()(et,34877,32774),h()(et,32969,1),h()(et,32968,0),h()(et,32971,1),h()(et,32970,0),h()(et,3106,new Float32Array([0,0,0,0])),h()(et,3107,[!0,!0,!0,!0]),h()(et,2884,!1),h()(et,2885,1029),h()(et,2929,!1),h()(et,2931,1),h()(et,2932,513),h()(et,2928,new Float32Array([0,1])),h()(et,2930,!0),h()(et,3024,!0),h()(et,36006,null),h()(et,2886,2305),h()(et,33170,4352),h()(et,2849,1),h()(et,32823,!1),h()(et,32824,0),h()(et,10752,0),h()(et,32938,1),h()(et,32939,!1),h()(et,3089,!1),h()(et,3088,new Int32Array([0,0,1024,1024])),h()(et,2960,!1),h()(et,2961,0),h()(et,2968,4294967295),h()(et,36005,4294967295),h()(et,2962,519),h()(et,2967,0),h()(et,2963,4294967295),h()(et,34816,519),h()(et,36003,0),h()(et,36004,4294967295),h()(et,2964,7680),h()(et,2965,7680),h()(et,2966,7680),h()(et,34817,7680),h()(et,34818,7680),h()(et,34819,7680),h()(et,2978,[0,0,1024,1024]),h()(et,3333,4),h()(et,3317,4),h()(et,37440,!1),h()(et,37441,!1),h()(et,37443,37444),h()(et,35723,4352),h()(et,36010,null),h()(et,35977,!1),h()(et,3330,0),h()(et,3332,0),h()(et,3331,0),h()(et,3314,0),h()(et,32878,0),h()(et,3316,0),h()(et,3315,0),h()(et,32877,0),et),ut=function(t,e,r){return e?t.enable(r):t.disable(r)},st=function(t,e,r){return t.hint(r,e)},ct=function(t,e,r){return t.pixelStorei(r,e)};function lt(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var ft=(rt={},h()(rt,3042,ut),h()(rt,32773,(function(t,e){return t.blendColor.apply(t,l()(e))})),h()(rt,32777,"blendEquation"),h()(rt,34877,"blendEquation"),h()(rt,32969,"blendFunc"),h()(rt,32968,"blendFunc"),h()(rt,32971,"blendFunc"),h()(rt,32970,"blendFunc"),h()(rt,3106,(function(t,e){return t.clearColor.apply(t,l()(e))})),h()(rt,3107,(function(t,e){return t.colorMask.apply(t,l()(e))})),h()(rt,2884,ut),h()(rt,2885,(function(t,e){return t.cullFace(e)})),h()(rt,2929,ut),h()(rt,2931,(function(t,e){return t.clearDepth(e)})),h()(rt,2932,(function(t,e){return t.depthFunc(e)})),h()(rt,2928,(function(t,e){return t.depthRange.apply(t,l()(e))})),h()(rt,2930,(function(t,e){return t.depthMask(e)})),h()(rt,3024,ut),h()(rt,35723,st),h()(rt,36006,(function(t,e){var r=M(t)?36009:36160;return t.bindFramebuffer(r,e)})),h()(rt,2886,(function(t,e){return t.frontFace(e)})),h()(rt,33170,st),h()(rt,2849,(function(t,e){return t.lineWidth(e)})),h()(rt,32823,ut),h()(rt,32824,"polygonOffset"),h()(rt,10752,"polygonOffset"),h()(rt,35977,ut),h()(rt,32938,"sampleCoverage"),h()(rt,32939,"sampleCoverage"),h()(rt,3089,ut),h()(rt,3088,(function(t,e){return t.scissor.apply(t,l()(e))})),h()(rt,2960,ut),h()(rt,2961,(function(t,e){return t.clearStencil(e)})),h()(rt,2968,(function(t,e){return t.stencilMaskSeparate(1028,e)})),h()(rt,36005,(function(t,e){return t.stencilMaskSeparate(1029,e)})),h()(rt,2962,"stencilFuncFront"),h()(rt,2967,"stencilFuncFront"),h()(rt,2963,"stencilFuncFront"),h()(rt,34816,"stencilFuncBack"),h()(rt,36003,"stencilFuncBack"),h()(rt,36004,"stencilFuncBack"),h()(rt,2964,"stencilOpFront"),h()(rt,2965,"stencilOpFront"),h()(rt,2966,"stencilOpFront"),h()(rt,34817,"stencilOpBack"),h()(rt,34818,"stencilOpBack"),h()(rt,34819,"stencilOpBack"),h()(rt,2978,(function(t,e){return t.viewport.apply(t,l()(e))})),h()(rt,3333,ct),h()(rt,3317,ct),h()(rt,37440,ct),h()(rt,37441,ct),h()(rt,37443,ct),h()(rt,3330,ct),h()(rt,3332,ct),h()(rt,3331,ct),h()(rt,36010,(function(t,e){return t.bindFramebuffer(36008,e)})),h()(rt,3314,ct),h()(rt,32878,ct),h()(rt,3316,ct),h()(rt,3315,ct),h()(rt,32877,ct),h()(rt,"framebuffer",(function(t,e){var r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)})),h()(rt,"blend",(function(t,e){return e?t.enable(3042):t.disable(3042)})),h()(rt,"blendColor",(function(t,e){return t.blendColor.apply(t,l()(e))})),h()(rt,"blendEquation",(function(t,e){e=lt(e)?e:[e,e],t.blendEquationSeparate.apply(t,l()(e))})),h()(rt,"blendFunc",(function(t,e){e=lt(e)&&2===e.length?[].concat(l()(e),l()(e)):e,t.blendFuncSeparate.apply(t,l()(e))})),h()(rt,"clearColor",(function(t,e){return t.clearColor.apply(t,l()(e))})),h()(rt,"clearDepth",(function(t,e){return t.clearDepth(e)})),h()(rt,"clearStencil",(function(t,e){return t.clearStencil(e)})),h()(rt,"colorMask",(function(t,e){return t.colorMask.apply(t,l()(e))})),h()(rt,"cull",(function(t,e){return e?t.enable(2884):t.disable(2884)})),h()(rt,"cullFace",(function(t,e){return t.cullFace(e)})),h()(rt,"depthTest",(function(t,e){return e?t.enable(2929):t.disable(2929)})),h()(rt,"depthFunc",(function(t,e){return t.depthFunc(e)})),h()(rt,"depthMask",(function(t,e){return t.depthMask(e)})),h()(rt,"depthRange",(function(t,e){return t.depthRange.apply(t,l()(e))})),h()(rt,"dither",(function(t,e){return e?t.enable(3024):t.disable(3024)})),h()(rt,"derivativeHint",(function(t,e){t.hint(35723,e)})),h()(rt,"frontFace",(function(t,e){return t.frontFace(e)})),h()(rt,"mipmapHint",(function(t,e){return t.hint(33170,e)})),h()(rt,"lineWidth",(function(t,e){return t.lineWidth(e)})),h()(rt,"polygonOffsetFill",(function(t,e){return e?t.enable(32823):t.disable(32823)})),h()(rt,"polygonOffset",(function(t,e){return t.polygonOffset.apply(t,l()(e))})),h()(rt,"sampleCoverage",(function(t,e){return t.sampleCoverage.apply(t,l()(e))})),h()(rt,"scissorTest",(function(t,e){return e?t.enable(3089):t.disable(3089)})),h()(rt,"scissor",(function(t,e){return t.scissor.apply(t,l()(e))})),h()(rt,"stencilTest",(function(t,e){return e?t.enable(2960):t.disable(2960)})),h()(rt,"stencilMask",(function(t,e){var r=e=lt(e)?e:[e,e],n=at()(r,2),i=n[0],a=n[1];t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,a)})),h()(rt,"stencilFunc",(function(t,e){var r=e=lt(e)&&3===e.length?[].concat(l()(e),l()(e)):e,n=at()(r,6),i=n[0],a=n[1],o=n[2],u=n[3],s=n[4],c=n[5];t.stencilFuncSeparate(1028,i,a,o),t.stencilFuncSeparate(1029,u,s,c)})),h()(rt,"stencilOp",(function(t,e){var r=e=lt(e)&&3===e.length?[].concat(l()(e),l()(e)):e,n=at()(r,6),i=n[0],a=n[1],o=n[2],u=n[3],s=n[4],c=n[5];t.stencilOpSeparate(1028,i,a,o),t.stencilOpSeparate(1029,u,s,c)})),h()(rt,"viewport",(function(t,e){return t.viewport.apply(t,l()(e))})),rt);function ht(t,e,r){return void 0!==e[t]?e[t]:r[t]}var dt={blendEquation:function(t,e,r){return t.blendEquationSeparate(ht(32777,e,r),ht(34877,e,r))},blendFunc:function(t,e,r){return t.blendFuncSeparate(ht(32969,e,r),ht(32968,e,r),ht(32971,e,r),ht(32970,e,r))},polygonOffset:function(t,e,r){return t.polygonOffset(ht(32824,e,r),ht(10752,e,r))},sampleCoverage:function(t,e,r){return t.sampleCoverage(ht(32938,e,r),ht(32939,e,r))},stencilFuncFront:function(t,e,r){return t.stencilFuncSeparate(1028,ht(2962,e,r),ht(2967,e,r),ht(2963,e,r))},stencilFuncBack:function(t,e,r){return t.stencilFuncSeparate(1029,ht(34816,e,r),ht(36003,e,r),ht(36004,e,r))},stencilOpFront:function(t,e,r){return t.stencilOpSeparate(1028,ht(2964,e,r),ht(2965,e,r),ht(2966,e,r))},stencilOpBack:function(t,e,r){return t.stencilOpSeparate(1029,ht(34817,e,r),ht(34818,e,r),ht(34819,e,r))}},gt={enable:function(t,e){return t(h()({},e,!0))},disable:function(t,e){return t(h()({},e,!1))},pixelStorei:function(t,e,r){return t(h()({},e,r))},hint:function(t,e,r){return t(h()({},e,r))},bindFramebuffer:function(t,e,r){var n;switch(e){case 36160:return t((n={},h()(n,36006,r),h()(n,36010,r),n));case 36009:return t(h()({},36006,r));case 36008:return t(h()({},36010,r));default:return null}},blendColor:function(t,e,r,n,i){return t(h()({},32773,new Float32Array([e,r,n,i])))},blendEquation:function(t,e){var r;return t((r={},h()(r,32777,e),h()(r,34877,e),r))},blendEquationSeparate:function(t,e,r){var n;return t((n={},h()(n,32777,e),h()(n,34877,r),n))},blendFunc:function(t,e,r){var n;return t((n={},h()(n,32969,e),h()(n,32968,r),h()(n,32971,e),h()(n,32970,r),n))},blendFuncSeparate:function(t,e,r,n,i){var a;return t((a={},h()(a,32969,e),h()(a,32968,r),h()(a,32971,n),h()(a,32970,i),a))},clearColor:function(t,e,r,n,i){return t(h()({},3106,new Float32Array([e,r,n,i])))},clearDepth:function(t,e){return t(h()({},2931,e))},clearStencil:function(t,e){return t(h()({},2961,e))},colorMask:function(t,e,r,n,i){return t(h()({},3107,[e,r,n,i]))},cullFace:function(t,e){return t(h()({},2885,e))},depthFunc:function(t,e){return t(h()({},2932,e))},depthRange:function(t,e,r){return t(h()({},2928,new Float32Array([e,r])))},depthMask:function(t,e){return t(h()({},2930,e))},frontFace:function(t,e){return t(h()({},2886,e))},lineWidth:function(t,e){return t(h()({},2849,e))},polygonOffset:function(t,e,r){var n;return t((n={},h()(n,32824,e),h()(n,10752,r),n))},sampleCoverage:function(t,e,r){var n;return t((n={},h()(n,32938,e),h()(n,32939,r),n))},scissor:function(t,e,r,n,i){return t(h()({},3088,new Int32Array([e,r,n,i])))},stencilMask:function(t,e){var r;return t((r={},h()(r,2968,e),h()(r,36005,e),r))},stencilMaskSeparate:function(t,e,r){return t(h()({},1028===e?2968:36005,r))},stencilFunc:function(t,e,r,n){var i;return t((i={},h()(i,2962,e),h()(i,2967,r),h()(i,2963,n),h()(i,34816,e),h()(i,36003,r),h()(i,36004,n),i))},stencilFuncSeparate:function(t,e,r,n,i){var a;return t((a={},h()(a,1028===e?2962:34816,r),h()(a,1028===e?2967:36003,n),h()(a,1028===e?2963:36004,i),a))},stencilOp:function(t,e,r,n){var i;return t((i={},h()(i,2964,e),h()(i,2965,r),h()(i,2966,n),h()(i,34817,e),h()(i,34818,r),h()(i,34819,n),i))},stencilOpSeparate:function(t,e,r,n,i){var a;return t((a={},h()(a,1028===e?2964:34817,r),h()(a,1028===e?2965:34818,n),h()(a,1028===e?2966:34819,i),a))},viewport:function(t,e,r,n,i){return t(h()({},2978,[e,r,n,i]))}},vt=function(t,e){return t.isEnabled(e)},yt=(nt={},h()(nt,3042,vt),h()(nt,2884,vt),h()(nt,2929,vt),h()(nt,3024,vt),h()(nt,32823,vt),h()(nt,32926,vt),h()(nt,32928,vt),h()(nt,3089,vt),h()(nt,2960,vt),h()(nt,35977,vt),nt);function mt(t){for(var e in t)return!1;return!0}function bt(t,e){if(t===e)return!0;var r=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&n&&t.length===e.length){for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function pt(t,e){var r=t[e].bind(t);t[e]=function(){var e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:r.apply(void 0,arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function _t(t,e,r){var n=t[e].bind(t);t[e]=function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];var o=r.apply(void 0,[t.state._updateCache].concat(i)),u=o.valueChanged,s=o.oldValue;return u&&n.apply(void 0,i),s},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}function At(t){var e=t.useProgram.bind(t);t.useProgram=function(r){t.state.program!==r&&(e(r),t.state.program=r)}}var xt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,a=void 0!==n&&n,o=r.log,u=void 0===o?function(){}:o;i()(this,t),this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=a?Ot(e):Object.assign({},ot),this.log=u,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return o()(t,[{key:"push",value:function(){this.stateStack.push({})}},{key:"pop",value:function(){N(this.stateStack.length>0);var t=this.stateStack[this.stateStack.length-1];St(this.gl,t),this.stateStack.pop()}},{key:"_updateCache",value:function(t){var e,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in t){N(void 0!==i);var a=t[i],o=this.cache[i];bt(a,o)||(r=!0,e=o,n&&!(i in n)&&(n[i]=o),this.cache[i]=a)}return{valueChanged:r,oldValue:e}}}]),t}();function wt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.enable,n=void 0===r||r,i=e.copyState;if(N(void 0!==i),!t.state){var a=globalThis.polyfillContext;for(var o in a&&a(t),t.state=new xt(t,{copyState:i}),At(t),gt){var u=gt[o];_t(t,o,u)}pt(t,"getParameter"),pt(t,"isEnabled")}return t.state.enable=n,t}function Tt(t){N(t.state),t.state.pop()}function Et(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return kt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function St(t,e){if(N(C(t),"setParameters requires a WebGL context"),!mt(e)){var r={};for(var n in e){var i=Number(n),a=ft[n];a&&("string"==typeof a?r[a]=!0:a(t,e[n],i))}var o=t.state&&t.state.cache;if(o)for(var u in r){(0,dt[u])(t,e,o)}}}function Ot(t,e){if("number"==typeof(e=e||ot)){var r=e,n=yt[r];return n?n(t,r):t.getParameter(r)}var i,a={},o=Et(Array.isArray(e)?e:Object.keys(e));try{for(o.s();!(i=o.n()).done;){var u=i.value,s=yt[u];a[u]=s?s(t,Number(u)):t.getParameter(Number(u))}}catch(t){o.e(t)}finally{o.f()}return a}function Lt(t,e,r){if(mt(e))return r(t);var n,i=e.nocatch,a=void 0===i||i;if(function(t){t.state||wt(t,{copyState:!1}),t.state.push()}(t),St(t,e),a)n=r(t),Tt(t);else try{n=r(t)}finally{Tt(t)}return n}var Ft=r(40);var Rt=Object(Ft.a)();function It(t){var e=t.getParameter(7936),r=t.getParameter(7937),n=t.getExtension("WEBGL_debug_renderer_info");return{vendor:n&&t.getParameter(n.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:n&&t.getParameter(n.UNMASKED_RENDERER_WEBGL||7937)||r,vendorMasked:e,rendererMasked:r,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}var Bt=r(13),Pt=function(){function t(e,r){i()(this,t),this.name=e,this.type=r,this.sampleSize=1,this.reset()}return o()(t,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Object(Bt.a)(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Object(Bt.a)()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){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}},{key:"_checkSampling",value:function(){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)}}]),t}(),Dt=function(){function t(e){var r=e.id,n=e.stats;i()(this,t),this.id=r,this.stats={},this._initializeStats(n),Object.seal(this)}return o()(t,[{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var e in this.stats)t(this.stats[e])}},{key:"getTable",value:function(){var t={};return this.forEach((function(e){t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}},{key:"_initializeStats",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){return t._getOrCreate(e)}))}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var e=t.name,r=t.type;return this.stats[e]||(this.stats[e]=t instanceof Pt?t:new Pt(e,r)),this.stats[e]}},{key:"size",get:function(){return Object.keys(this.stats).length}}]),t}(),jt=new(function(){function t(){i()(this,t),this.stats=new Map}return o()(t,[{key:"get",value:function(t){return this.stats.has(t)||this.stats.set(t,new Dt({id:t})),this.stats.get(t)}}]),t}());if(globalThis.luma&&"8.5.12"!==globalThis.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat("8.5.12"));globalThis.luma||(Object(Ft.a)()&&j.log(1,"luma.gl ".concat("8.5.12"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:"8.5.12",version:"8.5.12",log:j,stats:jt,globals:{modules:{},nodeIO:{}}});globalThis.luma;function Nt(t){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function Ct(t){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var Mt=r(7),Ut=r.n(Mt),Vt=r(5),Gt=r.n(Vt),zt=r(6),Ht=r.n(zt),Xt=r(3),Wt=r.n(Xt);function Yt(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function qt(t,e){if("string"!=typeof e)return e;var r=Number(e);if(!isNaN(r))return r;var n=t[e=e.replace(/^.*\./,"")];return Yt(void 0!==n,"Accessing undefined constant GL.".concat(e)),n}function Qt(t,e){for(var r in e=Number(e),t)if(t[r]===e)return"GL.".concat(r);return String(e)}var $t={};function Jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";$t[t]=$t[t]||1;var e=$t[t]++;return"".concat(t,"-").concat(e)}function Kt(t){return Yt("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Zt(t){var e=!0;for(var r in t){e=!1;break}return e}function te(t,e,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(t);n.forEach((function(t){a.methodName||(a[t]=function(){throw j.removed("Calling removed method ".concat(e,".").concat(t,": "),i)(),new Error(t)})}))}function ee(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return re(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return re(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function re(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ne="Resource subclass must define virtual methods",ie=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t),U(e);var n=r.id,a=r.userData,o=void 0===a?{}:a;this.gl=e,this.gl2=e,this.id=n||Jt(this[Symbol.toStringTag]),this.userData=o,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return o()(t,[{key:Symbol.toStringTag,get:function(){return"Resource"}}]),o()(t,[{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.deleteChildren,r=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(t){return t.delete()})),this}},{key:"bind",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Yt(t=qt(this.gl,t));var r=this.constructor.PARAMETERS||{},n=r[t];if(n){var i=M(this.gl),a=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!a){var o=n.webgl1,u="webgl2"in n?n.webgl2:n.webgl1,s=i?u:o;return s}}return this._getParameter(t,e)}},{key:"getParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.parameters,n=e.keys,i=this.constructor.PARAMETERS||{},a=M(this.gl),o={},u=r||Object.keys(i),s=ee(u);try{for(s.s();!(t=s.n()).done;){var c=t.value,l=i[c],f=l&&(!("webgl2"in l)||a)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?Qt(this.gl,c):c;o[h]=this.getParameter(c,e),n&&"GLenum"===l.type&&(o[h]=Qt(this.gl,o[h]))}}}catch(t){s.e(t)}finally{s.f()}return o}},{key:"setParameter",value:function(t,e){Yt(t=qt(this.gl,t));var r=(this.constructor.PARAMETERS||{})[t];if(r){var n=M(this.gl);if(!((!("webgl2"in r)||n)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(e=qt(e))}return this._setParameter(t,e),this}},{key:"setParameters",value:function(t){for(var e in t)this.setParameter(e,t[e]);return this}},{key:"stubRemovedMethods",value:function(t,e,r){return te(this,t,e,r)}},{key:"initialize",value:function(t){}},{key:"_createHandle",value:function(){throw new Error(ne)}},{key:"_deleteHandle",value:function(){throw new Error(ne)}},{key:"_bindHandle",value:function(t){throw new Error(ne)}},{key:"_getOptsFromHandle",value:function(){throw new Error(ne)}},{key:"_getParameter",value:function(t,e){throw new Error(ne)}},{key:"_setParameter",value:function(t,e){throw new Error(ne)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var t=this[Symbol.toStringTag],e=jt.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var t=this[Symbol.toStringTag];jt.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],r=jt.get("Memory Usage");r.get("GPU Memory").addCount(t),r.get("".concat(e," Memory")).addCount(t),this.byteLength=t}},{key:"_trackDeallocatedMemory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=jt.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get("".concat(t," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),t}(),ae=r(22),oe=r.n(ae);function ue(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function se(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.clamped,n=void 0===r||r;switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function ce(t){var e=t.data,r=t.width,n=t.height,i=t.bytesPerPixel,a=void 0===i?4:i,o=t.temp,u=r*a;o=o||new Uint8Array(u);for(var s=0;s<n/2;++s){var c=s*u,l=(n-s-1)*u;o.set(e.subarray(c,c+u)),e.copyWithin(c,l,l+u),e.set(o,l)}}function le(t){for(var e=t.data,r=t.width,n=t.height,i=Math.round(r/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),u=0;u<a;u++)for(var s=0;s<i;s++)for(var c=0;c<4;c++)o[4*(u*i+s)+c]=e[4*(2*u*r+2*s)+c];return{data:o,width:i,height:a}}function fe(t,e,r){var n=r.removedProps,i=void 0===n?{}:n,a=r.deprecatedProps,o=void 0===a?{}:a,u=r.replacedProps,s=void 0===u?{}:u;for(var c in i)if(c in e){var l=i[c]?"".concat(t,".").concat(i[c]):"N/A";j.removed("".concat(t,".").concat(c),l)()}for(var f in o)if(f in e){var h=o[f];j.deprecated("".concat(t,".").concat(f),"".concat(t,".").concat(h))()}var d=null;for(var g in s)if(g in e){var v=s[g];j.deprecated("".concat(t,".").concat(g),"".concat(t,".").concat(v))(),(d=d||Object.assign({},e))[v]=e[g],delete d[g]}return d||e}var he={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},de={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},ge=function(){function t(){var e=this;i()(this,t);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];n.forEach((function(t){return e._assign(t)})),Object.freeze(this)}return o()(t,null,[{key:"getBytesPerElement",value:function(t){return se(t.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(t){return Yt(t.size),se(t.type||5126).BYTES_PER_ELEMENT*t.size}},{key:"resolve",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return oe()(t,[he].concat(r))}}]),o()(t,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"_assign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(t=fe("Accessor",t,de)).type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"==typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return t.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return t.getBytesPerVertex(this)}}]),t}();function ve(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var ye,me,be,pe={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},_e={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:pe},Ae={removedProps:pe},xe=function(t){Gt()(r,t);var e=ve(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=a.target||(n.gl.webgl2?36662:34962),n.initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Buffer"}}]),o()(r,[{key:"getElementCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ge.getBytesPerElement(t))}},{key:"getVertexCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ge.getBytesPerVertex(t))}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=fe("Buffer",t,_e),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}},{key:"setProps",value:function(t){return"accessor"in(t=fe("Buffer",t,Ae))&&this.setAccessor(t.accessor),this}},{key:"setAccessor",value:function(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new ge(t),this}},{key:"reallocate",value:function(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}},{key:"setData",value:function(t){return this.initialize(t)}},{key:"subData",value:function(t){ArrayBuffer.isView(t)&&(t={data:t});var e=t,r=e.data,n=e.offset,i=void 0===n?0:n,a=e.srcOffset,o=void 0===a?0:a,u=t.byteLength||t.length;Yt(r);var s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==o||void 0!==u?(V(this.gl),this.gl.bufferSubData(this.target,i,r,o,u)):this.gl.bufferSubData(s,i,r),this.gl.bindBuffer(s,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(t){var e=t.sourceBuffer,r=t.readOffset,n=void 0===r?0:r,i=t.writeOffset,a=void 0===i?0:i,o=t.size,u=this.gl;return V(u),u.bindBuffer(36662,e.handle),u.bindBuffer(36663,this.handle),u.copyBufferSubData(36662,36663,n,a,o),u.bindBuffer(36662,null),u.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dstData,r=void 0===e?null:e,n=t.srcByteOffset,i=void 0===n?0:n,a=t.dstOffset,o=void 0===a?0:a,u=t.length,s=void 0===u?0:u;V(this.gl);var c,l,f=se(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=o;r?c=(l=r.length)-d:l=d+(c=Math.min(h,s||h));var g=Math.min(h,c);return Yt((s=s||g)<=g),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,o,s),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?this.target:e,n=t.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=t.offset,o=void 0===a?0:a,u=t.size;return 35345===r||35982===r?void 0!==u?this.gl.bindBufferRange(r,i,this.handle,o,u):(Yt(0===o),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?this.target:e,n=t.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=35345===r||35982===r;return a?this.gl.bindBufferBase(r,i,null):this.gl.bindBuffer(r,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;Yt(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,e,t),this.gl.bindBuffer(n,null),this.debugData=t.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=ue(t);return Yt(i),this.setAccessor(new ge(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Yt(t>=0),this._trackDeallocatedMemory();var r=t;0===t&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,e),this.gl.bindBuffer(n,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(t){var e=t/se(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}},{key:"_inferType",value:function(t){this.accessor.type||this.setAccessor(new ge(this.accessor,{type:ue(t)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(t){this.gl.bindBuffer(this.target,this.handle);var e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}},{key:"setByteLength",value:function(t){return j.deprecated("setByteLength","reallocate")(),this.reallocate(t)}},{key:"updateAccessor",value:function(t){return j.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ge(this.accessor,t),this}},{key:"type",get:function(){return j.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return j.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),r}(ie),we=(ye={},h()(ye,6407,{dataFormat:6407,types:[5121,33635]}),h()(ye,6408,{dataFormat:6408,types:[5121,32819,32820]}),h()(ye,6406,{dataFormat:6406,types:[5121]}),h()(ye,6409,{dataFormat:6409,types:[5121]}),h()(ye,6410,{dataFormat:6410,types:[5121]}),h()(ye,33326,{dataFormat:6403,types:[5126],gl2:!0}),h()(ye,33328,{dataFormat:33319,types:[5126],gl2:!0}),h()(ye,34837,{dataFormat:6407,types:[5126],gl2:!0}),h()(ye,34836,{dataFormat:6408,types:[5126],gl2:!0}),ye),Te=(me={},h()(me,6403,1),h()(me,36244,1),h()(me,33319,2),h()(me,33320,2),h()(me,6407,3),h()(me,36248,3),h()(me,6408,4),h()(me,36249,4),h()(me,6402,1),h()(me,34041,1),h()(me,6406,1),h()(me,6409,1),h()(me,6410,2),me),Ee=(be={},h()(be,5126,4),h()(be,5125,4),h()(be,5124,4),h()(be,5123,2),h()(be,5122,2),h()(be,5131,2),h()(be,5120,1),h()(be,5121,1),be);function ke(t,e){var r=we[e];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=M(t)&&r.gl2||r.gl1;return"string"==typeof n?t.getExtension(n):n}function Se(t,e){var r=we[e];switch(r&&r.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}function Oe(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Le(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Le(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Re=[9729,9728],Ie=globalThis.WebGLBuffer||function(){},Be=function(t){Gt()(r,t);var e=Fe(r);function r(t,n){var a;i()(this,r);var o=n.id,u=void 0===o?Jt("texture"):o,s=n.handle,c=n.target;return(a=e.call(this,t,{id:u,handle:s})).target=c,a.textureUnit=void 0,a.loaded=!1,a.width=void 0,a.height=void 0,a.depth=void 0,a.format=void 0,a.type=void 0,a.dataFormat=void 0,a.border=void 0,a.textureUnit=void 0,a.mipmaps=void 0,a}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Texture"}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.format,n=e.linearFiltering,i=!0;return r&&(i=(i=i&&ke(t,r))&&(!n||Se(t,r))),i}}]),o()(r,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.data;if(r instanceof Promise)return r.then((function(r){return t.initialize(Object.assign({},e,{pixels:r,data:r}))})),this;var n="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement;if(n&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",(function(){return t.initialize(e)})),this;var i=e.pixels,a=void 0===i?null:i,o=e.format,u=void 0===o?6408:o,s=e.border,c=void 0===s?0:s,l=e.recreate,f=void 0!==l&&l,h=e.parameters,d=void 0===h?{}:h,g=e.pixelStore,v=void 0===g?{}:g,y=e.textureUnit,m=void 0===y?void 0:y;r||(r=a);var b=e.width,p=e.height,_=e.dataFormat,A=e.type,x=e.compressed,w=void 0!==x&&x,T=e.mipmaps,E=void 0===T||T,k=e.depth,S=void 0===k?0:k,O=this._deduceParameters({format:u,type:A,dataFormat:_,compressed:w,data:r,width:b,height:p});return b=O.width,p=O.height,w=O.compressed,_=O.dataFormat,A=O.type,this.width=b,this.height=p,this.depth=S,this.format=u,this.type=A,this.dataFormat=_,this.border=c,this.textureUnit=m,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),E&&this._isNPOT()&&(j.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),E=!1,this._updateForNPOT(d)),this.mipmaps=E,this.setImageData({data:r,width:b,height:p,depth:S,format:u,type:A,dataFormat:_,border:c,mipmaps:E,parameters:v,compressed:w}),E&&this.generateMipmap(),this.setParameters(d),f&&(this.data=r),n&&(this._video={video:r,parameters:d,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var t=this._video,e=t.video,r=t.parameters;if(t.lastTime===e.currentTime||e.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:e,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=e.currentTime}}},{key:"resize",value:function(t){var e=t.height,r=t.width,n=t.mipmaps,i=void 0!==n&&n;return r!==this.width||e!==this.height?this.initialize({width:r,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(j.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Lt(this.gl,e,(function(){t.gl.generateMipmap(t.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(t){this._trackDeallocatedMemory("Texture");var e=t.target,r=void 0===e?this.target:e,n=t.pixels,i=void 0===n?null:n,a=t.level,o=void 0===a?0:a,u=t.format,s=void 0===u?this.format:u,c=t.border,l=void 0===c?this.border:c,f=t.offset,h=void 0===f?0:f,d=t.parameters,g=void 0===d?{}:d,v=t.data,y=void 0===v?null:v,m=t.type,b=void 0===m?this.type:m,p=t.width,_=void 0===p?this.width:p,A=t.height,x=void 0===A?this.height:A,w=t.dataFormat,T=void 0===w?this.dataFormat:w,E=t.compressed,k=void 0!==E&&E;y||(y=i);var S=this._deduceParameters({format:s,type:b,dataFormat:T,compressed:k,data:y,width:_,height:x});b=S.type,T=S.dataFormat,k=S.compressed,_=S.width,x=S.height;var O=this.gl;O.bindTexture(this.target,this.handle);var L,F,R=this._getDataType({data:y,compressed:k});y=R.data,L=R.dataType;var I=0;if(Lt(this.gl,g,(function(){switch(L){case"null":O.texImage2D(r,o,s,_,x,l,T,b,y);break;case"typed-array":O.texImage2D(r,o,s,_,x,l,T,b,y,h);break;case"buffer":(F=V(O)).bindBuffer(35052,y.handle||y),F.texImage2D(r,o,s,_,x,l,T,b,h),F.bindBuffer(35052,null);break;case"browser-object":M(O)?O.texImage2D(r,o,s,_,x,l,T,b,y):O.texImage2D(r,o,s,T,b,y);break;case"compressed":var t,e=Oe(y.entries());try{for(e.s();!(t=e.n()).done;){var n=at()(t.value,2),i=n[0],a=n[1];O.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data),I+=a.levelSize}}catch(t){e.e(t)}finally{e.f()}break;default:Yt(!1,"Unknown image data type")}})),"compressed"===L)this._trackAllocatedMemory(I,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var B=Te[this.dataFormat]||4,P=Ee[this.type]||1;this._trackAllocatedMemory(this.width*this.height*B*P,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(t){var e=this,r=t.target,n=void 0===r?this.target:r,i=t.pixels,a=void 0===i?null:i,o=t.data,u=void 0===o?null:o,s=t.x,c=void 0===s?0:s,l=t.y,f=void 0===l?0:l,h=t.width,d=void 0===h?this.width:h,g=t.height,v=void 0===g?this.height:g,y=t.level,m=void 0===y?0:y,b=t.format,p=void 0===b?this.format:b,_=t.type,A=void 0===_?this.type:_,x=t.dataFormat,w=void 0===x?this.dataFormat:x,T=t.compressed,E=void 0!==T&&T,k=t.offset,S=void 0===k?0:k,O=t.border,L=(void 0===O&&this.border,t.parameters),F=void 0===L?{}:L,R=this._deduceParameters({format:p,type:A,dataFormat:w,compressed:E,data:u,width:d,height:v});if(A=R.type,w=R.dataFormat,E=R.compressed,d=R.width,v=R.height,Yt(0===this.depth,"texSubImage not supported for 3D textures"),u||(u=a),u&&u.data){var I=u;u=I.data,d=I.shape[0],v=I.shape[1]}u instanceof xe&&(u=u.handle),this.gl.bindTexture(this.target,this.handle),Lt(this.gl,F,(function(){if(E)e.gl.compressedTexSubImage2D(n,m,c,f,d,v,p,u);else if(null===u)e.gl.texSubImage2D(n,m,c,f,d,v,w,A,null);else if(ArrayBuffer.isView(u))e.gl.texSubImage2D(n,m,c,f,d,v,w,A,u,S);else if(u instanceof Ie){var t=V(e.gl);t.bindBuffer(35052,u),t.texSubImage2D(n,m,c,f,d,v,w,A,S),t.bindBuffer(35052,null)}else if(M(e.gl)){V(e.gl).texSubImage2D(n,m,c,f,d,v,w,A,u)}else e.gl.texSubImage2D(n,m,c,f,w,A,u)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){return j.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}},{key:"_getDataType",value:function(t){var e=t.data,r=t.compressed;return void 0!==r&&r?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof xe?{data:e.handle,dataType:"buffer"}:e instanceof Ie?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(t){var e=t.format,r=t.data,n=t.width,i=t.height,a=t.dataFormat,o=t.type,u=t.compressed,s=we[e];a=a||s&&s.dataFormat,o=o||s&&s.types[0],u=u||s&&s.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:a,type:o,compressed:u,width:n=c.width,height:i=c.height,format:e,data:r}}},{key:"_deduceImageSize",value:function(t,e,r){var n;return Yt(n="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:r}:{width:e>=0?e:1,height:r>=0?r:1},"Could not deduced texture size"),Yt(void 0===e||n.width===e,"Deduced texture width does not match supplied width"),Yt(void 0===r||n.height===r,"Deduced texture height does not match supplied height"),n}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}},{key:"_setParameter",value:function(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Yt(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!M(this.gl)&&(!(!this.width||!this.height)&&(!Kt(this.width)||!Kt(this.height)))}},{key:"_updateForNPOT",value:function(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(t,e){if(this._isNPOT())switch(t){case 10241:-1===Re.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}]),r}(ie),Pe="";function De(t){Pe=t}function je(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Yt("string"==typeof t),t=Pe+t;var r=e.dataType||"text";return fetch(t,e).then((function(t){return t[r]()}))}function Ne(t,e){return Yt("string"==typeof t),t=Pe+t,new Promise((function(r,n){try{var i=new Image;i.onload=function(){return r(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(t,".")))},i.crossOrigin=e&&e.crossOrigin||"anonymous",i.src=t}catch(t){n(t)}}))}function Ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Me=function(t){Gt()(r,t);var e=Ce(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),U(t),(a instanceof Promise||"string"==typeof a)&&(a={data:a}),"string"==typeof a.data&&(a=Object.assign({},a,{data:Ne(a.data)})),(n=e.call(this,t,Object.assign({},a,{target:3553}))).initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(t,e){return Be.isSupported(t,e)}}]),r}(Be),Ue=r(16),Ve=r.n(Ue),Ge=r(23),ze=r.n(Ge);function He(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Xe=[34069,34070,34071,34072,34073,34074],We=function(t){Gt()(n,t);var e,r=He(n);function n(t){var e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,n),U(t),(e=r.call(this,t,Object.assign({},a,{target:34067}))).initialize(a),Object.seal(Ut()(e)),e}return o()(n,[{key:Symbol.toStringTag,get:function(){return"TextureCube"}}]),o()(n,[{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.mipmaps,n=void 0===r||r,i=e.parameters,a=void 0===i?{}:i;return this.opts=e,this.setCubeMapImageData(e).then((function(){t.loaded=!0,n&&t.generateMipmap(e),t.setParameters(a)})),this}},{key:"subImage",value:function(t){var e=t.face,r=t.data,n=t.x,i=void 0===n?0:n,a=t.y,o=void 0===a?0:a,u=t.mipmapLevel,s=void 0===u?0:u;return this._subImage({target:e,data:r,x:i,y:o,mipmapLevel:s})}},{key:"setCubeMapImageData",value:(e=ze()(Ve.a.mark((function t(e){var r,n,i,a,o,u,s,c,l,f,h,d,g,v=this;return Ve.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.width,n=e.height,i=e.pixels,a=e.data,o=e.border,u=void 0===o?0:o,s=e.format,c=void 0===s?6408:s,l=e.type,f=void 0===l?5121:l,h=this.gl,d=i||a,t.next=5,Promise.all(Xe.map((function(t){var e=d[t];return Promise.all(Array.isArray(e)?e:[e])})));case 5:g=t.sent,this.bind(),Xe.forEach((function(t,e){g[e].length>1&&!1!==v.opts.mipmaps&&j.warn("".concat(v.id," has mipmap and multiple LODs."))(),g[e].forEach((function(e,i){r&&n?h.texImage2D(t,i,c,r,n,u,c,f,e):h.texImage2D(t,i,c,c,f,e)}))})),this.unbind();case 9:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"setImageDataForFace",value:function(t){var e=this,r=t.face,n=t.width,i=t.height,a=t.pixels,o=t.data,u=t.border,s=void 0===u?0:u,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,g=a||o;return this.bind(),g instanceof Promise?g.then((function(n){return e.setImageDataForFace(Object.assign({},t,{face:r,data:n,pixels:n}))})):this.width||this.height?d.texImage2D(r,0,l,n,i,s,l,h,g):d.texImage2D(r,0,l,l,h,g),this}}]),n}(Be);function Ye(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}We.FACES=Xe;var qe,Qe=function(t){Gt()(r,t);var e=Ye(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),V(t),a=Object.assign({depth:1},a,{target:32879,unpackFlipY:!1}),(n=e.call(this,t,a)).initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Texture3D"}}],[{key:"isSupported",value:function(t){return M(t)}}]),o()(r,[{key:"setImageData",value:function(t){var e=this,r=t.level,n=void 0===r?0:r,i=t.dataFormat,a=void 0===i?6408:i,o=t.width,u=t.height,s=t.depth,c=void 0===s?1:s,l=t.border,f=void 0===l?0:l,h=t.format,d=t.type,g=void 0===d?5121:d,v=t.offset,y=void 0===v?0:v,m=t.data,b=t.parameters,p=void 0===b?{}:b;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Lt(this.gl,p,(function(){ArrayBuffer.isView(m)&&e.gl.texImage3D(e.target,n,a,o,u,c,f,h,g,m),m instanceof xe&&(e.gl.bindBuffer(35052,m.handle),e.gl.texImage3D(e.target,n,a,o,u,c,f,h,g,y))})),m&&m.byteLength)this._trackAllocatedMemory(m.byteLength,"Texture");else{var _=Te[this.dataFormat]||4,A=Ee[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*_*A,"Texture")}return this.loaded=!0,this}}]),r}(Be),$e=r(12),Je=r.n($e),Ke="EXT_color_buffer_float",Ze=(qe={},h()(qe,33189,{bpp:2}),h()(qe,33190,{gl2:!0,bpp:3}),h()(qe,36012,{gl2:!0,bpp:4}),h()(qe,36168,{bpp:1}),h()(qe,34041,{bpp:4}),h()(qe,35056,{gl2:!0,bpp:4}),h()(qe,36013,{gl2:!0,bpp:5}),h()(qe,32854,{bpp:2}),h()(qe,36194,{bpp:2}),h()(qe,32855,{bpp:2}),h()(qe,33321,{gl2:!0,bpp:1}),h()(qe,33330,{gl2:!0,bpp:1}),h()(qe,33329,{gl2:!0,bpp:1}),h()(qe,33332,{gl2:!0,bpp:2}),h()(qe,33331,{gl2:!0,bpp:2}),h()(qe,33334,{gl2:!0,bpp:4}),h()(qe,33333,{gl2:!0,bpp:4}),h()(qe,33323,{gl2:!0,bpp:2}),h()(qe,33336,{gl2:!0,bpp:2}),h()(qe,33335,{gl2:!0,bpp:2}),h()(qe,33338,{gl2:!0,bpp:4}),h()(qe,33337,{gl2:!0,bpp:4}),h()(qe,33340,{gl2:!0,bpp:8}),h()(qe,33339,{gl2:!0,bpp:8}),h()(qe,32849,{gl2:!0,bpp:3}),h()(qe,32856,{gl2:!0,bpp:4}),h()(qe,32857,{gl2:!0,bpp:4}),h()(qe,36220,{gl2:!0,bpp:4}),h()(qe,36238,{gl2:!0,bpp:4}),h()(qe,36975,{gl2:!0,bpp:4}),h()(qe,36214,{gl2:!0,bpp:8}),h()(qe,36232,{gl2:!0,bpp:8}),h()(qe,36226,{gl2:!0,bpp:16}),h()(qe,36208,{gl2:!0,bpp:16}),h()(qe,33325,{gl2:Ke,bpp:2}),h()(qe,33327,{gl2:Ke,bpp:4}),h()(qe,34842,{gl2:Ke,bpp:8}),h()(qe,33326,{gl2:Ke,bpp:4}),h()(qe,33328,{gl2:Ke,bpp:8}),h()(qe,34836,{gl2:Ke,bpp:16}),h()(qe,35898,{gl2:Ke,bpp:4}),qe);function tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}function er(t,e,r){var n=r[e];if(!n)return!1;var i=M(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}var rr,nr=function(t){Gt()(r,t);var e=tr(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Renderbuffer"}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=e.format;return!r||er(t,r,Ze)}},{key:"getSamplesForFormat",value:function(t,e){var r=e.format;return t.getInternalformatParameter(36161,r,32937)}}]),o()(r,[{key:"initialize",value:function(t){var e=t.format,r=t.width,n=void 0===r?1:r,i=t.height,a=void 0===i?1:i,o=t.samples,u=void 0===o?0:o;return Yt(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==u&&M(this.gl)?this.gl.renderbufferStorageMultisample(36161,u,e,n,a):this.gl.renderbufferStorage(36161,e,n,a),this.format=e,this.width=n,this.height=a,this.samples=u,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Ze[this.format].bpp),this}},{key:"resize",value:function(t){var e=t.width,r=t.height;return e!==this.width||r!==this.height?this.initialize({width:e,height:r,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(t){this.gl.bindRenderbuffer(36161,t)}},{key:"_syncHandle",value:function(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}]),r}(ie);function ir(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.framebuffer,n=void 0===r?null:r,i=e.color,a=void 0===i?null:i,o=e.depth,u=void 0===o?null:o,s=e.stencil,c=void 0===s?null:s,l={};n&&(l.framebuffer=n);var f=0;a&&(f|=16384,!0!==a&&(l.clearColor=a)),u&&(f|=256,!0!==u&&(l.clearDepth=u)),c&&(f|=1024,!0!==u&&(l.clearStencil=u)),Yt(0!==f,"clear: bad arguments"),Lt(t,l,(function(){t.clear(f)}))}function ar(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.framebuffer,n=void 0===r?null:r,i=e.buffer,a=void 0===i?6144:i,o=e.drawBuffer,u=void 0===o?0:o,s=e.value,c=void 0===s?[0,0,0,0]:s;V(t),Lt(t,{framebuffer:n},(function(){switch(a){case 6144:switch(c.constructor){case Int32Array:t.clearBufferiv(a,u,c);break;case Uint32Array:t.clearBufferuiv(a,u,c);break;case Float32Array:default:t.clearBufferfv(a,u,c)}break;case 6145:t.clearBufferfv(6145,0,[c]);break;case 6146:t.clearBufferiv(6146,0,[c]);break;case 34041:var e=at()(c,2),r=e[0],n=e[1];t.clearBufferfi(34041,0,r,n);break;default:Yt(!1,"clear: bad arguments")}}))}function or(t){switch(t){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 Yt(!1),0}}function ur(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceX,n=void 0===r?0:r,i=e.sourceY,a=void 0===i?0:i,o=e.sourceFormat,u=void 0===o?6408:o,s=e.sourceAttachment,c=void 0===s?36064:s,l=e.target,f=void 0===l?null:l,h=e.sourceWidth,d=e.sourceHeight,g=e.sourceType,v=dr(t),y=v.framebuffer,m=v.deleteFramebuffer;Yt(y);var b=y.gl,p=y.handle,_=y.attachments;h=h||y.width,d=d||y.height,36064===c&&null===p&&(c=1028),Yt(_[c]),f=gr(f,g=g||_[c].type,u,h,d),g=g||ue(f);var A=b.bindFramebuffer(36160,p);return b.readPixels(n,a,h,d,u,g,f),b.bindFramebuffer(36160,A||null),m&&y.delete(),f}function sr(t,e){var r=e.sourceX,n=void 0===r?0:r,i=e.sourceY,a=void 0===i?0:i,o=e.sourceFormat,u=void 0===o?6408:o,s=e.target,c=void 0===s?null:s,l=e.targetByteOffset,f=void 0===l?0:l,h=e.sourceWidth,d=e.sourceHeight,g=e.sourceType,v=dr(t),y=v.framebuffer,m=v.deleteFramebuffer;Yt(y),h=h||y.width,d=d||y.height;var b=V(y.gl);if(g=g||(c?c.type:5121),!c){var p=or(u),_=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Yt(!1),0}}(g);c=new xe(b,{byteLength:f+h*d*p*_,accessor:{type:g,size:p}})}return c.bind({target:35051}),Lt(b,{framebuffer:y},(function(){b.readPixels(n,a,h,d,u,g,f)})),c.unbind({target:35051}),m&&y.delete(),c}function cr(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceAttachment,n=void 0===r?36064:r,i=e.targetMaxHeight,a=void 0===i?Number.MAX_SAFE_INTEGER:i,o=ur(t,{sourceAttachment:n}),u=t.width,s=t.height;s>a;){var c=le({data:o,width:u,height:s});o=c.data,u=c.width,s=c.height}ce({data:o,width:u,height:s});var l=document.createElement("canvas");l.width=u,l.height=s;var f=l.getContext("2d"),h=f.createImageData(u,s);return h.data.set(o),f.putImageData(h,0,0),l.toDataURL()}function lr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceAttachment,n=void 0===r?36064:r,i=e.targetImage,a=void 0===i?null:i,o=cr(t,{sourceAttachment:n});return(a=a||new Image).src=o,a}function fr(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.sourceX,i=void 0===n?0:n,a=r.sourceY,o=void 0===a?0:a,u=r.targetMipmaplevel,s=void 0===u?0:u,c=r.targetInternalFormat,l=void 0===c?6408:c,f=r.targetX,h=r.targetY,d=r.targetZ,g=r.width,v=r.height,y=dr(t),m=y.framebuffer,b=y.deleteFramebuffer;Yt(m);var p=m.gl,_=m.handle,A=void 0!==f||void 0!==h||void 0!==d;f=f||0,h=h||0,d=d||0;var x=p.bindFramebuffer(36160,_);Yt(e);var w=null;if(e instanceof Be&&(w=e,g=Number.isFinite(g)?g:w.width,v=Number.isFinite(v)?v:w.height,w.bind(0),e=w.target),A)switch(e){case 3553:case 34067:p.copyTexSubImage2D(e,s,f,h,i,o,g,v);break;case 35866:case 32879:var T=V(p);T.copyTexSubImage3D(e,s,f,h,d,i,o,g,v)}else p.copyTexImage2D(e,s,l,i,o,g,v,0);return w&&w.unbind(),p.bindFramebuffer(36160,x||null),b&&m.delete(),w}function hr(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.sourceX0,i=void 0===n?0:n,a=r.sourceY0,o=void 0===a?0:a,u=r.targetX0,s=void 0===u?0:u,c=r.targetY0,l=void 0===c?0:c,f=r.color,h=void 0===f||f,d=r.depth,g=void 0!==d&&d,v=r.stencil,y=void 0!==v&&v,m=r.filter,b=void 0===m?9728:m,p=r.sourceX1,_=r.sourceY1,A=r.targetX1,x=r.targetY1,w=r.sourceAttachment,T=void 0===w?36064:w,E=r.mask,k=void 0===E?0:E,S=dr(t),O=S.framebuffer,L=S.deleteFramebuffer,F=dr(e),R=F.framebuffer,I=F.deleteFramebuffer;Yt(O),Yt(R);var B=R.gl,P=R.handle,D=R.width,N=R.height,C=R.readBuffer,M=V(B);O.handle||36064!==T||(T=1028),h&&(k|=16384),g&&(k|=256),y&&(k|=1024),(L||I)&&1280&k&&(k=16384,j.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Yt(k),p=void 0===p?O.width:p,_=void 0===_?O.height:_,A=void 0===A?D:A,x=void 0===x?N:x;var U=B.bindFramebuffer(36009,P),G=B.bindFramebuffer(36008,O.handle);return M.readBuffer(T),M.blitFramebuffer(i,o,p,_,s,l,A,x,k,b),M.readBuffer(C),M.bindFramebuffer(36008,G||null),M.bindFramebuffer(36009,U||null),L&&O.delete(),I&&R.delete(),R}function dr(t){return t instanceof kr?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:(e=t,n=e.gl,i=e.width,a=e.height,o=e.id,u=new kr(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:h()({},36064,e)})),u),deleteFramebuffer:!0};var e,r,n,i,a,o,u}function gr(t,e,r,n,i){return t||new(se(e=e||5121,{clamped:!1}))(n*i*or(r))}var vr={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};var yr=(rr={},h()(rr,vr.WEBGL2,[!1,!0]),h()(rr,vr.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),h()(rr,vr.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),h()(rr,vr.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),h()(rr,vr.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),h()(rr,vr.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),h()(rr,vr.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),h()(rr,vr.FLOAT_BLEND,["EXT_float_blend"]),h()(rr,vr.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),h()(rr,vr.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),h()(rr,vr.TEXTURE_FLOAT,["OES_texture_float",!0]),h()(rr,vr.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),h()(rr,vr.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),h()(rr,vr.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),h()(rr,vr.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),h()(rr,vr.COLOR_ATTACHMENT_RGBA32F,[function(t){var e=new Me(t,{format:6408,type:5126,dataFormat:6408}),r=new kr(t,{id:"test-framebuffer",check:!1,attachments:h()({},36064,e)}),n=r.getStatus();return e.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),h()(rr,vr.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),h()(rr,vr.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),h()(rr,vr.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),h()(rr,vr.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),h()(rr,vr.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),h()(rr,vr.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),rr);function mr(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return br(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return br(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function pr(t,e){return _r(t,e)}function _r(t,e){return(e=Array.isArray(e)?e:[e]).every((function(e){return xr(t,e)}))}function Ar(t){for(var e in t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},yr)void 0===t.luma.caps[e]&&(t.luma.caps[e]=xr(t,e));return t.luma.caps}function xr(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){var r,n=yr[e];Yt(n,e);var i=M(t)&&n[1]||n[0];if("function"==typeof i)r=i(t);else if(Array.isArray(i)){r=!0;var a,o=mr(i);try{for(o.s();!(a=o.n()).done;){var u=a.value;r=r&&Boolean(t.getExtension(u))}}catch(t){o.e(t)}finally{o.f()}}else"string"==typeof i?r=Boolean(t.getExtension(i)):"boolean"==typeof i?r=i:Yt(!1);return r}(t,e)),t.luma.caps[e]||j.log(2,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}function wr(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Tr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tr(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Er(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var kr=function(t){Gt()(r,t);var e=Er(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.ownResources=[],n.initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var t=V(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var t=V(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.colorBufferFloat,n=e.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new r(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}}]),o()(r,[{key:"initialize",value:function(t){var e=t.width,r=void 0===e?1:e,n=t.height,i=void 0===n?1:n,a=t.attachments,o=void 0===a?null:a,u=t.color,s=void 0===u||u,c=t.depth,l=void 0===c||c,f=t.stencil,h=void 0!==f&&f,d=t.check,g=void 0===d||d,v=t.readBuffer,y=void 0===v?void 0:v,m=t.drawBuffers,b=void 0===m?void 0:m;if(Yt(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,o)for(var p in o){var _=o[p];(Array.isArray(_)?_[0]:_).resize({width:r,height:i})}else o=this._createDefaultAttachments(s,l,h,r,i);this.update({clearAttachments:!0,attachments:o,readBuffer:y,drawBuffers:b}),o&&g&&this.checkStatus()}},{key:"delete",value:function(){var t,e=wr(this.ownResources);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}return Je()(Wt()(r.prototype),"delete",this).call(this),this}},{key:"update",value:function(t){var e=t.attachments,r=void 0===e?{}:e,n=t.readBuffer,i=t.drawBuffers,a=t.clearAttachments,o=void 0!==a&&a,u=t.resizeAttachments,s=void 0===u||u;this.attach(r,{clearAttachments:o,resizeAttachments:s});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),i&&this._setDrawBuffers(i),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.width,r=t.height;if(null===this.handle)return Yt(void 0===e&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===e&&(e=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),e!==this.width&&r!==this.height&&j.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:e,height:r});return this.width=e,this.height=r,this}},{key:"attach",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,a=r.resizeAttachments,o=void 0===a||a,u={};i&&Object.keys(this.attachments).forEach((function(t){u[t]=null})),Object.assign(u,t);var s=this.gl.bindFramebuffer(36160,this.handle);for(var c in u){Yt(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=u[l],h=f;if(h)if(h instanceof nr)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=at()(f,3),g=d[0],v=d[1],y=void 0===v?0:v,m=d[2],b=void 0===m?0:m;h=g,this._attachTexture({attachment:l,texture:g,layer:y,level:b})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((function(t){return!e.attachments[t]})).forEach((function(t){delete e.attachments[t]}))}},{key:"checkStatus",value:function(){this.gl;var t=this.getStatus();if(36053!==t)throw new Error(function(t){return(kr.STATUS||{})[t]||"Framebuffer error ".concat(t)}(t));return this}},{key:"getStatus",value:function(){var t=this.gl,e=t.bindFramebuffer(36160,this.handle),r=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),r}},{key:"clear",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.color,n=e.depth,i=e.stencil,a=e.drawBuffers,o=void 0===a?[]:a,u=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&ir(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(e,r){ar(t.gl,{drawBuffer:r,value:e})})),this.gl.bindFramebuffer(36160,u||null),this}},{key:"readPixels",value:function(){return j.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){return j.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){return j.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){return j.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){return j.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){return j.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(t){var e=t.attachments,r=void 0===e?[]:e,n=t.x,i=void 0===n?0:n,a=t.y,o=void 0===a?0:a,u=t.width,s=t.height,c=V(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===o&&void 0===u&&void 0===s?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,o,u,s),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(t,e,r){var n=this._getAttachmentParameterFallback(e);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=Qt(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},a=wr(n);try{for(a.s();!(t=a.n()).done;){var o=t.value,u=r?Qt(this.gl,o):o;i[u]=this.getAttachmentParameter(e,o,r)}}catch(t){a.e(t)}finally{a.f()}return i}},{key:"getParameters",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=Object.keys(this.attachments),r={},n=0,i=e;n<i.length;n++){var a=i[n],o=Number(a),u=t?Qt(this.gl,o):o;r[u]=this.getAttachmentParameters(o,t)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(cr(this),"luma-debug-texture"),this}},{key:"log",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>j.level||"undefined"==typeof window)return this;e=e||"Framebuffer ".concat(this.id);var r=cr(this,{targetMaxHeight:100});return j.image({logLevel:t,message:e,image:r},e)(),this}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?36160:e;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?36160:e;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(t,e,r,n,i){var a,o=null;t&&((o=o||{})[36064]=new Me(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},h()(a,10241,9729),h()(a,10240,9729),h()(a,10242,33071),h()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return e&&r?((o=o||{})[33306]=new nr(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):e?((o=o||{})[36096]=new nr(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&Yt(!1),o}},{key:"_unattach",value:function(t){var e=this.attachments[t];e&&(e instanceof nr?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}},{key:"_attachRenderbuffer",value:function(t){var e=t.attachment,r=void 0===e?36064:e,n=t.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(t){var e=t.attachment,r=void 0===e?36064:e,n=t.texture,i=t.layer,a=t.level,o=this.gl;switch(o.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:V(o).framebufferTextureLayer(36160,r,n.target,a,i);break;case 34067:var u=function(t){return t<34069?t+34069:t}(i);o.framebufferTexture2D(36160,r,u,n.handle,a);break;case 3553:o.framebufferTexture2D(36160,r,3553,n.handle,a);break;default:Yt(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(t){var e,r=M(e=this.gl)?e:null;r?r.readBuffer(t):Yt(36064===t||1029===t,"Multiple render targets not supported"),this.readBuffer=t}},{key:"_setDrawBuffers",value:function(t){var e=this.gl,r=V(e);if(r)r.drawBuffers(t);else{var n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Yt(1===t.length&&(36064===t[0]||1029===t[0]),"Multiple render targets not supported")}this.drawBuffers=t}},{key:"_getAttachmentParameterFallback",value:function(t){var e=Ar(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(t){return this.gl.bindFramebuffer(36160,t)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}}]),r}(ie);var Sr;function Or(t,e){Yt(t instanceof Me||t instanceof We||t instanceof Qe);var r=t.constructor,n=t.gl,i=t.width,a=t.height,o=t.format,u=t.type,s=t.dataFormat,c=t.border,l=t.mipmaps;return new r(n,Object.assign({width:i,height:a,format:o,type:u,dataFormat:s,border:c,mipmaps:l},e))}kr.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var Lr=(Sr={},h()(Sr,33902,{gl1:new Float32Array([1,1])}),h()(Sr,33901,{gl1:new Float32Array([1,1])}),h()(Sr,3379,{gl1:64,gl2:2048}),h()(Sr,34076,{gl1:16}),h()(Sr,34930,{gl1:8}),h()(Sr,35661,{gl1:8}),h()(Sr,35660,{gl1:0}),h()(Sr,34024,{gl1:1}),h()(Sr,36348,{gl1:8}),h()(Sr,34921,{gl1:8}),h()(Sr,36347,{gl1:128}),h()(Sr,36349,{gl1:16}),h()(Sr,3386,{gl1:new Int32Array([0,0])}),h()(Sr,32883,{gl1:0,gl2:256}),h()(Sr,35071,{gl1:0,gl2:256}),h()(Sr,37447,{gl1:0,gl2:0}),h()(Sr,36063,{gl1:0,gl2:4}),h()(Sr,35379,{gl1:0,gl2:0}),h()(Sr,35374,{gl1:0,gl2:0}),h()(Sr,35377,{gl1:0,gl2:0}),h()(Sr,34852,{gl1:0,gl2:4}),h()(Sr,36203,{gl1:0,gl2:0}),h()(Sr,33001,{gl1:0,gl2:0}),h()(Sr,33e3,{gl1:0,gl2:0}),h()(Sr,37157,{gl1:0,gl2:0}),h()(Sr,35373,{gl1:0,gl2:0}),h()(Sr,35657,{gl1:0,gl2:0}),h()(Sr,36183,{gl1:0,gl2:0}),h()(Sr,37137,{gl1:0,gl2:0}),h()(Sr,34045,{gl1:0,gl2:0}),h()(Sr,35978,{gl1:0,gl2:0}),h()(Sr,35979,{gl1:0,gl2:0}),h()(Sr,35968,{gl1:0,gl2:0}),h()(Sr,35376,{gl1:0,gl2:0}),h()(Sr,35375,{gl1:0,gl2:0}),h()(Sr,35659,{gl1:0,gl2:0}),h()(Sr,37154,{gl1:0,gl2:0}),h()(Sr,35371,{gl1:0,gl2:0}),h()(Sr,35658,{gl1:0,gl2:0}),h()(Sr,35076,{gl1:0,gl2:-8,negative:!0}),h()(Sr,35077,{gl1:0,gl2:7}),h()(Sr,35380,{gl1:0,gl2:0}),Sr);function Fr(t){if(t.luma=t.luma||{},!t.luma.limits){t.luma.limits={},t.luma.webgl1MinLimits={},t.luma.webgl2MinLimits={};var e=M(t);for(var r in Lr){var n=Lr[r],i=n.gl1,a="gl2"in n?n.gl2:n.gl1,o=e?a:i,u="gl2"in n&&!e||"extension"in n&&!t.getExtension(n.extension)?o:t.getParameter(r);t.luma.limits[r]=u,t.luma.webgl1MinLimits[r]=i,t.luma.webgl2MinLimits[r]=a}}return t.luma.limits}function Rr(t){t.luma=t.luma||{};var e,r=It(t);t.luma.info||(t.luma.info=(e={},h()(e,37445,r.vendor),h()(e,37446,r.renderer),h()(e,7936,r.vendorMasked),h()(e,7937,r.rendererMasked),h()(e,7938,r.version),h()(e,35724,r.shadingLanguageVersion),e));return t.luma.info}function Ir(t){return Object.assign(It(t),{limits:Fr(t),info:Rr(t),webgl1MinLimits:t.luma.webgl1MinLimits,webgl2MinLimits:t.luma.webgl2MinLimits})}function Br(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="undefined"!=typeof window&&window.navigator||{},r=t.userAgent||e.userAgent||"",n=-1!==r.indexOf("MSIE "),i=-1!==r.indexOf("Trident/");return n||i}var Pr={};function Dr(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yr[e];if(Yt(n,e),!Br(r))return!0;if(e in Pr)return Pr[e];var i=n[0],a="#extension GL_".concat(i," : enable\nvoid main(void) {}"),o=t.createShader(35633);t.shaderSource(o,a),t.compileShader(o);var u=t.getShaderParameter(o,35713);return t.deleteShader(o),Pr[e]=u,u}function jr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=t.match(r);return n?n[1]:e}function Nr(t,e,r,n){for(var i=t.split(/\r?\n/),a={},o={},u=n||jr(e)||"(unnamed)",s="".concat(function(t){switch(t){case 35632:return"fragment";case 35633:return"vertex";default:return"unknown type"}}(r)," shader ").concat(u),c=0;c<i.length;c++){var l=i[c];if(!(l.length<=1)){var f=l.split(":"),h=f[0],d=parseInt(f[2],10);if(isNaN(d))throw new Error("GLSL compilation error in ".concat(s,": ").concat(t));"WARNING"!==h?a[d]=l:o[d]=l}}var g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",n=t.split(/\r?\n/),i=String(n.length+e-1).length;return n.map((function(t,n){var a=String(n+e),o=a.length;return Mr(a,i-o)+r+t}))}(e);return{shaderName:s,errors:Cr(a,g),warnings:Cr(o,g)}}function Cr(t,e){for(var r="",n=0;n<e.length;n++){var i=e[n];if((t[n+3]||t[n+2]||t[n+1])&&(r+="".concat(i,"\n"),t[n+1])){var a=t[n+1],o=a.split(":",3),u=o[0],s=parseInt(o[1],10)||0,c=a.substring(o.join(":").length+1).trim();r+=Mr("^^^ ".concat(u,": ").concat(c,"\n\n"),s)}}return r}function Mr(t,e){for(var r="",n=0;n<e;++n)r+=" ";return"".concat(r).concat(t)}function Ur(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Vr,Gr,zr=function(t){Gt()(r,t);var e=Ur(r);function r(t,n){var a;i()(this,r),U(t),Yt("string"==typeof n.source,"Shader: GLSL source code must be a JavaScript string");var o=jr(n.source,null)||n.id||Jt("unnamed ".concat(r.getTypeName(n.shaderType)));return(a=e.call(this,t,{id:o})).shaderType=n.shaderType,a.source=n.source,a.initialize(n),a}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Shader"}}],[{key:"getTypeName",value:function(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Yt(!1),"unknown"}}}]),o()(r,[{key:"initialize",value:function(t){var e=t.source,r=jr(e,null);r&&(this.id=Jt(r)),this._compile(e)}},{key:"getParameter",value:function(t){return this.gl.getShaderParameter(this.handle,t)}},{key:"toString",value:function(){return"".concat(r.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return jr(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}},{key:"_compile",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);var e=this.getParameter(35713);if(!e){var r=this.gl.getShaderInfoLog(this.handle),n=Nr(r,this.source,this.shaderType,this.id),i=n.shaderName,a=n.errors,o=n.warnings;throw j.error("GLSL compilation errors in ".concat(i,"\n").concat(a))(),j.warn("GLSL compilation warnings in ".concat(i,"\n").concat(o))(),new Error("GLSL compilation errors in ".concat(i))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),r}(ie),Hr=function(t){Gt()(r,t);var e=Ur(r);function r(t,n){return i()(this,r),"string"==typeof n&&(n={source:n}),e.call(this,t,Object.assign({},n,{shaderType:35633}))}return o()(r,[{key:Symbol.toStringTag,get:function(){return"VertexShader"}}]),o()(r,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),r}(zr),Xr=function(t){Gt()(r,t);var e=Ur(r);function r(t,n){return i()(this,r),"string"==typeof n&&(n={source:n}),e.call(this,t,Object.assign({},n,{shaderType:35632}))}return o()(r,[{key:Symbol.toStringTag,get:function(){return"FragmentShader"}}]),o()(r,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),r}(zr),Wr=(Vr={},h()(Vr,5126,sn.bind(null,"uniform1fv",Kr,1,cn)),h()(Vr,35664,sn.bind(null,"uniform2fv",Kr,2,cn)),h()(Vr,35665,sn.bind(null,"uniform3fv",Kr,3,cn)),h()(Vr,35666,sn.bind(null,"uniform4fv",Kr,4,cn)),h()(Vr,5124,sn.bind(null,"uniform1iv",Zr,1,cn)),h()(Vr,35667,sn.bind(null,"uniform2iv",Zr,2,cn)),h()(Vr,35668,sn.bind(null,"uniform3iv",Zr,3,cn)),h()(Vr,35669,sn.bind(null,"uniform4iv",Zr,4,cn)),h()(Vr,35670,sn.bind(null,"uniform1iv",Zr,1,cn)),h()(Vr,35671,sn.bind(null,"uniform2iv",Zr,2,cn)),h()(Vr,35672,sn.bind(null,"uniform3iv",Zr,3,cn)),h()(Vr,35673,sn.bind(null,"uniform4iv",Zr,4,cn)),h()(Vr,35674,sn.bind(null,"uniformMatrix2fv",Kr,4,ln)),h()(Vr,35675,sn.bind(null,"uniformMatrix3fv",Kr,9,ln)),h()(Vr,35676,sn.bind(null,"uniformMatrix4fv",Kr,16,ln)),h()(Vr,35678,un),h()(Vr,35680,un),h()(Vr,5125,sn.bind(null,"uniform1uiv",tn,1,cn)),h()(Vr,36294,sn.bind(null,"uniform2uiv",tn,2,cn)),h()(Vr,36295,sn.bind(null,"uniform3uiv",tn,3,cn)),h()(Vr,36296,sn.bind(null,"uniform4uiv",tn,4,cn)),h()(Vr,35685,sn.bind(null,"uniformMatrix2x3fv",Kr,6,ln)),h()(Vr,35686,sn.bind(null,"uniformMatrix2x4fv",Kr,8,ln)),h()(Vr,35687,sn.bind(null,"uniformMatrix3x2fv",Kr,6,ln)),h()(Vr,35688,sn.bind(null,"uniformMatrix3x4fv",Kr,12,ln)),h()(Vr,35689,sn.bind(null,"uniformMatrix4x2fv",Kr,8,ln)),h()(Vr,35690,sn.bind(null,"uniformMatrix4x3fv",Kr,12,ln)),h()(Vr,35678,un),h()(Vr,35680,un),h()(Vr,35679,un),h()(Vr,35682,un),h()(Vr,36289,un),h()(Vr,36292,un),h()(Vr,36293,un),h()(Vr,36298,un),h()(Vr,36299,un),h()(Vr,36300,un),h()(Vr,36303,un),h()(Vr,36306,un),h()(Vr,36307,un),h()(Vr,36308,un),h()(Vr,36311,un),Vr),Yr={},qr={},Qr={},$r=[0];function Jr(t,e,r,n){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&($r[0]=t,t=$r);var i=t.length;if(i%e&&j.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof r)return t;var a=n[i];a||(a=new r(i),n[i]=a);for(var o=0;o<i;o++)a[o]=t[o];return a}function Kr(t,e){return Jr(t,e,Float32Array,Yr)}function Zr(t,e){return Jr(t,e,Int32Array,qr)}function tn(t,e){return Jr(t,e,Uint32Array,Qr)}function en(t,e,r){var n=Wr[r.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(r.type));return n().bind(null,t,e)}function rn(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};var e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function nn(t,e,r){for(var n in t){var i=t[n];if((!r||Boolean(r[n]))&&!an(i))throw e=e?"".concat(e," "):"",console.error("".concat(e," Bad uniform ").concat(n),i),new Error("".concat(e," Bad uniform ").concat(n))}return!0}function an(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;for(var e=Math.min(t.length,16),r=0;r<e;++r)if(!Number.isFinite(t[r]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof Be||(t instanceof nr||t instanceof kr&&Boolean(t.texture))))}function on(t,e,r){if(Array.isArray(r)||ArrayBuffer.isView(r))if(t[e])for(var n=t[e],i=0,a=r.length;i<a;++i)n[i]=r[i];else t[e]=r.slice();else t[e]=r}function un(){var t=null;return function(e,r,n){var i=t!==n;return i&&(e.uniform1i(r,n),t=n),i}}function sn(t,e,r,n){var i=null,a=null;return function(o,u,s){var c=e(s,r),l=c.length,f=!1;if(null===i)i=new Float32Array(l),a=l,f=!0;else{Yt(a===l,"Uniform length cannot change.");for(var h=0;h<l;++h)if(c[h]!==i[h]){f=!0;break}}return f&&(n(o,t,u,c),i.set(c)),f}}function cn(t,e,r,n){t[e](r,n)}function ln(t,e,r,n){t[e](r,!1,n)}var fn=(Gr={},h()(Gr,5126,[5126,1,"float"]),h()(Gr,35664,[5126,2,"vec2"]),h()(Gr,35665,[5126,3,"vec3"]),h()(Gr,35666,[5126,4,"vec4"]),h()(Gr,5124,[5124,1,"int"]),h()(Gr,35667,[5124,2,"ivec2"]),h()(Gr,35668,[5124,3,"ivec3"]),h()(Gr,35669,[5124,4,"ivec4"]),h()(Gr,5125,[5125,1,"uint"]),h()(Gr,36294,[5125,2,"uvec2"]),h()(Gr,36295,[5125,3,"uvec3"]),h()(Gr,36296,[5125,4,"uvec4"]),h()(Gr,35670,[5126,1,"bool"]),h()(Gr,35671,[5126,2,"bvec2"]),h()(Gr,35672,[5126,3,"bvec3"]),h()(Gr,35673,[5126,4,"bvec4"]),h()(Gr,35674,[5126,8,"mat2"]),h()(Gr,35685,[5126,8,"mat2x3"]),h()(Gr,35686,[5126,8,"mat2x4"]),h()(Gr,35675,[5126,12,"mat3"]),h()(Gr,35687,[5126,12,"mat3x2"]),h()(Gr,35688,[5126,12,"mat3x4"]),h()(Gr,35676,[5126,16,"mat4"]),h()(Gr,35689,[5126,16,"mat4x2"]),h()(Gr,35690,[5126,16,"mat4x3"]),Gr);function hn(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Yt(!1),0}}function dn(t){var e=fn[t];if(!e)return null;var r=at()(e,2);return{type:r[0],components:r[1]}}function gn(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=5126}for(var r in fn){var n=at()(fn[r],3),i=n[0],a=n[1],o=n[2];if(i===t&&a===e)return{glType:r,name:o}}return null}var vn=function(){function t(e){i()(this,t),this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}return o()(t,[{key:"getAttributeInfo",value:function(t){var e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}},{key:"getAttributeLocation",value:function(t){var e=this.getAttributeInfo(t);return e?e.location:-1}},{key:"getAttributeAccessor",value:function(t){var e=this.getAttributeInfo(t);return e?e.accessor:null}},{key:"getVaryingInfo",value:function(t){var e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}},{key:"getVaryingIndex",value:function(t){var e=this.getVaryingInfo();return e?e.location:-1}},{key:"getVaryingAccessor",value:function(t){var e=this.getVaryingInfo();return e?e.accessor:null}},{key:"_readAttributesFromProgram",value:function(t){for(var e=t.gl,r=e.getProgramParameter(t.handle,35721),n=0;n<r;n++){var i=e.getActiveAttrib(t.handle,n),a=i.name,o=i.type,u=i.size,s=e.getAttribLocation(t.handle,a);s>=0&&this._addAttribute(s,a,o,u)}this.attributeInfos.sort((function(t,e){return t.location-e.location}))}},{key:"_readVaryingsFromProgram",value:function(t){var e=t.gl;if(M(e)){for(var r=e.getProgramParameter(t.handle,35971),n=0;n<r;n++){var i=e.getTransformFeedbackVarying(t.handle,n),a=i.name,o=i.type,u=i.size;this._addVarying(n,a,o,u)}this.varyingInfos.sort((function(t,e){return t.location-e.location}))}}},{key:"_addAttribute",value:function(t,e,r,n){var i=dn(r),a={type:i.type,size:n*i.components};this._inferProperties(t,e,a);var o={location:t,name:e,accessor:new ge(a)};this.attributeInfos.push(o),this.attributeInfosByLocation[t]=o,this.attributeInfosByName[o.name]=o}},{key:"_inferProperties",value:function(t,e,r){/instance/i.test(e)&&(r.divisor=1)}},{key:"_addVarying",value:function(t,e,r,n){var i=dn(r),a=i.type,o=i.components,u={location:t,name:e,accessor:new ge({type:a,size:n*o})};this.varyingInfos.push(u),this.varyingInfosByName[u.name]=u}}]),t}();function yn(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return mn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var pn=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"],_n=function(t){Gt()(r,t);var e=bn(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).stubRemovedMethods("Program","v6.0",pn),n._isCached=!1,n.initialize(a),Object.seal(Ut()(n)),n._setId(a.id),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Program"}}]),o()(r,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.hash,r=t.vs,n=t.fs,i=t.varyings,a=t.bufferMode,o=void 0===a?35981:a;return this.hash=e||"",this.vs="string"==typeof r?new Hr(this.gl,{id:"".concat(t.id,"-vs"),source:r}):r,this.fs="string"==typeof n?new Xr(this.gl,{id:"".concat(t.id,"-fs"),source:n}):n,Yt(this.vs instanceof Hr),Yt(this.fs instanceof Xr),this.uniforms={},this._textureUniforms={},i&&i.length>0&&(V(this.gl),this.varyings=i,this.gl2.transformFeedbackVaryings(this.handle,i,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new vn(this),this.setProps(t)}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Je()(Wt()(r.prototype),"delete",this).call(this,t)}},{key:"setProps",value:function(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}},{key:"draw",value:function(t){var e=this,r=t.logPriority,n=t.drawMode,i=void 0===n?4:n,a=t.vertexCount,o=t.offset,u=void 0===o?0:o,s=t.start,c=t.end,l=t.isIndexed,f=void 0!==l&&l,h=t.indexType,d=void 0===h?5123:h,g=t.instanceCount,v=void 0===g?0:g,y=t.isInstanced,m=void 0===y?v>0:y,b=t.vertexArray,p=void 0===b?null:b,_=t.transformFeedback,A=t.framebuffer,x=t.parameters,w=void 0===x?{}:x,T=t.uniforms,E=t.samplers;if((T||E)&&(j.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(T||{})),j.priority>=r){var k=A?A.id:"default",S="mode=".concat(Qt(this.gl,i)," verts=").concat(a," ")+"instances=".concat(v," indexType=").concat(Qt(this.gl,d)," ")+"isInstanced=".concat(m," isIndexed=").concat(f," ")+"Framebuffer=".concat(k);j.log(r,S)()}return Yt(p),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===a||m&&0===v)&&(p.bindForDraw(a,v,(function(){if(void 0!==A&&(w=Object.assign({},w,{framebuffer:A})),_){var t=hn(i);_.begin(t)}e._bindTextures(),Lt(e.gl,w,(function(){f&&m?e.gl2.drawElementsInstanced(i,a,d,u,v):f&&M(e.gl)&&!isNaN(s)&&!isNaN(c)?e.gl2.drawRangeElements(i,s,c,a,d,u):f?e.gl.drawElements(i,a,d,u):m?e.gl2.drawArraysInstanced(i,u,a,v):e.gl.drawArrays(i,u,a)})),_&&_.end()})),!0)}},{key:"setUniforms",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in j.priority>=2&&nn(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle),t){var r=t[e],n=this._uniformSetters[e];if(n){var i=r,a=!1;if(i instanceof kr&&(i=i.texture),i instanceof Be)if(a=this.uniforms[e]!==r){void 0===n.textureIndex&&(n.textureIndex=this._textureIndexCounter++);var o=i,u=n.textureIndex;o.bind(u),i=u,this._textureUniforms[e]=o}else i=n.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(n(i)||a)&&on(this.uniforms,e,r)}}return this}},{key:"_areTexturesRenderable",value:function(){var t=!0;for(var e in this._textureUniforms){var r=this._textureUniforms[e];r.update(),t=t&&r.loaded}return t}},{key:"_bindTextures",value:function(){for(var t in this._textureUniforms){var e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(t){var e,r={},n=yn(this.gl.getAttachedShaders(t));try{for(n.s();!(e=n.n()).done;){var i=e.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:r.vs=new Hr({handle:i});break;case 35632:r.fs=new Xr({handle:i})}}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"_getParameter",value:function(t){return this.gl.getProgramParameter(this.handle,t)}},{key:"_setId",value:function(t){if(!t){var e=this._getName();this.id=Jt(e)}}},{key:"_getName",value:function(){var t=this.vs.getName()||this.fs.getName();return t=(t=t.replace(/shader/i,""))?"".concat(t,"-program"):"program"}},{key:"_compileAndLink",value:function(){var t=this.gl;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),j.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),j.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||j.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var t=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var e=0;e<this._uniformCount;e++){var r=this.gl.getActiveUniform(this.handle,e),n=rn(r.name).name,i=t.getUniformLocation(this.handle,n);if(this._uniformSetters[n]=en(t,i,r),r.size>1)for(var a=0;a<r.size;a++)i=t.getUniformLocation(this.handle,"".concat(n,"[").concat(a,"]")),this._uniformSetters["".concat(n,"[").concat(a,"]")]=en(t,i,r)}this._textureIndexCounter=0}},{key:"getActiveUniforms",value:function(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}},{key:"getUniformBlockIndex",value:function(t){return this.gl2.getUniformBlockIndex(this.handle,t)}},{key:"getActiveUniformBlockParameter",value:function(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}},{key:"uniformBlockBinding",value:function(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}]),r}(ie);function An(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return xn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var Tn=function(t){Gt()(r,t);var e=wn(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),(n=e.call(this,t,a)).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"Query"}}],[{key:"isSupported",value:function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=M(t),i=_r(t,vr.TIMER_QUERY),a=n||i,o=An(r);try{for(o.s();!(e=o.n()).done;){var u=e.value;switch(u){case"queries":a=a&&n;break;case"timers":a=a&&i;break;default:Yt(!1)}}}catch(t){o.e(t)}finally{o.f()}return a}}]),o()(r,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.conservative,r=void 0!==e&&e;return this.begin(r?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}},{key:"end",value:function(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}},{key:"isTimerDisjoint",value:function(){return this.gl2.getParameter(36795)}},{key:"getResult",value:function(){return this.gl2.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var r=0;return this._pollingPromise=new Promise((function(n,i){requestAnimationFrame((function a(){t.isResultAvailable()?(n(t.getResult()),t._pollingPromise=null):r++>e?(i("Timed out"),t._pollingPromise=null):requestAnimationFrame(a)}))})),this._pollingPromise}},{key:"_createHandle",value:function(){return r.isSupported(this.gl)?this.gl2.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl2.deleteQuery(this.handle)}}]),r}(ie);function En(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var kn=function(t){Gt()(r,t);var e=En(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,r),V(t),(n=e.call(this,t,a)).initialize(a),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"TransformFeedback"}}],[{key:"isSupported",value:function(t){return M(t)}}]),o()(r,[{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Zt(this.buffers)||this.bind((function(){return t._unbindBuffers()})),this.setProps(e),this}},{key:"setProps",value:function(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}},{key:"setBuffers",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind((function(){for(var r in e)t.setBuffer(r,e[r])})),this}},{key:"setBuffer",value:function(t,e){var r=this,n=this._getVaryingIndex(t),i=this._getBufferParams(e),a=i.buffer,o=i.byteSize,u=i.byteOffset;return n<0?(this.unused[t]=a,j.warn((function(){return"".concat(r.id," unused varying buffer ").concat(t)}))(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,a,u,o),this)}},{key:"begin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(t){var e,r,n;return t instanceof xe==!1?(n=t.buffer,r=t.byteSize,e=t.byteOffset):n=t,void 0===e&&void 0===r||(e=e||0,r=r||n.byteLength-e),{buffer:n,byteOffset:e,byteSize:r}}},{key:"_getVaryingInfo",value:function(t){return this.configuration&&this.configuration.getVaryingInfo(t)}},{key:"_getVaryingIndex",value:function(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;var e=Number(t);return Number.isFinite(e)?e:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var t in this.buffers){var e=this._getBufferParams(this.buffers[t]),r=e.buffer,n=e.byteSize,i=e.byteOffset;this._bindBuffer(t,r,i,n)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var t in this.buffers)this._bindBuffer(t,null)}},{key:"_bindBuffer",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,i=e&&e.handle;return i&&void 0!==n?this.gl.bindBufferRange(35982,t,i,r,n):this.gl.bindBufferBase(35982,t,i),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(t){this.gl.bindTransformFeedback(36386,this.handle)}}]),r}(ie),Sn=null;function On(t,e){var r;return new t((r=t.BYTES_PER_ELEMENT*e,(!Sn||Sn.byteLength<r)&&(Sn=new ArrayBuffer(r)),Sn),0,e)}var Ln=r(15);function Fn(t){if(!t&&!Object(d.a)())return"Node";if(Object(Ln.a)(t))return"Electron";var e="undefined"!=typeof navigator?navigator:{},r=t||e.userAgent||"";if(r.indexOf("Edge")>-1)return"Edge";var n=-1!==r.indexOf("MSIE "),i=-1!==r.indexOf("Trident/");return n||i?"IE":T.b.chrome?"Chrome":T.b.safari?"Safari":T.b.mozInnerScreenX?"Firefox":"Unknown"}function Rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt()(t);if(e){var i=Wt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht()(this,r)}}var In="elements must be GL.ELEMENT_ARRAY_BUFFER",Bn=function(t){Gt()(r,t);var e=Rn(r);function r(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,r);var o=a.id||a.program&&a.program.id;return(n=e.call(this,t,Object.assign({},a,{id:o}))).buffer=null,n.bufferValue=null,n.isDefaultArray=a.isDefaultArray||!1,n.gl2=t,n.initialize(a),Object.seal(Ut()(n)),n}return o()(r,[{key:Symbol.toStringTag,get:function(){return"VertexArrayObject"}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!e.constantAttributeZero||(M(t)||"Chrome"===Fn())}},{key:"getDefaultArray",value:function(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new r(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(t){return r.MAX_ATTRIBUTES=r.MAX_ATTRIBUTES||t.getParameter(34921),r.MAX_ATTRIBUTES}},{key:"setConstant",value:function(t,e,n){switch(n.constructor){case Float32Array:r._setConstantFloatArray(t,e,n);break;case Int32Array:r._setConstantIntArray(t,e,n);break;case Uint32Array:r._setConstantUintArray(t,e,n);break;default:Yt(!1)}}}]),o()(r,[{key:"delete",value:function(){return Je()(Wt()(r.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete(),this}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}},{key:"setProps",value:function(t){return this}},{key:"setElementBuffer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Yt(!e||34963===e.target,In),this.bind((function(){t.gl.bindBuffer(34963,e?e.handle:null)})),this}},{key:"setBuffer",value:function(t,e,r){if(34963===e.target)return this.setElementBuffer(e,r);var n=r.size,i=r.type,a=r.stride,o=r.offset,u=r.normalized,s=r.integer,c=r.divisor,l=this.gl,f=this.gl2;return t=Number(t),this.bind((function(){l.bindBuffer(34962,e.handle),s?(Yt(M(l)),f.vertexAttribIPointer(t,n,i,a,o)):l.vertexAttribPointer(t,n,i,u,a,o),l.enableVertexAttribArray(t),f.vertexAttribDivisor(t,c||0)})),this}},{key:"enable",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!n&&0===t&&!r.isSupported(this.gl,{constantAttributeZero:!0});return i||(t=Number(t),this.bind((function(){return n?e.gl.enableVertexAttribArray(t):e.gl.disableVertexAttribArray(t)}))),this}},{key:"getConstantBuffer",value:function(t,e){var r=this._normalizeConstantArrayValue(e),n=r.byteLength*t,i=r.length*t,a=!this.buffer;if(this.buffer=this.buffer||new xe(this.gl,n),a=(a=a||this.buffer.reallocate(n))||!this._compareConstantArrayValues(r,this.bufferValue)){var o=On(e.constructor,i);!function(t){for(var e=t.target,r=t.source,n=t.start,i=void 0===n?0:n,a=t.count,o=void 0===a?1:a,u=r.length,s=o*u,c=0,l=i;c<u;c++)e[l++]=r[c];for(;c<s;)c<s-c?(e.copyWithin(i+c,i,i+c),c*=2):(e.copyWithin(i+c,i,i+s-c),c=s)}({target:o,source:r,start:0,count:i}),this.buffer.subData(o),this.bufferValue=e}return this.buffer}},{key:"_normalizeConstantArrayValue",value:function(t){return Array.isArray(t)?new Float32Array(t):t}},{key:"_compareConstantArrayValues",value:function(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}},{key:"_createHandle",value:function(){return this.gl.createVertexArray()}},{key:"_deleteHandle",value:function(t){return this.gl2.deleteVertexArray(t),[this.elements]}},{key:"_bindHandle",value:function(t){this.gl2.bindVertexArray(t)}},{key:"_getParameter",value:function(t,e){var r=this,n=e.location;return Yt(Number.isFinite(n)),this.bind((function(){switch(t){case 34373:return r.gl.getVertexAttribOffset(n,t);default:return r.gl.getVertexAttrib(n,t)}}))}},{key:"MAX_ATTRIBUTES",get:function(){return r.getMaxAttributes(this.gl)}}],[{key:"_setConstantFloatArray",value:function(t,e,r){switch(r.length){case 1:t.vertexAttrib1fv(e,r);break;case 2:t.vertexAttrib2fv(e,r);break;case 3:t.vertexAttrib3fv(e,r);break;case 4:t.vertexAttrib4fv(e,r);break;default:Yt(!1)}}},{key:"_setConstantIntArray",value:function(t,e,r){switch(Yt(M(t)),r.length){case 1:t.vertexAttribI1iv(e,r);break;case 2:t.vertexAttribI2iv(e,r);break;case 3:t.vertexAttribI3iv(e,r);break;case 4:t.vertexAttribI4iv(e,r);break;default:Yt(!1)}}},{key:"_setConstantUintArray",value:function(t,e,r){switch(Yt(M(t)),r.length){case 1:t.vertexAttribI1uiv(e,r);break;case 2:t.vertexAttribI2uiv(e,r);break;case 3:t.vertexAttribI3uiv(e,r);break;case 4:t.vertexAttribI4uiv(e,r);break;default:Yt(!1)}}}]),r}(ie),Pn=/^(.+)__LOCATION_([0-9]+)$/,Dn=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],jn=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t);var n=r.id||r.program&&r.program.id;this.id=n,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Bn(e),te(this,"VertexArray","v6.0",Dn),this.initialize(r),Object.seal(this)}return o()(t,[{key:"delete",value:function(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}},{key:"reset",value:function(){this.elements=null,this.elementsAccessor=null;var t=this.vertexArrayObject.MAX_ATTRIBUTES;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}},{key:"setProps",value:function(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}},{key:"clearDrawParams",value:function(){this.drawParams=null}},{key:"getDrawParams",value:function(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}},{key:"setAttributes",value:function(t){var e=this;return Object.assign(this.attributes,t),this.vertexArrayObject.bind((function(){for(var r in t){var n=t[r];e._setAttribute(r,n)}e.gl.bindBuffer(34962,null)})),this}},{key:"setElementBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}},{key:"setBuffer",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,r);var n=this._resolveLocationAndAccessor(t,e,e.accessor,r),i=n.location,a=n.accessor;return i>=0&&(this.values[i]=e,this.accessors[i]=a,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,a)),this}},{key:"setConstant",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},r)),i=n.location,a=n.accessor;return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=a,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}},{key:"unbindBuffers",value:function(){var t=this;return this.vertexArrayObject.bind((function(){t.elements&&t.vertexArrayObject.setElementBuffer(null),t.buffer=t.buffer||new xe(t.gl,{accessor:{size:4}});for(var e=0;e<t.vertexArrayObject.MAX_ATTRIBUTES;e++)t.values[e]instanceof xe&&(t.gl.disableVertexAttribArray(e),t.gl.bindBuffer(34962,t.buffer.handle),t.gl.vertexAttribPointer(e,1,5126,!1,0,0))})),this}},{key:"bindBuffers",value:function(){var t=this;return this.vertexArrayObject.bind((function(){t.elements&&t.setElementBuffer(t.elements);for(var e=0;e<t.vertexArrayObject.MAX_ATTRIBUTES;e++){var r=t.values[e];r instanceof xe&&t.setBuffer(e,r)}})),this}},{key:"bindForDraw",value:function(t,e,r){var n,i=this;return this.vertexArrayObject.bind((function(){i._setConstantAttributes(t,e),n=r()})),n}},{key:"_resolveLocationAndAccessor",value:function(t,e,r,n){var i=this,a={location:-1,accessor:null},o=this._getAttributeIndex(t),u=o.location,s=o.name;if(!Number.isFinite(u)||u<0)return this.unused[t]=e,j.once(3,(function(){return"unused value ".concat(t," in ").concat(i.id)}))(),a;var c=this._getAttributeInfo(s||u);if(!c)return a;var l=this.accessors[u]||{},f=ge.resolve(c.accessor,l,r,n),h=f.size,d=f.type;return Yt(Number.isFinite(h)&&Number.isFinite(d)),{location:u,accessor:f}}},{key:"_getAttributeInfo",value:function(t){return this.configuration&&this.configuration.getAttributeInfo(t)}},{key:"_getAttributeIndex",value:function(t){var e=Number(t);if(Number.isFinite(e))return{location:e};var r=Pn.exec(t),n=r?r[1]:t,i=r?Number(r[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(n)+i,name:n}:{location:-1}}},{key:"_setAttribute",value:function(t,e){if(e instanceof xe)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof xe){var r=e[0],n=e[1];this.setBuffer(t,r,n)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){var i=e;this.setConstant(t,i)}else{if(!(e.buffer instanceof xe))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");var a=e;this.setBuffer(t,a.buffer,a)}}},{key:"_setConstantAttributes",value:function(t,e){var r=Math.max(0|t,0|e),n=this.values[0];ArrayBuffer.isView(n)&&this._setConstantAttributeZero(n,r);for(var i=1;i<this.vertexArrayObject.MAX_ATTRIBUTES;i++)n=this.values[i],ArrayBuffer.isView(n)&&this._setConstantAttribute(i,n)}},{key:"_setConstantAttributeZero",value:function(t,e){if(Bn.isSupported(this.gl,{constantAttributeZero:!0}))this._setConstantAttribute(0,t);else{var r=this.vertexArrayObject.getConstantBuffer(e,t);this.vertexArrayObject.setBuffer(0,r,this.accessors[0])}}},{key:"_setConstantAttribute",value:function(t,e){Bn.setConstant(this.gl,t,e)}},{key:"_updateDrawParams",value:function(){for(var t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0},e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}},{key:"_updateDrawParamsForLocation",value:function(t,e){var r=this.values[e],n=this.accessors[e];if(r){var i=n.divisor>0;if(t.isInstanced=t.isInstanced||i,r instanceof xe){var a=r;if(i){var o=a.getVertexCount(n);t.instanceCount=Math.min(t.instanceCount,o)}else{var u=a.getVertexCount(n);t.vertexCount=Math.min(t.vertexCount,u)}}}}},{key:"setElements",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return j.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}]),t}(),Nn=function(){function t(e){var r;for(var n in i()(this,t),this.layout={},this.size=0,e)this._addUniform(n,e[n]);this.size+=(4-this.size%4)%4;var a=new Float32Array(this.size);this.typedArray=(r={},h()(r,5126,a),h()(r,5124,new Int32Array(a.buffer)),h()(r,5125,new Uint32Array(a.buffer)),r)}return o()(t,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[5126]}},{key:"getSubData",value:function(t){var e,r;if(void 0===t)e=this.data,r=0;else{var n=this.offsets[t],i=n+this.sizes[t];e=this.data.subarray(n,i),r=4*n}return{data:e,offset:r}}},{key:"setUniforms",value:function(t){for(var e in t)this._setValue(e,t[e]);return this}},{key:"_setValue",value:function(t,e){var r=this.layout[t];Yt(r,"UniformLayoutStd140 illegal argument");var n=this.typedArray[r.type];1===r.size?n[r.offset]=e:n.set(e,r.offset)}},{key:"_addUniform",value:function(t,e){var r=dn(e);Yt(r,"UniformBufferLayout illegal argument");var n=r.type,i=r.components;this.size=this._alignTo(this.size,i);var a=this.size;this.size+=i,this.layout[t]={type:n,size:i,offset:a}}},{key:"_alignTo",value:function(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}}]),t}();function Cn(t){var e=100,r=t.match(/[^\s]+/g);if(r.length>=2&&"#version"===r[0]){var n=parseInt(r[1],10);Number.isFinite(n)&&(e=n)}return e}function Mn(t,e){for(var r=e.maxElts,n=void 0===r?16:r,i=e.size,a=void 0===i?1:i,o="[",u=0;u<t.length&&u<n;++u)u>0&&(o+=",".concat(u%a==0?" ":"")),o+=Un(t[u],e);var s=t.length>n?"...":"]";return"".concat(o).concat(s)}function Un(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=1e-16,n=e.isInteger,i=void 0!==n&&n;if(Array.isArray(t)||ArrayBuffer.isView(t))return Mn(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<r)return i?"0":"0.";if(i)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);var a=t.toPrecision(2),o=a.indexOf(".0");return o===a.length-2?a.slice(0,-1):a}function Vn(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Gn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Gn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zn(t){var e=t.header,r=void 0===e?"Uniforms":e,n=t.program,i=t.uniforms,a=t.undefinedOnly,o=void 0!==a&&a;Yt(n);var u,s=n._uniformSetters,c={},l=Object.keys(s).sort(),f=0,d=Vn(l);try{for(d.s();!(u=d.n()).done;){var g=u.value;g.match(".*_.*")||g.match(".*Matrix")||Hn({table:c,header:r,uniforms:i,uniformName:g,undefinedOnly:o})&&f++}}catch(t){d.e(t)}finally{d.f()}var v,y=Vn(l);try{for(y.s();!(v=y.n()).done;){var m=v.value;m.match(".*Matrix")&&Hn({table:c,header:r,uniforms:i,uniformName:m,undefinedOnly:o})&&f++}}catch(t){y.e(t)}finally{y.f()}var b,p=Vn(l);try{for(p.s();!(b=p.n()).done;){var _=b.value;c[_]||Hn({table:c,header:r,uniforms:i,uniformName:_,undefinedOnly:o})&&f++}}catch(t){p.e(t)}finally{p.f()}var A=0,x={};if(!o)for(var w in i){var T=i[w];c[w]||(A++,x[w]=h()({Type:"NOT USED: ".concat(T)},r,Un(T)))}return{table:c,count:f,unusedTable:x,unusedCount:A}}function Hn(t){var e,r=t.table,n=t.header,i=t.uniforms,a=t.uniformName,o=t.undefinedOnly,u=i[a],s=function(t){return null!=t}(u);return(!o||!s)&&(r[a]=(e={},h()(e,n,s?Un(u):"N/A"),h()(e,"Uniform Type",s?u:"NOT PROVIDED"),e),!0)}function Xn(t){var e=t.vertexArray,r=t.header,n=void 0===r?"Attributes":r;if(!e.configuration)return{};var i={};e.elements&&(i.ELEMENT_ARRAY_BUFFER=Wn(e,e.elements,null,n));var a=e.values;for(var o in a){var u=e._getAttributeInfo(o);if(u){var s="".concat(o,": ").concat(u.name),c=e.accessors[u.location];c&&(s="".concat(o,": ").concat(Yn(u.name,c))),i[s]=Wn(e,a[o],c,n)}}return i}function Wn(t,e,r,n){var i,a,o=t.gl;if(!e)return a={},h()(a,n,"null"),h()(a,"Format ","N/A"),a;var u,s,c,l="NOT PROVIDED",f=1,d=0,g=0;if(r&&(l=r.type,f=r.size,u=-1!==(l=String(l).replace("Array","")).indexOf("nt")),e instanceof xe){var v,y,m=e,b=m.getDebugData(),p=b.data;if(s=b.changed?"*":"",c=p,d=(g=m.byteLength)/p.BYTES_PER_ELEMENT/f,r){var _=r.divisor>0;y="".concat(_?"I ":"P "," ").concat(d," (x").concat(f,"=").concat(g," bytes ").concat(Qt(o,l),")")}else u=!0,y="".concat(g," bytes");return v={},h()(v,n,"".concat(s).concat(Un(c,{size:f,isInteger:u}))),h()(v,"Format ",y),v}return c=e,f=e.length,u=-1!==(l=String(e.constructor.name).replace("Array","")).indexOf("nt"),i={},h()(i,n,"".concat(Un(c,{size:f,isInteger:u})," (constant)")),h()(i,"Format ","".concat(f,"x").concat(l," (constant)")),i}function Yn(t,e){var r=gn(e.type,e.size);return r?"".concat(t," (").concat(r.name,")"):t}function qn(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Qn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Qn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $n(t){var e,r={},n="Accessors for ".concat(t.id),i=qn(t.attributeInfos);try{for(i.s();!(e=i.n()).done;){var a=e.value;if(a){var o=Jn(a);r["in ".concat(o)]=h()({},n,JSON.stringify(a.accessor))}}}catch(t){i.e(t)}finally{i.f()}var u,s=qn(t.varyingInfos);try{for(s.s();!(u=s.n()).done;){var c=u.value;if(c){var l=Jn(c);r["out ".concat(l)]=h()({},n,JSON.stringify(c.accessor))}}}catch(t){s.e(t)}finally{s.f()}return r}function Jn(t){var e=t.accessor,r=gn(e.type,e.size);return r?"".concat(r.name," ").concat(t.name):t.name}},,function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return o}));var n=r(8),i=r.n(n),a=r(21);function o(){return!("object"===(void 0===t?"undefined":i()(t))&&"[object process]"===String(t)&&!t.browser)||Object(a.a)()}}).call(this,r(11))}])}));
|
package/dist/es5/init.js
CHANGED
|
@@ -17,7 +17,7 @@ var _probe = require("probe.gl");
|
|
|
17
17
|
|
|
18
18
|
var _env = require("@probe.gl/env");
|
|
19
19
|
|
|
20
|
-
var VERSION = typeof "8.5.
|
|
20
|
+
var VERSION = typeof "8.5.13" !== 'undefined' ? "8.5.13" : 'untranspiled source';
|
|
21
21
|
var STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
|
|
22
22
|
|
|
23
23
|
var StatsManager = function () {
|
package/dist/esm/init.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { log } from '@luma.gl/gltools';
|
|
2
2
|
import { Stats } from 'probe.gl';
|
|
3
3
|
import { isBrowser } from '@probe.gl/env';
|
|
4
|
-
const VERSION = typeof "8.5.
|
|
4
|
+
const VERSION = typeof "8.5.13" !== 'undefined' ? "8.5.13" : 'untranspiled source';
|
|
5
5
|
const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
|
|
6
6
|
|
|
7
7
|
class StatsManager {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/webgl",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.13",
|
|
4
4
|
"description": "WebGL2 Classes",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/runtime": "^7.0.0",
|
|
38
|
-
"@luma.gl/constants": "8.5.
|
|
39
|
-
"@luma.gl/gltools": "8.5.
|
|
38
|
+
"@luma.gl/constants": "8.5.13",
|
|
39
|
+
"@luma.gl/gltools": "8.5.13",
|
|
40
40
|
"@probe.gl/env": "^3.5.0",
|
|
41
41
|
"probe.gl": "^3.4.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "a46f53790803d9986e6bdf509828496f154f7c34"
|
|
44
44
|
}
|