@loaders.gl/textures 3.0.13 → 3.0.14

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.
Files changed (71) hide show
  1. package/dist/basis-worker.js +1 -1
  2. package/dist/basis-worker.js.map +1 -1
  3. package/dist/compressed-texture-worker.js +1 -1
  4. package/dist/compressed-texture-worker.js.map +1 -1
  5. package/dist/crunch-worker.js +1 -1
  6. package/dist/crunch-worker.js.map +1 -1
  7. package/dist/dist.es5.min.js +1 -1
  8. package/dist/dist.es5.min.js.map +1 -1
  9. package/dist/dist.min.js +1 -1
  10. package/dist/dist.min.js.map +1 -1
  11. package/dist/es5/basis-loader.js +13 -5
  12. package/dist/es5/basis-loader.js.map +1 -1
  13. package/dist/es5/bundle.js +2 -2
  14. package/dist/es5/bundle.js.map +1 -1
  15. package/dist/es5/compressed-texture-loader.js +41 -6
  16. package/dist/es5/compressed-texture-loader.js.map +1 -1
  17. package/dist/es5/compressed-texture-writer.js +2 -2
  18. package/dist/es5/compressed-texture-writer.js.map +1 -1
  19. package/dist/es5/crunch-loader.js +2 -2
  20. package/dist/es5/crunch-loader.js.map +1 -1
  21. package/dist/es5/index.js +14 -14
  22. package/dist/es5/lib/encoders/encode-ktx.js +1 -1
  23. package/dist/es5/lib/encoders/encode-ktx.js.map +1 -1
  24. package/dist/es5/lib/encoders/encode-texture.js +41 -13
  25. package/dist/es5/lib/encoders/encode-texture.js.map +1 -1
  26. package/dist/es5/lib/gl-constants.js +1 -1
  27. package/dist/es5/lib/gl-constants.js.map +1 -1
  28. package/dist/es5/lib/parsers/basis-module-loader.js +98 -22
  29. package/dist/es5/lib/parsers/basis-module-loader.js.map +1 -1
  30. package/dist/es5/lib/parsers/crunch-module-loader.js +71 -15
  31. package/dist/es5/lib/parsers/crunch-module-loader.js.map +1 -1
  32. package/dist/es5/lib/parsers/parse-basis.js +84 -46
  33. package/dist/es5/lib/parsers/parse-basis.js.map +1 -1
  34. package/dist/es5/lib/parsers/parse-crunch.js +76 -55
  35. package/dist/es5/lib/parsers/parse-crunch.js.map +1 -1
  36. package/dist/es5/lib/parsers/parse-dds.js +21 -21
  37. package/dist/es5/lib/parsers/parse-dds.js.map +1 -1
  38. package/dist/es5/lib/parsers/parse-ktx.js +16 -14
  39. package/dist/es5/lib/parsers/parse-ktx.js.map +1 -1
  40. package/dist/es5/lib/parsers/parse-npy.js +28 -25
  41. package/dist/es5/lib/parsers/parse-npy.js.map +1 -1
  42. package/dist/es5/lib/parsers/parse-pvr.js +21 -21
  43. package/dist/es5/lib/parsers/parse-pvr.js.map +1 -1
  44. package/dist/es5/lib/texture-api/async-deep-map.js +156 -27
  45. package/dist/es5/lib/texture-api/async-deep-map.js.map +1 -1
  46. package/dist/es5/lib/texture-api/deep-load.js +67 -6
  47. package/dist/es5/lib/texture-api/deep-load.js.map +1 -1
  48. package/dist/es5/lib/texture-api/generate-url.js +11 -7
  49. package/dist/es5/lib/texture-api/generate-url.js.map +1 -1
  50. package/dist/es5/lib/texture-api/load-image-array.js +76 -12
  51. package/dist/es5/lib/texture-api/load-image-array.js.map +1 -1
  52. package/dist/es5/lib/texture-api/load-image-cube.js +96 -27
  53. package/dist/es5/lib/texture-api/load-image-cube.js.map +1 -1
  54. package/dist/es5/lib/texture-api/load-image.js +145 -39
  55. package/dist/es5/lib/texture-api/load-image.js.map +1 -1
  56. package/dist/es5/lib/utils/extract-mipmap-images.js +9 -9
  57. package/dist/es5/lib/utils/extract-mipmap-images.js.map +1 -1
  58. package/dist/es5/lib/utils/ktx-format-helper.js +1 -1
  59. package/dist/es5/lib/utils/ktx-format-helper.js.map +1 -1
  60. package/dist/es5/lib/utils/texture-formats.js +27 -9
  61. package/dist/es5/lib/utils/texture-formats.js.map +1 -1
  62. package/dist/es5/lib/utils/version.js +1 -1
  63. package/dist/es5/lib/utils/version.js.map +1 -1
  64. package/dist/es5/npy-loader.js +42 -7
  65. package/dist/es5/npy-loader.js.map +1 -1
  66. package/dist/es5/workers/crunch-worker.js +11 -2
  67. package/dist/es5/workers/crunch-worker.js.map +1 -1
  68. package/dist/esm/lib/utils/version.js +1 -1
  69. package/dist/npy-worker.js +1 -1
  70. package/dist/npy-worker.js.map +1 -1
  71. package/package.json +5 -5
