@linkurious/ogma-annotations-react 1.1.12 → 1.1.14
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 +201 -0
- package/Readme.md +47 -0
- package/dist/index.js +20 -20
- package/dist/index.mjs +1323 -1770
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useOgma as
|
|
3
|
-
var
|
|
1
|
+
import Cr, { createContext as Or, useContext as qr, useReducer as Yr, useState as Nt, useEffect as er } from "react";
|
|
2
|
+
import { useOgma as Xr } from "@linkurious/ogma-react";
|
|
3
|
+
var or = { exports: {} }, ue = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
6
6
|
* react-jsx-runtime.production.min.js
|
|
@@ -10,25 +10,25 @@ var er = { exports: {} }, ae = {};
|
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
for (
|
|
23
|
-
i.call(
|
|
24
|
-
if (
|
|
25
|
-
for (
|
|
26
|
-
|
|
27
|
-
return { $$typeof: e, type:
|
|
28
|
-
}
|
|
29
|
-
return
|
|
13
|
+
var dr;
|
|
14
|
+
function Gr() {
|
|
15
|
+
if (dr)
|
|
16
|
+
return ue;
|
|
17
|
+
dr = 1;
|
|
18
|
+
var h = Cr, e = Symbol.for("react.element"), s = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
19
|
+
function f(p, d, v) {
|
|
20
|
+
var y, _ = {}, C = null, E = null;
|
|
21
|
+
v !== void 0 && (C = "" + v), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (E = d.ref);
|
|
22
|
+
for (y in d)
|
|
23
|
+
i.call(d, y) && !c.hasOwnProperty(y) && (_[y] = d[y]);
|
|
24
|
+
if (p && p.defaultProps)
|
|
25
|
+
for (y in d = p.defaultProps, d)
|
|
26
|
+
_[y] === void 0 && (_[y] = d[y]);
|
|
27
|
+
return { $$typeof: e, type: p, key: C, ref: E, props: _, _owner: l.current };
|
|
28
|
+
}
|
|
29
|
+
return ue.Fragment = s, ue.jsx = f, ue.jsxs = f, ue;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var ce = {};
|
|
32
32
|
/**
|
|
33
33
|
* @license React
|
|
34
34
|
* react-jsx-runtime.development.js
|
|
@@ -38,91 +38,91 @@ var le = {};
|
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
var
|
|
42
|
-
function
|
|
43
|
-
return
|
|
44
|
-
var
|
|
45
|
-
function
|
|
41
|
+
var fr;
|
|
42
|
+
function Jr() {
|
|
43
|
+
return fr || (fr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
44
|
+
var h = Cr, e = Symbol.for("react.element"), s = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), p = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), P = Symbol.iterator, S = "@@iterator";
|
|
45
|
+
function $(t) {
|
|
46
46
|
if (t === null || typeof t != "object")
|
|
47
47
|
return null;
|
|
48
|
-
var o = P && t[P] || t[
|
|
48
|
+
var o = P && t[P] || t[S];
|
|
49
49
|
return typeof o == "function" ? o : null;
|
|
50
50
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
51
|
+
var L = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
52
|
+
function T(t) {
|
|
53
53
|
{
|
|
54
|
-
for (var o = arguments.length, u = new Array(o > 1 ? o - 1 : 0),
|
|
55
|
-
u[
|
|
56
|
-
|
|
54
|
+
for (var o = arguments.length, u = new Array(o > 1 ? o - 1 : 0), g = 1; g < o; g++)
|
|
55
|
+
u[g - 1] = arguments[g];
|
|
56
|
+
B("error", t, u);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function B(t, o, u) {
|
|
60
60
|
{
|
|
61
|
-
var
|
|
62
|
-
|
|
61
|
+
var g = L.ReactDebugCurrentFrame, m = g.getStackAddendum();
|
|
62
|
+
m !== "" && (o += "%s", u = u.concat([m]));
|
|
63
63
|
var w = u.map(function(b) {
|
|
64
64
|
return String(b);
|
|
65
65
|
});
|
|
66
66
|
w.unshift("Warning: " + o), Function.prototype.apply.call(console[t], console, w);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
function
|
|
72
|
-
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c ||
|
|
69
|
+
var N = !1, it = !1, xt = !1, qt = !1, Yt = !1, pe;
|
|
70
|
+
pe = Symbol.for("react.module.reference");
|
|
71
|
+
function Ot(t) {
|
|
72
|
+
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || Yt || t === l || t === v || t === y || qt || t === E || N || it || xt || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === _ || t.$$typeof === f || t.$$typeof === p || t.$$typeof === d || // This needs to include all possible module reference object
|
|
73
73
|
// types supported by any Flight configuration anywhere since
|
|
74
74
|
// we don't know which Flight build this will end up being used
|
|
75
75
|
// with.
|
|
76
|
-
t.$$typeof ===
|
|
76
|
+
t.$$typeof === pe || t.getModuleId !== void 0));
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
82
|
-
var
|
|
83
|
-
return
|
|
78
|
+
function Pt(t, o, u) {
|
|
79
|
+
var g = t.displayName;
|
|
80
|
+
if (g)
|
|
81
|
+
return g;
|
|
82
|
+
var m = o.displayName || o.name || "";
|
|
83
|
+
return m !== "" ? u + "(" + m + ")" : u;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Xt(t) {
|
|
86
86
|
return t.displayName || "Context";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function tt(t) {
|
|
89
89
|
if (t == null)
|
|
90
90
|
return null;
|
|
91
|
-
if (typeof t.tag == "number" &&
|
|
91
|
+
if (typeof t.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
92
92
|
return t.displayName || t.name || null;
|
|
93
93
|
if (typeof t == "string")
|
|
94
94
|
return t;
|
|
95
95
|
switch (t) {
|
|
96
96
|
case i:
|
|
97
97
|
return "Fragment";
|
|
98
|
-
case
|
|
98
|
+
case s:
|
|
99
99
|
return "Portal";
|
|
100
100
|
case c:
|
|
101
101
|
return "Profiler";
|
|
102
|
-
case
|
|
102
|
+
case l:
|
|
103
103
|
return "StrictMode";
|
|
104
|
-
case
|
|
104
|
+
case v:
|
|
105
105
|
return "Suspense";
|
|
106
|
-
case
|
|
106
|
+
case y:
|
|
107
107
|
return "SuspenseList";
|
|
108
108
|
}
|
|
109
109
|
if (typeof t == "object")
|
|
110
110
|
switch (t.$$typeof) {
|
|
111
|
-
case
|
|
111
|
+
case p:
|
|
112
112
|
var o = t;
|
|
113
|
-
return
|
|
114
|
-
case g:
|
|
115
|
-
var u = t;
|
|
116
|
-
return Yt(u._context) + ".Provider";
|
|
113
|
+
return Xt(o) + ".Consumer";
|
|
117
114
|
case f:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
case _:
|
|
123
|
-
var
|
|
115
|
+
var u = t;
|
|
116
|
+
return Xt(u._context) + ".Provider";
|
|
117
|
+
case d:
|
|
118
|
+
return Pt(t, t.render, "ForwardRef");
|
|
119
|
+
case _:
|
|
120
|
+
var g = t.displayName || null;
|
|
121
|
+
return g !== null ? g : tt(t.type) || "Memo";
|
|
122
|
+
case C: {
|
|
123
|
+
var m = t, w = m._payload, b = m._init;
|
|
124
124
|
try {
|
|
125
|
-
return
|
|
125
|
+
return tt(b(w));
|
|
126
126
|
} catch {
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
@@ -130,18 +130,18 @@ function Ur() {
|
|
|
130
130
|
}
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
|
-
var
|
|
134
|
-
function
|
|
133
|
+
var D = Object.assign, at = 0, X, ht, Rt, ye, Gt, ve, me;
|
|
134
|
+
function At() {
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
function
|
|
136
|
+
At.__reactDisabledLog = !0;
|
|
137
|
+
function be() {
|
|
138
138
|
{
|
|
139
139
|
if (at === 0) {
|
|
140
|
-
|
|
140
|
+
X = console.log, ht = console.info, Rt = console.warn, ye = console.error, Gt = console.group, ve = console.groupCollapsed, me = console.groupEnd;
|
|
141
141
|
var t = {
|
|
142
142
|
configurable: !0,
|
|
143
143
|
enumerable: !0,
|
|
144
|
-
value:
|
|
144
|
+
value: At,
|
|
145
145
|
writable: !0
|
|
146
146
|
};
|
|
147
147
|
Object.defineProperties(console, {
|
|
@@ -157,7 +157,7 @@ function Ur() {
|
|
|
157
157
|
at++;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Ne() {
|
|
161
161
|
{
|
|
162
162
|
if (at--, at === 0) {
|
|
163
163
|
var t = {
|
|
@@ -166,65 +166,65 @@ function Ur() {
|
|
|
166
166
|
writable: !0
|
|
167
167
|
};
|
|
168
168
|
Object.defineProperties(console, {
|
|
169
|
-
log:
|
|
170
|
-
value:
|
|
169
|
+
log: D({}, t, {
|
|
170
|
+
value: X
|
|
171
171
|
}),
|
|
172
|
-
info:
|
|
172
|
+
info: D({}, t, {
|
|
173
173
|
value: ht
|
|
174
174
|
}),
|
|
175
|
-
warn:
|
|
176
|
-
value:
|
|
175
|
+
warn: D({}, t, {
|
|
176
|
+
value: Rt
|
|
177
177
|
}),
|
|
178
|
-
error:
|
|
179
|
-
value:
|
|
178
|
+
error: D({}, t, {
|
|
179
|
+
value: ye
|
|
180
180
|
}),
|
|
181
|
-
group:
|
|
182
|
-
value:
|
|
181
|
+
group: D({}, t, {
|
|
182
|
+
value: Gt
|
|
183
183
|
}),
|
|
184
|
-
groupCollapsed:
|
|
185
|
-
value:
|
|
184
|
+
groupCollapsed: D({}, t, {
|
|
185
|
+
value: ve
|
|
186
186
|
}),
|
|
187
|
-
groupEnd:
|
|
188
|
-
value:
|
|
187
|
+
groupEnd: D({}, t, {
|
|
188
|
+
value: me
|
|
189
189
|
})
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
at < 0 &&
|
|
192
|
+
at < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
var
|
|
195
|
+
var Jt = L.ReactCurrentDispatcher, Zt;
|
|
196
196
|
function It(t, o, u) {
|
|
197
197
|
{
|
|
198
|
-
if (
|
|
198
|
+
if (Zt === void 0)
|
|
199
199
|
try {
|
|
200
200
|
throw Error();
|
|
201
|
-
} catch (
|
|
202
|
-
var
|
|
203
|
-
|
|
201
|
+
} catch (m) {
|
|
202
|
+
var g = m.stack.trim().match(/\n( *(at )?)/);
|
|
203
|
+
Zt = g && g[1] || "";
|
|
204
204
|
}
|
|
205
205
|
return `
|
|
206
|
-
` +
|
|
206
|
+
` + Zt + t;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
var
|
|
209
|
+
var Kt = !1, Et;
|
|
210
210
|
{
|
|
211
|
-
var
|
|
212
|
-
|
|
211
|
+
var Be = typeof WeakMap == "function" ? WeakMap : Map;
|
|
212
|
+
Et = new Be();
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
if (!t ||
|
|
214
|
+
function Qt(t, o) {
|
|
215
|
+
if (!t || Kt)
|
|
216
216
|
return "";
|
|
217
217
|
{
|
|
218
|
-
var u =
|
|
218
|
+
var u = Et.get(t);
|
|
219
219
|
if (u !== void 0)
|
|
220
220
|
return u;
|
|
221
221
|
}
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
var
|
|
222
|
+
var g;
|
|
223
|
+
Kt = !0;
|
|
224
|
+
var m = Error.prepareStackTrace;
|
|
225
225
|
Error.prepareStackTrace = void 0;
|
|
226
226
|
var w;
|
|
227
|
-
w =
|
|
227
|
+
w = Jt.current, Jt.current = null, be();
|
|
228
228
|
try {
|
|
229
229
|
if (o) {
|
|
230
230
|
var b = function() {
|
|
@@ -237,171 +237,171 @@ function Ur() {
|
|
|
237
237
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
238
238
|
try {
|
|
239
239
|
Reflect.construct(b, []);
|
|
240
|
-
} catch (
|
|
241
|
-
|
|
240
|
+
} catch (I) {
|
|
241
|
+
g = I;
|
|
242
242
|
}
|
|
243
243
|
Reflect.construct(t, [], b);
|
|
244
244
|
} else {
|
|
245
245
|
try {
|
|
246
246
|
b.call();
|
|
247
|
-
} catch (
|
|
248
|
-
|
|
247
|
+
} catch (I) {
|
|
248
|
+
g = I;
|
|
249
249
|
}
|
|
250
250
|
t.call(b.prototype);
|
|
251
251
|
}
|
|
252
252
|
} else {
|
|
253
253
|
try {
|
|
254
254
|
throw Error();
|
|
255
|
-
} catch (
|
|
256
|
-
|
|
255
|
+
} catch (I) {
|
|
256
|
+
g = I;
|
|
257
257
|
}
|
|
258
258
|
t();
|
|
259
259
|
}
|
|
260
|
-
} catch (
|
|
261
|
-
if (
|
|
262
|
-
for (var
|
|
263
|
-
`),
|
|
264
|
-
`),
|
|
265
|
-
|
|
266
|
-
for (;
|
|
267
|
-
if (
|
|
268
|
-
if (
|
|
260
|
+
} catch (I) {
|
|
261
|
+
if (I && g && typeof I.stack == "string") {
|
|
262
|
+
for (var A = I.stack.split(`
|
|
263
|
+
`), R = g.stack.split(`
|
|
264
|
+
`), k = A.length - 1, O = R.length - 1; k >= 1 && O >= 0 && A[k] !== R[O]; )
|
|
265
|
+
O--;
|
|
266
|
+
for (; k >= 1 && O >= 0; k--, O--)
|
|
267
|
+
if (A[k] !== R[O]) {
|
|
268
|
+
if (k !== 1 || O !== 1)
|
|
269
269
|
do
|
|
270
|
-
if (
|
|
271
|
-
var
|
|
272
|
-
` +
|
|
273
|
-
return t.displayName &&
|
|
270
|
+
if (k--, O--, O < 0 || A[k] !== R[O]) {
|
|
271
|
+
var j = `
|
|
272
|
+
` + A[k].replace(" at new ", " at ");
|
|
273
|
+
return t.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", t.displayName)), typeof t == "function" && Et.set(t, j), j;
|
|
274
274
|
}
|
|
275
|
-
while (
|
|
275
|
+
while (k >= 1 && O >= 0);
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
} finally {
|
|
280
|
-
|
|
280
|
+
Kt = !1, Jt.current = w, Ne(), Error.prepareStackTrace = m;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
283
|
-
return typeof t == "function" &&
|
|
282
|
+
var W = t ? t.displayName || t.name : "", M = W ? It(W) : "";
|
|
283
|
+
return typeof t == "function" && Et.set(t, M), M;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
return
|
|
285
|
+
function He(t, o, u) {
|
|
286
|
+
return Qt(t, !1);
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function We(t) {
|
|
289
289
|
var o = t.prototype;
|
|
290
290
|
return !!(o && o.isReactComponent);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function Lt(t, o, u) {
|
|
293
293
|
if (t == null)
|
|
294
294
|
return "";
|
|
295
295
|
if (typeof t == "function")
|
|
296
|
-
return
|
|
296
|
+
return Qt(t, We(t));
|
|
297
297
|
if (typeof t == "string")
|
|
298
298
|
return It(t);
|
|
299
299
|
switch (t) {
|
|
300
|
-
case
|
|
300
|
+
case v:
|
|
301
301
|
return It("Suspense");
|
|
302
|
-
case
|
|
302
|
+
case y:
|
|
303
303
|
return It("SuspenseList");
|
|
304
304
|
}
|
|
305
305
|
if (typeof t == "object")
|
|
306
306
|
switch (t.$$typeof) {
|
|
307
|
-
case
|
|
308
|
-
return
|
|
309
|
-
case
|
|
310
|
-
return
|
|
311
|
-
case
|
|
312
|
-
var
|
|
307
|
+
case d:
|
|
308
|
+
return He(t.render);
|
|
309
|
+
case _:
|
|
310
|
+
return Lt(t.type, o, u);
|
|
311
|
+
case C: {
|
|
312
|
+
var g = t, m = g._payload, w = g._init;
|
|
313
313
|
try {
|
|
314
|
-
return
|
|
314
|
+
return Lt(w(m), o, u);
|
|
315
315
|
} catch {
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
return "";
|
|
320
320
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
321
|
+
var _t = Object.prototype.hasOwnProperty, we = {}, xe = L.ReactDebugCurrentFrame;
|
|
322
|
+
function Ft(t) {
|
|
323
323
|
if (t) {
|
|
324
|
-
var o = t._owner, u =
|
|
325
|
-
|
|
324
|
+
var o = t._owner, u = Lt(t.type, t._source, o ? o.type : null);
|
|
325
|
+
xe.setExtraStackFrame(u);
|
|
326
326
|
} else
|
|
327
|
-
|
|
327
|
+
xe.setExtraStackFrame(null);
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Ue(t, o, u, g, m) {
|
|
330
330
|
{
|
|
331
|
-
var w = Function.call.bind(
|
|
331
|
+
var w = Function.call.bind(_t);
|
|
332
332
|
for (var b in t)
|
|
333
333
|
if (w(t, b)) {
|
|
334
|
-
var
|
|
334
|
+
var A = void 0;
|
|
335
335
|
try {
|
|
336
336
|
if (typeof t[b] != "function") {
|
|
337
|
-
var
|
|
338
|
-
throw
|
|
337
|
+
var R = Error((g || "React class") + ": " + u + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
338
|
+
throw R.name = "Invariant Violation", R;
|
|
339
339
|
}
|
|
340
|
-
|
|
341
|
-
} catch (
|
|
342
|
-
|
|
340
|
+
A = t[b](o, b, g, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
341
|
+
} catch (k) {
|
|
342
|
+
A = k;
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
A && !(A instanceof Error) && (Ft(m), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", u, b, typeof A), Ft(null)), A instanceof Error && !(A.message in we) && (we[A.message] = !0, Ft(m), T("Failed %s type: %s", u, A.message), Ft(null));
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
var
|
|
349
|
-
function
|
|
350
|
-
return
|
|
348
|
+
var Ve = Array.isArray;
|
|
349
|
+
function te(t) {
|
|
350
|
+
return Ve(t);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function H(t) {
|
|
353
353
|
{
|
|
354
354
|
var o = typeof Symbol == "function" && Symbol.toStringTag, u = o && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
355
355
|
return u;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function qe(t) {
|
|
359
359
|
try {
|
|
360
|
-
return
|
|
360
|
+
return Ae(t), !1;
|
|
361
361
|
} catch {
|
|
362
362
|
return !0;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Ae(t) {
|
|
366
366
|
return "" + t;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
if (
|
|
370
|
-
return
|
|
368
|
+
function ee(t) {
|
|
369
|
+
if (qe(t))
|
|
370
|
+
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", H(t)), Ae(t);
|
|
371
371
|
}
|
|
372
|
-
var ot =
|
|
372
|
+
var ot = L.ReactCurrentOwner, Ee = {
|
|
373
373
|
key: !0,
|
|
374
374
|
ref: !0,
|
|
375
375
|
__self: !0,
|
|
376
376
|
__source: !0
|
|
377
|
-
}, $t,
|
|
378
|
-
|
|
379
|
-
function
|
|
380
|
-
if (
|
|
377
|
+
}, $t, _e, re;
|
|
378
|
+
re = {};
|
|
379
|
+
function ne(t) {
|
|
380
|
+
if (_t.call(t, "ref")) {
|
|
381
381
|
var o = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
382
382
|
if (o && o.isReactWarning)
|
|
383
383
|
return !1;
|
|
384
384
|
}
|
|
385
385
|
return t.ref !== void 0;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
if (
|
|
387
|
+
function Ye(t) {
|
|
388
|
+
if (_t.call(t, "key")) {
|
|
389
389
|
var o = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
390
390
|
if (o && o.isReactWarning)
|
|
391
391
|
return !1;
|
|
392
392
|
}
|
|
393
393
|
return t.key !== void 0;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Xe(t, o) {
|
|
396
396
|
if (typeof t.ref == "string" && ot.current && o && ot.current.stateNode !== o) {
|
|
397
|
-
var u =
|
|
398
|
-
|
|
397
|
+
var u = tt(ot.current.type);
|
|
398
|
+
re[u] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', tt(ot.current.type), t.ref), re[u] = !0);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function Ge(t, o) {
|
|
402
402
|
{
|
|
403
403
|
var u = function() {
|
|
404
|
-
$t || ($t = !0,
|
|
404
|
+
$t || ($t = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
405
405
|
};
|
|
406
406
|
u.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
407
407
|
get: u,
|
|
@@ -409,10 +409,10 @@ function Ur() {
|
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function ie(t, o) {
|
|
413
413
|
{
|
|
414
414
|
var u = function() {
|
|
415
|
-
|
|
415
|
+
_e || (_e = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
416
416
|
};
|
|
417
417
|
u.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
418
418
|
get: u,
|
|
@@ -420,8 +420,8 @@ function Ur() {
|
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
var
|
|
424
|
-
var
|
|
423
|
+
var ke = function(t, o, u, g, m, w, b) {
|
|
424
|
+
var A = {
|
|
425
425
|
// This tag allows us to uniquely identify this as a React Element
|
|
426
426
|
$$typeof: e,
|
|
427
427
|
// Built-in properties that belong on the element
|
|
@@ -432,58 +432,58 @@ function Ur() {
|
|
|
432
432
|
// Record the component responsible for creating this element.
|
|
433
433
|
_owner: w
|
|
434
434
|
};
|
|
435
|
-
return
|
|
435
|
+
return A._store = {}, Object.defineProperty(A._store, "validated", {
|
|
436
436
|
configurable: !1,
|
|
437
437
|
enumerable: !1,
|
|
438
438
|
writable: !0,
|
|
439
439
|
value: !1
|
|
440
|
-
}), Object.defineProperty(
|
|
440
|
+
}), Object.defineProperty(A, "_self", {
|
|
441
441
|
configurable: !1,
|
|
442
442
|
enumerable: !1,
|
|
443
443
|
writable: !1,
|
|
444
|
-
value:
|
|
445
|
-
}), Object.defineProperty(
|
|
444
|
+
value: g
|
|
445
|
+
}), Object.defineProperty(A, "_source", {
|
|
446
446
|
configurable: !1,
|
|
447
447
|
enumerable: !1,
|
|
448
448
|
writable: !1,
|
|
449
|
-
value:
|
|
450
|
-
}), Object.freeze && (Object.freeze(
|
|
449
|
+
value: m
|
|
450
|
+
}), Object.freeze && (Object.freeze(A.props), Object.freeze(A)), A;
|
|
451
451
|
};
|
|
452
|
-
function
|
|
452
|
+
function kt(t, o, u, g, m) {
|
|
453
453
|
{
|
|
454
|
-
var w, b = {},
|
|
455
|
-
u !== void 0 && (
|
|
454
|
+
var w, b = {}, A = null, R = null;
|
|
455
|
+
u !== void 0 && (ee(u), A = "" + u), Ye(o) && (ee(o.key), A = "" + o.key), ne(o) && (R = o.ref, Xe(o, m));
|
|
456
456
|
for (w in o)
|
|
457
|
-
|
|
457
|
+
_t.call(o, w) && !Ee.hasOwnProperty(w) && (b[w] = o[w]);
|
|
458
458
|
if (t && t.defaultProps) {
|
|
459
|
-
var
|
|
460
|
-
for (w in
|
|
461
|
-
b[w] === void 0 && (b[w] =
|
|
459
|
+
var k = t.defaultProps;
|
|
460
|
+
for (w in k)
|
|
461
|
+
b[w] === void 0 && (b[w] = k[w]);
|
|
462
462
|
}
|
|
463
|
-
if (
|
|
464
|
-
var
|
|
465
|
-
|
|
463
|
+
if (A || R) {
|
|
464
|
+
var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
465
|
+
A && Ge(b, O), R && ie(b, O);
|
|
466
466
|
}
|
|
467
|
-
return
|
|
467
|
+
return ke(t, A, R, m, g, ot.current, b);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
var
|
|
470
|
+
var oe = L.ReactCurrentOwner, Te = L.ReactDebugCurrentFrame;
|
|
471
471
|
function ut(t) {
|
|
472
472
|
if (t) {
|
|
473
|
-
var o = t._owner, u =
|
|
474
|
-
|
|
473
|
+
var o = t._owner, u = Lt(t.type, t._source, o ? o.type : null);
|
|
474
|
+
Te.setExtraStackFrame(u);
|
|
475
475
|
} else
|
|
476
|
-
|
|
476
|
+
Te.setExtraStackFrame(null);
|
|
477
477
|
}
|
|
478
478
|
var G;
|
|
479
479
|
G = !1;
|
|
480
|
-
function
|
|
480
|
+
function dt(t) {
|
|
481
481
|
return typeof t == "object" && t !== null && t.$$typeof === e;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function jt() {
|
|
484
484
|
{
|
|
485
|
-
if (
|
|
486
|
-
var t =
|
|
485
|
+
if (oe.current) {
|
|
486
|
+
var t = tt(oe.current.type);
|
|
487
487
|
if (t)
|
|
488
488
|
return `
|
|
489
489
|
|
|
@@ -492,7 +492,7 @@ Check the render method of \`` + t + "`.";
|
|
|
492
492
|
return "";
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Je(t) {
|
|
496
496
|
{
|
|
497
497
|
if (t !== void 0) {
|
|
498
498
|
var o = t.fileName.replace(/^.*[\\\/]/, ""), u = t.lineNumber;
|
|
@@ -503,10 +503,10 @@ Check your code at ` + o + ":" + u + ".";
|
|
|
503
503
|
return "";
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
var
|
|
507
|
-
function
|
|
506
|
+
var se = {};
|
|
507
|
+
function Se(t) {
|
|
508
508
|
{
|
|
509
|
-
var o =
|
|
509
|
+
var o = jt();
|
|
510
510
|
if (!o) {
|
|
511
511
|
var u = typeof t == "string" ? t : t.displayName || t.name;
|
|
512
512
|
u && (o = `
|
|
@@ -516,39 +516,39 @@ Check the top-level render call using <` + u + ">.");
|
|
|
516
516
|
return o;
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Ce(t, o) {
|
|
520
520
|
{
|
|
521
521
|
if (!t._store || t._store.validated || t.key != null)
|
|
522
522
|
return;
|
|
523
523
|
t._store.validated = !0;
|
|
524
|
-
var u =
|
|
525
|
-
if (
|
|
524
|
+
var u = Se(o);
|
|
525
|
+
if (se[u])
|
|
526
526
|
return;
|
|
527
|
-
|
|
528
|
-
var
|
|
529
|
-
t && t._owner && t._owner !==
|
|
527
|
+
se[u] = !0;
|
|
528
|
+
var g = "";
|
|
529
|
+
t && t._owner && t._owner !== oe.current && (g = " It was passed a child from " + tt(t._owner.type) + "."), ut(t), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, g), ut(null);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
function Dt(t, o) {
|
|
533
533
|
{
|
|
534
534
|
if (typeof t != "object")
|
|
535
535
|
return;
|
|
536
|
-
if (
|
|
536
|
+
if (te(t))
|
|
537
537
|
for (var u = 0; u < t.length; u++) {
|
|
538
|
-
var
|
|
539
|
-
|
|
538
|
+
var g = t[u];
|
|
539
|
+
dt(g) && Ce(g, o);
|
|
540
540
|
}
|
|
541
|
-
else if (
|
|
541
|
+
else if (dt(t))
|
|
542
542
|
t._store && (t._store.validated = !0);
|
|
543
543
|
else if (t) {
|
|
544
|
-
var
|
|
545
|
-
if (typeof
|
|
546
|
-
for (var w =
|
|
547
|
-
|
|
544
|
+
var m = $(t);
|
|
545
|
+
if (typeof m == "function" && m !== t.entries)
|
|
546
|
+
for (var w = m.call(t), b; !(b = w.next()).done; )
|
|
547
|
+
dt(b.value) && Ce(b.value, o);
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Ze(t) {
|
|
552
552
|
{
|
|
553
553
|
var o = t.type;
|
|
554
554
|
if (o == null || typeof o == "string")
|
|
@@ -556,574 +556,91 @@ Check the top-level render call using <` + u + ">.");
|
|
|
556
556
|
var u;
|
|
557
557
|
if (typeof o == "function")
|
|
558
558
|
u = o.propTypes;
|
|
559
|
-
else if (typeof o == "object" && (o.$$typeof ===
|
|
559
|
+
else if (typeof o == "object" && (o.$$typeof === d || // Note: Memo only checks outer props here.
|
|
560
560
|
// Inner props are checked in the reconciler.
|
|
561
|
-
o.$$typeof ===
|
|
561
|
+
o.$$typeof === _))
|
|
562
562
|
u = o.propTypes;
|
|
563
563
|
else
|
|
564
564
|
return;
|
|
565
565
|
if (u) {
|
|
566
|
-
var
|
|
567
|
-
|
|
566
|
+
var g = tt(o);
|
|
567
|
+
Ue(u, t.props, "prop", g, t);
|
|
568
568
|
} else if (o.PropTypes !== void 0 && !G) {
|
|
569
569
|
G = !0;
|
|
570
|
-
var
|
|
571
|
-
|
|
570
|
+
var m = tt(o);
|
|
571
|
+
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
|
|
572
572
|
}
|
|
573
|
-
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved &&
|
|
573
|
+
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Oe(t) {
|
|
577
577
|
{
|
|
578
578
|
for (var o = Object.keys(t.props), u = 0; u < o.length; u++) {
|
|
579
|
-
var
|
|
580
|
-
if (
|
|
581
|
-
ut(t),
|
|
579
|
+
var g = o[u];
|
|
580
|
+
if (g !== "children" && g !== "key") {
|
|
581
|
+
ut(t), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), ut(null);
|
|
582
582
|
break;
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
|
-
t.ref !== null && (ut(t),
|
|
585
|
+
t.ref !== null && (ut(t), T("Invalid attribute `ref` supplied to `React.Fragment`."), ut(null));
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function ae(t, o, u, g, m, w) {
|
|
589
589
|
{
|
|
590
|
-
var b =
|
|
590
|
+
var b = Ot(t);
|
|
591
591
|
if (!b) {
|
|
592
|
-
var
|
|
593
|
-
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
var
|
|
597
|
-
t === null ?
|
|
592
|
+
var A = "";
|
|
593
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (A += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
594
|
+
var R = Je(m);
|
|
595
|
+
R ? A += R : A += jt();
|
|
596
|
+
var k;
|
|
597
|
+
t === null ? k = "null" : te(t) ? k = "array" : t !== void 0 && t.$$typeof === e ? (k = "<" + (tt(t.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : k = typeof t, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, A);
|
|
598
598
|
}
|
|
599
|
-
var
|
|
600
|
-
if (
|
|
601
|
-
return
|
|
599
|
+
var O = kt(t, o, u, m, w);
|
|
600
|
+
if (O == null)
|
|
601
|
+
return O;
|
|
602
602
|
if (b) {
|
|
603
|
-
var
|
|
604
|
-
if (
|
|
605
|
-
if (
|
|
606
|
-
if (
|
|
607
|
-
for (var
|
|
608
|
-
Dt(
|
|
609
|
-
Object.freeze && Object.freeze(
|
|
603
|
+
var j = o.children;
|
|
604
|
+
if (j !== void 0)
|
|
605
|
+
if (g)
|
|
606
|
+
if (te(j)) {
|
|
607
|
+
for (var W = 0; W < j.length; W++)
|
|
608
|
+
Dt(j[W], t);
|
|
609
|
+
Object.freeze && Object.freeze(j);
|
|
610
610
|
} else
|
|
611
|
-
|
|
611
|
+
T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
612
612
|
else
|
|
613
|
-
Dt(
|
|
613
|
+
Dt(j, t);
|
|
614
614
|
}
|
|
615
|
-
return t === i ?
|
|
615
|
+
return t === i ? Oe(O) : Ze(O), O;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
function
|
|
619
|
-
return
|
|
618
|
+
function Ke(t, o, u) {
|
|
619
|
+
return ae(t, o, u, !0);
|
|
620
620
|
}
|
|
621
621
|
function r(t, o, u) {
|
|
622
|
-
return
|
|
622
|
+
return ae(t, o, u, !1);
|
|
623
623
|
}
|
|
624
|
-
var n = r,
|
|
625
|
-
|
|
626
|
-
}()),
|
|
627
|
-
}
|
|
628
|
-
process.env.NODE_ENV === "production" ? er.exports = Br() : er.exports = Ur();
|
|
629
|
-
var Wr = er.exports, Yr = Object.defineProperty, Vr = (p, e, a) => e in p ? Yr(p, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : p[e] = a, x = (p, e, a) => (Vr(p, typeof e != "symbol" ? e + "" : e, a), a), qr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
630
|
-
function lr(p) {
|
|
631
|
-
return p && p.__esModule && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p;
|
|
624
|
+
var n = r, a = Ke;
|
|
625
|
+
ce.Fragment = i, ce.jsx = n, ce.jsxs = a;
|
|
626
|
+
}()), ce;
|
|
632
627
|
}
|
|
633
|
-
|
|
634
|
-
(
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
})("Vector", function() {
|
|
638
|
-
var e = function() {
|
|
639
|
-
var a = Math.PI * 2, i = 180 / Math.PI, h = Math.PI / 180;
|
|
640
|
-
function c(s) {
|
|
641
|
-
return Math.round(s * 1e8) / 1e8;
|
|
642
|
-
}
|
|
643
|
-
function g(s, d) {
|
|
644
|
-
var A = d.x - s.x, _ = d.y - s.y;
|
|
645
|
-
return Math.sqrt(A * A + _ * _);
|
|
646
|
-
}
|
|
647
|
-
function m(s, d, A) {
|
|
648
|
-
var _ = d.y - s.y, R = d.x - s.x, P = Math.atan2(_, R);
|
|
649
|
-
if (A)
|
|
650
|
-
for (; P < 0; )
|
|
651
|
-
P += a;
|
|
652
|
-
return P;
|
|
653
|
-
}
|
|
654
|
-
function f(s, d) {
|
|
655
|
-
this.x = s !== void 0 ? s : 0, this.y = d !== void 0 ? d : 0;
|
|
656
|
-
}
|
|
657
|
-
return f.fromRadians = function(s) {
|
|
658
|
-
var d = Math.cos(s), A = Math.sin(s);
|
|
659
|
-
return new f(d, A);
|
|
660
|
-
}, f.fromDegrees = function(s) {
|
|
661
|
-
var d = s * (Math.PI / 180);
|
|
662
|
-
return f.fromRadians(d);
|
|
663
|
-
}, f.fromString = function(s) {
|
|
664
|
-
var d = s.split(",");
|
|
665
|
-
return new f(parseFloat(d[0]), parseFloat(d[1]));
|
|
666
|
-
}, f.fromArray = function(s) {
|
|
667
|
-
return new f(s[0], s[1]);
|
|
668
|
-
}, f.prototype = {
|
|
669
|
-
// version
|
|
670
|
-
version: "2.0.1",
|
|
671
|
-
// [API]
|
|
672
|
-
// [chainable, clone]
|
|
673
|
-
// clone the vector and return the cloned instance.
|
|
674
|
-
// @return cloned vector.
|
|
675
|
-
clone: function() {
|
|
676
|
-
return new f(this.x, this.y);
|
|
677
|
-
},
|
|
678
|
-
// [API]
|
|
679
|
-
// []
|
|
680
|
-
// Get if equal to another vector
|
|
681
|
-
// @param vector - other vector to compare with.
|
|
682
|
-
// @return if vectors are equal.
|
|
683
|
-
equals: function(s) {
|
|
684
|
-
return this.prototype === s.prototype && this.x === s.x && this.y === s.y;
|
|
685
|
-
},
|
|
686
|
-
// [API]
|
|
687
|
-
// [chainable, changeSelf]
|
|
688
|
-
// set values from another vector. this changes value of self.
|
|
689
|
-
// @param vector - other vector to get values from.
|
|
690
|
-
// @return self.
|
|
691
|
-
copy: function(s) {
|
|
692
|
-
return this.x = s.x, this.y = s.y, this;
|
|
693
|
-
},
|
|
694
|
-
// [API]
|
|
695
|
-
// [chainable, changeSelf]
|
|
696
|
-
// set only the x component from another vector.
|
|
697
|
-
// @return self.
|
|
698
|
-
copyX: function(s) {
|
|
699
|
-
return this.x = s.x, this;
|
|
700
|
-
},
|
|
701
|
-
// [API]
|
|
702
|
-
// [chainable, changeSelf]
|
|
703
|
-
// set only the y component from another vector.
|
|
704
|
-
// @return self.
|
|
705
|
-
copyY: function(s) {
|
|
706
|
-
return this.y = s.y, this;
|
|
707
|
-
},
|
|
708
|
-
// [API]
|
|
709
|
-
// []
|
|
710
|
-
// convert to a dictionary with {x, y}.
|
|
711
|
-
// @return a dictionary representation of the vector.
|
|
712
|
-
toDict: function() {
|
|
713
|
-
return { x: this.x, y: this.y };
|
|
714
|
-
},
|
|
715
|
-
// [API]
|
|
716
|
-
// []
|
|
717
|
-
// convert to array with [x, y].
|
|
718
|
-
// @return an array representation of the vector.
|
|
719
|
-
toArray: function() {
|
|
720
|
-
return [this.x, this.y];
|
|
721
|
-
},
|
|
722
|
-
// [API]
|
|
723
|
-
// [chainable, changeSelf]
|
|
724
|
-
// set values from x, y.
|
|
725
|
-
// @param x - optional x component to set.
|
|
726
|
-
// @param y - optional y component to set.
|
|
727
|
-
// @return self.
|
|
728
|
-
set: function(s, d) {
|
|
729
|
-
return s !== void 0 && (this.x = s), d !== void 0 && (this.y = d), this;
|
|
730
|
-
},
|
|
731
|
-
// [API]
|
|
732
|
-
// [chainable, clone]
|
|
733
|
-
// clone and flip between x and y values.
|
|
734
|
-
// @return cloned vector with flipped x and y components.
|
|
735
|
-
flipXY: function() {
|
|
736
|
-
return new f(this.y, this.x);
|
|
737
|
-
},
|
|
738
|
-
// [API]
|
|
739
|
-
// [chainable, changeSelf]
|
|
740
|
-
// flip between x and y values.
|
|
741
|
-
// @return self.
|
|
742
|
-
flipXYSelf: function() {
|
|
743
|
-
return this.y = [this.x, this.x = this.y][0], this;
|
|
744
|
-
},
|
|
745
|
-
// [API]
|
|
746
|
-
// [chainable, clone]
|
|
747
|
-
// clone and invert x and y values (like multiply with -1, eg x, y => -x, -y)
|
|
748
|
-
// @return cloned vector with inverted values.
|
|
749
|
-
invert: function() {
|
|
750
|
-
return this.mulScalar(-1);
|
|
751
|
-
},
|
|
752
|
-
// [API]
|
|
753
|
-
// [chainable, changeSelf]
|
|
754
|
-
// invert x and y values (like multiply with -1, eg x, y => -x, -y)
|
|
755
|
-
// @return self.
|
|
756
|
-
invertSelf: function() {
|
|
757
|
-
return this.mulScalarSelf(-1), this;
|
|
758
|
-
},
|
|
759
|
-
// [API]
|
|
760
|
-
// []
|
|
761
|
-
// get the distance from another vector.
|
|
762
|
-
// @param other - vector to get distance from.
|
|
763
|
-
// @return distance between vectors.
|
|
764
|
-
distanceFrom: function(s) {
|
|
765
|
-
return g(this, s);
|
|
766
|
-
},
|
|
767
|
-
// [API]
|
|
768
|
-
// []
|
|
769
|
-
// get angle from another vector in radians.
|
|
770
|
-
// @return angle in radians from this to other.
|
|
771
|
-
radiansTo: function(s) {
|
|
772
|
-
return m(this, s, !0);
|
|
773
|
-
},
|
|
774
|
-
// [API]
|
|
775
|
-
// []
|
|
776
|
-
// get degrees from another vector in degrees.
|
|
777
|
-
// @return angle in degrees from this to other.
|
|
778
|
-
degreesTo: function(s) {
|
|
779
|
-
return m(this, s, !0) * i;
|
|
780
|
-
},
|
|
781
|
-
// [API]
|
|
782
|
-
// []
|
|
783
|
-
// convert this vector to a radian angle.
|
|
784
|
-
// this is equivalent to doing Vector.zero.radiansTo(this).
|
|
785
|
-
// @return angle in radians.
|
|
786
|
-
toRadians: function(s) {
|
|
787
|
-
return m(f.zero, this, !0);
|
|
788
|
-
},
|
|
789
|
-
// [API]
|
|
790
|
-
// []
|
|
791
|
-
// convert this vector to degree.
|
|
792
|
-
// this is equivalent to doing Vector.zero.degreeTo(this).
|
|
793
|
-
// @return angle in degrees (0-360).
|
|
794
|
-
toDegrees: function(s) {
|
|
795
|
-
return this.toRadians() * i;
|
|
796
|
-
},
|
|
797
|
-
// [API]
|
|
798
|
-
// [chainable, changeSelf]
|
|
799
|
-
// rotate this vector by a given degree.
|
|
800
|
-
// @param degrees - degrees to rotate this vector by (can be positive or negative).
|
|
801
|
-
// @return self.
|
|
802
|
-
rotateDegreesSelf: function(s) {
|
|
803
|
-
return this.rotateRadiansSelf(s * h);
|
|
804
|
-
},
|
|
805
|
-
// [API]
|
|
806
|
-
// [chainable]
|
|
807
|
-
// clone and rotate the vector by a given degree.
|
|
808
|
-
// @param degrees - degree to rotate this vector by (can be positive or negative).
|
|
809
|
-
// @return cloned rotated vector.
|
|
810
|
-
rotateDegrees: function(s) {
|
|
811
|
-
return this.clone().rotateDegreesSelf(s);
|
|
812
|
-
},
|
|
813
|
-
// [API]
|
|
814
|
-
// [chainable, changeSelf]
|
|
815
|
-
// rotate this vector by a given radian.
|
|
816
|
-
// @param radians - radians to rotate this vector by (can be positive or negative).
|
|
817
|
-
// @return self.
|
|
818
|
-
rotateRadiansSelf: function(s) {
|
|
819
|
-
var d = Math.cos(s), A = Math.sin(s), _ = this.x * d - this.y * A, R = this.x * A + this.y * d;
|
|
820
|
-
return this.x = c(_), this.y = c(R), this;
|
|
821
|
-
},
|
|
822
|
-
// [API]
|
|
823
|
-
// [chainable]
|
|
824
|
-
// clone and rotate the vector by a given degree.
|
|
825
|
-
// @param radians - radians to rotate this vector by (can be positive or negative).
|
|
826
|
-
// @return cloned rotated vector.
|
|
827
|
-
rotateRadians: function(s) {
|
|
828
|
-
return this.clone().rotateRadiansSelf(s);
|
|
829
|
-
},
|
|
830
|
-
// [API]
|
|
831
|
-
// []
|
|
832
|
-
// calculate the length of this vector (aka magnitude).
|
|
833
|
-
// @return vector length.
|
|
834
|
-
length: function() {
|
|
835
|
-
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
836
|
-
},
|
|
837
|
-
// [API]
|
|
838
|
-
// [chainable, changeSelf]
|
|
839
|
-
// normalize this vector, eg make length equal 1.
|
|
840
|
-
// @return self.
|
|
841
|
-
normalizeSelf: function() {
|
|
842
|
-
var s = Math.sqrt(this.x * this.x + this.y * this.y);
|
|
843
|
-
return s === 0 ? this : (this.x /= s, this.y /= s, this);
|
|
844
|
-
},
|
|
845
|
-
// [API]
|
|
846
|
-
// [chainable, clone]
|
|
847
|
-
// clone and normalize the vector.
|
|
848
|
-
// @return normalized vector.
|
|
849
|
-
normalize: function() {
|
|
850
|
-
return this.clone().normalizeSelf();
|
|
851
|
-
},
|
|
852
|
-
// [API]
|
|
853
|
-
// [chainable, changeSelf]
|
|
854
|
-
// add other vector to self.
|
|
855
|
-
// for example, v(10, 11) + v(5, 6) = v(15, 17).
|
|
856
|
-
// @param other - vector to add components to self.
|
|
857
|
-
// @return self.
|
|
858
|
-
addSelf: function(s) {
|
|
859
|
-
return typeof s == "number" ? this.addScalarSelf(s) : (this.x += s.x, this.y += s.y, this);
|
|
860
|
-
},
|
|
861
|
-
// [API]
|
|
862
|
-
// [chainable, changeSelf]
|
|
863
|
-
// subtract other vector from self.
|
|
864
|
-
// for example, v(10, 10) - v(2, 3) = v(8, 7).
|
|
865
|
-
// @param other - vector to subtract components from self.
|
|
866
|
-
// @return self.
|
|
867
|
-
subSelf: function(s) {
|
|
868
|
-
return typeof s == "number" ? this.subScalarSelf(s) : (this.x -= s.x, this.y -= s.y, this);
|
|
869
|
-
},
|
|
870
|
-
// [API]
|
|
871
|
-
// [chainable, changeSelf]
|
|
872
|
-
// divide self by other vector.
|
|
873
|
-
// for example, v(10, 20) / v(2, 5) = v(5, 4).
|
|
874
|
-
// @param other - vector to divide components from self.
|
|
875
|
-
// @return self.
|
|
876
|
-
divSelf: function(s) {
|
|
877
|
-
return typeof s == "number" ? this.divScalarSelf(s) : (this.x /= s.x, this.y /= s.y, this);
|
|
878
|
-
},
|
|
879
|
-
// [API]
|
|
880
|
-
// [chainable, changeSelf]
|
|
881
|
-
// multiply self vector by other vector.
|
|
882
|
-
// for example, v(2, 3) * v(3, 4) = v(6, 12).
|
|
883
|
-
// @param other - vector to multiply components with self.
|
|
884
|
-
// @return self.
|
|
885
|
-
mulSelf: function(s) {
|
|
886
|
-
return typeof s == "number" ? this.mulScalarSelf(s) : (this.x *= s.x, this.y *= s.y, this);
|
|
887
|
-
},
|
|
888
|
-
// [API]
|
|
889
|
-
// [chainable, changeSelf]
|
|
890
|
-
// add scalar value to self.
|
|
891
|
-
// for example, v(2, 3) + 5 = v(7, 8).
|
|
892
|
-
// @param val - value to add to components.
|
|
893
|
-
// @return self.
|
|
894
|
-
addScalarSelf: function(s) {
|
|
895
|
-
return this.x += s, this.y += s, this;
|
|
896
|
-
},
|
|
897
|
-
// [API]
|
|
898
|
-
// [chainable, changeSelf]
|
|
899
|
-
// subtract scalar from self.
|
|
900
|
-
// for example, v(7, 9) - 5 = v(3, 4).
|
|
901
|
-
// @param val - value to subtract from components.
|
|
902
|
-
// @return self.
|
|
903
|
-
subScalarSelf: function(s) {
|
|
904
|
-
return this.x -= s, this.y -= s, this;
|
|
905
|
-
},
|
|
906
|
-
// [API]
|
|
907
|
-
// [chainable, changeSelf]
|
|
908
|
-
// divide self by scalar.
|
|
909
|
-
// for example, v(6, 8) / 5 = v(3, 4).
|
|
910
|
-
// @param val - value to divide components by.
|
|
911
|
-
// @return self.
|
|
912
|
-
divScalarSelf: function(s) {
|
|
913
|
-
return this.x /= s, this.y /= s, this;
|
|
914
|
-
},
|
|
915
|
-
// [API]
|
|
916
|
-
// [chainable, changeSelf]
|
|
917
|
-
// multiply self by scalar.
|
|
918
|
-
// for example, v(2, 3) * 2 = v(4, 6).
|
|
919
|
-
// @param val - value to multiply components with.
|
|
920
|
-
// @return self.
|
|
921
|
-
mulScalarSelf: function(s) {
|
|
922
|
-
return this.x *= s, this.y *= s, this;
|
|
923
|
-
},
|
|
924
|
-
// [API]
|
|
925
|
-
// [chainable, clone]
|
|
926
|
-
// clone self and add other vector to it.
|
|
927
|
-
// @param other - vector to add with.
|
|
928
|
-
// @return cloned vector.
|
|
929
|
-
add: function(s) {
|
|
930
|
-
return this.clone().addSelf(s);
|
|
931
|
-
},
|
|
932
|
-
// [API]
|
|
933
|
-
// [chainable, clone]
|
|
934
|
-
// clone self and subtract other vector from it.
|
|
935
|
-
// @param other - vector to subtract with.
|
|
936
|
-
// @return cloned vector.
|
|
937
|
-
sub: function(s) {
|
|
938
|
-
return this.clone().subSelf(s);
|
|
939
|
-
},
|
|
940
|
-
// [API]
|
|
941
|
-
// [chainable, clone]
|
|
942
|
-
// clone self and multiply by other vector.
|
|
943
|
-
// @param other - vector to multiply with.
|
|
944
|
-
// @return cloned vector.
|
|
945
|
-
mul: function(s) {
|
|
946
|
-
return this.clone().mulSelf(s);
|
|
947
|
-
},
|
|
948
|
-
// [API]
|
|
949
|
-
// [chainable, clone]
|
|
950
|
-
// clone self and divide by other vector.
|
|
951
|
-
// @param other - vector to divide with.
|
|
952
|
-
// @param scalar - value to divide by.
|
|
953
|
-
// @return cloned vector.
|
|
954
|
-
div: function(s) {
|
|
955
|
-
return this.clone().divSelf(s);
|
|
956
|
-
},
|
|
957
|
-
// [API]
|
|
958
|
-
// [chainable, clone]
|
|
959
|
-
// clone self and add scalar to it.
|
|
960
|
-
// @param scalar - value to add.
|
|
961
|
-
// @return cloned vector.
|
|
962
|
-
addScalar: function(s) {
|
|
963
|
-
return this.clone().addScalarSelf(s);
|
|
964
|
-
},
|
|
965
|
-
// [API]
|
|
966
|
-
// [chainable, clone]
|
|
967
|
-
// clone self and substract scalar from it.
|
|
968
|
-
// @param scalar - value to subtract.
|
|
969
|
-
// @return cloned vector.
|
|
970
|
-
subScalar: function(s) {
|
|
971
|
-
return this.clone().subScalarSelf(s);
|
|
972
|
-
},
|
|
973
|
-
// [API]
|
|
974
|
-
// [chainable, clone]
|
|
975
|
-
// clone self and multiply by scalar.
|
|
976
|
-
// @param scalar - value to multiply with.
|
|
977
|
-
// @return cloned vector.
|
|
978
|
-
mulScalar: function(s) {
|
|
979
|
-
return this.clone().mulScalarSelf(s);
|
|
980
|
-
},
|
|
981
|
-
// [API]
|
|
982
|
-
// [chainable, clone]
|
|
983
|
-
// clone self and divide by scalar.
|
|
984
|
-
// @param scalar - value to divide by.
|
|
985
|
-
// @return cloned vector.
|
|
986
|
-
divScalar: function(s) {
|
|
987
|
-
return this.clone().divScalarSelf(s);
|
|
988
|
-
},
|
|
989
|
-
// [API]
|
|
990
|
-
// [chainable, changeSelf]
|
|
991
|
-
// clamp vector values into range.
|
|
992
|
-
// note: this function does not validate that min < max.
|
|
993
|
-
// @param min - min value for x, y components.
|
|
994
|
-
// @param max - max value for x, y components.
|
|
995
|
-
// @return self.
|
|
996
|
-
clampSelf: function(s, d) {
|
|
997
|
-
return this.x < s.x && (this.x = s.x), this.y < s.y && (this.y = s.y), this.x > d.x && (this.x = d.x), this.y > d.y && (this.y = d.y), this;
|
|
998
|
-
},
|
|
999
|
-
// [API]
|
|
1000
|
-
// [chainable, clone]
|
|
1001
|
-
// clone vector and clamp its values.
|
|
1002
|
-
// note: this function does not validate that min < max.
|
|
1003
|
-
// @param min - min value for x, y components.
|
|
1004
|
-
// @param max - max value for x, y components.
|
|
1005
|
-
// @return cloned vector in range.
|
|
1006
|
-
clamp: function(s, d) {
|
|
1007
|
-
return this.clone().clampSelf(s, d);
|
|
1008
|
-
},
|
|
1009
|
-
// [API]
|
|
1010
|
-
// [chainable, changeSelf]
|
|
1011
|
-
// apply a function on x and y components of the vector.
|
|
1012
|
-
// for example, you can use Math.round to round the vector x, y values.
|
|
1013
|
-
// @param func - function to apply on components.
|
|
1014
|
-
// @return self.
|
|
1015
|
-
applySelf: function(s) {
|
|
1016
|
-
return this.x = s(this.x), this.y = s(this.y), this;
|
|
1017
|
-
},
|
|
1018
|
-
// [API]
|
|
1019
|
-
// [chainable, clone]
|
|
1020
|
-
// clone self and apply a function on x and y components of the clone vector.
|
|
1021
|
-
// for example, you can use Math.round to round the vector x, y values.
|
|
1022
|
-
// @param func - function to apply on components.
|
|
1023
|
-
// @return cloned vector.
|
|
1024
|
-
apply: function(s) {
|
|
1025
|
-
return this.clone().applySelf(s);
|
|
1026
|
-
},
|
|
1027
|
-
// [API]
|
|
1028
|
-
// [chainable, changeSelf]
|
|
1029
|
-
// turn self to absolute values (eg turn x, y positive).
|
|
1030
|
-
// @return self.
|
|
1031
|
-
absSelf: function() {
|
|
1032
|
-
return this.applySelf(Math.abs);
|
|
1033
|
-
},
|
|
1034
|
-
// [API]
|
|
1035
|
-
// [chainable, clone]
|
|
1036
|
-
// clone and turn to absolute values (eg turn x, y positive).
|
|
1037
|
-
// @return cloned vector.
|
|
1038
|
-
abs: function() {
|
|
1039
|
-
return this.clone().absSelf();
|
|
1040
|
-
},
|
|
1041
|
-
// [API]
|
|
1042
|
-
// [chainable, changeSelf]
|
|
1043
|
-
// turn self to round values (eg turn x, y positive).
|
|
1044
|
-
// @return self.
|
|
1045
|
-
roundSelf: function() {
|
|
1046
|
-
return this.applySelf(Math.round);
|
|
1047
|
-
},
|
|
1048
|
-
// [API]
|
|
1049
|
-
// [chainable, clone]
|
|
1050
|
-
// clone and turn to round values (eg turn x, y positive).
|
|
1051
|
-
// @return cloned vector.
|
|
1052
|
-
round: function() {
|
|
1053
|
-
return this.clone().roundSelf();
|
|
1054
|
-
},
|
|
1055
|
-
// [API]
|
|
1056
|
-
// []
|
|
1057
|
-
// calculate dot-product of this vector with another vector.
|
|
1058
|
-
// @param other - other vector to calculate dot-product with.
|
|
1059
|
-
// @return dot product.
|
|
1060
|
-
dot: function(s) {
|
|
1061
|
-
return this.x * s.x + this.y * s.y;
|
|
1062
|
-
},
|
|
1063
|
-
// [API]
|
|
1064
|
-
// []
|
|
1065
|
-
// calculate cross-product of this vector with another vector.
|
|
1066
|
-
// @param other - other vector to calculate cross-product with.
|
|
1067
|
-
// @return dot product.
|
|
1068
|
-
cross: function(s) {
|
|
1069
|
-
return this.x * s.y - this.y * s.x;
|
|
1070
|
-
},
|
|
1071
|
-
// [API]
|
|
1072
|
-
// [chainable, changeSelf]
|
|
1073
|
-
// if any of the components of this vector are NaN, null, undefined, etc. set them to defaults.
|
|
1074
|
-
// note: 0's are considered to be a valid number and will not be replaced with a default value.
|
|
1075
|
-
// @param x - default value for x if undefined (0 if not defined).
|
|
1076
|
-
// @param y - default value for y if undefined (0 if not defined).
|
|
1077
|
-
// @return self.
|
|
1078
|
-
repairSelf: function(s, d) {
|
|
1079
|
-
return (typeof this.x != "number" || isNaN(this.x + 1)) && (this.x = s || 0), (typeof this.y != "number" || isNaN(this.y + 1)) && (this.y = d || 0), this;
|
|
1080
|
-
},
|
|
1081
|
-
// [API]
|
|
1082
|
-
// [chainable, clone]
|
|
1083
|
-
// create a clone and if any of the components of the vector are NaN, null, undefined, etc. set them to default.
|
|
1084
|
-
// note: 0's are considered to be a valid number and will not be replaced with a default value.
|
|
1085
|
-
// @param x - default value for x if undefined (0 if not defined).
|
|
1086
|
-
// @param y - default value for y if undefined (0 if not defined).
|
|
1087
|
-
// @return repaired clone.
|
|
1088
|
-
repair: function(s, d) {
|
|
1089
|
-
return this.clone().repairSelf(s, d);
|
|
1090
|
-
},
|
|
1091
|
-
// [API]
|
|
1092
|
-
// []
|
|
1093
|
-
// convert to string in the form of "x,y".
|
|
1094
|
-
// @return string representation of the vector.
|
|
1095
|
-
toString: function() {
|
|
1096
|
-
return this.x + "," + this.y;
|
|
1097
|
-
},
|
|
1098
|
-
// [API]
|
|
1099
|
-
// []
|
|
1100
|
-
// convert to a string with a given format.
|
|
1101
|
-
// @param format - a string in which %x and %y will be replaced with the vector values.
|
|
1102
|
-
// @return formatted string representing the vector.
|
|
1103
|
-
format: function(s) {
|
|
1104
|
-
return s = s || "%x,%y", s = s.replace(new RegExp("%x", "g"), this.x), s = s.replace(new RegExp("%y", "g"), this.y), s;
|
|
1105
|
-
}
|
|
1106
|
-
}, f;
|
|
1107
|
-
}();
|
|
1108
|
-
return e.zero = new e(0, 0), e.one = new e(1, 1), e.up = new e(0, -1), e.down = new e(0, 1), e.left = new e(-1, 0), e.right = new e(1, 0), e.upLeft = new e(-1, -1), e.downLeft = new e(-1, 1), e.upRight = new e(1, -1), e.downRight = new e(1, 1), e.prototype.magnitude = e.prototype.length, Object.freeze && (Object.freeze(e.zero), Object.freeze(e.one), Object.freeze(e.up), Object.freeze(e.down), Object.freeze(e.left), Object.freeze(e.right), Object.freeze(e.upLeft), Object.freeze(e.downLeft), Object.freeze(e.upRight), Object.freeze(e.downRight)), e;
|
|
1109
|
-
});
|
|
1110
|
-
})(kr);
|
|
1111
|
-
var Xr = kr.exports;
|
|
1112
|
-
const X = /* @__PURE__ */ lr(Xr);
|
|
1113
|
-
let Me = (p = 21) => crypto.getRandomValues(new Uint8Array(p)).reduce((e, a) => (a &= 63, a < 36 ? e += a.toString(36) : a < 62 ? e += (a - 26).toString(36).toUpperCase() : a > 62 ? e += "-" : e += "_", e), "");
|
|
1114
|
-
const ce = {
|
|
628
|
+
process.env.NODE_ENV === "production" ? or.exports = Gr() : or.exports = Jr();
|
|
629
|
+
var Zr = or.exports, Kr = Object.defineProperty, Qr = (h, e, s) => e in h ? Kr(h, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : h[e] = s, x = (h, e, s) => (Qr(h, typeof e != "symbol" ? e + "" : e, s), s);
|
|
630
|
+
let ze = (h = 21) => crypto.getRandomValues(new Uint8Array(h)).reduce((e, s) => (s &= 63, s < 36 ? e += s.toString(36) : s < 62 ? e += (s - 26).toString(36).toUpperCase() : s > 62 ? e += "-" : e += "_", e), "");
|
|
631
|
+
const ge = {
|
|
1115
632
|
strokeType: "plain",
|
|
1116
633
|
strokeColor: "black",
|
|
1117
634
|
strokeWidth: 1,
|
|
1118
635
|
head: "none",
|
|
1119
636
|
tail: "none"
|
|
1120
|
-
},
|
|
637
|
+
}, gr = {
|
|
1121
638
|
id: 0,
|
|
1122
639
|
type: "Feature",
|
|
1123
640
|
properties: {
|
|
1124
641
|
type: "arrow",
|
|
1125
642
|
style: {
|
|
1126
|
-
...
|
|
643
|
+
...ge
|
|
1127
644
|
}
|
|
1128
645
|
},
|
|
1129
646
|
geometry: {
|
|
@@ -1143,245 +660,280 @@ const ce = {
|
|
|
1143
660
|
// tail: 'arrow-plain',
|
|
1144
661
|
// start: { x: 0, y: 0 },
|
|
1145
662
|
// end: { x: 100, y: 100 }
|
|
1146
|
-
},
|
|
1147
|
-
id:
|
|
663
|
+
}, tn = (h = 0, e = 0, s = 0, i = 0, l = { ...ge }) => ({
|
|
664
|
+
id: ze(),
|
|
1148
665
|
type: "Feature",
|
|
1149
666
|
properties: {
|
|
1150
667
|
type: "arrow",
|
|
1151
668
|
style: {
|
|
1152
|
-
...
|
|
1153
|
-
...
|
|
669
|
+
...ge,
|
|
670
|
+
...l
|
|
1154
671
|
}
|
|
1155
672
|
},
|
|
1156
673
|
geometry: {
|
|
1157
674
|
type: "LineString",
|
|
1158
675
|
coordinates: [
|
|
1159
|
-
[
|
|
1160
|
-
[
|
|
676
|
+
[h, e],
|
|
677
|
+
[s, i]
|
|
1161
678
|
]
|
|
1162
679
|
}
|
|
1163
|
-
}),
|
|
1164
|
-
function
|
|
1165
|
-
return document.createElementNS(
|
|
680
|
+
}), en = "http://www.w3.org/2000/svg";
|
|
681
|
+
function de(h) {
|
|
682
|
+
return document.createElementNS(en, h);
|
|
1166
683
|
}
|
|
1167
|
-
function
|
|
1168
|
-
return
|
|
684
|
+
function Pr(h) {
|
|
685
|
+
return h.geometry.bbox || rn(h), h.geometry.bbox;
|
|
1169
686
|
}
|
|
1170
|
-
function
|
|
1171
|
-
const e =
|
|
687
|
+
function vt(h) {
|
|
688
|
+
const e = Pr(h);
|
|
1172
689
|
return {
|
|
1173
690
|
width: e[2] - e[0],
|
|
1174
691
|
height: e[3] - e[1]
|
|
1175
692
|
};
|
|
1176
693
|
}
|
|
1177
|
-
function yt(
|
|
1178
|
-
const e =
|
|
694
|
+
function yt(h) {
|
|
695
|
+
const e = Pr(h);
|
|
1179
696
|
return { x: e[0], y: e[1] };
|
|
1180
697
|
}
|
|
1181
|
-
function
|
|
1182
|
-
const [e,
|
|
1183
|
-
|
|
698
|
+
function rn(h) {
|
|
699
|
+
const [e, s] = h.geometry.coordinates[0][0], [i, l] = h.geometry.coordinates[0][2];
|
|
700
|
+
h.geometry.bbox = [e, s, i, l];
|
|
1184
701
|
}
|
|
1185
|
-
function
|
|
1186
|
-
|
|
702
|
+
function nn(h, e, s, i, l) {
|
|
703
|
+
h.geometry.bbox = [e, s, e + i, s + l], h.geometry.coordinates = [
|
|
1187
704
|
[
|
|
1188
|
-
[e,
|
|
1189
|
-
[e + i,
|
|
1190
|
-
[e + i,
|
|
1191
|
-
[e,
|
|
1192
|
-
[e,
|
|
705
|
+
[e, s],
|
|
706
|
+
[e + i, s],
|
|
707
|
+
[e + i, s + l],
|
|
708
|
+
[e, s + l],
|
|
709
|
+
[e, s]
|
|
1193
710
|
]
|
|
1194
711
|
];
|
|
1195
712
|
}
|
|
1196
|
-
function
|
|
1197
|
-
const [e,
|
|
1198
|
-
return { x: e, y:
|
|
713
|
+
function fe(h) {
|
|
714
|
+
const [e, s] = h.geometry.coordinates[0];
|
|
715
|
+
return { x: e, y: s };
|
|
1199
716
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const [
|
|
1202
|
-
return { x:
|
|
717
|
+
function Ie(h, e) {
|
|
718
|
+
const [s, i] = h.geometry.coordinates[e === "start" ? 0 : 1];
|
|
719
|
+
return { x: s, y: i };
|
|
1203
720
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const [e,
|
|
1206
|
-
return { x: e, y:
|
|
721
|
+
function $e(h) {
|
|
722
|
+
const [e, s] = h.geometry.coordinates[1];
|
|
723
|
+
return { x: e, y: s };
|
|
1207
724
|
}
|
|
1208
|
-
function Rr(
|
|
1209
|
-
|
|
725
|
+
function Rr(h, e, s) {
|
|
726
|
+
h.geometry.coordinates[0] = [e, s];
|
|
1210
727
|
}
|
|
1211
|
-
function
|
|
1212
|
-
|
|
728
|
+
function Ir(h, e, s) {
|
|
729
|
+
h.geometry.coordinates[1] = [e, s];
|
|
1213
730
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return { start:
|
|
731
|
+
function je(h) {
|
|
732
|
+
return { start: fe(h), end: $e(h) };
|
|
1216
733
|
}
|
|
1217
|
-
function
|
|
1218
|
-
e === "start" ? Rr(
|
|
734
|
+
function Bt(h, e, s, i) {
|
|
735
|
+
e === "start" ? Rr(h, s, i) : Ir(h, s, i);
|
|
1219
736
|
}
|
|
1220
|
-
const
|
|
1221
|
-
function
|
|
1222
|
-
const i = Math.atan2(
|
|
737
|
+
const Lr = (h) => parseInt(h.getAttribute("data-handle-id") || "-1");
|
|
738
|
+
function Le(h, e, s) {
|
|
739
|
+
const i = Math.atan2(h.y - e.y, h.x - e.x);
|
|
1223
740
|
return {
|
|
1224
|
-
x: e.x +
|
|
1225
|
-
y: e.y +
|
|
741
|
+
x: e.x + s * Math.cos(i),
|
|
742
|
+
y: e.y + s * Math.sin(i)
|
|
1226
743
|
};
|
|
1227
744
|
}
|
|
1228
|
-
function
|
|
745
|
+
function sr(h, e) {
|
|
1229
746
|
if (!e)
|
|
1230
|
-
return { x:
|
|
1231
|
-
const
|
|
747
|
+
return { x: h.clientX, y: h.clientY };
|
|
748
|
+
const s = e.getBoundingClientRect();
|
|
1232
749
|
return {
|
|
1233
|
-
x:
|
|
1234
|
-
y:
|
|
750
|
+
x: h.clientX - s.left - e.clientLeft,
|
|
751
|
+
y: h.clientY - s.top - e.clientTop
|
|
1235
752
|
};
|
|
1236
753
|
}
|
|
1237
|
-
|
|
754
|
+
const Ct = (h, e) => ({
|
|
755
|
+
x: h.x - e.x,
|
|
756
|
+
y: h.y - e.y
|
|
757
|
+
}), Wt = (h) => Math.sqrt(h.x * h.x + h.y * h.y), Fr = (h) => ({
|
|
758
|
+
x: -h.x,
|
|
759
|
+
y: -h.y
|
|
760
|
+
}), $r = (h) => {
|
|
761
|
+
const e = Wt(h);
|
|
762
|
+
return e === 0 ? { x: 0, y: 0 } : {
|
|
763
|
+
x: h.x / e,
|
|
764
|
+
y: h.y / e
|
|
765
|
+
};
|
|
766
|
+
}, Ht = (h, e) => ({
|
|
767
|
+
x: h.x + e.x,
|
|
768
|
+
y: h.y + e.y
|
|
769
|
+
}), jr = (h, e) => ({
|
|
770
|
+
x: h.x * e,
|
|
771
|
+
y: h.y * e
|
|
772
|
+
}), Fe = (h, e) => ({
|
|
773
|
+
x: h.x * e.x,
|
|
774
|
+
y: h.y * e.y
|
|
775
|
+
}), st = (h, e) => {
|
|
776
|
+
const s = Math.sin(e), i = Math.cos(e);
|
|
777
|
+
return {
|
|
778
|
+
x: h.x * i - h.y * s,
|
|
779
|
+
y: h.x * s + h.y * i
|
|
780
|
+
};
|
|
781
|
+
}, on = (h, e) => ({
|
|
782
|
+
x: h.x / e,
|
|
783
|
+
y: h.y / e
|
|
784
|
+
}), pr = (h, e) => h.x * e.x + h.y * e.y;
|
|
785
|
+
function Dr(h, e = 5, s = 30) {
|
|
1238
786
|
var i;
|
|
1239
|
-
const { start:
|
|
1240
|
-
return Math.min(
|
|
787
|
+
const { start: l, end: c } = je(h), f = Ct(c, l), p = h.properties.style && h.properties.style.strokeWidth ? (i = h.properties.style) == null ? void 0 : i.strokeWidth : 0;
|
|
788
|
+
return Math.min(s, Math.max(3 * p, Wt(f) * 0.1, e));
|
|
1241
789
|
}
|
|
1242
|
-
function
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
790
|
+
function yr(h, e, s, i) {
|
|
791
|
+
const l = jr(Fr($r(e)), i);
|
|
792
|
+
if (!s || s === "none")
|
|
1245
793
|
return "";
|
|
1246
|
-
const c =
|
|
1247
|
-
return `M ${c.x} ${c.y} L ${
|
|
794
|
+
const c = Ht(h, st(l, Math.PI / 8)), f = Ht(h, st(l, -Math.PI / 8)), p = `${h.x} ${h.y}`;
|
|
795
|
+
return `M ${c.x} ${c.y} L ${p} ${f.x} ${f.y} ${s === "arrow" ? "" : `${c.x} ${c.y}`}`;
|
|
1248
796
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const { start: c, end:
|
|
1251
|
-
E.setAttribute("data-annotation", `${
|
|
1252
|
-
const
|
|
1253
|
-
E.setAttribute("stroke",
|
|
1254
|
-
const
|
|
1255
|
-
E.setAttribute("d",
|
|
797
|
+
function sn(h, e, s, i, l) {
|
|
798
|
+
const { start: c, end: f } = je(h), { tail: p, head: d, strokeColor: v, strokeWidth: y } = h.properties.style || s, _ = Ct(f, c), C = Dr(h, i, l), E = de("path");
|
|
799
|
+
E.setAttribute("data-annotation", `${h.id}`), E.setAttribute("data-annotation-type", "arrow");
|
|
800
|
+
const P = d === "arrow-plain" || p === "arrow";
|
|
801
|
+
E.setAttribute("stroke", v || "none"), E.setAttribute("stroke-width", `${y}`), E.setAttribute("fill", P ? v || "" : "none"), E.setAttribute("stroke-linecap", "round"), E.setAttribute("stroke-linejoin", "round");
|
|
802
|
+
const S = yr(c, Fr(_), p, C), $ = yr(f, _, d, C), L = S + `M ${c.x} ${c.y} ${f.x} ${f.y}` + $;
|
|
803
|
+
E.setAttribute("d", L), e.appendChild(E);
|
|
1256
804
|
}
|
|
1257
|
-
const
|
|
1258
|
-
var
|
|
1259
|
-
|
|
1260
|
-
|
|
805
|
+
const Y = -1, De = "dragging", Me = "dragstart", Vt = "dragend", ar = "select", lr = "unselect", an = "hover", ln = "unhover", hr = "remove", ur = "add", hn = "cancelDrawing", cr = "update", un = "link";
|
|
806
|
+
var cn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
807
|
+
function Mr(h) {
|
|
808
|
+
return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
|
|
809
|
+
}
|
|
810
|
+
var zr = { exports: {} };
|
|
811
|
+
(function(h) {
|
|
812
|
+
var e = Object.prototype.hasOwnProperty, s = "~";
|
|
1261
813
|
function i() {
|
|
1262
814
|
}
|
|
1263
|
-
Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (
|
|
1264
|
-
function
|
|
1265
|
-
this.fn =
|
|
815
|
+
Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (s = !1));
|
|
816
|
+
function l(d, v, y) {
|
|
817
|
+
this.fn = d, this.context = v, this.once = y || !1;
|
|
1266
818
|
}
|
|
1267
|
-
function c(
|
|
1268
|
-
if (typeof
|
|
819
|
+
function c(d, v, y, _, C) {
|
|
820
|
+
if (typeof y != "function")
|
|
1269
821
|
throw new TypeError("The listener must be a function");
|
|
1270
|
-
var
|
|
1271
|
-
return
|
|
822
|
+
var E = new l(y, _ || d, C), P = s ? s + v : v;
|
|
823
|
+
return d._events[P] ? d._events[P].fn ? d._events[P] = [d._events[P], E] : d._events[P].push(E) : (d._events[P] = E, d._eventsCount++), d;
|
|
1272
824
|
}
|
|
1273
|
-
function
|
|
1274
|
-
--
|
|
825
|
+
function f(d, v) {
|
|
826
|
+
--d._eventsCount === 0 ? d._events = new i() : delete d._events[v];
|
|
1275
827
|
}
|
|
1276
|
-
function
|
|
828
|
+
function p() {
|
|
1277
829
|
this._events = new i(), this._eventsCount = 0;
|
|
1278
830
|
}
|
|
1279
|
-
|
|
1280
|
-
var
|
|
831
|
+
p.prototype.eventNames = function() {
|
|
832
|
+
var d = [], v, y;
|
|
1281
833
|
if (this._eventsCount === 0)
|
|
1282
|
-
return
|
|
1283
|
-
for (
|
|
1284
|
-
e.call(
|
|
1285
|
-
return Object.getOwnPropertySymbols ?
|
|
1286
|
-
},
|
|
1287
|
-
var
|
|
1288
|
-
if (!
|
|
834
|
+
return d;
|
|
835
|
+
for (y in v = this._events)
|
|
836
|
+
e.call(v, y) && d.push(s ? y.slice(1) : y);
|
|
837
|
+
return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(v)) : d;
|
|
838
|
+
}, p.prototype.listeners = function(d) {
|
|
839
|
+
var v = s ? s + d : d, y = this._events[v];
|
|
840
|
+
if (!y)
|
|
1289
841
|
return [];
|
|
1290
|
-
if (
|
|
1291
|
-
return [
|
|
1292
|
-
for (var
|
|
1293
|
-
|
|
1294
|
-
return
|
|
1295
|
-
},
|
|
1296
|
-
var
|
|
1297
|
-
return
|
|
1298
|
-
},
|
|
1299
|
-
var P =
|
|
842
|
+
if (y.fn)
|
|
843
|
+
return [y.fn];
|
|
844
|
+
for (var _ = 0, C = y.length, E = new Array(C); _ < C; _++)
|
|
845
|
+
E[_] = y[_].fn;
|
|
846
|
+
return E;
|
|
847
|
+
}, p.prototype.listenerCount = function(d) {
|
|
848
|
+
var v = s ? s + d : d, y = this._events[v];
|
|
849
|
+
return y ? y.fn ? 1 : y.length : 0;
|
|
850
|
+
}, p.prototype.emit = function(d, v, y, _, C, E) {
|
|
851
|
+
var P = s ? s + d : d;
|
|
1300
852
|
if (!this._events[P])
|
|
1301
853
|
return !1;
|
|
1302
|
-
var
|
|
1303
|
-
if (
|
|
1304
|
-
switch (
|
|
854
|
+
var S = this._events[P], $ = arguments.length, L, T;
|
|
855
|
+
if (S.fn) {
|
|
856
|
+
switch (S.once && this.removeListener(d, S.fn, void 0, !0), $) {
|
|
1305
857
|
case 1:
|
|
1306
|
-
return
|
|
858
|
+
return S.fn.call(S.context), !0;
|
|
1307
859
|
case 2:
|
|
1308
|
-
return
|
|
860
|
+
return S.fn.call(S.context, v), !0;
|
|
1309
861
|
case 3:
|
|
1310
|
-
return
|
|
862
|
+
return S.fn.call(S.context, v, y), !0;
|
|
1311
863
|
case 4:
|
|
1312
|
-
return
|
|
864
|
+
return S.fn.call(S.context, v, y, _), !0;
|
|
1313
865
|
case 5:
|
|
1314
|
-
return
|
|
866
|
+
return S.fn.call(S.context, v, y, _, C), !0;
|
|
1315
867
|
case 6:
|
|
1316
|
-
return
|
|
868
|
+
return S.fn.call(S.context, v, y, _, C, E), !0;
|
|
1317
869
|
}
|
|
1318
|
-
for (
|
|
1319
|
-
|
|
1320
|
-
|
|
870
|
+
for (T = 1, L = new Array($ - 1); T < $; T++)
|
|
871
|
+
L[T - 1] = arguments[T];
|
|
872
|
+
S.fn.apply(S.context, L);
|
|
1321
873
|
} else {
|
|
1322
|
-
var
|
|
1323
|
-
for (
|
|
1324
|
-
switch (
|
|
874
|
+
var B = S.length, N;
|
|
875
|
+
for (T = 0; T < B; T++)
|
|
876
|
+
switch (S[T].once && this.removeListener(d, S[T].fn, void 0, !0), $) {
|
|
1325
877
|
case 1:
|
|
1326
|
-
|
|
878
|
+
S[T].fn.call(S[T].context);
|
|
1327
879
|
break;
|
|
1328
880
|
case 2:
|
|
1329
|
-
|
|
881
|
+
S[T].fn.call(S[T].context, v);
|
|
1330
882
|
break;
|
|
1331
883
|
case 3:
|
|
1332
|
-
|
|
884
|
+
S[T].fn.call(S[T].context, v, y);
|
|
1333
885
|
break;
|
|
1334
886
|
case 4:
|
|
1335
|
-
|
|
887
|
+
S[T].fn.call(S[T].context, v, y, _);
|
|
1336
888
|
break;
|
|
1337
889
|
default:
|
|
1338
|
-
if (!
|
|
1339
|
-
for (
|
|
1340
|
-
|
|
1341
|
-
|
|
890
|
+
if (!L)
|
|
891
|
+
for (N = 1, L = new Array($ - 1); N < $; N++)
|
|
892
|
+
L[N - 1] = arguments[N];
|
|
893
|
+
S[T].fn.apply(S[T].context, L);
|
|
1342
894
|
}
|
|
1343
895
|
}
|
|
1344
896
|
return !0;
|
|
1345
|
-
},
|
|
1346
|
-
return c(this,
|
|
1347
|
-
},
|
|
1348
|
-
return c(this,
|
|
1349
|
-
},
|
|
1350
|
-
var
|
|
1351
|
-
if (!this._events[
|
|
897
|
+
}, p.prototype.on = function(d, v, y) {
|
|
898
|
+
return c(this, d, v, y, !1);
|
|
899
|
+
}, p.prototype.once = function(d, v, y) {
|
|
900
|
+
return c(this, d, v, y, !0);
|
|
901
|
+
}, p.prototype.removeListener = function(d, v, y, _) {
|
|
902
|
+
var C = s ? s + d : d;
|
|
903
|
+
if (!this._events[C])
|
|
1352
904
|
return this;
|
|
1353
|
-
if (!
|
|
1354
|
-
return
|
|
1355
|
-
var
|
|
1356
|
-
if (
|
|
1357
|
-
|
|
905
|
+
if (!v)
|
|
906
|
+
return f(this, C), this;
|
|
907
|
+
var E = this._events[C];
|
|
908
|
+
if (E.fn)
|
|
909
|
+
E.fn === v && (!_ || E.once) && (!y || E.context === y) && f(this, C);
|
|
1358
910
|
else {
|
|
1359
|
-
for (var P = 0,
|
|
1360
|
-
(
|
|
1361
|
-
|
|
911
|
+
for (var P = 0, S = [], $ = E.length; P < $; P++)
|
|
912
|
+
(E[P].fn !== v || _ && !E[P].once || y && E[P].context !== y) && S.push(E[P]);
|
|
913
|
+
S.length ? this._events[C] = S.length === 1 ? S[0] : S : f(this, C);
|
|
1362
914
|
}
|
|
1363
915
|
return this;
|
|
1364
|
-
},
|
|
1365
|
-
var
|
|
1366
|
-
return
|
|
1367
|
-
},
|
|
1368
|
-
})(
|
|
1369
|
-
var
|
|
1370
|
-
const
|
|
1371
|
-
class
|
|
1372
|
-
constructor(e,
|
|
1373
|
-
super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId",
|
|
1374
|
-
i.code === 27 && this.selectedId !==
|
|
916
|
+
}, p.prototype.removeAllListeners = function(d) {
|
|
917
|
+
var v;
|
|
918
|
+
return d ? (v = s ? s + d : d, this._events[v] && f(this, v)) : (this._events = new i(), this._eventsCount = 0), this;
|
|
919
|
+
}, p.prototype.off = p.prototype.removeListener, p.prototype.addListener = p.prototype.on, p.prefixed = s, p.EventEmitter = p, h.exports = p;
|
|
920
|
+
})(zr);
|
|
921
|
+
var dn = zr.exports;
|
|
922
|
+
const Nr = /* @__PURE__ */ Mr(dn);
|
|
923
|
+
class Br extends Nr {
|
|
924
|
+
constructor(e, s) {
|
|
925
|
+
super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId", Y), x(this, "hoveredId", Y), x(this, "ogmaOptions"), x(this, "shouldDetect"), x(this, "isDragging"), x(this, "showeditorOnHover"), x(this, "_onKeyUp", (i) => {
|
|
926
|
+
i.code === 27 && this.selectedId !== Y ? this.unselect() : (i.code === 46 || i.code === 8) && this.selectedId !== Y && this._canRemove() && this.remove(this.selectedId);
|
|
1375
927
|
}), x(this, "_onClickMouseMove", (i) => {
|
|
1376
928
|
if (!i.domEvent || this.isDragging || !this.shouldDetect || i.domEvent.type !== "mousemove" && i.domEvent.target && i.domEvent.target.tagName === "a")
|
|
1377
929
|
return;
|
|
1378
|
-
const
|
|
1379
|
-
i.domEvent.type === "mousemove" ? c ? this.hover(c.id) : this.hoveredId !==
|
|
930
|
+
const l = this.ogma.view.screenToGraphCoordinates(i), c = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(l, 0) : void 0;
|
|
931
|
+
i.domEvent.type === "mousemove" ? c ? this.hover(c.id) : this.hoveredId !== Y && this.unhover() : c ? this.select(c.id) : this.selectedId !== Y && this.unselect();
|
|
1380
932
|
}), this.ogma = e, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.showeditorOnHover = !0, this.ogmaOptions = e.getOptions(), e.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp).on("frame", () => {
|
|
1381
933
|
this.refreshEditor(), this.refreshDrawing();
|
|
1382
934
|
}), this.layer = e.layers.addSVGLayer({
|
|
1383
935
|
draw: (i) => this.draw(i)
|
|
1384
|
-
}), this.layer.moveToTop(), this.editor = e.layers.addLayer(
|
|
936
|
+
}), this.layer.moveToTop(), this.editor = e.layers.addLayer(s), this.editor.hide();
|
|
1385
937
|
}
|
|
1386
938
|
_canRemove() {
|
|
1387
939
|
return !0;
|
|
@@ -1392,52 +944,52 @@ class $r extends jr {
|
|
|
1392
944
|
* @returns the added annotation
|
|
1393
945
|
*/
|
|
1394
946
|
add(e) {
|
|
1395
|
-
const
|
|
1396
|
-
id: e.id === void 0 ?
|
|
947
|
+
const s = this.getDefaultOptions(), i = Object.assign(e, {
|
|
948
|
+
id: e.id === void 0 ? ze() : e.id,
|
|
1397
949
|
type: e.type,
|
|
1398
950
|
properties: {
|
|
1399
|
-
...
|
|
951
|
+
...s.properties,
|
|
1400
952
|
...e.properties || {},
|
|
1401
953
|
// styles need to be merged
|
|
1402
|
-
style: { ...
|
|
954
|
+
style: { ...s.properties.style, ...e.properties.style || {} }
|
|
1403
955
|
},
|
|
1404
956
|
geometry: {
|
|
1405
|
-
...
|
|
957
|
+
...s.geometry,
|
|
1406
958
|
...e.geometry
|
|
1407
959
|
}
|
|
1408
960
|
});
|
|
1409
|
-
return this.elements.push(i), this.layer.refresh(), this.emit(
|
|
961
|
+
return this.elements.push(i), this.layer.refresh(), this.emit(ur, i), i;
|
|
1410
962
|
}
|
|
1411
|
-
updateStyle(e,
|
|
963
|
+
updateStyle(e, s) {
|
|
1412
964
|
this.updateAnnotation(e, {
|
|
1413
965
|
properties: {
|
|
1414
|
-
style:
|
|
966
|
+
style: s
|
|
1415
967
|
}
|
|
1416
968
|
});
|
|
1417
969
|
}
|
|
1418
|
-
updateGeometry(e,
|
|
970
|
+
updateGeometry(e, s) {
|
|
1419
971
|
this.updateAnnotation(e, {
|
|
1420
|
-
geometry:
|
|
972
|
+
geometry: s
|
|
1421
973
|
});
|
|
1422
974
|
}
|
|
1423
975
|
/**
|
|
1424
976
|
* @method update
|
|
1425
977
|
* Updates an annotation (position, color etc)
|
|
1426
978
|
* @param id Id of the annotation to update
|
|
1427
|
-
* @param
|
|
979
|
+
* @param element params of the annotation
|
|
1428
980
|
*/
|
|
1429
|
-
update(e,
|
|
981
|
+
update(e, s) {
|
|
1430
982
|
const i = this.getById(e);
|
|
1431
|
-
this.updateAnnotation(i,
|
|
983
|
+
this.updateAnnotation(i, s);
|
|
1432
984
|
}
|
|
1433
|
-
updateAnnotation(e,
|
|
985
|
+
updateAnnotation(e, s) {
|
|
1434
986
|
if (!e)
|
|
1435
987
|
return;
|
|
1436
988
|
const i = e.id;
|
|
1437
|
-
Object.keys(
|
|
1438
|
-
if (
|
|
1439
|
-
if (
|
|
1440
|
-
const c =
|
|
989
|
+
Object.keys(s).forEach((l) => {
|
|
990
|
+
if (l !== "id")
|
|
991
|
+
if (l === "properties") {
|
|
992
|
+
const c = s.properties || { style: {} };
|
|
1441
993
|
e.properties = {
|
|
1442
994
|
...e.properties || {},
|
|
1443
995
|
...c || {},
|
|
@@ -1447,18 +999,18 @@ class $r extends jr {
|
|
|
1447
999
|
}
|
|
1448
1000
|
};
|
|
1449
1001
|
} else
|
|
1450
|
-
|
|
1002
|
+
l === "geometry" ? e.geometry = {
|
|
1451
1003
|
...e.geometry,
|
|
1452
|
-
...
|
|
1453
|
-
} : e[
|
|
1004
|
+
...s.geometry
|
|
1005
|
+
} : e[l] = s[l];
|
|
1454
1006
|
}), i === this.selectedId && this.refreshEditor(), this.layer.refresh();
|
|
1455
1007
|
}
|
|
1456
1008
|
getById(e) {
|
|
1457
|
-
const
|
|
1009
|
+
const s = Number(e);
|
|
1458
1010
|
for (let i = 0; i < this.elements.length; i++) {
|
|
1459
|
-
const
|
|
1460
|
-
if (!(
|
|
1461
|
-
return
|
|
1011
|
+
const l = this.elements[i];
|
|
1012
|
+
if (!(l.id !== e && l.id !== s))
|
|
1013
|
+
return l;
|
|
1462
1014
|
}
|
|
1463
1015
|
}
|
|
1464
1016
|
/**
|
|
@@ -1467,23 +1019,23 @@ class $r extends jr {
|
|
|
1467
1019
|
* Select element, show editor, disable Ogma dragging and fire event
|
|
1468
1020
|
*/
|
|
1469
1021
|
select(e) {
|
|
1470
|
-
const
|
|
1471
|
-
|
|
1022
|
+
const s = this.getById(e);
|
|
1023
|
+
s && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, s));
|
|
1472
1024
|
}
|
|
1473
1025
|
hover(e) {
|
|
1474
|
-
const
|
|
1475
|
-
|
|
1026
|
+
const s = this.getById(e);
|
|
1027
|
+
s && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(an, s));
|
|
1476
1028
|
}
|
|
1477
1029
|
getSelectedFeature() {
|
|
1478
|
-
return this.selectedId ===
|
|
1030
|
+
return this.selectedId === Y ? null : this.getById(this.selectedId);
|
|
1479
1031
|
}
|
|
1480
1032
|
unselect() {
|
|
1481
1033
|
const e = this.getById(this.selectedId);
|
|
1482
|
-
return e && this.emit(
|
|
1034
|
+
return e && this.emit(lr, e), this.selectedId = Y, this.hoveredId === Y && this.editor.hide(), this.layer.refresh(), this;
|
|
1483
1035
|
}
|
|
1484
1036
|
unhover() {
|
|
1485
1037
|
const e = this.getById(this.hoveredId);
|
|
1486
|
-
return this.emit(
|
|
1038
|
+
return this.emit(ln, e), this.hoveredId = Y, this.selectedId === Y && this.editor.hide(), this.layer.refresh(), this;
|
|
1487
1039
|
}
|
|
1488
1040
|
/**
|
|
1489
1041
|
* @method remove
|
|
@@ -1491,8 +1043,8 @@ class $r extends jr {
|
|
|
1491
1043
|
* Removes annotation with the given id
|
|
1492
1044
|
*/
|
|
1493
1045
|
remove(e) {
|
|
1494
|
-
const
|
|
1495
|
-
e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e),
|
|
1046
|
+
const s = this.getById(e);
|
|
1047
|
+
e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), s && this.emit(hr, s), this.layer.refresh();
|
|
1496
1048
|
}
|
|
1497
1049
|
/**
|
|
1498
1050
|
* @method disableDragging
|
|
@@ -1542,39 +1094,42 @@ class $r extends jr {
|
|
|
1542
1094
|
this.ogma.events.off(this._onClickMouseMove).off(this._onKeyUp), this.layer.destroy();
|
|
1543
1095
|
}
|
|
1544
1096
|
}
|
|
1545
|
-
const
|
|
1546
|
-
class
|
|
1547
|
-
constructor(e,
|
|
1097
|
+
const vr = "handle-line", mr = "handle-start", br = "handle-end";
|
|
1098
|
+
class fn extends Br {
|
|
1099
|
+
constructor(e, s = {}) {
|
|
1548
1100
|
super(
|
|
1549
1101
|
e,
|
|
1550
1102
|
`
|
|
1551
1103
|
<div class="arrow-handle">
|
|
1552
|
-
<div id="${
|
|
1553
|
-
<div id="${
|
|
1554
|
-
<div id="${
|
|
1104
|
+
<div id="${vr}" data-handle-id="0" class="handle line"></div>
|
|
1105
|
+
<div id="${mr}" data-handle-id="1" class="handle point"></div>
|
|
1106
|
+
<div id="${br}" data-handle-id="2" class="handle point"></div>
|
|
1555
1107
|
</div>
|
|
1556
1108
|
`
|
|
1557
|
-
), x(this, "draggedHandle",
|
|
1558
|
-
const
|
|
1559
|
-
if (!
|
|
1109
|
+
), x(this, "draggedHandle", Y), x(this, "start", { x: 0, y: 0 }), x(this, "end", { x: 0, y: 0 }), x(this, "arrow", { ...gr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "minArrowHeight", 0), x(this, "maxArrowHeight", 0), x(this, "handles", []), x(this, "onHandleMouseDown", (i) => {
|
|
1110
|
+
const l = this.getById(this.selectedId) || this.getById(this.hoveredId);
|
|
1111
|
+
if (!l)
|
|
1560
1112
|
return;
|
|
1561
|
-
const { x: c, y:
|
|
1562
|
-
this.startDragging(
|
|
1113
|
+
const { x: c, y: f } = sr(i, this.ogma.getContainer());
|
|
1114
|
+
this.startDragging(l, c, f), this.draggedHandle = Lr(i.target);
|
|
1563
1115
|
}), x(this, "onMouseUp", () => {
|
|
1564
|
-
this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle =
|
|
1116
|
+
this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y, this.emit(Vt, this.arrow));
|
|
1565
1117
|
}), x(this, "onMouseMove", (i) => {
|
|
1566
|
-
if (!this.isDragging || this.draggedHandle ===
|
|
1118
|
+
if (!this.isDragging || this.draggedHandle === Y)
|
|
1567
1119
|
return;
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1120
|
+
const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: f, y: p } = st(
|
|
1121
|
+
on(
|
|
1122
|
+
{ x: i.clientX - this.startX, y: i.clientY - this.startY },
|
|
1123
|
+
this.ogma.view.getZoom()
|
|
1124
|
+
),
|
|
1125
|
+
c
|
|
1126
|
+
), d = l.id === vr, v = l.id === mr, y = l.id === br;
|
|
1127
|
+
(d || v) && Rr(this.arrow, this.start.x + f, this.start.y + p), (d || y) && Ir(this.arrow, this.end.x + f, this.end.y + p), this.emit(
|
|
1128
|
+
De,
|
|
1574
1129
|
this.arrow,
|
|
1575
|
-
|
|
1130
|
+
d ? "line" : v ? "start" : "end"
|
|
1576
1131
|
), this.refreshEditor(), this.layer.refresh();
|
|
1577
|
-
}), this.minArrowHeight =
|
|
1132
|
+
}), this.minArrowHeight = s.minArrowHeight || 0, this.maxArrowHeight = s.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
|
|
1578
1133
|
this.editor.element.querySelectorAll(".arrow-handle>.handle")
|
|
1579
1134
|
), this.handles.forEach(
|
|
1580
1135
|
(i) => i.addEventListener("mousedown", this.onHandleMouseDown)
|
|
@@ -1586,55 +1141,56 @@ class on extends $r {
|
|
|
1586
1141
|
* @param y
|
|
1587
1142
|
* @param arrow
|
|
1588
1143
|
*/
|
|
1589
|
-
startDrawing(e,
|
|
1590
|
-
var
|
|
1144
|
+
startDrawing(e, s, i = tn(e, s, e, s, ge)) {
|
|
1145
|
+
var l;
|
|
1591
1146
|
this.disableDragging(), this.add(i), this.hoveredId = i.id;
|
|
1592
|
-
const c = this.ogma.view.graphToScreenCoordinates({ x: e, y:
|
|
1147
|
+
const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: s }), f = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
|
|
1593
1148
|
left: 0,
|
|
1594
1149
|
top: 0
|
|
1595
1150
|
};
|
|
1596
1151
|
this.startDragging(
|
|
1597
1152
|
this.getById(i.id),
|
|
1598
|
-
c.x + (
|
|
1599
|
-
c.y +
|
|
1153
|
+
c.x + (f == null ? void 0 : f.left),
|
|
1154
|
+
c.y + f.top
|
|
1600
1155
|
), this.draggedHandle = 2;
|
|
1601
1156
|
}
|
|
1602
1157
|
cancelDrawing() {
|
|
1603
|
-
this.isDragging && (this.remove(this.arrow.id), this.emit(
|
|
1158
|
+
this.isDragging && (this.remove(this.arrow.id), this.emit(Vt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y);
|
|
1604
1159
|
}
|
|
1605
|
-
startDragging(e,
|
|
1606
|
-
this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX =
|
|
1160
|
+
startDragging(e, s, i) {
|
|
1161
|
+
this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = s, this.startY = i, this.start = fe(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(Me, this.arrow), this.isDragging = !0;
|
|
1607
1162
|
}
|
|
1608
|
-
detect(e,
|
|
1163
|
+
detect(e, s = 0) {
|
|
1609
1164
|
return this.elements.find((i) => {
|
|
1610
|
-
const { start:
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1165
|
+
const { start: l, end: c } = je(i), f = Ct(e, {
|
|
1166
|
+
x: (l.x + c.x) / 2,
|
|
1167
|
+
y: (l.y + c.y) / 2
|
|
1168
|
+
}), p = Ct(c, l), d = Wt(p), v = $r(p), y = Dr(i);
|
|
1169
|
+
return Math.abs(pr(v, f)) < d / 2 + s && Math.abs(pr(st(v, Math.PI / 2), f)) < y / 2 + s;
|
|
1614
1170
|
});
|
|
1615
1171
|
}
|
|
1616
1172
|
refreshEditor() {
|
|
1617
1173
|
if (+this.selectedId < 0 && +this.hoveredId < 0)
|
|
1618
1174
|
return;
|
|
1619
|
-
const e = this.selectedId !==
|
|
1175
|
+
const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId), s = je(e), i = this.ogma.view.graphToScreenCoordinates(s.start), l = this.ogma.view.graphToScreenCoordinates(s.end), [c, f, p] = Array.prototype.slice.call(
|
|
1620
1176
|
this.editor.element.querySelectorAll(".handle")
|
|
1621
1177
|
);
|
|
1622
|
-
|
|
1623
|
-
const
|
|
1624
|
-
x: (
|
|
1625
|
-
y: (
|
|
1626
|
-
},
|
|
1627
|
-
|
|
1178
|
+
f.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, p.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
|
|
1179
|
+
const d = {
|
|
1180
|
+
x: (l.x + i.x) / 2,
|
|
1181
|
+
y: (l.y + i.y) / 2
|
|
1182
|
+
}, v = Ct(l, i), y = jr(v, 1 / Wt(v)), _ = Math.atan2(y.y, y.x);
|
|
1183
|
+
c.style.width = `${Wt(v)}px`, c.style.left = `${d.x}px`, c.style.top = `${d.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${_}rad)`;
|
|
1628
1184
|
}
|
|
1629
1185
|
getDefaultOptions() {
|
|
1630
|
-
return
|
|
1186
|
+
return gr;
|
|
1631
1187
|
}
|
|
1632
1188
|
draw(e) {
|
|
1633
1189
|
e.innerHTML = "";
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
(
|
|
1637
|
-
), e.appendChild(
|
|
1190
|
+
const s = de("g"), i = this.ogma.view.getAngle();
|
|
1191
|
+
s.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
|
|
1192
|
+
(l) => sn(l, s, ge, this.minArrowHeight, this.maxArrowHeight)
|
|
1193
|
+
), e.appendChild(s);
|
|
1638
1194
|
}
|
|
1639
1195
|
refreshDrawing() {
|
|
1640
1196
|
const e = this.ogma.view.getAngle();
|
|
@@ -1647,7 +1203,7 @@ class on extends $r {
|
|
|
1647
1203
|
super.destroy(), document.removeEventListener("mousemove", this.onMouseMove, !0), document.removeEventListener("mouseup", this.onMouseUp);
|
|
1648
1204
|
}
|
|
1649
1205
|
}
|
|
1650
|
-
const
|
|
1206
|
+
const Ut = {
|
|
1651
1207
|
font: "sans-serif",
|
|
1652
1208
|
fontSize: 12,
|
|
1653
1209
|
color: "black",
|
|
@@ -1655,13 +1211,13 @@ const Ht = {
|
|
|
1655
1211
|
strokeWidth: 1,
|
|
1656
1212
|
strokeColor: "#000",
|
|
1657
1213
|
strokeType: "plain"
|
|
1658
|
-
},
|
|
1214
|
+
}, rr = {
|
|
1659
1215
|
id: 0,
|
|
1660
1216
|
type: "Feature",
|
|
1661
1217
|
properties: {
|
|
1662
1218
|
type: "text",
|
|
1663
1219
|
content: "",
|
|
1664
|
-
style: { ...
|
|
1220
|
+
style: { ...Ut }
|
|
1665
1221
|
},
|
|
1666
1222
|
geometry: {
|
|
1667
1223
|
type: "Polygon",
|
|
@@ -1677,126 +1233,126 @@ const Ht = {
|
|
|
1677
1233
|
}
|
|
1678
1234
|
// position: { x: 0, y: 0 },
|
|
1679
1235
|
// size: { width: 100, height: 50 }
|
|
1680
|
-
},
|
|
1236
|
+
}, wr = {
|
|
1681
1237
|
handleSize: 3.5,
|
|
1682
1238
|
placeholder: "Your text..."
|
|
1683
|
-
},
|
|
1684
|
-
id:
|
|
1239
|
+
}, gn = (h = 0, e = 0, s = 100, i = 50, l = "", c = { ...Ut }) => ({
|
|
1240
|
+
id: ze(),
|
|
1685
1241
|
type: "Feature",
|
|
1686
1242
|
properties: {
|
|
1687
1243
|
type: "text",
|
|
1688
|
-
content:
|
|
1689
|
-
style: { ...
|
|
1244
|
+
content: l,
|
|
1245
|
+
style: { ...Ut, ...c }
|
|
1690
1246
|
},
|
|
1691
1247
|
geometry: {
|
|
1692
1248
|
type: "Polygon",
|
|
1693
1249
|
coordinates: [
|
|
1694
1250
|
[
|
|
1695
|
-
[
|
|
1696
|
-
[
|
|
1697
|
-
[
|
|
1698
|
-
[
|
|
1699
|
-
[
|
|
1251
|
+
[h, e],
|
|
1252
|
+
[h + s, e],
|
|
1253
|
+
[h + s, e + i],
|
|
1254
|
+
[h, e + i],
|
|
1255
|
+
[h, e]
|
|
1700
1256
|
]
|
|
1701
1257
|
]
|
|
1702
1258
|
}
|
|
1703
1259
|
});
|
|
1704
|
-
var
|
|
1705
|
-
(function(
|
|
1706
|
-
(function(
|
|
1707
|
-
|
|
1708
|
-
})(
|
|
1709
|
-
var
|
|
1710
|
-
for (var
|
|
1711
|
-
|
|
1260
|
+
var Hr = { exports: {} };
|
|
1261
|
+
(function(h, e) {
|
|
1262
|
+
(function(s, i) {
|
|
1263
|
+
h.exports = i();
|
|
1264
|
+
})(cn, () => (() => {
|
|
1265
|
+
var s = { d: (r, n) => {
|
|
1266
|
+
for (var a in n)
|
|
1267
|
+
s.o(n, a) && !s.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
|
|
1712
1268
|
}, o: (r, n) => Object.prototype.hasOwnProperty.call(r, n) }, i = {};
|
|
1713
|
-
function
|
|
1714
|
-
return
|
|
1269
|
+
function l(r) {
|
|
1270
|
+
return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
1715
1271
|
return typeof n;
|
|
1716
1272
|
} : function(n) {
|
|
1717
1273
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1718
|
-
},
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/,
|
|
1722
|
-
function
|
|
1723
|
-
var n = "",
|
|
1724
|
-
return
|
|
1725
|
-
}
|
|
1726
|
-
var
|
|
1727
|
-
function
|
|
1728
|
-
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
1729
|
-
n.family = (
|
|
1730
|
-
var t =
|
|
1731
|
-
|
|
1732
|
-
var o = parseFloat(
|
|
1733
|
-
if (o !== "normal" && o !== "inherit" && o ?
|
|
1274
|
+
}, l(r);
|
|
1275
|
+
}
|
|
1276
|
+
s.d(i, { default: () => Ke });
|
|
1277
|
+
var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, f = /\bsmall-caps\b/, p = /\b(?:italic|oblique)\b/, d = /\bbold(?:er)?\b/, v = 13.3333333, y = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
|
|
1278
|
+
function _(r) {
|
|
1279
|
+
var n = "", a = this;
|
|
1280
|
+
return a.style && a.style !== "normal" && (n += a.style), a.variant && a.variant !== "normal" && (n += (n ? " " : "") + a.variant), a.weight && a.weight !== "normal" && (n += (n ? " " : "") + a.weight), a.size && (n += (n ? " " : "") + a.size + "px", a.height !== a.size && (n += "/" + a.height + "px")), a.family && (n += (n ? " " : "") + a.family), r && (n += "::" + a.baseline), r && (n += "::" + a.color), n;
|
|
1281
|
+
}
|
|
1282
|
+
var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: _, valueOf: _ };
|
|
1283
|
+
function E(r) {
|
|
1284
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = c.exec(r);
|
|
1285
|
+
n.family = (a[6] || "").trim();
|
|
1286
|
+
var t = y[a[2]] || parseFloat(a[2]);
|
|
1287
|
+
a[3] === "%" ? t *= 0.16 : a[3] === "em" ? t *= 16 : a[3] === "pt" && (t *= v), n.size = t;
|
|
1288
|
+
var o = parseFloat(a[4]);
|
|
1289
|
+
if (o !== "normal" && o !== "inherit" && o ? a[5] && a[5] !== "em" ? a[5] === "pt" ? n.height = o * v : a[5] === "%" ? n.height = 0.01 * t : n.height = o : n.height = o * t : n.height = Math.round(t * (7 / 6)), f.test(a[1]) && (n.variant = "small-caps"), p.test(a[1]) && (n.style = "italic"), d.test(a[1]))
|
|
1734
1290
|
n.weight = "bold";
|
|
1735
1291
|
else {
|
|
1736
|
-
var u = parseInt(/\b(\d+)\b/.exec(
|
|
1292
|
+
var u = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
|
|
1737
1293
|
u >= 100 && u !== 400 && (n.weight = u);
|
|
1738
1294
|
}
|
|
1739
1295
|
return n;
|
|
1740
1296
|
}
|
|
1741
1297
|
function P() {
|
|
1742
|
-
var r, n,
|
|
1298
|
+
var r, n, a, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = 14, g = 12, m = null, w = null, b = "";
|
|
1743
1299
|
if (t && t.nodeType) {
|
|
1744
|
-
var
|
|
1745
|
-
r =
|
|
1300
|
+
var A = t && (t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView), R = A.getComputedStyle(t, null);
|
|
1301
|
+
r = R.getPropertyValue("font-family") || "", g = parseFloat(R.getPropertyValue("font-size")), u = R.getPropertyValue("line-height"), m = R.getPropertyValue("font-weight"), w = R.getPropertyValue("font-style"), b = R.getPropertyValue("font-variant") || "";
|
|
1746
1302
|
} else if (typeof t == "string") {
|
|
1747
|
-
var
|
|
1748
|
-
r =
|
|
1303
|
+
var k = E(t);
|
|
1304
|
+
r = k.family, g = k.size, u = k.height, b = k.variant, w = k.style, m = k.weight;
|
|
1749
1305
|
} else
|
|
1750
|
-
|
|
1751
|
-
o.size && o.size < 3 && (
|
|
1752
|
-
var
|
|
1753
|
-
return
|
|
1306
|
+
l(t) === "object" && (r = t.family, g = t.size, u = t.height, b = t.variant, m = t.weight, w = t.style, n = t.baseline, a = t.color);
|
|
1307
|
+
o.size && o.size < 3 && (g *= o.size), u = u !== "normal" && u ? parseFloat(u) : g * (7 / 6), o.height && o.height < 3 && (u *= o.height);
|
|
1308
|
+
var O = Object.create(C);
|
|
1309
|
+
return O.family = o.family || r || "sans-serif", O.height = u ?? 14, O.size = g ?? 12, O.variant = o.variant || b || "", O.style = o.style || w || "", O.weight = o.weight || m || "", O.baseline = n || 0, o.baseline != null && (O.baseline = o.baseline), O.color = o.color || a || "", O.id = _.call(O, !0), O;
|
|
1754
1310
|
}
|
|
1755
|
-
const
|
|
1756
|
-
var
|
|
1311
|
+
const S = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
|
|
1312
|
+
var $, L = function(r) {
|
|
1757
1313
|
var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || r && r.createElement("canvas");
|
|
1758
1314
|
if (n && n.getContext) {
|
|
1759
|
-
var
|
|
1760
|
-
if (
|
|
1315
|
+
var a = n.getContext("2d");
|
|
1316
|
+
if (a && typeof a.measureText == "function")
|
|
1761
1317
|
return function(t, o) {
|
|
1762
|
-
return
|
|
1318
|
+
return a.font = String(o), a.measureText(t).width;
|
|
1763
1319
|
};
|
|
1764
1320
|
}
|
|
1765
|
-
}(typeof document < "u" ? document : null) || (
|
|
1766
|
-
if (
|
|
1767
|
-
var
|
|
1768
|
-
|
|
1321
|
+
}(typeof document < "u" ? document : null) || ($ = {}, function(r, n) {
|
|
1322
|
+
if (!$[n]) {
|
|
1323
|
+
var a = P(n);
|
|
1324
|
+
$[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
|
|
1769
1325
|
}
|
|
1770
|
-
return r.length *
|
|
1771
|
-
}),
|
|
1772
|
-
function
|
|
1773
|
-
var t = Object.assign({},
|
|
1326
|
+
return r.length * $[n].size;
|
|
1327
|
+
}), T = {}, B = { trim: !0, collapse: !0 };
|
|
1328
|
+
function N(r, n, a) {
|
|
1329
|
+
var t = Object.assign({}, B, a), o = String(r);
|
|
1774
1330
|
if (!o)
|
|
1775
1331
|
return 0;
|
|
1776
|
-
if (o in
|
|
1332
|
+
if (o in S) {
|
|
1777
1333
|
var u = n.id + "/" + o;
|
|
1778
|
-
return u in
|
|
1334
|
+
return u in T || (T[u] = L("_".concat(o, "_"), n) - L("__", n)), T[u];
|
|
1779
1335
|
}
|
|
1780
|
-
return t.trim && t.collapse ? t.trim ? o = o.trim() : t.collapse && (o = o.replace(/\s+/g, " ")) : o = o.replace(/\n/g, " "),
|
|
1336
|
+
return t.trim && t.collapse ? t.trim ? o = o.trim() : t.collapse && (o = o.replace(/\s+/g, " ")) : o = o.replace(/\n/g, " "), L(o, n) + n.size * (r.tracking || 0);
|
|
1781
1337
|
}
|
|
1782
|
-
function
|
|
1783
|
-
return
|
|
1338
|
+
function it(r) {
|
|
1339
|
+
return it = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
1784
1340
|
return typeof n;
|
|
1785
1341
|
} : function(n) {
|
|
1786
1342
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1787
|
-
},
|
|
1343
|
+
}, it(r);
|
|
1788
1344
|
}
|
|
1789
1345
|
function xt(r, n) {
|
|
1790
1346
|
if (typeof n != "function" && n !== null)
|
|
1791
1347
|
throw new TypeError("Super expression must either be null or a function");
|
|
1792
|
-
r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n &&
|
|
1348
|
+
r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n && qt(r, n);
|
|
1793
1349
|
}
|
|
1794
|
-
function
|
|
1795
|
-
return
|
|
1796
|
-
return
|
|
1797
|
-
},
|
|
1350
|
+
function qt(r, n) {
|
|
1351
|
+
return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, t) {
|
|
1352
|
+
return a.__proto__ = t, a;
|
|
1353
|
+
}, qt(r, n);
|
|
1798
1354
|
}
|
|
1799
|
-
function
|
|
1355
|
+
function Yt(r) {
|
|
1800
1356
|
var n = function() {
|
|
1801
1357
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
1802
1358
|
return !1;
|
|
@@ -1810,62 +1366,62 @@ var Mr = { exports: {} };
|
|
|
1810
1366
|
}
|
|
1811
1367
|
}();
|
|
1812
1368
|
return function() {
|
|
1813
|
-
var
|
|
1369
|
+
var a, t = Ot(r);
|
|
1814
1370
|
if (n) {
|
|
1815
|
-
var o =
|
|
1816
|
-
|
|
1371
|
+
var o = Ot(this).constructor;
|
|
1372
|
+
a = Reflect.construct(t, arguments, o);
|
|
1817
1373
|
} else
|
|
1818
|
-
|
|
1819
|
-
return
|
|
1374
|
+
a = t.apply(this, arguments);
|
|
1375
|
+
return pe(this, a);
|
|
1820
1376
|
};
|
|
1821
1377
|
}
|
|
1822
|
-
function
|
|
1823
|
-
if (n && (
|
|
1378
|
+
function pe(r, n) {
|
|
1379
|
+
if (n && (it(n) === "object" || typeof n == "function"))
|
|
1824
1380
|
return n;
|
|
1825
1381
|
if (n !== void 0)
|
|
1826
1382
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1827
|
-
return function(
|
|
1828
|
-
if (
|
|
1383
|
+
return function(a) {
|
|
1384
|
+
if (a === void 0)
|
|
1829
1385
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1830
|
-
return
|
|
1386
|
+
return a;
|
|
1831
1387
|
}(r);
|
|
1832
1388
|
}
|
|
1833
|
-
function
|
|
1834
|
-
return
|
|
1389
|
+
function Ot(r) {
|
|
1390
|
+
return Ot = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
|
|
1835
1391
|
return n.__proto__ || Object.getPrototypeOf(n);
|
|
1836
|
-
},
|
|
1392
|
+
}, Ot(r);
|
|
1837
1393
|
}
|
|
1838
|
-
function
|
|
1394
|
+
function Pt(r, n) {
|
|
1839
1395
|
if (!(r instanceof n))
|
|
1840
1396
|
throw new TypeError("Cannot call a class as a function");
|
|
1841
1397
|
}
|
|
1842
|
-
function
|
|
1843
|
-
for (var
|
|
1844
|
-
var t = n[
|
|
1845
|
-
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u,
|
|
1846
|
-
if (
|
|
1398
|
+
function Xt(r, n) {
|
|
1399
|
+
for (var a = 0; a < n.length; a++) {
|
|
1400
|
+
var t = n[a];
|
|
1401
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, g) {
|
|
1402
|
+
if (it(u) !== "object" || u === null)
|
|
1847
1403
|
return u;
|
|
1848
|
-
var
|
|
1849
|
-
if (
|
|
1850
|
-
var w =
|
|
1851
|
-
if (
|
|
1404
|
+
var m = u[Symbol.toPrimitive];
|
|
1405
|
+
if (m !== void 0) {
|
|
1406
|
+
var w = m.call(u, g);
|
|
1407
|
+
if (it(w) !== "object")
|
|
1852
1408
|
return w;
|
|
1853
1409
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1854
1410
|
}
|
|
1855
1411
|
return String(u);
|
|
1856
|
-
}(t.key, "string"),
|
|
1412
|
+
}(t.key, "string"), it(o) === "symbol" ? o : String(o)), t);
|
|
1857
1413
|
}
|
|
1858
1414
|
var o;
|
|
1859
1415
|
}
|
|
1860
|
-
function
|
|
1861
|
-
return n &&
|
|
1416
|
+
function tt(r, n, a) {
|
|
1417
|
+
return n && Xt(r.prototype, n), a && Xt(r, a), Object.defineProperty(r, "prototype", { writable: !1 }), r;
|
|
1862
1418
|
}
|
|
1863
|
-
var
|
|
1419
|
+
var D = function() {
|
|
1864
1420
|
function r() {
|
|
1865
1421
|
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
1866
|
-
|
|
1422
|
+
Pt(this, r), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
|
|
1867
1423
|
}
|
|
1868
|
-
return
|
|
1424
|
+
return tt(r, [{ key: "clone", value: function() {
|
|
1869
1425
|
var n = new r(this.value);
|
|
1870
1426
|
return n.value = this.value, n.weight = this.weight, n.style = this.style, n.font = this.font, n.href = this.href, n.sub = this.sub, n.sup = this.sup, n;
|
|
1871
1427
|
} }, { key: "valueOf", value: function() {
|
|
@@ -1874,42 +1430,42 @@ var Mr = { exports: {} };
|
|
|
1874
1430
|
return this.value;
|
|
1875
1431
|
} }]), r;
|
|
1876
1432
|
}(), at = function(r) {
|
|
1877
|
-
xt(
|
|
1878
|
-
var n =
|
|
1879
|
-
function
|
|
1880
|
-
return
|
|
1433
|
+
xt(a, r);
|
|
1434
|
+
var n = Yt(a);
|
|
1435
|
+
function a() {
|
|
1436
|
+
return Pt(this, a), n.apply(this, arguments);
|
|
1881
1437
|
}
|
|
1882
|
-
return
|
|
1883
|
-
}(
|
|
1884
|
-
xt(
|
|
1885
|
-
var n =
|
|
1886
|
-
function
|
|
1887
|
-
return
|
|
1438
|
+
return tt(a);
|
|
1439
|
+
}(D), X = function(r) {
|
|
1440
|
+
xt(a, r);
|
|
1441
|
+
var n = Yt(a);
|
|
1442
|
+
function a() {
|
|
1443
|
+
return Pt(this, a), n.apply(this, arguments);
|
|
1888
1444
|
}
|
|
1889
|
-
return
|
|
1890
|
-
}(
|
|
1891
|
-
xt(
|
|
1892
|
-
var n =
|
|
1893
|
-
function
|
|
1894
|
-
return
|
|
1445
|
+
return tt(a);
|
|
1446
|
+
}(D), ht = function(r) {
|
|
1447
|
+
xt(a, r);
|
|
1448
|
+
var n = Yt(a);
|
|
1449
|
+
function a() {
|
|
1450
|
+
return Pt(this, a), n.apply(this, arguments);
|
|
1895
1451
|
}
|
|
1896
|
-
return
|
|
1897
|
-
}(
|
|
1898
|
-
function
|
|
1452
|
+
return tt(a);
|
|
1453
|
+
}(D), Rt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Gt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, ve = /^(?:[;\xAD%?…]|,(?!\d))/, me = /^[´±°¢£¤$¥\u2212]/;
|
|
1454
|
+
function At(r, n) {
|
|
1899
1455
|
n !== !1 && (r = r.trim());
|
|
1900
|
-
for (var
|
|
1901
|
-
|
|
1902
|
-
var b =
|
|
1903
|
-
if ((
|
|
1904
|
-
var
|
|
1905
|
-
/\u00AD$/.test(
|
|
1456
|
+
for (var a, t, o = [], u = r.charAt(0), g = 0, m = 1, w = r.length; m < w; m++) {
|
|
1457
|
+
a = r.charAt(m), t = r.charAt(m + 1);
|
|
1458
|
+
var b = Rt.test(u), A = Rt.test(a), R = A || b, k = void 0;
|
|
1459
|
+
if ((me.test(a) && !Gt.test(u) || ve.test(u + t) && !Gt.test(a)) && (R = !0), u !== "-" && u !== "‐" && u !== "–" && u !== "—" || ((k = Rt.test(r.charAt(m - 2))) && !A && (R = !1), !k && ye.test(a + t) && (R = !0)), R) {
|
|
1460
|
+
var O = r.slice(g, m);
|
|
1461
|
+
/\u00AD$/.test(O) ? (o.push(new D(O.slice(0, -1))), o.push(new ht())) : (o.push(new D(O)), o.push(new at())), g = m;
|
|
1906
1462
|
}
|
|
1907
|
-
u =
|
|
1463
|
+
u = a;
|
|
1908
1464
|
}
|
|
1909
|
-
return o.push(new
|
|
1465
|
+
return o.push(new D(r.slice(g))), o;
|
|
1910
1466
|
}
|
|
1911
|
-
const
|
|
1912
|
-
var
|
|
1467
|
+
const be = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "", zwj: "", lrm: "", rlm: "", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
|
|
1468
|
+
var Ne = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Jt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Zt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, It = /^<!--(.+?)-->/, Kt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, Et = { b: function(r) {
|
|
1913
1469
|
r.weight = "bold";
|
|
1914
1470
|
}, strong: function(r) {
|
|
1915
1471
|
r.weight = "bold";
|
|
@@ -1935,37 +1491,37 @@ var Mr = { exports: {} };
|
|
|
1935
1491
|
r.sub = !0;
|
|
1936
1492
|
}, sup: function(r) {
|
|
1937
1493
|
r.sup = !0;
|
|
1938
|
-
} },
|
|
1939
|
-
function
|
|
1940
|
-
return r.replace(
|
|
1941
|
-
if (
|
|
1942
|
-
var u =
|
|
1943
|
-
return String.fromCharCode(parseInt(
|
|
1494
|
+
} }, Be = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
|
|
1495
|
+
function Qt(r) {
|
|
1496
|
+
return r.replace(Kt, function(n, a, t, o) {
|
|
1497
|
+
if (a || t) {
|
|
1498
|
+
var u = a ? 10 : 16;
|
|
1499
|
+
return String.fromCharCode(parseInt(a || t, u));
|
|
1944
1500
|
}
|
|
1945
|
-
return o in
|
|
1501
|
+
return o in be ? be[o] : n;
|
|
1946
1502
|
});
|
|
1947
1503
|
}
|
|
1948
|
-
function
|
|
1504
|
+
function He(r) {
|
|
1949
1505
|
return r && r.length > 1 && (r[0] === '"' && r[r.length - 1] === '"' || r[0] === "'" && r[r.length - 1] === "'") ? r.slice(1, -1) : r;
|
|
1950
1506
|
}
|
|
1951
|
-
var
|
|
1952
|
-
function
|
|
1953
|
-
var n,
|
|
1507
|
+
var We = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
|
|
1508
|
+
function Lt(r) {
|
|
1509
|
+
var n, a = {};
|
|
1954
1510
|
if (r) {
|
|
1955
1511
|
do
|
|
1956
|
-
if (n =
|
|
1957
|
-
var t =
|
|
1958
|
-
if (
|
|
1512
|
+
if (n = We.exec(r)) {
|
|
1513
|
+
var t = Qt(He(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
|
|
1514
|
+
if (a[n[1]] = t, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
|
|
1959
1515
|
throw new Error("Attribute error");
|
|
1960
1516
|
}
|
|
1961
1517
|
while (n && r.length);
|
|
1962
1518
|
if (/\S/.test(r))
|
|
1963
1519
|
throw new Error("Attribute error");
|
|
1964
1520
|
}
|
|
1965
|
-
return
|
|
1521
|
+
return a;
|
|
1966
1522
|
}
|
|
1967
|
-
const
|
|
1968
|
-
var
|
|
1523
|
+
const _t = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
|
|
1524
|
+
var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, Ue = /^\\([&{}$%#_])/, Ve = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, te = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, H = { bf: function(r) {
|
|
1969
1525
|
r.weight = "bold";
|
|
1970
1526
|
}, it: function(r) {
|
|
1971
1527
|
r.style = "italic";
|
|
@@ -1980,40 +1536,40 @@ var Mr = { exports: {} };
|
|
|
1980
1536
|
}, _: function(r) {
|
|
1981
1537
|
r.sub = !0;
|
|
1982
1538
|
}, par: function(r) {
|
|
1983
|
-
this.tokens.push(new
|
|
1539
|
+
this.tokens.push(new X(), new X());
|
|
1984
1540
|
}, newline: function(r) {
|
|
1985
|
-
this.tokens.push(new
|
|
1541
|
+
this.tokens.push(new X());
|
|
1986
1542
|
}, url: function(r, n) {
|
|
1987
|
-
this.open_context().href = n, this.add_token(new
|
|
1543
|
+
this.open_context().href = n, this.add_token(new D(n)), this.close_context();
|
|
1988
1544
|
} };
|
|
1989
|
-
|
|
1990
|
-
var
|
|
1991
|
-
function
|
|
1545
|
+
H.textsuperscript = H["^"], H.textsubscript = H._, H.textsl = H.sl, H.mathbf = H.bf, H.mathit = H.it, H.textbf = H.bf, H.textit = H.it, H.textcolor = H.color;
|
|
1546
|
+
var qe = /[\r\n\xA0]+/g;
|
|
1547
|
+
function Ae(r, n) {
|
|
1992
1548
|
r.sup && (r.baseline = 0.45, r.size = 0.7), r.sub && (r.baseline = -0.3, r.size = 0.7);
|
|
1993
|
-
var
|
|
1994
|
-
return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (
|
|
1549
|
+
var a = n;
|
|
1550
|
+
return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = P(n, r)), a;
|
|
1995
1551
|
}
|
|
1996
|
-
function
|
|
1997
|
-
for (var t, o, u = r.width; u +
|
|
1998
|
-
o = (t = r[r.length - 1]).width, t.width >
|
|
1999
|
-
r[r.length - 1] instanceof ht && r.pop(), t = r[r.length - 1] || t || {},
|
|
1552
|
+
function ee(r, n, a) {
|
|
1553
|
+
for (var t, o, u = r.width; u + a.width > n && r.length; )
|
|
1554
|
+
o = (t = r[r.length - 1]).width, t.width > a.width ? (t.value = t.value.slice(0, -1), t.width = N(t, t.font), u += t.width) : r.pop(), u -= o;
|
|
1555
|
+
r[r.length - 1] instanceof ht && r.pop(), t = r[r.length - 1] || t || {}, a.font = P(a.font, t.bold, t.italic, ""), a.href = r.length ? t.href : null, a.rel = r.length ? t.rel : null, a.target = r.length ? t.target : null, r.push(a);
|
|
2000
1556
|
}
|
|
2001
1557
|
function ot(r) {
|
|
2002
1558
|
return Math.round(1e6 * r) / 1e6;
|
|
2003
1559
|
}
|
|
2004
|
-
function
|
|
1560
|
+
function Ee(r) {
|
|
2005
1561
|
return function(n) {
|
|
2006
1562
|
if (Array.isArray(n))
|
|
2007
1563
|
return $t(n);
|
|
2008
1564
|
}(r) || function(n) {
|
|
2009
1565
|
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
|
|
2010
1566
|
return Array.from(n);
|
|
2011
|
-
}(r) || function(n,
|
|
1567
|
+
}(r) || function(n, a) {
|
|
2012
1568
|
if (n) {
|
|
2013
1569
|
if (typeof n == "string")
|
|
2014
|
-
return $t(n,
|
|
1570
|
+
return $t(n, a);
|
|
2015
1571
|
var t = Object.prototype.toString.call(n).slice(8, -1);
|
|
2016
|
-
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? $t(n,
|
|
1572
|
+
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? $t(n, a) : void 0;
|
|
2017
1573
|
}
|
|
2018
1574
|
}(r) || function() {
|
|
2019
1575
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
@@ -2022,128 +1578,128 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2022
1578
|
}
|
|
2023
1579
|
function $t(r, n) {
|
|
2024
1580
|
(n == null || n > r.length) && (n = r.length);
|
|
2025
|
-
for (var
|
|
2026
|
-
t[
|
|
1581
|
+
for (var a = 0, t = new Array(n); a < n; a++)
|
|
1582
|
+
t[a] = r[a];
|
|
2027
1583
|
return t;
|
|
2028
1584
|
}
|
|
2029
|
-
var
|
|
1585
|
+
var _e = { center: "middle", right: "end" }, re = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ne = function(r, n) {
|
|
2030
1586
|
return !r && !n || r === n;
|
|
2031
1587
|
};
|
|
2032
|
-
function
|
|
2033
|
-
var
|
|
1588
|
+
function Ye(r, n) {
|
|
1589
|
+
var a = [], t = n.font(), o = t.size, u = t.family, g = n.align(), m = n.createElement();
|
|
2034
1590
|
if (r.length) {
|
|
2035
|
-
var w = t.height, b = n.valign(),
|
|
2036
|
-
if (
|
|
2037
|
-
var
|
|
2038
|
-
|
|
1591
|
+
var w = t.height, b = n.valign(), A = n.height()(), R = n.width()(0), k = !isFinite(R) && r.length === 1, O = k ? null : n.x(), j = ot(w / o), W = k ? null : ot(w / (1.15 * o + (w - o) / 2));
|
|
1592
|
+
if (re[b] && isFinite(A)) {
|
|
1593
|
+
var M = b === "bottom" ? 1 : 0.5;
|
|
1594
|
+
W += (A * M - w * r.length * M) / o;
|
|
2039
1595
|
}
|
|
2040
|
-
var
|
|
2041
|
-
|
|
2042
|
-
for (var z = [],
|
|
2043
|
-
if (
|
|
2044
|
-
var
|
|
2045
|
-
z.push(
|
|
1596
|
+
var I = g === "justify", U = 0;
|
|
1597
|
+
g === "right" ? U = R : g === "center" && (U = R / 2);
|
|
1598
|
+
for (var z = [], et = "tspan", J = null, V = "", F = function() {
|
|
1599
|
+
if (V) {
|
|
1600
|
+
var Tt = m(et, J, V);
|
|
1601
|
+
z.push(Tt);
|
|
2046
1602
|
}
|
|
2047
|
-
|
|
2048
|
-
},
|
|
2049
|
-
var
|
|
2050
|
-
if (
|
|
1603
|
+
et = "tspan", J = null, V = "";
|
|
1604
|
+
}, nt = 0, rt = r.length; nt < rt; nt++) {
|
|
1605
|
+
var ft = "", mt = "", ct = 0, gt = r[nt];
|
|
1606
|
+
if (gt.length) {
|
|
2051
1607
|
z = [];
|
|
2052
|
-
for (var
|
|
2053
|
-
var
|
|
2054
|
-
|
|
1608
|
+
for (var Mt = 0, le = 0, pt = void 0, Z = 0, Pe = gt.length; Z < Pe; Z++) {
|
|
1609
|
+
var q = gt[Z], K = q.font;
|
|
1610
|
+
q.whitespace && Mt++, le += q.width, Z && !q.tracking && !ct && ne(K.id, ft) && ne(q.class, mt) && ne(pt, q.href) ? V += q.value : (F(), V = q.value, J = { fontFamily: K.family !== u ? K.family : null, fontSize: K.size !== o ? K.size : null, fontWeight: K.weight || null, fontStyle: K.style || null, fontVariant: K.variant !== "normal" && K.variant || null, fill: K.color || null, baselineShift: K.baseline ? 100 * K.baseline + "%" : null, className: q.class || null }, ct && (J.dx = ot(ct), ct = 0), q.tracking && (ct = K.size * q.tracking), q.href && !pt ? (pt = q.href, et = "a", J.href = pt, J.rel = q.rel, J.target = q.target) : pt = null, ft = K.id, mt = q.class);
|
|
2055
1611
|
}
|
|
2056
|
-
if (
|
|
2057
|
-
|
|
1612
|
+
if (F(), k)
|
|
1613
|
+
a.push.apply(a, Ee(z));
|
|
2058
1614
|
else {
|
|
2059
|
-
var Re = null,
|
|
2060
|
-
|
|
1615
|
+
var Re = null, he = nt === rt - 1 || gt[gt.length - 1] instanceof X;
|
|
1616
|
+
I && gt.length > 1 && !he && (Re = ot((R - le) / Mt)), a.push(m.apply(void 0, ["tspan", { wordSpacing: Re, x: O(nt) + U, dy: ot(nt ? j : W) + "em" }].concat(Ee(z))));
|
|
2061
1617
|
}
|
|
2062
1618
|
} else
|
|
2063
|
-
|
|
1619
|
+
a.push(m("tspan", { x: O(nt), dy: ot(nt ? j : W) + "em" }, " "));
|
|
2064
1620
|
}
|
|
2065
1621
|
}
|
|
2066
|
-
return
|
|
1622
|
+
return m.apply(void 0, ["text", { fontFamily: u, fontSize: o, textAnchor: _e[g] || "start" }].concat(a));
|
|
2067
1623
|
}
|
|
2068
|
-
var
|
|
2069
|
-
function
|
|
1624
|
+
var Xe = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
|
|
1625
|
+
function Ge(r, n, a) {
|
|
2070
1626
|
if (r.length) {
|
|
2071
|
-
|
|
2072
|
-
var t = n.font(), o = t.height, u = t.size,
|
|
2073
|
-
if (
|
|
2074
|
-
var
|
|
2075
|
-
|
|
1627
|
+
a.textBaseline = "middle";
|
|
1628
|
+
var t = n.font(), o = t.height, u = t.size, g = n.valign(), m = n.height()(), w = n.width()(0), b = n.align(), A = b === "justify", R = 0.5 * o, k = Xe[g];
|
|
1629
|
+
if (k && isFinite(m)) {
|
|
1630
|
+
var O = r.length * o;
|
|
1631
|
+
R += m * k - O * k;
|
|
2076
1632
|
}
|
|
2077
|
-
r.forEach(function(
|
|
2078
|
-
var
|
|
2079
|
-
|
|
2080
|
-
|
|
1633
|
+
r.forEach(function(j, W) {
|
|
1634
|
+
var M = n.x()(W), I = W * o + R, U = 0, z = 0;
|
|
1635
|
+
j.forEach(function(V) {
|
|
1636
|
+
V.whitespace && U++, z += V.width;
|
|
2081
1637
|
});
|
|
2082
|
-
var
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
var
|
|
2086
|
-
|
|
2087
|
-
return
|
|
2088
|
-
}(
|
|
2089
|
-
var
|
|
2090
|
-
if (b === "right" ?
|
|
2091
|
-
|
|
2092
|
-
var
|
|
2093
|
-
|
|
1638
|
+
var et = 0, J = W === r.length - 1 || j[j.length - 1] instanceof X;
|
|
1639
|
+
A && j.length > 1 && !J && (et = (w - z) / U), j.forEach(function(V) {
|
|
1640
|
+
a.font = V.font;
|
|
1641
|
+
var F = V.font, nt = F.baseline ? u * -F.baseline + 0.15 * u : 0;
|
|
1642
|
+
a.fillStyle = function(mt, ct) {
|
|
1643
|
+
return mt.color ? mt.color : ct.href ? "#00C" : "#000";
|
|
1644
|
+
}(F, V);
|
|
1645
|
+
var rt = 0;
|
|
1646
|
+
if (b === "right" ? rt += w - z : b === "center" ? rt += w / 2 - z / 2 : b === "justify" && (V.whitespace || V instanceof X) && (M += et), a.fillText(V.value, M + rt, I + nt), V.href) {
|
|
1647
|
+
a.beginPath(), a.strokeStyle = a.fillStyle;
|
|
1648
|
+
var ft = Math.floor(I + 0.45 * u) + 0.5;
|
|
1649
|
+
a.moveTo(M + rt, ft), a.lineTo(M + rt + V.width, ft), a.stroke();
|
|
2094
1650
|
}
|
|
2095
|
-
|
|
1651
|
+
M += V.width;
|
|
2096
1652
|
});
|
|
2097
1653
|
});
|
|
2098
1654
|
}
|
|
2099
1655
|
}
|
|
2100
|
-
function
|
|
2101
|
-
return
|
|
1656
|
+
function ie(r) {
|
|
1657
|
+
return ie = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
2102
1658
|
return typeof n;
|
|
2103
1659
|
} : function(n) {
|
|
2104
1660
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
2105
|
-
},
|
|
1661
|
+
}, ie(r);
|
|
2106
1662
|
}
|
|
2107
|
-
function
|
|
2108
|
-
for (var n = {},
|
|
2109
|
-
var t = r[
|
|
2110
|
-
typeof t != "number" && t != null && (typeof t == "string" ? n.text = t : typeof t == "function" ? n.fn = t :
|
|
1663
|
+
function ke(r) {
|
|
1664
|
+
for (var n = {}, a = 0; a < r.length; a++) {
|
|
1665
|
+
var t = r[a];
|
|
1666
|
+
typeof t != "number" && t != null && (typeof t == "string" ? n.text = t : typeof t == "function" ? n.fn = t : ie(t) === "object" && t._groups ? n.d3 = t : t && t.nodeType && t.getContext ? n.ctx = t.getContext("2d") : t && t.fillText && t.beginPath ? n.ctx = t : t && (n.text = t));
|
|
2111
1667
|
}
|
|
2112
1668
|
return n;
|
|
2113
1669
|
}
|
|
2114
|
-
function
|
|
2115
|
-
return
|
|
1670
|
+
function kt(r) {
|
|
1671
|
+
return kt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
2116
1672
|
return typeof n;
|
|
2117
1673
|
} : function(n) {
|
|
2118
1674
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
2119
|
-
},
|
|
1675
|
+
}, kt(r);
|
|
2120
1676
|
}
|
|
2121
|
-
function
|
|
2122
|
-
for (var
|
|
2123
|
-
var t = n[
|
|
2124
|
-
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u,
|
|
2125
|
-
if (
|
|
1677
|
+
function oe(r, n) {
|
|
1678
|
+
for (var a = 0; a < n.length; a++) {
|
|
1679
|
+
var t = n[a];
|
|
1680
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, g) {
|
|
1681
|
+
if (kt(u) !== "object" || u === null)
|
|
2126
1682
|
return u;
|
|
2127
|
-
var
|
|
2128
|
-
if (
|
|
2129
|
-
var w =
|
|
2130
|
-
if (
|
|
1683
|
+
var m = u[Symbol.toPrimitive];
|
|
1684
|
+
if (m !== void 0) {
|
|
1685
|
+
var w = m.call(u, g);
|
|
1686
|
+
if (kt(w) !== "object")
|
|
2131
1687
|
return w;
|
|
2132
1688
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2133
1689
|
}
|
|
2134
1690
|
return String(u);
|
|
2135
|
-
}(t.key, "string"),
|
|
1691
|
+
}(t.key, "string"), kt(o) === "symbol" ? o : String(o)), t);
|
|
2136
1692
|
}
|
|
2137
1693
|
var o;
|
|
2138
1694
|
}
|
|
2139
|
-
var
|
|
1695
|
+
var Te = P(), ut = function(r) {
|
|
2140
1696
|
return typeof r == "function" ? r : function() {
|
|
2141
1697
|
return r;
|
|
2142
1698
|
};
|
|
2143
1699
|
}, G = function() {
|
|
2144
1700
|
function r(t) {
|
|
2145
|
-
if (function(u,
|
|
2146
|
-
if (!(u instanceof
|
|
1701
|
+
if (function(u, g) {
|
|
1702
|
+
if (!(u instanceof g))
|
|
2147
1703
|
throw new TypeError("Cannot call a class as a function");
|
|
2148
1704
|
}(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
|
|
2149
1705
|
return 1 / 0;
|
|
@@ -2155,82 +1711,82 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2155
1711
|
for (var o in t)
|
|
2156
1712
|
typeof this[o] == "function" && this[o](t[o]);
|
|
2157
1713
|
}
|
|
2158
|
-
var n,
|
|
2159
|
-
return n = r,
|
|
2160
|
-
var o = this, u = this.props.parser(String(t)),
|
|
1714
|
+
var n, a;
|
|
1715
|
+
return n = r, a = [{ key: "linebreak", value: function(t) {
|
|
1716
|
+
var o = this, u = this.props.parser(String(t)), g = this.font(), m = function(w, b, A) {
|
|
2161
1717
|
if (!w.length)
|
|
2162
1718
|
return [];
|
|
2163
|
-
var
|
|
2164
|
-
if (!
|
|
1719
|
+
var R = b.height(), k = b.width(), O = b.overflowLine(), j = b.overflowWrap(), W = P(A, !0, !1), M = isFinite(R()) ? Math.floor(R() / A.height) : 1 / 0;
|
|
1720
|
+
if (!R() && !k(0) || !M)
|
|
2165
1721
|
return [];
|
|
2166
|
-
for (var
|
|
2167
|
-
var
|
|
2168
|
-
if (
|
|
2169
|
-
if (
|
|
2170
|
-
z = 0, J = [],
|
|
2171
|
-
else if (
|
|
2172
|
-
J.push({ index:
|
|
2173
|
-
else if (
|
|
2174
|
-
z +=
|
|
1722
|
+
for (var I = 0, U = 0, z = 0, et = [], J = [], V = !1; I < w.length && U < M; ) {
|
|
1723
|
+
var F = w[I], nt = Ae(F, A);
|
|
1724
|
+
if (F.width = N(F, nt), F.font = nt, F.line = U, F.whitespace = F.value in S, F.value && (F.value = F.value.replace(qe, " ")), !(!z && F.whitespace || V && F.whitespace))
|
|
1725
|
+
if (F instanceof X)
|
|
1726
|
+
z = 0, J = [], et.push(I + 1), U++;
|
|
1727
|
+
else if (F instanceof at || F instanceof ht)
|
|
1728
|
+
J.push({ index: I, width: z });
|
|
1729
|
+
else if (F.whitespace || z + F.width < k(U))
|
|
1730
|
+
z += F.width;
|
|
2175
1731
|
else if (J.length) {
|
|
2176
|
-
var
|
|
1732
|
+
var rt = void 0, ft = void 0;
|
|
2177
1733
|
do {
|
|
2178
|
-
|
|
2179
|
-
var
|
|
2180
|
-
|
|
2181
|
-
} while (!
|
|
2182
|
-
|
|
2183
|
-
} else if (
|
|
2184
|
-
var
|
|
2185
|
-
if (z +
|
|
2186
|
-
var
|
|
1734
|
+
ft = !0, rt = J.pop();
|
|
1735
|
+
var mt = w[rt.index], ct = void 0;
|
|
1736
|
+
mt instanceof ht && (ct = N("-", mt.font), rt.width + ct > k(U) && (ft = !J.length));
|
|
1737
|
+
} while (!ft);
|
|
1738
|
+
et.push(rt.index + 1), z = 0, U++, I = rt.index, J = [];
|
|
1739
|
+
} else if (j === "break-word") {
|
|
1740
|
+
var gt = k(U);
|
|
1741
|
+
if (z + F.width > gt) {
|
|
1742
|
+
var Mt = F.clone();
|
|
2187
1743
|
do
|
|
2188
|
-
|
|
2189
|
-
while (
|
|
2190
|
-
|
|
1744
|
+
F.value = F.value.slice(0, -1), F.width = N(F, F.font), z += F.width;
|
|
1745
|
+
while (F.value && F.width > gt);
|
|
1746
|
+
Mt.value = Mt.value.slice(F.value.length), w.splice(I + 1, 0, new at(), Mt);
|
|
2191
1747
|
}
|
|
2192
|
-
|
|
1748
|
+
et.push(I + 1), z = 0, U++;
|
|
2193
1749
|
} else
|
|
2194
|
-
z +=
|
|
2195
|
-
|
|
1750
|
+
z += F.width;
|
|
1751
|
+
I++, V = F.whitespace;
|
|
2196
1752
|
}
|
|
2197
|
-
|
|
2198
|
-
var
|
|
2199
|
-
for (var
|
|
2200
|
-
|
|
2201
|
-
for (var bt =
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
var
|
|
2205
|
-
return
|
|
1753
|
+
I !== et[et.length - 1] && et.push(I);
|
|
1754
|
+
var le = 0, pt = 0, Z = et.map(function(Tt) {
|
|
1755
|
+
for (var Q, St = le; (Q = w[St]) && (Q.whitespace || !Q.value); )
|
|
1756
|
+
St++;
|
|
1757
|
+
for (var bt = Tt, Qe = null; bt > St && (Q = w[bt - 1]) && (Q.whitespace || !(Q.value || Q instanceof ht)); )
|
|
1758
|
+
Q instanceof X && (Qe = Q), bt--;
|
|
1759
|
+
Q instanceof ht && (Q.value = "-", Q.width = N("-", Q.font)), le = Tt;
|
|
1760
|
+
var zt = w.slice(St, bt).filter(function(tr) {
|
|
1761
|
+
return tr.value;
|
|
2206
1762
|
});
|
|
2207
|
-
return
|
|
2208
|
-
return
|
|
2209
|
-
}, 0),
|
|
1763
|
+
return Qe && zt.push(Qe), zt.width = zt.reduce(function(tr, Vr) {
|
|
1764
|
+
return tr + Vr.width;
|
|
1765
|
+
}, 0), zt.width > pt && (pt = zt.width), zt;
|
|
2210
1766
|
});
|
|
2211
|
-
if (
|
|
2212
|
-
var
|
|
2213
|
-
|
|
2214
|
-
var
|
|
2215
|
-
if (
|
|
2216
|
-
var bt = new
|
|
2217
|
-
bt.font =
|
|
1767
|
+
if (Z.hasLineOverflow = !1, O) {
|
|
1768
|
+
var Pe = O === "ellipsis" ? "…" : O;
|
|
1769
|
+
Z.forEach(function(Tt, Q) {
|
|
1770
|
+
var St = k(Q);
|
|
1771
|
+
if (Tt.width > St) {
|
|
1772
|
+
var bt = new D(Pe);
|
|
1773
|
+
bt.font = A, bt.width = N(Pe, W), ee(Tt, St, bt), Z.hasLineOverflow = !0;
|
|
2218
1774
|
}
|
|
2219
1775
|
});
|
|
2220
1776
|
}
|
|
2221
|
-
var
|
|
2222
|
-
if (
|
|
2223
|
-
var
|
|
2224
|
-
|
|
1777
|
+
var q = b.overflow() === "ellipsis" ? "…" : b.overflow();
|
|
1778
|
+
if (q && I !== w.length) {
|
|
1779
|
+
var K = k(Z.length - 1), Re = Z[Z.length - 1], he = new D(q);
|
|
1780
|
+
he.font = A, he.width = N(q, W), ee(Re, K, he), Z.hasOverflow = !0;
|
|
2225
1781
|
} else
|
|
2226
|
-
|
|
2227
|
-
return
|
|
2228
|
-
}(u, this,
|
|
2229
|
-
return
|
|
2230
|
-
return o.render(
|
|
2231
|
-
},
|
|
1782
|
+
Z.hasOverflow = !1;
|
|
1783
|
+
return Z.font = A, Z.width = pt, Z;
|
|
1784
|
+
}(u, this, g);
|
|
1785
|
+
return m.height = m.length * g.height, m.render = function(w) {
|
|
1786
|
+
return o.render(m, w);
|
|
1787
|
+
}, m.svg = m.render, m.draw = m.render, m;
|
|
2232
1788
|
} }, { key: "font", value: function(t) {
|
|
2233
|
-
return arguments.length ? (this.props.font = P(t), this) : this.props.font || P(
|
|
1789
|
+
return arguments.length ? (this.props.font = P(t), this) : this.props.font || P(Te);
|
|
2234
1790
|
} }, { key: "overflow", value: function(t) {
|
|
2235
1791
|
return arguments.length ? (this.props.overflow = String(t), this) : this.props.overflow;
|
|
2236
1792
|
} }, { key: "overflowLine", value: function(t) {
|
|
@@ -2266,49 +1822,49 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2266
1822
|
} }, { key: "createElement", value: function(t) {
|
|
2267
1823
|
return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
|
|
2268
1824
|
} }, { key: "render", value: function() {
|
|
2269
|
-
var t =
|
|
2270
|
-
return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ?
|
|
2271
|
-
} }],
|
|
1825
|
+
var t = ke(arguments);
|
|
1826
|
+
return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Ge(t.text, this, t.ctx) : Ye(t.text, this);
|
|
1827
|
+
} }], a && oe(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
|
|
2272
1828
|
}();
|
|
2273
|
-
function
|
|
2274
|
-
return
|
|
1829
|
+
function dt(r) {
|
|
1830
|
+
return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
2275
1831
|
return typeof n;
|
|
2276
1832
|
} : function(n) {
|
|
2277
1833
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
2278
|
-
},
|
|
1834
|
+
}, dt(r);
|
|
2279
1835
|
}
|
|
2280
|
-
function
|
|
1836
|
+
function jt(r, n) {
|
|
2281
1837
|
(n == null || n > r.length) && (n = r.length);
|
|
2282
|
-
for (var
|
|
2283
|
-
t[
|
|
1838
|
+
for (var a = 0, t = new Array(n); a < n; a++)
|
|
1839
|
+
t[a] = r[a];
|
|
2284
1840
|
return t;
|
|
2285
1841
|
}
|
|
2286
|
-
function
|
|
2287
|
-
for (var
|
|
2288
|
-
var t = n[
|
|
2289
|
-
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u,
|
|
2290
|
-
if (
|
|
1842
|
+
function Je(r, n) {
|
|
1843
|
+
for (var a = 0; a < n.length; a++) {
|
|
1844
|
+
var t = n[a];
|
|
1845
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, g) {
|
|
1846
|
+
if (dt(u) !== "object" || u === null)
|
|
2291
1847
|
return u;
|
|
2292
|
-
var
|
|
2293
|
-
if (
|
|
2294
|
-
var w =
|
|
2295
|
-
if (
|
|
1848
|
+
var m = u[Symbol.toPrimitive];
|
|
1849
|
+
if (m !== void 0) {
|
|
1850
|
+
var w = m.call(u, g);
|
|
1851
|
+
if (dt(w) !== "object")
|
|
2296
1852
|
return w;
|
|
2297
1853
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2298
1854
|
}
|
|
2299
1855
|
return String(u);
|
|
2300
|
-
}(t.key, "string"),
|
|
1856
|
+
}(t.key, "string"), dt(o) === "symbol" ? o : String(o)), t);
|
|
2301
1857
|
}
|
|
2302
1858
|
var o;
|
|
2303
1859
|
}
|
|
2304
|
-
var
|
|
1860
|
+
var se = function(r) {
|
|
2305
1861
|
return typeof r == "function" ? r : function() {
|
|
2306
1862
|
return r;
|
|
2307
1863
|
};
|
|
2308
|
-
},
|
|
1864
|
+
}, Se = function() {
|
|
2309
1865
|
function r(t) {
|
|
2310
|
-
if (function(u,
|
|
2311
|
-
if (!(u instanceof
|
|
1866
|
+
if (function(u, g) {
|
|
1867
|
+
if (!(u instanceof g))
|
|
2312
1868
|
throw new TypeError("Cannot call a class as a function");
|
|
2313
1869
|
}(this, r), this.props = { width: function() {
|
|
2314
1870
|
return 1 / 0;
|
|
@@ -2319,47 +1875,47 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2319
1875
|
typeof this[o] == "function" && this[o](t[o]);
|
|
2320
1876
|
this.render = this.render.bind(this);
|
|
2321
1877
|
}
|
|
2322
|
-
var n,
|
|
2323
|
-
return n = r,
|
|
2324
|
-
var o = this.props, u = o.hAnchor,
|
|
1878
|
+
var n, a;
|
|
1879
|
+
return n = r, a = [{ key: "anchor", value: function(t) {
|
|
1880
|
+
var o = this.props, u = o.hAnchor, g = o.vAnchor, m = o.width, w = o.height;
|
|
2325
1881
|
if (!arguments.length)
|
|
2326
|
-
return [u *
|
|
1882
|
+
return [u * m(0), g * w(0)];
|
|
2327
1883
|
if (typeof t == "string") {
|
|
2328
1884
|
var b = this.props;
|
|
2329
|
-
t.toLowerCase().trim().split(/\s+/).forEach(function(
|
|
2330
|
-
|
|
1885
|
+
t.toLowerCase().trim().split(/\s+/).forEach(function(A) {
|
|
1886
|
+
A === "top" && (b.vAnchor = -0), A === "middle" && (b.vAnchor = -0.5), A === "bottom" && (b.vAnchor = -1), A === "left" && (b.hAnchor = -0), A === "center" && (b.hAnchor = -0.5), A === "right" && (b.hAnchor = -1);
|
|
2331
1887
|
});
|
|
2332
1888
|
}
|
|
2333
1889
|
return this;
|
|
2334
1890
|
} }, { key: "width", value: function(t) {
|
|
2335
|
-
return arguments.length ? (this.props.width =
|
|
1891
|
+
return arguments.length ? (this.props.width = se(t), this) : this.props.width;
|
|
2336
1892
|
} }, { key: "height", value: function(t) {
|
|
2337
|
-
return arguments.length ? (this.props.height =
|
|
1893
|
+
return arguments.length ? (this.props.height = se(t), this) : this.props.height;
|
|
2338
1894
|
} }, { key: "rotate", value: function(t) {
|
|
2339
1895
|
return arguments.length ? (this.props.rotation = t, this) : this.props.rotation;
|
|
2340
1896
|
} }, { key: "createElement", value: function(t) {
|
|
2341
1897
|
return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
|
|
2342
1898
|
} }, { key: "canvas", value: function(t, o) {
|
|
2343
|
-
var u,
|
|
2344
|
-
return
|
|
2345
|
-
if (Array.isArray(
|
|
2346
|
-
return
|
|
2347
|
-
}(u = this.anchor()) || function(
|
|
2348
|
-
if (typeof Symbol < "u" &&
|
|
2349
|
-
return Array.from(
|
|
2350
|
-
}(u) || function(
|
|
2351
|
-
if (
|
|
2352
|
-
if (typeof
|
|
2353
|
-
return
|
|
2354
|
-
var b = Object.prototype.toString.call(
|
|
2355
|
-
return b === "Object" &&
|
|
1899
|
+
var u, g = t.getContext ? t.getContext("2d") : t;
|
|
1900
|
+
return g.save(), g.rotate(this.rotate() * Math.PI / 180), g.translate.apply(g, function(m) {
|
|
1901
|
+
if (Array.isArray(m))
|
|
1902
|
+
return jt(m);
|
|
1903
|
+
}(u = this.anchor()) || function(m) {
|
|
1904
|
+
if (typeof Symbol < "u" && m[Symbol.iterator] != null || m["@@iterator"] != null)
|
|
1905
|
+
return Array.from(m);
|
|
1906
|
+
}(u) || function(m, w) {
|
|
1907
|
+
if (m) {
|
|
1908
|
+
if (typeof m == "string")
|
|
1909
|
+
return jt(m, w);
|
|
1910
|
+
var b = Object.prototype.toString.call(m).slice(8, -1);
|
|
1911
|
+
return b === "Object" && m.constructor && (b = m.constructor.name), b === "Map" || b === "Set" ? Array.from(m) : b === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b) ? jt(m, w) : void 0;
|
|
2356
1912
|
}
|
|
2357
1913
|
}(u) || function() {
|
|
2358
1914
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2359
1915
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2360
|
-
}()), o(
|
|
1916
|
+
}()), o(g), g.restore(), g;
|
|
2361
1917
|
} }, { key: "render", value: function() {
|
|
2362
|
-
var t =
|
|
1918
|
+
var t = ke(arguments);
|
|
2363
1919
|
if (t.d3)
|
|
2364
1920
|
return t.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
|
|
2365
1921
|
if (t.ctx)
|
|
@@ -2368,208 +1924,208 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2368
1924
|
var o = typeof t.text.render == "function" ? t.text.render() : t.text;
|
|
2369
1925
|
return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, o);
|
|
2370
1926
|
}
|
|
2371
|
-
} }],
|
|
2372
|
-
}(),
|
|
2373
|
-
function
|
|
2374
|
-
return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n,
|
|
2375
|
-
return
|
|
1927
|
+
} }], a && Je(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
|
|
1928
|
+
}(), Ce = Object.prototype.hasOwnProperty, Dt = {};
|
|
1929
|
+
function Ze(r) {
|
|
1930
|
+
return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, t) {
|
|
1931
|
+
return a + "-" + t.toLowerCase();
|
|
2376
1932
|
})), Dt[r];
|
|
2377
1933
|
}
|
|
2378
|
-
function
|
|
1934
|
+
function Oe(r, n) {
|
|
2379
1935
|
if (Array.isArray(n))
|
|
2380
|
-
return n.forEach(function(
|
|
2381
|
-
return
|
|
1936
|
+
return n.forEach(function(a) {
|
|
1937
|
+
return Oe(r, a);
|
|
2382
1938
|
});
|
|
2383
1939
|
typeof n == "string" && (n = document.createTextNode(n)), r.appendChild(n);
|
|
2384
1940
|
}
|
|
2385
|
-
function
|
|
1941
|
+
function ae(r, n) {
|
|
2386
1942
|
if (typeof document < "u") {
|
|
2387
|
-
var
|
|
2388
|
-
if (n &&
|
|
1943
|
+
var a = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
|
|
1944
|
+
if (n && a.setAttribute)
|
|
2389
1945
|
for (var t in n)
|
|
2390
|
-
|
|
2391
|
-
for (var o = arguments.length, u = new Array(o > 2 ? o - 2 : 0),
|
|
2392
|
-
u[
|
|
2393
|
-
return u != null && u.length && u.forEach(function(
|
|
2394
|
-
|
|
2395
|
-
}),
|
|
1946
|
+
Ce.call(n, t) && n[t] != null && a.setAttribute(t === "className" ? "class" : Ze(t), n[t]);
|
|
1947
|
+
for (var o = arguments.length, u = new Array(o > 2 ? o - 2 : 0), g = 2; g < o; g++)
|
|
1948
|
+
u[g - 2] = arguments[g];
|
|
1949
|
+
return u != null && u.length && u.forEach(function(m) {
|
|
1950
|
+
Oe(a, m);
|
|
1951
|
+
}), a;
|
|
2396
1952
|
}
|
|
2397
1953
|
}
|
|
2398
|
-
G.createElement =
|
|
1954
|
+
G.createElement = ae, G.textparser = At, G.defaultparser = At, G.htmlparser = function(r) {
|
|
2399
1955
|
r = String(r || "").trim();
|
|
2400
|
-
for (var n,
|
|
2401
|
-
for (var
|
|
2402
|
-
t[
|
|
2403
|
-
o.push(
|
|
2404
|
-
},
|
|
2405
|
-
var
|
|
2406
|
-
if (
|
|
2407
|
-
for (var
|
|
2408
|
-
|
|
2409
|
-
for (;
|
|
2410
|
-
|
|
2411
|
-
for (;
|
|
2412
|
-
o.push(new
|
|
1956
|
+
for (var n, a, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, o = [], u = [], g = function(R) {
|
|
1957
|
+
for (var k in t)
|
|
1958
|
+
t[k] && (R[k] = t[k]);
|
|
1959
|
+
o.push(R);
|
|
1960
|
+
}, m = function(R) {
|
|
1961
|
+
var k = o.length, O = Be[R];
|
|
1962
|
+
if (k && O) {
|
|
1963
|
+
for (var j = k - 1; o[j] && (o[j] instanceof at || Ne.test(o[j].value)); )
|
|
1964
|
+
j--;
|
|
1965
|
+
for (; O && o[j] && o[j] instanceof X; )
|
|
1966
|
+
j--, O--;
|
|
1967
|
+
for (; O-- > 0; )
|
|
1968
|
+
o.push(new X());
|
|
2413
1969
|
}
|
|
2414
1970
|
}; r.length; ) {
|
|
2415
1971
|
if (n = /^[^<]+/.exec(r))
|
|
2416
|
-
|
|
1972
|
+
At(Qt(n[0]), !1).forEach(g);
|
|
2417
1973
|
else if (!(n = It.exec(r)))
|
|
2418
|
-
if (n =
|
|
2419
|
-
u.length && (t = u.pop()),
|
|
2420
|
-
else if (n =
|
|
1974
|
+
if (n = Jt.exec(r))
|
|
1975
|
+
u.length && (t = u.pop()), m(n[1]);
|
|
1976
|
+
else if (n = Zt.exec(r)) {
|
|
2421
1977
|
var w = n[1];
|
|
2422
|
-
|
|
2423
|
-
var b =
|
|
2424
|
-
w === "a" && (b.href && (t.href = b.href), b.rel && (t.rel = b.rel), b.target && (t.target = b.target)), b.class && (t.class = t.class ? t.class + " " + b.class : b.class), b.style && (
|
|
1978
|
+
m(w), u.push(t), t = Object.create(t), Et[w] && Et[w](t, "");
|
|
1979
|
+
var b = Lt(n[2]);
|
|
1980
|
+
w === "a" && (b.href && (t.href = b.href), b.rel && (t.rel = b.rel), b.target && (t.target = b.target)), b.class && (t.class = t.class ? t.class + " " + b.class : b.class), b.style && (a = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(b.style)) && a[1] && (t.color = a[1]), w === "br" && o.push(new X());
|
|
2425
1981
|
} else
|
|
2426
|
-
n = [r.slice(0, 1)],
|
|
1982
|
+
n = [r.slice(0, 1)], g(new D(n[0]));
|
|
2427
1983
|
r = r.slice(n[0].length);
|
|
2428
1984
|
}
|
|
2429
|
-
for (var
|
|
2430
|
-
o.pop(),
|
|
1985
|
+
for (var A = o[o.length - 1]; A instanceof X; )
|
|
1986
|
+
o.pop(), A = o[o.length - 1];
|
|
2431
1987
|
return o;
|
|
2432
1988
|
}, G.latexparser = function(r) {
|
|
2433
1989
|
r = String(r || "").trim();
|
|
2434
1990
|
var n = [0];
|
|
2435
|
-
r = r.replace(/\\verb,(.*?),/, function(
|
|
2436
|
-
return n.push(
|
|
1991
|
+
r = r.replace(/\\verb,(.*?),/, function(M, I) {
|
|
1992
|
+
return n.push(I), "\\verb," + (n.length - 1) + ",";
|
|
2437
1993
|
}).replace(/\\\\\n/g, function() {
|
|
2438
1994
|
return "\\\\";
|
|
2439
|
-
}).replace(
|
|
2440
|
-
return
|
|
2441
|
-
}).replace(/\n\s+/g, function(
|
|
2442
|
-
return /\n/.test(
|
|
2443
|
-
}).replace(/\\symbol\{(\d+)\}/, function(
|
|
2444
|
-
return z.charAt(
|
|
2445
|
-
}).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(
|
|
2446
|
-
return
|
|
2447
|
-
}).replace(/\\verb,(.*?),/, function(
|
|
2448
|
-
return "\\verb,".concat(n[+
|
|
1995
|
+
}).replace(Ve, function(M, I, U) {
|
|
1996
|
+
return U.charAt(I - 1) === "\\" ? M : te[M];
|
|
1997
|
+
}).replace(/\n\s+/g, function(M) {
|
|
1998
|
+
return /\n/.test(M.slice(1)) ? "\\par " : M;
|
|
1999
|
+
}).replace(/\\symbol\{(\d+)\}/, function(M, I, U, z) {
|
|
2000
|
+
return z.charAt(U - 1) === "\\" ? M : String.fromCharCode(1 * I);
|
|
2001
|
+
}).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, I, U, z) {
|
|
2002
|
+
return I + U + "{" + z + "}";
|
|
2003
|
+
}).replace(/\\verb,(.*?),/, function(M, I) {
|
|
2004
|
+
return "\\verb,".concat(n[+I], ",");
|
|
2449
2005
|
});
|
|
2450
|
-
for (var
|
|
2451
|
-
for (var
|
|
2452
|
-
t[
|
|
2453
|
-
return o.push(
|
|
2454
|
-
},
|
|
2006
|
+
for (var a, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, o = [], u = [], g = function(M) {
|
|
2007
|
+
for (var I in t)
|
|
2008
|
+
t[I] && (M[I] = t[I]);
|
|
2009
|
+
return o.push(M), M;
|
|
2010
|
+
}, m = function() {
|
|
2455
2011
|
u.push(t), t = Object.create(t);
|
|
2456
2012
|
}, w = function() {
|
|
2457
2013
|
if (!u.length)
|
|
2458
2014
|
throw new Error("Unexpected }");
|
|
2459
2015
|
t = u.pop();
|
|
2460
|
-
}, b = { tokens: o, open_context:
|
|
2461
|
-
if (
|
|
2462
|
-
|
|
2463
|
-
else if (
|
|
2464
|
-
|
|
2465
|
-
else if (!(
|
|
2466
|
-
if (
|
|
2467
|
-
|
|
2468
|
-
else if (
|
|
2016
|
+
}, b = { tokens: o, open_context: m, close_context: w, add_token: g }; r.length; ) {
|
|
2017
|
+
if (a = Ft.exec(r))
|
|
2018
|
+
At(a[0], !1).forEach(g);
|
|
2019
|
+
else if (a = Ue.exec(r))
|
|
2020
|
+
g(new D(a[1]));
|
|
2021
|
+
else if (!(a = xe.exec(r))) {
|
|
2022
|
+
if (a = /^\{/.exec(r))
|
|
2023
|
+
m();
|
|
2024
|
+
else if (a = /^\}/.exec(r))
|
|
2469
2025
|
w();
|
|
2470
|
-
else if (!(
|
|
2471
|
-
if (
|
|
2472
|
-
|
|
2473
|
-
else if (
|
|
2474
|
-
var
|
|
2475
|
-
if (/^(La)?TeX$/i.test(
|
|
2476
|
-
|
|
2477
|
-
var
|
|
2478
|
-
|
|
2479
|
-
} else if (
|
|
2480
|
-
|
|
2481
|
-
else if (
|
|
2482
|
-
var
|
|
2483
|
-
if (
|
|
2484
|
-
for (
|
|
2485
|
-
if (!(
|
|
2486
|
-
throw new Error(
|
|
2487
|
-
|
|
2026
|
+
else if (!(a = /^\$/.exec(r)))
|
|
2027
|
+
if (a = /^\\verb,([^,]+),/.exec(r))
|
|
2028
|
+
g(new D(a[1]));
|
|
2029
|
+
else if (a = we.exec(r)) {
|
|
2030
|
+
var A = a[1].slice(1) || a[1], R = !!a[2];
|
|
2031
|
+
if (/^(La)?TeX$/i.test(A)) {
|
|
2032
|
+
m(), t.family = "serif";
|
|
2033
|
+
var k = void 0;
|
|
2034
|
+
A === "LaTeX" && ((k = g(new D("L"))).tracking = -0.25, (k = g(new D("A"))).size = 0.7, k.baseline = 0.3, k.tracking = -0.1), (k = g(new D("T"))).tracking = -0.17, (k = g(new D("E"))).baseline = -0.22, k.tracking = -0.13, k = g(new D("X")), w();
|
|
2035
|
+
} else if (A in _t)
|
|
2036
|
+
g(new D(_t[A])), R && m();
|
|
2037
|
+
else if (A in H) {
|
|
2038
|
+
var O = [], j = H[A].length - 1, W = void 0;
|
|
2039
|
+
if (j) {
|
|
2040
|
+
for (R = !1, r = r.slice(a[0].length - 1); j--; ) {
|
|
2041
|
+
if (!(W = /^\{([^}]+)\}/.exec(r)))
|
|
2042
|
+
throw new Error(A + " is missing an argument");
|
|
2043
|
+
O.push(W[1]), r = r.slice(W[0].length);
|
|
2488
2044
|
}
|
|
2489
|
-
|
|
2045
|
+
a[0] = /^\{/.exec(r) ? "{" : "", R = !!a[0];
|
|
2490
2046
|
}
|
|
2491
|
-
|
|
2047
|
+
R && m(), H[A].apply(b, [t].concat(O));
|
|
2492
2048
|
} else
|
|
2493
|
-
console.warn("unknown latex command",
|
|
2049
|
+
console.warn("unknown latex command", A), g(new D(a[1])), R && m();
|
|
2494
2050
|
} else
|
|
2495
|
-
|
|
2051
|
+
a = [r.slice(0, 1)], g(new D(a[0]));
|
|
2496
2052
|
}
|
|
2497
|
-
r = r.slice(
|
|
2053
|
+
r = r.slice(a[0].length);
|
|
2498
2054
|
}
|
|
2499
2055
|
return o;
|
|
2500
|
-
}, G.measureText = function(r, n,
|
|
2501
|
-
return
|
|
2502
|
-
}, G.Token =
|
|
2503
|
-
const
|
|
2056
|
+
}, G.measureText = function(r, n, a) {
|
|
2057
|
+
return N(r, P(n), a);
|
|
2058
|
+
}, G.Token = D, G.Break = at, G.LineBreak = X, G.SoftHyphen = ht, G.Rotator = Se, Se.createElement = ae;
|
|
2059
|
+
const Ke = G;
|
|
2504
2060
|
return i.default;
|
|
2505
2061
|
})());
|
|
2506
|
-
})(
|
|
2507
|
-
var
|
|
2508
|
-
const
|
|
2509
|
-
function
|
|
2510
|
-
return
|
|
2062
|
+
})(Hr);
|
|
2063
|
+
var pn = Hr.exports;
|
|
2064
|
+
const xr = /* @__PURE__ */ Mr(pn);
|
|
2065
|
+
function nr(h) {
|
|
2066
|
+
return h.replace(/…$/, "");
|
|
2511
2067
|
}
|
|
2512
|
-
function
|
|
2513
|
-
return
|
|
2068
|
+
function ir(h) {
|
|
2069
|
+
return h.children[0].innerHTML;
|
|
2514
2070
|
}
|
|
2515
|
-
function
|
|
2516
|
-
const
|
|
2517
|
-
if (
|
|
2071
|
+
function yn(h, e) {
|
|
2072
|
+
const s = vt(h), { fontSize: i, font: l, padding: c = 0 } = h.properties.style || {};
|
|
2073
|
+
if (s.width === s.height && s.width === 0)
|
|
2518
2074
|
return;
|
|
2519
|
-
const
|
|
2520
|
-
font: `${i}px/${i}px ${
|
|
2521
|
-
width:
|
|
2522
|
-
height:
|
|
2075
|
+
const f = new xr({
|
|
2076
|
+
font: `${i}px/${i}px ${l}`.replace(/(px)+/g, "px"),
|
|
2077
|
+
width: s.width - c * 2,
|
|
2078
|
+
height: s.height - c * 2,
|
|
2523
2079
|
align: "left",
|
|
2524
2080
|
valign: "top",
|
|
2525
2081
|
x: 0,
|
|
2526
2082
|
overflow: "ellipsis",
|
|
2527
2083
|
parser: "html",
|
|
2528
|
-
createElement:
|
|
2084
|
+
createElement: xr.createElement
|
|
2529
2085
|
});
|
|
2530
|
-
|
|
2531
|
-
const
|
|
2532
|
-
|
|
2086
|
+
f.overflowWrap("break-word");
|
|
2087
|
+
const p = f.linebreak(
|
|
2088
|
+
h.properties.content.replaceAll(`
|
|
2533
2089
|
`, "<br>")
|
|
2534
|
-
).render(),
|
|
2535
|
-
let
|
|
2536
|
-
const
|
|
2537
|
-
|
|
2538
|
-
`).forEach((
|
|
2539
|
-
let P =
|
|
2540
|
-
for (; P.length &&
|
|
2541
|
-
if (
|
|
2090
|
+
).render(), d = [...p.children];
|
|
2091
|
+
let v = 0;
|
|
2092
|
+
const y = [];
|
|
2093
|
+
h.properties.content.split(`
|
|
2094
|
+
`).forEach((E) => {
|
|
2095
|
+
let P = E;
|
|
2096
|
+
for (; P.length && v < d.length; ) {
|
|
2097
|
+
if (d[v].innerHTML === " ") {
|
|
2542
2098
|
P.startsWith(`
|
|
2543
|
-
`) ||
|
|
2099
|
+
`) || y.push(v), v++;
|
|
2544
2100
|
break;
|
|
2545
2101
|
}
|
|
2546
|
-
const
|
|
2547
|
-
P.startsWith(
|
|
2548
|
-
}
|
|
2549
|
-
}),
|
|
2550
|
-
const
|
|
2551
|
-
|
|
2552
|
-
let P =
|
|
2553
|
-
const
|
|
2102
|
+
const S = nr(ir(d[v]));
|
|
2103
|
+
P.startsWith(S) && (P = P.slice(S.length).trim()), v++;
|
|
2104
|
+
}
|
|
2105
|
+
}), y.forEach((E) => p.removeChild(d[E]));
|
|
2106
|
+
const _ = h.properties.content.match(/(https?:\/\/.*)/gm), C = _ ? _.map((E) => E.split(" ")[0]) : [];
|
|
2107
|
+
p.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((E) => {
|
|
2108
|
+
let P = E;
|
|
2109
|
+
const S = [];
|
|
2554
2110
|
for (; P.length > 0; ) {
|
|
2555
|
-
const
|
|
2556
|
-
if (
|
|
2111
|
+
const $ = d.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && P.startsWith(nr(ir(T))));
|
|
2112
|
+
if (!$)
|
|
2557
2113
|
break;
|
|
2558
|
-
|
|
2559
|
-
const
|
|
2560
|
-
if (!
|
|
2114
|
+
S.push($);
|
|
2115
|
+
const L = nr($.children[0].innerHTML).length;
|
|
2116
|
+
if (!L)
|
|
2561
2117
|
break;
|
|
2562
|
-
P = P.slice(
|
|
2118
|
+
P = P.slice(L);
|
|
2563
2119
|
}
|
|
2564
|
-
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2120
|
+
S.forEach(($) => {
|
|
2121
|
+
const L = document.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
2122
|
+
L.setAttribute("href", E), L.setAttribute("target", "_blank"), L.innerHTML = ir($), $.children[0].innerHTML = "", $.children[0].appendChild(L);
|
|
2567
2123
|
});
|
|
2568
|
-
}), e.appendChild(
|
|
2124
|
+
}), e.appendChild(p);
|
|
2569
2125
|
}
|
|
2570
|
-
const
|
|
2571
|
-
class
|
|
2572
|
-
constructor(e,
|
|
2126
|
+
const Ar = 20;
|
|
2127
|
+
class vn extends Br {
|
|
2128
|
+
constructor(e, s = {}) {
|
|
2573
2129
|
super(
|
|
2574
2130
|
e,
|
|
2575
2131
|
`
|
|
@@ -2585,130 +2141,126 @@ class un extends $r {
|
|
|
2585
2141
|
<textarea wrap="on"></textarea>
|
|
2586
2142
|
</div>
|
|
2587
2143
|
`
|
|
2588
|
-
), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...
|
|
2144
|
+
), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...rr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "handles", []), x(this, "draggedHandle", Y), x(this, "isFocused", !1), x(this, "placeholder", "Type your text here..."), x(this, "_onFocus", () => {
|
|
2589
2145
|
this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
|
|
2590
2146
|
}), x(this, "_onBlur", () => {
|
|
2591
2147
|
this.isFocused = !1;
|
|
2592
|
-
}), x(this, "startDrawing", (
|
|
2593
|
-
this.add(
|
|
2594
|
-
const
|
|
2595
|
-
this.select(
|
|
2148
|
+
}), x(this, "startDrawing", (l, c, f = gn(l, c, 0, 0, "", Ut)) => {
|
|
2149
|
+
this.add(f);
|
|
2150
|
+
const p = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
|
|
2151
|
+
this.select(f.id), this.startDragging(this.getById(f.id), p.x, p.y), this.draggedHandle = 6;
|
|
2596
2152
|
}), x(this, "cancelDrawing", () => {
|
|
2597
|
-
this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...
|
|
2598
|
-
}), x(this, "startDragging", (
|
|
2599
|
-
this.annotation =
|
|
2600
|
-
const
|
|
2601
|
-
this.rect.x =
|
|
2602
|
-
}), x(this, "onHandleMouseDown", (
|
|
2153
|
+
this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...rr }, this.draggedHandle = Y, this.isDragging = !1, this.emit(Vt, this.annotation));
|
|
2154
|
+
}), x(this, "startDragging", (l, c, f) => {
|
|
2155
|
+
this.annotation = l;
|
|
2156
|
+
const p = yt(this.annotation), d = vt(this.annotation);
|
|
2157
|
+
this.rect.x = p.x, this.rect.y = p.y, this.rect.width = d.width, this.rect.height = d.height, this.startX = c, this.startY = f, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Me, this.annotation), this.isDragging = !0;
|
|
2158
|
+
}), x(this, "onHandleMouseDown", (l) => {
|
|
2603
2159
|
const c = this.getById(this.selectedId) || this.getById(this.hoveredId);
|
|
2604
2160
|
if (!c)
|
|
2605
2161
|
return;
|
|
2606
2162
|
this.selectedId !== c.id && this.select(this.hoveredId);
|
|
2607
|
-
const { x:
|
|
2608
|
-
this.startDragging(c,
|
|
2609
|
-
}), x(this, "onMouseMove", (
|
|
2610
|
-
requestAnimationFrame(() => this._onMouseMove(
|
|
2611
|
-
}), x(this, "_onMouseMove", (
|
|
2163
|
+
const { x: f, y: p } = sr(l, this.ogma.getContainer());
|
|
2164
|
+
this.startDragging(c, f, p), this.draggedHandle = Lr(l.target);
|
|
2165
|
+
}), x(this, "onMouseMove", (l) => {
|
|
2166
|
+
requestAnimationFrame(() => this._onMouseMove(l));
|
|
2167
|
+
}), x(this, "_onMouseMove", (l) => {
|
|
2612
2168
|
if (!this.isDragging)
|
|
2613
2169
|
return;
|
|
2614
|
-
|
|
2615
|
-
const c = this.handles[this.draggedHandle],
|
|
2616
|
-
|
|
2170
|
+
l.stopPropagation(), l.preventDefault();
|
|
2171
|
+
const c = this.handles[this.draggedHandle], f = c.classList.contains("top"), p = c.classList.contains("left"), d = c.classList.contains("right"), v = c.classList.contains("bottom"), y = c.classList.contains("line-handle"), { x: _, y: C } = sr(
|
|
2172
|
+
l,
|
|
2617
2173
|
this.ogma.getContainer()
|
|
2618
|
-
),
|
|
2619
|
-
(
|
|
2620
|
-
const
|
|
2621
|
-
this.rect.width + P * (
|
|
2622
|
-
|
|
2623
|
-
),
|
|
2624
|
-
this.rect.height +
|
|
2625
|
-
|
|
2174
|
+
), E = this.ogma.view.getZoom(), P = (_ - this.startX) / E, S = (C - this.startY) / E, $ = this.ogma.view.getAngle(), L = st({ x: P, y: S }, $);
|
|
2175
|
+
(v && p || f && d) && (L.y = 0, L.x = 0);
|
|
2176
|
+
const T = p || y ? this.rect.x + L.x : this.rect.x, B = f || y ? this.rect.y + L.y : this.rect.y, N = Math.max(
|
|
2177
|
+
this.rect.width + P * (y || p ? 0 : 1),
|
|
2178
|
+
Ar
|
|
2179
|
+
), it = Math.max(
|
|
2180
|
+
this.rect.height + S * (y || f ? 0 : 1),
|
|
2181
|
+
Ar
|
|
2626
2182
|
);
|
|
2627
|
-
|
|
2183
|
+
nn(this.annotation, T, B, N, it), this.emit(De, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
|
|
2628
2184
|
}), x(this, "onMouseUp", () => {
|
|
2629
|
-
!this.isDragging || this.draggedHandle ===
|
|
2630
|
-
}), x(this, "_onMousedown", (
|
|
2631
|
-
|
|
2185
|
+
!this.isDragging || this.draggedHandle === Y || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Vt, this.annotation), this.isDragging = !1, this.draggedHandle = Y);
|
|
2186
|
+
}), x(this, "_onMousedown", (l) => {
|
|
2187
|
+
l.stopPropagation();
|
|
2632
2188
|
}), x(this, "onViewChanged", () => {
|
|
2633
|
-
const
|
|
2634
|
-
document.documentElement.style.setProperty("--handle-scale", `${1 /
|
|
2189
|
+
const l = Math.max(2, this.handleSize / this.ogma.view.getZoom());
|
|
2190
|
+
document.documentElement.style.setProperty("--handle-scale", `${1 / l}`);
|
|
2635
2191
|
}), x(this, "_onInput", () => {
|
|
2636
|
-
const
|
|
2637
|
-
|
|
2638
|
-
}), this.showeditorOnHover = !1, this.handleSize =
|
|
2192
|
+
const l = this.getById(this.selectedId);
|
|
2193
|
+
l && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), l.properties.content = this.textArea.value, this.emit(cr, l), this.layer.refresh());
|
|
2194
|
+
}), this.showeditorOnHover = !1, this.handleSize = wr.handleSize, this.placeholder = wr.placeholder;
|
|
2639
2195
|
const i = this.textArea = this.editor.element.querySelector("textarea");
|
|
2640
2196
|
i.addEventListener("input", this._onInput), i.addEventListener("focus", this._onFocus), i.addEventListener("blur", this._onBlur), i.addEventListener("mousedown", this._onMousedown), i.spellcheck = !1, this.handles = Array.prototype.slice.call(
|
|
2641
2197
|
this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
|
|
2642
2198
|
), this.handles.forEach(
|
|
2643
|
-
(
|
|
2199
|
+
(l) => l.addEventListener("mousedown", this.onHandleMouseDown)
|
|
2644
2200
|
), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), e.events.on(["viewChanged", "zoom"], this.onViewChanged);
|
|
2645
2201
|
}
|
|
2646
2202
|
_canRemove() {
|
|
2647
2203
|
return !this.isFocused;
|
|
2648
2204
|
}
|
|
2649
|
-
detect({ x: e, y:
|
|
2650
|
-
const
|
|
2651
|
-
return this.elements.find((
|
|
2652
|
-
const { x:
|
|
2653
|
-
return
|
|
2205
|
+
detect({ x: e, y: s }, i = 0) {
|
|
2206
|
+
const l = { x: e, y: s }, c = this.ogma.view.getAngle();
|
|
2207
|
+
return this.elements.find((f) => {
|
|
2208
|
+
const { x: p, y: d } = yt(f), { width: v, height: y } = vt(f), _ = { x: p, y: d }, { x: C, y: E } = st(Ct(l, _), -c);
|
|
2209
|
+
return C > -i && C < v + i && E > -i && E < y + i;
|
|
2654
2210
|
});
|
|
2655
2211
|
}
|
|
2656
2212
|
draw(e) {
|
|
2657
2213
|
e.innerHTML = "";
|
|
2658
|
-
const
|
|
2659
|
-
this.elements.forEach((c,
|
|
2660
|
-
const
|
|
2661
|
-
color:
|
|
2662
|
-
fontSize:
|
|
2663
|
-
font:
|
|
2214
|
+
const s = "", i = this.ogma.view.getAngle();
|
|
2215
|
+
this.elements.forEach((c, f) => {
|
|
2216
|
+
const p = `class${f}`, d = vt(c), v = yt(c), y = c.id, {
|
|
2217
|
+
color: _,
|
|
2218
|
+
fontSize: C,
|
|
2219
|
+
font: E,
|
|
2664
2220
|
strokeColor: P,
|
|
2665
|
-
strokeWidth:
|
|
2666
|
-
strokeType:
|
|
2667
|
-
background:
|
|
2668
|
-
} = c.properties.style ||
|
|
2669
|
-
if (
|
|
2221
|
+
strokeWidth: S,
|
|
2222
|
+
strokeType: $,
|
|
2223
|
+
background: L
|
|
2224
|
+
} = c.properties.style || Ut;
|
|
2225
|
+
if (y === this.selectedId)
|
|
2670
2226
|
return;
|
|
2671
|
-
const
|
|
2672
|
-
|
|
2673
|
-
const
|
|
2674
|
-
let
|
|
2675
|
-
|
|
2676
|
-
const { x:
|
|
2677
|
-
|
|
2678
|
-
);
|
|
2679
|
-
k.setAttribute("transform", `translate(${st},${xt})`), k.classList.add(m), k.setAttribute("data-annotation", `${c.id}`), k.setAttribute("data-annotation-type", "text"), e.appendChild(k);
|
|
2227
|
+
const T = de("g");
|
|
2228
|
+
T.classList.add("annotation-text"), T.setAttribute("fill", `${_}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${E}`);
|
|
2229
|
+
const B = de("rect");
|
|
2230
|
+
let N = !1;
|
|
2231
|
+
$ && $ !== "none" && (N = !0, B.setAttribute("stroke", P || "black"), B.setAttribute("stroke-width", `${S}`), $ === "dashed" && B.setAttribute("stroke-dasharray", "5,5")), (L && L.length || N) && (N = !0, B.setAttribute("fill", L || "transparent")), N && (B.setAttribute("width", `${d.width}`), B.setAttribute("height", `${d.height}`)), T.appendChild(B), yn(c, T);
|
|
2232
|
+
const { x: it, y: xt } = st(v, -i);
|
|
2233
|
+
T.setAttribute("transform", `translate(${it},${xt})`), T.classList.add(p), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
|
|
2680
2234
|
});
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2235
|
+
const l = de("style");
|
|
2236
|
+
l.innerHTML = s, e.firstChild && e.insertBefore(l, e.firstChild);
|
|
2683
2237
|
}
|
|
2684
2238
|
refreshDrawing() {
|
|
2685
2239
|
const e = this.ogma.view.getAngle();
|
|
2686
|
-
[...this.layer.element.children].forEach((
|
|
2687
|
-
const i =
|
|
2240
|
+
[...this.layer.element.children].forEach((s) => {
|
|
2241
|
+
const i = s.getAttribute("data-annotation");
|
|
2688
2242
|
if (!i)
|
|
2689
2243
|
return;
|
|
2690
|
-
const
|
|
2691
|
-
|
|
2692
|
-
);
|
|
2693
|
-
a.setAttribute("transform", `translate(${c},${g})`);
|
|
2244
|
+
const l = yt(this.getById(i)), { x: c, y: f } = st(l, -e);
|
|
2245
|
+
s.setAttribute("transform", `translate(${c},${f})`);
|
|
2694
2246
|
});
|
|
2695
2247
|
}
|
|
2696
2248
|
getDefaultOptions() {
|
|
2697
|
-
return
|
|
2249
|
+
return rr;
|
|
2698
2250
|
}
|
|
2699
2251
|
refreshEditor() {
|
|
2700
2252
|
if (+this.selectedId < 0 && +this.hoveredId < 0)
|
|
2701
2253
|
return;
|
|
2702
|
-
const e = this.getById(this.selectedId) || this.getById(this.hoveredId),
|
|
2254
|
+
const e = this.getById(this.selectedId) || this.getById(this.hoveredId), s = vt(e), i = this.ogma.view.graphToScreenCoordinates(
|
|
2703
2255
|
yt(e)
|
|
2704
|
-
),
|
|
2256
|
+
), l = this.ogma.view.getZoom(), {
|
|
2705
2257
|
font: c,
|
|
2706
|
-
fontSize:
|
|
2707
|
-
color:
|
|
2708
|
-
background:
|
|
2709
|
-
padding:
|
|
2710
|
-
} = e.properties.style ||
|
|
2711
|
-
this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${
|
|
2258
|
+
fontSize: f,
|
|
2259
|
+
color: p,
|
|
2260
|
+
background: d,
|
|
2261
|
+
padding: v = 0
|
|
2262
|
+
} = e.properties.style || Ut, y = (f || 1) * l;
|
|
2263
|
+
this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${s.width / 2 * l}px, ${s.height / 2 * l}px)`, this.editor.element.style.width = `${s.width * l}px`, this.editor.element.style.height = `${s.height * l}px`, this.textArea.style.font = `${y} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${y}px`, this.textArea.style.padding = `${l * v}px`, this.textArea.style.lineHeight = `${y}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = p || "black", this.textArea.style.background = d || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
|
|
2712
2264
|
}
|
|
2713
2265
|
select(e) {
|
|
2714
2266
|
super.select(e), this.textArea.focus();
|
|
@@ -2717,60 +2269,60 @@ class un extends $r {
|
|
|
2717
2269
|
super.destroy(), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("mousemove", this.onMouseMove, !0), this.ogma.events.off(this.onViewChanged);
|
|
2718
2270
|
}
|
|
2719
2271
|
}
|
|
2720
|
-
class
|
|
2272
|
+
class mn {
|
|
2721
2273
|
constructor() {
|
|
2722
2274
|
x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
|
|
2723
2275
|
}
|
|
2724
|
-
add(e,
|
|
2725
|
-
const
|
|
2726
|
-
id:
|
|
2727
|
-
arrow:
|
|
2276
|
+
add(e, s, i, l, c) {
|
|
2277
|
+
const f = ze(), p = e.id, d = {
|
|
2278
|
+
id: f,
|
|
2279
|
+
arrow: p,
|
|
2728
2280
|
target: i,
|
|
2729
|
-
targetType:
|
|
2281
|
+
targetType: l,
|
|
2730
2282
|
connectionPoint: c,
|
|
2731
|
-
side:
|
|
2283
|
+
side: s
|
|
2732
2284
|
};
|
|
2733
|
-
return this.links[
|
|
2285
|
+
return this.links[f] = d, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(f), this.linksByArrowId[p] || (this.linksByArrowId[p] = {}), this.linksByArrowId[p][s] = f, e.properties.link = e.properties.link || {}, e.properties.link[s] = {
|
|
2734
2286
|
id: i,
|
|
2735
|
-
side:
|
|
2736
|
-
type:
|
|
2287
|
+
side: s,
|
|
2288
|
+
type: l,
|
|
2737
2289
|
magnet: c
|
|
2738
2290
|
}, this;
|
|
2739
2291
|
}
|
|
2740
|
-
arrowIsLinked(e,
|
|
2292
|
+
arrowIsLinked(e, s) {
|
|
2741
2293
|
var i;
|
|
2742
|
-
return !!((i = this.linksByArrowId[e]) != null && i[
|
|
2294
|
+
return !!((i = this.linksByArrowId[e]) != null && i[s]);
|
|
2743
2295
|
}
|
|
2744
2296
|
// remove the link between the arrow and the target by arrow id and side
|
|
2745
|
-
remove(e,
|
|
2746
|
-
var i,
|
|
2747
|
-
const c = e.id,
|
|
2748
|
-
if ((
|
|
2297
|
+
remove(e, s) {
|
|
2298
|
+
var i, l;
|
|
2299
|
+
const c = e.id, f = (i = this.linksByArrowId[c]) == null ? void 0 : i[s];
|
|
2300
|
+
if ((l = e.properties.link) == null || delete l[s], !f)
|
|
2749
2301
|
return this;
|
|
2750
|
-
const
|
|
2751
|
-
delete this.links[
|
|
2752
|
-
const
|
|
2753
|
-
for (let
|
|
2754
|
-
if (
|
|
2755
|
-
|
|
2302
|
+
const p = this.links[f];
|
|
2303
|
+
delete this.links[f];
|
|
2304
|
+
const d = this.linksByTargetId[p.target];
|
|
2305
|
+
for (let v = 0; v < d.length; v++)
|
|
2306
|
+
if (d[v] === f) {
|
|
2307
|
+
d.splice(v, 1);
|
|
2756
2308
|
break;
|
|
2757
2309
|
}
|
|
2758
|
-
return delete this.linksByArrowId[c][
|
|
2310
|
+
return delete this.linksByArrowId[c][s], this;
|
|
2759
2311
|
}
|
|
2760
|
-
getArrowLink(e,
|
|
2312
|
+
getArrowLink(e, s) {
|
|
2761
2313
|
var i;
|
|
2762
|
-
const
|
|
2763
|
-
return
|
|
2314
|
+
const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[s];
|
|
2315
|
+
return l ? this.links[l] : null;
|
|
2764
2316
|
}
|
|
2765
|
-
getTargetLinks(e,
|
|
2317
|
+
getTargetLinks(e, s) {
|
|
2766
2318
|
var i;
|
|
2767
|
-
return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((
|
|
2319
|
+
return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === s)) ?? [];
|
|
2768
2320
|
}
|
|
2769
2321
|
forEach(e) {
|
|
2770
2322
|
Object.values(this.links).forEach(e);
|
|
2771
2323
|
}
|
|
2772
2324
|
}
|
|
2773
|
-
const lt = (
|
|
2325
|
+
const lt = (h) => h.properties.type === "arrow", wt = (h) => h.properties.type === "text", Er = (h) => h.type === "FeatureCollection", bn = {
|
|
2774
2326
|
magnetColor: "#3e8",
|
|
2775
2327
|
detectMargin: 20,
|
|
2776
2328
|
magnetHandleRadius: 5,
|
|
@@ -2780,7 +2332,7 @@ const lt = (p) => p.properties.type === "arrow", wt = (p) => p.properties.type =
|
|
|
2780
2332
|
textHandleSize: 3.5,
|
|
2781
2333
|
minArrowHeight: 20,
|
|
2782
2334
|
maxArrowHeight: 30
|
|
2783
|
-
},
|
|
2335
|
+
}, _r = ["start", "end"], kr = [
|
|
2784
2336
|
{ x: 0, y: 0 },
|
|
2785
2337
|
{ x: 0.5, y: 0 },
|
|
2786
2338
|
{ x: 1, y: 0 },
|
|
@@ -2790,128 +2342,129 @@ const lt = (p) => p.properties.type === "arrow", wt = (p) => p.properties.type =
|
|
|
2790
2342
|
{ x: 0.5, y: 1 },
|
|
2791
2343
|
{ x: 1, y: 1 }
|
|
2792
2344
|
];
|
|
2793
|
-
class
|
|
2794
|
-
constructor(e,
|
|
2795
|
-
super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new
|
|
2345
|
+
class wn extends Nr {
|
|
2346
|
+
constructor(e, s = {}) {
|
|
2347
|
+
super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new mn()), x(this, "layer"), x(this, "annotations"), x(this, "ogma"), x(this, "options"), x(this, "selected", null), x(this, "updateTimeout", 0), x(this, "hoveredNode", null), x(this, "dragged", null), x(this, "textToMagnet"), x(this, "activeLinks", []), x(this, "_render", (i) => {
|
|
2796
2348
|
if (!this.dragged || this.textToMagnet === void 0)
|
|
2797
2349
|
return;
|
|
2798
2350
|
i.beginPath(), i.fillStyle = "green";
|
|
2799
|
-
const
|
|
2800
|
-
|
|
2351
|
+
const l = this.ogma.view.getZoom();
|
|
2352
|
+
kr.forEach((c) => {
|
|
2801
2353
|
if (!this.textToMagnet)
|
|
2802
2354
|
return;
|
|
2803
|
-
const
|
|
2804
|
-
i.moveTo(
|
|
2355
|
+
const f = vt(this.textToMagnet), p = yt(this.textToMagnet), d = Fe(c, { x: f.width, y: f.height }), v = st(d, this.ogma.view.getAngle()), { x: y, y: _ } = Ht(v, p);
|
|
2356
|
+
i.moveTo(y, _), i.arc(y, _, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
|
|
2805
2357
|
}), i.fill(), i.closePath();
|
|
2806
|
-
}), x(this, "_onFeatureDrag", (i,
|
|
2807
|
-
const c =
|
|
2358
|
+
}), x(this, "_onFeatureDrag", (i, l) => {
|
|
2359
|
+
const c = l;
|
|
2808
2360
|
if (lt(i) && c === "line")
|
|
2809
|
-
["start", "end"].find((
|
|
2810
|
-
const
|
|
2811
|
-
return this._snapToText(i, c,
|
|
2361
|
+
["start", "end"].find((f) => {
|
|
2362
|
+
const p = f === "start" ? fe(i) : $e(i);
|
|
2363
|
+
return this._snapToText(i, c, p) || this._findAndSnapToNode(i, f, p);
|
|
2812
2364
|
});
|
|
2813
2365
|
else if (lt(i) && c !== "line") {
|
|
2814
|
-
const
|
|
2815
|
-
this._snapToText(i, c,
|
|
2366
|
+
const f = c === "start" ? fe(i) : $e(i);
|
|
2367
|
+
this._snapToText(i, c, f) || this._findAndSnapToNode(i, c, f);
|
|
2816
2368
|
} else
|
|
2817
|
-
wt(i) && (this.activeLinks.forEach(({ arrow:
|
|
2818
|
-
const
|
|
2819
|
-
|
|
2369
|
+
wt(i) && (this.activeLinks.forEach(({ arrow: f, side: p, connectionPoint: d }) => {
|
|
2370
|
+
const v = this.getAnnotation(f), y = vt(i), _ = yt(i), C = Fe(d, { x: y.width, y: y.height }), E = st(C, this.ogma.view.getAngle()), P = Ht(E, _);
|
|
2371
|
+
v.geometry.coordinates[p === "start" ? 0 : 1] = [P.x, P.y];
|
|
2820
2372
|
}), this.activeLinks.length && this.arrows.refreshLayer());
|
|
2821
|
-
this.layer.refresh(), this.emit(
|
|
2373
|
+
this.layer.refresh(), this.emit(De, i, l);
|
|
2822
2374
|
}), x(this, "_onFeatureDragEnd", (i) => {
|
|
2823
|
-
this.dragged !== null && lt(i) &&
|
|
2824
|
-
this.links.getArrowLink(i.id,
|
|
2375
|
+
this.dragged !== null && lt(i) && fe(this.dragged) && _r.forEach((l) => {
|
|
2376
|
+
this.links.getArrowLink(i.id, l) && this.emit(un, {
|
|
2825
2377
|
arrow: i,
|
|
2826
|
-
link: this.links.getArrowLink(i.id,
|
|
2378
|
+
link: this.links.getArrowLink(i.id, l)
|
|
2827
2379
|
});
|
|
2828
|
-
}), (wt(i) || lt(i)) && this.onUpdate(i), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((
|
|
2380
|
+
}), (wt(i) || lt(i)) && this.onUpdate(i), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((l) => l.enableDetection()), this.layer.refresh(), this.emit(Vt, i);
|
|
2829
2381
|
}), x(this, "_onFeatureDragStart", (i) => {
|
|
2830
|
-
this.textToMagnet = void 0, lt(i) ? this.dragged = i : wt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((
|
|
2831
|
-
const c =
|
|
2832
|
-
c && c !== i &&
|
|
2833
|
-
}), this.emit(
|
|
2382
|
+
this.textToMagnet = void 0, lt(i) ? this.dragged = i : wt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((l) => {
|
|
2383
|
+
const c = l.getSelectedFeature();
|
|
2384
|
+
c && c !== i && l.unhover().unselect(), l.disableDetection();
|
|
2385
|
+
}), this.emit(Me, i);
|
|
2834
2386
|
}), x(this, "_onNodesDragStart", () => {
|
|
2835
2387
|
this.arrows.unhover().unselect(), this.texts.unhover().unselect();
|
|
2836
2388
|
}), x(this, "_onNodesDrag", (i) => {
|
|
2837
|
-
const { dx:
|
|
2838
|
-
this._moveNodes(i.nodes,
|
|
2389
|
+
const { dx: l, dy: c } = i;
|
|
2390
|
+
this._moveNodes(i.nodes, l, c);
|
|
2839
2391
|
}), x(this, "_onLayoutEnd", (i) => {
|
|
2840
|
-
i.ids.forEach((
|
|
2841
|
-
this.links.getTargetLinks(
|
|
2842
|
-
const
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
),
|
|
2846
|
-
|
|
2392
|
+
i.ids.forEach((l, c) => {
|
|
2393
|
+
this.links.getTargetLinks(l, "node").forEach((f) => {
|
|
2394
|
+
const p = this.getAnnotation(f.arrow), d = f.side, v = Ie(
|
|
2395
|
+
p,
|
|
2396
|
+
d === "start" ? "end" : "start"
|
|
2397
|
+
), y = i.positions.current[c], _ = this.ogma.getNode(l).getAttribute("radius"), C = Le(v, y, +_);
|
|
2398
|
+
Bt(p, d, C.x, C.y);
|
|
2847
2399
|
});
|
|
2848
2400
|
}), this.arrows.refreshLayer(), this.texts.refreshLayer();
|
|
2849
2401
|
}), x(this, "_onAdded", (i) => {
|
|
2850
|
-
this.emit(
|
|
2402
|
+
this.emit(ur, i);
|
|
2851
2403
|
}), x(this, "_onRemoved", (i) => {
|
|
2852
|
-
this.emit(
|
|
2404
|
+
this.emit(hr, i);
|
|
2853
2405
|
}), x(this, "_onUnselect", (i) => {
|
|
2854
|
-
this.selected = null, this.emit(
|
|
2406
|
+
this.selected = null, this.emit(lr, i);
|
|
2855
2407
|
}), x(this, "_onSelect", (i) => {
|
|
2856
|
-
this.selected !== i && (this.selected = i, this.emit(
|
|
2408
|
+
this.selected !== i && (this.selected = i, this.emit(ar, this.selected));
|
|
2857
2409
|
}), x(this, "onUpdate", (i) => {
|
|
2858
2410
|
cancelAnimationFrame(this.updateTimeout), this.updateTimeout = requestAnimationFrame(
|
|
2859
2411
|
() => this._onUpdate(i)
|
|
2860
2412
|
);
|
|
2861
2413
|
}), x(this, "_onUpdate", (i) => {
|
|
2862
|
-
this.emit(
|
|
2863
|
-
}), this.options = this.setOptions({ ...
|
|
2864
|
-
i.on(
|
|
2414
|
+
this.emit(cr, i);
|
|
2415
|
+
}), this.options = this.setOptions({ ...bn, ...s }), this.ogma = e, this.arrows = new fn(e, this.options), this.texts = new vn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
|
|
2416
|
+
i.on(Me, this._onFeatureDragStart).on(De, this._onFeatureDrag).on(Vt, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(ur, this._onAdded).on(hr, this._onRemoved);
|
|
2865
2417
|
}), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
|
|
2866
2418
|
this.refreshTextLinks();
|
|
2867
2419
|
}), this.layer = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
|
|
2868
2420
|
}
|
|
2869
|
-
_moveNodes(e,
|
|
2870
|
-
e.forEach((
|
|
2871
|
-
const c = this.links.getTargetLinks(
|
|
2872
|
-
c.forEach((
|
|
2873
|
-
const
|
|
2874
|
-
|
|
2875
|
-
|
|
2421
|
+
_moveNodes(e, s, i) {
|
|
2422
|
+
e.forEach((l) => {
|
|
2423
|
+
const c = this.links.getTargetLinks(l.getId(), "node"), f = l.getPosition();
|
|
2424
|
+
c.forEach((p) => {
|
|
2425
|
+
const d = this.getAnnotation(p.arrow), v = p.side, y = Ie(
|
|
2426
|
+
d,
|
|
2427
|
+
v === "start" ? "end" : "start"
|
|
2876
2428
|
);
|
|
2877
|
-
let
|
|
2878
|
-
const
|
|
2879
|
-
(
|
|
2429
|
+
let _ = f;
|
|
2430
|
+
const C = +l.getAttribute("radius"), E = 1e-6;
|
|
2431
|
+
(p.connectionPoint.x - (f.x - s) > E || p.connectionPoint.y - (f.y - i) > E) && (_ = Le(y, f, C)), Bt(d, v, _.x, _.y);
|
|
2880
2432
|
});
|
|
2881
2433
|
}), this.arrows.refreshLayer();
|
|
2882
2434
|
}
|
|
2883
|
-
_snapToText(e,
|
|
2884
|
-
const
|
|
2885
|
-
if (this.links.remove(e,
|
|
2435
|
+
_snapToText(e, s, i) {
|
|
2436
|
+
const l = this.texts.detect(i, this.options.detectMargin);
|
|
2437
|
+
if (this.links.remove(e, s), !l)
|
|
2886
2438
|
return !1;
|
|
2887
|
-
this.textToMagnet =
|
|
2888
|
-
const c = this.findMagnetPoint(
|
|
2889
|
-
return c ? (
|
|
2890
|
-
}
|
|
2891
|
-
_findAndSnapToNode(e,
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2439
|
+
this.textToMagnet = l;
|
|
2440
|
+
const c = this.findMagnetPoint(kr, l, i);
|
|
2441
|
+
return c ? (Bt(e, s, c.point.x, c.point.y), this.links.add(e, s, l.id, "text", c.magnet), !0) : !1;
|
|
2442
|
+
}
|
|
2443
|
+
_findAndSnapToNode(e, s, i) {
|
|
2444
|
+
var l, c;
|
|
2445
|
+
const f = this.ogma.view.graphToScreenCoordinates(i), p = this.ogma.view.getElementAt(f);
|
|
2446
|
+
this.links.remove(e, s), p && p.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = p, p.setSelected(!0), this._snapToNode(e, s, p, f)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
|
|
2447
|
+
}
|
|
2448
|
+
_snapToNode(e, s, i, l) {
|
|
2449
|
+
const c = i.getPositionOnScreen(), f = +i.getAttribute("radius"), p = f * this.ogma.view.getZoom(), d = l.x - c.x, v = l.y - c.y, y = Math.sqrt(d * d + v * v), _ = i.getPosition();
|
|
2450
|
+
if (y < p + this.options.detectMargin) {
|
|
2451
|
+
let C = _;
|
|
2452
|
+
if (y > p / 2) {
|
|
2453
|
+
const E = Ie(e, s === "end" ? "start" : "end");
|
|
2454
|
+
C = Le(E, C, f);
|
|
2902
2455
|
}
|
|
2903
|
-
|
|
2456
|
+
Bt(e, s, C.x, C.y), this.links.add(e, s, i.getId(), "node", C);
|
|
2904
2457
|
}
|
|
2905
2458
|
}
|
|
2906
2459
|
refreshTextLinks() {
|
|
2907
2460
|
let e = !1;
|
|
2908
2461
|
this.links.forEach(
|
|
2909
|
-
({ connectionPoint:
|
|
2462
|
+
({ connectionPoint: s, targetType: i, target: l, arrow: c, side: f }) => {
|
|
2910
2463
|
if (i !== "text")
|
|
2911
2464
|
return;
|
|
2912
2465
|
e = !0;
|
|
2913
|
-
const
|
|
2914
|
-
|
|
2466
|
+
const p = this.getAnnotation(l), d = this.getAnnotation(c), v = vt(p), y = yt(p), _ = Fe(s, { x: v.width, y: v.height }), C = st(_, this.ogma.view.getAngle()), E = Ht(C, y);
|
|
2467
|
+
Bt(d, f, E.x, E.y);
|
|
2915
2468
|
}
|
|
2916
2469
|
), e && this.arrows.refreshLayer();
|
|
2917
2470
|
}
|
|
@@ -2921,24 +2474,24 @@ class dn extends jr {
|
|
|
2921
2474
|
getSelected() {
|
|
2922
2475
|
return this.selected;
|
|
2923
2476
|
}
|
|
2924
|
-
findMagnetPoint(e,
|
|
2925
|
-
let
|
|
2477
|
+
findMagnetPoint(e, s, i) {
|
|
2478
|
+
let l;
|
|
2926
2479
|
for (const c of e) {
|
|
2927
|
-
const
|
|
2480
|
+
const f = vt(s), p = yt(s), d = Fe(c, { x: f.width, y: f.height }), v = st(d, this.ogma.view.getAngle()), y = Ht(v, p), _ = Wt(Ct(y, i)), C = Math.min(
|
|
2928
2481
|
this.options.magnetRadius * this.ogma.view.getZoom(),
|
|
2929
2482
|
// when really zoomed in: avoid to snap on too far away magnets
|
|
2930
|
-
|
|
2931
|
-
|
|
2483
|
+
f.width / 2,
|
|
2484
|
+
f.height / 2
|
|
2932
2485
|
);
|
|
2933
|
-
if (
|
|
2934
|
-
|
|
2935
|
-
point:
|
|
2486
|
+
if (_ < Math.max(C, this.options.magnetHandleRadius)) {
|
|
2487
|
+
l = {
|
|
2488
|
+
point: y,
|
|
2936
2489
|
magnet: c
|
|
2937
2490
|
};
|
|
2938
2491
|
break;
|
|
2939
2492
|
}
|
|
2940
2493
|
}
|
|
2941
|
-
return
|
|
2494
|
+
return l;
|
|
2942
2495
|
}
|
|
2943
2496
|
/**
|
|
2944
2497
|
* Set the options for the controller
|
|
@@ -2956,8 +2509,8 @@ class dn extends jr {
|
|
|
2956
2509
|
* @param id the id of the annotation to select
|
|
2957
2510
|
*/
|
|
2958
2511
|
select(e) {
|
|
2959
|
-
const
|
|
2960
|
-
return
|
|
2512
|
+
const s = this.getAnnotations().features.find((i) => i.id === e);
|
|
2513
|
+
return s ? (lt(s) ? this.arrows.select(s.id) : wt(s) && this.texts.select(s.id), this) : this;
|
|
2961
2514
|
}
|
|
2962
2515
|
/**
|
|
2963
2516
|
* Unselects the currently selected annotation
|
|
@@ -2970,12 +2523,12 @@ class dn extends jr {
|
|
|
2970
2523
|
* @param annotation The annotation to add
|
|
2971
2524
|
*/
|
|
2972
2525
|
add(e) {
|
|
2973
|
-
if (
|
|
2974
|
-
const [
|
|
2975
|
-
(
|
|
2526
|
+
if (Er(e)) {
|
|
2527
|
+
const [s, i] = e.features.reduce(
|
|
2528
|
+
(l, c) => (lt(c) ? l[1].push(c) : wt(c) && l[0].push(c), l),
|
|
2976
2529
|
[[], []]
|
|
2977
2530
|
);
|
|
2978
|
-
return
|
|
2531
|
+
return s.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
|
|
2979
2532
|
}
|
|
2980
2533
|
switch (e.properties.type) {
|
|
2981
2534
|
case "text":
|
|
@@ -2992,29 +2545,29 @@ class dn extends jr {
|
|
|
2992
2545
|
* @param annotation The annotation(s) to remove
|
|
2993
2546
|
*/
|
|
2994
2547
|
remove(e) {
|
|
2995
|
-
return
|
|
2996
|
-
(
|
|
2548
|
+
return Er(e) ? (e.features.forEach(
|
|
2549
|
+
(s) => this.remove(s)
|
|
2997
2550
|
), this) : (lt(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
|
|
2998
2551
|
}
|
|
2999
2552
|
loadLink(e) {
|
|
3000
2553
|
if (e.properties.link)
|
|
3001
|
-
for (const
|
|
3002
|
-
const i = e.properties.link[
|
|
2554
|
+
for (const s of _r) {
|
|
2555
|
+
const i = e.properties.link[s];
|
|
3003
2556
|
if (!i)
|
|
3004
2557
|
continue;
|
|
3005
|
-
const
|
|
3006
|
-
if (i.type === "text" &&
|
|
3007
|
-
this.links.add(e,
|
|
2558
|
+
const l = this.getAnnotation(i.id);
|
|
2559
|
+
if (i.type === "text" && l)
|
|
2560
|
+
this.links.add(e, s, i.id, i.type, i.magnet);
|
|
3008
2561
|
else if (i.type === "node") {
|
|
3009
2562
|
const c = this.ogma.getNode(i.id);
|
|
3010
2563
|
if (!c)
|
|
3011
2564
|
continue;
|
|
3012
|
-
this.links.add(e,
|
|
3013
|
-
const
|
|
2565
|
+
this.links.add(e, s, i.id, i.type, i.magnet);
|
|
2566
|
+
const f = c.getPosition(), p = c.getAttribute("radius") || 0, d = Ie(
|
|
3014
2567
|
e,
|
|
3015
|
-
|
|
3016
|
-
),
|
|
3017
|
-
|
|
2568
|
+
s === "start" ? "end" : "start"
|
|
2569
|
+
), v = Le(d, f, +p);
|
|
2570
|
+
Bt(e, s, v.x, v.y);
|
|
3018
2571
|
}
|
|
3019
2572
|
}
|
|
3020
2573
|
}
|
|
@@ -3024,8 +2577,8 @@ class dn extends jr {
|
|
|
3024
2577
|
* @param y coord of the first point
|
|
3025
2578
|
* @param arrow The arrow to add
|
|
3026
2579
|
*/
|
|
3027
|
-
startArrow(e,
|
|
3028
|
-
this.cancelDrawing(), this.arrows.startDrawing(e,
|
|
2580
|
+
startArrow(e, s, i) {
|
|
2581
|
+
this.cancelDrawing(), this.arrows.startDrawing(e, s, i);
|
|
3029
2582
|
}
|
|
3030
2583
|
/**
|
|
3031
2584
|
* Start adding a text (add it, and give control to the user)
|
|
@@ -3033,23 +2586,23 @@ class dn extends jr {
|
|
|
3033
2586
|
* @param y coord of the top left point
|
|
3034
2587
|
* @param text The text to add
|
|
3035
2588
|
*/
|
|
3036
|
-
startText(e,
|
|
3037
|
-
this.cancelDrawing(), this.texts.startDrawing(e,
|
|
2589
|
+
startText(e, s, i) {
|
|
2590
|
+
this.cancelDrawing(), this.texts.startDrawing(e, s, i);
|
|
3038
2591
|
}
|
|
3039
2592
|
/**
|
|
3040
2593
|
* Cancel drawing on the current frame
|
|
3041
2594
|
*/
|
|
3042
2595
|
cancelDrawing() {
|
|
3043
|
-
this.annotations.forEach((e) => e.cancelDrawing()), this.emit(
|
|
2596
|
+
this.annotations.forEach((e) => e.cancelDrawing()), this.emit(hn);
|
|
3044
2597
|
}
|
|
3045
2598
|
/**
|
|
3046
2599
|
* Update the style of the annotation with the given id
|
|
3047
2600
|
* @param id The id of the annotation to update
|
|
3048
2601
|
* @param style The new style
|
|
3049
2602
|
*/
|
|
3050
|
-
updateStyle(e,
|
|
3051
|
-
const i = this.getAnnotations().features.find((
|
|
3052
|
-
return i ? (lt(i) ? this.arrows.updateStyle(i,
|
|
2603
|
+
updateStyle(e, s) {
|
|
2604
|
+
const i = this.getAnnotations().features.find((l) => l.id === e);
|
|
2605
|
+
return i ? (lt(i) ? this.arrows.updateStyle(i, s) : wt(i) && this.texts.updateStyle(i, s), this.onUpdate(i), this) : this;
|
|
3053
2606
|
}
|
|
3054
2607
|
/**
|
|
3055
2608
|
*
|
|
@@ -3060,8 +2613,8 @@ class dn extends jr {
|
|
|
3060
2613
|
type: "FeatureCollection",
|
|
3061
2614
|
features: []
|
|
3062
2615
|
};
|
|
3063
|
-
return this.annotations.forEach((
|
|
3064
|
-
e.features = [...e.features, ...
|
|
2616
|
+
return this.annotations.forEach((s) => {
|
|
2617
|
+
e.features = [...e.features, ...s.getElements()];
|
|
3065
2618
|
}), e;
|
|
3066
2619
|
}
|
|
3067
2620
|
/**
|
|
@@ -3070,7 +2623,7 @@ class dn extends jr {
|
|
|
3070
2623
|
* @returns The annotation with the given id
|
|
3071
2624
|
*/
|
|
3072
2625
|
getAnnotation(e) {
|
|
3073
|
-
return this.getAnnotations().features.find((
|
|
2626
|
+
return this.getAnnotations().features.find((s) => s.id === e);
|
|
3074
2627
|
}
|
|
3075
2628
|
/**
|
|
3076
2629
|
* Destroy the controller and its elements
|
|
@@ -3079,7 +2632,7 @@ class dn extends jr {
|
|
|
3079
2632
|
this.annotations.forEach((e) => e.destroy()), this.layer.destroy();
|
|
3080
2633
|
}
|
|
3081
2634
|
}
|
|
3082
|
-
const
|
|
2635
|
+
const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Wr = "#333333", Cn = [
|
|
3083
2636
|
"#FFFFFF",
|
|
3084
2637
|
"#F44E3B",
|
|
3085
2638
|
"#FE9200",
|
|
@@ -3092,7 +2645,7 @@ const Sr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Ar = "none", Dr = "#333333",
|
|
|
3092
2645
|
"#333333",
|
|
3093
2646
|
"#808080",
|
|
3094
2647
|
"#cccccc"
|
|
3095
|
-
],
|
|
2648
|
+
], On = [
|
|
3096
2649
|
"Roboto",
|
|
3097
2650
|
"Helvetica Neue",
|
|
3098
2651
|
"Helvetica",
|
|
@@ -3104,120 +2657,120 @@ const Sr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Ar = "none", Dr = "#333333",
|
|
|
3104
2657
|
"Consolas",
|
|
3105
2658
|
"Courier New",
|
|
3106
2659
|
"monospace"
|
|
3107
|
-
].sort((
|
|
2660
|
+
].sort((h, e) => h.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), xn = {
|
|
3108
2661
|
head: "arrow",
|
|
3109
|
-
strokeColor:
|
|
2662
|
+
strokeColor: Wr,
|
|
3110
2663
|
strokeWidth: 5
|
|
3111
|
-
},
|
|
2664
|
+
}, An = 0.25, En = {
|
|
3112
2665
|
font: "Roboto",
|
|
3113
|
-
fontSize:
|
|
3114
|
-
padding:
|
|
3115
|
-
color:
|
|
3116
|
-
strokeType:
|
|
3117
|
-
background:
|
|
2666
|
+
fontSize: Tr[2],
|
|
2667
|
+
padding: Tr[2] * An,
|
|
2668
|
+
color: Wr,
|
|
2669
|
+
strokeType: Sr,
|
|
2670
|
+
background: Sr
|
|
3118
2671
|
};
|
|
3119
|
-
function
|
|
3120
|
-
return
|
|
2672
|
+
function _n(h) {
|
|
2673
|
+
return h.reduce((e, s) => e + s, 0) / h.length;
|
|
3121
2674
|
}
|
|
3122
|
-
function
|
|
3123
|
-
return e + (
|
|
2675
|
+
function Pn(h, e = 0, s = 1) {
|
|
2676
|
+
return e + (s - e) * h;
|
|
3124
2677
|
}
|
|
3125
|
-
function
|
|
3126
|
-
return (
|
|
2678
|
+
function Rn(h, e = 0, s = 1) {
|
|
2679
|
+
return (h - e) / (s - e);
|
|
3127
2680
|
}
|
|
3128
|
-
function
|
|
3129
|
-
return
|
|
2681
|
+
function In() {
|
|
2682
|
+
return Or(null);
|
|
3130
2683
|
}
|
|
3131
|
-
const
|
|
2684
|
+
const Ur = Or(
|
|
3132
2685
|
void 0
|
|
3133
|
-
),
|
|
2686
|
+
), Ln = () => qr(Ur), kn = (h, e) => {
|
|
3134
2687
|
switch (e.type) {
|
|
3135
2688
|
case "add":
|
|
3136
2689
|
return {
|
|
3137
|
-
...
|
|
3138
|
-
features: [...
|
|
2690
|
+
...h,
|
|
2691
|
+
features: [...h.features, e.payload]
|
|
3139
2692
|
};
|
|
3140
2693
|
case "remove":
|
|
3141
2694
|
return {
|
|
3142
|
-
...
|
|
3143
|
-
features:
|
|
2695
|
+
...h,
|
|
2696
|
+
features: h.features.filter((s) => s.id !== e.payload.id)
|
|
3144
2697
|
};
|
|
3145
2698
|
case "update":
|
|
3146
2699
|
return {
|
|
3147
|
-
...
|
|
3148
|
-
features:
|
|
3149
|
-
(
|
|
2700
|
+
...h,
|
|
2701
|
+
features: h.features.map(
|
|
2702
|
+
(s) => s.id === e.payload.id ? e.payload : s
|
|
3150
2703
|
)
|
|
3151
2704
|
};
|
|
3152
2705
|
default:
|
|
3153
|
-
return
|
|
2706
|
+
return h;
|
|
3154
2707
|
}
|
|
3155
|
-
},
|
|
3156
|
-
const e =
|
|
2708
|
+
}, Fn = ({ children: h }) => {
|
|
2709
|
+
const e = Xr(), [s, i] = Yr(kn, {
|
|
3157
2710
|
type: "FeatureCollection",
|
|
3158
2711
|
features: []
|
|
3159
|
-
}), [
|
|
3160
|
-
return
|
|
2712
|
+
}), [l, c] = Nt(null), [f, p] = Nt(xn), [d, v] = Nt(En), [y, _] = Nt(), [C, E] = Nt(1), [P, S] = Nt(1);
|
|
2713
|
+
return er(() => {
|
|
3161
2714
|
if (!e)
|
|
3162
2715
|
return;
|
|
3163
|
-
const
|
|
2716
|
+
const $ = new wn(e, {
|
|
3164
2717
|
minArrowHeight: 1
|
|
3165
|
-
}),
|
|
3166
|
-
return
|
|
3167
|
-
...
|
|
3168
|
-
strokeWidth: (
|
|
3169
|
-
}),
|
|
3170
|
-
lt(
|
|
3171
|
-
...
|
|
3172
|
-
}) : wt(
|
|
3173
|
-
...
|
|
3174
|
-
}), c(
|
|
2718
|
+
}), L = _n(e.getNodes().getAttribute("radius")) / 5, T = C;
|
|
2719
|
+
return p({
|
|
2720
|
+
...f,
|
|
2721
|
+
strokeWidth: (f.strokeWidth || 1) * T
|
|
2722
|
+
}), E(T), S(L), $.on("select", (B) => {
|
|
2723
|
+
lt(B) ? p({
|
|
2724
|
+
...B.properties.style || {}
|
|
2725
|
+
}) : wt(B) && v({
|
|
2726
|
+
...B.properties.style || {}
|
|
2727
|
+
}), c(B);
|
|
3175
2728
|
}).on("unselect", () => {
|
|
3176
2729
|
c(null);
|
|
3177
|
-
}),
|
|
3178
|
-
|
|
2730
|
+
}), _($), () => {
|
|
2731
|
+
y == null || y.destroy();
|
|
3179
2732
|
};
|
|
3180
|
-
}, [e]),
|
|
3181
|
-
|
|
3182
|
-
}, [
|
|
3183
|
-
|
|
3184
|
-
}, [
|
|
3185
|
-
|
|
2733
|
+
}, [e]), er(() => {
|
|
2734
|
+
y && l && (l == null ? void 0 : l.properties.type) === "arrow" && y.updateStyle(l.id, f);
|
|
2735
|
+
}, [y, f, l]), er(() => {
|
|
2736
|
+
y && l && (l == null ? void 0 : l.properties.type) === "text" && y.updateStyle(l.id, d);
|
|
2737
|
+
}, [y, d, l]), /* @__PURE__ */ Zr.jsx(
|
|
2738
|
+
Ur.Provider,
|
|
3186
2739
|
{
|
|
3187
2740
|
value: {
|
|
3188
|
-
annotations:
|
|
2741
|
+
annotations: s,
|
|
3189
2742
|
updateAnnotations: i,
|
|
3190
|
-
currentAnnotation:
|
|
2743
|
+
currentAnnotation: l,
|
|
3191
2744
|
setCurrentAnnotation: c,
|
|
3192
|
-
textStyle:
|
|
3193
|
-
setTextStyle:
|
|
3194
|
-
arrowStyle:
|
|
3195
|
-
setArrowStyle:
|
|
3196
|
-
arrowWidthFactor:
|
|
3197
|
-
setArrowWidthFactor:
|
|
2745
|
+
textStyle: d,
|
|
2746
|
+
setTextStyle: v,
|
|
2747
|
+
arrowStyle: f,
|
|
2748
|
+
setArrowStyle: p,
|
|
2749
|
+
arrowWidthFactor: C,
|
|
2750
|
+
setArrowWidthFactor: E,
|
|
3198
2751
|
textSizeFactor: P,
|
|
3199
|
-
setTextSizeFactor:
|
|
3200
|
-
editor:
|
|
3201
|
-
setEditor:
|
|
2752
|
+
setTextSizeFactor: S,
|
|
2753
|
+
editor: y,
|
|
2754
|
+
setEditor: _
|
|
3202
2755
|
},
|
|
3203
|
-
children:
|
|
2756
|
+
children: h
|
|
3204
2757
|
}
|
|
3205
2758
|
);
|
|
3206
2759
|
};
|
|
3207
2760
|
export {
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
2761
|
+
Ur as AnnotationsContext,
|
|
2762
|
+
Fn as AnnotationsContextProvider,
|
|
2763
|
+
Wr as BLACK,
|
|
2764
|
+
An as RELATIVE_PADDING,
|
|
2765
|
+
Sr as TRANSPARENT,
|
|
2766
|
+
In as createAnnotationsContext,
|
|
2767
|
+
xn as defaultArrowStyle,
|
|
2768
|
+
Cn as defaultColors,
|
|
2769
|
+
En as defaultTextStyle,
|
|
2770
|
+
Tr as fontSizes,
|
|
2771
|
+
On as fonts,
|
|
2772
|
+
Pn as interpolate,
|
|
2773
|
+
_n as mean,
|
|
2774
|
+
Rn as normalize,
|
|
2775
|
+
Ln as useAnnotationsContext
|
|
3223
2776
|
};
|