@loaders.gl/3d-tiles 4.0.0-alpha.12 → 4.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.min.js CHANGED
@@ -5689,23 +5689,23 @@
5689
5689
  var init_color = __esm({
5690
5690
  "../../node_modules/@probe.gl/log/dist/utils/color.js"() {
5691
5691
  init_dist();
5692
- (function(COLOR2) {
5693
- COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
5694
- COLOR2[COLOR2["RED"] = 31] = "RED";
5695
- COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
5696
- COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
5697
- COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
5698
- COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
5699
- COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
5700
- COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
5701
- COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
5702
- COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
5703
- COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
5704
- COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
5705
- COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
5706
- COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
5707
- COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
5708
- COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
5692
+ (function(COLOR3) {
5693
+ COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
5694
+ COLOR3[COLOR3["RED"] = 31] = "RED";
5695
+ COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
5696
+ COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
5697
+ COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
5698
+ COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
5699
+ COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
5700
+ COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
5701
+ COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
5702
+ COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
5703
+ COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
5704
+ COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
5705
+ COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
5706
+ COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
5707
+ COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
5708
+ COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
5709
5709
  })(COLOR || (COLOR = {}));
5710
5710
  BACKGROUND_INCREMENT = 10;
5711
5711
  }
@@ -12676,22 +12676,25 @@
12676
12676
  if (binaryByteLength) {
12677
12677
  internalBinaryBuffer = data.slice(24 + jsonByteLength);
12678
12678
  }
12679
- if ("bufferView" in subtree.tileAvailability) {
12680
- subtree.tileAvailability.explicitBitstream = await getExplicitBitstream(subtree, "tileAvailability", internalBinaryBuffer, context);
12681
- }
12682
- if ("bufferView" in subtree.contentAvailability) {
12683
- subtree.contentAvailability.explicitBitstream = await getExplicitBitstream(subtree, "contentAvailability", internalBinaryBuffer, context);
12684
- }
12685
- if ("bufferView" in subtree.childSubtreeAvailability) {
12686
- subtree.childSubtreeAvailability.explicitBitstream = await getExplicitBitstream(subtree, "childSubtreeAvailability", internalBinaryBuffer, context);
12679
+ await loadExplicitBitstream(subtree, subtree.tileAvailability, internalBinaryBuffer, context);
12680
+ if (Array.isArray(subtree.contentAvailability)) {
12681
+ for (const contentAvailability of subtree.contentAvailability) {
12682
+ await loadExplicitBitstream(subtree, contentAvailability, internalBinaryBuffer, context);
12683
+ }
12684
+ } else {
12685
+ await loadExplicitBitstream(subtree, subtree.contentAvailability, internalBinaryBuffer, context);
12687
12686
  }
12687
+ await loadExplicitBitstream(subtree, subtree.childSubtreeAvailability, internalBinaryBuffer, context);
12688
12688
  return subtree;
12689
12689
  }
12690
- async function getExplicitBitstream(subtree, name10, internalBinaryBuffer, context) {
12691
- const bufferViewIndex = subtree[name10].bufferView;
12690
+ async function loadExplicitBitstream(subtree, availabilityObject, internalBinaryBuffer, context) {
12691
+ const bufferViewIndex = Number.isFinite(availabilityObject.bitstream) ? availabilityObject.bitstream : availabilityObject.bufferView;
12692
+ if (typeof bufferViewIndex !== "number") {
12693
+ return;
12694
+ }
12692
12695
  const bufferView = subtree.bufferViews[bufferViewIndex];
12693
12696
  const buffer = subtree.buffers[bufferView.buffer];
12694
- if (!context?.url || !context.fetch) {
12697
+ if (!context?.baseUrl) {
12695
12698
  throw new Error("Url is not provided");
12696
12699
  }
12697
12700
  if (!context.fetch) {
@@ -12701,9 +12704,10 @@
12701
12704
  const bufferUri = `${context?.baseUrl || ""}/${buffer.uri}`;
12702
12705
  const response = await context.fetch(bufferUri);
12703
12706
  const data = await response.arrayBuffer();
12704
- return new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
12707
+ availabilityObject.explicitBitstream = new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
12708
+ return;
12705
12709
  }
12706
- return new Uint8Array(internalBinaryBuffer, bufferView.byteOffset, bufferView.byteLength);
12710
+ availabilityObject.explicitBitstream = new Uint8Array(internalBinaryBuffer, bufferView.byteOffset, bufferView.byteLength);
12707
12711
  }
12708
12712
  function parseUint64Value(buffer) {
12709
12713
  const dataView = new DataView(buffer);
@@ -12739,6 +12743,608 @@
12739
12743
  }
12740
12744
  });
12741
12745
 
12746
+ // node_modules/@probe.gl/env/dist/lib/is-electron.js
12747
+ function isElectron2(mockUserAgent) {
12748
+ if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
12749
+ return true;
12750
+ }
12751
+ if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
12752
+ return true;
12753
+ }
12754
+ const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
12755
+ const userAgent = mockUserAgent || realUserAgent;
12756
+ if (userAgent && userAgent.indexOf("Electron") >= 0) {
12757
+ return true;
12758
+ }
12759
+ return false;
12760
+ }
12761
+ var init_is_electron2 = __esm({
12762
+ "node_modules/@probe.gl/env/dist/lib/is-electron.js"() {
12763
+ }
12764
+ });
12765
+
12766
+ // node_modules/@probe.gl/env/dist/lib/is-browser.js
12767
+ function isBrowser5() {
12768
+ const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
12769
+ return !isNode || isElectron2();
12770
+ }
12771
+ var init_is_browser2 = __esm({
12772
+ "node_modules/@probe.gl/env/dist/lib/is-browser.js"() {
12773
+ init_is_electron2();
12774
+ }
12775
+ });
12776
+
12777
+ // node_modules/@probe.gl/env/dist/lib/globals.js
12778
+ var self_4, window_4, document_4, process_2, console_2, navigator_2;
12779
+ var init_globals5 = __esm({
12780
+ "node_modules/@probe.gl/env/dist/lib/globals.js"() {
12781
+ self_4 = globalThis.self || globalThis.window || globalThis.global;
12782
+ window_4 = globalThis.window || globalThis.self || globalThis.global;
12783
+ document_4 = globalThis.document || {};
12784
+ process_2 = globalThis.process || {};
12785
+ console_2 = globalThis.console;
12786
+ navigator_2 = globalThis.navigator || {};
12787
+ }
12788
+ });
12789
+
12790
+ // node_modules/@probe.gl/env/dist/utils/globals.js
12791
+ var VERSION10, isBrowser6;
12792
+ var init_globals6 = __esm({
12793
+ "node_modules/@probe.gl/env/dist/utils/globals.js"() {
12794
+ init_is_browser2();
12795
+ VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
12796
+ isBrowser6 = isBrowser5();
12797
+ }
12798
+ });
12799
+
12800
+ // node_modules/@probe.gl/env/dist/index.js
12801
+ var init_dist3 = __esm({
12802
+ "node_modules/@probe.gl/env/dist/index.js"() {
12803
+ init_globals6();
12804
+ init_globals5();
12805
+ init_is_browser2();
12806
+ }
12807
+ });
12808
+
12809
+ // node_modules/@probe.gl/log/dist/utils/local-storage.js
12810
+ function getStorage2(type) {
12811
+ try {
12812
+ const storage = window[type];
12813
+ const x = "__storage_test__";
12814
+ storage.setItem(x, x);
12815
+ storage.removeItem(x);
12816
+ return storage;
12817
+ } catch (e) {
12818
+ return null;
12819
+ }
12820
+ }
12821
+ var LocalStorage2;
12822
+ var init_local_storage2 = __esm({
12823
+ "node_modules/@probe.gl/log/dist/utils/local-storage.js"() {
12824
+ LocalStorage2 = class {
12825
+ constructor(id, defaultConfig) {
12826
+ let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
12827
+ this.storage = void 0;
12828
+ this.id = void 0;
12829
+ this.config = void 0;
12830
+ this.storage = getStorage2(type);
12831
+ this.id = id;
12832
+ this.config = defaultConfig;
12833
+ this._loadConfiguration();
12834
+ }
12835
+ getConfiguration() {
12836
+ return this.config;
12837
+ }
12838
+ setConfiguration(configuration) {
12839
+ Object.assign(this.config, configuration);
12840
+ if (this.storage) {
12841
+ const serialized = JSON.stringify(this.config);
12842
+ this.storage.setItem(this.id, serialized);
12843
+ }
12844
+ }
12845
+ _loadConfiguration() {
12846
+ let configuration = {};
12847
+ if (this.storage) {
12848
+ const serializedConfiguration = this.storage.getItem(this.id);
12849
+ configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
12850
+ }
12851
+ Object.assign(this.config, configuration);
12852
+ return this;
12853
+ }
12854
+ };
12855
+ }
12856
+ });
12857
+
12858
+ // node_modules/@probe.gl/log/dist/utils/formatters.js
12859
+ function formatTime2(ms) {
12860
+ let formatted;
12861
+ if (ms < 10) {
12862
+ formatted = "".concat(ms.toFixed(2), "ms");
12863
+ } else if (ms < 100) {
12864
+ formatted = "".concat(ms.toFixed(1), "ms");
12865
+ } else if (ms < 1e3) {
12866
+ formatted = "".concat(ms.toFixed(0), "ms");
12867
+ } else {
12868
+ formatted = "".concat((ms / 1e3).toFixed(2), "s");
12869
+ }
12870
+ return formatted;
12871
+ }
12872
+ function leftPad2(string) {
12873
+ let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
12874
+ const padLength = Math.max(length4 - string.length, 0);
12875
+ return "".concat(" ".repeat(padLength)).concat(string);
12876
+ }
12877
+ function formatImage2(image, message, scale5) {
12878
+ let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
12879
+ const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
12880
+ if (image.width > maxWidth) {
12881
+ scale5 = Math.min(scale5, maxWidth / image.width);
12882
+ }
12883
+ const width = image.width * scale5;
12884
+ const height = image.height * scale5;
12885
+ const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
12886
+ return ["".concat(message, " %c+"), style];
12887
+ }
12888
+ var init_formatters2 = __esm({
12889
+ "node_modules/@probe.gl/log/dist/utils/formatters.js"() {
12890
+ }
12891
+ });
12892
+
12893
+ // node_modules/@probe.gl/log/dist/utils/color.js
12894
+ function getColor2(color) {
12895
+ if (typeof color !== "string") {
12896
+ return color;
12897
+ }
12898
+ color = color.toUpperCase();
12899
+ return COLOR2[color] || COLOR2.WHITE;
12900
+ }
12901
+ function addColor2(string, color, background) {
12902
+ if (!isBrowser5 && typeof string === "string") {
12903
+ if (color) {
12904
+ const colorCode = getColor2(color);
12905
+ string = "[".concat(colorCode, "m").concat(string, "");
12906
+ }
12907
+ if (background) {
12908
+ const colorCode = getColor2(background);
12909
+ string = "[".concat(colorCode + BACKGROUND_INCREMENT2, "m").concat(string, "");
12910
+ }
12911
+ }
12912
+ return string;
12913
+ }
12914
+ var COLOR2, BACKGROUND_INCREMENT2;
12915
+ var init_color2 = __esm({
12916
+ "node_modules/@probe.gl/log/dist/utils/color.js"() {
12917
+ init_dist3();
12918
+ (function(COLOR3) {
12919
+ COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
12920
+ COLOR3[COLOR3["RED"] = 31] = "RED";
12921
+ COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
12922
+ COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
12923
+ COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
12924
+ COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
12925
+ COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
12926
+ COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
12927
+ COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
12928
+ COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
12929
+ COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
12930
+ COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
12931
+ COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
12932
+ COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
12933
+ COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
12934
+ COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
12935
+ })(COLOR2 || (COLOR2 = {}));
12936
+ BACKGROUND_INCREMENT2 = 10;
12937
+ }
12938
+ });
12939
+
12940
+ // node_modules/@probe.gl/log/dist/utils/autobind.js
12941
+ function autobind2(obj) {
12942
+ let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
12943
+ const proto = Object.getPrototypeOf(obj);
12944
+ const propNames = Object.getOwnPropertyNames(proto);
12945
+ const object = obj;
12946
+ for (const key of propNames) {
12947
+ const value = object[key];
12948
+ if (typeof value === "function") {
12949
+ if (!predefined.find((name10) => key === name10)) {
12950
+ object[key] = value.bind(obj);
12951
+ }
12952
+ }
12953
+ }
12954
+ }
12955
+ var init_autobind2 = __esm({
12956
+ "node_modules/@probe.gl/log/dist/utils/autobind.js"() {
12957
+ }
12958
+ });
12959
+
12960
+ // node_modules/@probe.gl/log/dist/utils/assert.js
12961
+ function assert8(condition, message) {
12962
+ if (!condition) {
12963
+ throw new Error(message || "Assertion failed");
12964
+ }
12965
+ }
12966
+ var init_assert7 = __esm({
12967
+ "node_modules/@probe.gl/log/dist/utils/assert.js"() {
12968
+ }
12969
+ });
12970
+
12971
+ // node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
12972
+ function getHiResTimestamp2() {
12973
+ let timestamp;
12974
+ if (isBrowser5() && window_4.performance) {
12975
+ var _window$performance, _window$performance$n;
12976
+ timestamp = window_4 === null || window_4 === void 0 ? void 0 : (_window$performance = window_4.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);
12977
+ } else if ("hrtime" in process_2) {
12978
+ var _process$hrtime;
12979
+ const timeParts = process_2 === null || process_2 === void 0 ? void 0 : (_process$hrtime = process_2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_2);
12980
+ timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
12981
+ } else {
12982
+ timestamp = Date.now();
12983
+ }
12984
+ return timestamp;
12985
+ }
12986
+ var init_hi_res_timestamp2 = __esm({
12987
+ "node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js"() {
12988
+ init_dist3();
12989
+ }
12990
+ });
12991
+
12992
+ // node_modules/@probe.gl/log/dist/log.js
12993
+ function noop2() {
12994
+ }
12995
+ function normalizeLogLevel2(logLevel) {
12996
+ if (!logLevel) {
12997
+ return 0;
12998
+ }
12999
+ let resolvedLevel;
13000
+ switch (typeof logLevel) {
13001
+ case "number":
13002
+ resolvedLevel = logLevel;
13003
+ break;
13004
+ case "object":
13005
+ resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
13006
+ break;
13007
+ default:
13008
+ return 0;
13009
+ }
13010
+ assert8(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
13011
+ return resolvedLevel;
13012
+ }
13013
+ function normalizeArguments2(opts) {
13014
+ const {
13015
+ logLevel,
13016
+ message
13017
+ } = opts;
13018
+ opts.logLevel = normalizeLogLevel2(logLevel);
13019
+ const args = opts.args ? Array.from(opts.args) : [];
13020
+ while (args.length && args.shift() !== message) {
13021
+ }
13022
+ switch (typeof logLevel) {
13023
+ case "string":
13024
+ case "function":
13025
+ if (message !== void 0) {
13026
+ args.unshift(message);
13027
+ }
13028
+ opts.message = logLevel;
13029
+ break;
13030
+ case "object":
13031
+ Object.assign(opts, logLevel);
13032
+ break;
13033
+ default:
13034
+ }
13035
+ if (typeof opts.message === "function") {
13036
+ opts.message = opts.message();
13037
+ }
13038
+ const messageType = typeof opts.message;
13039
+ assert8(messageType === "string" || messageType === "object");
13040
+ return Object.assign(opts, {
13041
+ args
13042
+ }, opts.opts);
13043
+ }
13044
+ function decorateMessage2(id, message, opts) {
13045
+ if (typeof message === "string") {
13046
+ const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
13047
+ message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
13048
+ message = addColor2(message, opts.color, opts.background);
13049
+ }
13050
+ return message;
13051
+ }
13052
+ function logImageInNode2(_ref2) {
13053
+ let {
13054
+ image,
13055
+ message = "",
13056
+ scale: scale5 = 1
13057
+ } = _ref2;
13058
+ console.warn("removed");
13059
+ return noop2;
13060
+ }
13061
+ function logImageInBrowser2(_ref3) {
13062
+ let {
13063
+ image,
13064
+ message = "",
13065
+ scale: scale5 = 1
13066
+ } = _ref3;
13067
+ if (typeof image === "string") {
13068
+ const img = new Image();
13069
+ img.onload = () => {
13070
+ const args = formatImage2(img, message, scale5);
13071
+ console.log(...args);
13072
+ };
13073
+ img.src = image;
13074
+ return noop2;
13075
+ }
13076
+ const element = image.nodeName || "";
13077
+ if (element.toLowerCase() === "img") {
13078
+ console.log(...formatImage2(image, message, scale5));
13079
+ return noop2;
13080
+ }
13081
+ if (element.toLowerCase() === "canvas") {
13082
+ const img = new Image();
13083
+ img.onload = () => console.log(...formatImage2(img, message, scale5));
13084
+ img.src = image.toDataURL();
13085
+ return noop2;
13086
+ }
13087
+ return noop2;
13088
+ }
13089
+ function getTableHeader2(table) {
13090
+ for (const key in table) {
13091
+ for (const title in table[key]) {
13092
+ return title || "untitled";
13093
+ }
13094
+ }
13095
+ return "empty";
13096
+ }
13097
+ var originalConsole2, DEFAULT_LOG_CONFIGURATION2, cache2, ONCE2, Log2;
13098
+ var init_log3 = __esm({
13099
+ "node_modules/@probe.gl/log/dist/log.js"() {
13100
+ init_dist3();
13101
+ init_local_storage2();
13102
+ init_formatters2();
13103
+ init_color2();
13104
+ init_autobind2();
13105
+ init_assert7();
13106
+ init_hi_res_timestamp2();
13107
+ originalConsole2 = {
13108
+ debug: isBrowser5() ? console.debug || console.log : console.log,
13109
+ log: console.log,
13110
+ info: console.info,
13111
+ warn: console.warn,
13112
+ error: console.error
13113
+ };
13114
+ DEFAULT_LOG_CONFIGURATION2 = {
13115
+ enabled: true,
13116
+ level: 0
13117
+ };
13118
+ cache2 = {};
13119
+ ONCE2 = {
13120
+ once: true
13121
+ };
13122
+ Log2 = class {
13123
+ constructor() {
13124
+ let {
13125
+ id
13126
+ } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
13127
+ id: ""
13128
+ };
13129
+ this.id = void 0;
13130
+ this.VERSION = VERSION10;
13131
+ this._startTs = getHiResTimestamp2();
13132
+ this._deltaTs = getHiResTimestamp2();
13133
+ this._storage = void 0;
13134
+ this.userData = {};
13135
+ this.LOG_THROTTLE_TIMEOUT = 0;
13136
+ this.id = id;
13137
+ this.userData = {};
13138
+ this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_LOG_CONFIGURATION2);
13139
+ this.timeStamp("".concat(this.id, " started"));
13140
+ autobind2(this);
13141
+ Object.seal(this);
13142
+ }
13143
+ set level(newLevel) {
13144
+ this.setLevel(newLevel);
13145
+ }
13146
+ get level() {
13147
+ return this.getLevel();
13148
+ }
13149
+ isEnabled() {
13150
+ return this._storage.config.enabled;
13151
+ }
13152
+ getLevel() {
13153
+ return this._storage.config.level;
13154
+ }
13155
+ getTotal() {
13156
+ return Number((getHiResTimestamp2() - this._startTs).toPrecision(10));
13157
+ }
13158
+ getDelta() {
13159
+ return Number((getHiResTimestamp2() - this._deltaTs).toPrecision(10));
13160
+ }
13161
+ set priority(newPriority) {
13162
+ this.level = newPriority;
13163
+ }
13164
+ get priority() {
13165
+ return this.level;
13166
+ }
13167
+ getPriority() {
13168
+ return this.level;
13169
+ }
13170
+ enable() {
13171
+ let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
13172
+ this._storage.setConfiguration({
13173
+ enabled
13174
+ });
13175
+ return this;
13176
+ }
13177
+ setLevel(level) {
13178
+ this._storage.setConfiguration({
13179
+ level
13180
+ });
13181
+ return this;
13182
+ }
13183
+ get(setting) {
13184
+ return this._storage.config[setting];
13185
+ }
13186
+ set(setting, value) {
13187
+ this._storage.setConfiguration({
13188
+ [setting]: value
13189
+ });
13190
+ }
13191
+ settings() {
13192
+ if (console.table) {
13193
+ console.table(this._storage.config);
13194
+ } else {
13195
+ console.log(this._storage.config);
13196
+ }
13197
+ }
13198
+ assert(condition, message) {
13199
+ assert8(condition, message);
13200
+ }
13201
+ warn(message) {
13202
+ return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
13203
+ }
13204
+ error(message) {
13205
+ return this._getLogFunction(0, message, originalConsole2.error, arguments);
13206
+ }
13207
+ deprecated(oldUsage, newUsage) {
13208
+ return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
13209
+ }
13210
+ removed(oldUsage, newUsage) {
13211
+ return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
13212
+ }
13213
+ probe(logLevel, message) {
13214
+ return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
13215
+ time: true,
13216
+ once: true
13217
+ });
13218
+ }
13219
+ log(logLevel, message) {
13220
+ return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
13221
+ }
13222
+ info(logLevel, message) {
13223
+ return this._getLogFunction(logLevel, message, console.info, arguments);
13224
+ }
13225
+ once(logLevel, message) {
13226
+ return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
13227
+ }
13228
+ table(logLevel, table, columns) {
13229
+ if (table) {
13230
+ return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
13231
+ tag: getTableHeader2(table)
13232
+ });
13233
+ }
13234
+ return noop2;
13235
+ }
13236
+ image(_ref) {
13237
+ let {
13238
+ logLevel,
13239
+ priority,
13240
+ image,
13241
+ message = "",
13242
+ scale: scale5 = 1
13243
+ } = _ref;
13244
+ if (!this._shouldLog(logLevel || priority)) {
13245
+ return noop2;
13246
+ }
13247
+ return isBrowser5() ? logImageInBrowser2({
13248
+ image,
13249
+ message,
13250
+ scale: scale5
13251
+ }) : logImageInNode2({
13252
+ image,
13253
+ message,
13254
+ scale: scale5
13255
+ });
13256
+ }
13257
+ time(logLevel, message) {
13258
+ return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
13259
+ }
13260
+ timeEnd(logLevel, message) {
13261
+ return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
13262
+ }
13263
+ timeStamp(logLevel, message) {
13264
+ return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
13265
+ }
13266
+ group(logLevel, message) {
13267
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
13268
+ collapsed: false
13269
+ };
13270
+ const options = normalizeArguments2({
13271
+ logLevel,
13272
+ message,
13273
+ opts
13274
+ });
13275
+ const {
13276
+ collapsed
13277
+ } = opts;
13278
+ options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
13279
+ return this._getLogFunction(options);
13280
+ }
13281
+ groupCollapsed(logLevel, message) {
13282
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
13283
+ return this.group(logLevel, message, Object.assign({}, opts, {
13284
+ collapsed: true
13285
+ }));
13286
+ }
13287
+ groupEnd(logLevel) {
13288
+ return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
13289
+ }
13290
+ withGroup(logLevel, message, func) {
13291
+ this.group(logLevel, message)();
13292
+ try {
13293
+ func();
13294
+ } finally {
13295
+ this.groupEnd(logLevel)();
13296
+ }
13297
+ }
13298
+ trace() {
13299
+ if (console.trace) {
13300
+ console.trace();
13301
+ }
13302
+ }
13303
+ _shouldLog(logLevel) {
13304
+ return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
13305
+ }
13306
+ _getLogFunction(logLevel, message, method, args, opts) {
13307
+ if (this._shouldLog(logLevel)) {
13308
+ opts = normalizeArguments2({
13309
+ logLevel,
13310
+ message,
13311
+ args,
13312
+ opts
13313
+ });
13314
+ method = method || opts.method;
13315
+ assert8(method);
13316
+ opts.total = this.getTotal();
13317
+ opts.delta = this.getDelta();
13318
+ this._deltaTs = getHiResTimestamp2();
13319
+ const tag = opts.tag || opts.message;
13320
+ if (opts.once && tag) {
13321
+ if (!cache2[tag]) {
13322
+ cache2[tag] = getHiResTimestamp2();
13323
+ } else {
13324
+ return noop2;
13325
+ }
13326
+ }
13327
+ message = decorateMessage2(this.id, opts.message, opts);
13328
+ return method.bind(console, message, ...opts.args);
13329
+ }
13330
+ return noop2;
13331
+ }
13332
+ };
13333
+ Log2.VERSION = VERSION10;
13334
+ }
13335
+ });
13336
+
13337
+ // node_modules/@probe.gl/log/dist/index.js
13338
+ var dist_default2;
13339
+ var init_dist4 = __esm({
13340
+ "node_modules/@probe.gl/log/dist/index.js"() {
13341
+ init_log3();
13342
+ dist_default2 = new Log2({
13343
+ id: "@probe.gl/log"
13344
+ });
13345
+ }
13346
+ });
13347
+
12742
13348
  // ../../node_modules/long/index.js
