iflow-engine-base 3.9.20 → 3.9.21

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.
@@ -1,6 +1,6 @@
1
1
  import { V as X, E as gt, Q as yt, M as Me, a as we, b as se, B as Ee, F as ye, S as vt, c as Ge, m as ze, d as wt, P as bt, C as pe, e as xt, f as Mt, N as kt, T as _t, L as Ze, g as ge, h as Te, D as Ae, i as Et, j as Re, k as at, G as Se, l as Ct, n as St, A as Tt, o as At, O as It, W as Lt, p as Pt, q as Ue, r as Dt, I as zt, R as Rt } from "./three-vendor-Dbcwwhki.js";
2
- import { F as qe, W as lt, L as Bt } from "./sdk-runtime-DLvF5IZ2.js";
3
- import { r as _e } from "./sdk-assets-F7qFhuao.js";
2
+ import { F as qe, W as lt, L as Bt, r as Nt } from "./sdk-runtime-cY1Wn7o-.js";
3
+ import { r as _e } from "./sdk-assets-1SXx8Tbf.js";
4
4
  var Oe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
5
  function ht(A) {
6
6
  return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
@@ -10,7 +10,7 @@ function We(A) {
10
10
  }
11
11
  var Ve = { exports: {} };
12
12
  var Je;
13
- function Nt() {
13
+ function Ot() {
14
14
  return Je || (Je = 1, (function(A, e) {
15
15
  (function(t) {
16
16
  A.exports = t();
@@ -2312,14 +2312,14 @@ function Nt() {
2312
2312
  });
2313
2313
  })(Ve)), Ve.exports;
2314
2314
  }
2315
- var Ot = Nt();
2316
- const Wt = /* @__PURE__ */ ht(Ot);
2317
- var je = { exports: {} }, jt = je.exports, Qe;
2318
- function Ut() {
2315
+ var Wt = Ot();
2316
+ const jt = /* @__PURE__ */ ht(Wt);
2317
+ var je = { exports: {} }, Ut = je.exports, Qe;
2318
+ function Ft() {
2319
2319
  return Qe || (Qe = 1, (function(A, e) {
2320
2320
  (function(t, i) {
2321
2321
  A.exports = i();
2322
- })(jt, function() {
2322
+ })(Ut, function() {
2323
2323
  var t = function() {
2324
2324
  function i(d) {
2325
2325
  return r.appendChild(d.dom), d;
@@ -2359,9 +2359,9 @@ function Ut() {
2359
2359
  });
2360
2360
  })(je)), je.exports;
2361
2361
  }
2362
- var Ft = Ut();
2363
- const Vt = /* @__PURE__ */ ht(Ft);
2364
- class Ht {
2362
+ var Vt = Ft();
2363
+ const Ht = /* @__PURE__ */ ht(Vt);
2364
+ class Gt {
2365
2365
  panel = null;
2366
2366
  listEl = null;
2367
2367
  isVisible = !1;
@@ -2515,7 +2515,7 @@ class ct {
2515
2515
  constructor(e) {
2516
2516
  this.engine = e;
2517
2517
  const t = document.getElementById(e?.options?.containerId ?? "") ?? e?.container ?? null;
2518
- t && (this.panelUI = new Ht(t, this));
2518
+ t && (this.panelUI = new Gt(t, this));
2519
2519
  }
2520
2520
  // ─── 数据 ──────────────────────────────────────────────
2521
2521
  _loadLayers(e = this.engine.dwgData?.layers ?? []) {
@@ -2643,7 +2643,7 @@ class ct {
2643
2643
  }
2644
2644
  }
2645
2645
  var fe = /* @__PURE__ */ ((A) => (A.ModelLoadStart = "model-load-start", A.ModelLoadProgress = "model-load-progress", A.ModelLoaded = "model-loaded", A.ModelLoadError = "model-load-error", A.RenderStart = "render-start", A.RenderEnd = "render-end", A.CameraChanged = "camera-changed", A.CameraReset = "camera-reset", A.SelectionChanged = "selection-changed", A.HoverChanged = "hover-changed", A.EntityClick = "entity-click", A.LayerVisibilityChanged = "layer-visibility-changed", A.LayerColorChanged = "layer-color-changed", A.ViewZoomChanged = "view-zoom-changed", A.ViewPanChanged = "view-pan-changed", A.ToolActivated = "tool-activated", A.ToolDeactivated = "tool-deactivated", A.Error = "error", A.Warning = "warning", A))(fe || {});
2646
- class Gt {
2646
+ class Zt {
2647
2647
  listeners = /* @__PURE__ */ new Map();
2648
2648
  onceListeners = /* @__PURE__ */ new Map();
2649
2649
  debugMode = !1;
@@ -2768,7 +2768,7 @@ function $e(A, e, t) {
2768
2768
  const i = new X(A[0] ?? 0, A[1] ?? 0, A[2] ?? 0), n = new gt(0, 0, t ?? 0), s = new X(e[0] ?? 1, e[1] ?? 1, e[2] ?? 1), r = new yt().setFromEuler(n);
2769
2769
  return new Me().compose(i, r, s);
2770
2770
  }
2771
- function Zt(A) {
2771
+ function $t(A) {
2772
2772
  return Array.isArray(A?.transformMatrix) && A.transformMatrix.length === 16 ? new Me().fromArray(A.transformMatrix) : $e(
2773
2773
  A.position ?? [0, 0, 0],
2774
2774
  A.scale ?? [1, 1, 1],
@@ -2830,7 +2830,7 @@ class et {
2830
2830
  for (const n of e)
2831
2831
  if (n?.visible !== !1) {
2832
2832
  if (n.type === "INSERT") {
2833
- const s = this.getBlockItems(n.blockId, i + 1), r = t.clone().multiply(Zt(n)), o = this.getClipPolygon(n, t);
2833
+ const s = this.getBlockItems(n.blockId, i + 1), r = t.clone().multiply($t(n)), o = this.getClipPolygon(n, t);
2834
2834
  for (const a of s) {
2835
2835
  const h = this.cloneRenderItem(a, r, n), u = o ? this.clipRenderItem(h, o) : h;
2836
2836
  u && (yield u);
@@ -3044,7 +3044,7 @@ class et {
3044
3044
  };
3045
3045
  }
3046
3046
  }
3047
- class $t {
3047
+ class Yt {
3048
3048
  zipObjectUrls = [];
3049
3049
  /** 加载新版 manifest 分包数据,并返回 Loader 可消费的 DWGData 结构。 */
3050
3050
  async load(e) {
@@ -3190,7 +3190,7 @@ class $t {
3190
3190
  const t = await fetch(e);
3191
3191
  if (!t.ok)
3192
3192
  throw new Error(`HTTP error! status: ${t.status}`);
3193
- const i = await Wt.loadAsync(await t.arrayBuffer()), n = this.findZipManifestPath(i), s = await this.fetchZipJson(i, n);
3193
+ const i = await jt.loadAsync(await t.arrayBuffer()), n = this.findZipManifestPath(i), s = await this.fetchZipJson(i, n);
3194
3194
  if (!this.isSplitManifest(s))
3195
3195
  throw new Error("[LoaderModule2d] Expected split CAD manifest data in .2d package.");
3196
3196
  const r = this.getZipBasePath(n);
@@ -3267,8 +3267,8 @@ class $t {
3267
3267
  this.zipObjectUrls.forEach((e) => URL.revokeObjectURL(e)), this.zipObjectUrls = [];
3268
3268
  }
3269
3269
  }
3270
- const ae = 1e-8, tt = 1e-3, Yt = 8421504;
3271
- class Xt {
3270
+ const ae = 1e-8, tt = 1e-3, Xt = 8421504;
3271
+ class Kt {
3272
3272
  constructor(e) {
3273
3273
  this.engine = e;
3274
3274
  }
@@ -3281,7 +3281,7 @@ class Xt {
3281
3281
  if (this.isSolidFill(e))
3282
3282
  return this.createSolidItems(e, t, i);
3283
3283
  const s = this.createPatternLineItem(e, t, i);
3284
- return s ? [s] : (this.warnUnknownPatternFallback(e), this.createSolidItems(e, t, i, Yt));
3284
+ return s ? [s] : (this.warnUnknownPatternFallback(e), this.createSolidItems(e, t, i, Xt));
3285
3285
  }
3286
3286
  /** 只有明确的 SOLID 才作为实心面;patternType=SolidFill 在当前导出数据里不可靠。 */
3287
3287
  isSolidFill(e) {
@@ -3651,7 +3651,7 @@ class Xt {
3651
3651
  }
3652
3652
  class it {
3653
3653
  constructor(e, t) {
3654
- this.engine = e, this.textFactory = t, this.hatchRenderer = new Xt(e);
3654
+ this.engine = e, this.textFactory = t, this.hatchRenderer = new Kt(e);
3655
3655
  }
3656
3656
  hatchRenderer;
3657
3657
  /** 根据实体类型分发到线、文字、填充、图片等具体几何生成逻辑。 */
@@ -3843,7 +3843,7 @@ class it {
3843
3843
  }];
3844
3844
  }
3845
3845
  }
3846
- class Kt {
3846
+ class qt {
3847
3847
  constructor(e, t, i = e.modelGroup, n = {}) {
3848
3848
  this.model = t, this.targetGroup = i, this.options = n;
3849
3849
  }
@@ -4160,13 +4160,13 @@ class nt {
4160
4160
  return s.applyMatrix4($e([(t.min.x + t.max.x) / 2, (t.min.y + t.max.y) / 2, 0], [1, 1, 1], 0)), s;
4161
4161
  }
4162
4162
  }
4163
- class qt {
4163
+ class Jt {
4164
4164
  engine;
4165
4165
  data = null;
4166
4166
  enableValidation = !0;
4167
4167
  model = this.createEmptyModel();
4168
4168
  font = null;
4169
- dataSource = new $t();
4169
+ dataSource = new Yt();
4170
4170
  lastBuildOptions = {};
4171
4171
  activeWorkspace = { type: "model", name: "模型" };
4172
4172
  workspaceCache = /* @__PURE__ */ new Map();
@@ -4344,7 +4344,7 @@ class qt {
4344
4344
  for (let a = 0; a < e.length; a += 1) {
4345
4345
  const h = e[a], u = this.createTileGroup(h, n.namePrefix);
4346
4346
  t.add(u);
4347
- const g = new Kt(this.engine, this.model, u, {
4347
+ const g = new qt(this.engine, this.model, u, {
4348
4348
  interactive: n.interactive ?? !0
4349
4349
  }), v = /* @__PURE__ */ new Set();
4350
4350
  let d = 0, y = 0;
@@ -4669,9 +4669,9 @@ class qt {
4669
4669
  this.clear();
4670
4670
  }
4671
4671
  }
4672
- const Jt = "3.9.18", Qt = {
4673
- version: Jt
4674
- }, ei = Qt.version, ti = `
4672
+ const Qt = "3.9.205", ei = {
4673
+ version: Qt
4674
+ }, ti = ei.version, ii = `
4675
4675
  varying vec2 vWorldPos;
4676
4676
 
4677
4677
  void main() {
@@ -4679,7 +4679,7 @@ const Jt = "3.9.18", Qt = {
4679
4679
  vWorldPos = worldPosition.xy;
4680
4680
  gl_Position = projectionMatrix * viewMatrix * worldPosition;
4681
4681
  }
4682
- `, ii = `
4682
+ `, ni = `
4683
4683
  precision highp float;
4684
4684
 
4685
4685
  varying vec2 vWorldPos;
@@ -4735,7 +4735,7 @@ const Jt = "3.9.18", Qt = {
4735
4735
  gl_FragColor = vec4(color, alpha);
4736
4736
  }
4737
4737
  `;
4738
- class ni {
4738
+ class si {
4739
4739
  scene;
4740
4740
  camera;
4741
4741
  container;
@@ -4788,8 +4788,8 @@ class ni {
4788
4788
  createGridMesh() {
4789
4789
  this.gridGeometry = new at(1, 1, 1, 1), this.gridMaterial = new Ct({
4790
4790
  uniforms: this.gridUniforms,
4791
- vertexShader: ti,
4792
- fragmentShader: ii,
4791
+ vertexShader: ii,
4792
+ fragmentShader: ni,
4793
4793
  transparent: !0,
4794
4794
  depthWrite: !1,
4795
4795
  depthTest: !1,
@@ -4878,7 +4878,7 @@ class ni {
4878
4878
  this.stopMonitoring(), this.teardownResizeObserver(), this.gridMesh && this.gridGroup.remove(this.gridMesh), this.gridGeometry && (this.gridGeometry.dispose(), this.gridGeometry = void 0), this.gridMaterial && (this.gridMaterial.dispose(), this.gridMaterial = void 0), this.gridMesh = void 0;
4879
4879
  }
4880
4880
  }
4881
- class si {
4881
+ class ri {
4882
4882
  engine;
4883
4883
  scene;
4884
4884
  options;
@@ -4911,7 +4911,7 @@ class si {
4911
4911
  * 创建网格辅助(自适应网格)
4912
4912
  */
4913
4913
  createGrid(e = 1e3, t = 50) {
4914
- this.adaptiveGrid && (this.adaptiveGrid.dispose(), this.adaptiveGrid = void 0), this.adaptiveGrid = new ni(
4914
+ this.adaptiveGrid && (this.adaptiveGrid.dispose(), this.adaptiveGrid = void 0), this.adaptiveGrid = new si(
4915
4915
  this.scene,
4916
4916
  this.engine.cameraModule2d.orthographicCamera,
4917
4917
  this.engine.renderModule2d.container
@@ -5013,7 +5013,7 @@ class si {
5013
5013
  this.clearScene(), this.adaptiveGrid && (this.adaptiveGrid.dispose(), this.adaptiveGrid = void 0), this.axesHelper && (this.scene.remove(this.axesHelper), this.axesHelper = void 0), this.scene.clear();
5014
5014
  }
5015
5015
  }
5016
- class ri {
5016
+ class oi {
5017
5017
  engine;
5018
5018
  isFree;
5019
5019
  // 高亮模型
@@ -5029,7 +5029,7 @@ class ri {
5029
5029
  this.engine = e, this.isFree = !0, this.highlightModels = [], this.hideModels = [], this.translucentModels = [], this.highlightHoverModels = [], this.models = [];
5030
5030
  }
5031
5031
  }
5032
- class oi {
5032
+ class ai {
5033
5033
  engine;
5034
5034
  orthographicCamera;
5035
5035
  container;
@@ -5261,7 +5261,7 @@ class oi {
5261
5261
  this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.orthographicCamera = null;
5262
5262
  }
5263
5263
  }
5264
- class ai {
5264
+ class li {
5265
5265
  engine;
5266
5266
  renderer;
5267
5267
  container;
@@ -5393,7 +5393,7 @@ class ai {
5393
5393
  window.removeEventListener("resize", this.onWindowResize.bind(this)), this.renderer.dispose(), this.container.contains(this.renderer.domElement) && this.container.removeChild(this.renderer.domElement), this.renderer = null;
5394
5394
  }
5395
5395
  }
5396
- class li extends Pt {
5396
+ class hi extends Pt {
5397
5397
  object;
5398
5398
  domElement;
5399
5399
  enabled = !0;
@@ -5603,7 +5603,7 @@ class li extends Pt {
5603
5603
  this.enabled = !1, this.domElement.removeEventListener("mousedown", this.onMouseDown.bind(this)), this.domElement.removeEventListener("mousemove", this.onMouseMove.bind(this)), this.domElement.removeEventListener("mouseup", this.onMouseUp.bind(this)), this.domElement.removeEventListener("mouseleave", this.onMouseUp.bind(this)), this.domElement.removeEventListener("wheel", this.onWheel.bind(this)), this.domElement.removeEventListener("dblclick", this.onDoubleClick.bind(this)), this.domElement.removeEventListener("click", this.onClick.bind(this)), this.domElement.removeEventListener("touchstart", this.onTouchStart.bind(this)), this.domElement.removeEventListener("touchmove", this.onTouchMove.bind(this)), this.domElement.removeEventListener("touchend", this.onTouchEnd.bind(this));
5604
5604
  }
5605
5605
  }
5606
- class hi {
5606
+ class ci {
5607
5607
  engine;
5608
5608
  panControls;
5609
5609
  isActive = !0;
@@ -5620,7 +5620,7 @@ class hi {
5620
5620
  * 创建 2D 平移控制器
5621
5621
  */
5622
5622
  createPanControls() {
5623
- const e = new li(
5623
+ const e = new hi(
5624
5624
  this.engine.camera,
5625
5625
  this.engine.renderer.domElement
5626
5626
  );
@@ -5736,7 +5736,7 @@ class hi {
5736
5736
  this.panControls.dispose(), this.panControls = null;
5737
5737
  }
5738
5738
  }
5739
- class ci {
5739
+ class di {
5740
5740
  engine;
5741
5741
  pickBoxElementIds = [];
5742
5742
  worldToScreen;
@@ -5873,7 +5873,7 @@ class ci {
5873
5873
  return e.distanceTo(a);
5874
5874
  }
5875
5875
  }
5876
- class di {
5876
+ class ui {
5877
5877
  engine;
5878
5878
  // 小组件容器
5879
5879
  widgetContainer = null;
@@ -6041,7 +6041,7 @@ class di {
6041
6041
  return Math.atan2(e.clientX - i, n - e.clientY);
6042
6042
  }
6043
6043
  }
6044
- class ui {
6044
+ class pi {
6045
6045
  engine;
6046
6046
  enabled = !1;
6047
6047
  constructor(e) {
@@ -6094,7 +6094,7 @@ class ui {
6094
6094
  return e?.object ?? e?.group?.children?.[e.indexes?.[0]] ?? this.engine.modelGroup?.children?.[e.indexes?.[0]];
6095
6095
  }
6096
6096
  }
6097
- class pi {
6097
+ class fi {
6098
6098
  engine;
6099
6099
  highlightMaterial;
6100
6100
  hideMaterial;
@@ -6354,7 +6354,7 @@ class pi {
6354
6354
  return !0;
6355
6355
  }
6356
6356
  }
6357
- function fi(A) {
6357
+ function mi(A) {
6358
6358
  const e = {
6359
6359
  mouseMoveFrame: null,
6360
6360
  latestMouseMoveEvent: null,
@@ -6464,7 +6464,7 @@ function fi(A) {
6464
6464
  }
6465
6465
  return e;
6466
6466
  }
6467
- class mi {
6467
+ class gi {
6468
6468
  el;
6469
6469
  xEl;
6470
6470
  yEl;
@@ -6484,7 +6484,7 @@ class mi {
6484
6484
  }
6485
6485
  }
6486
6486
  var ut = /* @__PURE__ */ ((A) => (A.ModelLoadStart = "model-load-start", A.ModelLoadProgress = "model-load-progress", A.ModelLoaded = "model-loaded", A.ModelError = "model-error", A.SelectionChanged = "selection-changed", A.HoverChanged = "hover-changed", A.Click = "click", A.MouseMove = "mouse-move", A.CameraChanged = "camera-changed", A.CameraIdle = "camera-idle", A.EngineFree = "engine-free", A.EngineBusy = "engine-busy", A.MeasureChanged = "measure-changed", A.MeasureClick = "measure-click", A.SectionMove = "section-move", A))(ut || {});
6487
- class gi {
6487
+ class yi {
6488
6488
  engine;
6489
6489
  behavior;
6490
6490
  mouseCoordUI = null;
@@ -6494,7 +6494,7 @@ class gi {
6494
6494
  init() {
6495
6495
  this.behavior = this.engine.handelBehaved2d, this.behavior.init(this);
6496
6496
  const e = this.engine.container;
6497
- e && this.engine.options?.showMouseCoordinates !== !1 && (this.mouseCoordUI = new mi(e));
6497
+ e && this.engine.options?.showMouseCoordinates !== !1 && (this.mouseCoordUI = new gi(e));
6498
6498
  }
6499
6499
  active() {
6500
6500
  this.behavior.active();
@@ -6561,7 +6561,7 @@ class gi {
6561
6561
  this.mouseCoordUI?.dispose(), this.mouseCoordUI = null;
6562
6562
  }
6563
6563
  }
6564
- class yi {
6564
+ class vi {
6565
6565
  overlay;
6566
6566
  hLine;
6567
6567
  vLine;
@@ -6615,7 +6615,7 @@ const st = [
6615
6615
  { action: "linkElement2d3d", label: "模型联动", dividerBefore: !0 },
6616
6616
  { action: "linkView2d3d", label: "视角关联" }
6617
6617
  ];
6618
- class vi {
6618
+ class wi {
6619
6619
  menu;
6620
6620
  container;
6621
6621
  canvas;
@@ -6688,7 +6688,7 @@ class vi {
6688
6688
  this.canvas.removeEventListener("contextmenu", this.onContextMenu), document.removeEventListener("mousedown", this.onDocMouseDown), document.removeEventListener("keydown", this.onEscape), this.menu.parentElement?.removeChild(this.menu);
6689
6689
  }
6690
6690
  }
6691
- class wi {
6691
+ class bi {
6692
6692
  overlay = null;
6693
6693
  textEl = null;
6694
6694
  barEl = null;
@@ -6823,14 +6823,14 @@ class wi {
6823
6823
  this.overlay?.remove(), this.overlay = null, this.textEl = null, this.barEl = null, this.pctEl = null;
6824
6824
  }
6825
6825
  }
6826
- const bi = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
6826
+ const xi = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
6827
6827
  <circle cx="6.5" cy="6.5" r="4.5" stroke="currentColor" stroke-width="1.5"/>
6828
6828
  <line x1="10" y1="10" x2="14" y2="14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
6829
- </svg>`, xi = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
6829
+ </svg>`, Mi = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
6830
6830
  <line x1="1" y1="1" x2="11" y2="11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
6831
6831
  <line x1="11" y1="1" x2="1" y2="11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
6832
6832
  </svg>`;
6833
- class Mi {
6833
+ class ki {
6834
6834
  manager;
6835
6835
  wrapper;
6836
6836
  input;
@@ -6849,7 +6849,7 @@ class Mi {
6849
6849
  return e.className = "engine-2d-search", e.innerHTML = `
6850
6850
  <div class="engine-2d-search__box">
6851
6851
  <div class="engine-2d-search__input-row">
6852
- <span class="engine-2d-search__icon">${bi}</span>
6852
+ <span class="engine-2d-search__icon">${xi}</span>
6853
6853
  <input
6854
6854
  class="engine-2d-search__input"
6855
6855
  type="text"
@@ -6857,7 +6857,7 @@ class Mi {
6857
6857
  autocomplete="off"
6858
6858
  spellcheck="false"
6859
6859
  />
6860
- <button class="engine-2d-search__clear" title="清除">${xi}</button>
6860
+ <button class="engine-2d-search__clear" title="清除">${Mi}</button>
6861
6861
  </div>
6862
6862
  <div class="engine-2d-search__divider"></div>
6863
6863
  <div class="engine-2d-search__status"></div>
@@ -6963,13 +6963,13 @@ class Mi {
6963
6963
  this.input.removeEventListener("input", this.onInput), this.input.removeEventListener("keydown", this.onKeyDown), this.clearBtn.removeEventListener("click", this.onClear), document.removeEventListener("mousedown", this.onDocMouseDown), document.removeEventListener("keydown", this.onEscape), this.wrapper.parentElement?.removeChild(this.wrapper), this.debounceTimer !== null && clearTimeout(this.debounceTimer);
6964
6964
  }
6965
6965
  }
6966
- class ki {
6966
+ class _i {
6967
6967
  engine;
6968
6968
  searchUI = null;
6969
6969
  constructor(e) {
6970
6970
  this.engine = e;
6971
6971
  const t = document.getElementById(e?.options?.containerId ?? "") ?? e?.container ?? null;
6972
- t && (this.searchUI = new Mi(t, this));
6972
+ t && (this.searchUI = new ki(t, this));
6973
6973
  }
6974
6974
  /** 只查询已加载的文字实体,支持连续包含和按字符顺序的模糊匹配。 */
6975
6975
  search(e) {
@@ -7146,7 +7146,7 @@ const rt = {
7146
7146
  "--e2d-coord-label": "rgba(0,0,0,0.50)"
7147
7147
  }
7148
7148
  };
7149
- class _i {
7149
+ class Ei {
7150
7150
  container;
7151
7151
  current;
7152
7152
  constructor(e, t = "dark") {
@@ -7214,7 +7214,7 @@ class Ye {
7214
7214
  this.clearAllPoints();
7215
7215
  }
7216
7216
  }
7217
- class Ei extends Ye {
7217
+ class Ci extends Ye {
7218
7218
  /** 两点完成一条距离测量。 */
7219
7219
  handleClick(e) {
7220
7220
  super.handleClick(e), this.points.length === 2 && (this.manager.addMeasurement("distance", this.points), this.clearAllPoints());
@@ -7223,7 +7223,7 @@ class Ei extends Ye {
7223
7223
  this.points.length === 1 && this.manager.drawPreview("distance", [this.points[0], e]);
7224
7224
  }
7225
7225
  }
7226
- class Ci extends Ye {
7226
+ class Si extends Ye {
7227
7227
  /** 三点及以上可以闭合面积,双击或 Enter 结束。 */
7228
7228
  handleClick(e) {
7229
7229
  super.handleClick(e), this.manager.drawPreview("area", this.points);
@@ -7236,7 +7236,7 @@ class Ci extends Ye {
7236
7236
  e.length >= 3 && this.manager.addMeasurement("area", e), this.clearAllPoints();
7237
7237
  }
7238
7238
  }
7239
- class Si extends Ye {
7239
+ class Ti extends Ye {
7240
7240
  /** 三点完成角度测量,第二个点作为角点。 */
7241
7241
  handleClick(e) {
7242
7242
  super.handleClick(e), this.points.length === 3 && (this.manager.addMeasurement("angle", this.points), this.clearAllPoints());
@@ -7245,7 +7245,7 @@ class Si extends Ye {
7245
7245
  this.points.length >= 2 && this.manager.drawPreview("angle", [...this.points, e]);
7246
7246
  }
7247
7247
  }
7248
- class Ti {
7248
+ class Ai {
7249
7249
  distanceMeasure;
7250
7250
  areaMeasure;
7251
7251
  angleMeasure;
@@ -7265,7 +7265,7 @@ class Ti {
7265
7265
  hasDraggedAfterMouseDown = !1;
7266
7266
  currentWorkspaceKey = "model";
7267
7267
  constructor(e) {
7268
- this.engine = e, this.container = e.container, this.distanceMeasure = new Ei(this), this.areaMeasure = new Ci(this), this.angleMeasure = new Si(this), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", this.annotationContainer.style.pointerEvents = "none", this.annotationContainer.style.zIndex = "20", this.container.appendChild(this.annotationContainer);
7268
+ this.engine = e, this.container = e.container, this.distanceMeasure = new Ci(this), this.areaMeasure = new Si(this), this.angleMeasure = new Ti(this), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", this.annotationContainer.style.pointerEvents = "none", this.annotationContainer.style.zIndex = "20", this.container.appendChild(this.annotationContainer);
7269
7269
  }
7270
7270
  /** 开启 2D 测量事件;只停用图元点选,不停用 pan/zoom 视图控制。 */
7271
7271
  active() {
@@ -7524,7 +7524,7 @@ const He = {
7524
7524
  strokeWidth: 2,
7525
7525
  fontSize: 16,
7526
7526
  cloudRadius: 10
7527
- }, Ai = {
7527
+ }, Ii = {
7528
7528
  none: _e("/assets/icon/选择.svg", import.meta.url),
7529
7529
  line: _e("/assets/icon/线.svg", import.meta.url),
7530
7530
  arrow: _e("/assets/icon/箭头.svg", import.meta.url),
@@ -7533,8 +7533,8 @@ const He = {
7533
7533
  polygon: _e("/assets/icon/面积.svg", import.meta.url),
7534
7534
  text: _e("/assets/icon/文字.svg", import.meta.url),
7535
7535
  cloudline: _e("/assets/icon/云线.svg", import.meta.url)
7536
- }, Ii = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M6 6l1 16h10l1-16"/><path d="M10 11v6"/><path d="M14 11v6"/></svg>'), Li = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round"><path d="M6 6l12 12"/><path d="M18 6L6 18"/></svg>');
7537
- class Pi {
7536
+ }, Li = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M6 6l1 16h10l1-16"/><path d="M10 11v6"/><path d="M14 11v6"/></svg>'), Pi = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round"><path d="M6 6l12 12"/><path d="M18 6L6 18"/></svg>');
7537
+ class Di {
7538
7538
  engine;
7539
7539
  container;
7540
7540
  layer;
@@ -7714,7 +7714,7 @@ class Pi {
7714
7714
  { type: "cloudline", title: "云线,双击或 Enter 结束" },
7715
7715
  { type: "text", title: "文字" }
7716
7716
  ].forEach((a) => {
7717
- const h = this.createIconButton(a.title, Ai[a.type]);
7717
+ const h = this.createIconButton(a.title, Ii[a.type]);
7718
7718
  h.onclick = () => {
7719
7719
  this.active(), this.setDrawType(a.type);
7720
7720
  }, a.type !== "none" && (this.buttons[a.type] = h), e.appendChild(h);
@@ -7731,9 +7731,9 @@ class Pi {
7731
7731
  s.type = "number", s.min = "10", s.max = "72", s.value = `${this.style.fontSize}`, s.title = "字号", s.onchange = () => {
7732
7732
  this.style.fontSize = this.normalizeNumber(s.valueAsNumber, 10, 72, He.fontSize);
7733
7733
  }, e.appendChild(s), e.appendChild(this.createDivider());
7734
- const r = this.createIconButton("清空", Ii);
7734
+ const r = this.createIconButton("清空", Li);
7735
7735
  r.onclick = () => this.clearAll(), e.appendChild(r);
7736
- const o = this.createIconButton("关闭", Li);
7736
+ const o = this.createIconButton("关闭", Pi);
7737
7737
  return o.onclick = () => {
7738
7738
  this.hideToolbar(), this.disActive();
7739
7739
  }, e.appendChild(o), e;
@@ -7934,7 +7934,7 @@ class Pi {
7934
7934
  return `markup-2d-${Date.now()}-${Math.random().toString(16).slice(2)}`;
7935
7935
  }
7936
7936
  }
7937
- class Di {
7937
+ class zi {
7938
7938
  engine;
7939
7939
  manager;
7940
7940
  constructor(e) {
@@ -8001,7 +8001,7 @@ class Di {
8001
8001
  return { x: i.x, y: i.y, z: 0 };
8002
8002
  }
8003
8003
  }
8004
- class zi {
8004
+ class Ri {
8005
8005
  engine;
8006
8006
  mainViewPort = null;
8007
8007
  constructor(e) {
@@ -8037,7 +8037,7 @@ class zi {
8037
8037
  };
8038
8038
  }
8039
8039
  }
8040
- class Ri {
8040
+ class Bi {
8041
8041
  constructor(e, t) {
8042
8042
  this.container = e, this.engine = t, this.el = document.createElement("div"), this.el.className = "engine-2d-workspace-tabs", this.container.appendChild(this.el), this.unsubscribe = this.engine.events?.on(fe.ModelLoaded, () => this.refresh()) ?? (() => {
8043
8043
  }), this.refresh();
@@ -8076,7 +8076,7 @@ class Ri {
8076
8076
  this.unsubscribe(), this.el.remove();
8077
8077
  }
8078
8078
  }
8079
- class Bi {
8079
+ class Ni {
8080
8080
  // 配置选项
8081
8081
  options;
8082
8082
  container = null;
@@ -8121,7 +8121,7 @@ class Bi {
8121
8121
  renderer = null;
8122
8122
  // 数据
8123
8123
  dwgData = null;
8124
- version = ei;
8124
+ version = ti;
8125
8125
  constructor(e) {
8126
8126
  if (this.options = e, this.options.backgroundColor = this.options.backgroundColor ?? 1710618, this.options.enablePerformanceMonitoring = this.options.enablePerformanceMonitoring ?? !1, this.options.showMouseCoordinates = this.options.showMouseCoordinates ?? !1, this.options.loadingStyle = this.options.loadingStyle ?? 2, this.options.contextMenu = this.options.contextMenu ?? {
8127
8127
  items: [
@@ -8135,13 +8135,13 @@ class Bi {
8135
8135
  ]
8136
8136
  }, this.enablePerformanceMonitoring = e.enablePerformanceMonitoring ?? !1, this.container = document.getElementById(e.containerId), !this.container)
8137
8137
  throw new Error(`Container ${e.containerId} not found`);
8138
- this.initialize(), this.handelBehaved2d = fi(this), this.interactionModule2d = new gi(this), this.interactionModule2d.init(), this.interactionModule2d.active();
8138
+ this.initialize(), this.handelBehaved2d = mi(this), this.interactionModule2d = new yi(this), this.interactionModule2d.init(), this.interactionModule2d.active();
8139
8139
  }
8140
8140
  /**
8141
8141
  * 初始化引擎
8142
8142
  */
8143
8143
  initialize() {
8144
- this.events = new Gt(!1), this.sceneModule2d = new si(this, this.options), this.scene = this.sceneModule2d.scene, this.cameraModule2d = new oi(this, this.container), this.camera = this.cameraModule2d.orthographicCamera, this.renderModule2d = new ai(this, this.container, this.options), this.renderer = this.renderModule2d.renderer, this.controlModule2d = new hi(this), this.loaderModule2d = new qt(this), this.themeManager = new _i(this.container), this.layerManager = new ct(this), this.searchManager = new ki(this), this.measure = new Ti(this), this.markup = new Pi(this), this.label = new Di(this), this.viewCube = new zi(this), this.octreeBox2d = new ci(this), this.modelToolModule2d = new pi(this), this.engineStatus2d = new ri(this), this.linkView2d3d = new di(this), this.linkElement2d3d = new ui(this), this.sceneModule2d.initGrid(), this.cadCursorUI = new yi(this.container, this.renderer.domElement, this.options.cursorStyle ?? "short-crosshair"), this.cadCursorUI.setBackgroundColor(this.options.backgroundColor ?? 1710618), this.loadingUI = new wi(this.container, this.options.loadingStyle), this.events.on(fe.ModelLoadStart, () => this.loadingUI.show("正在加载...", 0)), this.events.on(fe.ModelLoadProgress, (e) => this.loadingUI.update(e.text, e.progress)), this.events.on(fe.ModelLoaded, () => this.loadingUI.hide()), this.events.on(fe.ModelLoadError, () => this.loadingUI.hide()), this.versionEl = document.createElement("div"), this.versionEl.className = "engine-2d-version-text", this.updateVersionDisplay(), this.container.appendChild(this.versionEl), this.workspaceTabsUI = new Ri(this.container, this), this.contextMenuUI = new vi(
8144
+ this.events = new Zt(!1), this.sceneModule2d = new ri(this, this.options), this.scene = this.sceneModule2d.scene, this.cameraModule2d = new ai(this, this.container), this.camera = this.cameraModule2d.orthographicCamera, this.renderModule2d = new li(this, this.container, this.options), this.renderer = this.renderModule2d.renderer, this.controlModule2d = new ci(this), this.loaderModule2d = new Jt(this), this.themeManager = new Ei(this.container), this.layerManager = new ct(this), this.searchManager = new _i(this), this.measure = new Ai(this), this.markup = new Di(this), this.label = new zi(this), this.viewCube = new Ri(this), this.octreeBox2d = new di(this), this.modelToolModule2d = new fi(this), this.engineStatus2d = new oi(this), this.linkView2d3d = new ui(this), this.linkElement2d3d = new pi(this), this.sceneModule2d.initGrid(), this.cadCursorUI = new vi(this.container, this.renderer.domElement, this.options.cursorStyle ?? "short-crosshair"), this.cadCursorUI.setBackgroundColor(this.options.backgroundColor ?? 1710618), this.loadingUI = new bi(this.container, this.options.loadingStyle), this.events.on(fe.ModelLoadStart, () => this.loadingUI.show("正在加载...", 0)), this.events.on(fe.ModelLoadProgress, (e) => this.loadingUI.update(e.text, e.progress)), this.events.on(fe.ModelLoaded, () => this.loadingUI.hide()), this.events.on(fe.ModelLoadError, () => this.loadingUI.hide()), this.versionEl = document.createElement("div"), this.versionEl.className = "engine-2d-version-text", this.updateVersionDisplay(), this.container.appendChild(this.versionEl), this.workspaceTabsUI = new Bi(this.container, this), this.contextMenuUI = new wi(
8145
8145
  this.container,
8146
8146
  this.renderer.domElement,
8147
8147
  (e) => {
@@ -8184,7 +8184,7 @@ class Bi {
8184
8184
  };
8185
8185
  /** 初始化 stats.js 性能监视器,showStats 优先控制可视面板,旧配置 enablePerformanceMonitoring 继续兼容。 */
8186
8186
  initStatsMonitor() {
8187
- !(this.options.showStats ?? this.enablePerformanceMonitoring) || !this.container || (this.stats = new Vt(), this.stats.showPanel(0), this.stats.dom.className = "engine-2d-stats-monitor", this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
8187
+ !(this.options.showStats ?? this.enablePerformanceMonitoring) || !this.container || (this.stats = new Ht(), this.stats.showPanel(0), this.stats.dom.className = "engine-2d-stats-monitor", this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
8188
8188
  }
8189
8189
  /**
8190
8190
  * 更新性能统计
@@ -8205,6 +8205,19 @@ class Bi {
8205
8205
  async loadModel(e, t) {
8206
8206
  return await this.loaderModule2d.loadModel(e, t), {};
8207
8207
  }
8208
+ /**
8209
+ * 通过 viewToken 向 OpenAPI 解析真实加载地址,再复用现有 2D URL 加载逻辑。
8210
+ */
8211
+ async loadModelByViewToken(e, t) {
8212
+ const i = await Nt(
8213
+ this.options,
8214
+ e,
8215
+ "2d"
8216
+ );
8217
+ if (i.assetCategory === "composite_model" && i.urls.length > 1)
8218
+ throw new Error("[BimEngine] 2D engine does not support composite_model viewToken loading");
8219
+ return this.loadModel(i.url, t);
8220
+ }
8208
8221
  /** 获取当前 2D 图纸中可切换的布局空间列表。 */
8209
8222
  getLayouts() {
8210
8223
  return this.loaderModule2d?.getLayouts() ?? [];
@@ -8403,16 +8416,16 @@ class Bi {
8403
8416
  console.log("[EngineKernel2d] Disposing engine..."), this.stopRendering(), this.cadCursorUI?.dispose(), this.contextMenuUI?.dispose(), this.loadingUI?.dispose(), this.workspaceTabsUI?.dispose(), this.versionEl?.parentElement?.removeChild(this.versionEl), this.searchManager?.dispose(), this.measure?.dispose(), this.markup?.dispose(), this.label?.dispose(), this.themeManager?.dispose(), this.loaderModule2d?.dispose(), this.controlModule2d?.dispose(), this.renderModule2d?.dispose(), this.cameraModule2d?.dispose(), this.sceneModule2d?.dispose(), this.events?.dispose(), this.stats?.dom?.parentElement && this.stats.dom.parentElement.removeChild(this.stats.dom), this.scene = null, this.camera = null, this.renderer = null, this.dwgData = null, this.stats = void 0, this.versionEl = null, console.log("[EngineKernel2d] Engine disposed");
8404
8417
  }
8405
8418
  }
8406
- const ji = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8419
+ const Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8407
8420
  __proto__: null,
8408
- EngineKernel2d: Bi
8421
+ EngineKernel2d: Ni
8409
8422
  }, Symbol.toStringTag, { value: "Module" }));
8410
8423
  export {
8411
- ei as E,
8412
- Wt as J,
8413
- qt as L,
8414
- Vt as S,
8415
- ji as a,
8424
+ ti as E,
8425
+ jt as J,
8426
+ Jt as L,
8427
+ Ht as S,
8428
+ Ui as a,
8416
8429
  Oe as c,
8417
8430
  ht as g
8418
8431
  };