mapicgc-gl-js 1.0.7 → 1.0.8

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 (52) hide show
  1. package/README.md +2 -4
  2. package/dist/array-utils-flat-DeB-J5jn.mjs +1523 -0
  3. package/dist/assets/maplibre-gl-worker-HMCkgiD4.js +10 -0
  4. package/dist/buffer-transform-CH0poqqn.mjs +941 -0
  5. package/dist/expression-CtaQKvTZ.mjs +3444 -0
  6. package/dist/get-attribute-from-layouts-DqvACIaG.mjs +936 -0
  7. package/dist/{html2canvas-DhrjCa5K-6_3CwS_m.mjs → html2canvas-Cgp0Hyhk-HIw4n-A9.mjs} +105 -109
  8. package/dist/{index.es-D_FsJY9H-CO3QIBGM.mjs → index.es-lgdlL0gw-Bl7I-U5B.mjs} +176 -176
  9. package/dist/mapicgc-gl-js.css +1 -1
  10. package/dist/mapicgc-gl.css +199 -0
  11. package/dist/mapicgc-gl.js +5079 -856
  12. package/dist/mapicgc-gl.mjs +85573 -61841
  13. package/dist/purify.es-DNpVkA56-DxzGf9c8.mjs +769 -0
  14. package/dist/{chunk-efA98nb6-Dfm7IivL.mjs → rolldown-runtime-3b4jIN3o-CmciV3xi.mjs} +2 -2
  15. package/dist/{typeof-CTd55yxz-BxqQpTq1.mjs → typeof-C3azmBUr-9LkZMuan.mjs} +1 -1
  16. package/dist/webgl-Cep-x0-T.mjs +784 -0
  17. package/package.json +20 -15
  18. package/public/mapicgc-gl.css +199 -0
  19. package/src/controls/ApiTerritorialControl.js +222 -0
  20. package/src/index.js +18 -1
  21. package/src/map/Map.js +245 -144
  22. package/src/mapicgc-config.json +1303 -8
  23. package/src/plugins/CompareMaps.js +2 -1
  24. package/src/territorial/ApiTerritorialControl.js +1 -0
  25. package/src/territorial/mostraPanellInfo.js +250 -0
  26. package/src/territorial/searchApiTerritorialICGC.js +250 -0
  27. package/test/exemples/addApiTerritorialICGC.html +113 -0
  28. package/test/exemples/addBasemap.html +4 -4
  29. package/test/exemples/addCompare.html +7 -6
  30. package/test/exemples/addControl.html +12 -6
  31. package/test/exemples/addFeatureQuery.html +5 -4
  32. package/test/exemples/addGeocoderICGC.html +5 -4
  33. package/test/exemples/addICGCTerrain.html +5 -4
  34. package/test/exemples/addICGCTerrainCustomStyle.html +5 -4
  35. package/test/exemples/addImageLayerICGC.html +5 -4
  36. package/test/exemples/addLayerGeojson.html +5 -4
  37. package/test/exemples/addLayerTree.html +5 -4
  38. package/test/exemples/addLogo.html +5 -3
  39. package/test/exemples/addMapStyle.html +5 -4
  40. package/test/exemples/addMarker.html +5 -4
  41. package/test/exemples/addMouseCoordinateControl.html +5 -4
  42. package/test/exemples/addReliefStyle.html +6 -5
  43. package/test/exemples/addVectorLayerICGC.html +5 -4
  44. package/test/exemples/advancedExemple.html +5 -4
  45. package/test/exemples/fetchData.html +6 -5
  46. package/test/exemples/fetchDataAndMenu.html +5 -4
  47. package/test/exemples/styleOrto3D.html +8 -4
  48. package/test/vitest/ApiTerritorialControl.test.js +76 -0
  49. package/vite.config.mjs +16 -5
  50. package/dist/purify.es-DVGU85zV-CJOZ7ABI.mjs +0 -549
  51. package/dist/webgl-device-B1jTrfKA.mjs +0 -6880
  52. package/dist/webgl-device-D8jkwRzb.mjs +0 -2
