@planara/core 1.4.9 → 1.5.0
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/core/editor-renderer.d.ts +31 -2
- package/dist/core/editor-renderer.d.ts.map +1 -1
- package/dist/core/preview-renderer.d.ts +1 -0
- package/dist/core/preview-renderer.d.ts.map +1 -1
- package/dist/core/renderer.d.ts +2 -1
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/extensions/orbit-extension.d.ts +4 -1
- package/dist/extensions/orbit-extension.d.ts.map +1 -1
- package/dist/handlers/display/wireframe-handler.d.ts +37 -0
- package/dist/handlers/display/wireframe-handler.d.ts.map +1 -0
- package/dist/hub/app-hub.d.ts +8 -0
- package/dist/hub/app-hub.d.ts.map +1 -0
- package/dist/hub/editor-hub.d.ts +13 -0
- package/dist/hub/editor-hub.d.ts.map +1 -0
- package/dist/index.cjs.js +32 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1636 -71
- package/dist/index.full.d.ts +216 -0
- package/dist/index.public.d.ts +174 -0
- package/dist/index.umd.js +32 -4
- package/dist/interfaces/display-handler.d.ts +12 -0
- package/dist/interfaces/display-handler.d.ts.map +1 -0
- package/dist/interfaces/handler.d.ts +22 -0
- package/dist/interfaces/handler.d.ts.map +1 -0
- package/dist/interfaces/manager.d.ts +22 -0
- package/dist/interfaces/manager.d.ts.map +1 -0
- package/dist/interfaces/mesh-api.d.ts +38 -0
- package/dist/interfaces/mesh-api.d.ts.map +1 -0
- package/dist/interfaces/renderer-api.d.ts +14 -0
- package/dist/interfaces/renderer-api.d.ts.map +1 -0
- package/dist/ioc/container.d.ts +4 -0
- package/dist/ioc/container.d.ts.map +1 -0
- package/dist/loaders/obj-loader.d.ts +2 -1
- package/dist/loaders/obj-loader.d.ts.map +1 -1
- package/dist/managers/display-manager.d.ts +19 -0
- package/dist/managers/display-manager.d.ts.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/utils/program-settings.d.ts +4 -3
- package/dist/utils/program-settings.d.ts.map +1 -1
- package/dist/utils/renderer-api.d.ts +19 -0
- package/dist/utils/renderer-api.d.ts.map +1 -0
- package/package.json +16 -4
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,823 @@
|
|
|
1
|
-
import { Program as
|
|
2
|
-
|
|
1
|
+
import { Program as ht, Renderer as dt, Transform as pt, Camera as vt, Geometry as yt, Mesh as gt, Orbit as De, GridHelper as mt, AxesHelper as wt, Raycast as Mt, Vec2 as _t, Vec3 as bt, NormalProgram as Pt, WireMesh as Rt } from "ogl";
|
|
2
|
+
var Ie = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ce = {};
|
|
3
|
+
/*! *****************************************************************************
|
|
4
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
6
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
7
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
10
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
11
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
12
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
13
|
+
|
|
14
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
15
|
+
and limitations under the License.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
var Te;
|
|
18
|
+
function Ot() {
|
|
19
|
+
if (Te) return Ce;
|
|
20
|
+
Te = 1;
|
|
21
|
+
var t;
|
|
22
|
+
return (function(e) {
|
|
23
|
+
(function(r) {
|
|
24
|
+
var s = typeof globalThis == "object" ? globalThis : typeof Ie == "object" ? Ie : typeof self == "object" ? self : typeof this == "object" ? this : w(), a = o(e);
|
|
25
|
+
typeof s.Reflect < "u" && (a = o(s.Reflect, a)), r(a, s), typeof s.Reflect > "u" && (s.Reflect = e);
|
|
26
|
+
function o(v, b) {
|
|
27
|
+
return function(C, N) {
|
|
28
|
+
Object.defineProperty(v, C, { configurable: !0, writable: !0, value: N }), b && b(C, N);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function f() {
|
|
32
|
+
try {
|
|
33
|
+
return Function("return this;")();
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function m() {
|
|
38
|
+
try {
|
|
39
|
+
return (0, eval)("(function() { return this; })()");
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function w() {
|
|
44
|
+
return f() || m();
|
|
45
|
+
}
|
|
46
|
+
})(function(r, s) {
|
|
47
|
+
var a = Object.prototype.hasOwnProperty, o = typeof Symbol == "function", f = o && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", m = o && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", w = typeof Object.create == "function", v = { __proto__: [] } instanceof Array, b = !w && !v, C = {
|
|
48
|
+
// create an object in dictionary mode (a.k.a. "slow" mode in v8)
|
|
49
|
+
create: w ? function() {
|
|
50
|
+
return K(/* @__PURE__ */ Object.create(null));
|
|
51
|
+
} : v ? function() {
|
|
52
|
+
return K({ __proto__: null });
|
|
53
|
+
} : function() {
|
|
54
|
+
return K({});
|
|
55
|
+
},
|
|
56
|
+
has: b ? function(n, i) {
|
|
57
|
+
return a.call(n, i);
|
|
58
|
+
} : function(n, i) {
|
|
59
|
+
return i in n;
|
|
60
|
+
},
|
|
61
|
+
get: b ? function(n, i) {
|
|
62
|
+
return a.call(n, i) ? n[i] : void 0;
|
|
63
|
+
} : function(n, i) {
|
|
64
|
+
return n[i];
|
|
65
|
+
}
|
|
66
|
+
}, N = Object.getPrototypeOf(Function), H = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : ot(), Z = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : ut(), J = typeof WeakMap == "function" ? WeakMap : lt(), D = o ? Symbol.for("@reflect-metadata:registry") : void 0, V = it(), ce = st(V);
|
|
67
|
+
function Le(n, i, u, l) {
|
|
68
|
+
if (g(u)) {
|
|
69
|
+
if (!Me(n))
|
|
70
|
+
throw new TypeError();
|
|
71
|
+
if (!_e(i))
|
|
72
|
+
throw new TypeError();
|
|
73
|
+
return Ye(n, i);
|
|
74
|
+
} else {
|
|
75
|
+
if (!Me(n))
|
|
76
|
+
throw new TypeError();
|
|
77
|
+
if (!E(i))
|
|
78
|
+
throw new TypeError();
|
|
79
|
+
if (!E(l) && !g(l) && !k(l))
|
|
80
|
+
throw new TypeError();
|
|
81
|
+
return k(l) && (l = void 0), u = x(u), Qe(n, i, u, l);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
r("decorate", Le);
|
|
85
|
+
function Ve(n, i) {
|
|
86
|
+
function u(l, y) {
|
|
87
|
+
if (!E(l))
|
|
88
|
+
throw new TypeError();
|
|
89
|
+
if (!g(y) && !rt(y))
|
|
90
|
+
throw new TypeError();
|
|
91
|
+
ve(n, i, l, y);
|
|
92
|
+
}
|
|
93
|
+
return u;
|
|
94
|
+
}
|
|
95
|
+
r("metadata", Ve);
|
|
96
|
+
function We(n, i, u, l) {
|
|
97
|
+
if (!E(u))
|
|
98
|
+
throw new TypeError();
|
|
99
|
+
return g(l) || (l = x(l)), ve(n, i, u, l);
|
|
100
|
+
}
|
|
101
|
+
r("defineMetadata", We);
|
|
102
|
+
function ze(n, i, u) {
|
|
103
|
+
if (!E(i))
|
|
104
|
+
throw new TypeError();
|
|
105
|
+
return g(u) || (u = x(u)), he(n, i, u);
|
|
106
|
+
}
|
|
107
|
+
r("hasMetadata", ze);
|
|
108
|
+
function Ue(n, i, u) {
|
|
109
|
+
if (!E(i))
|
|
110
|
+
throw new TypeError();
|
|
111
|
+
return g(u) || (u = x(u)), Y(n, i, u);
|
|
112
|
+
}
|
|
113
|
+
r("hasOwnMetadata", Ue);
|
|
114
|
+
function $e(n, i, u) {
|
|
115
|
+
if (!E(i))
|
|
116
|
+
throw new TypeError();
|
|
117
|
+
return g(u) || (u = x(u)), de(n, i, u);
|
|
118
|
+
}
|
|
119
|
+
r("getMetadata", $e);
|
|
120
|
+
function qe(n, i, u) {
|
|
121
|
+
if (!E(i))
|
|
122
|
+
throw new TypeError();
|
|
123
|
+
return g(u) || (u = x(u)), pe(n, i, u);
|
|
124
|
+
}
|
|
125
|
+
r("getOwnMetadata", qe);
|
|
126
|
+
function Be(n, i) {
|
|
127
|
+
if (!E(n))
|
|
128
|
+
throw new TypeError();
|
|
129
|
+
return g(i) || (i = x(i)), ye(n, i);
|
|
130
|
+
}
|
|
131
|
+
r("getMetadataKeys", Be);
|
|
132
|
+
function Ze(n, i) {
|
|
133
|
+
if (!E(n))
|
|
134
|
+
throw new TypeError();
|
|
135
|
+
return g(i) || (i = x(i)), ge(n, i);
|
|
136
|
+
}
|
|
137
|
+
r("getOwnMetadataKeys", Ze);
|
|
138
|
+
function Je(n, i, u) {
|
|
139
|
+
if (!E(i))
|
|
140
|
+
throw new TypeError();
|
|
141
|
+
if (g(u) || (u = x(u)), !E(i))
|
|
142
|
+
throw new TypeError();
|
|
143
|
+
g(u) || (u = x(u));
|
|
144
|
+
var l = F(
|
|
145
|
+
i,
|
|
146
|
+
u,
|
|
147
|
+
/*Create*/
|
|
148
|
+
!1
|
|
149
|
+
);
|
|
150
|
+
return g(l) ? !1 : l.OrdinaryDeleteMetadata(n, i, u);
|
|
151
|
+
}
|
|
152
|
+
r("deleteMetadata", Je);
|
|
153
|
+
function Ye(n, i) {
|
|
154
|
+
for (var u = n.length - 1; u >= 0; --u) {
|
|
155
|
+
var l = n[u], y = l(i);
|
|
156
|
+
if (!g(y) && !k(y)) {
|
|
157
|
+
if (!_e(y))
|
|
158
|
+
throw new TypeError();
|
|
159
|
+
i = y;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return i;
|
|
163
|
+
}
|
|
164
|
+
function Qe(n, i, u, l) {
|
|
165
|
+
for (var y = n.length - 1; y >= 0; --y) {
|
|
166
|
+
var R = n[y], S = R(i, u, l);
|
|
167
|
+
if (!g(S) && !k(S)) {
|
|
168
|
+
if (!E(S))
|
|
169
|
+
throw new TypeError();
|
|
170
|
+
l = S;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return l;
|
|
174
|
+
}
|
|
175
|
+
function he(n, i, u) {
|
|
176
|
+
var l = Y(n, i, u);
|
|
177
|
+
if (l)
|
|
178
|
+
return !0;
|
|
179
|
+
var y = X(i);
|
|
180
|
+
return k(y) ? !1 : he(n, y, u);
|
|
181
|
+
}
|
|
182
|
+
function Y(n, i, u) {
|
|
183
|
+
var l = F(
|
|
184
|
+
i,
|
|
185
|
+
u,
|
|
186
|
+
/*Create*/
|
|
187
|
+
!1
|
|
188
|
+
);
|
|
189
|
+
return g(l) ? !1 : we(l.OrdinaryHasOwnMetadata(n, i, u));
|
|
190
|
+
}
|
|
191
|
+
function de(n, i, u) {
|
|
192
|
+
var l = Y(n, i, u);
|
|
193
|
+
if (l)
|
|
194
|
+
return pe(n, i, u);
|
|
195
|
+
var y = X(i);
|
|
196
|
+
if (!k(y))
|
|
197
|
+
return de(n, y, u);
|
|
198
|
+
}
|
|
199
|
+
function pe(n, i, u) {
|
|
200
|
+
var l = F(
|
|
201
|
+
i,
|
|
202
|
+
u,
|
|
203
|
+
/*Create*/
|
|
204
|
+
!1
|
|
205
|
+
);
|
|
206
|
+
if (!g(l))
|
|
207
|
+
return l.OrdinaryGetOwnMetadata(n, i, u);
|
|
208
|
+
}
|
|
209
|
+
function ve(n, i, u, l) {
|
|
210
|
+
var y = F(
|
|
211
|
+
u,
|
|
212
|
+
l,
|
|
213
|
+
/*Create*/
|
|
214
|
+
!0
|
|
215
|
+
);
|
|
216
|
+
y.OrdinaryDefineOwnMetadata(n, i, u, l);
|
|
217
|
+
}
|
|
218
|
+
function ye(n, i) {
|
|
219
|
+
var u = ge(n, i), l = X(n);
|
|
220
|
+
if (l === null)
|
|
221
|
+
return u;
|
|
222
|
+
var y = ye(l, i);
|
|
223
|
+
if (y.length <= 0)
|
|
224
|
+
return u;
|
|
225
|
+
if (u.length <= 0)
|
|
226
|
+
return y;
|
|
227
|
+
for (var R = new Z(), S = [], M = 0, c = u; M < c.length; M++) {
|
|
228
|
+
var h = c[M], d = R.has(h);
|
|
229
|
+
d || (R.add(h), S.push(h));
|
|
230
|
+
}
|
|
231
|
+
for (var p = 0, _ = y; p < _.length; p++) {
|
|
232
|
+
var h = _[p], d = R.has(h);
|
|
233
|
+
d || (R.add(h), S.push(h));
|
|
234
|
+
}
|
|
235
|
+
return S;
|
|
236
|
+
}
|
|
237
|
+
function ge(n, i) {
|
|
238
|
+
var u = F(
|
|
239
|
+
n,
|
|
240
|
+
i,
|
|
241
|
+
/*create*/
|
|
242
|
+
!1
|
|
243
|
+
);
|
|
244
|
+
return u ? u.OrdinaryOwnMetadataKeys(n, i) : [];
|
|
245
|
+
}
|
|
246
|
+
function me(n) {
|
|
247
|
+
if (n === null)
|
|
248
|
+
return 1;
|
|
249
|
+
switch (typeof n) {
|
|
250
|
+
case "undefined":
|
|
251
|
+
return 0;
|
|
252
|
+
case "boolean":
|
|
253
|
+
return 2;
|
|
254
|
+
case "string":
|
|
255
|
+
return 3;
|
|
256
|
+
case "symbol":
|
|
257
|
+
return 4;
|
|
258
|
+
case "number":
|
|
259
|
+
return 5;
|
|
260
|
+
case "object":
|
|
261
|
+
return n === null ? 1 : 6;
|
|
262
|
+
default:
|
|
263
|
+
return 6;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function g(n) {
|
|
267
|
+
return n === void 0;
|
|
268
|
+
}
|
|
269
|
+
function k(n) {
|
|
270
|
+
return n === null;
|
|
271
|
+
}
|
|
272
|
+
function Xe(n) {
|
|
273
|
+
return typeof n == "symbol";
|
|
274
|
+
}
|
|
275
|
+
function E(n) {
|
|
276
|
+
return typeof n == "object" ? n !== null : typeof n == "function";
|
|
277
|
+
}
|
|
278
|
+
function Ke(n, i) {
|
|
279
|
+
switch (me(n)) {
|
|
280
|
+
case 0:
|
|
281
|
+
return n;
|
|
282
|
+
case 1:
|
|
283
|
+
return n;
|
|
284
|
+
case 2:
|
|
285
|
+
return n;
|
|
286
|
+
case 3:
|
|
287
|
+
return n;
|
|
288
|
+
case 4:
|
|
289
|
+
return n;
|
|
290
|
+
case 5:
|
|
291
|
+
return n;
|
|
292
|
+
}
|
|
293
|
+
var u = "string", l = be(n, f);
|
|
294
|
+
if (l !== void 0) {
|
|
295
|
+
var y = l.call(n, u);
|
|
296
|
+
if (E(y))
|
|
297
|
+
throw new TypeError();
|
|
298
|
+
return y;
|
|
299
|
+
}
|
|
300
|
+
return et(n);
|
|
301
|
+
}
|
|
302
|
+
function et(n, i) {
|
|
303
|
+
var u, l, y;
|
|
304
|
+
{
|
|
305
|
+
var R = n.toString;
|
|
306
|
+
if (W(R)) {
|
|
307
|
+
var l = R.call(n);
|
|
308
|
+
if (!E(l))
|
|
309
|
+
return l;
|
|
310
|
+
}
|
|
311
|
+
var u = n.valueOf;
|
|
312
|
+
if (W(u)) {
|
|
313
|
+
var l = u.call(n);
|
|
314
|
+
if (!E(l))
|
|
315
|
+
return l;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
throw new TypeError();
|
|
319
|
+
}
|
|
320
|
+
function we(n) {
|
|
321
|
+
return !!n;
|
|
322
|
+
}
|
|
323
|
+
function tt(n) {
|
|
324
|
+
return "" + n;
|
|
325
|
+
}
|
|
326
|
+
function x(n) {
|
|
327
|
+
var i = Ke(n);
|
|
328
|
+
return Xe(i) ? i : tt(i);
|
|
329
|
+
}
|
|
330
|
+
function Me(n) {
|
|
331
|
+
return Array.isArray ? Array.isArray(n) : n instanceof Object ? n instanceof Array : Object.prototype.toString.call(n) === "[object Array]";
|
|
332
|
+
}
|
|
333
|
+
function W(n) {
|
|
334
|
+
return typeof n == "function";
|
|
335
|
+
}
|
|
336
|
+
function _e(n) {
|
|
337
|
+
return typeof n == "function";
|
|
338
|
+
}
|
|
339
|
+
function rt(n) {
|
|
340
|
+
switch (me(n)) {
|
|
341
|
+
case 3:
|
|
342
|
+
return !0;
|
|
343
|
+
case 4:
|
|
344
|
+
return !0;
|
|
345
|
+
default:
|
|
346
|
+
return !1;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
function Q(n, i) {
|
|
350
|
+
return n === i || n !== n && i !== i;
|
|
351
|
+
}
|
|
352
|
+
function be(n, i) {
|
|
353
|
+
var u = n[i];
|
|
354
|
+
if (u != null) {
|
|
355
|
+
if (!W(u))
|
|
356
|
+
throw new TypeError();
|
|
357
|
+
return u;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function Pe(n) {
|
|
361
|
+
var i = be(n, m);
|
|
362
|
+
if (!W(i))
|
|
363
|
+
throw new TypeError();
|
|
364
|
+
var u = i.call(n);
|
|
365
|
+
if (!E(u))
|
|
366
|
+
throw new TypeError();
|
|
367
|
+
return u;
|
|
368
|
+
}
|
|
369
|
+
function Re(n) {
|
|
370
|
+
return n.value;
|
|
371
|
+
}
|
|
372
|
+
function Oe(n) {
|
|
373
|
+
var i = n.next();
|
|
374
|
+
return i.done ? !1 : i;
|
|
375
|
+
}
|
|
376
|
+
function Ee(n) {
|
|
377
|
+
var i = n.return;
|
|
378
|
+
i && i.call(n);
|
|
379
|
+
}
|
|
380
|
+
function X(n) {
|
|
381
|
+
var i = Object.getPrototypeOf(n);
|
|
382
|
+
if (typeof n != "function" || n === N || i !== N)
|
|
383
|
+
return i;
|
|
384
|
+
var u = n.prototype, l = u && Object.getPrototypeOf(u);
|
|
385
|
+
if (l == null || l === Object.prototype)
|
|
386
|
+
return i;
|
|
387
|
+
var y = l.constructor;
|
|
388
|
+
return typeof y != "function" || y === n ? i : y;
|
|
389
|
+
}
|
|
390
|
+
function nt() {
|
|
391
|
+
var n;
|
|
392
|
+
!g(D) && typeof s.Reflect < "u" && !(D in s.Reflect) && typeof s.Reflect.defineMetadata == "function" && (n = at(s.Reflect));
|
|
393
|
+
var i, u, l, y = new J(), R = {
|
|
394
|
+
registerProvider: S,
|
|
395
|
+
getProvider: c,
|
|
396
|
+
setProvider: d
|
|
397
|
+
};
|
|
398
|
+
return R;
|
|
399
|
+
function S(p) {
|
|
400
|
+
if (!Object.isExtensible(R))
|
|
401
|
+
throw new Error("Cannot add provider to a frozen registry.");
|
|
402
|
+
switch (!0) {
|
|
403
|
+
case n === p:
|
|
404
|
+
break;
|
|
405
|
+
case g(i):
|
|
406
|
+
i = p;
|
|
407
|
+
break;
|
|
408
|
+
case i === p:
|
|
409
|
+
break;
|
|
410
|
+
case g(u):
|
|
411
|
+
u = p;
|
|
412
|
+
break;
|
|
413
|
+
case u === p:
|
|
414
|
+
break;
|
|
415
|
+
default:
|
|
416
|
+
l === void 0 && (l = new Z()), l.add(p);
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function M(p, _) {
|
|
421
|
+
if (!g(i)) {
|
|
422
|
+
if (i.isProviderFor(p, _))
|
|
423
|
+
return i;
|
|
424
|
+
if (!g(u)) {
|
|
425
|
+
if (u.isProviderFor(p, _))
|
|
426
|
+
return i;
|
|
427
|
+
if (!g(l))
|
|
428
|
+
for (var P = Pe(l); ; ) {
|
|
429
|
+
var O = Oe(P);
|
|
430
|
+
if (!O)
|
|
431
|
+
return;
|
|
432
|
+
var T = Re(O);
|
|
433
|
+
if (T.isProviderFor(p, _))
|
|
434
|
+
return Ee(P), T;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (!g(n) && n.isProviderFor(p, _))
|
|
439
|
+
return n;
|
|
440
|
+
}
|
|
441
|
+
function c(p, _) {
|
|
442
|
+
var P = y.get(p), O;
|
|
443
|
+
return g(P) || (O = P.get(_)), g(O) && (O = M(p, _), g(O) || (g(P) && (P = new H(), y.set(p, P)), P.set(_, O))), O;
|
|
444
|
+
}
|
|
445
|
+
function h(p) {
|
|
446
|
+
if (g(p))
|
|
447
|
+
throw new TypeError();
|
|
448
|
+
return i === p || u === p || !g(l) && l.has(p);
|
|
449
|
+
}
|
|
450
|
+
function d(p, _, P) {
|
|
451
|
+
if (!h(P))
|
|
452
|
+
throw new Error("Metadata provider not registered.");
|
|
453
|
+
var O = c(p, _);
|
|
454
|
+
if (O !== P) {
|
|
455
|
+
if (!g(O))
|
|
456
|
+
return !1;
|
|
457
|
+
var T = y.get(p);
|
|
458
|
+
g(T) && (T = new H(), y.set(p, T)), T.set(_, P);
|
|
459
|
+
}
|
|
460
|
+
return !0;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
function it() {
|
|
464
|
+
var n;
|
|
465
|
+
return !g(D) && E(s.Reflect) && Object.isExtensible(s.Reflect) && (n = s.Reflect[D]), g(n) && (n = nt()), !g(D) && E(s.Reflect) && Object.isExtensible(s.Reflect) && Object.defineProperty(s.Reflect, D, {
|
|
466
|
+
enumerable: !1,
|
|
467
|
+
configurable: !1,
|
|
468
|
+
writable: !1,
|
|
469
|
+
value: n
|
|
470
|
+
}), n;
|
|
471
|
+
}
|
|
472
|
+
function st(n) {
|
|
473
|
+
var i = new J(), u = {
|
|
474
|
+
isProviderFor: function(h, d) {
|
|
475
|
+
var p = i.get(h);
|
|
476
|
+
return g(p) ? !1 : p.has(d);
|
|
477
|
+
},
|
|
478
|
+
OrdinaryDefineOwnMetadata: S,
|
|
479
|
+
OrdinaryHasOwnMetadata: y,
|
|
480
|
+
OrdinaryGetOwnMetadata: R,
|
|
481
|
+
OrdinaryOwnMetadataKeys: M,
|
|
482
|
+
OrdinaryDeleteMetadata: c
|
|
483
|
+
};
|
|
484
|
+
return V.registerProvider(u), u;
|
|
485
|
+
function l(h, d, p) {
|
|
486
|
+
var _ = i.get(h), P = !1;
|
|
487
|
+
if (g(_)) {
|
|
488
|
+
if (!p)
|
|
489
|
+
return;
|
|
490
|
+
_ = new H(), i.set(h, _), P = !0;
|
|
491
|
+
}
|
|
492
|
+
var O = _.get(d);
|
|
493
|
+
if (g(O)) {
|
|
494
|
+
if (!p)
|
|
495
|
+
return;
|
|
496
|
+
if (O = new H(), _.set(d, O), !n.setProvider(h, d, u))
|
|
497
|
+
throw _.delete(d), P && i.delete(h), new Error("Wrong provider for target.");
|
|
498
|
+
}
|
|
499
|
+
return O;
|
|
500
|
+
}
|
|
501
|
+
function y(h, d, p) {
|
|
502
|
+
var _ = l(
|
|
503
|
+
d,
|
|
504
|
+
p,
|
|
505
|
+
/*Create*/
|
|
506
|
+
!1
|
|
507
|
+
);
|
|
508
|
+
return g(_) ? !1 : we(_.has(h));
|
|
509
|
+
}
|
|
510
|
+
function R(h, d, p) {
|
|
511
|
+
var _ = l(
|
|
512
|
+
d,
|
|
513
|
+
p,
|
|
514
|
+
/*Create*/
|
|
515
|
+
!1
|
|
516
|
+
);
|
|
517
|
+
if (!g(_))
|
|
518
|
+
return _.get(h);
|
|
519
|
+
}
|
|
520
|
+
function S(h, d, p, _) {
|
|
521
|
+
var P = l(
|
|
522
|
+
p,
|
|
523
|
+
_,
|
|
524
|
+
/*Create*/
|
|
525
|
+
!0
|
|
526
|
+
);
|
|
527
|
+
P.set(h, d);
|
|
528
|
+
}
|
|
529
|
+
function M(h, d) {
|
|
530
|
+
var p = [], _ = l(
|
|
531
|
+
h,
|
|
532
|
+
d,
|
|
533
|
+
/*Create*/
|
|
534
|
+
!1
|
|
535
|
+
);
|
|
536
|
+
if (g(_))
|
|
537
|
+
return p;
|
|
538
|
+
for (var P = _.keys(), O = Pe(P), T = 0; ; ) {
|
|
539
|
+
var Se = Oe(O);
|
|
540
|
+
if (!Se)
|
|
541
|
+
return p.length = T, p;
|
|
542
|
+
var ft = Re(Se);
|
|
543
|
+
try {
|
|
544
|
+
p[T] = ft;
|
|
545
|
+
} catch (ct) {
|
|
546
|
+
try {
|
|
547
|
+
Ee(O);
|
|
548
|
+
} finally {
|
|
549
|
+
throw ct;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
T++;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
function c(h, d, p) {
|
|
556
|
+
var _ = l(
|
|
557
|
+
d,
|
|
558
|
+
p,
|
|
559
|
+
/*Create*/
|
|
560
|
+
!1
|
|
561
|
+
);
|
|
562
|
+
if (g(_) || !_.delete(h))
|
|
563
|
+
return !1;
|
|
564
|
+
if (_.size === 0) {
|
|
565
|
+
var P = i.get(d);
|
|
566
|
+
g(P) || (P.delete(p), P.size === 0 && i.delete(P));
|
|
567
|
+
}
|
|
568
|
+
return !0;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function at(n) {
|
|
572
|
+
var i = n.defineMetadata, u = n.hasOwnMetadata, l = n.getOwnMetadata, y = n.getOwnMetadataKeys, R = n.deleteMetadata, S = new J(), M = {
|
|
573
|
+
isProviderFor: function(c, h) {
|
|
574
|
+
var d = S.get(c);
|
|
575
|
+
return !g(d) && d.has(h) ? !0 : y(c, h).length ? (g(d) && (d = new Z(), S.set(c, d)), d.add(h), !0) : !1;
|
|
576
|
+
},
|
|
577
|
+
OrdinaryDefineOwnMetadata: i,
|
|
578
|
+
OrdinaryHasOwnMetadata: u,
|
|
579
|
+
OrdinaryGetOwnMetadata: l,
|
|
580
|
+
OrdinaryOwnMetadataKeys: y,
|
|
581
|
+
OrdinaryDeleteMetadata: R
|
|
582
|
+
};
|
|
583
|
+
return M;
|
|
584
|
+
}
|
|
585
|
+
function F(n, i, u) {
|
|
586
|
+
var l = V.getProvider(n, i);
|
|
587
|
+
if (!g(l))
|
|
588
|
+
return l;
|
|
589
|
+
if (u) {
|
|
590
|
+
if (V.setProvider(n, i, ce))
|
|
591
|
+
return ce;
|
|
592
|
+
throw new Error("Illegal state.");
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function ot() {
|
|
596
|
+
var n = {}, i = [], u = (
|
|
597
|
+
/** @class */
|
|
598
|
+
(function() {
|
|
599
|
+
function M(c, h, d) {
|
|
600
|
+
this._index = 0, this._keys = c, this._values = h, this._selector = d;
|
|
601
|
+
}
|
|
602
|
+
return M.prototype["@@iterator"] = function() {
|
|
603
|
+
return this;
|
|
604
|
+
}, M.prototype[m] = function() {
|
|
605
|
+
return this;
|
|
606
|
+
}, M.prototype.next = function() {
|
|
607
|
+
var c = this._index;
|
|
608
|
+
if (c >= 0 && c < this._keys.length) {
|
|
609
|
+
var h = this._selector(this._keys[c], this._values[c]);
|
|
610
|
+
return c + 1 >= this._keys.length ? (this._index = -1, this._keys = i, this._values = i) : this._index++, { value: h, done: !1 };
|
|
611
|
+
}
|
|
612
|
+
return { value: void 0, done: !0 };
|
|
613
|
+
}, M.prototype.throw = function(c) {
|
|
614
|
+
throw this._index >= 0 && (this._index = -1, this._keys = i, this._values = i), c;
|
|
615
|
+
}, M.prototype.return = function(c) {
|
|
616
|
+
return this._index >= 0 && (this._index = -1, this._keys = i, this._values = i), { value: c, done: !0 };
|
|
617
|
+
}, M;
|
|
618
|
+
})()
|
|
619
|
+
), l = (
|
|
620
|
+
/** @class */
|
|
621
|
+
(function() {
|
|
622
|
+
function M() {
|
|
623
|
+
this._keys = [], this._values = [], this._cacheKey = n, this._cacheIndex = -2;
|
|
624
|
+
}
|
|
625
|
+
return Object.defineProperty(M.prototype, "size", {
|
|
626
|
+
get: function() {
|
|
627
|
+
return this._keys.length;
|
|
628
|
+
},
|
|
629
|
+
enumerable: !0,
|
|
630
|
+
configurable: !0
|
|
631
|
+
}), M.prototype.has = function(c) {
|
|
632
|
+
return this._find(
|
|
633
|
+
c,
|
|
634
|
+
/*insert*/
|
|
635
|
+
!1
|
|
636
|
+
) >= 0;
|
|
637
|
+
}, M.prototype.get = function(c) {
|
|
638
|
+
var h = this._find(
|
|
639
|
+
c,
|
|
640
|
+
/*insert*/
|
|
641
|
+
!1
|
|
642
|
+
);
|
|
643
|
+
return h >= 0 ? this._values[h] : void 0;
|
|
644
|
+
}, M.prototype.set = function(c, h) {
|
|
645
|
+
var d = this._find(
|
|
646
|
+
c,
|
|
647
|
+
/*insert*/
|
|
648
|
+
!0
|
|
649
|
+
);
|
|
650
|
+
return this._values[d] = h, this;
|
|
651
|
+
}, M.prototype.delete = function(c) {
|
|
652
|
+
var h = this._find(
|
|
653
|
+
c,
|
|
654
|
+
/*insert*/
|
|
655
|
+
!1
|
|
656
|
+
);
|
|
657
|
+
if (h >= 0) {
|
|
658
|
+
for (var d = this._keys.length, p = h + 1; p < d; p++)
|
|
659
|
+
this._keys[p - 1] = this._keys[p], this._values[p - 1] = this._values[p];
|
|
660
|
+
return this._keys.length--, this._values.length--, Q(c, this._cacheKey) && (this._cacheKey = n, this._cacheIndex = -2), !0;
|
|
661
|
+
}
|
|
662
|
+
return !1;
|
|
663
|
+
}, M.prototype.clear = function() {
|
|
664
|
+
this._keys.length = 0, this._values.length = 0, this._cacheKey = n, this._cacheIndex = -2;
|
|
665
|
+
}, M.prototype.keys = function() {
|
|
666
|
+
return new u(this._keys, this._values, y);
|
|
667
|
+
}, M.prototype.values = function() {
|
|
668
|
+
return new u(this._keys, this._values, R);
|
|
669
|
+
}, M.prototype.entries = function() {
|
|
670
|
+
return new u(this._keys, this._values, S);
|
|
671
|
+
}, M.prototype["@@iterator"] = function() {
|
|
672
|
+
return this.entries();
|
|
673
|
+
}, M.prototype[m] = function() {
|
|
674
|
+
return this.entries();
|
|
675
|
+
}, M.prototype._find = function(c, h) {
|
|
676
|
+
if (!Q(this._cacheKey, c)) {
|
|
677
|
+
this._cacheIndex = -1;
|
|
678
|
+
for (var d = 0; d < this._keys.length; d++)
|
|
679
|
+
if (Q(this._keys[d], c)) {
|
|
680
|
+
this._cacheIndex = d;
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
return this._cacheIndex < 0 && h && (this._cacheIndex = this._keys.length, this._keys.push(c), this._values.push(void 0)), this._cacheIndex;
|
|
685
|
+
}, M;
|
|
686
|
+
})()
|
|
687
|
+
);
|
|
688
|
+
return l;
|
|
689
|
+
function y(M, c) {
|
|
690
|
+
return M;
|
|
691
|
+
}
|
|
692
|
+
function R(M, c) {
|
|
693
|
+
return c;
|
|
694
|
+
}
|
|
695
|
+
function S(M, c) {
|
|
696
|
+
return [M, c];
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function ut() {
|
|
700
|
+
var n = (
|
|
701
|
+
/** @class */
|
|
702
|
+
(function() {
|
|
703
|
+
function i() {
|
|
704
|
+
this._map = new H();
|
|
705
|
+
}
|
|
706
|
+
return Object.defineProperty(i.prototype, "size", {
|
|
707
|
+
get: function() {
|
|
708
|
+
return this._map.size;
|
|
709
|
+
},
|
|
710
|
+
enumerable: !0,
|
|
711
|
+
configurable: !0
|
|
712
|
+
}), i.prototype.has = function(u) {
|
|
713
|
+
return this._map.has(u);
|
|
714
|
+
}, i.prototype.add = function(u) {
|
|
715
|
+
return this._map.set(u, u), this;
|
|
716
|
+
}, i.prototype.delete = function(u) {
|
|
717
|
+
return this._map.delete(u);
|
|
718
|
+
}, i.prototype.clear = function() {
|
|
719
|
+
this._map.clear();
|
|
720
|
+
}, i.prototype.keys = function() {
|
|
721
|
+
return this._map.keys();
|
|
722
|
+
}, i.prototype.values = function() {
|
|
723
|
+
return this._map.keys();
|
|
724
|
+
}, i.prototype.entries = function() {
|
|
725
|
+
return this._map.entries();
|
|
726
|
+
}, i.prototype["@@iterator"] = function() {
|
|
727
|
+
return this.keys();
|
|
728
|
+
}, i.prototype[m] = function() {
|
|
729
|
+
return this.keys();
|
|
730
|
+
}, i;
|
|
731
|
+
})()
|
|
732
|
+
);
|
|
733
|
+
return n;
|
|
734
|
+
}
|
|
735
|
+
function lt() {
|
|
736
|
+
var n = 16, i = C.create(), u = l();
|
|
737
|
+
return (
|
|
738
|
+
/** @class */
|
|
739
|
+
(function() {
|
|
740
|
+
function c() {
|
|
741
|
+
this._key = l();
|
|
742
|
+
}
|
|
743
|
+
return c.prototype.has = function(h) {
|
|
744
|
+
var d = y(
|
|
745
|
+
h,
|
|
746
|
+
/*create*/
|
|
747
|
+
!1
|
|
748
|
+
);
|
|
749
|
+
return d !== void 0 ? C.has(d, this._key) : !1;
|
|
750
|
+
}, c.prototype.get = function(h) {
|
|
751
|
+
var d = y(
|
|
752
|
+
h,
|
|
753
|
+
/*create*/
|
|
754
|
+
!1
|
|
755
|
+
);
|
|
756
|
+
return d !== void 0 ? C.get(d, this._key) : void 0;
|
|
757
|
+
}, c.prototype.set = function(h, d) {
|
|
758
|
+
var p = y(
|
|
759
|
+
h,
|
|
760
|
+
/*create*/
|
|
761
|
+
!0
|
|
762
|
+
);
|
|
763
|
+
return p[this._key] = d, this;
|
|
764
|
+
}, c.prototype.delete = function(h) {
|
|
765
|
+
var d = y(
|
|
766
|
+
h,
|
|
767
|
+
/*create*/
|
|
768
|
+
!1
|
|
769
|
+
);
|
|
770
|
+
return d !== void 0 ? delete d[this._key] : !1;
|
|
771
|
+
}, c.prototype.clear = function() {
|
|
772
|
+
this._key = l();
|
|
773
|
+
}, c;
|
|
774
|
+
})()
|
|
775
|
+
);
|
|
776
|
+
function l() {
|
|
777
|
+
var c;
|
|
778
|
+
do
|
|
779
|
+
c = "@@WeakMap@@" + M();
|
|
780
|
+
while (C.has(i, c));
|
|
781
|
+
return i[c] = !0, c;
|
|
782
|
+
}
|
|
783
|
+
function y(c, h) {
|
|
784
|
+
if (!a.call(c, u)) {
|
|
785
|
+
if (!h)
|
|
786
|
+
return;
|
|
787
|
+
Object.defineProperty(c, u, { value: C.create() });
|
|
788
|
+
}
|
|
789
|
+
return c[u];
|
|
790
|
+
}
|
|
791
|
+
function R(c, h) {
|
|
792
|
+
for (var d = 0; d < h; ++d)
|
|
793
|
+
c[d] = Math.random() * 255 | 0;
|
|
794
|
+
return c;
|
|
795
|
+
}
|
|
796
|
+
function S(c) {
|
|
797
|
+
if (typeof Uint8Array == "function") {
|
|
798
|
+
var h = new Uint8Array(c);
|
|
799
|
+
return typeof crypto < "u" ? crypto.getRandomValues(h) : typeof msCrypto < "u" ? msCrypto.getRandomValues(h) : R(h, c), h;
|
|
800
|
+
}
|
|
801
|
+
return R(new Array(c), c);
|
|
802
|
+
}
|
|
803
|
+
function M() {
|
|
804
|
+
var c = S(n);
|
|
805
|
+
c[6] = c[6] & 79 | 64, c[8] = c[8] & 191 | 128;
|
|
806
|
+
for (var h = "", d = 0; d < n; ++d) {
|
|
807
|
+
var p = c[d];
|
|
808
|
+
(d === 4 || d === 6 || d === 8) && (h += "-"), p < 16 && (h += "0"), h += p.toString(16).toLowerCase();
|
|
809
|
+
}
|
|
810
|
+
return h;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
function K(n) {
|
|
814
|
+
return n.__ = void 0, delete n.__, n;
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
})(t || (t = {})), Ce;
|
|
818
|
+
}
|
|
819
|
+
Ot();
|
|
820
|
+
function Et(t) {
|
|
3
821
|
const e = (
|
|
4
822
|
/* glsl */
|
|
5
823
|
`
|
|
@@ -17,7 +835,7 @@ function M(s) {
|
|
|
17
835
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
18
836
|
}
|
|
19
837
|
`
|
|
20
|
-
),
|
|
838
|
+
), r = (
|
|
21
839
|
/* glsl */
|
|
22
840
|
`
|
|
23
841
|
precision highp float;
|
|
@@ -35,16 +853,16 @@ function M(s) {
|
|
|
35
853
|
}
|
|
36
854
|
`
|
|
37
855
|
);
|
|
38
|
-
return new
|
|
856
|
+
return new ht(t, {
|
|
39
857
|
vertex: e,
|
|
40
|
-
fragment:
|
|
858
|
+
fragment: r,
|
|
41
859
|
cullFace: !1,
|
|
42
860
|
uniforms: {
|
|
43
861
|
uHit: { value: 0 }
|
|
44
862
|
}
|
|
45
863
|
});
|
|
46
864
|
}
|
|
47
|
-
class
|
|
865
|
+
class ke {
|
|
48
866
|
/** Экземпляр рендерера OGL */
|
|
49
867
|
gl;
|
|
50
868
|
/** Корневой объект сцены */
|
|
@@ -62,7 +880,7 @@ class u {
|
|
|
62
880
|
* @param canvas - HTMLCanvasElement для рендеринга
|
|
63
881
|
*/
|
|
64
882
|
constructor(e) {
|
|
65
|
-
this.canvas = e, this.gl = new
|
|
883
|
+
this.canvas = e, this.gl = new dt({ canvas: e, dpr: 2 }), this.gl.setSize(e.clientWidth, e.clientHeight), this.gl.gl.clearColor(0.1, 0.1, 0.1, 1), this.scene = new pt(), this.camera = new vt(this.gl.gl, { fov: 45 }), this.camera.position.set(1, 1, 7), this.camera.lookAt([0, 0, 0]), this.program = Et(this.gl.gl), this.meshes = [];
|
|
66
884
|
}
|
|
67
885
|
/**
|
|
68
886
|
* Обновляет размер рендерера и камеры при изменении размеров canvas.
|
|
@@ -89,37 +907,603 @@ class u {
|
|
|
89
907
|
}
|
|
90
908
|
/**
|
|
91
909
|
* Публичный метод для добавления фигуры.
|
|
92
|
-
* @param figure Данные фигуры: position, normal, uv
|
|
910
|
+
* @param figure - Данные фигуры: position, normal, uv
|
|
93
911
|
*/
|
|
94
912
|
addFigure(e) {
|
|
95
|
-
const
|
|
913
|
+
const r = new yt(this.gl.gl, {
|
|
96
914
|
position: { size: 3, data: new Float32Array(e.position) },
|
|
97
915
|
normal: { size: 3, data: new Float32Array(e.normal ?? []) },
|
|
98
916
|
uv: { size: 2, data: new Float32Array(e.uv ?? []) }
|
|
99
|
-
}),
|
|
100
|
-
geometry:
|
|
917
|
+
}), s = new gt(this.gl.gl, {
|
|
918
|
+
geometry: r,
|
|
101
919
|
program: this.program
|
|
102
920
|
});
|
|
103
|
-
return
|
|
921
|
+
return s.setParent(this.scene), this.meshes.push(s), s;
|
|
104
922
|
}
|
|
105
923
|
/** Деструктор */
|
|
106
924
|
destroy() {
|
|
107
925
|
this.meshes && (this.meshes.length = 0, this.meshes = []), this.scene = null, this.camera = null, this.program = null, this.gl = null, this.canvas = null;
|
|
108
926
|
}
|
|
109
927
|
}
|
|
110
|
-
class
|
|
928
|
+
class St extends De {
|
|
111
929
|
/** Используется ли Orbit-controls */
|
|
112
930
|
isInteracting = !1;
|
|
113
931
|
element;
|
|
114
|
-
constructor(e,
|
|
115
|
-
super(e,
|
|
932
|
+
constructor(e, r = {}) {
|
|
933
|
+
super(e, r), this.element = r.element || document, this.element.addEventListener("mousedown", () => this.isInteracting = !0), this.element.addEventListener("mouseup", () => this.isInteracting = !1), this.element.addEventListener("touchstart", () => this.isInteracting = !0), this.element.addEventListener("touchend", () => this.isInteracting = !1);
|
|
116
934
|
}
|
|
117
935
|
/** Очистка новых обработчиков событий */
|
|
118
936
|
destroy() {
|
|
119
937
|
this.element.removeEventListener("mousedown", () => this.isInteracting = !0), this.element.removeEventListener("mouseup", () => this.isInteracting = !1), this.element.removeEventListener("touchstart", () => this.isInteracting = !0), this.element.removeEventListener("touchend", () => this.isInteracting = !1);
|
|
120
938
|
}
|
|
121
939
|
}
|
|
122
|
-
|
|
940
|
+
var ee;
|
|
941
|
+
(function(t) {
|
|
942
|
+
t[t.Transient = 0] = "Transient", t[t.Singleton = 1] = "Singleton", t[t.ResolutionScoped = 2] = "ResolutionScoped", t[t.ContainerScoped = 3] = "ContainerScoped";
|
|
943
|
+
})(ee || (ee = {}));
|
|
944
|
+
const I = ee;
|
|
945
|
+
/*! *****************************************************************************
|
|
946
|
+
Copyright (c) Microsoft Corporation.
|
|
947
|
+
|
|
948
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
949
|
+
purpose with or without fee is hereby granted.
|
|
950
|
+
|
|
951
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
952
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
953
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
954
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
955
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
956
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
957
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
958
|
+
***************************************************************************** */
|
|
959
|
+
var te = function(t, e) {
|
|
960
|
+
return te = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, s) {
|
|
961
|
+
r.__proto__ = s;
|
|
962
|
+
} || function(r, s) {
|
|
963
|
+
for (var a in s) s.hasOwnProperty(a) && (r[a] = s[a]);
|
|
964
|
+
}, te(t, e);
|
|
965
|
+
};
|
|
966
|
+
function ue(t, e) {
|
|
967
|
+
te(t, e);
|
|
968
|
+
function r() {
|
|
969
|
+
this.constructor = t;
|
|
970
|
+
}
|
|
971
|
+
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
972
|
+
}
|
|
973
|
+
function It(t, e, r, s) {
|
|
974
|
+
function a(o) {
|
|
975
|
+
return o instanceof r ? o : new r(function(f) {
|
|
976
|
+
f(o);
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
return new (r || (r = Promise))(function(o, f) {
|
|
980
|
+
function m(b) {
|
|
981
|
+
try {
|
|
982
|
+
v(s.next(b));
|
|
983
|
+
} catch (C) {
|
|
984
|
+
f(C);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
function w(b) {
|
|
988
|
+
try {
|
|
989
|
+
v(s.throw(b));
|
|
990
|
+
} catch (C) {
|
|
991
|
+
f(C);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
function v(b) {
|
|
995
|
+
b.done ? o(b.value) : a(b.value).then(m, w);
|
|
996
|
+
}
|
|
997
|
+
v((s = s.apply(t, [])).next());
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
function Ct(t, e) {
|
|
1001
|
+
var r = { label: 0, sent: function() {
|
|
1002
|
+
if (o[0] & 1) throw o[1];
|
|
1003
|
+
return o[1];
|
|
1004
|
+
}, trys: [], ops: [] }, s, a, o, f;
|
|
1005
|
+
return f = { next: m(0), throw: m(1), return: m(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
|
|
1006
|
+
return this;
|
|
1007
|
+
}), f;
|
|
1008
|
+
function m(v) {
|
|
1009
|
+
return function(b) {
|
|
1010
|
+
return w([v, b]);
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
function w(v) {
|
|
1014
|
+
if (s) throw new TypeError("Generator is already executing.");
|
|
1015
|
+
for (; r; ) try {
|
|
1016
|
+
if (s = 1, a && (o = v[0] & 2 ? a.return : v[0] ? a.throw || ((o = a.return) && o.call(a), 0) : a.next) && !(o = o.call(a, v[1])).done) return o;
|
|
1017
|
+
switch (a = 0, o && (v = [v[0] & 2, o.value]), v[0]) {
|
|
1018
|
+
case 0:
|
|
1019
|
+
case 1:
|
|
1020
|
+
o = v;
|
|
1021
|
+
break;
|
|
1022
|
+
case 4:
|
|
1023
|
+
return r.label++, { value: v[1], done: !1 };
|
|
1024
|
+
case 5:
|
|
1025
|
+
r.label++, a = v[1], v = [0];
|
|
1026
|
+
continue;
|
|
1027
|
+
case 7:
|
|
1028
|
+
v = r.ops.pop(), r.trys.pop();
|
|
1029
|
+
continue;
|
|
1030
|
+
default:
|
|
1031
|
+
if (o = r.trys, !(o = o.length > 0 && o[o.length - 1]) && (v[0] === 6 || v[0] === 2)) {
|
|
1032
|
+
r = 0;
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
if (v[0] === 3 && (!o || v[1] > o[0] && v[1] < o[3])) {
|
|
1036
|
+
r.label = v[1];
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
if (v[0] === 6 && r.label < o[1]) {
|
|
1040
|
+
r.label = o[1], o = v;
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
if (o && r.label < o[2]) {
|
|
1044
|
+
r.label = o[2], r.ops.push(v);
|
|
1045
|
+
break;
|
|
1046
|
+
}
|
|
1047
|
+
o[2] && r.ops.pop(), r.trys.pop();
|
|
1048
|
+
continue;
|
|
1049
|
+
}
|
|
1050
|
+
v = e.call(t, r);
|
|
1051
|
+
} catch (b) {
|
|
1052
|
+
v = [6, b], a = 0;
|
|
1053
|
+
} finally {
|
|
1054
|
+
s = o = 0;
|
|
1055
|
+
}
|
|
1056
|
+
if (v[0] & 5) throw v[1];
|
|
1057
|
+
return { value: v[0] ? v[1] : void 0, done: !0 };
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
function z(t) {
|
|
1061
|
+
var e = typeof Symbol == "function" && Symbol.iterator, r = e && t[e], s = 0;
|
|
1062
|
+
if (r) return r.call(t);
|
|
1063
|
+
if (t && typeof t.length == "number") return {
|
|
1064
|
+
next: function() {
|
|
1065
|
+
return t && s >= t.length && (t = void 0), { value: t && t[s++], done: !t };
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1069
|
+
}
|
|
1070
|
+
function B(t, e) {
|
|
1071
|
+
var r = typeof Symbol == "function" && t[Symbol.iterator];
|
|
1072
|
+
if (!r) return t;
|
|
1073
|
+
var s = r.call(t), a, o = [], f;
|
|
1074
|
+
try {
|
|
1075
|
+
for (; (e === void 0 || e-- > 0) && !(a = s.next()).done; ) o.push(a.value);
|
|
1076
|
+
} catch (m) {
|
|
1077
|
+
f = { error: m };
|
|
1078
|
+
} finally {
|
|
1079
|
+
try {
|
|
1080
|
+
a && !a.done && (r = s.return) && r.call(s);
|
|
1081
|
+
} finally {
|
|
1082
|
+
if (f) throw f.error;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
return o;
|
|
1086
|
+
}
|
|
1087
|
+
function A() {
|
|
1088
|
+
for (var t = [], e = 0; e < arguments.length; e++)
|
|
1089
|
+
t = t.concat(B(arguments[e]));
|
|
1090
|
+
return t;
|
|
1091
|
+
}
|
|
1092
|
+
var re = "injectionTokens";
|
|
1093
|
+
function Tt(t) {
|
|
1094
|
+
var e = Reflect.getMetadata("design:paramtypes", t) || [], r = Reflect.getOwnMetadata(re, t) || {};
|
|
1095
|
+
return Object.keys(r).forEach(function(s) {
|
|
1096
|
+
e[+s] = r[s];
|
|
1097
|
+
}), e;
|
|
1098
|
+
}
|
|
1099
|
+
function je(t, e) {
|
|
1100
|
+
return function(r, s, a) {
|
|
1101
|
+
var o = Reflect.getOwnMetadata(re, r) || {};
|
|
1102
|
+
o[a] = t, Reflect.defineMetadata(re, o, r);
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
function Ne(t) {
|
|
1106
|
+
return !!t.useClass;
|
|
1107
|
+
}
|
|
1108
|
+
function ne(t) {
|
|
1109
|
+
return !!t.useFactory;
|
|
1110
|
+
}
|
|
1111
|
+
var He = (function() {
|
|
1112
|
+
function t(e) {
|
|
1113
|
+
this.wrap = e, this.reflectMethods = [
|
|
1114
|
+
"get",
|
|
1115
|
+
"getPrototypeOf",
|
|
1116
|
+
"setPrototypeOf",
|
|
1117
|
+
"getOwnPropertyDescriptor",
|
|
1118
|
+
"defineProperty",
|
|
1119
|
+
"has",
|
|
1120
|
+
"set",
|
|
1121
|
+
"deleteProperty",
|
|
1122
|
+
"apply",
|
|
1123
|
+
"construct",
|
|
1124
|
+
"ownKeys"
|
|
1125
|
+
];
|
|
1126
|
+
}
|
|
1127
|
+
return t.prototype.createProxy = function(e) {
|
|
1128
|
+
var r = this, s = {}, a = !1, o, f = function() {
|
|
1129
|
+
return a || (o = e(r.wrap()), a = !0), o;
|
|
1130
|
+
};
|
|
1131
|
+
return new Proxy(s, this.createHandler(f));
|
|
1132
|
+
}, t.prototype.createHandler = function(e) {
|
|
1133
|
+
var r = {}, s = function(a) {
|
|
1134
|
+
r[a] = function() {
|
|
1135
|
+
for (var o = [], f = 0; f < arguments.length; f++)
|
|
1136
|
+
o[f] = arguments[f];
|
|
1137
|
+
o[0] = e();
|
|
1138
|
+
var m = Reflect[a];
|
|
1139
|
+
return m.apply(void 0, A(o));
|
|
1140
|
+
};
|
|
1141
|
+
};
|
|
1142
|
+
return this.reflectMethods.forEach(s), r;
|
|
1143
|
+
}, t;
|
|
1144
|
+
})();
|
|
1145
|
+
function j(t) {
|
|
1146
|
+
return typeof t == "string" || typeof t == "symbol";
|
|
1147
|
+
}
|
|
1148
|
+
function xt(t) {
|
|
1149
|
+
return typeof t == "object" && "token" in t && "multiple" in t;
|
|
1150
|
+
}
|
|
1151
|
+
function xe(t) {
|
|
1152
|
+
return typeof t == "object" && "token" in t && "transform" in t;
|
|
1153
|
+
}
|
|
1154
|
+
function At(t) {
|
|
1155
|
+
return typeof t == "function" || t instanceof He;
|
|
1156
|
+
}
|
|
1157
|
+
function $(t) {
|
|
1158
|
+
return !!t.useToken;
|
|
1159
|
+
}
|
|
1160
|
+
function q(t) {
|
|
1161
|
+
return t.useValue != null;
|
|
1162
|
+
}
|
|
1163
|
+
function Dt(t) {
|
|
1164
|
+
return Ne(t) || q(t) || $(t) || ne(t);
|
|
1165
|
+
}
|
|
1166
|
+
var le = (function() {
|
|
1167
|
+
function t() {
|
|
1168
|
+
this._registryMap = /* @__PURE__ */ new Map();
|
|
1169
|
+
}
|
|
1170
|
+
return t.prototype.entries = function() {
|
|
1171
|
+
return this._registryMap.entries();
|
|
1172
|
+
}, t.prototype.getAll = function(e) {
|
|
1173
|
+
return this.ensure(e), this._registryMap.get(e);
|
|
1174
|
+
}, t.prototype.get = function(e) {
|
|
1175
|
+
this.ensure(e);
|
|
1176
|
+
var r = this._registryMap.get(e);
|
|
1177
|
+
return r[r.length - 1] || null;
|
|
1178
|
+
}, t.prototype.set = function(e, r) {
|
|
1179
|
+
this.ensure(e), this._registryMap.get(e).push(r);
|
|
1180
|
+
}, t.prototype.setAll = function(e, r) {
|
|
1181
|
+
this._registryMap.set(e, r);
|
|
1182
|
+
}, t.prototype.has = function(e) {
|
|
1183
|
+
return this.ensure(e), this._registryMap.get(e).length > 0;
|
|
1184
|
+
}, t.prototype.clear = function() {
|
|
1185
|
+
this._registryMap.clear();
|
|
1186
|
+
}, t.prototype.ensure = function(e) {
|
|
1187
|
+
this._registryMap.has(e) || this._registryMap.set(e, []);
|
|
1188
|
+
}, t;
|
|
1189
|
+
})(), kt = (function(t) {
|
|
1190
|
+
ue(e, t);
|
|
1191
|
+
function e() {
|
|
1192
|
+
return t !== null && t.apply(this, arguments) || this;
|
|
1193
|
+
}
|
|
1194
|
+
return e;
|
|
1195
|
+
})(le), U = /* @__PURE__ */ (function() {
|
|
1196
|
+
function t() {
|
|
1197
|
+
this.scopedResolutions = /* @__PURE__ */ new Map();
|
|
1198
|
+
}
|
|
1199
|
+
return t;
|
|
1200
|
+
})();
|
|
1201
|
+
function jt(t, e) {
|
|
1202
|
+
if (t === null)
|
|
1203
|
+
return "at position #" + e;
|
|
1204
|
+
var r = t.split(",")[e].trim();
|
|
1205
|
+
return '"' + r + '" at position #' + e;
|
|
1206
|
+
}
|
|
1207
|
+
function Nt(t, e, r) {
|
|
1208
|
+
return r === void 0 && (r = " "), A([t], e.message.split(`
|
|
1209
|
+
`).map(function(s) {
|
|
1210
|
+
return r + s;
|
|
1211
|
+
})).join(`
|
|
1212
|
+
`);
|
|
1213
|
+
}
|
|
1214
|
+
function Ht(t, e, r) {
|
|
1215
|
+
var s = B(t.toString().match(/constructor\(([\w, ]+)\)/) || [], 2), a = s[1], o = a === void 0 ? null : a, f = jt(o, e);
|
|
1216
|
+
return Nt("Cannot inject the dependency " + f + ' of "' + t.name + '" constructor. Reason:', r);
|
|
1217
|
+
}
|
|
1218
|
+
function Ft(t) {
|
|
1219
|
+
if (typeof t.dispose != "function")
|
|
1220
|
+
return !1;
|
|
1221
|
+
var e = t.dispose;
|
|
1222
|
+
return !(e.length > 0);
|
|
1223
|
+
}
|
|
1224
|
+
var Gt = (function(t) {
|
|
1225
|
+
ue(e, t);
|
|
1226
|
+
function e() {
|
|
1227
|
+
return t !== null && t.apply(this, arguments) || this;
|
|
1228
|
+
}
|
|
1229
|
+
return e;
|
|
1230
|
+
})(le), Lt = (function(t) {
|
|
1231
|
+
ue(e, t);
|
|
1232
|
+
function e() {
|
|
1233
|
+
return t !== null && t.apply(this, arguments) || this;
|
|
1234
|
+
}
|
|
1235
|
+
return e;
|
|
1236
|
+
})(le), Vt = /* @__PURE__ */ (function() {
|
|
1237
|
+
function t() {
|
|
1238
|
+
this.preResolution = new Gt(), this.postResolution = new Lt();
|
|
1239
|
+
}
|
|
1240
|
+
return t;
|
|
1241
|
+
})(), Fe = /* @__PURE__ */ new Map(), Wt = (function() {
|
|
1242
|
+
function t(e) {
|
|
1243
|
+
this.parent = e, this._registry = new kt(), this.interceptors = new Vt(), this.disposed = !1, this.disposables = /* @__PURE__ */ new Set();
|
|
1244
|
+
}
|
|
1245
|
+
return t.prototype.register = function(e, r, s) {
|
|
1246
|
+
s === void 0 && (s = { lifecycle: I.Transient }), this.ensureNotDisposed();
|
|
1247
|
+
var a;
|
|
1248
|
+
if (Dt(r) ? a = r : a = { useClass: r }, $(a))
|
|
1249
|
+
for (var o = [e], f = a; f != null; ) {
|
|
1250
|
+
var m = f.useToken;
|
|
1251
|
+
if (o.includes(m))
|
|
1252
|
+
throw new Error("Token registration cycle detected! " + A(o, [m]).join(" -> "));
|
|
1253
|
+
o.push(m);
|
|
1254
|
+
var w = this._registry.get(m);
|
|
1255
|
+
w && $(w.provider) ? f = w.provider : f = null;
|
|
1256
|
+
}
|
|
1257
|
+
if ((s.lifecycle === I.Singleton || s.lifecycle == I.ContainerScoped || s.lifecycle == I.ResolutionScoped) && (q(a) || ne(a)))
|
|
1258
|
+
throw new Error('Cannot use lifecycle "' + I[s.lifecycle] + '" with ValueProviders or FactoryProviders');
|
|
1259
|
+
return this._registry.set(e, { provider: a, options: s }), this;
|
|
1260
|
+
}, t.prototype.registerType = function(e, r) {
|
|
1261
|
+
return this.ensureNotDisposed(), j(r) ? this.register(e, {
|
|
1262
|
+
useToken: r
|
|
1263
|
+
}) : this.register(e, {
|
|
1264
|
+
useClass: r
|
|
1265
|
+
});
|
|
1266
|
+
}, t.prototype.registerInstance = function(e, r) {
|
|
1267
|
+
return this.ensureNotDisposed(), this.register(e, {
|
|
1268
|
+
useValue: r
|
|
1269
|
+
});
|
|
1270
|
+
}, t.prototype.registerSingleton = function(e, r) {
|
|
1271
|
+
if (this.ensureNotDisposed(), j(e)) {
|
|
1272
|
+
if (j(r))
|
|
1273
|
+
return this.register(e, {
|
|
1274
|
+
useToken: r
|
|
1275
|
+
}, { lifecycle: I.Singleton });
|
|
1276
|
+
if (r)
|
|
1277
|
+
return this.register(e, {
|
|
1278
|
+
useClass: r
|
|
1279
|
+
}, { lifecycle: I.Singleton });
|
|
1280
|
+
throw new Error('Cannot register a type name as a singleton without a "to" token');
|
|
1281
|
+
}
|
|
1282
|
+
var s = e;
|
|
1283
|
+
return r && !j(r) && (s = r), this.register(e, {
|
|
1284
|
+
useClass: s
|
|
1285
|
+
}, { lifecycle: I.Singleton });
|
|
1286
|
+
}, t.prototype.resolve = function(e, r, s) {
|
|
1287
|
+
r === void 0 && (r = new U()), s === void 0 && (s = !1), this.ensureNotDisposed();
|
|
1288
|
+
var a = this.getRegistration(e);
|
|
1289
|
+
if (!a && j(e)) {
|
|
1290
|
+
if (s)
|
|
1291
|
+
return;
|
|
1292
|
+
throw new Error('Attempted to resolve unregistered dependency token: "' + e.toString() + '"');
|
|
1293
|
+
}
|
|
1294
|
+
if (this.executePreResolutionInterceptor(e, "Single"), a) {
|
|
1295
|
+
var o = this.resolveRegistration(a, r);
|
|
1296
|
+
return this.executePostResolutionInterceptor(e, o, "Single"), o;
|
|
1297
|
+
}
|
|
1298
|
+
if (At(e)) {
|
|
1299
|
+
var o = this.construct(e, r);
|
|
1300
|
+
return this.executePostResolutionInterceptor(e, o, "Single"), o;
|
|
1301
|
+
}
|
|
1302
|
+
throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.");
|
|
1303
|
+
}, t.prototype.executePreResolutionInterceptor = function(e, r) {
|
|
1304
|
+
var s, a;
|
|
1305
|
+
if (this.interceptors.preResolution.has(e)) {
|
|
1306
|
+
var o = [];
|
|
1307
|
+
try {
|
|
1308
|
+
for (var f = z(this.interceptors.preResolution.getAll(e)), m = f.next(); !m.done; m = f.next()) {
|
|
1309
|
+
var w = m.value;
|
|
1310
|
+
w.options.frequency != "Once" && o.push(w), w.callback(e, r);
|
|
1311
|
+
}
|
|
1312
|
+
} catch (v) {
|
|
1313
|
+
s = { error: v };
|
|
1314
|
+
} finally {
|
|
1315
|
+
try {
|
|
1316
|
+
m && !m.done && (a = f.return) && a.call(f);
|
|
1317
|
+
} finally {
|
|
1318
|
+
if (s) throw s.error;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
this.interceptors.preResolution.setAll(e, o);
|
|
1322
|
+
}
|
|
1323
|
+
}, t.prototype.executePostResolutionInterceptor = function(e, r, s) {
|
|
1324
|
+
var a, o;
|
|
1325
|
+
if (this.interceptors.postResolution.has(e)) {
|
|
1326
|
+
var f = [];
|
|
1327
|
+
try {
|
|
1328
|
+
for (var m = z(this.interceptors.postResolution.getAll(e)), w = m.next(); !w.done; w = m.next()) {
|
|
1329
|
+
var v = w.value;
|
|
1330
|
+
v.options.frequency != "Once" && f.push(v), v.callback(e, r, s);
|
|
1331
|
+
}
|
|
1332
|
+
} catch (b) {
|
|
1333
|
+
a = { error: b };
|
|
1334
|
+
} finally {
|
|
1335
|
+
try {
|
|
1336
|
+
w && !w.done && (o = m.return) && o.call(m);
|
|
1337
|
+
} finally {
|
|
1338
|
+
if (a) throw a.error;
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
this.interceptors.postResolution.setAll(e, f);
|
|
1342
|
+
}
|
|
1343
|
+
}, t.prototype.resolveRegistration = function(e, r) {
|
|
1344
|
+
if (this.ensureNotDisposed(), e.options.lifecycle === I.ResolutionScoped && r.scopedResolutions.has(e))
|
|
1345
|
+
return r.scopedResolutions.get(e);
|
|
1346
|
+
var s = e.options.lifecycle === I.Singleton, a = e.options.lifecycle === I.ContainerScoped, o = s || a, f;
|
|
1347
|
+
return q(e.provider) ? f = e.provider.useValue : $(e.provider) ? f = o ? e.instance || (e.instance = this.resolve(e.provider.useToken, r)) : this.resolve(e.provider.useToken, r) : Ne(e.provider) ? f = o ? e.instance || (e.instance = this.construct(e.provider.useClass, r)) : this.construct(e.provider.useClass, r) : ne(e.provider) ? f = e.provider.useFactory(this) : f = this.construct(e.provider, r), e.options.lifecycle === I.ResolutionScoped && r.scopedResolutions.set(e, f), f;
|
|
1348
|
+
}, t.prototype.resolveAll = function(e, r, s) {
|
|
1349
|
+
var a = this;
|
|
1350
|
+
r === void 0 && (r = new U()), s === void 0 && (s = !1), this.ensureNotDisposed();
|
|
1351
|
+
var o = this.getAllRegistrations(e);
|
|
1352
|
+
if (!o && j(e)) {
|
|
1353
|
+
if (s)
|
|
1354
|
+
return [];
|
|
1355
|
+
throw new Error('Attempted to resolve unregistered dependency token: "' + e.toString() + '"');
|
|
1356
|
+
}
|
|
1357
|
+
if (this.executePreResolutionInterceptor(e, "All"), o) {
|
|
1358
|
+
var f = o.map(function(w) {
|
|
1359
|
+
return a.resolveRegistration(w, r);
|
|
1360
|
+
});
|
|
1361
|
+
return this.executePostResolutionInterceptor(e, f, "All"), f;
|
|
1362
|
+
}
|
|
1363
|
+
var m = [this.construct(e, r)];
|
|
1364
|
+
return this.executePostResolutionInterceptor(e, m, "All"), m;
|
|
1365
|
+
}, t.prototype.isRegistered = function(e, r) {
|
|
1366
|
+
return r === void 0 && (r = !1), this.ensureNotDisposed(), this._registry.has(e) || r && (this.parent || !1) && this.parent.isRegistered(e, !0);
|
|
1367
|
+
}, t.prototype.reset = function() {
|
|
1368
|
+
this.ensureNotDisposed(), this._registry.clear(), this.interceptors.preResolution.clear(), this.interceptors.postResolution.clear();
|
|
1369
|
+
}, t.prototype.clearInstances = function() {
|
|
1370
|
+
var e, r;
|
|
1371
|
+
this.ensureNotDisposed();
|
|
1372
|
+
try {
|
|
1373
|
+
for (var s = z(this._registry.entries()), a = s.next(); !a.done; a = s.next()) {
|
|
1374
|
+
var o = B(a.value, 2), f = o[0], m = o[1];
|
|
1375
|
+
this._registry.setAll(f, m.filter(function(w) {
|
|
1376
|
+
return !q(w.provider);
|
|
1377
|
+
}).map(function(w) {
|
|
1378
|
+
return w.instance = void 0, w;
|
|
1379
|
+
}));
|
|
1380
|
+
}
|
|
1381
|
+
} catch (w) {
|
|
1382
|
+
e = { error: w };
|
|
1383
|
+
} finally {
|
|
1384
|
+
try {
|
|
1385
|
+
a && !a.done && (r = s.return) && r.call(s);
|
|
1386
|
+
} finally {
|
|
1387
|
+
if (e) throw e.error;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
}, t.prototype.createChildContainer = function() {
|
|
1391
|
+
var e, r;
|
|
1392
|
+
this.ensureNotDisposed();
|
|
1393
|
+
var s = new t(this);
|
|
1394
|
+
try {
|
|
1395
|
+
for (var a = z(this._registry.entries()), o = a.next(); !o.done; o = a.next()) {
|
|
1396
|
+
var f = B(o.value, 2), m = f[0], w = f[1];
|
|
1397
|
+
w.some(function(v) {
|
|
1398
|
+
var b = v.options;
|
|
1399
|
+
return b.lifecycle === I.ContainerScoped;
|
|
1400
|
+
}) && s._registry.setAll(m, w.map(function(v) {
|
|
1401
|
+
return v.options.lifecycle === I.ContainerScoped ? {
|
|
1402
|
+
provider: v.provider,
|
|
1403
|
+
options: v.options
|
|
1404
|
+
} : v;
|
|
1405
|
+
}));
|
|
1406
|
+
}
|
|
1407
|
+
} catch (v) {
|
|
1408
|
+
e = { error: v };
|
|
1409
|
+
} finally {
|
|
1410
|
+
try {
|
|
1411
|
+
o && !o.done && (r = a.return) && r.call(a);
|
|
1412
|
+
} finally {
|
|
1413
|
+
if (e) throw e.error;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
return s;
|
|
1417
|
+
}, t.prototype.beforeResolution = function(e, r, s) {
|
|
1418
|
+
s === void 0 && (s = { frequency: "Always" }), this.interceptors.preResolution.set(e, {
|
|
1419
|
+
callback: r,
|
|
1420
|
+
options: s
|
|
1421
|
+
});
|
|
1422
|
+
}, t.prototype.afterResolution = function(e, r, s) {
|
|
1423
|
+
s === void 0 && (s = { frequency: "Always" }), this.interceptors.postResolution.set(e, {
|
|
1424
|
+
callback: r,
|
|
1425
|
+
options: s
|
|
1426
|
+
});
|
|
1427
|
+
}, t.prototype.dispose = function() {
|
|
1428
|
+
return It(this, void 0, void 0, function() {
|
|
1429
|
+
var e;
|
|
1430
|
+
return Ct(this, function(r) {
|
|
1431
|
+
switch (r.label) {
|
|
1432
|
+
case 0:
|
|
1433
|
+
return this.disposed = !0, e = [], this.disposables.forEach(function(s) {
|
|
1434
|
+
var a = s.dispose();
|
|
1435
|
+
a && e.push(a);
|
|
1436
|
+
}), [4, Promise.all(e)];
|
|
1437
|
+
case 1:
|
|
1438
|
+
return r.sent(), [2];
|
|
1439
|
+
}
|
|
1440
|
+
});
|
|
1441
|
+
});
|
|
1442
|
+
}, t.prototype.getRegistration = function(e) {
|
|
1443
|
+
return this.isRegistered(e) ? this._registry.get(e) : this.parent ? this.parent.getRegistration(e) : null;
|
|
1444
|
+
}, t.prototype.getAllRegistrations = function(e) {
|
|
1445
|
+
return this.isRegistered(e) ? this._registry.getAll(e) : this.parent ? this.parent.getAllRegistrations(e) : null;
|
|
1446
|
+
}, t.prototype.construct = function(e, r) {
|
|
1447
|
+
var s = this;
|
|
1448
|
+
if (e instanceof He)
|
|
1449
|
+
return e.createProxy(function(o) {
|
|
1450
|
+
return s.resolve(o, r);
|
|
1451
|
+
});
|
|
1452
|
+
var a = (function() {
|
|
1453
|
+
var o = Fe.get(e);
|
|
1454
|
+
if (!o || o.length === 0) {
|
|
1455
|
+
if (e.length === 0)
|
|
1456
|
+
return new e();
|
|
1457
|
+
throw new Error('TypeInfo not known for "' + e.name + '"');
|
|
1458
|
+
}
|
|
1459
|
+
var f = o.map(s.resolveParams(r, e));
|
|
1460
|
+
return new (e.bind.apply(e, A([void 0], f)))();
|
|
1461
|
+
})();
|
|
1462
|
+
return Ft(a) && this.disposables.add(a), a;
|
|
1463
|
+
}, t.prototype.resolveParams = function(e, r) {
|
|
1464
|
+
var s = this;
|
|
1465
|
+
return function(a, o) {
|
|
1466
|
+
var f, m, w;
|
|
1467
|
+
try {
|
|
1468
|
+
return xt(a) ? xe(a) ? a.multiple ? (f = s.resolve(a.transform)).transform.apply(f, A([s.resolveAll(a.token, new U(), a.isOptional)], a.transformArgs)) : (m = s.resolve(a.transform)).transform.apply(m, A([s.resolve(a.token, e, a.isOptional)], a.transformArgs)) : a.multiple ? s.resolveAll(a.token, new U(), a.isOptional) : s.resolve(a.token, e, a.isOptional) : xe(a) ? (w = s.resolve(a.transform, e)).transform.apply(w, A([s.resolve(a.token, e)], a.transformArgs)) : s.resolve(a, e);
|
|
1469
|
+
} catch (v) {
|
|
1470
|
+
throw new Error(Ht(r, o, v));
|
|
1471
|
+
}
|
|
1472
|
+
};
|
|
1473
|
+
}, t.prototype.ensureNotDisposed = function() {
|
|
1474
|
+
if (this.disposed)
|
|
1475
|
+
throw new Error("This container has been disposed, you cannot interact with a disposed container");
|
|
1476
|
+
}, t;
|
|
1477
|
+
})(), zt = new Wt();
|
|
1478
|
+
function fe(t, e) {
|
|
1479
|
+
var r = {
|
|
1480
|
+
token: t,
|
|
1481
|
+
multiple: !1,
|
|
1482
|
+
isOptional: e
|
|
1483
|
+
};
|
|
1484
|
+
return je(r);
|
|
1485
|
+
}
|
|
1486
|
+
function L(t) {
|
|
1487
|
+
return function(e) {
|
|
1488
|
+
Fe.set(e, Tt(e));
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
function Ut(t, e) {
|
|
1492
|
+
var r = {
|
|
1493
|
+
token: t,
|
|
1494
|
+
multiple: !0,
|
|
1495
|
+
isOptional: e
|
|
1496
|
+
};
|
|
1497
|
+
return je(r);
|
|
1498
|
+
}
|
|
1499
|
+
if (typeof Reflect > "u" || !Reflect.getMetadata)
|
|
1500
|
+
throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);
|
|
1501
|
+
var $t = Object.getOwnPropertyDescriptor, qt = (t, e, r, s) => {
|
|
1502
|
+
for (var a = s > 1 ? void 0 : s ? $t(e, r) : e, o = t.length - 1, f; o >= 0; o--)
|
|
1503
|
+
(f = t[o]) && (a = f(a) || a);
|
|
1504
|
+
return a;
|
|
1505
|
+
};
|
|
1506
|
+
let Ae = class extends ke {
|
|
123
1507
|
/** Orbit-контроллер для управления камерой */
|
|
124
1508
|
orbit;
|
|
125
1509
|
/** Raycast для подсветки моделей при наведении */
|
|
@@ -133,10 +1517,46 @@ class F extends u {
|
|
|
133
1517
|
* Создает сетку, оси координат и orbit-контроллер.
|
|
134
1518
|
* @param canvas - HTMLCanvasElement для рендеринга
|
|
135
1519
|
*/
|
|
136
|
-
constructor(
|
|
137
|
-
super(
|
|
138
|
-
const
|
|
139
|
-
|
|
1520
|
+
constructor(t) {
|
|
1521
|
+
super(t);
|
|
1522
|
+
const e = new mt(this.gl.gl, { size: 10, divisions: 10 });
|
|
1523
|
+
e.position.y = -1e-3, e.setParent(this.scene), new wt(this.gl.gl, { size: 6, symmetric: !0 }).setParent(this.scene), this.orbit = new St(this.camera, { element: this.canvas }), this.raycast = new Mt(), this.mouse = new _t(), this.isEventListenersAdded = !1;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Добавляет фигуру в сцену и сохраняет его во внутреннем массиве.
|
|
1527
|
+
*
|
|
1528
|
+
* @param mesh - Фигура для добавления в сцену.
|
|
1529
|
+
* @internal
|
|
1530
|
+
*/
|
|
1531
|
+
addMesh(t) {
|
|
1532
|
+
this.scene.addChild(t);
|
|
1533
|
+
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Возвращает WebGL контекст рендерера.
|
|
1536
|
+
*
|
|
1537
|
+
* @returns Контекст WebGL (OGLRenderingContext) текущей сцены.
|
|
1538
|
+
* @internal
|
|
1539
|
+
*/
|
|
1540
|
+
getContext() {
|
|
1541
|
+
return this.gl.gl;
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Убирает фигуру со сцены
|
|
1545
|
+
*
|
|
1546
|
+
* @param mesh - Фигура для удаления со сцены.
|
|
1547
|
+
* @internal
|
|
1548
|
+
*/
|
|
1549
|
+
removeMesh(t) {
|
|
1550
|
+
this.scene.removeChild(t);
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Возвращает список всех фигур, находящихся в сцене.
|
|
1554
|
+
*
|
|
1555
|
+
* @returns Массив текущих фигур.
|
|
1556
|
+
* @internal
|
|
1557
|
+
*/
|
|
1558
|
+
getMeshes() {
|
|
1559
|
+
return this.meshes;
|
|
140
1560
|
}
|
|
141
1561
|
/**
|
|
142
1562
|
* Обновление состояния рендерера.
|
|
@@ -147,23 +1567,23 @@ class F extends u {
|
|
|
147
1567
|
/**
|
|
148
1568
|
* Метод для добавления фигуры.
|
|
149
1569
|
* Настройка raycast.
|
|
150
|
-
* @param figure Данные фигуры: position, normal, uv
|
|
1570
|
+
* @param figure - Данные фигуры: position, normal, uv
|
|
151
1571
|
*/
|
|
152
|
-
addFigure(
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
|
|
1572
|
+
addFigure(t) {
|
|
1573
|
+
const e = super.addFigure(t);
|
|
1574
|
+
if (e.geometry) {
|
|
1575
|
+
const r = e.geometry.constructor.name;
|
|
1576
|
+
e.geometry.raycast = r.includes("Sphere") ? "sphere" : "box";
|
|
157
1577
|
}
|
|
158
|
-
return
|
|
159
|
-
this.updateHitUniform(
|
|
160
|
-
}), this.isEventListenersAdded || this.initMouseListeners(),
|
|
1578
|
+
return e.isHit = !1, e.onBeforeRender(({ mesh: r }) => {
|
|
1579
|
+
this.updateHitUniform(r);
|
|
1580
|
+
}), this.isEventListenersAdded || this.initMouseListeners(), e;
|
|
161
1581
|
}
|
|
162
1582
|
/**
|
|
163
1583
|
* Обновление uniform uHit для конкретной 3D-модели
|
|
164
1584
|
*/
|
|
165
|
-
updateHitUniform(
|
|
166
|
-
this.program.uniforms.uHit.value =
|
|
1585
|
+
updateHitUniform(t) {
|
|
1586
|
+
this.program.uniforms.uHit.value = t.isHit ? 1 : 0;
|
|
167
1587
|
}
|
|
168
1588
|
/**
|
|
169
1589
|
* Инициализация обработчиков мыши для raycast
|
|
@@ -174,16 +1594,19 @@ class F extends u {
|
|
|
174
1594
|
/**
|
|
175
1595
|
* Обработчик движения мыши
|
|
176
1596
|
*/
|
|
177
|
-
handleMouseMove = (
|
|
1597
|
+
handleMouseMove = (t) => {
|
|
178
1598
|
if (this.orbit.isInteracting) return;
|
|
179
|
-
this.mouse.set(2 * (
|
|
1599
|
+
this.mouse.set(2 * (t.x / this.gl.width) - 1, 2 * (1 - t.y / this.gl.height) - 1), this.raycast.castMouse(this.camera, this.mouse), this.meshes.forEach((r) => r.isHit = !1), this.raycast.intersectBounds(this.meshes).forEach((r) => r.isHit = !0);
|
|
180
1600
|
};
|
|
181
1601
|
/** Деструктор */
|
|
182
1602
|
destroy() {
|
|
183
1603
|
this.isEventListenersAdded && (window.removeEventListener("mousemove", this.handleMouseMove, !1), this.isEventListenersAdded = !1), this.orbit = null, this.raycast = null, this.mouse = null, super.destroy();
|
|
184
1604
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
1605
|
+
};
|
|
1606
|
+
Ae = qt([
|
|
1607
|
+
L()
|
|
1608
|
+
], Ae);
|
|
1609
|
+
class ur extends ke {
|
|
187
1610
|
/** Orbit-контроллер для управления камерой */
|
|
188
1611
|
orbit;
|
|
189
1612
|
/**
|
|
@@ -191,9 +1614,9 @@ class z extends u {
|
|
|
191
1614
|
* @param canvas - HTMLCanvasElement для рендеринга
|
|
192
1615
|
*/
|
|
193
1616
|
constructor(e) {
|
|
194
|
-
super(e), this.orbit = new
|
|
1617
|
+
super(e), this.orbit = new De(this.camera, {
|
|
195
1618
|
element: this.canvas,
|
|
196
|
-
target: new
|
|
1619
|
+
target: new bt(0, 0, 0),
|
|
197
1620
|
minPolarAngle: Math.PI / 2,
|
|
198
1621
|
maxPolarAngle: Math.PI / 2,
|
|
199
1622
|
enableRotate: !0,
|
|
@@ -208,7 +1631,7 @@ class z extends u {
|
|
|
208
1631
|
this.orbit?.update();
|
|
209
1632
|
}
|
|
210
1633
|
}
|
|
211
|
-
class
|
|
1634
|
+
class Bt {
|
|
212
1635
|
/** Тип фигуры */
|
|
213
1636
|
type;
|
|
214
1637
|
/** Позиции вершин */
|
|
@@ -227,8 +1650,8 @@ class A {
|
|
|
227
1650
|
this.type = e.type, this.position = e.position, this.normal = e.normal ?? [], this.uv = e.uv ?? [], this.material = e.material;
|
|
228
1651
|
}
|
|
229
1652
|
}
|
|
230
|
-
var
|
|
231
|
-
class
|
|
1653
|
+
var Ge = /* @__PURE__ */ ((t) => (t[t.Cube = 0] = "Cube", t[t.Sphere = 1] = "Sphere", t[t.Plane = 2] = "Plane", t[t.Cylinder = 3] = "Cylinder", t[t.Custom = 4] = "Custom", t))(Ge || {}), G = /* @__PURE__ */ ((t) => (t.Plane = "plane", t.Wireframe = "wireframe", t.Texture = "texture", t))(G || {});
|
|
1654
|
+
class lr {
|
|
232
1655
|
/** Позиции вершин */
|
|
233
1656
|
positions = [];
|
|
234
1657
|
/** Нормали вершин */
|
|
@@ -241,64 +1664,206 @@ class C {
|
|
|
241
1664
|
tmpUVs = [];
|
|
242
1665
|
/**
|
|
243
1666
|
* Загружает OBJ-модель в Figure
|
|
244
|
-
* @param objContent Строка содержимого .obj файла
|
|
1667
|
+
* @param objContent - Строка содержимого .obj файла
|
|
245
1668
|
*/
|
|
246
1669
|
load(e) {
|
|
247
|
-
const
|
|
1670
|
+
const r = e.split(`
|
|
248
1671
|
`);
|
|
249
|
-
for (const a of
|
|
1672
|
+
for (const a of r) {
|
|
250
1673
|
if (!a.trim() || a.startsWith("#")) continue;
|
|
251
|
-
const
|
|
252
|
-
switch (
|
|
1674
|
+
const o = a.trim().split(/\s+/);
|
|
1675
|
+
switch (o[0]) {
|
|
253
1676
|
case "v":
|
|
254
|
-
this.tmpPositions.push(
|
|
1677
|
+
this.tmpPositions.push(o.slice(1).map(Number));
|
|
255
1678
|
break;
|
|
256
1679
|
case "vn":
|
|
257
|
-
this.tmpNormals.push(
|
|
1680
|
+
this.tmpNormals.push(o.slice(1).map(Number));
|
|
258
1681
|
break;
|
|
259
1682
|
case "vt":
|
|
260
|
-
this.tmpUVs.push(
|
|
1683
|
+
this.tmpUVs.push(o.slice(1).map(Number));
|
|
261
1684
|
break;
|
|
262
1685
|
case "f":
|
|
263
|
-
this.processFaceLine(
|
|
1686
|
+
this.processFaceLine(o);
|
|
264
1687
|
break;
|
|
265
1688
|
}
|
|
266
1689
|
}
|
|
267
|
-
const
|
|
268
|
-
type:
|
|
1690
|
+
const s = {
|
|
1691
|
+
type: Ge.Custom,
|
|
269
1692
|
position: this.positions,
|
|
270
1693
|
...this.normals.length > 0 && { normal: this.normals },
|
|
271
1694
|
...this.uvs.length > 0 && { uv: this.uvs }
|
|
272
1695
|
};
|
|
273
|
-
return new
|
|
1696
|
+
return new Bt(s);
|
|
274
1697
|
}
|
|
275
1698
|
/**
|
|
276
1699
|
* Обрабатывает строку face (f) и разворачивает индексы в массивы для рендеринга
|
|
277
1700
|
*/
|
|
278
1701
|
processFaceLine(e) {
|
|
279
|
-
for (let
|
|
280
|
-
const
|
|
281
|
-
if (!
|
|
282
|
-
const [a,
|
|
283
|
-
if (h !== void 0) {
|
|
284
|
-
const n = this.tmpPositions[h - 1];
|
|
285
|
-
n && this.positions.push(...n);
|
|
286
|
-
}
|
|
287
|
-
if (l !== void 0) {
|
|
288
|
-
const n = this.tmpUVs[l - 1];
|
|
289
|
-
n && this.uvs.push(...n);
|
|
290
|
-
}
|
|
1702
|
+
for (let r = 1; r < e.length; r++) {
|
|
1703
|
+
const s = e[r];
|
|
1704
|
+
if (!s) continue;
|
|
1705
|
+
const [a, o, f] = s.split("/"), m = a ? parseInt(a, 10) : void 0, w = o ? parseInt(o, 10) : void 0, v = f ? parseInt(f, 10) : void 0;
|
|
291
1706
|
if (m !== void 0) {
|
|
292
|
-
const
|
|
293
|
-
|
|
1707
|
+
const b = this.tmpPositions[m - 1];
|
|
1708
|
+
b && this.positions.push(...b);
|
|
1709
|
+
}
|
|
1710
|
+
if (w !== void 0) {
|
|
1711
|
+
const b = this.tmpUVs[w - 1];
|
|
1712
|
+
b && this.uvs.push(...b);
|
|
1713
|
+
}
|
|
1714
|
+
if (v !== void 0) {
|
|
1715
|
+
const b = this.tmpNormals[v - 1];
|
|
1716
|
+
b && this.normals.push(...b);
|
|
294
1717
|
}
|
|
295
1718
|
}
|
|
296
1719
|
}
|
|
297
1720
|
}
|
|
1721
|
+
var Zt = Object.getOwnPropertyDescriptor, Jt = (t, e, r, s) => {
|
|
1722
|
+
for (var a = s > 1 ? void 0 : s ? Zt(e, r) : e, o = t.length - 1, f; o >= 0; o--)
|
|
1723
|
+
(f = t[o]) && (a = f(a) || a);
|
|
1724
|
+
return a;
|
|
1725
|
+
}, Yt = (t, e) => (r, s) => e(r, s, t);
|
|
1726
|
+
let ie = class {
|
|
1727
|
+
/** Текущий режим отображения */
|
|
1728
|
+
currentMode = G.Plane;
|
|
1729
|
+
/** Хендлеры, которые управляют отображением */
|
|
1730
|
+
handlers;
|
|
1731
|
+
constructor(t) {
|
|
1732
|
+
this.handlers = new Map(t.map((e) => [e.mode, e]));
|
|
1733
|
+
}
|
|
1734
|
+
/** Установка режима отображения */
|
|
1735
|
+
manage(t) {
|
|
1736
|
+
t !== this.currentMode && (this.handlers.get(this.currentMode)?.rollback(), t !== G.Plane && this.handlers.get(t)?.handle(), this.currentMode = t);
|
|
1737
|
+
}
|
|
1738
|
+
/** Освобождение ресурсов */
|
|
1739
|
+
destroy() {
|
|
1740
|
+
this.handlers && this.handlers.clear(), this.currentMode = G.Plane;
|
|
1741
|
+
}
|
|
1742
|
+
};
|
|
1743
|
+
ie = Jt([
|
|
1744
|
+
L(),
|
|
1745
|
+
Yt(0, Ut("IDisplayHandler"))
|
|
1746
|
+
], ie);
|
|
1747
|
+
var Qt = Object.getOwnPropertyDescriptor, Xt = (t, e, r, s) => {
|
|
1748
|
+
for (var a = s > 1 ? void 0 : s ? Qt(e, r) : e, o = t.length - 1, f; o >= 0; o--)
|
|
1749
|
+
(f = t[o]) && (a = f(a) || a);
|
|
1750
|
+
return a;
|
|
1751
|
+
}, Kt = (t, e) => (r, s) => e(r, s, t);
|
|
1752
|
+
let se = class {
|
|
1753
|
+
constructor(t) {
|
|
1754
|
+
this.api = t, this.wireMeshes = [], this.context = this.api.getContext(), this.wireMeshProgram = new Pt(this.context);
|
|
1755
|
+
}
|
|
1756
|
+
/** Режим отображения */
|
|
1757
|
+
mode = G.Wireframe;
|
|
1758
|
+
/** Wireframe-модели для добавленных на сцену объектов */
|
|
1759
|
+
wireMeshes;
|
|
1760
|
+
/** Настройки рендеринга для режима wireframe */
|
|
1761
|
+
wireMeshProgram;
|
|
1762
|
+
/** WebGl контекст */
|
|
1763
|
+
context;
|
|
1764
|
+
/**
|
|
1765
|
+
* Применяет wireframe-режим к сцене.
|
|
1766
|
+
*/
|
|
1767
|
+
handle() {
|
|
1768
|
+
const t = this.api.getMeshes();
|
|
1769
|
+
this.createWireMeshes(t), this.api.removeMeshes(t), this.api.addMeshes(this.wireMeshes);
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Отменяет wireframe-режим у сцены.
|
|
1773
|
+
*/
|
|
1774
|
+
rollback() {
|
|
1775
|
+
const t = this.api.getMeshes();
|
|
1776
|
+
this.api.removeMeshes(this.wireMeshes), this.api.addMeshes(t);
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* Освобождает ресурсы хендлера, удаляет wireframe-модели со сцены.
|
|
1780
|
+
*/
|
|
1781
|
+
destroy() {
|
|
1782
|
+
this.wireMeshes && (this.wireMeshes.length = 0, this.wireMeshes = []);
|
|
1783
|
+
}
|
|
1784
|
+
/**
|
|
1785
|
+
* Создание wireframe-моделей для фигур на сцене.
|
|
1786
|
+
*/
|
|
1787
|
+
createWireMeshes(t) {
|
|
1788
|
+
for (const e of t) {
|
|
1789
|
+
const r = new Rt(this.context, {
|
|
1790
|
+
geometry: e.geometry,
|
|
1791
|
+
program: this.wireMeshProgram
|
|
1792
|
+
});
|
|
1793
|
+
this.wireMeshes.push(r);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
se = Xt([
|
|
1798
|
+
L(),
|
|
1799
|
+
Kt(0, fe("RendererApi"))
|
|
1800
|
+
], se);
|
|
1801
|
+
var er = Object.getOwnPropertyDescriptor, tr = (t, e, r, s) => {
|
|
1802
|
+
for (var a = s > 1 ? void 0 : s ? er(e, r) : e, o = t.length - 1, f; o >= 0; o--)
|
|
1803
|
+
(f = t[o]) && (a = f(a) || a);
|
|
1804
|
+
return a;
|
|
1805
|
+
}, rr = (t, e) => (r, s) => e(r, s, t);
|
|
1806
|
+
let ae = class {
|
|
1807
|
+
constructor(t) {
|
|
1808
|
+
this.renderer = t;
|
|
1809
|
+
}
|
|
1810
|
+
addMesh(t) {
|
|
1811
|
+
this.renderer.addMesh(t);
|
|
1812
|
+
}
|
|
1813
|
+
addMeshes(t) {
|
|
1814
|
+
for (const e of t)
|
|
1815
|
+
this.renderer.addMesh(e);
|
|
1816
|
+
}
|
|
1817
|
+
removeMesh(t) {
|
|
1818
|
+
this.renderer.removeMesh(t);
|
|
1819
|
+
}
|
|
1820
|
+
removeMeshes(t) {
|
|
1821
|
+
for (const e of t)
|
|
1822
|
+
this.renderer.removeMesh(e);
|
|
1823
|
+
}
|
|
1824
|
+
getMeshes() {
|
|
1825
|
+
return this.renderer.getMeshes();
|
|
1826
|
+
}
|
|
1827
|
+
getContext() {
|
|
1828
|
+
return this.renderer.getContext();
|
|
1829
|
+
}
|
|
1830
|
+
};
|
|
1831
|
+
ae = tr([
|
|
1832
|
+
L(),
|
|
1833
|
+
rr(0, fe("EditorRenderer"))
|
|
1834
|
+
], ae);
|
|
1835
|
+
var nr = Object.getOwnPropertyDescriptor, ir = (t, e, r, s) => {
|
|
1836
|
+
for (var a = s > 1 ? void 0 : s ? nr(e, r) : e, o = t.length - 1, f; o >= 0; o--)
|
|
1837
|
+
(f = t[o]) && (a = f(a) || a);
|
|
1838
|
+
return a;
|
|
1839
|
+
}, sr = (t, e) => (r, s) => e(r, s, t);
|
|
1840
|
+
let oe = class {
|
|
1841
|
+
constructor(t) {
|
|
1842
|
+
this.displayManager = t;
|
|
1843
|
+
}
|
|
1844
|
+
setDisplayMode(t) {
|
|
1845
|
+
this.displayManager.manage(t);
|
|
1846
|
+
}
|
|
1847
|
+
destroy() {
|
|
1848
|
+
this.displayManager.destroy();
|
|
1849
|
+
}
|
|
1850
|
+
};
|
|
1851
|
+
oe = ir([
|
|
1852
|
+
L(),
|
|
1853
|
+
sr(0, fe("IDisplayManager"))
|
|
1854
|
+
], oe);
|
|
1855
|
+
function ar(t) {
|
|
1856
|
+
const e = zt.createChildContainer();
|
|
1857
|
+
return e.registerInstance("EditorRenderer", t), e.registerSingleton("RendererApi", ae), e.registerSingleton("IDisplayHandler", se), e.registerSingleton("IDisplayManager", ie), e.registerSingleton("EditorHub", oe), e;
|
|
1858
|
+
}
|
|
1859
|
+
function fr(t) {
|
|
1860
|
+
return ar(t).resolve("EditorHub");
|
|
1861
|
+
}
|
|
298
1862
|
export {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
1863
|
+
oe as EditorHub,
|
|
1864
|
+
Ae as EditorRenderer,
|
|
1865
|
+
lr as ObjLoader,
|
|
1866
|
+
ur as PreviewRenderer,
|
|
1867
|
+
ke as Renderer,
|
|
1868
|
+
fr as createAppHub
|
|
304
1869
|
};
|