@loaders.gl/core 4.0.0-alpha.5 → 4.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/dist/bundle.js +2 -2
  2. package/dist/core-addons/write-file-browser.js +59 -1
  3. package/dist/dist.min.js +855 -404
  4. package/dist/es5/bundle.js +6 -0
  5. package/dist/es5/bundle.js.map +1 -0
  6. package/dist/es5/core-addons/write-file-browser.js +2 -0
  7. package/dist/es5/core-addons/write-file-browser.js.map +1 -0
  8. package/dist/es5/index.js +377 -0
  9. package/dist/es5/index.js.map +1 -0
  10. package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js +94 -0
  11. package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js.map +1 -0
  12. package/dist/es5/iterators/make-iterator/make-array-buffer-iterator.js +42 -0
  13. package/dist/es5/iterators/make-iterator/make-array-buffer-iterator.js.map +1 -0
  14. package/dist/es5/iterators/make-iterator/make-blob-iterator.js +47 -0
  15. package/dist/es5/iterators/make-iterator/make-blob-iterator.js.map +1 -0
  16. package/dist/es5/iterators/make-iterator/make-iterator.js +31 -0
  17. package/dist/es5/iterators/make-iterator/make-iterator.js.map +1 -0
  18. package/dist/es5/iterators/make-iterator/make-stream-iterator.js +133 -0
  19. package/dist/es5/iterators/make-iterator/make-stream-iterator.js.map +1 -0
  20. package/dist/es5/iterators/make-iterator/make-string-iterator.js +38 -0
  21. package/dist/es5/iterators/make-iterator/make-string-iterator.js.map +1 -0
  22. package/dist/es5/iterators/make-stream/make-dom-stream.js +67 -0
  23. package/dist/es5/iterators/make-stream/make-dom-stream.js.map +1 -0
  24. package/dist/es5/iterators/make-stream/make-node-stream.js +168 -0
  25. package/dist/es5/iterators/make-stream/make-node-stream.js.map +1 -0
  26. package/dist/es5/javascript-utils/is-type.js +79 -0
  27. package/dist/es5/javascript-utils/is-type.js.map +1 -0
  28. package/dist/es5/lib/api/encode-table.js +159 -0
  29. package/dist/es5/lib/api/encode-table.js.map +1 -0
  30. package/dist/es5/lib/api/encode.js +244 -0
  31. package/dist/es5/lib/api/encode.js.map +1 -0
  32. package/dist/es5/lib/api/load-in-batches.js +63 -0
  33. package/dist/es5/lib/api/load-in-batches.js.map +1 -0
  34. package/dist/es5/lib/api/load.js +76 -0
  35. package/dist/es5/lib/api/load.js.map +1 -0
  36. package/dist/es5/lib/api/loader-options.js +19 -0
  37. package/dist/es5/lib/api/loader-options.js.map +1 -0
  38. package/dist/es5/lib/api/parse-in-batches.js +277 -0
  39. package/dist/es5/lib/api/parse-in-batches.js.map +1 -0
  40. package/dist/es5/lib/api/parse-sync.js +54 -0
  41. package/dist/es5/lib/api/parse-sync.js.map +1 -0
  42. package/dist/es5/lib/api/parse.js +143 -0
  43. package/dist/es5/lib/api/parse.js.map +1 -0
  44. package/dist/es5/lib/api/register-loaders.js +50 -0
  45. package/dist/es5/lib/api/register-loaders.js.map +1 -0
  46. package/dist/es5/lib/api/save.js +42 -0
  47. package/dist/es5/lib/api/save.js.map +1 -0
  48. package/dist/es5/lib/api/select-loader.js +303 -0
  49. package/dist/es5/lib/api/select-loader.js.map +1 -0
  50. package/dist/es5/lib/common.js +2 -0
  51. package/dist/es5/lib/common.js.map +1 -0
  52. package/dist/es5/lib/fetch/fetch-error-message.js +56 -0
  53. package/dist/es5/lib/fetch/fetch-error-message.js.map +1 -0
  54. package/dist/es5/lib/fetch/fetch-file.js +47 -0
  55. package/dist/es5/lib/fetch/fetch-file.js.map +1 -0
  56. package/dist/es5/lib/fetch/read-array-buffer.js +76 -0
  57. package/dist/es5/lib/fetch/read-array-buffer.js.map +1 -0
  58. package/dist/es5/lib/fetch/read-file.js +20 -0
  59. package/dist/es5/lib/fetch/read-file.js.map +1 -0
  60. package/dist/es5/lib/fetch/write-file.js +48 -0
  61. package/dist/es5/lib/fetch/write-file.js.map +1 -0
  62. package/dist/es5/lib/filesystems/browser-filesystem.js +249 -0
  63. package/dist/es5/lib/filesystems/browser-filesystem.js.map +1 -0
  64. package/dist/es5/lib/filesystems/filesystem.js +2 -0
  65. package/dist/es5/lib/filesystems/filesystem.js.map +1 -0
  66. package/dist/es5/lib/filesystems/read-array-buffer.js +41 -0
  67. package/dist/es5/lib/filesystems/read-array-buffer.js.map +1 -0
  68. package/dist/es5/lib/init.js +18 -0
  69. package/dist/es5/lib/init.js.map +1 -0
  70. package/dist/es5/lib/loader-utils/check-errors.js +57 -0
  71. package/dist/es5/lib/loader-utils/check-errors.js.map +1 -0
  72. package/dist/es5/lib/loader-utils/get-data.js +237 -0
  73. package/dist/es5/lib/loader-utils/get-data.js.map +1 -0
  74. package/dist/es5/lib/loader-utils/get-fetch-function.js +26 -0
  75. package/dist/es5/lib/loader-utils/get-fetch-function.js.map +1 -0
  76. package/dist/es5/lib/loader-utils/loader-context.js +41 -0
  77. package/dist/es5/lib/loader-utils/loader-context.js.map +1 -0
  78. package/dist/es5/lib/loader-utils/loggers.js +90 -0
  79. package/dist/es5/lib/loader-utils/loggers.js.map +1 -0
  80. package/dist/es5/lib/loader-utils/normalize-loader.js +44 -0
  81. package/dist/es5/lib/loader-utils/normalize-loader.js.map +1 -0
  82. package/dist/es5/lib/loader-utils/option-defaults.js +47 -0
  83. package/dist/es5/lib/loader-utils/option-defaults.js.map +1 -0
  84. package/dist/es5/lib/loader-utils/option-utils.js +132 -0
  85. package/dist/es5/lib/loader-utils/option-utils.js.map +1 -0
  86. package/dist/es5/lib/progress/fetch-progress.js +134 -0
  87. package/dist/es5/lib/progress/fetch-progress.js.map +1 -0
  88. package/dist/es5/lib/utils/log.js +12 -0
  89. package/dist/es5/lib/utils/log.js.map +1 -0
  90. package/dist/es5/lib/utils/mime-type-utils.js +24 -0
  91. package/dist/es5/lib/utils/mime-type-utils.js.map +1 -0
  92. package/dist/es5/lib/utils/resource-utils.js +58 -0
  93. package/dist/es5/lib/utils/resource-utils.js.map +1 -0
  94. package/dist/es5/lib/utils/response-utils.js +196 -0
  95. package/dist/es5/lib/utils/response-utils.js.map +1 -0
  96. package/dist/es5/null-loader.js +139 -0
  97. package/dist/es5/null-loader.js.map +1 -0
  98. package/dist/es5/workers/null-worker.js +6 -0
  99. package/dist/es5/workers/null-worker.js.map +1 -0
  100. package/dist/esm/bundle.js +4 -0
  101. package/dist/esm/bundle.js.map +1 -0
  102. package/dist/esm/core-addons/README.md +1 -0
  103. package/dist/esm/core-addons/write-file-browser.js +2 -0
  104. package/dist/esm/core-addons/write-file-browser.js.map +1 -0
  105. package/dist/esm/index.js +30 -0
  106. package/dist/esm/index.js.map +1 -0
  107. package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js +16 -0
  108. package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js.map +1 -0
  109. package/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js +20 -0
  110. package/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js.map +1 -0
  111. package/dist/esm/iterators/make-iterator/make-blob-iterator.js +12 -0
  112. package/dist/esm/iterators/make-iterator/make-blob-iterator.js.map +1 -0
  113. package/dist/esm/iterators/make-iterator/make-iterator.js +25 -0
  114. package/dist/esm/iterators/make-iterator/make-iterator.js.map +1 -0
  115. package/dist/esm/iterators/make-iterator/make-stream-iterator.js +32 -0
  116. package/dist/esm/iterators/make-iterator/make-stream-iterator.js.map +1 -0
  117. package/dist/esm/iterators/make-iterator/make-string-iterator.js +13 -0
  118. package/dist/esm/iterators/make-iterator/make-string-iterator.js.map +1 -0
  119. package/dist/esm/iterators/make-stream/make-dom-stream.js +29 -0
  120. package/dist/esm/iterators/make-stream/make-dom-stream.js.map +1 -0
  121. package/dist/esm/iterators/make-stream/make-node-stream.js +57 -0
  122. package/dist/esm/iterators/make-stream/make-node-stream.js.map +1 -0
  123. package/dist/esm/javascript-utils/is-type.js +19 -0
  124. package/dist/esm/javascript-utils/is-type.js.map +1 -0
  125. package/dist/esm/lib/api/encode-table.js +45 -0
  126. package/dist/esm/lib/api/encode-table.js.map +1 -0
  127. package/dist/esm/lib/api/encode.js +87 -0
  128. package/dist/esm/lib/api/encode.js.map +1 -0
  129. package/dist/esm/lib/api/load-in-batches.js +25 -0
  130. package/dist/esm/lib/api/load-in-batches.js.map +1 -0
  131. package/dist/esm/lib/api/load.js +26 -0
  132. package/dist/esm/lib/api/load.js.map +1 -0
  133. package/dist/esm/lib/api/loader-options.js +3 -0
  134. package/dist/esm/lib/api/loader-options.js.map +1 -0
  135. package/dist/esm/lib/api/parse-in-batches.js +85 -0
  136. package/dist/esm/lib/api/parse-in-batches.js.map +1 -0
  137. package/dist/esm/lib/api/parse-sync.js +47 -0
  138. package/dist/esm/lib/api/parse-sync.js.map +1 -0
  139. package/dist/esm/lib/api/parse.js +76 -0
  140. package/dist/esm/lib/api/parse.js.map +1 -0
  141. package/dist/esm/lib/api/register-loaders.js +25 -0
  142. package/dist/esm/lib/api/register-loaders.js.map +1 -0
  143. package/dist/esm/lib/api/save.js +11 -0
  144. package/dist/esm/lib/api/save.js.map +1 -0
  145. package/dist/esm/lib/api/select-loader.js +204 -0
  146. package/dist/esm/lib/api/select-loader.js.map +1 -0
  147. package/dist/esm/lib/common.js +2 -0
  148. package/dist/esm/lib/common.js.map +1 -0
  149. package/dist/esm/lib/fetch/fetch-error-message.js +18 -0
  150. package/dist/esm/lib/fetch/fetch-error-message.js.map +1 -0
  151. package/dist/esm/lib/fetch/fetch-file.js +14 -0
  152. package/dist/esm/lib/fetch/fetch-file.js.map +1 -0
  153. package/dist/esm/lib/fetch/read-array-buffer.js +23 -0
  154. package/dist/esm/lib/fetch/read-array-buffer.js.map +1 -0
  155. package/dist/esm/lib/fetch/read-file.js +15 -0
  156. package/dist/esm/lib/fetch/read-file.js.map +1 -0
  157. package/dist/esm/lib/fetch/write-file.js +21 -0
  158. package/dist/esm/lib/fetch/write-file.js.map +1 -0
  159. package/dist/esm/lib/filesystems/browser-filesystem.js +92 -0
  160. package/dist/esm/lib/filesystems/browser-filesystem.js.map +1 -0
  161. package/dist/esm/lib/filesystems/filesystem.js +2 -0
  162. package/dist/esm/lib/filesystems/filesystem.js.map +1 -0
  163. package/dist/esm/lib/filesystems/read-array-buffer.js +8 -0
  164. package/dist/esm/lib/filesystems/read-array-buffer.js.map +1 -0
  165. package/dist/esm/lib/init.js +11 -0
  166. package/dist/esm/lib/init.js.map +1 -0
  167. package/dist/esm/lib/loader-utils/check-errors.js +22 -0
  168. package/dist/esm/lib/loader-utils/check-errors.js.map +1 -0
  169. package/dist/esm/lib/loader-utils/get-data.js +103 -0
  170. package/dist/esm/lib/loader-utils/get-data.js.map +1 -0
  171. package/dist/esm/lib/loader-utils/get-fetch-function.js +18 -0
  172. package/dist/esm/lib/loader-utils/get-fetch-function.js.map +1 -0
  173. package/dist/esm/lib/loader-utils/loader-context.js +30 -0
  174. package/dist/esm/lib/loader-utils/loader-context.js.map +1 -0
  175. package/dist/esm/lib/loader-utils/loggers.js +50 -0
  176. package/dist/esm/lib/loader-utils/loggers.js.map +1 -0
  177. package/dist/esm/lib/loader-utils/normalize-loader.js +37 -0
  178. package/dist/esm/lib/loader-utils/normalize-loader.js.map +1 -0
  179. package/dist/esm/lib/loader-utils/option-defaults.js +39 -0
  180. package/dist/esm/lib/loader-utils/option-defaults.js.map +1 -0
  181. package/dist/esm/lib/loader-utils/option-utils.js +106 -0
  182. package/dist/esm/lib/loader-utils/option-utils.js.map +1 -0
  183. package/dist/esm/lib/progress/fetch-progress.js +52 -0
  184. package/dist/esm/lib/progress/fetch-progress.js.map +1 -0
  185. package/dist/esm/lib/utils/log.js +5 -0
  186. package/dist/esm/lib/utils/log.js.map +1 -0
  187. package/dist/esm/lib/utils/mime-type-utils.js +17 -0
  188. package/dist/esm/lib/utils/mime-type-utils.js.map +1 -0
  189. package/dist/esm/lib/utils/resource-utils.js +51 -0
  190. package/dist/esm/lib/utils/resource-utils.js.map +1 -0
  191. package/dist/esm/lib/utils/response-utils.js +91 -0
  192. package/dist/esm/lib/utils/response-utils.js.map +1 -0
  193. package/dist/esm/null-loader.js +45 -0
  194. package/dist/esm/null-loader.js.map +1 -0
  195. package/dist/esm/workers/null-worker.js +4 -0
  196. package/dist/esm/workers/null-worker.js.map +1 -0
  197. package/dist/index.d.ts +3 -1
  198. package/dist/index.d.ts.map +1 -1
  199. package/dist/index.js +108 -29
  200. package/dist/iterators/batch-iterators/timed-batch-iterator.js +20 -17
  201. package/dist/iterators/make-iterator/make-array-buffer-iterator.js +25 -16
  202. package/dist/iterators/make-iterator/make-blob-iterator.js +20 -12
  203. package/dist/iterators/make-iterator/make-iterator.d.ts +1 -1
  204. package/dist/iterators/make-iterator/make-iterator.d.ts.map +1 -1
  205. package/dist/iterators/make-iterator/make-iterator.js +36 -29
  206. package/dist/iterators/make-iterator/make-stream-iterator.d.ts +1 -1
  207. package/dist/iterators/make-iterator/make-stream-iterator.d.ts.map +1 -1
  208. package/dist/iterators/make-iterator/make-stream-iterator.js +89 -32
  209. package/dist/iterators/make-iterator/make-string-iterator.js +22 -12
  210. package/dist/iterators/make-stream/make-dom-stream.d.ts +1 -1
  211. package/dist/iterators/make-stream/make-dom-stream.d.ts.map +1 -1
  212. package/dist/iterators/make-stream/make-dom-stream.js +44 -32
  213. package/dist/iterators/make-stream/make-node-stream.d.ts +8 -3
  214. package/dist/iterators/make-stream/make-node-stream.d.ts.map +1 -1
  215. package/dist/iterators/make-stream/make-node-stream.js +75 -67
  216. package/dist/javascript-utils/is-type.d.ts +1 -1
  217. package/dist/javascript-utils/is-type.d.ts.map +1 -1
  218. package/dist/javascript-utils/is-type.js +41 -21
  219. package/dist/lib/api/encode-table.d.ts +6 -0
  220. package/dist/lib/api/encode-table.d.ts.map +1 -0
  221. package/dist/lib/api/encode-table.js +54 -0
  222. package/dist/lib/api/encode.d.ts +5 -5
  223. package/dist/lib/api/encode.d.ts.map +1 -1
  224. package/dist/lib/api/encode.js +111 -81
  225. package/dist/lib/api/load-in-batches.d.ts +1 -1
  226. package/dist/lib/api/load-in-batches.d.ts.map +1 -1
  227. package/dist/lib/api/load-in-batches.js +30 -27
  228. package/dist/lib/api/load.d.ts +3 -1
  229. package/dist/lib/api/load.d.ts.map +1 -1
  230. package/dist/lib/api/load.js +42 -24
  231. package/dist/lib/api/loader-options.d.ts +3 -0
  232. package/dist/lib/api/loader-options.d.ts.map +1 -0
  233. package/dist/lib/api/loader-options.js +7 -0
  234. package/dist/lib/api/parse-in-batches.js +113 -92
  235. package/dist/lib/api/parse-sync.js +56 -54
  236. package/dist/lib/api/parse.d.ts +4 -8
  237. package/dist/lib/api/parse.d.ts.map +1 -1
  238. package/dist/lib/api/parse.js +81 -61
  239. package/dist/lib/api/register-loaders.d.ts +1 -1
  240. package/dist/lib/api/register-loaders.d.ts.map +1 -1
  241. package/dist/lib/api/register-loaders.js +29 -23
  242. package/dist/lib/api/save.js +13 -9
  243. package/dist/lib/api/select-loader.d.ts.map +1 -1
  244. package/dist/lib/api/select-loader.js +216 -194
  245. package/dist/lib/common.js +2 -2
  246. package/dist/lib/fetch/fetch-error-message.js +21 -17
  247. package/dist/lib/fetch/fetch-file.js +25 -15
  248. package/dist/lib/fetch/read-array-buffer.js +39 -27
  249. package/dist/lib/fetch/read-file.js +28 -16
  250. package/dist/lib/fetch/write-file.js +20 -23
  251. package/dist/lib/filesystems/browser-filesystem.d.ts +1 -1
  252. package/dist/lib/filesystems/browser-filesystem.d.ts.map +1 -1
  253. package/dist/lib/filesystems/browser-filesystem.js +118 -107
  254. package/dist/lib/filesystems/filesystem.d.ts +2 -2
  255. package/dist/lib/filesystems/filesystem.d.ts.map +1 -1
  256. package/dist/lib/filesystems/filesystem.js +2 -2
  257. package/dist/lib/filesystems/read-array-buffer.js +28 -8
  258. package/dist/lib/init.d.ts.map +1 -1
  259. package/dist/lib/init.js +16 -6
  260. package/dist/lib/loader-utils/check-errors.js +26 -22
  261. package/dist/lib/loader-utils/get-data.js +122 -122
  262. package/dist/lib/loader-utils/get-fetch-function.d.ts +9 -0
  263. package/dist/lib/loader-utils/get-fetch-function.d.ts.map +1 -0
  264. package/dist/lib/loader-utils/get-fetch-function.js +31 -0
  265. package/dist/lib/loader-utils/loader-context.js +47 -34
  266. package/dist/lib/loader-utils/loggers.d.ts +2 -1
  267. package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
  268. package/dist/lib/loader-utils/loggers.js +39 -46
  269. package/dist/lib/loader-utils/normalize-loader.js +50 -41
  270. package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
  271. package/dist/lib/loader-utils/option-defaults.js +41 -35
  272. package/dist/lib/loader-utils/option-utils.d.ts +11 -13
  273. package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
  274. package/dist/lib/loader-utils/option-utils.js +140 -120
  275. package/dist/lib/progress/fetch-progress.js +54 -56
  276. package/dist/lib/utils/log.d.ts +3 -0
  277. package/dist/lib/utils/log.d.ts.map +1 -0
  278. package/dist/lib/utils/log.js +6 -0
  279. package/dist/lib/utils/mime-type-utils.js +38 -17
  280. package/dist/lib/utils/resource-utils.js +70 -52
  281. package/dist/lib/utils/response-utils.js +104 -105
  282. package/dist/null-loader.d.ts.map +1 -1
  283. package/dist/null-loader.js +53 -31
  284. package/dist/null-worker.js +61 -21
  285. package/dist/workers/null-worker.js +5 -4
  286. package/package.json +8 -8
  287. package/src/index.ts +19 -1
  288. package/src/iterators/make-stream/make-dom-stream.ts +1 -1
  289. package/src/iterators/make-stream/make-node-stream.ts +8 -2
  290. package/src/lib/api/encode-table.ts +71 -0
  291. package/src/lib/api/encode.ts +15 -5
  292. package/src/lib/api/load-in-batches.ts +1 -1
  293. package/src/lib/api/load.ts +39 -8
  294. package/src/lib/api/loader-options.ts +2 -0
  295. package/src/lib/api/parse.ts +39 -2
  296. package/src/lib/api/register-loaders.ts +1 -1
  297. package/src/lib/api/select-loader.ts +16 -0
  298. package/src/lib/init.ts +10 -3
  299. package/src/lib/loader-utils/get-fetch-function.ts +38 -0
  300. package/src/lib/loader-utils/loader-context.ts +1 -1
  301. package/src/lib/loader-utils/loggers.ts +1 -1
  302. package/src/lib/loader-utils/option-defaults.ts +3 -1
  303. package/src/lib/loader-utils/option-utils.ts +22 -46
  304. package/src/lib/progress/fetch-progress.ts +2 -2
  305. package/src/lib/utils/log.ts +4 -0
  306. package/src/lib/utils/response-utils.ts +2 -2
  307. package/src/null-loader.ts +17 -5
  308. package/dist/bundle.js.map +0 -1
  309. package/dist/core-addons/write-file-browser.js.map +0 -1
  310. package/dist/index.js.map +0 -1
  311. package/dist/iterators/batch-iterators/timed-batch-iterator.js.map +0 -1
  312. package/dist/iterators/make-iterator/make-array-buffer-iterator.js.map +0 -1
  313. package/dist/iterators/make-iterator/make-blob-iterator.js.map +0 -1
  314. package/dist/iterators/make-iterator/make-iterator.js.map +0 -1
  315. package/dist/iterators/make-iterator/make-stream-iterator.js.map +0 -1
  316. package/dist/iterators/make-iterator/make-string-iterator.js.map +0 -1
  317. package/dist/iterators/make-stream/make-dom-stream.js.map +0 -1
  318. package/dist/iterators/make-stream/make-node-stream.js.map +0 -1
  319. package/dist/javascript-utils/is-type.js.map +0 -1
  320. package/dist/lib/api/encode.js.map +0 -1
  321. package/dist/lib/api/load-in-batches.js.map +0 -1
  322. package/dist/lib/api/load.js.map +0 -1
  323. package/dist/lib/api/parse-in-batches.js.map +0 -1
  324. package/dist/lib/api/parse-sync.js.map +0 -1
  325. package/dist/lib/api/parse.js.map +0 -1
  326. package/dist/lib/api/register-loaders.js.map +0 -1
  327. package/dist/lib/api/save.js.map +0 -1
  328. package/dist/lib/api/select-loader.js.map +0 -1
  329. package/dist/lib/api/set-loader-options.d.ts +0 -6
  330. package/dist/lib/api/set-loader-options.d.ts.map +0 -1
  331. package/dist/lib/api/set-loader-options.js +0 -5
  332. package/dist/lib/api/set-loader-options.js.map +0 -1
  333. package/dist/lib/common.js.map +0 -1
  334. package/dist/lib/fetch/fetch-error-message.js.map +0 -1
  335. package/dist/lib/fetch/fetch-file.js.map +0 -1
  336. package/dist/lib/fetch/read-array-buffer.js.map +0 -1
  337. package/dist/lib/fetch/read-file.js.map +0 -1
  338. package/dist/lib/fetch/write-file.js.map +0 -1
  339. package/dist/lib/filesystems/browser-filesystem.js.map +0 -1
  340. package/dist/lib/filesystems/filesystem.js.map +0 -1
  341. package/dist/lib/filesystems/read-array-buffer.js.map +0 -1
  342. package/dist/lib/init.js.map +0 -1
  343. package/dist/lib/loader-utils/check-errors.js.map +0 -1
  344. package/dist/lib/loader-utils/get-data.js.map +0 -1
  345. package/dist/lib/loader-utils/loader-context.js.map +0 -1
  346. package/dist/lib/loader-utils/loggers.js.map +0 -1
  347. package/dist/lib/loader-utils/normalize-loader.js.map +0 -1
  348. package/dist/lib/loader-utils/option-defaults.js.map +0 -1
  349. package/dist/lib/loader-utils/option-utils.js.map +0 -1
  350. package/dist/lib/progress/fetch-progress.js.map +0 -1
  351. package/dist/lib/utils/mime-type-utils.js.map +0 -1
  352. package/dist/lib/utils/resource-utils.js.map +0 -1
  353. package/dist/lib/utils/response-utils.js.map +0 -1
  354. package/dist/null-loader.js.map +0 -1
  355. package/dist/workers/null-worker.js.map +0 -1
  356. package/src/lib/api/set-loader-options.ts +0 -9
  357. /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, module2, desc) => {
21
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
22
- for (let key of __getOwnPropNames(module2))
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: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
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 = (module2) => {
29
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
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.result = new Promise((resolve, reject) => {
123
- this._resolve = resolve;
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, onMessage2 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
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: onMessage2, onError, onStart });
402
+ this.jobQueue.push({ name, onMessage: onMessage3, onError, onStart });
350
403
  return this;
351
404
  });
