@loaders.gl/textures 3.1.0-alpha.5 → 3.1.0-beta.5
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/basis-loader.d.ts +1 -0
- package/dist/basis-loader.d.ts.map +1 -0
- package/dist/basis-loader.js +40 -0
- package/dist/basis-worker.js +675 -2
- package/dist/bundle.d.ts +1 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +2107 -0
- package/dist/compressed-texture-loader.d.ts +1 -0
- package/dist/compressed-texture-loader.d.ts.map +1 -0
- package/dist/compressed-texture-loader.js +64 -0
- package/dist/compressed-texture-worker.js +1179 -2
- package/dist/compressed-texture-writer.d.ts +1 -0
- package/dist/compressed-texture-writer.d.ts.map +1 -0
- package/dist/compressed-texture-writer.js +28 -0
- package/dist/crunch-loader.d.ts +1 -0
- package/dist/crunch-loader.d.ts.map +1 -0
- package/dist/crunch-loader.js +25 -0
- package/dist/crunch-worker.js +486 -2
- package/dist/es5/index.js +3 -3
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/{gl-constants.js → gl-extensions.js} +4 -4
- package/dist/es5/lib/gl-extensions.js.map +1 -0
- package/dist/es5/lib/parsers/basis-module-loader.js +1 -1
- package/dist/es5/lib/parsers/basis-module-loader.js.map +1 -1
- package/dist/es5/lib/parsers/crunch-module-loader.js.map +1 -1
- package/dist/es5/lib/parsers/parse-basis.js +9 -9
- package/dist/es5/lib/parsers/parse-basis.js.map +1 -1
- package/dist/es5/lib/parsers/parse-crunch.js +4 -4
- package/dist/es5/lib/parsers/parse-crunch.js.map +1 -1
- package/dist/es5/lib/parsers/parse-dds.js +23 -23
- package/dist/es5/lib/parsers/parse-dds.js.map +1 -1
- package/dist/es5/lib/parsers/parse-ktx.js +2 -2
- package/dist/es5/lib/parsers/parse-ktx.js.map +1 -1
- package/dist/es5/lib/parsers/parse-npy.js +3 -1
- package/dist/es5/lib/parsers/parse-npy.js.map +1 -1
- package/dist/es5/lib/parsers/parse-pvr.js +28 -28
- package/dist/es5/lib/parsers/parse-pvr.js.map +1 -1
- package/dist/es5/lib/texture-api/async-deep-map.js.map +1 -1
- package/dist/es5/lib/texture-api/deep-load.js.map +1 -1
- package/dist/es5/lib/texture-api/generate-url.js +4 -12
- package/dist/es5/lib/texture-api/generate-url.js.map +1 -1
- package/dist/es5/lib/texture-api/load-image-array.js.map +1 -1
- package/dist/es5/lib/texture-api/load-image-cube.js.map +1 -1
- package/dist/es5/lib/texture-api/load-image.js +2 -5
- package/dist/es5/lib/texture-api/load-image.js.map +1 -1
- package/dist/es5/lib/texture-api/texture-api-types.js +2 -0
- package/dist/es5/lib/texture-api/texture-api-types.js.map +1 -0
- package/dist/es5/lib/utils/extract-mipmap-images.js.map +1 -1
- package/dist/es5/lib/utils/ktx-format-helper.js +67 -67
- package/dist/es5/lib/utils/ktx-format-helper.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/lib/utils/version.js.map +1 -1
- package/dist/es5/libs/README.md +2 -2
- package/dist/es5/libs/basis_encoder.js +1 -1
- package/dist/es5/libs/basis_transcoder.js +1 -1
- package/dist/es5/libs/crunch.js +1 -0
- package/dist/es5/npy-loader.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/{gl-constants.js → gl-extensions.js} +2 -2
- package/dist/esm/lib/gl-extensions.js.map +1 -0
- package/dist/esm/lib/parsers/basis-module-loader.js +1 -1
- package/dist/esm/lib/parsers/basis-module-loader.js.map +1 -1
- package/dist/esm/lib/parsers/crunch-module-loader.js.map +1 -1
- package/dist/esm/lib/parsers/parse-basis.js +8 -8
- package/dist/esm/lib/parsers/parse-basis.js.map +1 -1
- package/dist/esm/lib/parsers/parse-crunch.js +4 -4
- package/dist/esm/lib/parsers/parse-crunch.js.map +1 -1
- package/dist/esm/lib/parsers/parse-dds.js +23 -23
- package/dist/esm/lib/parsers/parse-dds.js.map +1 -1
- package/dist/esm/lib/parsers/parse-ktx.js +2 -2
- package/dist/esm/lib/parsers/parse-ktx.js.map +1 -1
- package/dist/esm/lib/parsers/parse-npy.js +3 -1
- package/dist/esm/lib/parsers/parse-npy.js.map +1 -1
- package/dist/esm/lib/parsers/parse-pvr.js +28 -28
- package/dist/esm/lib/parsers/parse-pvr.js.map +1 -1
- package/dist/esm/lib/texture-api/async-deep-map.js.map +1 -1
- package/dist/esm/lib/texture-api/deep-load.js.map +1 -1
- package/dist/esm/lib/texture-api/generate-url.js +5 -13
- package/dist/esm/lib/texture-api/generate-url.js.map +1 -1
- package/dist/esm/lib/texture-api/load-image-array.js.map +1 -1
- package/dist/esm/lib/texture-api/load-image-cube.js.map +1 -1
- package/dist/esm/lib/texture-api/load-image.js +2 -5
- package/dist/esm/lib/texture-api/load-image.js.map +1 -1
- package/dist/esm/lib/texture-api/texture-api-types.js +2 -0
- package/dist/esm/lib/texture-api/texture-api-types.js.map +1 -0
- package/dist/esm/lib/utils/extract-mipmap-images.js.map +1 -1
- package/dist/esm/lib/utils/ktx-format-helper.js +67 -67
- package/dist/esm/lib/utils/ktx-format-helper.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/esm/lib/utils/version.js.map +1 -1
- package/dist/esm/libs/README.md +2 -2
- package/dist/esm/libs/basis_encoder.js +1 -1
- package/dist/esm/libs/basis_transcoder.js +1 -1
- package/dist/esm/libs/crunch.js +1 -0
- package/dist/esm/npy-loader.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/ktx2-basis-universal-texture-writer.d.ts +1 -0
- package/dist/ktx2-basis-universal-texture-writer.d.ts.map +1 -0
- package/dist/ktx2-basis-universal-texture-writer.js +25 -0
- package/dist/lib/encoders/encode-ktx.d.ts +1 -0
- package/dist/lib/encoders/encode-ktx.d.ts.map +1 -0
- package/dist/lib/encoders/encode-ktx.js +10 -0
- package/dist/lib/encoders/encode-ktx2-basis-texture.d.ts +1 -0
- package/dist/lib/encoders/encode-ktx2-basis-texture.d.ts.map +1 -0
- package/dist/lib/encoders/encode-ktx2-basis-texture.js +41 -0
- package/dist/lib/encoders/encode-texture.d.ts +1 -0
- package/dist/lib/encoders/encode-texture.d.ts.map +1 -0
- package/dist/lib/encoders/encode-texture.js +30 -0
- package/dist/lib/{gl-constants.d.ts → gl-extensions.d.ts} +2 -1
- package/dist/lib/gl-extensions.d.ts.map +1 -0
- package/dist/lib/gl-extensions.js +72 -0
- package/dist/lib/parsers/basis-module-loader.d.ts +1 -0
- package/dist/lib/parsers/basis-module-loader.d.ts.map +1 -0
- package/dist/lib/parsers/basis-module-loader.js +114 -0
- package/dist/lib/parsers/crunch-module-loader.d.ts +1 -0
- package/dist/lib/parsers/crunch-module-loader.d.ts.map +1 -0
- package/dist/lib/parsers/crunch-module-loader.js +35 -0
- package/dist/lib/parsers/parse-basis.d.ts +1 -0
- package/dist/lib/parsers/parse-basis.d.ts.map +1 -0
- package/dist/lib/parsers/parse-basis.js +245 -0
- package/dist/lib/parsers/parse-compressed-texture.d.ts +1 -0
- package/dist/lib/parsers/parse-compressed-texture.d.ts.map +1 -0
- package/dist/lib/parsers/parse-compressed-texture.js +26 -0
- package/dist/lib/parsers/parse-crunch.d.ts +1 -0
- package/dist/lib/parsers/parse-crunch.d.ts.map +1 -0
- package/dist/lib/parsers/parse-crunch.js +105 -0
- package/dist/lib/parsers/parse-dds.d.ts +1 -0
- package/dist/lib/parsers/parse-dds.d.ts.map +1 -0
- package/dist/lib/parsers/parse-dds.js +108 -0
- package/dist/lib/parsers/parse-ktx.d.ts +3 -2
- package/dist/lib/parsers/parse-ktx.d.ts.map +1 -0
- package/dist/lib/parsers/parse-ktx.js +46 -0
- package/dist/lib/parsers/parse-npy.d.ts +8 -2
- package/dist/lib/parsers/parse-npy.d.ts.map +1 -0
- package/dist/lib/parsers/parse-npy.js +85 -0
- package/dist/lib/parsers/parse-pvr.d.ts +1 -0
- package/dist/lib/parsers/parse-pvr.d.ts.map +1 -0
- package/dist/lib/parsers/parse-pvr.js +250 -0
- package/dist/lib/texture-api/async-deep-map.d.ts +5 -2
- package/dist/lib/texture-api/async-deep-map.d.ts.map +1 -0
- package/dist/lib/texture-api/async-deep-map.js +41 -0
- package/dist/lib/texture-api/deep-load.d.ts +5 -2
- package/dist/lib/texture-api/deep-load.d.ts.map +1 -0
- package/dist/lib/texture-api/deep-load.js +16 -0
- package/dist/lib/texture-api/generate-url.d.ts +3 -1
- package/dist/lib/texture-api/generate-url.d.ts.map +1 -0
- package/dist/lib/texture-api/generate-url.js +17 -0
- package/dist/lib/texture-api/load-image-array.d.ts +4 -2
- package/dist/lib/texture-api/load-image-array.d.ts.map +1 -0
- package/dist/lib/texture-api/load-image-array.js +21 -0
- package/dist/lib/texture-api/load-image-cube.d.ts +12 -2
- package/dist/lib/texture-api/load-image-cube.d.ts.map +1 -0
- package/dist/lib/texture-api/load-image-cube.js +47 -0
- package/dist/lib/texture-api/load-image.d.ts +7 -5
- package/dist/lib/texture-api/load-image.d.ts.map +1 -0
- package/dist/lib/texture-api/load-image.js +43 -0
- package/dist/lib/texture-api/texture-api-types.d.ts +10 -0
- package/dist/lib/texture-api/texture-api-types.d.ts.map +1 -0
- package/dist/lib/texture-api/texture-api-types.js +3 -0
- package/dist/lib/utils/extract-mipmap-images.d.ts +2 -1
- package/dist/lib/utils/extract-mipmap-images.d.ts.map +1 -0
- package/dist/lib/utils/extract-mipmap-images.js +50 -0
- package/dist/lib/utils/ktx-format-helper.d.ts +4 -3
- package/dist/lib/utils/ktx-format-helper.d.ts.map +1 -0
- package/dist/lib/utils/ktx-format-helper.js +125 -0
- package/dist/lib/utils/texture-formats.d.ts +1 -0
- package/dist/lib/utils/texture-formats.d.ts.map +1 -0
- package/dist/lib/utils/texture-formats.js +51 -0
- package/dist/lib/utils/version.d.ts +1 -0
- package/dist/lib/utils/version.d.ts.map +1 -0
- package/dist/lib/utils/version.js +8 -0
- package/dist/libs/README.md +2 -2
- package/dist/libs/basis_encoder.js +1 -1
- package/dist/libs/basis_transcoder.js +1 -1
- package/dist/libs/crunch.js +1 -0
- package/dist/npy-loader.d.ts +7 -3
- package/dist/npy-loader.d.ts.map +1 -0
- package/dist/npy-loader.js +34 -0
- package/dist/npy-worker.js +240 -2
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/workers/basis-worker.d.ts +1 -0
- package/dist/workers/basis-worker.d.ts.map +1 -0
- package/dist/workers/basis-worker.js +5 -0
- package/dist/workers/compressed-texture-worker.d.ts +1 -0
- package/dist/workers/compressed-texture-worker.d.ts.map +1 -0
- package/dist/workers/compressed-texture-worker.js +5 -0
- package/dist/workers/crunch-worker.d.ts +1 -0
- package/dist/workers/crunch-worker.d.ts.map +1 -0
- package/dist/workers/crunch-worker.js +14 -0
- package/dist/workers/npy-worker.d.ts +1 -0
- package/dist/workers/npy-worker.d.ts.map +1 -0
- package/dist/workers/npy-worker.js +5 -0
- package/package.json +10 -11
- package/src/index.ts +1 -1
- package/src/lib/{gl-constants.ts → gl-extensions.ts} +1 -1
- package/src/lib/parsers/crunch-module-loader.ts +1 -0
- package/src/lib/parsers/parse-basis.js +32 -8
- package/src/lib/parsers/parse-crunch.ts +4 -4
- package/src/lib/parsers/parse-dds.ts +29 -26
- package/src/lib/parsers/parse-ktx.js +3 -6
- package/src/lib/parsers/parse-ktx.ts +47 -0
- package/src/lib/parsers/parse-npy.js +3 -17
- package/src/lib/parsers/parse-npy.ts +98 -0
- package/src/lib/parsers/parse-pvr.ts +90 -48
- package/src/lib/texture-api/async-deep-map.ts +15 -8
- package/src/lib/texture-api/deep-load.ts +7 -3
- package/src/lib/texture-api/generate-url.ts +10 -8
- package/src/lib/texture-api/load-image-array.ts +8 -2
- package/src/lib/texture-api/load-image-cube.ts +18 -4
- package/src/lib/texture-api/load-image.ts +15 -5
- package/src/lib/texture-api/texture-api-types.ts +12 -0
- package/src/lib/utils/extract-mipmap-images.ts +16 -3
- package/src/lib/utils/ktx-format-helper.ts +71 -71
- package/src/libs/README.md +2 -2
- package/src/libs/basis_encoder.js +1 -1
- package/src/libs/basis_transcoder.js +1 -1
- package/src/libs/crunch.js +1 -0
- package/src/npy-loader.ts +2 -2
- package/dist/basis-worker.js.map +0 -1
- package/dist/compressed-texture-worker.js.map +0 -1
- package/dist/crunch-worker.js.map +0 -1
- package/dist/dist.min.js +0 -2
- package/dist/dist.min.js.map +0 -1
- package/dist/es5/lib/gl-constants.js.map +0 -1
- package/dist/esm/lib/gl-constants.js.map +0 -1
- package/dist/npy-worker.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:////home/user/apps/loaders.gl_duplicate/node_modules/@babel/runtime/regenerator/index.js","webpack:////home/user/apps/loaders.gl_duplicate/node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack:///../worker-utils/src/lib/env-utils/globals.ts","webpack:////home/user/apps/loaders.gl_duplicate/node_modules/@babel/runtime/helpers/defineProperty.js","webpack:////home/user/apps/loaders.gl_duplicate/node_modules/@babel/runtime/helpers/typeof.js","webpack:////home/user/apps/loaders.gl_duplicate/node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:////home/user/apps/loaders.gl_duplicate/node_modules/@babel/runtime/helpers/createClass.js","webpack:////home/user/apps/loaders.gl_duplicate/node_modules/regenerator-runtime/runtime.js","webpack:///(webpack)/buildin/global.js","webpack:////home/user/apps/loaders.gl_duplicate/node_modules/process/browser.js","webpack:///../worker-utils/src/lib/worker-utils/get-transfer-list.ts","webpack:///../worker-utils/src/lib/worker-farm/worker-body.ts","webpack:///../loader-utils/src/lib/worker-loader-utils/create-loader-worker.ts","webpack:///./src/lib/utils/version.ts","webpack:///./src/crunch-loader.ts","webpack:///../worker-utils/src/lib/library-utils/library-utils.ts","webpack:///./src/lib/parsers/crunch-module-loader.ts","webpack:///../worker-utils/src/lib/env-utils/assert.ts","webpack:///./src/lib/gl-constants.ts","webpack:///../loader-utils/src/lib/env-utils/assert.ts","webpack:///./src/lib/utils/extract-mipmap-images.ts","webpack:///./src/lib/parsers/parse-dds.ts","webpack:///./src/lib/parsers/parse-crunch.ts","webpack:///./src/workers/crunch-worker.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","error","done","Promise","then","fn","self","this","args","arguments","apply","err","undefined","globals","window","global","document","global_","isBrowser","process","String","browser","isWorker","importScripts","matches","orientation","version","exec","parseFloat","obj","configurable","writable","_typeof","iterator","constructor","instance","Constructor","TypeError","_defineProperties","target","props","length","descriptor","protoProps","staticProps","runtime","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","define","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","state","method","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","invoke","result","__await","unwrapped","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","toString","keys","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","g","e","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","Array","title","env","argv","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","isTransferable","ArrayBuffer","MessagePort","ImageBitmap","OffscreenCanvas","onMessageWrapperMap","Map","WorkerBody","onMessage","onmessage","message","isKnownMessage","data","payload","onMessageWrapper","addEventListener","removeEventListener","source","transferList","getTransferList","recursive","transfers","transfersSet","Set","add","buffer","isView","from","postMessage","startsWith","requestId","parseOnMainThread","arrayBuffer","options","id","input","parseData","a","loader","parseSync","parse","parser","parseTextSync","textDecoder","TextDecoder","decode","worker","CrunchLoader","extensions","mimeTypes","binary","crunch","libraryPath","crunchModule","loadLibraryPromises","loadLibrary","libraryUrl","moduleName","getLibraryUrl","loadLibraryFromFile","library","CDN","condition","assert","endsWith","fetch","response","node","text","scriptSource","loadLibraryFromString","eval","script","createElement","appendChild","createTextNode","body","loadCrunchModule","loadCrunch","loadCrunchDecoder","globalThis","GL","extractMipmapImages","images","mipMapLevels","levelWidth","width","levelHeight","height","offset","levelSize","getLevelSize","levelData","getLevelData","compressed","format","internalFormat","Math","max","index","isArray","Uint8Array","byteOffset","sizeFunction","getDxt1LevelSize","getDxtXLevelSize","CRN_FORMAT","DXT_FORMAT_MAP","pixelFormat","dst","cachedDstSize","srcSize","byteLength","bytes","src","_malloc","arrayBufferCopy","HEAPU8","_crn_get_dxt_format","Boolean","_crn_get_levels","_crn_get_width","_crn_get_height","dstSize","_free","_crn_decompress","image","srcData","dstData","dstByteOffset","numBytes","dst32Offset","tail","src32","Uint32Array","dst32","CrunchLoaderWithParser"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,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tBkG,GAAyB,SACjCzF,GAD8B,IAEjCP,MDkCK,SAAP,wCVhCmCF,GWChBkG,GXCG,oBAATvU,OAIXsM,EAAWE,UAAX,+BAAuB,WAAOhI,EAAMoI,GAAb,uBAAAwB,EAAA,2DACb5J,EADa,OAEd,YAFc,uCAMR0J,EAAuBtB,EAAvBsB,MANQ,EAMetB,EAAhBoB,eANC,MAMS,GANT,WAQMG,EAAU,CAC7BE,UACAN,YAAaG,EACbF,UACAzK,QAAS,CACPgL,MAAOT,KAbI,OAQTrI,EARS,OAgBf6G,EAAWqB,YAAY,OAAQ,CAAClI,WAhBjB,kDAkBTgH,EAAU,gBAAiB7I,MAAQ,KAAM6I,QAAU,GACzDH,EAAWqB,YAAY,QAAS,CAAChO,MAAO8M,IAnBzB,8FAAvB","file":"crunch-worker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","module.exports = require(\"regenerator-runtime\");\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","// Purpose: include this in your module to avoids adding dependencies on\n// micro modules like 'global' and 'is-browser';\n\n/* eslint-disable no-restricted-globals */\nconst globals = {\n self: typeof self !== 'undefined' && self,\n window: typeof window !== 'undefined' && window,\n global: typeof global !== 'undefined' && global,\n document: typeof document !== 'undefined' && document\n};\n\nconst self_: {[key: string]: any} = globals.self || globals.window || globals.global || {};\nconst window_: {[key: string]: any} = globals.window || globals.self || globals.global || {};\nconst global_: {[key: string]: any} = globals.global || globals.self || globals.window || {};\nconst document_: {[key: string]: any} = globals.document || {};\n\nexport {self_ as self, window_ as window, global_ as global, document_ as document};\n\n/** true if running in the browser, false if running in Node.js */\nexport const isBrowser: boolean =\n // @ts-ignore process.browser\n typeof process !== 'object' || String(process) !== '[object process]' || process.browser;\n\n/** true if running on a worker thread */\nexport const isWorker: boolean = typeof importScripts === 'function';\n\n/** true if running on a mobile device */\nexport const isMobile: boolean =\n typeof window !== 'undefined' && typeof window.orientation !== 'undefined';\n\n// Extract node major version\nconst matches =\n typeof process !== 'undefined' && process.version && /v([0-9]*)/.exec(process.version);\n\n/** Version of Node.js if running under Node, otherwise 0 */\nexport const nodeVersion: number = (matches && parseFloat(matches[1])) || 0;\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// NOTE - there is a copy of this function is both in core and loader-utils\n// core does not need all the utils in loader-utils, just this one.\n\n/**\n * Returns an array of Transferrable objects that can be used with postMessage\n * https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage\n * @param object data to be sent via postMessage\n * @param recursive - not for application use\n * @param transfers - not for application use\n * @returns a transfer list that can be passed to postMessage\n */\nexport function getTransferList(\n object: any,\n recursive: boolean = true,\n transfers?: Set<any>\n): Transferable[] {\n // Make sure that items in the transfer list is unique\n const transfersSet = transfers || new Set();\n\n if (!object) {\n // ignore\n } else if (isTransferable(object)) {\n transfersSet.add(object);\n } else if (isTransferable(object.buffer)) {\n // Typed array\n transfersSet.add(object.buffer);\n } else if (ArrayBuffer.isView(object)) {\n // object is a TypeArray viewing into a SharedArrayBuffer (not transferable)\n // Do not iterate through the content in this case\n } else if (recursive && typeof object === 'object') {\n for (const key in object) {\n // Avoid perf hit - only go one level deep\n getTransferList(object[key], recursive, transfersSet);\n }\n }\n\n // If transfers is defined, is internal recursive call\n // Otherwise it's called by the user\n return transfers === undefined ? Array.from(transfersSet) : [];\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Transferable\nfunction isTransferable(object) {\n if (!object) {\n return false;\n }\n if (object instanceof ArrayBuffer) {\n return true;\n }\n if (typeof MessagePort !== 'undefined' && object instanceof MessagePort) {\n return true;\n }\n if (typeof ImageBitmap !== 'undefined' && object instanceof ImageBitmap) {\n return true;\n }\n // @ts-ignore\n if (typeof OffscreenCanvas !== 'undefined' && object instanceof OffscreenCanvas) {\n return true;\n }\n return false;\n}\n","import type {WorkerMessageData, WorkerMessageType, WorkerMessagePayload} from '../../types';\nimport {getTransferList} from '../worker-utils/get-transfer-list';\n\nconst onMessageWrapperMap = new Map();\n\n/**\n * Type safe wrapper for worker code\n */\nexport default class WorkerBody {\n /*\n * (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n */\n static set onmessage(onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any) {\n // eslint-disable-next-line no-restricted-globals\n self.onmessage = (message) => {\n if (!isKnownMessage(message)) {\n return;\n }\n\n // Confusingly the message itself also has a 'type' field which is always set to 'message'\n const {type, payload} = message.data;\n onMessage(type, payload);\n };\n }\n\n static addEventListener(\n onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n ) {\n let onMessageWrapper = onMessageWrapperMap.get(onMessage);\n\n if (!onMessageWrapper) {\n onMessageWrapper = (message) => {\n if (!isKnownMessage(message)) {\n return;\n }\n\n // Confusingly the message itself also has a 'type' field which is always set to 'message'\n const {type, payload} = message.data;\n onMessage(type, payload);\n };\n }\n\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('message', onMessageWrapper);\n }\n\n static removeEventListener(\n onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n ) {\n const onMessageWrapper = onMessageWrapperMap.get(onMessage);\n onMessageWrapperMap.delete(onMessage);\n // eslint-disable-next-line no-restricted-globals\n self.removeEventListener('message', onMessageWrapper);\n }\n\n /**\n * Send a message from a worker to creating thread (main thread)\n * @param type\n * @param payload\n */\n static postMessage(type: WorkerMessageType, payload: WorkerMessagePayload): void {\n if (self) {\n const data: WorkerMessageData = {source: 'loaders.gl', type, payload};\n const transferList = getTransferList(payload);\n // eslint-disable-next-line no-restricted-globals\n // @ts-ignore\n self.postMessage(data, transferList);\n }\n }\n}\n\n// Filter out noise messages sent to workers\nfunction isKnownMessage(message) {\n const {type, data} = message;\n return (\n type === 'message' &&\n data &&\n typeof data.source === 'string' &&\n data.source.startsWith('loaders.gl')\n );\n}\n","/* eslint-disable no-restricted-globals */\nimport type {LoaderWithParser} from '../../types';\nimport {WorkerBody} from '@loaders.gl/worker-utils';\n// import {validateLoaderVersion} from './validate-loader-version';\n\nlet requestId = 0;\n\n/**\n * Set up a WebWorkerGlobalScope to talk with the main thread\n * @param loader\n */\nexport function createLoaderWorker(loader: LoaderWithParser) {\n // Check that we are actually in a worker thread\n if (typeof self === 'undefined') {\n return;\n }\n\n WorkerBody.onmessage = async (type, payload) => {\n switch (type) {\n case 'process':\n try {\n // validateLoaderVersion(loader, data.source.split('@')[1]);\n\n const {input, options = {}} = payload;\n\n const result = await parseData({\n loader,\n arrayBuffer: input,\n options,\n context: {\n parse: parseOnMainThread\n }\n });\n WorkerBody.postMessage('done', {result});\n } catch (error) {\n const message = error instanceof Error ? error.message : '';\n WorkerBody.postMessage('error', {error: message});\n }\n break;\n default:\n }\n };\n}\n\nfunction parseOnMainThread(arrayBuffer: ArrayBuffer, options: {[key: string]: any}): Promise<void> {\n return new Promise((resolve, reject) => {\n const id = requestId++;\n\n /**\n */\n const onMessage = (type, payload) => {\n if (payload.id !== id) {\n // not ours\n return;\n }\n\n switch (type) {\n case 'done':\n WorkerBody.removeEventListener(onMessage);\n resolve(payload.result);\n break;\n\n case 'error':\n WorkerBody.removeEventListener(onMessage);\n reject(payload.error);\n break;\n\n default:\n // ignore\n }\n };\n\n WorkerBody.addEventListener(onMessage);\n\n // Ask the main thread to decode data\n const payload = {id, input: arrayBuffer, options};\n WorkerBody.postMessage('process', payload);\n });\n}\n\n// TODO - Support byteOffset and byteLength (enabling parsing of embedded binaries without copies)\n// TODO - Why not support async loader.parse* funcs here?\n// TODO - Why not reuse a common function instead of reimplementing loader.parse* selection logic? Keeping loader small?\n// TODO - Lack of appropriate parser functions can be detected when we create worker, no need to wait until parse\nasync function parseData({loader, arrayBuffer, options, context}) {\n let data;\n let parser;\n if (loader.parseSync || loader.parse) {\n data = arrayBuffer;\n parser = loader.parseSync || loader.parse;\n } else if (loader.parseTextSync) {\n const textDecoder = new TextDecoder();\n data = textDecoder.decode(arrayBuffer);\n parser = loader.parseTextSync;\n } else {\n throw new Error(`Could not load data with ${loader.name} loader`);\n }\n\n // TODO - proper merge in of loader options...\n options = {\n ...options,\n modules: (loader && loader.options && loader.options.modules) || {},\n worker: false\n };\n\n return await parser(data, {...options}, context, loader);\n}\n","// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// TODO: use 'latest' instead of 'beta' when 3.0.0 version is released as 'latest'\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n","import type {Loader} from '@loaders.gl/loader-utils';\nimport {VERSION} from './lib/utils/version';\n\n/**\n * Worker loader for the Crunch compressed texture container format\n */\nexport const CrunchLoader = {\n id: 'crunch',\n name: 'Crunch',\n module: 'textures',\n version: VERSION,\n worker: true,\n extensions: ['crn'],\n mimeTypes: ['image/crn', 'image/x-crn', 'application/octet-stream'],\n binary: true,\n options: {\n crunch: {\n libraryPath: 'libs/'\n }\n }\n};\n\n// We avoid bundling crunch - rare format, only offer worker loader\n\n// TYPE TESTS - TODO find a better way than exporting junk\nexport const _TypecheckCrunchLoader: Loader = CrunchLoader;\n","/* global importScripts */\nimport {global, isBrowser, isWorker} from '../env-utils/globals';\nimport * as node from '../node/require-utils.node';\nimport {assert} from '../env-utils/assert';\nimport {VERSION as __VERSION__} from '../env-utils/version';\n\n// TODO - unpkg.com doesn't seem to have a `latest` specifier for alpha releases...\nconst LATEST = 'beta';\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : LATEST;\n\nconst loadLibraryPromises = {}; // promises\n\n/**\n * Dynamically loads a library (\"module\")\n *\n * - wasm library: Array buffer is returned\n * - js library: Parse JS is returned\n *\n * Method depends on environment\n * - browser - script element is created and installed on document\n * - worker - eval is called on global context\n * - node - file is required\n *\n * @param libraryUrl\n * @param moduleName\n * @param options\n */\nexport async function loadLibrary(\n libraryUrl: string,\n moduleName: string | null = null,\n options: object = {}\n): Promise<any> {\n if (moduleName) {\n libraryUrl = getLibraryUrl(libraryUrl, moduleName, options);\n }\n\n // Ensure libraries are only loaded once\n loadLibraryPromises[libraryUrl] =\n loadLibraryPromises[libraryUrl] || loadLibraryFromFile(libraryUrl);\n return await loadLibraryPromises[libraryUrl];\n}\n\n// TODO - sort out how to resolve paths for main/worker and dev/prod\nexport function getLibraryUrl(library, moduleName?: string, options?): string {\n // Check if already a URL\n if (library.startsWith('http')) {\n return library;\n }\n\n // Allow application to import and supply libraries through `options.modules`\n const modules = options.modules || {};\n if (modules[library]) {\n return modules[library];\n }\n\n // Load from local files, not from CDN scripts in Node.js\n // TODO - needs to locate the modules directory when installed!\n if (!isBrowser) {\n return `modules/${moduleName}/dist/libs/${library}`;\n }\n\n // In browser, load from external scripts\n if (options.CDN) {\n assert(options.CDN.startsWith('http'));\n return `${options.CDN}/${moduleName}@${VERSION}/dist/libs/${library}`;\n }\n\n // TODO - loading inside workers requires paths relative to worker script location...\n if (isWorker) {\n return `../src/libs/${library}`;\n }\n\n return `modules/${moduleName}/src/libs/${library}`;\n}\n\nasync function loadLibraryFromFile(libraryUrl) {\n if (libraryUrl.endsWith('wasm')) {\n const response = await fetch(libraryUrl);\n return await response.arrayBuffer();\n }\n\n if (!isBrowser) {\n return node.requireFromFile && (await node.requireFromFile(libraryUrl));\n }\n if (isWorker) {\n return importScripts(libraryUrl);\n }\n // TODO - fix - should be more secure than string parsing since observes CORS\n // if (isBrowser) {\n // return await loadScriptFromFile(libraryUrl);\n // }\n\n const response = await fetch(libraryUrl);\n const scriptSource = await response.text();\n return loadLibraryFromString(scriptSource, libraryUrl);\n}\n\n/*\nasync function loadScriptFromFile(libraryUrl) {\n const script = document.createElement('script');\n script.src = libraryUrl;\n return await new Promise((resolve, reject) => {\n script.onload = data => {\n resolve(data);\n };\n script.onerror = reject;\n });\n}\n*/\n\n// TODO - Needs security audit...\n// - Raw eval call\n// - Potentially bypasses CORS\n// Upside is that this separates fetching and parsing\n// we could create a`LibraryLoader` or`ModuleLoader`\nfunction loadLibraryFromString(scriptSource, id) {\n if (!isBrowser) {\n return node.requireFromString && node.requireFromString(scriptSource, id);\n }\n\n if (isWorker) {\n // Use lvalue trick to make eval run in global scope\n eval.call(global, scriptSource); // eslint-disable-line no-eval\n // https://stackoverflow.com/questions/9107240/1-evalthis-vs-evalthis-in-javascript\n // http://perfectionkills.com/global-eval-what-are-the-options/\n return null;\n }\n\n const script = document.createElement('script');\n script.id = id;\n // most browsers like a separate text node but some throw an error. The second method covers those.\n try {\n script.appendChild(document.createTextNode(scriptSource));\n } catch (e) {\n script.text = scriptSource;\n }\n document.body.appendChild(script);\n return null;\n}\n\n// TODO - technique for module injection into worker, from THREE.DracoLoader...\n/*\nfunction combineWorkerWithLibrary(worker, jsContent) {\n var fn = wWorker.toString();\n var body = [\n '// injected',\n jsContent,\n '',\n '// worker',\n fn.substring(fn.indexOf('{') + 1, fn.lastIndexOf('}'))\n ].join('\\n');\n this.workerSourceURL = URL.createObjectURL(new Blob([body]));\n}\n*/\n","import {loadLibrary} from '@loaders.gl/worker-utils';\n\n/**\n * Load crunch decoder module\n * @param options - loader options\n * @returns Promise of module object\n */\nexport async function loadCrunchModule(options): Promise<any> {\n const modules = options.modules || {};\n if (modules.crunch) {\n return modules.crunch;\n }\n\n return loadCrunch(options);\n}\n\nlet crunchModule;\n\n/**\n * Load crunch decoder module\n * @param {any} options - Loader options\n * @returns {Promise<any>} Promise of Module object\n */\nasync function loadCrunch(options) {\n if (crunchModule) {\n return crunchModule;\n }\n\n let loadCrunchDecoder = await loadLibrary('crunch.js', 'textures', options);\n\n // Depends on how import happened...\n // @ts-ignore TS2339: Property does not exist on type\n loadCrunchDecoder = loadCrunchDecoder || globalThis.loadCrunchDecoder;\n crunchModule = loadCrunchDecoder();\n return crunchModule;\n}\n","// Replacement for the external assert method to reduce bundle size\n// Note: We don't use the second \"message\" argument in calling code,\n// so no need to support it here\n\n/** Throws an `Error` with the optional `message` if `condition` is falsy */\nexport function assert(condition: any, message?: string): void {\n if (!condition) {\n throw new Error(message || 'loaders.gl assertion failed.');\n }\n}\n","/* eslint-disable camelcase */\nexport const GL = {\n // WEBGL_compressed_texture_s3tc\n\n COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83f0,\n COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83f1,\n COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83f2,\n COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83f3,\n\n // WEBGL_compressed_texture_es3\n\n COMPRESSED_R11_EAC: 0x9270,\n COMPRESSED_SIGNED_R11_EAC: 0x9271,\n COMPRESSED_RG11_EAC: 0x9272,\n COMPRESSED_SIGNED_RG11_EAC: 0x9273,\n COMPRESSED_RGB8_ETC2: 0x9274,\n COMPRESSED_RGBA8_ETC2_EAC: 0x9275,\n COMPRESSED_SRGB8_ETC2: 0x9276,\n COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9277,\n COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9278,\n COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9279,\n\n // WEBGL_compressed_texture_pvrtc\n\n COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 0x8c00,\n COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 0x8c02,\n COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 0x8c01,\n COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 0x8c03,\n\n // WEBGL_compressed_texture_etc1\n\n COMPRESSED_RGB_ETC1_WEBGL: 0x8d64,\n\n // WEBGL_compressed_texture_atc\n\n COMPRESSED_RGB_ATC_WEBGL: 0x8c92,\n COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: 0x8c93,\n COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: 0x87ee,\n\n // WEBGL_compressed_texture_astc\n\n COMPRESSED_RGBA_ASTC_4X4_KHR: 0x93b0,\n COMPRESSED_RGBA_ASTC_5X4_KHR: 0x93b1,\n COMPRESSED_RGBA_ASTC_5X5_KHR: 0x93b2,\n COMPRESSED_RGBA_ASTC_6X5_KHR: 0x93b3,\n COMPRESSED_RGBA_ASTC_6X6_KHR: 0x93b4,\n COMPRESSED_RGBA_ASTC_8X5_KHR: 0x93b5,\n COMPRESSED_RGBA_ASTC_8X6_KHR: 0x93b6,\n COMPRESSED_RGBA_ASTC_8X8_KHR: 0x93b7,\n COMPRESSED_RGBA_ASTC_10X5_KHR: 0x93b8,\n COMPRESSED_RGBA_ASTC_10X6_KHR: 0x93b9,\n COMPRESSED_RGBA_ASTC_10X8_KHR: 0x93ba,\n COMPRESSED_RGBA_ASTC_10X10_KHR: 0x93bb,\n COMPRESSED_RGBA_ASTC_12X10_KHR: 0x93bc,\n COMPRESSED_RGBA_ASTC_12X12_KHR: 0x93bd,\n COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR: 0x93d0,\n COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR: 0x93d1,\n COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR: 0x93d2,\n COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR: 0x93d3,\n COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR: 0x93d4,\n COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR: 0x93d5,\n COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR: 0x93d6,\n COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR: 0x93d7,\n COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR: 0x93d8,\n COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR: 0x93d9,\n COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR: 0x93da,\n COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR: 0x93db,\n COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR: 0x93dc,\n COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR: 0x93dd,\n\n // EXT_texture_compression_rgtc\n\n COMPRESSED_RED_RGTC1_EXT: 0x8dbb,\n COMPRESSED_SIGNED_RED_RGTC1_EXT: 0x8dbc,\n COMPRESSED_RED_GREEN_RGTC2_EXT: 0x8dbd,\n COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 0x8dbe,\n\n // WEBGL_compressed_texture_s3tc_srgb\n\n COMPRESSED_SRGB_S3TC_DXT1_EXT: 0x8c4c,\n COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: 0x8c4d,\n COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: 0x8c4e,\n COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: 0x8c4f\n};\n","/**\n * Throws an `Error` with the optional `message` if `condition` is falsy\n * @note Replacement for the external assert method to reduce bundle size\n */\nexport function assert(condition: any, message?: string): void {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}\n","import {CompressedTextureExtractOptions, TextureLevel} from '../../types';\n\n/**\n * Extract mipmap images from compressed texture buffer\n * @param data - binary data of compressed texture or Array of level objects\n * @param options.mipMapLevels - number of mipmap level inside image\n * @param options.width - width of 0 - level\n * @param options.height - height of 0 - level\n * @param options.sizeFunction - format-related function to calculate level size in bytes\n * @param options.internalFormat - WebGL compatible format code\n * @returns Array of the texture levels\n */\nexport function extractMipmapImages(\n data: Uint8Array | Array<Object>,\n options: CompressedTextureExtractOptions\n): TextureLevel[] {\n const images = new Array(options.mipMapLevels);\n\n let levelWidth = options.width;\n let levelHeight = options.height;\n let offset = 0;\n\n for (let i = 0; i < options.mipMapLevels; ++i) {\n const levelSize = getLevelSize(options, levelWidth, levelHeight, data, i);\n const levelData = getLevelData(data, i, offset, levelSize);\n\n images[i] = {\n compressed: true,\n format: options.internalFormat,\n data: levelData,\n width: levelWidth,\n height: levelHeight,\n levelSize\n };\n\n levelWidth = Math.max(1, levelWidth >> 1);\n levelHeight = Math.max(1, levelHeight >> 1);\n\n offset += levelSize;\n }\n return images;\n}\n\nfunction getLevelData(data, index, offset, levelSize) {\n if (!Array.isArray(data)) {\n return new Uint8Array(data.buffer, data.byteOffset + offset, levelSize);\n }\n\n return data[index].levelData;\n}\n\nfunction getLevelSize(options, levelWidth, levelHeight, data, index) {\n if (!Array.isArray(data)) {\n return options.sizeFunction(levelWidth, levelHeight);\n }\n return options.sizeFunction(data[index]);\n}\n","import type {TextureLevel} from '../../types';\nimport {assert} from '@loaders.gl/loader-utils';\nimport {GL} from '../gl-constants';\nimport {extractMipmapImages} from '../utils/extract-mipmap-images';\n\nconst getATCLevelSize = getDxt1LevelSize;\nconst getATCALevelSize = getDxtXLevelSize;\nconst getATCILevelSize = getDxtXLevelSize;\nconst DDS_CONSTANTS = {\n MAGIC_NUMBER: 0x20534444,\n HEADER_LENGTH: 31,\n MAGIC_NUMBER_INDEX: 0,\n HEADER_SIZE_INDEX: 1,\n HEADER_FLAGS_INDEX: 2,\n HEADER_HEIGHT_INDEX: 3,\n HEADER_WIDTH_INDEX: 4,\n MIPMAPCOUNT_INDEX: 7,\n HEADER_PF_FLAGS_INDEX: 20,\n HEADER_PF_FOURCC_INDEX: 21,\n DDSD_MIPMAPCOUNT: 0x20000,\n DDPF_FOURCC: 0x4,\n PIXEL_FORMATS: {\n DXT1: GL.COMPRESSED_RGB_S3TC_DXT1_EXT,\n DXT3: GL.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n DXT5: GL.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n 'ATC ': GL.COMPRESSED_RGB_ATC_WEBGL,\n ATCA: GL.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,\n ATCI: GL.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL\n },\n SIZE_FUNCTIONS: {\n DXT1: getDxt1LevelSize,\n DXT3: getDxtXLevelSize,\n DXT5: getDxtXLevelSize,\n 'ATC ': getATCLevelSize,\n ATCA: getATCALevelSize,\n ATCI: getATCILevelSize\n }\n};\n\n/**\n * Check if data is in \"DDS\" format by its magic number\n * @param data - binary data of compressed texture\n * @returns true - data in \"DDS\" format, else - false\n */\nexport function isDDS(data: ArrayBuffer): boolean {\n const header = new Uint32Array(data, 0, DDS_CONSTANTS.HEADER_LENGTH);\n const magic = header[DDS_CONSTANTS.MAGIC_NUMBER_INDEX];\n return magic === DDS_CONSTANTS.MAGIC_NUMBER;\n}\n\n/**\n * Parse texture data as \"DDS\" format\n * @param data - binary data of compressed texture\n * @returns Array of the texture levels\n */\nexport function parseDDS(data: ArrayBuffer): TextureLevel[] {\n const header = new Int32Array(data, 0, DDS_CONSTANTS.HEADER_LENGTH);\n const pixelFormatNumber = header[DDS_CONSTANTS.HEADER_PF_FOURCC_INDEX];\n assert(\n Boolean(header[DDS_CONSTANTS.HEADER_PF_FLAGS_INDEX] & DDS_CONSTANTS.DDPF_FOURCC),\n 'DDS: Unsupported format, must contain a FourCC code'\n );\n const fourCC = int32ToFourCC(pixelFormatNumber);\n const internalFormat = DDS_CONSTANTS.PIXEL_FORMATS[fourCC];\n const sizeFunction = DDS_CONSTANTS.SIZE_FUNCTIONS[fourCC];\n assert(internalFormat && sizeFunction, `DDS: Unknown pixel format ${pixelFormatNumber}`);\n\n let mipMapLevels = 1;\n if (header[DDS_CONSTANTS.HEADER_FLAGS_INDEX] & DDS_CONSTANTS.DDSD_MIPMAPCOUNT) {\n mipMapLevels = Math.max(1, header[DDS_CONSTANTS.MIPMAPCOUNT_INDEX]);\n }\n const width = header[DDS_CONSTANTS.HEADER_WIDTH_INDEX];\n const height = header[DDS_CONSTANTS.HEADER_HEIGHT_INDEX];\n const dataOffset = header[DDS_CONSTANTS.HEADER_SIZE_INDEX] + 4;\n const image = new Uint8Array(data, dataOffset);\n\n return extractMipmapImages(image, {\n mipMapLevels,\n width,\n height,\n sizeFunction,\n internalFormat\n });\n}\n\n/**\n * DXT1 applicable function to calculate level size\n * @param width - level width\n * @param height - level height\n * @returns level size in bytes\n */\nexport function getDxt1LevelSize(width: number, height: number): number {\n return ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n}\n\n/**\n * DXT3 & DXT5 applicable function to calculate level size\n * @param width - level width\n * @param height - level height\n * @returns level size in bytes\n */\nexport function getDxtXLevelSize(width: number, height: number): number {\n return ((width + 3) >> 2) * ((height + 3) >> 2) * 16;\n}\n\n/**\n * Convert every byte of Int32 value to char\n * @param {number} value - Int32 number\n * @returns {string} string of 4 characters\n */\nfunction int32ToFourCC(value) {\n return String.fromCharCode(\n value & 0xff,\n (value >> 8) & 0xff,\n (value >> 16) & 0xff,\n (value >> 24) & 0xff\n );\n}\n","import type {TextureLevel} from '../../types';\nimport {loadCrunchModule} from './crunch-module-loader';\nimport {GL} from '../gl-constants';\nimport {assert} from '@loaders.gl/loader-utils';\nimport {getDxt1LevelSize, getDxtXLevelSize} from './parse-dds';\nimport {extractMipmapImages} from '../utils/extract-mipmap-images';\n\n// Taken from crnlib.h\nconst CRN_FORMAT = {\n cCRNFmtInvalid: -1,\n\n cCRNFmtDXT1: 0,\n // cCRNFmtDXT3 is not currently supported when writing to CRN - only DDS.\n cCRNFmtDXT3: 1,\n cCRNFmtDXT5: 2\n\n // Crunch supports more formats than this.\n};\n\n// Mapping of Crunch formats to DXT formats.\nconst DXT_FORMAT_MAP = {};\nDXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT1] = {\n pixelFormat: GL.COMPRESSED_RGB_S3TC_DXT1_EXT,\n sizeFunction: getDxt1LevelSize\n};\nDXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT3] = {\n pixelFormat: GL.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n sizeFunction: getDxtXLevelSize\n};\nDXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT5] = {\n pixelFormat: GL.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n sizeFunction: getDxtXLevelSize\n};\n\nlet cachedDstSize = 0;\nlet dst: number;\n\n/**\n * Parse texture data as \"CRN\" format.\n * Function is \"async\" as emscriptified decoder module is loaded asyncronously\n * @param data - binary data of compressed texture\n * @returns Promise of Array of the texture levels\n */\nexport async function parseCrunch(data, options: any): Promise<TextureLevel[]> {\n const crunchModule = await loadCrunchModule(options);\n\n // Copy the contents of the arrayBuffer into emscriptens heap.\n const srcSize = data.byteLength;\n const bytes = new Uint8Array(data);\n const src = crunchModule._malloc(srcSize);\n arrayBufferCopy(bytes, crunchModule.HEAPU8, src, srcSize);\n\n // Determine what type of compressed data the file contains.\n const format = crunchModule._crn_get_dxt_format(src, srcSize);\n assert(Boolean(DXT_FORMAT_MAP[format]), 'Unsupported format');\n\n // Gather basic metrics about the DXT data.\n const mipMapLevels = crunchModule._crn_get_levels(src, srcSize);\n const width = crunchModule._crn_get_width(src, srcSize);\n const height = crunchModule._crn_get_height(src, srcSize);\n // const bytesPerBlock = crunchModule._crn_get_bytes_per_block(src, srcSize);\n\n // Determine the size of the decoded DXT data.\n const sizeFunction = DXT_FORMAT_MAP[format].sizeFunction;\n let dstSize = 0;\n for (let i = 0; i < mipMapLevels; ++i) {\n dstSize += sizeFunction(width >> i, height >> i);\n }\n\n // Allocate enough space on the emscripten heap to hold the decoded DXT data\n // or reuse the existing allocation if a previous call to this function has\n // already acquired a large enough buffer.\n if (cachedDstSize < dstSize) {\n if (dst) {\n crunchModule._free(dst);\n }\n dst = crunchModule._malloc(dstSize);\n cachedDstSize = dstSize;\n }\n\n // Decompress the DXT data from the Crunch file into the allocated space.\n crunchModule._crn_decompress(src, srcSize, dst, dstSize, 0, mipMapLevels);\n\n // Release the crunch file data from the emscripten heap.\n crunchModule._free(src);\n\n const image = new Uint8Array(crunchModule.HEAPU8.buffer, dst, dstSize).slice();\n return extractMipmapImages(image, {\n mipMapLevels,\n width,\n height,\n sizeFunction,\n internalFormat: DXT_FORMAT_MAP[format].pixelFormat\n });\n}\n\n/**\n * Copy an array of bytes into or out of the emscripten heap\n * @param {Uint8Array} srcData - Source data array\n * @param {Uint8Array} dstData - Destination data array\n * @param {number} dstByteOffset - Destination data offset\n * @param {number} numBytes - number of bytes to copy\n * @returns {void}\n */\nfunction arrayBufferCopy(srcData, dstData, dstByteOffset, numBytes) {\n let i;\n const dst32Offset = dstByteOffset / 4;\n const tail = numBytes % 4;\n const src32 = new Uint32Array(srcData.buffer, 0, (numBytes - tail) / 4);\n const dst32 = new Uint32Array(dstData.buffer);\n for (i = 0; i < src32.length; i++) {\n dst32[dst32Offset + i] = src32[i];\n }\n for (i = numBytes - tail; i < numBytes; i++) {\n dstData[dstByteOffset + i] = srcData[i];\n }\n}\n","import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport {CrunchLoader} from '../crunch-loader';\nimport {parseCrunch} from '../lib/parsers/parse-crunch';\n\n/**\n * Loader for the Crunch compressed texture container format\n */\nexport const CrunchLoaderWithParser = {\n ...CrunchLoader,\n parse: parseCrunch\n};\n\ncreateLoaderWorker(CrunchLoaderWithParser);\n"],"sourceRoot":""}
|
package/dist/dist.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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=7)}([function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));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||{},a="object"!=typeof r||"[object process]"!==String(r)||r.browser,s="function"==typeof importScripts,_=("undefined"!=typeof window&&window.orientation,void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version));_&&parseFloat(_[1])}).call(this,n(4),n(5))},,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 a(){throw new Error("clearTimeout has not been defined")}function s(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:a}catch(t){r=a}}();var _,c=[],S=!1,u=-1;function E(){S&&_&&(S=!1,_.length?c=_.concat(c):u=-1,c.length&&R())}function R(){if(!S){var t=s(E);S=!0;for(var e=c.length;e;){for(_=c,c=[];++u<e;)_&&_[u].run();u=-1,e=c.length}_=null,S=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!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 l(){}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||s(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=l,i.addListener=l,i.once=l,i.off=l,i.removeListener=l,i.removeAllListeners=l,i.emit=l,i.prependListener=l,i.prependOnceListener=l,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 a}));var r=n(10),i=n.n(r);const o=t+"/../../..";async function a(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){const r=n(9);globalThis.loaders=globalThis.loaders||{},t.exports=Object.assign(globalThis.loaders,r)},,function(t,e,n){"use strict";n.r(e),n.d(e,"BasisLoader",(function(){return W})),n.d(e,"BasisWorkerLoader",(function(){return V})),n.d(e,"CompressedTextureLoader",(function(){return Tt})),n.d(e,"CompressedTextureWorkerLoader",(function(){return dt})),n.d(e,"CrunchLoader",(function(){return mt})),n.d(e,"NPYLoader",(function(){return Mt})),n.d(e,"NPYWorkerLoader",(function(){return Dt})),n.d(e,"CompressedTextureWriter",(function(){return Bt})),n.d(e,"KTX2BasisUniversalTextureWriter",(function(){return gt})),n.d(e,"loadImageTexture",(function(){return te})),n.d(e,"loadImageTextureArray",(function(){return ne})),n.d(e,"loadImageTextureCube",(function(){return ie})),n.d(e,"GL_CONSTANTS",(function(){return E})),n.d(e,"selectSupportedBasisFormat",(function(){return k})),n.d(e,"getSupportedGPUTextureFormats",(function(){return A})),n.d(e,"CrunchWorkerLoader",(function(){return mt}));const r="3.1.0-alpha.5";var i=n(0),o=n(2);const a={};async function s(t,e=null,n={}){return e&&(t=function(t,e,n){if(t.startsWith("http"))return t;const r=n.modules||{};if(r[t])return r[t];if(!i.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.1.0-alpha.5/dist/libs/${t}`;if(i.c)return"../src/libs/"+t;return`modules/${e}/src/libs/${t}`}(t,e,n)),a[t]=a[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!i.b)return o.requireFromFile&&await o.requireFromFile(t);if(i.c)return importScripts(t);const e=await fetch(t);return function(t,e){if(!i.b)return o.requireFromString&&o.requireFromString(t,e);if(i.c)return eval.call(i.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 a[t]}let _,c;async function S(t){const e=t.modules||{};return e.basis?e.basis:(_=_||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await s("basis_transcoder.js","textures",t),await s("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 _)}async function u(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(c=c||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await s("https://unpkg.com/@loaders.gl/textures@3.1.0-alpha.5/dist/libs/basis_encoder.js","textures",t),await s("https://unpkg.com/@loaders.gl/textures@3.1.0-alpha.5/dist/libs/basis_encoder.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,KTX2File:r,initializeBasis:i,BasisEncoder:o}=t;i(),e({BasisFile:n,KTX2File:r,BasisEncoder:o})})})}(e,n)}(t),await c)}const E={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},R=["","WEBKIT_","MOZ_"],f={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 l=null;function A(t){if(!l){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,l=new Set;for(const e of R)for(const n in f)if(t&&t.getExtension(`${e}${n}`)){const t=f[n];l.add(t)}}return l}new Uint8Array([0]);const C=[171,75,84,88,32,50,48,187,13,10,26,10];var d,T,m,P,p,h,D,M;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(d||(d={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(T||(T={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(m||(m={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(P||(P={})),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"}(p||(p={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(h||(h={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(D||(D={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(M||(M={}));class B{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=d.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:T.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:m.UNSPECIFIED,colorPrimaries:P.SRGB,transferFunction:P.SRGB,flags:h.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class g{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 G(t){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(t):Buffer.from(t).toString("utf8")}function w(t,e){const n=new Array(e.mipMapLevels);let r=e.width,i=e.height,o=0;for(let a=0;a<e.mipMapLevels;++a){const s=x(e,r,i,t,a),_=O(t,a,o,s);n[a]={compressed:!0,format:e.internalFormat,data:_,width:r,height:i,levelSize:s},r=Math.max(1,r>>1),i=Math.max(1,i>>1),o+=s}return n}function O(t,e,n,r){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+n,r)}function x(t,e,n,r,i){return Array.isArray(r)?t.sizeFunction(r[i]):t.sizeFunction(e,n)}const y={131:E.COMPRESSED_RGB_S3TC_DXT1_EXT,132:E.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:E.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:E.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:E.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:E.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:E.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:E.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:E.COMPRESSED_RED_RGTC1_EXT,140:E.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:E.COMPRESSED_RED_GREEN_RGTC2_EXT,142:E.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:E.COMPRESSED_RGB8_ETC2,148:E.COMPRESSED_SRGB8_ETC2,149:E.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:E.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:E.COMPRESSED_RGBA8_ETC2_EAC,152:E.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:E.COMPRESSED_R11_EAC,154:E.COMPRESSED_SIGNED_R11_EAC,155:E.COMPRESSED_RG11_EAC,156:E.COMPRESSED_SIGNED_RG11_EAC,157:E.COMPRESSED_RGBA_ASTC_4x4_KHR,158:E.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:E.COMPRESSED_RGBA_ASTC_5x4_KHR,160:E.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:E.COMPRESSED_RGBA_ASTC_5x5_KHR,162:E.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:E.COMPRESSED_RGBA_ASTC_6x5_KHR,164:E.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:E.COMPRESSED_RGBA_ASTC_6x6_KHR,166:E.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:E.COMPRESSED_RGBA_ASTC_8x5_KHR,168:E.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:E.COMPRESSED_RGBA_ASTC_8x6_KHR,170:E.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:E.COMPRESSED_RGBA_ASTC_8x8_KHR,172:E.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:E.COMPRESSED_RGBA_ASTC_10x5_KHR,174:E.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:E.COMPRESSED_RGBA_ASTC_10x6_KHR,176:E.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:E.COMPRESSED_RGBA_ASTC_10x8_KHR,178:E.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:E.COMPRESSED_RGBA_ASTC_10x10_KHR,180:E.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:E.COMPRESSED_RGBA_ASTC_12x10_KHR,182:E.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:E.COMPRESSED_RGBA_ASTC_12x12_KHR,184:E.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:E.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:E.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:E.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:E.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:E.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:E.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:E.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:E.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:E.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:E.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:E.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:E.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:E.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:E.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:E.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:E.COMPRESSED_RGBA_ASTC_12x12_KHR};const H=[171,75,84,88,32,50,48,187,13,10,26,10];function b(t){const e=new Uint8Array(t.buffer||t,t.byteOffset||0,H.length);return!(e[0]!==H[0]||e[1]!==H[1]||e[2]!==H[2]||e[3]!==H[3]||e[4]!==H[4]||e[5]!==H[5]||e[6]!==H[6]||e[7]!==H[7]||e[8]!==H[8]||e[9]!==H[9]||e[10]!==H[10]||e[11]!==H[11])}function U(t){const e=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,C.length);if(e[0]!==C[0]||e[1]!==C[1]||e[2]!==C[2]||e[3]!==C[3]||e[4]!==C[4]||e[5]!==C[5]||e[6]!==C[6]||e[7]!==C[7]||e[8]!==C[8]||e[9]!==C[9]||e[10]!==C[10]||e[11]!==C[11])throw new Error("Missing KTX 2.0 identifier.");const n=new B,r=17*Uint32Array.BYTES_PER_ELEMENT,i=new g(t,C.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 a=i._nextUint32(),s=i._nextUint32(),_=i._nextUint32(),c=i._nextUint32(),S=i._nextUint64(),u=i._nextUint64(),E=new g(t,C.length+r,3*o*8,!0);for(let e=0;e<o;e++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+E._nextUint64(),E._nextUint64()),uncompressedByteLength:E._nextUint64()});const R=new g(t,a,s,!0),f={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:[]},l=(f.descriptorBlockSize/4-6)/4;for(let t=0;t<l;t++)f.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(f);const A=new g(t,_,c,!0);for(;A._offset<c;){const t=A._nextUint32(),e=A._scan(t),r=G(e),i=A._scan(t-e.byteLength);n.keyValue[r]=r.match(/^ktx/i)?G(i):i,t%4&&A._skip(4-t%4)}if(u<=0)return n;const d=new g(t,S,u,!0),T=d._nextUint16(),m=d._nextUint16(),P=d._nextUint32(),p=d._nextUint32(),h=d._nextUint32(),D=d._nextUint32(),M=[];for(let t=0;t<o;t++)M.push({imageFlags:d._nextUint32(),rgbSliceByteOffset:d._nextUint32(),rgbSliceByteLength:d._nextUint32(),alphaSliceByteOffset:d._nextUint32(),alphaSliceByteLength:d._nextUint32()});const w=S+d._offset,O=w+P,x=O+p,y=x+h,H=new Uint8Array(t.buffer,t.byteOffset+w,P),b=new Uint8Array(t.buffer,t.byteOffset+O,p),U=new Uint8Array(t.buffer,t.byteOffset+x,h),L=new Uint8Array(t.buffer,t.byteOffset+y,D);return n.globalData={endpointCount:T,selectorCount:m,imageDescs:M,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=(a=e.vkFormat,y[a]);var a;return w(e.levels,{mipMapLevels:n,width:r,height:i,sizeFunction:t=>t.uncompressedByteLength,internalFormat:o})}const L={etc1:{basisFormat:0,compressed:!0,format:E.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:E.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:E.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,format:E.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:E.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:E.COMPRESSED_RGBA_ASTC_4X4_KHR},"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}};async function X(t,e){if("auto"===e.basis.containerFormat){if(b(t)){return v((await u(e)).KTX2File,t,e)}const{BasisFile:n}=await S(e);return I(n,t,e)}switch(e.basis.module){case"encoder":const n=await u(e);switch(e.basis.containerFormat){case"ktx2":return v(n.KTX2File,t,e);case"basis":default:return I(n.BasisFile,t,e)}case"transcoder":default:const{BasisFile:r}=await S(e);return I(r,t,e)}}function I(t,e,n){const r=new t(new Uint8Array(e));try{if(!r.startTranscoding())return null;const t=r.getNumImages(),e=[];for(let i=0;i<t;i++){const t=r.getNumLevels(i),o=[];for(let e=0;e<t;e++)o.push(K(r,i,e,n));e.push(o)}return e}finally{r.close(),r.delete()}}function K(t,e,n,r){const i=t.getImageWidth(e,n),o=t.getImageHeight(e,n),a=t.getHasAlpha(),{compressed:s,format:_,basisFormat:c}=N(r,a),S=t.getImageTranscodedSizeInBytes(e,n,c),u=new Uint8Array(S);return t.transcodeImage(u,e,n,c,0,0)?{width:i,height:o,data:u,compressed:s,hasAlpha:a,format:_}:null}function v(t,e,n){const r=new t(new Uint8Array(e));try{if(!r.startTranscoding())return null;const t=r.getLevels(),e=[];for(let i=0;i<t;i++){e.push(F(r,i,n));break}return e}finally{r.close(),r.delete()}}function F(t,e,n){const{alphaFlag:r,height:i,width:o}=t.getImageLevelInfo(e,0,0),{compressed:a,format:s,basisFormat:_}=N(n,r),c=t.getImageTranscodedSizeInBytes(e,0,0,_),S=new Uint8Array(c);return t.transcodeImage(S,e,0,0,_,0,-1,-1)?{width:o,height:i,data:S,compressed:a,alphaFlag:r,format:s}:null}function N(t,e){let n=t&&t.basis&&t.basis.format;return"auto"===n&&(n=k()),"object"==typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),L[n]}function k(){const t=A();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const V={name:"Basis",id:"basis",module:"textures",version:r,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},W={...V,parse:X};function j(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const z=J,$=Q,Z=Q,q={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:E.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:E.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:E.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":E.COMPRESSED_RGB_ATC_WEBGL,ATCA:E.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:E.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},SIZE_FUNCTIONS:{DXT1:J,DXT3:Q,DXT5:Q,"ATC ":z,ATCA:$,ATCI:Z}};function Y(t){const e=new Int32Array(t,0,q.HEADER_LENGTH),n=e[q.HEADER_PF_FOURCC_INDEX];j(Boolean(e[q.HEADER_PF_FLAGS_INDEX]&q.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=q.PIXEL_FORMATS[r],a=q.SIZE_FUNCTIONS[r];j(o&&a,"DDS: Unknown pixel format "+n);let s=1;e[q.HEADER_FLAGS_INDEX]&q.DDSD_MIPMAPCOUNT&&(s=Math.max(1,e[q.MIPMAPCOUNT_INDEX]));const _=e[q.HEADER_WIDTH_INDEX],c=e[q.HEADER_HEIGHT_INDEX],S=e[q.HEADER_SIZE_INDEX]+4;return w(new Uint8Array(t,S),{mipMapLevels:s,width:_,height:c,sizeFunction:a,internalFormat:o})}function J(t,e){return(t+3>>2)*(e+3>>2)*8}function Q(t,e){return(t+3>>2)*(e+3>>2)*16}const tt=55727696,et=1347834371,nt=13,rt=52,it=0,ot=2,at=4,st=6,_t=7,ct=11,St=12,ut={0:[E.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[E.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[E.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[E.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[E.COMPRESSED_RGB_ETC1_WEBGL],7:[E.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[E.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[E.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[E.COMPRESSED_RGB8_ETC2],23:[E.COMPRESSED_RGBA8_ETC2_EAC],24:[E.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[E.COMPRESSED_R11_EAC],26:[E.COMPRESSED_RG11_EAC],27:[E.COMPRESSED_RGBA_ASTC_4X4_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[E.COMPRESSED_RGBA_ASTC_5X4_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[E.COMPRESSED_RGBA_ASTC_5X5_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[E.COMPRESSED_RGBA_ASTC_6X5_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[E.COMPRESSED_RGBA_ASTC_6X6_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[E.COMPRESSED_RGBA_ASTC_8X5_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[E.COMPRESSED_RGBA_ASTC_8X6_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[E.COMPRESSED_RGBA_ASTC_8X8_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[E.COMPRESSED_RGBA_ASTC_10X5_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[E.COMPRESSED_RGBA_ASTC_10X6_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[E.COMPRESSED_RGBA_ASTC_10X8_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[E.COMPRESSED_RGBA_ASTC_10X10_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[E.COMPRESSED_RGBA_ASTC_12X10_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[E.COMPRESSED_RGBA_ASTC_12X12_KHR,E.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},Et={0:Rt,1:Rt,2:ft,3:ft,6:lt,7:lt,9:At,11:At,22:lt,23:At,24:lt,25:lt,26:At,27:At,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 Rt(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function ft(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function lt(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function At(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function Ct(t){if(b(t))return U(t);if(function(t){return new Uint32Array(t,0,q.HEADER_LENGTH)[q.MAGIC_NUMBER_INDEX]===q.MAGIC_NUMBER}(t))return Y(t);if(function(t){const e=new Uint32Array(t,0,nt)[it];return e===tt||e===et}(t))return function(t){const e=new Uint32Array(t,0,nt),n=e[ot],r=e[at],i=ut[n]||[],o=i.length>1&&r?i[1]:i[0],a=Et[n],s=e[ct],_=e[_t],c=e[st],S=rt+e[St];return w(new Uint8Array(t,S),{mipMapLevels:s,width:_,height:c,sizeFunction:a,internalFormat:o})}(t);throw new Error("Texture container format not recognized")}const dt={name:"Texture Containers",id:"compressed-texture",module:"textures",version:r,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/",useBasis:!1}}},Tt={...dt,parse:async(t,e)=>e["compressed-texture"].useBasis?(e.basis={format:{alpha:"BC3",noAlpha:"BC1"},...e.basis,containerFormat:"ktx2",module:"encoder"},await X(t,e)):Ct(t)},mt={id:"crunch",name:"Crunch",module:"textures",version:r,worker:!0,extensions:["crn"],mimeTypes:["image/crn","image/x-crn","application/octet-stream"],binary:!0,options:{crunch:{libraryPath:"libs/"}}};const Pt=function(){const t=new Uint32Array([305419896]);return!(18===new Uint8Array(t.buffer,t.byteOffset,t.byteLength)[0])}(),pt={u1:Uint8Array,i1:Int8Array,u2:Uint16Array,i2:Int16Array,u4:Uint32Array,i4:Int32Array,f4:Float32Array,f8:Float64Array};function ht(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),a=i.decode(o);r+=n;return{header:JSON.parse(a.replace(/'/g,'"').replace("False","false").replace("(","[").replace(/,*\),*/g,"]")),headerEndOffset:r}}(n),o=r.descr,a=pt[o.slice(1,3)];if(!a)return console.warn("Decoding of npy dtype not implemented: "+o),null;const s=r.shape.reduce((t,e)=>t*e)*a.BYTES_PER_ELEMENT,_=new a(t.slice(i,i+s));return(">"===o[0]&&Pt||"<"===o[0]&&!Pt)&&console.warn("Data is wrong endianness, byte swapping not yet implemented."),{data:_,header:r}}const Dt={name:"NPY",id:"npy",module:"textures",version:r,worker:!0,extensions:["npy"],mimeTypes:[],tests:[new Uint8Array([147,78,85,77,80,89]).buffer],options:{npy:{}}},Mt={...Dt,parseSync:ht,parse:async(t,e)=>ht(t)};const Bt={name:"DDS Texture Container",id:"dds",module:"textures",version:r,extensions:["dds"],options:{texture:{format:"auto",compression:"auto",quality:"auto",mipmap:!1,flipY:!1,toolFlags:""}},encodeURLtoURL:n(6).a};const gt={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-supercompressed-texture",module:"textures",version:r,extensions:["ktx2"],options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1},encode:async function(t,e={}){const{useSRGB:n=!1,qualityLevel:r=10,encodeUASTC:i=!1,mipmaps:o=!1}=e,{BasisEncoder:a}=await u(e),s=new a;try{const e=new Uint8Array(t.width*t.height*4);s.setCreateKTX2File(!0),s.setKTX2UASTCSupercompression(!0),s.setKTX2SRGBTransferFunc(!0),s.setSliceSourceImage(0,t.data,t.width,t.height,!1),s.setPerceptual(n),s.setMipSRGB(n),s.setQualityLevel(r),s.setUASTC(i),s.setMipGen(o);const a=s.encode(e);return new Uint8Array(e.buffer,0,a)}catch(t){throw console.error("Basis Universal Supercompressed GPU Texture encoder Error: ",t),t}finally{s.delete()}}};var Gt=n(12);const{_parseImageNode:wt}=globalThis,Ot="undefined"!=typeof Image,xt="undefined"!=typeof ImageBitmap,yt=Boolean(wt),Ht=!!Gt.a||yt;function bt(t){const e=Lt(t);if(!e)throw new Error("Not an image");return e}function Ut(t){switch(bt(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 Lt(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 Xt=/^data:image\/svg\+xml/,It=/\.svg((\?|#).*)?$/;function Kt(t){return t&&(Xt.test(t)||It.test(t))}function vt(t,e){if(Kt(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Ft(t,e,n){const r=function(t,e){if(Kt(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 vt(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 Nt={};let kt=!0;async function Vt(t,e,n){let r;if(Kt(n)){r=await Ft(t,e,n)}else r=vt(t,n);const i=e&&e.imagebitmap;return await async function(t,e=null){!function(t){for(const e in t||Nt)return!1;return!0}(e)&&kt||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),kt=!1}return await createImageBitmap(t)}(r,i)}function Wt(t){const e=jt(t);return function(t){const e=jt(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=jt(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=jt(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=jt(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 jt(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 zt={id:"image",module:"images",name:"Images",version:"3.1.0-alpha.5",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(xt)return"imagebitmap";if(Ot)return"image";if(Ht)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return xt||Ot||Ht;case"imagebitmap":return xt;case"image":return Ot;case"data":return Ht;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}(r)){case"imagebitmap":o=await Vt(t,e,i);break;case"image":o=await Ft(t,e,i);break;case"data":o=await async function(t,e){const{mimeType:n}=Wt(t)||{},r=globalThis._parseImageNode;return j(r),await r(t,n)}(t);break;default:j(!1)}return"data"===r&&(o=Ut(o)),o},tests:[t=>Boolean(Wt(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};let $t="";const Zt={};function qt(t,e,n){let r=t;"function"==typeof t&&(r=t({...e,...n})),j("string"==typeof r);const{baseUrl:i}=e;return i&&(r="/"===i[i.length-1]?`${i}${r}`:`${i}/${r}`),function(t){for(const e in Zt)if(t.startsWith(e)){const n=Zt[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t=`${$t}${t}`),t}(r)}async function Yt(t,e,n){if(Array.isArray(t))return await async function(t,e,n={}){const r=t.map(t=>Yt(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 a=Yt(t[o],e,n).then(t=>{i[o]=t});r.push(a)}return await Promise.all(r),i}(t,e,n);var r;const i=t;return await e(i,n)}async function Jt(t,e,n){return await async function(t,e,n={}){return await Yt(t,e,n)}(t,t=>Qt(t,e,n))}async function Qt(t,e,n){const r=await fetch(t,n.fetch),i=await r.arrayBuffer();return await e(i,n)}async function te(t,e={}){const n=await ee(t,e);return await Jt(n,zt.parse,e)}async function ee(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=qt(t,n,{...r,lod:0}),a=await Qt(o,zt.parse,n),{width:s,height:_}=function(t){return Ut(t)}(a);e=function({width:t,height:e}){return 1+Math.floor(Math.log2(Math.max(t,e)))}({width:s,height:_}),i.push(o)}j(e>0);for(let o=i.length;o<e;++o){const e=qt(t,n,{...r,lod:o});i.push(e)}return i}(t,r,e,n):qt(t,e,n)}async function ne(t,e,n={}){const r=await async function(t,e,n={}){const r=[];for(let i=0;i<t;i++){const t=ee(e,n,{index:i});r.push(t)}return await Promise.all(r)}(t,e,n);return await Jt(r,zt.parse,n)}const re=[{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 ie(t,e={}){const n=await async function(t,e){const n={},r=[];let i=0;for(let o=0;o<re.length;++o){const o=re[i],a=ee(t,e,{...o,index:i++}).then(t=>{n[o.face]=t});r.push(a)}return await Promise.all(r),n}(t,e);return await Jt(n,zt.parse,e)}},function(t,e){},,function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return i}));"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document;const i=Boolean("object"!=typeof r||"[object process]"!==String(r)||r.browser),o=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);o&&parseFloat(o[1])}).call(this,n(4),n(5))}])}));
|
|
2
|
-
//# sourceMappingURL=dist.min.js.map
|