package/dist/dist.min.js CHANGED
@@ -1,2 +1,2 @@
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 n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return _})),n.d(e,"c",(function(){return a}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.global||i.self||i.window||{},_="object"!=typeof r||"[object process]"!==String(r)||r.browser,a="function"==typeof importScripts,s=("undefined"!=typeof window&&window.orientation,void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version));s&&parseFloat(s[1])}).call(this,n(3),n(6))},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return _}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.global||i.self||i.window,_="object"!=typeof r||"[object process]"!==String(r)||r.browser,a=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);a&&parseFloat(a[1])}).call(this,n(3),n(6))},function(t,e){},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},,,function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function _(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:_}catch(t){r=_}}();var s,c=[],S=!1,E=-1;function u(){S&&s&&(S=!1,s.length?c=s.concat(c):E=-1,c.length&&R())}function R(){if(!S){var t=a(u);S=!0;for(var e=c.length;e;){for(s=c,c=[];++E<e;)s&&s[E].run();E=-1,e=c.length}s=null,S=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===_||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function A(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new f(t,e)),1!==c.length||S||a(R)},f.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=A,i.addListener=A,i.once=A,i.off=A,i.removeListener=A,i.removeAllListeners=A,i.emit=A,i.prependListener=A,i.prependOnceListener=A,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,n){"use strict";(function(t){n.d(e,"a",(function(){return _}));var r=n(11),i=n.n(r);const o=t+"/../../..";async function _(t,e){const n=["texture-compressor","--type","s3tc","--compression","DXT1","--quality","normal","--input",t,"--output",e],r=new i.a;return await r.start({command:"npx",arguments:n,spawn:{cwd:o}}),e}}).call(this,"/")},function(t,e,n){(function(e){const r=n(10),i="undefined"==typeof window?e:window;i.loaders=i.loaders||{},t.exports=Object.assign(i.loaders,r)}).call(this,n(3))},,function(t,e,n){"use strict";n.r(e),n.d(e,"BasisLoader",(function(){return R})),n.d(e,"BasisWorkerLoader",(function(){return u})),n.d(e,"CompressedTextureLoader",(function(){return ot})),n.d(e,"CompressedTextureWorkerLoader",(function(){return it})),n.d(e,"CrunchLoader",(function(){return _t})),n.d(e,"NPYLoader",(function(){return Et})),n.d(e,"NPYWorkerLoader",(function(){return St})),n.d(e,"CompressedTextureWriter",(function(){return ut})),n.d(e,"loadImageTexture",(function(){return vt})),n.d(e,"loadImageTextureArray",(function(){return Ft})),n.d(e,"loadImageTextureCube",(function(){return kt})),n.d(e,"GL_CONSTANTS",(function(){return c})),n.d(e,"getSupportedGPUTextureFormats",(function(){return zt})),n.d(e,"CrunchWorkerLoader",(function(){return _t}));var r=n(0),i=n(2);const o={};async function _(t,e=null,n={}){return e&&(t=function(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};if(i[t])return i[t];if(!r.b)return`modules/${e}/dist/libs/${t}`;if(n.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(n.CDN.startsWith("http")),`${n.CDN}/${e}@3.0.13/dist/libs/${t}`;if(r.c)return"../src/libs/"+t;return`modules/${e}/src/libs/${t}`}(t,e,n)),o[t]=o[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!r.b)return i.requireFromFile&&await i.requireFromFile(t);if(r.c)return importScripts(t);const e=await fetch(t);return function(t,e){if(!r.b)return i.requireFromString&&i.requireFromString(t,e);if(r.c)return eval.call(r.a,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(e){n.text=t}return document.body.appendChild(n),null}(await e.text(),t)}(t),await o[t]}let a;async function s(t){const e=t.modules||{};return e.basis?e.basis:(a=a||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await _("basis_transcoder.js","textures",t),await _("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise(e=>{t(n).then(t=>{const{BasisFile:n,initializeBasis:r}=t;r(),e({BasisFile:n})})})}(e,n)}(t),await a)}const c={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919},S={etc1:{basisFormat:0,compressed:!0},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:c.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:c.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0},"astc-4x4":{basisFormat:10,compressed:!0},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function E(t,e,n,r){const i=t.getImageWidth(e,n),o=t.getImageHeight(e,n),_=t.getHasAlpha(),{compressed:a,format:s,basisFormat:c}=function(t,e){let n=t&&t.basis&&t.basis.format;return"object"==typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),S[n]}(r,_),E=t.getImageTranscodedSizeInBytes(e,n,c),u=new Uint8Array(E);return t.transcodeImage(u,e,n,c,0,0)?{width:i,height:o,data:u,compressed:a,hasAlpha:_,format:s}:null}const u={name:"Basis",id:"basis",module:"textures",version:"3.0.13",worker:!0,extensions:["basis"],mimeTypes:["application/octet-stream"],tests:["sB"],binary:!0,options:{basis:{format:"rgb565",libraryPath:"libs/"}}},R={...u,parse:async function(t,e){const{BasisFile:n}=await s(e),r=new n(new Uint8Array(t));try{if(!r.startTranscoding())return null;const t=r.getNumImages(),n=[];for(let i=0;i<t;i++){const t=r.getNumLevels(i),o=[];for(let n=0;n<t;n++)o.push(E(r,i,n,e));n.push(o)}return n}finally{r.close(),r.delete()}}},f=(new Uint8Array([0]),[171,75,84,88,32,50,48,187,13,10,26,10]);var A,C,l,d,T,P,m,D;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(A||(A={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(C||(C={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(l||(l={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(d||(d={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(T||(T={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(P||(P={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(m||(m={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(D||(D={}));class p{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=A.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:C.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:l.UNSPECIFIED,colorPrimaries:d.SRGB,transferFunction:d.SRGB,flags:P.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class h{constructor(t,e,n,r){this._dataView=new DataView(t.buffer,t.byteOffset+e,n),this._littleEndian=r,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_skip(t){return this._offset+=t,this}_scan(t,e=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==e&&r<t;)r++,this._offset++;return r<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}function M(t){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(t):Buffer.from(t).toString("utf8")}function G(t,e){const n=new Array(e.mipMapLevels);let r=e.width,i=e.height,o=0;for(let _=0;_<e.mipMapLevels;++_){const a=B(e,r,i,t,_),s=g(t,_,o,a);n[_]={compressed:!0,format:e.internalFormat,data:s,width:r,height:i,levelSize:a},r=Math.max(1,r>>1),i=Math.max(1,i>>1),o+=a}return n}function g(t,e,n,r){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+n,r)}function B(t,e,n,r,i){return Array.isArray(r)?t.sizeFunction(r[i]):t.sizeFunction(e,n)}const O={131:c.COMPRESSED_RGB_S3TC_DXT1_EXT,132:c.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:c.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:c.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:c.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:c.COMPRESSED_RED_RGTC1_EXT,140:c.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:c.COMPRESSED_RED_GREEN_RGTC2_EXT,142:c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:c.COMPRESSED_RGB8_ETC2,148:c.COMPRESSED_SRGB8_ETC2,149:c.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:c.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:c.COMPRESSED_RGBA8_ETC2_EAC,152:c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:c.COMPRESSED_R11_EAC,154:c.COMPRESSED_SIGNED_R11_EAC,155:c.COMPRESSED_RG11_EAC,156:c.COMPRESSED_SIGNED_RG11_EAC,157:c.COMPRESSED_RGBA_ASTC_4x4_KHR,158:c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:c.COMPRESSED_RGBA_ASTC_5x4_KHR,160:c.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:c.COMPRESSED_RGBA_ASTC_5x5_KHR,162:c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:c.COMPRESSED_RGBA_ASTC_6x5_KHR,164:c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:c.COMPRESSED_RGBA_ASTC_6x6_KHR,166:c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:c.COMPRESSED_RGBA_ASTC_8x5_KHR,168:c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:c.COMPRESSED_RGBA_ASTC_8x6_KHR,170:c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:c.COMPRESSED_RGBA_ASTC_8x8_KHR,172:c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:c.COMPRESSED_RGBA_ASTC_10x5_KHR,174:c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:c.COMPRESSED_RGBA_ASTC_10x6_KHR,176:c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:c.COMPRESSED_RGBA_ASTC_10x8_KHR,178:c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:c.COMPRESSED_RGBA_ASTC_10x10_KHR,180:c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:c.COMPRESSED_RGBA_ASTC_12x10_KHR,182:c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:c.COMPRESSED_RGBA_ASTC_12x12_KHR,184:c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:c.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:c.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:c.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:c.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:c.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:c.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:c.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:c.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:c.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:c.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:c.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:c.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:c.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:c.COMPRESSED_RGBA_ASTC_12x12_KHR};const w=[171,75,84,88,32,50,48,187,13,10,26,10];function x(t){const e=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,f.length);if(e[0]!==f[0]||e[1]!==f[1]||e[2]!==f[2]||e[3]!==f[3]||e[4]!==f[4]||e[5]!==f[5]||e[6]!==f[6]||e[7]!==f[7]||e[8]!==f[8]||e[9]!==f[9]||e[10]!==f[10]||e[11]!==f[11])throw new Error("Missing KTX 2.0 identifier.");const n=new p,r=17*Uint32Array.BYTES_PER_ELEMENT,i=new h(t,f.length,r,!0);n.vkFormat=i._nextUint32(),n.typeSize=i._nextUint32(),n.pixelWidth=i._nextUint32(),n.pixelHeight=i._nextUint32(),n.pixelDepth=i._nextUint32(),n.layerCount=i._nextUint32(),n.faceCount=i._nextUint32();const o=i._nextUint32();n.supercompressionScheme=i._nextUint32();const _=i._nextUint32(),a=i._nextUint32(),s=i._nextUint32(),c=i._nextUint32(),S=i._nextUint64(),E=i._nextUint64(),u=new h(t,f.length+r,3*o*8,!0);for(let e=0;e<o;e++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+u._nextUint64(),u._nextUint64()),uncompressedByteLength:u._nextUint64()});const R=new h(t,_,a,!0),A={vendorId:R._skip(4)._nextUint16(),descriptorType:R._nextUint16(),versionNumber:R._nextUint16(),descriptorBlockSize:R._nextUint16(),colorModel:R._nextUint8(),colorPrimaries:R._nextUint8(),transferFunction:R._nextUint8(),flags:R._nextUint8(),texelBlockDimension:{x:R._nextUint8()+1,y:R._nextUint8()+1,z:R._nextUint8()+1,w:R._nextUint8()+1},bytesPlane:[R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8()],samples:[]},C=(A.descriptorBlockSize/4-6)/4;for(let t=0;t<C;t++)A.samples[t]={bitOffset:R._nextUint16(),bitLength:R._nextUint8(),channelID:R._nextUint8(),samplePosition:[R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8()],sampleLower:R._nextUint32(),sampleUpper:R._nextUint32()};n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(A);const l=new h(t,s,c,!0);for(;l._offset<c;){const t=l._nextUint32(),e=l._scan(t),r=M(e),i=l._scan(t-e.byteLength);n.keyValue[r]=r.match(/^ktx/i)?M(i):i,t%4&&l._skip(4-t%4)}if(E<=0)return n;const d=new h(t,S,E,!0),T=d._nextUint16(),P=d._nextUint16(),m=d._nextUint32(),D=d._nextUint32(),G=d._nextUint32(),g=d._nextUint32(),B=[];for(let t=0;t<o;t++)B.push({imageFlags:d._nextUint32(),rgbSliceByteOffset:d._nextUint32(),rgbSliceByteLength:d._nextUint32(),alphaSliceByteOffset:d._nextUint32(),alphaSliceByteLength:d._nextUint32()});const O=S+d._offset,w=O+m,x=w+D,y=x+G,H=new Uint8Array(t.buffer,t.byteOffset+O,m),b=new Uint8Array(t.buffer,t.byteOffset+w,D),U=new Uint8Array(t.buffer,t.byteOffset+x,G),L=new Uint8Array(t.buffer,t.byteOffset+y,g);return n.globalData={endpointCount:T,selectorCount:P,imageDescs:B,endpointsData:H,selectorsData:b,tablesData:U,extendedData:L},n}(new Uint8Array(t)),n=Math.max(1,e.levels.length),r=e.pixelWidth,i=e.pixelHeight,o=(_=e.vkFormat,O[_]);var _;return G(e.levels,{mipMapLevels:n,width:r,height:i,sizeFunction:t=>t.uncompressedByteLength,internalFormat:o})}function y(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const H=I,b=K,U=K,L={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4,PIXEL_FORMATS:{DXT1:c.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:c.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:c.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":c.COMPRESSED_RGB_ATC_WEBGL,ATCA:c.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:c.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},SIZE_FUNCTIONS:{DXT1:I,DXT3:K,DXT5:K,"ATC ":H,ATCA:b,ATCI:U}};function X(t){const e=new Int32Array(t,0,L.HEADER_LENGTH),n=e[L.HEADER_PF_FOURCC_INDEX];y(Boolean(e[L.HEADER_PF_FLAGS_INDEX]&L.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");const r=(i=n,String.fromCharCode(255&i,i>>8&255,i>>16&255,i>>24&255));var i;const o=L.PIXEL_FORMATS[r],_=L.SIZE_FUNCTIONS[r];y(o&&_,"DDS: Unknown pixel format "+n);let a=1;e[L.HEADER_FLAGS_INDEX]&L.DDSD_MIPMAPCOUNT&&(a=Math.max(1,e[L.MIPMAPCOUNT_INDEX]));const s=e[L.HEADER_WIDTH_INDEX],c=e[L.HEADER_HEIGHT_INDEX],S=e[L.HEADER_SIZE_INDEX]+4;return G(new Uint8Array(t,S),{mipMapLevels:a,width:s,height:c,sizeFunction:_,internalFormat:o})}function I(t,e){return(t+3>>2)*(e+3>>2)*8}function K(t,e){return(t+3>>2)*(e+3>>2)*16}const v=55727696,N=1347834371,F=13,V=52,k=0,W=2,j=4,$=6,z=7,Z=11,q=12,Y={0:[c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[c.COMPRESSED_RGB_ETC1_WEBGL],7:[c.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[c.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[c.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[c.COMPRESSED_RGB8_ETC2],23:[c.COMPRESSED_RGBA8_ETC2_EAC],24:[c.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[c.COMPRESSED_R11_EAC],26:[c.COMPRESSED_RG11_EAC],27:[c.COMPRESSED_RGBA_ASTC_4X4_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[c.COMPRESSED_RGBA_ASTC_5X4_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[c.COMPRESSED_RGBA_ASTC_5X5_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[c.COMPRESSED_RGBA_ASTC_6X5_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[c.COMPRESSED_RGBA_ASTC_6X6_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[c.COMPRESSED_RGBA_ASTC_8X5_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[c.COMPRESSED_RGBA_ASTC_8X6_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[c.COMPRESSED_RGBA_ASTC_8X8_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[c.COMPRESSED_RGBA_ASTC_10X5_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[c.COMPRESSED_RGBA_ASTC_10X6_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[c.COMPRESSED_RGBA_ASTC_10X8_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[c.COMPRESSED_RGBA_ASTC_10X10_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[c.COMPRESSED_RGBA_ASTC_12X10_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[c.COMPRESSED_RGBA_ASTC_12X12_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},J={0:Q,1:Q,2:tt,3:tt,6:et,7:et,9:nt,11:nt,22:et,23:nt,24:et,25:et,26:nt,27:nt,28:function(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16},29:function(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16},30:function(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16},31:function(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16},32:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16},33:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16},34:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16},35:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16},36:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16},37:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16},38:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16},39:function(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16},40:function(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}};function Q(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function tt(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function et(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function nt(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function rt(t){if(function(t){const e=new Uint8Array(t.buffer||t,t.byteOffset||0,w.length);return!(e[0]!==w[0]||e[1]!==w[1]||e[2]!==w[2]||e[3]!==w[3]||e[4]!==w[4]||e[5]!==w[5]||e[6]!==w[6]||e[7]!==w[7]||e[8]!==w[8]||e[9]!==w[9]||e[10]!==w[10]||e[11]!==w[11])}(t))return x(t);if(function(t){return new Uint32Array(t,0,L.HEADER_LENGTH)[L.MAGIC_NUMBER_INDEX]===L.MAGIC_NUMBER}(t))return X(t);if(function(t){const e=new Uint32Array(t,0,F)[k];return e===v||e===N}(t))return function(t){const e=new Uint32Array(t,0,F),n=e[W],r=e[j],i=Y[n]||[],o=i.length>1&&r?i[1]:i[0],_=J[n],a=e[Z],s=e[z],c=e[$],S=V+e[q];return G(new Uint8Array(t,S),{mipMapLevels:a,width:s,height:c,sizeFunction:_,internalFormat:o})}(t);throw new Error("Texture container format not recognized")}const it={name:"Texture Containers",id:"compressed-texture",module:"textures",version:"3.0.13",worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/"}}},ot={...it,parse:async t=>rt(t)},_t={id:"crunch",name:"Crunch",module:"textures",version:"3.0.13",worker:!0,extensions:["crn"],mimeTypes:["image/crn","image/x-crn","application/octet-stream"],binary:!0,options:{crunch:{libraryPath:"libs/"}}};const at=function(){const t=new Uint32Array([305419896]);return!(18===new Uint8Array(t.buffer,t.byteOffset,t.byteLength)[0])}(),st={u1:Uint8Array,i1:Int8Array,u2:Uint16Array,i2:Int16Array,u4:Uint32Array,i4:Int32Array,f4:Float32Array,f8:Float64Array};function ct(t,e){if(!t)return null;const n=new DataView(t),{header:r,headerEndOffset:i}=function(t){const e=t.getUint8(6);let n,r=8;e>=2?(n=t.getUint32(8,!0),r+=4):(n=t.getUint16(8,!0),r+=2);const i=new TextDecoder(e<=2?"latin1":"utf-8"),o=new Uint8Array(t.buffer,r,n),_=i.decode(o);r+=n;return{header:JSON.parse(_.replace(/'/g,'"').replace("False","false").replace("(","[").replace(/,*\),*/g,"]")),headerEndOffset:r}}(n),o=r.descr,_=st[o.slice(1,3)];if(!_)return console.warn("Decoding of npy dtype not implemented: "+o),null;const a=r.shape.reduce((t,e)=>t*e)*_.BYTES_PER_ELEMENT,s=new _(t.slice(i,i+a));return(">"===o[0]&&at||"<"===o[0]&&!at)&&console.warn("Data is wrong endianness, byte swapping not yet implemented."),{data:s,header:r}}const St={name:"NPY",id:"npy",module:"textures",version:"3.0.13",worker:!0,extensions:["npy"],mimeTypes:[],tests:[new Uint8Array([147,78,85,77,80,89]).buffer],options:{npy:{}}},Et={...St,parseSync:ct,parse:async(t,e)=>ct(t)};const ut={name:"DDS Texture Container",id:"dds",module:"textures",version:"3.0.13",extensions:["dds"],options:{texture:{format:"auto",compression:"auto",quality:"auto",mipmap:!1,flipY:!1,toolFlags:""}},encodeURLtoURL:n(7).a};function Rt(t,e){if(!t)throw new Error(e)}var ft=n(1);const{_parseImageNode:At}=ft.a,Ct="undefined"!=typeof Image,lt="undefined"!=typeof ImageBitmap,dt=Boolean(At),Tt=!!ft.b||dt;function Pt(t){const e=Dt(t);if(!e)throw new Error("Not an image");return e}function mt(t){switch(Pt(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Dt(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}const pt=/^data:image\/svg\+xml/,ht=/\.svg((\?|#).*)?$/;function Mt(t){return t&&(pt.test(t)||ht.test(t))}function Gt(t,e){if(Mt(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function gt(t,e,n){const r=function(t,e){if(Mt(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,"+btoa(e)}return Gt(t,e)}(t,n),i=self.URL||self.webkitURL,o="string"!=typeof r&&i.createObjectURL(r);try{return await async function(t,e){const n=new Image;if(n.src=t,e.image&&e.image.decode&&n.decode)return await n.decode(),n;return await new Promise((e,r)=>{try{n.onload=()=>e(n),n.onerror=e=>r(new Error(`Could not load image ${t}: ${e}`))}catch(t){r(t)}})}(o||r,e)}finally{o&&i.revokeObjectURL(o)}}const Bt={};let Ot=!0;async function wt(t,e,n){let r;if(Mt(n)){r=await gt(t,e,n)}else r=Gt(t,n);const i=e&&e.imagebitmap;return await async function(t,e=null){!function(t){for(const e in t||Bt)return!1;return!0}(e)&&Ot||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),Ot=!1}return await createImageBitmap(t)}(r,i)}function xt(t){const e=yt(t);return function(t){const e=yt(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){const e=yt(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;const{tableMarkers:n,sofMarkers:r}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let i=2;for(;i+9<e.byteLength;){const t=e.getUint16(i,!1);if(r.has(t))return{mimeType:"image/jpeg",height:e.getUint16(i+5,!1),width:e.getUint16(i+7,!1)};if(!n.has(t))return null;i+=2,i+=e.getUint16(i,!1)}return null}(e)||function(t){const e=yt(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){const e=yt(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function yt(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}const Ht={id:"image",module:"images",name:"Images",version:"3.0.13",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(t,e,n){const r=((e=e||{}).image||{}).type||"auto",{url:i}=n||{};let o;switch(function(t){switch(t){case"auto":case"data":return function(){if(lt)return"imagebitmap";if(Ct)return"image";if(Tt)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return lt||Ct||Tt;case"imagebitmap":return lt;case"image":return Ct;case"data":return Tt;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}(r)){case"imagebitmap":o=await wt(t,e,i);break;case"image":o=await gt(t,e,i);break;case"data":o=await function(t,e){const{mimeType:n}=xt(t)||{},{_parseImageNode:r}=ft.a;return Rt(r),r(t,n,e)}(t,e);break;default:Rt(!1)}return"data"===r&&(o=mt(o)),o},tests:[t=>Boolean(xt(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};let bt="";const Ut={};function Lt(t,e,n){let r=t;"function"==typeof t&&(r=t({...e,...n})),y("string"==typeof r);const{baseUrl:i}=e;return i&&(r="/"===i[i.length-1]?`${i}${r}`:`${i}/${r}`),function(t){for(const e in Ut)if(t.startsWith(e)){const n=Ut[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t=`${bt}${t}`),t}(r)}async function Xt(t,e,n){if(Array.isArray(t))return await async function(t,e,n={}){const r=t.map(t=>Xt(t,e,n));return await Promise.all(r)}(t,e,n);if((r=t)&&"object"==typeof r)return await async function(t,e,n){const r=[],i={};for(const o in t){const _=Xt(t[o],e,n).then(t=>{i[o]=t});r.push(_)}return await Promise.all(r),i}(t,e,n);var r;const i=t;return await e(i,n)}async function It(t,e,n){return await async function(t,e,n={}){return await Xt(t,e,n)}(t,t=>Kt(t,e,n))}async function Kt(t,e,n){const r=await fetch(t,n.fetch),i=await r.arrayBuffer();return await e(i,n)}async function vt(t,e={}){const n=await Nt(t,e);return await It(n,Ht.parse,e)}async function Nt(t,e,n={}){const r=e&&e.image&&e.image.mipLevels||0;return 0!==r?await async function(t,e,n,r){const i=[];if("auto"===e){const o=Lt(t,n,{...r,lod:0}),_=await Kt(o,Ht.parse,n),{width:a,height:s}=function(t){return mt(t)}(_);e=function({width:t,height:e}){return 1+Math.floor(Math.log2(Math.max(t,e)))}({width:a,height:s}),i.push(o)}y(e>0);for(let o=i.length;o<e;++o){const e=Lt(t,n,{...r,lod:o});i.push(e)}return i}(t,r,e,n):Lt(t,e,n)}async function Ft(t,e,n={}){const r=await async function(t,e,n={}){const r=[];for(let i=0;i<t;i++){const t=Nt(e,n,{index:i});r.push(t)}return await Promise.all(r)}(t,e,n);return await It(r,Ht.parse,n)}const Vt=[{face:34069,direction:"right",axis:"x",sign:"positive"},{face:34070,direction:"left",axis:"x",sign:"negative"},{face:34071,direction:"top",axis:"y",sign:"positive"},{face:34072,direction:"bottom",axis:"y",sign:"negative"},{face:34073,direction:"front",axis:"z",sign:"positive"},{face:34074,direction:"back",axis:"z",sign:"negative"}];async function kt(t,e={}){const n=await async function(t,e){const n={},r=[];let i=0;for(let o=0;o<Vt.length;++o){const o=Vt[i],_=Nt(t,e,{...o,index:i++}).then(t=>{n[o.face]=t});r.push(_)}return await Promise.all(r),n}(t,e);return await It(n,Ht.parse,e)}const Wt=["","WEBKIT_","MOZ_"],jt={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let $t=null;function zt(t){if(!$t){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,$t=new Set;for(const e of Wt)for(const n in jt)if(t&&t.getExtension(`${e}${n}`)){const t=jt[n];$t.add(t)}}return $t}},function(t,e){}])}));
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 n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return _})),n.d(e,"c",(function(){return a}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.global||i.self||i.window||{},_="object"!=typeof r||"[object process]"!==String(r)||r.browser,a="function"==typeof importScripts,s=("undefined"!=typeof window&&window.orientation,void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version));s&&parseFloat(s[1])}).call(this,n(3),n(6))},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return _}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.global||i.self||i.window,_="object"!=typeof r||"[object process]"!==String(r)||r.browser,a=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);a&&parseFloat(a[1])}).call(this,n(3),n(6))},function(t,e){},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},,,function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function _(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:_}catch(t){r=_}}();var s,c=[],S=!1,E=-1;function u(){S&&s&&(S=!1,s.length?c=s.concat(c):E=-1,c.length&&R())}function R(){if(!S){var t=a(u);S=!0;for(var e=c.length;e;){for(s=c,c=[];++E<e;)s&&s[E].run();E=-1,e=c.length}s=null,S=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===_||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function A(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new f(t,e)),1!==c.length||S||a(R)},f.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=A,i.addListener=A,i.once=A,i.off=A,i.removeListener=A,i.removeAllListeners=A,i.emit=A,i.prependListener=A,i.prependOnceListener=A,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,n){"use strict";(function(t){n.d(e,"a",(function(){return _}));var r=n(11),i=n.n(r);const o=t+"/../../..";async function _(t,e){const n=["texture-compressor","--type","s3tc","--compression","DXT1","--quality","normal","--input",t,"--output",e],r=new i.a;return await r.start({command:"npx",arguments:n,spawn:{cwd:o}}),e}}).call(this,"/")},function(t,e,n){(function(e){const r=n(10),i="undefined"==typeof window?e:window;i.loaders=i.loaders||{},t.exports=Object.assign(i.loaders,r)}).call(this,n(3))},,function(t,e,n){"use strict";n.r(e),n.d(e,"BasisLoader",(function(){return R})),n.d(e,"BasisWorkerLoader",(function(){return u})),n.d(e,"CompressedTextureLoader",(function(){return ot})),n.d(e,"CompressedTextureWorkerLoader",(function(){return it})),n.d(e,"CrunchLoader",(function(){return _t})),n.d(e,"NPYLoader",(function(){return Et})),n.d(e,"NPYWorkerLoader",(function(){return St})),n.d(e,"CompressedTextureWriter",(function(){return ut})),n.d(e,"loadImageTexture",(function(){return vt})),n.d(e,"loadImageTextureArray",(function(){return Ft})),n.d(e,"loadImageTextureCube",(function(){return kt})),n.d(e,"GL_CONSTANTS",(function(){return c})),n.d(e,"getSupportedGPUTextureFormats",(function(){return zt})),n.d(e,"CrunchWorkerLoader",(function(){return _t}));var r=n(0),i=n(2);const o={};async function _(t,e=null,n={}){return e&&(t=function(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};if(i[t])return i[t];if(!r.b)return`modules/${e}/dist/libs/${t}`;if(n.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(n.CDN.startsWith("http")),`${n.CDN}/${e}@3.0.14/dist/libs/${t}`;if(r.c)return"../src/libs/"+t;return`modules/${e}/src/libs/${t}`}(t,e,n)),o[t]=o[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!r.b)return i.requireFromFile&&await i.requireFromFile(t);if(r.c)return importScripts(t);const e=await fetch(t);return function(t,e){if(!r.b)return i.requireFromString&&i.requireFromString(t,e);if(r.c)return eval.call(r.a,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(e){n.text=t}return document.body.appendChild(n),null}(await e.text(),t)}(t),await o[t]}let a;async function s(t){const e=t.modules||{};return e.basis?e.basis:(a=a||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await _("basis_transcoder.js","textures",t),await _("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise(e=>{t(n).then(t=>{const{BasisFile:n,initializeBasis:r}=t;r(),e({BasisFile:n})})})}(e,n)}(t),await a)}const c={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919},S={etc1:{basisFormat:0,compressed:!0},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:c.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:c.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0},"astc-4x4":{basisFormat:10,compressed:!0},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function E(t,e,n,r){const i=t.getImageWidth(e,n),o=t.getImageHeight(e,n),_=t.getHasAlpha(),{compressed:a,format:s,basisFormat:c}=function(t,e){let n=t&&t.basis&&t.basis.format;return"object"==typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),S[n]}(r,_),E=t.getImageTranscodedSizeInBytes(e,n,c),u=new Uint8Array(E);return t.transcodeImage(u,e,n,c,0,0)?{width:i,height:o,data:u,compressed:a,hasAlpha:_,format:s}:null}const u={name:"Basis",id:"basis",module:"textures",version:"3.0.14",worker:!0,extensions:["basis"],mimeTypes:["application/octet-stream"],tests:["sB"],binary:!0,options:{basis:{format:"rgb565",libraryPath:"libs/"}}},R={...u,parse:async function(t,e){const{BasisFile:n}=await s(e),r=new n(new Uint8Array(t));try{if(!r.startTranscoding())return null;const t=r.getNumImages(),n=[];for(let i=0;i<t;i++){const t=r.getNumLevels(i),o=[];for(let n=0;n<t;n++)o.push(E(r,i,n,e));n.push(o)}return n}finally{r.close(),r.delete()}}},f=(new Uint8Array([0]),[171,75,84,88,32,50,48,187,13,10,26,10]);var A,C,l,d,T,P,m,D;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(A||(A={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(C||(C={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(l||(l={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(d||(d={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(T||(T={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(P||(P={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(m||(m={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(D||(D={}));class p{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=A.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:C.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:l.UNSPECIFIED,colorPrimaries:d.SRGB,transferFunction:d.SRGB,flags:P.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class h{constructor(t,e,n,r){this._dataView=new DataView(t.buffer,t.byteOffset+e,n),this._littleEndian=r,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_skip(t){return this._offset+=t,this}_scan(t,e=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==e&&r<t;)r++,this._offset++;return r<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}function M(t){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(t):Buffer.from(t).toString("utf8")}function G(t,e){const n=new Array(e.mipMapLevels);let r=e.width,i=e.height,o=0;for(let _=0;_<e.mipMapLevels;++_){const a=B(e,r,i,t,_),s=g(t,_,o,a);n[_]={compressed:!0,format:e.internalFormat,data:s,width:r,height:i,levelSize:a},r=Math.max(1,r>>1),i=Math.max(1,i>>1),o+=a}return n}function g(t,e,n,r){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+n,r)}function B(t,e,n,r,i){return Array.isArray(r)?t.sizeFunction(r[i]):t.sizeFunction(e,n)}const O={131:c.COMPRESSED_RGB_S3TC_DXT1_EXT,132:c.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:c.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:c.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:c.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:c.COMPRESSED_RED_RGTC1_EXT,140:c.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:c.COMPRESSED_RED_GREEN_RGTC2_EXT,142:c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:c.COMPRESSED_RGB8_ETC2,148:c.COMPRESSED_SRGB8_ETC2,149:c.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:c.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:c.COMPRESSED_RGBA8_ETC2_EAC,152:c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:c.COMPRESSED_R11_EAC,154:c.COMPRESSED_SIGNED_R11_EAC,155:c.COMPRESSED_RG11_EAC,156:c.COMPRESSED_SIGNED_RG11_EAC,157:c.COMPRESSED_RGBA_ASTC_4x4_KHR,158:c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:c.COMPRESSED_RGBA_ASTC_5x4_KHR,160:c.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:c.COMPRESSED_RGBA_ASTC_5x5_KHR,162:c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:c.COMPRESSED_RGBA_ASTC_6x5_KHR,164:c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:c.COMPRESSED_RGBA_ASTC_6x6_KHR,166:c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:c.COMPRESSED_RGBA_ASTC_8x5_KHR,168:c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:c.COMPRESSED_RGBA_ASTC_8x6_KHR,170:c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:c.COMPRESSED_RGBA_ASTC_8x8_KHR,172:c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:c.COMPRESSED_RGBA_ASTC_10x5_KHR,174:c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:c.COMPRESSED_RGBA_ASTC_10x6_KHR,176:c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:c.COMPRESSED_RGBA_ASTC_10x8_KHR,178:c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:c.COMPRESSED_RGBA_ASTC_10x10_KHR,180:c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:c.COMPRESSED_RGBA_ASTC_12x10_KHR,182:c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:c.COMPRESSED_RGBA_ASTC_12x12_KHR,184:c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:c.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:c.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:c.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:c.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:c.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:c.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:c.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:c.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:c.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:c.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:c.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:c.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:c.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:c.COMPRESSED_RGBA_ASTC_12x12_KHR};const w=[171,75,84,88,32,50,48,187,13,10,26,10];function x(t){const e=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,f.length);if(e[0]!==f[0]||e[1]!==f[1]||e[2]!==f[2]||e[3]!==f[3]||e[4]!==f[4]||e[5]!==f[5]||e[6]!==f[6]||e[7]!==f[7]||e[8]!==f[8]||e[9]!==f[9]||e[10]!==f[10]||e[11]!==f[11])throw new Error("Missing KTX 2.0 identifier.");const n=new p,r=17*Uint32Array.BYTES_PER_ELEMENT,i=new h(t,f.length,r,!0);n.vkFormat=i._nextUint32(),n.typeSize=i._nextUint32(),n.pixelWidth=i._nextUint32(),n.pixelHeight=i._nextUint32(),n.pixelDepth=i._nextUint32(),n.layerCount=i._nextUint32(),n.faceCount=i._nextUint32();const o=i._nextUint32();n.supercompressionScheme=i._nextUint32();const _=i._nextUint32(),a=i._nextUint32(),s=i._nextUint32(),c=i._nextUint32(),S=i._nextUint64(),E=i._nextUint64(),u=new h(t,f.length+r,3*o*8,!0);for(let e=0;e<o;e++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+u._nextUint64(),u._nextUint64()),uncompressedByteLength:u._nextUint64()});const R=new h(t,_,a,!0),A={vendorId:R._skip(4)._nextUint16(),descriptorType:R._nextUint16(),versionNumber:R._nextUint16(),descriptorBlockSize:R._nextUint16(),colorModel:R._nextUint8(),colorPrimaries:R._nextUint8(),transferFunction:R._nextUint8(),flags:R._nextUint8(),texelBlockDimension:{x:R._nextUint8()+1,y:R._nextUint8()+1,z:R._nextUint8()+1,w:R._nextUint8()+1},bytesPlane:[R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8()],samples:[]},C=(A.descriptorBlockSize/4-6)/4;for(let t=0;t<C;t++)A.samples[t]={bitOffset:R._nextUint16(),bitLength:R._nextUint8(),channelID:R._nextUint8(),samplePosition:[R._nextUint8(),R._nextUint8(),R._nextUint8(),R._nextUint8()],sampleLower:R._nextUint32(),sampleUpper:R._nextUint32()};n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(A);const l=new h(t,s,c,!0);for(;l._offset<c;){const t=l._nextUint32(),e=l._scan(t),r=M(e),i=l._scan(t-e.byteLength);n.keyValue[r]=r.match(/^ktx/i)?M(i):i,t%4&&l._skip(4-t%4)}if(E<=0)return n;const d=new h(t,S,E,!0),T=d._nextUint16(),P=d._nextUint16(),m=d._nextUint32(),D=d._nextUint32(),G=d._nextUint32(),g=d._nextUint32(),B=[];for(let t=0;t<o;t++)B.push({imageFlags:d._nextUint32(),rgbSliceByteOffset:d._nextUint32(),rgbSliceByteLength:d._nextUint32(),alphaSliceByteOffset:d._nextUint32(),alphaSliceByteLength:d._nextUint32()});const O=S+d._offset,w=O+m,x=w+D,y=x+G,H=new Uint8Array(t.buffer,t.byteOffset+O,m),b=new Uint8Array(t.buffer,t.byteOffset+w,D),U=new Uint8Array(t.buffer,t.byteOffset+x,G),L=new Uint8Array(t.buffer,t.byteOffset+y,g);return n.globalData={endpointCount:T,selectorCount:P,imageDescs:B,endpointsData:H,selectorsData:b,tablesData:U,extendedData:L},n}(new Uint8Array(t)),n=Math.max(1,e.levels.length),r=e.pixelWidth,i=e.pixelHeight,o=(_=e.vkFormat,O[_]);var _;return G(e.levels,{mipMapLevels:n,width:r,height:i,sizeFunction:t=>t.uncompressedByteLength,internalFormat:o})}function y(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const H=I,b=K,U=K,L={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4,PIXEL_FORMATS:{DXT1:c.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:c.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:c.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":c.COMPRESSED_RGB_ATC_WEBGL,ATCA:c.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:c.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},SIZE_FUNCTIONS:{DXT1:I,DXT3:K,DXT5:K,"ATC ":H,ATCA:b,ATCI:U}};function X(t){const e=new Int32Array(t,0,L.HEADER_LENGTH),n=e[L.HEADER_PF_FOURCC_INDEX];y(Boolean(e[L.HEADER_PF_FLAGS_INDEX]&L.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");const r=(i=n,String.fromCharCode(255&i,i>>8&255,i>>16&255,i>>24&255));var i;const o=L.PIXEL_FORMATS[r],_=L.SIZE_FUNCTIONS[r];y(o&&_,"DDS: Unknown pixel format "+n);let a=1;e[L.HEADER_FLAGS_INDEX]&L.DDSD_MIPMAPCOUNT&&(a=Math.max(1,e[L.MIPMAPCOUNT_INDEX]));const s=e[L.HEADER_WIDTH_INDEX],c=e[L.HEADER_HEIGHT_INDEX],S=e[L.HEADER_SIZE_INDEX]+4;return G(new Uint8Array(t,S),{mipMapLevels:a,width:s,height:c,sizeFunction:_,internalFormat:o})}function I(t,e){return(t+3>>2)*(e+3>>2)*8}function K(t,e){return(t+3>>2)*(e+3>>2)*16}const v=55727696,N=1347834371,F=13,V=52,k=0,W=2,j=4,$=6,z=7,Z=11,q=12,Y={0:[c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[c.COMPRESSED_RGB_ETC1_WEBGL],7:[c.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[c.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[c.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[c.COMPRESSED_RGB8_ETC2],23:[c.COMPRESSED_RGBA8_ETC2_EAC],24:[c.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[c.COMPRESSED_R11_EAC],26:[c.COMPRESSED_RG11_EAC],27:[c.COMPRESSED_RGBA_ASTC_4X4_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[c.COMPRESSED_RGBA_ASTC_5X4_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[c.COMPRESSED_RGBA_ASTC_5X5_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[c.COMPRESSED_RGBA_ASTC_6X5_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[c.COMPRESSED_RGBA_ASTC_6X6_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[c.COMPRESSED_RGBA_ASTC_8X5_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[c.COMPRESSED_RGBA_ASTC_8X6_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[c.COMPRESSED_RGBA_ASTC_8X8_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[c.COMPRESSED_RGBA_ASTC_10X5_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[c.COMPRESSED_RGBA_ASTC_10X6_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[c.COMPRESSED_RGBA_ASTC_10X8_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[c.COMPRESSED_RGBA_ASTC_10X10_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[c.COMPRESSED_RGBA_ASTC_12X10_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[c.COMPRESSED_RGBA_ASTC_12X12_KHR,c.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},J={0:Q,1:Q,2:tt,3:tt,6:et,7:et,9:nt,11:nt,22:et,23:nt,24:et,25:et,26:nt,27:nt,28:function(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16},29:function(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16},30:function(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16},31:function(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16},32:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16},33:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16},34:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16},35:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16},36:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16},37:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16},38:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16},39:function(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16},40:function(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}};function Q(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function tt(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function et(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function nt(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function rt(t){if(function(t){const e=new Uint8Array(t.buffer||t,t.byteOffset||0,w.length);return!(e[0]!==w[0]||e[1]!==w[1]||e[2]!==w[2]||e[3]!==w[3]||e[4]!==w[4]||e[5]!==w[5]||e[6]!==w[6]||e[7]!==w[7]||e[8]!==w[8]||e[9]!==w[9]||e[10]!==w[10]||e[11]!==w[11])}(t))return x(t);if(function(t){return new Uint32Array(t,0,L.HEADER_LENGTH)[L.MAGIC_NUMBER_INDEX]===L.MAGIC_NUMBER}(t))return X(t);if(function(t){const e=new Uint32Array(t,0,F)[k];return e===v||e===N}(t))return function(t){const e=new Uint32Array(t,0,F),n=e[W],r=e[j],i=Y[n]||[],o=i.length>1&&r?i[1]:i[0],_=J[n],a=e[Z],s=e[z],c=e[$],S=V+e[q];return G(new Uint8Array(t,S),{mipMapLevels:a,width:s,height:c,sizeFunction:_,internalFormat:o})}(t);throw new Error("Texture container format not recognized")}const it={name:"Texture Containers",id:"compressed-texture",module:"textures",version:"3.0.14",worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/"}}},ot={...it,parse:async t=>rt(t)},_t={id:"crunch",name:"Crunch",module:"textures",version:"3.0.14",worker:!0,extensions:["crn"],mimeTypes:["image/crn","image/x-crn","application/octet-stream"],binary:!0,options:{crunch:{libraryPath:"libs/"}}};const at=function(){const t=new Uint32Array([305419896]);return!(18===new Uint8Array(t.buffer,t.byteOffset,t.byteLength)[0])}(),st={u1:Uint8Array,i1:Int8Array,u2:Uint16Array,i2:Int16Array,u4:Uint32Array,i4:Int32Array,f4:Float32Array,f8:Float64Array};function ct(t,e){if(!t)return null;const n=new DataView(t),{header:r,headerEndOffset:i}=function(t){const e=t.getUint8(6);let n,r=8;e>=2?(n=t.getUint32(8,!0),r+=4):(n=t.getUint16(8,!0),r+=2);const i=new TextDecoder(e<=2?"latin1":"utf-8"),o=new Uint8Array(t.buffer,r,n),_=i.decode(o);r+=n;return{header:JSON.parse(_.replace(/'/g,'"').replace("False","false").replace("(","[").replace(/,*\),*/g,"]")),headerEndOffset:r}}(n),o=r.descr,_=st[o.slice(1,3)];if(!_)return console.warn("Decoding of npy dtype not implemented: "+o),null;const a=r.shape.reduce((t,e)=>t*e)*_.BYTES_PER_ELEMENT,s=new _(t.slice(i,i+a));return(">"===o[0]&&at||"<"===o[0]&&!at)&&console.warn("Data is wrong endianness, byte swapping not yet implemented."),{data:s,header:r}}const St={name:"NPY",id:"npy",module:"textures",version:"3.0.14",worker:!0,extensions:["npy"],mimeTypes:[],tests:[new Uint8Array([147,78,85,77,80,89]).buffer],options:{npy:{}}},Et={...St,parseSync:ct,parse:async(t,e)=>ct(t)};const ut={name:"DDS Texture Container",id:"dds",module:"textures",version:"3.0.14",extensions:["dds"],options:{texture:{format:"auto",compression:"auto",quality:"auto",mipmap:!1,flipY:!1,toolFlags:""}},encodeURLtoURL:n(7).a};function Rt(t,e){if(!t)throw new Error(e)}var ft=n(1);const{_parseImageNode:At}=ft.a,Ct="undefined"!=typeof Image,lt="undefined"!=typeof ImageBitmap,dt=Boolean(At),Tt=!!ft.b||dt;function Pt(t){const e=Dt(t);if(!e)throw new Error("Not an image");return e}function mt(t){switch(Pt(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Dt(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}const pt=/^data:image\/svg\+xml/,ht=/\.svg((\?|#).*)?$/;function Mt(t){return t&&(pt.test(t)||ht.test(t))}function Gt(t,e){if(Mt(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function gt(t,e,n){const r=function(t,e){if(Mt(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,"+btoa(e)}return Gt(t,e)}(t,n),i=self.URL||self.webkitURL,o="string"!=typeof r&&i.createObjectURL(r);try{return await async function(t,e){const n=new Image;if(n.src=t,e.image&&e.image.decode&&n.decode)return await n.decode(),n;return await new Promise((e,r)=>{try{n.onload=()=>e(n),n.onerror=e=>r(new Error(`Could not load image ${t}: ${e}`))}catch(t){r(t)}})}(o||r,e)}finally{o&&i.revokeObjectURL(o)}}const Bt={};let Ot=!0;async function wt(t,e,n){let r;if(Mt(n)){r=await gt(t,e,n)}else r=Gt(t,n);const i=e&&e.imagebitmap;return await async function(t,e=null){!function(t){for(const e in t||Bt)return!1;return!0}(e)&&Ot||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),Ot=!1}return await createImageBitmap(t)}(r,i)}function xt(t){const e=yt(t);return function(t){const e=yt(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){const e=yt(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;const{tableMarkers:n,sofMarkers:r}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let i=2;for(;i+9<e.byteLength;){const t=e.getUint16(i,!1);if(r.has(t))return{mimeType:"image/jpeg",height:e.getUint16(i+5,!1),width:e.getUint16(i+7,!1)};if(!n.has(t))return null;i+=2,i+=e.getUint16(i,!1)}return null}(e)||function(t){const e=yt(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){const e=yt(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function yt(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}const Ht={id:"image",module:"images",name:"Images",version:"3.0.14",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(t,e,n){const r=((e=e||{}).image||{}).type||"auto",{url:i}=n||{};let o;switch(function(t){switch(t){case"auto":case"data":return function(){if(lt)return"imagebitmap";if(Ct)return"image";if(Tt)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return lt||Ct||Tt;case"imagebitmap":return lt;case"image":return Ct;case"data":return Tt;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}(r)){case"imagebitmap":o=await wt(t,e,i);break;case"image":o=await gt(t,e,i);break;case"data":o=await function(t,e){const{mimeType:n}=xt(t)||{},{_parseImageNode:r}=ft.a;return Rt(r),r(t,n,e)}(t,e);break;default:Rt(!1)}return"data"===r&&(o=mt(o)),o},tests:[t=>Boolean(xt(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};let bt="";const Ut={};function Lt(t,e,n){let r=t;"function"==typeof t&&(r=t({...e,...n})),y("string"==typeof r);const{baseUrl:i}=e;return i&&(r="/"===i[i.length-1]?`${i}${r}`:`${i}/${r}`),function(t){for(const e in Ut)if(t.startsWith(e)){const n=Ut[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t=`${bt}${t}`),t}(r)}async function Xt(t,e,n){if(Array.isArray(t))return await async function(t,e,n={}){const r=t.map(t=>Xt(t,e,n));return await Promise.all(r)}(t,e,n);if((r=t)&&"object"==typeof r)return await async function(t,e,n){const r=[],i={};for(const o in t){const _=Xt(t[o],e,n).then(t=>{i[o]=t});r.push(_)}return await Promise.all(r),i}(t,e,n);var r;const i=t;return await e(i,n)}async function It(t,e,n){return await async function(t,e,n={}){return await Xt(t,e,n)}(t,t=>Kt(t,e,n))}async function Kt(t,e,n){const r=await fetch(t,n.fetch),i=await r.arrayBuffer();return await e(i,n)}async function vt(t,e={}){const n=await Nt(t,e);return await It(n,Ht.parse,e)}async function Nt(t,e,n={}){const r=e&&e.image&&e.image.mipLevels||0;return 0!==r?await async function(t,e,n,r){const i=[];if("auto"===e){const o=Lt(t,n,{...r,lod:0}),_=await Kt(o,Ht.parse,n),{width:a,height:s}=function(t){return mt(t)}(_);e=function({width:t,height:e}){return 1+Math.floor(Math.log2(Math.max(t,e)))}({width:a,height:s}),i.push(o)}y(e>0);for(let o=i.length;o<e;++o){const e=Lt(t,n,{...r,lod:o});i.push(e)}return i}(t,r,e,n):Lt(t,e,n)}async function Ft(t,e,n={}){const r=await async function(t,e,n={}){const r=[];for(let i=0;i<t;i++){const t=Nt(e,n,{index:i});r.push(t)}return await Promise.all(r)}(t,e,n);return await It(r,Ht.parse,n)}const Vt=[{face:34069,direction:"right",axis:"x",sign:"positive"},{face:34070,direction:"left",axis:"x",sign:"negative"},{face:34071,direction:"top",axis:"y",sign:"positive"},{face:34072,direction:"bottom",axis:"y",sign:"negative"},{face:34073,direction:"front",axis:"z",sign:"positive"},{face:34074,direction:"back",axis:"z",sign:"negative"}];async function kt(t,e={}){const n=await async function(t,e){const n={},r=[];let i=0;for(let o=0;o<Vt.length;++o){const o=Vt[i],_=Nt(t,e,{...o,index:i++}).then(t=>{n[o.face]=t});r.push(_)}return await Promise.all(r),n}(t,e);return await It(n,Ht.parse,e)}const Wt=["","WEBKIT_","MOZ_"],jt={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let $t=null;function zt(t){if(!$t){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,$t=new Set;for(const e of Wt)for(const n in jt)if(t&&t.getExtension(`${e}${n}`)){const t=jt[n];$t.add(t)}}return $t}},function(t,e){}])}));
2
2
  //# sourceMappingURL=dist.min.js.map