352
405
  this._startQueuedJob();
@@ -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,6 +529,10 @@
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
538
  const workerFile = `${worker.id}-worker.js`;
@@ -496,11 +554,64 @@
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_version();
503
562
  NPM_TAG = "beta";
563
+ VERSION2 = typeof VERSION !== "undefined" ? VERSION : NPM_TAG;
564
+ }
565
+ });
566
+
567
+ // ../worker-utils/src/lib/worker-api/process-on-worker.ts
568
+ async function processOnWorker(worker, data, options = {}, context = {}) {
569
+ const name = getWorkerName(worker);
570
+ const workerFarm = WorkerFarm.getWorkerFarm(options);
571
+ const { source } = options;
572
+ const workerPoolProps = { name, source };
573
+ if (!source) {
574
+ workerPoolProps.url = getWorkerURL(worker, options);
575
+ }
576
+ const workerPool = workerFarm.getWorkerPool(workerPoolProps);
577
+ const jobName = options.jobName || worker.name;
578
+ const job = await workerPool.startJob(jobName, onMessage.bind(null, context));
579
+ const transferableOptions = getTransferListForWriter(options);
580
+ job.postMessage("process", { input: data, options: transferableOptions });
581
+ const result = await job.result;
582
+ return result.result;
583
+ }
584
+ async function onMessage(context, job, type, payload) {
585
+ switch (type) {
586
+ case "done":
587
+ job.done(payload);
588
+ break;
589
+ case "error":
590
+ job.error(new Error(payload.error));
591
+ break;
592
+ case "process":
593
+ const { id, input, options } = payload;
594
+ try {
595
+ if (!context.process) {
596
+ job.postMessage("error", { id, error: "Worker not set up to process on main thread" });
597
+ return;
598
+ }
599
+ const result = await context.process(input, options);
600
+ job.postMessage("done", { id, result });
601
+ } catch (error) {
602
+ const message = error instanceof Error ? error.message : "unknown error";
603
+ job.postMessage("error", { id, error: message });
604
+ }
605
+ break;
606
+ default:
607
+ console.warn(`process-on-worker: unknown message ${type}`);
608
+ }
609
+ }
610
+ var init_process_on_worker = __esm({
611
+ "../worker-utils/src/lib/worker-api/process-on-worker.ts"() {
612
+ init_worker_farm();
613
+ init_get_worker_url();
614
+ init_get_transfer_list();
504
615
  }
505
616
  });
