@vsleem-realsee-viewer/shared 2.0.20 → 2.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,20 +1,19 @@
1
- var E = /* @__PURE__ */ ((s) => (s[s.CADModel = 5] = "CADModel", s[s.BIMModel = 6] = "BIMModel", s[s.ForgeModel = 7] = "ForgeModel", s[s.ThreeDModel = 8] = "ThreeDModel", s[s.SkyMapModel = 9] = "SkyMapModel", s[s.ScaleModel = 10] = "ScaleModel", s))(E || {}), et = /* @__PURE__ */ ((s) => (s[s.Global = 0] = "Global", s))(et || {}), v = /* @__PURE__ */ ((s) => (s[s.Space = 0] = "Space", s[s.Model = 1] = "Model", s[s.Data = 2] = "Data", s))(v || {}), R = /* @__PURE__ */ ((s) => (s[s.Used = 0] = "Used", s[s.Enabled = 1] = "Enabled", s[s.Disabled = 2] = "Disabled", s))(R || {}), U = /* @__PURE__ */ ((s) => (s[s.SUCCESS = 200] = "SUCCESS", s[s.ERROR = -1] = "ERROR", s[s.TIMEOUT = 401] = "TIMEOUT", s))(U || {}), M = /* @__PURE__ */ ((s) => (s.GET = "GET", s.POST = "POST", s))(M || {}), O = /* @__PURE__ */ ((s) => (s.JSON = "application/json", s.FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8", s.FORM_DATA = "multipart/form-data;charset=UTF-8", s.OCTET_STREAM = "'application/octet-stream", s))(O || {}), st = /* @__PURE__ */ ((s) => (s.Hw = "huawei", s.Ali = "aliyun", s.Hs = "hs", s.Aws = "amazon", s.Minio = "minio", s))(st || {}), w = /* @__PURE__ */ ((s) => (s[s.GeoPointNoPlane = 9e3] = "GeoPointNoPlane", s[s.PointUnmappedGIS = 9010] = "PointUnmappedGIS", s[s.PointNoXYZ = 9011] = "PointNoXYZ", s[s.PointNoPlane = 9012] = "PointNoPlane", s[s.RelativePlaneUnmatch = 9020] = "RelativePlaneUnmatch", s[s.RelativeNoPlane = 9021] = "RelativeNoPlane", s[s.RelativeJsonError = 9022] = "RelativeJsonError", s[s.RequestCodeError = 9030] = "RequestCodeError", s[s.RequestResultError = 9031] = "RequestResultError", s[s.RequestUnknownError = 9032] = "RequestUnknownError", s))(w || {});
2
- const it = {
1
+ var b = /* @__PURE__ */ ((s) => (s[s.CADModel = 5] = "CADModel", s[s.BIMModel = 6] = "BIMModel", s[s.ForgeModel = 7] = "ForgeModel", s[s.ThreeDModel = 8] = "ThreeDModel", s[s.GeoModel = 9] = "GeoModel", s[s.ScaleModel = 101] = "ScaleModel", s))(b || {}), st = /* @__PURE__ */ ((s) => (s[s.Global = 0] = "Global", s))(st || {}), M = /* @__PURE__ */ ((s) => (s[s.Space = 0] = "Space", s[s.Model = 1] = "Model", s[s.Data = 2] = "Data", s))(M || {}), O = /* @__PURE__ */ ((s) => (s[s.Used = 0] = "Used", s[s.Enabled = 1] = "Enabled", s[s.Disabled = 2] = "Disabled", s))(O || {}), Y = /* @__PURE__ */ ((s) => (s[s.SUCCESS = 200] = "SUCCESS", s[s.ERROR = -1] = "ERROR", s[s.TIMEOUT = 401] = "TIMEOUT", s))(Y || {}), x = /* @__PURE__ */ ((s) => (s.GET = "GET", s.POST = "POST", s))(x || {}), L = /* @__PURE__ */ ((s) => (s.JSON = "application/json", s.FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8", s.FORM_DATA = "multipart/form-data;charset=UTF-8", s.OCTET_STREAM = "'application/octet-stream", s))(L || {}), it = /* @__PURE__ */ ((s) => (s.Hw = "huawei", s.Ali = "aliyun", s.Hs = "hs", s.Aws = "amazon", s.Minio = "minio", s))(it || {}), p = /* @__PURE__ */ ((s) => (s[s.GeoPointNoPlane = 9e3] = "GeoPointNoPlane", s[s.PointUnmappedGIS = 9010] = "PointUnmappedGIS", s[s.PointNoXYZ = 9011] = "PointNoXYZ", s[s.PointNoPlane = 9012] = "PointNoPlane", s[s.RelativePlaneUnmatch = 9020] = "RelativePlaneUnmatch", s[s.RelativeNoPlane = 9021] = "RelativeNoPlane", s[s.RelativeJsonError = 9022] = "RelativeJsonError", s[s.RequestCodeError = 9030] = "RequestCodeError", s[s.RequestResultError = 9031] = "RequestResultError", s[s.RequestUnknownError = 9032] = "RequestUnknownError", s))(p || {});
2
+ const nt = {
3
3
  baseUrl: "https://vsleem.com/api",
4
- obsType: "hs",
5
4
  authorizeCode: ""
6
- }, nt = {
5
+ }, ot = {
7
6
  isTransformResponse: !0,
8
7
  joinBaseUrl: !0,
9
8
  withAuthorize: !0
10
- }, ot = {
9
+ }, rt = {
11
10
  url: "",
12
- method: M.GET,
11
+ method: x.GET,
13
12
  headers: {}
14
13
  };
15
- class y extends Error {
14
+ class w extends Error {
16
15
  constructor(t, e, i) {
17
- super(e), this.code = t, this.message = e, this.details = i, this.name = "Apprror", Object.setPrototypeOf(this, y.prototype);
16
+ super(e), this.code = t, this.message = e, this.details = i, this.name = "Apprror", Object.setPrototypeOf(this, w.prototype);
18
17
  }
19
18
  // 可选的:转换成 JSON 格式,方便返回给调用方
20
19
  toJSON() {
@@ -26,195 +25,196 @@ class y extends Error {
26
25
  };
27
26
  }
28
27
  }
29
- const Y = { ...it };
30
- function rt(s) {
31
- Object.assign(Y, s);
28
+ const G = { ...nt };
29
+ function at(s) {
30
+ const { baseUrl: t, authorizeCode: e } = s;
31
+ Object.assign(G, { baseUrl: t, authorizeCode: e });
32
32
  }
33
- async function S(s, t) {
34
- const e = { ...nt, ...t }, i = { ...ot, ...s };
33
+ async function P(s, t) {
34
+ const e = { ...ot, ...t }, i = { ...rt, ...s };
35
35
  try {
36
- const n = at(i, e), { url: o, ...r } = n, h = await (await window.fetch(o, r)).json();
37
- return ht(h, e);
36
+ const n = ht(i, e), { url: o, ...r } = n, c = await (await window.fetch(o, r)).json();
37
+ return ct(c, e);
38
38
  } catch (n) {
39
- return ct(n);
39
+ return lt(n);
40
40
  }
41
41
  }
42
- function at(s, t) {
43
- const { baseUrl: e, authorizeCode: i } = Y, { joinBaseUrl: n, withAuthorize: o } = t;
44
- let { url: r, method: a, headers: h = {}, params: l, data: c } = s;
42
+ function ht(s, t) {
43
+ const { baseUrl: e, authorizeCode: i } = G, { joinBaseUrl: n, withAuthorize: o } = t;
44
+ let { url: r, method: a, headers: c = {}, params: l, data: h } = s;
45
45
  n && e && (r = `${e}${r}`), a = a?.toUpperCase();
46
- const u = { ...h };
47
- if (/^https?:\/\/.+$/i.test(e ?? "") ? u.PlatForm = new URL(e ?? "").host : u.PlatForm = new URL(window.location.href).host, o && i && (u.AuthorizationCode = i), a === M.POST && !u["Content-Type"] && (u["Content-Type"] = O.JSON), a === M.GET && l) {
48
- const g = new URLSearchParams(l);
49
- r += `?${g.toString()}`;
46
+ const u = { ...c };
47
+ if (/^https?:\/\/.+$/i.test(e ?? "") ? u.PlatForm = new URL(e ?? "").host : u.PlatForm = new URL(window.location.href).host, o && i && (u.AuthorizationCode = i), a === x.POST && !u["Content-Type"] && (u["Content-Type"] = L.JSON), a === x.GET && l) {
48
+ const T = new URLSearchParams(l), v = r.includes("?") ? "&" : "?";
49
+ r += v + `${T.toString()}`;
50
50
  }
51
51
  let d;
52
- return a === M.POST && (d = u["Content-Type"] === O.JSON ? JSON.stringify(c || {}) : c), {
52
+ return a === x.POST && (d = u["Content-Type"] === L.JSON ? JSON.stringify(h || {}) : h), {
53
53
  url: r,
54
54
  method: a,
55
55
  headers: u,
56
56
  body: d
57
57
  };
58
58
  }
59
- function ht(s, t) {
59
+ function ct(s, t) {
60
60
  if (!t.isTransformResponse)
61
61
  return s;
62
62
  if (!s)
63
- throw new y(w.RequestResultError, "请求返回的结果错误");
63
+ throw new w(p.RequestResultError, "请求返回的结果错误");
64
64
  const { code: e, data: i, msg: n } = s;
65
- if (e === U.SUCCESS)
65
+ if (e === Y.SUCCESS)
66
66
  return i;
67
- throw new y(w.RequestCodeError, n || "请求返回的Code错误");
67
+ throw new w(p.RequestCodeError, n || "请求返回的Code错误");
68
68
  }
69
- function ct(s) {
70
- throw s instanceof Error ? s : new y(
71
- w.RequestUnknownError,
69
+ function lt(s) {
70
+ throw s instanceof Error ? s : new w(
71
+ p.RequestUnknownError,
72
72
  typeof s == "string" ? s : "未知的请求错误"
73
73
  );
74
74
  }
75
- const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
75
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
76
76
  __proto__: null,
77
- request: S,
78
- setRequestGlobalConfig: rt
77
+ request: P,
78
+ setRequestGlobalConfig: at
79
79
  }, Symbol.toStringTag, { value: "Module" }));
80
- function G(s, t) {
81
- return S(
80
+ function B(s, t) {
81
+ return P(
82
82
  {
83
83
  url: "/project/jssdk/cs/list",
84
- method: M.GET,
84
+ method: x.GET,
85
85
  params: s
86
86
  },
87
87
  t
88
88
  );
89
89
  }
90
- function B(s, t) {
91
- return S(
90
+ function $(s, t) {
91
+ return P(
92
92
  {
93
93
  url: "/project/jssdk/cs/bind",
94
- method: M.POST,
94
+ method: x.POST,
95
95
  data: s
96
96
  },
97
97
  t
98
98
  );
99
99
  }
100
- function L(s, t) {
101
- return S(
100
+ function A(s, t) {
101
+ return P(
102
102
  {
103
103
  url: "/project/jssdk/cs/save",
104
- method: M.POST,
104
+ method: x.POST,
105
105
  data: s
106
106
  },
107
107
  t
108
108
  );
109
109
  }
110
- function $(s, t) {
111
- return S(
110
+ function _(s, t) {
111
+ return P(
112
112
  {
113
113
  url: "/project/jssdk/cs/delete",
114
- method: M.POST,
114
+ method: x.POST,
115
115
  data: s
116
116
  },
117
117
  t
118
118
  );
119
119
  }
120
- function _(s, t) {
121
- return S(
120
+ function Z(s, t) {
121
+ return P(
122
122
  {
123
123
  url: "/project/jssdk/cs/mapping",
124
- method: M.POST,
124
+ method: x.POST,
125
125
  data: s
126
126
  },
127
127
  t
128
128
  );
129
129
  }
130
- function Z(s, t) {
131
- return S(
130
+ function q(s, t) {
131
+ return P(
132
132
  {
133
133
  url: "/project/jssdk/cs/mapping/query",
134
- method: M.GET,
134
+ method: x.GET,
135
135
  params: s
136
136
  },
137
137
  t
138
138
  );
139
139
  }
140
- function lt(s, t = {
140
+ function ut(s, t = {
141
141
  isTransformResponse: !1,
142
142
  joinBaseUrl: !1,
143
143
  withAuthorize: !1
144
144
  }) {
145
- return S(
145
+ return P(
146
146
  {
147
147
  url: s,
148
- method: M.GET
148
+ method: x.GET
149
149
  },
150
150
  t
151
151
  );
152
152
  }
153
- const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
153
+ const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
154
154
  __proto__: null,
155
- bindCoordinate: B,
156
- getCoordinateList: G,
157
- getImageInfo: lt,
158
- getMappingRelation: Z,
159
- mapingCoordinate: _,
160
- removeCoordinate: $,
161
- saveCoordinate: L
162
- }, Symbol.toStringTag, { value: "Module" })), ut = typeof window < "u", dt = Object.prototype.toString;
163
- function T(s, t) {
164
- return dt.call(s) === `[object ${t}]`;
155
+ bindCoordinate: $,
156
+ getCoordinateList: B,
157
+ getImageInfo: ut,
158
+ getMappingRelation: q,
159
+ mapingCoordinate: Z,
160
+ removeCoordinate: _,
161
+ saveCoordinate: A
162
+ }, Symbol.toStringTag, { value: "Module" })), dt = typeof window < "u", ft = Object.prototype.toString;
163
+ function E(s, t) {
164
+ return ft.call(s) === `[object ${t}]`;
165
165
  }
166
- function q(s) {
166
+ function J(s) {
167
167
  return typeof s < "u";
168
168
  }
169
- function J(s) {
170
- return !q(s);
169
+ function H(s) {
170
+ return !J(s);
171
171
  }
172
- function b(s) {
173
- return s !== null && T(s, "Object");
172
+ function S(s) {
173
+ return s !== null && E(s, "Object");
174
174
  }
175
- function H(s) {
175
+ function V(s) {
176
176
  return s === null;
177
177
  }
178
- function ft(s) {
179
- return T(s, "Date");
180
- }
181
178
  function mt(s) {
182
- return T(s, "String");
183
- }
184
- function k(s) {
185
- return typeof s == "function";
179
+ return E(s, "Date");
186
180
  }
187
181
  function yt(s) {
188
- return T(s, "Boolean");
182
+ return E(s, "String");
189
183
  }
190
- function wt(s) {
191
- return T(s, "RegExp");
184
+ function j(s) {
185
+ return typeof s == "function";
192
186
  }
193
- function x(s) {
194
- return s && Array.isArray(s);
187
+ function wt(s) {
188
+ return E(s, "Boolean");
195
189
  }
196
190
  function pt(s) {
197
- return typeof window < "u" && T(s, "Window");
191
+ return E(s, "RegExp");
192
+ }
193
+ function g(s) {
194
+ return s && Array.isArray(s);
198
195
  }
199
196
  function gt(s) {
200
- return b(s) && !!s.tagName;
197
+ return typeof window < "u" && E(s, "Window");
198
+ }
199
+ function xt(s) {
200
+ return S(s) && !!s.tagName;
201
201
  }
202
- function N(s) {
202
+ function I(s) {
203
203
  return typeof s == "number" ? !0 : typeof s != "string" ? !1 : /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(s);
204
204
  }
205
- function xt(s, t) {
205
+ function Mt(s, t) {
206
206
  return JSON.stringify(s) === JSON.stringify(t);
207
207
  }
208
- function Mt(s) {
209
- return J(s) || H(s);
210
- }
211
208
  function vt(s) {
212
- return T(s, "Promise") && b(s) && k(s.then) && k(s.catch);
209
+ return H(s) || V(s);
213
210
  }
214
- function V(s) {
215
- return P(s, /* @__PURE__ */ new WeakMap());
211
+ function bt(s) {
212
+ return E(s, "Promise") && S(s) && j(s.then) && j(s.catch);
213
+ }
214
+ function W(s) {
215
+ return z(s, /* @__PURE__ */ new WeakMap());
216
216
  }
217
- function P(s, t) {
217
+ function z(s, t) {
218
218
  if (typeof s != "object" || s === null)
219
219
  return s;
220
220
  if (t.has(s))
@@ -226,11 +226,11 @@ function P(s, t) {
226
226
  return e = new RegExp(s), t.set(s, e), e;
227
227
  if (s instanceof Map)
228
228
  return e = /* @__PURE__ */ new Map(), t.set(s, e), s.forEach((n, o) => {
229
- e.set(o, P(n, t));
229
+ e.set(o, z(n, t));
230
230
  }), e;
231
231
  if (s instanceof Set)
232
232
  return e = /* @__PURE__ */ new Set(), t.set(s, e), s.forEach((n) => {
233
- e.add(P(n, t));
233
+ e.add(z(n, t));
234
234
  }), e;
235
235
  if (ArrayBuffer.isView(s))
236
236
  return e = new s.constructor(
@@ -243,18 +243,18 @@ function P(s, t) {
243
243
  if (Array.isArray(s)) {
244
244
  e = [], t.set(s, e);
245
245
  for (let n = 0; n < s.length; n++)
246
- n in s && (e[n] = P(s[n], t));
246
+ n in s && (e[n] = z(s[n], t));
247
247
  return e;
248
248
  }
249
249
  e = Object.create(Object.getPrototypeOf(s)), t.set(s, e);
250
250
  for (const n in s)
251
- Object.prototype.hasOwnProperty.call(s, n) && (e[n] = P(s[n], t));
251
+ Object.prototype.hasOwnProperty.call(s, n) && (e[n] = z(s[n], t));
252
252
  const i = Object.getOwnPropertySymbols(s);
253
253
  for (const n of i)
254
- Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] = P(s[n], t));
254
+ Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] = z(s[n], t));
255
255
  return e;
256
256
  }
257
- function bt(s, t, e = !1) {
257
+ function Tt(s, t, e = !1) {
258
258
  let i;
259
259
  const n = function(...o) {
260
260
  const r = this, a = e && !i;
@@ -281,51 +281,51 @@ function St(s, t, e = !1) {
281
281
  clearTimeout(i), i = void 0, n = void 0;
282
282
  }, o;
283
283
  }
284
- function A(s, ...t) {
284
+ function k(s, ...t) {
285
285
  if (!t.length) return s;
286
286
  const e = t.shift();
287
- return e === void 0 ? s : (I(s) && I(e) && Object.keys(e).forEach((i) => {
287
+ return e === void 0 ? s : (C(s) && C(e) && Object.keys(e).forEach((i) => {
288
288
  const n = s[i], o = e[i];
289
- Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] : I(n) && I(o) ? s[i] = A({ ...n }, o) : o !== void 0 && (s[i] = o);
290
- }), A(s, ...t));
289
+ Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] : C(n) && C(o) ? s[i] = k({ ...n }, o) : o !== void 0 && (s[i] = o);
290
+ }), k(s, ...t));
291
291
  }
292
- function I(s) {
292
+ function C(s) {
293
293
  return s !== null && typeof s == "object" && !Array.isArray(s);
294
294
  }
295
- function W(s, ...t) {
295
+ function Q(s, ...t) {
296
296
  if (!t.length) return s;
297
297
  for (const e of t)
298
298
  e != null && typeof e == "object" && Object.keys(e).forEach((i) => {
299
299
  const n = e[i], o = s[i];
300
- n !== null && typeof n == "object" && !Array.isArray(n) ? ((!o || typeof o != "object") && (s[i] = {}), W(s[i], n)) : s[i] = n;
300
+ n !== null && typeof n == "object" && !Array.isArray(n) ? ((!o || typeof o != "object") && (s[i] = {}), Q(s[i], n)) : s[i] = n;
301
301
  });
302
302
  return s;
303
303
  }
304
- function Q(s, t) {
304
+ function K(s, t) {
305
305
  const e = {};
306
- if (b(s) && !x(s)) {
306
+ if (S(s) && !g(s)) {
307
307
  for (const i in s)
308
308
  if (Object.prototype.hasOwnProperty.call(s, i)) {
309
- const n = s[i], o = b(t) && !x(t) ? t[i] : void 0;
309
+ const n = s[i], o = S(t) && !g(t) ? t[i] : void 0;
310
310
  if (!(i in (t || {})))
311
311
  e[i] = n;
312
- else if (x(n) && x(o))
312
+ else if (g(n) && g(o))
313
313
  JSON.stringify(n) !== JSON.stringify(o) && (e[i] = n);
314
- else if (b(n) && b(o)) {
315
- const r = Q(n, o);
314
+ else if (S(n) && S(o)) {
315
+ const r = K(n, o);
316
316
  r && Object.keys(r).length > 0 && (e[i] = r);
317
317
  } else n !== o && (e[i] = n);
318
318
  }
319
319
  }
320
- if (b(t) && x(t))
320
+ if (S(t) && g(t))
321
321
  for (const i in t)
322
322
  Object.prototype.hasOwnProperty.call(t, i) && !(i in (s || {})) && (e[i] = void 0);
323
323
  return e;
324
324
  }
325
- function Tt(s, t = {}) {
325
+ function Pt(s, t = {}) {
326
326
  return new Promise((e, i) => {
327
- const n = z(s);
328
- if (Pt(n)) {
327
+ const n = D(s);
328
+ if (Et(n)) {
329
329
  e(!0);
330
330
  return;
331
331
  }
@@ -339,14 +339,14 @@ function Tt(s, t = {}) {
339
339
  }, document.head.appendChild(o);
340
340
  });
341
341
  }
342
- function Pt(s) {
343
- const t = z(s);
344
- return Array.from(document.scripts).some((e) => z(e.src) === t);
345
- }
346
342
  function Et(s) {
343
+ const t = D(s);
344
+ return Array.from(document.scripts).some((e) => D(e.src) === t);
345
+ }
346
+ function zt(s) {
347
347
  return new Promise((t, e) => {
348
- const i = z(s);
349
- if (zt(i)) {
348
+ const i = D(s);
349
+ if (Dt(i)) {
350
350
  t(!0);
351
351
  return;
352
352
  }
@@ -358,13 +358,13 @@ function Et(s) {
358
358
  }, document.head.appendChild(n);
359
359
  });
360
360
  }
361
- function zt(s) {
362
- const t = z(s);
361
+ function Dt(s) {
362
+ const t = D(s);
363
363
  return Array.from(document.querySelectorAll('link[rel="stylesheet"]')).some(
364
- (e) => z(e.href) === t
364
+ (e) => D(e.href) === t
365
365
  );
366
366
  }
367
- function z(s) {
367
+ function D(s) {
368
368
  try {
369
369
  const t = new URL(s, window.location.href);
370
370
  return `${t.origin}${t.pathname}`;
@@ -372,7 +372,7 @@ function z(s) {
372
372
  return s;
373
373
  }
374
374
  }
375
- function Dt(s, t, e, i) {
375
+ function Nt(s, t, e, i) {
376
376
  const n = Math.min(s / e, t / i), o = e * n, r = i * n;
377
377
  return {
378
378
  scale: n,
@@ -384,59 +384,59 @@ function Dt(s, t, e, i) {
384
384
  sh: r
385
385
  };
386
386
  }
387
- function It(s, t, e) {
387
+ function Ct(s, t, e) {
388
388
  return {
389
389
  x: s * e.scale + e.x,
390
390
  // 缩放后加上偏移量
391
391
  y: t * e.scale + e.y
392
392
  };
393
393
  }
394
- function Nt(s, t, e) {
394
+ function It(s, t, e) {
395
395
  return {
396
396
  x: (s - e.x) / e.scale,
397
397
  // 减去偏移量后缩放到模型尺寸
398
398
  y: (t - e.y) / e.scale
399
399
  };
400
400
  }
401
- function Ct(s) {
401
+ function Rt(s) {
402
402
  console.warn(`[warn]:${s}`);
403
403
  }
404
- function Rt(s) {
404
+ function Ot(s) {
405
405
  throw new Error(`[error]:${s}`);
406
406
  }
407
- const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
407
+ const jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
408
408
  __proto__: null,
409
- cloneDeep: V,
410
- debounce: bt,
411
- deepMerge: A,
412
- deepMergeProps: W,
413
- error: Rt,
414
- getDiffProps: Q,
415
- getImageTransform: Dt,
416
- inBrowser: ut,
417
- is: T,
418
- isArray: x,
419
- isBoolean: yt,
420
- isDate: ft,
421
- isDef: q,
422
- isElement: gt,
423
- isFunction: k,
424
- isNull: H,
425
- isNullOrUnDef: Mt,
426
- isNumeric: N,
427
- isObject: b,
428
- isPromise: vt,
429
- isRegExp: wt,
430
- isSameValue: xt,
431
- isString: mt,
432
- isUnDef: J,
433
- isWindow: pt,
434
- loadCss: Et,
435
- loadScript: Tt,
409
+ cloneDeep: W,
410
+ debounce: Tt,
411
+ deepMerge: k,
412
+ deepMergeProps: Q,
413
+ error: Ot,
414
+ getDiffProps: K,
415
+ getImageTransform: Nt,
416
+ inBrowser: dt,
417
+ is: E,
418
+ isArray: g,
419
+ isBoolean: wt,
420
+ isDate: mt,
421
+ isDef: J,
422
+ isElement: xt,
423
+ isFunction: j,
424
+ isNull: V,
425
+ isNullOrUnDef: vt,
426
+ isNumeric: I,
427
+ isObject: S,
428
+ isPromise: bt,
429
+ isRegExp: pt,
430
+ isSameValue: Mt,
431
+ isString: yt,
432
+ isUnDef: H,
433
+ isWindow: gt,
434
+ loadCss: zt,
435
+ loadScript: Pt,
436
436
  throttle: St,
437
- toCanvasCoord: It,
438
- toModelCoord: Nt,
439
- warn: Ct
437
+ toCanvasCoord: Ct,
438
+ toModelCoord: It,
439
+ warn: Rt
440
440
  }, Symbol.toStringTag, { value: "Module" }));
441
441
  class f {
442
442
  /** 直角坐标系坐标 */
@@ -467,8 +467,8 @@ class f {
467
467
  plane = "xy";
468
468
  /** 默认平面 ('xy' 或 'xz') */
469
469
  constructor(t) {
470
- const { x: e, y: i, z: n, lat: o, lon: r, alt: a, yaw: h, pitch: l, roll: c, plane: u = "xy" } = t || {};
471
- this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0, (this.x !== 0 || this.y !== 0 || this.z !== 0) && (this.plane = u, this.hasXYZ = !0), this.lat = Number(o) || 0, this.lon = Number(r) || 0, this.alt = Number(a) || 0, (this.lat !== 0 || this.lon !== 0 || this.alt !== 0) && (this.hasGeo = !0), this.yaw = Number(h) || 0, this.pitch = Number(l) || 0, this.roll = Number(c) || 0, (N(h) || N(l) || N(c)) && (this.hasAngle = !0);
470
+ const { x: e, y: i, z: n, lat: o, lon: r, alt: a, yaw: c, pitch: l, roll: h, plane: u = "xy" } = t || {};
471
+ this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0, (this.x !== 0 || this.y !== 0 || this.z !== 0) && (this.plane = u, this.hasXYZ = !0), this.lat = Number(o) || 0, this.lon = Number(r) || 0, this.alt = Number(a) || 0, (this.lat !== 0 || this.lon !== 0 || this.alt !== 0) && (this.hasGeo = !0), this.yaw = Number(c) || 0, this.pitch = Number(l) || 0, this.roll = Number(h) || 0, (I(c) || I(l) || I(h)) && (this.hasAngle = !0);
472
472
  }
473
473
  /**
474
474
  * 计算两点之间的三维距离
@@ -521,7 +521,7 @@ class f {
521
521
  * @returns 夹角角度 (0-180度)
522
522
  */
523
523
  static angleXZ(t, e, i) {
524
- const n = { x: t.x - e.x, z: t.z - e.z }, o = { x: i.x - e.x, z: i.z - e.z }, r = n.x * o.x + n.z * o.z, a = Math.sqrt(n.x ** 2 + n.z ** 2), h = Math.sqrt(o.x ** 2 + o.z ** 2), l = Math.max(-1, Math.min(1, r / (a * h))), u = Math.acos(l) * 180 / Math.PI;
524
+ const n = { x: t.x - e.x, z: t.z - e.z }, o = { x: i.x - e.x, z: i.z - e.z }, r = n.x * o.x + n.z * o.z, a = Math.sqrt(n.x ** 2 + n.z ** 2), c = Math.sqrt(o.x ** 2 + o.z ** 2), l = Math.max(-1, Math.min(1, r / (a * c))), u = Math.acos(l) * 180 / Math.PI;
525
525
  return Math.min(u, 360 - u);
526
526
  }
527
527
  /**
@@ -555,26 +555,26 @@ class f {
555
555
  try {
556
556
  if (e?.id === i?.id)
557
557
  return new f(this);
558
- if (e?.modelType === E.SkyMapModel) {
558
+ if (e?.modelType === b.GeoModel) {
559
559
  const { refPoint: n } = e?.relativeMap || {};
560
560
  if (this?.hasXYZ)
561
561
  return this.project(t);
562
562
  if (this.hasGeo && n) {
563
- const o = D.LLHToXYZ(this, n);
563
+ const o = N.LLHToXYZ(this, n);
564
564
  return this.x = o.x, this.y = o.y, this.z = o.z, this.hasXYZ = !0, this.project(t);
565
565
  }
566
- throw new y(w.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
566
+ throw new w(p.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
567
567
  }
568
- if (i?.modelType === E.SkyMapModel) {
568
+ if (i?.modelType === b.GeoModel) {
569
569
  const { refPoint: n } = i?.relativeMap || {};
570
570
  if (this?.hasGeo)
571
571
  return new f(this);
572
572
  const o = this.project(t);
573
573
  if (o?.hasXYZ && n) {
574
- const r = D.XYZToLLH(o, n);
574
+ const r = N.XYZToLLH(o, n);
575
575
  return o.lat = r.lat, o.lon = r.lon, o.alt = r.alt, o.hasGeo = !0, o;
576
576
  }
577
- throw new y(w.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
577
+ throw new w(p.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
578
578
  }
579
579
  return this.project(t);
580
580
  } catch (n) {
@@ -590,12 +590,12 @@ class f {
590
590
  */
591
591
  project(t) {
592
592
  if (!this.hasXYZ)
593
- throw new y(w.PointNoXYZ, "点没有xxz坐标信息");
593
+ throw new w(p.PointNoXYZ, "点没有xxz坐标信息");
594
594
  if (this.plane === "xz")
595
595
  return this.projectXZ(t);
596
596
  if (this.plane === "xy")
597
597
  return this.projectXY(t);
598
- throw new y(w.PointNoPlane, "点的plane应为xz或xy");
598
+ throw new w(p.PointNoPlane, "点的plane应为xz或xy");
599
599
  }
600
600
  /**
601
601
  * XZ平面投影转换
@@ -620,7 +620,7 @@ class f {
620
620
  return e.x = i + t.x, e.y = n + t.y, e.z += t.z, e;
621
621
  }
622
622
  }
623
- class D {
623
+ class N {
624
624
  lat = 0;
625
625
  /** 经度 */
626
626
  lon = 0;
@@ -629,45 +629,45 @@ class D {
629
629
  /** 高度 */
630
630
  constructor(t) {
631
631
  const { lat: e = 0, lon: i = 0, alt: n = 0 } = t || {};
632
- this.lat = e, this.lon = i, this.alt = n;
632
+ this.lat = Number(e) || 0, this.lon = Number(i) || 0, this.alt = Number(n) || 0;
633
633
  }
634
634
  static XYZToLLH(t, e) {
635
635
  const n = 0.0033528106647474805, o = n * (2 - n), r = f.toRadians(e.lat), a = 6378137 / Math.sqrt(1 - o * Math.sin(r) ** 2) + e.alt;
636
- let h, l, c;
636
+ let c, l, h;
637
637
  if (t.plane === "xz") {
638
638
  const u = t.x / 1e3 / (a * Math.cos(r)), d = t.z / 1e3 / a;
639
- h = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), c = e.alt + t.y / 1e3;
639
+ c = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), h = e.alt + t.y / 1e3;
640
640
  } else if (t.plane === "xy") {
641
641
  const u = t.x / 1e3 / (a * Math.cos(r)), d = t.y / 1e3 / a;
642
- h = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), c = e.alt + t.z / 1e3;
642
+ c = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), h = e.alt + t.z / 1e3;
643
643
  } else
644
- throw new y(w.GeoPointNoPlane, "点的plane应为xz或xy");
645
- return new D({
644
+ throw new w(p.GeoPointNoPlane, "点的plane应为xz或xy");
645
+ return new N({
646
646
  lat: l,
647
- lon: h,
648
- alt: c
647
+ lon: c,
648
+ alt: h
649
649
  });
650
650
  }
651
651
  static LLHToXYZ(t, e) {
652
- const n = 0.0033528106647474805, o = n * (2 - n), r = f.toRadians(e.lat), a = 6378137 / Math.sqrt(1 - o * Math.sin(r) ** 2) + e.alt, h = f.toRadians(t.lon - e.lon), l = f.toRadians(e.lat - t.lat), c = a * h * Math.cos(r), u = a * l;
652
+ const n = 0.0033528106647474805, o = n * (2 - n), r = f.toRadians(e.lat), a = 6378137 / Math.sqrt(1 - o * Math.sin(r) ** 2) + e.alt, c = f.toRadians(t.lon - e.lon), l = f.toRadians(e.lat - t.lat), h = a * c * Math.cos(r), u = a * l;
653
653
  if (t.plane === "xz")
654
654
  return new f({
655
- x: c * 1e3,
655
+ x: h * 1e3,
656
656
  y: (t.alt - e.alt) * 1e3,
657
657
  z: u * 1e3,
658
658
  plane: "xz"
659
659
  });
660
660
  if (t.plane === "xy")
661
661
  return new f({
662
- x: c * 1e3,
662
+ x: h * 1e3,
663
663
  y: u * 1e3,
664
664
  z: (t.alt - e.alt) * 1e3,
665
665
  plane: "xy"
666
666
  });
667
- throw new y(w.GeoPointNoPlane, "点的plane应为xz或xy");
667
+ throw new w(p.GeoPointNoPlane, "点的plane应为xz或xy");
668
668
  }
669
669
  }
670
- class p {
670
+ class y {
671
671
  scale = 1;
672
672
  yaw = 0;
673
673
  x = 0;
@@ -680,7 +680,7 @@ class p {
680
680
  /** 参考点 */
681
681
  constructor(t) {
682
682
  const { refPoint: e, ...i } = t || {};
683
- e && (this.refPoint = new D(e)), Object.assign(this, i);
683
+ e && (this.refPoint = new N(e)), Object.assign(this, i);
684
684
  }
685
685
  /**
686
686
  * 合并两个相对坐标系的映射关系
@@ -690,22 +690,22 @@ class p {
690
690
  */
691
691
  static addRelativeMap(t, e) {
692
692
  if (t.plane !== e.plane)
693
- throw new y(w.RelativePlaneUnmatch, "两个映射关系的plane应该相同");
693
+ throw new w(p.RelativePlaneUnmatch, "两个映射关系的plane应该相同");
694
694
  const i = t.scale * e.scale, n = t.yaw + e.yaw, o = Math.cos(e.yaw), r = Math.sin(e.yaw);
695
- let a = 0, h = 0, l = 0;
695
+ let a = 0, c = 0, l = 0;
696
696
  if (t.plane === "xz") {
697
- const c = t.x * o - t.z * r, u = t.y, d = t.x * r + t.z * o;
698
- a = e.x + c * e.scale, h = e.y + u * e.scale, l = e.z + d * e.scale;
697
+ const h = t.x * o - t.z * r, u = t.y, d = t.x * r + t.z * o;
698
+ a = e.x + h * e.scale, c = e.y + u * e.scale, l = e.z + d * e.scale;
699
699
  } else if (t.plane === "xy") {
700
- const c = t.x * o - t.y * r, u = t.x * r + t.y * o, d = t.z;
701
- a = e.x + c * e.scale, h = e.y + u * e.scale, l = e.z + d * e.scale;
700
+ const h = t.x * o - t.y * r, u = t.x * r + t.y * o, d = t.z;
701
+ a = e.x + h * e.scale, c = e.y + u * e.scale, l = e.z + d * e.scale;
702
702
  } else
703
- throw new y(w.RelativeNoPlane, "映射关系的plane应为xz或xy");
704
- return new p({
703
+ throw new w(p.RelativeNoPlane, "映射关系的plane应为xz或xy");
704
+ return new y({
705
705
  scale: i,
706
706
  yaw: n,
707
707
  x: a,
708
- y: h,
708
+ y: c,
709
709
  z: l,
710
710
  start: t.start,
711
711
  end: t.end,
@@ -719,19 +719,19 @@ class p {
719
719
  */
720
720
  static inverseRelativeMap(t) {
721
721
  const e = 1 / t.scale, i = -t.yaw, n = Math.cos(-i), o = Math.sin(-i);
722
- let r = 0, a = 0, h = 0;
722
+ let r = 0, a = 0, c = 0;
723
723
  if (t.plane === "xz")
724
- r = -(t.x * n + t.z * o) * e, a = -t.y * e, h = -(t.z * n - t.x * o) * e;
724
+ r = -(t.x * n + t.z * o) * e, a = -t.y * e, c = -(t.z * n - t.x * o) * e;
725
725
  else if (t.plane === "xy")
726
- r = -(t.x * n + t.y * o) * e, a = -(t.y * n - t.x * o) * e, h = -t.z * e;
726
+ r = -(t.x * n + t.y * o) * e, a = -(t.y * n - t.x * o) * e, c = -t.z * e;
727
727
  else
728
- throw new y(w.RelativeNoPlane, "映射关系的plane应为xz或xy");
729
- return new p({
728
+ throw new w(p.RelativeNoPlane, "映射关系的plane应为xz或xy");
729
+ return new y({
730
730
  scale: e,
731
731
  yaw: i,
732
732
  x: r,
733
733
  y: a,
734
- z: h,
734
+ z: c,
735
735
  start: t.start,
736
736
  end: t.end,
737
737
  plane: t.plane
@@ -741,9 +741,9 @@ class p {
741
741
  try {
742
742
  let e = t ? JSON.parse(t) : void 0;
743
743
  const { reference_point: i } = e || {};
744
- return i && (e = { refPoint: i }), e ? new p(e) : void 0;
744
+ return i && (e = { refPoint: i }), e ? new y(e) : void 0;
745
745
  } catch {
746
- throw new y(w.RelativeJsonError, "relativeMap格式化失败");
746
+ throw new w(p.RelativeJsonError, "relativeMap格式化失败");
747
747
  }
748
748
  }
749
749
  static toStringify(t) {
@@ -757,7 +757,7 @@ class m {
757
757
  * @returns
758
758
  */
759
759
  static async getCoordinateTree(t) {
760
- const e = await G({ projectId: t });
760
+ const e = await B({ projectId: t });
761
761
  if (e.length) {
762
762
  const i = m.handleCoordinateList(e);
763
763
  return m.buildCoordinateTree(i, 0);
@@ -780,16 +780,16 @@ class m {
780
780
  */
781
781
  static async addCoordinate(t, e) {
782
782
  const { projectId: i, id: n } = t, o = e.map((a) => {
783
- const { type: h, modelType: l, relativeMap: c, level: u, ...d } = a, g = c ? JSON.stringify(c) : void 0;
783
+ const { type: c, modelType: l, relativeMap: h, level: u, ...d } = a, T = h ? JSON.stringify(h) : void 0;
784
784
  return {
785
785
  ...d,
786
786
  projectId: i,
787
787
  parentId: n,
788
- coordinateType: h,
788
+ coordinateType: c,
789
789
  renderType: l,
790
- relativePosition: g
790
+ relativePosition: T
791
791
  };
792
- }), r = await L(o);
792
+ }), r = await A(o);
793
793
  return m.handleCoordinateList(r);
794
794
  }
795
795
  /**
@@ -800,7 +800,7 @@ class m {
800
800
  */
801
801
  static async removeCoordinate(t, e) {
802
802
  const i = e.map((n) => n.id ?? -1);
803
- return await $(i);
803
+ return await _(i);
804
804
  }
805
805
  /**
806
806
  * 更新坐标系
@@ -810,9 +810,9 @@ class m {
810
810
  */
811
811
  static async updateCoordinate(t, e) {
812
812
  const { projectId: i, id: n } = t, o = e.map((a) => {
813
- const { type: h, relativeMap: l, level: c, ...u } = a, d = p.toStringify(l);
813
+ const { type: c, relativeMap: l, level: h, ...u } = a, d = y.toStringify(l);
814
814
  return { ...u, relativePosition: d, projectId: i, parentId: n };
815
- }), r = await L(o);
815
+ }), r = await A(o);
816
816
  return m.handleCoordinateList(r);
817
817
  }
818
818
  /**
@@ -823,9 +823,9 @@ class m {
823
823
  */
824
824
  static async bindCoordinate(t, e) {
825
825
  const { projectId: i, id: n } = t, o = e.map((a) => {
826
- const { modelId: h } = a;
827
- return { modelId: h, parentId: n, projectId: i };
828
- }), r = await B(o);
826
+ const { modelId: c } = a;
827
+ return { modelId: c, parentId: n, projectId: i };
828
+ }), r = await $(o);
829
829
  return m.handleCoordinateList(r);
830
830
  }
831
831
  /**
@@ -841,13 +841,13 @@ class m {
841
841
  renderType: o,
842
842
  relativePosition: r,
843
843
  ...a
844
- } = e, h = p.toParse(r);
845
- return new C({
844
+ } = e, c = o === b.GeoModel ? new y(y.toParse(r)) : y.toParse(r);
845
+ return new R({
846
846
  ...a,
847
847
  type: i,
848
848
  modelType: o,
849
849
  modelValue: n,
850
- relativeMap: h
850
+ relativeMap: c
851
851
  });
852
852
  });
853
853
  }
@@ -860,9 +860,9 @@ class m {
860
860
  const e = Array.isArray(t) ? t : [t], i = [];
861
861
  function n(o) {
862
862
  for (const r of o) {
863
- const { level: a, parent: h, relativeMap: l, ...c } = r, u = new C({
864
- ...c,
865
- relativeMap: new p(l)
863
+ const { level: a, parent: c, relativeMap: l, ...h } = r, u = new R({
864
+ ...h,
865
+ relativeMap: new y(l)
866
866
  });
867
867
  i.push(u), r.children && r.children.length > 0 && n(r.children);
868
868
  }
@@ -886,7 +886,7 @@ class m {
886
886
  r.level = 0, n.push(r);
887
887
  else {
888
888
  const a = i.get(String(o.parentId ?? -1));
889
- a && (r.type === v.Space && (r.level = (Number(a.level) || 0) + 1), r.parent = a, a.children?.push(r));
889
+ a && (r.type === M.Space && (r.level = (Number(a.level) || 0) + 1), r.parent = a, a.children?.push(r));
890
890
  }
891
891
  }), n.forEach(m.sortCoordinateTree), n[0];
892
892
  }
@@ -897,7 +897,7 @@ class m {
897
897
  */
898
898
  static sortCoordinateTree(t) {
899
899
  t.children && (t.children.sort((e, i) => {
900
- if (e.type === v.Space) {
900
+ if (e.type === M.Space) {
901
901
  const n = Number(i?.relativeMap?.z) - Number(e?.relativeMap?.z);
902
902
  return n !== 0 ? n : Number(i.createTime) - Number(e.createTime);
903
903
  } else
@@ -911,14 +911,14 @@ class m {
911
911
  static filterSpaceTree(t, e) {
912
912
  const i = [];
913
913
  return t.forEach((n) => {
914
- const o = new C(n);
914
+ const o = new R(n);
915
915
  e && (o.parent = e);
916
916
  const r = m.filterSpaceTree(o.children, o);
917
- o.children = r, o.disabled = o.disabled ?? !1, o.type !== v.Model && i.push(o);
917
+ o.children = r, o.disabled = o.disabled ?? !1, o.type !== M.Model && i.push(o);
918
918
  }), i;
919
919
  }
920
920
  }
921
- class C {
921
+ class R {
922
922
  id = 0;
923
923
  /** id */
924
924
  type = 0;
@@ -960,10 +960,10 @@ class C {
960
960
  this.setOptions(t);
961
961
  }
962
962
  get spaceList() {
963
- return this.children.filter((t) => t.type === v.Space);
963
+ return this.children.filter((t) => t.type === M.Space);
964
964
  }
965
965
  get modelList() {
966
- return this.children.filter((t) => t.type === v.Model);
966
+ return this.children.filter((t) => t.type === M.Model);
967
967
  }
968
968
  get fullName() {
969
969
  const t = this.name ? `(${this.name})` : "";
@@ -972,16 +972,16 @@ class C {
972
972
  /** 设置参数 */
973
973
  setOptions(t) {
974
974
  const { relativeMap: e, parent: i, children: n, ...o } = t || {};
975
- e && (this.relativeMap = new p(e)), i && (this.parent = i), n?.length && (this.children = n), Object.assign(this, o);
975
+ e && (this.relativeMap = new y(e)), i && (this.parent = i), n?.length && (this.children = n), Object.assign(this, o);
976
976
  }
977
977
  /** 添加子节点 */
978
978
  async addChild(t) {
979
- const e = x(t) ? t : [t], i = await m.addCoordinate(this, e);
979
+ const e = g(t) ? t : [t], i = await m.addCoordinate(this, e);
980
980
  return this.mergeChild(i), i;
981
981
  }
982
982
  /** 删除子节点 */
983
983
  async removeChild(t) {
984
- const e = x(t) ? t : [t];
984
+ const e = g(t) ? t : [t];
985
985
  await m.removeCoordinate(this, e);
986
986
  for (const i of e) {
987
987
  const n = this.children.findIndex((o) => o.id === i.id);
@@ -990,12 +990,12 @@ class C {
990
990
  }
991
991
  /** 更新子节点 */
992
992
  async updateChild(t) {
993
- const e = x(t) ? t : [t], i = await m.updateCoordinate(this, e);
993
+ const e = g(t) ? t : [t], i = await m.updateCoordinate(this, e);
994
994
  return this.mergeChild(i), i;
995
995
  }
996
996
  /** 绑定子节点,不建立映射关系 */
997
997
  async bindChild(t) {
998
- const e = x(t) ? t : [t], i = await m.bindCoordinate(this, e);
998
+ const e = g(t) ? t : [t], i = await m.bindCoordinate(this, e);
999
999
  return this.mergeChild(i), i;
1000
1000
  }
1001
1001
  /** 合并子节点,没有查询到节点就插入 */
@@ -1003,26 +1003,26 @@ class C {
1003
1003
  t?.length && t.forEach((e) => {
1004
1004
  const i = this.children.find((n) => n.id === e.id);
1005
1005
  if (i) {
1006
- const { relativeMap: n, no: o, name: r, shortName: a, status: h, modelId: l, modelValue: c } = e;
1006
+ const { relativeMap: n, no: o, name: r, shortName: a, status: c, modelId: l, modelValue: h } = e;
1007
1007
  Object.assign(i, {
1008
1008
  relativeMap: n,
1009
1009
  no: o,
1010
1010
  name: r,
1011
1011
  shortName: a,
1012
- status: h,
1012
+ status: c,
1013
1013
  modelId: l,
1014
- modelValue: c
1014
+ modelValue: h
1015
1015
  });
1016
1016
  } else this.id === e.parentId && (e.parent = this, this.children.unshift(e));
1017
1017
  });
1018
1018
  }
1019
1019
  /** 映射到(模型映射到空间,空间映射到空间) */
1020
1020
  async mappingTo(t) {
1021
- await _(t);
1021
+ await Z(t);
1022
1022
  }
1023
1023
  /** 来自映射(被映射过的源坐标系关系) */
1024
- async fromMapping() {
1025
- const t = await Z({ srcCsId: this.id });
1024
+ async getMapping() {
1025
+ const t = await q({ srcCsId: this.id });
1026
1026
  return t[t.length - 1];
1027
1027
  }
1028
1028
  /**
@@ -1037,13 +1037,13 @@ class C {
1037
1037
  }
1038
1038
  /**
1039
1039
  *寻找到符合要求的子节点模型坐标系
1040
- * @param type 模型类型 默认包含CADModel,SkyMapModel
1040
+ * @param type 允许的模型类型
1041
1041
  * @param mapped 是否被映射
1042
1042
  * @returns
1043
1043
  */
1044
- findChildModel(t = [E.CADModel, E.SkyMapModel], e = !0) {
1045
- const i = x(t) ? t : [t];
1046
- return i.includes(this.modelType ?? -1) && this.status !== R.Disabled ? this : ([v.Data, v.Model].includes(this.type) ? this.findParentSpace() : this)?.modelList?.filter((a) => i.includes(a.modelType ?? -1) ? e ? !!a.relativeMap : !0 : !1)?.sort((a, h) => Number(a.status) - Number(h.status))?.[0];
1044
+ findChildModel(t, e = !0) {
1045
+ const i = g(t) ? t : [t];
1046
+ return i.includes(this.modelType ?? -1) && this.status !== O.Disabled ? this : ([M.Data, M.Model].includes(this.type) ? this.findParentSpace() : this)?.modelList?.filter((a) => i.includes(a.modelType ?? -1) ? e ? !!a.relativeMap : !0 : !1)?.sort((a, c) => Number(a.status) - Number(c.status))?.[0];
1047
1047
  }
1048
1048
  /**
1049
1049
  * 寻找与当前节点最近的一个模型节点,从当前节点遍历到根节点-广度优先遍历
@@ -1051,36 +1051,39 @@ class C {
1051
1051
  * @param excludeNodes 排除的坐标系
1052
1052
  * @returns
1053
1053
  */
1054
- findClosestModel(t = E.CADModel, e) {
1055
- const i = /* @__PURE__ */ new Set();
1056
- for (const l of e ?? [])
1057
- i.add(String(l.id));
1058
- const n = [{ node: this, distance: 0 }], o = x(t) ? t : [t], r = /* @__PURE__ */ new Set();
1059
- let a, h = 1 / 0;
1060
- for (; n.length > 0; ) {
1061
- const l = n.shift();
1062
- if (!l) break;
1063
- const { node: c, distance: u } = l;
1064
- if (i.has(String(c.id)))
1065
- continue;
1066
- if (o.includes(c.modelType ?? -1)) {
1067
- if (u < h && (a = c, h = u, u <= 1))
1068
- break;
1054
+ findClosestModel(t = [
1055
+ b.CADModel,
1056
+ b.BIMModel,
1057
+ b.ForgeModel,
1058
+ b.ThreeDModel,
1059
+ b.GeoModel
1060
+ ], e) {
1061
+ const i = g(t) ? t : [t], n = /* @__PURE__ */ new Set();
1062
+ e?.forEach((h) => {
1063
+ n.add(String(h.id));
1064
+ });
1065
+ const o = [{ node: this, distance: 0 }], r = /* @__PURE__ */ new Set(), a = [];
1066
+ for (; o.length > 0; ) {
1067
+ const { node: h, distance: u } = o.shift();
1068
+ if (n.has(String(h.id)) || r.has(h))
1069
1069
  continue;
1070
- }
1071
- r.add(c);
1072
- const d = [];
1073
- if (c.children)
1074
- for (const g of c.children)
1075
- r.has(g) || d.push(g);
1076
- if (c.parent?.children)
1077
- for (const g of c.parent.children)
1078
- g !== c && !r.has(g) && d.push(g);
1079
- c.parent && !r.has(c.parent) && d.push(c.parent);
1080
- for (const g of d)
1081
- n.push({ node: g, distance: u + 1 });
1070
+ const d = h.modelType ?? -1;
1071
+ i.includes(d) && a.push({ node: h, distance: u, modelType: d }), r.add(h);
1072
+ const T = [];
1073
+ if (h.children)
1074
+ for (const v of h.children)
1075
+ r.has(v) || T.push(v);
1076
+ if (h.parent?.children)
1077
+ for (const v of h.parent.children)
1078
+ v !== h && !r.has(v) && T.push(v);
1079
+ h.parent && !r.has(h.parent) && T.push(h.parent);
1080
+ for (const v of T)
1081
+ o.push({ node: v, distance: u + 1 });
1082
1082
  }
1083
- return a;
1083
+ if (a.length === 0)
1084
+ return;
1085
+ const c = Math.min(...a.map((h) => h.distance)), l = a.filter((h) => h.distance === c);
1086
+ return l.sort((h, u) => h.modelType - u.modelType), l[0]?.node;
1084
1087
  }
1085
1088
  /**
1086
1089
  *向上寻找到子节点的空间坐标系
@@ -1088,7 +1091,7 @@ class C {
1088
1091
  */
1089
1092
  findParentSpace() {
1090
1093
  let t = this;
1091
- for (; t && t.type !== v.Space; )
1094
+ for (; t && t.type !== M.Space; )
1092
1095
  t = t.parent;
1093
1096
  return t;
1094
1097
  }
@@ -1101,13 +1104,13 @@ class C {
1101
1104
  const e = [];
1102
1105
  let i = this;
1103
1106
  for (; i && t > 0; )
1104
- i.type === v.Space && (e.unshift(i.fullName), t--), i = i.parent;
1107
+ i.type === M.Space && (e.unshift(i.fullName), t--), i = i.parent;
1105
1108
  return e;
1106
1109
  }
1107
1110
  /** 寻找坐标系组, 有groupUuid表示坐标系组 */
1108
1111
  findCsGroup() {
1109
1112
  const { groupUuid: t, parent: e } = this;
1110
- return t ? e?.children?.filter((i) => i.groupUuid === t) || [] : [this];
1113
+ return t ? e?.children?.filter((i) => i.groupUuid === t) || [] : [];
1111
1114
  }
1112
1115
  /**
1113
1116
  * 递归寻找到相应的层级
@@ -1156,9 +1159,9 @@ class C {
1156
1159
  */
1157
1160
  getMappedCsTree() {
1158
1161
  function t(n) {
1159
- return n.children?.length && (n.children = n.children.filter((o) => !!o?.relativeMap && o.status !== R.Disabled).map((o) => t(o))), n;
1162
+ return n.children?.length && (n.children = n.children.filter((o) => !!o?.relativeMap && o.status !== O.Disabled).map((o) => t(o))), n;
1160
1163
  }
1161
- const e = V(this.findRoot(!0)), i = t(e);
1164
+ const e = W(this.findRoot(!0)), i = t(e);
1162
1165
  return i.parentId = 0, i.parent = void 0, i;
1163
1166
  }
1164
1167
  /**
@@ -1168,13 +1171,13 @@ class C {
1168
1171
  */
1169
1172
  getDestRelativeMap(t) {
1170
1173
  if (this.id === t.id)
1171
- return new p();
1174
+ return new y();
1172
1175
  const e = this.getRelativeMaps(), i = t.getRelativeMaps();
1173
- let n = new p();
1176
+ let n = new y();
1174
1177
  return e?.forEach((o) => {
1175
- n = p.addRelativeMap(n, o);
1178
+ n = y.addRelativeMap(n, o);
1176
1179
  }), i?.reverse()?.forEach((o) => {
1177
- n = p.addRelativeMap(n, p.inverseRelativeMap(o));
1180
+ n = y.addRelativeMap(n, y.inverseRelativeMap(o));
1178
1181
  }), n;
1179
1182
  }
1180
1183
  /**
@@ -1208,7 +1211,7 @@ class C {
1208
1211
  */
1209
1212
  static getCommonCoordinate(t) {
1210
1213
  let e;
1211
- const i = t.map((n) => n.getCsRoutes(!0).filter((r) => r.id && r.type === v.Space));
1214
+ const i = t.map((n) => n.getCsRoutes(!0).filter((r) => r.id && r.type === M.Space));
1212
1215
  for (; this.checkSameCoordinate(i); ) {
1213
1216
  const o = i.shift();
1214
1217
  o?.length && (e = o[0]);
@@ -1236,7 +1239,7 @@ class C {
1236
1239
  } else return !1;
1237
1240
  }
1238
1241
  }
1239
- class K {
1242
+ class tt {
1240
1243
  yaw = 0;
1241
1244
  /** 偏航角 */
1242
1245
  pitch = 0;
@@ -1250,14 +1253,14 @@ class K {
1250
1253
  static toParse(t) {
1251
1254
  if (t) {
1252
1255
  const e = t?.split(",").map((i) => Number(i) || 0);
1253
- return new K({ yaw: e[0], pitch: e[1], roll: e[2] });
1256
+ return new tt({ yaw: e[0], pitch: e[1], roll: e[2] });
1254
1257
  }
1255
1258
  }
1256
1259
  static toStringify(t) {
1257
1260
  return t ? `${t.yaw},${t.pitch},${t.roll}` : "";
1258
1261
  }
1259
1262
  }
1260
- class tt {
1263
+ class et {
1261
1264
  x = 0;
1262
1265
  /** x轴 */
1263
1266
  y = 0;
@@ -1271,14 +1274,14 @@ class tt {
1271
1274
  static toParse(t) {
1272
1275
  if (t) {
1273
1276
  const e = t?.split(",").map((i) => Number(i) || 0);
1274
- return new tt({ x: e[0], y: e[1], z: e[2] });
1277
+ return new et({ x: e[0], y: e[1], z: e[2] });
1275
1278
  }
1276
1279
  }
1277
1280
  static toStringify(t) {
1278
1281
  return t ? `${t.x},${t.y},${t.z}` : "";
1279
1282
  }
1280
1283
  }
1281
- class At {
1284
+ class kt {
1282
1285
  /**
1283
1286
  * 将源坐标系中的点转换到目标坐标系中
1284
1287
  * @param points 需要转换的点数组
@@ -1297,7 +1300,7 @@ class At {
1297
1300
  }), o;
1298
1301
  }
1299
1302
  }
1300
- class jt {
1303
+ class Xt {
1301
1304
  canvas;
1302
1305
  ctx;
1303
1306
  options;
@@ -1349,11 +1352,11 @@ class jt {
1349
1352
  isBindEvent: o = !0,
1350
1353
  isDrawAssist: r = !1,
1351
1354
  isMoveRedrawing: a,
1352
- customDrawAssist: h,
1355
+ customDrawAssist: c,
1353
1356
  afterDraw: l,
1354
- ...c
1357
+ ...h
1355
1358
  } = t;
1356
- this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.width = i, this.height = n, this.canvas.width = i, this.canvas.height = n, this.isBindEvent = o, this.isDrawAssist = r, this.customDrawAssist = h, this.isMoveRedrawing = a ?? r, this.options = c, this.onMousedown = this.onMousedown.bind(this), this.onMousemove = this.onMousemove.bind(this), this.onMousemoveTemp = this.onMousemoveTemp.bind(this), this.onMouseup = this.onMouseup.bind(this), this.onMousewheel = this.onMousewheel.bind(this), this.onDblclick = this.onDblclick.bind(this), this.onTouchstart = this.onTouchstart.bind(this), this.onTouchmove = this.onTouchmove.bind(this), this.onTouchend = this.onTouchend.bind(this), this.onMouseout = this.onMouseout.bind(this), this.afterDraw = this.afterDraw, o && (this.canvas.addEventListener("DOMMouseScroll", this.onMousewheel), this.canvas.addEventListener("mousewheel", this.onMousewheel), this.canvas.addEventListener("mousedown", this.onMousedown), this.canvas.addEventListener("mousemove", this.onMousemove), this.canvas.addEventListener("mouseout", this.onMouseout), this.canvas.addEventListener("dblclick", this.onDblclick), this.canvas.addEventListener("touchstart", this.onTouchstart));
1359
+ this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.width = i, this.height = n, this.canvas.width = i, this.canvas.height = n, this.isBindEvent = o, this.isDrawAssist = r, this.customDrawAssist = c, this.isMoveRedrawing = a ?? r, this.options = h, this.onMousedown = this.onMousedown.bind(this), this.onMousemove = this.onMousemove.bind(this), this.onMousemoveTemp = this.onMousemoveTemp.bind(this), this.onMouseup = this.onMouseup.bind(this), this.onMousewheel = this.onMousewheel.bind(this), this.onDblclick = this.onDblclick.bind(this), this.onTouchstart = this.onTouchstart.bind(this), this.onTouchmove = this.onTouchmove.bind(this), this.onTouchend = this.onTouchend.bind(this), this.onMouseout = this.onMouseout.bind(this), this.afterDraw = this.afterDraw, o && (this.canvas.addEventListener("DOMMouseScroll", this.onMousewheel), this.canvas.addEventListener("mousewheel", this.onMousewheel), this.canvas.addEventListener("mousedown", this.onMousedown), this.canvas.addEventListener("mousemove", this.onMousemove), this.canvas.addEventListener("mouseout", this.onMouseout), this.canvas.addEventListener("dblclick", this.onDblclick), this.canvas.addEventListener("touchstart", this.onTouchstart));
1357
1360
  }
1358
1361
  onClick(t) {
1359
1362
  const { screenX: e, screenY: i } = t;
@@ -1482,8 +1485,8 @@ class jt {
1482
1485
  this.isBindEvent && (this.canvas.removeEventListener("mousemove", this.onMousemove), this.canvas.removeEventListener("DOMMouseScroll", this.onMousewheel), this.canvas.removeEventListener("mousewheel", this.onMousewheel), this.canvas.removeEventListener("mousedown", this.onMousedown), this.canvas.removeEventListener("mouseout", this.onMouseout), this.canvas.removeEventListener("dblclick", this.onDblclick));
1483
1486
  }
1484
1487
  }
1485
- const j = {};
1486
- class Xt {
1488
+ const X = {};
1489
+ class Ft {
1487
1490
  type = "image";
1488
1491
  // 修改为更通用的名称
1489
1492
  x;
@@ -1497,7 +1500,7 @@ class Xt {
1497
1500
  this.x = t.x || 0, this.y = t.y || 0, this.width = t.width || 0, this.height = t.height || 0, this.src = t.src, this.redraw = t.redraw, this.img = this.loadImage(t.onload);
1498
1501
  }
1499
1502
  loadImage(t) {
1500
- const e = j[this.src];
1503
+ const e = X[this.src];
1501
1504
  if (e)
1502
1505
  return queueMicrotask(() => {
1503
1506
  t?.(e), this.redraw?.();
@@ -1505,7 +1508,7 @@ class Xt {
1505
1508
  {
1506
1509
  const i = new Image();
1507
1510
  return i.crossOrigin = "anonymous", i.src = this.src, i.onload = () => {
1508
- j[this.src] = i, t?.(i), this.redraw?.();
1511
+ X[this.src] = i, t?.(i), this.redraw?.();
1509
1512
  }, i;
1510
1513
  }
1511
1514
  }
@@ -1518,7 +1521,7 @@ class Xt {
1518
1521
  }
1519
1522
  }
1520
1523
  }
1521
- class Ft {
1524
+ class Ut {
1522
1525
  id = "";
1523
1526
  type = "point";
1524
1527
  x;
@@ -1538,8 +1541,8 @@ class Ft {
1538
1541
  t.beginPath(), t.arc(this.x, this.y, this.r * i, 0, 2 * Math.PI), t.fillStyle = this.backgroundColor, t.fill(), t.font = `${this.r * i}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.text, this.x, this.y + this.r * i / 3), t.restore();
1539
1542
  }
1540
1543
  }
1541
- const X = {};
1542
- class Ut {
1544
+ const F = {};
1545
+ class Yt {
1543
1546
  id = "";
1544
1547
  type = "issue";
1545
1548
  //轨迹点上的事件
@@ -1559,7 +1562,7 @@ class Ut {
1559
1562
  this.id = t.id, this.x = t.x, this.y = t.y, this.width = t.width || 0, this.height = t.height || 0, this.index = t.index, this.pIndex = t.pIndex, this.parentId = t.parentId, this.count = t.count || 0, this.badgeR = 3, this.src = t.src, this.redraw = t.redraw, this.img = this.loadImage(t.onload);
1560
1563
  }
1561
1564
  loadImage(t) {
1562
- const e = X[this.src];
1565
+ const e = F[this.src];
1563
1566
  if (e)
1564
1567
  return queueMicrotask(() => {
1565
1568
  t?.(e), this.redraw?.();
@@ -1567,18 +1570,18 @@ class Ut {
1567
1570
  {
1568
1571
  const i = new Image();
1569
1572
  return i.src = this.src, i.crossOrigin = "anonymous", i.onload = () => {
1570
- X[this.src] = i, t?.(i), this.redraw?.();
1573
+ F[this.src] = i, t?.(i), this.redraw?.();
1571
1574
  }, i;
1572
1575
  }
1573
1576
  }
1574
1577
  draw(t, e) {
1575
1578
  if (!this.img.complete) return;
1576
- const i = 1 / e.scale, n = this.width * i, o = this.height * i, r = this.x - n / 2, a = this.y - o, h = this.badgeR * i, l = h * 1.5;
1577
- t.save(), t.drawImage(this.img, r, a, n, o), t.beginPath(), this.count > 1 && (t.arc(this.x + n * 0.3, this.y - o * 0.8, h, 0, 2 * Math.PI), t.fillStyle = "red", t.fill(), t.font = `${l}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.count.toString(), this.x + n * 0.3, this.y - o * 0.8 + h / 2)), t.restore();
1579
+ const i = 1 / e.scale, n = this.width * i, o = this.height * i, r = this.x - n / 2, a = this.y - o, c = this.badgeR * i, l = c * 1.5;
1580
+ t.save(), t.drawImage(this.img, r, a, n, o), t.beginPath(), this.count > 1 && (t.arc(this.x + n * 0.3, this.y - o * 0.8, c, 0, 2 * Math.PI), t.fillStyle = "red", t.fill(), t.font = `${l}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.count.toString(), this.x + n * 0.3, this.y - o * 0.8 + c / 2)), t.restore();
1578
1581
  }
1579
1582
  }
1580
- const F = {};
1581
- class Yt {
1583
+ const U = {};
1584
+ class Gt {
1582
1585
  type = "marker";
1583
1586
  x;
1584
1587
  y;
@@ -1594,7 +1597,7 @@ class Yt {
1594
1597
  this.x = t.x, this.y = t.y, this.url = t.url, this.width = t.width ?? 0, this.height = t.height ?? 0, this.anchor = t.anchor, this.scale = t.scale ?? 1, t.redraw && (this.redraw = t.redraw), t.beforeDraw && (this.beforeDraw = t.beforeDraw), this.img = this.loadImage(t.onload);
1595
1598
  }
1596
1599
  loadImage(t) {
1597
- const e = F[this.url];
1600
+ const e = U[this.url];
1598
1601
  if (e)
1599
1602
  return queueMicrotask(() => {
1600
1603
  t?.(e), this.redraw?.();
@@ -1602,7 +1605,7 @@ class Yt {
1602
1605
  {
1603
1606
  const i = new Image();
1604
1607
  return i.src = this.url, i.crossOrigin = "anonymous", i.onload = () => {
1605
- F[this.url] = i, t?.(i), this.redraw?.();
1608
+ U[this.url] = i, t?.(i), this.redraw?.();
1606
1609
  }, i;
1607
1610
  }
1608
1611
  }
@@ -1632,7 +1635,7 @@ class Yt {
1632
1635
  }
1633
1636
  }
1634
1637
  }
1635
- class Gt {
1638
+ class Bt {
1636
1639
  type = "radar";
1637
1640
  x;
1638
1641
  y;
@@ -1662,7 +1665,7 @@ class Gt {
1662
1665
  r.addColorStop(0, "rgba(180, 42, 42, 1)"), r.addColorStop(1, "rgba(180, 42, 42, 0.5)"), t.beginPath(), t.moveTo(this.x, this.y), t.arc(this.x, this.y, this.r * i, n, o), t.closePath(), t.fillStyle = r, t.fill(), t.restore();
1663
1666
  }
1664
1667
  }
1665
- class Bt {
1668
+ class $t {
1666
1669
  type = "region";
1667
1670
  x;
1668
1671
  y;
@@ -1683,8 +1686,8 @@ class Bt {
1683
1686
  }
1684
1687
  draw(t, e) {
1685
1688
  if (t.save(), t.beginPath(), t.globalAlpha = 0.3, t.fillStyle = this.backgroundColor, this.shape === "circle") {
1686
- const [{ x: i, y: n }, {}, { x: o, y: r }] = this.areaPoints, a = Math.abs(o - i) / 2, h = i + (o - i) / 2, l = n + (r - n) / 2;
1687
- t.arc(h, l, a, 0, 2 * Math.PI);
1689
+ const [{ x: i, y: n }, {}, { x: o, y: r }] = this.areaPoints, a = Math.abs(o - i) / 2, c = i + (o - i) / 2, l = n + (r - n) / 2;
1690
+ t.arc(c, l, a, 0, 2 * Math.PI);
1688
1691
  } else
1689
1692
  this.areaPoints.forEach((i, n) => {
1690
1693
  const { x: o, y: r } = i;
@@ -1694,33 +1697,35 @@ class Bt {
1694
1697
  }
1695
1698
  }
1696
1699
  export {
1697
- it as APP_SETTING,
1698
- y as AppError,
1699
- w as AppErrorCode,
1700
- st as AppObsType,
1701
- jt as CanvasElement,
1702
- Xt as CanvasImageElement,
1703
- Ut as CanvasIssueElement,
1704
- Yt as CanvasMarkerElement,
1705
- Ft as CanvasPointElement,
1706
- Gt as CanvasRadarElement,
1707
- Bt as CanvasRegionElement,
1708
- C as Coordinate,
1709
- et as CoordinateLevel,
1710
- E as CoordinateModelType,
1711
- R as CoordinateStatus,
1712
- v as CoordinateType,
1713
- At as DataHelper,
1700
+ nt as APP_SETTING,
1701
+ w as AppError,
1702
+ p as AppErrorCode,
1703
+ it as AppObsType,
1704
+ Xt as CanvasElement,
1705
+ Ft as CanvasImageElement,
1706
+ Yt as CanvasIssueElement,
1707
+ Gt as CanvasMarkerElement,
1708
+ Ut as CanvasPointElement,
1709
+ Bt as CanvasRadarElement,
1710
+ $t as CanvasRegionElement,
1711
+ R as Coordinate,
1712
+ st as CoordinateLevel,
1713
+ b as CoordinateModelType,
1714
+ O as CoordinateStatus,
1715
+ M as CoordinateType,
1716
+ kt as DataHelper,
1714
1717
  m as DataSource,
1715
- D as GeoPoint,
1718
+ N as GeoPoint,
1716
1719
  f as Point,
1717
- K as Position,
1718
- p as RelativeMap,
1719
- O as RequestContentType,
1720
- M as RequestMethod,
1721
- U as RequestResultCode,
1722
- tt as Vector3,
1723
- Lt as api,
1724
- Ot as http,
1725
- kt as utils
1720
+ tt as Position,
1721
+ rt as REQUEST_CONFIG,
1722
+ ot as REQUEST_OPTIONS,
1723
+ y as RelativeMap,
1724
+ L as RequestContentType,
1725
+ x as RequestMethod,
1726
+ Y as RequestResultCode,
1727
+ et as Vector3,
1728
+ At as api,
1729
+ Lt as http,
1730
+ jt as utils
1726
1731
  };