mxcad 1.0.3 → 1.0.5
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/LICENSE.md +9 -9
- package/README.md +60 -60
- package/dist/mxcad.d.ts +34 -12
- package/dist/mxcad.es.js +1341 -1188
- package/dist/mxcad.umd.js +49 -38
- package/dist/mxdrawassembly_min.wasm.wasm +0 -0
- package/package.json +14 -13
package/dist/mxcad.es.js
CHANGED
|
@@ -1,1159 +1,308 @@
|
|
|
1
|
-
import { MxFun as I, MrxDbgUiPrPoint as
|
|
2
|
-
async function
|
|
3
|
-
const
|
|
4
|
-
return await WebAssembly.instantiate(
|
|
1
|
+
import { MxFun as I, MrxDbgUiPrPoint as oe, store as Ve, MxPaintBrush as q, MrxDbgUiPrBaseReturn as b, MxDbCircleShape as mt, MxDbLine as Re, MxDbPolyline as Kt, MxDbRegularPolygon as jt, MxDbCircleArc as De, Mx3PointArc as Ot, MxDbEllipseShape as kt } from "mxdraw";
|
|
2
|
+
async function qt(i, o) {
|
|
3
|
+
const f = await (await fetch(i)).arrayBuffer();
|
|
4
|
+
return await WebAssembly.instantiate(f, o);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return btoa(unescape(encodeURIComponent(
|
|
6
|
+
function Vt(i) {
|
|
7
|
+
return btoa(unescape(encodeURIComponent(i)));
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return decodeURIComponent(escape(atob(
|
|
9
|
+
function Ht(i) {
|
|
10
|
+
return decodeURIComponent(escape(atob(i)));
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
I.callCommand("MxCAD_SetEntityData",
|
|
12
|
+
function Nt(i) {
|
|
13
|
+
let o = JSON.stringify(i);
|
|
14
|
+
I.callCommand("MxCAD_SetEntityData", o);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
b64Encode:
|
|
18
|
-
b64Decode:
|
|
19
|
-
setMcDbEntity:
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
b64Decode: wt,
|
|
25
|
-
setMcDbEntity: vt,
|
|
26
|
-
MxTools: Ve
|
|
27
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
28
|
-
function Ht() {
|
|
29
|
-
var o = (() => {
|
|
30
|
-
var s = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
|
|
31
|
-
return typeof __filename < "u" && (s = s || __filename), function(l) {
|
|
32
|
-
l = l || {};
|
|
33
|
-
var n;
|
|
34
|
-
n || (n = typeof l < "u" ? l : {});
|
|
35
|
-
var f, _;
|
|
36
|
-
n.ready = new Promise(function(e, t) {
|
|
37
|
-
f = e, _ = t;
|
|
38
|
-
});
|
|
39
|
-
var p = Object.assign({}, n), E = typeof window == "object", m = typeof importScripts == "function", y = "", w, D, R, A, v, T;
|
|
40
|
-
typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" ? (y = m ? xxxxx("path").dirname(y) + "/" : __dirname + "/", T = () => {
|
|
41
|
-
v || (A = xxxxx("fs"), v = xxxxx("path"));
|
|
42
|
-
}, w = function(e, t) {
|
|
43
|
-
return T(), e = v.normalize(e), A.readFileSync(e, t ? void 0 : "utf8");
|
|
44
|
-
}, R = (e) => (e = w(e, !0), e.buffer || (e = new Uint8Array(e)), e), D = (e, t, r) => {
|
|
45
|
-
T(), e = v.normalize(e), A.readFile(e, function(i, c) {
|
|
46
|
-
i ? r(i) : t(c.buffer);
|
|
47
|
-
});
|
|
48
|
-
}, 1 < process.argv.length && process.argv[1].replace(/\\/g, "/"), process.argv.slice(2), process.on("uncaughtException", function(e) {
|
|
49
|
-
throw e;
|
|
50
|
-
}), process.on("unhandledRejection", function(e) {
|
|
51
|
-
throw e;
|
|
52
|
-
}), n.inspect = function() {
|
|
53
|
-
return "[Emscripten Module object]";
|
|
54
|
-
}) : (E || m) && (m ? y = self.location.href : typeof document < "u" && document.currentScript && (y = document.currentScript.src), s && (y = s), y = y.indexOf("blob:") !== 0 ? y.substr(0, y.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", w = (e) => {
|
|
55
|
-
var t = new XMLHttpRequest();
|
|
56
|
-
return t.open("GET", e, !1), t.send(null), t.responseText;
|
|
57
|
-
}, m && (R = (e) => {
|
|
58
|
-
var t = new XMLHttpRequest();
|
|
59
|
-
return t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
|
|
60
|
-
}), D = (e, t, r) => {
|
|
61
|
-
var i = new XMLHttpRequest();
|
|
62
|
-
i.open("GET", e, !0), i.responseType = "arraybuffer", i.onload = () => {
|
|
63
|
-
i.status == 200 || i.status == 0 && i.response ? t(i.response) : r();
|
|
64
|
-
}, i.onerror = r, i.send(null);
|
|
65
|
-
});
|
|
66
|
-
var H = n.print || console.log.bind(console), b = n.printErr || console.warn.bind(console);
|
|
67
|
-
Object.assign(n, p), p = null;
|
|
68
|
-
function j(e) {
|
|
69
|
-
O || (O = {}), O[e] || (O[e] = 1, b(e));
|
|
70
|
-
}
|
|
71
|
-
var O, X;
|
|
72
|
-
n.wasmBinary && (X = n.wasmBinary), n.noExitRuntime, typeof WebAssembly != "object" && se("no native wasm support detected");
|
|
73
|
-
var V, N = !1, z = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
|
|
74
|
-
function q(e, t, r) {
|
|
75
|
-
var i = t + r;
|
|
76
|
-
for (r = t; e[r] && !(r >= i); )
|
|
77
|
-
++r;
|
|
78
|
-
if (16 < r - t && e.buffer && z)
|
|
79
|
-
return z.decode(e.subarray(t, r));
|
|
80
|
-
for (i = ""; t < r; ) {
|
|
81
|
-
var c = e[t++];
|
|
82
|
-
if (c & 128) {
|
|
83
|
-
var u = e[t++] & 63;
|
|
84
|
-
if ((c & 224) == 192)
|
|
85
|
-
i += String.fromCharCode((c & 31) << 6 | u);
|
|
86
|
-
else {
|
|
87
|
-
var a = e[t++] & 63;
|
|
88
|
-
c = (c & 240) == 224 ? (c & 15) << 12 | u << 6 | a : (c & 7) << 18 | u << 12 | a << 6 | e[t++] & 63, 65536 > c ? i += String.fromCharCode(c) : (c -= 65536, i += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023));
|
|
89
|
-
}
|
|
90
|
-
} else
|
|
91
|
-
i += String.fromCharCode(c);
|
|
92
|
-
}
|
|
93
|
-
return i;
|
|
94
|
-
}
|
|
95
|
-
function ue(e, t) {
|
|
96
|
-
return e ? q(J, e, t) : "";
|
|
97
|
-
}
|
|
98
|
-
function he(e, t, r, i) {
|
|
99
|
-
if (!(0 < i))
|
|
100
|
-
return 0;
|
|
101
|
-
var c = r;
|
|
102
|
-
i = r + i - 1;
|
|
103
|
-
for (var u = 0; u < e.length; ++u) {
|
|
104
|
-
var a = e.charCodeAt(u);
|
|
105
|
-
if (55296 <= a && 57343 >= a) {
|
|
106
|
-
var d = e.charCodeAt(++u);
|
|
107
|
-
a = 65536 + ((a & 1023) << 10) | d & 1023;
|
|
108
|
-
}
|
|
109
|
-
if (127 >= a) {
|
|
110
|
-
if (r >= i)
|
|
111
|
-
break;
|
|
112
|
-
t[r++] = a;
|
|
113
|
-
} else {
|
|
114
|
-
if (2047 >= a) {
|
|
115
|
-
if (r + 1 >= i)
|
|
116
|
-
break;
|
|
117
|
-
t[r++] = 192 | a >> 6;
|
|
118
|
-
} else {
|
|
119
|
-
if (65535 >= a) {
|
|
120
|
-
if (r + 2 >= i)
|
|
121
|
-
break;
|
|
122
|
-
t[r++] = 224 | a >> 12;
|
|
123
|
-
} else {
|
|
124
|
-
if (r + 3 >= i)
|
|
125
|
-
break;
|
|
126
|
-
t[r++] = 240 | a >> 18, t[r++] = 128 | a >> 12 & 63;
|
|
127
|
-
}
|
|
128
|
-
t[r++] = 128 | a >> 6 & 63;
|
|
129
|
-
}
|
|
130
|
-
t[r++] = 128 | a & 63;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return t[r] = 0, r - c;
|
|
134
|
-
}
|
|
135
|
-
var ye, K, J, M, Ee, ge;
|
|
136
|
-
function He() {
|
|
137
|
-
var e = V.buffer;
|
|
138
|
-
ye = e, n.HEAP8 = K = new Int8Array(e), n.HEAP16 = new Int16Array(e), n.HEAP32 = M = new Int32Array(e), n.HEAPU8 = J = new Uint8Array(e), n.HEAPU16 = new Uint16Array(e), n.HEAPU32 = new Uint32Array(e), n.HEAPF32 = Ee = new Float32Array(e), n.HEAPF64 = ge = new Float64Array(e);
|
|
139
|
-
}
|
|
140
|
-
var Ne, ze = [], Ge = [], Xe = [];
|
|
141
|
-
function Mt() {
|
|
142
|
-
var e = n.preRun.shift();
|
|
143
|
-
ze.unshift(e);
|
|
144
|
-
}
|
|
145
|
-
var oe = 0, fe = null;
|
|
146
|
-
n.preloadedImages = {}, n.preloadedAudios = {};
|
|
147
|
-
function se(e) {
|
|
148
|
-
throw n.onAbort && n.onAbort(e), e = "Aborted(" + e + ")", b(e), N = !0, e = new WebAssembly.RuntimeError(e + ". Build with -s ASSERTIONS=1 for more info."), _(e), e;
|
|
149
|
-
}
|
|
150
|
-
function $e() {
|
|
151
|
-
return $.startsWith("data:application/octet-stream;base64,");
|
|
152
|
-
}
|
|
153
|
-
var $;
|
|
154
|
-
if ($ = "mxdrawassembly_min.wasm.wasm", !$e()) {
|
|
155
|
-
var Ye = $;
|
|
156
|
-
$ = n.locateFile ? n.locateFile(Ye, y) : y + Ye;
|
|
157
|
-
}
|
|
158
|
-
function Ze() {
|
|
159
|
-
var e = $;
|
|
160
|
-
try {
|
|
161
|
-
if (e == $ && X)
|
|
162
|
-
return new Uint8Array(X);
|
|
163
|
-
if (R)
|
|
164
|
-
return R(e);
|
|
165
|
-
throw "both async and sync fetching of the wasm failed";
|
|
166
|
-
} catch (t) {
|
|
167
|
-
se(t);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
function Pt() {
|
|
171
|
-
if (!X && (E || m)) {
|
|
172
|
-
if (typeof fetch == "function" && !$.startsWith("file://"))
|
|
173
|
-
return fetch($, { credentials: "same-origin" }).then(function(e) {
|
|
174
|
-
if (!e.ok)
|
|
175
|
-
throw "failed to load wasm binary file at '" + $ + "'";
|
|
176
|
-
return e.arrayBuffer();
|
|
177
|
-
}).catch(function() {
|
|
178
|
-
return Ze();
|
|
179
|
-
});
|
|
180
|
-
if (D)
|
|
181
|
-
return new Promise(function(e, t) {
|
|
182
|
-
D($, function(r) {
|
|
183
|
-
e(new Uint8Array(r));
|
|
184
|
-
}, t);
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
return Promise.resolve().then(function() {
|
|
188
|
-
return Ze();
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
function Te(e) {
|
|
192
|
-
for (; 0 < e.length; ) {
|
|
193
|
-
var t = e.shift();
|
|
194
|
-
if (typeof t == "function")
|
|
195
|
-
t(n);
|
|
196
|
-
else {
|
|
197
|
-
var r = t.Da;
|
|
198
|
-
typeof r == "number" ? t.da === void 0 ? Qe(r)() : Qe(r)(t.da) : r(t.da === void 0 ? null : t.da);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
var _e = [];
|
|
203
|
-
function Qe(e) {
|
|
204
|
-
var t = _e[e];
|
|
205
|
-
return t || (e >= _e.length && (_e.length = e + 1), _e[e] = t = Ne.get(e)), t;
|
|
206
|
-
}
|
|
207
|
-
function Je(e, t) {
|
|
208
|
-
if (0 >= e)
|
|
209
|
-
return e;
|
|
210
|
-
var r = 32 >= t ? Math.abs(1 << t - 1) : Math.pow(2, t - 1);
|
|
211
|
-
return e >= r && (32 >= t || e > r) && (e = -2 * r + e), e;
|
|
212
|
-
}
|
|
213
|
-
function qe(e, t) {
|
|
214
|
-
return 0 <= e ? e : 32 >= t ? 2 * Math.abs(1 << t - 1) + e : Math.pow(2, t) + e;
|
|
215
|
-
}
|
|
216
|
-
function Ct(e, t) {
|
|
217
|
-
function r(Y) {
|
|
218
|
-
var Le = i;
|
|
219
|
-
return (Y === "double" || Y === "i64") && Le & 7 && (Le += 4), i = Le, Y === "double" ? (Y = Number(ge[i >> 3]), i += 8) : Y == "i64" ? (Y = [M[i >> 2], M[i + 4 >> 2]], i += 8) : (Y = M[i >> 2], i += 4), Y;
|
|
220
|
-
}
|
|
221
|
-
for (var i = t, c = [], u, a; ; ) {
|
|
222
|
-
var d = e;
|
|
223
|
-
if (u = K[e >> 0], u === 0)
|
|
224
|
-
break;
|
|
225
|
-
if (a = K[e + 1 >> 0], u == 37) {
|
|
226
|
-
var P = !1, x = t = !1, C = !1, te = !1;
|
|
227
|
-
e:
|
|
228
|
-
for (; ; ) {
|
|
229
|
-
switch (a) {
|
|
230
|
-
case 43:
|
|
231
|
-
P = !0;
|
|
232
|
-
break;
|
|
233
|
-
case 45:
|
|
234
|
-
t = !0;
|
|
235
|
-
break;
|
|
236
|
-
case 35:
|
|
237
|
-
x = !0;
|
|
238
|
-
break;
|
|
239
|
-
case 48:
|
|
240
|
-
if (C)
|
|
241
|
-
break e;
|
|
242
|
-
C = !0;
|
|
243
|
-
break;
|
|
244
|
-
case 32:
|
|
245
|
-
te = !0;
|
|
246
|
-
break;
|
|
247
|
-
default:
|
|
248
|
-
break e;
|
|
249
|
-
}
|
|
250
|
-
e++, a = K[e + 1 >> 0];
|
|
251
|
-
}
|
|
252
|
-
var k = 0;
|
|
253
|
-
if (a == 42)
|
|
254
|
-
k = r("i32"), e++, a = K[e + 1 >> 0];
|
|
255
|
-
else
|
|
256
|
-
for (; 48 <= a && 57 >= a; )
|
|
257
|
-
k = 10 * k + (a - 48), e++, a = K[e + 1 >> 0];
|
|
258
|
-
var L = !1, W = -1;
|
|
259
|
-
if (a == 46) {
|
|
260
|
-
if (W = 0, L = !0, e++, a = K[e + 1 >> 0], a == 42)
|
|
261
|
-
W = r("i32"), e++;
|
|
262
|
-
else
|
|
263
|
-
for (; a = K[e + 1 >> 0], !(48 > a || 57 < a); )
|
|
264
|
-
W = 10 * W + (a - 48), e++;
|
|
265
|
-
a = K[e + 1 >> 0];
|
|
266
|
-
}
|
|
267
|
-
switch (0 > W && (W = 6, L = !1), String.fromCharCode(a)) {
|
|
268
|
-
case "h":
|
|
269
|
-
if (a = K[e + 2 >> 0], a == 104) {
|
|
270
|
-
e++;
|
|
271
|
-
var B = 1;
|
|
272
|
-
} else
|
|
273
|
-
B = 2;
|
|
274
|
-
break;
|
|
275
|
-
case "l":
|
|
276
|
-
a = K[e + 2 >> 0], a == 108 ? (e++, B = 8) : B = 4;
|
|
277
|
-
break;
|
|
278
|
-
case "L":
|
|
279
|
-
case "q":
|
|
280
|
-
case "j":
|
|
281
|
-
B = 8;
|
|
282
|
-
break;
|
|
283
|
-
case "z":
|
|
284
|
-
case "t":
|
|
285
|
-
case "I":
|
|
286
|
-
B = 4;
|
|
287
|
-
break;
|
|
288
|
-
default:
|
|
289
|
-
B = null;
|
|
290
|
-
}
|
|
291
|
-
switch (B && e++, a = K[e + 1 >> 0], String.fromCharCode(a)) {
|
|
292
|
-
case "d":
|
|
293
|
-
case "i":
|
|
294
|
-
case "u":
|
|
295
|
-
case "o":
|
|
296
|
-
case "x":
|
|
297
|
-
case "X":
|
|
298
|
-
case "p":
|
|
299
|
-
d = a == 100 || a == 105, B = B || 4, u = r("i" + 8 * B), B == 8 && (u = a == 117 ? (u[0] >>> 0) + 4294967296 * (u[1] >>> 0) : (u[0] >>> 0) + 4294967296 * u[1]), 4 >= B && (u = (d ? Je : qe)(u & Math.pow(256, B) - 1, 8 * B));
|
|
300
|
-
var re = Math.abs(u);
|
|
301
|
-
if (d = "", a == 100 || a == 105)
|
|
302
|
-
var g = Je(u, 8 * B).toString(10);
|
|
303
|
-
else if (a == 117)
|
|
304
|
-
g = qe(u, 8 * B).toString(10), u = Math.abs(u);
|
|
305
|
-
else if (a == 111)
|
|
306
|
-
g = (x ? "0" : "") + re.toString(8);
|
|
307
|
-
else if (a == 120 || a == 88) {
|
|
308
|
-
if (d = x && u != 0 ? "0x" : "", 0 > u) {
|
|
309
|
-
for (u = -u, g = (re - 1).toString(16), re = [], x = 0; x < g.length; x++)
|
|
310
|
-
re.push((15 - parseInt(g[x], 16)).toString(16));
|
|
311
|
-
for (g = re.join(""); g.length < 2 * B; )
|
|
312
|
-
g = "f" + g;
|
|
313
|
-
} else
|
|
314
|
-
g = re.toString(16);
|
|
315
|
-
a == 88 && (d = d.toUpperCase(), g = g.toUpperCase());
|
|
316
|
-
} else
|
|
317
|
-
a == 112 && (re === 0 ? g = "(nil)" : (d = "0x", g = re.toString(16)));
|
|
318
|
-
if (L)
|
|
319
|
-
for (; g.length < W; )
|
|
320
|
-
g = "0" + g;
|
|
321
|
-
for (0 <= u && (P ? d = "+" + d : te && (d = " " + d)), g.charAt(0) == "-" && (d = "-" + d, g = g.substr(1)); d.length + g.length < k; )
|
|
322
|
-
t ? g += " " : C ? g = "0" + g : d = " " + d;
|
|
323
|
-
g = d + g, g.split("").forEach(function(Y) {
|
|
324
|
-
c.push(Y.charCodeAt(0));
|
|
325
|
-
});
|
|
326
|
-
break;
|
|
327
|
-
case "f":
|
|
328
|
-
case "F":
|
|
329
|
-
case "e":
|
|
330
|
-
case "E":
|
|
331
|
-
case "g":
|
|
332
|
-
case "G":
|
|
333
|
-
if (u = r("double"), isNaN(u))
|
|
334
|
-
g = "nan", C = !1;
|
|
335
|
-
else if (isFinite(u)) {
|
|
336
|
-
if (L = !1, B = Math.min(W, 20), (a == 103 || a == 71) && (L = !0, W = W || 1, B = parseInt(u.toExponential(B).split("e")[1], 10), W > B && -4 <= B ? (a = (a == 103 ? "f" : "F").charCodeAt(0), W -= B + 1) : (a = (a == 103 ? "e" : "E").charCodeAt(0), W--), B = Math.min(W, 20)), a == 101 || a == 69 ? (g = u.toExponential(B), /[eE][-+]\d$/.test(g) && (g = g.slice(0, -1) + "0" + g.slice(-1))) : (a == 102 || a == 70) && (g = u.toFixed(B), u === 0 && (0 > u || u === 0 && 1 / u === -1 / 0) && (g = "-" + g)), d = g.split("e"), L && !x)
|
|
337
|
-
for (; 1 < d[0].length && d[0].includes(".") && (d[0].slice(-1) == "0" || d[0].slice(-1) == "."); )
|
|
338
|
-
d[0] = d[0].slice(0, -1);
|
|
339
|
-
else
|
|
340
|
-
for (x && g.indexOf(".") == -1 && (d[0] += "."); W > B++; )
|
|
341
|
-
d[0] += "0";
|
|
342
|
-
g = d[0] + (1 < d.length ? "e" + d[1] : ""), a == 69 && (g = g.toUpperCase()), 0 <= u && (P ? g = "+" + g : te && (g = " " + g));
|
|
343
|
-
} else
|
|
344
|
-
g = (0 > u ? "-" : "") + "inf", C = !1;
|
|
345
|
-
for (; g.length < k; )
|
|
346
|
-
g = t ? g + " " : !C || g[0] != "-" && g[0] != "+" ? (C ? "0" : " ") + g : g[0] + "0" + g.slice(1);
|
|
347
|
-
97 > a && (g = g.toUpperCase()), g.split("").forEach(function(Y) {
|
|
348
|
-
c.push(Y.charCodeAt(0));
|
|
349
|
-
});
|
|
350
|
-
break;
|
|
351
|
-
case "s":
|
|
352
|
-
if (C = (P = r("i8*")) ? dt(P) : 6, L && (C = Math.min(C, W)), !t)
|
|
353
|
-
for (; C < k--; )
|
|
354
|
-
c.push(32);
|
|
355
|
-
if (P)
|
|
356
|
-
for (x = 0; x < C; x++)
|
|
357
|
-
c.push(J[P++ >> 0]);
|
|
358
|
-
else
|
|
359
|
-
c = c.concat(it(
|
|
360
|
-
"(null)".substr(0, C),
|
|
361
|
-
!0
|
|
362
|
-
));
|
|
363
|
-
if (t)
|
|
364
|
-
for (; C < k--; )
|
|
365
|
-
c.push(32);
|
|
366
|
-
break;
|
|
367
|
-
case "c":
|
|
368
|
-
for (t && c.push(r("i8")); 0 < --k; )
|
|
369
|
-
c.push(32);
|
|
370
|
-
t || c.push(r("i8"));
|
|
371
|
-
break;
|
|
372
|
-
case "n":
|
|
373
|
-
t = r("i32*"), M[t >> 2] = c.length;
|
|
374
|
-
break;
|
|
375
|
-
case "%":
|
|
376
|
-
c.push(u);
|
|
377
|
-
break;
|
|
378
|
-
default:
|
|
379
|
-
for (x = d; x < e + 2; x++)
|
|
380
|
-
c.push(K[x >> 0]);
|
|
381
|
-
}
|
|
382
|
-
e += 2;
|
|
383
|
-
} else
|
|
384
|
-
c.push(u), e += 1;
|
|
385
|
-
}
|
|
386
|
-
return c;
|
|
387
|
-
}
|
|
388
|
-
function be(e) {
|
|
389
|
-
if (!e || !e.callee || !e.callee.name)
|
|
390
|
-
return [null, "", ""];
|
|
391
|
-
var t = e.callee.name, r = "(", i = !0, c;
|
|
392
|
-
for (c in e) {
|
|
393
|
-
var u = e[c];
|
|
394
|
-
i || (r += ", "), i = !1, r = typeof u == "number" || typeof u == "string" ? r + u : r + ("(" + typeof u + ")");
|
|
395
|
-
}
|
|
396
|
-
return r += ")", e = (e = e.callee.caller) ? e.arguments : [], i && (r = ""), [e, t, r];
|
|
397
|
-
}
|
|
398
|
-
function Bt(e) {
|
|
399
|
-
e: {
|
|
400
|
-
var t = Error();
|
|
401
|
-
if (!t.stack) {
|
|
402
|
-
try {
|
|
403
|
-
throw Error();
|
|
404
|
-
} catch (W) {
|
|
405
|
-
t = W;
|
|
406
|
-
}
|
|
407
|
-
if (!t.stack) {
|
|
408
|
-
t = "(no stack trace available)";
|
|
409
|
-
break e;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
t = t.stack.toString();
|
|
413
|
-
}
|
|
414
|
-
t = t.slice(t.indexOf(`
|
|
415
|
-
`, Math.max(t.lastIndexOf("_emscripten_log"), t.lastIndexOf("_emscripten_get_callstack"))) + 1), e & 32 && j("EM_LOG_DEMANGLE is deprecated; ignoring"), e & 8 && typeof emscripten_source_map > "u" && (j('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'), e = e ^ 8 | 16);
|
|
416
|
-
var r = null;
|
|
417
|
-
if (e & 128)
|
|
418
|
-
for (r = be(arguments); r[1].includes("_emscripten_"); )
|
|
419
|
-
r = be(r[0]);
|
|
420
|
-
var i = t.split(`
|
|
421
|
-
`);
|
|
422
|
-
t = "";
|
|
423
|
-
var c = RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"), u = RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"), a = RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)"), d;
|
|
424
|
-
for (d in i) {
|
|
425
|
-
var P = i[d], x;
|
|
426
|
-
if ((x = a.exec(P)) && x.length == 5) {
|
|
427
|
-
P = x[1];
|
|
428
|
-
var C = x[2], te = x[3];
|
|
429
|
-
x = x[4];
|
|
430
|
-
} else if ((x = c.exec(P)) || (x = u.exec(P)), x && 4 <= x.length)
|
|
431
|
-
P = x[1], C = x[2], te = x[3], x = x[4] | 0;
|
|
432
|
-
else {
|
|
433
|
-
t += P + `
|
|
434
|
-
`;
|
|
435
|
-
continue;
|
|
436
|
-
}
|
|
437
|
-
var k = !1;
|
|
438
|
-
if (e & 8) {
|
|
439
|
-
var L = emscripten_source_map.Ia({
|
|
440
|
-
line: te,
|
|
441
|
-
ua: x
|
|
442
|
-
});
|
|
443
|
-
(k = L && L.source) && (e & 64 && (L.source = L.source.substring(L.source.replace(/\\/g, "/").lastIndexOf("/") + 1)), t += " at " + P + " (" + L.source + ":" + L.line + ":" + L.ua + `)
|
|
444
|
-
`);
|
|
445
|
-
}
|
|
446
|
-
(e & 16 || !k) && (e & 64 && (C = C.substring(C.replace(/\\/g, "/").lastIndexOf("/") + 1)), t += (k ? " = " + P : " at " + P) + " (" + C + ":" + te + ":" + x + `)
|
|
447
|
-
`), e & 128 && r[0] && (r[1] == P && 0 < r[2].length && (t = t.replace(/\s+$/, ""), t += " with values: " + r[1] + r[2] + `
|
|
448
|
-
`), r = be(r[0]));
|
|
449
|
-
}
|
|
450
|
-
return t = t.replace(/\s+$/, "");
|
|
451
|
-
}
|
|
452
|
-
function Dt(e) {
|
|
453
|
-
var t = e.getExtension("ANGLE_instanced_arrays");
|
|
454
|
-
t && (e.vertexAttribDivisor = function(r, i) {
|
|
455
|
-
t.vertexAttribDivisorANGLE(r, i);
|
|
456
|
-
}, e.drawArraysInstanced = function(r, i, c, u) {
|
|
457
|
-
t.drawArraysInstancedANGLE(r, i, c, u);
|
|
458
|
-
}, e.drawElementsInstanced = function(r, i, c, u, a) {
|
|
459
|
-
t.drawElementsInstancedANGLE(r, i, c, u, a);
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
function Rt(e) {
|
|
463
|
-
var t = e.getExtension("OES_vertex_array_object");
|
|
464
|
-
t && (e.createVertexArray = function() {
|
|
465
|
-
return t.createVertexArrayOES();
|
|
466
|
-
}, e.deleteVertexArray = function(r) {
|
|
467
|
-
t.deleteVertexArrayOES(r);
|
|
468
|
-
}, e.bindVertexArray = function(r) {
|
|
469
|
-
t.bindVertexArrayOES(r);
|
|
470
|
-
}, e.isVertexArray = function(r) {
|
|
471
|
-
return t.isVertexArrayOES(r);
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
function Tt(e) {
|
|
475
|
-
var t = e.getExtension("WEBGL_draw_buffers");
|
|
476
|
-
t && (e.drawBuffers = function(r, i) {
|
|
477
|
-
t.drawBuffersWEBGL(r, i);
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
var Ue = 1, xe = [], U = [], ee = [], Se = [], et = [1, 1, 2, 2, 4, 4, 4, 2, 3, 4, 8];
|
|
481
|
-
function ae(e) {
|
|
482
|
-
Ae || (Ae = e);
|
|
483
|
-
}
|
|
484
|
-
function me(e) {
|
|
485
|
-
for (var t = Ue++, r = e.length; r < t; r++)
|
|
486
|
-
e[r] = null;
|
|
487
|
-
return t;
|
|
488
|
-
}
|
|
489
|
-
function Fe(e) {
|
|
490
|
-
return 32 - Math.clz32(e === 0 ? 0 : e - 1);
|
|
491
|
-
}
|
|
492
|
-
function bt(e, t) {
|
|
493
|
-
e.fa || (e.fa = e.getContext, e.getContext = function(i, c) {
|
|
494
|
-
return (c = e.fa(i, c)) || (c = e.fa(i)), i == "webgl" == c instanceof WebGLRenderingContext ? c : null;
|
|
495
|
-
});
|
|
496
|
-
var r = 1 < t.na ? e.getContext("webgl2", t) : e.getContext("webgl", t);
|
|
497
|
-
return r ? St(r, t) : 0;
|
|
498
|
-
}
|
|
499
|
-
function St(e, t) {
|
|
500
|
-
var r = me(Se), i = { Ea: r, attributes: t, version: t.na, ba: e };
|
|
501
|
-
for (e.canvas && (e.canvas.ya = i), Se[r] = i, (typeof t.ma > "u" || t.ma) && Ft(i), i.oa = i.ba.getParameter(34921), i.X = [], e = 0; e < i.oa; e++)
|
|
502
|
-
i.X[e] = { enabled: !1, ea: !1, size: 0, type: 0, pa: 0, ga: 0, R: 0, ta: null };
|
|
503
|
-
for (e = Fe(2097152), i.U = [], i.qa = [], i.U.length = i.qa.length = e + 1, i.aa = [], i.ha = [], i.aa.length = i.ha.length = e + 1, i.S = [], i.S.length = e + 1, t = 0; t <= e; ++t) {
|
|
504
|
-
i.S[t] = null, i.U[t] = i.qa[t] = 0, i.aa[t] = [], i.ha[t] = [];
|
|
505
|
-
var c = i.aa[t], u = i.ha[t];
|
|
506
|
-
c.length = u.length = 64;
|
|
507
|
-
for (var a = 0; 64 > a; ++a)
|
|
508
|
-
c[a] = u[a] = null;
|
|
509
|
-
}
|
|
510
|
-
return r;
|
|
511
|
-
}
|
|
512
|
-
function Ft(e) {
|
|
513
|
-
if (e || (e = F), !e.xa) {
|
|
514
|
-
e.xa = !0;
|
|
515
|
-
var t = e.ba;
|
|
516
|
-
Dt(t), Rt(t), Tt(t), t.Ca = t.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"), t.Fa = t.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"), 2 <= e.version && (t.la = t.getExtension("EXT_disjoint_timer_query_webgl2")), (2 > e.version || !t.la) && (t.la = t.getExtension("EXT_disjoint_timer_query")), t.Ha = t.getExtension("WEBGL_multi_draw"), (t.getSupportedExtensions() || []).forEach(function(r) {
|
|
517
|
-
r.includes("lose_context") || r.includes("debug") || t.getExtension(r);
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
var Ae, F, We, Wt = ["default", "low-power", "high-performance"], It = [0, typeof document < "u" ? document : 0, typeof window < "u" ? window : 0];
|
|
522
|
-
function tt(e) {
|
|
523
|
-
return e.slice(-1) == "]" && e.lastIndexOf("[");
|
|
524
|
-
}
|
|
525
|
-
function nt(e) {
|
|
526
|
-
var t = h.va;
|
|
527
|
-
if (t) {
|
|
528
|
-
var r = t.V[e];
|
|
529
|
-
return typeof r == "number" && (t.V[e] = r = h.getUniformLocation(t, t.ra[e] + (0 < r ? "[" + r + "]" : ""))), r;
|
|
530
|
-
}
|
|
531
|
-
ae(1282);
|
|
532
|
-
}
|
|
533
|
-
for (var rt = [], h, Lt = new Float32Array(288), we = 0; 288 > we; ++we)
|
|
534
|
-
rt[we] = Lt.subarray(0, we + 1);
|
|
535
|
-
function it(e, t) {
|
|
536
|
-
for (var r = 0, i = 0; i < e.length; ++i) {
|
|
537
|
-
var c = e.charCodeAt(i);
|
|
538
|
-
55296 <= c && 57343 >= c && (c = 65536 + ((c & 1023) << 10) | e.charCodeAt(++i) & 1023), 127 >= c ? ++r : r = 2047 >= c ? r + 2 : 65535 >= c ? r + 3 : r + 4;
|
|
539
|
-
}
|
|
540
|
-
return r = Array(r + 1), e = he(e, r, 0, r.length), t && (r.length = e), r;
|
|
541
|
-
}
|
|
542
|
-
var jt = { c: function() {
|
|
543
|
-
se("");
|
|
544
|
-
}, a: function(e, t, r) {
|
|
545
|
-
t = Ct(t, r), t = q(t, 0), e & 24 && (t = t.replace(/\s+$/, ""), t += (0 < t.length ? `
|
|
546
|
-
` : "") + Bt(e)), e & 1 ? e & 4 ? console.error(t) : e & 2 ? console.warn(t) : e & 512 ? console.info(t) : e & 256 ? console.debug(t) : console.log(t) : e & 6 ? b(t) : H(t);
|
|
547
|
-
}, o: function(e, t, r) {
|
|
548
|
-
J.copyWithin(e, t, t + r);
|
|
549
|
-
}, n: function(e) {
|
|
550
|
-
var t = J.length;
|
|
551
|
-
if (e >>>= 0, 2147483648 < e)
|
|
552
|
-
return !1;
|
|
553
|
-
for (var r = 1; 4 >= r; r *= 2) {
|
|
554
|
-
var i = t * (1 + 0.2 / r);
|
|
555
|
-
i = Math.min(i, e + 100663296);
|
|
556
|
-
var c = Math;
|
|
557
|
-
i = Math.max(e, i), c = c.min.call(c, 2147483648, i + (65536 - i % 65536) % 65536);
|
|
558
|
-
e: {
|
|
559
|
-
try {
|
|
560
|
-
V.grow(c - ye.byteLength + 65535 >>> 16), He();
|
|
561
|
-
var u = 1;
|
|
562
|
-
break e;
|
|
563
|
-
} catch {
|
|
564
|
-
}
|
|
565
|
-
u = void 0;
|
|
566
|
-
}
|
|
567
|
-
if (u)
|
|
568
|
-
return !0;
|
|
569
|
-
}
|
|
570
|
-
return !1;
|
|
571
|
-
}, k: function(e, t) {
|
|
572
|
-
return t >>= 2, t = { alpha: !!M[t + 0], depth: !!M[t + 1], stencil: !!M[t + 2], antialias: !!M[t + 3], premultipliedAlpha: !!M[t + 4], preserveDrawingBuffer: !!M[t + 5], powerPreference: Wt[M[t + 6]], failIfMajorPerformanceCaveat: !!M[t + 7], na: M[t + 8], Ga: M[t + 9], ma: M[t + 10], wa: M[t + 11], Ja: M[t + 12], Ka: M[t + 13] }, e = 2 < e ? ue(e) : e, e = It[e] || (typeof document < "u" ? document.querySelector(e) : void 0), !e || t.wa ? 0 : bt(e, t);
|
|
573
|
-
}, e: function(e) {
|
|
574
|
-
return F = Se[e], n.za = h = F && F.ba, !e || h ? 0 : -5;
|
|
575
|
-
}, d: function(e, t) {
|
|
576
|
-
h.attachShader(U[e], ee[t]);
|
|
577
|
-
}, A: function(e, t, r) {
|
|
578
|
-
h.bindAttribLocation(U[e], t, ue(r));
|
|
579
|
-
}, b: function(e, t) {
|
|
580
|
-
e == 34962 ? h.ja = t : e == 34963 && (h.ka = t), e == 35051 ? h.Aa = t : e == 35052 && (h.Ba = t), h.bindBuffer(e, xe[t]);
|
|
581
|
-
}, f: function(e, t, r, i) {
|
|
582
|
-
2 <= F.version ? r ? h.bufferData(e, J, i, r, t) : h.bufferData(e, t, i) : h.bufferData(e, r ? J.subarray(r, r + t) : t, i);
|
|
583
|
-
}, v: function(e) {
|
|
584
|
-
h.clear(e);
|
|
585
|
-
}, w: function(e, t, r, i) {
|
|
586
|
-
h.clearColor(e, t, r, i);
|
|
587
|
-
}, t: function(e) {
|
|
588
|
-
h.compileShader(ee[e]);
|
|
589
|
-
}, j: function() {
|
|
590
|
-
var e = me(U), t = h.createProgram();
|
|
591
|
-
return t.name = e, t.$ = t.Y = t.Z = 0, t.ia = 1, U[e] = t, e;
|
|
592
|
-
}, C: function(e) {
|
|
593
|
-
var t = me(ee);
|
|
594
|
-
return ee[t] = h.createShader(e), t;
|
|
595
|
-
}, q: function(e, t, r, i) {
|
|
596
|
-
if (!h.ka) {
|
|
597
|
-
var c = 1 * et[r - 5120] * t, u = Fe(c), a = F.S[u];
|
|
598
|
-
a ? u = a : (a = h.getParameter(34965), F.S[u] = h.createBuffer(), h.bindBuffer(34963, F.S[u]), h.bufferData(34963, 1 << u, 35048), h.bindBuffer(34963, a), u = F.S[u]), h.bindBuffer(34963, u), h.bufferSubData(34963, 0, J.subarray(i, i + c)), i = 0;
|
|
599
|
-
}
|
|
600
|
-
for (We = !1, c = 0; c < F.oa; ++c)
|
|
601
|
-
if (u = F.X[c], u.ea && u.enabled) {
|
|
602
|
-
We = !0, a = u.ga, a = 0 < a ? t * a : u.size * et[u.type - 5120] * t;
|
|
603
|
-
var d = Fe(a), P = F.aa[d], x = F.U[d];
|
|
604
|
-
F.U[d] = F.U[d] + 1 & 63;
|
|
605
|
-
var C = P[x];
|
|
606
|
-
C ? d = C : (C = h.getParameter(34964), P[x] = h.createBuffer(), h.bindBuffer(34962, P[x]), h.bufferData(34962, 1 << d, 35048), h.bindBuffer(34962, C), d = P[x]), h.bindBuffer(34962, d), h.bufferSubData(34962, 0, J.subarray(u.R, u.R + a)), u.ta.call(h, c, u.size, u.type, u.pa, u.ga, 0);
|
|
607
|
-
}
|
|
608
|
-
h.drawElements(e, t, r, i), We && h.bindBuffer(34962, xe[h.ja]), h.ka || h.bindBuffer(34963, null);
|
|
609
|
-
}, s: function(e) {
|
|
610
|
-
F.X[e].enabled = !0, h.enableVertexAttribArray(e);
|
|
611
|
-
}, g: function(e, t) {
|
|
612
|
-
for (var r = 0; r < e; r++) {
|
|
613
|
-
var i = h.createBuffer(), c = i && me(xe);
|
|
614
|
-
i ? (i.name = c, xe[c] = i) : ae(1282), M[t + 4 * r >> 2] = c;
|
|
615
|
-
}
|
|
616
|
-
}, p: function() {
|
|
617
|
-
var e = h.getError() || Ae;
|
|
618
|
-
return Ae = 0, e;
|
|
619
|
-
}, x: function(e, t, r) {
|
|
620
|
-
if (r)
|
|
621
|
-
if (e >= Ue)
|
|
622
|
-
ae(1281);
|
|
623
|
-
else if (e = U[e], t == 35716)
|
|
624
|
-
e = h.getProgramInfoLog(e), e === null && (e = "(unknown error)"), M[r >> 2] = e.length + 1;
|
|
625
|
-
else if (t == 35719) {
|
|
626
|
-
if (!e.$)
|
|
627
|
-
for (t = 0; t < h.getProgramParameter(e, 35718); ++t)
|
|
628
|
-
e.$ = Math.max(e.$, h.getActiveUniform(e, t).name.length + 1);
|
|
629
|
-
M[r >> 2] = e.$;
|
|
630
|
-
} else if (t == 35722) {
|
|
631
|
-
if (!e.Y)
|
|
632
|
-
for (t = 0; t < h.getProgramParameter(e, 35721); ++t)
|
|
633
|
-
e.Y = Math.max(e.Y, h.getActiveAttrib(
|
|
634
|
-
e,
|
|
635
|
-
t
|
|
636
|
-
).name.length + 1);
|
|
637
|
-
M[r >> 2] = e.Y;
|
|
638
|
-
} else if (t == 35381) {
|
|
639
|
-
if (!e.Z)
|
|
640
|
-
for (t = 0; t < h.getProgramParameter(e, 35382); ++t)
|
|
641
|
-
e.Z = Math.max(e.Z, h.getActiveUniformBlockName(e, t).length + 1);
|
|
642
|
-
M[r >> 2] = e.Z;
|
|
643
|
-
} else
|
|
644
|
-
M[r >> 2] = h.getProgramParameter(e, t);
|
|
645
|
-
else
|
|
646
|
-
ae(1281);
|
|
647
|
-
}, l: function(e, t, r, i) {
|
|
648
|
-
e = h.getShaderInfoLog(ee[e]), e === null && (e = "(unknown error)"), t = 0 < t && i ? he(e, J, i, t) : 0, r && (M[r >> 2] = t);
|
|
649
|
-
}, m: function(e, t, r) {
|
|
650
|
-
r ? t == 35716 ? (e = h.getShaderInfoLog(ee[e]), e === null && (e = "(unknown error)"), M[r >> 2] = e ? e.length + 1 : 0) : t == 35720 ? (e = h.getShaderSource(ee[e]), M[r >> 2] = e ? e.length + 1 : 0) : M[r >> 2] = h.getShaderParameter(ee[e], t) : ae(1281);
|
|
651
|
-
}, i: function(e, t) {
|
|
652
|
-
if (t = ue(t), e = U[e]) {
|
|
653
|
-
var r = e, i = r.V, c = r.sa, u;
|
|
654
|
-
if (!i)
|
|
655
|
-
for (r.V = i = {}, r.ra = {}, u = 0; u < h.getProgramParameter(r, 35718); ++u) {
|
|
656
|
-
var a = h.getActiveUniform(r, u), d = a.name;
|
|
657
|
-
a = a.size;
|
|
658
|
-
var P = tt(d);
|
|
659
|
-
P = 0 < P ? d.slice(0, P) : d;
|
|
660
|
-
var x = r.ia;
|
|
661
|
-
for (r.ia += a, c[P] = [a, x], d = 0; d < a; ++d)
|
|
662
|
-
i[x] = d, r.ra[x++] = P;
|
|
663
|
-
}
|
|
664
|
-
if (r = e.V, i = 0, c = t, u = tt(t), 0 < u && (i = parseInt(t.slice(u + 1)) >>> 0, c = t.slice(0, u)), (c = e.sa[c]) && i < c[0] && (i += c[1], r[i] = r[i] || h.getUniformLocation(e, t)))
|
|
665
|
-
return i;
|
|
666
|
-
} else
|
|
667
|
-
ae(1281);
|
|
668
|
-
return -1;
|
|
669
|
-
}, z: function(e) {
|
|
670
|
-
e = U[e], h.linkProgram(e), e.V = 0, e.sa = {};
|
|
671
|
-
}, B: function(e, t, r, i) {
|
|
672
|
-
for (var c = "", u = 0; u < t; ++u) {
|
|
673
|
-
var a = i ? M[i + 4 * u >> 2] : -1;
|
|
674
|
-
c += ue(M[r + 4 * u >> 2], 0 > a ? void 0 : a);
|
|
675
|
-
}
|
|
676
|
-
h.shaderSource(ee[e], c);
|
|
677
|
-
}, h: function(e, t, r, i) {
|
|
678
|
-
if (2 <= F.version)
|
|
679
|
-
h.uniformMatrix4fv(nt(e), !!r, Ee, i >> 2, 16 * t);
|
|
680
|
-
else {
|
|
681
|
-
if (18 >= t) {
|
|
682
|
-
var c = rt[16 * t - 1], u = Ee;
|
|
683
|
-
i >>= 2;
|
|
684
|
-
for (var a = 0; a < 16 * t; a += 16) {
|
|
685
|
-
var d = i + a;
|
|
686
|
-
c[a] = u[d], c[a + 1] = u[d + 1], c[a + 2] = u[d + 2], c[a + 3] = u[d + 3], c[a + 4] = u[d + 4], c[a + 5] = u[d + 5], c[a + 6] = u[d + 6], c[a + 7] = u[d + 7], c[a + 8] = u[d + 8], c[a + 9] = u[d + 9], c[a + 10] = u[d + 10], c[a + 11] = u[d + 11], c[a + 12] = u[d + 12], c[a + 13] = u[d + 13], c[a + 14] = u[d + 14], c[a + 15] = u[d + 15];
|
|
687
|
-
}
|
|
688
|
-
} else
|
|
689
|
-
c = Ee.subarray(i >> 2, i + 64 * t >> 2);
|
|
690
|
-
h.uniformMatrix4fv(nt(e), !!r, c);
|
|
691
|
-
}
|
|
692
|
-
}, u: function(e) {
|
|
693
|
-
e = U[e], h.useProgram(e), h.va = e;
|
|
694
|
-
}, y: function(e) {
|
|
695
|
-
h.validateProgram(U[e]);
|
|
696
|
-
}, r: function(e, t, r, i, c, u) {
|
|
697
|
-
var a = F.X[e];
|
|
698
|
-
h.ja ? (a.ea = !1, h.vertexAttribPointer(e, t, r, !!i, c, u)) : (a.size = t, a.type = r, a.pa = i, a.ga = c, a.R = u, a.ea = !0, a.ta = function(d, P, x, C, te, k) {
|
|
699
|
-
this.vertexAttribPointer(d, P, x, C, te, k);
|
|
700
|
-
});
|
|
701
|
-
} };
|
|
702
|
-
(function() {
|
|
703
|
-
function e(c) {
|
|
704
|
-
n.asm = c.exports, V = n.asm.D, He(), Ne = n.asm.M, Ge.unshift(n.asm.E), oe--, n.monitorRunDependencies && n.monitorRunDependencies(oe), oe == 0 && fe && (c = fe, fe = null, c());
|
|
705
|
-
}
|
|
706
|
-
function t(c) {
|
|
707
|
-
e(c.instance);
|
|
708
|
-
}
|
|
709
|
-
function r(c) {
|
|
710
|
-
return Pt().then(function(u) {
|
|
711
|
-
return WebAssembly.instantiate(u, i);
|
|
712
|
-
}).then(function(u) {
|
|
713
|
-
return u;
|
|
714
|
-
}).then(c, function(u) {
|
|
715
|
-
b("failed to asynchronously prepare wasm: " + u), se(u);
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
var i = { a: jt };
|
|
719
|
-
if (oe++, n.monitorRunDependencies && n.monitorRunDependencies(oe), n.instantiateWasm)
|
|
720
|
-
try {
|
|
721
|
-
return n.instantiateWasm(
|
|
722
|
-
i,
|
|
723
|
-
e
|
|
724
|
-
);
|
|
725
|
-
} catch (c) {
|
|
726
|
-
return b("Module.instantiateWasm callback failed with error: " + c), !1;
|
|
727
|
-
}
|
|
728
|
-
return function() {
|
|
729
|
-
return X || typeof WebAssembly.instantiateStreaming != "function" || $e() || $.startsWith("file://") || typeof fetch != "function" ? r(t) : fetch($, { credentials: "same-origin" }).then(function(c) {
|
|
730
|
-
return WebAssembly.instantiateStreaming(c, i).then(t, function(u) {
|
|
731
|
-
return b("wasm streaming compile failed: " + u), b("falling back to ArrayBuffer instantiation"), r(t);
|
|
732
|
-
});
|
|
733
|
-
});
|
|
734
|
-
}().catch(_), {};
|
|
735
|
-
})(), n.___wasm_call_ctors = function() {
|
|
736
|
-
return (n.___wasm_call_ctors = n.asm.E).apply(null, arguments);
|
|
737
|
-
};
|
|
738
|
-
var ot = n._emscripten_bind_VoidPtr___destroy___0 = function() {
|
|
739
|
-
return (ot = n._emscripten_bind_VoidPtr___destroy___0 = n.asm.F).apply(null, arguments);
|
|
740
|
-
}, st = n._emscripten_bind_McObject_updateDisplay_2 = function() {
|
|
741
|
-
return (st = n._emscripten_bind_McObject_updateDisplay_2 = n.asm.G).apply(null, arguments);
|
|
742
|
-
}, ut = n._emscripten_bind_McObject_test_0 = function() {
|
|
743
|
-
return (ut = n._emscripten_bind_McObject_test_0 = n.asm.H).apply(null, arguments);
|
|
744
|
-
}, at = n._emscripten_bind_McApp_McApp_0 = function() {
|
|
745
|
-
return (at = n._emscripten_bind_McApp_McApp_0 = n.asm.I).apply(null, arguments);
|
|
746
|
-
}, ct = n._emscripten_bind_McApp_Init_0 = function() {
|
|
747
|
-
return (ct = n._emscripten_bind_McApp_Init_0 = n.asm.J).apply(null, arguments);
|
|
748
|
-
}, lt = n._emscripten_bind_McApp_CreateMxDraw_3 = function() {
|
|
749
|
-
return (lt = n._emscripten_bind_McApp_CreateMxDraw_3 = n.asm.K).apply(null, arguments);
|
|
750
|
-
}, ft = n._emscripten_bind_McApp___destroy___0 = function() {
|
|
751
|
-
return (ft = n._emscripten_bind_McApp___destroy___0 = n.asm.L).apply(null, arguments);
|
|
752
|
-
}, dt = n._strlen = function() {
|
|
753
|
-
return (dt = n._strlen = n.asm.N).apply(null, arguments);
|
|
754
|
-
};
|
|
755
|
-
n._malloc = function() {
|
|
756
|
-
return (n._malloc = n.asm.O).apply(null, arguments);
|
|
757
|
-
}, n._free = function() {
|
|
758
|
-
return (n._free = n.asm.P).apply(null, arguments);
|
|
759
|
-
};
|
|
760
|
-
var ve;
|
|
761
|
-
fe = function e() {
|
|
762
|
-
ve || Ie(), ve || (fe = e);
|
|
763
|
-
};
|
|
764
|
-
function Ie() {
|
|
765
|
-
function e() {
|
|
766
|
-
if (!ve && (ve = !0, n.calledRun = !0, !N)) {
|
|
767
|
-
if (Te(Ge), f(n), n.onRuntimeInitialized && n.onRuntimeInitialized(), n.postRun)
|
|
768
|
-
for (typeof n.postRun == "function" && (n.postRun = [n.postRun]); n.postRun.length; ) {
|
|
769
|
-
var t = n.postRun.shift();
|
|
770
|
-
Xe.unshift(t);
|
|
771
|
-
}
|
|
772
|
-
Te(Xe);
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
if (!(0 < oe)) {
|
|
776
|
-
if (n.preRun)
|
|
777
|
-
for (typeof n.preRun == "function" && (n.preRun = [n.preRun]); n.preRun.length; )
|
|
778
|
-
Mt();
|
|
779
|
-
Te(ze), 0 < oe || (n.setStatus ? (n.setStatus("Running..."), setTimeout(function() {
|
|
780
|
-
setTimeout(function() {
|
|
781
|
-
n.setStatus("");
|
|
782
|
-
}, 1), e();
|
|
783
|
-
}, 1)) : e());
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
if (n.run = Ie, n.preInit)
|
|
787
|
-
for (typeof n.preInit == "function" && (n.preInit = [n.preInit]); 0 < n.preInit.length; )
|
|
788
|
-
n.preInit.pop()();
|
|
789
|
-
Ie();
|
|
790
|
-
function G() {
|
|
791
|
-
}
|
|
792
|
-
G.prototype = Object.create(G.prototype), G.prototype.constructor = G, G.prototype.T = G, G.W = {}, n.WrapperObject = G;
|
|
793
|
-
function Me(e) {
|
|
794
|
-
return (e || G).W;
|
|
795
|
-
}
|
|
796
|
-
n.getCache = Me;
|
|
797
|
-
function Pe(e, t) {
|
|
798
|
-
var r = Me(t), i = r[e];
|
|
799
|
-
return i || (i = Object.create((t || G).prototype), i.R = e, r[e] = i);
|
|
800
|
-
}
|
|
801
|
-
n.wrapPointer = Pe, n.castObject = function(e, t) {
|
|
802
|
-
return Pe(e.R, t);
|
|
803
|
-
}, n.NULL = Pe(0), n.destroy = function(e) {
|
|
804
|
-
if (!e.__destroy__)
|
|
805
|
-
throw "Error: Cannot destroy object. (Did you create it yourself?)";
|
|
806
|
-
e.__destroy__(), delete Me(e.T)[e.R];
|
|
807
|
-
}, n.compare = function(e, t) {
|
|
808
|
-
return e.R === t.R;
|
|
809
|
-
}, n.getPointer = function(e) {
|
|
810
|
-
return e.R;
|
|
811
|
-
}, n.getClass = function(e) {
|
|
812
|
-
return e.T;
|
|
813
|
-
};
|
|
814
|
-
var ce = 0, Ce = 0, Be = 0, De = [], Re = 0;
|
|
815
|
-
function pt() {
|
|
816
|
-
if (Re) {
|
|
817
|
-
for (var e = 0; e < De.length; e++)
|
|
818
|
-
n._free(De[e]);
|
|
819
|
-
De.length = 0, n._free(ce), ce = 0, Ce += Re, Re = 0;
|
|
820
|
-
}
|
|
821
|
-
ce || (Ce += 128, (ce = n._malloc(Ce)) || se(void 0)), Be = 0;
|
|
822
|
-
}
|
|
823
|
-
function ht(e, t) {
|
|
824
|
-
return ce || se(void 0), e = e.length * t.BYTES_PER_ELEMENT, e = e + 7 & -8, Be + e >= Ce ? (0 < e || se(void 0), Re += e, t = n._malloc(e), De.push(t)) : (t = ce + Be, Be += e), t;
|
|
825
|
-
}
|
|
826
|
-
function yt(e, t, r) {
|
|
827
|
-
switch (r >>>= 0, t.BYTES_PER_ELEMENT) {
|
|
828
|
-
case 2:
|
|
829
|
-
r >>>= 1;
|
|
830
|
-
break;
|
|
831
|
-
case 4:
|
|
832
|
-
r >>>= 2;
|
|
833
|
-
break;
|
|
834
|
-
case 8:
|
|
835
|
-
r >>>= 3;
|
|
836
|
-
}
|
|
837
|
-
for (var i = 0; i < e.length; i++)
|
|
838
|
-
t[r + i] = e[i];
|
|
839
|
-
}
|
|
840
|
-
function Et(e) {
|
|
841
|
-
if (typeof e == "object") {
|
|
842
|
-
var t = ht(e, ge);
|
|
843
|
-
return yt(e, ge, t), t;
|
|
844
|
-
}
|
|
845
|
-
return e;
|
|
846
|
-
}
|
|
847
|
-
function ne() {
|
|
848
|
-
throw "cannot construct a VoidPtr, no constructor in IDL";
|
|
849
|
-
}
|
|
850
|
-
ne.prototype = Object.create(G.prototype), ne.prototype.constructor = ne, ne.prototype.T = ne, ne.W = {}, n.VoidPtr = ne, ne.prototype.__destroy__ = function() {
|
|
851
|
-
ot(this.R);
|
|
852
|
-
};
|
|
853
|
-
function Z() {
|
|
854
|
-
throw "cannot construct a McObject, no constructor in IDL";
|
|
855
|
-
}
|
|
856
|
-
Z.prototype = Object.create(G.prototype), Z.prototype.constructor = Z, Z.prototype.T = Z, Z.W = {}, n.McObject = Z, Z.prototype.updateDisplay = function(e, t) {
|
|
857
|
-
var r = this.R;
|
|
858
|
-
return pt(), typeof e == "object" && (e = Et(e)), typeof t == "object" && (t = Et(t)), !!st(r, e, t);
|
|
859
|
-
}, Z.prototype.test = Z.prototype.test = function() {
|
|
860
|
-
ut(this.R);
|
|
861
|
-
};
|
|
862
|
-
function Q() {
|
|
863
|
-
this.R = at(), Me(Q)[this.R] = this;
|
|
864
|
-
}
|
|
865
|
-
return Q.prototype = Object.create(G.prototype), Q.prototype.constructor = Q, Q.prototype.T = Q, Q.W = {}, n.McApp = Q, Q.prototype.Init = function() {
|
|
866
|
-
ct(this.R);
|
|
867
|
-
}, Q.prototype.CreateMxDraw = function(e, t, r) {
|
|
868
|
-
var i = this.R;
|
|
869
|
-
if (pt(), e && typeof e == "object" && (e = e.R), t && typeof t == "object" && (t = t.R), r && typeof r == "object")
|
|
870
|
-
r = r.R;
|
|
871
|
-
else if (typeof r == "string") {
|
|
872
|
-
r = it(r);
|
|
873
|
-
var c = ht(r, K);
|
|
874
|
-
yt(r, K, c), r = c;
|
|
875
|
-
}
|
|
876
|
-
return Pe(lt(i, e, t, r), Z);
|
|
877
|
-
}, Q.prototype.__destroy__ = function() {
|
|
878
|
-
ft(this.R);
|
|
879
|
-
}, l.ready;
|
|
880
|
-
};
|
|
881
|
-
})();
|
|
882
|
-
return typeof exports == "object" && typeof module == "object" ? module.exports = o : typeof define == "function" && define.amd ? define([], function() {
|
|
883
|
-
return o;
|
|
884
|
-
}) : typeof exports == "object" && (exports.mxdrawassembly = o), o();
|
|
885
|
-
}
|
|
886
|
-
async function qt() {
|
|
887
|
-
const o = new ie();
|
|
888
|
-
o.setMessage(`
|
|
16
|
+
const _t = {
|
|
17
|
+
b64Encode: Vt,
|
|
18
|
+
b64Decode: Ht,
|
|
19
|
+
setMcDbEntity: Nt
|
|
20
|
+
};
|
|
21
|
+
async function Ut() {
|
|
22
|
+
const i = new oe();
|
|
23
|
+
i.setMessage(`
|
|
889
24
|
\u6307\u5B9A\u63D2\u5165\u4F4D\u7F6E:`);
|
|
890
|
-
let
|
|
891
|
-
if (
|
|
25
|
+
let o = await i.go();
|
|
26
|
+
if (o == null)
|
|
892
27
|
return;
|
|
893
|
-
let
|
|
894
|
-
if (
|
|
28
|
+
let n = "\u6D4B\u8BD5";
|
|
29
|
+
if (n.length <= 0)
|
|
895
30
|
return;
|
|
896
|
-
let
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
postx:
|
|
900
|
-
posty:
|
|
901
|
-
text:
|
|
902
|
-
height:
|
|
31
|
+
let f = I.screenCoordLong2Doc(50);
|
|
32
|
+
n = _t.b64Encode(n);
|
|
33
|
+
const l = {
|
|
34
|
+
postx: o.x,
|
|
35
|
+
posty: o.y,
|
|
36
|
+
text: n,
|
|
37
|
+
height: f
|
|
903
38
|
};
|
|
904
|
-
I.call("Mx_Text",
|
|
39
|
+
I.call("Mx_Text", l);
|
|
905
40
|
}
|
|
906
|
-
class
|
|
41
|
+
class zt extends mt {
|
|
907
42
|
getGripPoints() {
|
|
908
|
-
const { x:
|
|
909
|
-
let
|
|
910
|
-
return [this.center,
|
|
43
|
+
const { x: o, y: n, z: f } = this.center;
|
|
44
|
+
let l = new THREE.Vector3(o, n + this.radius, f), g = new THREE.Vector3(o, n - this.radius, f), d = new THREE.Vector3(o - this.radius, n, f), h = new THREE.Vector3(o + this.radius, n, f);
|
|
45
|
+
return [this.center, l, g, d, h];
|
|
911
46
|
}
|
|
912
|
-
moveGripPointsAt(
|
|
913
|
-
const [
|
|
914
|
-
return
|
|
47
|
+
moveGripPointsAt(o, n) {
|
|
48
|
+
const [f, l, g, d, h] = this.getGripPoints();
|
|
49
|
+
return o === 0 && (this.center = f.add(n)), o === 1 && (this.radius = l.add(n).distanceTo(this.center)), o === 2 && (this.radius = g.add(n).distanceTo(this.center)), o === 3 && (this.radius = d.add(n).distanceTo(this.center)), o === 4 && (this.radius = h.add(n).distanceTo(this.center)), !0;
|
|
915
50
|
}
|
|
916
51
|
}
|
|
917
|
-
const
|
|
918
|
-
const [
|
|
919
|
-
return new THREE.Vector3(
|
|
52
|
+
const At = (i) => {
|
|
53
|
+
const [o, n, f] = i, { x: l, y: g, z: d } = o, { x: h, y: w, z: E } = n, { x, y: D, z: W } = f, m = g * E - w * d - g * W + D * d + w * W - D * E, M = -(l * E - h * d - l * W + x * d + h * W - x * E), T = l * w - h * g - l * D + x * g + h * D - x * w, v = -(l * w * W - l * D * E - h * g * W + h * D * d + x * g * E - x * w * d), P = 2 * (h - l), K = 2 * (w - g), O = 2 * (E - d), U = l * l + g * g + d * d - h * h - w * w - E * E, H = 2 * (x - l), N = 2 * (D - g), z = 2 * (W - d), Y = l * l + g * g + d * d - x * x - D * D - W * W, de = -(M * O * Y - M * z * U - K * T * Y + K * z * v + N * T * U - N * O * v) / (m * K * z - m * N * O - P * M * z + P * N * T + H * M * O - H * K * T), pe = (m * O * Y - m * z * U - P * T * Y + P * z * v + H * T * U - H * O * v) / (m * K * z - m * N * O - P * M * z + P * N * T + H * M * O - H * K * T), j = -(m * K * Y - m * N * U - P * M * Y + P * N * v + H * M * U - H * K * v) / (m * K * z - m * N * O - P * M * z + P * N * T + H * M * O - H * K * T);
|
|
54
|
+
return new THREE.Vector3(de, pe, j);
|
|
920
55
|
};
|
|
921
|
-
function
|
|
922
|
-
const
|
|
923
|
-
let
|
|
924
|
-
|
|
925
|
-
let
|
|
926
|
-
const
|
|
927
|
-
|
|
928
|
-
(
|
|
929
|
-
|
|
56
|
+
function Gt() {
|
|
57
|
+
const i = new oe();
|
|
58
|
+
let o = new zt();
|
|
59
|
+
q.use(o), o.closed = !1;
|
|
60
|
+
let n = 0, f = "default", l = !0;
|
|
61
|
+
const g = () => {
|
|
62
|
+
i.setUserDraw(
|
|
63
|
+
(m, M) => {
|
|
64
|
+
o.radius = l ? o.center.distanceTo(m) : o.center.distanceTo(m) / 2, M.drawCustomEntity(o), M.drawLine(o.center, m);
|
|
930
65
|
}
|
|
931
66
|
);
|
|
932
|
-
},
|
|
933
|
-
if (
|
|
934
|
-
if (
|
|
935
|
-
if (
|
|
936
|
-
|
|
937
|
-
\u6307\u5B9A\u5706\u7684\u534A\u5F84:`),
|
|
938
|
-
else if (
|
|
939
|
-
return I.getCurrentDraw().addMxEntity(
|
|
940
|
-
|
|
67
|
+
}, d = (m) => {
|
|
68
|
+
if (f === "default") {
|
|
69
|
+
if (m === b.kOk) {
|
|
70
|
+
if (n === 0)
|
|
71
|
+
i.setMessage(`
|
|
72
|
+
\u6307\u5B9A\u5706\u7684\u534A\u5F84:`), i.setKeyWords("[\u76F4\u5F84(D)]"), o.center = i.value(), g();
|
|
73
|
+
else if (n === 1)
|
|
74
|
+
return I.getCurrentDraw().addMxEntity(o), !0;
|
|
75
|
+
n++;
|
|
941
76
|
}
|
|
942
|
-
|
|
943
|
-
\u6307\u5B9A\u5706\u7684\u76F4\u5F84:`),
|
|
77
|
+
m === b.kKeyWord && i.isKeyWordPicked("D") && (l = !1, g(), i.setMessage(`
|
|
78
|
+
\u6307\u5B9A\u5706\u7684\u76F4\u5F84:`), i.setKeyWords(""));
|
|
944
79
|
}
|
|
945
80
|
};
|
|
946
|
-
let
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
949
|
-
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E00\u4E2A\u70B9:`),
|
|
950
|
-
if (
|
|
951
|
-
T.drawLine(
|
|
952
|
-
}),
|
|
953
|
-
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E8C\u4E2A\u70B9:`)),
|
|
954
|
-
const [
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
81
|
+
let h = [];
|
|
82
|
+
const w = (m) => {
|
|
83
|
+
if (f === "3P" && (i.setMessage(`
|
|
84
|
+
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E00\u4E2A\u70B9:`), m === b.kOk)) {
|
|
85
|
+
if (n === 0 && (h.push(i.value()), i.setUserDraw((M, T) => {
|
|
86
|
+
T.drawLine(h[0], M);
|
|
87
|
+
}), i.setMessage(`
|
|
88
|
+
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E8C\u4E2A\u70B9:`)), n === 1 && (h.push(i.value()), i.setUserDraw((M, T) => {
|
|
89
|
+
const [v, P] = h, K = M;
|
|
90
|
+
o.center = At([
|
|
91
|
+
v,
|
|
92
|
+
P,
|
|
93
|
+
K
|
|
94
|
+
]), o.radius = o.center.distanceTo(v), T.drawCustomEntity(o);
|
|
95
|
+
}), i.setMessage(`
|
|
96
|
+
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E09\u4E2A\u70B9:`)), n === 2)
|
|
97
|
+
return h.push(i.value()), o.center = At(h), o.radius = o.center.distanceTo(h[0]), I.getCurrentDraw().addMxEntity(o), !0;
|
|
98
|
+
n++;
|
|
960
99
|
}
|
|
961
100
|
};
|
|
962
|
-
let
|
|
963
|
-
const
|
|
964
|
-
new THREE.Line3(
|
|
965
|
-
}, D = (
|
|
966
|
-
if (
|
|
967
|
-
\u6307\u5B9A\u5706\u76F4\u5F84\u7684\u7B2C\u4E00\u4E2A\u7AEF\u70B9:`),
|
|
968
|
-
if (
|
|
969
|
-
|
|
970
|
-
}),
|
|
971
|
-
\u6307\u5B9A\u5706\u76F4\u5F84\u7684\u7B2C\u4E8C\u4E2A\u7AEF\u70B9:`)),
|
|
972
|
-
return
|
|
973
|
-
|
|
101
|
+
let E;
|
|
102
|
+
const x = (m, M) => {
|
|
103
|
+
new THREE.Line3(m, M).getCenter(o.center), o.radius = M.distanceTo(m) / 2;
|
|
104
|
+
}, D = (m) => {
|
|
105
|
+
if (f === "2P" && (i.setMessage(`
|
|
106
|
+
\u6307\u5B9A\u5706\u76F4\u5F84\u7684\u7B2C\u4E00\u4E2A\u7AEF\u70B9:`), m === b.kOk)) {
|
|
107
|
+
if (n === 0 && (E = i.value(), i.setUserDraw((M, T) => {
|
|
108
|
+
x(E, M), T.drawCustomEntity(o), T.drawLine(E, M);
|
|
109
|
+
}), i.setMessage(`
|
|
110
|
+
\u6307\u5B9A\u5706\u76F4\u5F84\u7684\u7B2C\u4E8C\u4E2A\u7AEF\u70B9:`)), n === 1)
|
|
111
|
+
return x(E, i.value()), I.getCurrentDraw().addMxEntity(o), !0;
|
|
112
|
+
n++;
|
|
974
113
|
}
|
|
975
|
-
},
|
|
976
|
-
if (
|
|
977
|
-
if (
|
|
978
|
-
\u6307\u5B9A\u5BF9\u8C61\u4E0E\u5706\u7684\u7B2C\u4E00\u4E2A\u5207\u70B9:`),
|
|
979
|
-
if (
|
|
980
|
-
const
|
|
981
|
-
console.log(
|
|
114
|
+
}, W = (m) => {
|
|
115
|
+
if (f === "T") {
|
|
116
|
+
if (i.setMessage(`
|
|
117
|
+
\u6307\u5B9A\u5BF9\u8C61\u4E0E\u5706\u7684\u7B2C\u4E00\u4E2A\u5207\u70B9:`), m === b.kOk) {
|
|
118
|
+
if (n === 0) {
|
|
119
|
+
const M = i.value();
|
|
120
|
+
console.log(M), I.getCurrentDraw();
|
|
982
121
|
}
|
|
983
|
-
|
|
122
|
+
n++;
|
|
984
123
|
}
|
|
985
124
|
return !0;
|
|
986
125
|
}
|
|
987
126
|
};
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
127
|
+
i.setMessage(
|
|
128
|
+
`
|
|
129
|
+
\u6307\u5B9A\u5706\u7684\u5706\u5FC3\u6216[\u4E09\u70B9(3P)/\u4E24\u70B9(2P)/\u5207\u70B9\u3001\u5207\u70B9\u3001\u534A\u5F84(T)]:`
|
|
130
|
+
), i.setKeyWords("3P 2P T"), i.goWhile(
|
|
131
|
+
(m) => {
|
|
132
|
+
if (m === b.kKeyWord && (i.isKeyWordPicked("3P") ? f = "3P" : i.isKeyWordPicked("2P") ? f = "2P" : i.isKeyWordPicked("T") && (f = "T")), d(m))
|
|
133
|
+
return { exit: !0 };
|
|
134
|
+
if (w(m))
|
|
135
|
+
return { exit: !0 };
|
|
136
|
+
if (D(m))
|
|
137
|
+
return { exit: !0 };
|
|
138
|
+
if (W(m))
|
|
139
|
+
return { exit: !0 };
|
|
140
|
+
},
|
|
141
|
+
(m) => {
|
|
142
|
+
m === b.kCancel && I.getCurrentDraw().addMxEntity(o);
|
|
143
|
+
}
|
|
144
|
+
);
|
|
1001
145
|
}
|
|
1002
|
-
|
|
1003
|
-
I.addCommand("Mx_Circle",
|
|
146
|
+
Ve.events.on("MxDbEntityRegister", () => {
|
|
147
|
+
I.addCommand("Mx_Circle", Gt);
|
|
1004
148
|
});
|
|
1005
|
-
const
|
|
1006
|
-
function
|
|
1007
|
-
const
|
|
1008
|
-
let
|
|
1009
|
-
return
|
|
149
|
+
const wt = () => Ve.state.MxFun.stopRunCommand();
|
|
150
|
+
function je(i, o, n, f) {
|
|
151
|
+
const l = i - n, g = o - f;
|
|
152
|
+
let d = 0;
|
|
153
|
+
return l == 0 ? d = Math.PI / 2 : d = Math.atan(Math.abs(g / l)), l < 0 && g >= 0 ? d = Math.PI - d : l < 0 && g < 0 ? d = Math.PI + d : l >= 0 && g < 0 && (d = Math.PI * 2 - d), d;
|
|
1010
154
|
}
|
|
1011
|
-
async function
|
|
1012
|
-
const
|
|
1013
|
-
let
|
|
1014
|
-
|
|
155
|
+
async function Xt() {
|
|
156
|
+
const i = new oe();
|
|
157
|
+
let o = new Re(), n = [];
|
|
158
|
+
i.setMessage(`
|
|
1015
159
|
\u6307\u5B9A\u7B2C\u4E00\u70B9:`);
|
|
1016
|
-
let
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
}),
|
|
160
|
+
let f = await i.go();
|
|
161
|
+
i.setUserDraw((g, d) => {
|
|
162
|
+
n.forEach((h) => {
|
|
163
|
+
d.drawCustomEntity(h);
|
|
164
|
+
}), d.drawLine(f, g);
|
|
1021
165
|
});
|
|
1022
|
-
const
|
|
1023
|
-
|
|
1024
|
-
\u6307\u5B9A\u4E0B\u4E00\u4E2A\u70B9:`),
|
|
166
|
+
const l = () => {
|
|
167
|
+
i.setMessage(`
|
|
168
|
+
\u6307\u5B9A\u4E0B\u4E00\u4E2A\u70B9:`), n.length > 1 ? i.setKeyWords("[\u9000\u51FA(E)/\u95ED\u5408(C)/\u653E\u5F03(U)]") : i.setKeyWords("[\u9000\u51FA(E)/\u653E\u5F03(U)]");
|
|
1025
169
|
};
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
if (o.
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
170
|
+
l(), i.goWhile(
|
|
171
|
+
(g) => {
|
|
172
|
+
if (g === b.kOk && (o = new Re(), q.use(o), o.pt1 = f, o.pt2 = i.value(), f = o.pt2.clone(), n.push(o), l()), g === b.kKeyWord) {
|
|
173
|
+
if (i.isKeyWordPicked("E"))
|
|
174
|
+
wt();
|
|
175
|
+
else if (i.isKeyWordPicked("C")) {
|
|
176
|
+
const d = new Re();
|
|
177
|
+
return d.pt1 = f.clone(), d.pt2 = n[0].pt1.clone(), q.use(d), n.push(d), f = d.pt2.clone(), wt(), { exit: !0 };
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
(g) => {
|
|
182
|
+
if (g === b.kCancel)
|
|
183
|
+
return n.forEach((d) => {
|
|
184
|
+
I.getCurrentDraw().addMxEntity(d);
|
|
185
|
+
}), { exit: !0 };
|
|
186
|
+
}
|
|
187
|
+
);
|
|
1041
188
|
}
|
|
1042
|
-
|
|
1043
|
-
I.addCommand("Mx_Line",
|
|
189
|
+
Ve.events.on("MxDbEntityRegister", () => {
|
|
190
|
+
I.addCommand("Mx_Line", Xt);
|
|
1044
191
|
});
|
|
1045
|
-
async function
|
|
1046
|
-
const
|
|
1047
|
-
|
|
192
|
+
async function en() {
|
|
193
|
+
const i = new oe();
|
|
194
|
+
i.setMessage(`
|
|
1048
195
|
\u6307\u5B9A\u63D2\u5165\u4F4D\u7F6E:`);
|
|
1049
|
-
let
|
|
1050
|
-
if (
|
|
196
|
+
let o = await i.go();
|
|
197
|
+
if (o == null)
|
|
1051
198
|
return;
|
|
1052
|
-
let
|
|
199
|
+
let n = `\u6D4B\u8BD5
|
|
1053
200
|
\u6D4B\u8BD5`;
|
|
1054
|
-
if (
|
|
201
|
+
if (n.length <= 0)
|
|
1055
202
|
return;
|
|
1056
|
-
let
|
|
1057
|
-
|
|
1058
|
-
const
|
|
1059
|
-
postx:
|
|
1060
|
-
posty:
|
|
1061
|
-
text:
|
|
1062
|
-
height:
|
|
203
|
+
let f = I.screenCoordLong2Doc(50);
|
|
204
|
+
n = _t.b64Encode(n);
|
|
205
|
+
const l = {
|
|
206
|
+
postx: o.x,
|
|
207
|
+
posty: o.y,
|
|
208
|
+
text: n,
|
|
209
|
+
height: f
|
|
1063
210
|
};
|
|
1064
|
-
I.call("Mx_MText",
|
|
211
|
+
I.call("Mx_MText", l);
|
|
1065
212
|
}
|
|
1066
|
-
async function
|
|
1067
|
-
const
|
|
1068
|
-
|
|
213
|
+
async function tn() {
|
|
214
|
+
const i = new oe(), o = new Kt();
|
|
215
|
+
q.use(o), i.setMessage(`
|
|
1069
216
|
\u6307\u5B9A\u8D77\u70B9:`);
|
|
1070
|
-
let
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
}),
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
217
|
+
let n;
|
|
218
|
+
i.setUserDraw((f, l) => {
|
|
219
|
+
l.drawCustomEntity(o), n && l.drawLine(n, f);
|
|
220
|
+
}), i.goWhile(
|
|
221
|
+
(f) => {
|
|
222
|
+
if (f === b.kOk) {
|
|
223
|
+
const l = i.value();
|
|
224
|
+
o.points.push(i.value()), n = l, i.setMessage(`
|
|
225
|
+
\u6307\u5B9A\u4E0B\u4E00\u4E2A\u70B9:`), i.setKeyWords("[\u5706\u5F27(A)/\u5BBD\u5EA6(W)]");
|
|
226
|
+
} else
|
|
227
|
+
f === b.kKeyWord && (i.isKeyWordPicked("A"), i.isKeyWordPicked("W"));
|
|
228
|
+
},
|
|
229
|
+
(f) => {
|
|
230
|
+
f === b.kCancel && I.getCurrentDraw().addMxEntity(o);
|
|
231
|
+
}
|
|
232
|
+
);
|
|
1083
233
|
}
|
|
1084
|
-
async function
|
|
1085
|
-
const
|
|
1086
|
-
let
|
|
1087
|
-
|
|
234
|
+
async function nn() {
|
|
235
|
+
const i = new oe();
|
|
236
|
+
let o = new jt();
|
|
237
|
+
q.use(o), i.setMessage(`
|
|
1088
238
|
\u8F93\u5165\u8FB9\u7684\u6570\u76EE<5>:`);
|
|
1089
|
-
let
|
|
1090
|
-
for (;
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
let
|
|
1094
|
-
|
|
1095
|
-
if (
|
|
1096
|
-
if (
|
|
1097
|
-
|
|
1098
|
-
[\u5185\u63A5\u4E8E\u5706(I)/\u5916\u5207\u4E8E\u5706(C)]<\u5916\u5207>:`),
|
|
1099
|
-
else if (
|
|
1100
|
-
|
|
1101
|
-
\u6307\u5B9A\u8FB9\u7684\u7B2C\u4E8C\u4E2A\u7AEF\u70B9:`),
|
|
239
|
+
let n = 3, f = [n];
|
|
240
|
+
for (; n < 25; )
|
|
241
|
+
f.push(n++);
|
|
242
|
+
i.setKeyWords(f.join(" "));
|
|
243
|
+
let l = 0;
|
|
244
|
+
i.goWhile((g) => {
|
|
245
|
+
if (g === b.kOk)
|
|
246
|
+
if (l === 1)
|
|
247
|
+
o.centerPoint = i.value(), i.setMessage(`
|
|
248
|
+
[\u5185\u63A5\u4E8E\u5706(I)/\u5916\u5207\u4E8E\u5706(C)]<\u5916\u5207>:`), i.setKeyWords("I C");
|
|
249
|
+
else if (l === 2)
|
|
250
|
+
i.setMessage(`
|
|
251
|
+
\u6307\u5B9A\u8FB9\u7684\u7B2C\u4E8C\u4E2A\u7AEF\u70B9:`), l++;
|
|
1102
252
|
else {
|
|
1103
|
-
if (
|
|
1104
|
-
return
|
|
253
|
+
if (l === 3)
|
|
254
|
+
return i.setMessage(`
|
|
1105
255
|
\u6307\u5B9A\u8FB9\u7684\u7B2C\u4E8C\u4E2A\u7AEF\u70B9:`), { exit: !0 };
|
|
1106
|
-
if (
|
|
1107
|
-
return
|
|
1108
|
-
|
|
256
|
+
if (l === 4)
|
|
257
|
+
return o.otherPoint = i.value(), I.getCurrentDraw().addMxEntity(o), { exit: !0 };
|
|
258
|
+
l === 5 && i.setMessage(`
|
|
1109
259
|
\u5916\u5207\u4E8E\u5706(C)\u65E0\u6CD5\u7ED8\u5236:`);
|
|
1110
260
|
}
|
|
1111
|
-
if (
|
|
1112
|
-
const
|
|
1113
|
-
!Number.isNaN(
|
|
1114
|
-
\u6307\u5B9A\u6B63\u591A\u8FB9\u5F62\u7684\u4E2D\u5FC3\u70B9\u6216 [\u8FB9(E)]:`),
|
|
1115
|
-
\u6307\u5B9A\u8FB9\u7684\u7B2C\u4E00\u4E2A\u7AEF\u70B9:`),
|
|
1116
|
-
|
|
1117
|
-
}),
|
|
1118
|
-
\u6307\u5B9A\u5706\u7684\u534A\u5F84:`),
|
|
1119
|
-
\u5916\u5207\u4E8E\u5706(C)\u65E0\u6CD5\u7ED8\u5236:`),
|
|
261
|
+
if (g === b.kKeyWord) {
|
|
262
|
+
const d = i.keyWordPicked(), h = Number(d);
|
|
263
|
+
!Number.isNaN(h) && l === 0 && (o.sidesNumber = h, i.setMessage(`
|
|
264
|
+
\u6307\u5B9A\u6B63\u591A\u8FB9\u5F62\u7684\u4E2D\u5FC3\u70B9\u6216 [\u8FB9(E)]:`), i.setKeyWords("E"), l++), l === 1 && (i.isKeyWordPicked("E") && (i.setMessage(`
|
|
265
|
+
\u6307\u5B9A\u8FB9\u7684\u7B2C\u4E00\u4E2A\u7AEF\u70B9:`), l++), i.isKeyWordPicked("I") ? (i.setUserDraw((w, E) => {
|
|
266
|
+
o.otherPoint = w, E.drawCustomEntity(o);
|
|
267
|
+
}), i.setMessage(`
|
|
268
|
+
\u6307\u5B9A\u5706\u7684\u534A\u5F84:`), l++, l++, l++) : i.isKeyWordPicked("C") && (i.setMessage(`
|
|
269
|
+
\u5916\u5207\u4E8E\u5706(C)\u65E0\u6CD5\u7ED8\u5236:`), l++, l++, l++, l++));
|
|
1120
270
|
}
|
|
1121
271
|
});
|
|
1122
272
|
}
|
|
1123
|
-
function
|
|
1124
|
-
const
|
|
1125
|
-
return new THREE.Vector3(
|
|
273
|
+
function $t(i, o, n) {
|
|
274
|
+
const f = i.x, l = o.x, g = n.x, d = i.y, h = o.y, w = n.y, E = f - l, x = d - h, D = f - g, W = d - w, m = (f * f - l * l + (d * d - h * h)) / 2, M = (f * f - g * g + (d * d - w * w)) / 2, T = x * D - E * W, v = -(W * m - x * M) / T, P = -(E * M - D * m) / T;
|
|
275
|
+
return new THREE.Vector3(v, P, 0);
|
|
1126
276
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const
|
|
1129
|
-
return Math.sqrt((
|
|
277
|
+
function Yt(i, o) {
|
|
278
|
+
const n = i.x, f = i.y, l = o.x, g = o.y;
|
|
279
|
+
return Math.sqrt((n - l) * (n - l) + (f - g) * (f - g));
|
|
1130
280
|
}
|
|
1131
|
-
function
|
|
1132
|
-
let n;
|
|
1133
|
-
o < l ? n = l - o : n = l - o + 360;
|
|
281
|
+
function Zt(i, o, n) {
|
|
1134
282
|
let f;
|
|
1135
|
-
|
|
283
|
+
i < n ? f = n - i : f = n - i + 360;
|
|
284
|
+
let l;
|
|
285
|
+
return i < o ? l = o - i : l = o - i + 360, l > f;
|
|
1136
286
|
}
|
|
1137
|
-
function Oe(
|
|
1138
|
-
const
|
|
1139
|
-
let
|
|
1140
|
-
return
|
|
1141
|
-
sin:
|
|
1142
|
-
cos:
|
|
1143
|
-
angle:
|
|
287
|
+
function Oe(i, o, n) {
|
|
288
|
+
const f = i.x, l = o.x, g = i.y, d = o.y;
|
|
289
|
+
let h, w, E;
|
|
290
|
+
return h = (g - d) / n, w = (f - l) / n, w >= 0.99999 && (w = 0.99999), w <= -0.99999 && (w = -0.99999), E = Math.acos(w), E = E / Math.PI * 180, h < -0.05 && (E = 360 - E), {
|
|
291
|
+
sin: h,
|
|
292
|
+
cos: w,
|
|
293
|
+
angle: E
|
|
1144
294
|
};
|
|
1145
295
|
}
|
|
1146
|
-
const
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1149
|
-
if (
|
|
296
|
+
const J = (i, o, n) => {
|
|
297
|
+
const f = () => {
|
|
298
|
+
i.go((l) => {
|
|
299
|
+
if (l === b.kKeyWord && n() && f(), l === b.kOk && o() && f(), l === b.kNone && f(), l === b.kCancel)
|
|
1150
300
|
return { exit: !0 };
|
|
1151
301
|
});
|
|
1152
302
|
};
|
|
1153
|
-
return
|
|
303
|
+
return f;
|
|
1154
304
|
};
|
|
1155
|
-
class
|
|
1156
|
-
bulge = 0;
|
|
305
|
+
class He extends mt {
|
|
1157
306
|
constructor() {
|
|
1158
307
|
super(), this._propertyDbKeys = [...this._propertyDbKeys, "bulge"];
|
|
1159
308
|
}
|
|
@@ -1161,110 +310,1114 @@ class ke extends mt {
|
|
|
1161
310
|
return "MxDbCircle";
|
|
1162
311
|
}
|
|
1163
312
|
create() {
|
|
1164
|
-
return new
|
|
313
|
+
return new He();
|
|
1165
314
|
}
|
|
1166
|
-
getArcBulge(
|
|
1167
|
-
const
|
|
1168
|
-
let
|
|
1169
|
-
|
|
315
|
+
getArcBulge(o, n, f) {
|
|
316
|
+
const l = o.distanceTo(n);
|
|
317
|
+
let h = 2 * new THREE.Line3(o, n).getCenter(
|
|
318
|
+
new THREE.Vector3()
|
|
319
|
+
).distanceTo(f) / l;
|
|
320
|
+
return h > 0.9999 && h < 1.0001 ? h = 1 : h < -0.9999 && h > -1.0001 ? h = -1 : Math.abs(h) < 1e-10 && (h = 0), h;
|
|
1170
321
|
}
|
|
1171
|
-
getArcMidPoint(
|
|
1172
|
-
const
|
|
1173
|
-
let
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1176
|
-
const D =
|
|
1177
|
-
(
|
|
1178
|
-
const
|
|
1179
|
-
return
|
|
322
|
+
getArcMidPoint(o, n, f, l, g) {
|
|
323
|
+
const d = o, h = f * Math.PI / 180;
|
|
324
|
+
let w = l * Math.PI / 180;
|
|
325
|
+
const E = new THREE.Vector3(), x = new THREE.Vector3();
|
|
326
|
+
E.x = d.x + n * Math.cos(h), E.y = d.y + n * Math.sin(h), x.x = d.x + n * Math.cos(w), x.y = d.y + n * Math.sin(w);
|
|
327
|
+
const D = n;
|
|
328
|
+
(g ? f < l : f > l) && (w += Math.PI * 2);
|
|
329
|
+
const W = new THREE.Vector3();
|
|
330
|
+
return W.x = d.x + D * Math.cos((h + w) / 2), W.y = d.y + D * Math.sin((h + w) / 2), [E, W, x, this.center];
|
|
1180
331
|
}
|
|
1181
332
|
getGripPoints() {
|
|
1182
|
-
return this.getArcMidPoint(
|
|
333
|
+
return this.getArcMidPoint(
|
|
334
|
+
this.center,
|
|
335
|
+
this.radius,
|
|
336
|
+
THREE.MathUtils.radToDeg(this.startAngle),
|
|
337
|
+
THREE.MathUtils.radToDeg(this.endAngle),
|
|
338
|
+
this.clockwise
|
|
339
|
+
);
|
|
1183
340
|
}
|
|
1184
|
-
moveGripPointsAt(
|
|
1185
|
-
if (
|
|
1186
|
-
return this.center.add(
|
|
1187
|
-
const
|
|
1188
|
-
return this.upDatePoints(
|
|
341
|
+
moveGripPointsAt(o, n) {
|
|
342
|
+
if (o === 3)
|
|
343
|
+
return this.center.add(n), !0;
|
|
344
|
+
const f = this.getGripPoints();
|
|
345
|
+
return this.upDatePoints(f, o, n), !0;
|
|
1189
346
|
}
|
|
1190
|
-
upDatePoints(
|
|
1191
|
-
|
|
1192
|
-
const [
|
|
1193
|
-
this.center =
|
|
1194
|
-
const
|
|
1195
|
-
this.clockwise =
|
|
347
|
+
upDatePoints(o, n, f) {
|
|
348
|
+
o[n].add(f);
|
|
349
|
+
const [l, g, d] = o;
|
|
350
|
+
this.center = $t(l, d, g), this.radius = Yt(g, this.center);
|
|
351
|
+
const h = Oe(l, this.center, this.radius), w = Oe(d, this.center, this.radius), E = Oe(g, this.center, this.radius);
|
|
352
|
+
this.clockwise = Zt(
|
|
353
|
+
w.angle,
|
|
354
|
+
h.angle,
|
|
355
|
+
E.angle
|
|
356
|
+
), this.startAngle = THREE.MathUtils.degToRad(h.angle), this.endAngle = THREE.MathUtils.degToRad(w.angle);
|
|
1196
357
|
}
|
|
1197
358
|
}
|
|
1198
|
-
function
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
|
|
359
|
+
async function rn() {
|
|
360
|
+
const i = new oe();
|
|
361
|
+
i.setMessage(`
|
|
362
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u8D77\u70B9:`), i.setKeyWords("[\u5706\u5FC3(C)]");
|
|
363
|
+
let o = new He();
|
|
364
|
+
o.closed = !1, q.use(o);
|
|
365
|
+
let n, f, l;
|
|
366
|
+
const g = J(
|
|
367
|
+
i,
|
|
368
|
+
() => {
|
|
369
|
+
n = i.value(), i.setMessage(`
|
|
370
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u7B2C\u4E8C\u4E2A\u70B9:`), i.setKeyWords("[\u5706\u5FC3(C)/\u7AEF\u70B9(E)]"), i.setUserDraw((v, P) => {
|
|
371
|
+
P.drawLine(n, v);
|
|
372
|
+
}), M();
|
|
373
|
+
},
|
|
374
|
+
() => {
|
|
375
|
+
if (i.isKeyWordPicked("C")) {
|
|
376
|
+
const v = new De();
|
|
377
|
+
o.center = i.value(), v.center = i.value(), i.setMessage(`
|
|
378
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u5706\u5FC3:`), i.setKeyWords(""), h();
|
|
379
|
+
} else
|
|
380
|
+
return !0;
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
let d;
|
|
384
|
+
const h = J(
|
|
385
|
+
i,
|
|
386
|
+
() => {
|
|
387
|
+
d = i.value(), l = new De(), l.closed = !1, q.use(l), l.center = d, o.center = d, i.setMessage(`
|
|
388
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u8D77\u70B9:`), i.setUserDraw((v, P) => {
|
|
389
|
+
P.drawCustomEntity(l), P.drawLine(d, v);
|
|
390
|
+
}), x();
|
|
391
|
+
},
|
|
392
|
+
() => {
|
|
393
|
+
}
|
|
394
|
+
);
|
|
395
|
+
let w, E;
|
|
396
|
+
const x = J(
|
|
397
|
+
i,
|
|
398
|
+
() => {
|
|
399
|
+
w = i.value(), l.endPoint = w, i.setMessage(
|
|
400
|
+
`
|
|
401
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u7AEF\u70B9(\u6309\u4F4F ctrl \u952E\u53D6\u76F8\u53CD\u65B9\u5411)\u6216 [\u89D2\u5EA6(A)/\u5F26\u957F(L)/\u4FEE\u6539\u534A\u5F84(R)]:`
|
|
402
|
+
), i.setKeyWords("A L R"), E = new Re(), E.setDashLineDisplay(!0), E.setDashArray(0.05), E.setLineWidth(2), E.setColor("#ffd30d"), E.pt1 = l.center, i.setUserDraw((v, P) => {
|
|
403
|
+
l.startPoint = v, E.pt2 = v, P.drawCustomEntity(l), P.drawCustomEntity(E);
|
|
404
|
+
}), W();
|
|
405
|
+
},
|
|
406
|
+
() => {
|
|
407
|
+
}
|
|
408
|
+
);
|
|
409
|
+
let D;
|
|
410
|
+
const W = J(
|
|
411
|
+
i,
|
|
412
|
+
() => {
|
|
413
|
+
D = i.value(), l.startPoint = D, l.endPoint = w, I.getCurrentDraw().addMxEntity(l);
|
|
414
|
+
},
|
|
415
|
+
() => {
|
|
416
|
+
if (i.isKeyWordPicked("A"))
|
|
417
|
+
return i.setMessage(
|
|
418
|
+
`
|
|
419
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u5939\u89D2(\u6309\u4F4F ctrl \u952E\u53D6\u76F8\u53CD\u65B9\u5411)\u6216 [\u4FEE\u6539\u534A\u5F84(R)]:`
|
|
420
|
+
), i.setKeyWords("R"), i.setUserDraw((v, P) => {
|
|
421
|
+
l.startPoint = v, P.drawCustomEntity(l), P.drawCustomEntity(E);
|
|
422
|
+
}), !0;
|
|
423
|
+
if (i.isKeyWordPicked("L"))
|
|
424
|
+
return i.setMessage(
|
|
425
|
+
`
|
|
426
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u5939\u89D2(\u6309\u4F4F ctrl \u952E\u53D6\u76F8\u53CD\u65B9\u5411)\u6216 [\u4FEE\u6539\u534A\u5F84(R)]:`
|
|
427
|
+
), i.setKeyWords("R"), i.setUserDraw((v, P) => {
|
|
428
|
+
l.startPoint = v, P.drawCustomEntity(l), P.drawCustomEntity(E);
|
|
429
|
+
}), !0;
|
|
430
|
+
if (i.isKeyWordPicked("R"))
|
|
431
|
+
i.setMessage(
|
|
432
|
+
`
|
|
433
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u534A\u5F84${l.radius ? "<" + l.radius + ">" : ""}:`
|
|
434
|
+
), i.setKeyWords(""), i.setUserDraw((v, P) => {
|
|
435
|
+
P.drawLine(v, l.center), l.startPoint = v, P.drawCustomEntity(l);
|
|
436
|
+
}), x();
|
|
437
|
+
else
|
|
438
|
+
return !0;
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
let m;
|
|
442
|
+
const M = J(
|
|
443
|
+
i,
|
|
444
|
+
() => {
|
|
445
|
+
m = i.value(), i.setMessage(`
|
|
446
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u7AEF\u70B9:`), f = new Ot(), f.autoClockwise = !0, f.closed = !1, q.use(f), f.point1 = n, f.point3 = m, o.center, i.setUserDraw((v, P) => {
|
|
447
|
+
f.point2 = v, P.drawCustomEntity(o);
|
|
448
|
+
}), T();
|
|
449
|
+
},
|
|
450
|
+
() => {
|
|
451
|
+
if (i.isKeyWordPicked("C"))
|
|
452
|
+
l = new De(), l.closed = !1, q.use(l), i.setMessage(`
|
|
453
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u5706\u5FC3`), i.setKeyWords(""), i.setUserDraw((v, P) => {
|
|
454
|
+
l.startPoint = n, P.drawLine(v, l.startPoint);
|
|
455
|
+
}), h();
|
|
456
|
+
else if (i.isKeyWordPicked("E"))
|
|
457
|
+
l = new De(), l.closed = !1, q.use(l), i.setMessage(`
|
|
458
|
+
\u6307\u5B9A\u5706\u5F27\u7684\u5706\u5FC3`), i.setKeyWords(""), i.setUserDraw((v, P) => {
|
|
459
|
+
l.startPoint = n, P.drawLine(v, l.startPoint);
|
|
460
|
+
}), h();
|
|
461
|
+
else
|
|
462
|
+
return !0;
|
|
463
|
+
}
|
|
464
|
+
), T = J(
|
|
465
|
+
i,
|
|
466
|
+
() => {
|
|
467
|
+
f.point1 = n, f.point2 = i.value(), f.point3 = m, I.getCurrentDraw().addMxEntity(f);
|
|
468
|
+
},
|
|
469
|
+
() => {
|
|
470
|
+
if (i.isKeyWordPicked("C"))
|
|
471
|
+
console.log("C");
|
|
472
|
+
else if (i.isKeyWordPicked("E"))
|
|
473
|
+
console.log("E");
|
|
474
|
+
else
|
|
475
|
+
return !0;
|
|
476
|
+
}
|
|
477
|
+
);
|
|
478
|
+
g();
|
|
1214
479
|
}
|
|
1215
|
-
function
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1218
|
-
\u6307\u5B9A\u692D\u5706\u7684\u8F74\u7AEF\u70B9`),
|
|
1219
|
-
let
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
480
|
+
function sn() {
|
|
481
|
+
const i = new oe(), o = new kt();
|
|
482
|
+
o.closed = !1, q.use(o), i.setMessage(`
|
|
483
|
+
\u6307\u5B9A\u692D\u5706\u7684\u8F74\u7AEF\u70B9`), i.setKeyWords("[\u4E2D\u5FC3\u70B9(C)]");
|
|
484
|
+
let n, f = new THREE.Vector3();
|
|
485
|
+
J(
|
|
486
|
+
i,
|
|
487
|
+
() => {
|
|
488
|
+
n = i.value(), i.setUserDraw((E, x) => {
|
|
489
|
+
const D = new THREE.Line3(n, E);
|
|
490
|
+
D.getCenter(f), o.center = f, o.xRadius = D.distance() / 2, o.yRadius = o.xRadius, o.rotation = je(E.x, E.y, f.x, f.y), x.drawLine(E, n);
|
|
491
|
+
}), i.setMessage(`
|
|
492
|
+
\u6307\u5B9A\u692D\u5706\u5F27\u8F74\u7684\u53E6\u4E00\u4E2A\u7AEF\u70B9:`), i.setKeyWords(""), g();
|
|
493
|
+
},
|
|
494
|
+
() => {
|
|
495
|
+
}
|
|
496
|
+
)();
|
|
497
|
+
const g = J(
|
|
498
|
+
i,
|
|
499
|
+
() => {
|
|
500
|
+
i.setUserDraw((E, x) => {
|
|
501
|
+
o.yRadius = f.distanceTo(E), x.drawLine(f, E), x.drawCustomEntity(o);
|
|
502
|
+
}), i.setMessage(`
|
|
503
|
+
\u6307\u5B9A\u53E6\u4E00\u6761\u534A\u8F74\u957F\u5EA6`), i.setKeyWords(""), d();
|
|
504
|
+
},
|
|
505
|
+
() => {
|
|
506
|
+
}
|
|
507
|
+
), d = J(
|
|
508
|
+
i,
|
|
509
|
+
() => {
|
|
510
|
+
i.setMessage(`
|
|
511
|
+
\u6307\u5B9A\u8D77\u59CB\u89D2\u5EA6`), i.setKeyWords(""), i.setUserDraw((E, x) => {
|
|
512
|
+
o.startAngle = je(E.x, E.y, f.x, f.y) - o.rotation, x.drawLine(f, E), x.drawCustomEntity(o);
|
|
513
|
+
}), h();
|
|
514
|
+
},
|
|
515
|
+
() => {
|
|
516
|
+
}
|
|
517
|
+
), h = J(
|
|
518
|
+
i,
|
|
519
|
+
() => {
|
|
520
|
+
i.setUserDraw((E, x) => {
|
|
521
|
+
o.endAngle = je(E.x, E.y, f.x, f.y) - o.rotation, x.drawLine(f, E), x.drawCustomEntity(o);
|
|
522
|
+
}), i.setMessage(`
|
|
523
|
+
\u6307\u5B9A\u7EC8\u6B62\u89D2\u5EA6`), i.setKeyWords(""), w();
|
|
524
|
+
},
|
|
525
|
+
() => {
|
|
526
|
+
}
|
|
527
|
+
), w = J(
|
|
528
|
+
i,
|
|
529
|
+
() => {
|
|
530
|
+
I.getCurrentDraw().addMxEntity(o);
|
|
531
|
+
},
|
|
532
|
+
() => {
|
|
533
|
+
}
|
|
534
|
+
);
|
|
1250
535
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
536
|
+
var Fe = (() => {
|
|
537
|
+
var i = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
|
|
538
|
+
return typeof __filename < "u" && (i = i || __filename), function(o) {
|
|
539
|
+
o = o || {};
|
|
540
|
+
var n;
|
|
541
|
+
n || (n = typeof o < "u" ? o : {});
|
|
542
|
+
var f, l;
|
|
543
|
+
n.ready = new Promise(function(e, t) {
|
|
544
|
+
f = e, l = t;
|
|
545
|
+
});
|
|
546
|
+
var g = Object.assign({}, n), d = typeof window == "object", h = typeof importScripts == "function", w = "", E, x, D, W, m, M;
|
|
547
|
+
typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" ? (w = h ? require("path").dirname(w) + "/" : __dirname + "/", M = () => {
|
|
548
|
+
m || (W = require("fs"), m = require("path"));
|
|
549
|
+
}, E = function(e, t) {
|
|
550
|
+
return M(), e = m.normalize(e), W.readFileSync(e, t ? void 0 : "utf8");
|
|
551
|
+
}, D = (e) => (e = E(e, !0), e.buffer || (e = new Uint8Array(e)), e), x = (e, t, r) => {
|
|
552
|
+
M(), e = m.normalize(e), W.readFile(e, function(s, c) {
|
|
553
|
+
s ? r(s) : t(c.buffer);
|
|
554
|
+
});
|
|
555
|
+
}, 1 < process.argv.length && process.argv[1].replace(/\\/g, "/"), process.argv.slice(2), process.on("uncaughtException", function(e) {
|
|
556
|
+
throw e;
|
|
557
|
+
}), process.on("unhandledRejection", function(e) {
|
|
558
|
+
throw e;
|
|
559
|
+
}), n.inspect = function() {
|
|
560
|
+
return "[Emscripten Module object]";
|
|
561
|
+
}) : (d || h) && (h ? w = self.location.href : typeof document < "u" && document.currentScript && (w = document.currentScript.src), i && (w = i), w = w.indexOf("blob:") !== 0 ? w.substr(0, w.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", E = (e) => {
|
|
562
|
+
var t = new XMLHttpRequest();
|
|
563
|
+
return t.open("GET", e, !1), t.send(null), t.responseText;
|
|
564
|
+
}, h && (D = (e) => {
|
|
565
|
+
var t = new XMLHttpRequest();
|
|
566
|
+
return t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
|
|
567
|
+
}), x = (e, t, r) => {
|
|
568
|
+
var s = new XMLHttpRequest();
|
|
569
|
+
s.open("GET", e, !0), s.responseType = "arraybuffer", s.onload = () => {
|
|
570
|
+
s.status == 200 || s.status == 0 && s.response ? t(s.response) : r();
|
|
571
|
+
}, s.onerror = r, s.send(null);
|
|
572
|
+
});
|
|
573
|
+
var T = n.print || console.log.bind(console), v = n.printErr || console.warn.bind(console);
|
|
574
|
+
Object.assign(n, g), g = null;
|
|
575
|
+
function P(e) {
|
|
576
|
+
K || (K = {}), K[e] || (K[e] = 1, v(e));
|
|
577
|
+
}
|
|
578
|
+
var K, O;
|
|
579
|
+
n.wasmBinary && (O = n.wasmBinary), n.noExitRuntime, typeof WebAssembly != "object" && ae("no native wasm support detected");
|
|
580
|
+
var U, H = !1, N = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
|
|
581
|
+
function z(e, t, r) {
|
|
582
|
+
var s = t + r;
|
|
583
|
+
for (r = t; e[r] && !(r >= s); )
|
|
584
|
+
++r;
|
|
585
|
+
if (16 < r - t && e.buffer && N)
|
|
586
|
+
return N.decode(e.subarray(t, r));
|
|
587
|
+
for (s = ""; t < r; ) {
|
|
588
|
+
var c = e[t++];
|
|
589
|
+
if (c & 128) {
|
|
590
|
+
var u = e[t++] & 63;
|
|
591
|
+
if ((c & 224) == 192)
|
|
592
|
+
s += String.fromCharCode((c & 31) << 6 | u);
|
|
593
|
+
else {
|
|
594
|
+
var a = e[t++] & 63;
|
|
595
|
+
c = (c & 240) == 224 ? (c & 15) << 12 | u << 6 | a : (c & 7) << 18 | u << 12 | a << 6 | e[t++] & 63, 65536 > c ? s += String.fromCharCode(c) : (c -= 65536, s += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023));
|
|
596
|
+
}
|
|
597
|
+
} else
|
|
598
|
+
s += String.fromCharCode(c);
|
|
599
|
+
}
|
|
600
|
+
return s;
|
|
601
|
+
}
|
|
602
|
+
function Y(e, t) {
|
|
603
|
+
return e ? z(ee, e, t) : "";
|
|
604
|
+
}
|
|
605
|
+
function de(e, t, r, s) {
|
|
606
|
+
if (!(0 < s))
|
|
607
|
+
return 0;
|
|
608
|
+
var c = r;
|
|
609
|
+
s = r + s - 1;
|
|
610
|
+
for (var u = 0; u < e.length; ++u) {
|
|
611
|
+
var a = e.charCodeAt(u);
|
|
612
|
+
if (55296 <= a && 57343 >= a) {
|
|
613
|
+
var p = e.charCodeAt(++u);
|
|
614
|
+
a = 65536 + ((a & 1023) << 10) | p & 1023;
|
|
615
|
+
}
|
|
616
|
+
if (127 >= a) {
|
|
617
|
+
if (r >= s)
|
|
618
|
+
break;
|
|
619
|
+
t[r++] = a;
|
|
620
|
+
} else {
|
|
621
|
+
if (2047 >= a) {
|
|
622
|
+
if (r + 1 >= s)
|
|
623
|
+
break;
|
|
624
|
+
t[r++] = 192 | a >> 6;
|
|
625
|
+
} else {
|
|
626
|
+
if (65535 >= a) {
|
|
627
|
+
if (r + 2 >= s)
|
|
628
|
+
break;
|
|
629
|
+
t[r++] = 224 | a >> 12;
|
|
630
|
+
} else {
|
|
631
|
+
if (r + 3 >= s)
|
|
632
|
+
break;
|
|
633
|
+
t[r++] = 240 | a >> 18, t[r++] = 128 | a >> 12 & 63;
|
|
634
|
+
}
|
|
635
|
+
t[r++] = 128 | a >> 6 & 63;
|
|
636
|
+
}
|
|
637
|
+
t[r++] = 128 | a & 63;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return t[r] = 0, r - c;
|
|
641
|
+
}
|
|
642
|
+
var pe, j, ee, C, ye, he;
|
|
643
|
+
function Ne() {
|
|
644
|
+
var e = U.buffer;
|
|
645
|
+
pe = e, n.HEAP8 = j = new Int8Array(e), n.HEAP16 = new Int16Array(e), n.HEAP32 = C = new Int32Array(e), n.HEAPU8 = ee = new Uint8Array(e), n.HEAPU16 = new Uint16Array(e), n.HEAPU32 = new Uint32Array(e), n.HEAPF32 = ye = new Float32Array(e), n.HEAPF64 = he = new Float64Array(e);
|
|
646
|
+
}
|
|
647
|
+
var ze, Ge = [], Xe = [], $e = [];
|
|
648
|
+
function Pt() {
|
|
649
|
+
var e = n.preRun.shift();
|
|
650
|
+
Ge.unshift(e);
|
|
651
|
+
}
|
|
652
|
+
var ue = 0, fe = null;
|
|
653
|
+
n.preloadedImages = {}, n.preloadedAudios = {};
|
|
654
|
+
function ae(e) {
|
|
655
|
+
throw n.onAbort && n.onAbort(e), e = "Aborted(" + e + ")", v(e), H = !0, e = new WebAssembly.RuntimeError(e + ". Build with -s ASSERTIONS=1 for more info."), l(e), e;
|
|
656
|
+
}
|
|
657
|
+
function Ye() {
|
|
658
|
+
return X.startsWith("data:application/octet-stream;base64,");
|
|
659
|
+
}
|
|
660
|
+
var X;
|
|
661
|
+
if (X = "mxdrawassembly_min.wasm.wasm", !Ye()) {
|
|
662
|
+
var Ze = X;
|
|
663
|
+
X = n.locateFile ? n.locateFile(Ze, w) : w + Ze;
|
|
664
|
+
}
|
|
665
|
+
function Qe() {
|
|
666
|
+
var e = X;
|
|
667
|
+
try {
|
|
668
|
+
if (e == X && O)
|
|
669
|
+
return new Uint8Array(O);
|
|
670
|
+
if (D)
|
|
671
|
+
return D(e);
|
|
672
|
+
throw "both async and sync fetching of the wasm failed";
|
|
673
|
+
} catch (t) {
|
|
674
|
+
ae(t);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function xt() {
|
|
678
|
+
if (!O && (d || h)) {
|
|
679
|
+
if (typeof fetch == "function" && !X.startsWith("file://"))
|
|
680
|
+
return fetch(X, { credentials: "same-origin" }).then(function(e) {
|
|
681
|
+
if (!e.ok)
|
|
682
|
+
throw "failed to load wasm binary file at '" + X + "'";
|
|
683
|
+
return e.arrayBuffer();
|
|
684
|
+
}).catch(function() {
|
|
685
|
+
return Qe();
|
|
686
|
+
});
|
|
687
|
+
if (x)
|
|
688
|
+
return new Promise(function(e, t) {
|
|
689
|
+
x(X, function(r) {
|
|
690
|
+
e(new Uint8Array(r));
|
|
691
|
+
}, t);
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
return Promise.resolve().then(function() {
|
|
695
|
+
return Qe();
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
function We(e) {
|
|
699
|
+
for (; 0 < e.length; ) {
|
|
700
|
+
var t = e.shift();
|
|
701
|
+
if (typeof t == "function")
|
|
702
|
+
t(n);
|
|
703
|
+
else {
|
|
704
|
+
var r = t.Da;
|
|
705
|
+
typeof r == "number" ? t.da === void 0 ? Je(r)() : Je(r)(t.da) : r(t.da === void 0 ? null : t.da);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
var Ee = [];
|
|
710
|
+
function Je(e) {
|
|
711
|
+
var t = Ee[e];
|
|
712
|
+
return t || (e >= Ee.length && (Ee.length = e + 1), Ee[e] = t = ze.get(e)), t;
|
|
713
|
+
}
|
|
714
|
+
function qe(e, t) {
|
|
715
|
+
if (0 >= e)
|
|
716
|
+
return e;
|
|
717
|
+
var r = 32 >= t ? Math.abs(1 << t - 1) : Math.pow(2, t - 1);
|
|
718
|
+
return e >= r && (32 >= t || e > r) && (e = -2 * r + e), e;
|
|
719
|
+
}
|
|
720
|
+
function Ue(e, t) {
|
|
721
|
+
return 0 <= e ? e : 32 >= t ? 2 * Math.abs(1 << t - 1) + e : Math.pow(2, t) + e;
|
|
722
|
+
}
|
|
723
|
+
function Mt(e, t) {
|
|
724
|
+
function r($) {
|
|
725
|
+
var Ke = s;
|
|
726
|
+
return ($ === "double" || $ === "i64") && Ke & 7 && (Ke += 4), s = Ke, $ === "double" ? ($ = Number(he[s >> 3]), s += 8) : $ == "i64" ? ($ = [C[s >> 2], C[s + 4 >> 2]], s += 8) : ($ = C[s >> 2], s += 4), $;
|
|
727
|
+
}
|
|
728
|
+
for (var s = t, c = [], u, a; ; ) {
|
|
729
|
+
var p = e;
|
|
730
|
+
if (u = j[e >> 0], u === 0)
|
|
731
|
+
break;
|
|
732
|
+
if (a = j[e + 1 >> 0], u == 37) {
|
|
733
|
+
var B = !1, _ = t = !1, R = !1, re = !1;
|
|
734
|
+
e:
|
|
735
|
+
for (; ; ) {
|
|
736
|
+
switch (a) {
|
|
737
|
+
case 43:
|
|
738
|
+
B = !0;
|
|
739
|
+
break;
|
|
740
|
+
case 45:
|
|
741
|
+
t = !0;
|
|
742
|
+
break;
|
|
743
|
+
case 35:
|
|
744
|
+
_ = !0;
|
|
745
|
+
break;
|
|
746
|
+
case 48:
|
|
747
|
+
if (R)
|
|
748
|
+
break e;
|
|
749
|
+
R = !0;
|
|
750
|
+
break;
|
|
751
|
+
case 32:
|
|
752
|
+
re = !0;
|
|
753
|
+
break;
|
|
754
|
+
default:
|
|
755
|
+
break e;
|
|
756
|
+
}
|
|
757
|
+
e++, a = j[e + 1 >> 0];
|
|
758
|
+
}
|
|
759
|
+
var V = 0;
|
|
760
|
+
if (a == 42)
|
|
761
|
+
V = r("i32"), e++, a = j[e + 1 >> 0];
|
|
762
|
+
else
|
|
763
|
+
for (; 48 <= a && 57 >= a; )
|
|
764
|
+
V = 10 * V + (a - 48), e++, a = j[e + 1 >> 0];
|
|
765
|
+
var k = !1, L = -1;
|
|
766
|
+
if (a == 46) {
|
|
767
|
+
if (L = 0, k = !0, e++, a = j[e + 1 >> 0], a == 42)
|
|
768
|
+
L = r("i32"), e++;
|
|
769
|
+
else
|
|
770
|
+
for (; a = j[e + 1 >> 0], !(48 > a || 57 < a); )
|
|
771
|
+
L = 10 * L + (a - 48), e++;
|
|
772
|
+
a = j[e + 1 >> 0];
|
|
773
|
+
}
|
|
774
|
+
switch (0 > L && (L = 6, k = !1), String.fromCharCode(a)) {
|
|
775
|
+
case "h":
|
|
776
|
+
if (a = j[e + 2 >> 0], a == 104) {
|
|
777
|
+
e++;
|
|
778
|
+
var F = 1;
|
|
779
|
+
} else
|
|
780
|
+
F = 2;
|
|
781
|
+
break;
|
|
782
|
+
case "l":
|
|
783
|
+
a = j[e + 2 >> 0], a == 108 ? (e++, F = 8) : F = 4;
|
|
784
|
+
break;
|
|
785
|
+
case "L":
|
|
786
|
+
case "q":
|
|
787
|
+
case "j":
|
|
788
|
+
F = 8;
|
|
789
|
+
break;
|
|
790
|
+
case "z":
|
|
791
|
+
case "t":
|
|
792
|
+
case "I":
|
|
793
|
+
F = 4;
|
|
794
|
+
break;
|
|
795
|
+
default:
|
|
796
|
+
F = null;
|
|
797
|
+
}
|
|
798
|
+
switch (F && e++, a = j[e + 1 >> 0], String.fromCharCode(a)) {
|
|
799
|
+
case "d":
|
|
800
|
+
case "i":
|
|
801
|
+
case "u":
|
|
802
|
+
case "o":
|
|
803
|
+
case "x":
|
|
804
|
+
case "X":
|
|
805
|
+
case "p":
|
|
806
|
+
p = a == 100 || a == 105, F = F || 4, u = r("i" + 8 * F), F == 8 && (u = a == 117 ? (u[0] >>> 0) + 4294967296 * (u[1] >>> 0) : (u[0] >>> 0) + 4294967296 * u[1]), 4 >= F && (u = (p ? qe : Ue)(u & Math.pow(256, F) - 1, 8 * F));
|
|
807
|
+
var se = Math.abs(u);
|
|
808
|
+
if (p = "", a == 100 || a == 105)
|
|
809
|
+
var A = qe(u, 8 * F).toString(10);
|
|
810
|
+
else if (a == 117)
|
|
811
|
+
A = Ue(u, 8 * F).toString(10), u = Math.abs(u);
|
|
812
|
+
else if (a == 111)
|
|
813
|
+
A = (_ ? "0" : "") + se.toString(8);
|
|
814
|
+
else if (a == 120 || a == 88) {
|
|
815
|
+
if (p = _ && u != 0 ? "0x" : "", 0 > u) {
|
|
816
|
+
for (u = -u, A = (se - 1).toString(16), se = [], _ = 0; _ < A.length; _++)
|
|
817
|
+
se.push((15 - parseInt(A[_], 16)).toString(16));
|
|
818
|
+
for (A = se.join(""); A.length < 2 * F; )
|
|
819
|
+
A = "f" + A;
|
|
820
|
+
} else
|
|
821
|
+
A = se.toString(16);
|
|
822
|
+
a == 88 && (p = p.toUpperCase(), A = A.toUpperCase());
|
|
823
|
+
} else
|
|
824
|
+
a == 112 && (se === 0 ? A = "(nil)" : (p = "0x", A = se.toString(16)));
|
|
825
|
+
if (k)
|
|
826
|
+
for (; A.length < L; )
|
|
827
|
+
A = "0" + A;
|
|
828
|
+
for (0 <= u && (B ? p = "+" + p : re && (p = " " + p)), A.charAt(0) == "-" && (p = "-" + p, A = A.substr(1)); p.length + A.length < V; )
|
|
829
|
+
t ? A += " " : R ? A = "0" + A : p = " " + p;
|
|
830
|
+
A = p + A, A.split("").forEach(function($) {
|
|
831
|
+
c.push($.charCodeAt(0));
|
|
832
|
+
});
|
|
833
|
+
break;
|
|
834
|
+
case "f":
|
|
835
|
+
case "F":
|
|
836
|
+
case "e":
|
|
837
|
+
case "E":
|
|
838
|
+
case "g":
|
|
839
|
+
case "G":
|
|
840
|
+
if (u = r("double"), isNaN(u))
|
|
841
|
+
A = "nan", R = !1;
|
|
842
|
+
else if (isFinite(u)) {
|
|
843
|
+
if (k = !1, F = Math.min(L, 20), (a == 103 || a == 71) && (k = !0, L = L || 1, F = parseInt(u.toExponential(F).split("e")[1], 10), L > F && -4 <= F ? (a = (a == 103 ? "f" : "F").charCodeAt(0), L -= F + 1) : (a = (a == 103 ? "e" : "E").charCodeAt(0), L--), F = Math.min(L, 20)), a == 101 || a == 69 ? (A = u.toExponential(F), /[eE][-+]\d$/.test(A) && (A = A.slice(0, -1) + "0" + A.slice(-1))) : (a == 102 || a == 70) && (A = u.toFixed(F), u === 0 && (0 > u || u === 0 && 1 / u === -1 / 0) && (A = "-" + A)), p = A.split("e"), k && !_)
|
|
844
|
+
for (; 1 < p[0].length && p[0].includes(".") && (p[0].slice(-1) == "0" || p[0].slice(-1) == "."); )
|
|
845
|
+
p[0] = p[0].slice(0, -1);
|
|
846
|
+
else
|
|
847
|
+
for (_ && A.indexOf(".") == -1 && (p[0] += "."); L > F++; )
|
|
848
|
+
p[0] += "0";
|
|
849
|
+
A = p[0] + (1 < p.length ? "e" + p[1] : ""), a == 69 && (A = A.toUpperCase()), 0 <= u && (B ? A = "+" + A : re && (A = " " + A));
|
|
850
|
+
} else
|
|
851
|
+
A = (0 > u ? "-" : "") + "inf", R = !1;
|
|
852
|
+
for (; A.length < V; )
|
|
853
|
+
A = t ? A + " " : !R || A[0] != "-" && A[0] != "+" ? (R ? "0" : " ") + A : A[0] + "0" + A.slice(1);
|
|
854
|
+
97 > a && (A = A.toUpperCase()), A.split("").forEach(function($) {
|
|
855
|
+
c.push($.charCodeAt(0));
|
|
856
|
+
});
|
|
857
|
+
break;
|
|
858
|
+
case "s":
|
|
859
|
+
if (R = (B = r("i8*")) ? pt(B) : 6, k && (R = Math.min(R, L)), !t)
|
|
860
|
+
for (; R < V--; )
|
|
861
|
+
c.push(32);
|
|
862
|
+
if (B)
|
|
863
|
+
for (_ = 0; _ < R; _++)
|
|
864
|
+
c.push(ee[B++ >> 0]);
|
|
865
|
+
else
|
|
866
|
+
c = c.concat(st(
|
|
867
|
+
"(null)".substr(0, R),
|
|
868
|
+
!0
|
|
869
|
+
));
|
|
870
|
+
if (t)
|
|
871
|
+
for (; R < V--; )
|
|
872
|
+
c.push(32);
|
|
873
|
+
break;
|
|
874
|
+
case "c":
|
|
875
|
+
for (t && c.push(r("i8")); 0 < --V; )
|
|
876
|
+
c.push(32);
|
|
877
|
+
t || c.push(r("i8"));
|
|
878
|
+
break;
|
|
879
|
+
case "n":
|
|
880
|
+
t = r("i32*"), C[t >> 2] = c.length;
|
|
881
|
+
break;
|
|
882
|
+
case "%":
|
|
883
|
+
c.push(u);
|
|
884
|
+
break;
|
|
885
|
+
default:
|
|
886
|
+
for (_ = p; _ < e + 2; _++)
|
|
887
|
+
c.push(j[_ >> 0]);
|
|
888
|
+
}
|
|
889
|
+
e += 2;
|
|
890
|
+
} else
|
|
891
|
+
c.push(u), e += 1;
|
|
892
|
+
}
|
|
893
|
+
return c;
|
|
894
|
+
}
|
|
895
|
+
function Te(e) {
|
|
896
|
+
if (!e || !e.callee || !e.callee.name)
|
|
897
|
+
return [null, "", ""];
|
|
898
|
+
var t = e.callee.name, r = "(", s = !0, c;
|
|
899
|
+
for (c in e) {
|
|
900
|
+
var u = e[c];
|
|
901
|
+
s || (r += ", "), s = !1, r = typeof u == "number" || typeof u == "string" ? r + u : r + ("(" + typeof u + ")");
|
|
902
|
+
}
|
|
903
|
+
return r += ")", e = (e = e.callee.caller) ? e.arguments : [], s && (r = ""), [e, t, r];
|
|
904
|
+
}
|
|
905
|
+
function Ct(e) {
|
|
906
|
+
e: {
|
|
907
|
+
var t = Error();
|
|
908
|
+
if (!t.stack) {
|
|
909
|
+
try {
|
|
910
|
+
throw Error();
|
|
911
|
+
} catch (L) {
|
|
912
|
+
t = L;
|
|
913
|
+
}
|
|
914
|
+
if (!t.stack) {
|
|
915
|
+
t = "(no stack trace available)";
|
|
916
|
+
break e;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
t = t.stack.toString();
|
|
920
|
+
}
|
|
921
|
+
t = t.slice(t.indexOf(`
|
|
922
|
+
`, Math.max(t.lastIndexOf("_emscripten_log"), t.lastIndexOf("_emscripten_get_callstack"))) + 1), e & 32 && P("EM_LOG_DEMANGLE is deprecated; ignoring"), e & 8 && typeof emscripten_source_map > "u" && (P('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'), e = e ^ 8 | 16);
|
|
923
|
+
var r = null;
|
|
924
|
+
if (e & 128)
|
|
925
|
+
for (r = Te(arguments); r[1].includes("_emscripten_"); )
|
|
926
|
+
r = Te(r[0]);
|
|
927
|
+
var s = t.split(`
|
|
928
|
+
`);
|
|
929
|
+
t = "";
|
|
930
|
+
var c = RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"), u = RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"), a = RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)"), p;
|
|
931
|
+
for (p in s) {
|
|
932
|
+
var B = s[p], _;
|
|
933
|
+
if ((_ = a.exec(B)) && _.length == 5) {
|
|
934
|
+
B = _[1];
|
|
935
|
+
var R = _[2], re = _[3];
|
|
936
|
+
_ = _[4];
|
|
937
|
+
} else if ((_ = c.exec(B)) || (_ = u.exec(B)), _ && 4 <= _.length)
|
|
938
|
+
B = _[1], R = _[2], re = _[3], _ = _[4] | 0;
|
|
939
|
+
else {
|
|
940
|
+
t += B + `
|
|
941
|
+
`;
|
|
942
|
+
continue;
|
|
943
|
+
}
|
|
944
|
+
var V = !1;
|
|
945
|
+
if (e & 8) {
|
|
946
|
+
var k = emscripten_source_map.Ia({
|
|
947
|
+
line: re,
|
|
948
|
+
ua: _
|
|
949
|
+
});
|
|
950
|
+
(V = k && k.source) && (e & 64 && (k.source = k.source.substring(k.source.replace(/\\/g, "/").lastIndexOf("/") + 1)), t += " at " + B + " (" + k.source + ":" + k.line + ":" + k.ua + `)
|
|
951
|
+
`);
|
|
952
|
+
}
|
|
953
|
+
(e & 16 || !V) && (e & 64 && (R = R.substring(R.replace(/\\/g, "/").lastIndexOf("/") + 1)), t += (V ? " = " + B : " at " + B) + " (" + R + ":" + re + ":" + _ + `)
|
|
954
|
+
`), e & 128 && r[0] && (r[1] == B && 0 < r[2].length && (t = t.replace(/\s+$/, ""), t += " with values: " + r[1] + r[2] + `
|
|
955
|
+
`), r = Te(r[0]));
|
|
956
|
+
}
|
|
957
|
+
return t = t.replace(/\s+$/, "");
|
|
958
|
+
}
|
|
959
|
+
function Bt(e) {
|
|
960
|
+
var t = e.getExtension("ANGLE_instanced_arrays");
|
|
961
|
+
t && (e.vertexAttribDivisor = function(r, s) {
|
|
962
|
+
t.vertexAttribDivisorANGLE(r, s);
|
|
963
|
+
}, e.drawArraysInstanced = function(r, s, c, u) {
|
|
964
|
+
t.drawArraysInstancedANGLE(r, s, c, u);
|
|
965
|
+
}, e.drawElementsInstanced = function(r, s, c, u, a) {
|
|
966
|
+
t.drawElementsInstancedANGLE(r, s, c, u, a);
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
function Dt(e) {
|
|
970
|
+
var t = e.getExtension("OES_vertex_array_object");
|
|
971
|
+
t && (e.createVertexArray = function() {
|
|
972
|
+
return t.createVertexArrayOES();
|
|
973
|
+
}, e.deleteVertexArray = function(r) {
|
|
974
|
+
t.deleteVertexArrayOES(r);
|
|
975
|
+
}, e.bindVertexArray = function(r) {
|
|
976
|
+
t.bindVertexArrayOES(r);
|
|
977
|
+
}, e.isVertexArray = function(r) {
|
|
978
|
+
return t.isVertexArrayOES(r);
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
function Rt(e) {
|
|
982
|
+
var t = e.getExtension("WEBGL_draw_buffers");
|
|
983
|
+
t && (e.drawBuffers = function(r, s) {
|
|
984
|
+
t.drawBuffersWEBGL(r, s);
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
var et = 1, ge = [], te = [], ne = [], be = [], tt = [1, 1, 2, 2, 4, 4, 4, 2, 3, 4, 8];
|
|
988
|
+
function ce(e) {
|
|
989
|
+
we || (we = e);
|
|
990
|
+
}
|
|
991
|
+
function Ae(e) {
|
|
992
|
+
for (var t = et++, r = e.length; r < t; r++)
|
|
993
|
+
e[r] = null;
|
|
994
|
+
return t;
|
|
995
|
+
}
|
|
996
|
+
function Se(e) {
|
|
997
|
+
return 32 - Math.clz32(e === 0 ? 0 : e - 1);
|
|
998
|
+
}
|
|
999
|
+
function Ft(e, t) {
|
|
1000
|
+
e.fa || (e.fa = e.getContext, e.getContext = function(s, c) {
|
|
1001
|
+
return (c = e.fa(s, c)) || (c = e.fa(s)), s == "webgl" == c instanceof WebGLRenderingContext ? c : null;
|
|
1002
|
+
});
|
|
1003
|
+
var r = 1 < t.na ? e.getContext("webgl2", t) : e.getContext("webgl", t);
|
|
1004
|
+
return r ? Wt(r, t) : 0;
|
|
1005
|
+
}
|
|
1006
|
+
function Wt(e, t) {
|
|
1007
|
+
var r = Ae(be), s = { Ea: r, attributes: t, version: t.na, ba: e };
|
|
1008
|
+
for (e.canvas && (e.canvas.ya = s), be[r] = s, (typeof t.ma > "u" || t.ma) && Tt(s), s.oa = s.ba.getParameter(34921), s.X = [], e = 0; e < s.oa; e++)
|
|
1009
|
+
s.X[e] = { enabled: !1, ea: !1, size: 0, type: 0, pa: 0, ga: 0, R: 0, ta: null };
|
|
1010
|
+
for (e = Se(2097152), s.U = [], s.qa = [], s.U.length = s.qa.length = e + 1, s.aa = [], s.ha = [], s.aa.length = s.ha.length = e + 1, s.S = [], s.S.length = e + 1, t = 0; t <= e; ++t) {
|
|
1011
|
+
s.S[t] = null, s.U[t] = s.qa[t] = 0, s.aa[t] = [], s.ha[t] = [];
|
|
1012
|
+
var c = s.aa[t], u = s.ha[t];
|
|
1013
|
+
c.length = u.length = 64;
|
|
1014
|
+
for (var a = 0; 64 > a; ++a)
|
|
1015
|
+
c[a] = u[a] = null;
|
|
1016
|
+
}
|
|
1017
|
+
return r;
|
|
1018
|
+
}
|
|
1019
|
+
function Tt(e) {
|
|
1020
|
+
if (e || (e = S), !e.xa) {
|
|
1021
|
+
e.xa = !0;
|
|
1022
|
+
var t = e.ba;
|
|
1023
|
+
Bt(t), Dt(t), Rt(t), t.Ca = t.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"), t.Fa = t.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"), 2 <= e.version && (t.la = t.getExtension("EXT_disjoint_timer_query_webgl2")), (2 > e.version || !t.la) && (t.la = t.getExtension("EXT_disjoint_timer_query")), t.Ha = t.getExtension("WEBGL_multi_draw"), (t.getSupportedExtensions() || []).forEach(function(r) {
|
|
1024
|
+
r.includes("lose_context") || r.includes("debug") || t.getExtension(r);
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
var we, S, Le, bt = ["default", "low-power", "high-performance"], St = [0, typeof document < "u" ? document : 0, typeof window < "u" ? window : 0];
|
|
1029
|
+
function nt(e) {
|
|
1030
|
+
return e.slice(-1) == "]" && e.lastIndexOf("[");
|
|
1031
|
+
}
|
|
1032
|
+
function rt(e) {
|
|
1033
|
+
var t = y.va;
|
|
1034
|
+
if (t) {
|
|
1035
|
+
var r = t.V[e];
|
|
1036
|
+
return typeof r == "number" && (t.V[e] = r = y.getUniformLocation(t, t.ra[e] + (0 < r ? "[" + r + "]" : ""))), r;
|
|
1037
|
+
}
|
|
1038
|
+
ce(1282);
|
|
1039
|
+
}
|
|
1040
|
+
for (var it = [], y, Lt = new Float32Array(288), me = 0; 288 > me; ++me)
|
|
1041
|
+
it[me] = Lt.subarray(0, me + 1);
|
|
1042
|
+
function st(e, t) {
|
|
1043
|
+
for (var r = 0, s = 0; s < e.length; ++s) {
|
|
1044
|
+
var c = e.charCodeAt(s);
|
|
1045
|
+
55296 <= c && 57343 >= c && (c = 65536 + ((c & 1023) << 10) | e.charCodeAt(++s) & 1023), 127 >= c ? ++r : r = 2047 >= c ? r + 2 : 65535 >= c ? r + 3 : r + 4;
|
|
1046
|
+
}
|
|
1047
|
+
return r = Array(r + 1), e = de(e, r, 0, r.length), t && (r.length = e), r;
|
|
1048
|
+
}
|
|
1049
|
+
var It = { c: function() {
|
|
1050
|
+
ae("");
|
|
1051
|
+
}, a: function(e, t, r) {
|
|
1052
|
+
t = Mt(t, r), t = z(t, 0), e & 24 && (t = t.replace(/\s+$/, ""), t += (0 < t.length ? `
|
|
1053
|
+
` : "") + Ct(e)), e & 1 ? e & 4 ? console.error(t) : e & 2 ? console.warn(t) : e & 512 ? console.info(t) : e & 256 ? console.debug(t) : console.log(t) : e & 6 ? v(t) : T(t);
|
|
1054
|
+
}, o: function(e, t, r) {
|
|
1055
|
+
ee.copyWithin(e, t, t + r);
|
|
1056
|
+
}, n: function(e) {
|
|
1057
|
+
var t = ee.length;
|
|
1058
|
+
if (e >>>= 0, 2147483648 < e)
|
|
1059
|
+
return !1;
|
|
1060
|
+
for (var r = 1; 4 >= r; r *= 2) {
|
|
1061
|
+
var s = t * (1 + 0.2 / r);
|
|
1062
|
+
s = Math.min(s, e + 100663296);
|
|
1063
|
+
var c = Math;
|
|
1064
|
+
s = Math.max(e, s), c = c.min.call(c, 2147483648, s + (65536 - s % 65536) % 65536);
|
|
1065
|
+
e: {
|
|
1066
|
+
try {
|
|
1067
|
+
U.grow(c - pe.byteLength + 65535 >>> 16), Ne();
|
|
1068
|
+
var u = 1;
|
|
1069
|
+
break e;
|
|
1070
|
+
} catch {
|
|
1071
|
+
}
|
|
1072
|
+
u = void 0;
|
|
1073
|
+
}
|
|
1074
|
+
if (u)
|
|
1075
|
+
return !0;
|
|
1076
|
+
}
|
|
1077
|
+
return !1;
|
|
1078
|
+
}, k: function(e, t) {
|
|
1079
|
+
return t >>= 2, t = { alpha: !!C[t + 0], depth: !!C[t + 1], stencil: !!C[t + 2], antialias: !!C[t + 3], premultipliedAlpha: !!C[t + 4], preserveDrawingBuffer: !!C[t + 5], powerPreference: bt[C[t + 6]], failIfMajorPerformanceCaveat: !!C[t + 7], na: C[t + 8], Ga: C[t + 9], ma: C[t + 10], wa: C[t + 11], Ja: C[t + 12], Ka: C[t + 13] }, e = 2 < e ? Y(e) : e, e = St[e] || (typeof document < "u" ? document.querySelector(e) : void 0), !e || t.wa ? 0 : Ft(e, t);
|
|
1080
|
+
}, e: function(e) {
|
|
1081
|
+
return S = be[e], n.za = y = S && S.ba, !e || y ? 0 : -5;
|
|
1082
|
+
}, d: function(e, t) {
|
|
1083
|
+
y.attachShader(te[e], ne[t]);
|
|
1084
|
+
}, A: function(e, t, r) {
|
|
1085
|
+
y.bindAttribLocation(te[e], t, Y(r));
|
|
1086
|
+
}, b: function(e, t) {
|
|
1087
|
+
e == 34962 ? y.ja = t : e == 34963 && (y.ka = t), e == 35051 ? y.Aa = t : e == 35052 && (y.Ba = t), y.bindBuffer(e, ge[t]);
|
|
1088
|
+
}, f: function(e, t, r, s) {
|
|
1089
|
+
2 <= S.version ? r ? y.bufferData(e, ee, s, r, t) : y.bufferData(e, t, s) : y.bufferData(e, r ? ee.subarray(r, r + t) : t, s);
|
|
1090
|
+
}, v: function(e) {
|
|
1091
|
+
y.clear(e);
|
|
1092
|
+
}, w: function(e, t, r, s) {
|
|
1093
|
+
y.clearColor(e, t, r, s);
|
|
1094
|
+
}, t: function(e) {
|
|
1095
|
+
y.compileShader(ne[e]);
|
|
1096
|
+
}, j: function() {
|
|
1097
|
+
var e = Ae(te), t = y.createProgram();
|
|
1098
|
+
return t.name = e, t.$ = t.Y = t.Z = 0, t.ia = 1, te[e] = t, e;
|
|
1099
|
+
}, C: function(e) {
|
|
1100
|
+
var t = Ae(ne);
|
|
1101
|
+
return ne[t] = y.createShader(e), t;
|
|
1102
|
+
}, q: function(e, t, r, s) {
|
|
1103
|
+
if (!y.ka) {
|
|
1104
|
+
var c = 1 * tt[r - 5120] * t, u = Se(c), a = S.S[u];
|
|
1105
|
+
a ? u = a : (a = y.getParameter(34965), S.S[u] = y.createBuffer(), y.bindBuffer(34963, S.S[u]), y.bufferData(34963, 1 << u, 35048), y.bindBuffer(34963, a), u = S.S[u]), y.bindBuffer(34963, u), y.bufferSubData(34963, 0, ee.subarray(s, s + c)), s = 0;
|
|
1106
|
+
}
|
|
1107
|
+
for (Le = !1, c = 0; c < S.oa; ++c)
|
|
1108
|
+
if (u = S.X[c], u.ea && u.enabled) {
|
|
1109
|
+
Le = !0, a = u.ga, a = 0 < a ? t * a : u.size * tt[u.type - 5120] * t;
|
|
1110
|
+
var p = Se(a), B = S.aa[p], _ = S.U[p];
|
|
1111
|
+
S.U[p] = S.U[p] + 1 & 63;
|
|
1112
|
+
var R = B[_];
|
|
1113
|
+
R ? p = R : (R = y.getParameter(34964), B[_] = y.createBuffer(), y.bindBuffer(34962, B[_]), y.bufferData(34962, 1 << p, 35048), y.bindBuffer(34962, R), p = B[_]), y.bindBuffer(34962, p), y.bufferSubData(34962, 0, ee.subarray(u.R, u.R + a)), u.ta.call(y, c, u.size, u.type, u.pa, u.ga, 0);
|
|
1114
|
+
}
|
|
1115
|
+
y.drawElements(e, t, r, s), Le && y.bindBuffer(34962, ge[y.ja]), y.ka || y.bindBuffer(34963, null);
|
|
1116
|
+
}, s: function(e) {
|
|
1117
|
+
S.X[e].enabled = !0, y.enableVertexAttribArray(e);
|
|
1118
|
+
}, g: function(e, t) {
|
|
1119
|
+
for (var r = 0; r < e; r++) {
|
|
1120
|
+
var s = y.createBuffer(), c = s && Ae(ge);
|
|
1121
|
+
s ? (s.name = c, ge[c] = s) : ce(1282), C[t + 4 * r >> 2] = c;
|
|
1122
|
+
}
|
|
1123
|
+
}, p: function() {
|
|
1124
|
+
var e = y.getError() || we;
|
|
1125
|
+
return we = 0, e;
|
|
1126
|
+
}, x: function(e, t, r) {
|
|
1127
|
+
if (r)
|
|
1128
|
+
if (e >= et)
|
|
1129
|
+
ce(1281);
|
|
1130
|
+
else if (e = te[e], t == 35716)
|
|
1131
|
+
e = y.getProgramInfoLog(e), e === null && (e = "(unknown error)"), C[r >> 2] = e.length + 1;
|
|
1132
|
+
else if (t == 35719) {
|
|
1133
|
+
if (!e.$)
|
|
1134
|
+
for (t = 0; t < y.getProgramParameter(e, 35718); ++t)
|
|
1135
|
+
e.$ = Math.max(e.$, y.getActiveUniform(e, t).name.length + 1);
|
|
1136
|
+
C[r >> 2] = e.$;
|
|
1137
|
+
} else if (t == 35722) {
|
|
1138
|
+
if (!e.Y)
|
|
1139
|
+
for (t = 0; t < y.getProgramParameter(e, 35721); ++t)
|
|
1140
|
+
e.Y = Math.max(e.Y, y.getActiveAttrib(
|
|
1141
|
+
e,
|
|
1142
|
+
t
|
|
1143
|
+
).name.length + 1);
|
|
1144
|
+
C[r >> 2] = e.Y;
|
|
1145
|
+
} else if (t == 35381) {
|
|
1146
|
+
if (!e.Z)
|
|
1147
|
+
for (t = 0; t < y.getProgramParameter(e, 35382); ++t)
|
|
1148
|
+
e.Z = Math.max(e.Z, y.getActiveUniformBlockName(e, t).length + 1);
|
|
1149
|
+
C[r >> 2] = e.Z;
|
|
1150
|
+
} else
|
|
1151
|
+
C[r >> 2] = y.getProgramParameter(e, t);
|
|
1152
|
+
else
|
|
1153
|
+
ce(1281);
|
|
1154
|
+
}, l: function(e, t, r, s) {
|
|
1155
|
+
e = y.getShaderInfoLog(ne[e]), e === null && (e = "(unknown error)"), t = 0 < t && s ? de(e, ee, s, t) : 0, r && (C[r >> 2] = t);
|
|
1156
|
+
}, m: function(e, t, r) {
|
|
1157
|
+
r ? t == 35716 ? (e = y.getShaderInfoLog(ne[e]), e === null && (e = "(unknown error)"), C[r >> 2] = e ? e.length + 1 : 0) : t == 35720 ? (e = y.getShaderSource(ne[e]), C[r >> 2] = e ? e.length + 1 : 0) : C[r >> 2] = y.getShaderParameter(ne[e], t) : ce(1281);
|
|
1158
|
+
}, i: function(e, t) {
|
|
1159
|
+
if (t = Y(t), e = te[e]) {
|
|
1160
|
+
var r = e, s = r.V, c = r.sa, u;
|
|
1161
|
+
if (!s)
|
|
1162
|
+
for (r.V = s = {}, r.ra = {}, u = 0; u < y.getProgramParameter(r, 35718); ++u) {
|
|
1163
|
+
var a = y.getActiveUniform(r, u), p = a.name;
|
|
1164
|
+
a = a.size;
|
|
1165
|
+
var B = nt(p);
|
|
1166
|
+
B = 0 < B ? p.slice(0, B) : p;
|
|
1167
|
+
var _ = r.ia;
|
|
1168
|
+
for (r.ia += a, c[B] = [a, _], p = 0; p < a; ++p)
|
|
1169
|
+
s[_] = p, r.ra[_++] = B;
|
|
1170
|
+
}
|
|
1171
|
+
if (r = e.V, s = 0, c = t, u = nt(t), 0 < u && (s = parseInt(t.slice(u + 1)) >>> 0, c = t.slice(0, u)), (c = e.sa[c]) && s < c[0] && (s += c[1], r[s] = r[s] || y.getUniformLocation(e, t)))
|
|
1172
|
+
return s;
|
|
1173
|
+
} else
|
|
1174
|
+
ce(1281);
|
|
1175
|
+
return -1;
|
|
1176
|
+
}, z: function(e) {
|
|
1177
|
+
e = te[e], y.linkProgram(e), e.V = 0, e.sa = {};
|
|
1178
|
+
}, B: function(e, t, r, s) {
|
|
1179
|
+
for (var c = "", u = 0; u < t; ++u) {
|
|
1180
|
+
var a = s ? C[s + 4 * u >> 2] : -1;
|
|
1181
|
+
c += Y(C[r + 4 * u >> 2], 0 > a ? void 0 : a);
|
|
1182
|
+
}
|
|
1183
|
+
y.shaderSource(ne[e], c);
|
|
1184
|
+
}, h: function(e, t, r, s) {
|
|
1185
|
+
if (2 <= S.version)
|
|
1186
|
+
y.uniformMatrix4fv(rt(e), !!r, ye, s >> 2, 16 * t);
|
|
1187
|
+
else {
|
|
1188
|
+
if (18 >= t) {
|
|
1189
|
+
var c = it[16 * t - 1], u = ye;
|
|
1190
|
+
s >>= 2;
|
|
1191
|
+
for (var a = 0; a < 16 * t; a += 16) {
|
|
1192
|
+
var p = s + a;
|
|
1193
|
+
c[a] = u[p], c[a + 1] = u[p + 1], c[a + 2] = u[p + 2], c[a + 3] = u[p + 3], c[a + 4] = u[p + 4], c[a + 5] = u[p + 5], c[a + 6] = u[p + 6], c[a + 7] = u[p + 7], c[a + 8] = u[p + 8], c[a + 9] = u[p + 9], c[a + 10] = u[p + 10], c[a + 11] = u[p + 11], c[a + 12] = u[p + 12], c[a + 13] = u[p + 13], c[a + 14] = u[p + 14], c[a + 15] = u[p + 15];
|
|
1194
|
+
}
|
|
1195
|
+
} else
|
|
1196
|
+
c = ye.subarray(s >> 2, s + 64 * t >> 2);
|
|
1197
|
+
y.uniformMatrix4fv(rt(e), !!r, c);
|
|
1198
|
+
}
|
|
1199
|
+
}, u: function(e) {
|
|
1200
|
+
e = te[e], y.useProgram(e), y.va = e;
|
|
1201
|
+
}, y: function(e) {
|
|
1202
|
+
y.validateProgram(te[e]);
|
|
1203
|
+
}, r: function(e, t, r, s, c, u) {
|
|
1204
|
+
var a = S.X[e];
|
|
1205
|
+
y.ja ? (a.ea = !1, y.vertexAttribPointer(e, t, r, !!s, c, u)) : (a.size = t, a.type = r, a.pa = s, a.ga = c, a.R = u, a.ea = !0, a.ta = function(p, B, _, R, re, V) {
|
|
1206
|
+
this.vertexAttribPointer(p, B, _, R, re, V);
|
|
1207
|
+
});
|
|
1208
|
+
} };
|
|
1209
|
+
(function() {
|
|
1210
|
+
function e(c) {
|
|
1211
|
+
n.asm = c.exports, U = n.asm.D, Ne(), ze = n.asm.M, Xe.unshift(n.asm.E), ue--, n.monitorRunDependencies && n.monitorRunDependencies(ue), ue == 0 && fe && (c = fe, fe = null, c());
|
|
1212
|
+
}
|
|
1213
|
+
function t(c) {
|
|
1214
|
+
e(c.instance);
|
|
1215
|
+
}
|
|
1216
|
+
function r(c) {
|
|
1217
|
+
return xt().then(function(u) {
|
|
1218
|
+
return WebAssembly.instantiate(u, s);
|
|
1219
|
+
}).then(function(u) {
|
|
1220
|
+
return u;
|
|
1221
|
+
}).then(c, function(u) {
|
|
1222
|
+
v("failed to asynchronously prepare wasm: " + u), ae(u);
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
var s = { a: It };
|
|
1226
|
+
if (ue++, n.monitorRunDependencies && n.monitorRunDependencies(ue), n.instantiateWasm)
|
|
1227
|
+
try {
|
|
1228
|
+
return n.instantiateWasm(
|
|
1229
|
+
s,
|
|
1230
|
+
e
|
|
1231
|
+
);
|
|
1232
|
+
} catch (c) {
|
|
1233
|
+
return v("Module.instantiateWasm callback failed with error: " + c), !1;
|
|
1234
|
+
}
|
|
1235
|
+
return function() {
|
|
1236
|
+
return O || typeof WebAssembly.instantiateStreaming != "function" || Ye() || X.startsWith("file://") || typeof fetch != "function" ? r(t) : fetch(X, { credentials: "same-origin" }).then(function(c) {
|
|
1237
|
+
return WebAssembly.instantiateStreaming(c, s).then(t, function(u) {
|
|
1238
|
+
return v("wasm streaming compile failed: " + u), v("falling back to ArrayBuffer instantiation"), r(t);
|
|
1239
|
+
});
|
|
1240
|
+
});
|
|
1241
|
+
}().catch(l), {};
|
|
1242
|
+
})(), n.___wasm_call_ctors = function() {
|
|
1243
|
+
return (n.___wasm_call_ctors = n.asm.E).apply(null, arguments);
|
|
1244
|
+
};
|
|
1245
|
+
var ot = n._emscripten_bind_VoidPtr___destroy___0 = function() {
|
|
1246
|
+
return (ot = n._emscripten_bind_VoidPtr___destroy___0 = n.asm.F).apply(null, arguments);
|
|
1247
|
+
}, ut = n._emscripten_bind_McObject_updateDisplay_2 = function() {
|
|
1248
|
+
return (ut = n._emscripten_bind_McObject_updateDisplay_2 = n.asm.G).apply(null, arguments);
|
|
1249
|
+
}, at = n._emscripten_bind_McObject_test_0 = function() {
|
|
1250
|
+
return (at = n._emscripten_bind_McObject_test_0 = n.asm.H).apply(null, arguments);
|
|
1251
|
+
}, ct = n._emscripten_bind_McApp_McApp_0 = function() {
|
|
1252
|
+
return (ct = n._emscripten_bind_McApp_McApp_0 = n.asm.I).apply(null, arguments);
|
|
1253
|
+
}, lt = n._emscripten_bind_McApp_Init_0 = function() {
|
|
1254
|
+
return (lt = n._emscripten_bind_McApp_Init_0 = n.asm.J).apply(null, arguments);
|
|
1255
|
+
}, ft = n._emscripten_bind_McApp_CreateMxDraw_3 = function() {
|
|
1256
|
+
return (ft = n._emscripten_bind_McApp_CreateMxDraw_3 = n.asm.K).apply(null, arguments);
|
|
1257
|
+
}, dt = n._emscripten_bind_McApp___destroy___0 = function() {
|
|
1258
|
+
return (dt = n._emscripten_bind_McApp___destroy___0 = n.asm.L).apply(null, arguments);
|
|
1259
|
+
}, pt = n._strlen = function() {
|
|
1260
|
+
return (pt = n._strlen = n.asm.N).apply(null, arguments);
|
|
1261
|
+
};
|
|
1262
|
+
n._malloc = function() {
|
|
1263
|
+
return (n._malloc = n.asm.O).apply(null, arguments);
|
|
1264
|
+
}, n._free = function() {
|
|
1265
|
+
return (n._free = n.asm.P).apply(null, arguments);
|
|
1266
|
+
};
|
|
1267
|
+
var _e;
|
|
1268
|
+
fe = function e() {
|
|
1269
|
+
_e || Ie(), _e || (fe = e);
|
|
1270
|
+
};
|
|
1271
|
+
function Ie() {
|
|
1272
|
+
function e() {
|
|
1273
|
+
if (!_e && (_e = !0, n.calledRun = !0, !H)) {
|
|
1274
|
+
if (We(Xe), f(n), n.onRuntimeInitialized && n.onRuntimeInitialized(), n.postRun)
|
|
1275
|
+
for (typeof n.postRun == "function" && (n.postRun = [n.postRun]); n.postRun.length; ) {
|
|
1276
|
+
var t = n.postRun.shift();
|
|
1277
|
+
$e.unshift(t);
|
|
1278
|
+
}
|
|
1279
|
+
We($e);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
if (!(0 < ue)) {
|
|
1283
|
+
if (n.preRun)
|
|
1284
|
+
for (typeof n.preRun == "function" && (n.preRun = [n.preRun]); n.preRun.length; )
|
|
1285
|
+
Pt();
|
|
1286
|
+
We(Ge), 0 < ue || (n.setStatus ? (n.setStatus("Running..."), setTimeout(function() {
|
|
1287
|
+
setTimeout(function() {
|
|
1288
|
+
n.setStatus("");
|
|
1289
|
+
}, 1), e();
|
|
1290
|
+
}, 1)) : e());
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
if (n.run = Ie, n.preInit)
|
|
1294
|
+
for (typeof n.preInit == "function" && (n.preInit = [n.preInit]); 0 < n.preInit.length; )
|
|
1295
|
+
n.preInit.pop()();
|
|
1296
|
+
Ie();
|
|
1297
|
+
function G() {
|
|
1298
|
+
}
|
|
1299
|
+
G.prototype = Object.create(G.prototype), G.prototype.constructor = G, G.prototype.T = G, G.W = {}, n.WrapperObject = G;
|
|
1300
|
+
function ve(e) {
|
|
1301
|
+
return (e || G).W;
|
|
1302
|
+
}
|
|
1303
|
+
n.getCache = ve;
|
|
1304
|
+
function Pe(e, t) {
|
|
1305
|
+
var r = ve(t), s = r[e];
|
|
1306
|
+
return s || (s = Object.create((t || G).prototype), s.R = e, r[e] = s);
|
|
1307
|
+
}
|
|
1308
|
+
n.wrapPointer = Pe, n.castObject = function(e, t) {
|
|
1309
|
+
return Pe(e.R, t);
|
|
1310
|
+
}, n.NULL = Pe(0), n.destroy = function(e) {
|
|
1311
|
+
if (!e.__destroy__)
|
|
1312
|
+
throw "Error: Cannot destroy object. (Did you create it yourself?)";
|
|
1313
|
+
e.__destroy__(), delete ve(e.T)[e.R];
|
|
1314
|
+
}, n.compare = function(e, t) {
|
|
1315
|
+
return e.R === t.R;
|
|
1316
|
+
}, n.getPointer = function(e) {
|
|
1317
|
+
return e.R;
|
|
1318
|
+
}, n.getClass = function(e) {
|
|
1319
|
+
return e.T;
|
|
1320
|
+
};
|
|
1321
|
+
var le = 0, xe = 0, Me = 0, Ce = [], Be = 0;
|
|
1322
|
+
function yt() {
|
|
1323
|
+
if (Be) {
|
|
1324
|
+
for (var e = 0; e < Ce.length; e++)
|
|
1325
|
+
n._free(Ce[e]);
|
|
1326
|
+
Ce.length = 0, n._free(le), le = 0, xe += Be, Be = 0;
|
|
1327
|
+
}
|
|
1328
|
+
le || (xe += 128, (le = n._malloc(xe)) || ae(void 0)), Me = 0;
|
|
1329
|
+
}
|
|
1330
|
+
function ht(e, t) {
|
|
1331
|
+
return le || ae(void 0), e = e.length * t.BYTES_PER_ELEMENT, e = e + 7 & -8, Me + e >= xe ? (0 < e || ae(void 0), Be += e, t = n._malloc(e), Ce.push(t)) : (t = le + Me, Me += e), t;
|
|
1332
|
+
}
|
|
1333
|
+
function Et(e, t, r) {
|
|
1334
|
+
switch (r >>>= 0, t.BYTES_PER_ELEMENT) {
|
|
1335
|
+
case 2:
|
|
1336
|
+
r >>>= 1;
|
|
1337
|
+
break;
|
|
1338
|
+
case 4:
|
|
1339
|
+
r >>>= 2;
|
|
1340
|
+
break;
|
|
1341
|
+
case 8:
|
|
1342
|
+
r >>>= 3;
|
|
1343
|
+
}
|
|
1344
|
+
for (var s = 0; s < e.length; s++)
|
|
1345
|
+
t[r + s] = e[s];
|
|
1346
|
+
}
|
|
1347
|
+
function gt(e) {
|
|
1348
|
+
if (typeof e == "object") {
|
|
1349
|
+
var t = ht(e, he);
|
|
1350
|
+
return Et(e, he, t), t;
|
|
1351
|
+
}
|
|
1352
|
+
return e;
|
|
1353
|
+
}
|
|
1354
|
+
function ie() {
|
|
1355
|
+
throw "cannot construct a VoidPtr, no constructor in IDL";
|
|
1356
|
+
}
|
|
1357
|
+
ie.prototype = Object.create(G.prototype), ie.prototype.constructor = ie, ie.prototype.T = ie, ie.W = {}, n.VoidPtr = ie, ie.prototype.__destroy__ = function() {
|
|
1358
|
+
ot(this.R);
|
|
1359
|
+
};
|
|
1360
|
+
function Z() {
|
|
1361
|
+
throw "cannot construct a McObject, no constructor in IDL";
|
|
1362
|
+
}
|
|
1363
|
+
Z.prototype = Object.create(G.prototype), Z.prototype.constructor = Z, Z.prototype.T = Z, Z.W = {}, n.McObject = Z, Z.prototype.updateDisplay = function(e, t) {
|
|
1364
|
+
var r = this.R;
|
|
1365
|
+
return yt(), typeof e == "object" && (e = gt(e)), typeof t == "object" && (t = gt(t)), !!ut(r, e, t);
|
|
1366
|
+
}, Z.prototype.test = Z.prototype.test = function() {
|
|
1367
|
+
at(this.R);
|
|
1368
|
+
};
|
|
1369
|
+
function Q() {
|
|
1370
|
+
this.R = ct(), ve(Q)[this.R] = this;
|
|
1371
|
+
}
|
|
1372
|
+
return Q.prototype = Object.create(G.prototype), Q.prototype.constructor = Q, Q.prototype.T = Q, Q.W = {}, n.McApp = Q, Q.prototype.Init = function() {
|
|
1373
|
+
lt(this.R);
|
|
1374
|
+
}, Q.prototype.CreateMxDraw = function(e, t, r) {
|
|
1375
|
+
var s = this.R;
|
|
1376
|
+
if (yt(), e && typeof e == "object" && (e = e.R), t && typeof t == "object" && (t = t.R), r && typeof r == "object")
|
|
1377
|
+
r = r.R;
|
|
1378
|
+
else if (typeof r == "string") {
|
|
1379
|
+
r = st(r);
|
|
1380
|
+
var c = ht(r, j);
|
|
1381
|
+
Et(r, j, c), r = c;
|
|
1382
|
+
}
|
|
1383
|
+
return Pe(ft(s, e, t, r), Z);
|
|
1384
|
+
}, Q.prototype.__destroy__ = function() {
|
|
1385
|
+
dt(this.R);
|
|
1386
|
+
}, o.ready;
|
|
1387
|
+
};
|
|
1388
|
+
})();
|
|
1389
|
+
typeof exports == "object" && typeof module == "object" ? module.exports = Fe : typeof define == "function" && define.amd ? define([], function() {
|
|
1390
|
+
return Fe;
|
|
1391
|
+
}) : typeof exports == "object" && (exports.mxdrawassembly = Fe);
|
|
1392
|
+
const vt = (i, o) => new URL(i, o || self.location.href).toString();
|
|
1393
|
+
let ke;
|
|
1394
|
+
function Qt(i, o = vt) {
|
|
1395
|
+
Fe({
|
|
1396
|
+
locateFile: o
|
|
1397
|
+
}).then((n) => {
|
|
1398
|
+
let f = new n.McApp();
|
|
1399
|
+
f.Init(), ke = n, ke.McApp = f, i(ke);
|
|
1256
1400
|
});
|
|
1257
1401
|
}
|
|
1402
|
+
const on = {
|
|
1403
|
+
loadMxdrawassembly: Qt,
|
|
1404
|
+
getWasmURL: vt
|
|
1405
|
+
};
|
|
1258
1406
|
export {
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1407
|
+
ke as MxCpp,
|
|
1408
|
+
_t as MxTools,
|
|
1409
|
+
Ht as b64Decode,
|
|
1410
|
+
Vt as b64Encode,
|
|
1411
|
+
on as default,
|
|
1412
|
+
rn as drawArc,
|
|
1413
|
+
Gt as drawCircle,
|
|
1414
|
+
sn as drawEllipticalArc,
|
|
1415
|
+
Xt as drawLine,
|
|
1416
|
+
en as drawMText,
|
|
1417
|
+
tn as drawPolyLine,
|
|
1418
|
+
nn as drawPolygon,
|
|
1419
|
+
Ut as drawText,
|
|
1420
|
+
qt as fetchAndInstantiate,
|
|
1421
|
+
Qt as loadMxdrawassembly,
|
|
1422
|
+
Nt as setMcDbEntity
|
|
1270
1423
|
};
|