506
617
 
@@ -524,7 +635,9 @@
524
635
  var init_src = __esm({
525
636
  "../worker-utils/src/index.ts"() {
526
637
  init_assert2();
638
+ init_globals2();
527
639
  init_worker_farm();
640
+ init_process_on_worker();
528
641
  init_get_worker_url();
529
642
  init_validate_worker_version();
530
643
  }
@@ -535,6 +648,9 @@
535
648
  if (!WorkerFarm.isSupported()) {
536
649
  return false;
537
650
  }
651
+ if (!isBrowser2 && !options?._nodeWorkers) {
652
+ return false;
653
+ }
538
654
  return loader.worker && options?.worker;
539
655
  }
540
656
  async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
@@ -543,15 +659,17 @@
543
659
  const workerFarm = WorkerFarm.getWorkerFarm(options);
544
660
  const workerPool = workerFarm.getWorkerPool({ name, url });
545
661
  options = JSON.parse(JSON.stringify(options));
546
- const job = await workerPool.startJob("process-on-worker", onMessage.bind(null, parseOnMainThread));
662
+ context = JSON.parse(JSON.stringify(context || {}));
663
+ const job = await workerPool.startJob("process-on-worker", onMessage2.bind(null, parseOnMainThread));
547
664
  job.postMessage("process", {
548
665
  input: data,
549
- options
666
+ options,
667
+ context
550
668
  });
551
669
  const result = await job.result;
552
670
  return await result.result;
553
671
  }