@@ -0,0 +1,1523 @@
1
+ //#region node_modules/@probe.gl/env/dist/lib/globals.js
2
+ var e = globalThis;
3
+ globalThis.document;
4
+ var t = globalThis.process || {};
5
+ globalThis.console;
6
+ var n = globalThis.navigator || {};
7
+ //#endregion
8
+ //#region node_modules/@probe.gl/env/dist/lib/is-electron.js
9
+ function r(e) {
10
+ if (typeof window < "u" && window.process?.type === "renderer" || typeof process < "u" && process.versions?.electron) return !0;
11
+ let t = typeof navigator < "u" && navigator.userAgent, n = e || t;
12
+ return !!(n && n.indexOf("Electron") >= 0);
13
+ }
14
+ //#endregion
15
+ //#region node_modules/@probe.gl/env/dist/lib/is-browser.js
16
+ function i() {
17
+ return !(typeof process == "object" && String(process) === "[object process]" && !process?.browser) || r();
18
+ }
19
+ //#endregion
20
+ //#region node_modules/@probe.gl/env/dist/index.js
21
+ var a = "4.1.1";
22
+ //#endregion
23
+ //#region node_modules/@probe.gl/log/dist/utils/assert.js
24
+ function o(e, t) {
25
+ if (!e) throw Error(t || "Assertion failed");
26
+ }
27
+ //#endregion
28
+ //#region node_modules/@probe.gl/log/dist/loggers/log-utils.js
29
+ function s(e) {
30
+ if (!e) return 0;
31
+ let t;
32
+ switch (typeof e) {
33
+ case "number":
34
+ t = e;
35
+ break;
36
+ case "object":
37
+ t = e.logLevel || e.priority || 0;
38
+ break;
39
+ default: return 0;
40
+ }
41
+ return o(Number.isFinite(t) && t >= 0), t;
42
+ }
43
+ function c(e) {
44
+ let { logLevel: t, message: n } = e;
45
+ e.logLevel = s(t);
46
+ let r = e.args ? Array.from(e.args) : [];
47
+ for (; r.length && r.shift() !== n;);
48
+ switch (typeof t) {
49
+ case "string":
50
+ case "function":
51
+ n !== void 0 && r.unshift(n), e.message = t;
52
+ break;
53
+ case "object": Object.assign(e, t);
54
+ }
55
+ typeof e.message == "function" && (e.message = e.message());
56
+ let i = typeof e.message;
57
+ return o(i === "string" || i === "object"), Object.assign(e, { args: r }, e.opts);
58
+ }
59
+ //#endregion
60
+ //#region node_modules/@probe.gl/log/dist/loggers/base-log.js
61
+ var l = () => {}, u = class {
62
+ constructor({ level: e = 0 } = {}) {
63
+ this.userData = {}, this._onceCache = /* @__PURE__ */ new Set(), this._level = e;
64
+ }
65
+ set level(e) {
66
+ this.setLevel(e);
67
+ }
68
+ get level() {
69
+ return this.getLevel();
70
+ }
71
+ setLevel(e) {
72
+ return this._level = e, this;
73
+ }
74
+ getLevel() {
75
+ return this._level;
76
+ }
77
+ warn(e, ...t) {
78
+ return this._log("warn", 0, e, t, { once: !0 });
79
+ }
80
+ error(e, ...t) {
81
+ return this._log("error", 0, e, t);
82
+ }
83
+ log(e, t, ...n) {
84
+ return this._log("log", e, t, n);
85
+ }
86
+ info(e, t, ...n) {
87
+ return this._log("info", e, t, n);
88
+ }
89
+ once(e, t, ...n) {
90
+ return this._log("once", e, t, n, { once: !0 });
91
+ }
92
+ _log(e, t, n, r, i = {}) {
93
+ let a = c({
94
+ logLevel: t,
95
+ message: n,
96
+ args: this._buildArgs(t, n, r),
97
+ opts: i
98
+ });
99
+ return this._createLogFunction(e, a, i);
100
+ }
101
+ _buildArgs(e, t, n) {
102
+ return [
103
+ e,
104
+ t,
105
+ ...n
106
+ ];
107
+ }
108
+ _createLogFunction(e, t, n) {
109
+ if (!this._shouldLog(t.logLevel)) return l;
110
+ let r = this._getOnceTag(n.tag ?? t.tag ?? t.message);
111
+ if ((n.once || t.once) && r !== void 0) {
112
+ if (this._onceCache.has(r)) return l;
113
+ this._onceCache.add(r);
114
+ }
115
+ return this._emit(e, t);
116
+ }
117
+ _shouldLog(e) {
118
+ return this.getLevel() >= s(e);
119
+ }
120
+ _getOnceTag(e) {
121
+ if (e !== void 0) try {
122
+ return typeof e == "string" ? e : String(e);
123
+ } catch {
124
+ return;
125
+ }
126
+ }
127
+ };
128
+ //#endregion
129
+ //#region node_modules/@probe.gl/log/dist/utils/local-storage.js
130
+ function ee(e) {
131
+ try {
132
+ let t = window[e], n = "__storage_test__";
133
+ return t.setItem(n, n), t.removeItem(n), t;
134
+ } catch {
135
+ return null;
136
+ }
137
+ }
138
+ var te = class {
139
+ constructor(e, t, n = "sessionStorage") {
140
+ this.storage = ee(n), this.id = e, this.config = t, this._loadConfiguration();
141
+ }
142
+ getConfiguration() {
143
+ return this.config;
144
+ }
145
+ setConfiguration(e) {
146
+ if (Object.assign(this.config, e), this.storage) {
147
+ let e = JSON.stringify(this.config);
148
+ this.storage.setItem(this.id, e);
149
+ }
150
+ }
151
+ _loadConfiguration() {
152
+ let e = {};
153
+ if (this.storage) {
154
+ let t = this.storage.getItem(this.id);
155
+ e = t ? JSON.parse(t) : {};
156
+ }
157
+ return Object.assign(this.config, e), this;
158
+ }
159
+ };
160
+ //#endregion
161
+ //#region node_modules/@probe.gl/log/dist/utils/formatters.js
162
+ function ne(e) {
163
+ let t;
164
+ return t = e < 10 ? `${e.toFixed(2)}ms` : e < 100 ? `${e.toFixed(1)}ms` : e < 1e3 ? `${e.toFixed(0)}ms` : `${(e / 1e3).toFixed(2)}s`, t;
165
+ }
166
+ function re(e, t = 8) {
167
+ let n = Math.max(t - e.length, 0);
168
+ return `${" ".repeat(n)}${e}`;
169
+ }
170
+ //#endregion
171
+ //#region node_modules/@probe.gl/log/dist/utils/color.js
172
+ var d;
173
+ (function(e) {
174
+ e[e.BLACK = 30] = "BLACK", e[e.RED = 31] = "RED", e[e.GREEN = 32] = "GREEN", e[e.YELLOW = 33] = "YELLOW", e[e.BLUE = 34] = "BLUE", e[e.MAGENTA = 35] = "MAGENTA", e[e.CYAN = 36] = "CYAN", e[e.WHITE = 37] = "WHITE", e[e.BRIGHT_BLACK = 90] = "BRIGHT_BLACK", e[e.BRIGHT_RED = 91] = "BRIGHT_RED", e[e.BRIGHT_GREEN = 92] = "BRIGHT_GREEN", e[e.BRIGHT_YELLOW = 93] = "BRIGHT_YELLOW", e[e.BRIGHT_BLUE = 94] = "BRIGHT_BLUE", e[e.BRIGHT_MAGENTA = 95] = "BRIGHT_MAGENTA", e[e.BRIGHT_CYAN = 96] = "BRIGHT_CYAN", e[e.BRIGHT_WHITE = 97] = "BRIGHT_WHITE";
175
+ })(d ||= {});
176
+ var ie = 10;
177
+ function f(e) {
178
+ return typeof e == "string" ? (e = e.toUpperCase(), d[e] || d.WHITE) : e;
179
+ }
180
+ function ae(e, t, n) {
181
+ return !i && typeof e == "string" && (t && (e = `\u001b[${f(t)}m${e}\u001b[39m`), n && (e = `\u001b[${f(n) + ie}m${e}\u001b[49m`)), e;
182
+ }
183
+ //#endregion
184
+ //#region node_modules/@probe.gl/log/dist/utils/autobind.js
185
+ function oe(e, t = ["constructor"]) {
186
+ let n = Object.getPrototypeOf(e), r = Object.getOwnPropertyNames(n), i = e;
187
+ for (let n of r) {
188
+ let r = i[n];
189
+ typeof r == "function" && (t.find((e) => n === e) || (i[n] = r.bind(e)));
190
+ }
191
+ }
192
+ //#endregion
193
+ //#region node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
194
+ function p() {
195
+ let n;
196
+ if (i() && e.performance) n = e?.performance?.now?.();
197
+ else if ("hrtime" in t) {
198
+ let e = t?.hrtime?.();
199
+ n = e[0] * 1e3 + e[1] / 1e6;
200
+ } else n = Date.now();
201
+ return n;
202
+ }
203
+ //#endregion
204
+ //#region node_modules/@probe.gl/log/dist/loggers/probe-log.js
205
+ var m = {
206
+ debug: i() && console.debug || console.log,
207
+ log: console.log,
208
+ info: console.info,
209
+ warn: console.warn,
210
+ error: console.error
211
+ }, h = {
212
+ enabled: !0,
213
+ level: 0
214
+ }, g = class extends u {
215
+ constructor({ id: e } = { id: "" }) {
216
+ super({ level: 0 }), this.VERSION = a, this._startTs = p(), this._deltaTs = p(), this.userData = {}, this.LOG_THROTTLE_TIMEOUT = 0, this.id = e, this.userData = {}, this._storage = new te(`__probe-${this.id}__`, { [this.id]: h }), this.timeStamp(`${this.id} started`), oe(this), Object.seal(this);
217
+ }
218
+ isEnabled() {
219
+ return this._getConfiguration().enabled;
220
+ }
221
+ getLevel() {
222
+ return this._getConfiguration().level;
223
+ }
224
+ getTotal() {
225
+ return Number((p() - this._startTs).toPrecision(10));
226
+ }
227
+ getDelta() {
228
+ return Number((p() - this._deltaTs).toPrecision(10));
229
+ }
230
+ set priority(e) {
231
+ this.level = e;
232
+ }
233
+ get priority() {
234
+ return this.level;
235
+ }
236
+ getPriority() {
237
+ return this.level;
238
+ }
239
+ enable(e = !0) {
240
+ return this._updateConfiguration({ enabled: e }), this;
241
+ }
242
+ setLevel(e) {
243
+ return this._updateConfiguration({ level: e }), this;
244
+ }
245
+ get(e) {
246
+ return this._getConfiguration()[e];
247
+ }
248
+ set(e, t) {
249
+ this._updateConfiguration({ [e]: t });
250
+ }
251
+ settings() {
252
+ console.table ? console.table(this._storage.config) : console.log(this._storage.config);
253
+ }
254
+ assert(e, t) {
255
+ if (!e) throw Error(t || "Assertion failed");
256
+ }
257
+ warn(e, ...t) {
258
+ return this._log("warn", 0, e, t, {
259
+ method: m.warn,
260
+ once: !0
261
+ });
262
+ }
263
+ error(e, ...t) {
264
+ return this._log("error", 0, e, t, { method: m.error });
265
+ }
266
+ deprecated(e, t) {
267
+ return this.warn(`\`${e}\` is deprecated and will be removed \
268
+ in a later version. Use \`${t}\` instead`);
269
+ }
270
+ removed(e, t) {
271
+ return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`);
272
+ }
273
+ probe(e, t, ...n) {
274
+ return this._log("log", e, t, n, {
275
+ method: m.log,
276
+ time: !0,
277
+ once: !0
278
+ });
279
+ }
280
+ log(e, t, ...n) {
281
+ return this._log("log", e, t, n, { method: m.debug });
282
+ }
283
+ info(e, t, ...n) {
284
+ return this._log("info", e, t, n, { method: console.info });
285
+ }
286
+ once(e, t, ...n) {
287
+ return this._log("once", e, t, n, {
288
+ method: m.debug || m.info,
289
+ once: !0
290
+ });
291
+ }
292
+ table(e, t, n) {
293
+ return t ? this._log("table", e, t, n && [n] || [], {
294
+ method: console.table || l,
295
+ tag: ce(t)
296
+ }) : l;
297
+ }
298
+ time(e, t) {
299
+ return this._log("time", e, t, [], { method: console.time ? console.time : console.info });
300
+ }
301
+ timeEnd(e, t) {
302
+ return this._log("time", e, t, [], { method: console.timeEnd ? console.timeEnd : console.info });
303
+ }
304
+ timeStamp(e, t) {
305
+ return this._log("time", e, t, [], { method: console.timeStamp || l });
306
+ }
307
+ group(e, t, n = { collapsed: !1 }) {
308
+ let r = (n.collapsed ? console.groupCollapsed : console.group) || console.info;
309
+ return this._log("group", e, t, [], { method: r });
310
+ }
311
+ groupCollapsed(e, t, n = {}) {
312
+ return this.group(e, t, Object.assign({}, n, { collapsed: !0 }));
313
+ }
314
+ groupEnd(e) {
315
+ return this._log("groupEnd", e, "", [], { method: console.groupEnd || l });
316
+ }
317
+ withGroup(e, t, n) {
318
+ this.group(e, t)();
319
+ try {
320
+ n();
321
+ } finally {
322
+ this.groupEnd(e)();
323
+ }
324
+ }
325
+ trace() {
326
+ console.trace && console.trace();
327
+ }
328
+ _shouldLog(e) {
329
+ return this.isEnabled() && super._shouldLog(e);
330
+ }
331
+ _emit(e, t) {
332
+ let n = t.method;
333
+ o(n), t.total = this.getTotal(), t.delta = this.getDelta(), this._deltaTs = p();
334
+ let r = se(this.id, t.message, t);
335
+ return n.bind(console, r, ...t.args);
336
+ }
337
+ _getConfiguration() {
338
+ return this._storage.config[this.id] || this._updateConfiguration(h), this._storage.config[this.id];
339
+ }
340
+ _updateConfiguration(e) {
341
+ let t = this._storage.config[this.id] || { ...h };
342
+ this._storage.setConfiguration({ [this.id]: {
343
+ ...t,
344
+ ...e
345
+ } });
346
+ }
347
+ };
348
+ g.VERSION = a;
349
+ function se(e, t, n) {
350
+ if (typeof t == "string") {
351
+ let r = n.time ? re(ne(n.total)) : "";
352
+ t = n.time ? `${e}: ${r} ${t}` : `${e}: ${t}`, t = ae(t, n.color, n.background);
353
+ }
354
+ return t;
355
+ }
356
+ function ce(e) {
357
+ for (let t in e) for (let n in e[t]) return n || "untitled";
358
+ return "empty";
359
+ }
360
+ //#endregion
361
+ //#region node_modules/@luma.gl/core/dist/utils/log.js
362
+ var _ = new g({ id: "luma.gl" }), v = {};
363
+ function y(e = "id") {
364
+ return v[e] = v[e] || 1, `${e}-${v[e]++}`;
365
+ }
366
+ //#endregion
367
+ //#region node_modules/@luma.gl/core/dist/adapter/resources/resource.js
368
+ var le = "cpu-hotspot-profiler", b = "GPU Resource Counts", x = "Resource Counts", S = "GPU Time and Memory", ue = [
369
+ "Resources",
370
+ "Buffers",
371
+ "Textures",
372
+ "Samplers",
373
+ "TextureViews",
374
+ "Framebuffers",
375
+ "QuerySets",
376
+ "Shaders",
377
+ "RenderPipelines",
378
+ "ComputePipelines",
379
+ "PipelineLayouts",
380
+ "VertexArrays",
381
+ "RenderPasss",
382
+ "RenderBundleEncoders",
383
+ "RenderBundles",
384
+ "ComputePasss",
385
+ "CommandEncoders",
386
+ "CommandBuffers"
387
+ ], de = [
388
+ "Resources",
389
+ "Buffers",
390
+ "Textures",
391
+ "Samplers",
392
+ "TextureViews",
393
+ "Framebuffers",
394
+ "QuerySets",
395
+ "Shaders",
396
+ "RenderPipelines",
397
+ "SharedRenderPipelines",
398
+ "ComputePipelines",
399
+ "PipelineLayouts",
400
+ "VertexArrays",
401
+ "RenderPasss",
402
+ "RenderBundleEncoders",
403
+ "RenderBundles",
404
+ "ComputePasss",
405
+ "CommandEncoders",
406
+ "CommandBuffers"
407
+ ], fe = ue.flatMap((e) => [`${e} Created`, `${e} Active`]), pe = de.flatMap((e) => [`${e} Created`, `${e} Active`]), C = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = class {
408
+ static defaultProps = {
409
+ id: "undefined",
410
+ handle: void 0,
411
+ _isHandleBorrowed: !1,
412
+ userData: void 0
413
+ };
414
+ toString() {
415
+ return `${this[Symbol.toStringTag] || this.constructor.name}:"${this.id}"`;
416
+ }
417
+ toJSON() {
418
+ return this.toString();
419
+ }
420
+ id;
421
+ props;
422
+ userData = {};
423
+ _device;
424
+ destroyed = !1;
425
+ allocatedBytes = 0;
426
+ allocatedBytesName = null;
427
+ _attachedResources = /* @__PURE__ */ new Set();
428
+ get ownsHandle() {
429
+ return (this.props.handle === void 0 || this.props.handle === null) && !this.isHandleBorrowed;
430
+ }
431
+ get isHandleBorrowed() {
432
+ return !!this.props._isHandleBorrowed;
433
+ }
434
+ constructor(e, t, n) {
435
+ if (!e) throw Error("no device");
436
+ this._device = e, this.props = me(t, n);
437
+ let r = this.props.id === "undefined" ? y(this[Symbol.toStringTag]) : this.props.id;
438
+ this.props.id = r, this.id = r, this.userData = this.props.userData || {}, this.addStats();
439
+ }
440
+ destroy() {
441
+ this.destroyed || this.destroyResource();
442
+ }
443
+ delete() {
444
+ return this.destroy(), this;
445
+ }
446
+ getProps() {
447
+ return this.props;
448
+ }
449
+ attachResource(e) {
450
+ this._attachedResources.add(e);
451
+ }
452
+ detachResource(e) {
453
+ this._attachedResources.delete(e);
454
+ }
455
+ destroyAttachedResource(e) {
456
+ this._attachedResources.delete(e) && e.destroy();
457
+ }
458
+ destroyAttachedResources() {
459
+ for (let e of this._attachedResources) e.destroy();
460
+ this._attachedResources = /* @__PURE__ */ new Set();
461
+ }
462
+ destroyResource() {
463
+ this.destroyed ||= (this.destroyAttachedResources(), this.removeStats(), !0);
464
+ }
465
+ removeStats() {
466
+ let e = O(this._device), t = e ? k() : 0, n = [this._device.statsManager.getStats(b), this._device.statsManager.getStats(x)], r = D(this._device);
467
+ for (let e of n) E(e, r);
468
+ let i = this.getStatsName();
469
+ for (let e of n) e.get("Resources Active").decrementCount(), e.get(`${i}s Active`).decrementCount();
470
+ e && (e.statsBookkeepingCalls = (e.statsBookkeepingCalls || 0) + 1, e.statsBookkeepingTimeMs = (e.statsBookkeepingTimeMs || 0) + (k() - t));
471
+ }
472
+ trackAllocatedMemory(e, t = this.getStatsName()) {
473
+ let n = O(this._device), r = n ? k() : 0, i = this._device.statsManager.getStats(S);
474
+ this.allocatedBytes > 0 && this.allocatedBytesName && (i.get("GPU Memory").subtractCount(this.allocatedBytes), i.get(`${this.allocatedBytesName} Memory`).subtractCount(this.allocatedBytes)), i.get("GPU Memory").addCount(e), i.get(`${t} Memory`).addCount(e), n && (n.statsBookkeepingCalls = (n.statsBookkeepingCalls || 0) + 1, n.statsBookkeepingTimeMs = (n.statsBookkeepingTimeMs || 0) + (k() - r)), this.allocatedBytes = e, this.allocatedBytesName = t;
475
+ }
476
+ trackReferencedMemory(e, t = this.getStatsName()) {
477
+ this.trackAllocatedMemory(e, `External ${t}`);
478
+ }
479
+ trackDeallocatedMemory(e = this.getStatsName()) {
480
+ if (this.allocatedBytes === 0) {
481
+ this.allocatedBytesName = null;
482
+ return;
483
+ }
484
+ let t = O(this._device), n = t ? k() : 0, r = this._device.statsManager.getStats(S);
485
+ r.get("GPU Memory").subtractCount(this.allocatedBytes), r.get(`${this.allocatedBytesName || e} Memory`).subtractCount(this.allocatedBytes), t && (t.statsBookkeepingCalls = (t.statsBookkeepingCalls || 0) + 1, t.statsBookkeepingTimeMs = (t.statsBookkeepingTimeMs || 0) + (k() - n)), this.allocatedBytes = 0, this.allocatedBytesName = null;
486
+ }
487
+ trackDeallocatedReferencedMemory(e = this.getStatsName()) {
488
+ this.trackDeallocatedMemory(`Referenced ${e}`);
489
+ }
490
+ addStats() {
491
+ let e = this.getStatsName(), t = O(this._device), n = t ? k() : 0, r = [this._device.statsManager.getStats(b), this._device.statsManager.getStats(x)], i = D(this._device);
492
+ for (let e of r) E(e, i);
493
+ for (let t of r) t.get("Resources Created").incrementCount(), t.get("Resources Active").incrementCount(), t.get(`${e}s Created`).incrementCount(), t.get(`${e}s Active`).incrementCount();
494
+ t && (t.statsBookkeepingCalls = (t.statsBookkeepingCalls || 0) + 1, t.statsBookkeepingTimeMs = (t.statsBookkeepingTimeMs || 0) + (k() - n)), he(this._device, e);
495
+ }
496
+ getStatsName() {
497
+ return ge(this);
498
+ }
499
+ };
500
+ function me(e, t) {
501
+ let n = { ...t };
502
+ for (let t in e) e[t] !== void 0 && (n[t] = e[t]);
503
+ return n;
504
+ }
505
+ function E(e, t) {
506
+ let n = e.stats, r = !1;
507
+ for (let i of t) n[i] || (e.get(i), r = !0);
508
+ let i = Object.keys(n).length, a = C.get(e);
509
+ if (!r && a?.orderedStatNames === t && a.statCount === i) return;
510
+ let o = {}, s = w.get(t);
511
+ s || (s = new Set(t), w.set(t, s));
512
+ for (let e of t) n[e] && (o[e] = n[e]);
513
+ for (let [e, t] of Object.entries(n)) s.has(e) || (o[e] = t);
514
+ for (let e of Object.keys(n)) delete n[e];
515
+ Object.assign(n, o), C.set(e, {
516
+ orderedStatNames: t,
517
+ statCount: i
518
+ });
519
+ }
520
+ function D(e) {
521
+ return e.type === "webgl" ? pe : fe;
522
+ }
523
+ function O(e) {
524
+ let t = e.userData[le];
525
+ return t?.enabled ? t : null;
526
+ }
527
+ function k() {
528
+ return globalThis.performance?.now?.() ?? Date.now();
529
+ }
530
+ function he(e, t) {
531
+ let n = O(e);
532
+ if (n && n.activeDefaultFramebufferAcquireDepth) switch (n.transientCanvasResourceCreates = (n.transientCanvasResourceCreates || 0) + 1, t) {
533
+ case "Texture":
534
+ n.transientCanvasTextureCreates = (n.transientCanvasTextureCreates || 0) + 1;
535
+ break;
536
+ case "TextureView":
537
+ n.transientCanvasTextureViewCreates = (n.transientCanvasTextureViewCreates || 0) + 1;
538
+ break;
539
+ case "Sampler":
540
+ n.transientCanvasSamplerCreates = (n.transientCanvasSamplerCreates || 0) + 1;
541
+ break;
542
+ case "Framebuffer": n.transientCanvasFramebufferCreates = (n.transientCanvasFramebufferCreates || 0) + 1;
543
+ }
544
+ }
545
+ function ge(e) {
546
+ let t = Object.getPrototypeOf(e);
547
+ for (; t;) {
548
+ let n = Object.getPrototypeOf(t);
549
+ if (!n || n === T.prototype) return _e(t) || e[Symbol.toStringTag] || e.constructor.name;
550
+ t = n;
551
+ }
552
+ return e[Symbol.toStringTag] || e.constructor.name;
553
+ }
554
+ function _e(e) {
555
+ let t = Object.getOwnPropertyDescriptor(e, Symbol.toStringTag);
556
+ return typeof t?.get == "function" ? t.get.call(e) : typeof t?.value == "string" ? t.value : null;
557
+ }
558
+ //#endregion
559
+ //#region node_modules/@luma.gl/core/dist/adapter/resources/buffer.js
560
+ var ve = class e extends T {
561
+ static INDEX = 16;
562
+ static VERTEX = 32;
563
+ static UNIFORM = 64;
564
+ static STORAGE = 128;
565
+ static INDIRECT = 256;
566
+ static QUERY_RESOLVE = 512;
567
+ static MAP_READ = 1;
568
+ static MAP_WRITE = 2;
569
+ static COPY_SRC = 4;
570
+ static COPY_DST = 8;
571
+ get [Symbol.toStringTag]() {
572
+ return "Buffer";
573
+ }
574
+ usage;
575
+ indexType;
576
+ updateTimestamp;
577
+ constructor(t, n) {
578
+ let r = { ...n };
579
+ (n.usage || 0) & e.INDEX && !n.indexType && (n.data instanceof Uint32Array ? r.indexType = "uint32" : n.data instanceof Uint16Array ? r.indexType = "uint16" : n.data instanceof Uint8Array && (r.indexType = "uint8")), delete r.data, super(t, r, e.defaultProps), this.usage = r.usage || 0, this.indexType = r.indexType, this.updateTimestamp = t.incrementTimestamp();
580
+ }
581
+ clone(e) {
582
+ return this.device.createBuffer({
583
+ ...this.props,
584
+ ...e
585
+ });
586
+ }
587
+ static DEBUG_DATA_MAX_LENGTH = 32;
588
+ debugData = /* @__PURE__ */ new ArrayBuffer(0);
589
+ _setDebugData(t, n, r) {
590
+ if (!this.device.props.debug) return;
591
+ let i = null, a;
592
+ ArrayBuffer.isView(t) ? (i = t, a = t.buffer) : a = t;
593
+ let o = Math.min(t ? t.byteLength : r, e.DEBUG_DATA_MAX_LENGTH);
594
+ if (a === null) this.debugData = new ArrayBuffer(o);
595
+ else {
596
+ let e = Math.min(i?.byteOffset || 0, a.byteLength), t = Math.max(0, a.byteLength - e), n = Math.min(o, t);
597
+ this.debugData = new Uint8Array(a, e, n).slice().buffer;
598
+ }
599
+ }
600
+ static defaultProps = {
601
+ ...T.defaultProps,
602
+ handle: void 0,
603
+ usage: 0,
604
+ byteLength: 0,
605
+ byteOffset: 0,
606
+ data: null,
607
+ indexType: "uint16",
608
+ onMapped: void 0
609
+ };
610
+ }, A = globalThis.Float16Array;
611
+ function ye() {
612
+ return A ?? Uint16Array;
613
+ }
614
+ function be(e) {
615
+ return !!(A && e === A);
616
+ }
617
+ //#endregion
618
+ //#region node_modules/@luma.gl/core/dist/shadertypes/data-types/decode-data-types.js
619
+ function xe(e) {
620
+ let t = e.includes("norm"), n = !t && !e.startsWith("float"), r = e.startsWith("s"), [i, a, o] = F[e] || [
621
+ "uint8 ",
622
+ "i32",
623
+ 1
624
+ ];
625
+ return {
626
+ signedType: i,
627
+ primitiveType: a,
628
+ byteLength: o,
629
+ normalized: t,
630
+ integer: n,
631
+ signed: r
632
+ };
633
+ }
634
+ function Se(e) {
635
+ let t = e;
636
+ switch (t) {
637
+ case "uint8": return "unorm8";
638
+ case "sint8": return "snorm8";
639
+ case "uint16": return "unorm16";
640
+ case "sint16": return "snorm16";
641
+ default: return t;
642
+ }
643
+ }
644
+ function j(e, t) {
645
+ switch (t) {
646
+ case 1: return e;
647
+ case 2: return e + e % 2;
648
+ default: return e + (4 - e % 4) % 4;
649
+ }
650
+ }
651
+ function M(e) {
652
+ let t = ArrayBuffer.isView(e) ? e.constructor : e;
653
+ if (be(t)) return "float16";
654
+ if (t === Uint8ClampedArray) return "uint8";
655
+ let n = Object.values(F).find((e) => t === e[4]);
656
+ if (!n) throw Error(t.name);
657
+ return n[0];
658
+ }
659
+ function Ce(e) {
660
+ return M(e);
661
+ }
662
+ function N(e) {
663
+ if (e === "float16") return ye();
664
+ let t = F[e];
665
+ if (!t) throw Error(e);
666
+ let [, , , , n] = t;
667
+ return n;
668
+ }
669
+ function P(e) {
670
+ return N(e);
671
+ }
672
+ var F = {
673
+ uint8: [
674
+ "uint8",
675
+ "u32",
676
+ 1,
677
+ !1,
678
+ Uint8Array
679
+ ],
680
+ sint8: [
681
+ "sint8",
682
+ "i32",
683
+ 1,
684
+ !1,
685
+ Int8Array
686
+ ],
687
+ unorm8: [
688
+ "uint8",
689
+ "f32",
690
+ 1,
691
+ !0,
692
+ Uint8Array
693
+ ],
694
+ snorm8: [
695
+ "sint8",
696
+ "f32",
697
+ 1,
698
+ !0,
699
+ Int8Array
700
+ ],
701
+ uint16: [
702
+ "uint16",
703
+ "u32",
704
+ 2,
705
+ !1,
706
+ Uint16Array
707
+ ],
708
+ sint16: [
709
+ "sint16",
710
+ "i32",
711
+ 2,
712
+ !1,
713
+ Int16Array
714
+ ],
715
+ unorm16: [
716
+ "uint16",
717
+ "u32",
718
+ 2,
719
+ !0,
720
+ Uint16Array
721
+ ],
722
+ snorm16: [
723
+ "sint16",
724
+ "i32",
725
+ 2,
726
+ !0,
727
+ Int16Array
728
+ ],
729
+ float16: [
730
+ "float16",
731
+ "f16",
732
+ 2,
733
+ !1,
734
+ Uint16Array
735
+ ],
736
+ float32: [
737
+ "float32",
738
+ "f32",
739
+ 4,
740
+ !1,
741
+ Float32Array
742
+ ],
743
+ uint32: [
744
+ "uint32",
745
+ "u32",
746
+ 4,
747
+ !1,
748
+ Uint32Array
749
+ ],
750
+ sint32: [
751
+ "sint32",
752
+ "i32",
753
+ 4,
754
+ !1,
755
+ Int32Array
756
+ ]
757
+ }, I = new class {
758
+ getDataTypeInfo(e) {
759
+ return xe(e);
760
+ }
761
+ getNormalizedDataType(e) {
762
+ return Se(e);
763
+ }
764
+ alignTo(e, t) {
765
+ return j(e, t);
766
+ }
767
+ getDataType(e) {
768
+ return Ce(e);
769
+ }
770
+ getTypedArrayConstructor(e) {
771
+ return P(e);
772
+ }
773
+ }(), we = new class {
774
+ getVertexFormatInfo(e) {
775
+ if (e === "unorm10-10-10-2") return {
776
+ type: "unorm8",
777
+ components: 4,
778
+ byteLength: 4,
779
+ integer: !1,
780
+ signed: !1,
781
+ normalized: !0
782
+ };
783
+ let t = e === "unorm8x4-bgra" ? "unorm8x4" : e, n;
784
+ t.endsWith("-webgl") && (t = t.slice(0, -6), n = !0);
785
+ let r = t.split("x");
786
+ if (r.length > 2) throw Error(`Unsupported vertex format: ${e}`);
787
+ let [i, a] = r, o = i, s = Ee(e, a), c = Te(e, o), l;
788
+ try {
789
+ l = n ? De(e, o, s) : this.makeVertexFormat(c.signedType, s, c.normalized);
790
+ } catch {
791
+ throw Error(`Unsupported vertex format: ${e}`);
792
+ }
793
+ if (l !== (n ? e : t)) throw Error(`Unsupported vertex format: ${e}`);
794
+ let u = {
795
+ type: o,
796
+ components: s,
797
+ byteLength: c.byteLength * s,
798
+ integer: c.integer,
799
+ signed: c.signed,
800
+ normalized: c.normalized
801
+ };
802
+ return n && (u.webglOnly = !0), u;
803
+ }
804
+ makeVertexFormat(e, t, n) {
805
+ let r = n ? I.getNormalizedDataType(e) : e;
806
+ switch (r) {
807
+ case "unorm8": return t === 1 ? "unorm8" : t === 3 ? "unorm8x3-webgl" : `${r}x${t}`;
808
+ case "snorm8": return t === 1 ? "snorm8" : t === 3 ? "snorm8x3-webgl" : `${r}x${t}`;
809
+ case "uint8":
810
+ case "sint8":
811
+ if (t === 3) throw Error(`size: ${t}`);
812
+ return t === 1 ? r : `${r}x${t}`;
813
+ case "uint16": return t === 1 ? "uint16" : t === 3 ? "uint16x3-webgl" : `${r}x${t}`;
814
+ case "sint16": return t === 1 ? "sint16" : t === 3 ? "sint16x3-webgl" : `${r}x${t}`;
815
+ case "unorm16": return t === 1 ? "unorm16" : t === 3 ? "unorm16x3-webgl" : `${r}x${t}`;
816
+ case "snorm16": return t === 1 ? "snorm16" : t === 3 ? "snorm16x3-webgl" : `${r}x${t}`;
817
+ case "float16":
818
+ if (t === 3) throw Error(`size: ${t}`);
819
+ return t === 1 ? r : `${r}x${t}`;
820
+ default: return t === 1 ? r : `${r}x${t}`;
821
+ }
822
+ }
823
+ getVertexFormatFromAttribute(e, t, n) {
824
+ if (!t || t > 4) throw Error(`size ${t}`);
825
+ let r = t, i = I.getDataType(e);
826
+ return this.makeVertexFormat(i, r, n);
827
+ }
828
+ getCompatibleVertexFormat(e) {
829
+ let t;
830
+ switch (e.primitiveType) {
831
+ case "f32":
832
+ t = "float32";
833
+ break;
834
+ case "i32":
835
+ t = "sint32";
836
+ break;
837
+ case "u32":
838
+ t = "uint32";
839
+ break;
840
+ case "f16": return e.components <= 2 ? "float16x2" : "float16x4";
841
+ }
842
+ return e.components === 1 ? t : `${t}x${e.components}`;
843
+ }
844
+ }();
845
+ function Te(e, t) {
846
+ try {
847
+ return I.getDataTypeInfo(t);
848
+ } catch {
849
+ throw Error(`Unsupported vertex format: ${e}`);
850
+ }
851
+ }
852
+ function Ee(e, t) {
853
+ if (!t) return 1;
854
+ let n = Number(t);
855
+ if (n === 2 || n === 3 || n === 4) return n;
856
+ throw Error(`Unsupported vertex format: ${e}`);
857
+ }
858
+ function De(e, t, n) {
859
+ if (n !== 3) throw Error(`Unsupported vertex format: ${e}`);
860
+ switch (t) {
861
+ case "uint8":
862
+ case "sint8":
863
+ case "unorm8":
864
+ case "snorm8":
865
+ case "uint16":
866
+ case "sint16":
867
+ case "unorm16":
868
+ case "snorm16": return `${t}x3-webgl`;
869
+ default: throw Error(`Unsupported vertex format: ${e}`);
870
+ }
871
+ }
872
+ //#endregion
873
+ //#region node_modules/@luma.gl/core/dist/utils/assert.js
874
+ function L(e, t) {
875
+ if (!e) {
876
+ let e = Error(t ?? "luma.gl assertion failed.");
877
+ throw Error.captureStackTrace?.(e, L), e;
878
+ }
879
+ }
880
+ function Oe(e, t) {
881
+ return L(e, t), e;
882
+ }
883
+ //#endregion
884
+ //#region node_modules/@luma.gl/core/dist/adapter-utils/format-compiler-log.js
885
+ function ke(e, t, n) {
886
+ let r = "", i = t.split(/\r?\n/), a = e.slice().sort((e, t) => e.lineNum - t.lineNum);
887
+ switch (n?.showSourceCode || "no") {
888
+ case "all":
889
+ let t = 0;
890
+ for (let e = 1; e <= i.length; e++) {
891
+ let o = i[e - 1], s = a[t];
892
+ for (o && s && (r += z(o, e, n)); a.length > t && s.lineNum === e;) {
893
+ let e = a[t++];
894
+ e && (r += R(e, i, e.lineNum, {
895
+ ...n,
896
+ inlineSource: !1
897
+ }));
898
+ }
899
+ }
900
+ for (; a.length > t;) {
901
+ let e = a[t++];
902
+ e && (r += R(e, [], 0, {
903
+ ...n,
904
+ inlineSource: !1
905
+ }));
906
+ }
907
+ return r;
908
+ case "issues":
909
+ case "no":
910
+ for (let t of e) r += R(t, i, t.lineNum, { inlineSource: n?.showSourceCode !== "no" });
911
+ return r;
912
+ }
913
+ }
914
+ function R(e, t, n, r) {
915
+ if (r?.inlineSource) return `
916
+ ${Ae(t, n)}${e.linePos > 0 ? `${" ".repeat(e.linePos + 5)}^^^\n` : ""}${e.type.toUpperCase()}: ${e.message}
917
+
918
+ `;
919
+ let i = e.type === "error" ? "red" : "orange";
920
+ return r?.html ? `<div class='luma-compiler-log-${e.type}' style="color:${i};"><b> ${e.type.toUpperCase()}: ${e.message}</b></div>` : `${e.type.toUpperCase()}: ${e.message}`;
921
+ }
922
+ function Ae(e, t, n) {
923
+ let r = "";
924
+ for (let i = t - 2; i <= t; i++) {
925
+ let a = e[i - 1];
926
+ a !== void 0 && (r += z(a, t, n));
927
+ }
928
+ return r;
929
+ }
930
+ function z(e, t, n) {
931
+ let r = n?.html ? Me(e) : e;
932
+ return `${je(String(t), 4)}: ${r}${n?.html ? "<br/>" : "\n"}`;
933
+ }
934
+ function je(e, t) {
935
+ let n = "";
936
+ for (let r = e.length; r < t; ++r) n += " ";
937
+ return n + e;
938
+ }
939
+ function Me(e) {
940
+ return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&#039;");
941
+ }
942
+ //#endregion
943
+ //#region node_modules/@luma.gl/core/dist/adapter/resources/shader.js
944
+ var Ne = class e extends T {
945
+ get [Symbol.toStringTag]() {
946
+ return "Shader";
947
+ }
948
+ stage;
949
+ source;
950
+ compilationStatus = "pending";
951
+ constructor(t, n) {
952
+ n = {
953
+ ...n,
954
+ debugShaders: n.debugShaders || t.props.debugShaders || "errors"
955
+ }, super(t, {
956
+ id: Pe(n),
957
+ ...n
958
+ }, e.defaultProps), this.stage = this.props.stage, this.source = this.props.source;
959
+ }
960
+ getCompilationInfoSync() {
961
+ return null;
962
+ }
963
+ getTranslatedSource() {
964
+ return null;
965
+ }
966
+ async debugShader() {
967
+ let e = this.props.debugShaders;
968
+ switch (e) {
969
+ case "never": return;
970
+ case "errors": if (this.compilationStatus === "success") return;
971
+ }
972
+ try {
973
+ let t = await this.getCompilationInfo();
974
+ if (e === "warnings" && t?.length === 0) return;
975
+ this._displayShaderLog(t, this.id);
976
+ } catch (e) {
977
+ _.warn(`Shader ${this.id}: failed to fetch compilation info during debug logging`, e)();
978
+ }
979
+ }
980
+ _displayShaderLog(e, t) {
981
+ if (typeof document > "u" || !document?.createElement) return;
982
+ let n = t, r = `${this.stage} shader "${n}"`, i = ke(e, this.source, {
983
+ showSourceCode: "all",
984
+ html: !0
985
+ }), a = this.getTranslatedSource(), o = document.createElement("div");
986
+ o.innerHTML = `\
987
+ <h1>Compilation error in ${r}</h1>
988
+ <div style="display:flex;position:fixed;top:10px;right:20px;gap:2px;">
989
+ <button id="copy">Copy source</button><br/>
990
+ <button id="close">Close</button>
991
+ </div>
992
+ <code><pre>${i}</pre></code>`, a && (o.innerHTML += `<br /><h1>Translated Source</h1><br /><br /><code><pre>${a}</pre></code>`), o.style.top = "0", o.style.left = "0", o.style.background = "white", o.style.position = "fixed", o.style.zIndex = "9999", o.style.maxWidth = "100vw", o.style.maxHeight = "100vh", o.style.overflowY = "auto", document.body.appendChild(o), o.querySelector(".luma-compiler-log-error")?.scrollIntoView(), o.querySelector("button#close").onclick = () => {
993
+ o.remove();
994
+ }, o.querySelector("button#copy").onclick = () => {
995
+ navigator.clipboard.writeText(this.source);
996
+ };
997
+ }
998
+ static defaultProps = {
999
+ ...T.defaultProps,
1000
+ language: "auto",
1001
+ stage: void 0,
1002
+ source: "",
1003
+ sourceMap: null,
1004
+ entryPoint: "main",
1005
+ debugShaders: void 0
1006
+ };
1007
+ };
1008
+ function Pe(e) {
1009
+ return Fe(e.source) || e.id || y(`unnamed ${e.stage}-shader`);
1010
+ }
1011
+ function Fe(e, t = "unnamed") {
1012
+ return /#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(e)?.[1] ?? t;
1013
+ }
1014
+ //#endregion
1015
+ //#region node_modules/@luma.gl/core/dist/adapter/resources/render-pipeline.js
1016
+ var Ie = class e extends T {
1017
+ get [Symbol.toStringTag]() {
1018
+ return "RenderPipeline";
1019
+ }
1020
+ shaderLayout;
1021
+ bufferLayout;
1022
+ linkStatus = "pending";
1023
+ hash = "";
1024
+ sharedRenderPipeline = null;
1025
+ get isPending() {
1026
+ return this.linkStatus === "pending" || this.vs.compilationStatus === "pending" || this.fs?.compilationStatus === "pending";
1027
+ }
1028
+ get isErrored() {
1029
+ return this.linkStatus === "error" || this.vs.compilationStatus === "error" || this.fs?.compilationStatus === "error";
1030
+ }
1031
+ constructor(t, n) {
1032
+ super(t, n, e.defaultProps), this.shaderLayout = this.props.shaderLayout, this.bufferLayout = this.props.bufferLayout || [], this.sharedRenderPipeline = this.props._sharedRenderPipeline || null;
1033
+ }
1034
+ static defaultProps = {
1035
+ ...T.defaultProps,
1036
+ vs: null,
1037
+ vertexEntryPoint: "vertexMain",
1038
+ vsConstants: {},
1039
+ fs: null,
1040
+ fragmentEntryPoint: "fragmentMain",
1041
+ fsConstants: {},
1042
+ shaderLayout: null,
1043
+ bufferLayout: [],
1044
+ topology: "triangle-list",
1045
+ colorAttachmentFormats: void 0,
1046
+ depthStencilAttachmentFormat: void 0,
1047
+ parameters: {},
1048
+ varyings: void 0,
1049
+ bufferMode: void 0,
1050
+ disableWarnings: !1,
1051
+ _sharedRenderPipeline: void 0,
1052
+ _uniformBlockLayouts: [],
1053
+ bindings: void 0,
1054
+ bindGroups: void 0
1055
+ };
1056
+ };
1057
+ //#endregion
1058
+ //#region node_modules/@luma.gl/core/dist/shadertypes/shader-types/shader-type-decoder.js
1059
+ function B(e) {
1060
+ let t = Ue[H(e)];
1061
+ if (!t) throw Error(`Unsupported variable shader type: ${e}`);
1062
+ return t;
1063
+ }
1064
+ function Le(e) {
1065
+ let t = He[V(e)];
1066
+ if (!t) throw Error(`Unsupported attribute shader type: ${e}`);
1067
+ let [n, r] = t, i = n === "i32" || n === "u32", a = n !== "u32";
1068
+ return {
1069
+ primitiveType: n,
1070
+ components: r,
1071
+ byteLength: Ve[n] * r,
1072
+ integer: i,
1073
+ signed: a
1074
+ };
1075
+ }
1076
+ var Re = class {
1077
+ getVariableShaderTypeInfo(e) {
1078
+ return B(e);
1079
+ }
1080
+ getAttributeShaderTypeInfo(e) {
1081
+ return Le(e);
1082
+ }
1083
+ makeShaderAttributeType(e, t) {
1084
+ return ze(e, t);
1085
+ }
1086
+ resolveAttributeShaderTypeAlias(e) {
1087
+ return V(e);
1088
+ }
1089
+ resolveVariableShaderTypeAlias(e) {
1090
+ return H(e);
1091
+ }
1092
+ };
1093
+ function ze(e, t) {
1094
+ return t === 1 ? e : `vec${t}<${e}>`;
1095
+ }
1096
+ function V(e) {
1097
+ return We[e] || e;
1098
+ }
1099
+ function H(e) {
1100
+ return Ge[e] || e;
1101
+ }
1102
+ var Be = new Re(), Ve = {
1103
+ f32: 4,
1104
+ f16: 2,
1105
+ i32: 4,
1106
+ u32: 4
1107
+ }, He = {
1108
+ f32: ["f32", 1],
1109
+ "vec2<f32>": ["f32", 2],
1110
+ "vec3<f32>": ["f32", 3],
1111
+ "vec4<f32>": ["f32", 4],
1112
+ f16: ["f16", 1],
1113
+ "vec2<f16>": ["f16", 2],
1114
+ "vec3<f16>": ["f16", 3],
1115
+ "vec4<f16>": ["f16", 4],
1116
+ i32: ["i32", 1],
1117
+ "vec2<i32>": ["i32", 2],
1118
+ "vec3<i32>": ["i32", 3],
1119
+ "vec4<i32>": ["i32", 4],
1120
+ u32: ["u32", 1],
1121
+ "vec2<u32>": ["u32", 2],
1122
+ "vec3<u32>": ["u32", 3],
1123
+ "vec4<u32>": ["u32", 4]
1124
+ }, Ue = {
1125
+ f32: {
1126
+ type: "f32",
1127
+ components: 1
1128
+ },
1129
+ f16: {
1130
+ type: "f16",
1131
+ components: 1
1132
+ },
1133
+ i32: {
1134
+ type: "i32",
1135
+ components: 1
1136
+ },
1137
+ u32: {
1138
+ type: "u32",
1139
+ components: 1
1140
+ },
1141
+ "vec2<f32>": {
1142
+ type: "f32",
1143
+ components: 2
1144
+ },
1145
+ "vec3<f32>": {
1146
+ type: "f32",
1147
+ components: 3
1148
+ },
1149
+ "vec4<f32>": {
1150
+ type: "f32",
1151
+ components: 4
1152
+ },
1153
+ "vec2<f16>": {
1154
+ type: "f16",
1155
+ components: 2
1156
+ },
1157
+ "vec3<f16>": {
1158
+ type: "f16",
1159
+ components: 3
1160
+ },
1161
+ "vec4<f16>": {
1162
+ type: "f16",
1163
+ components: 4
1164
+ },
1165
+ "vec2<i32>": {
1166
+ type: "i32",
1167
+ components: 2
1168
+ },
1169
+ "vec3<i32>": {
1170
+ type: "i32",
1171
+ components: 3
1172
+ },
1173
+ "vec4<i32>": {
1174
+ type: "i32",
1175
+ components: 4
1176
+ },
1177
+ "vec2<u32>": {
1178
+ type: "u32",
1179
+ components: 2
1180
+ },
1181
+ "vec3<u32>": {
1182
+ type: "u32",
1183
+ components: 3
1184
+ },
1185
+ "vec4<u32>": {
1186
+ type: "u32",
1187
+ components: 4
1188
+ },
1189
+ "mat2x2<f32>": {
1190
+ type: "f32",
1191
+ components: 4
1192
+ },
1193
+ "mat2x3<f32>": {
1194
+ type: "f32",
1195
+ components: 6
1196
+ },
1197
+ "mat2x4<f32>": {
1198
+ type: "f32",
1199
+ components: 8
1200
+ },
1201
+ "mat3x2<f32>": {
1202
+ type: "f32",
1203
+ components: 6
1204
+ },
1205
+ "mat3x3<f32>": {
1206
+ type: "f32",
1207
+ components: 9
1208
+ },
1209
+ "mat3x4<f32>": {
1210
+ type: "f32",
1211
+ components: 12
1212
+ },
1213
+ "mat4x2<f32>": {
1214
+ type: "f32",
1215
+ components: 8
1216
+ },
1217
+ "mat4x3<f32>": {
1218
+ type: "f32",
1219
+ components: 12
1220
+ },
1221
+ "mat4x4<f32>": {
1222
+ type: "f32",
1223
+ components: 16
1224
+ },
1225
+ "mat2x2<f16>": {
1226
+ type: "f16",
1227
+ components: 4
1228
+ },
1229
+ "mat2x3<f16>": {
1230
+ type: "f16",
1231
+ components: 6
1232
+ },
1233
+ "mat2x4<f16>": {
1234
+ type: "f16",
1235
+ components: 8
1236
+ },
1237
+ "mat3x2<f16>": {
1238
+ type: "f16",
1239
+ components: 6
1240
+ },
1241
+ "mat3x3<f16>": {
1242
+ type: "f16",
1243
+ components: 9
1244
+ },
1245
+ "mat3x4<f16>": {
1246
+ type: "f16",
1247
+ components: 12
1248
+ },
1249
+ "mat4x2<f16>": {
1250
+ type: "f16",
1251
+ components: 8
1252
+ },
1253
+ "mat4x3<f16>": {
1254
+ type: "f16",
1255
+ components: 12
1256
+ },
1257
+ "mat4x4<f16>": {
1258
+ type: "f16",
1259
+ components: 16
1260
+ },
1261
+ "mat2x2<i32>": {
1262
+ type: "i32",
1263
+ components: 4
1264
+ },
1265
+ "mat2x3<i32>": {
1266
+ type: "i32",
1267
+ components: 6
1268
+ },
1269
+ "mat2x4<i32>": {
1270
+ type: "i32",
1271
+ components: 8
1272
+ },
1273
+ "mat3x2<i32>": {
1274
+ type: "i32",
1275
+ components: 6
1276
+ },
1277
+ "mat3x3<i32>": {
1278
+ type: "i32",
1279
+ components: 9
1280
+ },
1281
+ "mat3x4<i32>": {
1282
+ type: "i32",
1283
+ components: 12
1284
+ },
1285
+ "mat4x2<i32>": {
1286
+ type: "i32",
1287
+ components: 8
1288
+ },
1289
+ "mat4x3<i32>": {
1290
+ type: "i32",
1291
+ components: 12
1292
+ },
1293
+ "mat4x4<i32>": {
1294
+ type: "i32",
1295
+ components: 16
1296
+ },
1297
+ "mat2x2<u32>": {
1298
+ type: "u32",
1299
+ components: 4
1300
+ },
1301
+ "mat2x3<u32>": {
1302
+ type: "u32",
1303
+ components: 6
1304
+ },
1305
+ "mat2x4<u32>": {
1306
+ type: "u32",
1307
+ components: 8
1308
+ },
1309
+ "mat3x2<u32>": {
1310
+ type: "u32",
1311
+ components: 6
1312
+ },
1313
+ "mat3x3<u32>": {
1314
+ type: "u32",
1315
+ components: 9
1316
+ },
1317
+ "mat3x4<u32>": {
1318
+ type: "u32",
1319
+ components: 12
1320
+ },
1321
+ "mat4x2<u32>": {
1322
+ type: "u32",
1323
+ components: 8
1324
+ },
1325
+ "mat4x3<u32>": {
1326
+ type: "u32",
1327
+ components: 12
1328
+ },
1329
+ "mat4x4<u32>": {
1330
+ type: "u32",
1331
+ components: 16
1332
+ }
1333
+ }, We = {
1334
+ vec2i: "vec2<i32>",
1335
+ vec3i: "vec3<i32>",
1336
+ vec4i: "vec4<i32>",
1337
+ vec2u: "vec2<u32>",
1338
+ vec3u: "vec3<u32>",
1339
+ vec4u: "vec4<u32>",
1340
+ vec2f: "vec2<f32>",
1341
+ vec3f: "vec3<f32>",
1342
+ vec4f: "vec4<f32>",
1343
+ vec2h: "vec2<f16>",
1344
+ vec3h: "vec3<f16>",
1345
+ vec4h: "vec4<f16>"
1346
+ }, Ge = {
1347
+ vec2i: "vec2<i32>",
1348
+ vec3i: "vec3<i32>",
1349
+ vec4i: "vec4<i32>",
1350
+ vec2u: "vec2<u32>",
1351
+ vec3u: "vec3<u32>",
1352
+ vec4u: "vec4<u32>",
1353
+ vec2f: "vec2<f32>",
1354
+ vec3f: "vec3<f32>",
1355
+ vec4f: "vec4<f32>",
1356
+ vec2h: "vec2<f16>",
1357
+ vec3h: "vec3<f16>",
1358
+ vec4h: "vec4<f16>",
1359
+ mat2x2f: "mat2x2<f32>",
1360
+ mat2x3f: "mat2x3<f32>",
1361
+ mat2x4f: "mat2x4<f32>",
1362
+ mat3x2f: "mat3x2<f32>",
1363
+ mat3x3f: "mat3x3<f32>",
1364
+ mat3x4f: "mat3x4<f32>",
1365
+ mat4x2f: "mat4x2<f32>",
1366
+ mat4x3f: "mat4x3<f32>",
1367
+ mat4x4f: "mat4x4<f32>",
1368
+ mat2x2i: "mat2x2<i32>",
1369
+ mat2x3i: "mat2x3<i32>",
1370
+ mat2x4i: "mat2x4<i32>",
1371
+ mat3x2i: "mat3x2<i32>",
1372
+ mat3x3i: "mat3x3<i32>",
1373
+ mat3x4i: "mat3x4<i32>",
1374
+ mat4x2i: "mat4x2<i32>",
1375
+ mat4x3i: "mat4x3<i32>",
1376
+ mat4x4i: "mat4x4<i32>",
1377
+ mat2x2u: "mat2x2<u32>",
1378
+ mat2x3u: "mat2x3<u32>",
1379
+ mat2x4u: "mat2x4<u32>",
1380
+ mat3x2u: "mat3x2<u32>",
1381
+ mat3x3u: "mat3x3<u32>",
1382
+ mat3x4u: "mat3x4<u32>",
1383
+ mat4x2u: "mat4x2<u32>",
1384
+ mat4x3u: "mat4x3<u32>",
1385
+ mat4x4u: "mat4x4<u32>",
1386
+ mat2x2h: "mat2x2<f16>",
1387
+ mat2x3h: "mat2x3<f16>",
1388
+ mat2x4h: "mat2x4<f16>",
1389
+ mat3x2h: "mat3x2<f16>",
1390
+ mat3x3h: "mat3x3<f16>",
1391
+ mat3x4h: "mat3x4<f16>",
1392
+ mat4x2h: "mat4x2<f16>",
1393
+ mat4x3h: "mat4x3<f16>",
1394
+ mat4x4h: "mat4x4<f16>"
1395
+ };
1396
+ //#endregion
1397
+ //#region node_modules/@luma.gl/core/dist/shadertypes/shader-types/shader-block-layout.js
1398
+ function Ke(e, t = {}) {
1399
+ let n = { ...e }, r = t.layout ?? "std140", i = {}, a = 0;
1400
+ for (let [e, t] of Object.entries(n)) a = G(i, e, t, a, r);
1401
+ return a = j(a, q(n, r)), {
1402
+ layout: r,
1403
+ byteLength: a * 4,
1404
+ uniformTypes: n,
1405
+ fields: i
1406
+ };
1407
+ }
1408
+ function U(e, t) {
1409
+ let n = H(e), r = B(n), i = /^mat(\d)x(\d)<.+>$/.exec(n);
1410
+ if (i) {
1411
+ let e = Number(i[1]), a = Number(i[2]), o = J(a, n, r.type, t), s = qe(o.size, o.alignment, t);
1412
+ return {
1413
+ alignment: o.alignment,
1414
+ size: e * s,
1415
+ components: e * a,
1416
+ columns: e,
1417
+ rows: a,
1418
+ columnStride: s,
1419
+ shaderType: n,
1420
+ type: r.type
1421
+ };
1422
+ }
1423
+ let a = /^vec(\d)<.+>$/.exec(n);
1424
+ return a ? J(Number(a[1]), n, r.type, t) : {
1425
+ alignment: 1,
1426
+ size: 1,
1427
+ components: 1,
1428
+ columns: 1,
1429
+ rows: 1,
1430
+ columnStride: 1,
1431
+ shaderType: n,
1432
+ type: r.type
1433
+ };
1434
+ }
1435
+ function W(e) {
1436
+ return !!e && typeof e == "object" && !Array.isArray(e);
1437
+ }
1438
+ function G(e, t, n, r, i) {
1439
+ if (typeof n == "string") {
1440
+ let a = U(n, i), o = j(r, a.alignment);
1441
+ return e[t] = {
1442
+ offset: o,
1443
+ ...a
1444
+ }, o + a.size;
1445
+ }
1446
+ if (Array.isArray(n)) {
1447
+ if (Array.isArray(n[0])) throw Error(`Nested arrays are not supported for ${t}`);
1448
+ let a = n[0], o = n[1], s = Y(a, i), c = j(r, q(n, i));
1449
+ for (let n = 0; n < o; n++) G(e, `${t}[${n}]`, a, c + n * s, i);
1450
+ return c + s * o;
1451
+ }
1452
+ if (W(n)) {
1453
+ let a = q(n, i), o = j(r, a);
1454
+ for (let [r, a] of Object.entries(n)) o = G(e, `${t}.${r}`, a, o, i);
1455
+ return j(o, a);
1456
+ }
1457
+ throw Error(`Unsupported CompositeShaderType for ${t}`);
1458
+ }
1459
+ function K(e, t) {
1460
+ if (typeof e == "string") return U(e, t).size;
1461
+ if (Array.isArray(e)) {
1462
+ let n = e[0], r = e[1];
1463
+ if (Array.isArray(n)) throw Error("Nested arrays are not supported");
1464
+ return Y(n, t) * r;
1465
+ }
1466
+ let n = 0;
1467
+ for (let r of Object.values(e)) {
1468
+ let e = r;
1469
+ n = j(n, q(e, t)), n += K(e, t);
1470
+ }
1471
+ return j(n, q(e, t));
1472
+ }
1473
+ function q(e, t) {
1474
+ if (typeof e == "string") return U(e, t).alignment;
1475
+ if (Array.isArray(e)) {
1476
+ let n = e[0], r = q(n, t);
1477
+ return Z(t) ? Math.max(r, 4) : r;
1478
+ }
1479
+ let n = 1;
1480
+ for (let r of Object.values(e)) {
1481
+ let e = q(r, t);
1482
+ n = Math.max(n, e);
1483
+ }
1484
+ return Je(t) ? Math.max(n, 4) : n;
1485
+ }
1486
+ function J(e, t, n, r) {
1487
+ return {
1488
+ alignment: e === 2 ? 2 : 4,
1489
+ size: e === 3 ? 3 : e,
1490
+ components: e,
1491
+ columns: 1,
1492
+ rows: e,
1493
+ columnStride: e === 3 ? 3 : e,
1494
+ shaderType: t,
1495
+ type: n
1496
+ };
1497
+ }
1498
+ function Y(e, t) {
1499
+ return X(K(e, t), q(e, t), t);
1500
+ }
1501
+ function X(e, t, n) {
1502
+ return j(e, Z(n) ? 4 : t);
1503
+ }
1504
+ function qe(e, t, n) {
1505
+ return n === "std140" ? 4 : j(e, t);
1506
+ }
1507
+ function Z(e) {
1508
+ return e === "std140" || e === "wgsl-uniform";
1509
+ }
1510
+ function Je(e) {
1511
+ return e === "std140" || e === "wgsl-uniform";
1512
+ }
1513
+ //#endregion
1514
+ //#region node_modules/@luma.gl/core/dist/utils/array-utils-flat.js
1515
+ var Q;
1516
+ function $(e) {
1517
+ return (!Q || Q.byteLength < e) && (Q = new ArrayBuffer(e)), Q;
1518
+ }
1519
+ function Ye(e, t) {
1520
+ return new e($(e.BYTES_PER_ELEMENT * t), 0, t);
1521
+ }
1522
+ //#endregion
1523
+ export { r as C, i as S, ve as _, Ke as a, _ as b, Ie as c, Oe as d, we as f, N as g, P as h, W as i, Ne as l, M as m, $ as n, B as o, I as p, U as r, Be as s, Ye as t, L as u, T as v, n as w, g as x, y };