@loaders.gl/core 4.0.0-alpha.5 → 4.0.0-alpha.7
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/bundle.js +2 -2
- package/dist/core-addons/write-file-browser.js +59 -1
- package/dist/dist.min.js +934 -451
- package/dist/es5/bundle.js +6 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/core-addons/write-file-browser.js +2 -0
- package/dist/es5/core-addons/write-file-browser.js.map +1 -0
- package/dist/es5/index.js +377 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js +94 -0
- package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js.map +1 -0
- package/dist/es5/iterators/make-iterator/make-array-buffer-iterator.js +42 -0
- package/dist/es5/iterators/make-iterator/make-array-buffer-iterator.js.map +1 -0
- package/dist/es5/iterators/make-iterator/make-blob-iterator.js +47 -0
- package/dist/es5/iterators/make-iterator/make-blob-iterator.js.map +1 -0
- package/dist/es5/iterators/make-iterator/make-iterator.js +31 -0
- package/dist/es5/iterators/make-iterator/make-iterator.js.map +1 -0
- package/dist/es5/iterators/make-iterator/make-stream-iterator.js +133 -0
- package/dist/es5/iterators/make-iterator/make-stream-iterator.js.map +1 -0
- package/dist/es5/iterators/make-iterator/make-string-iterator.js +38 -0
- package/dist/es5/iterators/make-iterator/make-string-iterator.js.map +1 -0
- package/dist/es5/iterators/make-stream/make-dom-stream.js +67 -0
- package/dist/es5/iterators/make-stream/make-dom-stream.js.map +1 -0
- package/dist/es5/iterators/make-stream/make-node-stream.js +168 -0
- package/dist/es5/iterators/make-stream/make-node-stream.js.map +1 -0
- package/dist/es5/javascript-utils/is-type.js +79 -0
- package/dist/es5/javascript-utils/is-type.js.map +1 -0
- package/dist/es5/lib/api/encode-table.js +159 -0
- package/dist/es5/lib/api/encode-table.js.map +1 -0
- package/dist/es5/lib/api/encode.js +244 -0
- package/dist/es5/lib/api/encode.js.map +1 -0
- package/dist/es5/lib/api/load-in-batches.js +63 -0
- package/dist/es5/lib/api/load-in-batches.js.map +1 -0
- package/dist/es5/lib/api/load.js +76 -0
- package/dist/es5/lib/api/load.js.map +1 -0
- package/dist/es5/lib/api/loader-options.js +19 -0
- package/dist/es5/lib/api/loader-options.js.map +1 -0
- package/dist/es5/lib/api/parse-in-batches.js +278 -0
- package/dist/es5/lib/api/parse-in-batches.js.map +1 -0
- package/dist/es5/lib/api/parse-sync.js +53 -0
- package/dist/es5/lib/api/parse-sync.js.map +1 -0
- package/dist/es5/lib/api/parse.js +143 -0
- package/dist/es5/lib/api/parse.js.map +1 -0
- package/dist/es5/lib/api/register-loaders.js +50 -0
- package/dist/es5/lib/api/register-loaders.js.map +1 -0
- package/dist/es5/lib/api/save.js +42 -0
- package/dist/es5/lib/api/save.js.map +1 -0
- package/dist/es5/lib/api/select-loader.js +302 -0
- package/dist/es5/lib/api/select-loader.js.map +1 -0
- package/dist/es5/lib/common.js +2 -0
- package/dist/es5/lib/common.js.map +1 -0
- package/dist/es5/lib/fetch/fetch-error-message.js +56 -0
- package/dist/es5/lib/fetch/fetch-error-message.js.map +1 -0
- package/dist/es5/lib/fetch/fetch-file.js +47 -0
- package/dist/es5/lib/fetch/fetch-file.js.map +1 -0
- package/dist/es5/lib/fetch/read-array-buffer.js +76 -0
- package/dist/es5/lib/fetch/read-array-buffer.js.map +1 -0
- package/dist/es5/lib/fetch/read-file.js +20 -0
- package/dist/es5/lib/fetch/read-file.js.map +1 -0
- package/dist/es5/lib/fetch/write-file.js +48 -0
- package/dist/es5/lib/fetch/write-file.js.map +1 -0
- package/dist/es5/lib/filesystems/browser-filesystem.js +249 -0
- package/dist/es5/lib/filesystems/browser-filesystem.js.map +1 -0
- package/dist/es5/lib/filesystems/filesystem.js +2 -0
- package/dist/es5/lib/filesystems/filesystem.js.map +1 -0
- package/dist/es5/lib/filesystems/read-array-buffer.js +41 -0
- package/dist/es5/lib/filesystems/read-array-buffer.js.map +1 -0
- package/dist/es5/lib/init.js +18 -0
- package/dist/es5/lib/init.js.map +1 -0
- package/dist/es5/lib/loader-utils/check-errors.js +57 -0
- package/dist/es5/lib/loader-utils/check-errors.js.map +1 -0
- package/dist/es5/lib/loader-utils/get-data.js +237 -0
- package/dist/es5/lib/loader-utils/get-data.js.map +1 -0
- package/dist/es5/lib/loader-utils/get-fetch-function.js +26 -0
- package/dist/es5/lib/loader-utils/get-fetch-function.js.map +1 -0
- package/dist/es5/lib/loader-utils/loader-context.js +49 -0
- package/dist/es5/lib/loader-utils/loader-context.js.map +1 -0
- package/dist/es5/lib/loader-utils/loggers.js +90 -0
- package/dist/es5/lib/loader-utils/loggers.js.map +1 -0
- package/dist/es5/lib/loader-utils/normalize-loader.js +44 -0
- package/dist/es5/lib/loader-utils/normalize-loader.js.map +1 -0
- package/dist/es5/lib/loader-utils/option-defaults.js +47 -0
- package/dist/es5/lib/loader-utils/option-defaults.js.map +1 -0
- package/dist/es5/lib/loader-utils/option-utils.js +132 -0
- package/dist/es5/lib/loader-utils/option-utils.js.map +1 -0
- package/dist/es5/lib/progress/fetch-progress.js +134 -0
- package/dist/es5/lib/progress/fetch-progress.js.map +1 -0
- package/dist/es5/lib/utils/log.js +12 -0
- package/dist/es5/lib/utils/log.js.map +1 -0
- package/dist/es5/lib/utils/mime-type-utils.js +24 -0
- package/dist/es5/lib/utils/mime-type-utils.js.map +1 -0
- package/dist/es5/lib/utils/resource-utils.js +62 -0
- package/dist/es5/lib/utils/resource-utils.js.map +1 -0
- package/dist/es5/lib/utils/response-utils.js +197 -0
- package/dist/es5/lib/utils/response-utils.js.map +1 -0
- package/dist/es5/lib/utils/url-utils.js +16 -0
- package/dist/es5/lib/utils/url-utils.js.map +1 -0
- package/dist/es5/null-loader.js +139 -0
- package/dist/es5/null-loader.js.map +1 -0
- package/dist/es5/workers/null-worker.js +6 -0
- package/dist/es5/workers/null-worker.js.map +1 -0
- package/dist/esm/bundle.js +4 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/core-addons/README.md +1 -0
- package/dist/esm/core-addons/write-file-browser.js +2 -0
- package/dist/esm/core-addons/write-file-browser.js.map +1 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js +16 -0
- package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js.map +1 -0
- package/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js +20 -0
- package/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js.map +1 -0
- package/dist/esm/iterators/make-iterator/make-blob-iterator.js +12 -0
- package/dist/esm/iterators/make-iterator/make-blob-iterator.js.map +1 -0
- package/dist/esm/iterators/make-iterator/make-iterator.js +25 -0
- package/dist/esm/iterators/make-iterator/make-iterator.js.map +1 -0
- package/dist/esm/iterators/make-iterator/make-stream-iterator.js +32 -0
- package/dist/esm/iterators/make-iterator/make-stream-iterator.js.map +1 -0
- package/dist/esm/iterators/make-iterator/make-string-iterator.js +13 -0
- package/dist/esm/iterators/make-iterator/make-string-iterator.js.map +1 -0
- package/dist/esm/iterators/make-stream/make-dom-stream.js +29 -0
- package/dist/esm/iterators/make-stream/make-dom-stream.js.map +1 -0
- package/dist/esm/iterators/make-stream/make-node-stream.js +57 -0
- package/dist/esm/iterators/make-stream/make-node-stream.js.map +1 -0
- package/dist/esm/javascript-utils/is-type.js +19 -0
- package/dist/esm/javascript-utils/is-type.js.map +1 -0
- package/dist/esm/lib/api/encode-table.js +45 -0
- package/dist/esm/lib/api/encode-table.js.map +1 -0
- package/dist/esm/lib/api/encode.js +87 -0
- package/dist/esm/lib/api/encode.js.map +1 -0
- package/dist/esm/lib/api/load-in-batches.js +25 -0
- package/dist/esm/lib/api/load-in-batches.js.map +1 -0
- package/dist/esm/lib/api/load.js +26 -0
- package/dist/esm/lib/api/load.js.map +1 -0
- package/dist/esm/lib/api/loader-options.js +3 -0
- package/dist/esm/lib/api/loader-options.js.map +1 -0
- package/dist/esm/lib/api/parse-in-batches.js +84 -0
- package/dist/esm/lib/api/parse-in-batches.js.map +1 -0
- package/dist/esm/lib/api/parse-sync.js +45 -0
- package/dist/esm/lib/api/parse-sync.js.map +1 -0
- package/dist/esm/lib/api/parse.js +74 -0
- package/dist/esm/lib/api/parse.js.map +1 -0
- package/dist/esm/lib/api/register-loaders.js +25 -0
- package/dist/esm/lib/api/register-loaders.js.map +1 -0
- package/dist/esm/lib/api/save.js +11 -0
- package/dist/esm/lib/api/save.js.map +1 -0
- package/dist/esm/lib/api/select-loader.js +201 -0
- package/dist/esm/lib/api/select-loader.js.map +1 -0
- package/dist/esm/lib/common.js +2 -0
- package/dist/esm/lib/common.js.map +1 -0
- package/dist/esm/lib/fetch/fetch-error-message.js +18 -0
- package/dist/esm/lib/fetch/fetch-error-message.js.map +1 -0
- package/dist/esm/lib/fetch/fetch-file.js +14 -0
- package/dist/esm/lib/fetch/fetch-file.js.map +1 -0
- package/dist/esm/lib/fetch/read-array-buffer.js +23 -0
- package/dist/esm/lib/fetch/read-array-buffer.js.map +1 -0
- package/dist/esm/lib/fetch/read-file.js +15 -0
- package/dist/esm/lib/fetch/read-file.js.map +1 -0
- package/dist/esm/lib/fetch/write-file.js +21 -0
- package/dist/esm/lib/fetch/write-file.js.map +1 -0
- package/dist/esm/lib/filesystems/browser-filesystem.js +92 -0
- package/dist/esm/lib/filesystems/browser-filesystem.js.map +1 -0
- package/dist/esm/lib/filesystems/filesystem.js +2 -0
- package/dist/esm/lib/filesystems/filesystem.js.map +1 -0
- package/dist/esm/lib/filesystems/read-array-buffer.js +8 -0
- package/dist/esm/lib/filesystems/read-array-buffer.js.map +1 -0
- package/dist/esm/lib/init.js +11 -0
- package/dist/esm/lib/init.js.map +1 -0
- package/dist/esm/lib/loader-utils/check-errors.js +22 -0
- package/dist/esm/lib/loader-utils/check-errors.js.map +1 -0
- package/dist/esm/lib/loader-utils/get-data.js +103 -0
- package/dist/esm/lib/loader-utils/get-data.js.map +1 -0
- package/dist/esm/lib/loader-utils/get-fetch-function.js +18 -0
- package/dist/esm/lib/loader-utils/get-fetch-function.js.map +1 -0
- package/dist/esm/lib/loader-utils/loader-context.js +38 -0
- package/dist/esm/lib/loader-utils/loader-context.js.map +1 -0
- package/dist/esm/lib/loader-utils/loggers.js +50 -0
- package/dist/esm/lib/loader-utils/loggers.js.map +1 -0
- package/dist/esm/lib/loader-utils/normalize-loader.js +37 -0
- package/dist/esm/lib/loader-utils/normalize-loader.js.map +1 -0
- package/dist/esm/lib/loader-utils/option-defaults.js +39 -0
- package/dist/esm/lib/loader-utils/option-defaults.js.map +1 -0
- package/dist/esm/lib/loader-utils/option-utils.js +106 -0
- package/dist/esm/lib/loader-utils/option-utils.js.map +1 -0
- package/dist/esm/lib/progress/fetch-progress.js +52 -0
- package/dist/esm/lib/progress/fetch-progress.js.map +1 -0
- package/dist/esm/lib/utils/log.js +5 -0
- package/dist/esm/lib/utils/log.js.map +1 -0
- package/dist/esm/lib/utils/mime-type-utils.js +17 -0
- package/dist/esm/lib/utils/mime-type-utils.js.map +1 -0
- package/dist/esm/lib/utils/resource-utils.js +54 -0
- package/dist/esm/lib/utils/resource-utils.js.map +1 -0
- package/dist/esm/lib/utils/response-utils.js +89 -0
- package/dist/esm/lib/utils/response-utils.js.map +1 -0
- package/dist/esm/lib/utils/url-utils.js +9 -0
- package/dist/esm/lib/utils/url-utils.js.map +1 -0
- package/dist/esm/null-loader.js +45 -0
- package/dist/esm/null-loader.js.map +1 -0
- package/dist/esm/workers/null-worker.js +4 -0
- package/dist/esm/workers/null-worker.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -29
- package/dist/iterators/batch-iterators/timed-batch-iterator.js +20 -17
- package/dist/iterators/make-iterator/make-array-buffer-iterator.js +25 -16
- package/dist/iterators/make-iterator/make-blob-iterator.js +20 -12
- package/dist/iterators/make-iterator/make-iterator.d.ts +1 -1
- package/dist/iterators/make-iterator/make-iterator.d.ts.map +1 -1
- package/dist/iterators/make-iterator/make-iterator.js +36 -29
- package/dist/iterators/make-iterator/make-stream-iterator.d.ts +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.d.ts.map +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.js +89 -32
- package/dist/iterators/make-iterator/make-string-iterator.js +22 -12
- package/dist/iterators/make-stream/make-dom-stream.d.ts +1 -1
- package/dist/iterators/make-stream/make-dom-stream.d.ts.map +1 -1
- package/dist/iterators/make-stream/make-dom-stream.js +44 -32
- package/dist/iterators/make-stream/make-node-stream.d.ts +8 -3
- package/dist/iterators/make-stream/make-node-stream.d.ts.map +1 -1
- package/dist/iterators/make-stream/make-node-stream.js +75 -67
- package/dist/javascript-utils/is-type.d.ts +1 -1
- package/dist/javascript-utils/is-type.d.ts.map +1 -1
- package/dist/javascript-utils/is-type.js +41 -21
- package/dist/lib/api/encode-table.d.ts +6 -0
- package/dist/lib/api/encode-table.d.ts.map +1 -0
- package/dist/lib/api/encode-table.js +54 -0
- package/dist/lib/api/encode.d.ts +5 -5
- package/dist/lib/api/encode.d.ts.map +1 -1
- package/dist/lib/api/encode.js +111 -81
- package/dist/lib/api/load-in-batches.d.ts +1 -1
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.js +30 -27
- package/dist/lib/api/load.d.ts +4 -1
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +42 -24
- package/dist/lib/api/loader-options.d.ts +3 -0
- package/dist/lib/api/loader-options.d.ts.map +1 -0
- package/dist/lib/api/loader-options.js +7 -0
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +110 -92
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +56 -54
- package/dist/lib/api/parse.d.ts +4 -8
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +81 -61
- package/dist/lib/api/register-loaders.d.ts +1 -1
- package/dist/lib/api/register-loaders.d.ts.map +1 -1
- package/dist/lib/api/register-loaders.js +29 -23
- package/dist/lib/api/save.js +13 -9
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +219 -194
- package/dist/lib/common.js +2 -2
- package/dist/lib/fetch/fetch-error-message.js +21 -17
- package/dist/lib/fetch/fetch-file.js +25 -15
- package/dist/lib/fetch/read-array-buffer.js +39 -27
- package/dist/lib/fetch/read-file.js +28 -16
- package/dist/lib/fetch/write-file.js +20 -23
- package/dist/lib/filesystems/browser-filesystem.d.ts +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts.map +1 -1
- package/dist/lib/filesystems/browser-filesystem.js +118 -107
- package/dist/lib/filesystems/filesystem.d.ts +2 -2
- package/dist/lib/filesystems/filesystem.d.ts.map +1 -1
- package/dist/lib/filesystems/filesystem.js +2 -2
- package/dist/lib/filesystems/read-array-buffer.js +28 -8
- package/dist/lib/init.d.ts.map +1 -1
- package/dist/lib/init.js +16 -6
- package/dist/lib/loader-utils/check-errors.js +26 -22
- package/dist/lib/loader-utils/get-data.js +122 -122
- package/dist/lib/loader-utils/get-fetch-function.d.ts +9 -0
- package/dist/lib/loader-utils/get-fetch-function.d.ts.map +1 -0
- package/dist/lib/loader-utils/get-fetch-function.js +31 -0
- package/dist/lib/loader-utils/loader-context.d.ts +1 -1
- package/dist/lib/loader-utils/loader-context.d.ts.map +1 -1
- package/dist/lib/loader-utils/loader-context.js +57 -34
- package/dist/lib/loader-utils/loggers.d.ts +2 -1
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +39 -46
- package/dist/lib/loader-utils/normalize-loader.js +50 -41
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +41 -35
- package/dist/lib/loader-utils/option-utils.d.ts +11 -13
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +140 -120
- package/dist/lib/progress/fetch-progress.js +54 -56
- package/dist/lib/utils/log.d.ts +3 -0
- package/dist/lib/utils/log.d.ts.map +1 -0
- package/dist/lib/utils/log.js +6 -0
- package/dist/lib/utils/mime-type-utils.js +38 -17
- package/dist/lib/utils/resource-utils.d.ts +17 -8
- package/dist/lib/utils/resource-utils.d.ts.map +1 -1
- package/dist/lib/utils/resource-utils.js +86 -56
- package/dist/lib/utils/response-utils.d.ts.map +1 -1
- package/dist/lib/utils/response-utils.js +105 -105
- package/dist/lib/utils/url-utils.d.ts +3 -0
- package/dist/lib/utils/url-utils.d.ts.map +1 -0
- package/dist/lib/utils/url-utils.js +14 -0
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +53 -31
- package/dist/null-worker-node.js +234 -0
- package/dist/null-worker.js +61 -21
- package/dist/workers/null-worker.js +5 -4
- package/package.json +11 -10
- package/src/index.ts +19 -1
- package/src/iterators/make-stream/make-dom-stream.ts +1 -1
- package/src/iterators/make-stream/make-node-stream.ts +8 -2
- package/src/lib/api/encode-table.ts +71 -0
- package/src/lib/api/encode.ts +15 -5
- package/src/lib/api/load-in-batches.ts +1 -1
- package/src/lib/api/load.ts +39 -8
- package/src/lib/api/loader-options.ts +2 -0
- package/src/lib/api/parse-in-batches.ts +8 -9
- package/src/lib/api/parse-sync.ts +8 -4
- package/src/lib/api/parse.ts +42 -5
- package/src/lib/api/register-loaders.ts +1 -1
- package/src/lib/api/select-loader.ts +23 -4
- package/src/lib/init.ts +10 -3
- package/src/lib/loader-utils/get-fetch-function.ts +38 -0
- package/src/lib/loader-utils/loader-context.ts +20 -9
- package/src/lib/loader-utils/loggers.ts +1 -1
- package/src/lib/loader-utils/option-defaults.ts +3 -1
- package/src/lib/loader-utils/option-utils.ts +22 -46
- package/src/lib/progress/fetch-progress.ts +2 -2
- package/src/lib/utils/log.ts +4 -0
- package/src/lib/utils/resource-utils.ts +54 -34
- package/src/lib/utils/response-utils.ts +5 -4
- package/src/lib/utils/url-utils.ts +12 -0
- package/src/null-loader.ts +17 -5
- package/dist/bundle.js.map +0 -1
- package/dist/core-addons/write-file-browser.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/iterators/batch-iterators/timed-batch-iterator.js.map +0 -1
- package/dist/iterators/make-iterator/make-array-buffer-iterator.js.map +0 -1
- package/dist/iterators/make-iterator/make-blob-iterator.js.map +0 -1
- package/dist/iterators/make-iterator/make-iterator.js.map +0 -1
- package/dist/iterators/make-iterator/make-stream-iterator.js.map +0 -1
- package/dist/iterators/make-iterator/make-string-iterator.js.map +0 -1
- package/dist/iterators/make-stream/make-dom-stream.js.map +0 -1
- package/dist/iterators/make-stream/make-node-stream.js.map +0 -1
- package/dist/javascript-utils/is-type.js.map +0 -1
- package/dist/lib/api/encode.js.map +0 -1
- package/dist/lib/api/load-in-batches.js.map +0 -1
- package/dist/lib/api/load.js.map +0 -1
- package/dist/lib/api/parse-in-batches.js.map +0 -1
- package/dist/lib/api/parse-sync.js.map +0 -1
- package/dist/lib/api/parse.js.map +0 -1
- package/dist/lib/api/register-loaders.js.map +0 -1
- package/dist/lib/api/save.js.map +0 -1
- package/dist/lib/api/select-loader.js.map +0 -1
- package/dist/lib/api/set-loader-options.d.ts +0 -6
- package/dist/lib/api/set-loader-options.d.ts.map +0 -1
- package/dist/lib/api/set-loader-options.js +0 -5
- package/dist/lib/api/set-loader-options.js.map +0 -1
- package/dist/lib/common.js.map +0 -1
- package/dist/lib/fetch/fetch-error-message.js.map +0 -1
- package/dist/lib/fetch/fetch-file.js.map +0 -1
- package/dist/lib/fetch/read-array-buffer.js.map +0 -1
- package/dist/lib/fetch/read-file.js.map +0 -1
- package/dist/lib/fetch/write-file.js.map +0 -1
- package/dist/lib/filesystems/browser-filesystem.js.map +0 -1
- package/dist/lib/filesystems/filesystem.js.map +0 -1
- package/dist/lib/filesystems/read-array-buffer.js.map +0 -1
- package/dist/lib/init.js.map +0 -1
- package/dist/lib/loader-utils/check-errors.js.map +0 -1
- package/dist/lib/loader-utils/get-data.js.map +0 -1
- package/dist/lib/loader-utils/loader-context.js.map +0 -1
- package/dist/lib/loader-utils/loggers.js.map +0 -1
- package/dist/lib/loader-utils/normalize-loader.js.map +0 -1
- package/dist/lib/loader-utils/option-defaults.js.map +0 -1
- package/dist/lib/loader-utils/option-utils.js.map +0 -1
- package/dist/lib/progress/fetch-progress.js.map +0 -1
- package/dist/lib/utils/mime-type-utils.js.map +0 -1
- package/dist/lib/utils/resource-utils.js.map +0 -1
- package/dist/lib/utils/response-utils.js.map +0 -1
- package/dist/null-loader.js.map +0 -1
- package/dist/workers/null-worker.js.map +0 -1
- package/src/lib/api/set-loader-options.ts +0 -9
- /package/dist/{core-addons → es5/core-addons}/README.md +0 -0
package/dist/dist.min.js
CHANGED
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
for (var name in all)
|
|
18
18
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
19
|
};
|
|
20
|
-
var __reExport = (target,
|
|
21
|
-
if (
|
|
22
|
-
for (let key of __getOwnPropNames(
|
|
20
|
+
var __reExport = (target, module, desc) => {
|
|
21
|
+
if (module && typeof module === "object" || typeof module === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(module))
|
|
23
23
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
24
|
-
__defProp(target, key, { get: () =>
|
|
24
|
+
__defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
|
|
25
25
|
}
|
|
26
26
|
return target;
|
|
27
27
|
};
|
|
28
|
-
var __toModule = (
|
|
29
|
-
return __reExport(__markAsModule(__defProp(
|
|
28
|
+
var __toModule = (module) => {
|
|
29
|
+
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
// ../loader-utils/src/lib/env-utils/assert.ts
|
|
@@ -112,15 +112,15 @@
|
|
|
112
112
|
init_assert2();
|
|
113
113
|
WorkerJob = class {
|
|
114
114
|
constructor(jobName, workerThread) {
|
|
115
|
-
this.name = jobName;
|
|
116
|
-
this.workerThread = workerThread;
|
|
117
115
|
this.isRunning = true;
|
|
118
116
|
this._resolve = () => {
|
|
119
117
|
};
|
|
120
118
|
this._reject = () => {
|
|
121
119
|
};
|
|
122
|
-
this.
|
|
123
|
-
|
|
120
|
+
this.name = jobName;
|
|
121
|
+
this.workerThread = workerThread;
|
|
122
|
+
this.result = new Promise((resolve2, reject) => {
|
|
123
|
+
this._resolve = resolve2;
|
|
124
124
|
this._reject = reject;
|
|
125
125
|
});
|
|
126
126
|
}
|
|
@@ -145,6 +145,17 @@
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
|
|
148
|
+
// ../worker-utils/src/lib/node/worker_threads-browser.ts
|
|
149
|
+
var Worker2;
|
|
150
|
+
var init_worker_threads_browser = __esm({
|
|
151
|
+
"../worker-utils/src/lib/node/worker_threads-browser.ts"() {
|
|
152
|
+
Worker2 = class {
|
|
153
|
+
terminate() {
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
148
159
|
// ../worker-utils/src/lib/worker-utils/get-loadable-worker-url.ts
|
|
149
160
|
function getLoadableWorkerURL(props) {
|
|
150
161
|
assert2(props.source && !props.url || !props.source && props.url);
|
|
@@ -223,6 +234,22 @@
|
|
|
223
234
|
}
|
|
224
235
|
return false;
|
|
225
236
|
}
|
|
237
|
+
function getTransferListForWriter(object) {
|
|
238
|
+
if (object === null) {
|
|
239
|
+
return {};
|
|
240
|
+
}
|
|
241
|
+
const clone = Object.assign({}, object);
|
|
242
|
+
Object.keys(clone).forEach((key) => {
|
|
243
|
+
if (typeof object[key] === "object" && !ArrayBuffer.isView(object[key]) && !(object[key] instanceof Array)) {
|
|
244
|
+
clone[key] = getTransferListForWriter(object[key]);
|
|
245
|
+
} else if (typeof clone[key] === "function" || clone[key] instanceof RegExp) {
|
|
246
|
+
clone[key] = {};
|
|
247
|
+
} else {
|
|
248
|
+
clone[key] = object[key];
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
return clone;
|
|
252
|
+
}
|
|
226
253
|
var init_get_transfer_list = __esm({
|
|
227
254
|
"../worker-utils/src/lib/worker-utils/get-transfer-list.ts"() {
|
|
228
255
|
}
|
|
@@ -232,6 +259,8 @@
|
|
|
232
259
|
var NOOP, WorkerThread;
|
|
233
260
|
var init_worker_thread = __esm({
|
|
234
261
|
"../worker-utils/src/lib/worker-farm/worker-thread.ts"() {
|
|
262
|
+
init_worker_threads_browser();
|
|
263
|
+
init_globals2();
|
|
235
264
|
init_assert2();
|
|
236
265
|
init_get_loadable_worker_url();
|
|
237
266
|
init_get_transfer_list();
|
|
@@ -248,10 +277,10 @@
|
|
|
248
277
|
this.url = url;
|
|
249
278
|
this.onMessage = NOOP;
|
|
250
279
|
this.onError = (error) => console.log(error);
|
|
251
|
-
this.worker = this._createBrowserWorker();
|
|
280
|
+
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
252
281
|
}
|
|
253
282
|
static isSupported() {
|
|
254
|
-
return typeof Worker !== "undefined";
|
|
283
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
|
|
255
284
|
}
|
|
256
285
|
destroy() {
|
|
257
286
|
this.onMessage = NOOP;
|
|
@@ -294,6 +323,27 @@
|
|
|
294
323
|
worker.onmessageerror = (event) => console.error(event);
|
|
295
324
|
return worker;
|
|
296
325
|
}
|
|
326
|
+
_createNodeWorker() {
|
|
327
|
+
let worker;
|
|
328
|
+
if (this.url) {
|
|
329
|
+
const absolute = this.url.includes(":/") || this.url.startsWith("/");
|
|
330
|
+
const url = absolute ? this.url : `./${this.url}`;
|
|
331
|
+
worker = new Worker2(url, { eval: false });
|
|
332
|
+
} else if (this.source) {
|
|
333
|
+
worker = new Worker2(this.source, { eval: true });
|
|
334
|
+
} else {
|
|
335
|
+
throw new Error("no worker");
|
|
336
|
+
}
|
|
337
|
+
worker.on("message", (data) => {
|
|
338
|
+
this.onMessage(data);
|
|
339
|
+
});
|
|
340
|
+
worker.on("error", (error) => {
|
|
341
|
+
this.onError(error);
|
|
342
|
+
});
|
|
343
|
+
worker.on("exit", (code) => {
|
|
344
|
+
});
|
|
345
|
+
return worker;
|
|
346
|
+
}
|
|
297
347
|
};
|
|
298
348
|
}
|
|
299
349
|
});
|
|
@@ -322,6 +372,9 @@
|
|
|
322
372
|
this.url = props.url;
|
|
323
373
|
this.setProps(props);
|
|
324
374
|
}
|
|
375
|
+
static isSupported() {
|
|
376
|
+
return WorkerThread.isSupported();
|
|
377
|
+
}
|
|
325
378
|
destroy() {
|
|
326
379
|
this.idleQueue.forEach((worker) => worker.destroy());
|
|
327
380
|
this.isDestroyed = true;
|
|
@@ -344,9 +397,9 @@
|
|
|
344
397
|
this.onDebug = props.onDebug;
|
|
345
398
|
}
|
|
346
399
|
}
|
|
347
|
-
async startJob(name,
|
|
400
|
+
async startJob(name, onMessage3 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
|
|
348
401
|
const startPromise = new Promise((onStart) => {
|
|
349
|
-
this.jobQueue.push({ name, onMessage:
|
|
402
|
+
this.jobQueue.push({ name, onMessage: onMessage3, onError, onStart });
|
|
350
403
|
return this;
|
|
351
404
|
});
|
|
352
405
|
this._startQueuedJob();
|
|
@@ -380,7 +433,7 @@
|
|
|
380
433
|
}
|
|
381
434
|
}
|
|
382
435
|
returnWorkerToQueue(worker) {
|
|
383
|
-
const shouldDestroyWorker = this.isDestroyed || !this.reuseWorkers || this.count > this._getMaxConcurrency();
|
|
436
|
+
const shouldDestroyWorker = !isBrowser2 || this.isDestroyed || !this.reuseWorkers || this.count > this._getMaxConcurrency();
|
|
384
437
|
if (shouldDestroyWorker) {
|
|
385
438
|
worker.destroy();
|
|
386
439
|
this.count--;
|
|
@@ -418,9 +471,9 @@
|
|
|
418
471
|
DEFAULT_PROPS = {
|
|
419
472
|
maxConcurrency: 3,
|
|
420
473
|
maxMobileConcurrency: 1,
|
|
474
|
+
reuseWorkers: true,
|
|
421
475
|
onDebug: () => {
|
|
422
|
-
}
|
|
423
|
-
reuseWorkers: true
|
|
476
|
+
}
|
|
424
477
|
};
|
|
425
478
|
WorkerFarm = class {
|
|
426
479
|
constructor(props) {
|
|
@@ -441,6 +494,7 @@
|
|
|
441
494
|
for (const workerPool of this.workerPools.values()) {
|
|
442
495
|
workerPool.destroy();
|
|
443
496
|
}
|
|
497
|
+
this.workerPools = new Map();
|
|
444
498
|
}
|
|
445
499
|
setProps(props) {
|
|
446
500
|
this.props = { ...this.props, ...props };
|
|
@@ -475,9 +529,13 @@
|
|
|
475
529
|
});
|
|
476
530
|
|
|
477
531
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
532
|
+
function getWorkerName(worker) {
|
|
533
|
+
const warning = worker.version !== VERSION2 ? ` (worker-utils@${VERSION2})` : "";
|
|
534
|
+
return `${worker.name}@${worker.version}${warning}`;
|
|
535
|
+
}
|
|
478
536
|
function getWorkerURL(worker, options = {}) {
|
|
479
537
|
const workerOptions = options[worker.id] || {};
|
|
480
|
-
const workerFile = `${worker.id}-worker.js`;
|
|
538
|
+
const workerFile = isBrowser2 ? `${worker.id}-worker.js` : `${worker.id}-worker-node.js`;
|
|
481
539
|
let url = workerOptions.workerUrl;
|
|
482
540
|
if (!url && worker.id === "compression") {
|
|
483
541
|
url = options.workerUrl;
|
|
@@ -496,11 +554,65 @@
|
|
|
496
554
|
assert2(url);
|
|
497
555
|
return url;
|
|
498
556
|
}
|
|
499
|
-
var NPM_TAG;
|
|
557
|
+
var NPM_TAG, VERSION2;
|
|
500
558
|
var init_get_worker_url = __esm({
|
|
501
559
|
"../worker-utils/src/lib/worker-api/get-worker-url.ts"() {
|
|
502
560
|
init_assert2();
|
|
561
|
+
init_globals2();
|
|
562
|
+
init_version();
|
|
503
563
|
NPM_TAG = "beta";
|
|
564
|
+
VERSION2 = typeof VERSION !== "undefined" ? VERSION : NPM_TAG;
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
// ../worker-utils/src/lib/worker-api/process-on-worker.ts
|
|
569
|
+
async function processOnWorker(worker, data, options = {}, context = {}) {
|
|
570
|
+
const name = getWorkerName(worker);
|
|
571
|
+
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
572
|
+
const { source } = options;
|
|
573
|
+
const workerPoolProps = { name, source };
|
|
574
|
+
if (!source) {
|
|
575
|
+
workerPoolProps.url = getWorkerURL(worker, options);
|
|
576
|
+
}
|
|
577
|
+
const workerPool = workerFarm.getWorkerPool(workerPoolProps);
|
|
578
|
+
const jobName = options.jobName || worker.name;
|
|
579
|
+
const job = await workerPool.startJob(jobName, onMessage.bind(null, context));
|
|
580
|
+
const transferableOptions = getTransferListForWriter(options);
|
|
581
|
+
job.postMessage("process", { input: data, options: transferableOptions });
|
|
582
|
+
const result = await job.result;
|
|
583
|
+
return result.result;
|
|
584
|
+
}
|
|
585
|
+
async function onMessage(context, job, type, payload) {
|
|
586
|
+
switch (type) {
|
|
587
|
+
case "done":
|
|
588
|
+
job.done(payload);
|
|
589
|
+
break;
|
|
590
|
+
case "error":
|
|
591
|
+
job.error(new Error(payload.error));
|
|
592
|
+
break;
|
|
593
|
+
case "process":
|
|
594
|
+
const { id, input, options } = payload;
|
|
595
|
+
try {
|
|
596
|
+
if (!context.process) {
|
|
597
|
+
job.postMessage("error", { id, error: "Worker not set up to process on main thread" });
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
const result = await context.process(input, options);
|
|
601
|
+
job.postMessage("done", { id, result });
|
|
602
|
+
} catch (error) {
|
|
603
|
+
const message = error instanceof Error ? error.message : "unknown error";
|
|
604
|
+
job.postMessage("error", { id, error: message });
|
|
605
|
+
}
|
|
606
|
+
break;
|
|
607
|
+
default:
|
|
608
|
+
console.warn(`process-on-worker: unknown message ${type}`);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
var init_process_on_worker = __esm({
|
|
612
|
+
"../worker-utils/src/lib/worker-api/process-on-worker.ts"() {
|
|
613
|
+
init_worker_farm();
|
|
614
|
+
init_get_worker_url();
|
|
615
|
+
init_get_transfer_list();
|
|
504
616
|
}
|
|
505
617
|
});
|
|
506
618
|
|
|
@@ -524,7 +636,9 @@
|
|
|
524
636
|
var init_src = __esm({
|
|
525
637
|
"../worker-utils/src/index.ts"() {
|
|
526
638
|
init_assert2();
|
|
639
|
+
init_globals2();
|
|
527
640
|
init_worker_farm();
|
|
641
|
+
init_process_on_worker();
|
|
528
642
|
init_get_worker_url();
|
|
529
643
|
init_validate_worker_version();
|
|
530
644
|
}
|
|
@@ -535,6 +649,9 @@
|
|
|
535
649
|
if (!WorkerFarm.isSupported()) {
|
|
536
650
|
return false;
|
|
537
651
|
}
|
|
652
|
+
if (!isBrowser2 && !options?._nodeWorkers) {
|
|
653
|
+
return false;
|
|
654
|
+
}
|
|
538
655
|
return loader.worker && options?.worker;
|
|
539
656
|
}
|
|
540
657
|
async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
|
|
@@ -543,15 +660,17 @@
|
|
|
543
660
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
544
661
|
const workerPool = workerFarm.getWorkerPool({ name, url });
|
|
545
662
|
options = JSON.parse(JSON.stringify(options));
|
|
546
|
-
|
|
663
|
+
context = JSON.parse(JSON.stringify(context || {}));
|
|
664
|
+
const job = await workerPool.startJob("process-on-worker", onMessage2.bind(null, parseOnMainThread));
|
|
547
665
|
job.postMessage("process", {
|
|
548
666
|
input: data,
|
|
549
|
-
options
|
|
667
|
+
options,
|
|
668
|
+
context
|
|
550
669
|
});
|
|
551
670
|
const result = await job.result;
|
|
552
671
|
return await result.result;
|
|
553
672
|
}
|
|
554
|
-
async function
|
|
673
|
+
async function onMessage2(parseOnMainThread, job, type, payload) {
|
|
555
674
|
switch (type) {
|
|
556
675
|
case "done":
|
|
557
676
|
job.done(payload);
|
|
@@ -576,59 +695,28 @@
|
|
|
576
695
|
var init_parse_with_worker = __esm({
|
|
577
696
|
"../loader-utils/src/lib/worker-loader-utils/parse-with-worker.ts"() {
|
|
578
697
|
init_src();
|
|
698
|
+
init_src();
|
|
579
699
|
}
|
|
580
700
|
});
|
|
581
701
|
|
|
582
|
-
//
|
|
583
|
-
|
|
584
|
-
|
|
702
|
+
// ../loader-utils/src/lib/worker-loader-utils/encode-with-worker.ts
|
|
703
|
+
function canEncodeWithWorker(writer, options) {
|
|
704
|
+
if (!WorkerFarm.isSupported()) {
|
|
705
|
+
return false;
|
|
585
706
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
// ../loader-utils/src/lib/binary-utils/buffer-utils.ts
|
|
589
|
-
function isBuffer(value) {
|
|
590
|
-
return value && typeof value === "object" && value.isBuffer;
|
|
591
|
-
}
|
|
592
|
-
function toBuffer2(data) {
|
|
593
|
-
return node.toBuffer ? node.toBuffer(data) : data;
|
|
594
|
-
}
|
|
595
|
-
function bufferToArrayBuffer(buffer) {
|
|
596
|
-
if (isBuffer(buffer)) {
|
|
597
|
-
const typedArray = new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.length);
|
|
598
|
-
return typedArray.slice().buffer;
|
|
707
|
+
if (!isBrowser && !options?._nodeWorkers) {
|
|
708
|
+
return false;
|
|
599
709
|
}
|
|
600
|
-
return
|
|
710
|
+
return writer.worker && options?.worker;
|
|
601
711
|
}
|
|
602
|
-
var
|
|
603
|
-
"../loader-utils/src/lib/
|
|
604
|
-
|
|
712
|
+
var init_encode_with_worker = __esm({
|
|
713
|
+
"../loader-utils/src/lib/worker-loader-utils/encode-with-worker.ts"() {
|
|
714
|
+
init_src();
|
|
715
|
+
init_globals();
|
|
605
716
|
}
|
|
606
717
|
});
|
|
607
718
|
|
|
608
719
|
// ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
|
|
609
|
-
function toArrayBuffer(data) {
|
|
610
|
-
if (isBuffer(data)) {
|
|
611
|
-
return bufferToArrayBuffer(data);
|
|
612
|
-
}
|
|
613
|
-
if (data instanceof ArrayBuffer) {
|
|
614
|
-
return data;
|
|
615
|
-
}
|
|
616
|
-
if (ArrayBuffer.isView(data)) {
|
|
617
|
-
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
618
|
-
return data.buffer;
|
|
619
|
-
}
|
|
620
|
-
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
621
|
-
}
|
|
622
|
-
if (typeof data === "string") {
|
|
623
|
-
const text = data;
|
|
624
|
-
const uint8Array = new TextEncoder().encode(text);
|
|
625
|
-
return uint8Array.buffer;
|
|
626
|
-
}
|
|
627
|
-
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
628
|
-
return data._toArrayBuffer();
|
|
629
|
-
}
|
|
630
|
-
throw new Error("toArrayBuffer");
|
|
631
|
-
}
|
|
632
720
|
function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {
|
|
633
721
|
byteLength = byteLength || arrayBuffer1.byteLength;
|
|
634
722
|
if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {
|
|
@@ -656,7 +744,6 @@
|
|
|
656
744
|
}
|
|
657
745
|
var init_array_buffer_utils = __esm({
|
|
658
746
|
"../loader-utils/src/lib/binary-utils/array-buffer-utils.ts"() {
|
|
659
|
-
init_buffer_utils();
|
|
660
747
|
}
|
|
661
748
|
});
|
|
662
749
|
|
|
@@ -727,8 +814,54 @@
|
|
|
727
814
|
}
|
|
728
815
|
});
|
|
729
816
|
|
|
817
|
+
// ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
818
|
+
function _typeof(obj) {
|
|
819
|
+
"@babel/helpers - typeof";
|
|
820
|
+
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
821
|
+
return typeof obj2;
|
|
822
|
+
} : function(obj2) {
|
|
823
|
+
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
824
|
+
}, _typeof(obj);
|
|
825
|
+
}
|
|
826
|
+
var init_typeof = __esm({
|
|
827
|
+
"../../node_modules/@babel/runtime/helpers/esm/typeof.js"() {
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
|
|
831
|
+
// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
832
|
+
function _toPrimitive(input, hint) {
|
|
833
|
+
if (_typeof(input) !== "object" || input === null)
|
|
834
|
+
return input;
|
|
835
|
+
var prim = input[Symbol.toPrimitive];
|
|
836
|
+
if (prim !== void 0) {
|
|
837
|
+
var res = prim.call(input, hint || "default");
|
|
838
|
+
if (_typeof(res) !== "object")
|
|
839
|
+
return res;
|
|
840
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
841
|
+
}
|
|
842
|
+
return (hint === "string" ? String : Number)(input);
|
|
843
|
+
}
|
|
844
|
+
var init_toPrimitive = __esm({
|
|
845
|
+
"../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"() {
|
|
846
|
+
init_typeof();
|
|
847
|
+
}
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
851
|
+
function _toPropertyKey(arg) {
|
|
852
|
+
var key = _toPrimitive(arg, "string");
|
|
853
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
854
|
+
}
|
|
855
|
+
var init_toPropertyKey = __esm({
|
|
856
|
+
"../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"() {
|
|
857
|
+
init_typeof();
|
|
858
|
+
init_toPrimitive();
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
|
|
730
862
|
// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
731
863
|
function _defineProperty(obj, key, value) {
|
|
864
|
+
key = _toPropertyKey(key);
|
|
732
865
|
if (key in obj) {
|
|
733
866
|
Object.defineProperty(obj, key, {
|
|
734
867
|
value,
|
|
@@ -743,10 +876,11 @@
|
|
|
743
876
|
}
|
|
744
877
|
var init_defineProperty = __esm({
|
|
745
878
|
"../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"() {
|
|
879
|
+
init_toPropertyKey();
|
|
746
880
|
}
|
|
747
881
|
});
|
|
748
882
|
|
|
749
|
-
//
|
|
883
|
+
// ../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
|
|
750
884
|
function getHiResTimestamp() {
|
|
751
885
|
let timestamp;
|
|
752
886
|
if (typeof window !== "undefined" && window.performance) {
|
|
@@ -760,14 +894,14 @@
|
|
|
760
894
|
return timestamp;
|
|
761
895
|
}
|
|
762
896
|
var init_hi_res_timestamp = __esm({
|
|
763
|
-
"
|
|
897
|
+
"../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
|
|
764
898
|
}
|
|
765
899
|
});
|
|
766
900
|
|
|
767
|
-
//
|
|
901
|
+
// ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js
|
|
768
902
|
var Stat;
|
|
769
903
|
var init_stat = __esm({
|
|
770
|
-
"
|
|
904
|
+
"../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js"() {
|
|
771
905
|
init_defineProperty();
|
|
772
906
|
init_hi_res_timestamp();
|
|
773
907
|
Stat = class {
|
|
@@ -775,12 +909,12 @@
|
|
|
775
909
|
_defineProperty(this, "name", void 0);
|
|
776
910
|
_defineProperty(this, "type", void 0);
|
|
777
911
|
_defineProperty(this, "sampleSize", 1);
|
|
778
|
-
_defineProperty(this, "time",
|
|
779
|
-
_defineProperty(this, "count",
|
|
780
|
-
_defineProperty(this, "samples",
|
|
781
|
-
_defineProperty(this, "lastTiming",
|
|
782
|
-
_defineProperty(this, "lastSampleTime",
|
|
783
|
-
_defineProperty(this, "lastSampleCount",
|
|
912
|
+
_defineProperty(this, "time", 0);
|
|
913
|
+
_defineProperty(this, "count", 0);
|
|
914
|
+
_defineProperty(this, "samples", 0);
|
|
915
|
+
_defineProperty(this, "lastTiming", 0);
|
|
916
|
+
_defineProperty(this, "lastSampleTime", 0);
|
|
917
|
+
_defineProperty(this, "lastSampleCount", 0);
|
|
784
918
|
_defineProperty(this, "_count", 0);
|
|
785
919
|
_defineProperty(this, "_time", 0);
|
|
786
920
|
_defineProperty(this, "_samples", 0);
|
|
@@ -790,6 +924,20 @@
|
|
|
790
924
|
this.type = type;
|
|
791
925
|
this.reset();
|
|
792
926
|
}
|
|
927
|
+
reset() {
|
|
928
|
+
this.time = 0;
|
|
929
|
+
this.count = 0;
|
|
930
|
+
this.samples = 0;
|
|
931
|
+
this.lastTiming = 0;
|
|
932
|
+
this.lastSampleTime = 0;
|
|
933
|
+
this.lastSampleCount = 0;
|
|
934
|
+
this._count = 0;
|
|
935
|
+
this._time = 0;
|
|
936
|
+
this._samples = 0;
|
|
937
|
+
this._startTime = 0;
|
|
938
|
+
this._timerPending = false;
|
|
939
|
+
return this;
|
|
940
|
+
}
|
|
793
941
|
setSampleSize(samples) {
|
|
794
942
|
this.sampleSize = samples;
|
|
795
943
|
return this;
|
|
@@ -853,20 +1001,6 @@
|
|
|
853
1001
|
getHz() {
|
|
854
1002
|
return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
|
|
855
1003
|
}
|
|
856
|
-
reset() {
|
|
857
|
-
this.time = 0;
|
|
858
|
-
this.count = 0;
|
|
859
|
-
this.samples = 0;
|
|
860
|
-
this.lastTiming = 0;
|
|
861
|
-
this.lastSampleTime = 0;
|
|
862
|
-
this.lastSampleCount = 0;
|
|
863
|
-
this._count = 0;
|
|
864
|
-
this._time = 0;
|
|
865
|
-
this._samples = 0;
|
|
866
|
-
this._startTime = 0;
|
|
867
|
-
this._timerPending = false;
|
|
868
|
-
return this;
|
|
869
|
-
}
|
|
870
1004
|
_checkSampling() {
|
|
871
1005
|
if (this._samples === this.sampleSize) {
|
|
872
1006
|
this.lastSampleTime = this._time;
|
|
@@ -883,10 +1017,10 @@
|
|
|
883
1017
|
}
|
|
884
1018
|
});
|
|
885
1019
|
|
|
886
|
-
//
|
|
1020
|
+
// ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js
|
|
887
1021
|
var Stats;
|
|
888
1022
|
var init_stats = __esm({
|
|
889
|
-
"
|
|
1023
|
+
"../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js"() {
|
|
890
1024
|
init_defineProperty();
|
|
891
1025
|
init_stat();
|
|
892
1026
|
Stats = class {
|
|
@@ -909,56 +1043,55 @@
|
|
|
909
1043
|
return Object.keys(this.stats).length;
|
|
910
1044
|
}
|
|
911
1045
|
reset() {
|
|
912
|
-
for (const
|
|
913
|
-
|
|
1046
|
+
for (const stat2 of Object.values(this.stats)) {
|
|
1047
|
+
stat2.reset();
|
|
914
1048
|
}
|
|
915
1049
|
return this;
|
|
916
1050
|
}
|
|
917
1051
|
forEach(fn) {
|
|
918
|
-
for (const
|
|
919
|
-
fn(
|
|
1052
|
+
for (const stat2 of Object.values(this.stats)) {
|
|
1053
|
+
fn(stat2);
|
|
920
1054
|
}
|
|
921
1055
|
}
|
|
922
1056
|
getTable() {
|
|
923
1057
|
const table = {};
|
|
924
|
-
this.forEach((
|
|
925
|
-
table[
|
|
926
|
-
time:
|
|
927
|
-
count:
|
|
928
|
-
average:
|
|
929
|
-
hz:
|
|
1058
|
+
this.forEach((stat2) => {
|
|
1059
|
+
table[stat2.name] = {
|
|
1060
|
+
time: stat2.time || 0,
|
|
1061
|
+
count: stat2.count || 0,
|
|
1062
|
+
average: stat2.getAverageTime() || 0,
|
|
1063
|
+
hz: stat2.getHz() || 0
|
|
930
1064
|
};
|
|
931
1065
|
});
|
|
932
1066
|
return table;
|
|
933
1067
|
}
|
|
934
1068
|
_initializeStats() {
|
|
935
1069
|
let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
936
|
-
stats.forEach((
|
|
1070
|
+
stats.forEach((stat2) => this._getOrCreate(stat2));
|
|
937
1071
|
}
|
|
938
|
-
_getOrCreate(
|
|
939
|
-
if (!stat || !stat.name) {
|
|
940
|
-
return null;
|
|
941
|
-
}
|
|
1072
|
+
_getOrCreate(stat2) {
|
|
942
1073
|
const {
|
|
943
1074
|
name,
|
|
944
1075
|
type
|
|
945
|
-
} =
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1076
|
+
} = stat2;
|
|
1077
|
+
let result = this.stats[name];
|
|
1078
|
+
if (!result) {
|
|
1079
|
+
if (stat2 instanceof Stat) {
|
|
1080
|
+
result = stat2;
|
|
949
1081
|
} else {
|
|
950
|
-
|
|
1082
|
+
result = new Stat(name, type);
|
|
951
1083
|
}
|
|
1084
|
+
this.stats[name] = result;
|
|
952
1085
|
}
|
|
953
|
-
return
|
|
1086
|
+
return result;
|
|
954
1087
|
}
|
|
955
1088
|
};
|
|
956
1089
|
}
|
|
957
1090
|
});
|
|
958
1091
|
|
|
959
|
-
//
|
|
960
|
-
var
|
|
961
|
-
"
|
|
1092
|
+
// ../loader-utils/node_modules/@probe.gl/stats/dist/index.js
|
|
1093
|
+
var init_dist = __esm({
|
|
1094
|
+
"../loader-utils/node_modules/@probe.gl/stats/dist/index.js"() {
|
|
962
1095
|
init_stats();
|
|
963
1096
|
init_stat();
|
|
964
1097
|
init_hi_res_timestamp();
|
|
@@ -969,7 +1102,7 @@
|
|
|
969
1102
|
var STAT_QUEUED_REQUESTS, STAT_ACTIVE_REQUESTS, STAT_CANCELLED_REQUESTS, STAT_QUEUED_REQUESTS_EVER, STAT_ACTIVE_REQUESTS_EVER, DEFAULT_PROPS2, RequestScheduler;
|
|
970
1103
|
var init_request_scheduler = __esm({
|
|
971
1104
|
"../loader-utils/src/lib/request-utils/request-scheduler.ts"() {
|
|
972
|
-
|
|
1105
|
+
init_dist();
|
|
973
1106
|
STAT_QUEUED_REQUESTS = "Queued Requests";
|
|
974
1107
|
STAT_ACTIVE_REQUESTS = "Active Requests";
|
|
975
1108
|
STAT_CANCELLED_REQUESTS = "Cancelled Requests";
|
|
@@ -1003,8 +1136,8 @@
|
|
|
1003
1136
|
return this.requestMap.get(handle);
|
|
1004
1137
|
}
|
|
1005
1138
|
const request = { handle, priority: 0, getPriority };
|
|
1006
|
-
const promise = new Promise((
|
|
1007
|
-
request.resolve =
|
|
1139
|
+
const promise = new Promise((resolve2) => {
|
|
1140
|
+
request.resolve = resolve2;
|
|
1008
1141
|
return request;
|
|
1009
1142
|
});
|
|
1010
1143
|
this.requestQueue.push(request);
|
|
@@ -1013,7 +1146,7 @@
|
|
|
1013
1146
|
return promise;
|
|
1014
1147
|
}
|
|
1015
1148
|
_issueRequest(request) {
|
|
1016
|
-
const { handle, resolve } = request;
|
|
1149
|
+
const { handle, resolve: resolve2 } = request;
|
|
1017
1150
|
let isDone = false;
|
|
1018
1151
|
const done = () => {
|
|
1019
1152
|
if (!isDone) {
|
|
@@ -1024,7 +1157,7 @@
|
|
|
1024
1157
|
}
|
|
1025
1158
|
};
|
|
1026
1159
|
this.activeRequestCount++;
|
|
1027
|
-
return
|
|
1160
|
+
return resolve2 ? resolve2({ done }) : Promise.resolve({ done });
|
|
1028
1161
|
}
|
|
1029
1162
|
_issueNewRequests() {
|
|
1030
1163
|
if (!this.deferredUpdate) {
|
|
@@ -1100,15 +1233,15 @@
|
|
|
1100
1233
|
function parseTextSync(text) {
|
|
1101
1234
|
return JSON.parse(text);
|
|
1102
1235
|
}
|
|
1103
|
-
var
|
|
1236
|
+
var VERSION3, JSONLoader;
|
|
1104
1237
|
var init_json_loader = __esm({
|
|
1105
1238
|
"../loader-utils/src/json-loader.ts"() {
|
|
1106
|
-
|
|
1239
|
+
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
1107
1240
|
JSONLoader = {
|
|
1108
1241
|
name: "JSON",
|
|
1109
1242
|
id: "json",
|
|
1110
1243
|
module: "json",
|
|
1111
|
-
version:
|
|
1244
|
+
version: VERSION3,
|
|
1112
1245
|
extensions: ["json", "geojson"],
|
|
1113
1246
|
mimeTypes: ["application/json"],
|
|
1114
1247
|
category: "json",
|
|
@@ -1120,19 +1253,93 @@
|
|
|
1120
1253
|
}
|
|
1121
1254
|
});
|
|
1122
1255
|
|
|
1256
|
+
// ../loader-utils/src/lib/node/buffer.browser.ts
|
|
1257
|
+
function toArrayBuffer(buffer) {
|
|
1258
|
+
return buffer;
|
|
1259
|
+
}
|
|
1260
|
+
function toBuffer(binaryData) {
|
|
1261
|
+
throw new Error("Buffer not supported in browser");
|
|
1262
|
+
}
|
|
1263
|
+
var init_buffer_browser = __esm({
|
|
1264
|
+
"../loader-utils/src/lib/node/buffer.browser.ts"() {
|
|
1265
|
+
}
|
|
1266
|
+
});
|
|
1267
|
+
|
|
1268
|
+
// ../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts
|
|
1269
|
+
function isBuffer(value) {
|
|
1270
|
+
return value && typeof value === "object" && value.isBuffer;
|
|
1271
|
+
}
|
|
1272
|
+
function toBuffer2(data) {
|
|
1273
|
+
return toBuffer ? toBuffer(data) : data;
|
|
1274
|
+
}
|
|
1275
|
+
function toArrayBuffer2(data) {
|
|
1276
|
+
if (isBuffer(data)) {
|
|
1277
|
+
return toArrayBuffer(data);
|
|
1278
|
+
}
|
|
1279
|
+
if (data instanceof ArrayBuffer) {
|
|
1280
|
+
return data;
|
|
1281
|
+
}
|
|
1282
|
+
if (ArrayBuffer.isView(data)) {
|
|
1283
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
1284
|
+
return data.buffer;
|
|
1285
|
+
}
|
|
1286
|
+
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
1287
|
+
}
|
|
1288
|
+
if (typeof data === "string") {
|
|
1289
|
+
const text = data;
|
|
1290
|
+
const uint8Array = new TextEncoder().encode(text);
|
|
1291
|
+
return uint8Array.buffer;
|
|
1292
|
+
}
|
|
1293
|
+
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
1294
|
+
return data._toArrayBuffer();
|
|
1295
|
+
}
|
|
1296
|
+
throw new Error("toArrayBuffer");
|
|
1297
|
+
}
|
|
1298
|
+
var init_memory_conversion_utils = __esm({
|
|
1299
|
+
"../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts"() {
|
|
1300
|
+
init_buffer_browser();
|
|
1301
|
+
}
|
|
1302
|
+
});
|
|
1303
|
+
|
|
1304
|
+
// ../loader-utils/src/lib/node/promisify.ts
|
|
1305
|
+
function promisify2(fn) {
|
|
1306
|
+
return (arg1, arg2) => new Promise((resolve2, reject) => fn(arg1, arg2, (error, callbackArgs) => error ? reject(error) : resolve2(callbackArgs)));
|
|
1307
|
+
}
|
|
1308
|
+
function promisify3(fn) {
|
|
1309
|
+
return (arg1, arg2, arg3) => new Promise((resolve2, reject) => fn(arg1, arg2, arg3, (error, callbackArgs) => error ? reject(error) : resolve2(callbackArgs)));
|
|
1310
|
+
}
|
|
1311
|
+
var init_promisify = __esm({
|
|
1312
|
+
"../loader-utils/src/lib/node/promisify.ts"() {
|
|
1313
|
+
}
|
|
1314
|
+
});
|
|
1315
|
+
|
|
1316
|
+
// ../loader-utils/src/lib/path-utils/get-cwd.ts
|
|
1317
|
+
function getCWD() {
|
|
1318
|
+
if (typeof process !== "undefined" && typeof process.cwd !== "undefined") {
|
|
1319
|
+
return process.cwd();
|
|
1320
|
+
}
|
|
1321
|
+
const pathname = window.location?.pathname;
|
|
1322
|
+
return pathname?.slice(0, pathname.lastIndexOf("/") + 1) || "";
|
|
1323
|
+
}
|
|
1324
|
+
var init_get_cwd = __esm({
|
|
1325
|
+
"../loader-utils/src/lib/path-utils/get-cwd.ts"() {
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1328
|
+
|
|
1123
1329
|
// ../loader-utils/src/lib/path-utils/path.ts
|
|
1124
1330
|
var path_exports = {};
|
|
1125
1331
|
__export(path_exports, {
|
|
1126
1332
|
dirname: () => dirname,
|
|
1127
1333
|
filename: () => filename,
|
|
1128
|
-
join: () => join
|
|
1334
|
+
join: () => join,
|
|
1335
|
+
resolve: () => resolve
|
|
1129
1336
|
});
|
|
1130
1337
|
function filename(url) {
|
|
1131
|
-
const slashIndex = url
|
|
1338
|
+
const slashIndex = url ? url.lastIndexOf("/") : -1;
|
|
1132
1339
|
return slashIndex >= 0 ? url.substr(slashIndex + 1) : "";
|
|
1133
1340
|
}
|
|
1134
1341
|
function dirname(url) {
|
|
1135
|
-
const slashIndex = url
|
|
1342
|
+
const slashIndex = url ? url.lastIndexOf("/") : -1;
|
|
1136
1343
|
return slashIndex >= 0 ? url.substr(0, slashIndex) : "";
|
|
1137
1344
|
}
|
|
1138
1345
|
function join(...parts) {
|
|
@@ -1148,33 +1355,187 @@
|
|
|
1148
1355
|
});
|
|
1149
1356
|
return parts.join(separator);
|
|
1150
1357
|
}
|
|
1358
|
+
function resolve(...components) {
|
|
1359
|
+
const paths = [];
|
|
1360
|
+
for (let _i = 0; _i < components.length; _i++) {
|
|
1361
|
+
paths[_i] = components[_i];
|
|
1362
|
+
}
|
|
1363
|
+
let resolvedPath = "";
|
|
1364
|
+
let resolvedAbsolute = false;
|
|
1365
|
+
let cwd;
|
|
1366
|
+
for (let i = paths.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
1367
|
+
let path;
|
|
1368
|
+
if (i >= 0) {
|
|
1369
|
+
path = paths[i];
|
|
1370
|
+
} else {
|
|
1371
|
+
if (cwd === void 0) {
|
|
1372
|
+
cwd = getCWD();
|
|
1373
|
+
}
|
|
1374
|
+
path = cwd;
|
|
1375
|
+
}
|
|
1376
|
+
if (path.length === 0) {
|
|
1377
|
+
continue;
|
|
1378
|
+
}
|
|
1379
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
1380
|
+
resolvedAbsolute = path.charCodeAt(0) === SLASH;
|
|
1381
|
+
}
|
|
1382
|
+
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
|
|
1383
|
+
if (resolvedAbsolute) {
|
|
1384
|
+
return `/${resolvedPath}`;
|
|
1385
|
+
} else if (resolvedPath.length > 0) {
|
|
1386
|
+
return resolvedPath;
|
|
1387
|
+
}
|
|
1388
|
+
return ".";
|
|
1389
|
+
}
|
|
1390
|
+
function normalizeStringPosix(path, allowAboveRoot) {
|
|
1391
|
+
let res = "";
|
|
1392
|
+
let lastSlash = -1;
|
|
1393
|
+
let dots = 0;
|
|
1394
|
+
let code;
|
|
1395
|
+
let isAboveRoot = false;
|
|
1396
|
+
for (let i = 0; i <= path.length; ++i) {
|
|
1397
|
+
if (i < path.length) {
|
|
1398
|
+
code = path.charCodeAt(i);
|
|
1399
|
+
} else if (code === SLASH) {
|
|
1400
|
+
break;
|
|
1401
|
+
} else {
|
|
1402
|
+
code = SLASH;
|
|
1403
|
+
}
|
|
1404
|
+
if (code === SLASH) {
|
|
1405
|
+
if (lastSlash === i - 1 || dots === 1) {
|
|
1406
|
+
} else if (lastSlash !== i - 1 && dots === 2) {
|
|
1407
|
+
if (res.length < 2 || !isAboveRoot || res.charCodeAt(res.length - 1) !== DOT || res.charCodeAt(res.length - 2) !== DOT) {
|
|
1408
|
+
if (res.length > 2) {
|
|
1409
|
+
const start = res.length - 1;
|
|
1410
|
+
let j = start;
|
|
1411
|
+
for (; j >= 0; --j) {
|
|
1412
|
+
if (res.charCodeAt(j) === SLASH) {
|
|
1413
|
+
break;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
if (j !== start) {
|
|
1417
|
+
res = j === -1 ? "" : res.slice(0, j);
|
|
1418
|
+
lastSlash = i;
|
|
1419
|
+
dots = 0;
|
|
1420
|
+
isAboveRoot = false;
|
|
1421
|
+
continue;
|
|
1422
|
+
}
|
|
1423
|
+
} else if (res.length === 2 || res.length === 1) {
|
|
1424
|
+
res = "";
|
|
1425
|
+
lastSlash = i;
|
|
1426
|
+
dots = 0;
|
|
1427
|
+
isAboveRoot = false;
|
|
1428
|
+
continue;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
if (allowAboveRoot) {
|
|
1432
|
+
if (res.length > 0) {
|
|
1433
|
+
res += "/..";
|
|
1434
|
+
} else {
|
|
1435
|
+
res = "..";
|
|
1436
|
+
}
|
|
1437
|
+
isAboveRoot = true;
|
|
1438
|
+
}
|
|
1439
|
+
} else {
|
|
1440
|
+
const slice = path.slice(lastSlash + 1, i);
|
|
1441
|
+
if (res.length > 0) {
|
|
1442
|
+
res += `/${slice}`;
|
|
1443
|
+
} else {
|
|
1444
|
+
res = slice;
|
|
1445
|
+
}
|
|
1446
|
+
isAboveRoot = false;
|
|
1447
|
+
}
|
|
1448
|
+
lastSlash = i;
|
|
1449
|
+
dots = 0;
|
|
1450
|
+
} else if (code === DOT && dots !== -1) {
|
|
1451
|
+
++dots;
|
|
1452
|
+
} else {
|
|
1453
|
+
dots = -1;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
return res;
|
|
1457
|
+
}
|
|
1458
|
+
var SLASH, DOT;
|
|
1151
1459
|
var init_path = __esm({
|
|
1152
1460
|
"../loader-utils/src/lib/path-utils/path.ts"() {
|
|
1461
|
+
init_get_cwd();
|
|
1462
|
+
SLASH = 47;
|
|
1463
|
+
DOT = 46;
|
|
1153
1464
|
}
|
|
1154
1465
|
});
|
|
1155
1466
|
|
|
1156
|
-
// (disabled)
|
|
1467
|
+
// (disabled):fs
|
|
1157
1468
|
var require_fs = __commonJS({
|
|
1158
|
-
"(disabled)
|
|
1469
|
+
"(disabled):fs"() {
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
|
|
1473
|
+
// ../loader-utils/src/lib/node/fs.ts
|
|
1474
|
+
var fs_exports = {};
|
|
1475
|
+
__export(fs_exports, {
|
|
1476
|
+
_readToArrayBuffer: () => _readToArrayBuffer,
|
|
1477
|
+
close: () => close,
|
|
1478
|
+
createWriteStream: () => createWriteStream,
|
|
1479
|
+
fstat: () => fstat,
|
|
1480
|
+
isSupported: () => isSupported,
|
|
1481
|
+
open: () => open,
|
|
1482
|
+
read: () => read,
|
|
1483
|
+
readFile: () => readFile,
|
|
1484
|
+
readFileSync: () => readFileSync,
|
|
1485
|
+
readdir: () => readdir,
|
|
1486
|
+
stat: () => stat,
|
|
1487
|
+
writeFile: () => writeFile,
|
|
1488
|
+
writeFileSync: () => writeFileSync
|
|
1489
|
+
});
|
|
1490
|
+
async function _readToArrayBuffer(fd, start, length) {
|
|
1491
|
+
const buffer = Buffer.alloc(length);
|
|
1492
|
+
const { bytesRead } = await read(fd, buffer, 0, length, start);
|
|
1493
|
+
if (bytesRead !== length) {
|
|
1494
|
+
throw new Error("fs.read failed");
|
|
1495
|
+
}
|
|
1496
|
+
return toArrayBuffer(buffer);
|
|
1497
|
+
}
|
|
1498
|
+
var import_fs, readdir, stat, readFile, readFileSync, writeFile, writeFileSync, open, close, read, fstat, createWriteStream, isSupported;
|
|
1499
|
+
var init_fs = __esm({
|
|
1500
|
+
"../loader-utils/src/lib/node/fs.ts"() {
|
|
1501
|
+
import_fs = __toModule(require_fs());
|
|
1502
|
+
init_buffer_browser();
|
|
1503
|
+
init_promisify();
|
|
1504
|
+
isSupported = Boolean(import_fs.default);
|
|
1505
|
+
try {
|
|
1506
|
+
readdir = promisify2(import_fs.default.readdir);
|
|
1507
|
+
stat = promisify2(import_fs.default.stat);
|
|
1508
|
+
readFile = import_fs.default.readFile;
|
|
1509
|
+
readFileSync = import_fs.default.readFileSync;
|
|
1510
|
+
writeFile = promisify3(import_fs.default.writeFile);
|
|
1511
|
+
writeFileSync = import_fs.default.writeFileSync;
|
|
1512
|
+
open = import_fs.default.open;
|
|
1513
|
+
close = (fd) => new Promise((resolve2, reject) => import_fs.default.close(fd, (err) => err ? reject(err) : resolve2()));
|
|
1514
|
+
read = import_fs.default.read;
|
|
1515
|
+
fstat = import_fs.default.fstat;
|
|
1516
|
+
createWriteStream = import_fs.default.createWriteStream;
|
|
1517
|
+
isSupported = Boolean(import_fs.default);
|
|
1518
|
+
} catch {
|
|
1519
|
+
}
|
|
1159
1520
|
}
|
|
1160
1521
|
});
|
|
1161
1522
|
|
|
1162
1523
|
// ../loader-utils/src/index.ts
|
|
1163
|
-
var fs;
|
|
1164
1524
|
var init_src2 = __esm({
|
|
1165
1525
|
"../loader-utils/src/index.ts"() {
|
|
1166
1526
|
init_assert();
|
|
1167
1527
|
init_globals();
|
|
1168
1528
|
init_parse_with_worker();
|
|
1529
|
+
init_encode_with_worker();
|
|
1169
1530
|
init_array_buffer_utils();
|
|
1170
1531
|
init_text_iterators();
|
|
1171
1532
|
init_async_iteration();
|
|
1172
1533
|
init_request_scheduler();
|
|
1173
1534
|
init_file_aliases();
|
|
1174
1535
|
init_json_loader();
|
|
1536
|
+
init_memory_conversion_utils();
|
|
1175
1537
|
init_path();
|
|
1176
|
-
|
|
1177
|
-
fs = __toModule(require_fs());
|
|
1538
|
+
init_fs();
|
|
1178
1539
|
}
|
|
1179
1540
|
});
|
|
1180
1541
|
|
|
@@ -1225,39 +1586,60 @@
|
|
|
1225
1586
|
}
|
|
1226
1587
|
});
|
|
1227
1588
|
|
|
1589
|
+
// src/lib/utils/url-utils.ts
|
|
1590
|
+
function extractQueryString(url) {
|
|
1591
|
+
const matches3 = url.match(QUERY_STRING_PATTERN);
|
|
1592
|
+
return matches3 && matches3[0];
|
|
1593
|
+
}
|
|
1594
|
+
function stripQueryString(url) {
|
|
1595
|
+
return url.replace(QUERY_STRING_PATTERN, "");
|
|
1596
|
+
}
|
|
1597
|
+
var QUERY_STRING_PATTERN;
|
|
1598
|
+
var init_url_utils = __esm({
|
|
1599
|
+
"src/lib/utils/url-utils.ts"() {
|
|
1600
|
+
QUERY_STRING_PATTERN = /\?.*/;
|
|
1601
|
+
}
|
|
1602
|
+
});
|
|
1603
|
+
|
|
1228
1604
|
// src/lib/utils/resource-utils.ts
|
|
1229
|
-
function
|
|
1605
|
+
function getResourceUrl(resource) {
|
|
1230
1606
|
if (isResponse(resource)) {
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1233
|
-
return {
|
|
1234
|
-
url,
|
|
1235
|
-
type: parseMIMEType(contentTypeHeader) || parseMIMETypeFromURL(url)
|
|
1236
|
-
};
|
|
1607
|
+
const response = resource;
|
|
1608
|
+
return response.url;
|
|
1237
1609
|
}
|
|
1238
1610
|
if (isBlob(resource)) {
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
type: resource.type || ""
|
|
1242
|
-
};
|
|
1611
|
+
const blob = resource;
|
|
1612
|
+
return blob.name || "";
|
|
1243
1613
|
}
|
|
1244
1614
|
if (typeof resource === "string") {
|
|
1245
|
-
return
|
|
1246
|
-
url: stripQueryString(resource),
|
|
1247
|
-
type: parseMIMETypeFromURL(resource)
|
|
1248
|
-
};
|
|
1615
|
+
return resource;
|
|
1249
1616
|
}
|
|
1250
|
-
return
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1617
|
+
return "";
|
|
1618
|
+
}
|
|
1619
|
+
function getResourceMIMEType(resource) {
|
|
1620
|
+
if (isResponse(resource)) {
|
|
1621
|
+
const response = resource;
|
|
1622
|
+
const contentTypeHeader = response.headers.get("content-type") || "";
|
|
1623
|
+
const noQueryUrl = stripQueryString(response.url);
|
|
1624
|
+
return parseMIMEType(contentTypeHeader) || parseMIMETypeFromURL(noQueryUrl);
|
|
1625
|
+
}
|
|
1626
|
+
if (isBlob(resource)) {
|
|
1627
|
+
const blob = resource;
|
|
1628
|
+
return blob.type || "";
|
|
1629
|
+
}
|
|
1630
|
+
if (typeof resource === "string") {
|
|
1631
|
+
return parseMIMETypeFromURL(resource);
|
|
1632
|
+
}
|
|
1633
|
+
return "";
|
|
1254
1634
|
}
|
|
1255
1635
|
function getResourceContentLength(resource) {
|
|
1256
1636
|
if (isResponse(resource)) {
|
|
1257
|
-
|
|
1637
|
+
const response = resource;
|
|
1638
|
+
return response.headers["content-length"] || -1;
|
|
1258
1639
|
}
|
|
1259
1640
|
if (isBlob(resource)) {
|
|
1260
|
-
|
|
1641
|
+
const blob = resource;
|
|
1642
|
+
return blob.size;
|
|
1261
1643
|
}
|
|
1262
1644
|
if (typeof resource === "string") {
|
|
1263
1645
|
return resource.length;
|
|
@@ -1270,15 +1652,11 @@
|
|
|
1270
1652
|
}
|
|
1271
1653
|
return -1;
|
|
1272
1654
|
}
|
|
1273
|
-
function stripQueryString(url) {
|
|
1274
|
-
return url.replace(QUERY_STRING_PATTERN, "");
|
|
1275
|
-
}
|
|
1276
|
-
var QUERY_STRING_PATTERN;
|
|
1277
1655
|
var init_resource_utils = __esm({
|
|
1278
1656
|
"src/lib/utils/resource-utils.ts"() {
|
|
1279
1657
|
init_is_type();
|
|
1280
1658
|
init_mime_type_utils();
|
|
1281
|
-
|
|
1659
|
+
init_url_utils();
|
|
1282
1660
|
}
|
|
1283
1661
|
});
|
|
1284
1662
|
|
|
@@ -1292,7 +1670,8 @@
|
|
|
1292
1670
|
if (contentLength >= 0) {
|
|
1293
1671
|
headers["content-length"] = String(contentLength);
|
|
1294
1672
|
}
|
|
1295
|
-
const
|
|
1673
|
+
const url = getResourceUrl(resource);
|
|
1674
|
+
const type = getResourceMIMEType(resource);
|
|
1296
1675
|
if (type) {
|
|
1297
1676
|
headers["content-type"] = type;
|
|
1298
1677
|
}
|
|
@@ -1322,7 +1701,7 @@
|
|
|
1322
1701
|
text += ` ${await response.text()}`;
|
|
1323
1702
|
}
|
|
1324
1703
|
message += text;
|
|
1325
|
-
message = message.length > 60 ? `${message.slice(60)}...` : message;
|
|
1704
|
+
message = message.length > 60 ? `${message.slice(0, 60)}...` : message;
|
|
1326
1705
|
} catch (error) {
|
|
1327
1706
|
}
|
|
1328
1707
|
return message;
|
|
@@ -1334,9 +1713,9 @@
|
|
|
1334
1713
|
}
|
|
1335
1714
|
if (resource instanceof Blob) {
|
|
1336
1715
|
const blobSlice = resource.slice(0, 5);
|
|
1337
|
-
return await new Promise((
|
|
1716
|
+
return await new Promise((resolve2) => {
|
|
1338
1717
|
const reader = new FileReader();
|
|
1339
|
-
reader.onload = (event) =>
|
|
1718
|
+
reader.onload = (event) => resolve2(event?.target?.result);
|
|
1340
1719
|
reader.readAsDataURL(blobSlice);
|
|
1341
1720
|
});
|
|
1342
1721
|
}
|
|
@@ -1384,7 +1763,7 @@
|
|
|
1384
1763
|
// src/lib/fetch/read-array-buffer.ts
|
|
1385
1764
|
async function readArrayBuffer(file, start, length) {
|
|
1386
1765
|
if (typeof file === "number") {
|
|
1387
|
-
return await
|
|
1766
|
+
return await fs_exports._readToArrayBuffer(file, start, length);
|
|
1388
1767
|
}
|
|
1389
1768
|
if (!(file instanceof Blob)) {
|
|
1390
1769
|
file = new Blob([file]);
|
|
@@ -1393,9 +1772,9 @@
|
|
|
1393
1772
|
return await readBlob(slice);
|
|
1394
1773
|
}
|
|
1395
1774
|
async function readBlob(blob) {
|
|
1396
|
-
return await new Promise((
|
|
1775
|
+
return await new Promise((resolve2, reject) => {
|
|
1397
1776
|
const fileReader = new FileReader();
|
|
1398
|
-
fileReader.onload = (event) =>
|
|
1777
|
+
fileReader.onload = (event) => resolve2(event?.target?.result);
|
|
1399
1778
|
fileReader.onerror = (error) => reject(error);
|
|
1400
1779
|
fileReader.readAsArrayBuffer(blob);
|
|
1401
1780
|
});
|
|
@@ -1407,11 +1786,11 @@
|
|
|
1407
1786
|
});
|
|
1408
1787
|
|
|
1409
1788
|
// src/lib/fetch/read-file.ts
|
|
1410
|
-
function
|
|
1789
|
+
function readFileSync2(url, options = {}) {
|
|
1411
1790
|
url = resolvePath(url);
|
|
1412
1791
|
if (!isBrowser) {
|
|
1413
|
-
const buffer =
|
|
1414
|
-
return typeof buffer !== "string" ?
|
|
1792
|
+
const buffer = fs_exports.readFileSync(url, options);
|
|
1793
|
+
return typeof buffer !== "string" ? toArrayBuffer2(buffer) : buffer;
|
|
1415
1794
|
}
|
|
1416
1795
|
if (!options.nothrow) {
|
|
1417
1796
|
assert(false);
|
|
@@ -1426,17 +1805,17 @@
|
|
|
1426
1805
|
});
|
|
1427
1806
|
|
|
1428
1807
|
// src/lib/fetch/write-file.ts
|
|
1429
|
-
async function
|
|
1808
|
+
async function writeFile2(filePath, arrayBufferOrString, options) {
|
|
1430
1809
|
filePath = resolvePath(filePath);
|
|
1431
1810
|
if (!isBrowser) {
|
|
1432
|
-
await
|
|
1811
|
+
await fs_exports.writeFile(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
|
|
1433
1812
|
}
|
|
1434
1813
|
assert(false);
|
|
1435
1814
|
}
|
|
1436
|
-
function
|
|
1815
|
+
function writeFileSync2(filePath, arrayBufferOrString, options) {
|
|
1437
1816
|
filePath = resolvePath(filePath);
|
|
1438
1817
|
if (!isBrowser) {
|
|
1439
|
-
|
|
1818
|
+
fs_exports.writeFileSync(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
|
|
1440
1819
|
}
|
|
1441
1820
|
assert(false);
|
|
1442
1821
|
}
|
|
@@ -1447,12 +1826,12 @@
|
|
|
1447
1826
|
}
|
|
1448
1827
|
});
|
|
1449
1828
|
|
|
1450
|
-
// ../../node_modules/probe.gl/dist/
|
|
1829
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-electron.js
|
|
1451
1830
|
function isElectron(mockUserAgent) {
|
|
1452
1831
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
1453
1832
|
return true;
|
|
1454
1833
|
}
|
|
1455
|
-
if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions
|
|
1834
|
+
if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
|
|
1456
1835
|
return true;
|
|
1457
1836
|
}
|
|
1458
1837
|
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
@@ -1463,52 +1842,54 @@
|
|
|
1463
1842
|
return false;
|
|
1464
1843
|
}
|
|
1465
1844
|
var init_is_electron = __esm({
|
|
1466
|
-
"../../node_modules/probe.gl/dist/
|
|
1845
|
+
"../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-electron.js"() {
|
|
1467
1846
|
}
|
|
1468
1847
|
});
|
|
1469
1848
|
|
|
1470
|
-
// ../../node_modules/probe.gl/dist/
|
|
1849
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-browser.js
|
|
1471
1850
|
function isBrowser3() {
|
|
1472
1851
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
1473
1852
|
return !isNode || isElectron();
|
|
1474
1853
|
}
|
|
1475
1854
|
var init_is_browser = __esm({
|
|
1476
|
-
"../../node_modules/probe.gl/dist/
|
|
1855
|
+
"../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-browser.js"() {
|
|
1477
1856
|
init_is_electron();
|
|
1478
1857
|
}
|
|
1479
1858
|
});
|
|
1480
1859
|
|
|
1481
|
-
// ../../node_modules/probe.gl/dist/
|
|
1482
|
-
var
|
|
1860
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/globals.js
|
|
1861
|
+
var self_3, window_3, document_3, process_, console_, navigator_;
|
|
1483
1862
|
var init_globals3 = __esm({
|
|
1484
|
-
"../../node_modules/probe.gl/dist/
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
};
|
|
1492
|
-
self_3 = globals3.self || globals3.window || globals3.global;
|
|
1493
|
-
window_3 = globals3.window || globals3.self || globals3.global;
|
|
1494
|
-
global_3 = globals3.global || globals3.self || globals3.window;
|
|
1495
|
-
document_3 = globals3.document || {};
|
|
1496
|
-
process_ = globals3.process || {};
|
|
1863
|
+
"../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/globals.js"() {
|
|
1864
|
+
self_3 = globalThis.self || globalThis.window || globalThis.global;
|
|
1865
|
+
window_3 = globalThis.window || globalThis.self || globalThis.global;
|
|
1866
|
+
document_3 = globalThis.document || {};
|
|
1867
|
+
process_ = globalThis.process || {};
|
|
1868
|
+
console_ = globalThis.console;
|
|
1869
|
+
navigator_ = globalThis.navigator || {};
|
|
1497
1870
|
}
|
|
1498
1871
|
});
|
|
1499
1872
|
|
|
1500
|
-
// ../../node_modules/probe.gl/dist/
|
|
1501
|
-
var
|
|
1873
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
1874
|
+
var VERSION4, isBrowser4;
|
|
1502
1875
|
var init_globals4 = __esm({
|
|
1503
|
-
"../../node_modules/probe.gl/dist/
|
|
1876
|
+
"../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js"() {
|
|
1504
1877
|
init_is_browser();
|
|
1505
|
-
|
|
1506
|
-
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
1878
|
+
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
1507
1879
|
isBrowser4 = isBrowser3();
|
|
1508
1880
|
}
|
|
1509
1881
|
});
|
|
1510
1882
|
|
|
1511
|
-
// ../../node_modules/probe.gl/dist/
|
|
1883
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/index.js
|
|
1884
|
+
var init_dist2 = __esm({
|
|
1885
|
+
"../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/index.js"() {
|
|
1886
|
+
init_globals4();
|
|
1887
|
+
init_globals3();
|
|
1888
|
+
init_is_browser();
|
|
1889
|
+
}
|
|
1890
|
+
});
|
|
1891
|
+
|
|
1892
|
+
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
1512
1893
|
function getStorage(type) {
|
|
1513
1894
|
try {
|
|
1514
1895
|
const storage = window[type];
|
|
@@ -1522,29 +1903,28 @@
|
|
|
1522
1903
|
}
|
|
1523
1904
|
var LocalStorage;
|
|
1524
1905
|
var init_local_storage = __esm({
|
|
1525
|
-
"../../node_modules
|
|
1906
|
+
"../../node_modules/@probe.gl/log/dist/utils/local-storage.js"() {
|
|
1907
|
+
init_defineProperty();
|
|
1526
1908
|
LocalStorage = class {
|
|
1527
|
-
constructor(id,
|
|
1909
|
+
constructor(id, defaultConfig) {
|
|
1910
|
+
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
1911
|
+
_defineProperty(this, "storage", void 0);
|
|
1912
|
+
_defineProperty(this, "id", void 0);
|
|
1913
|
+
_defineProperty(this, "config", void 0);
|
|
1528
1914
|
this.storage = getStorage(type);
|
|
1529
1915
|
this.id = id;
|
|
1530
|
-
this.config =
|
|
1531
|
-
Object.assign(this.config, defaultSettings);
|
|
1916
|
+
this.config = defaultConfig;
|
|
1532
1917
|
this._loadConfiguration();
|
|
1533
1918
|
}
|
|
1534
1919
|
getConfiguration() {
|
|
1535
1920
|
return this.config;
|
|
1536
1921
|
}
|
|
1537
1922
|
setConfiguration(configuration) {
|
|
1538
|
-
this.config = {};
|
|
1539
|
-
return this.updateConfiguration(configuration);
|
|
1540
|
-
}
|
|
1541
|
-
updateConfiguration(configuration) {
|
|
1542
1923
|
Object.assign(this.config, configuration);
|
|
1543
1924
|
if (this.storage) {
|
|
1544
1925
|
const serialized = JSON.stringify(this.config);
|
|
1545
1926
|
this.storage.setItem(this.id, serialized);
|
|
1546
1927
|
}
|
|
1547
|
-
return this;
|
|
1548
1928
|
}
|
|
1549
1929
|
_loadConfiguration() {
|
|
1550
1930
|
let configuration = {};
|
|
@@ -1559,7 +1939,7 @@
|
|
|
1559
1939
|
}
|
|
1560
1940
|
});
|
|
1561
1941
|
|
|
1562
|
-
// ../../node_modules
|
|
1942
|
+
// ../../node_modules/@probe.gl/log/dist/utils/formatters.js
|
|
1563
1943
|
function formatTime(ms) {
|
|
1564
1944
|
let formatted;
|
|
1565
1945
|
if (ms < 10) {
|
|
@@ -1573,11 +1953,13 @@
|
|
|
1573
1953
|
}
|
|
1574
1954
|
return formatted;
|
|
1575
1955
|
}
|
|
1576
|
-
function leftPad(string
|
|
1956
|
+
function leftPad(string) {
|
|
1957
|
+
let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
1577
1958
|
const padLength = Math.max(length - string.length, 0);
|
|
1578
1959
|
return "".concat(" ".repeat(padLength)).concat(string);
|
|
1579
1960
|
}
|
|
1580
|
-
function formatImage(image, message, scale
|
|
1961
|
+
function formatImage(image, message, scale) {
|
|
1962
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
1581
1963
|
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
1582
1964
|
if (image.width > maxWidth) {
|
|
1583
1965
|
scale = Math.min(scale, maxWidth / image.width);
|
|
@@ -1588,87 +1970,97 @@
|
|
|
1588
1970
|
return ["".concat(message, " %c+"), style];
|
|
1589
1971
|
}
|
|
1590
1972
|
var init_formatters = __esm({
|
|
1591
|
-
"../../node_modules
|
|
1973
|
+
"../../node_modules/@probe.gl/log/dist/utils/formatters.js"() {
|
|
1592
1974
|
}
|
|
1593
1975
|
});
|
|
1594
1976
|
|
|
1595
|
-
// ../../node_modules
|
|
1977
|
+
// ../../node_modules/@probe.gl/log/dist/utils/color.js
|
|
1596
1978
|
function getColor(color) {
|
|
1597
|
-
|
|
1979
|
+
if (typeof color !== "string") {
|
|
1980
|
+
return color;
|
|
1981
|
+
}
|
|
1982
|
+
color = color.toUpperCase();
|
|
1983
|
+
return COLOR[color] || COLOR.WHITE;
|
|
1598
1984
|
}
|
|
1599
1985
|
function addColor(string, color, background) {
|
|
1600
|
-
if (!
|
|
1986
|
+
if (!isBrowser3 && typeof string === "string") {
|
|
1601
1987
|
if (color) {
|
|
1602
|
-
|
|
1603
|
-
string = "[".concat(
|
|
1988
|
+
const colorCode = getColor(color);
|
|
1989
|
+
string = "[".concat(colorCode, "m").concat(string, "[39m");
|
|
1604
1990
|
}
|
|
1605
1991
|
if (background) {
|
|
1606
|
-
|
|
1607
|
-
string = "[".concat(
|
|
1992
|
+
const colorCode = getColor(background);
|
|
1993
|
+
string = "[".concat(colorCode + BACKGROUND_INCREMENT, "m").concat(string, "[49m");
|
|
1608
1994
|
}
|
|
1609
1995
|
}
|
|
1610
1996
|
return string;
|
|
1611
1997
|
}
|
|
1612
|
-
var COLOR;
|
|
1998
|
+
var COLOR, BACKGROUND_INCREMENT;
|
|
1613
1999
|
var init_color = __esm({
|
|
1614
|
-
"../../node_modules
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
BLACK
|
|
1618
|
-
RED
|
|
1619
|
-
GREEN
|
|
1620
|
-
YELLOW
|
|
1621
|
-
BLUE
|
|
1622
|
-
MAGENTA
|
|
1623
|
-
CYAN
|
|
1624
|
-
WHITE
|
|
1625
|
-
BRIGHT_BLACK
|
|
1626
|
-
BRIGHT_RED
|
|
1627
|
-
BRIGHT_GREEN
|
|
1628
|
-
BRIGHT_YELLOW
|
|
1629
|
-
BRIGHT_BLUE
|
|
1630
|
-
BRIGHT_MAGENTA
|
|
1631
|
-
BRIGHT_CYAN
|
|
1632
|
-
BRIGHT_WHITE
|
|
1633
|
-
};
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
2000
|
+
"../../node_modules/@probe.gl/log/dist/utils/color.js"() {
|
|
2001
|
+
init_dist2();
|
|
2002
|
+
(function(COLOR2) {
|
|
2003
|
+
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
2004
|
+
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
2005
|
+
COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
|
|
2006
|
+
COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
|
|
2007
|
+
COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
|
|
2008
|
+
COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
|
|
2009
|
+
COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
|
|
2010
|
+
COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
|
|
2011
|
+
COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
2012
|
+
COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
2013
|
+
COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
2014
|
+
COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
2015
|
+
COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
2016
|
+
COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
2017
|
+
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
2018
|
+
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
2019
|
+
})(COLOR || (COLOR = {}));
|
|
2020
|
+
BACKGROUND_INCREMENT = 10;
|
|
2021
|
+
}
|
|
2022
|
+
});
|
|
2023
|
+
|
|
2024
|
+
// ../../node_modules/@probe.gl/log/dist/utils/autobind.js
|
|
2025
|
+
function autobind(obj) {
|
|
2026
|
+
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
1639
2027
|
const proto = Object.getPrototypeOf(obj);
|
|
1640
2028
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
2029
|
+
const object = obj;
|
|
1641
2030
|
for (const key of propNames) {
|
|
1642
|
-
|
|
2031
|
+
const value = object[key];
|
|
2032
|
+
if (typeof value === "function") {
|
|
1643
2033
|
if (!predefined.find((name) => key === name)) {
|
|
1644
|
-
|
|
2034
|
+
object[key] = value.bind(obj);
|
|
1645
2035
|
}
|
|
1646
2036
|
}
|
|
1647
2037
|
}
|
|
1648
2038
|
}
|
|
1649
2039
|
var init_autobind = __esm({
|
|
1650
|
-
"../../node_modules
|
|
2040
|
+
"../../node_modules/@probe.gl/log/dist/utils/autobind.js"() {
|
|
1651
2041
|
}
|
|
1652
2042
|
});
|
|
1653
2043
|
|
|
1654
|
-
// ../../node_modules
|
|
2044
|
+
// ../../node_modules/@probe.gl/log/dist/utils/assert.js
|
|
1655
2045
|
function assert3(condition, message) {
|
|
1656
2046
|
if (!condition) {
|
|
1657
2047
|
throw new Error(message || "Assertion failed");
|
|
1658
2048
|
}
|
|
1659
2049
|
}
|
|
1660
2050
|
var init_assert3 = __esm({
|
|
1661
|
-
"../../node_modules
|
|
2051
|
+
"../../node_modules/@probe.gl/log/dist/utils/assert.js"() {
|
|
1662
2052
|
}
|
|
1663
2053
|
});
|
|
1664
2054
|
|
|
1665
|
-
// ../../node_modules
|
|
2055
|
+
// ../../node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
|
|
1666
2056
|
function getHiResTimestamp2() {
|
|
1667
2057
|
let timestamp;
|
|
1668
|
-
if (
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
2058
|
+
if (isBrowser3() && window_3.performance) {
|
|
2059
|
+
var _window$performance, _window$performance$n;
|
|
2060
|
+
timestamp = window_3 === null || window_3 === void 0 ? void 0 : (_window$performance = window_3.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
2061
|
+
} else if ("hrtime" in process_) {
|
|
2062
|
+
var _process$hrtime;
|
|
2063
|
+
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
1672
2064
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
1673
2065
|
} else {
|
|
1674
2066
|
timestamp = Date.now();
|
|
@@ -1676,22 +2068,14 @@
|
|
|
1676
2068
|
return timestamp;
|
|
1677
2069
|
}
|
|
1678
2070
|
var init_hi_res_timestamp2 = __esm({
|
|
1679
|
-
"../../node_modules
|
|
1680
|
-
|
|
2071
|
+
"../../node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js"() {
|
|
2072
|
+
init_dist2();
|
|
1681
2073
|
}
|
|
1682
2074
|
});
|
|
1683
2075
|
|
|
1684
|
-
// ../../node_modules
|
|
2076
|
+
// ../../node_modules/@probe.gl/log/dist/log.js
|
|
1685
2077
|
function noop() {
|
|
1686
2078
|
}
|
|
1687
|
-
function getTableHeader(table) {
|
|
1688
|
-
for (const key in table) {
|
|
1689
|
-
for (const title in table[key]) {
|
|
1690
|
-
return title || "untitled";
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
return "empty";
|
|
1694
|
-
}
|
|
1695
2079
|
function normalizeLogLevel(logLevel) {
|
|
1696
2080
|
if (!logLevel) {
|
|
1697
2081
|
return 0;
|
|
@@ -1719,7 +2103,6 @@
|
|
|
1719
2103
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
1720
2104
|
while (args.length && args.shift() !== message) {
|
|
1721
2105
|
}
|
|
1722
|
-
opts.args = args;
|
|
1723
2106
|
switch (typeof logLevel) {
|
|
1724
2107
|
case "string":
|
|
1725
2108
|
case "function":
|
|
@@ -1738,7 +2121,9 @@
|
|
|
1738
2121
|
}
|
|
1739
2122
|
const messageType = typeof opts.message;
|
|
1740
2123
|
assert3(messageType === "string" || messageType === "object");
|
|
1741
|
-
return Object.assign(opts,
|
|
2124
|
+
return Object.assign(opts, {
|
|
2125
|
+
args
|
|
2126
|
+
}, opts.opts);
|
|
1742
2127
|
}
|
|
1743
2128
|
function decorateMessage(id, message, opts) {
|
|
1744
2129
|
if (typeof message === "string") {
|
|
@@ -1748,29 +2133,21 @@
|
|
|
1748
2133
|
}
|
|
1749
2134
|
return message;
|
|
1750
2135
|
}
|
|
1751
|
-
function logImageInNode({
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
asciify = module.require("asciify-image");
|
|
1759
|
-
} catch (error) {
|
|
1760
|
-
}
|
|
1761
|
-
if (asciify) {
|
|
1762
|
-
return () => asciify(image, {
|
|
1763
|
-
fit: "box",
|
|
1764
|
-
width: "".concat(Math.round(80 * scale), "%")
|
|
1765
|
-
}).then((data) => console.log(data));
|
|
1766
|
-
}
|
|
2136
|
+
function logImageInNode(_ref2) {
|
|
2137
|
+
let {
|
|
2138
|
+
image,
|
|
2139
|
+
message = "",
|
|
2140
|
+
scale = 1
|
|
2141
|
+
} = _ref2;
|
|
2142
|
+
console.warn("removed");
|
|
1767
2143
|
return noop;
|
|
1768
2144
|
}
|
|
1769
|
-
function logImageInBrowser({
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
2145
|
+
function logImageInBrowser(_ref3) {
|
|
2146
|
+
let {
|
|
2147
|
+
image,
|
|
2148
|
+
message = "",
|
|
2149
|
+
scale = 1
|
|
2150
|
+
} = _ref3;
|
|
1774
2151
|
if (typeof image === "string") {
|
|
1775
2152
|
const img = new Image();
|
|
1776
2153
|
img.onload = () => {
|
|
@@ -1793,10 +2170,19 @@
|
|
|
1793
2170
|
}
|
|
1794
2171
|
return noop;
|
|
1795
2172
|
}
|
|
1796
|
-
|
|
2173
|
+
function getTableHeader(table) {
|
|
2174
|
+
for (const key in table) {
|
|
2175
|
+
for (const title in table[key]) {
|
|
2176
|
+
return title || "untitled";
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
return "empty";
|
|
2180
|
+
}
|
|
2181
|
+
var originalConsole, DEFAULT_LOG_CONFIGURATION, cache, ONCE, Log;
|
|
1797
2182
|
var init_log = __esm({
|
|
1798
|
-
"../../node_modules
|
|
1799
|
-
|
|
2183
|
+
"../../node_modules/@probe.gl/log/dist/log.js"() {
|
|
2184
|
+
init_defineProperty();
|
|
2185
|
+
init_dist2();
|
|
1800
2186
|
init_local_storage();
|
|
1801
2187
|
init_formatters();
|
|
1802
2188
|
init_color();
|
|
@@ -1804,13 +2190,13 @@
|
|
|
1804
2190
|
init_assert3();
|
|
1805
2191
|
init_hi_res_timestamp2();
|
|
1806
2192
|
originalConsole = {
|
|
1807
|
-
debug:
|
|
2193
|
+
debug: isBrowser3() ? console.debug || console.log : console.log,
|
|
1808
2194
|
log: console.log,
|
|
1809
2195
|
info: console.info,
|
|
1810
2196
|
warn: console.warn,
|
|
1811
2197
|
error: console.error
|
|
1812
2198
|
};
|
|
1813
|
-
|
|
2199
|
+
DEFAULT_LOG_CONFIGURATION = {
|
|
1814
2200
|
enabled: true,
|
|
1815
2201
|
level: 0
|
|
1816
2202
|
};
|
|
@@ -1819,18 +2205,22 @@
|
|
|
1819
2205
|
once: true
|
|
1820
2206
|
};
|
|
1821
2207
|
Log = class {
|
|
1822
|
-
constructor({
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
2208
|
+
constructor() {
|
|
2209
|
+
let {
|
|
2210
|
+
id
|
|
2211
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
2212
|
+
id: ""
|
|
2213
|
+
};
|
|
2214
|
+
_defineProperty(this, "id", void 0);
|
|
2215
|
+
_defineProperty(this, "VERSION", VERSION4);
|
|
2216
|
+
_defineProperty(this, "_startTs", getHiResTimestamp2());
|
|
2217
|
+
_defineProperty(this, "_deltaTs", getHiResTimestamp2());
|
|
2218
|
+
_defineProperty(this, "_storage", void 0);
|
|
2219
|
+
_defineProperty(this, "userData", {});
|
|
2220
|
+
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
1827
2221
|
this.id = id;
|
|
1828
|
-
this.VERSION = VERSION3;
|
|
1829
|
-
this._startTs = getHiResTimestamp2();
|
|
1830
|
-
this._deltaTs = getHiResTimestamp2();
|
|
1831
|
-
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
1832
|
-
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
1833
2222
|
this.userData = {};
|
|
2223
|
+
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_LOG_CONFIGURATION);
|
|
1834
2224
|
this.timeStamp("".concat(this.id, " started"));
|
|
1835
2225
|
autobind(this);
|
|
1836
2226
|
Object.seal(this);
|
|
@@ -1862,18 +2252,34 @@
|
|
|
1862
2252
|
getPriority() {
|
|
1863
2253
|
return this.level;
|
|
1864
2254
|
}
|
|
1865
|
-
enable(
|
|
1866
|
-
|
|
2255
|
+
enable() {
|
|
2256
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
2257
|
+
this._storage.setConfiguration({
|
|
1867
2258
|
enabled
|
|
1868
2259
|
});
|
|
1869
2260
|
return this;
|
|
1870
2261
|
}
|
|
1871
2262
|
setLevel(level) {
|
|
1872
|
-
this._storage.
|
|
2263
|
+
this._storage.setConfiguration({
|
|
1873
2264
|
level
|
|
1874
2265
|
});
|
|
1875
2266
|
return this;
|
|
1876
2267
|
}
|
|
2268
|
+
get(setting) {
|
|
2269
|
+
return this._storage.config[setting];
|
|
2270
|
+
}
|
|
2271
|
+
set(setting, value) {
|
|
2272
|
+
this._storage.setConfiguration({
|
|
2273
|
+
[setting]: value
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
settings() {
|
|
2277
|
+
if (console.table) {
|
|
2278
|
+
console.table(this._storage.config);
|
|
2279
|
+
} else {
|
|
2280
|
+
console.log(this._storage.config);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
1877
2283
|
assert(condition, message) {
|
|
1878
2284
|
assert3(condition, message);
|
|
1879
2285
|
}
|
|
@@ -1912,17 +2318,18 @@
|
|
|
1912
2318
|
}
|
|
1913
2319
|
return noop;
|
|
1914
2320
|
}
|
|
1915
|
-
image({
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
2321
|
+
image(_ref) {
|
|
2322
|
+
let {
|
|
2323
|
+
logLevel,
|
|
2324
|
+
priority,
|
|
2325
|
+
image,
|
|
2326
|
+
message = "",
|
|
2327
|
+
scale = 1
|
|
2328
|
+
} = _ref;
|
|
1922
2329
|
if (!this._shouldLog(logLevel || priority)) {
|
|
1923
2330
|
return noop;
|
|
1924
2331
|
}
|
|
1925
|
-
return
|
|
2332
|
+
return isBrowser3() ? logImageInBrowser({
|
|
1926
2333
|
image,
|
|
1927
2334
|
message,
|
|
1928
2335
|
scale
|
|
@@ -1932,21 +2339,6 @@
|
|
|
1932
2339
|
scale
|
|
1933
2340
|
});
|
|
1934
2341
|
}
|
|
1935
|
-
settings() {
|
|
1936
|
-
if (console.table) {
|
|
1937
|
-
console.table(this._storage.config);
|
|
1938
|
-
} else {
|
|
1939
|
-
console.log(this._storage.config);
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
get(setting) {
|
|
1943
|
-
return this._storage.config[setting];
|
|
1944
|
-
}
|
|
1945
|
-
set(setting, value) {
|
|
1946
|
-
this._storage.updateConfiguration({
|
|
1947
|
-
[setting]: value
|
|
1948
|
-
});
|
|
1949
|
-
}
|
|
1950
2342
|
time(logLevel, message) {
|
|
1951
2343
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
1952
2344
|
}
|
|
@@ -1956,10 +2348,11 @@
|
|
|
1956
2348
|
timeStamp(logLevel, message) {
|
|
1957
2349
|
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
1958
2350
|
}
|
|
1959
|
-
group(logLevel, message
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2351
|
+
group(logLevel, message) {
|
|
2352
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
2353
|
+
collapsed: false
|
|
2354
|
+
};
|
|
2355
|
+
const options = normalizeArguments({
|
|
1963
2356
|
logLevel,
|
|
1964
2357
|
message,
|
|
1965
2358
|
opts
|
|
@@ -1967,10 +2360,11 @@
|
|
|
1967
2360
|
const {
|
|
1968
2361
|
collapsed
|
|
1969
2362
|
} = opts;
|
|
1970
|
-
|
|
1971
|
-
return this._getLogFunction(
|
|
2363
|
+
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
2364
|
+
return this._getLogFunction(options);
|
|
1972
2365
|
}
|
|
1973
|
-
groupCollapsed(logLevel, message
|
|
2366
|
+
groupCollapsed(logLevel, message) {
|
|
2367
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1974
2368
|
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
1975
2369
|
collapsed: true
|
|
1976
2370
|
}));
|
|
@@ -1994,7 +2388,7 @@
|
|
|
1994
2388
|
_shouldLog(logLevel) {
|
|
1995
2389
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
1996
2390
|
}
|
|
1997
|
-
_getLogFunction(logLevel, message, method, args
|
|
2391
|
+
_getLogFunction(logLevel, message, method, args, opts) {
|
|
1998
2392
|
if (this._shouldLog(logLevel)) {
|
|
1999
2393
|
opts = normalizeArguments({
|
|
2000
2394
|
logLevel,
|
|
@@ -2008,7 +2402,7 @@
|
|
|
2008
2402
|
opts.delta = this.getDelta();
|
|
2009
2403
|
this._deltaTs = getHiResTimestamp2();
|
|
2010
2404
|
const tag = opts.tag || opts.message;
|
|
2011
|
-
if (opts.once) {
|
|
2405
|
+
if (opts.once && tag) {
|
|
2012
2406
|
if (!cache[tag]) {
|
|
2013
2407
|
cache[tag] = getHiResTimestamp2();
|
|
2014
2408
|
} else {
|
|
@@ -2021,48 +2415,18 @@
|
|
|
2021
2415
|
return noop;
|
|
2022
2416
|
}
|
|
2023
2417
|
};
|
|
2024
|
-
Log
|
|
2418
|
+
_defineProperty(Log, "VERSION", VERSION4);
|
|
2025
2419
|
}
|
|
2026
2420
|
});
|
|
2027
2421
|
|
|
2028
|
-
// ../../node_modules
|
|
2029
|
-
var
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
});
|
|
2033
|
-
|
|
2034
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
2035
|
-
var init_stat2 = __esm({
|
|
2036
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
2037
|
-
init_hi_res_timestamp3();
|
|
2038
|
-
}
|
|
2039
|
-
});
|
|
2040
|
-
|
|
2041
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
2042
|
-
var init_stats2 = __esm({
|
|
2043
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
2044
|
-
init_stat2();
|
|
2045
|
-
}
|
|
2046
|
-
});
|
|
2047
|
-
|
|
2048
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js
|
|
2049
|
-
var init_esm2 = __esm({
|
|
2050
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
2051
|
-
init_stats2();
|
|
2052
|
-
init_stat2();
|
|
2053
|
-
init_hi_res_timestamp3();
|
|
2054
|
-
}
|
|
2055
|
-
});
|
|
2056
|
-
|
|
2057
|
-
// ../../node_modules/probe.gl/dist/esm/index.js
|
|
2058
|
-
var esm_default;
|
|
2059
|
-
var init_esm3 = __esm({
|
|
2060
|
-
"../../node_modules/probe.gl/dist/esm/index.js"() {
|
|
2422
|
+
// ../../node_modules/@probe.gl/log/dist/index.js
|
|
2423
|
+
var dist_default;
|
|
2424
|
+
var init_dist3 = __esm({
|
|
2425
|
+
"../../node_modules/@probe.gl/log/dist/index.js"() {
|
|
2061
2426
|
init_log();
|
|
2062
2427
|
init_log();
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
id: "probe.gl"
|
|
2428
|
+
dist_default = new Log({
|
|
2429
|
+
id: "@probe.gl/log"
|
|
2066
2430
|
});
|
|
2067
2431
|
}
|
|
2068
2432
|
});
|
|
@@ -2071,7 +2435,7 @@
|
|
|
2071
2435
|
var probeLog, NullLog, ConsoleLog;
|
|
2072
2436
|
var init_loggers = __esm({
|
|
2073
2437
|
"src/lib/loader-utils/loggers.ts"() {
|
|
2074
|
-
|
|
2438
|
+
init_dist3();
|
|
2075
2439
|
probeLog = new Log({ id: "loaders.gl" });
|
|
2076
2440
|
NullLog = class {
|
|
2077
2441
|
log() {
|
|
@@ -2115,6 +2479,7 @@
|
|
|
2115
2479
|
var DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS;
|
|
2116
2480
|
var init_option_defaults = __esm({
|
|
2117
2481
|
"src/lib/loader-utils/option-defaults.ts"() {
|
|
2482
|
+
init_src2();
|
|
2118
2483
|
init_loggers();
|
|
2119
2484
|
DEFAULT_LOADER_OPTIONS = {
|
|
2120
2485
|
fetch: null,
|
|
@@ -2125,7 +2490,8 @@
|
|
|
2125
2490
|
worker: true,
|
|
2126
2491
|
maxConcurrency: 3,
|
|
2127
2492
|
maxMobileConcurrency: 1,
|
|
2128
|
-
reuseWorkers:
|
|
2493
|
+
reuseWorkers: isBrowser,
|
|
2494
|
+
_nodeWorkers: false,
|
|
2129
2495
|
_workerType: "",
|
|
2130
2496
|
limit: 0,
|
|
2131
2497
|
_limitMB: 0,
|
|
@@ -2172,20 +2538,6 @@
|
|
|
2172
2538
|
validateOptions(options, loaders);
|
|
2173
2539
|
return normalizeOptionsInternal(loader, options, url);
|
|
2174
2540
|
}
|
|
2175
|
-
function getFetchFunction(options, context) {
|
|
2176
|
-
const globalOptions = getGlobalLoaderOptions();
|
|
2177
|
-
const fetchOptions = options || globalOptions;
|
|
2178
|
-
if (typeof fetchOptions.fetch === "function") {
|
|
2179
|
-
return fetchOptions.fetch;
|
|
2180
|
-
}
|
|
2181
|
-
if (isObject(fetchOptions.fetch)) {
|
|
2182
|
-
return (url) => fetchFile(url, fetchOptions);
|
|
2183
|
-
}
|
|
2184
|
-
if (context?.fetch) {
|
|
2185
|
-
return context?.fetch;
|
|
2186
|
-
}
|
|
2187
|
-
return fetchFile;
|
|
2188
|
-
}
|
|
2189
2541
|
function validateOptions(options, loaders) {
|
|
2190
2542
|
validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
|
|
2191
2543
|
for (const loader of loaders) {
|
|
@@ -2264,7 +2616,6 @@
|
|
|
2264
2616
|
var init_option_utils = __esm({
|
|
2265
2617
|
"src/lib/loader-utils/option-utils.ts"() {
|
|
2266
2618
|
init_is_type();
|
|
2267
|
-
init_fetch_file();
|
|
2268
2619
|
init_loggers();
|
|
2269
2620
|
init_option_defaults();
|
|
2270
2621
|
getGlobalLoaderOptions = () => {
|
|
@@ -2275,12 +2626,10 @@
|
|
|
2275
2626
|
}
|
|
2276
2627
|
});
|
|
2277
2628
|
|
|
2278
|
-
// src/lib/api/
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
var init_set_loader_options = __esm({
|
|
2283
|
-
"src/lib/api/set-loader-options.ts"() {
|
|
2629
|
+
// src/lib/api/loader-options.ts
|
|
2630
|
+
var init_loader_options = __esm({
|
|
2631
|
+
"src/lib/api/loader-options.ts"() {
|
|
2632
|
+
init_option_utils();
|
|
2284
2633
|
init_option_utils();
|
|
2285
2634
|
}
|
|
2286
2635
|
});
|
|
@@ -2353,6 +2702,15 @@
|
|
|
2353
2702
|
}
|
|
2354
2703
|
});
|
|
2355
2704
|
|
|
2705
|
+
// src/lib/utils/log.ts
|
|
2706
|
+
var log;
|
|
2707
|
+
var init_log2 = __esm({
|
|
2708
|
+
"src/lib/utils/log.ts"() {
|
|
2709
|
+
init_dist3();
|
|
2710
|
+
log = new Log({ id: "loaders.gl" });
|
|
2711
|
+
}
|
|
2712
|
+
});
|
|
2713
|
+
|
|
2356
2714
|
// src/lib/api/select-loader.ts
|
|
2357
2715
|
async function selectLoader(data, loaders = [], options, context) {
|
|
2358
2716
|
if (!validHTTPResponse(data)) {
|
|
@@ -2393,16 +2751,26 @@
|
|
|
2393
2751
|
return loader;
|
|
2394
2752
|
}
|
|
2395
2753
|
function selectLoaderInternal(data, loaders, options, context) {
|
|
2396
|
-
const
|
|
2397
|
-
const
|
|
2754
|
+
const url = getResourceUrl(data);
|
|
2755
|
+
const type = getResourceMIMEType(data);
|
|
2756
|
+
const testUrl = stripQueryString(url) || context?.url;
|
|
2398
2757
|
let loader = null;
|
|
2758
|
+
let reason = "";
|
|
2399
2759
|
if (options?.mimeType) {
|
|
2400
2760
|
loader = findLoaderByMIMEType(loaders, options?.mimeType);
|
|
2761
|
+
reason = `match forced by supplied MIME type ${options?.mimeType}`;
|
|
2401
2762
|
}
|
|
2402
2763
|
loader = loader || findLoaderByUrl(loaders, testUrl);
|
|
2764
|
+
reason = reason || (loader ? `matched url ${testUrl}` : "");
|
|
2403
2765
|
loader = loader || findLoaderByMIMEType(loaders, type);
|
|
2766
|
+
reason = reason || (loader ? `matched MIME type ${type}` : "");
|
|
2404
2767
|
loader = loader || findLoaderByInitialBytes(loaders, data);
|
|
2768
|
+
reason = reason || (loader ? `matched initial data ${getFirstCharacters(data)}` : "");
|
|
2405
2769
|
loader = loader || findLoaderByMIMEType(loaders, options?.fallbackMimeType);
|
|
2770
|
+
reason = reason || (loader ? `matched fallback MIME type ${type}` : "");
|
|
2771
|
+
if (reason) {
|
|
2772
|
+
log.log(1, `selectLoader selected ${loader?.name}: ${reason}.`);
|
|
2773
|
+
}
|
|
2406
2774
|
return loader;
|
|
2407
2775
|
}
|
|
2408
2776
|
function validHTTPResponse(data) {
|
|
@@ -2414,7 +2782,8 @@
|
|
|
2414
2782
|
return true;
|
|
2415
2783
|
}
|
|
2416
2784
|
function getNoValidLoaderMessage(data) {
|
|
2417
|
-
const
|
|
2785
|
+
const url = getResourceUrl(data);
|
|
2786
|
+
const type = getResourceMIMEType(data);
|
|
2418
2787
|
let message = "No valid loader found (";
|
|
2419
2788
|
message += url ? `${path_exports.filename(url)}, ` : "no url provided, ";
|
|
2420
2789
|
message += `MIME type: ${type ? `"${type}"` : "not provided"}, `;
|
|
@@ -2529,9 +2898,11 @@
|
|
|
2529
2898
|
"src/lib/api/select-loader.ts"() {
|
|
2530
2899
|
init_src2();
|
|
2531
2900
|
init_normalize_loader();
|
|
2901
|
+
init_log2();
|
|
2532
2902
|
init_resource_utils();
|
|
2533
2903
|
init_register_loaders();
|
|
2534
2904
|
init_is_type();
|
|
2905
|
+
init_url_utils();
|
|
2535
2906
|
EXT_PATTERN = /\.([^.]+)$/;
|
|
2536
2907
|
}
|
|
2537
2908
|
});
|
|
@@ -2611,7 +2982,7 @@
|
|
|
2611
2982
|
if (done) {
|
|
2612
2983
|
return;
|
|
2613
2984
|
}
|
|
2614
|
-
yield
|
|
2985
|
+
yield toArrayBuffer2(value);
|
|
2615
2986
|
}
|
|
2616
2987
|
} catch (error) {
|
|
2617
2988
|
reader.releaseLock();
|
|
@@ -2619,7 +2990,7 @@
|
|
|
2619
2990
|
}
|
|
2620
2991
|
async function* makeNodeStreamIterator(stream, options) {
|
|
2621
2992
|
for await (const chunk of stream) {
|
|
2622
|
-
yield
|
|
2993
|
+
yield toArrayBuffer2(chunk);
|
|
2623
2994
|
}
|
|
2624
2995
|
}
|
|
2625
2996
|
var init_make_stream_iterator = __esm({
|
|
@@ -2757,19 +3128,49 @@
|
|
|
2757
3128
|
}
|
|
2758
3129
|
});
|
|
2759
3130
|
|
|
3131
|
+
// src/lib/loader-utils/get-fetch-function.ts
|
|
3132
|
+
function getFetchFunction(options, context) {
|
|
3133
|
+
const globalOptions = getGlobalLoaderOptions();
|
|
3134
|
+
const fetchOptions = options || globalOptions;
|
|
3135
|
+
if (typeof fetchOptions.fetch === "function") {
|
|
3136
|
+
return fetchOptions.fetch;
|
|
3137
|
+
}
|
|
3138
|
+
if (isObject(fetchOptions.fetch)) {
|
|
3139
|
+
return (url) => fetchFile(url, fetchOptions);
|
|
3140
|
+
}
|
|
3141
|
+
if (context?.fetch) {
|
|
3142
|
+
return context?.fetch;
|
|
3143
|
+
}
|
|
3144
|
+
return fetchFile;
|
|
3145
|
+
}
|
|
3146
|
+
var init_get_fetch_function = __esm({
|
|
3147
|
+
"src/lib/loader-utils/get-fetch-function.ts"() {
|
|
3148
|
+
init_is_type();
|
|
3149
|
+
init_fetch_file();
|
|
3150
|
+
init_option_utils();
|
|
3151
|
+
}
|
|
3152
|
+
});
|
|
3153
|
+
|
|
2760
3154
|
// src/lib/loader-utils/loader-context.ts
|
|
2761
|
-
function getLoaderContext(context, options,
|
|
2762
|
-
if (
|
|
2763
|
-
return
|
|
3155
|
+
function getLoaderContext(context, options, parentContext) {
|
|
3156
|
+
if (parentContext) {
|
|
3157
|
+
return parentContext;
|
|
2764
3158
|
}
|
|
2765
|
-
const
|
|
3159
|
+
const newContext = {
|
|
2766
3160
|
fetch: getFetchFunction(options, context),
|
|
2767
3161
|
...context
|
|
2768
3162
|
};
|
|
2769
|
-
if (
|
|
2770
|
-
|
|
3163
|
+
if (newContext.url) {
|
|
3164
|
+
const baseUrl = stripQueryString(newContext.url);
|
|
3165
|
+
newContext.baseUrl = baseUrl;
|
|
3166
|
+
newContext.queryString = extractQueryString(newContext.url);
|
|
3167
|
+
newContext.filename = path_exports.filename(baseUrl);
|
|
3168
|
+
newContext.baseUrl = path_exports.dirname(baseUrl);
|
|
3169
|
+
}
|
|
3170
|
+
if (!Array.isArray(newContext.loaders)) {
|
|
3171
|
+
newContext.loaders = null;
|
|
2771
3172
|
}
|
|
2772
|
-
return
|
|
3173
|
+
return newContext;
|
|
2773
3174
|
}
|
|
2774
3175
|
function getLoadersFromContext(loaders, context) {
|
|
2775
3176
|
if (!context && loaders && !Array.isArray(loaders)) {
|
|
@@ -2787,7 +3188,9 @@
|
|
|
2787
3188
|
}
|
|
2788
3189
|
var init_loader_context = __esm({
|
|
2789
3190
|
"src/lib/loader-utils/loader-context.ts"() {
|
|
2790
|
-
|
|
3191
|
+
init_get_fetch_function();
|
|
3192
|
+
init_url_utils();
|
|
3193
|
+
init_src2();
|
|
2791
3194
|
}
|
|
2792
3195
|
});
|
|
2793
3196
|
|
|
@@ -2801,7 +3204,7 @@
|
|
|
2801
3204
|
}
|
|
2802
3205
|
data = await data;
|
|
2803
3206
|
options = options || {};
|
|
2804
|
-
const
|
|
3207
|
+
const url = getResourceUrl(data);
|
|
2805
3208
|
const typedLoaders = loaders;
|
|
2806
3209
|
const candidateLoaders = getLoadersFromContext(typedLoaders, context);
|
|
2807
3210
|
const loader = await selectLoader(data, candidateLoaders, options);
|
|
@@ -2809,11 +3212,17 @@
|
|
|
2809
3212
|
return null;
|
|
2810
3213
|
}
|
|
2811
3214
|
options = normalizeOptions(options, loader, candidateLoaders, url);
|
|
2812
|
-
context = getLoaderContext({ url, parse, loaders: candidateLoaders }, options, context);
|
|
3215
|
+
context = getLoaderContext({ url, parse, loaders: candidateLoaders }, options, context || null);
|
|
2813
3216
|
return await parseWithLoader(loader, data, options, context);
|
|
2814
3217
|
}
|
|
2815
3218
|
async function parseWithLoader(loader, data, options, context) {
|
|
2816
3219
|
validateWorkerVersion(loader);
|
|
3220
|
+
if (isResponse(data)) {
|
|
3221
|
+
const response = data;
|
|
3222
|
+
const { ok, redirected, status, statusText, type, url } = response;
|
|
3223
|
+
const headers = Object.fromEntries(response.headers.entries());
|
|
3224
|
+
context.response = { headers, ok, redirected, status, statusText, type, url };
|
|
3225
|
+
}
|
|
2817
3226
|
data = await getArrayBufferOrStringFromData(data, loader, options);
|
|
2818
3227
|
if (loader.parseTextSync && typeof data === "string") {
|
|
2819
3228
|
options.dataType = "text";
|
|
@@ -2836,6 +3245,7 @@
|
|
|
2836
3245
|
init_src();
|
|
2837
3246
|
init_src2();
|
|
2838
3247
|
init_normalize_loader();
|
|
3248
|
+
init_is_type();
|
|
2839
3249
|
init_option_utils();
|
|
2840
3250
|
init_get_data();
|
|
2841
3251
|
init_loader_context();
|
|
@@ -2860,11 +3270,11 @@
|
|
|
2860
3270
|
return null;
|
|
2861
3271
|
}
|
|
2862
3272
|
options = normalizeOptions(options, loader, candidateLoaders);
|
|
2863
|
-
const
|
|
3273
|
+
const url = getResourceUrl(data);
|
|
2864
3274
|
const parse2 = () => {
|
|
2865
|
-
throw new Error("parseSync called parse");
|
|
3275
|
+
throw new Error("parseSync called parse (which is async");
|
|
2866
3276
|
};
|
|
2867
|
-
context = getLoaderContext({ url, parseSync, parse: parse2, loaders }, options);
|
|
3277
|
+
context = getLoaderContext({ url, parseSync, parse: parse2, loaders }, options, context || null);
|
|
2868
3278
|
return parseWithLoaderSync(loader, data, options, context);
|
|
2869
3279
|
}
|
|
2870
3280
|
function parseWithLoaderSync(loader, data, options, context) {
|
|
@@ -2892,6 +3302,7 @@
|
|
|
2892
3302
|
// src/lib/api/parse-in-batches.ts
|
|
2893
3303
|
async function parseInBatches(data, loaders, options, context) {
|
|
2894
3304
|
assert(!context || typeof context === "object");
|
|
3305
|
+
const loaderArray = Array.isArray(loaders) ? loaders : void 0;
|
|
2895
3306
|
if (!Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
2896
3307
|
context = void 0;
|
|
2897
3308
|
options = loaders;
|
|
@@ -2899,13 +3310,13 @@
|
|
|
2899
3310
|
}
|
|
2900
3311
|
data = await data;
|
|
2901
3312
|
options = options || {};
|
|
2902
|
-
const
|
|
3313
|
+
const url = getResourceUrl(data);
|
|
2903
3314
|
const loader = await selectLoader(data, loaders, options);
|
|
2904
3315
|
if (!loader) {
|
|
2905
3316
|
return null;
|
|
2906
3317
|
}
|
|
2907
|
-
options = normalizeOptions(options, loader,
|
|
2908
|
-
context = getLoaderContext({ url, parseInBatches, parse, loaders }, options, context);
|
|
3318
|
+
options = normalizeOptions(options, loader, loaderArray, url);
|
|
3319
|
+
context = getLoaderContext({ url, parseInBatches, parse, loaders: loaderArray }, options, context || null);
|
|
2909
3320
|
return await parseWithLoaderInBatches(loader, data, options, context);
|
|
2910
3321
|
}
|
|
2911
3322
|
async function parseWithLoaderInBatches(loader, data, options, context) {
|
|
@@ -2970,12 +3381,17 @@
|
|
|
2970
3381
|
|
|
2971
3382
|
// src/lib/api/load.ts
|
|
2972
3383
|
async function load(url, loaders, options, context) {
|
|
3384
|
+
let resolvedLoaders;
|
|
3385
|
+
let resolvedOptions;
|
|
2973
3386
|
if (!Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
3387
|
+
resolvedLoaders = [];
|
|
3388
|
+
resolvedOptions = loaders;
|
|
2974
3389
|
context = void 0;
|
|
2975
|
-
|
|
2976
|
-
|
|
3390
|
+
} else {
|
|
3391
|
+
resolvedLoaders = loaders;
|
|
3392
|
+
resolvedOptions = options;
|
|
2977
3393
|
}
|
|
2978
|
-
const fetch2 = getFetchFunction(
|
|
3394
|
+
const fetch2 = getFetchFunction(resolvedOptions);
|
|
2979
3395
|
let data = url;
|
|
2980
3396
|
if (typeof url === "string") {
|
|
2981
3397
|
data = await fetch2(url);
|
|
@@ -2983,13 +3399,13 @@
|
|
|
2983
3399
|
if (isBlob(url)) {
|
|
2984
3400
|
data = await fetch2(url);
|
|
2985
3401
|
}
|
|
2986
|
-
return await parse(data,
|
|
3402
|
+
return Array.isArray(resolvedLoaders) ? await parse(data, resolvedLoaders, resolvedOptions) : await parse(data, resolvedLoaders, resolvedOptions);
|
|
2987
3403
|
}
|
|
2988
3404
|
var init_load = __esm({
|
|
2989
3405
|
"src/lib/api/load.ts"() {
|
|
2990
3406
|
init_is_type();
|
|
2991
3407
|
init_normalize_loader();
|
|
2992
|
-
|
|
3408
|
+
init_get_fetch_function();
|
|
2993
3409
|
init_parse();
|
|
2994
3410
|
}
|
|
2995
3411
|
});
|
|
@@ -3019,13 +3435,64 @@
|
|
|
3019
3435
|
var init_load_in_batches = __esm({
|
|
3020
3436
|
"src/lib/api/load-in-batches.ts"() {
|
|
3021
3437
|
init_normalize_loader();
|
|
3022
|
-
|
|
3438
|
+
init_get_fetch_function();
|
|
3023
3439
|
init_parse_in_batches();
|
|
3024
3440
|
}
|
|
3025
3441
|
});
|
|
3026
3442
|
|
|
3443
|
+
// src/lib/api/encode-table.ts
|
|
3444
|
+
async function encodeTable(data, writer, options) {
|
|
3445
|
+
if (writer.encode) {
|
|
3446
|
+
return await writer.encode(data, options);
|
|
3447
|
+
}
|
|
3448
|
+
if (writer.encodeText) {
|
|
3449
|
+
const text = await writer.encodeText(data, options);
|
|
3450
|
+
return new TextEncoder().encode(text);
|
|
3451
|
+
}
|
|
3452
|
+
if (writer.encodeInBatches) {
|
|
3453
|
+
const batches = encodeTableInBatches(data, writer, options);
|
|
3454
|
+
const chunks = [];
|
|
3455
|
+
for await (const batch of batches) {
|
|
3456
|
+
chunks.push(batch);
|
|
3457
|
+
}
|
|
3458
|
+
return concatenateArrayBuffers(...chunks);
|
|
3459
|
+
}
|
|
3460
|
+
throw new Error("Writer could not encode data");
|
|
3461
|
+
}
|
|
3462
|
+
async function encodeTableAsText(data, writer, options) {
|
|
3463
|
+
if (writer.text && writer.encodeText) {
|
|
3464
|
+
return await writer.encodeText(data, options);
|
|
3465
|
+
}
|
|
3466
|
+
if (writer.text && (writer.encode || writer.encodeInBatches)) {
|
|
3467
|
+
const arrayBuffer = await encodeTable(data, writer, options);
|
|
3468
|
+
return new TextDecoder().decode(arrayBuffer);
|
|
3469
|
+
}
|
|
3470
|
+
throw new Error("Writer could not encode data as text");
|
|
3471
|
+
}
|
|
3472
|
+
function encodeTableInBatches(data, writer, options) {
|
|
3473
|
+
if (writer.encodeInBatches) {
|
|
3474
|
+
const dataIterator = getIterator(data);
|
|
3475
|
+
return writer.encodeInBatches(dataIterator, options);
|
|
3476
|
+
}
|
|
3477
|
+
throw new Error("Writer could not encode data in batches");
|
|
3478
|
+
}
|
|
3479
|
+
function getIterator(data) {
|
|
3480
|
+
const dataIterator = [{ table: data, start: 0, end: data.length }];
|
|
3481
|
+
return dataIterator;
|
|
3482
|
+
}
|
|
3483
|
+
var init_encode_table = __esm({
|
|
3484
|
+
"src/lib/api/encode-table.ts"() {
|
|
3485
|
+
init_src2();
|
|
3486
|
+
}
|
|
3487
|
+
});
|
|
3488
|
+
|
|
3027
3489
|
// src/lib/api/encode.ts
|
|
3028
3490
|
async function encode(data, writer, options) {
|
|
3491
|
+
const globalOptions = getGlobalLoaderOptions();
|
|
3492
|
+
options = { ...globalOptions, ...options };
|
|
3493
|
+
if (canEncodeWithWorker(writer, options)) {
|
|
3494
|
+
return await processOnWorker(writer, data, options);
|
|
3495
|
+
}
|
|
3029
3496
|
if (writer.encode) {
|
|
3030
3497
|
return await writer.encode(data, options);
|
|
3031
3498
|
}
|
|
@@ -3045,7 +3512,7 @@
|
|
|
3045
3512
|
}
|
|
3046
3513
|
if (!isBrowser && writer.encodeURLtoURL) {
|
|
3047
3514
|
const tmpInputFilename = getTemporaryFilename("input");
|
|
3048
|
-
await
|
|
3515
|
+
await writeFile2(tmpInputFilename, data);
|
|
3049
3516
|
const tmpOutputFilename = getTemporaryFilename("output");
|
|
3050
3517
|
const outputFilename = await encodeURLtoURL(tmpInputFilename, tmpOutputFilename, writer, options);
|
|
3051
3518
|
const response = await fetchFile(outputFilename);
|
|
@@ -3071,7 +3538,7 @@
|
|
|
3071
3538
|
}
|
|
3072
3539
|
function encodeInBatches(data, writer, options) {
|
|
3073
3540
|
if (writer.encodeInBatches) {
|
|
3074
|
-
const dataIterator =
|
|
3541
|
+
const dataIterator = getIterator2(data);
|
|
3075
3542
|
return writer.encodeInBatches(dataIterator, options);
|
|
3076
3543
|
}
|
|
3077
3544
|
throw new Error("Writer could not encode data in batches");
|
|
@@ -3085,7 +3552,7 @@
|
|
|
3085
3552
|
const outputFilename = await writer.encodeURLtoURL(inputUrl, outputUrl, options);
|
|
3086
3553
|
return outputFilename;
|
|
3087
3554
|
}
|
|
3088
|
-
function
|
|
3555
|
+
function getIterator2(data) {
|
|
3089
3556
|
const dataIterator = [{ table: data, start: 0, end: data.length }];
|
|
3090
3557
|
return dataIterator;
|
|
3091
3558
|
}
|
|
@@ -3094,21 +3561,24 @@
|
|
|
3094
3561
|
}
|
|
3095
3562
|
var init_encode = __esm({
|
|
3096
3563
|
"src/lib/api/encode.ts"() {
|
|
3564
|
+
init_src2();
|
|
3565
|
+
init_src();
|
|
3097
3566
|
init_src2();
|
|
3098
3567
|
init_src2();
|
|
3099
3568
|
init_write_file();
|
|
3100
3569
|
init_fetch_file();
|
|
3570
|
+
init_loader_options();
|
|
3101
3571
|
}
|
|
3102
3572
|
});
|
|
3103
3573
|
|
|
3104
3574
|
// src/lib/api/save.ts
|
|
3105
3575
|
async function save(data, url, writer, options) {
|
|
3106
3576
|
const encodedData = await encode(data, writer, options);
|
|
3107
|
-
return await
|
|
3577
|
+
return await writeFile2(url, encodedData);
|
|
3108
3578
|
}
|
|
3109
3579
|
function saveSync(data, url, writer, options) {
|
|
3110
3580
|
const encodedData = encodeSync(data, writer, options);
|
|
3111
|
-
return
|
|
3581
|
+
return writeFileSync2(url, encodedData);
|
|
3112
3582
|
}
|
|
3113
3583
|
var init_save = __esm({
|
|
3114
3584
|
"src/lib/api/save.ts"() {
|
|
@@ -3148,15 +3618,21 @@
|
|
|
3148
3618
|
});
|
|
3149
3619
|
|
|
3150
3620
|
// src/null-loader.ts
|
|
3151
|
-
|
|
3621
|
+
function parseSync2(arrayBuffer, options, context) {
|
|
3622
|
+
if (!options.null.echoParameters)
|
|
3623
|
+
return null;
|
|
3624
|
+
context = context && JSON.parse(JSON.stringify(context));
|
|
3625
|
+
return { arrayBuffer, options, context };
|
|
3626
|
+
}
|
|
3627
|
+
var VERSION5, NullWorkerLoader, NullLoader;
|
|
3152
3628
|
var init_null_loader = __esm({
|
|
3153
3629
|
"src/null-loader.ts"() {
|
|
3154
|
-
|
|
3630
|
+
VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
3155
3631
|
NullWorkerLoader = {
|
|
3156
3632
|
name: "Null loader",
|
|
3157
3633
|
id: "null",
|
|
3158
3634
|
module: "core",
|
|
3159
|
-
version:
|
|
3635
|
+
version: VERSION5,
|
|
3160
3636
|
worker: true,
|
|
3161
3637
|
mimeTypes: ["application/x.empty"],
|
|
3162
3638
|
extensions: ["null"],
|
|
@@ -3169,19 +3645,21 @@
|
|
|
3169
3645
|
name: "Null loader",
|
|
3170
3646
|
id: "null",
|
|
3171
3647
|
module: "core",
|
|
3172
|
-
version:
|
|
3648
|
+
version: VERSION5,
|
|
3173
3649
|
mimeTypes: ["application/x.empty"],
|
|
3174
3650
|
extensions: ["null"],
|
|
3175
|
-
parse: async (arrayBuffer) => arrayBuffer,
|
|
3176
|
-
parseSync:
|
|
3177
|
-
parseInBatches: async function* generator(asyncIterator) {
|
|
3651
|
+
parse: async (arrayBuffer, options, context) => parseSync2(arrayBuffer, options, context),
|
|
3652
|
+
parseSync: parseSync2,
|
|
3653
|
+
parseInBatches: async function* generator(asyncIterator, options, context) {
|
|
3178
3654
|
for await (const batch of asyncIterator) {
|
|
3179
|
-
yield batch;
|
|
3655
|
+
yield parseSync2(batch, options, context);
|
|
3180
3656
|
}
|
|
3181
3657
|
},
|
|
3182
3658
|
tests: [() => false],
|
|
3183
3659
|
options: {
|
|
3184
|
-
null: {
|
|
3660
|
+
null: {
|
|
3661
|
+
echoParameters: false
|
|
3662
|
+
}
|
|
3185
3663
|
}
|
|
3186
3664
|
};
|
|
3187
3665
|
}
|
|
@@ -3200,8 +3678,8 @@
|
|
|
3200
3678
|
return response;
|
|
3201
3679
|
}
|
|
3202
3680
|
const contentLength = response.headers.get("content-length") || 0;
|
|
3203
|
-
const totalBytes = contentLength
|
|
3204
|
-
if (!(
|
|
3681
|
+
const totalBytes = contentLength ? parseInt(contentLength) : 0;
|
|
3682
|
+
if (!(totalBytes > 0)) {
|
|
3205
3683
|
return response;
|
|
3206
3684
|
}
|
|
3207
3685
|
if (typeof ReadableStream === "undefined" || !body.getReader) {
|
|
@@ -3210,12 +3688,12 @@
|
|
|
3210
3688
|
const progressStream = new ReadableStream({
|
|
3211
3689
|
async start(controller) {
|
|
3212
3690
|
const reader = body.getReader();
|
|
3213
|
-
await
|
|
3691
|
+
await read2(controller, reader, 0, totalBytes, onProgress, onDone, onError);
|
|
3214
3692
|
}
|
|
3215
3693
|
});
|
|
3216
3694
|
return new Response(progressStream);
|
|
3217
3695
|
}
|
|
3218
|
-
async function
|
|
3696
|
+
async function read2(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError) {
|
|
3219
3697
|
try {
|
|
3220
3698
|
const { done, value } = await reader.read();
|
|
3221
3699
|
if (done) {
|
|
@@ -3227,7 +3705,7 @@
|
|
|
3227
3705
|
const percent = Math.round(loadedBytes / totalBytes * 100);
|
|
3228
3706
|
onProgress(percent, { loadedBytes, totalBytes });
|
|
3229
3707
|
controller.enqueue(value);
|
|
3230
|
-
await
|
|
3708
|
+
await read2(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError);
|
|
3231
3709
|
} catch (error) {
|
|
3232
3710
|
controller.error(error);
|
|
3233
3711
|
onError(error);
|
|
@@ -3336,10 +3814,14 @@
|
|
|
3336
3814
|
encode: () => encode,
|
|
3337
3815
|
encodeInBatches: () => encodeInBatches,
|
|
3338
3816
|
encodeSync: () => encodeSync,
|
|
3817
|
+
encodeTable: () => encodeTable,
|
|
3818
|
+
encodeTableAsText: () => encodeTableAsText,
|
|
3819
|
+
encodeTableInBatches: () => encodeTableInBatches,
|
|
3339
3820
|
encodeText: () => encodeText,
|
|
3340
3821
|
encodeURLtoURL: () => encodeURLtoURL,
|
|
3341
3822
|
fetchFile: () => fetchFile,
|
|
3342
3823
|
forEach: () => forEach,
|
|
3824
|
+
getLoaderOptions: () => getGlobalLoaderOptions,
|
|
3343
3825
|
getPathPrefix: () => getPathPrefix,
|
|
3344
3826
|
global: () => global_,
|
|
3345
3827
|
isAsyncIterable: () => isAsyncIterable,
|
|
@@ -3364,7 +3846,7 @@
|
|
|
3364
3846
|
parseInBatches: () => parseInBatches,
|
|
3365
3847
|
parseSync: () => parseSync,
|
|
3366
3848
|
readArrayBuffer: () => readArrayBuffer,
|
|
3367
|
-
readFileSync: () =>
|
|
3849
|
+
readFileSync: () => readFileSync2,
|
|
3368
3850
|
registerLoaders: () => registerLoaders,
|
|
3369
3851
|
resolvePath: () => resolvePath,
|
|
3370
3852
|
save: () => save,
|
|
@@ -3372,11 +3854,11 @@
|
|
|
3372
3854
|
selectLoader: () => selectLoader,
|
|
3373
3855
|
selectLoaderSync: () => selectLoaderSync,
|
|
3374
3856
|
self: () => self_,
|
|
3375
|
-
setLoaderOptions: () =>
|
|
3857
|
+
setLoaderOptions: () => setGlobalOptions,
|
|
3376
3858
|
setPathPrefix: () => setPathPrefix,
|
|
3377
3859
|
window: () => window_,
|
|
3378
|
-
writeFile: () =>
|
|
3379
|
-
writeFileSync: () =>
|
|
3860
|
+
writeFile: () => writeFile2,
|
|
3861
|
+
writeFileSync: () => writeFileSync2
|
|
3380
3862
|
});
|
|
3381
3863
|
var init_src3 = __esm({
|
|
3382
3864
|
"src/index.ts"() {
|
|
@@ -3384,7 +3866,7 @@
|
|
|
3384
3866
|
init_read_array_buffer();
|
|
3385
3867
|
init_read_file();
|
|
3386
3868
|
init_write_file();
|
|
3387
|
-
|
|
3869
|
+
init_loader_options();
|
|
3388
3870
|
init_register_loaders();
|
|
3389
3871
|
init_select_loader();
|
|
3390
3872
|
init_parse();
|
|
@@ -3392,6 +3874,7 @@
|
|
|
3392
3874
|
init_parse_in_batches();
|
|
3393
3875
|
init_load();
|
|
3394
3876
|
init_load_in_batches();
|
|
3877
|
+
init_encode_table();
|
|
3395
3878
|
init_encode();
|
|
3396
3879
|
init_save();
|
|
3397
3880
|
init_src2();
|
|
@@ -3413,10 +3896,10 @@
|
|
|
3413
3896
|
|
|
3414
3897
|
// src/bundle.ts
|
|
3415
3898
|
var require_bundle = __commonJS({
|
|
3416
|
-
"src/bundle.ts"(exports,
|
|
3899
|
+
"src/bundle.ts"(exports, module) {
|
|
3417
3900
|
var moduleExports = (init_src3(), src_exports);
|
|
3418
3901
|
globalThis.loaders = globalThis.loaders || {};
|
|
3419
|
-
|
|
3902
|
+
module.exports = Object.assign(globalThis.loaders, moduleExports);
|
|
3420
3903
|
}
|
|
3421
3904
|
});
|
|
3422
3905
|
require_bundle();
|