554
- async function onMessage(parseOnMainThread, job, type, payload) {
672
+ async function onMessage2(parseOnMainThread, job, type, payload) {
555
673
  switch (type) {
556
674
  case "done":
557
675
  job.done(payload);
@@ -576,59 +694,28 @@
576
694
  var init_parse_with_worker = __esm({
577
695
  "../loader-utils/src/lib/worker-loader-utils/parse-with-worker.ts"() {
578
696
  init_src();
697
+ init_src();
579
698
  }
580
699
  });
581
700
 
582
- // (disabled):../loader-utils/src/lib/node/buffer
583
- var init_buffer = __esm({
584
- "(disabled):../loader-utils/src/lib/node/buffer"() {
701
+ // ../loader-utils/src/lib/worker-loader-utils/encode-with-worker.ts
702
+ function canEncodeWithWorker(writer, options) {
703
+ if (!WorkerFarm.isSupported()) {
704
+ return false;
585
705
  }
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;
706
+ if (!isBrowser && !options?._nodeWorkers) {
707
+ return false;
599
708
  }
600
- return buffer;
709
+ return writer.worker && options?.worker;
601
710
  }
602
- var init_buffer_utils = __esm({
603
- "../loader-utils/src/lib/binary-utils/buffer-utils.ts"() {
604
- init_buffer();
711
+ var init_encode_with_worker = __esm({
712
+ "../loader-utils/src/lib/worker-loader-utils/encode-with-worker.ts"() {
713
+ init_src();
714
+ init_globals();
605
715
  }
606
716
  });
607
717
 
608
718
  // ../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
719
  function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {
633
720
  byteLength = byteLength || arrayBuffer1.byteLength;
634
721
  if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {
@@ -656,7 +743,6 @@
656
743
  }
657
744
  var init_array_buffer_utils = __esm({
658
745
  "../loader-utils/src/lib/binary-utils/array-buffer-utils.ts"() {
659
- init_buffer_utils();
660
746
  }
661
747
  });
662
748
 
@@ -727,8 +813,54 @@
727
813
  }
728
814
  });
729
815
 
816
+ // ../../node_modules/@babel/runtime/helpers/esm/typeof.js
817
+ function _typeof(obj) {
818
+ "@babel/helpers - typeof";
819
+ return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
820
+ return typeof obj2;
821
+ } : function(obj2) {
822
+ return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
823
+ }, _typeof(obj);
824
+ }
825
+ var init_typeof = __esm({
826
+ "../../node_modules/@babel/runtime/helpers/esm/typeof.js"() {
827
+ }
828
+ });
829
+
830
+ // ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
831
+ function _toPrimitive(input, hint) {
832
+ if (_typeof(input) !== "object" || input === null)
833
+ return input;
834
+ var prim = input[Symbol.toPrimitive];
835
+ if (prim !== void 0) {
836
+ var res = prim.call(input, hint || "default");
837
+ if (_typeof(res) !== "object")
838
+ return res;
839
+ throw new TypeError("@@toPrimitive must return a primitive value.");
840
+ }
841
+ return (hint === "string" ? String : Number)(input);
842
+ }
843
+ var init_toPrimitive = __esm({
844
+ "../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"() {
845
+ init_typeof();
846
+ }
847
+ });
848
+
849
+ // ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
850
+ function _toPropertyKey(arg) {
851
+ var key = _toPrimitive(arg, "string");
852
+ return _typeof(key) === "symbol" ? key : String(key);
853
+ }
854
+ var init_toPropertyKey = __esm({
855
+ "../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"() {
856
+ init_typeof();
857
+ init_toPrimitive();
858
+ }
859
+ });
860
+
730
861
  // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
731
862
  function _defineProperty(obj, key, value) {
863
+ key = _toPropertyKey(key);
732
864
  if (key in obj) {
733
865
  Object.defineProperty(obj, key, {
734
866
  value,
@@ -743,10 +875,11 @@
743
875
  }
744
876
  var init_defineProperty = __esm({
745
877
  "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"() {
878
+ init_toPropertyKey();
746
879
  }
747
880
  });
748
881
 
749
- // ../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
882
+ // ../../node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
750
883
  function getHiResTimestamp() {
751
884
  let timestamp;
752
885
  if (typeof window !== "undefined" && window.performance) {
@@ -760,14 +893,14 @@
760
893
  return timestamp;
761
894
  }
762
895
  var init_hi_res_timestamp = __esm({
763
- "../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
896
+ "../../node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
764
897
  }
765
898
  });
766
899
 
767
- // ../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js
900
+ // ../../node_modules/@probe.gl/stats/dist/lib/stat.js
768
901
  var Stat;
769
902
  var init_stat = __esm({
770
- "../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
903
+ "../../node_modules/@probe.gl/stats/dist/lib/stat.js"() {
771
904
  init_defineProperty();
772
905
  init_hi_res_timestamp();
773
906
  Stat = class {
@@ -775,12 +908,12 @@
775
908
  _defineProperty(this, "name", void 0);
776
909
  _defineProperty(this, "type", void 0);
777
910
  _defineProperty(this, "sampleSize", 1);
778
- _defineProperty(this, "time", void 0);
779
- _defineProperty(this, "count", void 0);
780
- _defineProperty(this, "samples", void 0);
781
- _defineProperty(this, "lastTiming", void 0);
782
- _defineProperty(this, "lastSampleTime", void 0);
783
- _defineProperty(this, "lastSampleCount", void 0);
911
+ _defineProperty(this, "time", 0);
912
+ _defineProperty(this, "count", 0);
913
+ _defineProperty(this, "samples", 0);
914
+ _defineProperty(this, "lastTiming", 0);
915
+ _defineProperty(this, "lastSampleTime", 0);
916
+ _defineProperty(this, "lastSampleCount", 0);
784
917
  _defineProperty(this, "_count", 0);
785
918
  _defineProperty(this, "_time", 0);
786
919
  _defineProperty(this, "_samples", 0);
@@ -790,6 +923,20 @@
790
923
  this.type = type;
791
924
  this.reset();
792
925
  }
926
+ reset() {
927
+ this.time = 0;
928
+ this.count = 0;
929
+ this.samples = 0;
930
+ this.lastTiming = 0;
931
+ this.lastSampleTime = 0;
932
+ this.lastSampleCount = 0;
933
+ this._count = 0;
934
+ this._time = 0;
935
+ this._samples = 0;
936
+ this._startTime = 0;
937
+ this._timerPending = false;
938
+ return this;
939
+ }
793
940
  setSampleSize(samples) {
794
941
  this.sampleSize = samples;
795
942
  return this;
@@ -853,20 +1000,6 @@
853
1000
  getHz() {
854
1001
  return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
855
1002
  }
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
1003
  _checkSampling() {
871
1004
  if (this._samples === this.sampleSize) {
872
1005
  this.lastSampleTime = this._time;
@@ -883,10 +1016,10 @@
883
1016
  }
884
1017
  });
885
1018
 
886
- // ../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js
1019
+ // ../../node_modules/@probe.gl/stats/dist/lib/stats.js
887
1020
  var Stats;
888
1021
  var init_stats = __esm({
889
- "../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
1022
+ "../../node_modules/@probe.gl/stats/dist/lib/stats.js"() {
890
1023
  init_defineProperty();
891
1024
  init_stat();
892
1025
  Stats = class {
@@ -909,56 +1042,55 @@
909
1042
  return Object.keys(this.stats).length;
910
1043
  }
911
1044
  reset() {
912
- for (const key in this.stats) {
913
- this.stats[key].reset();
1045
+ for (const stat2 of Object.values(this.stats)) {
1046
+ stat2.reset();
914
1047
  }
915
1048
  return this;
916
1049
  }
917
1050
  forEach(fn) {
918
- for (const key in this.stats) {
919
- fn(this.stats[key]);
1051
+ for (const stat2 of Object.values(this.stats)) {
1052
+ fn(stat2);
920
1053
  }
921
1054
  }
922
1055
  getTable() {
923
1056
  const table = {};
924
- this.forEach((stat) => {
925
- table[stat.name] = {
926
- time: stat.time || 0,
927
- count: stat.count || 0,
928
- average: stat.getAverageTime() || 0,
929
- hz: stat.getHz() || 0
1057
+ this.forEach((stat2) => {
1058
+ table[stat2.name] = {
1059
+ time: stat2.time || 0,
1060
+ count: stat2.count || 0,
1061
+ average: stat2.getAverageTime() || 0,
1062
+ hz: stat2.getHz() || 0
930
1063
  };
931
1064
  });
932
1065
  return table;
933
1066
  }
934
1067
  _initializeStats() {
935
1068
  let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
936
- stats.forEach((stat) => this._getOrCreate(stat));
1069
+ stats.forEach((stat2) => this._getOrCreate(stat2));
937
1070
  }
938
- _getOrCreate(stat) {
939
- if (!stat || !stat.name) {
940
- return null;
941
- }
1071
+ _getOrCreate(stat2) {
942
1072
  const {
943
1073
  name,
944
1074
  type
945
- } = stat;
946
- if (!this.stats[name]) {
947
- if (stat instanceof Stat) {
948
- this.stats[name] = stat;
1075
+ } = stat2;
1076
+ let result = this.stats[name];
1077
+ if (!result) {
1078
+ if (stat2 instanceof Stat) {
1079
+ result = stat2;
949
1080
  } else {
950
- this.stats[name] = new Stat(name, type);
1081
+ result = new Stat(name, type);
951
1082
  }
1083
+ this.stats[name] = result;
952
1084
  }
953
- return this.stats[name];
1085
+ return result;
954
1086
  }
955
1087
  };
956
1088
  }
957
1089
  });
958
1090
 
959
- // ../../node_modules/@probe.gl/stats/dist/esm/index.js
960
- var init_esm = __esm({
961
- "../../node_modules/@probe.gl/stats/dist/esm/index.js"() {
1091
+ // ../../node_modules/@probe.gl/stats/dist/index.js
1092
+ var init_dist = __esm({
1093
+ "../../node_modules/@probe.gl/stats/dist/index.js"() {
962
1094
  init_stats();
963
1095
  init_stat();
964
1096
  init_hi_res_timestamp();
@@ -969,7 +1101,7 @@
969
1101
  var STAT_QUEUED_REQUESTS, STAT_ACTIVE_REQUESTS, STAT_CANCELLED_REQUESTS, STAT_QUEUED_REQUESTS_EVER, STAT_ACTIVE_REQUESTS_EVER, DEFAULT_PROPS2, RequestScheduler;
970
1102
  var init_request_scheduler = __esm({
971
1103
  "../loader-utils/src/lib/request-utils/request-scheduler.ts"() {
972
- init_esm();
1104
+ init_dist();
973
1105
  STAT_QUEUED_REQUESTS = "Queued Requests";
974
1106
  STAT_ACTIVE_REQUESTS = "Active Requests";
975
1107
  STAT_CANCELLED_REQUESTS = "Cancelled Requests";
@@ -1003,8 +1135,8 @@
1003
1135
  return this.requestMap.get(handle);
1004
1136
  }
1005
1137
  const request = { handle, priority: 0, getPriority };
1006
- const promise = new Promise((resolve) => {
1007
- request.resolve = resolve;
1138
+ const promise = new Promise((resolve2) => {
1139
+ request.resolve = resolve2;
1008
1140
  return request;
1009
1141
  });
1010
1142
  this.requestQueue.push(request);
@@ -1013,7 +1145,7 @@
1013
1145
  return promise;
1014
1146
  }
1015
1147
  _issueRequest(request) {
1016
- const { handle, resolve } = request;
1148
+ const { handle, resolve: resolve2 } = request;
1017
1149
  let isDone = false;
1018
1150
  const done = () => {
1019
1151
  if (!isDone) {
@@ -1024,7 +1156,7 @@
1024
1156
  }
1025
1157
  };
1026
1158
  this.activeRequestCount++;
1027
- return resolve ? resolve({ done }) : Promise.resolve({ done });
1159
+ return resolve2 ? resolve2({ done }) : Promise.resolve({ done });
1028
1160
  }
1029
1161
  _issueNewRequests() {
1030
1162
  if (!this.deferredUpdate) {
@@ -1100,15 +1232,15 @@
1100
1232
  function parseTextSync(text) {
1101
1233
  return JSON.parse(text);
1102
1234
  }
1103
- var VERSION2, JSONLoader;
1235
+ var VERSION3, JSONLoader;
1104
1236
  var init_json_loader = __esm({
1105
1237
  "../loader-utils/src/json-loader.ts"() {
1106
- VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1238
+ VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1107
1239
  JSONLoader = {
1108
1240
  name: "JSON",
1109
1241
  id: "json",
1110
1242
  module: "json",
1111
- version: VERSION2,
1243
+ version: VERSION3,
1112
1244
  extensions: ["json", "geojson"],
1113
1245
  mimeTypes: ["application/json"],
1114
1246
  category: "json",
@@ -1120,19 +1252,93 @@
1120
1252
  }
1121
1253
  });
1122
1254
 
1255
+ // ../loader-utils/src/lib/node/buffer.browser.ts
1256
+ function toArrayBuffer(buffer) {
1257
+ return buffer;
1258
+ }
1259
+ function toBuffer(binaryData) {
1260
+ throw new Error("Buffer not supported in browser");
1261
+ }
1262
+ var init_buffer_browser = __esm({
1263
+ "../loader-utils/src/lib/node/buffer.browser.ts"() {
1264
+ }
1265
+ });
1266
+
1267
+ // ../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts
1268
+ function isBuffer(value) {
1269
+ return value && typeof value === "object" && value.isBuffer;
1270
+ }
1271
+ function toBuffer2(data) {
1272
+ return toBuffer ? toBuffer(data) : data;
1273
+ }
1274
+ function toArrayBuffer2(data) {
1275
+ if (isBuffer(data)) {
1276
+ return toArrayBuffer(data);
1277
+ }
1278
+ if (data instanceof ArrayBuffer) {
1279
+ return data;
1280
+ }
1281
+ if (ArrayBuffer.isView(data)) {
1282
+ if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
1283
+ return data.buffer;
1284
+ }
1285
+ return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
1286
+ }
1287
+ if (typeof data === "string") {
1288
+ const text = data;
1289
+ const uint8Array = new TextEncoder().encode(text);
1290
+ return uint8Array.buffer;
1291
+ }
1292
+ if (data && typeof data === "object" && data._toArrayBuffer) {
1293
+ return data._toArrayBuffer();
1294
+ }
1295
+ throw new Error("toArrayBuffer");
1296
+ }
1297
+ var init_memory_conversion_utils = __esm({
1298
+ "../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts"() {
1299
+ init_buffer_browser();
1300
+ }
1301
+ });
1302
+
1303
+ // ../loader-utils/src/lib/node/promisify.ts
1304
+ function promisify2(fn) {
1305
+ return (arg1, arg2) => new Promise((resolve2, reject) => fn(arg1, arg2, (error, callbackArgs) => error ? reject(error) : resolve2(callbackArgs)));
1306
+ }
1307
+ function promisify3(fn) {
1308
+ return (arg1, arg2, arg3) => new Promise((resolve2, reject) => fn(arg1, arg2, arg3, (error, callbackArgs) => error ? reject(error) : resolve2(callbackArgs)));
1309
+ }
1310
+ var init_promisify = __esm({
1311
+ "../loader-utils/src/lib/node/promisify.ts"() {
1312
+ }
1313
+ });
1314
+
1315
+ // ../loader-utils/src/lib/path-utils/get-cwd.ts
1316
+ function getCWD() {
1317
+ if (typeof process !== "undefined" && typeof process.cwd !== "undefined") {
1318
+ return process.cwd();
1319
+ }
1320
+ const pathname = window.location?.pathname;
1321
+ return pathname?.slice(0, pathname.lastIndexOf("/") + 1) || "";
1322
+ }
1323
+ var init_get_cwd = __esm({
1324
+ "../loader-utils/src/lib/path-utils/get-cwd.ts"() {
1325
+ }
1326
+ });
1327
+
1123
1328
  // ../loader-utils/src/lib/path-utils/path.ts
1124
1329
  var path_exports = {};
1125
1330
  __export(path_exports, {
1126
1331
  dirname: () => dirname,
1127
1332
  filename: () => filename,
1128
- join: () => join
1333
+ join: () => join,
1334
+ resolve: () => resolve
1129
1335
  });
1130
1336
  function filename(url) {
1131
- const slashIndex = url && url.lastIndexOf("/");
1337
+ const slashIndex = url ? url.lastIndexOf("/") : -1;
1132
1338
  return slashIndex >= 0 ? url.substr(slashIndex + 1) : "";
1133
1339
  }
1134
1340
  function dirname(url) {
1135
- const slashIndex = url && url.lastIndexOf("/");
1341
+ const slashIndex = url ? url.lastIndexOf("/") : -1;
1136
1342
  return slashIndex >= 0 ? url.substr(0, slashIndex) : "";
1137
1343
  }
1138
1344
  function join(...parts) {
@@ -1148,33 +1354,187 @@
1148
1354
  });
1149
1355
  return parts.join(separator);
1150
1356
  }
1357
+ function resolve(...components) {
1358
+ const paths = [];
1359
+ for (let _i = 0; _i < components.length; _i++) {
1360
+ paths[_i] = components[_i];
1361
+ }
1362
+ let resolvedPath = "";
1363
+ let resolvedAbsolute = false;
1364
+ let cwd;
1365
+ for (let i = paths.length - 1; i >= -1 && !resolvedAbsolute; i--) {
1366
+ let path;
1367
+ if (i >= 0) {
1368
+ path = paths[i];
1369
+ } else {
1370
+ if (cwd === void 0) {
1371
+ cwd = getCWD();
1372
+ }
1373
+ path = cwd;
1374
+ }
1375
+ if (path.length === 0) {
1376
+ continue;
1377
+ }
1378
+ resolvedPath = `${path}/${resolvedPath}`;
1379
+ resolvedAbsolute = path.charCodeAt(0) === SLASH;
1380
+ }
1381
+ resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
1382
+ if (resolvedAbsolute) {
1383
+ return `/${resolvedPath}`;
1384
+ } else if (resolvedPath.length > 0) {
1385
+ return resolvedPath;
1386
+ }
1387
+ return ".";
1388
+ }
1389
+ function normalizeStringPosix(path, allowAboveRoot) {
1390
+ let res = "";
1391
+ let lastSlash = -1;
1392
+ let dots = 0;
1393
+ let code;
1394
+ let isAboveRoot = false;
1395
+ for (let i = 0; i <= path.length; ++i) {
1396
+ if (i < path.length) {
1397
+ code = path.charCodeAt(i);
1398
+ } else if (code === SLASH) {
1399
+ break;
1400
+ } else {
1401
+ code = SLASH;
1402
+ }
1403
+ if (code === SLASH) {
1404
+ if (lastSlash === i - 1 || dots === 1) {
1405
+ } else if (lastSlash !== i - 1 && dots === 2) {
1406
+ if (res.length < 2 || !isAboveRoot || res.charCodeAt(res.length - 1) !== DOT || res.charCodeAt(res.length - 2) !== DOT) {
1407
+ if (res.length > 2) {
1408
+ const start = res.length - 1;
1409
+ let j = start;
1410
+ for (; j >= 0; --j) {
1411
+ if (res.charCodeAt(j) === SLASH) {
1412
+ break;
1413
+ }
1414
+ }
1415
+ if (j !== start) {
1416
+ res = j === -1 ? "" : res.slice(0, j);
1417
+ lastSlash = i;
1418
+ dots = 0;
1419
+ isAboveRoot = false;
1420
+ continue;
1421
+ }
1422
+ } else if (res.length === 2 || res.length === 1) {
1423
+ res = "";
1424
+ lastSlash = i;
1425
+ dots = 0;
1426
+ isAboveRoot = false;
1427
+ continue;
1428
+ }
1429
+ }
1430
+ if (allowAboveRoot) {
1431
+ if (res.length > 0) {
1432
+ res += "/..";
1433
+ } else {
1434
+ res = "..";
1435
+ }
1436
+ isAboveRoot = true;
1437
+ }
1438
+ } else {
1439
+ const slice = path.slice(lastSlash + 1, i);
1440
+ if (res.length > 0) {
1441
+ res += `/${slice}`;
1442
+ } else {
1443
+ res = slice;
1444
+ }
1445
+ isAboveRoot = false;
1446
+ }
1447
+ lastSlash = i;
1448
+ dots = 0;
1449
+ } else if (code === DOT && dots !== -1) {
1450
+ ++dots;
1451
+ } else {
1452
+ dots = -1;
1453
+ }
1454
+ }
1455
+ return res;
1456
+ }
1457
+ var SLASH, DOT;
1151
1458
  var init_path = __esm({
1152
1459
  "../loader-utils/src/lib/path-utils/path.ts"() {
1460
+ init_get_cwd();
1461
+ SLASH = 47;
1462
+ DOT = 46;
1153
1463
  }
1154
1464
  });
1155
1465
 
1156
- // (disabled):../loader-utils/src/lib/node/fs
1466
+ // (disabled):fs
1157
1467
  var require_fs = __commonJS({
1158
- "(disabled):../loader-utils/src/lib/node/fs"() {
1468
+ "(disabled):fs"() {
1469
+ }
1470
+ });
1471
+
1472
+ // ../loader-utils/src/lib/node/fs.ts
1473
+ var fs_exports = {};
1474
+ __export(fs_exports, {
1475
+ _readToArrayBuffer: () => _readToArrayBuffer,
1476
+ close: () => close,
1477
+ createWriteStream: () => createWriteStream,
1478
+ fstat: () => fstat,
1479
+ isSupported: () => isSupported,
1480
+ open: () => open,
1481
+ read: () => read,
1482
+ readFile: () => readFile,
1483
+ readFileSync: () => readFileSync,
1484
+ readdir: () => readdir,
1485
+ stat: () => stat,
1486
+ writeFile: () => writeFile,
1487
+ writeFileSync: () => writeFileSync
1488
+ });
1489
+ async function _readToArrayBuffer(fd, start, length) {
1490
+ const buffer = Buffer.alloc(length);
1491
+ const { bytesRead } = await read(fd, buffer, 0, length, start);
1492
+ if (bytesRead !== length) {
1493
+ throw new Error("fs.read failed");
1494
+ }
1495
+ return toArrayBuffer(buffer);
1496
+ }
1497
+ var import_fs, readdir, stat, readFile, readFileSync, writeFile, writeFileSync, open, close, read, fstat, createWriteStream, isSupported;
1498
+ var init_fs = __esm({
1499
+ "../loader-utils/src/lib/node/fs.ts"() {
1500
+ import_fs = __toModule(require_fs());
1501
+ init_buffer_browser();
1502
+ init_promisify();
1503
+ isSupported = Boolean(import_fs.default);
1504
+ try {
1505
+ readdir = promisify2(import_fs.default.readdir);
1506
+ stat = promisify2(import_fs.default.stat);
1507
+ readFile = import_fs.default.readFile;
1508
+ readFileSync = import_fs.default.readFileSync;
1509
+ writeFile = promisify3(import_fs.default.writeFile);
1510
+ writeFileSync = import_fs.default.writeFileSync;
1511
+ open = import_fs.default.open;
1512
+ close = (fd) => new Promise((resolve2, reject) => import_fs.default.close(fd, (err) => err ? reject(err) : resolve2()));
1513
+ read = import_fs.default.read;
1514
+ fstat = import_fs.default.fstat;
1515
+ createWriteStream = import_fs.default.createWriteStream;
1516
+ isSupported = Boolean(import_fs.default);
1517
+ } catch {
1518
+ }
1159
1519
  }
1160
1520
  });
1161
1521
 
1162
1522
  // ../loader-utils/src/index.ts
1163
- var fs;
1164
1523
  var init_src2 = __esm({
1165
1524
  "../loader-utils/src/index.ts"() {
1166
1525
  init_assert();
1167
1526
  init_globals();
1168
1527
  init_parse_with_worker();
1528
+ init_encode_with_worker();
1169
1529
  init_array_buffer_utils();
1170
1530
  init_text_iterators();
1171
1531
  init_async_iteration();
1172
1532
  init_request_scheduler();
1173
1533
  init_file_aliases();
1174
1534
  init_json_loader();
1535
+ init_memory_conversion_utils();
1175
1536
  init_path();
1176
- init_buffer_utils();
1177
- fs = __toModule(require_fs());
1537
+ init_fs();
1178
1538
  }
1179
1539
  });
1180
1540
 
@@ -1322,7 +1682,7 @@
1322
1682
  text += ` ${await response.text()}`;
1323
1683
  }
1324
1684
  message += text;
1325
- message = message.length > 60 ? `${message.slice(60)}...` : message;
1685
+ message = message.length > 60 ? `${message.slice(0, 60)}...` : message;
1326
1686
  } catch (error) {
1327
1687
  }
1328
1688
  return message;
@@ -1334,9 +1694,9 @@
1334
1694
  }
1335
1695
  if (resource instanceof Blob) {
1336
1696
  const blobSlice = resource.slice(0, 5);
1337
- return await new Promise((resolve) => {
1697
+ return await new Promise((resolve2) => {
1338
1698
  const reader = new FileReader();
1339
- reader.onload = (event) => resolve(event?.target?.result);
1699
+ reader.onload = (event) => resolve2(event?.target?.result);
1340
1700
  reader.readAsDataURL(blobSlice);
1341
1701
  });
1342
1702
  }
@@ -1384,7 +1744,7 @@
1384
1744
  // src/lib/fetch/read-array-buffer.ts
1385
1745
  async function readArrayBuffer(file, start, length) {
1386
1746
  if (typeof file === "number") {
1387
- return await fs._readToArrayBuffer(file, start, length);
1747
+ return await fs_exports._readToArrayBuffer(file, start, length);
1388
1748
  }
1389
1749
  if (!(file instanceof Blob)) {
1390
1750
  file = new Blob([file]);
@@ -1393,9 +1753,9 @@
1393
1753
  return await readBlob(slice);
1394
1754
  }
1395
1755
  async function readBlob(blob) {
1396
- return await new Promise((resolve, reject) => {
1756
+ return await new Promise((resolve2, reject) => {
1397
1757
  const fileReader = new FileReader();
1398
- fileReader.onload = (event) => resolve(event?.target?.result);
1758
+ fileReader.onload = (event) => resolve2(event?.target?.result);
1399
1759
  fileReader.onerror = (error) => reject(error);
1400
1760
  fileReader.readAsArrayBuffer(blob);
1401
1761
  });
@@ -1407,11 +1767,11 @@
1407
1767
  });
1408
1768
 
1409
1769
  // src/lib/fetch/read-file.ts
1410
- function readFileSync(url, options = {}) {
1770
+ function readFileSync2(url, options = {}) {
1411
1771
  url = resolvePath(url);
1412
1772
  if (!isBrowser) {
1413
- const buffer = fs.readFileSync(url, options);
1414
- return typeof buffer !== "string" ? toArrayBuffer(buffer) : buffer;
1773
+ const buffer = fs_exports.readFileSync(url, options);
1774
+ return typeof buffer !== "string" ? toArrayBuffer2(buffer) : buffer;
1415
1775
  }
1416
1776
  if (!options.nothrow) {
1417
1777
  assert(false);
@@ -1426,17 +1786,17 @@
1426
1786
  });
1427
1787
 
1428
1788
  // src/lib/fetch/write-file.ts
1429
- async function writeFile(filePath, arrayBufferOrString, options) {
1789
+ async function writeFile2(filePath, arrayBufferOrString, options) {
1430
1790
  filePath = resolvePath(filePath);
1431
1791
  if (!isBrowser) {
1432
- await fs.writeFile(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
1792
+ await fs_exports.writeFile(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
1433
1793
  }
1434
1794
  assert(false);
1435
1795
  }
1436
- function writeFileSync(filePath, arrayBufferOrString, options) {
1796
+ function writeFileSync2(filePath, arrayBufferOrString, options) {
1437
1797
  filePath = resolvePath(filePath);
1438
1798
  if (!isBrowser) {
1439
- fs.writeFileSync(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
1799
+ fs_exports.writeFileSync(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
1440
1800
  }
1441
1801
  assert(false);
1442
1802
  }
@@ -1447,12 +1807,12 @@
1447
1807
  }
1448
1808
  });
1449
1809
 
1450
- // ../../node_modules/probe.gl/dist/esm/env/is-electron.js
1810
+ // ../../node_modules/@probe.gl/env/dist/lib/is-electron.js
1451
1811
  function isElectron(mockUserAgent) {
1452
1812
  if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
1453
1813
  return true;
1454
1814
  }
1455
- if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
1815
+ if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
1456
1816
  return true;
1457
1817
  }
1458
1818
  const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
@@ -1463,52 +1823,54 @@
1463
1823
  return false;
1464
1824
  }
1465
1825
  var init_is_electron = __esm({
1466
- "../../node_modules/probe.gl/dist/esm/env/is-electron.js"() {
1826
+ "../../node_modules/@probe.gl/env/dist/lib/is-electron.js"() {
1467
1827
  }
1468
1828
  });
1469
1829
 
1470
- // ../../node_modules/probe.gl/dist/esm/env/is-browser.js
1830
+ // ../../node_modules/@probe.gl/env/dist/lib/is-browser.js
1471
1831
  function isBrowser3() {
1472
1832
  const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
1473
1833
  return !isNode || isElectron();
1474
1834
  }
1475
1835
  var init_is_browser = __esm({
1476
- "../../node_modules/probe.gl/dist/esm/env/is-browser.js"() {
1836
+ "../../node_modules/@probe.gl/env/dist/lib/is-browser.js"() {
1477
1837
  init_is_electron();
1478
1838
  }
1479
1839
  });
1480
1840
 
1481
- // ../../node_modules/probe.gl/dist/esm/env/globals.js
1482
- var globals3, self_3, window_3, global_3, document_3, process_;
1841
+ // ../../node_modules/@probe.gl/env/dist/lib/globals.js
1842
+ var self_3, window_3, document_3, process_, console_, navigator_;
1483
1843
  var init_globals3 = __esm({
1484
- "../../node_modules/probe.gl/dist/esm/env/globals.js"() {
1485
- globals3 = {
1486
- self: typeof self !== "undefined" && self,
1487
- window: typeof window !== "undefined" && window,
1488
- global: typeof global !== "undefined" && global,
1489
- document: typeof document !== "undefined" && document,
1490
- process: typeof process === "object" && process
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 || {};
1844
+ "../../node_modules/@probe.gl/env/dist/lib/globals.js"() {
1845
+ self_3 = globalThis.self || globalThis.window || globalThis.global;
1846
+ window_3 = globalThis.window || globalThis.self || globalThis.global;
1847
+ document_3 = globalThis.document || {};
1848
+ process_ = globalThis.process || {};
1849
+ console_ = globalThis.console;
1850
+ navigator_ = globalThis.navigator || {};
1497
1851
  }
1498
1852
  });
1499
1853
 
1500
- // ../../node_modules/probe.gl/dist/esm/utils/globals.js
1501
- var VERSION3, isBrowser4;
1854
+ // ../../node_modules/@probe.gl/env/dist/utils/globals.js
1855
+ var VERSION4, isBrowser4;
1502
1856
  var init_globals4 = __esm({
1503
- "../../node_modules/probe.gl/dist/esm/utils/globals.js"() {
1857
+ "../../node_modules/@probe.gl/env/dist/utils/globals.js"() {
1504
1858
  init_is_browser();
1505
- init_globals3();
1506
- VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
1859
+ VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
1507
1860
  isBrowser4 = isBrowser3();
1508
1861
  }
1509
1862
  });
1510
1863
 
1511
- // ../../node_modules/probe.gl/dist/esm/utils/local-storage.js
1864
+ // ../../node_modules/@probe.gl/env/dist/index.js
1865
+ var init_dist2 = __esm({
1866
+ "../../node_modules/@probe.gl/env/dist/index.js"() {
1867
+ init_globals4();
1868
+ init_globals3();
1869
+ init_is_browser();
1870
+ }
1871
+ });
1872
+
1873
+ // ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
1512
1874
  function getStorage(type) {
1513
1875
  try {
1514
1876
  const storage = window[type];
@@ -1522,29 +1884,28 @@
1522
1884
  }
1523
1885
  var LocalStorage;
1524
1886
  var init_local_storage = __esm({
1525
- "../../node_modules/probe.gl/dist/esm/utils/local-storage.js"() {
1887
+ "../../node_modules/@probe.gl/log/dist/utils/local-storage.js"() {
1888
+ init_defineProperty();
1526
1889
  LocalStorage = class {
1527
- constructor(id, defaultSettings, type = "sessionStorage") {
1890
+ constructor(id, defaultConfig) {
1891
+ let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
1892
+ _defineProperty(this, "storage", void 0);
1893
+ _defineProperty(this, "id", void 0);
1894
+ _defineProperty(this, "config", void 0);
1528
1895
  this.storage = getStorage(type);
1529
1896
  this.id = id;
1530
- this.config = {};
1531
- Object.assign(this.config, defaultSettings);
1897
+ this.config = defaultConfig;
1532
1898
  this._loadConfiguration();
1533
1899
  }
1534
1900
  getConfiguration() {
1535
1901
  return this.config;
1536
1902
  }
1537
1903
  setConfiguration(configuration) {
1538
- this.config = {};
1539
- return this.updateConfiguration(configuration);
1540
- }
1541
- updateConfiguration(configuration) {
1542
1904
  Object.assign(this.config, configuration);
1543
1905
  if (this.storage) {
1544
1906
  const serialized = JSON.stringify(this.config);
1545
1907
  this.storage.setItem(this.id, serialized);
1546
1908
  }
1547
- return this;
1548
1909
  }
1549
1910
  _loadConfiguration() {
1550
1911
  let configuration = {};
@@ -1559,7 +1920,7 @@
1559
1920
  }
1560
1921
  });
1561
1922
 
1562
- // ../../node_modules/probe.gl/dist/esm/utils/formatters.js
1923
+ // ../../node_modules/@probe.gl/log/dist/utils/formatters.js
1563
1924
  function formatTime(ms) {
1564
1925
  let formatted;
1565
1926
  if (ms < 10) {
@@ -1573,11 +1934,13 @@
1573
1934
  }
1574
1935
  return formatted;
1575
1936
  }
1576
- function leftPad(string, length = 8) {
1937
+ function leftPad(string) {
1938
+ let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
1577
1939
  const padLength = Math.max(length - string.length, 0);
1578
1940
  return "".concat(" ".repeat(padLength)).concat(string);
1579
1941
  }
1580
- function formatImage(image, message, scale, maxWidth = 600) {
1942
+ function formatImage(image, message, scale) {
1943
+ let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
1581
1944
  const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
1582
1945
  if (image.width > maxWidth) {
1583
1946
  scale = Math.min(scale, maxWidth / image.width);
@@ -1588,87 +1951,97 @@
1588
1951
  return ["".concat(message, " %c+"), style];
1589
1952
  }
1590
1953
  var init_formatters = __esm({
1591
- "../../node_modules/probe.gl/dist/esm/utils/formatters.js"() {
1954
+ "../../node_modules/@probe.gl/log/dist/utils/formatters.js"() {
1592
1955
  }
1593
1956
  });
1594
1957
 
1595
- // ../../node_modules/probe.gl/dist/esm/utils/color.js
1958
+ // ../../node_modules/@probe.gl/log/dist/utils/color.js
1596
1959
  function getColor(color) {
1597
- return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
1960
+ if (typeof color !== "string") {
1961
+ return color;
1962
+ }
1963
+ color = color.toUpperCase();
1964
+ return COLOR[color] || COLOR.WHITE;
1598
1965
  }
1599
1966
  function addColor(string, color, background) {
1600
- if (!isBrowser4 && typeof string === "string") {
1967
+ if (!isBrowser3 && typeof string === "string") {
1601
1968
  if (color) {
1602
- color = getColor(color);
1603
- string = "[".concat(color, "m").concat(string, "");
1969
+ const colorCode = getColor(color);
1970
+ string = "[".concat(colorCode, "m").concat(string, "");
1604
1971
  }
1605
1972
  if (background) {
1606
- color = getColor(background);
1607
- string = "[".concat(background + 10, "m").concat(string, "");
1973
+ const colorCode = getColor(background);
1974
+ string = "[".concat(colorCode + BACKGROUND_INCREMENT, "m").concat(string, "");
1608
1975
  }
1609
1976
  }
1610
1977
  return string;
1611
1978
  }
1612
- var COLOR;
1979
+ var COLOR, BACKGROUND_INCREMENT;
1613
1980
  var init_color = __esm({
1614
- "../../node_modules/probe.gl/dist/esm/utils/color.js"() {
1615
- init_globals4();
1616
- COLOR = {
1617
- BLACK: 30,
1618
- RED: 31,
1619
- GREEN: 32,
1620
- YELLOW: 33,
1621
- BLUE: 34,
1622
- MAGENTA: 35,
1623
- CYAN: 36,
1624
- WHITE: 37,
1625
- BRIGHT_BLACK: 90,
1626
- BRIGHT_RED: 91,
1627
- BRIGHT_GREEN: 92,
1628
- BRIGHT_YELLOW: 93,
1629
- BRIGHT_BLUE: 94,
1630
- BRIGHT_MAGENTA: 95,
1631
- BRIGHT_CYAN: 96,
1632
- BRIGHT_WHITE: 97
1633
- };
1634
- }
1635
- });
1636
-
1637
- // ../../node_modules/probe.gl/dist/esm/utils/autobind.js
1638
- function autobind(obj, predefined = ["constructor"]) {
1981
+ "../../node_modules/@probe.gl/log/dist/utils/color.js"() {
1982
+ init_dist2();
1983
+ (function(COLOR2) {
1984
+ COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
1985
+ COLOR2[COLOR2["RED"] = 31] = "RED";
1986
+ COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
1987
+ COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
1988
+ COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
1989
+ COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
1990
+ COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
1991
+ COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
1992
+ COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
1993
+ COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
1994
+ COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
1995
+ COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
1996
+ COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
1997
+ COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
1998
+ COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
1999
+ COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
2000
+ })(COLOR || (COLOR = {}));
2001
+ BACKGROUND_INCREMENT = 10;
2002
+ }
2003
+ });
2004
+
2005
+ // ../../node_modules/@probe.gl/log/dist/utils/autobind.js
2006
+ function autobind(obj) {
2007
+ let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
1639
2008
  const proto = Object.getPrototypeOf(obj);
1640
2009
  const propNames = Object.getOwnPropertyNames(proto);
2010
+ const object = obj;
1641
2011
  for (const key of propNames) {
1642
- if (typeof obj[key] === "function") {
2012
+ const value = object[key];
2013
+ if (typeof value === "function") {
1643
2014
  if (!predefined.find((name) => key === name)) {
1644
- obj[key] = obj[key].bind(obj);
2015
+ object[key] = value.bind(obj);
1645
2016
  }
1646
2017
  }
1647
2018
  }
1648
2019
  }
1649
2020
  var init_autobind = __esm({
1650
- "../../node_modules/probe.gl/dist/esm/utils/autobind.js"() {
2021
+ "../../node_modules/@probe.gl/log/dist/utils/autobind.js"() {
1651
2022
  }
1652
2023
  });
1653
2024
 
1654
- // ../../node_modules/probe.gl/dist/esm/utils/assert.js
2025
+ // ../../node_modules/@probe.gl/log/dist/utils/assert.js
1655
2026
  function assert3(condition, message) {
1656
2027
  if (!condition) {
1657
2028
  throw new Error(message || "Assertion failed");
1658
2029
  }
1659
2030
  }
1660
2031
  var init_assert3 = __esm({
1661
- "../../node_modules/probe.gl/dist/esm/utils/assert.js"() {
2032
+ "../../node_modules/@probe.gl/log/dist/utils/assert.js"() {
1662
2033
  }
1663
2034
  });
1664
2035
 
1665
- // ../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js
2036
+ // ../../node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
1666
2037
  function getHiResTimestamp2() {
1667
2038
  let timestamp;
1668
- if (isBrowser4 && window_3.performance) {
1669
- timestamp = window_3.performance.now();
1670
- } else if (process_.hrtime) {
1671
- const timeParts = process_.hrtime();
2039
+ if (isBrowser3() && window_3.performance) {
2040
+ var _window$performance, _window$performance$n;
2041
+ 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);
2042
+ } else if ("hrtime" in process_) {
2043
+ var _process$hrtime;
2044
+ 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
2045
  timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
1673
2046
  } else {
1674
2047
  timestamp = Date.now();
@@ -1676,22 +2049,14 @@
1676
2049
  return timestamp;
1677
2050
  }
1678
2051
  var init_hi_res_timestamp2 = __esm({
1679
- "../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js"() {
1680
- init_globals4();
2052
+ "../../node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js"() {
2053
+ init_dist2();
1681
2054
  }
1682
2055
  });
1683
2056
 
1684
- // ../../node_modules/probe.gl/dist/esm/lib/log.js
2057
+ // ../../node_modules/@probe.gl/log/dist/log.js
1685
2058
  function noop() {
1686
2059
  }
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
2060
  function normalizeLogLevel(logLevel) {
1696
2061
  if (!logLevel) {
1697
2062
  return 0;
@@ -1719,7 +2084,6 @@
1719
2084
  const args = opts.args ? Array.from(opts.args) : [];
1720
2085
  while (args.length && args.shift() !== message) {
1721
2086
  }
1722
- opts.args = args;
1723
2087
  switch (typeof logLevel) {
1724
2088
  case "string":
1725
2089
  case "function":
@@ -1738,7 +2102,9 @@
1738
2102
  }
1739
2103
  const messageType = typeof opts.message;
1740
2104
  assert3(messageType === "string" || messageType === "object");
1741
- return Object.assign(opts, opts.opts);
2105
+ return Object.assign(opts, {
2106
+ args
2107
+ }, opts.opts);
1742
2108
  }
1743
2109
  function decorateMessage(id, message, opts) {
1744
2110
  if (typeof message === "string") {
@@ -1748,29 +2114,21 @@
1748
2114
  }
1749
2115
  return message;
1750
2116
  }
1751
- function logImageInNode({
1752
- image,
1753
- message = "",
1754
- scale = 1
1755
- }) {
1756
- let asciify = null;
1757
- try {
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
- }
2117
+ function logImageInNode(_ref2) {
2118
+ let {
2119
+ image,
2120
+ message = "",
2121
+ scale = 1
2122
+ } = _ref2;
2123
+ console.warn("removed");
1767
2124
  return noop;
1768
2125
  }
1769
- function logImageInBrowser({
1770
- image,
1771
- message = "",
1772
- scale = 1
1773
- }) {
2126
+ function logImageInBrowser(_ref3) {
2127
+ let {
2128
+ image,
2129
+ message = "",
2130
+ scale = 1
2131
+ } = _ref3;
1774
2132
  if (typeof image === "string") {
1775
2133
  const img = new Image();
1776
2134
  img.onload = () => {
@@ -1793,10 +2151,19 @@
1793
2151
  }
1794
2152
  return noop;
1795
2153
  }
1796
- var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
2154
+ function getTableHeader(table) {
2155
+ for (const key in table) {
2156
+ for (const title in table[key]) {
2157
+ return title || "untitled";
2158
+ }
2159
+ }
2160
+ return "empty";
2161
+ }
2162
+ var originalConsole, DEFAULT_LOG_CONFIGURATION, cache, ONCE, Log;
1797
2163
  var init_log = __esm({
1798
- "../../node_modules/probe.gl/dist/esm/lib/log.js"() {
1799
- init_globals4();
2164
+ "../../node_modules/@probe.gl/log/dist/log.js"() {
2165
+ init_defineProperty();
2166
+ init_dist2();
1800
2167
  init_local_storage();
1801
2168
  init_formatters();
1802
2169
  init_color();
@@ -1804,13 +2171,13 @@
1804
2171
  init_assert3();
1805
2172
  init_hi_res_timestamp2();
1806
2173
  originalConsole = {
1807
- debug: isBrowser4 ? console.debug || console.log : console.log,
2174
+ debug: isBrowser3() ? console.debug || console.log : console.log,
1808
2175
  log: console.log,
1809
2176
  info: console.info,
1810
2177
  warn: console.warn,
1811
2178
  error: console.error
1812
2179
  };
1813
- DEFAULT_SETTINGS = {
2180
+ DEFAULT_LOG_CONFIGURATION = {
1814
2181
  enabled: true,
1815
2182
  level: 0
1816
2183
  };
@@ -1819,18 +2186,22 @@
1819
2186
  once: true
1820
2187
  };
1821
2188
  Log = class {
1822
- constructor({
1823
- id
1824
- } = {
1825
- id: ""
1826
- }) {
2189
+ constructor() {
2190
+ let {
2191
+ id
2192
+ } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
2193
+ id: ""
2194
+ };
2195
+ _defineProperty(this, "id", void 0);
2196
+ _defineProperty(this, "VERSION", VERSION4);
2197
+ _defineProperty(this, "_startTs", getHiResTimestamp2());
2198
+ _defineProperty(this, "_deltaTs", getHiResTimestamp2());
2199
+ _defineProperty(this, "_storage", void 0);
2200
+ _defineProperty(this, "userData", {});
2201
+ _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
1827
2202
  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
2203
  this.userData = {};
2204
+ this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_LOG_CONFIGURATION);
1834
2205
  this.timeStamp("".concat(this.id, " started"));
1835
2206
  autobind(this);
1836
2207
  Object.seal(this);
@@ -1862,18 +2233,34 @@
1862
2233
  getPriority() {
1863
2234
  return this.level;
1864
2235
  }
1865
- enable(enabled = true) {
1866
- this._storage.updateConfiguration({
2236
+ enable() {
2237
+ let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
2238
+ this._storage.setConfiguration({
1867
2239
  enabled
1868
2240
  });
1869
2241
  return this;
1870
2242
  }
1871
2243
  setLevel(level) {
1872
- this._storage.updateConfiguration({
2244
+ this._storage.setConfiguration({
1873
2245
  level
1874
2246
  });
1875
2247
  return this;
1876
2248
  }
2249
+ get(setting) {
2250
+ return this._storage.config[setting];
2251
+ }
2252
+ set(setting, value) {
2253
+ this._storage.setConfiguration({
2254
+ [setting]: value
2255
+ });
2256
+ }
2257
+ settings() {
2258
+ if (console.table) {
2259
+ console.table(this._storage.config);
2260
+ } else {
2261
+ console.log(this._storage.config);
2262
+ }
2263
+ }
1877
2264
  assert(condition, message) {
1878
2265
  assert3(condition, message);
1879
2266
  }
@@ -1912,17 +2299,18 @@
1912
2299
  }
1913
2300
  return noop;
1914
2301
  }
1915
- image({
1916
- logLevel,
1917
- priority,
1918
- image,
1919
- message = "",
1920
- scale = 1
1921
- }) {
2302
+ image(_ref) {
2303
+ let {
2304
+ logLevel,
2305
+ priority,
2306
+ image,
2307
+ message = "",
2308
+ scale = 1
2309
+ } = _ref;
1922
2310
  if (!this._shouldLog(logLevel || priority)) {
1923
2311
  return noop;
1924
2312
  }
1925
- return isBrowser4 ? logImageInBrowser({
2313
+ return isBrowser3() ? logImageInBrowser({
1926
2314
  image,
1927
2315
  message,
1928
2316
  scale
@@ -1932,21 +2320,6 @@
1932
2320
  scale
1933
2321
  });
1934
2322
  }
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
2323
  time(logLevel, message) {
1951
2324
  return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
1952
2325
  }
@@ -1956,10 +2329,11 @@
1956
2329
  timeStamp(logLevel, message) {
1957
2330
  return this._getLogFunction(logLevel, message, console.timeStamp || noop);
1958
2331
  }
1959
- group(logLevel, message, opts = {
1960
- collapsed: false
1961
- }) {
1962
- opts = normalizeArguments({
2332
+ group(logLevel, message) {
2333
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
2334
+ collapsed: false
2335
+ };
2336
+ const options = normalizeArguments({
1963
2337
  logLevel,
1964
2338
  message,
1965
2339
  opts
@@ -1967,10 +2341,11 @@
1967
2341
  const {
1968
2342
  collapsed
1969
2343
  } = opts;
1970
- opts.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
1971
- return this._getLogFunction(opts);
2344
+ options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
2345
+ return this._getLogFunction(options);
1972
2346
  }
1973
- groupCollapsed(logLevel, message, opts = {}) {
2347
+ groupCollapsed(logLevel, message) {
2348
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1974
2349
  return this.group(logLevel, message, Object.assign({}, opts, {
1975
2350
  collapsed: true
1976
2351
  }));
@@ -1994,7 +2369,7 @@
1994
2369
  _shouldLog(logLevel) {
1995
2370
  return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
1996
2371
  }
1997
- _getLogFunction(logLevel, message, method, args = [], opts) {
2372
+ _getLogFunction(logLevel, message, method, args, opts) {
1998
2373
  if (this._shouldLog(logLevel)) {
1999
2374
  opts = normalizeArguments({
2000
2375
  logLevel,
@@ -2008,7 +2383,7 @@
2008
2383
  opts.delta = this.getDelta();
2009
2384
  this._deltaTs = getHiResTimestamp2();
2010
2385
  const tag = opts.tag || opts.message;
2011
- if (opts.once) {
2386
+ if (opts.once && tag) {
2012
2387
  if (!cache[tag]) {
2013
2388
  cache[tag] = getHiResTimestamp2();
2014
2389
  } else {
@@ -2021,48 +2396,18 @@
2021
2396
  return noop;
2022
2397
  }
2023
2398
  };
2024
- Log.VERSION = VERSION3;
2399
+ _defineProperty(Log, "VERSION", VERSION4);
2025
2400
  }
2026
2401
  });
2027
2402
 
2028
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
2029
- var init_hi_res_timestamp3 = __esm({
2030
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
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"() {
2403
+ // ../../node_modules/@probe.gl/log/dist/index.js
2404
+ var dist_default;
2405
+ var init_dist3 = __esm({
2406
+ "../../node_modules/@probe.gl/log/dist/index.js"() {
2061
2407
  init_log();
2062
2408
  init_log();
2063
- init_esm2();
2064
- esm_default = new Log({
2065
- id: "probe.gl"
2409
+ dist_default = new Log({
2410
+ id: "@probe.gl/log"
2066
2411
  });
2067
2412
  }
2068
2413
  });
@@ -2071,7 +2416,7 @@
2071
2416
  var probeLog, NullLog, ConsoleLog;
2072
2417
  var init_loggers = __esm({
2073
2418
  "src/lib/loader-utils/loggers.ts"() {
2074
- init_esm3();
2419
+ init_dist3();
2075
2420
  probeLog = new Log({ id: "loaders.gl" });
2076
2421
  NullLog = class {
2077
2422
  log() {
@@ -2115,6 +2460,7 @@
2115
2460
  var DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS;
2116
2461
  var init_option_defaults = __esm({
2117
2462
  "src/lib/loader-utils/option-defaults.ts"() {
2463
+ init_src2();
2118
2464
  init_loggers();
2119
2465
  DEFAULT_LOADER_OPTIONS = {
2120
2466
  fetch: null,
@@ -2125,7 +2471,8 @@
2125
2471
  worker: true,
2126
2472
  maxConcurrency: 3,
2127
2473
  maxMobileConcurrency: 1,
2128
- reuseWorkers: true,
2474
+ reuseWorkers: isBrowser,
2475
+ _nodeWorkers: false,
2129
2476
  _workerType: "",
2130
2477
  limit: 0,
2131
2478
  _limitMB: 0,
@@ -2172,20 +2519,6 @@
2172
2519
  validateOptions(options, loaders);
2173
2520
  return normalizeOptionsInternal(loader, options, url);
2174
2521
  }
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
2522
  function validateOptions(options, loaders) {
2190
2523
  validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
2191
2524
  for (const loader of loaders) {
@@ -2264,7 +2597,6 @@
2264
2597
  var init_option_utils = __esm({
2265
2598
  "src/lib/loader-utils/option-utils.ts"() {
2266
2599
  init_is_type();
2267
- init_fetch_file();
2268
2600
  init_loggers();
2269
2601
  init_option_defaults();
2270
2602
  getGlobalLoaderOptions = () => {
@@ -2275,12 +2607,10 @@
2275
2607
  }
2276
2608
  });
2277
2609
 
2278
- // src/lib/api/set-loader-options.ts
2279
- function setLoaderOptions(options) {
2280
- setGlobalOptions(options);
2281
- }
2282
- var init_set_loader_options = __esm({
2283
- "src/lib/api/set-loader-options.ts"() {
2610
+ // src/lib/api/loader-options.ts
2611
+ var init_loader_options = __esm({
2612
+ "src/lib/api/loader-options.ts"() {
2613
+ init_option_utils();
2284
2614
  init_option_utils();
2285
2615
  }
2286
2616
  });
@@ -2353,6 +2683,15 @@
2353
2683
  }
2354
2684
  });
2355
2685
 
2686
+ // src/lib/utils/log.ts
2687
+ var log;
2688
+ var init_log2 = __esm({
2689
+ "src/lib/utils/log.ts"() {
2690
+ init_dist3();
2691
+ log = new Log({ id: "loaders.gl" });
2692
+ }
2693
+ });
2694
+
2356
2695
  // src/lib/api/select-loader.ts
2357
2696
  async function selectLoader(data, loaders = [], options, context) {
2358
2697
  if (!validHTTPResponse(data)) {
@@ -2396,13 +2735,22 @@
2396
2735
  const { url, type } = getResourceUrlAndType(data);
2397
2736
  const testUrl = url || context?.url;
2398
2737
  let loader = null;
2738
+ let reason = "";
2399
2739
  if (options?.mimeType) {
2400
2740
  loader = findLoaderByMIMEType(loaders, options?.mimeType);
2741
+ reason = `match forced by supplied MIME type ${options?.mimeType}`;
2401
2742
  }
2402
2743
  loader = loader || findLoaderByUrl(loaders, testUrl);
2744
+ reason = reason || (loader ? `matched url ${testUrl}` : "");
2403
2745
  loader = loader || findLoaderByMIMEType(loaders, type);
2746
+ reason = reason || (loader ? `matched MIME type ${type}` : "");
2404
2747
  loader = loader || findLoaderByInitialBytes(loaders, data);
2748
+ reason = reason || (loader ? `matched initial data ${getFirstCharacters(data)}` : "");
2405
2749
  loader = loader || findLoaderByMIMEType(loaders, options?.fallbackMimeType);
2750
+ reason = reason || (loader ? `matched fallback MIME type ${type}` : "");
2751
+ if (reason) {
2752
+ log.log(1, `selectLoader selected ${loader?.name}: ${reason}.`);
2753
+ }
2406
2754
  return loader;
2407
2755
  }
2408
2756
  function validHTTPResponse(data) {
@@ -2529,6 +2877,7 @@
2529
2877
  "src/lib/api/select-loader.ts"() {
2530
2878
  init_src2();
2531
2879
  init_normalize_loader();
2880
+ init_log2();
2532
2881
  init_resource_utils();
2533
2882
  init_register_loaders();
2534
2883
  init_is_type();
@@ -2611,7 +2960,7 @@
2611
2960
  if (done) {
2612
2961
  return;
2613
2962
  }
2614
- yield toArrayBuffer(value);
2963
+ yield toArrayBuffer2(value);
2615
2964
  }
2616
2965
  } catch (error) {
2617
2966
  reader.releaseLock();
@@ -2619,7 +2968,7 @@
2619
2968
  }
2620
2969
  async function* makeNodeStreamIterator(stream, options) {
2621
2970
  for await (const chunk of stream) {
2622
- yield toArrayBuffer(chunk);
2971
+ yield toArrayBuffer2(chunk);
2623
2972
  }
2624
2973
  }
2625
2974
  var init_make_stream_iterator = __esm({
@@ -2757,6 +3106,29 @@
2757
3106
  }
2758
3107
  });
2759
3108
 
3109
+ // src/lib/loader-utils/get-fetch-function.ts
3110
+ function getFetchFunction(options, context) {
3111
+ const globalOptions = getGlobalLoaderOptions();
3112
+ const fetchOptions = options || globalOptions;
3113
+ if (typeof fetchOptions.fetch === "function") {
3114
+ return fetchOptions.fetch;
3115
+ }
3116
+ if (isObject(fetchOptions.fetch)) {
3117
+ return (url) => fetchFile(url, fetchOptions);
3118
+ }
3119
+ if (context?.fetch) {
3120
+ return context?.fetch;
3121
+ }
3122
+ return fetchFile;
3123
+ }
3124
+ var init_get_fetch_function = __esm({
3125
+ "src/lib/loader-utils/get-fetch-function.ts"() {
3126
+ init_is_type();
3127
+ init_fetch_file();
3128
+ init_option_utils();
3129
+ }
3130
+ });
3131
+
2760
3132
  // src/lib/loader-utils/loader-context.ts
2761
3133
  function getLoaderContext(context, options, previousContext = null) {
2762
3134
  if (previousContext) {
@@ -2787,7 +3159,7 @@
2787
3159
  }
2788
3160
  var init_loader_context = __esm({
2789
3161
  "src/lib/loader-utils/loader-context.ts"() {
2790
- init_option_utils();
3162
+ init_get_fetch_function();
2791
3163
  }
2792
3164
  });
2793
3165
 
@@ -2814,6 +3186,12 @@
2814
3186
  }
2815
3187
  async function parseWithLoader(loader, data, options, context) {
2816
3188
  validateWorkerVersion(loader);
3189
+ if (isResponse(data)) {
3190
+ const response = data;
3191
+ const { ok, redirected, status, statusText, type, url } = response;
3192
+ const headers = Object.fromEntries(response.headers.entries());
3193
+ context.response = { headers, ok, redirected, status, statusText, type, url };
3194
+ }
2817
3195
  data = await getArrayBufferOrStringFromData(data, loader, options);
2818
3196
  if (loader.parseTextSync && typeof data === "string") {
2819
3197
  options.dataType = "text";
@@ -2836,6 +3214,7 @@
2836
3214
  init_src();
2837
3215
  init_src2();
2838
3216
  init_normalize_loader();
3217
+ init_is_type();
2839
3218
  init_option_utils();
2840
3219
  init_get_data();
2841
3220
  init_loader_context();
@@ -2970,12 +3349,17 @@
2970
3349
 
2971
3350
  // src/lib/api/load.ts
2972
3351
  async function load(url, loaders, options, context) {
3352
+ let resolvedLoaders;
3353
+ let resolvedOptions;
2973
3354
  if (!Array.isArray(loaders) && !isLoaderObject(loaders)) {
3355
+ resolvedLoaders = [];
3356
+ resolvedOptions = loaders;
2974
3357
  context = void 0;
2975
- options = loaders;
2976
- loaders = void 0;
3358
+ } else {
3359
+ resolvedLoaders = loaders;
3360
+ resolvedOptions = options;
2977
3361
  }
2978
- const fetch2 = getFetchFunction(options);
3362
+ const fetch2 = getFetchFunction(resolvedOptions);
2979
3363
  let data = url;
2980
3364
  if (typeof url === "string") {
2981
3365
  data = await fetch2(url);
@@ -2983,13 +3367,13 @@
2983
3367
  if (isBlob(url)) {
2984
3368
  data = await fetch2(url);
2985
3369
  }
2986
- return await parse(data, loaders, options);
3370
+ return Array.isArray(resolvedLoaders) ? await parse(data, resolvedLoaders, resolvedOptions) : await parse(data, resolvedLoaders, resolvedOptions);
2987
3371
  }
2988
3372
  var init_load = __esm({
2989
3373
  "src/lib/api/load.ts"() {
2990
3374
  init_is_type();
2991
3375
  init_normalize_loader();
2992
- init_option_utils();
3376
+ init_get_fetch_function();
2993
3377
  init_parse();
2994
3378
  }
2995
3379
  });
@@ -3019,13 +3403,64 @@
3019
3403
  var init_load_in_batches = __esm({
3020
3404
  "src/lib/api/load-in-batches.ts"() {
3021
3405
  init_normalize_loader();
3022
- init_option_utils();
3406
+ init_get_fetch_function();
3023
3407
  init_parse_in_batches();
3024
3408
  }
3025
3409
  });
3026
3410
 
3411
+ // src/lib/api/encode-table.ts
3412
+ async function encodeTable(data, writer, options) {
3413
+ if (writer.encode) {
3414
+ return await writer.encode(data, options);
3415
+ }
3416
+ if (writer.encodeText) {
3417
+ const text = await writer.encodeText(data, options);
3418
+ return new TextEncoder().encode(text);
3419
+ }
3420
+ if (writer.encodeInBatches) {
3421
+ const batches = encodeTableInBatches(data, writer, options);
3422
+ const chunks = [];
3423
+ for await (const batch of batches) {
3424
+ chunks.push(batch);
3425
+ }
3426
+ return concatenateArrayBuffers(...chunks);
3427
+ }
3428
+ throw new Error("Writer could not encode data");
3429
+ }
3430
+ async function encodeTableAsText(data, writer, options) {
3431
+ if (writer.text && writer.encodeText) {
3432
+ return await writer.encodeText(data, options);
3433
+ }
3434
+ if (writer.text && (writer.encode || writer.encodeInBatches)) {
3435
+ const arrayBuffer = await encodeTable(data, writer, options);
3436
+ return new TextDecoder().decode(arrayBuffer);
3437
+ }
3438
+ throw new Error("Writer could not encode data as text");
3439
+ }
3440
+ function encodeTableInBatches(data, writer, options) {
3441
+ if (writer.encodeInBatches) {
3442
+ const dataIterator = getIterator(data);
3443
+ return writer.encodeInBatches(dataIterator, options);
3444
+ }
3445
+ throw new Error("Writer could not encode data in batches");
3446
+ }
3447
+ function getIterator(data) {
3448
+ const dataIterator = [{ table: data, start: 0, end: data.length }];
3449
+ return dataIterator;
3450
+ }
3451
+ var init_encode_table = __esm({
3452
+ "src/lib/api/encode-table.ts"() {
3453
+ init_src2();
3454
+ }
3455
+ });
3456
+
3027
3457
  // src/lib/api/encode.ts
3028
3458
  async function encode(data, writer, options) {
3459
+ const globalOptions = getGlobalLoaderOptions();
3460
+ options = { ...globalOptions, ...options };
3461
+ if (canEncodeWithWorker(writer, options)) {
3462
+ return await processOnWorker(writer, data, options);
3463
+ }
3029
3464
  if (writer.encode) {
3030
3465
  return await writer.encode(data, options);
3031
3466
  }
@@ -3045,7 +3480,7 @@
3045
3480
  }
3046
3481
  if (!isBrowser && writer.encodeURLtoURL) {
3047
3482
  const tmpInputFilename = getTemporaryFilename("input");
3048
- await writeFile(tmpInputFilename, data);
3483
+ await writeFile2(tmpInputFilename, data);
3049
3484
  const tmpOutputFilename = getTemporaryFilename("output");
3050
3485
  const outputFilename = await encodeURLtoURL(tmpInputFilename, tmpOutputFilename, writer, options);
3051
3486
  const response = await fetchFile(outputFilename);
@@ -3071,7 +3506,7 @@
3071
3506
  }
3072
3507
  function encodeInBatches(data, writer, options) {
3073
3508
  if (writer.encodeInBatches) {
3074
- const dataIterator = getIterator(data);
3509
+ const dataIterator = getIterator2(data);
3075
3510
  return writer.encodeInBatches(dataIterator, options);
3076
3511
  }
3077
3512
  throw new Error("Writer could not encode data in batches");
@@ -3085,7 +3520,7 @@
3085
3520
  const outputFilename = await writer.encodeURLtoURL(inputUrl, outputUrl, options);
3086
3521
  return outputFilename;
3087
3522
  }
3088
- function getIterator(data) {
3523
+ function getIterator2(data) {
3089
3524
  const dataIterator = [{ table: data, start: 0, end: data.length }];
3090
3525
  return dataIterator;
3091
3526
  }
@@ -3094,21 +3529,24 @@
3094
3529
  }
3095
3530
  var init_encode = __esm({
3096
3531
  "src/lib/api/encode.ts"() {
3532
+ init_src2();
3533
+ init_src();
3097
3534
  init_src2();
3098
3535
  init_src2();
3099
3536
  init_write_file();
3100
3537
  init_fetch_file();
3538
+ init_loader_options();
3101
3539
  }
3102
3540
  });
3103
3541
 
3104
3542
  // src/lib/api/save.ts
3105
3543
  async function save(data, url, writer, options) {
3106
3544
  const encodedData = await encode(data, writer, options);
3107
- return await writeFile(url, encodedData);
3545
+ return await writeFile2(url, encodedData);
3108
3546
  }
3109
3547
  function saveSync(data, url, writer, options) {
3110
3548
  const encodedData = encodeSync(data, writer, options);
3111
- return writeFileSync(url, encodedData);
3549
+ return writeFileSync2(url, encodedData);
3112
3550
  }
3113
3551
  var init_save = __esm({
3114
3552
  "src/lib/api/save.ts"() {
@@ -3148,15 +3586,21 @@
3148
3586
  });
3149
3587
 
3150
3588
  // src/null-loader.ts
3151
- var VERSION4, NullWorkerLoader, NullLoader;
3589
+ function parseSync2(arrayBuffer, options, context) {
3590
+ if (!options.null.echoParameters)
3591
+ return null;
3592
+ context = context && JSON.parse(JSON.stringify(context));
3593
+ return { arrayBuffer, options, context };
3594
+ }
3595
+ var VERSION5, NullWorkerLoader, NullLoader;
3152
3596
  var init_null_loader = __esm({
3153
3597
  "src/null-loader.ts"() {
3154
- VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
3598
+ VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
3155
3599
  NullWorkerLoader = {
3156
3600
  name: "Null loader",
3157
3601
  id: "null",
3158
3602
  module: "core",
3159
- version: VERSION4,
3603
+ version: VERSION5,
3160
3604
  worker: true,
3161
3605
  mimeTypes: ["application/x.empty"],
3162
3606
  extensions: ["null"],
@@ -3169,19 +3613,21 @@
3169
3613
  name: "Null loader",
3170
3614
  id: "null",
3171
3615
  module: "core",
3172
- version: VERSION4,
3616
+ version: VERSION5,
3173
3617
  mimeTypes: ["application/x.empty"],
3174
3618
  extensions: ["null"],
3175
- parse: async (arrayBuffer) => arrayBuffer,
3176
- parseSync: (arrayBuffer) => arrayBuffer,
3177
- parseInBatches: async function* generator(asyncIterator) {
3619
+ parse: async (arrayBuffer, options, context) => parseSync2(arrayBuffer, options, context),
3620
+ parseSync: parseSync2,
3621
+ parseInBatches: async function* generator(asyncIterator, options, context) {
3178
3622
  for await (const batch of asyncIterator) {
3179
- yield batch;
3623
+ yield parseSync2(batch, options, context);
3180
3624
  }
3181
3625
  },
3182
3626
  tests: [() => false],
3183
3627
  options: {
3184
- null: {}
3628
+ null: {
3629
+ echoParameters: false
3630
+ }
3185
3631
  }
3186
3632
  };
3187
3633
  }
@@ -3200,8 +3646,8 @@
3200
3646
  return response;
3201
3647
  }
3202
3648
  const contentLength = response.headers.get("content-length") || 0;
3203
- const totalBytes = contentLength && parseInt(contentLength);
3204
- if (!(contentLength > 0)) {
3649
+ const totalBytes = contentLength ? parseInt(contentLength) : 0;
3650
+ if (!(totalBytes > 0)) {
3205
3651
  return response;
3206
3652
  }
3207
3653
  if (typeof ReadableStream === "undefined" || !body.getReader) {
@@ -3210,12 +3656,12 @@
3210
3656
  const progressStream = new ReadableStream({
3211
3657
  async start(controller) {
3212
3658
  const reader = body.getReader();
3213
- await read(controller, reader, 0, totalBytes, onProgress, onDone, onError);
3659
+ await read2(controller, reader, 0, totalBytes, onProgress, onDone, onError);
3214
3660
  }
3215
3661
  });
3216
3662
  return new Response(progressStream);
3217
3663
  }
3218
- async function read(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError) {
3664
+ async function read2(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError) {
3219
3665
  try {
3220
3666
  const { done, value } = await reader.read();
3221
3667
  if (done) {
@@ -3227,7 +3673,7 @@
3227
3673
  const percent = Math.round(loadedBytes / totalBytes * 100);
3228
3674
  onProgress(percent, { loadedBytes, totalBytes });
3229
3675
  controller.enqueue(value);
3230
- await read(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError);
3676
+ await read2(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError);
3231
3677
  } catch (error) {
3232
3678
  controller.error(error);
3233
3679
  onError(error);
@@ -3336,10 +3782,14 @@
3336
3782
  encode: () => encode,
3337
3783
  encodeInBatches: () => encodeInBatches,
3338
3784
  encodeSync: () => encodeSync,
3785
+ encodeTable: () => encodeTable,
3786
+ encodeTableAsText: () => encodeTableAsText,
3787
+ encodeTableInBatches: () => encodeTableInBatches,
3339
3788
  encodeText: () => encodeText,
3340
3789
  encodeURLtoURL: () => encodeURLtoURL,
3341
3790
  fetchFile: () => fetchFile,
3342
3791
  forEach: () => forEach,
3792
+ getLoaderOptions: () => getGlobalLoaderOptions,
3343
3793
  getPathPrefix: () => getPathPrefix,
3344
3794
  global: () => global_,
3345
3795
  isAsyncIterable: () => isAsyncIterable,
@@ -3364,7 +3814,7 @@
3364
3814
  parseInBatches: () => parseInBatches,
3365
3815
  parseSync: () => parseSync,
3366
3816
  readArrayBuffer: () => readArrayBuffer,
3367
- readFileSync: () => readFileSync,
3817
+ readFileSync: () => readFileSync2,
3368
3818
  registerLoaders: () => registerLoaders,
3369
3819
  resolvePath: () => resolvePath,
3370
3820
  save: () => save,
@@ -3372,11 +3822,11 @@
3372
3822
  selectLoader: () => selectLoader,
3373
3823
  selectLoaderSync: () => selectLoaderSync,
3374
3824
  self: () => self_,
3375
- setLoaderOptions: () => setLoaderOptions,
3825
+ setLoaderOptions: () => setGlobalOptions,
3376
3826
  setPathPrefix: () => setPathPrefix,
3377
3827
  window: () => window_,
3378
- writeFile: () => writeFile,
3379
- writeFileSync: () => writeFileSync
3828
+ writeFile: () => writeFile2,
3829
+ writeFileSync: () => writeFileSync2
3380
3830
  });
3381
3831
  var init_src3 = __esm({
3382
3832
  "src/index.ts"() {
@@ -3384,7 +3834,7 @@
3384
3834
  init_read_array_buffer();
3385
3835
  init_read_file();
3386
3836
  init_write_file();
3387
- init_set_loader_options();
3837
+ init_loader_options();
3388
3838
  init_register_loaders();
3389
3839
  init_select_loader();
3390
3840
  init_parse();
@@ -3392,6 +3842,7 @@
3392
3842
  init_parse_in_batches();
3393
3843
  init_load();
3394
3844
  init_load_in_batches();
3845
+ init_encode_table();
3395
3846
  init_encode();
3396
3847
  init_save();
3397
3848
  init_src2();
@@ -3413,10 +3864,10 @@
3413
3864
 
3414
3865
  // src/bundle.ts
3415
3866
  var require_bundle = __commonJS({
3416
- "src/bundle.ts"(exports, module2) {
3867
+ "src/bundle.ts"(exports, module) {
3417
3868
  var moduleExports = (init_src3(), src_exports);
3418
3869
  globalThis.loaders = globalThis.loaders || {};
3419
- module2.exports = Object.assign(globalThis.loaders, moduleExports);
3870
+ module.exports = Object.assign(globalThis.loaders, moduleExports);
3420
3871
  }
3421
3872
  });
3422
3873
  require_bundle();