@loaders.gl/pointclouds 5.0.0-beta.4 → 5.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LAS-README.md +1 -1
- package/PCD-README.md +1 -1
- package/PLY-README.md +1 -1
- package/README.md +1 -1
- package/dist/dist.dev.js +129 -90
- package/dist/dist.min.js +20 -20
- package/dist/las/las-loader-shared.cjs +1 -1
- package/dist/las/las-loader-shared.js +1 -1
- package/dist/las/las-loader-types.d.ts +2 -2
- package/dist/las/las-loader.cjs +4 -4
- package/dist/las/las-loader.cjs.map +2 -2
- package/dist/las/las-loader.d.ts +1 -1
- package/dist/las/las-loader.d.ts.map +1 -1
- package/dist/las/las-loader.js +1 -1
- package/dist/las/las-loader.js.map +1 -1
- package/dist/las/las-writer.cjs +1 -1
- package/dist/las/las-writer.js +1 -1
- package/dist/las-loader.cjs +4 -4
- package/dist/las-loader.cjs.map +2 -2
- package/dist/las-worker.js +303 -80
- package/dist/las-writer.cjs +1 -1
- package/dist/pcd/pcd-loader-types.cjs +3 -3
- package/dist/pcd/pcd-loader-types.cjs.map +2 -2
- package/dist/pcd/pcd-loader-types.d.ts +1 -1
- package/dist/pcd/pcd-loader-types.d.ts.map +1 -1
- package/dist/pcd/pcd-loader-types.js +2 -2
- package/dist/pcd/pcd-loader-types.js.map +1 -1
- package/dist/pcd/pcd-loader.cjs +4 -4
- package/dist/pcd/pcd-loader.cjs.map +2 -2
- package/dist/pcd/pcd-loader.d.ts +1 -1
- package/dist/pcd/pcd-loader.d.ts.map +1 -1
- package/dist/pcd/pcd-loader.js +1 -1
- package/dist/pcd/pcd-loader.js.map +1 -1
- package/dist/pcd/pcd-writer.cjs +1 -1
- package/dist/pcd/pcd-writer.js +1 -1
- package/dist/pcd-loader-types.cjs +3 -3
- package/dist/pcd-loader-types.cjs.map +2 -2
- package/dist/pcd-loader.cjs +4 -4
- package/dist/pcd-loader.cjs.map +2 -2
- package/dist/pcd-worker.js +568 -287
- package/dist/pcd-writer.cjs +1 -1
- package/dist/ply/ply-loader-types.cjs +3 -3
- package/dist/ply/ply-loader-types.cjs.map +2 -2
- package/dist/ply/ply-loader-types.d.ts +1 -1
- package/dist/ply/ply-loader-types.d.ts.map +1 -1
- package/dist/ply/ply-loader-types.js +2 -2
- package/dist/ply/ply-loader-types.js.map +1 -1
- package/dist/ply/ply-loader.cjs +4 -4
- package/dist/ply/ply-loader.cjs.map +2 -2
- package/dist/ply/ply-loader.d.ts +1 -1
- package/dist/ply/ply-loader.d.ts.map +1 -1
- package/dist/ply/ply-loader.js +1 -1
- package/dist/ply/ply-loader.js.map +1 -1
- package/dist/ply/ply-writer.cjs +1 -1
- package/dist/ply/ply-writer.js +1 -1
- package/dist/ply-loader-types.cjs +3 -3
- package/dist/ply-loader-types.cjs.map +2 -2
- package/dist/ply-loader.cjs +4 -4
- package/dist/ply-loader.cjs.map +2 -2
- package/dist/ply-worker.js +394 -113
- package/dist/ply-writer.cjs +1 -1
- package/package.json +3 -3
- package/src/las/las-loader.ts +1 -1
- package/src/pcd/pcd-loader-types.ts +1 -1
- package/src/pcd/pcd-loader.ts +1 -1
- package/src/ply/ply-loader-types.ts +1 -1
- package/src/ply/ply-loader.ts +1 -1
package/dist/ply-worker.js
CHANGED
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
// ../../node_modules/@math.gl/
|
|
18
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/node/worker_threads-browser.js
|
|
19
19
|
var parentPort;
|
|
20
20
|
var init_worker_threads_browser = __esm({
|
|
21
|
-
"../../node_modules/@math.gl/
|
|
21
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/node/worker_threads-browser.js"() {
|
|
22
22
|
parentPort = globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort ?? null;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
// ../../node_modules/@math.gl/
|
|
26
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-utils/get-transfer-list.js
|
|
27
27
|
function getTransferList(object, recursive = true, transfers) {
|
|
28
28
|
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
29
29
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
return false;
|
|
75
75
|
}
|
|
76
76
|
var init_get_transfer_list = __esm({
|
|
77
|
-
"../../node_modules/@math.gl/
|
|
77
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-utils/get-transfer-list.js"() {
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
// ../../node_modules/@math.gl/
|
|
81
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-farm/worker-body.js
|
|
82
82
|
async function getParentPort() {
|
|
83
83
|
return parentPort;
|
|
84
84
|
}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
}
|
|
92
92
|
var onMessageWrapperMap, WorkerBody;
|
|
93
93
|
var init_worker_body = __esm({
|
|
94
|
-
"../../node_modules/@math.gl/
|
|
94
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-farm/worker-body.js"() {
|
|
95
95
|
init_get_transfer_list();
|
|
96
96
|
init_worker_threads_browser();
|
|
97
97
|
onMessageWrapperMap = /* @__PURE__ */ new Map();
|
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
-
// ../../node_modules/@math.gl/
|
|
175
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/async-queue/async-queue.js
|
|
176
176
|
var AsyncQueue;
|
|
177
177
|
var init_async_queue = __esm({
|
|
178
|
-
"../../node_modules/@math.gl/
|
|
178
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/async-queue/async-queue.js"() {
|
|
179
179
|
AsyncQueue = class {
|
|
180
180
|
constructor() {
|
|
181
181
|
this._values = [];
|
|
@@ -244,10 +244,10 @@
|
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
-
// ../../node_modules/@math.gl/
|
|
247
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/shared-state.js
|
|
248
248
|
var SharedWorkerState;
|
|
249
249
|
var init_shared_state = __esm({
|
|
250
|
-
"../../node_modules/@math.gl/
|
|
250
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/shared-state.js"() {
|
|
251
251
|
SharedWorkerState = class {
|
|
252
252
|
constructor(buffer) {
|
|
253
253
|
if (typeof SharedArrayBuffer === "undefined" || !(buffer instanceof SharedArrayBuffer) || buffer.byteLength !== 16)
|
|
@@ -288,18 +288,18 @@
|
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
|
|
291
|
-
// ../../node_modules/@math.gl/
|
|
291
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/validate-output-ownership.js
|
|
292
292
|
function validateOutputOwnership(ownership) {
|
|
293
293
|
if (ownership !== void 0 && ownership !== "copy" && ownership !== "transfer") {
|
|
294
294
|
throw new Error("Invalid worker output ownership");
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
var init_validate_output_ownership = __esm({
|
|
298
|
-
"../../node_modules/@math.gl/
|
|
298
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/validate-output-ownership.js"() {
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
-
// ../../node_modules/@math.gl/
|
|
302
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/create-worker.js
|
|
303
303
|
async function createWorker(process2, processInBatches, preload2) {
|
|
304
304
|
if (!await WorkerBody.inWorkerThread()) {
|
|
305
305
|
return;
|
|
@@ -504,7 +504,7 @@
|
|
|
504
504
|
}
|
|
505
505
|
var requestId, activeController, activeInputBatches, activeOutputAcknowledgements;
|
|
506
506
|
var init_create_worker = __esm({
|
|
507
|
-
"../../node_modules/@math.gl/
|
|
507
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/create-worker.js"() {
|
|
508
508
|
init_shared_state();
|
|
509
509
|
init_async_queue();
|
|
510
510
|
init_worker_body();
|
|
@@ -516,19 +516,20 @@
|
|
|
516
516
|
}
|
|
517
517
|
});
|
|
518
518
|
|
|
519
|
-
// ../../node_modules/@math.gl/
|
|
519
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/index.js
|
|
520
520
|
var import_meta, path, moduleUrl;
|
|
521
521
|
var init_worker_utils = __esm({
|
|
522
|
-
"../../node_modules/@math.gl/
|
|
522
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/index.js"() {
|
|
523
523
|
init_worker_body();
|
|
524
524
|
init_create_worker();
|
|
525
|
+
init_get_transfer_list();
|
|
525
526
|
import_meta = {};
|
|
526
527
|
path = typeof __filename === "string" ? __filename.replace(/\\/g, "/") : "";
|
|
527
528
|
moduleUrl = path ? `file://${path.startsWith("/") ? "" : "/"}${encodeURI(path).replace(/#/g, "%23").replace(/\?/g, "%3F")}` : import_meta.url;
|
|
528
529
|
}
|
|
529
530
|
});
|
|
530
531
|
|
|
531
|
-
// ../../node_modules/@math.gl/
|
|
532
|
+
// ../../node_modules/@math.gl/tasks/dist/tasks/task-preload.js
|
|
532
533
|
function preloadTaskCode(task, signal) {
|
|
533
534
|
if (!task.preload)
|
|
534
535
|
return Promise.resolve();
|
|
@@ -564,23 +565,193 @@
|
|
|
564
565
|
}
|
|
565
566
|
var pending, loaded;
|
|
566
567
|
var init_task_preload = __esm({
|
|
567
|
-
"../../node_modules/@math.gl/
|
|
568
|
+
"../../node_modules/@math.gl/tasks/dist/tasks/task-preload.js"() {
|
|
568
569
|
pending = /* @__PURE__ */ new WeakMap();
|
|
569
570
|
loaded = /* @__PURE__ */ new WeakSet();
|
|
570
571
|
}
|
|
571
572
|
});
|
|
572
573
|
|
|
573
|
-
// ../../node_modules/@math.gl/
|
|
574
|
+
// ../../node_modules/@math.gl/tasks/dist/tasks/task-channel.js
|
|
575
|
+
var TaskRequestError, TaskChannel;
|
|
576
|
+
var init_task_channel = __esm({
|
|
577
|
+
"../../node_modules/@math.gl/tasks/dist/tasks/task-channel.js"() {
|
|
578
|
+
TaskRequestError = class extends Error {
|
|
579
|
+
};
|
|
580
|
+
TaskChannel = class {
|
|
581
|
+
constructor(options) {
|
|
582
|
+
this.options = options;
|
|
583
|
+
this.nextId = 1;
|
|
584
|
+
this.pending = /* @__PURE__ */ new Map();
|
|
585
|
+
this.incoming = /* @__PURE__ */ new Map();
|
|
586
|
+
}
|
|
587
|
+
/** Send a request without serializing other in-flight requests. */
|
|
588
|
+
request(operation, value, signal, transfer = []) {
|
|
589
|
+
if (this.failure)
|
|
590
|
+
return Promise.reject(this.failure.reason);
|
|
591
|
+
if (signal?.aborted)
|
|
592
|
+
return Promise.reject(signal.reason);
|
|
593
|
+
const id = this.nextId++;
|
|
594
|
+
return new Promise((resolve, reject) => {
|
|
595
|
+
const abort = () => {
|
|
596
|
+
const pending2 = this.pending.get(id);
|
|
597
|
+
if (!pending2)
|
|
598
|
+
return;
|
|
599
|
+
this.pending.delete(id);
|
|
600
|
+
pending2.cleanup();
|
|
601
|
+
reject(signal?.reason);
|
|
602
|
+
this.send({ source: "math.gl/tasks", kind: "cancel", id });
|
|
603
|
+
};
|
|
604
|
+
this.pending.set(id, {
|
|
605
|
+
resolve,
|
|
606
|
+
reject,
|
|
607
|
+
cleanup: () => signal?.removeEventListener("abort", abort)
|
|
608
|
+
});
|
|
609
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
610
|
+
this.send({ source: "math.gl/tasks", kind: "request", id, operation, value }, transfer);
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
/** Send a one-way notification. */
|
|
614
|
+
emit(operation, value, transfer = []) {
|
|
615
|
+
if (this.failure)
|
|
616
|
+
throw this.failure.reason;
|
|
617
|
+
this.send({ source: "math.gl/tasks", kind: "event", id: 0, operation, value }, transfer);
|
|
618
|
+
}
|
|
619
|
+
/** Dispatch a transport message; unrelated protocols are ignored. */
|
|
620
|
+
receive(message) {
|
|
621
|
+
if (this.failure || message?.source !== "math.gl/tasks")
|
|
622
|
+
return;
|
|
623
|
+
if (message.kind === "failure") {
|
|
624
|
+
const reason = new Error(message.error?.message ?? "Task channel failed");
|
|
625
|
+
this.close(reason);
|
|
626
|
+
this.options.onFailure?.(reason);
|
|
627
|
+
} else if (message.kind === "result" || message.kind === "error") {
|
|
628
|
+
const pending2 = this.pending.get(message.id);
|
|
629
|
+
if (!pending2)
|
|
630
|
+
return;
|
|
631
|
+
this.pending.delete(message.id);
|
|
632
|
+
pending2.cleanup();
|
|
633
|
+
if (message.kind === "result")
|
|
634
|
+
pending2.resolve(message.value);
|
|
635
|
+
else {
|
|
636
|
+
const error = new TaskRequestError(message.error?.message ?? "Task request failed");
|
|
637
|
+
error.name = message.error?.name ?? "Error";
|
|
638
|
+
pending2.reject(error);
|
|
639
|
+
}
|
|
640
|
+
} else if (message.kind === "cancel") {
|
|
641
|
+
this.incoming.get(message.id)?.abort(new DOMException("Task request cancelled", "AbortError"));
|
|
642
|
+
} else if (message.kind === "event") {
|
|
643
|
+
try {
|
|
644
|
+
this.options.handleEvent?.(message.operation, message.value);
|
|
645
|
+
} catch (error) {
|
|
646
|
+
this.fail(error);
|
|
647
|
+
}
|
|
648
|
+
} else if (message.kind === "request") {
|
|
649
|
+
if (this.incoming.has(message.id)) {
|
|
650
|
+
this.fail(new Error("Duplicate task request identifier"));
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
const controller = new AbortController();
|
|
654
|
+
this.incoming.set(message.id, controller);
|
|
655
|
+
void Promise.resolve().then(() => {
|
|
656
|
+
controller.signal.throwIfAborted();
|
|
657
|
+
return this.options.handleRequest(message.operation, message.value, controller.signal);
|
|
658
|
+
}).then((value) => {
|
|
659
|
+
if (!controller.signal.aborted && !this.failure) {
|
|
660
|
+
this.send({ source: "math.gl/tasks", kind: "result", id: message.id, value }, this.options.getResultTransferList?.(value, message.value));
|
|
661
|
+
}
|
|
662
|
+
}).catch((reason) => {
|
|
663
|
+
if (!controller.signal.aborted && !this.failure) {
|
|
664
|
+
this.send({
|
|
665
|
+
source: "math.gl/tasks",
|
|
666
|
+
kind: "error",
|
|
667
|
+
id: message.id,
|
|
668
|
+
error: {
|
|
669
|
+
name: reason instanceof Error ? reason.name : "Error",
|
|
670
|
+
message: reason instanceof Error ? reason.message : String(reason)
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
}).finally(() => this.incoming.delete(message.id));
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
/** Reject all outstanding calls with a common cause and abort incoming callbacks. */
|
|
678
|
+
close(reason = new Error("Task channel closed")) {
|
|
679
|
+
if (this.failure)
|
|
680
|
+
return;
|
|
681
|
+
this.failure = { reason };
|
|
682
|
+
for (const pending2 of this.pending.values()) {
|
|
683
|
+
pending2.cleanup();
|
|
684
|
+
pending2.reject(reason);
|
|
685
|
+
}
|
|
686
|
+
this.pending.clear();
|
|
687
|
+
for (const controller of this.incoming.values())
|
|
688
|
+
controller.abort(reason);
|
|
689
|
+
this.incoming.clear();
|
|
690
|
+
}
|
|
691
|
+
send(message, transfer = []) {
|
|
692
|
+
if (this.failure)
|
|
693
|
+
return;
|
|
694
|
+
try {
|
|
695
|
+
this.options.send(message, transfer);
|
|
696
|
+
} catch (error) {
|
|
697
|
+
this.fail(error);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/** Invalidate the channel and notify the peer when the transport still works. */
|
|
701
|
+
fail(reason) {
|
|
702
|
+
if (this.failure)
|
|
703
|
+
return;
|
|
704
|
+
this.close(reason);
|
|
705
|
+
try {
|
|
706
|
+
this.options.send({
|
|
707
|
+
source: "math.gl/tasks",
|
|
708
|
+
kind: "failure",
|
|
709
|
+
id: 0,
|
|
710
|
+
error: {
|
|
711
|
+
name: reason instanceof Error ? reason.name : "Error",
|
|
712
|
+
message: reason instanceof Error ? reason.message : String(reason)
|
|
713
|
+
}
|
|
714
|
+
}, []);
|
|
715
|
+
} catch {
|
|
716
|
+
}
|
|
717
|
+
this.options.onFailure?.(reason);
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
// ../../node_modules/@math.gl/tasks/dist/tasks/task-runtime.js
|
|
574
724
|
function assertPayload(value) {
|
|
575
725
|
if (!value || typeof value !== "object" || Object.getPrototypeOf(value) !== Object.prototype) {
|
|
576
726
|
throw new TypeError("Task payloads must be plain objects with named fields");
|
|
577
727
|
}
|
|
578
728
|
}
|
|
729
|
+
function clonePayload(value, ownership = "copy") {
|
|
730
|
+
assertPayload(value);
|
|
731
|
+
if (!["copy", "transfer", "share"].includes(ownership))
|
|
732
|
+
throw new TypeError("Invalid input ownership");
|
|
733
|
+
const transfer = getTransferList(value);
|
|
734
|
+
if (ownership === "share" && transfer.length)
|
|
735
|
+
throw new TypeError("Share requires shared storage");
|
|
736
|
+
return structuredClone(value, {
|
|
737
|
+
transfer: ownership === "transfer" ? transfer : []
|
|
738
|
+
});
|
|
739
|
+
}
|
|
579
740
|
function taskContext(state, context = {}) {
|
|
580
741
|
const signal = context.signal ?? new AbortController().signal;
|
|
581
742
|
return {
|
|
582
743
|
state,
|
|
583
744
|
signal,
|
|
745
|
+
requestHost: async (operation, payload, controls) => {
|
|
746
|
+
signal.throwIfAborted();
|
|
747
|
+
if (!context.requestHost)
|
|
748
|
+
throw new Error("No host request handler configured");
|
|
749
|
+
return context.requestHost(operation, payload, controls);
|
|
750
|
+
},
|
|
751
|
+
emitHost: (operation, payload) => {
|
|
752
|
+
signal.throwIfAborted();
|
|
753
|
+
context.emitHost?.(operation, payload);
|
|
754
|
+
},
|
|
584
755
|
throwIfAborted: () => {
|
|
585
756
|
signal.throwIfAborted();
|
|
586
757
|
context.throwIfAborted?.();
|
|
@@ -599,6 +770,69 @@
|
|
|
599
770
|
throw new Error("A task is already installed in this worker");
|
|
600
771
|
installed = true;
|
|
601
772
|
const runtime = new TaskRuntime(task);
|
|
773
|
+
let channelStream;
|
|
774
|
+
const channel = new TaskChannel({
|
|
775
|
+
getResultTransferList: (value, request) => request.outputOwnership === "transfer" ? getTransferList(value) : [],
|
|
776
|
+
send: (message, transfer) => {
|
|
777
|
+
const snapshot = structuredClone(message, { transfer });
|
|
778
|
+
void WorkerBody.postMessage("task-channel", snapshot).catch((reason) => channel.fail(reason));
|
|
779
|
+
},
|
|
780
|
+
handleRequest: async (operation, value, signal) => {
|
|
781
|
+
const request = value;
|
|
782
|
+
const context = {
|
|
783
|
+
signal,
|
|
784
|
+
reportProgress: (progress) => channel.emit("task:progress", { id: request.progressId, progress }),
|
|
785
|
+
requestHost: (operation2, payload, controls = {}) => {
|
|
786
|
+
const request2 = {
|
|
787
|
+
operation: operation2,
|
|
788
|
+
payload: clonePayload(payload, controls.inputOwnership),
|
|
789
|
+
outputOwnership: controls.outputOwnership ?? "copy"
|
|
790
|
+
};
|
|
791
|
+
return channel.request("task:host-request", request2, signal, getTransferList(request2));
|
|
792
|
+
},
|
|
793
|
+
emitHost: (operation2, payload) => channel.emit("task:host-event", { operation: operation2, payload, id: request.progressId })
|
|
794
|
+
};
|
|
795
|
+
switch (operation) {
|
|
796
|
+
case "initialize":
|
|
797
|
+
return runtime.initialize(request.input, context);
|
|
798
|
+
case "process":
|
|
799
|
+
return runtime.process(request.input, request.options, context);
|
|
800
|
+
case "stream-open": {
|
|
801
|
+
if (channelStream)
|
|
802
|
+
throw new Error("A task stream is already open");
|
|
803
|
+
async function* inputs() {
|
|
804
|
+
while (true) {
|
|
805
|
+
const result = await channel.request("task:next-input", { outputOwnership: "transfer" }, signal);
|
|
806
|
+
if (result.done)
|
|
807
|
+
return;
|
|
808
|
+
yield result.value;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
channelStream = runtime.stream(inputs(), request.options, context)[Symbol.asyncIterator]();
|
|
812
|
+
return {};
|
|
813
|
+
}
|
|
814
|
+
case "stream-next":
|
|
815
|
+
if (!channelStream)
|
|
816
|
+
throw new Error("No active task stream");
|
|
817
|
+
return channelStream.next();
|
|
818
|
+
case "stream-close":
|
|
819
|
+
try {
|
|
820
|
+
await channelStream?.return?.();
|
|
821
|
+
} finally {
|
|
822
|
+
channelStream = void 0;
|
|
823
|
+
}
|
|
824
|
+
return {};
|
|
825
|
+
case "destroy":
|
|
826
|
+
return runtime.destroy();
|
|
827
|
+
default:
|
|
828
|
+
throw new Error("Unknown task channel operation");
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
await WorkerBody.addEventListener((type, payload) => {
|
|
833
|
+
if (type === "task-channel")
|
|
834
|
+
channel.receive(payload);
|
|
835
|
+
});
|
|
602
836
|
let streamOptions = {};
|
|
603
837
|
return createWorker(async (request, _options, context) => {
|
|
604
838
|
switch (request.operation) {
|
|
@@ -630,9 +864,10 @@
|
|
|
630
864
|
}
|
|
631
865
|
var TaskRuntime, installed;
|
|
632
866
|
var init_task_runtime = __esm({
|
|
633
|
-
"../../node_modules/@math.gl/
|
|
867
|
+
"../../node_modules/@math.gl/tasks/dist/tasks/task-runtime.js"() {
|
|
634
868
|
init_worker_utils();
|
|
635
869
|
init_task_preload();
|
|
870
|
+
init_task_channel();
|
|
636
871
|
TaskRuntime = class {
|
|
637
872
|
constructor(task) {
|
|
638
873
|
this.task = task;
|
|
@@ -683,13 +918,20 @@
|
|
|
683
918
|
}
|
|
684
919
|
});
|
|
685
920
|
|
|
686
|
-
// ../../node_modules/@math.gl/
|
|
921
|
+
// ../../node_modules/@math.gl/tasks/dist/tasks/index.js
|
|
687
922
|
var init_tasks = __esm({
|
|
688
|
-
"../../node_modules/@math.gl/
|
|
923
|
+
"../../node_modules/@math.gl/tasks/dist/tasks/index.js"() {
|
|
689
924
|
init_task_runtime();
|
|
690
925
|
}
|
|
691
926
|
});
|
|
692
927
|
|
|
928
|
+
// ../../node_modules/@math.gl/tasks/dist/index.js
|
|
929
|
+
var init_dist = __esm({
|
|
930
|
+
"../../node_modules/@math.gl/tasks/dist/index.js"() {
|
|
931
|
+
init_tasks();
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
|
|
693
935
|
// ../core/src/worker-utils/lib/node/worker_threads-browser.ts
|
|
694
936
|
var worker_threads_browser_exports = {};
|
|
695
937
|
__export(worker_threads_browser_exports, {
|
|
@@ -734,7 +976,7 @@
|
|
|
734
976
|
var init_task_runtime2 = __esm({
|
|
735
977
|
"../core/src/worker-utils/lib/worker-api/task-runtime.ts"() {
|
|
736
978
|
"use strict";
|
|
737
|
-
|
|
979
|
+
init_dist();
|
|
738
980
|
initializeTaskWorker2 = initializeTaskWorker;
|
|
739
981
|
}
|
|
740
982
|
});
|
|
@@ -1240,7 +1482,7 @@
|
|
|
1240
1482
|
});
|
|
1241
1483
|
|
|
1242
1484
|
// ../../node_modules/@math.gl/core/dist/index.js
|
|
1243
|
-
var
|
|
1485
|
+
var init_dist2 = __esm({
|
|
1244
1486
|
"../../node_modules/@math.gl/core/dist/index.js"() {
|
|
1245
1487
|
init_math_utils();
|
|
1246
1488
|
init_types2();
|
|
@@ -16237,12 +16479,6 @@ return true;`);
|
|
|
16237
16479
|
metadata: serializeArrowMetadata(arrowSchema.metadata)
|
|
16238
16480
|
};
|
|
16239
16481
|
}
|
|
16240
|
-
function deserializeArrowSchema(schema, options) {
|
|
16241
|
-
return new Schema2(
|
|
16242
|
-
schema.fields.map((field) => deserializeArrowField(field, options)),
|
|
16243
|
-
deserializeArrowMetadata(schema.metadata)
|
|
16244
|
-
);
|
|
16245
|
-
}
|
|
16246
16482
|
function serializeArrowMetadata(arrowMetadata) {
|
|
16247
16483
|
return Object.fromEntries(arrowMetadata);
|
|
16248
16484
|
}
|
|
@@ -16776,7 +17012,7 @@ return true;`);
|
|
|
16776
17012
|
var init_float162 = __esm({
|
|
16777
17013
|
"../core/src/schema/float16.ts"() {
|
|
16778
17014
|
"use strict";
|
|
16779
|
-
|
|
17015
|
+
init_dist2();
|
|
16780
17016
|
}
|
|
16781
17017
|
});
|
|
16782
17018
|
|
|
@@ -17276,7 +17512,29 @@ return true;`);
|
|
|
17276
17512
|
}
|
|
17277
17513
|
});
|
|
17278
17514
|
|
|
17279
|
-
//
|
|
17515
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
|
|
17516
|
+
function getArrowVariadicBuffers(data) {
|
|
17517
|
+
return data.variadicBuffers ?? [];
|
|
17518
|
+
}
|
|
17519
|
+
function createArrowData(type, offset, length, nullCount, buffers, children, dictionary, variadicBuffers) {
|
|
17520
|
+
return Reflect.construct(Data, [
|
|
17521
|
+
type,
|
|
17522
|
+
offset,
|
|
17523
|
+
length,
|
|
17524
|
+
nullCount,
|
|
17525
|
+
buffers,
|
|
17526
|
+
children,
|
|
17527
|
+
dictionary,
|
|
17528
|
+
variadicBuffers
|
|
17529
|
+
]);
|
|
17530
|
+
}
|
|
17531
|
+
var init_arrow_data = __esm({
|
|
17532
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js"() {
|
|
17533
|
+
init_Arrow_dom();
|
|
17534
|
+
}
|
|
17535
|
+
});
|
|
17536
|
+
|
|
17537
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js
|
|
17280
17538
|
function splitArrowBuffers(input, options = {}) {
|
|
17281
17539
|
const context = { ...options, copies: /* @__PURE__ */ new WeakMap() };
|
|
17282
17540
|
if (isArrowTable2(input)) {
|
|
@@ -17299,17 +17557,12 @@ return true;`);
|
|
|
17299
17557
|
function isArrowVector2(input) {
|
|
17300
17558
|
return "data" in input && Array.isArray(input.data);
|
|
17301
17559
|
}
|
|
17302
|
-
function splitArrowTableBuffersInternal(
|
|
17303
|
-
const recordBatches =
|
|
17304
|
-
|
|
17305
|
-
);
|
|
17306
|
-
return new Table(table.schema, recordBatches);
|
|
17560
|
+
function splitArrowTableBuffersInternal(arrowTable, options) {
|
|
17561
|
+
const recordBatches = arrowTable.batches.map((recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options));
|
|
17562
|
+
return new Table(arrowTable.schema, recordBatches);
|
|
17307
17563
|
}
|
|
17308
17564
|
function splitArrowRecordBatchBuffers(recordBatch, options) {
|
|
17309
|
-
return new RecordBatch3(
|
|
17310
|
-
recordBatch.schema,
|
|
17311
|
-
splitArrowDataBuffers(recordBatch.data, options)
|
|
17312
|
-
);
|
|
17565
|
+
return new RecordBatch3(recordBatch.schema, splitArrowDataBuffers(recordBatch.data, options));
|
|
17313
17566
|
}
|
|
17314
17567
|
function splitArrowDataBuffers(data, options) {
|
|
17315
17568
|
const children = data.children.map((childData) => splitArrowDataBuffers(childData, options));
|
|
@@ -17320,7 +17573,7 @@ return true;`);
|
|
|
17320
17573
|
[BufferType.VALIDITY]: splitArrowBuffer(data.buffers[BufferType.VALIDITY], options),
|
|
17321
17574
|
[BufferType.TYPE]: splitArrowBuffer(data.buffers[BufferType.TYPE], options)
|
|
17322
17575
|
};
|
|
17323
|
-
return
|
|
17576
|
+
return createArrowData(
|
|
17324
17577
|
data.type,
|
|
17325
17578
|
data.offset,
|
|
17326
17579
|
data.length,
|
|
@@ -17328,7 +17581,8 @@ return true;`);
|
|
|
17328
17581
|
data._nullCount,
|
|
17329
17582
|
buffers,
|
|
17330
17583
|
children,
|
|
17331
|
-
dictionary
|
|
17584
|
+
dictionary,
|
|
17585
|
+
getArrowVariadicBuffers(data).map((buffer) => splitArrowBuffer(buffer, options))
|
|
17332
17586
|
);
|
|
17333
17587
|
}
|
|
17334
17588
|
function splitArrowVectorBuffers(vector, options) {
|
|
@@ -17346,7 +17600,7 @@ return true;`);
|
|
|
17346
17600
|
}
|
|
17347
17601
|
let copy = options.copies.get(array);
|
|
17348
17602
|
if (!copy) {
|
|
17349
|
-
copy = array.slice();
|
|
17603
|
+
copy = array instanceof Uint8Array ? new Uint8Array(array) : array.slice();
|
|
17350
17604
|
options.copies.set(array, copy);
|
|
17351
17605
|
}
|
|
17352
17606
|
return copy;
|
|
@@ -17355,29 +17609,106 @@ return true;`);
|
|
|
17355
17609
|
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
17356
17610
|
}
|
|
17357
17611
|
var init_split_arrow_buffers = __esm({
|
|
17358
|
-
"
|
|
17359
|
-
"use strict";
|
|
17612
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js"() {
|
|
17360
17613
|
init_Arrow_dom();
|
|
17614
|
+
init_arrow_data();
|
|
17615
|
+
}
|
|
17616
|
+
});
|
|
17617
|
+
|
|
17618
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
|
|
17619
|
+
var init_indexed_arrow_vector = __esm({
|
|
17620
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
|
|
17361
17621
|
}
|
|
17362
17622
|
});
|
|
17363
17623
|
|
|
17364
|
-
//
|
|
17365
|
-
|
|
17366
|
-
|
|
17624
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
|
|
17625
|
+
var init_indexed_arrow_table = __esm({
|
|
17626
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
|
|
17627
|
+
}
|
|
17628
|
+
});
|
|
17629
|
+
|
|
17630
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
|
|
17631
|
+
var init_mapped_arrow_table = __esm({
|
|
17632
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
|
|
17633
|
+
}
|
|
17634
|
+
});
|
|
17635
|
+
|
|
17636
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
|
|
17637
|
+
var init_rename_arrow_columns = __esm({
|
|
17638
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
|
|
17639
|
+
}
|
|
17640
|
+
});
|
|
17641
|
+
|
|
17642
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js
|
|
17643
|
+
function dehydrateArrowTable(arrowTable, options) {
|
|
17644
|
+
const splitTable = splitArrowBuffers(arrowTable, options);
|
|
17367
17645
|
return {
|
|
17368
|
-
shape: "arrow-table",
|
|
17369
17646
|
transport: "arrow-js",
|
|
17370
|
-
|
|
17371
|
-
|
|
17647
|
+
version: 1,
|
|
17648
|
+
schema: tableToIPC(new Table(splitTable.schema, [])),
|
|
17649
|
+
metadataVersion: splitTable.schema.metadataVersion,
|
|
17650
|
+
batches: splitTable.batches.map((batch) => dehydrateArrowData(batch.data))
|
|
17372
17651
|
};
|
|
17373
17652
|
}
|
|
17374
17653
|
function hydrateArrowTable(table) {
|
|
17375
|
-
|
|
17376
|
-
|
|
17377
|
-
|
|
17378
|
-
);
|
|
17379
|
-
|
|
17654
|
+
if (table.transport !== "arrow-js" || table.version !== 1) {
|
|
17655
|
+
throw new Error("Unsupported Arrow column-buffer transport protocol.");
|
|
17656
|
+
}
|
|
17657
|
+
const decodedSchema = tableFromIPC(table.schema).schema;
|
|
17658
|
+
const schema = new Schema2(decodedSchema.fields, decodedSchema.metadata, decodedSchema.dictionaries, table.metadataVersion);
|
|
17659
|
+
const type = new Struct(schema.fields);
|
|
17660
|
+
const batches = table.batches.map((data) => new RecordBatch3(schema, hydrateArrowData(data, type)));
|
|
17661
|
+
return new Table(schema, batches);
|
|
17662
|
+
}
|
|
17663
|
+
function dehydrateArrowData(data) {
|
|
17664
|
+
return {
|
|
17665
|
+
offset: data.offset,
|
|
17666
|
+
length: data.length,
|
|
17667
|
+
nullCount: data.nullCount,
|
|
17668
|
+
buffers: {
|
|
17669
|
+
[BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
|
|
17670
|
+
[BufferType.DATA]: data.buffers[BufferType.DATA],
|
|
17671
|
+
[BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
|
|
17672
|
+
[BufferType.TYPE]: data.buffers[BufferType.TYPE]
|
|
17673
|
+
},
|
|
17674
|
+
children: data.children.map((child) => dehydrateArrowData(child)),
|
|
17675
|
+
variadicBuffers: getArrowVariadicBuffers(data),
|
|
17676
|
+
dictionary: data.dictionary?.data.map((chunk) => dehydrateArrowData(chunk))
|
|
17677
|
+
};
|
|
17678
|
+
}
|
|
17679
|
+
function hydrateArrowData(data, type) {
|
|
17680
|
+
const children = data.children.map((child, index) => hydrateArrowData(child, type.children[index].type));
|
|
17681
|
+
const dictionary = data.dictionary && DataType.isDictionary(type) ? new Vector(data.dictionary.map((chunk) => hydrateArrowData(chunk, type.dictionary))) : void 0;
|
|
17682
|
+
return createArrowData(type, data.offset, data.length, data.nullCount, data.buffers, children, dictionary, data.variadicBuffers);
|
|
17380
17683
|
}
|
|
17684
|
+
var init_arrow_table_transport = __esm({
|
|
17685
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js"() {
|
|
17686
|
+
init_Arrow_dom();
|
|
17687
|
+
init_arrow_data();
|
|
17688
|
+
init_split_arrow_buffers();
|
|
17689
|
+
}
|
|
17690
|
+
});
|
|
17691
|
+
|
|
17692
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/index.js
|
|
17693
|
+
var init_arrow = __esm({
|
|
17694
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
|
|
17695
|
+
init_indexed_arrow_table();
|
|
17696
|
+
init_indexed_arrow_vector();
|
|
17697
|
+
init_mapped_arrow_table();
|
|
17698
|
+
init_rename_arrow_columns();
|
|
17699
|
+
init_split_arrow_buffers();
|
|
17700
|
+
init_arrow_table_transport();
|
|
17701
|
+
}
|
|
17702
|
+
});
|
|
17703
|
+
|
|
17704
|
+
// ../../node_modules/@math.gl/arrow/dist/index.js
|
|
17705
|
+
var init_dist3 = __esm({
|
|
17706
|
+
"../../node_modules/@math.gl/arrow/dist/index.js"() {
|
|
17707
|
+
init_arrow();
|
|
17708
|
+
}
|
|
17709
|
+
});
|
|
17710
|
+
|
|
17711
|
+
// ../core/src/arrow-worker-transport.ts
|
|
17381
17712
|
function serializeArrowWorkerTable(result) {
|
|
17382
17713
|
if (!isArrowTableWrapper(result)) {
|
|
17383
17714
|
throw new Error("Workers require Arrow table output");
|
|
@@ -17406,60 +17737,10 @@ return true;`);
|
|
|
17406
17737
|
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
17407
17738
|
);
|
|
17408
17739
|
}
|
|
17409
|
-
|
|
17410
|
-
|
|
17411
|
-
}
|
|
17412
|
-
function dehydrateArrowData(data) {
|
|
17413
|
-
return {
|
|
17414
|
-
type: serializeArrowType(data.type),
|
|
17415
|
-
offset: data.offset,
|
|
17416
|
-
length: data.length,
|
|
17417
|
-
// @ts-expect-error _nullCount is protected. Preserve the Arrow lazy null-count state.
|
|
17418
|
-
nullCount: data._nullCount,
|
|
17419
|
-
buffers: {
|
|
17420
|
-
[BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
|
|
17421
|
-
[BufferType.DATA]: data.buffers[BufferType.DATA],
|
|
17422
|
-
[BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
|
|
17423
|
-
[BufferType.TYPE]: data.buffers[BufferType.TYPE]
|
|
17424
|
-
},
|
|
17425
|
-
children: data.children.map((childData) => dehydrateArrowData(childData)),
|
|
17426
|
-
dictionary: data.dictionary ? dehydrateArrowVector(data.dictionary) : void 0
|
|
17427
|
-
};
|
|
17428
|
-
}
|
|
17429
|
-
function dehydrateArrowVector(vector) {
|
|
17430
|
-
return { data: vector.data.map((data) => dehydrateArrowData(data)) };
|
|
17431
|
-
}
|
|
17432
|
-
function hydrateArrowData(data) {
|
|
17433
|
-
const children = data.children.map((childData) => hydrateArrowData(childData));
|
|
17434
|
-
const dictionary = data.dictionary ? hydrateArrowVector(data.dictionary) : void 0;
|
|
17435
|
-
return new Data(
|
|
17436
|
-
deserializeArrowType(data.type),
|
|
17437
|
-
data.offset,
|
|
17438
|
-
data.length,
|
|
17439
|
-
data.nullCount,
|
|
17440
|
-
data.buffers,
|
|
17441
|
-
children,
|
|
17442
|
-
dictionary
|
|
17443
|
-
);
|
|
17444
|
-
}
|
|
17445
|
-
function hydrateArrowVector(vector) {
|
|
17446
|
-
return new Vector(vector.data.map((data) => hydrateArrowData(data)));
|
|
17447
|
-
}
|
|
17448
|
-
var init_arrow_table_transport = __esm({
|
|
17449
|
-
"../core/src/schema-utils/lib/arrow/arrow-table-transport.ts"() {
|
|
17740
|
+
var init_arrow_worker_transport = __esm({
|
|
17741
|
+
"../core/src/arrow-worker-transport.ts"() {
|
|
17450
17742
|
"use strict";
|
|
17451
|
-
|
|
17452
|
-
init_convert_arrow_schema();
|
|
17453
|
-
init_split_arrow_buffers();
|
|
17454
|
-
}
|
|
17455
|
-
});
|
|
17456
|
-
|
|
17457
|
-
// ../core/src/schema-utils/arrow-transport.ts
|
|
17458
|
-
var init_arrow_transport = __esm({
|
|
17459
|
-
"../core/src/schema-utils/arrow-transport.ts"() {
|
|
17460
|
-
"use strict";
|
|
17461
|
-
init_arrow_table_transport();
|
|
17462
|
-
init_split_arrow_buffers();
|
|
17743
|
+
init_dist3();
|
|
17463
17744
|
}
|
|
17464
17745
|
});
|
|
17465
17746
|
|
|
@@ -19474,8 +19755,8 @@ return true;`);
|
|
|
19474
19755
|
"src/ply/ply-loader-types.ts"() {
|
|
19475
19756
|
"use strict";
|
|
19476
19757
|
init_ply_format();
|
|
19477
|
-
|
|
19478
|
-
VERSION = true ? "5.0.0-beta.
|
|
19758
|
+
init_arrow_worker_transport();
|
|
19759
|
+
VERSION = true ? "5.0.0-beta.5" : "latest";
|
|
19479
19760
|
PLYLoader = {
|
|
19480
19761
|
dataType: null,
|
|
19481
19762
|
batchType: null,
|
|
@@ -19580,7 +19861,7 @@ return true;`);
|
|
|
19580
19861
|
"use strict";
|
|
19581
19862
|
init_loader_utils();
|
|
19582
19863
|
init_schema3();
|
|
19583
|
-
|
|
19864
|
+
init_arrow_worker_transport();
|
|
19584
19865
|
init_schema_utils();
|
|
19585
19866
|
init_parse_ply();
|
|
19586
19867
|
init_parse_ply_arrow();
|