12743
13349
  function Long(low, high, unsigned) {
12744
13350
  this.low = low | 0;
@@ -12753,27 +13359,27 @@
12753
13359
  return value ? 31 - c : c;
12754
13360
  }
12755
13361
  function fromInt(value, unsigned) {
12756
- var obj, cachedObj, cache2;
13362
+ var obj, cachedObj, cache3;
12757
13363
  if (unsigned) {
12758
13364
  value >>>= 0;
12759
- if (cache2 = 0 <= value && value < 256) {
13365
+ if (cache3 = 0 <= value && value < 256) {
12760
13366
  cachedObj = UINT_CACHE[value];
12761
13367
  if (cachedObj)
12762
13368
  return cachedObj;
12763
13369
  }
12764
13370
  obj = fromBits(value, 0, true);
12765
- if (cache2)
13371
+ if (cache3)
12766
13372
  UINT_CACHE[value] = obj;
12767
13373
  return obj;
12768
13374
  } else {
12769
13375
  value |= 0;
12770
- if (cache2 = -128 <= value && value < 128) {
13376
+ if (cache3 = -128 <= value && value < 128) {
12771
13377
  cachedObj = INT_CACHE[value];
12772
13378
  if (cachedObj)
12773
13379
  return cachedObj;
12774
13380
  }
12775
13381
  obj = fromBits(value, value < 0 ? -1 : 0, false);
12776
- if (cache2)
13382
+ if (cache3)
12777
13383
  INT_CACHE[value] = obj;
12778
13384
  return obj;
12779
13385
  }
@@ -14088,11 +14694,20 @@
14088
14694
  return tile;
14089
14695
  }
14090
14696
  function getAvailabilityResult(availabilityData, index) {
14091
- if ("constant" in availabilityData) {
14092
- return Boolean(availabilityData.constant);
14697
+ let availabilityObject;
14698
+ if (Array.isArray(availabilityData)) {
14699
+ availabilityObject = availabilityData[0];
14700
+ if (availabilityData.length > 1) {
14701
+ dist_default2.once('Not supported extension "3DTILES_multiple_contents" has been detected');
14702
+ }
14703
+ } else {
14704
+ availabilityObject = availabilityData;
14705
+ }
14706
+ if ("constant" in availabilityObject) {
14707
+ return Boolean(availabilityObject.constant);
14093
14708
  }
14094
- if (availabilityData.explicitBitstream) {
14095
- return getBooleanValueFromBitstream(index, availabilityData.explicitBitstream);
14709
+ if (availabilityObject.explicitBitstream) {
14710
+ return getBooleanValueFromBitstream(index, availabilityObject.explicitBitstream);
14096
14711
  }
14097
14712
  return false;
14098
14713
  }
@@ -14172,6 +14787,7 @@
14172
14787
  "src/lib/parsers/helpers/parse-3d-implicit-tiles.ts"() {
14173
14788
  init_tile_3d_subtree_loader();
14174
14789
  init_src3();
14790
+ init_dist4();
14175
14791
  init_s2();
14176
14792
  init_s2_corners_to_obb();
14177
14793
  QUADTREE_DEVISION_COUNT = 4;