iflow-engine-base 3.10.9 → 3.11.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.
@@ -1,19 +1,22 @@
1
- import { J as I } from "./engine-2d-DVhZzZy6.js";
2
1
  import { b8 as w } from "./three-vendor-fDCVai2b.js";
3
- const _ = "__BIM_ENGINE_SDK_ASSET_BASE__", S = "__BIM_ENGINE_SDK_ASSET_FILE_MAP__", b = "__BIM_ENGINE_SDK_ASSET_FILE_URLS__", g = "__BIM_ENGINE_SDK_ASSET_FILE_SESSION__", M = "https://unpkg.com/iflow-engine-base@3.9.20/dist/", A = "https://__bim_engine_sdk_asset__/", R = ["assets/", "fonts/", "draco/", "basis/", "texture/", "prompt/"];
4
- function l() {
2
+ const S = "__BIM_ENGINE_SDK_ASSET_BASE__", b = "__BIM_ENGINE_SDK_ASSET_FILE_MAP__", g = "__BIM_ENGINE_SDK_ASSET_FILE_URLS__", A = "__BIM_ENGINE_SDK_ASSET_FILE_SESSION__", j = "https://unpkg.com/iflow-engine-base@3.9.20/dist/", L = "https://__bim_engine_sdk_asset__/", M = ["assets/", "fonts/", "draco/", "basis/", "texture/", "prompt/"];
3
+ let _ = null;
4
+ async function R() {
5
+ return _ || (_ = import("./sdk-vendor-DgZ0Rkal.js").then((t) => t.j).then((t) => t.default ?? t)), _;
6
+ }
7
+ function a() {
5
8
  return typeof globalThis < "u" ? globalThis : null;
6
9
  }
7
10
  function u(t) {
8
11
  return t.endsWith("/") ? t : `${t}/`;
9
12
  }
10
- function c(t) {
13
+ function l(t) {
11
14
  return String(t).replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+/g, "/");
12
15
  }
13
- function h(t) {
16
+ function m(t) {
14
17
  return /^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(t) || /^(?:data|blob):/i.test(t);
15
18
  }
16
- function j(t) {
19
+ function y(t) {
17
20
  return t.startsWith("./") || t.startsWith("../");
18
21
  }
19
22
  function f(t, e) {
@@ -23,87 +26,87 @@ function f(t, e) {
23
26
  return null;
24
27
  }
25
28
  }
26
- function y(t) {
29
+ function F(t) {
27
30
  return /\.zip$/i.test(t.name);
28
31
  }
29
- function F() {
32
+ function T() {
30
33
  return `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
31
34
  }
32
- function T(t) {
33
- return t.startsWith(A);
35
+ function v(t) {
36
+ return t.startsWith(L);
34
37
  }
35
- function L() {
36
- const e = l()?.[g];
37
- return typeof e == "string" && e ? `${A}${e}/` : null;
38
+ function p() {
39
+ const e = a()?.[A];
40
+ return typeof e == "string" && e ? `${L}${e}/` : null;
38
41
  }
39
- function v(t) {
40
- return `${L() ?? A}${c(t)}`;
42
+ function z(t) {
43
+ return `${p() ?? L}${l(t)}`;
41
44
  }
42
- function m() {
43
- const e = l()?.[S];
45
+ function U() {
46
+ const e = a()?.[b];
44
47
  return e instanceof Map ? e : null;
45
48
  }
46
- function z() {
47
- const e = l()?.[b];
49
+ function K() {
50
+ const e = a()?.[g];
48
51
  return Array.isArray(e) ? e : [];
49
52
  }
50
- function U() {
51
- const t = l();
52
- t && (z().forEach((e) => URL.revokeObjectURL(e)), delete t[S], delete t[b], delete t[g]);
53
+ function O() {
54
+ const t = a();
55
+ t && (K().forEach((e) => URL.revokeObjectURL(e)), delete t[b], delete t[g], delete t[A]);
53
56
  }
54
- function K(t, e) {
55
- const n = l();
56
- n && (U(), n[S] = t, n[b] = e, n[g] = F());
57
+ function D(t, e) {
58
+ const n = a();
59
+ n && (O(), n[b] = t, n[g] = e, n[A] = T());
57
60
  }
58
- function D(t, e, n) {
59
- const s = c(e), r = /* @__PURE__ */ new Set([s]), o = s.indexOf("dist/");
61
+ function N(t, e, n) {
62
+ const s = l(e), r = /* @__PURE__ */ new Set([s]), o = s.indexOf("dist/");
60
63
  o >= 0 && r.add(s.slice(o + 5));
61
- const i = s.indexOf("public/");
62
- i >= 0 && r.add(s.slice(i + 7));
63
- for (const a of R) {
64
- const E = s.indexOf(a);
64
+ const c = s.indexOf("public/");
65
+ c >= 0 && r.add(s.slice(c + 7));
66
+ for (const i of M) {
67
+ const E = s.indexOf(i);
65
68
  E >= 0 && r.add(s.slice(E));
66
69
  }
67
- r.forEach((a) => {
68
- a && (t.set(a, n), t.set(a.toLowerCase(), n));
70
+ r.forEach((i) => {
71
+ i && (t.set(i, n), t.set(i.toLowerCase(), n));
69
72
  });
70
73
  }
71
- function O(t) {
72
- const e = m();
74
+ function B(t) {
75
+ const e = U();
73
76
  if (!e)
74
77
  return null;
75
- const n = c(t);
78
+ const n = l(t);
76
79
  return e.get(n) ?? e.get(n.toLowerCase()) ?? null;
77
80
  }
78
- function p(t) {
79
- const e = m();
81
+ function h(t) {
82
+ const e = U();
80
83
  if (!e)
81
84
  return !1;
82
- const n = c(t).replace(/\/?$/, "/").toLowerCase();
85
+ const n = l(t).replace(/\/?$/, "/").toLowerCase();
83
86
  for (const s of e.keys())
84
87
  if (s.toLowerCase().startsWith(n))
85
88
  return !0;
86
89
  return !1;
87
90
  }
88
- function N(t) {
89
- if (!T(t))
91
+ function k(t) {
92
+ if (!v(t))
90
93
  return null;
91
- const e = L();
94
+ const e = p();
92
95
  if (!e || !t.startsWith(e))
93
96
  return null;
94
97
  const n = t.slice(e.length);
95
- return O(n);
98
+ return B(n);
96
99
  }
97
- w.setURLModifier((t) => N(t) ?? t);
98
- async function k(t) {
100
+ w.setURLModifier((t) => k(t) ?? t);
101
+ async function P(t) {
99
102
  const e = [];
100
103
  for (const n of t) {
101
- const s = c(n.webkitRelativePath || n.name);
102
- if (y(n)) {
103
- const r = await I.loadAsync(n), o = Object.values(r.files);
104
- for (const i of o)
104
+ const s = l(n.webkitRelativePath || n.name);
105
+ if (F(n)) {
106
+ const o = await (await R()).loadAsync(n), c = Object.values(o.files);
107
+ for (const i of c)
105
108
  i.dir || e.push({
106
- path: c(i.name),
109
+ path: l(i.name),
107
110
  blob: await i.async("blob")
108
111
  });
109
112
  continue;
@@ -115,27 +118,27 @@ async function k(t) {
115
118
  }
116
119
  return e;
117
120
  }
118
- function B() {
121
+ function I() {
119
122
  return typeof document < "u" && document.baseURI ? document.baseURI : typeof location < "u" && location.href ? location.href : null;
120
123
  }
121
- function P(t, e) {
124
+ function W(t, e) {
122
125
  const n = u(t);
123
- if (h(n))
126
+ if (m(n))
124
127
  return n;
125
- const s = d(e) || W() || B();
128
+ const s = d(e) || x() || I();
126
129
  return f(n, s || void 0) || n;
127
130
  }
128
131
  function d(t) {
129
132
  if (!t)
130
133
  return null;
131
134
  try {
132
- const e = B(), n = f(t, e || void 0) || t, s = new URL(".", n), r = s.pathname.replace(/\\/g, "/");
135
+ const e = I(), n = f(t, e || void 0) || t, s = new URL(".", n), r = s.pathname.replace(/\\/g, "/");
133
136
  return r.endsWith("/chunks/") ? new URL("../", s).toString() : e && /\/src\//.test(r) ? u(e) : s.toString();
134
137
  } catch {
135
138
  return null;
136
139
  }
137
140
  }
138
- function W() {
141
+ function x() {
139
142
  if (typeof document > "u")
140
143
  return null;
141
144
  const t = document.currentScript;
@@ -149,60 +152,60 @@ function W() {
149
152
  }
150
153
  return null;
151
154
  }
152
- function V(t) {
153
- const e = l();
155
+ function Z(t) {
156
+ const e = a();
154
157
  if (e) {
155
158
  if (!t) {
156
- delete e[_];
159
+ delete e[S];
157
160
  return;
158
161
  }
159
- e[_] = u(t);
162
+ e[S] = u(t);
160
163
  }
161
164
  }
162
- async function x(t) {
165
+ async function $(t) {
163
166
  if (!t || t.length === 0) {
164
- U();
167
+ O();
165
168
  return;
166
169
  }
167
- const e = Array.from(t), n = await k(e), s = /* @__PURE__ */ new Map(), r = [];
170
+ const e = Array.from(t), n = await P(e), s = /* @__PURE__ */ new Map(), r = [];
168
171
  n.forEach((o) => {
169
- const i = URL.createObjectURL(o.blob);
170
- r.push(i), D(s, o.path, i);
171
- }), K(s, r);
172
+ const c = URL.createObjectURL(o.blob);
173
+ r.push(c), N(s, o.path, c);
174
+ }), D(s, r);
172
175
  }
173
- async function Y(t) {
174
- await x(t ? [t] : null);
176
+ async function V(t) {
177
+ await $(t ? [t] : null);
175
178
  }
176
- function $(t) {
177
- const e = L();
179
+ function G(t) {
180
+ const e = p();
178
181
  if (e)
179
182
  return e;
180
- const s = l()?.[_];
181
- return typeof s == "string" && s.length > 0 ? P(s, t) : u(M);
183
+ const s = a()?.[S];
184
+ return typeof s == "string" && s.length > 0 ? W(s, t) : u(j);
182
185
  }
183
- function J(t, e) {
184
- if (h(t))
186
+ function Y(t, e) {
187
+ if (m(t))
185
188
  return t;
186
- const n = c(t), s = O(n);
189
+ const n = l(t), s = B(n);
187
190
  if (s && !t.endsWith("/"))
188
191
  return s;
189
- if (t.endsWith("/") || p(n)) {
190
- const o = v(n);
191
- if (p(n))
192
+ if (t.endsWith("/") || h(n)) {
193
+ const o = z(n);
194
+ if (h(n))
192
195
  return t.endsWith("/") ? u(o) : o;
193
196
  }
194
- if (j(t)) {
197
+ if (y(t)) {
195
198
  const o = f(t, d(e) || void 0);
196
199
  if (o)
197
200
  return o;
198
201
  }
199
- const r = $(e);
202
+ const r = G(e);
200
203
  return f(n, r) || n;
201
204
  }
202
205
  export {
203
- Y as a,
204
- V as b,
205
- $ as g,
206
- J as r,
207
- x as s
206
+ V as a,
207
+ Z as b,
208
+ G as g,
209
+ Y as r,
210
+ $ as s
208
211
  };