@nebula-spatial/cad-loader 0.2.0 → 0.2.2
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/CHANGELOG.md +8 -0
- package/README.md +11 -0
- package/dist/index.js +324 -299
- package/dist/loader/geo-loader.d.ts +2 -0
- package/dist/session/cad-document-session.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Tr = Object.defineProperty;
|
|
2
2
|
var nn = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var Lr = (t, n, e) => n in t ?
|
|
5
|
+
var Lr = (t, n, e) => n in t ? Tr(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
6
6
|
var f = (t, n, e) => Lr(t, typeof n != "symbol" ? n + "" : n, e), tt = (t, n, e) => n.has(t) || nn("Cannot " + e);
|
|
7
7
|
var b = (t, n, e) => (tt(t, n, "read from private field"), e ? e.call(t) : n.get(t)), E = (t, n, e) => n.has(t) ? nn("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(t) : n.set(t, e), F = (t, n, e, r) => (tt(t, n, "write to private field"), r ? r.call(t, e) : n.set(t, e), e), R = (t, n, e) => (tt(t, n, "access private method"), e);
|
|
8
|
-
import { CadPackError as O, normalizeGeometrySegments as Mr, normalizeViewportRect as Mt, cloneViewportRect as ze, mergeViewportRects as
|
|
9
|
-
import { readBlockAnnotationSidecar as
|
|
10
|
-
import { BufferAttribute as Q, RawShaderMaterial as Kr, Color as Hn, Vector2 as qn, DoubleSide as Ct, BufferGeometry as
|
|
8
|
+
import { CadPackError as O, normalizeGeometrySegments as Mr, normalizeViewportRect as Mt, cloneViewportRect as ze, mergeViewportRects as fe, readGroup as Dr, transformBBoxByInstance as Fr, parseBinStreaming as Dt, isStrictTextRoundtripEnabled as Or, assertStrictTextRoundtrip as _r, computeViewportRectFromPositions as Fe, expandViewportRect as je, viewportRectEquals as Ur, viewportRectIntersects as zn, viewportRectContains as Ft, transformViewportRect as Gr, readExternalVariantDependencyPlan as He, readExternalAnnotationManifest as Ot, readExternalBlockAnnotations as _t, readSceneAnnotationSidecar as Nr, parseBinPayload as zr, parseBinBounds as Hr, readExternalVariantManifest as qr } from "./core/index.js";
|
|
9
|
+
import { readBlockAnnotationSidecar as Ho } from "./core/index.js";
|
|
10
|
+
import { BufferAttribute as Q, RawShaderMaterial as Kr, Color as Hn, Vector2 as qn, DoubleSide as Ct, BufferGeometry as Ut, LineSegments as Gt, InstancedInterleavedBuffer as rn, InstancedBufferGeometry as Kn, Float32BufferAttribute as Xn, InterleavedBufferAttribute as Le, Mesh as Nt, Vector3 as nt, Box3 as Xr, Sphere as Wr, Object3D as wt, InstancedBufferAttribute as ce, Points as Wn, Group as J, PointsMaterial as sn, LineBasicMaterial as an, MeshBasicMaterial as on } from "three";
|
|
11
11
|
import { BatchedText as ln, Text as Yr, preloadFont as qe } from "troika-three-text";
|
|
12
12
|
import Qr from "rbush";
|
|
13
13
|
const zt = 16.7, Ht = 6, qt = 128 * 1024 * 1024, Kt = 64 * 1024 * 1024, Xt = 2, Wt = 1, $r = 3e5, jr = 22e4, cn = 2;
|
|
@@ -415,7 +415,7 @@ function mi(t, n) {
|
|
|
415
415
|
let e = n ? ze(n) : null;
|
|
416
416
|
for (const r of ["line", "fill", "dot"])
|
|
417
417
|
for (const i of t[r].values())
|
|
418
|
-
e =
|
|
418
|
+
e = fe(e, i.bbox);
|
|
419
419
|
return e;
|
|
420
420
|
}
|
|
421
421
|
function xi(t) {
|
|
@@ -556,7 +556,7 @@ async function at(t, n, e, r) {
|
|
|
556
556
|
bytes: $n(i)
|
|
557
557
|
}), s;
|
|
558
558
|
}
|
|
559
|
-
async function
|
|
559
|
+
async function ki(t, n, e) {
|
|
560
560
|
return await at("line", t.line, n, e) + await at("fill", t.fill, n, e) + await at("dot", t.dot, n, e);
|
|
561
561
|
}
|
|
562
562
|
async function mn(t, n, e) {
|
|
@@ -589,7 +589,7 @@ function Yt() {
|
|
|
589
589
|
if (r()) return;
|
|
590
590
|
await n({ type: "header", header: d.header });
|
|
591
591
|
const h = async () => {
|
|
592
|
-
const m = await
|
|
592
|
+
const m = await ki(s, n, r);
|
|
593
593
|
return o = 0, m > 0 && (c = !0), m;
|
|
594
594
|
};
|
|
595
595
|
try {
|
|
@@ -629,7 +629,7 @@ function Yt() {
|
|
|
629
629
|
}
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function Ti(t) {
|
|
633
633
|
return t.reduce((n, e) => n + e.t.length * 2 + 128, 0);
|
|
634
634
|
}
|
|
635
635
|
function Li(t) {
|
|
@@ -720,7 +720,7 @@ function $t(t = {}) {
|
|
|
720
720
|
type: "text",
|
|
721
721
|
texts: x.texts,
|
|
722
722
|
cost: x.cost,
|
|
723
|
-
bytes:
|
|
723
|
+
bytes: Ti(x.texts)
|
|
724
724
|
});
|
|
725
725
|
return;
|
|
726
726
|
}
|
|
@@ -775,21 +775,21 @@ async function jt(t) {
|
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
|
-
var
|
|
778
|
+
var me, ie, xe, se;
|
|
779
779
|
class _i {
|
|
780
780
|
constructor(n) {
|
|
781
|
-
E(this,
|
|
781
|
+
E(this, me, []);
|
|
782
782
|
E(this, ie, []);
|
|
783
|
-
E(this,
|
|
783
|
+
E(this, xe);
|
|
784
784
|
E(this, se, !1);
|
|
785
|
-
F(this,
|
|
785
|
+
F(this, xe, n);
|
|
786
786
|
}
|
|
787
787
|
[Symbol.asyncIterator]() {
|
|
788
788
|
return this;
|
|
789
789
|
}
|
|
790
790
|
next() {
|
|
791
|
-
const n = b(this,
|
|
792
|
-
return n ? (b(this,
|
|
791
|
+
const n = b(this, me).shift();
|
|
792
|
+
return n ? (b(this, xe).call(this, n), Promise.resolve({ done: !1, value: n.event })) : b(this, se) ? Promise.resolve({ done: !0, value: void 0 }) : new Promise((e) => {
|
|
793
793
|
b(this, ie).push({ resolve: e });
|
|
794
794
|
});
|
|
795
795
|
}
|
|
@@ -797,10 +797,10 @@ class _i {
|
|
|
797
797
|
if (b(this, se)) return;
|
|
798
798
|
const e = b(this, ie).shift();
|
|
799
799
|
if (e) {
|
|
800
|
-
b(this,
|
|
800
|
+
b(this, xe).call(this, n), e.resolve({ done: !1, value: n.event });
|
|
801
801
|
return;
|
|
802
802
|
}
|
|
803
|
-
b(this,
|
|
803
|
+
b(this, me).push(n);
|
|
804
804
|
}
|
|
805
805
|
close() {
|
|
806
806
|
if (!b(this, se))
|
|
@@ -808,23 +808,23 @@ class _i {
|
|
|
808
808
|
b(this, ie).shift().resolve({ done: !0, value: void 0 });
|
|
809
809
|
}
|
|
810
810
|
clear() {
|
|
811
|
-
b(this,
|
|
811
|
+
b(this, me).length = 0, this.close();
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
|
|
814
|
+
me = new WeakMap(), ie = new WeakMap(), xe = new WeakMap(), se = new WeakMap();
|
|
815
815
|
function xn() {
|
|
816
816
|
let t, n;
|
|
817
817
|
return { promise: new Promise((r, i) => {
|
|
818
818
|
t = r, n = i;
|
|
819
819
|
}), resolve: t, reject: n };
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function Ui(t) {
|
|
822
822
|
return t instanceof Error ? t : new Error(String(t));
|
|
823
823
|
}
|
|
824
824
|
function ot(t) {
|
|
825
825
|
return t === void 0 ? void 0 : new Set(t);
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function Gi(t) {
|
|
828
828
|
return {
|
|
829
829
|
highWatermarkBytes: (t == null ? void 0 : t.highWatermarkBytes) ?? qt,
|
|
830
830
|
lowWatermarkBytes: (t == null ? void 0 : t.lowWatermarkBytes) ?? Kt,
|
|
@@ -901,33 +901,33 @@ function Xi(t) {
|
|
|
901
901
|
dot: t.dot.map(lt)
|
|
902
902
|
};
|
|
903
903
|
}
|
|
904
|
-
var
|
|
904
|
+
var T, Re, Be, Ae, pe, te, G, ge, ne, be, Ee, Y, Ie, Se, Ve, _, Pe, ke, v, Jn, er, tr, ue, Bt, nr, ve, At, Oe, _e, Ue;
|
|
905
905
|
class Wi {
|
|
906
906
|
constructor(n, e) {
|
|
907
907
|
E(this, v);
|
|
908
908
|
f(this, "events");
|
|
909
909
|
f(this, "ready");
|
|
910
|
-
E(this,
|
|
910
|
+
E(this, T);
|
|
911
911
|
E(this, Re);
|
|
912
912
|
E(this, Be);
|
|
913
913
|
E(this, Ae, new AbortController());
|
|
914
|
-
E(this,
|
|
914
|
+
E(this, pe, xn());
|
|
915
915
|
E(this, te, xn());
|
|
916
|
-
E(this,
|
|
917
|
-
E(this,
|
|
916
|
+
E(this, G);
|
|
917
|
+
E(this, ge, []);
|
|
918
918
|
E(this, ne);
|
|
919
|
-
E(this,
|
|
919
|
+
E(this, be, /* @__PURE__ */ new Set());
|
|
920
920
|
E(this, Ee, []);
|
|
921
921
|
E(this, Y, null);
|
|
922
|
-
E(this,
|
|
922
|
+
E(this, Ie, null);
|
|
923
923
|
E(this, Se, 0);
|
|
924
924
|
E(this, Ve, !1);
|
|
925
925
|
E(this, _, !1);
|
|
926
926
|
E(this, Pe, !1);
|
|
927
|
-
E(this,
|
|
928
|
-
F(this,
|
|
927
|
+
E(this, ke, vt());
|
|
928
|
+
F(this, T, e);
|
|
929
929
|
const r = Je(n, b(this, Ae).signal);
|
|
930
|
-
F(this, Re, r.source), F(this, Be, r.sourceSignal), F(this, ne, new Qn(
|
|
930
|
+
F(this, Re, r.source), F(this, Be, r.sourceSignal), F(this, ne, new Qn(Gi(e.flowControl))), F(this, G, new _i((i) => R(this, v, nr).call(this, i))), this.events = b(this, G), this.ready = b(this, pe).promise, this.ready.catch(() => {
|
|
931
931
|
}), b(this, te).promise.catch(() => {
|
|
932
932
|
}), R(this, v, At).call(this, e.signal), R(this, v, At).call(this, b(this, Be)), b(this, _) || R(this, v, Jn).call(this);
|
|
933
933
|
}
|
|
@@ -941,11 +941,11 @@ class Wi {
|
|
|
941
941
|
R(this, v, Oe).call(this, N("CAD load session disposed"));
|
|
942
942
|
return;
|
|
943
943
|
}
|
|
944
|
-
(n = b(this, Y)) == null || n.dispose(), b(this,
|
|
944
|
+
(n = b(this, Y)) == null || n.dispose(), b(this, G).clear(), R(this, v, Ue).call(this);
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
|
-
|
|
948
|
+
T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), pe = new WeakMap(), te = new WeakMap(), G = new WeakMap(), ge = new WeakMap(), ne = new WeakMap(), be = new WeakMap(), Ee = new WeakMap(), Y = new WeakMap(), Ie = new WeakMap(), Se = new WeakMap(), Ve = new WeakMap(), _ = new WeakMap(), Pe = new WeakMap(), ke = new WeakMap(), v = new WeakSet(), Jn = async function() {
|
|
949
949
|
var n, e;
|
|
950
950
|
try {
|
|
951
951
|
const r = await Promise.race([
|
|
@@ -956,43 +956,43 @@ k = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
956
956
|
F(this, Se, r.byteLength);
|
|
957
957
|
const s = R(this, v, er).call(this).start({
|
|
958
958
|
buffer: r,
|
|
959
|
-
hiddenInstanceIds: ot(b(this,
|
|
960
|
-
keepTextsForHiddenInstances: b(this,
|
|
961
|
-
loadBlocks: b(this,
|
|
962
|
-
suppressExpandedInsertGeometry: b(this,
|
|
963
|
-
maxExpandedInstanceVertices: b(this,
|
|
964
|
-
externalVariantFetchSource: b(this,
|
|
965
|
-
externalVariantBuffers: b(this,
|
|
966
|
-
requiredExternalVariantIds: ot(b(this,
|
|
967
|
-
externalVariantGeometryFetchIds: ot(b(this,
|
|
959
|
+
hiddenInstanceIds: ot(b(this, T).hiddenInstanceIds),
|
|
960
|
+
keepTextsForHiddenInstances: b(this, T).keepTextsForHiddenInstances || void 0,
|
|
961
|
+
loadBlocks: b(this, T).loadBlocks,
|
|
962
|
+
suppressExpandedInsertGeometry: b(this, T).loadBlocks !== !1,
|
|
963
|
+
maxExpandedInstanceVertices: b(this, T).maxExpandedInstanceVertices,
|
|
964
|
+
externalVariantFetchSource: b(this, T).externalVariantFetchSource,
|
|
965
|
+
externalVariantBuffers: b(this, T).externalVariantBuffers,
|
|
966
|
+
requiredExternalVariantIds: ot(b(this, T).requiredExternalVariantIds),
|
|
967
|
+
externalVariantGeometryFetchIds: ot(b(this, T).externalVariantGeometryFetchIds)
|
|
968
968
|
}, (o) => R(this, v, tr).call(this, o));
|
|
969
969
|
if (F(this, Y, s), s.completion.catch(() => {
|
|
970
970
|
}), (n = s.backgroundCompletion) == null || n.catch(() => {
|
|
971
|
-
}), R(this, v,
|
|
971
|
+
}), R(this, v, ve).call(this, b(this, ne).takeInitialGrant()), await Promise.race([s.completion, b(this, te).promise]), s.backgroundCompletion && await Promise.race([s.backgroundCompletion, b(this, te).promise]), b(this, _)) return;
|
|
972
972
|
if (!b(this, Ve))
|
|
973
973
|
throw new Error("CAD loader adapter completed without a done event");
|
|
974
|
-
if (!b(this,
|
|
974
|
+
if (!b(this, Ie))
|
|
975
975
|
throw new Error("CAD loader adapter completed without metadata");
|
|
976
976
|
const a = {
|
|
977
|
-
header: b(this,
|
|
978
|
-
chunks: b(this,
|
|
977
|
+
header: b(this, Ie),
|
|
978
|
+
chunks: b(this, ge),
|
|
979
979
|
rawBytes: b(this, Se)
|
|
980
980
|
};
|
|
981
|
-
F(this, _, !0), b(this,
|
|
981
|
+
F(this, _, !0), b(this, G).push({ event: { type: "ready", document: a } }), b(this, G).close(), b(this, pe).resolve(a), R(this, v, Ue).call(this);
|
|
982
982
|
} catch (r) {
|
|
983
|
-
b(this, _) || R(this, v, Oe).call(this,
|
|
983
|
+
b(this, _) || R(this, v, Oe).call(this, Ui(r));
|
|
984
984
|
} finally {
|
|
985
985
|
(e = b(this, Y)) == null || e.dispose(), R(this, v, _e).call(this);
|
|
986
986
|
}
|
|
987
987
|
}, er = function() {
|
|
988
|
-
return b(this,
|
|
989
|
-
workerUrl: b(this,
|
|
990
|
-
workerFactory: b(this,
|
|
988
|
+
return b(this, T).preferWorker !== !1 && Qt(b(this, T).workerFactory) ? $t({
|
|
989
|
+
workerUrl: b(this, T).workerUrl,
|
|
990
|
+
workerFactory: b(this, T).workerFactory
|
|
991
991
|
}) : Yt();
|
|
992
992
|
}, tr = async function(n) {
|
|
993
993
|
if (!b(this, _)) {
|
|
994
994
|
if (n.type === "header") {
|
|
995
|
-
F(this,
|
|
995
|
+
F(this, Ie, n.header), b(this, G).push({
|
|
996
996
|
event: { type: "meta", meta: n.header, header: n.header }
|
|
997
997
|
}), await R(this, v, ue).call(this);
|
|
998
998
|
return;
|
|
@@ -1000,7 +1000,7 @@ k = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1000
1000
|
if (n.type === "geometry") {
|
|
1001
1001
|
const e = n.layers.map((r) => {
|
|
1002
1002
|
const i = qi(r);
|
|
1003
|
-
return b(this,
|
|
1003
|
+
return b(this, ge).push({ kind: n.kind, payload: i }), {
|
|
1004
1004
|
event: {
|
|
1005
1005
|
type: "geometry",
|
|
1006
1006
|
kind: n.kind,
|
|
@@ -1015,12 +1015,12 @@ k = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1015
1015
|
return;
|
|
1016
1016
|
}
|
|
1017
1017
|
if (n.type === "text") {
|
|
1018
|
-
const e = n.texts.map((r) => (b(this,
|
|
1018
|
+
const e = n.texts.map((r) => (b(this, ge).push({ kind: "text", payload: r }), { event: { type: "text", chunk: r } }));
|
|
1019
1019
|
await R(this, v, Bt).call(this, e, "text", n.bytes), await R(this, v, ue).call(this);
|
|
1020
1020
|
return;
|
|
1021
1021
|
}
|
|
1022
1022
|
if (n.type === "insertModel") {
|
|
1023
|
-
b(this,
|
|
1023
|
+
b(this, G).push({
|
|
1024
1024
|
event: {
|
|
1025
1025
|
type: "insert",
|
|
1026
1026
|
instances: Ki(n.instances),
|
|
@@ -1032,33 +1032,33 @@ k = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1032
1032
|
F(this, Ve, !0), await R(this, v, ue).call(this);
|
|
1033
1033
|
}
|
|
1034
1034
|
}, ue = async function() {
|
|
1035
|
-
const n = Math.max(0, (b(this,
|
|
1036
|
-
typeof performance > "u" || typeof performance.now != "function" || performance.now() - b(this,
|
|
1035
|
+
const n = Math.max(0, (b(this, T).frameBudgetMs ?? zt) - (b(this, T).frameReserveMs ?? Ht));
|
|
1036
|
+
typeof performance > "u" || typeof performance.now != "function" || performance.now() - b(this, ke) < n || (await new Promise((e) => {
|
|
1037
1037
|
typeof globalThis.requestAnimationFrame == "function" ? globalThis.requestAnimationFrame(() => e()) : setTimeout(e, 0);
|
|
1038
|
-
}), F(this,
|
|
1038
|
+
}), F(this, ke, performance.now()));
|
|
1039
1039
|
}, Bt = function(n, e, r) {
|
|
1040
1040
|
if (n.length === 0) {
|
|
1041
|
-
R(this, v,
|
|
1041
|
+
R(this, v, ve).call(this, e === "geometry" ? { geometryCredits: 1, textCredits: 0 } : { geometryCredits: 0, textCredits: 1 });
|
|
1042
1042
|
return;
|
|
1043
1043
|
}
|
|
1044
1044
|
const i = { kind: e, bytes: Math.max(0, r), creditReplaced: !1 };
|
|
1045
1045
|
b(this, ne).onQueued(e, i.bytes);
|
|
1046
1046
|
const s = b(this, ne).onConsumed(e, 0);
|
|
1047
|
-
if (i.creditReplaced = R(this, v,
|
|
1048
|
-
b(this,
|
|
1047
|
+
if (i.creditReplaced = R(this, v, ve).call(this, s), n.forEach((a, o) => {
|
|
1048
|
+
b(this, G).push({
|
|
1049
1049
|
...a,
|
|
1050
1050
|
batch: i,
|
|
1051
1051
|
accountsBatch: o === n.length - 1
|
|
1052
1052
|
});
|
|
1053
1053
|
}), !!s.paused)
|
|
1054
1054
|
return new Promise((a) => {
|
|
1055
|
-
b(this,
|
|
1055
|
+
b(this, be).add(a);
|
|
1056
1056
|
});
|
|
1057
1057
|
}, nr = function(n) {
|
|
1058
1058
|
if (!n.batch || !n.accountsBatch) return;
|
|
1059
1059
|
const e = b(this, ne).onConsumed(n.batch.kind, n.batch.bytes);
|
|
1060
|
-
n.batch.creditReplaced || (n.batch.creditReplaced = R(this, v,
|
|
1061
|
-
},
|
|
1060
|
+
n.batch.creditReplaced || (n.batch.creditReplaced = R(this, v, ve).call(this, e)), e.paused || R(this, v, _e).call(this);
|
|
1061
|
+
}, ve = function(n) {
|
|
1062
1062
|
var e;
|
|
1063
1063
|
return !((e = b(this, Y)) != null && e.grant) || b(this, _) || n.geometryCredits <= 0 && n.textCredits <= 0 ? !1 : (b(this, Y).grant({
|
|
1064
1064
|
geometryCredits: n.geometryCredits,
|
|
@@ -1074,14 +1074,14 @@ k = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1074
1074
|
n.addEventListener("abort", e, { once: !0 }), b(this, Ee).push(() => n.removeEventListener("abort", e));
|
|
1075
1075
|
}, Oe = function(n) {
|
|
1076
1076
|
var e, r, i;
|
|
1077
|
-
b(this, _) || (F(this, _, !0), b(this, Ae).abort(n), (r = (e = b(this, Y)) == null ? void 0 : e.cancel) == null || r.call(e), (i = b(this, Y)) == null || i.dispose(), b(this, te).reject(n), b(this,
|
|
1077
|
+
b(this, _) || (F(this, _, !0), b(this, Ae).abort(n), (r = (e = b(this, Y)) == null ? void 0 : e.cancel) == null || r.call(e), (i = b(this, Y)) == null || i.dispose(), b(this, te).reject(n), b(this, pe).reject(n), b(this, G).push({ event: { type: "error", error: n } }), b(this, G).close(), R(this, v, _e).call(this), R(this, v, Ue).call(this));
|
|
1078
1078
|
}, _e = function() {
|
|
1079
|
-
for (const n of b(this,
|
|
1080
|
-
b(this,
|
|
1081
|
-
},
|
|
1079
|
+
for (const n of b(this, be)) n();
|
|
1080
|
+
b(this, be).clear();
|
|
1081
|
+
}, Ue = function() {
|
|
1082
1082
|
for (const n of b(this, Ee).splice(0)) n();
|
|
1083
1083
|
};
|
|
1084
|
-
function
|
|
1084
|
+
function Ro(t, n = {}) {
|
|
1085
1085
|
return new Wi(t, n);
|
|
1086
1086
|
}
|
|
1087
1087
|
class Yi {
|
|
@@ -1202,22 +1202,22 @@ async function rr(t) {
|
|
|
1202
1202
|
var z, en;
|
|
1203
1203
|
const { node: n } = t, e = new ji(n), r = t.appendExternalVariantDelta === !0, i = new Yi(Ji(t.scheduler));
|
|
1204
1204
|
let s = null, a = !0, o = null, c = !1, l = !1, d = !1, u = null, h = !1, y = null, p = null, m = null;
|
|
1205
|
-
const I = [], w = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Set(), C = new Promise((g,
|
|
1206
|
-
y =
|
|
1205
|
+
const I = [], w = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Set(), C = new Promise((g, k) => {
|
|
1206
|
+
y = k;
|
|
1207
1207
|
});
|
|
1208
1208
|
C.catch(() => {
|
|
1209
1209
|
});
|
|
1210
1210
|
const S = (g) => {
|
|
1211
1211
|
var oe;
|
|
1212
|
-
const
|
|
1212
|
+
const k = pn(g);
|
|
1213
1213
|
if (!d) {
|
|
1214
1214
|
d = !0, (oe = s == null ? void 0 : s.cancel) == null || oe.call(s);
|
|
1215
1215
|
for (const $ of w)
|
|
1216
|
-
D($,
|
|
1217
|
-
r || e.fail(
|
|
1218
|
-
}), y == null || y(
|
|
1216
|
+
D($, k);
|
|
1217
|
+
r || e.fail(k), n.ready.catch(() => {
|
|
1218
|
+
}), y == null || y(k);
|
|
1219
1219
|
}
|
|
1220
|
-
return
|
|
1220
|
+
return k;
|
|
1221
1221
|
}, B = (g) => (x.add(g), g.then(
|
|
1222
1222
|
() => {
|
|
1223
1223
|
x.delete(g);
|
|
@@ -1229,17 +1229,17 @@ async function rr(t) {
|
|
|
1229
1229
|
}), g), V = (g) => ({
|
|
1230
1230
|
geometryCredits: g.geometryCredits,
|
|
1231
1231
|
textCredits: g.textCredits
|
|
1232
|
-
}), A = (g,
|
|
1233
|
-
d || !(s != null && s.grant) ||
|
|
1232
|
+
}), A = (g, k) => {
|
|
1233
|
+
d || !(s != null && s.grant) || k && g.geometryCredits <= 0 && g.textCredits <= 0 || s.grant(V(g));
|
|
1234
1234
|
}, P = (g) => {
|
|
1235
1235
|
!o || g.flowQueued || (o.onQueued(g.kind, g.bytes), g.flowQueued = !0);
|
|
1236
1236
|
}, M = () => {
|
|
1237
1237
|
for (const g of w)
|
|
1238
1238
|
P(g);
|
|
1239
|
-
}, D = (g,
|
|
1239
|
+
}, D = (g, k) => {
|
|
1240
1240
|
if (!g.settled) {
|
|
1241
|
-
if (g.settled = !0, w.delete(g),
|
|
1242
|
-
g.reject(
|
|
1241
|
+
if (g.settled = !0, w.delete(g), k) {
|
|
1242
|
+
g.reject(k);
|
|
1243
1243
|
return;
|
|
1244
1244
|
}
|
|
1245
1245
|
g.resolve();
|
|
@@ -1258,13 +1258,13 @@ async function rr(t) {
|
|
|
1258
1258
|
}).finally(() => {
|
|
1259
1259
|
u = null, !d && h && i.hasPending() && K();
|
|
1260
1260
|
}), u.catch(() => {
|
|
1261
|
-
}), u)), L = (g,
|
|
1261
|
+
}), u)), L = (g, k, oe) => {
|
|
1262
1262
|
let $ = null, tn = null;
|
|
1263
|
-
const le = new Promise((
|
|
1264
|
-
$ =
|
|
1263
|
+
const le = new Promise((Te, et) => {
|
|
1264
|
+
$ = Te, tn = et;
|
|
1265
1265
|
}), j = {
|
|
1266
1266
|
kind: g,
|
|
1267
|
-
bytes:
|
|
1267
|
+
bytes: k,
|
|
1268
1268
|
append: oe,
|
|
1269
1269
|
flowQueued: !1,
|
|
1270
1270
|
settled: !1,
|
|
@@ -1286,9 +1286,9 @@ async function rr(t) {
|
|
|
1286
1286
|
}
|
|
1287
1287
|
try {
|
|
1288
1288
|
j.append(), o && j.flowQueued && A(o.onConsumed(j.kind, j.bytes), !0), D(j);
|
|
1289
|
-
} catch (
|
|
1290
|
-
const et = pn(
|
|
1291
|
-
throw D(j, et), S(
|
|
1289
|
+
} catch (Te) {
|
|
1290
|
+
const et = pn(Te);
|
|
1291
|
+
throw D(j, et), S(Te);
|
|
1292
1292
|
}
|
|
1293
1293
|
}), K(), le;
|
|
1294
1294
|
}, X = (g) => {
|
|
@@ -1314,10 +1314,10 @@ async function rr(t) {
|
|
|
1314
1314
|
return;
|
|
1315
1315
|
}
|
|
1316
1316
|
I.push(g);
|
|
1317
|
-
}), H = (g,
|
|
1317
|
+
}), H = (g, k) => {
|
|
1318
1318
|
const oe = Promise.resolve().then(async () => {
|
|
1319
1319
|
var $;
|
|
1320
|
-
await (($ = t.beforeTextAppend) == null ? void 0 : $.call(t, g)), await
|
|
1320
|
+
await (($ = t.beforeTextAppend) == null ? void 0 : $.call(t, g)), await k();
|
|
1321
1321
|
}).catch(($) => {
|
|
1322
1322
|
throw S($);
|
|
1323
1323
|
});
|
|
@@ -1386,10 +1386,10 @@ async function rr(t) {
|
|
|
1386
1386
|
W
|
|
1387
1387
|
), s.completion.catch(() => {
|
|
1388
1388
|
}), t.signal) {
|
|
1389
|
-
const g = t.signal,
|
|
1389
|
+
const g = t.signal, k = () => {
|
|
1390
1390
|
S(N(g.reason));
|
|
1391
1391
|
};
|
|
1392
|
-
g.addEventListener("abort",
|
|
1392
|
+
g.addEventListener("abort", k, { once: !0 }), p = () => g.removeEventListener("abort", k), g.aborted && k();
|
|
1393
1393
|
}
|
|
1394
1394
|
if (s.grant && (o = new Qn(es(t.flowControl)), M(), A(o.takeInitialGrant(), !1)), await Promise.race([s.completion, C]), s.backgroundCompletion && await Promise.race([s.backgroundCompletion, C]), await K(), await Promise.all(Array.from(x)), !c)
|
|
1395
1395
|
throw new Error("Geo loader pipeline completed without done event");
|
|
@@ -1742,7 +1742,7 @@ function hr(t) {
|
|
|
1742
1742
|
return xs[t];
|
|
1743
1743
|
}
|
|
1744
1744
|
function Cn(t, n) {
|
|
1745
|
-
const e = hr(n.theme), r = n.elementKind ?? "line", i = n.state ?? "normal", s =
|
|
1745
|
+
const e = hr(n.theme), r = n.elementKind ?? "line", i = n.state ?? "normal", s = Ge(t, n, 0);
|
|
1746
1746
|
let a = ws(s, e, r), o = s.kind === "aci" && fr(s.index) === 7;
|
|
1747
1747
|
if (n.enhanceContrast) {
|
|
1748
1748
|
const l = bs(a, {
|
|
@@ -1762,17 +1762,17 @@ function Cn(t, n) {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
function bs(t, n) {
|
|
1764
1764
|
const e = hr(n.theme), r = n.elementKind === "text" ? 4.5 : n.elementKind === "hatch" ? 1.6 : 2.2;
|
|
1765
|
-
return yr(t, e.background) >= r ?
|
|
1765
|
+
return yr(t, e.background) >= r ? Ce(t) : Bs(t, e.background, r, n.theme);
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1768
|
-
return e > gs ? n.fallbackColor ?? { kind: "aci", index: 7 } : t.kind === "bylayer" ?
|
|
1767
|
+
function Ge(t, n, e = 0) {
|
|
1768
|
+
return e > gs ? n.fallbackColor ?? { kind: "aci", index: 7 } : t.kind === "bylayer" ? Ge(n.layerColor ?? n.fallbackColor ?? { kind: "aci", index: 7 }, n, e + 1) : t.kind === "byblock" ? Ge(
|
|
1769
1769
|
n.byBlockColor ?? n.parentByBlockColor ?? n.fallbackColor ?? { kind: "aci", index: 7 },
|
|
1770
1770
|
{
|
|
1771
1771
|
...n,
|
|
1772
1772
|
byBlockColor: n.parentByBlockColor ?? null
|
|
1773
1773
|
},
|
|
1774
1774
|
e + 1
|
|
1775
|
-
) : t.kind === "none" ?
|
|
1775
|
+
) : t.kind === "none" ? Ge(n.fallbackColor ?? { kind: "aci", index: 7 }, n, e + 1) : t;
|
|
1776
1776
|
}
|
|
1777
1777
|
function Is(t) {
|
|
1778
1778
|
return Zt(t);
|
|
@@ -1781,19 +1781,19 @@ function Zt(t) {
|
|
|
1781
1781
|
return Math.abs(t[0] - 200) <= 2 && Math.abs(t[1] - 200) <= 2 && Math.abs(t[2] - 200) <= 2;
|
|
1782
1782
|
}
|
|
1783
1783
|
function Cs(t, n = {}) {
|
|
1784
|
-
return n.treatLegacyForegroundAsAci7 && Is(t) ? { kind: "aci", index: 7 } : { kind: "truecolor", rgb:
|
|
1784
|
+
return n.treatLegacyForegroundAsAci7 && Is(t) ? { kind: "aci", index: 7 } : { kind: "truecolor", rgb: Ce(t) };
|
|
1785
1785
|
}
|
|
1786
1786
|
function ws(t, n, e) {
|
|
1787
|
-
return t.kind === "truecolor" ?
|
|
1787
|
+
return t.kind === "truecolor" ? Ce(t.rgb) : t.kind === "aci" ? vs(t.index, n) : (t.kind === "none", e === "text" ? n.defaultText : n.defaultLine);
|
|
1788
1788
|
}
|
|
1789
1789
|
function vs(t, n) {
|
|
1790
1790
|
const e = fr(t);
|
|
1791
|
-
return
|
|
1791
|
+
return Ce(e === 7 || e === 0 || e === 256 ? n.foreground : ps[e] ?? n.defaultLine);
|
|
1792
1792
|
}
|
|
1793
1793
|
function fr(t) {
|
|
1794
1794
|
return Number.isFinite(t) ? Math.abs(Math.trunc(t)) : 7;
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function Ce(t) {
|
|
1797
1797
|
return [q(t[0]), q(t[1]), q(t[2])];
|
|
1798
1798
|
}
|
|
1799
1799
|
function Rs(t, n) {
|
|
@@ -1815,7 +1815,7 @@ function yr(t, n) {
|
|
|
1815
1815
|
}
|
|
1816
1816
|
function Bs(t, n, e, r) {
|
|
1817
1817
|
const i = As(t);
|
|
1818
|
-
let s = 0, a = 1, o =
|
|
1818
|
+
let s = 0, a = 1, o = Ce(t);
|
|
1819
1819
|
for (let c = 0; c < 16; c += 1) {
|
|
1820
1820
|
const l = (s + a) / 2, d = r === "light" ? i.l * (1 - l) : i.l + (1 - i.l) * l, u = Es(i.h, i.s, d);
|
|
1821
1821
|
yr(u, n) >= e ? (o = u, a = l) : s = l;
|
|
@@ -1960,7 +1960,7 @@ class mr extends Kr {
|
|
|
1960
1960
|
this.uniforms.uResolution.value.set(Math.max(1, e), Math.max(1, r));
|
|
1961
1961
|
}
|
|
1962
1962
|
}
|
|
1963
|
-
const
|
|
1963
|
+
const ks = new Float32Array([
|
|
1964
1964
|
-1,
|
|
1965
1965
|
1,
|
|
1966
1966
|
1,
|
|
@@ -1985,7 +1985,7 @@ const Ts = new Float32Array([
|
|
|
1985
1985
|
1,
|
|
1986
1986
|
0,
|
|
1987
1987
|
-1
|
|
1988
|
-
]),
|
|
1988
|
+
]), Ts = [
|
|
1989
1989
|
0,
|
|
1990
1990
|
2,
|
|
1991
1991
|
1,
|
|
@@ -2014,14 +2014,14 @@ function xr(t, n) {
|
|
|
2014
2014
|
t.boundingBox = e.box, t.boundingSphere = e.sphere;
|
|
2015
2015
|
}
|
|
2016
2016
|
function Ms(t) {
|
|
2017
|
-
const n = new
|
|
2017
|
+
const n = new Ut();
|
|
2018
2018
|
n.setAttribute("position", new Q(t.position, t.positionItemSize)), n.setAttribute("color", new Q(t.color, 3, !0)), xr(n, t.bbox);
|
|
2019
|
-
const e = new mr({ variant: "thin" }), r = new
|
|
2019
|
+
const e = new mr({ variant: "thin" }), r = new Gt(n, e);
|
|
2020
2020
|
return r.name = "cad-thin-line", r.renderOrder = 1, r.userData.kind = "line", r.userData.mode = "thin", r.userData.vertexCount = t.vertexCount, r.userData.bbox = t.bbox, r;
|
|
2021
2021
|
}
|
|
2022
2022
|
function Ds(t) {
|
|
2023
2023
|
const n = Math.floor(t.vertexCount / 2), e = t.positionItemSize * 2, r = new rn(t.position, e, 1), i = new rn(t.color, 6, 1), s = new Kn();
|
|
2024
|
-
s.setIndex(
|
|
2024
|
+
s.setIndex(Ts), s.setAttribute("position", new Xn(ks.slice(), 3)), s.setAttribute("instanceStart", new Le(r, t.positionItemSize, 0)), s.setAttribute("instanceEnd", new Le(r, t.positionItemSize, t.positionItemSize)), s.setAttribute("instanceColorStart", new Le(i, 3, 0, !0)), s.setAttribute("instanceColorEnd", new Le(i, 3, 3, !0)), s.instanceCount = n, xr(s, t.bbox);
|
|
2025
2025
|
const a = new mr({
|
|
2026
2026
|
variant: "fat",
|
|
2027
2027
|
linewidthPx: t.linewidthPx,
|
|
@@ -2066,9 +2066,9 @@ function dt(t, n) {
|
|
|
2066
2066
|
const e = [];
|
|
2067
2067
|
for (const r of n) {
|
|
2068
2068
|
if (r.count <= 0) continue;
|
|
2069
|
-
const i = r.bbox !== void 0 ?
|
|
2069
|
+
const i = r.bbox !== void 0 ? Gs(r.bbox) : Fe(r.pos, r.count, 3), s = _s(t);
|
|
2070
2070
|
for (let a = 0; a < r.count; ) {
|
|
2071
|
-
const o =
|
|
2071
|
+
const o = Us(a, r.count, s, pr(t)), c = new Ut(), l = r.pos.subarray(a * 3, o * 3), d = r.col.subarray(a * 3, o * 3), u = o - a;
|
|
2072
2072
|
c.setAttribute("position", new Q(l, 3)), c.setAttribute("color", new Q(d, 3, !0)), e.push({
|
|
2073
2073
|
geometry: c,
|
|
2074
2074
|
vertexCount: u,
|
|
@@ -2087,7 +2087,7 @@ function _s(t) {
|
|
|
2087
2087
|
const n = pr(t);
|
|
2088
2088
|
return Math.max(n, Math.floor(Fs / n) * n);
|
|
2089
2089
|
}
|
|
2090
|
-
function
|
|
2090
|
+
function Us(t, n, e, r) {
|
|
2091
2091
|
let i = Math.min(n, t + e);
|
|
2092
2092
|
if (i < n) {
|
|
2093
2093
|
const s = t + Math.floor((i - t) / r) * r;
|
|
@@ -2095,7 +2095,7 @@ function Gs(t, n, e, r) {
|
|
|
2095
2095
|
}
|
|
2096
2096
|
return i > t ? i : n;
|
|
2097
2097
|
}
|
|
2098
|
-
function
|
|
2098
|
+
function Gs(t) {
|
|
2099
2099
|
return t ? { minX: t.minX, minY: t.minY, maxX: t.maxX, maxY: t.maxY } : null;
|
|
2100
2100
|
}
|
|
2101
2101
|
function Ns(t) {
|
|
@@ -2253,7 +2253,7 @@ class Bn {
|
|
|
2253
2253
|
}
|
|
2254
2254
|
refresh(n, e, r, i) {
|
|
2255
2255
|
const s = n ? je(n, this.marginRatio) : null, a = !s, o = i === void 0 ? `signature:${Hs(r)}` : `revision:${i}`;
|
|
2256
|
-
if (this.cacheValid && this.lastLayerVersion === e.version && this.lastUserHiddenCacheKey === o && this.lastFilteredQueryAll === a &&
|
|
2256
|
+
if (this.cacheValid && this.lastLayerVersion === e.version && this.lastUserHiddenCacheKey === o && this.lastFilteredQueryAll === a && Ur(this.lastFilteredQueryRect, s))
|
|
2257
2257
|
return;
|
|
2258
2258
|
const c = this.resolveQueryHits(s), l = /* @__PURE__ */ new Map();
|
|
2259
2259
|
for (const u of c) {
|
|
@@ -2331,7 +2331,7 @@ function Hs(t) {
|
|
|
2331
2331
|
return t.size === 0 ? "0:" : `${t.size}:${Array.from(t).sort((n, e) => n - e).join(",")}`;
|
|
2332
2332
|
}
|
|
2333
2333
|
function qs(t, n, e) {
|
|
2334
|
-
const r = t === "line" ? new
|
|
2334
|
+
const r = t === "line" ? new Gt(n, e) : t === "fill" ? new Nt(n, e) : new Wn(n, e);
|
|
2335
2335
|
return r.count = 0, r;
|
|
2336
2336
|
}
|
|
2337
2337
|
function An(t, n) {
|
|
@@ -2488,11 +2488,11 @@ function Z(t, n, e) {
|
|
|
2488
2488
|
const ra = {
|
|
2489
2489
|
visibleVertexCount: 0,
|
|
2490
2490
|
zoom: 1
|
|
2491
|
-
}, Vn = /* @__PURE__ */ new Set(), ia = Object.freeze({ kind: "structure" }),
|
|
2491
|
+
}, Vn = /* @__PURE__ */ new Set(), ia = Object.freeze({ kind: "structure" }), Bo = Object.freeze({ kind: "visual" });
|
|
2492
2492
|
function sa(t) {
|
|
2493
2493
|
let n = null;
|
|
2494
2494
|
for (const e of t)
|
|
2495
|
-
Vt(e.bbox) && (n =
|
|
2495
|
+
Vt(e.bbox) && (n = fe(n, e.bbox));
|
|
2496
2496
|
return n;
|
|
2497
2497
|
}
|
|
2498
2498
|
function Vt(t) {
|
|
@@ -2504,7 +2504,7 @@ function Cr(t, n, e) {
|
|
|
2504
2504
|
function aa(t) {
|
|
2505
2505
|
return t.recordKey ?? Cr(t.instanceId, t.variantId, 0);
|
|
2506
2506
|
}
|
|
2507
|
-
const ft = "geo-node:promoted-instanced-v1", Pn = "geo-node:text-batch-static-bounds-v1", Me = "geo-node:text-batch-bounds-dirty-v1",
|
|
2507
|
+
const ft = "geo-node:promoted-instanced-v1", Pn = "geo-node:text-batch-static-bounds-v1", Me = "geo-node:text-batch-bounds-dirty-v1", kn = 1.5, oa = 1, Tn = "geo-node:world-sized-points-v1", wr = "geo-node:world-sized-points-uniforms", la = 16777216, ca = 25, ua = 28, da = 29;
|
|
2508
2508
|
function ha() {
|
|
2509
2509
|
return {
|
|
2510
2510
|
activeThinCount: 0,
|
|
@@ -2513,13 +2513,13 @@ function ha() {
|
|
|
2513
2513
|
cachedFatCount: 0
|
|
2514
2514
|
};
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function we(t) {
|
|
2517
2517
|
return [t[0], t[1], t[2], t[3]];
|
|
2518
2518
|
}
|
|
2519
2519
|
function fa(t, n) {
|
|
2520
2520
|
return [Math.min(t[0], n[0]), Math.min(t[1], n[1]), Math.max(t[2], n[2]), Math.max(t[3], n[3])];
|
|
2521
2521
|
}
|
|
2522
|
-
function
|
|
2522
|
+
function U(t) {
|
|
2523
2523
|
return [t[0], t[1], t[2]];
|
|
2524
2524
|
}
|
|
2525
2525
|
function ya(t, n) {
|
|
@@ -2530,7 +2530,7 @@ function Ln(t, n, e) {
|
|
|
2530
2530
|
r.vertexCount <= 0 || t.push({
|
|
2531
2531
|
startVertex: r.startVertex + e,
|
|
2532
2532
|
vertexCount: r.vertexCount,
|
|
2533
|
-
color:
|
|
2533
|
+
color: U(r.color)
|
|
2534
2534
|
});
|
|
2535
2535
|
}
|
|
2536
2536
|
function Pt(t) {
|
|
@@ -2540,7 +2540,7 @@ function Pt(t) {
|
|
|
2540
2540
|
const r = {
|
|
2541
2541
|
startVertex: e.startVertex,
|
|
2542
2542
|
vertexCount: e.vertexCount,
|
|
2543
|
-
color:
|
|
2543
|
+
color: U(e.color)
|
|
2544
2544
|
}, i = n[n.length - 1];
|
|
2545
2545
|
if (i && i.startVertex + i.vertexCount === r.startVertex && ya(i.color, r.color)) {
|
|
2546
2546
|
n[n.length - 1] = {
|
|
@@ -2588,7 +2588,10 @@ function xa(t, n) {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
const s = new Map(i.inserts.map((o) => [o.instanceId, o]));
|
|
2590
2590
|
for (const o of r.inserts)
|
|
2591
|
-
s.set(
|
|
2591
|
+
s.set(
|
|
2592
|
+
o.instanceId,
|
|
2593
|
+
pa(s.get(o.instanceId), o)
|
|
2594
|
+
);
|
|
2592
2595
|
const a = Array.from(s.values()).sort((o, c) => o.instanceId - c.instanceId);
|
|
2593
2596
|
e.set(r.variantId, {
|
|
2594
2597
|
...i,
|
|
@@ -2600,7 +2603,21 @@ function xa(t, n) {
|
|
|
2600
2603
|
}
|
|
2601
2604
|
return Array.from(e.values()).sort((r, i) => i.instanceCount - r.instanceCount);
|
|
2602
2605
|
}
|
|
2603
|
-
function pa(t) {
|
|
2606
|
+
function pa(t, n) {
|
|
2607
|
+
const e = fe((t == null ? void 0 : t.bbox) ?? null, n.bbox ?? null);
|
|
2608
|
+
if (e)
|
|
2609
|
+
return {
|
|
2610
|
+
...n,
|
|
2611
|
+
canHighlight: !0,
|
|
2612
|
+
bbox: e
|
|
2613
|
+
};
|
|
2614
|
+
const { bbox: r, ...i } = n;
|
|
2615
|
+
return {
|
|
2616
|
+
...i,
|
|
2617
|
+
canHighlight: !1
|
|
2618
|
+
};
|
|
2619
|
+
}
|
|
2620
|
+
function ga(t) {
|
|
2604
2621
|
return t.line.count > 0 || t.fill.count > 0 || t.dot.count > 0 || t.line.raw.byteLength > 0 || t.fill.raw.byteLength > 0 || t.dot.raw.byteLength > 0;
|
|
2605
2622
|
}
|
|
2606
2623
|
function Dn(t, n) {
|
|
@@ -2613,7 +2630,7 @@ function Dn(t, n) {
|
|
|
2613
2630
|
);
|
|
2614
2631
|
return e;
|
|
2615
2632
|
}
|
|
2616
|
-
function
|
|
2633
|
+
function ba(t, n, e) {
|
|
2617
2634
|
if (!n) return t;
|
|
2618
2635
|
if (!t)
|
|
2619
2636
|
return {
|
|
@@ -2623,7 +2640,7 @@ function ga(t, n, e) {
|
|
|
2623
2640
|
};
|
|
2624
2641
|
const r = t.variants.slice();
|
|
2625
2642
|
for (const s of n.variants)
|
|
2626
|
-
(!r[s.id] ||
|
|
2643
|
+
(!r[s.id] || ga(s)) && (r[s.id] = s);
|
|
2627
2644
|
const i = /* @__PURE__ */ new Map();
|
|
2628
2645
|
for (const [s, a] of t.textIndexesByInstanceId)
|
|
2629
2646
|
i.set(s, [...a]);
|
|
@@ -2640,20 +2657,20 @@ function ga(t, n, e) {
|
|
|
2640
2657
|
])
|
|
2641
2658
|
};
|
|
2642
2659
|
}
|
|
2643
|
-
function
|
|
2660
|
+
function Ia(t) {
|
|
2644
2661
|
return {
|
|
2645
2662
|
index: t.index,
|
|
2646
2663
|
name: t.name,
|
|
2647
|
-
color:
|
|
2664
|
+
color: U(t.color),
|
|
2648
2665
|
lw_px: t.lw_px,
|
|
2649
2666
|
visible: t.visible
|
|
2650
2667
|
};
|
|
2651
2668
|
}
|
|
2652
|
-
function
|
|
2669
|
+
function Ca(t) {
|
|
2653
2670
|
const n = t >>> 0;
|
|
2654
2671
|
return [n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
2655
2672
|
}
|
|
2656
|
-
function
|
|
2673
|
+
function wa(t) {
|
|
2657
2674
|
return t[0] << 16 | t[1] << 8 | t[2];
|
|
2658
2675
|
}
|
|
2659
2676
|
function yt(t) {
|
|
@@ -2661,7 +2678,7 @@ function yt(t) {
|
|
|
2661
2678
|
const n = Math.round(t);
|
|
2662
2679
|
return n < 0 ? 0 : n > 255 ? 255 : n;
|
|
2663
2680
|
}
|
|
2664
|
-
function
|
|
2681
|
+
function va(t) {
|
|
2665
2682
|
switch (t) {
|
|
2666
2683
|
case "fill":
|
|
2667
2684
|
return 1;
|
|
@@ -2678,8 +2695,8 @@ function wa(t) {
|
|
|
2678
2695
|
return 0;
|
|
2679
2696
|
}
|
|
2680
2697
|
}
|
|
2681
|
-
function
|
|
2682
|
-
return (n !== null && Zt(t) ? la : yt(t[0]) << 16 | yt(t[1]) << 8 | yt(t[2])) |
|
|
2698
|
+
function Ra(t, n, e, r, i) {
|
|
2699
|
+
return (n !== null && Zt(t) ? la : yt(t[0]) << 16 | yt(t[1]) << 8 | yt(t[2])) | va(e) << ca | (r === "light" ? 1 : 0) << ua | (i ? 1 : 0) << da;
|
|
2683
2700
|
}
|
|
2684
2701
|
function mt(t) {
|
|
2685
2702
|
return "color" in t && t.color instanceof Hn;
|
|
@@ -2699,7 +2716,7 @@ function xt(t) {
|
|
|
2699
2716
|
i && !n.has(i) && (n.add(i), i.dispose()), e !== t && ((s = e.dispose) == null || s.call(e));
|
|
2700
2717
|
});
|
|
2701
2718
|
}
|
|
2702
|
-
function
|
|
2719
|
+
function Ba(t) {
|
|
2703
2720
|
var i;
|
|
2704
2721
|
const n = t.userData;
|
|
2705
2722
|
if (n[ft] === !0)
|
|
@@ -2740,19 +2757,19 @@ function Ra(t) {
|
|
|
2740
2757
|
const r = (i = t.customProgramCacheKey) == null ? void 0 : i.bind(t);
|
|
2741
2758
|
t.customProgramCacheKey = () => `${r ? r() : ""}|${ft}`, n[ft] = !0, t.needsUpdate = !0;
|
|
2742
2759
|
}
|
|
2743
|
-
function
|
|
2760
|
+
function Aa(t) {
|
|
2744
2761
|
const n = t.userData[wr];
|
|
2745
2762
|
return n && typeof n == "object" ? n : null;
|
|
2746
2763
|
}
|
|
2747
|
-
function
|
|
2764
|
+
function Ea(t, n) {
|
|
2748
2765
|
var o;
|
|
2749
|
-
const e = t.userData, r =
|
|
2766
|
+
const e = t.userData, r = Aa(t);
|
|
2750
2767
|
if (r)
|
|
2751
|
-
return r.uGeoPointWorldSize.value = n.pointWorldSize, r.uGeoPointViewportHeight.value = Math.max(1, Math.floor(n.viewportHeight) || 1), r.uGeoPointMinVisiblePixelSize.value =
|
|
2768
|
+
return r.uGeoPointWorldSize.value = n.pointWorldSize, r.uGeoPointViewportHeight.value = Math.max(1, Math.floor(n.viewportHeight) || 1), r.uGeoPointMinVisiblePixelSize.value = kn, r;
|
|
2752
2769
|
const i = {
|
|
2753
2770
|
uGeoPointWorldSize: { value: n.pointWorldSize },
|
|
2754
2771
|
uGeoPointViewportHeight: { value: Math.max(1, Math.floor(n.viewportHeight) || 1) },
|
|
2755
|
-
uGeoPointMinVisiblePixelSize: { value:
|
|
2772
|
+
uGeoPointMinVisiblePixelSize: { value: kn }
|
|
2756
2773
|
};
|
|
2757
2774
|
e[wr] = i;
|
|
2758
2775
|
const s = t.onBeforeCompile;
|
|
@@ -2783,13 +2800,13 @@ function Aa(t, n) {
|
|
|
2783
2800
|
));
|
|
2784
2801
|
};
|
|
2785
2802
|
const a = (o = t.customProgramCacheKey) == null ? void 0 : o.bind(t);
|
|
2786
|
-
return t.customProgramCacheKey = () => `${a ? a() : ""}|${
|
|
2803
|
+
return t.customProgramCacheKey = () => `${a ? a() : ""}|${Tn}`, e[Tn] = !0, t.needsUpdate = !0, i;
|
|
2787
2804
|
}
|
|
2788
2805
|
const We = /* @__PURE__ */ new WeakMap();
|
|
2789
2806
|
function Ye(t, n) {
|
|
2790
2807
|
n ? We.set(t, n) : We.delete(t);
|
|
2791
2808
|
}
|
|
2792
|
-
class
|
|
2809
|
+
class ye extends J {
|
|
2793
2810
|
constructor(e = {}) {
|
|
2794
2811
|
super();
|
|
2795
2812
|
f(this, "meta", {
|
|
@@ -2902,8 +2919,8 @@ class fe extends J {
|
|
|
2902
2919
|
setLayerColor(e, r) {
|
|
2903
2920
|
const i = this.layerStatesByIndex.get(e), s = this.layerGroupsByIndex.get(e), a = this.originalLayerColorsByIndex.get(e);
|
|
2904
2921
|
if (!i || !s || !a) return;
|
|
2905
|
-
const o = r === null ? null :
|
|
2906
|
-
o ? this.colorOverridesByIndex.set(e,
|
|
2922
|
+
const o = r === null ? null : Ca(r);
|
|
2923
|
+
o ? this.colorOverridesByIndex.set(e, U(o)) : this.colorOverridesByIndex.delete(e), this.displayHexMemo.clear(), i.color = U(o ?? a), this.layerStateRevision += 1, s.traverse((c) => {
|
|
2907
2924
|
var h;
|
|
2908
2925
|
const l = (h = c.userData) == null ? void 0 : h.kind;
|
|
2909
2926
|
if (l === "text" || l === "text-batch") return;
|
|
@@ -2929,7 +2946,7 @@ class fe extends J {
|
|
|
2929
2946
|
if (((r = this.metaSnapshotCache) == null ? void 0 : r.revision) === this.metaRevision)
|
|
2930
2947
|
return this.metaSnapshotCache.value;
|
|
2931
2948
|
const e = Object.freeze({
|
|
2932
|
-
bounds:
|
|
2949
|
+
bounds: we(this.meta.bounds),
|
|
2933
2950
|
entityCount: this.meta.entityCount,
|
|
2934
2951
|
lineCount: this.meta.lineCount,
|
|
2935
2952
|
fillCount: this.meta.fillCount,
|
|
@@ -2943,7 +2960,7 @@ class fe extends J {
|
|
|
2943
2960
|
if (((r = this.layersSnapshotCache) == null ? void 0 : r.revision) === this.layerStateRevision)
|
|
2944
2961
|
return this.layersSnapshotCache.value;
|
|
2945
2962
|
const e = Object.freeze(
|
|
2946
|
-
this.layerOrder.map((i) => this.layerStatesByIndex.get(i)).filter((i) => i !== void 0).map((i) => Object.freeze(
|
|
2963
|
+
this.layerOrder.map((i) => this.layerStatesByIndex.get(i)).filter((i) => i !== void 0).map((i) => Object.freeze(Ia(i)))
|
|
2947
2964
|
);
|
|
2948
2965
|
return this.layersSnapshotCache = { revision: this.layerStateRevision, value: e }, e;
|
|
2949
2966
|
}
|
|
@@ -2981,7 +2998,7 @@ class fe extends J {
|
|
|
2981
2998
|
var r;
|
|
2982
2999
|
if (((r = this.boundsSnapshotCache) == null ? void 0 : r.revision) === this.metaRevision)
|
|
2983
3000
|
return this.boundsSnapshotCache.value;
|
|
2984
|
-
const e = Object.freeze(
|
|
3001
|
+
const e = Object.freeze(we(this.bounds));
|
|
2985
3002
|
return this.boundsSnapshotCache = { revision: this.metaRevision, value: e }, e;
|
|
2986
3003
|
}
|
|
2987
3004
|
getGeometryChunkStats() {
|
|
@@ -2997,7 +3014,7 @@ class fe extends J {
|
|
|
2997
3014
|
return [...e, ...r];
|
|
2998
3015
|
}
|
|
2999
3016
|
_collectTextUserDataForDebug() {
|
|
3000
|
-
return this.textUserDataByAppendOrder.map((e) => ({ ...e, c:
|
|
3017
|
+
return this.textUserDataByAppendOrder.map((e) => ({ ...e, c: U(e.c) }));
|
|
3001
3018
|
}
|
|
3002
3019
|
getTextEntries() {
|
|
3003
3020
|
return this.textUserDataByAppendOrder;
|
|
@@ -3182,8 +3199,8 @@ class fe extends J {
|
|
|
3182
3199
|
}
|
|
3183
3200
|
_initFromHeader(e) {
|
|
3184
3201
|
if (!this.disposed) {
|
|
3185
|
-
this.readySettled && this.startReadyCycle(), this.resetContent(), this.bounds =
|
|
3186
|
-
bounds:
|
|
3202
|
+
this.readySettled && this.startReadyCycle(), this.resetContent(), this.bounds = we(e.bounds), this.meta = {
|
|
3203
|
+
bounds: we(e.bounds),
|
|
3187
3204
|
entityCount: e.entityCount,
|
|
3188
3205
|
lineCount: e.lineCount,
|
|
3189
3206
|
fillCount: e.fillCount,
|
|
@@ -3194,9 +3211,9 @@ class fe extends J {
|
|
|
3194
3211
|
const i = r.index, s = {
|
|
3195
3212
|
...r,
|
|
3196
3213
|
visible: r.visible ?? !0,
|
|
3197
|
-
color:
|
|
3214
|
+
color: U(r.color)
|
|
3198
3215
|
};
|
|
3199
|
-
this.layerOrder.push(i), this.layerStatesByIndex.set(i, s), this.originalLayerColorsByIndex.set(i,
|
|
3216
|
+
this.layerOrder.push(i), this.layerStatesByIndex.set(i, s), this.originalLayerColorsByIndex.set(i, U(s.color));
|
|
3200
3217
|
const a = this.ensureLayerGroup(i, s.name, s.visible);
|
|
3201
3218
|
a.name = s.name, a.visible = s.visible;
|
|
3202
3219
|
}
|
|
@@ -3332,9 +3349,9 @@ class fe extends J {
|
|
|
3332
3349
|
let s = null;
|
|
3333
3350
|
for (const c of i.byKind.values())
|
|
3334
3351
|
for (const l of c)
|
|
3335
|
-
s =
|
|
3352
|
+
s = fe(s, l.bbox);
|
|
3336
3353
|
if (!s) return null;
|
|
3337
|
-
const a =
|
|
3354
|
+
const a = Gr(s, r);
|
|
3338
3355
|
return Vt(a) ? a : null;
|
|
3339
3356
|
}
|
|
3340
3357
|
_debugHasInsertPresenter() {
|
|
@@ -3364,13 +3381,13 @@ class fe extends J {
|
|
|
3364
3381
|
if (this.disposed) return;
|
|
3365
3382
|
const r = this.meta.textCount, i = fa(this.bounds, e.bounds);
|
|
3366
3383
|
this.bounds = i, this.meta = {
|
|
3367
|
-
bounds:
|
|
3384
|
+
bounds: we(i),
|
|
3368
3385
|
entityCount: this.meta.entityCount + e.entityCount,
|
|
3369
3386
|
lineCount: this.meta.lineCount + e.lineCount,
|
|
3370
3387
|
fillCount: this.meta.fillCount + e.fillCount,
|
|
3371
3388
|
dotCount: this.meta.dotCount + e.dotCount,
|
|
3372
3389
|
textCount: this.meta.textCount + e.textCount
|
|
3373
|
-
}, this.metaRevision += 1, this.layerBlockUsages = ma(this.layerBlockUsages, e.layerBlockUsages), this.insertRuntime =
|
|
3390
|
+
}, this.metaRevision += 1, this.layerBlockUsages = ma(this.layerBlockUsages, e.layerBlockUsages), this.insertRuntime = ba(this.insertRuntime, e.insertRuntime, r), this.rebuildInsertRuntimeInstanceIndex(), this.updateAutoQualityContext({
|
|
3374
3391
|
visibleVertexCount: this.meta.lineCount + this.meta.fillCount + this.meta.dotCount,
|
|
3375
3392
|
zoom: this.autoQualityContext.zoom
|
|
3376
3393
|
}), this.notifyInternalChange();
|
|
@@ -3425,7 +3442,7 @@ class fe extends J {
|
|
|
3425
3442
|
sizeAttenuation: !1,
|
|
3426
3443
|
depthTest: !1,
|
|
3427
3444
|
depthWrite: !1
|
|
3428
|
-
}), c =
|
|
3445
|
+
}), c = Ea(o, {
|
|
3429
3446
|
pointWorldSize: a,
|
|
3430
3447
|
viewportHeight: this.lineResolution.height
|
|
3431
3448
|
});
|
|
@@ -3444,7 +3461,7 @@ class fe extends J {
|
|
|
3444
3461
|
const s = this.textRenderablesByLayerIndex.get(e.li) ?? [];
|
|
3445
3462
|
s.push(i), this.textRenderablesByLayerIndex.set(e.li, s), this.textRenderablesByAppendOrder.push(i);
|
|
3446
3463
|
const a = Number(r.userData.textCount || 0);
|
|
3447
|
-
r.userData.textCount = a + 1, this.textUserDataByAppendOrder.push({ ...i.userData.text, c:
|
|
3464
|
+
r.userData.textCount = a + 1, this.textUserDataByAppendOrder.push({ ...i.userData.text, c: U(i.userData.text.c) }), typeof globalThis.self < "u" && this.scheduleTextBatchSync(r);
|
|
3448
3465
|
}
|
|
3449
3466
|
appendAnnotationTextChunks(e) {
|
|
3450
3467
|
if (!(this.disposed || e.length === 0))
|
|
@@ -3456,7 +3473,7 @@ class fe extends J {
|
|
|
3456
3473
|
i.userData.annotationOverlay = !0, i.visible = this.annotationOverlayVisible, this.applyColorToTextRenderable(i, this.colorOverridesByIndex.get(e.li) ?? null), r.add(i), this.markTextBatchBoundsDirty(r);
|
|
3457
3474
|
const s = this.annotationTextRenderablesByLayerIndex.get(e.li) ?? [];
|
|
3458
3475
|
s.push(i), this.annotationTextRenderablesByLayerIndex.set(e.li, s);
|
|
3459
|
-
const a =
|
|
3476
|
+
const a = ye.getTextOwnerKey(e), o = {
|
|
3460
3477
|
renderable: i,
|
|
3461
3478
|
layerIndex: e.li,
|
|
3462
3479
|
ownerKey: a,
|
|
@@ -3468,7 +3485,7 @@ class fe extends J {
|
|
|
3468
3485
|
}
|
|
3469
3486
|
this.applyAnnotationTextRenderableVisibility(o);
|
|
3470
3487
|
const l = Number(r.userData.textCount || 0);
|
|
3471
|
-
r.userData.textCount = l + 1, this.textUserDataByAppendOrder.push({ ...i.userData.text, c:
|
|
3488
|
+
r.userData.textCount = l + 1, this.textUserDataByAppendOrder.push({ ...i.userData.text, c: U(i.userData.text.c) }), typeof globalThis.self < "u" && this.scheduleTextBatchSync(r);
|
|
3472
3489
|
}
|
|
3473
3490
|
getOrCreateTextBatch(e) {
|
|
3474
3491
|
const r = this.textBatchByLayerIndex.get(e);
|
|
@@ -3512,7 +3529,7 @@ class fe extends J {
|
|
|
3512
3529
|
}));
|
|
3513
3530
|
}
|
|
3514
3531
|
createRenderableChunk(e, r, i, s, a, o, c) {
|
|
3515
|
-
const l = new
|
|
3532
|
+
const l = new Ut();
|
|
3516
3533
|
l.setAttribute("position", new Xn(i, 3)), this.registerGeometryDisplayColors(
|
|
3517
3534
|
l,
|
|
3518
3535
|
s,
|
|
@@ -3525,7 +3542,7 @@ class fe extends J {
|
|
|
3525
3542
|
if (e === "line") {
|
|
3526
3543
|
const y = new an({ vertexColors: !0 });
|
|
3527
3544
|
this.applyLayerColorState(y, d, e);
|
|
3528
|
-
const p = new
|
|
3545
|
+
const p = new Gt(l, y);
|
|
3529
3546
|
p.renderOrder = 1, u = p;
|
|
3530
3547
|
} else if (e === "fill") {
|
|
3531
3548
|
const y = new on({
|
|
@@ -3684,9 +3701,9 @@ class fe extends J {
|
|
|
3684
3701
|
}
|
|
3685
3702
|
createRenderableTextChunk(e) {
|
|
3686
3703
|
const r = Yr, i = this.resolveTextFont(e.t), s = new r();
|
|
3687
|
-
s.text = i.text, s.fontSize = e.h, s.position.set(e.x, e.y, 0), s.rotation.z = (e.r || 0) * Math.PI / 180, s.color = this.resolveDisplayHexForRgb(e.c, e.li, "text"), s.anchorX =
|
|
3704
|
+
s.text = i.text, s.fontSize = e.h, s.position.set(e.x, e.y, 0), s.rotation.z = (e.r || 0) * Math.PI / 180, s.color = this.resolveDisplayHexForRgb(e.c, e.li, "text"), s.anchorX = ye.resolveTextAnchorX(e.ha), s.anchorY = ye.resolveTextAnchorY(e.va), i.fontUrl && (s.font = i.fontUrl), e.w && (s.maxWidth = e.w), e.lh && (s.lineHeight = e.lh);
|
|
3688
3705
|
const a = e.wf || 1;
|
|
3689
|
-
return s.scale.x = (e.mx ? -1 : 1) * a, e.my && (s.scale.y = -1), this.commitTroikaTextTransform(s), s.name = "text-chunk", s.userData.kind = "text", s.userData.layerIndex = e.li, s.userData.text = { ...e, c:
|
|
3706
|
+
return s.scale.x = (e.mx ? -1 : 1) * a, e.my && (s.scale.y = -1), this.commitTroikaTextTransform(s), s.name = "text-chunk", s.userData.kind = "text", s.userData.layerIndex = e.li, s.userData.text = { ...e, c: U(e.c) }, s.userData.renderedText = i.text, s.userData.fontKind = i.kind ?? "default", s.userData.replacedUnsupportedText = i.replacedUnsupported === !0, s;
|
|
3690
3707
|
}
|
|
3691
3708
|
commitTroikaTextTransform(e) {
|
|
3692
3709
|
e.matrixAutoUpdate = !1, e.updateMatrix();
|
|
@@ -3782,10 +3799,10 @@ class fe extends J {
|
|
|
3782
3799
|
this.layerStatesByIndex.set(e, {
|
|
3783
3800
|
index: e,
|
|
3784
3801
|
name: a.name,
|
|
3785
|
-
color:
|
|
3802
|
+
color: U(c),
|
|
3786
3803
|
lw_px: 1,
|
|
3787
3804
|
visible: i
|
|
3788
|
-
}), this.originalLayerColorsByIndex.set(e,
|
|
3805
|
+
}), this.originalLayerColorsByIndex.set(e, U(c)), this.layerStateRevision += 1;
|
|
3789
3806
|
}
|
|
3790
3807
|
return a;
|
|
3791
3808
|
}
|
|
@@ -3827,7 +3844,7 @@ class fe extends J {
|
|
|
3827
3844
|
for (const o of r) {
|
|
3828
3845
|
let c = 0, l = null;
|
|
3829
3846
|
for (const x of o.records)
|
|
3830
|
-
c += x.vertexCount, l =
|
|
3847
|
+
c += x.vertexCount, l = fe(l, x.bbox);
|
|
3831
3848
|
const d = o.canonicalKind === "xy" ? 2 : 3, u = new Float32Array(c * d), h = new Uint8Array(c * 3), y = [];
|
|
3832
3849
|
let p = !0, m = 0;
|
|
3833
3850
|
for (const x of o.records)
|
|
@@ -3896,7 +3913,7 @@ class fe extends J {
|
|
|
3896
3913
|
const P = Number(((w = C.userData) == null ? void 0 : w.vertexCount) || 0);
|
|
3897
3914
|
if (P <= 0) continue;
|
|
3898
3915
|
const M = B.userData.cadDisplaySourceColor, D = B.userData.cadDisplayColorRuns;
|
|
3899
|
-
D && D.length > 0 ? Ln(d, D, a) : u = !1, a += P, c.push(V.array), l.push(M instanceof Uint8Array ? M : ds(A)), o =
|
|
3916
|
+
D && D.length > 0 ? Ln(d, D, a) : u = !1, a += P, c.push(V.array), l.push(M instanceof Uint8Array ? M : ds(A)), o = fe(o, ((x = C.userData) == null ? void 0 : x.bbox) ?? null);
|
|
3900
3917
|
}
|
|
3901
3918
|
for (const C of s)
|
|
3902
3919
|
i.remove(C), xt(C);
|
|
@@ -4069,9 +4086,9 @@ class fe extends J {
|
|
|
4069
4086
|
this.colorRefreshStats.displayRefreshVertexTotal += e.vertexCount, this.colorRefreshStats.displayRefreshRunTotal += e.runCount, this.colorRefreshStats.displayRefreshUniqueColorTotal += e.uniqueColorCount, this.colorRefreshStats.displayRefreshCacheHitTotal += e.cacheHitCount, this.colorRefreshStats.displayRefreshRepeatedRunVertexTotal += e.repeatedRunVertexCount;
|
|
4070
4087
|
}
|
|
4071
4088
|
resolveDisplayHexForRgb(e, r, i) {
|
|
4072
|
-
const s =
|
|
4089
|
+
const s = Ra(e, r, i, this.displayThemeName, this.displayContrastEnhancement), a = this.displayHexMemo.get(s);
|
|
4073
4090
|
if (a !== void 0) return a;
|
|
4074
|
-
const o =
|
|
4091
|
+
const o = wa(this.resolveDisplayRgbForLegacyRgb(e, r, i));
|
|
4075
4092
|
return this.displayHexMemo.set(s, o), o;
|
|
4076
4093
|
}
|
|
4077
4094
|
resolveDisplayRgbForLegacyRgb(e, r, i) {
|
|
@@ -4124,7 +4141,7 @@ class fe extends J {
|
|
|
4124
4141
|
vertexColors: !0,
|
|
4125
4142
|
size: 2,
|
|
4126
4143
|
sizeAttenuation: !1
|
|
4127
|
-
}),
|
|
4144
|
+
}), Ba(r), r;
|
|
4128
4145
|
}
|
|
4129
4146
|
clearViewportInsertPresenter() {
|
|
4130
4147
|
var e, r;
|
|
@@ -4266,7 +4283,7 @@ async function Rr(t, n, e) {
|
|
|
4266
4283
|
throw new Error(`Scene annotation count mismatch for ${r}`);
|
|
4267
4284
|
return a;
|
|
4268
4285
|
}
|
|
4269
|
-
async function
|
|
4286
|
+
async function Sa(t, n, e, r, i) {
|
|
4270
4287
|
if (e.externalVariantFetchSource !== void 0 || e.externalVariantBuffers !== void 0 || e.requiredExternalVariantIds !== void 0 || e.externalVariantGeometryFetchIds !== void 0)
|
|
4271
4288
|
return { annotations: [] };
|
|
4272
4289
|
const s = vr(t);
|
|
@@ -4305,12 +4322,14 @@ function Fn(t) {
|
|
|
4305
4322
|
worldUnitsPerPixel: t.worldUnitsPerPixel
|
|
4306
4323
|
};
|
|
4307
4324
|
}
|
|
4308
|
-
async function
|
|
4325
|
+
async function Va(t, n, e) {
|
|
4309
4326
|
if (!e.externalVariantBuffers && !e.externalVariantFetchSource)
|
|
4310
4327
|
throw new Error("External variant delta requires buffers or fetch source");
|
|
4311
4328
|
await is(t, n, void 0, {
|
|
4312
4329
|
signal: e.signal,
|
|
4313
4330
|
hiddenInstanceIds: Jt(e.hiddenInstanceIds),
|
|
4331
|
+
workerUrl: e.workerUrl,
|
|
4332
|
+
workerFactory: e.workerFactory,
|
|
4314
4333
|
externalVariantFetchSource: e.externalVariantFetchSource,
|
|
4315
4334
|
externalVariantBuffers: e.externalVariantBuffers,
|
|
4316
4335
|
requiredExternalVariantIds: re(e.requiredExternalVariantIds),
|
|
@@ -4319,28 +4338,28 @@ async function Sa(t, n, e) {
|
|
|
4319
4338
|
externalVariantDeltaOnly: !0
|
|
4320
4339
|
});
|
|
4321
4340
|
}
|
|
4322
|
-
function
|
|
4341
|
+
function Ao(t) {
|
|
4323
4342
|
return zr(t);
|
|
4324
4343
|
}
|
|
4325
|
-
const
|
|
4344
|
+
const Pa = {
|
|
4326
4345
|
deferExternalVariantGeometry: !0
|
|
4327
4346
|
};
|
|
4328
|
-
function
|
|
4329
|
-
return Dt(t,
|
|
4347
|
+
function ka(t) {
|
|
4348
|
+
return Dt(t, Pa).header;
|
|
4330
4349
|
}
|
|
4331
|
-
function
|
|
4350
|
+
function Eo(t) {
|
|
4332
4351
|
return Hr(t);
|
|
4333
4352
|
}
|
|
4334
|
-
function
|
|
4353
|
+
function So(t) {
|
|
4335
4354
|
return qr(t);
|
|
4336
4355
|
}
|
|
4337
|
-
function
|
|
4356
|
+
function Vo(t, n) {
|
|
4338
4357
|
return He(t, n);
|
|
4339
4358
|
}
|
|
4340
|
-
function
|
|
4359
|
+
function Po(t) {
|
|
4341
4360
|
return Ot(t);
|
|
4342
4361
|
}
|
|
4343
|
-
function
|
|
4362
|
+
function ko(t, n) {
|
|
4344
4363
|
return _t(t, n);
|
|
4345
4364
|
}
|
|
4346
4365
|
function To(t, n) {
|
|
@@ -4357,7 +4376,7 @@ function To(t, n) {
|
|
|
4357
4376
|
chunks: Array.from(e.chunks)
|
|
4358
4377
|
};
|
|
4359
4378
|
}
|
|
4360
|
-
function
|
|
4379
|
+
function Lo(t) {
|
|
4361
4380
|
ei(t);
|
|
4362
4381
|
}
|
|
4363
4382
|
function Ta(t) {
|
|
@@ -4371,8 +4390,8 @@ function re(t) {
|
|
|
4371
4390
|
if (t !== void 0)
|
|
4372
4391
|
return new Set(t);
|
|
4373
4392
|
}
|
|
4374
|
-
function
|
|
4375
|
-
const e = new AbortController(), r = Je(t, e.signal), i = new
|
|
4393
|
+
function Mo(t, n = {}) {
|
|
4394
|
+
const e = new AbortController(), r = Je(t, e.signal), i = new ye({ resolveTextFont: n.resolveTextFont }), s = [
|
|
4376
4395
|
de(n.signal, e),
|
|
4377
4396
|
de(r.sourceSignal, e)
|
|
4378
4397
|
];
|
|
@@ -4387,7 +4406,7 @@ function Lo(t, n = {}) {
|
|
|
4387
4406
|
jt(r.source),
|
|
4388
4407
|
e.signal,
|
|
4389
4408
|
"CAD load aborted before decoding"
|
|
4390
|
-
), u = await
|
|
4409
|
+
), u = await Sa(
|
|
4391
4410
|
r.source,
|
|
4392
4411
|
d,
|
|
4393
4412
|
n,
|
|
@@ -4416,23 +4435,23 @@ function Lo(t, n = {}) {
|
|
|
4416
4435
|
}
|
|
4417
4436
|
})(), i;
|
|
4418
4437
|
}
|
|
4419
|
-
const
|
|
4438
|
+
const La = 40;
|
|
4420
4439
|
function Br(t) {
|
|
4421
4440
|
return !!(t && Number.isFinite(t.minX) && Number.isFinite(t.minY) && Number.isFinite(t.maxX) && Number.isFinite(t.maxY) && t.maxX >= t.minX && t.maxY >= t.minY);
|
|
4422
4441
|
}
|
|
4423
|
-
function
|
|
4442
|
+
function Ma(t, n, e) {
|
|
4424
4443
|
return n.x >= t.minX - e && n.x <= t.maxX + e && n.y >= t.minY - e && n.y <= t.maxY + e;
|
|
4425
4444
|
}
|
|
4426
|
-
function
|
|
4445
|
+
function Da(t, n) {
|
|
4427
4446
|
return n.minX >= t.minX && n.maxX <= t.maxX && n.minY >= t.minY && n.maxY <= t.maxY;
|
|
4428
4447
|
}
|
|
4429
|
-
function
|
|
4448
|
+
function Do(t, n) {
|
|
4430
4449
|
return t.layerIndex === n.layerIndex && t.variantId === n.variantId && t.instanceId === n.instanceId;
|
|
4431
4450
|
}
|
|
4432
|
-
function
|
|
4451
|
+
function Fa(t, n, e = {}) {
|
|
4433
4452
|
var a;
|
|
4434
4453
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) return null;
|
|
4435
|
-
const r = Math.max(0, e.padding ??
|
|
4454
|
+
const r = Math.max(0, e.padding ?? La), i = t.getLayers();
|
|
4436
4455
|
let s = null;
|
|
4437
4456
|
for (let o = i.length - 1; o >= 0; o -= 1) {
|
|
4438
4457
|
const c = i[o];
|
|
@@ -4442,14 +4461,14 @@ function Da(t, n, e = {}) {
|
|
|
4442
4461
|
const u = l[d];
|
|
4443
4462
|
for (let h = u.inserts.length - 1; h >= 0; h -= 1) {
|
|
4444
4463
|
const y = u.inserts[h];
|
|
4445
|
-
if (!y.canHighlight || !Br(y.bbox) || ((a = e.isInstanceVisible) == null ? void 0 : a.call(e, y.instanceId)) === !1 || !
|
|
4464
|
+
if (!y.canHighlight || !Br(y.bbox) || ((a = e.isInstanceVisible) == null ? void 0 : a.call(e, y.instanceId)) === !1 || !Ma(y.bbox, n, r)) continue;
|
|
4446
4465
|
const p = {
|
|
4447
4466
|
kind: "insert",
|
|
4448
4467
|
layerIndex: c.index,
|
|
4449
4468
|
variantId: u.variantId,
|
|
4450
4469
|
instanceId: y.instanceId
|
|
4451
4470
|
};
|
|
4452
|
-
if (s || (s = p), !e.viewport ||
|
|
4471
|
+
if (s || (s = p), !e.viewport || Da(e.viewport, y.bbox)) return p;
|
|
4453
4472
|
}
|
|
4454
4473
|
}
|
|
4455
4474
|
}
|
|
@@ -4473,15 +4492,15 @@ function pt(t, n) {
|
|
|
4473
4492
|
bbox: Object.freeze({ ...r.bbox })
|
|
4474
4493
|
};
|
|
4475
4494
|
}
|
|
4476
|
-
const
|
|
4477
|
-
function
|
|
4478
|
-
const n = t.w ?? t.t.length * t.h *
|
|
4495
|
+
const Oa = 0.6;
|
|
4496
|
+
function _a(t) {
|
|
4497
|
+
const n = t.w ?? t.t.length * t.h * Oa, e = t.h * (t.lh || 1);
|
|
4479
4498
|
let r = 0;
|
|
4480
4499
|
t.ha === "center" ? r = -n / 2 : t.ha === "right" && (r = -n);
|
|
4481
4500
|
let i = 0;
|
|
4482
4501
|
return t.va === "middle" ? i = -e / 2 : t.va === "top" && (i = -e), { x0: r, y0: i, x1: r + n, y1: i + e };
|
|
4483
4502
|
}
|
|
4484
|
-
function
|
|
4503
|
+
function Ua(t, n, e) {
|
|
4485
4504
|
const r = t.x - n.x, i = t.y - n.y, s = (n.r || 0) * Math.PI / 180, a = Math.cos(-s), o = Math.sin(-s), c = r * a - i * o, l = r * o + i * a;
|
|
4486
4505
|
return c >= e.x0 && c <= e.x1 && l >= e.y0 && l <= e.y1;
|
|
4487
4506
|
}
|
|
@@ -4492,12 +4511,12 @@ function Ga(t, n, e = {}) {
|
|
|
4492
4511
|
const s = t.getLayers(), a = i === void 0 ? r.length - 1 : Math.min(r.length, Math.max(0, Math.floor(i))) - 1;
|
|
4493
4512
|
for (let o = a; o >= 0; o -= 1) {
|
|
4494
4513
|
const c = r[o], l = s.find((d) => d.index === c.li);
|
|
4495
|
-
if (!(l && l.visible === !1) &&
|
|
4514
|
+
if (!(l && l.visible === !1) && Ua(n, c, _a(c)))
|
|
4496
4515
|
return { kind: "text", textId: o };
|
|
4497
4516
|
}
|
|
4498
4517
|
return null;
|
|
4499
4518
|
}
|
|
4500
|
-
function
|
|
4519
|
+
function Na(t, n) {
|
|
4501
4520
|
if (n.kind !== "text" || !Number.isInteger(n.textId) || n.textId < 0) return null;
|
|
4502
4521
|
const e = t.getTextEntries()[n.textId];
|
|
4503
4522
|
if (!e) return null;
|
|
@@ -4513,23 +4532,23 @@ function Ua(t, n) {
|
|
|
4513
4532
|
layerIndex: e.li
|
|
4514
4533
|
};
|
|
4515
4534
|
}
|
|
4516
|
-
function
|
|
4535
|
+
function Fo(t, n) {
|
|
4517
4536
|
return (t == null ? void 0 : t.kind) === "text" && (n == null ? void 0 : n.kind) === "text" && t.textId === n.textId;
|
|
4518
4537
|
}
|
|
4519
|
-
const
|
|
4538
|
+
const Oo = [
|
|
4520
4539
|
"created",
|
|
4521
4540
|
"header-ready",
|
|
4522
4541
|
"initial-loading",
|
|
4523
4542
|
"interactive",
|
|
4524
4543
|
"failed",
|
|
4525
4544
|
"disposed"
|
|
4526
|
-
],
|
|
4527
|
-
function
|
|
4528
|
-
return `${
|
|
4545
|
+
], kt = "insert:";
|
|
4546
|
+
function za(t) {
|
|
4547
|
+
return `${kt}${t.layerIndex}:${t.variantId}:${t.instanceId}`;
|
|
4529
4548
|
}
|
|
4530
4549
|
function Ar(t) {
|
|
4531
|
-
if (t.startsWith(
|
|
4532
|
-
const e = t.slice(
|
|
4550
|
+
if (t.startsWith(kt)) {
|
|
4551
|
+
const e = t.slice(kt.length).split(":");
|
|
4533
4552
|
if (e.length !== 3) return null;
|
|
4534
4553
|
const r = Number(e[0]), i = Number(e[1]), s = Number(e[2]);
|
|
4535
4554
|
return [r, i, s].every(Number.isInteger) ? { kind: "insert", layerIndex: r, variantId: i, instanceId: s } : null;
|
|
@@ -4537,7 +4556,7 @@ function Ar(t) {
|
|
|
4537
4556
|
const n = Number(t);
|
|
4538
4557
|
return Number.isInteger(n) ? { instanceId: n } : null;
|
|
4539
4558
|
}
|
|
4540
|
-
function
|
|
4559
|
+
function Ha(t) {
|
|
4541
4560
|
const n = Ar(t);
|
|
4542
4561
|
return n ? n.instanceId : null;
|
|
4543
4562
|
}
|
|
@@ -4565,7 +4584,7 @@ function On(t, n) {
|
|
|
4565
4584
|
planar: t.planar && n.planar
|
|
4566
4585
|
} : t : n;
|
|
4567
4586
|
}
|
|
4568
|
-
function
|
|
4587
|
+
function qa(t) {
|
|
4569
4588
|
let n = 0, e = 0;
|
|
4570
4589
|
return t.traverse((r) => {
|
|
4571
4590
|
if (!Sr(r) || !Er(r)) return;
|
|
@@ -4574,14 +4593,14 @@ function Ha(t) {
|
|
|
4574
4593
|
Number.isFinite(i) && i > 0 && (e += i);
|
|
4575
4594
|
}), { renderableCount: n, submittedVertexRefs: e };
|
|
4576
4595
|
}
|
|
4577
|
-
const
|
|
4596
|
+
const Ka = {
|
|
4578
4597
|
line: "线",
|
|
4579
4598
|
fill: "填充",
|
|
4580
4599
|
dot: "点",
|
|
4581
4600
|
text: "文字",
|
|
4582
4601
|
insertPresenter: "INSERT Presenter",
|
|
4583
4602
|
other: "其它"
|
|
4584
|
-
},
|
|
4603
|
+
}, Xa = [
|
|
4585
4604
|
"line",
|
|
4586
4605
|
"fill",
|
|
4587
4606
|
"dot",
|
|
@@ -4589,19 +4608,19 @@ const qa = {
|
|
|
4589
4608
|
"insertPresenter",
|
|
4590
4609
|
"other"
|
|
4591
4610
|
];
|
|
4592
|
-
function
|
|
4611
|
+
function Wa(t) {
|
|
4593
4612
|
var e;
|
|
4594
4613
|
if (((e = t.userData) == null ? void 0 : e.insertPresenterMesh) === !0) return "insertPresenter";
|
|
4595
4614
|
const n = t.userData.kind;
|
|
4596
4615
|
return n === "line" ? "line" : n === "fill" ? "fill" : n === "dot" ? "dot" : n === "text" || n === "text-batch" || t.name === "text-batch" || t.name === "annotation-text-batch" || t.name === "text-chunk" ? "text" : "other";
|
|
4597
4616
|
}
|
|
4598
|
-
function
|
|
4617
|
+
function Ya(t) {
|
|
4599
4618
|
const n = /* @__PURE__ */ new Map();
|
|
4600
4619
|
return t.traverse((e) => {
|
|
4601
4620
|
if (!Sr(e) || !Er(e)) return;
|
|
4602
|
-
const r =
|
|
4621
|
+
const r = Wa(e), i = n.get(r) ?? {
|
|
4603
4622
|
kind: r,
|
|
4604
|
-
label:
|
|
4623
|
+
label: Ka[r],
|
|
4605
4624
|
renderables: 0,
|
|
4606
4625
|
submittedVertexRefs: 0
|
|
4607
4626
|
};
|
|
@@ -4609,7 +4628,7 @@ function Wa(t) {
|
|
|
4609
4628
|
const s = Number(e.userData.vertexCount);
|
|
4610
4629
|
Number.isFinite(s) && s > 0 && (i.submittedVertexRefs += s), n.set(r, i);
|
|
4611
4630
|
}), {
|
|
4612
|
-
renderDebugBreakdown:
|
|
4631
|
+
renderDebugBreakdown: Xa.map((e) => n.get(e)).filter((e) => e !== void 0)
|
|
4613
4632
|
};
|
|
4614
4633
|
}
|
|
4615
4634
|
function Er(t) {
|
|
@@ -4624,8 +4643,8 @@ function Sr(t) {
|
|
|
4624
4643
|
}
|
|
4625
4644
|
return !0;
|
|
4626
4645
|
}
|
|
4627
|
-
const
|
|
4628
|
-
function
|
|
4646
|
+
const Qa = 8;
|
|
4647
|
+
function $a(t) {
|
|
4629
4648
|
const n = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
|
|
4630
4649
|
for (const a of t.getLayers())
|
|
4631
4650
|
for (const o of t.getLayerBlockUsages(a.index)) {
|
|
@@ -4652,10 +4671,10 @@ function Qa(t) {
|
|
|
4652
4671
|
blockVariantCount: n.size,
|
|
4653
4672
|
blockInstanceCount: r.size,
|
|
4654
4673
|
splitBlockLayerGroupCount: s.length,
|
|
4655
|
-
splitBlockLayerDetails: s.slice(0,
|
|
4674
|
+
splitBlockLayerDetails: s.slice(0, Qa)
|
|
4656
4675
|
};
|
|
4657
4676
|
}
|
|
4658
|
-
function
|
|
4677
|
+
function ja(t) {
|
|
4659
4678
|
let n = 0, e = null, r = 0;
|
|
4660
4679
|
const { node: i, hiddenInstanceIds: s } = t, a = () => {
|
|
4661
4680
|
e && i.refreshInsertPresenter(
|
|
@@ -4671,7 +4690,7 @@ function $a(t) {
|
|
|
4671
4690
|
var y;
|
|
4672
4691
|
let h = !1;
|
|
4673
4692
|
for (const p of u) {
|
|
4674
|
-
const m =
|
|
4693
|
+
const m = Ha(p.insertId);
|
|
4675
4694
|
m !== null && (p.visible ? s.delete(m) && (h = !0) : s.has(m) || (s.add(m), h = !0));
|
|
4676
4695
|
}
|
|
4677
4696
|
h && (r += 1, i.invalidateInsertPresenterQueryCache(), a(), t.onInsertVisibilityChange(), (y = i._notifyStructureChange) == null || y.call(i));
|
|
@@ -4749,7 +4768,7 @@ function $a(t) {
|
|
|
4749
4768
|
} : null;
|
|
4750
4769
|
},
|
|
4751
4770
|
getDiagnostics() {
|
|
4752
|
-
const u = i.getMeta(), h =
|
|
4771
|
+
const u = i.getMeta(), h = qa(i), y = Ya(i), p = $a(i);
|
|
4753
4772
|
return {
|
|
4754
4773
|
entityCount: u.entityCount,
|
|
4755
4774
|
lineCount: u.lineCount,
|
|
@@ -4770,24 +4789,24 @@ function $a(t) {
|
|
|
4770
4789
|
}
|
|
4771
4790
|
};
|
|
4772
4791
|
}
|
|
4773
|
-
const
|
|
4792
|
+
const Za = 450, Vr = 250, Ja = 0.25;
|
|
4774
4793
|
function _n(t) {
|
|
4775
4794
|
return !t.manifestBBox || !t.viewport || !Number.isFinite(t.worldUnitsPerPixel) || t.worldUnitsPerPixel <= 0 || t.worldUnitsPerPixel > Vr ? !1 : zn(
|
|
4776
|
-
je(t.viewport,
|
|
4795
|
+
je(t.viewport, Ja),
|
|
4777
4796
|
t.manifestBBox
|
|
4778
4797
|
);
|
|
4779
4798
|
}
|
|
4780
|
-
function
|
|
4799
|
+
function Un(t) {
|
|
4781
4800
|
const n = t == null ? void 0 : t.bbox;
|
|
4782
4801
|
return n ? { minX: n[0], minY: n[1], maxX: n[2], maxY: n[3] } : null;
|
|
4783
4802
|
}
|
|
4784
4803
|
function gt(t) {
|
|
4785
4804
|
return "annotation" in t && (t.annotation.line_count > 0 || t.annotation.fill_count > 0 || t.annotation.dot_count > 0 || t.annotation.text_count > 0);
|
|
4786
4805
|
}
|
|
4787
|
-
function
|
|
4806
|
+
function Gn(t) {
|
|
4788
4807
|
return Number.isFinite(t) && t > 0 && t <= Vr;
|
|
4789
4808
|
}
|
|
4790
|
-
function
|
|
4809
|
+
function eo(t) {
|
|
4791
4810
|
const n = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Set();
|
|
4792
4811
|
let r = !1;
|
|
4793
4812
|
return {
|
|
@@ -4798,7 +4817,7 @@ function Ja(t) {
|
|
|
4798
4817
|
const c = { family: void 0 }, l = "";
|
|
4799
4818
|
if (e.has(l)) return a;
|
|
4800
4819
|
let d = n.get(l);
|
|
4801
|
-
return d || (d = { promise: o.resolve(c, t.signal).then((y) => (d && (d.resolved = y), y != null && y.fontUrl &&
|
|
4820
|
+
return d || (d = { promise: o.resolve(c, t.signal).then((y) => (d && (d.resolved = y), y != null && y.fontUrl && ro(y.fontUrl, a.text, t.signal).catch((p) => {
|
|
4802
4821
|
t.onNonFatalError(p instanceof Error ? p : new Error(String(p)));
|
|
4803
4822
|
}), y)).catch((y) => (e.add(l), t.onNonFatalError(y instanceof Error ? y : new Error(String(y))), null)), resolved: null }, n.set(l, d)), (u = d.resolved) != null && u.fontUrl ? { ...a, fontUrl: d.resolved.fontUrl, kind: d.resolved.family } : a;
|
|
4804
4823
|
},
|
|
@@ -4807,21 +4826,21 @@ function Ja(t) {
|
|
|
4807
4826
|
}
|
|
4808
4827
|
};
|
|
4809
4828
|
}
|
|
4810
|
-
const
|
|
4811
|
-
function
|
|
4829
|
+
const to = 8e3;
|
|
4830
|
+
function no(t) {
|
|
4812
4831
|
return typeof t == "object" && t !== null && typeof t.then == "function";
|
|
4813
4832
|
}
|
|
4814
|
-
function
|
|
4833
|
+
function ro(t, n, e) {
|
|
4815
4834
|
return typeof qe != "function" || e.aborted ? Promise.resolve() : new Promise((r, i) => {
|
|
4816
4835
|
let s = !1;
|
|
4817
4836
|
const a = (c) => {
|
|
4818
4837
|
s || (s = !0, globalThis.clearTimeout(o), c());
|
|
4819
4838
|
}, o = globalThis.setTimeout(() => {
|
|
4820
4839
|
a(() => i(new Error(`Troika font warmup timed out for ${t}`)));
|
|
4821
|
-
},
|
|
4840
|
+
}, to);
|
|
4822
4841
|
try {
|
|
4823
4842
|
const c = qe({ font: t, characters: n }, () => a(r));
|
|
4824
|
-
|
|
4843
|
+
no(c) && c.then(
|
|
4825
4844
|
() => a(r),
|
|
4826
4845
|
(l) => a(() => i(l instanceof Error ? l : new Error(String(l))))
|
|
4827
4846
|
);
|
|
@@ -4830,22 +4849,22 @@ function no(t, n, e) {
|
|
|
4830
4849
|
}
|
|
4831
4850
|
});
|
|
4832
4851
|
}
|
|
4833
|
-
const
|
|
4834
|
-
function
|
|
4852
|
+
const io = 600, so = 256, ao = 8e3, oo = 96;
|
|
4853
|
+
function lo(t) {
|
|
4835
4854
|
return [...new Set(t)].sort((n, e) => {
|
|
4836
4855
|
const r = n.codePointAt(0) ?? 0, i = e.codePointAt(0) ?? 0;
|
|
4837
4856
|
return r - i;
|
|
4838
4857
|
}).join("");
|
|
4839
4858
|
}
|
|
4840
|
-
function
|
|
4859
|
+
function co(t) {
|
|
4841
4860
|
return typeof t == "object" && t !== null && typeof t.then == "function";
|
|
4842
4861
|
}
|
|
4843
|
-
function
|
|
4862
|
+
function uo() {
|
|
4844
4863
|
return typeof globalThis.document < "u" && typeof qe == "function";
|
|
4845
4864
|
}
|
|
4846
|
-
function
|
|
4865
|
+
function ho(t) {
|
|
4847
4866
|
var w, x, C, S;
|
|
4848
|
-
const n = ((w = t.options) == null ? void 0 : w.idleDelayMs) ??
|
|
4867
|
+
const n = ((w = t.options) == null ? void 0 : w.idleDelayMs) ?? io, e = ((x = t.options) == null ? void 0 : x.maxUniqueCharsPerFont) ?? so, r = ((C = t.options) == null ? void 0 : C.timeoutMs) ?? ao, i = ((S = t.options) == null ? void 0 : S.signatureCacheLimit) ?? oo, s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
4849
4868
|
let c = null, l = !1;
|
|
4850
4869
|
const d = {
|
|
4851
4870
|
scheduledTexts: 0,
|
|
@@ -4872,7 +4891,7 @@ function uo(t) {
|
|
|
4872
4891
|
}, r);
|
|
4873
4892
|
try {
|
|
4874
4893
|
const L = qe({ font: B, characters: V }, () => D(A));
|
|
4875
|
-
|
|
4894
|
+
co(L) && L.then(
|
|
4876
4895
|
() => D(A),
|
|
4877
4896
|
(X) => D(() => P(X instanceof Error ? X : new Error(String(X))))
|
|
4878
4897
|
);
|
|
@@ -4904,10 +4923,10 @@ ${V}`;
|
|
|
4904
4923
|
const B = [...s.entries()];
|
|
4905
4924
|
s.clear();
|
|
4906
4925
|
for (const [V, A] of B)
|
|
4907
|
-
A.size !== 0 && y(V,
|
|
4926
|
+
A.size !== 0 && y(V, lo([...A].join("")));
|
|
4908
4927
|
}
|
|
4909
4928
|
function m(B) {
|
|
4910
|
-
if (!(l || B.length === 0) &&
|
|
4929
|
+
if (!(l || B.length === 0) && uo() && !t.signal.aborted) {
|
|
4911
4930
|
d.scheduledTexts += B.length;
|
|
4912
4931
|
for (const V of B) {
|
|
4913
4932
|
const A = t.resolveTextFont(V);
|
|
@@ -4938,7 +4957,7 @@ ${V}`;
|
|
|
4938
4957
|
};
|
|
4939
4958
|
}
|
|
4940
4959
|
const Pr = 0.25, Nn = 0.125;
|
|
4941
|
-
function
|
|
4960
|
+
function fo(t) {
|
|
4942
4961
|
const { viewport: n, worldUnitsPerPixel: e } = t;
|
|
4943
4962
|
if (!n || !Number.isFinite(e) || e <= 0 || !Number.isFinite(n.minX) || !Number.isFinite(n.minY) || !Number.isFinite(n.maxX) || !Number.isFinite(n.maxY) || n.maxX <= n.minX || n.maxY <= n.minY)
|
|
4944
4963
|
return null;
|
|
@@ -4954,19 +4973,19 @@ function ho(t) {
|
|
|
4954
4973
|
function bt(t) {
|
|
4955
4974
|
return Array.from(t).sort((n, e) => n - e).join(",");
|
|
4956
4975
|
}
|
|
4957
|
-
function
|
|
4976
|
+
function kr(t, n) {
|
|
4958
4977
|
if (t === null || !Number.isFinite(t) || t <= 0 || !Number.isFinite(n) || n <= 0) return !1;
|
|
4959
4978
|
const e = n / t;
|
|
4960
4979
|
return e >= 1 - Nn && e <= 1 + Nn;
|
|
4961
4980
|
}
|
|
4962
|
-
function fo(t) {
|
|
4963
|
-
return !t.viewport || !t.coverage || !Ft(t.coverage, t.viewport) || !Tr(t.coverageWorldUnitsPerPixel, t.worldUnitsPerPixel) ? !1 : t.coverageHiddenSignature === t.hiddenSignature;
|
|
4964
|
-
}
|
|
4965
4981
|
function yo(t) {
|
|
4982
|
+
return !t.viewport || !t.coverage || !Ft(t.coverage, t.viewport) || !kr(t.coverageWorldUnitsPerPixel, t.worldUnitsPerPixel) ? !1 : t.coverageHiddenSignature === t.hiddenSignature;
|
|
4983
|
+
}
|
|
4984
|
+
function mo(t) {
|
|
4966
4985
|
return !t.latestViewport || !Ft(
|
|
4967
4986
|
je(t.requestedViewport, Pr),
|
|
4968
4987
|
t.latestViewport
|
|
4969
|
-
) || !
|
|
4988
|
+
) || !kr(t.requestedWorldUnitsPerPixel, t.latestWorldUnitsPerPixel) ? !1 : t.requestedHiddenSignature === t.latestHiddenSignature;
|
|
4970
4989
|
}
|
|
4971
4990
|
function De(t, n, e) {
|
|
4972
4991
|
return {
|
|
@@ -4975,14 +4994,14 @@ function De(t, n, e) {
|
|
|
4975
4994
|
hiddenSignature: e
|
|
4976
4995
|
};
|
|
4977
4996
|
}
|
|
4978
|
-
const
|
|
4979
|
-
function
|
|
4980
|
-
const n =
|
|
4997
|
+
const Tt = /* @__PURE__ */ new WeakMap();
|
|
4998
|
+
function _o(t) {
|
|
4999
|
+
const n = Tt.get(t);
|
|
4981
5000
|
if (!n)
|
|
4982
5001
|
throw new Error("CAD document session has no render resource");
|
|
4983
5002
|
return n;
|
|
4984
5003
|
}
|
|
4985
|
-
function
|
|
5004
|
+
function Uo(t, n = {}) {
|
|
4986
5005
|
return new Lt(t, n);
|
|
4987
5006
|
}
|
|
4988
5007
|
const $e = class $e {
|
|
@@ -5030,6 +5049,8 @@ const $e = class $e {
|
|
|
5030
5049
|
f(this, "textWarmup");
|
|
5031
5050
|
f(this, "resolveTextFont");
|
|
5032
5051
|
f(this, "loadAnnotations");
|
|
5052
|
+
f(this, "workerUrl");
|
|
5053
|
+
f(this, "workerFactory");
|
|
5033
5054
|
f(this, "listeners", /* @__PURE__ */ new Map());
|
|
5034
5055
|
f(this, "resolveHeader");
|
|
5035
5056
|
f(this, "rejectHeader");
|
|
@@ -5039,18 +5060,18 @@ const $e = class $e {
|
|
|
5039
5060
|
f(this, "handleBeforeTextAppend", (n) => {
|
|
5040
5061
|
this.scheduleTextWarmup(n);
|
|
5041
5062
|
});
|
|
5042
|
-
this.sessionEpoch = $e.nextEpoch++, this.documentKey = e.documentKey ?? null, this.filename = e.filename ?? null, this.loadAnnotations = e.loadAnnotations !== !1, this.fontRuntime =
|
|
5063
|
+
this.sessionEpoch = $e.nextEpoch++, this.documentKey = e.documentKey ?? null, this.filename = e.filename ?? null, this.loadAnnotations = e.loadAnnotations !== !1, this.workerUrl = e.workerUrl, this.workerFactory = e.workerFactory, this.fontRuntime = eo({
|
|
5043
5064
|
fontResolver: e.fontResolver,
|
|
5044
5065
|
signal: this.sessionAbort.signal,
|
|
5045
5066
|
onNonFatalError: (i) => this.emit("non-fatal-error", { error: i })
|
|
5046
|
-
}), this.resolveTextFont = e.resolveTextFont ?? this.fontRuntime.resolveTextFont, this.textWarmup = e.textWarmup === !1 ? null :
|
|
5067
|
+
}), this.resolveTextFont = e.resolveTextFont ?? this.fontRuntime.resolveTextFont, this.textWarmup = e.textWarmup === !1 ? null : ho({
|
|
5047
5068
|
resolveTextFont: this.resolveTextFont,
|
|
5048
5069
|
signal: this.sessionAbort.signal,
|
|
5049
5070
|
options: typeof e.textWarmup == "object" ? e.textWarmup : void 0
|
|
5050
|
-
}), this.node = new
|
|
5071
|
+
}), this.node = new ye({
|
|
5051
5072
|
resolveTextFont: this.resolveTextFont
|
|
5052
5073
|
}), this.node.ready.catch(() => {
|
|
5053
|
-
}), this.renderNode =
|
|
5074
|
+
}), this.renderNode = ja({
|
|
5054
5075
|
node: this.node,
|
|
5055
5076
|
getHeaderBounds: () => this.headerBounds,
|
|
5056
5077
|
getUnmountedBounds: () => this.unmountedExternalBounds(),
|
|
@@ -5058,7 +5079,7 @@ const $e = class $e {
|
|
|
5058
5079
|
onInsertVisibilityChange: () => {
|
|
5059
5080
|
this.latestDemand && this.maybeRefreshExternalSidecars({ force: !0 });
|
|
5060
5081
|
}
|
|
5061
|
-
}),
|
|
5082
|
+
}), Tt.set(this, this.renderNode), this.headerReady = new Promise((i, s) => {
|
|
5062
5083
|
this.resolveHeader = i, this.rejectHeader = s;
|
|
5063
5084
|
}), this.initialContentReady = new Promise((i, s) => {
|
|
5064
5085
|
this.resolveInitial = i, this.rejectInitial = s;
|
|
@@ -5119,7 +5140,7 @@ const $e = class $e {
|
|
|
5119
5140
|
instanceId: i.instanceId
|
|
5120
5141
|
};
|
|
5121
5142
|
n.push({
|
|
5122
|
-
insertId:
|
|
5143
|
+
insertId: za(s),
|
|
5123
5144
|
blockName: r.blockName || `block#${r.variantId}`,
|
|
5124
5145
|
layerName: e.name,
|
|
5125
5146
|
layerIndex: e.index,
|
|
@@ -5137,7 +5158,7 @@ const $e = class $e {
|
|
|
5137
5158
|
return e ? "kind" in e ? pt(this.node, e) : this.findInsertDetailsByInstanceId(e.instanceId) : null;
|
|
5138
5159
|
}
|
|
5139
5160
|
pickInsertAtPoint(n, e) {
|
|
5140
|
-
const r =
|
|
5161
|
+
const r = Fa(
|
|
5141
5162
|
this.node,
|
|
5142
5163
|
{ x: n.x, y: n.y },
|
|
5143
5164
|
{
|
|
@@ -5156,7 +5177,7 @@ const $e = class $e {
|
|
|
5156
5177
|
return e ? {
|
|
5157
5178
|
documentKey: this.documentKey,
|
|
5158
5179
|
id: e,
|
|
5159
|
-
details:
|
|
5180
|
+
details: Na(this.node, e)
|
|
5160
5181
|
} : null;
|
|
5161
5182
|
}
|
|
5162
5183
|
abort(n) {
|
|
@@ -5171,7 +5192,7 @@ const $e = class $e {
|
|
|
5171
5192
|
this.disposed = !0, this.sessionAbort.abort(n), this.demandAbort.abort(n), this.annotationAbort.abort(n), this.clearAnnotationTimer(), this.rejectHeader(n), this.rejectInitial(n), this.setPhase("disposed"), (e = this.textWarmup) == null || e.dispose(), this.fontRuntime.dispose(), this.listeners.clear();
|
|
5172
5193
|
for (const r of this.signalCleanups) r();
|
|
5173
5194
|
this.signalCleanups.length = 0, Ye(this.node, null), this.node.ready.catch(() => {
|
|
5174
|
-
}), this.renderNode.dispose(),
|
|
5195
|
+
}), this.renderNode.dispose(), Tt.delete(this);
|
|
5175
5196
|
}
|
|
5176
5197
|
async runLoad() {
|
|
5177
5198
|
const n = this.sessionEpoch;
|
|
@@ -5182,14 +5203,16 @@ const $e = class $e {
|
|
|
5182
5203
|
"CAD load aborted before decoding"
|
|
5183
5204
|
);
|
|
5184
5205
|
if (!this.isCurrent(n)) return;
|
|
5185
|
-
this.mainBuffer = e, this.sourceFingerprint = this.documentKey ??
|
|
5186
|
-
const r =
|
|
5206
|
+
this.mainBuffer = e, this.sourceFingerprint = this.documentKey ?? xo(e), this.baseUrl = this.normalizedSource ? vr(this.normalizedSource) : null;
|
|
5207
|
+
const r = ka(e), i = this.toDocumentHeader(r);
|
|
5187
5208
|
if (this.header = i, this.headerBounds = i.bounds, this.annotationManifest = this.loadAnnotations ? Ot(e) : null, this.setPhase("header-ready"), this.emit("header", { header: i }), this.setPhase("initial-loading"), this.resolveHeader(i), await Promise.resolve(), !this.isCurrent(n)) return;
|
|
5188
5209
|
const s = this.latestDemand ?? this.pendingDemand, a = await this.prepareInitialExternalVariants(s);
|
|
5189
5210
|
if (!this.isCurrent(n) || (await ar(this.node, e.slice(0), void 0, {
|
|
5190
5211
|
signal: this.sessionAbort.signal,
|
|
5212
|
+
workerUrl: this.workerUrl,
|
|
5213
|
+
workerFactory: this.workerFactory,
|
|
5191
5214
|
hiddenInstanceIds: this.hiddenInstanceIds.size > 0 ? this.hiddenInstanceIds : void 0,
|
|
5192
|
-
externalVariantBuffers:
|
|
5215
|
+
externalVariantBuffers: po(a.buffers),
|
|
5193
5216
|
requiredExternalVariantIds: a.requiredVariantIds,
|
|
5194
5217
|
beforeTextAppend: this.handleBeforeTextAppend
|
|
5195
5218
|
}), await this.node.ready, !this.isCurrent(n))) return;
|
|
@@ -5214,12 +5237,12 @@ const $e = class $e {
|
|
|
5214
5237
|
this.externalViewportQueued = !0;
|
|
5215
5238
|
return;
|
|
5216
5239
|
}
|
|
5217
|
-
if (!
|
|
5240
|
+
if (!fo({
|
|
5218
5241
|
viewport: e.documentRect,
|
|
5219
5242
|
worldUnitsPerPixel: e.worldUnitsPerPixel
|
|
5220
5243
|
})) return;
|
|
5221
5244
|
const i = bt(this.hiddenInstanceIds);
|
|
5222
|
-
if (n.force !== !0 && this.lastCoverage &&
|
|
5245
|
+
if (n.force !== !0 && this.lastCoverage && yo({
|
|
5223
5246
|
coverage: this.lastCoverage.coverage,
|
|
5224
5247
|
coverageWorldUnitsPerPixel: this.lastCoverage.worldUnitsPerPixel,
|
|
5225
5248
|
coverageHiddenSignature: this.lastCoverage.hiddenSignature,
|
|
@@ -5285,7 +5308,7 @@ const $e = class $e {
|
|
|
5285
5308
|
}
|
|
5286
5309
|
if (!this.isCurrent(r)) return;
|
|
5287
5310
|
const c = this.latestDemand;
|
|
5288
|
-
if (!c || c.interaction === "active" || !
|
|
5311
|
+
if (!c || c.interaction === "active" || !mo({
|
|
5289
5312
|
requestedViewport: n.documentRect,
|
|
5290
5313
|
requestedWorldUnitsPerPixel: n.worldUnitsPerPixel,
|
|
5291
5314
|
requestedHiddenSignature: e,
|
|
@@ -5308,8 +5331,10 @@ const $e = class $e {
|
|
|
5308
5331
|
throw this.variantCoverage.set(h, "rejected"), new Error(`External block ${h} 尚未加载。`);
|
|
5309
5332
|
d.set(h, y);
|
|
5310
5333
|
}
|
|
5311
|
-
if (await
|
|
5334
|
+
if (await Va(this.node, i, {
|
|
5312
5335
|
signal: this.demandAbort.signal,
|
|
5336
|
+
workerUrl: this.workerUrl,
|
|
5337
|
+
workerFactory: this.workerFactory,
|
|
5313
5338
|
hiddenInstanceIds: Array.from(this.hiddenInstanceIds).sort((h, y) => h - y),
|
|
5314
5339
|
externalVariantBuffers: d,
|
|
5315
5340
|
requiredExternalVariantIds: l,
|
|
@@ -5347,10 +5372,10 @@ const $e = class $e {
|
|
|
5347
5372
|
}
|
|
5348
5373
|
shouldScheduleAnnotationLoad(n) {
|
|
5349
5374
|
var i;
|
|
5350
|
-
if (!
|
|
5375
|
+
if (!Gn(n.worldUnitsPerPixel)) return !1;
|
|
5351
5376
|
const e = (i = this.annotationManifest) == null ? void 0 : i.scene;
|
|
5352
5377
|
return e && !this.sceneAnnotationsLoaded && !this.sceneAnnotationsLoading && _n({
|
|
5353
|
-
manifestBBox:
|
|
5378
|
+
manifestBBox: Un(e),
|
|
5354
5379
|
viewport: n.documentRect,
|
|
5355
5380
|
worldUnitsPerPixel: n.worldUnitsPerPixel
|
|
5356
5381
|
}) ? !0 : !!(!this.blockAnnotationsLoaded && !this.blockAnnotationsLoading && this.variantManifest.some(gt));
|
|
@@ -5367,7 +5392,7 @@ const $e = class $e {
|
|
|
5367
5392
|
return;
|
|
5368
5393
|
}
|
|
5369
5394
|
this.shouldScheduleAnnotationLoad(r) && this.loadVisibleAnnotationsNow(r);
|
|
5370
|
-
},
|
|
5395
|
+
}, Za);
|
|
5371
5396
|
}
|
|
5372
5397
|
async loadVisibleAnnotationsNow(n) {
|
|
5373
5398
|
const e = this.sessionEpoch;
|
|
@@ -5385,7 +5410,7 @@ const $e = class $e {
|
|
|
5385
5410
|
var r;
|
|
5386
5411
|
const e = (r = this.annotationManifest) == null ? void 0 : r.scene;
|
|
5387
5412
|
if (!(!e || this.sceneAnnotationsLoaded || this.sceneAnnotationsLoading) && this.baseUrl && _n({
|
|
5388
|
-
manifestBBox:
|
|
5413
|
+
manifestBBox: Un(e),
|
|
5389
5414
|
viewport: n.documentRect,
|
|
5390
5415
|
worldUnitsPerPixel: n.worldUnitsPerPixel
|
|
5391
5416
|
})) {
|
|
@@ -5403,7 +5428,7 @@ const $e = class $e {
|
|
|
5403
5428
|
}
|
|
5404
5429
|
}
|
|
5405
5430
|
async loadBlockAnnotations(n) {
|
|
5406
|
-
if (!(this.blockAnnotationsLoaded || this.blockAnnotationsLoading) && this.mainBuffer && this.variantManifest.some(gt) &&
|
|
5431
|
+
if (!(this.blockAnnotationsLoaded || this.blockAnnotationsLoading) && this.mainBuffer && this.variantManifest.some(gt) && Gn(n.worldUnitsPerPixel)) {
|
|
5407
5432
|
this.blockAnnotationsLoading = !0;
|
|
5408
5433
|
try {
|
|
5409
5434
|
const e = _t(this.mainBuffer, {
|
|
@@ -5536,7 +5561,7 @@ const $e = class $e {
|
|
|
5536
5561
|
};
|
|
5537
5562
|
f($e, "nextEpoch", 1);
|
|
5538
5563
|
let Lt = $e;
|
|
5539
|
-
function
|
|
5564
|
+
function xo(t) {
|
|
5540
5565
|
const n = new Uint8Array(t);
|
|
5541
5566
|
let e = n.byteLength >>> 0;
|
|
5542
5567
|
const r = Math.max(1, Math.floor(n.byteLength / 32));
|
|
@@ -5544,56 +5569,56 @@ function mo(t) {
|
|
|
5544
5569
|
e = Math.imul(e, 33) + (n[i] ?? 0);
|
|
5545
5570
|
return `${n.byteLength.toString(16)}-${(e >>> 0).toString(16)}`;
|
|
5546
5571
|
}
|
|
5547
|
-
function
|
|
5572
|
+
function po(t) {
|
|
5548
5573
|
return new Map(Array.from(t, ([n, e]) => [n, e.slice(0)]));
|
|
5549
5574
|
}
|
|
5550
5575
|
function It(t) {
|
|
5551
5576
|
return t instanceof Error ? t : typeof t == "string" ? new Error(t) : new Error(`Unknown CAD session error: ${String(t)}`);
|
|
5552
5577
|
}
|
|
5553
|
-
const
|
|
5578
|
+
const go = [
|
|
5554
5579
|
"updateTextEntry",
|
|
5555
5580
|
"updateInsertInstanceTransform",
|
|
5556
5581
|
"applyInsertTransform",
|
|
5557
5582
|
"editBlock"
|
|
5558
5583
|
];
|
|
5559
5584
|
function Go(t) {
|
|
5560
|
-
return
|
|
5585
|
+
return go.includes(t);
|
|
5561
5586
|
}
|
|
5562
5587
|
export {
|
|
5563
|
-
|
|
5564
|
-
|
|
5588
|
+
go as CAD_RENDER_NODE_EDIT_METHODS,
|
|
5589
|
+
Oo as CAD_SESSION_PHASES,
|
|
5565
5590
|
ia as GEO_NODE_STRUCTURE_CHANGE,
|
|
5566
|
-
|
|
5591
|
+
Bo as GEO_NODE_VISUAL_CHANGE,
|
|
5567
5592
|
O as GeoLoaderError,
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5593
|
+
ye as GeoNode,
|
|
5594
|
+
Va as appendExternalVariantDeltaToGeoNode,
|
|
5595
|
+
Lo as assertValidSourceOrThrow,
|
|
5596
|
+
Do as cadInsertSelectionEquals,
|
|
5597
|
+
Fo as cadTextSelectionEquals,
|
|
5598
|
+
Uo as createCadDocumentSession,
|
|
5599
|
+
Ro as createLoadSession,
|
|
5575
5600
|
je as expandViewportRect,
|
|
5576
|
-
|
|
5577
|
-
|
|
5601
|
+
za as formatCadInsertId,
|
|
5602
|
+
_o as getCadDocumentRenderResource,
|
|
5578
5603
|
Go as isCadRenderNodeEditMethod,
|
|
5579
5604
|
To as loadExternalVariantDeltaFromBuffer,
|
|
5580
|
-
|
|
5581
|
-
|
|
5605
|
+
Mo as loadGeo,
|
|
5606
|
+
fe as mergeViewportRects,
|
|
5582
5607
|
Ta as normalizeGeoError,
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5608
|
+
Ao as parseBuffer,
|
|
5609
|
+
Eo as parseBufferBounds,
|
|
5610
|
+
ka as parseBufferHeader,
|
|
5586
5611
|
Ar as parseCadInsertId,
|
|
5587
|
-
|
|
5612
|
+
Fa as pickCadInsertAtPoint,
|
|
5588
5613
|
Ga as pickCadTextAtPoint,
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5614
|
+
Ho as readBlockAnnotationSidecar,
|
|
5615
|
+
Po as readBufferExternalAnnotationManifest,
|
|
5616
|
+
ko as readBufferExternalBlockAnnotations,
|
|
5617
|
+
Vo as readBufferExternalVariantDependencyPlan,
|
|
5618
|
+
So as readBufferExternalVariantManifest,
|
|
5594
5619
|
Nr as readSceneAnnotationSidecar,
|
|
5595
5620
|
pt as resolveCadInsertDetails,
|
|
5596
|
-
|
|
5621
|
+
Na as resolveCadTextDetails,
|
|
5597
5622
|
Fr as transformBBoxByInstance,
|
|
5598
5623
|
Ft as viewportRectContains,
|
|
5599
5624
|
zn as viewportRectIntersects
|