presenter 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/navigator/navigatorHotReload.d.ts +4 -0
- package/dist/navigator/navigatorHotReload.test.d.ts +1 -0
- package/dist/navigator/openNavigator.d.ts +3 -2
- package/dist/presenter.js +2 -2
- package/dist/presenter.js.map +1 -1
- package/dist/presenter.mjs +1207 -1122
- package/dist/presenter.mjs.map +1 -1
- package/dist/renderer/browser-canvas/BrowserCanvasRenderer.d.ts +1 -0
- package/dist/utils/presentation/setupKeyEventListeners.d.ts +2 -1
- package/package.json +1 -1
package/dist/presenter.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var ie = Object.defineProperty;
|
|
2
|
+
var oe = (n, e, t) => e in n ? ie(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var I = (n, e, t) => oe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
const ft = {
|
|
5
5
|
/** Represents an animated change in an object's properties. */
|
|
6
6
|
ANIMATE: "Animate",
|
|
@@ -9,52 +9,52 @@ const ft = {
|
|
|
9
9
|
/** Represents an immediate update to an object's properties without animation. */
|
|
10
10
|
UPDATE: "Update"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function se(n) {
|
|
13
13
|
return n * n * n;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function ae(n) {
|
|
16
16
|
return --n * n * n + 1;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function he(n) {
|
|
19
19
|
return ((n *= 2) <= 1 ? n * n * n : (n -= 2) * n * n + 2) / 2;
|
|
20
20
|
}
|
|
21
|
-
var
|
|
21
|
+
var i0 = 1.70158;
|
|
22
22
|
(function n(e) {
|
|
23
23
|
e = +e;
|
|
24
24
|
function t(o) {
|
|
25
25
|
return (o = +o) * o * (e * (o - 1) + o);
|
|
26
26
|
}
|
|
27
27
|
return t.overshoot = n, t;
|
|
28
|
-
})(
|
|
28
|
+
})(i0);
|
|
29
29
|
(function n(e) {
|
|
30
30
|
e = +e;
|
|
31
31
|
function t(o) {
|
|
32
32
|
return --o * o * ((o + 1) * e + o) + 1;
|
|
33
33
|
}
|
|
34
34
|
return t.overshoot = n, t;
|
|
35
|
-
})(
|
|
36
|
-
var
|
|
35
|
+
})(i0);
|
|
36
|
+
var le = (function n(e) {
|
|
37
37
|
e = +e;
|
|
38
38
|
function t(o) {
|
|
39
39
|
return ((o *= 2) < 1 ? o * o * ((e + 1) * o - e) : (o -= 2) * o * ((e + 1) * o + e) + 2) / 2;
|
|
40
40
|
}
|
|
41
41
|
return t.overshoot = n, t;
|
|
42
|
-
})(
|
|
43
|
-
const
|
|
42
|
+
})(i0);
|
|
43
|
+
const o0 = {
|
|
44
44
|
LINEAR: (n) => n,
|
|
45
|
-
CUBIC:
|
|
46
|
-
CUBIC_IN:
|
|
47
|
-
CUBIC_OUT:
|
|
48
|
-
BACK_IN_OUT:
|
|
49
|
-
},
|
|
50
|
-
function
|
|
45
|
+
CUBIC: he,
|
|
46
|
+
CUBIC_IN: se,
|
|
47
|
+
CUBIC_OUT: ae,
|
|
48
|
+
BACK_IN_OUT: le.overshoot(0.8)
|
|
49
|
+
}, ce = o0.LINEAR;
|
|
50
|
+
function s0(n, e, t = {}) {
|
|
51
51
|
return {
|
|
52
52
|
type: ft.ANIMATE,
|
|
53
53
|
object: n,
|
|
54
54
|
props: e,
|
|
55
55
|
delay: 0,
|
|
56
56
|
duration: 1e3,
|
|
57
|
-
easing:
|
|
57
|
+
easing: ce,
|
|
58
58
|
block: !1,
|
|
59
59
|
interpolators: null,
|
|
60
60
|
isKey: !1,
|
|
@@ -62,21 +62,21 @@ function o0(n, e, t = {}) {
|
|
|
62
62
|
...typeof t == "number" ? { duration: t } : t
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function Nn(n, e = {}) {
|
|
66
|
+
return s0(n, { opacity: 1 }, {
|
|
67
67
|
duration: 500,
|
|
68
|
-
easing:
|
|
68
|
+
easing: o0.CUBIC,
|
|
69
69
|
...typeof e == "number" ? { duration: e } : e
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
72
|
+
function Rn(n, e = {}) {
|
|
73
|
+
return s0(n, { opacity: 0 }, {
|
|
74
74
|
duration: 500,
|
|
75
|
-
easing:
|
|
75
|
+
easing: o0.CUBIC,
|
|
76
76
|
...typeof e == "number" ? { duration: e } : e
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function D0(n, e, t = {}) {
|
|
80
80
|
return {
|
|
81
81
|
type: ft.UPDATE,
|
|
82
82
|
isKey: !1,
|
|
@@ -86,11 +86,11 @@ function F0(n, e, t = {}) {
|
|
|
86
86
|
...t
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
89
|
+
function Fn(n) {
|
|
90
|
+
return D0(n, { opacity: 0 });
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function Bn(n) {
|
|
93
|
+
return D0(n, { opacity: 1 });
|
|
94
94
|
}
|
|
95
95
|
const ot = {
|
|
96
96
|
TOP_LEFT: "TopLeft",
|
|
@@ -139,7 +139,7 @@ G.RED = G(255, 0, 0);
|
|
|
139
139
|
G.TRANSPARENT = G(0, 0, 0, 0);
|
|
140
140
|
G.WHITE = G(255, 255, 255);
|
|
141
141
|
const Q = { red: 0, green: 0, blue: 0, alpha: 1 };
|
|
142
|
-
function
|
|
142
|
+
function q0(n = null) {
|
|
143
143
|
return {
|
|
144
144
|
content: null,
|
|
145
145
|
setup: null,
|
|
@@ -151,14 +151,14 @@ function N0(n = null) {
|
|
|
151
151
|
...n
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function z0(n, e = null) {
|
|
155
155
|
return n.alpha * (e ?? 1);
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(
|
|
157
|
+
function St(n, e = null) {
|
|
158
|
+
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(z0(n, e) * 255);
|
|
159
159
|
return `#${a.toString(16).padStart(6, "0")}${s !== 255 ? s.toString(16).padStart(2, "0") : ""}`;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Dn(n = null) {
|
|
162
162
|
const {
|
|
163
163
|
url: e = "https://wikipedia.org/",
|
|
164
164
|
backgroundColor: t = G.TRANSPARENT,
|
|
@@ -168,30 +168,30 @@ function Sn(n = null) {
|
|
|
168
168
|
scale: s = 1,
|
|
169
169
|
anchor: r = ht,
|
|
170
170
|
height: h = 1e3,
|
|
171
|
-
width:
|
|
172
|
-
x:
|
|
173
|
-
y:
|
|
171
|
+
width: c = 1e3,
|
|
172
|
+
x: u = 0,
|
|
173
|
+
y: p = 0
|
|
174
174
|
} = n || {}, l = document.createElement("iframe");
|
|
175
|
-
l.src = e, l.style.backgroundColor =
|
|
175
|
+
l.src = e, l.style.backgroundColor = St(t), l.style.border = i > 0 ? `${i}px solid ${St(o)}` : "none", l.style.pointerEvents = a;
|
|
176
176
|
const f = (100 / s).toFixed(3) + "%";
|
|
177
|
-
return l.style.height = i === 0 ? f : `calc(${f} - ${i * 2}px)`, l.style.width = i === 0 ? f : `calc(${f} - ${i * 2}px)`, l.style.transform = `scale(${s})`, l.style.transformOrigin = "top left",
|
|
177
|
+
return l.style.height = i === 0 ? f : `calc(${f} - ${i * 2}px)`, l.style.width = i === 0 ? f : `calc(${f} - ${i * 2}px)`, l.style.transform = `scale(${s})`, l.style.transformOrigin = "top left", q0({
|
|
178
178
|
content: l,
|
|
179
179
|
anchor: r,
|
|
180
180
|
height: h,
|
|
181
|
-
width:
|
|
182
|
-
x:
|
|
183
|
-
y:
|
|
181
|
+
width: c,
|
|
182
|
+
x: u,
|
|
183
|
+
y: p
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
const xt = {
|
|
187
187
|
LEFT: "left",
|
|
188
188
|
CENTER: "center",
|
|
189
189
|
RIGHT: "right"
|
|
190
|
-
},
|
|
190
|
+
}, ue = xt.LEFT;
|
|
191
191
|
function st(n, e) {
|
|
192
192
|
throw new Error("Unexpected value: " + n);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function qn(n = null) {
|
|
195
195
|
const {
|
|
196
196
|
alignment: e = xt.LEFT,
|
|
197
197
|
scale: t = 1,
|
|
@@ -201,40 +201,40 @@ function kn(n = null) {
|
|
|
201
201
|
x: s = 0,
|
|
202
202
|
y: r = 0
|
|
203
203
|
} = n || {};
|
|
204
|
-
function h(
|
|
205
|
-
const
|
|
206
|
-
switch (
|
|
204
|
+
function h(c) {
|
|
205
|
+
const u = document.createElement("video");
|
|
206
|
+
switch (u.autoplay = !0, u.style.transform = `scale(${t})`, e) {
|
|
207
207
|
case xt.LEFT:
|
|
208
|
-
|
|
208
|
+
u.style.transformOrigin = "top left";
|
|
209
209
|
break;
|
|
210
210
|
case xt.CENTER:
|
|
211
|
-
|
|
211
|
+
u.style.transformOrigin = "top center";
|
|
212
212
|
break;
|
|
213
213
|
case xt.RIGHT:
|
|
214
|
-
|
|
214
|
+
u.style.transformOrigin = "top right";
|
|
215
215
|
break;
|
|
216
216
|
default:
|
|
217
217
|
st(e);
|
|
218
218
|
}
|
|
219
|
-
|
|
220
|
-
const
|
|
219
|
+
c.appendChild(u);
|
|
220
|
+
const p = {
|
|
221
221
|
video: {
|
|
222
222
|
displaySurface: "window"
|
|
223
223
|
},
|
|
224
224
|
audio: !1
|
|
225
225
|
};
|
|
226
|
-
return navigator.mediaDevices.getDisplayMedia(
|
|
226
|
+
return navigator.mediaDevices.getDisplayMedia(p).then((l) => {
|
|
227
227
|
const f = l.getVideoTracks()[0];
|
|
228
228
|
f !== void 0 && (f.onended = function() {
|
|
229
|
-
|
|
230
|
-
}),
|
|
229
|
+
u.style.display = "none";
|
|
230
|
+
}), u.srcObject = l, u.play();
|
|
231
231
|
}).catch((l) => {
|
|
232
232
|
console.error("Could not start screen capture -", l);
|
|
233
233
|
}), () => {
|
|
234
|
-
|
|
234
|
+
u.srcObject.getTracks().forEach((f) => f.stop()), u.style.display = "none", u.srcObject = null;
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
return
|
|
237
|
+
return q0({
|
|
238
238
|
content: null,
|
|
239
239
|
setup: h,
|
|
240
240
|
anchor: o,
|
|
@@ -265,7 +265,7 @@ function lt(n) {
|
|
|
265
265
|
...n
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function zn(n = null) {
|
|
269
269
|
const { arrowheadSize: e, width: t = 10, ...o } = n || {}, i = e ?? t * 4;
|
|
270
270
|
return lt({
|
|
271
271
|
objectType: U.ARROW,
|
|
@@ -283,8 +283,8 @@ function In(n = null) {
|
|
|
283
283
|
...o
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
|
-
const
|
|
287
|
-
function
|
|
286
|
+
const fe = 50;
|
|
287
|
+
function jn(n = null) {
|
|
288
288
|
return lt({
|
|
289
289
|
objectType: U.CIRCLE,
|
|
290
290
|
anchor: ht,
|
|
@@ -292,13 +292,13 @@ function _n(n = null) {
|
|
|
292
292
|
strokeWidth: 0,
|
|
293
293
|
drawn: 1,
|
|
294
294
|
fillColor: Q,
|
|
295
|
-
radius:
|
|
295
|
+
radius: fe,
|
|
296
296
|
x: 0,
|
|
297
297
|
y: 0,
|
|
298
298
|
...n
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function g0(n, e = null) {
|
|
302
302
|
return lt({
|
|
303
303
|
objectType: U.GROUP,
|
|
304
304
|
anchor: ht,
|
|
@@ -323,7 +323,7 @@ function c0(n, e = null) {
|
|
|
323
323
|
...e
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Hn(n) {
|
|
327
327
|
const {
|
|
328
328
|
anchor: e = ht,
|
|
329
329
|
cols: t = 1,
|
|
@@ -333,39 +333,39 @@ function On(n) {
|
|
|
333
333
|
groupProps: s = {},
|
|
334
334
|
width: r = 0,
|
|
335
335
|
height: h = 0,
|
|
336
|
-
x:
|
|
337
|
-
y:
|
|
338
|
-
objects:
|
|
336
|
+
x: c = 0,
|
|
337
|
+
y: u = 0,
|
|
338
|
+
objects: p = () => null
|
|
339
339
|
} = n, l = [], f = [];
|
|
340
|
-
let
|
|
341
|
-
for (let
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
let
|
|
340
|
+
let v = 0, y = 0;
|
|
341
|
+
for (let P = 0; P < o; P++) {
|
|
342
|
+
const E = [];
|
|
343
|
+
v = 0;
|
|
344
|
+
let L = 0;
|
|
345
345
|
for (let S = 0; S < t; S++) {
|
|
346
|
-
const T =
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
x:
|
|
346
|
+
const T = p(P, S), k = typeof r == "function" ? r(P, S) : r, F = typeof h == "function" ? h(P, S) : h;
|
|
347
|
+
E.push(T), T != null && f.push(
|
|
348
|
+
g0([T], {
|
|
349
|
+
x: v,
|
|
350
350
|
y
|
|
351
351
|
})
|
|
352
|
-
),
|
|
352
|
+
), v += k + i, L = Math.max(L, F);
|
|
353
353
|
}
|
|
354
|
-
l.push(
|
|
354
|
+
l.push(E), y += L + a;
|
|
355
355
|
}
|
|
356
356
|
return {
|
|
357
|
-
grid:
|
|
358
|
-
x:
|
|
359
|
-
y:
|
|
357
|
+
grid: g0(f, {
|
|
358
|
+
x: c,
|
|
359
|
+
y: u,
|
|
360
360
|
height: y - a,
|
|
361
|
-
width:
|
|
361
|
+
width: v - i,
|
|
362
362
|
anchor: e,
|
|
363
363
|
...s
|
|
364
364
|
}),
|
|
365
365
|
objects: l
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Un(n = null) {
|
|
369
369
|
return lt({
|
|
370
370
|
objectType: U.IMAGE,
|
|
371
371
|
anchor: ht,
|
|
@@ -379,7 +379,7 @@ function Fn(n = null) {
|
|
|
379
379
|
...n
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function $n(n = null) {
|
|
383
383
|
return lt({
|
|
384
384
|
objectType: U.LINE,
|
|
385
385
|
color: Q,
|
|
@@ -394,7 +394,7 @@ function Nn(n = null) {
|
|
|
394
394
|
...n
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Yn(n, e = null) {
|
|
398
398
|
return lt({
|
|
399
399
|
objectType: U.MASK,
|
|
400
400
|
anchor: ht,
|
|
@@ -407,70 +407,70 @@ function Rn(n, e = null) {
|
|
|
407
407
|
...e
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
-
var
|
|
411
|
-
const e = (n && n.length > 0 ? n : "M0,0").match(
|
|
410
|
+
var ge = Object.defineProperty, O = (n, e) => ge(n, "name", { value: e, configurable: !0 }), Pt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, pe = /([astvzqmhlc])([^astvzqmhlc]*)/gi, de = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, xe = O((n) => {
|
|
411
|
+
const e = (n && n.length > 0 ? n : "M0,0").match(pe);
|
|
412
412
|
if (!e) throw new Error(`No path elements found in string ${n}`);
|
|
413
413
|
return e.reduce((t, o) => {
|
|
414
|
-
let i = o.charAt(0), a = i.toLowerCase(), s =
|
|
414
|
+
let i = o.charAt(0), a = i.toLowerCase(), s = ye(o.substring(1));
|
|
415
415
|
if (a === "m" && s.length > 2 && (t.push([i, ...s.splice(0, 2)]), a = "l", i = i === "m" ? "l" : "L"), a.toLowerCase() === "a" && (s.length === 5 || s.length === 6)) {
|
|
416
416
|
const r = o.substring(1).trim().split(" ");
|
|
417
417
|
s = [Number(r[0]), Number(r[1]), Number(r[2]), Number(r[3].charAt(0)), Number(r[3].charAt(1)), Number(r[3].substring(2)), Number(r[4])];
|
|
418
418
|
}
|
|
419
419
|
for (; s.length >= 0; ) {
|
|
420
|
-
if (s.length ===
|
|
421
|
-
t.push([i, ...s.splice(0,
|
|
420
|
+
if (s.length === Pt[a]) {
|
|
421
|
+
t.push([i, ...s.splice(0, Pt[a])]);
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
|
-
if (s.length <
|
|
425
|
-
t.push([i, ...s.splice(0,
|
|
424
|
+
if (s.length < Pt[a]) throw new Error(`Malformed path data: "${i}" must have ${Pt[a]} elements and has ${s.length}: ${o}`);
|
|
425
|
+
t.push([i, ...s.splice(0, Pt[a])]);
|
|
426
426
|
}
|
|
427
427
|
return t;
|
|
428
428
|
}, []);
|
|
429
|
-
}, "default"),
|
|
430
|
-
const e = n.match(
|
|
429
|
+
}, "default"), ye = O((n) => {
|
|
430
|
+
const e = n.match(de);
|
|
431
431
|
return e ? e.map(Number) : [];
|
|
432
|
-
}, "parseValues"),
|
|
432
|
+
}, "parseValues"), mt, J = (mt = class {
|
|
433
433
|
constructor(e, t, o, i) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
434
|
+
I(this, "x0");
|
|
435
|
+
I(this, "x1");
|
|
436
|
+
I(this, "y0");
|
|
437
|
+
I(this, "y1");
|
|
438
|
+
I(this, "getTotalLength", O(() => Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), "getTotalLength"));
|
|
439
|
+
I(this, "getPointAtLength", O((e) => {
|
|
440
440
|
let t = e / Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
|
|
441
441
|
t = Number.isNaN(t) ? 1 : t;
|
|
442
442
|
const o = (this.x1 - this.x0) * t, i = (this.y1 - this.y0) * t;
|
|
443
443
|
return { x: this.x0 + o, y: this.y0 + i };
|
|
444
444
|
}, "getPointAtLength"));
|
|
445
|
-
|
|
445
|
+
I(this, "getTangentAtLength", O((e) => {
|
|
446
446
|
const t = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
|
|
447
447
|
return { x: (this.x1 - this.x0) / t, y: (this.y1 - this.y0) / t };
|
|
448
448
|
}, "getTangentAtLength"));
|
|
449
|
-
|
|
449
|
+
I(this, "getPropertiesAtLength", O((e) => {
|
|
450
450
|
const t = this.getPointAtLength(e), o = this.getTangentAtLength(e);
|
|
451
451
|
return { x: t.x, y: t.y, tangentX: o.x, tangentY: o.y };
|
|
452
452
|
}, "getPropertiesAtLength"));
|
|
453
453
|
this.x0 = e, this.x1 = t, this.y0 = o, this.y1 = i;
|
|
454
454
|
}
|
|
455
|
-
}, O(
|
|
456
|
-
constructor(e, t, o, i, a, s, r, h,
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
455
|
+
}, O(mt, "LinearPosition"), mt), bt, p0 = (bt = class {
|
|
456
|
+
constructor(e, t, o, i, a, s, r, h, c) {
|
|
457
|
+
I(this, "x0");
|
|
458
|
+
I(this, "y0");
|
|
459
|
+
I(this, "rx");
|
|
460
|
+
I(this, "ry");
|
|
461
|
+
I(this, "xAxisRotate");
|
|
462
|
+
I(this, "LargeArcFlag");
|
|
463
|
+
I(this, "SweepFlag");
|
|
464
|
+
I(this, "x1");
|
|
465
|
+
I(this, "y1");
|
|
466
|
+
I(this, "length");
|
|
467
|
+
I(this, "getTotalLength", O(() => this.length, "getTotalLength"));
|
|
468
|
+
I(this, "getPointAtLength", O((e) => {
|
|
469
469
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
470
|
-
const t =
|
|
470
|
+
const t = d0({ x: this.x0, y: this.y0 }, this.rx, this.ry, this.xAxisRotate, this.LargeArcFlag, this.SweepFlag, { x: this.x1, y: this.y1 }, e / this.length);
|
|
471
471
|
return { x: t.x, y: t.y };
|
|
472
472
|
}, "getPointAtLength"));
|
|
473
|
-
|
|
473
|
+
I(this, "getTangentAtLength", O((e) => {
|
|
474
474
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
475
475
|
const t = 0.05, o = this.getPointAtLength(e);
|
|
476
476
|
let i;
|
|
@@ -478,148 +478,148 @@ var ae = Object.defineProperty, O = (n, e) => ae(n, "name", { value: e, configur
|
|
|
478
478
|
const a = i.x - o.x, s = i.y - o.y, r = Math.sqrt(a * a + s * s);
|
|
479
479
|
return e < this.length - t ? { x: -a / r, y: -s / r } : { x: a / r, y: s / r };
|
|
480
480
|
}, "getTangentAtLength"));
|
|
481
|
-
|
|
481
|
+
I(this, "getPropertiesAtLength", O((e) => {
|
|
482
482
|
const t = this.getTangentAtLength(e), o = this.getPointAtLength(e);
|
|
483
483
|
return { x: o.x, y: o.y, tangentX: t.x, tangentY: t.y };
|
|
484
484
|
}, "getPropertiesAtLength"));
|
|
485
|
-
this.x0 = e, this.y0 = t, this.rx = o, this.ry = i, this.xAxisRotate = a, this.LargeArcFlag = s, this.SweepFlag = r, this.x1 = h, this.y1 =
|
|
486
|
-
const
|
|
487
|
-
return
|
|
485
|
+
this.x0 = e, this.y0 = t, this.rx = o, this.ry = i, this.xAxisRotate = a, this.LargeArcFlag = s, this.SweepFlag = r, this.x1 = h, this.y1 = c;
|
|
486
|
+
const u = ve(300, function(p) {
|
|
487
|
+
return d0({ x: e, y: t }, o, i, a, s, r, { x: h, y: c }, p);
|
|
488
488
|
});
|
|
489
|
-
this.length =
|
|
489
|
+
this.length = u.arcLength;
|
|
490
490
|
}
|
|
491
|
-
}, O(
|
|
492
|
-
e = Math.abs(e), t = Math.abs(t), o =
|
|
493
|
-
const h =
|
|
491
|
+
}, O(bt, "Arc"), bt), d0 = O((n, e, t, o, i, a, s, r) => {
|
|
492
|
+
e = Math.abs(e), t = Math.abs(t), o = we(o, 360);
|
|
493
|
+
const h = me(o);
|
|
494
494
|
if (n.x === s.x && n.y === s.y) return { x: n.x, y: n.y, ellipticalArcAngle: 0 };
|
|
495
495
|
if (e === 0 || t === 0) return { x: 0, y: 0, ellipticalArcAngle: 0 };
|
|
496
|
-
const
|
|
496
|
+
const c = (n.x - s.x) / 2, u = (n.y - s.y) / 2, p = { x: Math.cos(h) * c + Math.sin(h) * u, y: -Math.sin(h) * c + Math.cos(h) * u }, l = Math.pow(p.x, 2) / Math.pow(e, 2) + Math.pow(p.y, 2) / Math.pow(t, 2);
|
|
497
497
|
l > 1 && (e = Math.sqrt(l) * e, t = Math.sqrt(l) * t);
|
|
498
|
-
let f = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(
|
|
498
|
+
let f = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(p.y, 2) - Math.pow(t, 2) * Math.pow(p.x, 2)) / (Math.pow(e, 2) * Math.pow(p.y, 2) + Math.pow(t, 2) * Math.pow(p.x, 2));
|
|
499
499
|
f = f < 0 ? 0 : f;
|
|
500
|
-
const
|
|
501
|
-
let S =
|
|
500
|
+
const v = (i !== a ? 1 : -1) * Math.sqrt(f), y = v * (e * p.y / t), M = v * (-t * p.x / e), P = { x: Math.cos(h) * y - Math.sin(h) * M + (n.x + s.x) / 2, y: Math.sin(h) * y + Math.cos(h) * M + (n.y + s.y) / 2 }, E = { x: (p.x - y) / e, y: (p.y - M) / t }, L = y0({ x: 1, y: 0 }, E);
|
|
501
|
+
let S = y0(E, { x: (-p.x - y) / e, y: (-p.y - M) / t });
|
|
502
502
|
!a && S > 0 ? S -= 2 * Math.PI : a && S < 0 && (S += 2 * Math.PI), S %= 2 * Math.PI;
|
|
503
|
-
const T =
|
|
504
|
-
return { x: Math.cos(h) *
|
|
505
|
-
}, "pointOnEllipticalArc"),
|
|
503
|
+
const T = L + S * r, k = e * Math.cos(T), F = t * Math.sin(T);
|
|
504
|
+
return { x: Math.cos(h) * k - Math.sin(h) * F + P.x, y: Math.sin(h) * k + Math.cos(h) * F + P.y, ellipticalArcStartAngle: L, ellipticalArcEndAngle: L + S, ellipticalArcAngle: T, ellipticalArcCenter: P, resultantRx: e, resultantRy: t };
|
|
505
|
+
}, "pointOnEllipticalArc"), ve = O((n, e) => {
|
|
506
506
|
n = n ?? 500;
|
|
507
507
|
let t = 0;
|
|
508
508
|
const o = [], i = [];
|
|
509
509
|
let a, s = e(0);
|
|
510
510
|
for (let r = 0; r < n; r++) {
|
|
511
|
-
const h =
|
|
512
|
-
a = e(h), t +=
|
|
511
|
+
const h = be(r * (1 / n), 0, 1);
|
|
512
|
+
a = e(h), t += x0(s, a), i.push([s, a]), o.push({ t: h, arcLength: t }), s = a;
|
|
513
513
|
}
|
|
514
|
-
return a = e(1), i.push([s, a]), t +=
|
|
515
|
-
}, "approximateArcLengthOfCurve"),
|
|
514
|
+
return a = e(1), i.push([s, a]), t += x0(s, a), o.push({ t: 1, arcLength: t }), { arcLength: t, arcLengthMap: o, approximationLines: i };
|
|
515
|
+
}, "approximateArcLengthOfCurve"), we = O((n, e) => (n % e + e) % e, "mod"), me = O((n) => n * (Math.PI / 180), "toRadians"), x0 = O((n, e) => Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2)), "distance"), be = O((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), y0 = O((n, e) => {
|
|
516
516
|
const t = n.x * e.x + n.y * e.y, o = Math.sqrt((Math.pow(n.x, 2) + Math.pow(n.y, 2)) * (Math.pow(e.x, 2) + Math.pow(e.y, 2)));
|
|
517
517
|
return (n.x * e.y - n.y * e.x < 0 ? -1 : 1) * Math.acos(t / o);
|
|
518
|
-
}, "angleBetween"), xe = [[], [], [-0.5773502691896257, 0.5773502691896258], [0, -0.7745966692414833, 0.7745966692414833], [-0.33998104358485626, 0.33998104358485626, -0.8611363115940526, 0.8611363115940526], [0, -0.5384693101056831, 0.5384693101056831, -0.906179845938664, 0.906179845938664], [0.6612093864662645, -0.6612093864662645, -0.2386191860831969, 0.2386191860831969, -0.932469514203152, 0.932469514203152], [0, 0.4058451513773972, -0.4058451513773972, -0.7415311855993945, 0.7415311855993945, -0.9491079123427585, 0.9491079123427585], [-0.1834346424956498, 0.1834346424956498, -0.525532409916329, 0.525532409916329, -0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363], [0, -0.8360311073266358, 0.8360311073266358, -0.9681602395076261, 0.9681602395076261, -0.3242534234038089, 0.3242534234038089, -0.6133714327005904, 0.6133714327005904], [-0.14887433898163122, 0.14887433898163122, -0.4333953941292472, 0.4333953941292472, -0.6794095682990244, 0.6794095682990244, -0.8650633666889845, 0.8650633666889845, -0.9739065285171717, 0.9739065285171717], [0, -0.26954315595234496, 0.26954315595234496, -0.5190961292068118, 0.5190961292068118, -0.7301520055740494, 0.7301520055740494, -0.8870625997680953, 0.8870625997680953, -0.978228658146057, 0.978228658146057], [-0.1252334085114689, 0.1252334085114689, -0.3678314989981802, 0.3678314989981802, -0.5873179542866175, 0.5873179542866175, -0.7699026741943047, 0.7699026741943047, -0.9041172563704749, 0.9041172563704749, -0.9815606342467192, 0.9815606342467192], [0, -0.2304583159551348, 0.2304583159551348, -0.44849275103644687, 0.44849275103644687, -0.6423493394403402, 0.6423493394403402, -0.8015780907333099, 0.8015780907333099, -0.9175983992229779, 0.9175983992229779, -0.9841830547185881, 0.9841830547185881], [-0.10805494870734367, 0.10805494870734367, -0.31911236892788974, 0.31911236892788974, -0.5152486363581541, 0.5152486363581541, -0.6872929048116855, 0.6872929048116855, -0.827201315069765, 0.827201315069765, -0.9284348836635735, 0.9284348836635735, -0.9862838086968123, 0.9862838086968123], [0, -0.20119409399743451, 0.20119409399743451, -0.3941513470775634, 0.3941513470775634, -0.5709721726085388, 0.5709721726085388, -0.7244177313601701, 0.7244177313601701, -0.8482065834104272, 0.8482065834104272, -0.937273392400706, 0.937273392400706, -0.9879925180204854, 0.9879925180204854], [-0.09501250983763744, 0.09501250983763744, -0.2816035507792589, 0.2816035507792589, -0.45801677765722737, 0.45801677765722737, -0.6178762444026438, 0.6178762444026438, -0.755404408355003, 0.755404408355003, -0.8656312023878318, 0.8656312023878318, -0.9445750230732326, 0.9445750230732326, -0.9894009349916499, 0.9894009349916499], [0, -0.17848418149584785, 0.17848418149584785, -0.3512317634538763, 0.3512317634538763, -0.5126905370864769, 0.5126905370864769, -0.6576711592166907, 0.6576711592166907, -0.7815140038968014, 0.7815140038968014, -0.8802391537269859, 0.8802391537269859, -0.9506755217687678, 0.9506755217687678, -0.9905754753144174, 0.9905754753144174], [-0.0847750130417353, 0.0847750130417353, -0.2518862256915055, 0.2518862256915055, -0.41175116146284263, 0.41175116146284263, -0.5597708310739475, 0.5597708310739475, -0.6916870430603532, 0.6916870430603532, -0.8037049589725231, 0.8037049589725231, -0.8926024664975557, 0.8926024664975557, -0.9558239495713977, 0.9558239495713977, -0.9915651684209309, 0.9915651684209309], [0, -0.16035864564022537, 0.16035864564022537, -0.31656409996362983, 0.31656409996362983, -0.46457074137596094, 0.46457074137596094, -0.600545304661681, 0.600545304661681, -0.7209661773352294, 0.7209661773352294, -0.8227146565371428, 0.8227146565371428, -0.9031559036148179, 0.9031559036148179, -0.96020815213483, 0.96020815213483, -0.9924068438435844, 0.9924068438435844], [-0.07652652113349734, 0.07652652113349734, -0.22778585114164507, 0.22778585114164507, -0.37370608871541955, 0.37370608871541955, -0.5108670019508271, 0.5108670019508271, -0.636053680726515, 0.636053680726515, -0.7463319064601508, 0.7463319064601508, -0.8391169718222188, 0.8391169718222188, -0.912234428251326, 0.912234428251326, -0.9639719272779138, 0.9639719272779138, -0.9931285991850949, 0.9931285991850949], [0, -0.1455618541608951, 0.1455618541608951, -0.2880213168024011, 0.2880213168024011, -0.4243421202074388, 0.4243421202074388, -0.5516188358872198, 0.5516188358872198, -0.6671388041974123, 0.6671388041974123, -0.7684399634756779, 0.7684399634756779, -0.8533633645833173, 0.8533633645833173, -0.9200993341504008, 0.9200993341504008, -0.9672268385663063, 0.9672268385663063, -0.9937521706203895, 0.9937521706203895], [-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992], [0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522], [-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]], ye = [[], [], [1, 1], [0.8888888888888888, 0.5555555555555556, 0.5555555555555556], [0.6521451548625461, 0.6521451548625461, 0.34785484513745385, 0.34785484513745385], [0.5688888888888889, 0.47862867049936647, 0.47862867049936647, 0.23692688505618908, 0.23692688505618908], [0.3607615730481386, 0.3607615730481386, 0.46791393457269104, 0.46791393457269104, 0.17132449237917036, 0.17132449237917036], [0.4179591836734694, 0.3818300505051189, 0.3818300505051189, 0.27970539148927664, 0.27970539148927664, 0.1294849661688697, 0.1294849661688697], [0.362683783378362, 0.362683783378362, 0.31370664587788727, 0.31370664587788727, 0.22238103445337448, 0.22238103445337448, 0.10122853629037626, 0.10122853629037626], [0.3302393550012598, 0.1806481606948574, 0.1806481606948574, 0.08127438836157441, 0.08127438836157441, 0.31234707704000286, 0.31234707704000286, 0.26061069640293544, 0.26061069640293544], [0.29552422471475287, 0.29552422471475287, 0.26926671930999635, 0.26926671930999635, 0.21908636251598204, 0.21908636251598204, 0.1494513491505806, 0.1494513491505806, 0.06667134430868814, 0.06667134430868814], [0.2729250867779006, 0.26280454451024665, 0.26280454451024665, 0.23319376459199048, 0.23319376459199048, 0.18629021092773426, 0.18629021092773426, 0.1255803694649046, 0.1255803694649046, 0.05566856711617366, 0.05566856711617366], [0.24914704581340277, 0.24914704581340277, 0.2334925365383548, 0.2334925365383548, 0.20316742672306592, 0.20316742672306592, 0.16007832854334622, 0.16007832854334622, 0.10693932599531843, 0.10693932599531843, 0.04717533638651183, 0.04717533638651183], [0.2325515532308739, 0.22628318026289723, 0.22628318026289723, 0.2078160475368885, 0.2078160475368885, 0.17814598076194574, 0.17814598076194574, 0.13887351021978725, 0.13887351021978725, 0.09212149983772845, 0.09212149983772845, 0.04048400476531588, 0.04048400476531588], [0.2152638534631578, 0.2152638534631578, 0.2051984637212956, 0.2051984637212956, 0.18553839747793782, 0.18553839747793782, 0.15720316715819355, 0.15720316715819355, 0.12151857068790319, 0.12151857068790319, 0.08015808715976021, 0.08015808715976021, 0.03511946033175186, 0.03511946033175186], [0.2025782419255613, 0.19843148532711158, 0.19843148532711158, 0.1861610000155622, 0.1861610000155622, 0.16626920581699392, 0.16626920581699392, 0.13957067792615432, 0.13957067792615432, 0.10715922046717194, 0.10715922046717194, 0.07036604748810812, 0.07036604748810812, 0.03075324199611727, 0.03075324199611727], [0.1894506104550685, 0.1894506104550685, 0.18260341504492358, 0.18260341504492358, 0.16915651939500254, 0.16915651939500254, 0.14959598881657674, 0.14959598881657674, 0.12462897125553388, 0.12462897125553388, 0.09515851168249279, 0.09515851168249279, 0.062253523938647894, 0.062253523938647894, 0.027152459411754096, 0.027152459411754096], [0.17944647035620653, 0.17656270536699264, 0.17656270536699264, 0.16800410215645004, 0.16800410215645004, 0.15404576107681028, 0.15404576107681028, 0.13513636846852548, 0.13513636846852548, 0.11188384719340397, 0.11188384719340397, 0.08503614831717918, 0.08503614831717918, 0.0554595293739872, 0.0554595293739872, 0.02414830286854793, 0.02414830286854793], [0.1691423829631436, 0.1691423829631436, 0.16427648374583273, 0.16427648374583273, 0.15468467512626524, 0.15468467512626524, 0.14064291467065065, 0.14064291467065065, 0.12255520671147846, 0.12255520671147846, 0.10094204410628717, 0.10094204410628717, 0.07642573025488905, 0.07642573025488905, 0.0497145488949698, 0.0497145488949698, 0.02161601352648331, 0.02161601352648331], [0.1610544498487837, 0.15896884339395434, 0.15896884339395434, 0.15276604206585967, 0.15276604206585967, 0.1426067021736066, 0.1426067021736066, 0.12875396253933621, 0.12875396253933621, 0.11156664554733399, 0.11156664554733399, 0.09149002162245, 0.09149002162245, 0.06904454273764123, 0.06904454273764123, 0.0448142267656996, 0.0448142267656996, 0.019461788229726478, 0.019461788229726478], [0.15275338713072584, 0.15275338713072584, 0.14917298647260374, 0.14917298647260374, 0.14209610931838204, 0.14209610931838204, 0.13168863844917664, 0.13168863844917664, 0.11819453196151841, 0.11819453196151841, 0.10193011981724044, 0.10193011981724044, 0.08327674157670475, 0.08327674157670475, 0.06267204833410907, 0.06267204833410907, 0.04060142980038694, 0.04060142980038694, 0.017614007139152118, 0.017614007139152118], [0.14608113364969041, 0.14452440398997005, 0.14452440398997005, 0.13988739479107315, 0.13988739479107315, 0.13226893863333747, 0.13226893863333747, 0.12183141605372853, 0.12183141605372853, 0.10879729916714838, 0.10879729916714838, 0.09344442345603386, 0.09344442345603386, 0.0761001136283793, 0.0761001136283793, 0.057134425426857205, 0.057134425426857205, 0.036953789770852494, 0.036953789770852494, 0.016017228257774335, 0.016017228257774335], [0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722], [0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771], [0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]], ve = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], we = O((n, e, t) => ({ x: (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], y: (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3] }), "cubicPoint"), me = O((n, e, t) => B0([3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])], [3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])], t), "cubicDerivative"), be = O((n, e, t) => {
|
|
518
|
+
}, "angleBetween"), Ae = [[], [], [-0.5773502691896257, 0.5773502691896258], [0, -0.7745966692414833, 0.7745966692414833], [-0.33998104358485626, 0.33998104358485626, -0.8611363115940526, 0.8611363115940526], [0, -0.5384693101056831, 0.5384693101056831, -0.906179845938664, 0.906179845938664], [0.6612093864662645, -0.6612093864662645, -0.2386191860831969, 0.2386191860831969, -0.932469514203152, 0.932469514203152], [0, 0.4058451513773972, -0.4058451513773972, -0.7415311855993945, 0.7415311855993945, -0.9491079123427585, 0.9491079123427585], [-0.1834346424956498, 0.1834346424956498, -0.525532409916329, 0.525532409916329, -0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363], [0, -0.8360311073266358, 0.8360311073266358, -0.9681602395076261, 0.9681602395076261, -0.3242534234038089, 0.3242534234038089, -0.6133714327005904, 0.6133714327005904], [-0.14887433898163122, 0.14887433898163122, -0.4333953941292472, 0.4333953941292472, -0.6794095682990244, 0.6794095682990244, -0.8650633666889845, 0.8650633666889845, -0.9739065285171717, 0.9739065285171717], [0, -0.26954315595234496, 0.26954315595234496, -0.5190961292068118, 0.5190961292068118, -0.7301520055740494, 0.7301520055740494, -0.8870625997680953, 0.8870625997680953, -0.978228658146057, 0.978228658146057], [-0.1252334085114689, 0.1252334085114689, -0.3678314989981802, 0.3678314989981802, -0.5873179542866175, 0.5873179542866175, -0.7699026741943047, 0.7699026741943047, -0.9041172563704749, 0.9041172563704749, -0.9815606342467192, 0.9815606342467192], [0, -0.2304583159551348, 0.2304583159551348, -0.44849275103644687, 0.44849275103644687, -0.6423493394403402, 0.6423493394403402, -0.8015780907333099, 0.8015780907333099, -0.9175983992229779, 0.9175983992229779, -0.9841830547185881, 0.9841830547185881], [-0.10805494870734367, 0.10805494870734367, -0.31911236892788974, 0.31911236892788974, -0.5152486363581541, 0.5152486363581541, -0.6872929048116855, 0.6872929048116855, -0.827201315069765, 0.827201315069765, -0.9284348836635735, 0.9284348836635735, -0.9862838086968123, 0.9862838086968123], [0, -0.20119409399743451, 0.20119409399743451, -0.3941513470775634, 0.3941513470775634, -0.5709721726085388, 0.5709721726085388, -0.7244177313601701, 0.7244177313601701, -0.8482065834104272, 0.8482065834104272, -0.937273392400706, 0.937273392400706, -0.9879925180204854, 0.9879925180204854], [-0.09501250983763744, 0.09501250983763744, -0.2816035507792589, 0.2816035507792589, -0.45801677765722737, 0.45801677765722737, -0.6178762444026438, 0.6178762444026438, -0.755404408355003, 0.755404408355003, -0.8656312023878318, 0.8656312023878318, -0.9445750230732326, 0.9445750230732326, -0.9894009349916499, 0.9894009349916499], [0, -0.17848418149584785, 0.17848418149584785, -0.3512317634538763, 0.3512317634538763, -0.5126905370864769, 0.5126905370864769, -0.6576711592166907, 0.6576711592166907, -0.7815140038968014, 0.7815140038968014, -0.8802391537269859, 0.8802391537269859, -0.9506755217687678, 0.9506755217687678, -0.9905754753144174, 0.9905754753144174], [-0.0847750130417353, 0.0847750130417353, -0.2518862256915055, 0.2518862256915055, -0.41175116146284263, 0.41175116146284263, -0.5597708310739475, 0.5597708310739475, -0.6916870430603532, 0.6916870430603532, -0.8037049589725231, 0.8037049589725231, -0.8926024664975557, 0.8926024664975557, -0.9558239495713977, 0.9558239495713977, -0.9915651684209309, 0.9915651684209309], [0, -0.16035864564022537, 0.16035864564022537, -0.31656409996362983, 0.31656409996362983, -0.46457074137596094, 0.46457074137596094, -0.600545304661681, 0.600545304661681, -0.7209661773352294, 0.7209661773352294, -0.8227146565371428, 0.8227146565371428, -0.9031559036148179, 0.9031559036148179, -0.96020815213483, 0.96020815213483, -0.9924068438435844, 0.9924068438435844], [-0.07652652113349734, 0.07652652113349734, -0.22778585114164507, 0.22778585114164507, -0.37370608871541955, 0.37370608871541955, -0.5108670019508271, 0.5108670019508271, -0.636053680726515, 0.636053680726515, -0.7463319064601508, 0.7463319064601508, -0.8391169718222188, 0.8391169718222188, -0.912234428251326, 0.912234428251326, -0.9639719272779138, 0.9639719272779138, -0.9931285991850949, 0.9931285991850949], [0, -0.1455618541608951, 0.1455618541608951, -0.2880213168024011, 0.2880213168024011, -0.4243421202074388, 0.4243421202074388, -0.5516188358872198, 0.5516188358872198, -0.6671388041974123, 0.6671388041974123, -0.7684399634756779, 0.7684399634756779, -0.8533633645833173, 0.8533633645833173, -0.9200993341504008, 0.9200993341504008, -0.9672268385663063, 0.9672268385663063, -0.9937521706203895, 0.9937521706203895], [-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992], [0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522], [-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]], Me = [[], [], [1, 1], [0.8888888888888888, 0.5555555555555556, 0.5555555555555556], [0.6521451548625461, 0.6521451548625461, 0.34785484513745385, 0.34785484513745385], [0.5688888888888889, 0.47862867049936647, 0.47862867049936647, 0.23692688505618908, 0.23692688505618908], [0.3607615730481386, 0.3607615730481386, 0.46791393457269104, 0.46791393457269104, 0.17132449237917036, 0.17132449237917036], [0.4179591836734694, 0.3818300505051189, 0.3818300505051189, 0.27970539148927664, 0.27970539148927664, 0.1294849661688697, 0.1294849661688697], [0.362683783378362, 0.362683783378362, 0.31370664587788727, 0.31370664587788727, 0.22238103445337448, 0.22238103445337448, 0.10122853629037626, 0.10122853629037626], [0.3302393550012598, 0.1806481606948574, 0.1806481606948574, 0.08127438836157441, 0.08127438836157441, 0.31234707704000286, 0.31234707704000286, 0.26061069640293544, 0.26061069640293544], [0.29552422471475287, 0.29552422471475287, 0.26926671930999635, 0.26926671930999635, 0.21908636251598204, 0.21908636251598204, 0.1494513491505806, 0.1494513491505806, 0.06667134430868814, 0.06667134430868814], [0.2729250867779006, 0.26280454451024665, 0.26280454451024665, 0.23319376459199048, 0.23319376459199048, 0.18629021092773426, 0.18629021092773426, 0.1255803694649046, 0.1255803694649046, 0.05566856711617366, 0.05566856711617366], [0.24914704581340277, 0.24914704581340277, 0.2334925365383548, 0.2334925365383548, 0.20316742672306592, 0.20316742672306592, 0.16007832854334622, 0.16007832854334622, 0.10693932599531843, 0.10693932599531843, 0.04717533638651183, 0.04717533638651183], [0.2325515532308739, 0.22628318026289723, 0.22628318026289723, 0.2078160475368885, 0.2078160475368885, 0.17814598076194574, 0.17814598076194574, 0.13887351021978725, 0.13887351021978725, 0.09212149983772845, 0.09212149983772845, 0.04048400476531588, 0.04048400476531588], [0.2152638534631578, 0.2152638534631578, 0.2051984637212956, 0.2051984637212956, 0.18553839747793782, 0.18553839747793782, 0.15720316715819355, 0.15720316715819355, 0.12151857068790319, 0.12151857068790319, 0.08015808715976021, 0.08015808715976021, 0.03511946033175186, 0.03511946033175186], [0.2025782419255613, 0.19843148532711158, 0.19843148532711158, 0.1861610000155622, 0.1861610000155622, 0.16626920581699392, 0.16626920581699392, 0.13957067792615432, 0.13957067792615432, 0.10715922046717194, 0.10715922046717194, 0.07036604748810812, 0.07036604748810812, 0.03075324199611727, 0.03075324199611727], [0.1894506104550685, 0.1894506104550685, 0.18260341504492358, 0.18260341504492358, 0.16915651939500254, 0.16915651939500254, 0.14959598881657674, 0.14959598881657674, 0.12462897125553388, 0.12462897125553388, 0.09515851168249279, 0.09515851168249279, 0.062253523938647894, 0.062253523938647894, 0.027152459411754096, 0.027152459411754096], [0.17944647035620653, 0.17656270536699264, 0.17656270536699264, 0.16800410215645004, 0.16800410215645004, 0.15404576107681028, 0.15404576107681028, 0.13513636846852548, 0.13513636846852548, 0.11188384719340397, 0.11188384719340397, 0.08503614831717918, 0.08503614831717918, 0.0554595293739872, 0.0554595293739872, 0.02414830286854793, 0.02414830286854793], [0.1691423829631436, 0.1691423829631436, 0.16427648374583273, 0.16427648374583273, 0.15468467512626524, 0.15468467512626524, 0.14064291467065065, 0.14064291467065065, 0.12255520671147846, 0.12255520671147846, 0.10094204410628717, 0.10094204410628717, 0.07642573025488905, 0.07642573025488905, 0.0497145488949698, 0.0497145488949698, 0.02161601352648331, 0.02161601352648331], [0.1610544498487837, 0.15896884339395434, 0.15896884339395434, 0.15276604206585967, 0.15276604206585967, 0.1426067021736066, 0.1426067021736066, 0.12875396253933621, 0.12875396253933621, 0.11156664554733399, 0.11156664554733399, 0.09149002162245, 0.09149002162245, 0.06904454273764123, 0.06904454273764123, 0.0448142267656996, 0.0448142267656996, 0.019461788229726478, 0.019461788229726478], [0.15275338713072584, 0.15275338713072584, 0.14917298647260374, 0.14917298647260374, 0.14209610931838204, 0.14209610931838204, 0.13168863844917664, 0.13168863844917664, 0.11819453196151841, 0.11819453196151841, 0.10193011981724044, 0.10193011981724044, 0.08327674157670475, 0.08327674157670475, 0.06267204833410907, 0.06267204833410907, 0.04060142980038694, 0.04060142980038694, 0.017614007139152118, 0.017614007139152118], [0.14608113364969041, 0.14452440398997005, 0.14452440398997005, 0.13988739479107315, 0.13988739479107315, 0.13226893863333747, 0.13226893863333747, 0.12183141605372853, 0.12183141605372853, 0.10879729916714838, 0.10879729916714838, 0.09344442345603386, 0.09344442345603386, 0.0761001136283793, 0.0761001136283793, 0.057134425426857205, 0.057134425426857205, 0.036953789770852494, 0.036953789770852494, 0.016017228257774335, 0.016017228257774335], [0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722], [0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771], [0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]], Le = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], Te = O((n, e, t) => ({ x: (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], y: (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3] }), "cubicPoint"), Ce = O((n, e, t) => j0([3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])], [3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])], t), "cubicDerivative"), Pe = O((n, e, t) => {
|
|
519
519
|
let o, i;
|
|
520
520
|
const a = t / 2;
|
|
521
521
|
o = 0;
|
|
522
|
-
for (let s = 0; s < 20; s++) i = a *
|
|
522
|
+
for (let s = 0; s < 20; s++) i = a * Ae[20][s] + a, o += Me[20][s] * H0(n, e, i);
|
|
523
523
|
return a * o;
|
|
524
|
-
}, "getCubicArcLength"),
|
|
524
|
+
}, "getCubicArcLength"), j0 = O((n, e, t) => ({ x: (1 - t) * (1 - t) * n[0] + 2 * (1 - t) * t * n[1] + t * t * n[2], y: (1 - t) * (1 - t) * e[0] + 2 * (1 - t) * t * e[1] + t * t * e[2] }), "quadraticPoint"), Ee = O((n, e, t) => {
|
|
525
525
|
t === void 0 && (t = 1);
|
|
526
|
-
const o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s),
|
|
526
|
+
const o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s), c = a * a + s * s;
|
|
527
527
|
if (r === 0) return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
528
|
-
const
|
|
529
|
-
return Math.sqrt(r) / 2 * (
|
|
530
|
-
}, "getQuadraticArcLength"),
|
|
531
|
-
function
|
|
532
|
-
const o =
|
|
528
|
+
const u = h / (2 * r), p = t + u, l = c / r - u * u, f = p * p + l > 0 ? Math.sqrt(p * p + l) : 0, v = u * u + l > 0 ? Math.sqrt(u * u + l) : 0, y = u + Math.sqrt(u * u + l) !== 0 && (p + f) / (u + v) !== 0 ? l * Math.log(Math.abs((p + f) / (u + v))) : 0;
|
|
529
|
+
return Math.sqrt(r) / 2 * (p * f - u * v + y);
|
|
530
|
+
}, "getQuadraticArcLength"), Se = O((n, e, t) => ({ x: 2 * (1 - t) * (n[1] - n[0]) + 2 * t * (n[2] - n[1]), y: 2 * (1 - t) * (e[1] - e[0]) + 2 * t * (e[2] - e[1]) }), "quadraticDerivative");
|
|
531
|
+
function H0(n, e, t) {
|
|
532
|
+
const o = Kt(1, t, n), i = Kt(1, t, e), a = o * o + i * i;
|
|
533
533
|
return Math.sqrt(a);
|
|
534
534
|
}
|
|
535
|
-
O(
|
|
536
|
-
var
|
|
535
|
+
O(H0, "BFunc");
|
|
536
|
+
var Kt = O((n, e, t) => {
|
|
537
537
|
const o = t.length - 1;
|
|
538
538
|
let i, a;
|
|
539
539
|
if (o === 0) return 0;
|
|
540
540
|
if (n === 0) {
|
|
541
541
|
a = 0;
|
|
542
|
-
for (let s = 0; s <= o; s++) a +=
|
|
542
|
+
for (let s = 0; s <= o; s++) a += Le[o][s] * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
543
543
|
return a;
|
|
544
544
|
}
|
|
545
545
|
i = new Array(o);
|
|
546
546
|
for (let s = 0; s < o; s++) i[s] = o * (t[s + 1] - t[s]);
|
|
547
|
-
return
|
|
548
|
-
}, "getDerivative"),
|
|
547
|
+
return Kt(n - 1, e, i);
|
|
548
|
+
}, "getDerivative"), Dt = O((n, e, t) => {
|
|
549
549
|
let o = 1, i = n / e, a = (n - t(i)) / e, s = 0;
|
|
550
550
|
for (; o > 1e-3; ) {
|
|
551
551
|
const r = t(i + a), h = Math.abs(n - r) / e;
|
|
552
552
|
if (h < o) o = h, i += a;
|
|
553
553
|
else {
|
|
554
|
-
const
|
|
555
|
-
|
|
554
|
+
const c = t(i - a), u = Math.abs(n - c) / e;
|
|
555
|
+
u < o ? (o = u, i -= a) : a /= 2;
|
|
556
556
|
}
|
|
557
557
|
if (s++, s > 500) break;
|
|
558
558
|
}
|
|
559
559
|
return i;
|
|
560
|
-
}, "t2length"),
|
|
560
|
+
}, "t2length"), At, ct = (At = class {
|
|
561
561
|
constructor(e, t, o, i, a, s, r, h) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
562
|
+
I(this, "a");
|
|
563
|
+
I(this, "b");
|
|
564
|
+
I(this, "c");
|
|
565
|
+
I(this, "d");
|
|
566
|
+
I(this, "length");
|
|
567
|
+
I(this, "getArcLength");
|
|
568
|
+
I(this, "getPoint");
|
|
569
|
+
I(this, "getDerivative");
|
|
570
|
+
I(this, "getTotalLength", O(() => this.length, "getTotalLength"));
|
|
571
|
+
I(this, "getPointAtLength", O((e) => {
|
|
572
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = Dt(e, this.length, (a) => this.getArcLength(t, o, a));
|
|
573
573
|
return this.getPoint(t, o, i);
|
|
574
574
|
}, "getPointAtLength"));
|
|
575
|
-
|
|
576
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
575
|
+
I(this, "getTangentAtLength", O((e) => {
|
|
576
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = Dt(e, this.length, (h) => this.getArcLength(t, o, h)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
|
|
577
577
|
let r;
|
|
578
578
|
return r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 }, r;
|
|
579
579
|
}, "getTangentAtLength"));
|
|
580
|
-
|
|
581
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
580
|
+
I(this, "getPropertiesAtLength", O((e) => {
|
|
581
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = Dt(e, this.length, (c) => this.getArcLength(t, o, c)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
|
|
582
582
|
let r;
|
|
583
583
|
r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 };
|
|
584
584
|
const h = this.getPoint(t, o, i);
|
|
585
585
|
return { x: h.x, y: h.y, tangentX: r.x, tangentY: r.y };
|
|
586
586
|
}, "getPropertiesAtLength"));
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
this.a = { x: e, y: t }, this.b = { x: o, y: i }, this.c = { x: a, y: s }, r !== void 0 && h !== void 0 ? (this.getArcLength =
|
|
587
|
+
I(this, "getC", O(() => this.c, "getC"));
|
|
588
|
+
I(this, "getD", O(() => this.d, "getD"));
|
|
589
|
+
this.a = { x: e, y: t }, this.b = { x: o, y: i }, this.c = { x: a, y: s }, r !== void 0 && h !== void 0 ? (this.getArcLength = Pe, this.getPoint = Te, this.getDerivative = Ce, this.d = { x: r, y: h }) : (this.getArcLength = Ee, this.getPoint = j0, this.getDerivative = Se, this.d = { x: 0, y: 0 }), this.length = this.getArcLength([this.a.x, this.b.x, this.c.x, this.d.x], [this.a.y, this.b.y, this.c.y, this.d.y], 1);
|
|
590
590
|
}
|
|
591
|
-
}, O(
|
|
591
|
+
}, O(At, "Bezier"), At), Mt, ke = (Mt = class {
|
|
592
592
|
constructor(e) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
593
|
+
I(this, "length", 0);
|
|
594
|
+
I(this, "partial_lengths", []);
|
|
595
|
+
I(this, "functions", []);
|
|
596
|
+
I(this, "initial_point", null);
|
|
597
|
+
I(this, "getPartAtLength", O((e) => {
|
|
598
598
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
599
599
|
let t = this.partial_lengths.length - 1;
|
|
600
600
|
for (; this.partial_lengths[t] >= e && t > 0; ) t--;
|
|
601
601
|
return t++, { fraction: e - this.partial_lengths[t - 1], i: t };
|
|
602
602
|
}, "getPartAtLength"));
|
|
603
|
-
|
|
604
|
-
|
|
603
|
+
I(this, "getTotalLength", O(() => this.length, "getTotalLength"));
|
|
604
|
+
I(this, "getPointAtLength", O((e) => {
|
|
605
605
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
606
606
|
if (o) return o.getPointAtLength(t.fraction);
|
|
607
607
|
if (this.initial_point) return this.initial_point;
|
|
608
608
|
throw new Error("Wrong function at this part.");
|
|
609
609
|
}, "getPointAtLength"));
|
|
610
|
-
|
|
610
|
+
I(this, "getTangentAtLength", O((e) => {
|
|
611
611
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
612
612
|
if (o) return o.getTangentAtLength(t.fraction);
|
|
613
613
|
if (this.initial_point) return { x: 0, y: 0 };
|
|
614
614
|
throw new Error("Wrong function at this part.");
|
|
615
615
|
}, "getTangentAtLength"));
|
|
616
|
-
|
|
616
|
+
I(this, "getPropertiesAtLength", O((e) => {
|
|
617
617
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
618
618
|
if (o) return o.getPropertiesAtLength(t.fraction);
|
|
619
619
|
if (this.initial_point) return { x: this.initial_point.x, y: this.initial_point.y, tangentX: 0, tangentY: 0 };
|
|
620
620
|
throw new Error("Wrong function at this part.");
|
|
621
621
|
}, "getPropertiesAtLength"));
|
|
622
|
-
|
|
622
|
+
I(this, "getParts", O(() => {
|
|
623
623
|
const e = [];
|
|
624
624
|
for (let t = 0; t < this.functions.length; t++) if (this.functions[t] !== null) {
|
|
625
625
|
this.functions[t] = this.functions[t];
|
|
@@ -628,7 +628,7 @@ var Vt = O((n, e, t) => {
|
|
|
628
628
|
}
|
|
629
629
|
return e;
|
|
630
630
|
}, "getParts"));
|
|
631
|
-
const t = Array.isArray(e) ? e :
|
|
631
|
+
const t = Array.isArray(e) ? e : xe(e);
|
|
632
632
|
let o, i = [0, 0], a = [0, 0], s = [0, 0];
|
|
633
633
|
for (let r = 0; r < t.length; r++) {
|
|
634
634
|
if (t[r][0] === "M") i = [t[r][1], t[r][2]], s = [i[0], i[1]], this.functions.push(null), r === 0 && (this.initial_point = { x: t[r][1], y: t[r][2] });
|
|
@@ -653,8 +653,8 @@ var Vt = O((n, e, t) => {
|
|
|
653
653
|
} else if (t[r][0] === "s") {
|
|
654
654
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
655
655
|
if (o) {
|
|
656
|
-
const h = o.getC(),
|
|
657
|
-
o = new ct(i[0], i[1], i[0] +
|
|
656
|
+
const h = o.getC(), c = o.getD();
|
|
657
|
+
o = new ct(i[0], i[1], i[0] + c.x - h.x, i[1] + c.y - h.y, i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
|
|
658
658
|
}
|
|
659
659
|
} else o = new ct(i[0], i[1], i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
|
|
660
660
|
o && (this.length += o.getTotalLength(), i = [t[r][3] + i[0], t[r][4] + i[1]], this.functions.push(o));
|
|
@@ -686,41 +686,41 @@ var Vt = O((n, e, t) => {
|
|
|
686
686
|
}
|
|
687
687
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1] + i[0], t[r][2] + i[1]];
|
|
688
688
|
} else if (t[r][0] === "A") {
|
|
689
|
-
const h = new
|
|
689
|
+
const h = new p0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, t[r][6], t[r][7]);
|
|
690
690
|
this.length += h.getTotalLength(), i = [t[r][6], t[r][7]], this.functions.push(h);
|
|
691
691
|
} else if (t[r][0] === "a") {
|
|
692
|
-
const h = new
|
|
692
|
+
const h = new p0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, i[0] + t[r][6], i[1] + t[r][7]);
|
|
693
693
|
this.length += h.getTotalLength(), i = [i[0] + t[r][6], i[1] + t[r][7]], this.functions.push(h);
|
|
694
694
|
}
|
|
695
695
|
this.partial_lengths.push(this.length);
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
}, O(
|
|
698
|
+
}, O(Mt, "SVGPathProperties"), Mt), Lt, Qt = (Lt = class {
|
|
699
699
|
constructor(e) {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
if (this.inst = new
|
|
707
|
-
}
|
|
708
|
-
}, O(
|
|
709
|
-
function
|
|
700
|
+
I(this, "inst");
|
|
701
|
+
I(this, "getTotalLength", O(() => this.inst.getTotalLength(), "getTotalLength"));
|
|
702
|
+
I(this, "getPointAtLength", O((e) => this.inst.getPointAtLength(e), "getPointAtLength"));
|
|
703
|
+
I(this, "getTangentAtLength", O((e) => this.inst.getTangentAtLength(e), "getTangentAtLength"));
|
|
704
|
+
I(this, "getPropertiesAtLength", O((e) => this.inst.getPropertiesAtLength(e), "getPropertiesAtLength"));
|
|
705
|
+
I(this, "getParts", O(() => this.inst.getParts(), "getParts"));
|
|
706
|
+
if (this.inst = new ke(e), !(this instanceof Qt)) return new Qt(e);
|
|
707
|
+
}
|
|
708
|
+
}, O(Lt, "_svgPathProperties"), Lt);
|
|
709
|
+
function Ie(n = G.BLACK) {
|
|
710
710
|
return { ...n, alpha: 0 };
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100",
|
|
712
|
+
function Wn(n = null) {
|
|
713
|
+
const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100", c = new Qt(r).getTotalLength();
|
|
714
714
|
return lt({
|
|
715
715
|
objectType: U.PATH,
|
|
716
716
|
anchor: ht,
|
|
717
717
|
strokeColor: Q,
|
|
718
718
|
drawn: 1,
|
|
719
|
-
fillColor:
|
|
719
|
+
fillColor: Ie(),
|
|
720
720
|
isRounded: !1,
|
|
721
721
|
height: t,
|
|
722
722
|
path: r,
|
|
723
|
-
pathLength:
|
|
723
|
+
pathLength: c,
|
|
724
724
|
strokeWidth: 4,
|
|
725
725
|
viewboxHeight: i ?? t,
|
|
726
726
|
viewboxWidth: a ?? o,
|
|
@@ -730,7 +730,7 @@ function Bn(n = null) {
|
|
|
730
730
|
...s
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Xn(n = null) {
|
|
734
734
|
return lt({
|
|
735
735
|
objectType: U.POLYGON,
|
|
736
736
|
strokeColor: Q,
|
|
@@ -745,7 +745,7 @@ function Dn(n = null) {
|
|
|
745
745
|
...n
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function Gn(n = null) {
|
|
749
749
|
return lt({
|
|
750
750
|
objectType: U.RECTANGLE,
|
|
751
751
|
anchor: ht,
|
|
@@ -761,7 +761,7 @@ function qn(n = null) {
|
|
|
761
761
|
...n
|
|
762
762
|
});
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function Vn(n = null) {
|
|
765
765
|
return lt({
|
|
766
766
|
objectType: U.SVG,
|
|
767
767
|
anchor: ht,
|
|
@@ -773,11 +773,11 @@ function zn(n = null) {
|
|
|
773
773
|
...n
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
|
-
const
|
|
776
|
+
const _e = {
|
|
777
777
|
NORMAL: "normal",
|
|
778
778
|
ITALIC: "italic",
|
|
779
779
|
OBLIQUE: "oblique"
|
|
780
|
-
},
|
|
780
|
+
}, Oe = _e.NORMAL, Ne = {
|
|
781
781
|
THIN: 100,
|
|
782
782
|
EXTRA_LIGHT: 200,
|
|
783
783
|
LIGHT: 300,
|
|
@@ -787,57 +787,80 @@ const Ce = {
|
|
|
787
787
|
BOLD: 700,
|
|
788
788
|
EXTRA_BOLD: 800,
|
|
789
789
|
BLACK: 900
|
|
790
|
-
},
|
|
790
|
+
}, Re = Ne.NORMAL, Fe = {
|
|
791
791
|
color: Q,
|
|
792
792
|
fontFamily: "sans-serif",
|
|
793
793
|
fontSize: 100,
|
|
794
|
-
fontStyle:
|
|
795
|
-
fontWeight:
|
|
794
|
+
fontStyle: Oe,
|
|
795
|
+
fontWeight: Re,
|
|
796
796
|
ligatures: !1,
|
|
797
797
|
subscript: !1,
|
|
798
798
|
superscript: !1
|
|
799
799
|
};
|
|
800
|
-
function
|
|
800
|
+
function U0(n) {
|
|
801
801
|
return typeof n == "string" ? [[{ text: n }]] : n.map((e) => e.map((t) => typeof t == "string" ? { text: t } : t));
|
|
802
802
|
}
|
|
803
|
-
function
|
|
804
|
-
return
|
|
803
|
+
function Be(n) {
|
|
804
|
+
return U0(n).reduce(
|
|
805
805
|
(t, o) => t + o.reduce((i, a) => i + a.text.length, 0),
|
|
806
806
|
0
|
|
807
807
|
);
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function De(n = "", e = null) {
|
|
810
810
|
return lt({
|
|
811
811
|
objectType: U.TEXT,
|
|
812
|
-
alignment:
|
|
812
|
+
alignment: ue,
|
|
813
813
|
anchor: ht,
|
|
814
814
|
length: null,
|
|
815
815
|
lineSpacing: 1,
|
|
816
816
|
text: n,
|
|
817
817
|
x: 0,
|
|
818
818
|
y: 0,
|
|
819
|
-
...
|
|
819
|
+
...Fe,
|
|
820
820
|
...e
|
|
821
821
|
});
|
|
822
822
|
}
|
|
823
|
-
|
|
823
|
+
De.writeOn = (n, e = {}) => s0(
|
|
824
824
|
n,
|
|
825
825
|
{
|
|
826
|
-
length:
|
|
826
|
+
length: Be(n.text)
|
|
827
827
|
},
|
|
828
828
|
e
|
|
829
829
|
);
|
|
830
|
-
|
|
830
|
+
const a0 = "presenter.navigator.open";
|
|
831
|
+
function $0() {
|
|
832
|
+
return typeof document > "u" ? !1 : Array.from(document.scripts).some((n) => n.src.includes("/@vite/client"));
|
|
833
|
+
}
|
|
834
|
+
function qe() {
|
|
835
|
+
var n;
|
|
836
|
+
return $0() ? ((n = h0()) == null ? void 0 : n.getItem(a0)) === "true" : !1;
|
|
837
|
+
}
|
|
838
|
+
function ze() {
|
|
839
|
+
var n;
|
|
840
|
+
$0() && ((n = h0()) == null || n.setItem(a0, "true"));
|
|
841
|
+
}
|
|
842
|
+
function Y0() {
|
|
843
|
+
var n;
|
|
844
|
+
(n = h0()) == null || n.removeItem(a0);
|
|
845
|
+
}
|
|
846
|
+
function h0() {
|
|
847
|
+
try {
|
|
848
|
+
return window.sessionStorage;
|
|
849
|
+
} catch {
|
|
850
|
+
return null;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
function W0(n) {
|
|
831
854
|
return n.altKey || n.ctrlKey || n.metaKey || n.shiftKey;
|
|
832
855
|
}
|
|
833
|
-
function
|
|
856
|
+
function v0(n) {
|
|
834
857
|
var o, i;
|
|
835
858
|
if (n === null)
|
|
836
859
|
return !1;
|
|
837
860
|
const e = n, t = (o = e.tagName) == null ? void 0 : o.toLowerCase();
|
|
838
861
|
return t === "input" || t === "textarea" || t === "select" || t === "button" || e.isContentEditable ? !0 : (((i = e.closest) == null ? void 0 : i.call(e, "[contenteditable=''], [contenteditable='true']")) ?? null) !== null;
|
|
839
862
|
}
|
|
840
|
-
function
|
|
863
|
+
function je(n) {
|
|
841
864
|
var o;
|
|
842
865
|
const { slides: e } = n, t = {
|
|
843
866
|
// First build of first slide
|
|
@@ -855,20 +878,20 @@ function Oe(n) {
|
|
|
855
878
|
if (a === void 0)
|
|
856
879
|
continue;
|
|
857
880
|
const s = a.shortcut;
|
|
858
|
-
|
|
881
|
+
qt(t, s, i, 0);
|
|
859
882
|
for (let r = 0; r < a.animations.length; r++) {
|
|
860
883
|
const h = a.animations[r];
|
|
861
884
|
if (h !== void 0)
|
|
862
885
|
if (Array.isArray(h))
|
|
863
|
-
for (const
|
|
864
|
-
|
|
886
|
+
for (const c of h)
|
|
887
|
+
qt(t, c.shortcut, i, r + 1);
|
|
865
888
|
else
|
|
866
|
-
|
|
889
|
+
qt(t, h.shortcut, i, r + 1);
|
|
867
890
|
}
|
|
868
891
|
}
|
|
869
892
|
return t;
|
|
870
893
|
}
|
|
871
|
-
function
|
|
894
|
+
function qt(n, e, t, o) {
|
|
872
895
|
if (e !== null)
|
|
873
896
|
if (Array.isArray(e))
|
|
874
897
|
for (const i of e)
|
|
@@ -876,144 +899,194 @@ function Dt(n, e, t, o) {
|
|
|
876
899
|
else
|
|
877
900
|
n[e] = { slideIndex: t, buildIndex: o };
|
|
878
901
|
}
|
|
879
|
-
function
|
|
880
|
-
t.shortcuts =
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
if (c.code === "Enter") {
|
|
901
|
-
const d = t.textCommand;
|
|
902
|
+
function X0(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }, { focusOnPointerDown: r = !1, keyEventTarget: h = e, signal: c } = {}) {
|
|
903
|
+
t.shortcuts = je(n);
|
|
904
|
+
const u = c === void 0 ? void 0 : { signal: c };
|
|
905
|
+
r && (e.hasAttribute("tabindex") || (e.tabIndex = -1), e.addEventListener(
|
|
906
|
+
"pointerdown",
|
|
907
|
+
(p) => {
|
|
908
|
+
v0(p.target) || e.focus({ preventScroll: !0 });
|
|
909
|
+
},
|
|
910
|
+
u
|
|
911
|
+
)), e.addEventListener(
|
|
912
|
+
"mousemove",
|
|
913
|
+
() => {
|
|
914
|
+
e.style.cursor = "auto";
|
|
915
|
+
},
|
|
916
|
+
u
|
|
917
|
+
), h.addEventListener(
|
|
918
|
+
"keyup",
|
|
919
|
+
(p) => {
|
|
920
|
+
const l = p;
|
|
921
|
+
if (!v0(l.target)) {
|
|
922
|
+
if (l.code === "Escape") {
|
|
902
923
|
t.textCommand = null;
|
|
903
|
-
const l = t.shortcuts[d];
|
|
904
|
-
l !== void 0 ? a(l.slideIndex, l.buildIndex) : isNaN(Number(d)) || a(Number(d) - 1, 0);
|
|
905
924
|
return;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
925
|
+
}
|
|
926
|
+
if (l.code === "ArrowRight" || l.code === "Space") {
|
|
927
|
+
o(l.shiftKey);
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
if (l.code === "ArrowLeft") {
|
|
931
|
+
i(l.shiftKey);
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
if (t.textCommand !== null) {
|
|
935
|
+
if (l.code === "Enter") {
|
|
936
|
+
const f = t.textCommand;
|
|
937
|
+
t.textCommand = null;
|
|
938
|
+
const v = t.shortcuts[f];
|
|
939
|
+
v !== void 0 ? a(v.slideIndex, v.buildIndex) : isNaN(Number(f)) || a(Number(f) - 1, 0);
|
|
940
|
+
return;
|
|
941
|
+
} else l.code === "Backspace" ? t.textCommand = t.textCommand.slice(0, -1) : t.textCommand += l.key;
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
if (l.key === "g") {
|
|
945
|
+
t.textCommand = "";
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
if (l.key === "`" && !W0(l)) {
|
|
949
|
+
s();
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
916
952
|
}
|
|
917
|
-
}
|
|
918
|
-
|
|
953
|
+
},
|
|
954
|
+
u
|
|
955
|
+
);
|
|
919
956
|
}
|
|
920
|
-
let
|
|
957
|
+
let R = null, Ot = null, yt = null;
|
|
958
|
+
const w0 = "__presenterNavigatorInstanceId";
|
|
959
|
+
let G0 = {
|
|
921
960
|
width: 700,
|
|
922
961
|
height: 680,
|
|
923
962
|
left: 20,
|
|
924
963
|
top: 50
|
|
925
964
|
};
|
|
926
|
-
function
|
|
965
|
+
function He({
|
|
927
966
|
presentation: n,
|
|
928
967
|
shortcutState: e,
|
|
929
968
|
onNavigateToSlide: t,
|
|
930
969
|
onRenderSlide: o,
|
|
931
970
|
onNext: i,
|
|
932
|
-
onPrevious: a
|
|
971
|
+
onPrevious: a,
|
|
972
|
+
forceRefresh: s = !1
|
|
933
973
|
}) {
|
|
934
|
-
if (
|
|
935
|
-
return
|
|
936
|
-
if (
|
|
974
|
+
if (R !== null && !R.closed && (Nt(R), !s))
|
|
975
|
+
return R.focus(), Ot;
|
|
976
|
+
if ((R === null || R.closed) && (R = window.open("", "Navigator", We())), R === null)
|
|
937
977
|
return console.error("Failed to open navigator window."), null;
|
|
938
|
-
|
|
939
|
-
|
|
978
|
+
yt == null || yt();
|
|
979
|
+
const r = Xe(R), h = new AbortController();
|
|
980
|
+
yt = () => h.abort();
|
|
981
|
+
const c = Ue(
|
|
982
|
+
n,
|
|
983
|
+
t,
|
|
984
|
+
i,
|
|
985
|
+
r.isActive
|
|
986
|
+
);
|
|
987
|
+
return Ot = c, ze(), R.document.title = n.title, R.document.body.replaceChildren(c.element), X0(
|
|
940
988
|
n,
|
|
941
|
-
|
|
989
|
+
c.element,
|
|
942
990
|
e,
|
|
943
991
|
{
|
|
944
|
-
onNext: (
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
992
|
+
onNext: (u) => {
|
|
993
|
+
r.isActive() && i(u);
|
|
994
|
+
},
|
|
995
|
+
onPrevious: (u) => {
|
|
996
|
+
r.isActive() && a(u);
|
|
997
|
+
},
|
|
998
|
+
onRenderSlide: (u, p) => {
|
|
999
|
+
r.isActive() && o(u, p);
|
|
1000
|
+
},
|
|
1001
|
+
onShowNavigator: () => {
|
|
1002
|
+
r.isActive() && Jt();
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
keyEventTarget: R,
|
|
1007
|
+
signal: h.signal
|
|
1008
|
+
}
|
|
1009
|
+
), R.addEventListener("resize", () => Nt(R), {
|
|
1010
|
+
signal: h.signal
|
|
1011
|
+
}), R.addEventListener(
|
|
1012
|
+
"beforeunload",
|
|
1013
|
+
() => {
|
|
1014
|
+
Nt(R), Y0();
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
signal: h.signal
|
|
1018
|
+
}
|
|
1019
|
+
), R.addEventListener(
|
|
1020
|
+
"keyup",
|
|
1021
|
+
(u) => {
|
|
1022
|
+
r.isActive() && (u.key === "Escape" || u.key === "`" && !W0(u)) && Jt();
|
|
948
1023
|
},
|
|
949
1024
|
{
|
|
950
|
-
|
|
1025
|
+
signal: h.signal
|
|
951
1026
|
}
|
|
952
|
-
),
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
const
|
|
964
|
-
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
const
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
i.style.gridTemplateColumns = l.input.checked ? "260px 1fr" : "1fr", h.style.flexDirection = L ? "column" : "row", u.container.style.flex = "1 1 0", c.container.style.flex = "1 1 0", requestAnimationFrame(() => {
|
|
979
|
-
u.resize(), c.resize();
|
|
1027
|
+
), Ot;
|
|
1028
|
+
}
|
|
1029
|
+
function Ue(n, e, t, o = () => !0) {
|
|
1030
|
+
const i = (R == null ? void 0 : R.document) ?? document, a = i.createElement("div");
|
|
1031
|
+
a.style.boxSizing = "border-box", a.style.display = "grid", a.style.gridTemplateColumns = "260px 1fr", a.style.gap = "18px", a.style.height = "100vh", a.style.overflow = "hidden", a.style.padding = "18px", a.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', a.style.backgroundColor = "#f5f6f8", a.style.color = "#1f2937", i.body.style.margin = "0", i.body.style.overflow = "hidden";
|
|
1032
|
+
const s = i.createElement("div");
|
|
1033
|
+
s.style.display = "flex", s.style.flexDirection = "column", s.style.gap = "8px", s.style.minHeight = "0", s.style.overflowY = "auto", s.style.paddingRight = "4px";
|
|
1034
|
+
const r = i.createElement("div");
|
|
1035
|
+
r.style.display = "flex", r.style.flexDirection = "column", r.style.gap = "14px", r.style.minHeight = "0", r.style.minWidth = "0", r.style.overflow = "hidden";
|
|
1036
|
+
const h = i.createElement("div");
|
|
1037
|
+
h.style.display = "flex", h.style.gap = "14px", h.style.alignItems = "center", h.style.flexWrap = "wrap", h.style.fontSize = "13px", h.style.color = "#4b5563";
|
|
1038
|
+
const c = i.createElement("div");
|
|
1039
|
+
c.style.display = "flex", c.style.gap = "14px", c.style.flex = "1 1 auto", c.style.minHeight = "0", c.style.minWidth = "0", c.style.overflow = "hidden";
|
|
1040
|
+
const u = m0("Current", n), p = m0("Next", n);
|
|
1041
|
+
p.container.style.cursor = "pointer", p.container.addEventListener("click", () => {
|
|
1042
|
+
o() && t();
|
|
1043
|
+
});
|
|
1044
|
+
const l = n.slides.map((L, S) => {
|
|
1045
|
+
const T = $e(L, S);
|
|
1046
|
+
return T.style.cursor = "pointer", T.addEventListener("click", (k) => {
|
|
1047
|
+
o() && (k.shiftKey && Jt(), e(S));
|
|
1048
|
+
}), s.appendChild(T), T;
|
|
1049
|
+
}), f = zt("Slides", s, !0), v = zt("Current", u.container, !0), y = zt("Next", p.container, !0), M = () => {
|
|
1050
|
+
const L = v.input.checked && y.input.checked && E();
|
|
1051
|
+
a.style.gridTemplateColumns = f.input.checked ? "260px 1fr" : "1fr", c.style.flexDirection = L ? "column" : "row", u.container.style.flex = "1 1 0", p.container.style.flex = "1 1 0", requestAnimationFrame(() => {
|
|
1052
|
+
u.resize(), p.resize();
|
|
980
1053
|
});
|
|
981
1054
|
};
|
|
982
|
-
|
|
983
|
-
function
|
|
984
|
-
|
|
985
|
-
const
|
|
986
|
-
|
|
987
|
-
}), u.label.textContent =
|
|
1055
|
+
f.input.addEventListener("change", M), v.input.addEventListener("change", M), y.input.addEventListener("change", M), R == null || R.addEventListener("resize", M), h.appendChild(f.element), h.appendChild(v.element), h.appendChild(y.element), c.appendChild(u.container), c.appendChild(p.container), r.appendChild(h), r.appendChild(c), a.appendChild(s), a.appendChild(r);
|
|
1056
|
+
function P(L, S, T, k) {
|
|
1057
|
+
o() && (l.forEach((F, X) => {
|
|
1058
|
+
const z = X === L;
|
|
1059
|
+
F.style.backgroundColor = z ? "#dbeafe" : "#ffffff", F.style.borderColor = z ? "#60a5fa" : "#e5e7eb", F.style.color = z ? "#1e3a8a" : "#1f2937";
|
|
1060
|
+
}), u.label.textContent = b0(n, L, S), p.label.textContent = b0(n, T, k), Ye(l[L], s), M());
|
|
988
1061
|
}
|
|
989
1062
|
function E() {
|
|
990
|
-
const L =
|
|
1063
|
+
const L = R;
|
|
991
1064
|
if (L === null)
|
|
992
1065
|
return !1;
|
|
993
|
-
const
|
|
994
|
-
return
|
|
1066
|
+
const S = f.input.checked ? 278 : 0, T = L.innerWidth - 36 - S, k = L.innerHeight - 36 - h.offsetHeight - 14;
|
|
1067
|
+
return T <= 0 || k <= 0 ? !1 : T / k < 1.1;
|
|
995
1068
|
}
|
|
996
1069
|
return {
|
|
997
|
-
element:
|
|
1070
|
+
element: a,
|
|
998
1071
|
currentCanvas: u.canvas,
|
|
999
|
-
nextCanvas:
|
|
1072
|
+
nextCanvas: p.canvas,
|
|
1000
1073
|
currentLabel: u.label,
|
|
1001
|
-
nextLabel:
|
|
1002
|
-
isOpen: () =>
|
|
1003
|
-
update:
|
|
1074
|
+
nextLabel: p.label,
|
|
1075
|
+
isOpen: () => R !== null && !R.closed,
|
|
1076
|
+
update: P
|
|
1004
1077
|
};
|
|
1005
1078
|
}
|
|
1006
|
-
function
|
|
1007
|
-
const t = (
|
|
1079
|
+
function $e(n, e) {
|
|
1080
|
+
const t = (R == null ? void 0 : R.document) ?? document, o = t.createElement("div");
|
|
1008
1081
|
o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "10px", o.style.padding = "8px 10px", o.style.backgroundColor = "#ffffff", o.style.border = "1px solid #e5e7eb", o.style.borderRadius = "6px", o.style.boxShadow = "0 1px 2px rgba(15, 23, 42, 0.06)", o.style.fontSize = "14px", o.style.lineHeight = "1", o.style.userSelect = "none";
|
|
1009
1082
|
const i = t.createElement("div");
|
|
1010
1083
|
i.textContent = `${e + 1}`, i.style.minWidth = "24px", i.style.fontWeight = "700", i.style.color = "#6b7280";
|
|
1011
1084
|
const a = t.createElement("div");
|
|
1012
1085
|
return a.textContent = n.title.length > 0 ? n.title : `Slide ${e + 1}`, a.style.overflow = "hidden", a.style.textOverflow = "ellipsis", a.style.whiteSpace = "nowrap", o.appendChild(i), o.appendChild(a), o;
|
|
1013
1086
|
}
|
|
1014
|
-
function
|
|
1015
|
-
var
|
|
1016
|
-
const t = (
|
|
1087
|
+
function m0(n, e) {
|
|
1088
|
+
var u;
|
|
1089
|
+
const t = (R == null ? void 0 : R.document) ?? document, o = t.createElement("div");
|
|
1017
1090
|
o.style.display = "flex", o.style.alignItems = "center", o.style.flexDirection = "column", o.style.minHeight = "0", o.style.minWidth = "0";
|
|
1018
1091
|
const i = t.createElement("div");
|
|
1019
1092
|
i.textContent = n, i.style.marginBottom = "4px", i.style.fontSize = "12px", i.style.fontWeight = "700", i.style.textAlign = "center", i.style.textTransform = "uppercase", i.style.color = "#6b7280";
|
|
@@ -1024,50 +1097,57 @@ function x0(n, e) {
|
|
|
1024
1097
|
const r = t.createElement("canvas");
|
|
1025
1098
|
r.style.display = "block", r.style.width = "0", r.style.height = "0";
|
|
1026
1099
|
function h() {
|
|
1027
|
-
const
|
|
1028
|
-
if (
|
|
1100
|
+
const p = s.clientWidth, l = s.clientHeight;
|
|
1101
|
+
if (p <= 0 || l <= 0)
|
|
1029
1102
|
return;
|
|
1030
|
-
const f = e.size.width / e.size.height,
|
|
1031
|
-
r.style.width = `${
|
|
1103
|
+
const f = e.size.width / e.size.height, v = Math.min(p, l * f), y = v / f;
|
|
1104
|
+
r.style.width = `${v}px`, r.style.height = `${y}px`;
|
|
1032
1105
|
}
|
|
1033
|
-
const
|
|
1034
|
-
return
|
|
1106
|
+
const c = (u = t.defaultView) == null ? void 0 : u.ResizeObserver;
|
|
1107
|
+
return c !== void 0 && new c(h).observe(s), R == null || R.addEventListener("resize", h), s.appendChild(r), o.appendChild(i), o.appendChild(a), o.appendChild(s), { container: o, label: a, canvas: r, resize: h };
|
|
1035
1108
|
}
|
|
1036
|
-
function
|
|
1037
|
-
const o = (
|
|
1109
|
+
function zt(n, e, t) {
|
|
1110
|
+
const o = (R == null ? void 0 : R.document) ?? document, i = e.style.display || "block", a = o.createElement("label");
|
|
1038
1111
|
a.style.display = "inline-flex", a.style.alignItems = "center", a.style.gap = "6px", a.style.userSelect = "none";
|
|
1039
1112
|
const s = o.createElement("input");
|
|
1040
1113
|
return s.type = "checkbox", s.checked = t, s.addEventListener("change", () => {
|
|
1041
1114
|
e.style.display = s.checked ? i : "none";
|
|
1042
1115
|
}), a.appendChild(s), a.appendChild(o.createTextNode(n)), { element: a, input: s };
|
|
1043
1116
|
}
|
|
1044
|
-
function
|
|
1117
|
+
function b0(n, e, t) {
|
|
1045
1118
|
if (e === null)
|
|
1046
1119
|
return "End of presentation";
|
|
1047
1120
|
const o = n.slides[e];
|
|
1048
1121
|
return o === void 0 ? "No slide" : `Slide ${e + 1} of ${n.slides.length}, Build ${t + 1} of ${o.animations.length + 1}`;
|
|
1049
1122
|
}
|
|
1050
|
-
function
|
|
1123
|
+
function Ye(n, e) {
|
|
1051
1124
|
if (n === void 0)
|
|
1052
1125
|
return;
|
|
1053
1126
|
const t = n.offsetTop, o = t + n.offsetHeight, i = e.scrollTop, a = i + e.clientHeight;
|
|
1054
1127
|
(t < i || o > a) && n.scrollIntoView({ block: "nearest" });
|
|
1055
1128
|
}
|
|
1056
|
-
function
|
|
1057
|
-
|
|
1129
|
+
function Jt() {
|
|
1130
|
+
Nt(R), Y0(), yt == null || yt(), R == null || R.close(), R = null, Ot = null, yt = null;
|
|
1058
1131
|
}
|
|
1059
|
-
function
|
|
1060
|
-
const { width: n, height: e, left: t, top: o } =
|
|
1132
|
+
function We() {
|
|
1133
|
+
const { width: n, height: e, left: t, top: o } = G0;
|
|
1061
1134
|
return `width=${n},height=${e},left=${t},top=${o}`;
|
|
1062
1135
|
}
|
|
1063
|
-
function
|
|
1064
|
-
n === null || n.closed || (
|
|
1136
|
+
function Nt(n) {
|
|
1137
|
+
n === null || n.closed || (G0 = {
|
|
1065
1138
|
width: n.outerWidth,
|
|
1066
1139
|
height: n.outerHeight,
|
|
1067
1140
|
left: n.screenX,
|
|
1068
1141
|
top: n.screenY
|
|
1069
1142
|
});
|
|
1070
1143
|
}
|
|
1144
|
+
function Xe(n) {
|
|
1145
|
+
var o;
|
|
1146
|
+
const e = typeof ((o = globalThis.crypto) == null ? void 0 : o.randomUUID) == "function" ? globalThis.crypto.randomUUID() : `${Date.now()}-${Math.random()}`, t = n;
|
|
1147
|
+
return t[w0] = e, {
|
|
1148
|
+
isActive: () => !n.closed && t[w0] === e
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1071
1151
|
function at(n = null) {
|
|
1072
1152
|
return {
|
|
1073
1153
|
height: 0,
|
|
@@ -1075,8 +1155,8 @@ function at(n = null) {
|
|
|
1075
1155
|
...n
|
|
1076
1156
|
};
|
|
1077
1157
|
}
|
|
1078
|
-
const
|
|
1079
|
-
function
|
|
1158
|
+
const Ge = at({ width: 0, height: 0 });
|
|
1159
|
+
function Ve(n = null) {
|
|
1080
1160
|
return {
|
|
1081
1161
|
backgroundColor: G.WHITE,
|
|
1082
1162
|
slides: [],
|
|
@@ -1088,7 +1168,7 @@ function ze(n = null) {
|
|
|
1088
1168
|
...n
|
|
1089
1169
|
};
|
|
1090
1170
|
}
|
|
1091
|
-
function
|
|
1171
|
+
function Ze(n) {
|
|
1092
1172
|
const e = Array.isArray(n) ? n : [n];
|
|
1093
1173
|
let t = 0, o = 0;
|
|
1094
1174
|
for (const i of e)
|
|
@@ -1106,26 +1186,26 @@ function je(n) {
|
|
|
1106
1186
|
}
|
|
1107
1187
|
return o;
|
|
1108
1188
|
}
|
|
1109
|
-
function
|
|
1110
|
-
const { red: t, green: o, blue: i } = n, a =
|
|
1189
|
+
function l0(n, e = null) {
|
|
1190
|
+
const { red: t, green: o, blue: i } = n, a = z0(n, e);
|
|
1111
1191
|
return `rgba(${t}, ${o}, ${i}, ${a})`;
|
|
1112
1192
|
}
|
|
1113
|
-
function
|
|
1193
|
+
function V0(n) {
|
|
1114
1194
|
return n === document.body;
|
|
1115
1195
|
}
|
|
1116
|
-
function
|
|
1196
|
+
function Ke(n, e) {
|
|
1117
1197
|
const t = document.createElement("div");
|
|
1118
|
-
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative",
|
|
1198
|
+
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", V0(e)) {
|
|
1119
1199
|
t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto", t.style.overflowY = "clip", document.title = n.title, document.documentElement.style.height = "100%", document.body.style.margin = "0", document.body.style.height = "100%", document.body.style.width = "100%", document.body.style.backgroundColor = "#000000";
|
|
1120
1200
|
const o = n.size.height / n.size.width;
|
|
1121
|
-
|
|
1201
|
+
A0(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => A0(t, o));
|
|
1122
1202
|
}
|
|
1123
1203
|
return t;
|
|
1124
1204
|
}
|
|
1125
|
-
function
|
|
1205
|
+
function A0(n, e) {
|
|
1126
1206
|
window.innerHeight / window.innerWidth > e ? (n.style.width = "100%", n.style.height = "auto") : (n.style.width = "auto", n.style.height = "100%");
|
|
1127
1207
|
}
|
|
1128
|
-
const
|
|
1208
|
+
const Qe = {
|
|
1129
1209
|
check: (n) => typeof n == "object" && n !== null && typeof n.red == "number" && typeof n.green == "number" && typeof n.blue == "number" && typeof n.alpha == "number",
|
|
1130
1210
|
interpolate: (n, e, t) => ({
|
|
1131
1211
|
red: Math.round(n.red + (e.red - n.red) * t),
|
|
@@ -1133,28 +1213,28 @@ const Ue = {
|
|
|
1133
1213
|
blue: Math.round(n.blue + (e.blue - n.blue) * t),
|
|
1134
1214
|
alpha: n.alpha + (e.alpha - n.alpha) * t
|
|
1135
1215
|
})
|
|
1136
|
-
},
|
|
1216
|
+
}, Je = {
|
|
1137
1217
|
check: (n) => !0,
|
|
1138
1218
|
interpolate: (n, e) => e
|
|
1139
|
-
},
|
|
1219
|
+
}, t1 = {
|
|
1140
1220
|
check: (n) => typeof n == "number",
|
|
1141
1221
|
interpolate: (n, e, t) => n + (e - n) * t
|
|
1142
|
-
},
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1222
|
+
}, M0 = [
|
|
1223
|
+
t1,
|
|
1224
|
+
Qe,
|
|
1225
|
+
Je
|
|
1146
1226
|
];
|
|
1147
|
-
function
|
|
1227
|
+
function e1(n, e, t, o = null) {
|
|
1148
1228
|
if (t === 0)
|
|
1149
1229
|
return n;
|
|
1150
1230
|
if (t === 1)
|
|
1151
1231
|
return { ...n, ...e };
|
|
1152
|
-
const i = o != null ? [...o, ...
|
|
1232
|
+
const i = o != null ? [...o, ...M0] : M0, a = {};
|
|
1153
1233
|
for (const s in e) {
|
|
1154
1234
|
const r = n[s], h = e[s];
|
|
1155
|
-
for (const
|
|
1156
|
-
if (
|
|
1157
|
-
a[s] =
|
|
1235
|
+
for (const c of i)
|
|
1236
|
+
if (c.check(r, s) && c.check(h, s)) {
|
|
1237
|
+
a[s] = c.interpolate(
|
|
1158
1238
|
r,
|
|
1159
1239
|
h,
|
|
1160
1240
|
t
|
|
@@ -1164,7 +1244,7 @@ function We(n, e, t, o = null) {
|
|
|
1164
1244
|
}
|
|
1165
1245
|
return { ...n, ...a };
|
|
1166
1246
|
}
|
|
1167
|
-
function
|
|
1247
|
+
function L0(n, e, t = null) {
|
|
1168
1248
|
if (e === null)
|
|
1169
1249
|
return;
|
|
1170
1250
|
const o = Array.isArray(e) ? e : [e];
|
|
@@ -1186,7 +1266,7 @@ function m0(n, e, t = null) {
|
|
|
1186
1266
|
);
|
|
1187
1267
|
n.set(a.object, {
|
|
1188
1268
|
...s,
|
|
1189
|
-
...
|
|
1269
|
+
...e1(
|
|
1190
1270
|
s,
|
|
1191
1271
|
a.props,
|
|
1192
1272
|
a.easing(h),
|
|
@@ -1213,10 +1293,10 @@ function m0(n, e, t = null) {
|
|
|
1213
1293
|
}
|
|
1214
1294
|
}
|
|
1215
1295
|
}
|
|
1216
|
-
function
|
|
1296
|
+
function Z0(n) {
|
|
1217
1297
|
return "objects" in n ? n.objects.filter((e) => "objectType" in e) : [];
|
|
1218
1298
|
}
|
|
1219
|
-
function
|
|
1299
|
+
function n1({
|
|
1220
1300
|
slide: n,
|
|
1221
1301
|
buildIndex: e,
|
|
1222
1302
|
buildTime: t
|
|
@@ -1224,7 +1304,7 @@ function Xe({
|
|
|
1224
1304
|
const o = /* @__PURE__ */ new Map();
|
|
1225
1305
|
function i(s) {
|
|
1226
1306
|
o.set(s, s);
|
|
1227
|
-
for (const r of
|
|
1307
|
+
for (const r of Z0(s))
|
|
1228
1308
|
i(r);
|
|
1229
1309
|
}
|
|
1230
1310
|
for (const s of n.objects)
|
|
@@ -1232,22 +1312,22 @@ function Xe({
|
|
|
1232
1312
|
const a = t === null ? e : e - 1;
|
|
1233
1313
|
for (let s = 0; s < a; s++) {
|
|
1234
1314
|
const r = n.animations[s] ?? null;
|
|
1235
|
-
|
|
1315
|
+
L0(o, r);
|
|
1236
1316
|
}
|
|
1237
1317
|
if (t !== null && e > 0) {
|
|
1238
1318
|
const s = n.animations[e - 1] ?? null;
|
|
1239
|
-
|
|
1319
|
+
L0(o, s, t);
|
|
1240
1320
|
}
|
|
1241
1321
|
return o;
|
|
1242
1322
|
}
|
|
1243
|
-
function
|
|
1323
|
+
function r1(n) {
|
|
1244
1324
|
const e = {};
|
|
1245
1325
|
function t(o) {
|
|
1246
1326
|
if (o.objectType === U.SVG) {
|
|
1247
1327
|
const a = o.svg;
|
|
1248
1328
|
a !== void 0 && a.length > 0 && (e[a] = a);
|
|
1249
1329
|
}
|
|
1250
|
-
const i =
|
|
1330
|
+
const i = Z0(o);
|
|
1251
1331
|
for (const a of i)
|
|
1252
1332
|
t(a);
|
|
1253
1333
|
}
|
|
@@ -1257,7 +1337,7 @@ function Ge(n) {
|
|
|
1257
1337
|
return e;
|
|
1258
1338
|
}
|
|
1259
1339
|
const dt = "presenterState";
|
|
1260
|
-
function
|
|
1340
|
+
function i1(n, e) {
|
|
1261
1341
|
const t = localStorage.getItem(dt);
|
|
1262
1342
|
if (t === null)
|
|
1263
1343
|
return null;
|
|
@@ -1266,8 +1346,8 @@ function Ze(n, e) {
|
|
|
1266
1346
|
let o;
|
|
1267
1347
|
try {
|
|
1268
1348
|
o = JSON.parse(t);
|
|
1269
|
-
} catch (
|
|
1270
|
-
return console.error("Failed to parse presentation state from localStorage:",
|
|
1349
|
+
} catch (c) {
|
|
1350
|
+
return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(dt), null;
|
|
1271
1351
|
}
|
|
1272
1352
|
const { title: i, timestamp: a } = o;
|
|
1273
1353
|
let { slideIndex: s, buildIndex: r } = o;
|
|
@@ -1281,13 +1361,13 @@ function Ze(n, e) {
|
|
|
1281
1361
|
buildIndex: r
|
|
1282
1362
|
});
|
|
1283
1363
|
}
|
|
1284
|
-
function
|
|
1364
|
+
function o1({ title: n, slideIndex: e, buildIndex: t }) {
|
|
1285
1365
|
localStorage.setItem(
|
|
1286
1366
|
dt,
|
|
1287
1367
|
JSON.stringify({ title: n, slideIndex: e, buildIndex: t, timestamp: Date.now() })
|
|
1288
1368
|
);
|
|
1289
1369
|
}
|
|
1290
|
-
const
|
|
1370
|
+
const T0 = Object.freeze({
|
|
1291
1371
|
canvas: null,
|
|
1292
1372
|
extrasContainer: null,
|
|
1293
1373
|
mountedExtrasCleanups: [],
|
|
@@ -1300,14 +1380,14 @@ const b0 = Object.freeze({
|
|
|
1300
1380
|
textCommand: null,
|
|
1301
1381
|
shortcuts: {}
|
|
1302
1382
|
}
|
|
1303
|
-
}),
|
|
1383
|
+
}), Z = {
|
|
1304
1384
|
Browser: "browser",
|
|
1305
1385
|
Node: "node"
|
|
1306
1386
|
};
|
|
1307
|
-
function
|
|
1387
|
+
function s1(n, e) {
|
|
1308
1388
|
e.context.clearRect(0, 0, n.width, n.height);
|
|
1309
1389
|
}
|
|
1310
|
-
function
|
|
1390
|
+
function a1(n) {
|
|
1311
1391
|
const e = document.createElement("canvas");
|
|
1312
1392
|
return e.setAttribute("width", n.width.toString()), e.setAttribute("height", n.height.toString()), e.style.position = "absolute", e.style.width = "100%", e;
|
|
1313
1393
|
}
|
|
@@ -1315,34 +1395,34 @@ const gt = {
|
|
|
1315
1395
|
Browser: "browser",
|
|
1316
1396
|
Node: "node"
|
|
1317
1397
|
};
|
|
1318
|
-
function
|
|
1398
|
+
function h1(n) {
|
|
1319
1399
|
const e = new Path2D(n);
|
|
1320
1400
|
return {
|
|
1321
1401
|
type: gt.Browser,
|
|
1322
1402
|
path: e
|
|
1323
1403
|
};
|
|
1324
1404
|
}
|
|
1325
|
-
function
|
|
1326
|
-
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n,
|
|
1327
|
-
x: S.x -
|
|
1328
|
-
y: S.y -
|
|
1405
|
+
function l1(n) {
|
|
1406
|
+
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n, c = { x: t, y: o }, u = { x: i, y: a }, p = Math.atan2(u.y - c.y, u.x - c.x), l = { x: c.x + (u.x - c.x) / 2, y: c.y + (u.y - c.y) / 2 }, f = u.x - c.x, v = u.y - c.y, M = Math.hypot(f, v) * e, P = Math.cos(p), E = Math.sin(p), L = h ? { x: l.x - P * M / 2, y: l.y - E * M / 2 } : c, S = h ? { x: l.x + P * M / 2, y: l.y + E * M / 2 } : { x: c.x + P * M, y: c.y + E * M }, T = r ? Math.PI / 6 : Math.PI / 4.5, k = M < s * 2 ? M / 2 : s, F = {
|
|
1407
|
+
x: S.x - k * Math.cos(p - T),
|
|
1408
|
+
y: S.y - k * Math.sin(p - T)
|
|
1329
1409
|
}, X = {
|
|
1330
|
-
x: S.x -
|
|
1331
|
-
y: S.y -
|
|
1332
|
-
},
|
|
1333
|
-
x:
|
|
1334
|
-
y:
|
|
1410
|
+
x: S.x - k * Math.cos(p + T),
|
|
1411
|
+
y: S.y - k * Math.sin(p + T)
|
|
1412
|
+
}, z = {
|
|
1413
|
+
x: L.x + k * Math.cos(p - T),
|
|
1414
|
+
y: L.y + k * Math.sin(p - T)
|
|
1335
1415
|
}, Y = {
|
|
1336
|
-
x:
|
|
1337
|
-
y:
|
|
1416
|
+
x: L.x + k * Math.cos(p + T),
|
|
1417
|
+
y: L.y + k * Math.sin(p + T)
|
|
1338
1418
|
};
|
|
1339
1419
|
return {
|
|
1340
|
-
arrowPoints: [
|
|
1341
|
-
arrowheadPoints: [
|
|
1342
|
-
doubledArrowheadPoints: [
|
|
1420
|
+
arrowPoints: [L, S],
|
|
1421
|
+
arrowheadPoints: [F, S, X],
|
|
1422
|
+
doubledArrowheadPoints: [z, L, Y]
|
|
1343
1423
|
};
|
|
1344
1424
|
}
|
|
1345
|
-
function
|
|
1425
|
+
function vt({
|
|
1346
1426
|
ctx: n,
|
|
1347
1427
|
color: e,
|
|
1348
1428
|
drawn: t = null,
|
|
@@ -1355,24 +1435,24 @@ function yt({
|
|
|
1355
1435
|
}) {
|
|
1356
1436
|
if (!(h === 0 || t === 0)) {
|
|
1357
1437
|
if (t !== null && r !== null && t !== 1) {
|
|
1358
|
-
const
|
|
1438
|
+
const c = r + (i ? h : 0), u = r * t;
|
|
1359
1439
|
o ? n.context.setLineDash([
|
|
1360
1440
|
0,
|
|
1361
|
-
(
|
|
1362
|
-
|
|
1363
|
-
(
|
|
1364
|
-
]) : n.context.setLineDash([
|
|
1441
|
+
(c - u) / 2,
|
|
1442
|
+
u,
|
|
1443
|
+
(c - u) / 2
|
|
1444
|
+
]) : n.context.setLineDash([u, c - u]);
|
|
1365
1445
|
} else
|
|
1366
1446
|
n.context.setLineDash([]);
|
|
1367
|
-
if (n.context.lineWidth = h, n.context.strokeStyle =
|
|
1447
|
+
if (n.context.lineWidth = h, n.context.strokeStyle = St(e, a), n.context.lineCap = i ? "round" : "butt", s === void 0) {
|
|
1368
1448
|
n.context.stroke();
|
|
1369
1449
|
return;
|
|
1370
1450
|
}
|
|
1371
1451
|
switch (n.type) {
|
|
1372
|
-
case
|
|
1452
|
+
case Z.Browser:
|
|
1373
1453
|
s.type === gt.Browser ? n.context.stroke(s.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1374
1454
|
break;
|
|
1375
|
-
case
|
|
1455
|
+
case Z.Node:
|
|
1376
1456
|
s.type === gt.Node ? n.context.stroke(s.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1377
1457
|
break;
|
|
1378
1458
|
default:
|
|
@@ -1380,23 +1460,23 @@ function yt({
|
|
|
1380
1460
|
}
|
|
1381
1461
|
}
|
|
1382
1462
|
}
|
|
1383
|
-
function
|
|
1384
|
-
if (n.context.fillStyle =
|
|
1463
|
+
function wt({ ctx: n, path: e, color: t, opacity: o = null }) {
|
|
1464
|
+
if (n.context.fillStyle = l0(t, o), e === void 0) {
|
|
1385
1465
|
n.context.fill();
|
|
1386
1466
|
return;
|
|
1387
1467
|
}
|
|
1388
1468
|
switch (n.type) {
|
|
1389
|
-
case
|
|
1469
|
+
case Z.Browser:
|
|
1390
1470
|
e.type === gt.Browser ? n.context.fill(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1391
1471
|
break;
|
|
1392
|
-
case
|
|
1472
|
+
case Z.Node:
|
|
1393
1473
|
e.type === gt.Node ? n.context.fill(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1394
1474
|
break;
|
|
1395
1475
|
default:
|
|
1396
1476
|
st(n);
|
|
1397
1477
|
}
|
|
1398
1478
|
}
|
|
1399
|
-
function
|
|
1479
|
+
function jt(n, e) {
|
|
1400
1480
|
const t = e(), o = n[0];
|
|
1401
1481
|
if (o === void 0)
|
|
1402
1482
|
return { path: t, length: 0 };
|
|
@@ -1406,12 +1486,12 @@ function zt(n, e) {
|
|
|
1406
1486
|
const s = n[a], r = n[a - 1];
|
|
1407
1487
|
if (s === void 0 || r === void 0)
|
|
1408
1488
|
continue;
|
|
1409
|
-
const h = s.x - r.x,
|
|
1410
|
-
i += Math.hypot(h,
|
|
1489
|
+
const h = s.x - r.x, c = s.y - r.y;
|
|
1490
|
+
i += Math.hypot(h, c), t.path.lineTo(s.x, s.y);
|
|
1411
1491
|
}
|
|
1412
1492
|
return { path: t, length: i };
|
|
1413
1493
|
}
|
|
1414
|
-
const
|
|
1494
|
+
const c1 = ({
|
|
1415
1495
|
ctx: n,
|
|
1416
1496
|
object: e,
|
|
1417
1497
|
opacity: t,
|
|
@@ -1420,69 +1500,69 @@ const e1 = ({
|
|
|
1420
1500
|
const i = e.opacity * t;
|
|
1421
1501
|
if (i === 0 || e.drawn === 0)
|
|
1422
1502
|
return;
|
|
1423
|
-
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } =
|
|
1424
|
-
if (
|
|
1503
|
+
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = l1(e), { path: h } = jt(a, o), { path: c } = jt(s, o);
|
|
1504
|
+
if (vt({
|
|
1425
1505
|
color: e.color,
|
|
1426
1506
|
ctx: n,
|
|
1427
1507
|
path: h,
|
|
1428
1508
|
opacity: i,
|
|
1429
1509
|
width: e.width
|
|
1430
|
-
}), e.isArrowheadFilled && (
|
|
1510
|
+
}), e.isArrowheadFilled && (c.path.closePath(), wt({
|
|
1431
1511
|
ctx: n,
|
|
1432
|
-
path:
|
|
1512
|
+
path: c,
|
|
1433
1513
|
color: e.color,
|
|
1434
1514
|
opacity: i
|
|
1435
|
-
})),
|
|
1515
|
+
})), vt({
|
|
1436
1516
|
color: e.color,
|
|
1437
1517
|
ctx: n,
|
|
1438
|
-
path:
|
|
1518
|
+
path: c,
|
|
1439
1519
|
opacity: i,
|
|
1440
1520
|
width: e.width
|
|
1441
1521
|
}), e.isArrowheadDoubled) {
|
|
1442
|
-
const { path:
|
|
1522
|
+
const { path: u } = jt(
|
|
1443
1523
|
r,
|
|
1444
1524
|
o
|
|
1445
1525
|
);
|
|
1446
|
-
e.isArrowheadFilled && (
|
|
1526
|
+
e.isArrowheadFilled && (u.path.closePath(), wt({
|
|
1447
1527
|
ctx: n,
|
|
1448
|
-
path:
|
|
1528
|
+
path: u,
|
|
1449
1529
|
color: e.color,
|
|
1450
1530
|
opacity: i
|
|
1451
|
-
})),
|
|
1531
|
+
})), vt({
|
|
1452
1532
|
color: e.color,
|
|
1453
1533
|
ctx: n,
|
|
1454
|
-
path:
|
|
1534
|
+
path: u,
|
|
1455
1535
|
opacity: i,
|
|
1456
1536
|
width: e.width
|
|
1457
1537
|
});
|
|
1458
1538
|
}
|
|
1459
1539
|
};
|
|
1460
|
-
function
|
|
1540
|
+
function u1(n, e) {
|
|
1461
1541
|
const t = n.radius - n.strokeWidth / 2;
|
|
1462
1542
|
if (t <= 0)
|
|
1463
1543
|
return;
|
|
1464
1544
|
const o = e(), i = -Math.PI / 2;
|
|
1465
1545
|
return o.path.arc(n.x, n.y, t, i, i + 2 * Math.PI), o;
|
|
1466
1546
|
}
|
|
1467
|
-
function
|
|
1547
|
+
function f1(n, e) {
|
|
1468
1548
|
const t = e(), o = -Math.PI / 2;
|
|
1469
1549
|
t.path.arc(n.x, n.y, n.radius, o, o + 2 * Math.PI);
|
|
1470
1550
|
const i = 2 * Math.PI * n.radius;
|
|
1471
1551
|
return { path: t, length: i };
|
|
1472
1552
|
}
|
|
1473
|
-
function
|
|
1553
|
+
function K0(n, e) {
|
|
1474
1554
|
switch (n.type) {
|
|
1475
|
-
case
|
|
1555
|
+
case Z.Browser:
|
|
1476
1556
|
e.type === gt.Browser ? n.context.clip(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1477
1557
|
break;
|
|
1478
|
-
case
|
|
1558
|
+
case Z.Node:
|
|
1479
1559
|
e.type === gt.Node ? n.context.clip(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1480
1560
|
break;
|
|
1481
1561
|
default:
|
|
1482
1562
|
st(n);
|
|
1483
1563
|
}
|
|
1484
1564
|
}
|
|
1485
|
-
const
|
|
1565
|
+
const g1 = ({
|
|
1486
1566
|
ctx: n,
|
|
1487
1567
|
object: e,
|
|
1488
1568
|
opacity: t,
|
|
@@ -1491,13 +1571,13 @@ const i1 = ({
|
|
|
1491
1571
|
const i = e.opacity * t;
|
|
1492
1572
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1493
1573
|
return;
|
|
1494
|
-
const { path: a, length: s } =
|
|
1574
|
+
const { path: a, length: s } = f1(e, o);
|
|
1495
1575
|
if (i < 1 && e.strokeWidth > 0) {
|
|
1496
|
-
const r =
|
|
1497
|
-
r !== void 0 && (n.context.save(),
|
|
1576
|
+
const r = u1(e, o);
|
|
1577
|
+
r !== void 0 && (n.context.save(), K0(n, r), wt({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
|
|
1498
1578
|
} else
|
|
1499
|
-
|
|
1500
|
-
|
|
1579
|
+
wt({ ctx: n, path: a, color: e.fillColor, opacity: i });
|
|
1580
|
+
vt({
|
|
1501
1581
|
color: e.strokeColor,
|
|
1502
1582
|
ctx: n,
|
|
1503
1583
|
drawn: e.drawn,
|
|
@@ -1514,11 +1594,11 @@ function W(n = null) {
|
|
|
1514
1594
|
...n
|
|
1515
1595
|
};
|
|
1516
1596
|
}
|
|
1517
|
-
const
|
|
1597
|
+
const p1 = W();
|
|
1518
1598
|
function ut(n = null) {
|
|
1519
1599
|
return {
|
|
1520
|
-
origin:
|
|
1521
|
-
size:
|
|
1600
|
+
origin: p1,
|
|
1601
|
+
size: Ge,
|
|
1522
1602
|
...n
|
|
1523
1603
|
};
|
|
1524
1604
|
}
|
|
@@ -1575,7 +1655,7 @@ function pt(n, e, t) {
|
|
|
1575
1655
|
st(e);
|
|
1576
1656
|
}
|
|
1577
1657
|
}
|
|
1578
|
-
const
|
|
1658
|
+
const d1 = ({
|
|
1579
1659
|
ctx: n,
|
|
1580
1660
|
object: e,
|
|
1581
1661
|
renderObject: t,
|
|
@@ -1588,22 +1668,22 @@ const s1 = ({
|
|
|
1588
1668
|
width: e.width * Math.abs(i),
|
|
1589
1669
|
height: e.height * Math.abs(a)
|
|
1590
1670
|
})
|
|
1591
|
-
), { rotation: r, rotateOriginX: h, rotateOriginY:
|
|
1671
|
+
), { rotation: r, rotateOriginX: h, rotateOriginY: c, skewOriginX: u, skewOriginY: p, skewX: l, skewY: f } = e;
|
|
1592
1672
|
if (!(i === 0 || a === 0)) {
|
|
1593
|
-
n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(h,
|
|
1673
|
+
n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(h, c), n.context.rotate(r * Math.PI / 180), n.context.translate(-h, -c), n.context.translate(u, p), n.context.transform(
|
|
1594
1674
|
1,
|
|
1595
1675
|
Math.tan(f * Math.PI / 180),
|
|
1596
1676
|
Math.tan(l * Math.PI / 180),
|
|
1597
1677
|
1,
|
|
1598
1678
|
0,
|
|
1599
1679
|
0
|
|
1600
|
-
), n.context.translate(-
|
|
1601
|
-
for (const
|
|
1602
|
-
t(
|
|
1603
|
-
e.previewColor !== null && (n.context.fillStyle =
|
|
1680
|
+
), n.context.translate(-u, -p);
|
|
1681
|
+
for (const v of e.objects)
|
|
1682
|
+
t(v, o * e.opacity);
|
|
1683
|
+
e.previewColor !== null && (n.context.fillStyle = St(e.previewColor), n.context.fillRect(0, 0, e.width, e.height)), e.rotateOriginPreviewSize > 0 && (n.context.fillStyle = "red", n.context.beginPath(), n.context.arc(h, c, e.rotateOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), e.skewOriginPreviewSize > 0 && (n.context.fillStyle = "blue", n.context.beginPath(), n.context.arc(u, p, e.skewOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), n.context.restore();
|
|
1604
1684
|
}
|
|
1605
1685
|
};
|
|
1606
|
-
function
|
|
1686
|
+
function c0(n, e, t, o, i = 0) {
|
|
1607
1687
|
const a = o();
|
|
1608
1688
|
a.path.moveTo(n.x + t, n.y), a.path.lineTo(n.x + e.width - t, n.y), a.path.arcTo(
|
|
1609
1689
|
n.x + e.width,
|
|
@@ -1627,10 +1707,10 @@ function a0(n, e, t, o, i = 0) {
|
|
|
1627
1707
|
const s = 2 * (e.width + e.height - 4 * t) + 2 * Math.PI * t + i;
|
|
1628
1708
|
return { path: a, length: s };
|
|
1629
1709
|
}
|
|
1630
|
-
const
|
|
1710
|
+
const kt = {
|
|
1631
1711
|
Browser: "browser",
|
|
1632
1712
|
Node: "node"
|
|
1633
|
-
},
|
|
1713
|
+
}, x1 = ({
|
|
1634
1714
|
ctx: n,
|
|
1635
1715
|
imageById: e,
|
|
1636
1716
|
object: t,
|
|
@@ -1644,17 +1724,17 @@ const St = {
|
|
|
1644
1724
|
), s = e[t.imageId];
|
|
1645
1725
|
if (s !== void 0) {
|
|
1646
1726
|
if (n.context.save(), t.cornerRadius > 0) {
|
|
1647
|
-
const r =
|
|
1727
|
+
const r = c0(
|
|
1648
1728
|
a.origin,
|
|
1649
1729
|
a.size,
|
|
1650
1730
|
t.cornerRadius,
|
|
1651
1731
|
i
|
|
1652
1732
|
);
|
|
1653
1733
|
switch (n.type) {
|
|
1654
|
-
case
|
|
1734
|
+
case Z.Browser:
|
|
1655
1735
|
r.path.type === gt.Browser ? n.context.clip(r.path.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1656
1736
|
break;
|
|
1657
|
-
case
|
|
1737
|
+
case Z.Node:
|
|
1658
1738
|
r.path.type === gt.Node ? n.context.clip(r.path.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1659
1739
|
break;
|
|
1660
1740
|
default:
|
|
@@ -1662,8 +1742,8 @@ const St = {
|
|
|
1662
1742
|
}
|
|
1663
1743
|
}
|
|
1664
1744
|
switch (n.context.globalAlpha = o * t.opacity, n.context.imageSmoothingEnabled = t.smooth, n.type) {
|
|
1665
|
-
case
|
|
1666
|
-
s.type ===
|
|
1745
|
+
case Z.Browser:
|
|
1746
|
+
s.type === kt.Browser ? n.context.drawImage(
|
|
1667
1747
|
s.image,
|
|
1668
1748
|
a.origin.x,
|
|
1669
1749
|
a.origin.y,
|
|
@@ -1671,8 +1751,8 @@ const St = {
|
|
|
1671
1751
|
a.size.height
|
|
1672
1752
|
) : console.warn("Attempted to use Node Image in Browser Canvas context");
|
|
1673
1753
|
break;
|
|
1674
|
-
case
|
|
1675
|
-
s.type ===
|
|
1754
|
+
case Z.Node:
|
|
1755
|
+
s.type === kt.Node ? n.context.drawImage(
|
|
1676
1756
|
s.image,
|
|
1677
1757
|
a.origin.x,
|
|
1678
1758
|
a.origin.y,
|
|
@@ -1686,13 +1766,13 @@ const St = {
|
|
|
1686
1766
|
n.context.restore();
|
|
1687
1767
|
}
|
|
1688
1768
|
};
|
|
1689
|
-
function
|
|
1769
|
+
function y1(n, e) {
|
|
1690
1770
|
const t = e();
|
|
1691
1771
|
t.path.moveTo(n.startX, n.startY), t.path.lineTo(n.endX, n.endY);
|
|
1692
1772
|
const o = Math.hypot(n.endX - n.startX, n.endY - n.startY);
|
|
1693
1773
|
return { path: t, length: o };
|
|
1694
1774
|
}
|
|
1695
|
-
const
|
|
1775
|
+
const v1 = ({
|
|
1696
1776
|
ctx: n,
|
|
1697
1777
|
object: e,
|
|
1698
1778
|
opacity: t,
|
|
@@ -1701,8 +1781,8 @@ const l1 = ({
|
|
|
1701
1781
|
const i = e.opacity * t;
|
|
1702
1782
|
if (i === 0 || e.drawn === 0)
|
|
1703
1783
|
return;
|
|
1704
|
-
const { path: a, length: s } =
|
|
1705
|
-
|
|
1784
|
+
const { path: a, length: s } = y1(e, o);
|
|
1785
|
+
vt({
|
|
1706
1786
|
color: e.color,
|
|
1707
1787
|
ctx: n,
|
|
1708
1788
|
drawn: e.drawn,
|
|
@@ -1713,7 +1793,7 @@ const l1 = ({
|
|
|
1713
1793
|
opacity: i,
|
|
1714
1794
|
width: e.width
|
|
1715
1795
|
});
|
|
1716
|
-
},
|
|
1796
|
+
}, w1 = ({
|
|
1717
1797
|
ctx: n,
|
|
1718
1798
|
object: e,
|
|
1719
1799
|
opacity: t,
|
|
@@ -1725,11 +1805,11 @@ const l1 = ({
|
|
|
1725
1805
|
e.anchor,
|
|
1726
1806
|
at({ width: e.width, height: e.height })
|
|
1727
1807
|
);
|
|
1728
|
-
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle =
|
|
1808
|
+
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = St(G.RED), n.context.rect(i.origin.x, i.origin.y, i.size.width, i.size.height), n.context.stroke()), n.context.beginPath(), n.context.rect(i.origin.x, i.origin.y, i.size.width, i.size.height), n.context.closePath(), n.context.clip();
|
|
1729
1809
|
for (const a of e.objects)
|
|
1730
1810
|
o(a, t * e.opacity);
|
|
1731
1811
|
n.context.restore();
|
|
1732
|
-
},
|
|
1812
|
+
}, m1 = ({
|
|
1733
1813
|
ctx: n,
|
|
1734
1814
|
object: e,
|
|
1735
1815
|
opacity: t,
|
|
@@ -1743,12 +1823,12 @@ const l1 = ({
|
|
|
1743
1823
|
e.anchor,
|
|
1744
1824
|
at({ width: e.width, height: e.height })
|
|
1745
1825
|
), s = o(e.path);
|
|
1746
|
-
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight),
|
|
1826
|
+
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight), wt({
|
|
1747
1827
|
ctx: n,
|
|
1748
1828
|
path: s,
|
|
1749
1829
|
color: e.fillColor,
|
|
1750
1830
|
opacity: i
|
|
1751
|
-
}),
|
|
1831
|
+
}), vt({
|
|
1752
1832
|
color: e.strokeColor,
|
|
1753
1833
|
ctx: n,
|
|
1754
1834
|
drawn: e.drawn,
|
|
@@ -1759,19 +1839,19 @@ const l1 = ({
|
|
|
1759
1839
|
width: e.strokeWidth
|
|
1760
1840
|
}), n.context.restore();
|
|
1761
1841
|
};
|
|
1762
|
-
function
|
|
1842
|
+
function b1(n, e) {
|
|
1763
1843
|
const t = e(), o = n.points, i = o[0];
|
|
1764
1844
|
if (i === void 0)
|
|
1765
1845
|
return { path: t, length: 0 };
|
|
1766
1846
|
t.path.moveTo(i.x, i.y);
|
|
1767
1847
|
let a = 0, s = i;
|
|
1768
1848
|
for (let h = 1; h < o.length; h++) {
|
|
1769
|
-
const
|
|
1770
|
-
if (
|
|
1849
|
+
const c = o[h];
|
|
1850
|
+
if (c === void 0)
|
|
1771
1851
|
continue;
|
|
1772
|
-
t.path.lineTo(
|
|
1773
|
-
const
|
|
1774
|
-
a +=
|
|
1852
|
+
t.path.lineTo(c.x, c.y);
|
|
1853
|
+
const u = Math.hypot(c.x - s.x, c.y - s.y);
|
|
1854
|
+
a += u, s = c;
|
|
1775
1855
|
}
|
|
1776
1856
|
t.path.closePath();
|
|
1777
1857
|
const r = Math.hypot(
|
|
@@ -1780,7 +1860,7 @@ function f1(n, e) {
|
|
|
1780
1860
|
);
|
|
1781
1861
|
return a += r, { path: t, length: a };
|
|
1782
1862
|
}
|
|
1783
|
-
const
|
|
1863
|
+
const A1 = ({
|
|
1784
1864
|
ctx: n,
|
|
1785
1865
|
object: e,
|
|
1786
1866
|
opacity: t,
|
|
@@ -1789,13 +1869,13 @@ const g1 = ({
|
|
|
1789
1869
|
const i = e.opacity * t;
|
|
1790
1870
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1791
1871
|
return;
|
|
1792
|
-
const { path: a, length: s } =
|
|
1793
|
-
|
|
1872
|
+
const { path: a, length: s } = b1(e, o);
|
|
1873
|
+
wt({
|
|
1794
1874
|
ctx: n,
|
|
1795
1875
|
path: a,
|
|
1796
1876
|
color: e.fillColor,
|
|
1797
1877
|
opacity: i
|
|
1798
|
-
}),
|
|
1878
|
+
}), vt({
|
|
1799
1879
|
color: e.strokeColor,
|
|
1800
1880
|
ctx: n,
|
|
1801
1881
|
drawn: e.drawn,
|
|
@@ -1805,7 +1885,7 @@ const g1 = ({
|
|
|
1805
1885
|
width: e.strokeWidth
|
|
1806
1886
|
});
|
|
1807
1887
|
};
|
|
1808
|
-
function
|
|
1888
|
+
function M1(n, e) {
|
|
1809
1889
|
const t = n.strokeWidth / 2, { origin: o, size: i } = pt(
|
|
1810
1890
|
W({ x: n.x, y: n.y }),
|
|
1811
1891
|
n.anchor,
|
|
@@ -1813,16 +1893,16 @@ function p1(n, e) {
|
|
|
1813
1893
|
), a = i.width - n.strokeWidth, s = i.height - n.strokeWidth;
|
|
1814
1894
|
if (a <= 0 || s <= 0)
|
|
1815
1895
|
return;
|
|
1816
|
-
const r = W({ x: o.x + t, y: o.y + t }), h = at({ width: a, height: s }),
|
|
1896
|
+
const r = W({ x: o.x + t, y: o.y + t }), h = at({ width: a, height: s }), c = Math.max(
|
|
1817
1897
|
0,
|
|
1818
1898
|
Math.min(n.cornerRadius - t, Math.min(a, s) / 2)
|
|
1819
1899
|
);
|
|
1820
|
-
if (
|
|
1821
|
-
return
|
|
1822
|
-
const
|
|
1823
|
-
return
|
|
1900
|
+
if (c > 0)
|
|
1901
|
+
return c0(r, h, c, e).path;
|
|
1902
|
+
const u = e();
|
|
1903
|
+
return u.path.moveTo(r.x, r.y), u.path.lineTo(r.x + a, r.y), u.path.lineTo(r.x + a, r.y + s), u.path.lineTo(r.x, r.y + s), u.path.closePath(), u;
|
|
1824
1904
|
}
|
|
1825
|
-
function
|
|
1905
|
+
function L1(n, e) {
|
|
1826
1906
|
const { origin: t, size: o } = pt(
|
|
1827
1907
|
W({ x: n.x, y: n.y }),
|
|
1828
1908
|
n.anchor,
|
|
@@ -1832,7 +1912,7 @@ function d1(n, e) {
|
|
|
1832
1912
|
Math.min(n.cornerRadius, Math.min(o.width, o.height) / 2)
|
|
1833
1913
|
), a = Math.min(n.strokeWidth * 2, o.width - i);
|
|
1834
1914
|
if (i > 0)
|
|
1835
|
-
return
|
|
1915
|
+
return c0(t, o, i, e, a);
|
|
1836
1916
|
{
|
|
1837
1917
|
const s = e();
|
|
1838
1918
|
s.path.moveTo(t.x, t.y), s.path.lineTo(t.x + o.width, t.y), s.path.lineTo(t.x + o.width, t.y + o.height), s.path.lineTo(t.x, t.y + o.height), s.path.lineTo(t.x, t.y), s.path.lineTo(t.x + a, t.y);
|
|
@@ -1840,7 +1920,7 @@ function d1(n, e) {
|
|
|
1840
1920
|
return { path: s, length: r };
|
|
1841
1921
|
}
|
|
1842
1922
|
}
|
|
1843
|
-
const
|
|
1923
|
+
const T1 = ({
|
|
1844
1924
|
ctx: n,
|
|
1845
1925
|
object: e,
|
|
1846
1926
|
opacity: t,
|
|
@@ -1849,13 +1929,13 @@ const x1 = ({
|
|
|
1849
1929
|
const i = e.opacity * t;
|
|
1850
1930
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1851
1931
|
return;
|
|
1852
|
-
const { path: a, length: s } =
|
|
1932
|
+
const { path: a, length: s } = L1(e, o);
|
|
1853
1933
|
if (i < 1 && e.strokeWidth > 0) {
|
|
1854
|
-
const r =
|
|
1855
|
-
r !== void 0 && (n.context.save(),
|
|
1934
|
+
const r = M1(e, o);
|
|
1935
|
+
r !== void 0 && (n.context.save(), K0(n, r), wt({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
|
|
1856
1936
|
} else
|
|
1857
|
-
|
|
1858
|
-
|
|
1937
|
+
wt({ ctx: n, path: a, color: e.fillColor, opacity: i });
|
|
1938
|
+
vt({
|
|
1859
1939
|
color: e.strokeColor,
|
|
1860
1940
|
ctx: n,
|
|
1861
1941
|
drawn: e.drawn,
|
|
@@ -1864,7 +1944,7 @@ const x1 = ({
|
|
|
1864
1944
|
opacity: i,
|
|
1865
1945
|
width: e.strokeWidth
|
|
1866
1946
|
});
|
|
1867
|
-
},
|
|
1947
|
+
}, C1 = ({
|
|
1868
1948
|
ctx: n,
|
|
1869
1949
|
imageById: e,
|
|
1870
1950
|
object: t,
|
|
@@ -1882,8 +1962,8 @@ const x1 = ({
|
|
|
1882
1962
|
at({ width: t.width, height: t.height })
|
|
1883
1963
|
);
|
|
1884
1964
|
switch (n.context.save(), n.context.globalAlpha = i, n.type) {
|
|
1885
|
-
case
|
|
1886
|
-
a.type ===
|
|
1965
|
+
case Z.Browser:
|
|
1966
|
+
a.type === kt.Browser && n.context.drawImage(
|
|
1887
1967
|
a.image,
|
|
1888
1968
|
s.origin.x,
|
|
1889
1969
|
s.origin.y,
|
|
@@ -1891,8 +1971,8 @@ const x1 = ({
|
|
|
1891
1971
|
s.size.height
|
|
1892
1972
|
);
|
|
1893
1973
|
break;
|
|
1894
|
-
case
|
|
1895
|
-
a.type ===
|
|
1974
|
+
case Z.Node:
|
|
1975
|
+
a.type === kt.Node && n.context.drawImage(
|
|
1896
1976
|
a.image,
|
|
1897
1977
|
s.origin.x,
|
|
1898
1978
|
s.origin.y,
|
|
@@ -1905,7 +1985,7 @@ const x1 = ({
|
|
|
1905
1985
|
}
|
|
1906
1986
|
n.context.restore();
|
|
1907
1987
|
};
|
|
1908
|
-
function
|
|
1988
|
+
function P1(n) {
|
|
1909
1989
|
return {
|
|
1910
1990
|
color: n.color,
|
|
1911
1991
|
fontFamily: n.fontFamily,
|
|
@@ -1917,7 +1997,7 @@ function v1(n) {
|
|
|
1917
1997
|
superscript: n.superscript
|
|
1918
1998
|
};
|
|
1919
1999
|
}
|
|
1920
|
-
function
|
|
2000
|
+
function E1(n, e = 1) {
|
|
1921
2001
|
const t = Math.max(...n.map((a) => a.reduce((s, r) => s + r.width, 0)));
|
|
1922
2002
|
let o = 0, i = 0;
|
|
1923
2003
|
for (let a = 0; a < n.length; a++) {
|
|
@@ -1932,8 +2012,8 @@ function w1(n, e = 1) {
|
|
|
1932
2012
|
width: t
|
|
1933
2013
|
};
|
|
1934
2014
|
}
|
|
1935
|
-
const
|
|
1936
|
-
function
|
|
2015
|
+
const S1 = 0.7, k1 = 0.3;
|
|
2016
|
+
function Q0(n) {
|
|
1937
2017
|
const e = n.superscript, t = n.subscript && !e;
|
|
1938
2018
|
return !e && !t ? {
|
|
1939
2019
|
baselineShift: 0,
|
|
@@ -1941,35 +2021,35 @@ function W0(n) {
|
|
|
1941
2021
|
isSubscript: !1,
|
|
1942
2022
|
isSuperscript: !1
|
|
1943
2023
|
} : {
|
|
1944
|
-
baselineShift: n.fontSize *
|
|
1945
|
-
fontSize: n.fontSize *
|
|
2024
|
+
baselineShift: n.fontSize * k1 * (e ? -1 : 1),
|
|
2025
|
+
fontSize: n.fontSize * S1,
|
|
1946
2026
|
isSubscript: t,
|
|
1947
2027
|
isSuperscript: e
|
|
1948
2028
|
};
|
|
1949
2029
|
}
|
|
1950
|
-
function
|
|
2030
|
+
function I1(n) {
|
|
1951
2031
|
return {
|
|
1952
2032
|
width: n.width,
|
|
1953
2033
|
height: n.fontBoundingBoxAscent
|
|
1954
2034
|
};
|
|
1955
2035
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const o =
|
|
1958
|
-
n.context.fillStyle =
|
|
2036
|
+
function J0(n, e, t = 1) {
|
|
2037
|
+
const o = Q0(e);
|
|
2038
|
+
n.context.fillStyle = l0(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${o.fontSize}px ${e.fontFamily}`, n.type === Z.Browser ? n.context.textRendering = e.ligatures ? "optimizeLegibility" : "optimizeSpeed" : n.context.fontVariant = e.ligatures ? "common-ligatures" : "no-common-ligatures";
|
|
1959
2039
|
}
|
|
1960
|
-
function
|
|
2040
|
+
function _1(n, e, t) {
|
|
1961
2041
|
const o = [];
|
|
1962
2042
|
for (const i of n) {
|
|
1963
2043
|
const a = [];
|
|
1964
2044
|
for (const s of i) {
|
|
1965
|
-
const { text: r, ...h } = s,
|
|
1966
|
-
|
|
1967
|
-
const
|
|
2045
|
+
const { text: r, ...h } = s, c = { ...e, ...h };
|
|
2046
|
+
J0(t, c);
|
|
2047
|
+
const u = t.context.measureText(r), p = I1(u), { baselineShift: l } = Q0(c), f = p.height + Math.max(0, -l), v = Math.max(0, l);
|
|
1968
2048
|
a.push({
|
|
1969
|
-
...
|
|
2049
|
+
...p,
|
|
1970
2050
|
baselineShift: l,
|
|
1971
|
-
bottom:
|
|
1972
|
-
height: f +
|
|
2051
|
+
bottom: v,
|
|
2052
|
+
height: f + v,
|
|
1973
2053
|
top: f
|
|
1974
2054
|
});
|
|
1975
2055
|
}
|
|
@@ -1977,75 +2057,75 @@ function M1(n, e, t) {
|
|
|
1977
2057
|
}
|
|
1978
2058
|
return o;
|
|
1979
2059
|
}
|
|
1980
|
-
const
|
|
2060
|
+
const O1 = ({ ctx: n, object: e, opacity: t }) => {
|
|
1981
2061
|
const o = e.opacity * t;
|
|
1982
2062
|
if (o === 0)
|
|
1983
2063
|
return;
|
|
1984
|
-
const { length: i } = e, a =
|
|
1985
|
-
let
|
|
1986
|
-
for (let
|
|
1987
|
-
const y = a[
|
|
2064
|
+
const { length: i } = e, a = U0(e.text), s = P1(e), r = _1(a, s, n), h = E1(r, e.lineSpacing), c = pt(W({ x: e.x, y: e.y }), e.anchor, h);
|
|
2065
|
+
let u = c.origin.x, p = c.origin.y, l = 0, f = 0;
|
|
2066
|
+
for (let v = 0; v < a.length; v++) {
|
|
2067
|
+
const y = a[v], M = r[v];
|
|
1988
2068
|
if (y == null || M == null) {
|
|
1989
2069
|
console.error("Could not determine text units or sizes for line");
|
|
1990
2070
|
continue;
|
|
1991
2071
|
}
|
|
1992
|
-
const
|
|
2072
|
+
const P = M.reduce((k, F) => k + F.width, 0), E = M.length === 0 ? f : M.reduce((k, F) => Math.max(k, F.top), 0), L = M.length === 0 ? 0 : M.reduce((k, F) => Math.max(k, F.bottom), 0), S = E + L;
|
|
1993
2073
|
switch (e.alignment) {
|
|
1994
2074
|
case xt.LEFT:
|
|
1995
|
-
|
|
2075
|
+
u = c.origin.x;
|
|
1996
2076
|
break;
|
|
1997
2077
|
case xt.CENTER:
|
|
1998
|
-
|
|
2078
|
+
u = c.origin.x + (c.size.width - P) / 2;
|
|
1999
2079
|
break;
|
|
2000
2080
|
case xt.RIGHT:
|
|
2001
|
-
|
|
2081
|
+
u = c.origin.x + (c.size.width - P);
|
|
2002
2082
|
break;
|
|
2003
2083
|
default:
|
|
2004
2084
|
st(e.alignment);
|
|
2005
2085
|
break;
|
|
2006
2086
|
}
|
|
2007
|
-
|
|
2008
|
-
const T =
|
|
2087
|
+
p += f * (e.lineSpacing - 1);
|
|
2088
|
+
const T = p + E;
|
|
2009
2089
|
f = S;
|
|
2010
|
-
for (let
|
|
2011
|
-
const
|
|
2012
|
-
if (
|
|
2090
|
+
for (let k = 0; k < y.length && !(i !== null && l >= i); k++) {
|
|
2091
|
+
const F = y[k], X = M[k];
|
|
2092
|
+
if (F == null || X == null) {
|
|
2013
2093
|
console.error("Could not determine text unit or size for unit");
|
|
2014
2094
|
continue;
|
|
2015
2095
|
}
|
|
2016
|
-
const { text:
|
|
2096
|
+
const { text: z, ...Y } = F;
|
|
2017
2097
|
let tt;
|
|
2018
|
-
if (i !== null && l +
|
|
2098
|
+
if (i !== null && l + z.length > i) {
|
|
2019
2099
|
const K = i - l;
|
|
2020
|
-
tt =
|
|
2100
|
+
tt = z.slice(0, K);
|
|
2021
2101
|
}
|
|
2022
|
-
const et = tt ??
|
|
2102
|
+
const et = tt ?? z;
|
|
2023
2103
|
l += et.length;
|
|
2024
2104
|
const nt = { ...s, ...Y };
|
|
2025
|
-
|
|
2105
|
+
J0(n, nt, o), n.context.fillText(et, u, T + X.baselineShift), u += X.width;
|
|
2026
2106
|
}
|
|
2027
|
-
|
|
2028
|
-
}
|
|
2029
|
-
},
|
|
2030
|
-
[U.ARROW]:
|
|
2031
|
-
[U.CIRCLE]:
|
|
2032
|
-
[U.GROUP]:
|
|
2033
|
-
[U.IMAGE]:
|
|
2034
|
-
[U.LINE]:
|
|
2035
|
-
[U.MASK]:
|
|
2036
|
-
[U.PATH]:
|
|
2037
|
-
[U.POLYGON]:
|
|
2038
|
-
[U.RECTANGLE]:
|
|
2107
|
+
p += S;
|
|
2108
|
+
}
|
|
2109
|
+
}, N1 = {
|
|
2110
|
+
[U.ARROW]: c1,
|
|
2111
|
+
[U.CIRCLE]: g1,
|
|
2112
|
+
[U.GROUP]: d1,
|
|
2113
|
+
[U.IMAGE]: x1,
|
|
2114
|
+
[U.LINE]: v1,
|
|
2115
|
+
[U.MASK]: w1,
|
|
2116
|
+
[U.PATH]: m1,
|
|
2117
|
+
[U.POLYGON]: A1,
|
|
2118
|
+
[U.RECTANGLE]: T1,
|
|
2039
2119
|
[U.SLIDE_OBJECT]: () => {
|
|
2040
2120
|
},
|
|
2041
|
-
[U.SVG]:
|
|
2042
|
-
[U.TEXT]:
|
|
2121
|
+
[U.SVG]: C1,
|
|
2122
|
+
[U.TEXT]: O1
|
|
2043
2123
|
};
|
|
2044
|
-
function
|
|
2124
|
+
function R1(n) {
|
|
2045
2125
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2046
2126
|
return e.setAttribute("viewBox", `0 0 ${n.width} ${n.height}`), e.style.backgroundColor = "transparent", e.style.position = "absolute", e.style.width = "100%", e;
|
|
2047
2127
|
}
|
|
2048
|
-
function
|
|
2128
|
+
function F1(n, e) {
|
|
2049
2129
|
if (n === null)
|
|
2050
2130
|
return null;
|
|
2051
2131
|
const t = pt(
|
|
@@ -2065,20 +2145,20 @@ function P1(n, e) {
|
|
|
2065
2145
|
a !== null && a(), n.removeChild(o);
|
|
2066
2146
|
};
|
|
2067
2147
|
}
|
|
2068
|
-
async function
|
|
2148
|
+
async function B1(n) {
|
|
2069
2149
|
if (Object.keys(n).length === 0)
|
|
2070
2150
|
return {};
|
|
2071
2151
|
const e = {}, t = (i) => new Promise((a, s) => {
|
|
2072
2152
|
const r = new Image();
|
|
2073
|
-
if (r.onload = () => a(r), r.onerror = (
|
|
2074
|
-
const
|
|
2075
|
-
r.src =
|
|
2153
|
+
if (r.onload = () => a(r), r.onerror = (c) => s(c), i.includes("</svg>")) {
|
|
2154
|
+
const c = i.replace(/<\?xml[^?]*\?>\s*/g, ""), u = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), p = URL.createObjectURL(u);
|
|
2155
|
+
r.src = p;
|
|
2076
2156
|
} else
|
|
2077
2157
|
r.src = i;
|
|
2078
2158
|
}), o = Object.entries(n).map(async ([i, a]) => {
|
|
2079
2159
|
const s = await t(a);
|
|
2080
2160
|
e[i] = {
|
|
2081
|
-
type:
|
|
2161
|
+
type: kt.Browser,
|
|
2082
2162
|
image: s
|
|
2083
2163
|
};
|
|
2084
2164
|
});
|
|
@@ -2089,70 +2169,71 @@ async function E1(n) {
|
|
|
2089
2169
|
}
|
|
2090
2170
|
return e;
|
|
2091
2171
|
}
|
|
2092
|
-
class
|
|
2172
|
+
class Zn {
|
|
2093
2173
|
constructor(e) {
|
|
2094
2174
|
this.navigator = null;
|
|
2095
2175
|
const { objectRenderers: t, scale: o = 1, ...i } = e;
|
|
2096
2176
|
this.props = {
|
|
2097
|
-
presentation:
|
|
2177
|
+
presentation: Ve(),
|
|
2098
2178
|
element: document.body,
|
|
2099
2179
|
objectRenderers: {
|
|
2100
|
-
...
|
|
2180
|
+
...N1,
|
|
2101
2181
|
...t
|
|
2102
2182
|
},
|
|
2103
2183
|
cacheDurationMinutes: 15,
|
|
2104
|
-
scale:
|
|
2184
|
+
scale: D1(o),
|
|
2105
2185
|
...i
|
|
2106
|
-
}, this.state = { ...
|
|
2186
|
+
}, this.state = { ...T0 };
|
|
2107
2187
|
}
|
|
2108
2188
|
/** Starts the presentation. */
|
|
2109
2189
|
async present() {
|
|
2110
|
-
const { presentation: e, element: t, scale: o } = this.props, i =
|
|
2190
|
+
const { presentation: e, element: t, scale: o } = this.props, i = a1(e.size), a = R1(e.size);
|
|
2111
2191
|
a.style.transformOrigin = "center center", a.style.transform = `scale(${o})`, this.state = {
|
|
2112
|
-
...
|
|
2113
|
-
imageById: await
|
|
2192
|
+
...T0,
|
|
2193
|
+
imageById: await B1({
|
|
2114
2194
|
...e.resources.images,
|
|
2115
|
-
...
|
|
2195
|
+
...r1(e)
|
|
2116
2196
|
}),
|
|
2117
2197
|
canvas: i,
|
|
2118
2198
|
extrasContainer: a
|
|
2119
2199
|
};
|
|
2120
|
-
const s =
|
|
2200
|
+
const s = Ke(e, t), r = V0(t), h = (p, l) => {
|
|
2121
2201
|
this.state.shortcutState.shortcuts.b = {
|
|
2122
2202
|
slideIndex: this.state.slideIndex,
|
|
2123
2203
|
buildIndex: this.state.buildIndex
|
|
2124
|
-
}, this.renderSlide(
|
|
2204
|
+
}, this.renderSlide(p ?? this.state.slideIndex, l);
|
|
2205
|
+
}, c = (p = !1) => {
|
|
2206
|
+
r && (this.navigator = He({
|
|
2207
|
+
presentation: e,
|
|
2208
|
+
shortcutState: this.state.shortcutState,
|
|
2209
|
+
onNavigateToSlide: (l) => this.renderSlide(l),
|
|
2210
|
+
onRenderSlide: h,
|
|
2211
|
+
onNext: (l) => this.next(l),
|
|
2212
|
+
onPrevious: (l) => this.previous(l),
|
|
2213
|
+
forceRefresh: p
|
|
2214
|
+
}), this.updateNavigator());
|
|
2125
2215
|
};
|
|
2126
|
-
|
|
2216
|
+
X0(
|
|
2127
2217
|
e,
|
|
2128
2218
|
s,
|
|
2129
2219
|
this.state.shortcutState,
|
|
2130
2220
|
{
|
|
2131
|
-
onNext: (
|
|
2132
|
-
onPrevious: (
|
|
2221
|
+
onNext: (p) => this.next(p),
|
|
2222
|
+
onPrevious: (p) => this.previous(p),
|
|
2133
2223
|
onRenderSlide: h,
|
|
2134
|
-
onShowNavigator: () =>
|
|
2135
|
-
r && (this.navigator = Fe({
|
|
2136
|
-
presentation: e,
|
|
2137
|
-
shortcutState: this.state.shortcutState,
|
|
2138
|
-
onNavigateToSlide: (c) => this.renderSlide(c),
|
|
2139
|
-
onRenderSlide: h,
|
|
2140
|
-
onNext: (c) => this.next(c),
|
|
2141
|
-
onPrevious: (c) => this.previous(c)
|
|
2142
|
-
}), this.updateNavigator());
|
|
2143
|
-
}
|
|
2224
|
+
onShowNavigator: () => c()
|
|
2144
2225
|
},
|
|
2145
2226
|
{
|
|
2146
2227
|
focusOnPointerDown: !r,
|
|
2147
2228
|
keyEventTarget: r ? window : s
|
|
2148
2229
|
}
|
|
2149
2230
|
), t.replaceChildren(), s.appendChild(i), s.appendChild(a), t.appendChild(s);
|
|
2150
|
-
const u =
|
|
2151
|
-
u !== null ? this.renderSlide(u.slideIndex, u.buildIndex) : this.renderSlide(0);
|
|
2231
|
+
const u = i1(e, this.props.cacheDurationMinutes);
|
|
2232
|
+
u !== null ? this.renderSlide(u.slideIndex, u.buildIndex) : this.renderSlide(0), qe() && c(!0);
|
|
2152
2233
|
}
|
|
2153
2234
|
renderSlide(e, t = 0, o = null) {
|
|
2154
2235
|
const { presentation: i } = this.props, { canvas: a } = this.state, s = this.state.slideIndex !== e;
|
|
2155
|
-
this.state.slideIndex = e, this.state.buildIndex = t, o === null &&
|
|
2236
|
+
this.state.slideIndex = e, this.state.buildIndex = t, o === null && o1({ title: i.title, slideIndex: e, buildIndex: t });
|
|
2156
2237
|
const r = i.slides[e];
|
|
2157
2238
|
if (!(r === void 0 || a === null)) {
|
|
2158
2239
|
if (s || this.state.mountedExtrasCleanups.length === 0 && r.extras.length > 0) {
|
|
@@ -2160,8 +2241,8 @@ class jn {
|
|
|
2160
2241
|
h();
|
|
2161
2242
|
this.state.mountedExtrasCleanups = [];
|
|
2162
2243
|
for (const h of r.extras) {
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2244
|
+
const c = F1(this.state.extrasContainer, h);
|
|
2245
|
+
c !== null && this.state.mountedExtrasCleanups.push(c);
|
|
2165
2246
|
}
|
|
2166
2247
|
}
|
|
2167
2248
|
this.renderCanvas(a, e, t, o, this.props.scale), o === null && this.updateNavigator();
|
|
@@ -2170,42 +2251,42 @@ class jn {
|
|
|
2170
2251
|
renderCanvas(e, t, o = 0, i = null, a = 1) {
|
|
2171
2252
|
const { objectRenderers: s, presentation: r } = this.props, { imageById: h } = this.state;
|
|
2172
2253
|
e.width = r.size.width, e.height = r.size.height;
|
|
2173
|
-
const
|
|
2174
|
-
if (
|
|
2254
|
+
const c = e.getContext("2d");
|
|
2255
|
+
if (c === null)
|
|
2175
2256
|
return;
|
|
2176
|
-
const
|
|
2177
|
-
type:
|
|
2178
|
-
context:
|
|
2257
|
+
const u = {
|
|
2258
|
+
type: Z.Browser,
|
|
2259
|
+
context: c
|
|
2179
2260
|
};
|
|
2180
|
-
|
|
2181
|
-
const
|
|
2182
|
-
if (
|
|
2261
|
+
s1(e, u);
|
|
2262
|
+
const p = r.slides[t];
|
|
2263
|
+
if (p === void 0)
|
|
2183
2264
|
return;
|
|
2184
|
-
const l =
|
|
2185
|
-
slide:
|
|
2265
|
+
const l = n1({
|
|
2266
|
+
slide: p,
|
|
2186
2267
|
buildIndex: o,
|
|
2187
2268
|
buildTime: i
|
|
2188
2269
|
});
|
|
2189
|
-
|
|
2270
|
+
u.context.fillStyle = l0(r.backgroundColor), u.context.fillRect(0, 0, e.width, e.height);
|
|
2190
2271
|
function f(y, M) {
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2193
|
-
ctx:
|
|
2272
|
+
const P = s[y.objectType], E = l.get(y);
|
|
2273
|
+
P === void 0 || E === void 0 || P({
|
|
2274
|
+
ctx: u,
|
|
2194
2275
|
imageById: h,
|
|
2195
|
-
object:
|
|
2276
|
+
object: E,
|
|
2196
2277
|
opacity: M,
|
|
2197
2278
|
renderObject: f,
|
|
2198
|
-
createPath2D:
|
|
2279
|
+
createPath2D: h1
|
|
2199
2280
|
});
|
|
2200
2281
|
}
|
|
2201
|
-
const
|
|
2202
|
-
|
|
2282
|
+
const v = a !== 1;
|
|
2283
|
+
v && (u.context.save(), u.context.translate(
|
|
2203
2284
|
e.width * (1 - a) / 2,
|
|
2204
2285
|
e.height * (1 - a) / 2
|
|
2205
|
-
),
|
|
2206
|
-
for (const y of
|
|
2286
|
+
), u.context.scale(a, a));
|
|
2287
|
+
for (const y of p.objects)
|
|
2207
2288
|
f(y, 1);
|
|
2208
|
-
|
|
2289
|
+
v && u.context.restore();
|
|
2209
2290
|
}
|
|
2210
2291
|
updateNavigator() {
|
|
2211
2292
|
const { navigator: e } = this;
|
|
@@ -2230,22 +2311,22 @@ class jn {
|
|
|
2230
2311
|
}
|
|
2231
2312
|
next(e = !1) {
|
|
2232
2313
|
const { presentation: t } = this.props, { currentAnimationId: o, slideIndex: i, buildIndex: a } = this.state;
|
|
2233
|
-
this.
|
|
2314
|
+
this.hideCursor(), o !== null && cancelAnimationFrame(o);
|
|
2234
2315
|
const s = t.slides[i];
|
|
2235
2316
|
if (s === void 0)
|
|
2236
2317
|
return;
|
|
2237
2318
|
const r = s.animations[a];
|
|
2238
2319
|
if (r !== void 0 && !e) {
|
|
2239
|
-
const h = performance.now(),
|
|
2240
|
-
const l =
|
|
2241
|
-
l <
|
|
2320
|
+
const h = performance.now(), c = Ze(r), u = (p) => {
|
|
2321
|
+
const l = p - h;
|
|
2322
|
+
l < c ? (this.renderSlide(i, a + 1, l), this.state.currentAnimationId = requestAnimationFrame(u)) : this.renderSlide(i, a + 1, null);
|
|
2242
2323
|
};
|
|
2243
|
-
this.state.currentAnimationId = requestAnimationFrame(
|
|
2324
|
+
this.state.currentAnimationId = requestAnimationFrame(u);
|
|
2244
2325
|
} else i + 1 < t.slides.length && this.renderSlide(i + 1);
|
|
2245
2326
|
}
|
|
2246
2327
|
previous(e = !1) {
|
|
2247
2328
|
const { currentAnimationId: t, slideIndex: o, buildIndex: i } = this.state;
|
|
2248
|
-
if (this.
|
|
2329
|
+
if (this.hideCursor(), t !== null && cancelAnimationFrame(t), i > 0)
|
|
2249
2330
|
e ? this.renderSlide(o, 0) : this.renderSlide(o, i - 1);
|
|
2250
2331
|
else if (o > 0) {
|
|
2251
2332
|
const a = this.props.presentation.slides[o - 1], s = e ? 0 : (a == null ? void 0 : a.animations.length) ?? 0;
|
|
@@ -2261,13 +2342,17 @@ class jn {
|
|
|
2261
2342
|
const { slideIndex: e, buildIndex: t } = this.state;
|
|
2262
2343
|
return t > 0 || e > 0;
|
|
2263
2344
|
}
|
|
2345
|
+
hideCursor() {
|
|
2346
|
+
var e, t;
|
|
2347
|
+
this.props.element.style.cursor = "none", (t = (e = this.state.canvas) == null ? void 0 : e.parentElement) == null || t.style.setProperty("cursor", "none");
|
|
2348
|
+
}
|
|
2264
2349
|
}
|
|
2265
|
-
function
|
|
2350
|
+
function D1(n) {
|
|
2266
2351
|
return n <= 0 || n > 1 ? (console.warn(
|
|
2267
2352
|
`BrowserCanvasRenderer scale must be positive and no greater than 1. Received ${n}; using 1 instead.`
|
|
2268
2353
|
), 1) : n;
|
|
2269
2354
|
}
|
|
2270
|
-
function
|
|
2355
|
+
function Kn(n = 1e3) {
|
|
2271
2356
|
return {
|
|
2272
2357
|
type: ft.PAUSE,
|
|
2273
2358
|
isKey: !1,
|
|
@@ -2275,7 +2360,7 @@ function Hn(n = 1e3) {
|
|
|
2275
2360
|
shortcut: null
|
|
2276
2361
|
};
|
|
2277
2362
|
}
|
|
2278
|
-
function
|
|
2363
|
+
function Qn(n = null) {
|
|
2279
2364
|
return {
|
|
2280
2365
|
objects: [],
|
|
2281
2366
|
animations: [],
|
|
@@ -2288,32 +2373,32 @@ function Un(n = null) {
|
|
|
2288
2373
|
...n
|
|
2289
2374
|
};
|
|
2290
2375
|
}
|
|
2291
|
-
function
|
|
2376
|
+
function Jn(n, e = {}) {
|
|
2292
2377
|
return {
|
|
2293
2378
|
...e,
|
|
2294
2379
|
text: n
|
|
2295
2380
|
};
|
|
2296
2381
|
}
|
|
2297
|
-
function
|
|
2382
|
+
function t2(n = G.BLACK) {
|
|
2298
2383
|
return { ...n, alpha: 1 };
|
|
2299
2384
|
}
|
|
2300
|
-
function
|
|
2385
|
+
function q1(n) {
|
|
2301
2386
|
for (var e = -1, t = n.length, o, i = n[t - 1], a = 0; ++e < t; )
|
|
2302
2387
|
o = i, i = n[e], a += o[1] * i[0] - o[0] * i[1];
|
|
2303
2388
|
return a / 2;
|
|
2304
2389
|
}
|
|
2305
|
-
function
|
|
2390
|
+
function z1(n) {
|
|
2306
2391
|
for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1], h = 0; ++e < t; )
|
|
2307
2392
|
i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r, h += Math.sqrt(i * i + a * a);
|
|
2308
2393
|
return h;
|
|
2309
2394
|
}
|
|
2310
|
-
function
|
|
2395
|
+
function j1(n) {
|
|
2311
2396
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
2312
2397
|
}
|
|
2313
|
-
var
|
|
2314
|
-
function
|
|
2315
|
-
if (
|
|
2316
|
-
|
|
2398
|
+
var Ht, C0;
|
|
2399
|
+
function H1() {
|
|
2400
|
+
if (C0) return Ht;
|
|
2401
|
+
C0 = 1;
|
|
2317
2402
|
var n = { a: 7, c: 6, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, z: 0 }, e = [
|
|
2318
2403
|
5760,
|
|
2319
2404
|
6158,
|
|
@@ -2374,20 +2459,20 @@ function O1() {
|
|
|
2374
2459
|
for (; f.index < f.max && t(f.path.charCodeAt(f.index)); )
|
|
2375
2460
|
f.index++;
|
|
2376
2461
|
}
|
|
2377
|
-
function
|
|
2378
|
-
var
|
|
2379
|
-
if (
|
|
2462
|
+
function c(f) {
|
|
2463
|
+
var v = f.path.charCodeAt(f.index);
|
|
2464
|
+
if (v === 48) {
|
|
2380
2465
|
f.param = 0, f.index++;
|
|
2381
2466
|
return;
|
|
2382
2467
|
}
|
|
2383
|
-
if (
|
|
2468
|
+
if (v === 49) {
|
|
2384
2469
|
f.param = 1, f.index++;
|
|
2385
2470
|
return;
|
|
2386
2471
|
}
|
|
2387
2472
|
f.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + f.index + ")";
|
|
2388
2473
|
}
|
|
2389
|
-
function
|
|
2390
|
-
var
|
|
2474
|
+
function u(f) {
|
|
2475
|
+
var v = f.index, y = v, M = f.max, P = !1, E = !1, L = !1, S = !1, T;
|
|
2391
2476
|
if (y >= M) {
|
|
2392
2477
|
f.err = "SvgPath: missed param (at pos " + y + ")";
|
|
2393
2478
|
return;
|
|
@@ -2397,21 +2482,21 @@ function O1() {
|
|
|
2397
2482
|
return;
|
|
2398
2483
|
}
|
|
2399
2484
|
if (T !== 46) {
|
|
2400
|
-
if (
|
|
2401
|
-
f.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " +
|
|
2485
|
+
if (P = T === 48, y++, T = y < M ? f.path.charCodeAt(y) : 0, P && y < M && T && a(T)) {
|
|
2486
|
+
f.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + v + ")";
|
|
2402
2487
|
return;
|
|
2403
2488
|
}
|
|
2404
2489
|
for (; y < M && a(f.path.charCodeAt(y)); )
|
|
2405
|
-
y++,
|
|
2490
|
+
y++, E = !0;
|
|
2406
2491
|
T = y < M ? f.path.charCodeAt(y) : 0;
|
|
2407
2492
|
}
|
|
2408
2493
|
if (T === 46) {
|
|
2409
2494
|
for (S = !0, y++; a(f.path.charCodeAt(y)); )
|
|
2410
|
-
y++,
|
|
2495
|
+
y++, L = !0;
|
|
2411
2496
|
T = y < M ? f.path.charCodeAt(y) : 0;
|
|
2412
2497
|
}
|
|
2413
2498
|
if (T === 101 || T === 69) {
|
|
2414
|
-
if (S && !
|
|
2499
|
+
if (S && !E && !L) {
|
|
2415
2500
|
f.err = "SvgPath: invalid float exponent (at pos " + y + ")";
|
|
2416
2501
|
return;
|
|
2417
2502
|
}
|
|
@@ -2423,55 +2508,55 @@ function O1() {
|
|
|
2423
2508
|
return;
|
|
2424
2509
|
}
|
|
2425
2510
|
}
|
|
2426
|
-
f.index = y, f.param = parseFloat(f.path.slice(
|
|
2511
|
+
f.index = y, f.param = parseFloat(f.path.slice(v, y)) + 0;
|
|
2427
2512
|
}
|
|
2428
|
-
function
|
|
2429
|
-
var
|
|
2430
|
-
|
|
2513
|
+
function p(f) {
|
|
2514
|
+
var v, y;
|
|
2515
|
+
v = f.path[f.segmentStart], y = v.toLowerCase();
|
|
2431
2516
|
var M = f.data;
|
|
2432
|
-
if (y === "m" && M.length > 2 && (f.result.push([
|
|
2433
|
-
f.result.push([
|
|
2517
|
+
if (y === "m" && M.length > 2 && (f.result.push([v, M[0], M[1]]), M = M.slice(2), y = "l", v = v === "m" ? "l" : "L"), y === "r")
|
|
2518
|
+
f.result.push([v].concat(M));
|
|
2434
2519
|
else
|
|
2435
|
-
for (; M.length >= n[y] && (f.result.push([
|
|
2520
|
+
for (; M.length >= n[y] && (f.result.push([v].concat(M.splice(0, n[y]))), !!n[y]); )
|
|
2436
2521
|
;
|
|
2437
2522
|
}
|
|
2438
2523
|
function l(f) {
|
|
2439
|
-
var
|
|
2524
|
+
var v = f.max, y, M, P, E, L;
|
|
2440
2525
|
if (f.segmentStart = f.index, y = f.path.charCodeAt(f.index), M = i(y), !o(y)) {
|
|
2441
2526
|
f.err = "SvgPath: bad command " + f.path[f.index] + " (at pos " + f.index + ")";
|
|
2442
2527
|
return;
|
|
2443
2528
|
}
|
|
2444
|
-
if (
|
|
2445
|
-
|
|
2529
|
+
if (E = n[f.path[f.index].toLowerCase()], f.index++, h(f), f.data = [], !E) {
|
|
2530
|
+
p(f);
|
|
2446
2531
|
return;
|
|
2447
2532
|
}
|
|
2448
|
-
for (
|
|
2449
|
-
for (
|
|
2450
|
-
if (M && (
|
|
2451
|
-
|
|
2533
|
+
for (P = !1; ; ) {
|
|
2534
|
+
for (L = E; L > 0; L--) {
|
|
2535
|
+
if (M && (L === 3 || L === 4) ? c(f) : u(f), f.err.length) {
|
|
2536
|
+
p(f);
|
|
2452
2537
|
return;
|
|
2453
2538
|
}
|
|
2454
|
-
f.data.push(f.param), h(f),
|
|
2539
|
+
f.data.push(f.param), h(f), P = !1, f.index < v && f.path.charCodeAt(f.index) === 44 && (f.index++, h(f), P = !0);
|
|
2455
2540
|
}
|
|
2456
|
-
if (!
|
|
2541
|
+
if (!P && (f.index >= f.max || !s(f.path.charCodeAt(f.index))))
|
|
2457
2542
|
break;
|
|
2458
2543
|
}
|
|
2459
|
-
|
|
2544
|
+
p(f);
|
|
2460
2545
|
}
|
|
2461
|
-
return
|
|
2462
|
-
var y = new r(
|
|
2546
|
+
return Ht = function(v) {
|
|
2547
|
+
var y = new r(v), M = y.max;
|
|
2463
2548
|
for (h(y); y.index < M && !y.err.length; )
|
|
2464
2549
|
l(y);
|
|
2465
2550
|
return y.result.length && ("mM".indexOf(y.result[0][0]) < 0 ? (y.err = "SvgPath: string should start with `M` or `m`", y.result = []) : y.result[0][0] = "M"), {
|
|
2466
2551
|
err: y.err,
|
|
2467
2552
|
segments: y.result
|
|
2468
2553
|
};
|
|
2469
|
-
},
|
|
2554
|
+
}, Ht;
|
|
2470
2555
|
}
|
|
2471
|
-
var
|
|
2472
|
-
function
|
|
2473
|
-
if (
|
|
2474
|
-
|
|
2556
|
+
var Ut, P0;
|
|
2557
|
+
function te() {
|
|
2558
|
+
if (P0) return Ut;
|
|
2559
|
+
P0 = 1;
|
|
2475
2560
|
function n(t, o) {
|
|
2476
2561
|
return [
|
|
2477
2562
|
t[0] * o[0] + t[2] * o[1],
|
|
@@ -2516,13 +2601,13 @@ function G0() {
|
|
|
2516
2601
|
t * a[0] + o * a[2] + (i ? 0 : a[4]),
|
|
2517
2602
|
t * a[1] + o * a[3] + (i ? 0 : a[5])
|
|
2518
2603
|
]) : [t, o];
|
|
2519
|
-
},
|
|
2604
|
+
}, Ut = e, Ut;
|
|
2520
2605
|
}
|
|
2521
|
-
var
|
|
2522
|
-
function
|
|
2523
|
-
if (
|
|
2524
|
-
|
|
2525
|
-
var n =
|
|
2606
|
+
var $t, E0;
|
|
2607
|
+
function U1() {
|
|
2608
|
+
if (E0) return $t;
|
|
2609
|
+
E0 = 1;
|
|
2610
|
+
var n = te(), e = {
|
|
2526
2611
|
matrix: !0,
|
|
2527
2612
|
scale: !0,
|
|
2528
2613
|
rotate: !0,
|
|
@@ -2530,16 +2615,16 @@ function F1() {
|
|
|
2530
2615
|
skewX: !0,
|
|
2531
2616
|
skewY: !0
|
|
2532
2617
|
}, t = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, o = /[\s,]+/;
|
|
2533
|
-
return
|
|
2618
|
+
return $t = function(a) {
|
|
2534
2619
|
var s = new n(), r, h;
|
|
2535
|
-
return a.split(t).forEach(function(
|
|
2536
|
-
if (
|
|
2537
|
-
if (typeof e[
|
|
2538
|
-
r =
|
|
2620
|
+
return a.split(t).forEach(function(c) {
|
|
2621
|
+
if (c.length) {
|
|
2622
|
+
if (typeof e[c] < "u") {
|
|
2623
|
+
r = c;
|
|
2539
2624
|
return;
|
|
2540
2625
|
}
|
|
2541
|
-
switch (h =
|
|
2542
|
-
return +
|
|
2626
|
+
switch (h = c.split(o).map(function(u) {
|
|
2627
|
+
return +u || 0;
|
|
2543
2628
|
}), r) {
|
|
2544
2629
|
case "matrix":
|
|
2545
2630
|
h.length === 6 && s.matrix(h);
|
|
@@ -2562,55 +2647,55 @@ function F1() {
|
|
|
2562
2647
|
}
|
|
2563
2648
|
}
|
|
2564
2649
|
}), s;
|
|
2565
|
-
},
|
|
2650
|
+
}, $t;
|
|
2566
2651
|
}
|
|
2567
|
-
var
|
|
2568
|
-
function
|
|
2569
|
-
if (
|
|
2570
|
-
|
|
2652
|
+
var Yt, S0;
|
|
2653
|
+
function $1() {
|
|
2654
|
+
if (S0) return Yt;
|
|
2655
|
+
S0 = 1;
|
|
2571
2656
|
var n = Math.PI * 2;
|
|
2572
2657
|
function e(i, a, s, r) {
|
|
2573
|
-
var h = i * r - a * s < 0 ? -1 : 1,
|
|
2574
|
-
return
|
|
2658
|
+
var h = i * r - a * s < 0 ? -1 : 1, c = i * s + a * r;
|
|
2659
|
+
return c > 1 && (c = 1), c < -1 && (c = -1), h * Math.acos(c);
|
|
2575
2660
|
}
|
|
2576
|
-
function t(i, a, s, r, h,
|
|
2577
|
-
var
|
|
2578
|
-
S < 0 && (S = 0), S /= M *
|
|
2579
|
-
var T = S *
|
|
2580
|
-
return
|
|
2661
|
+
function t(i, a, s, r, h, c, u, p, l, f) {
|
|
2662
|
+
var v = f * (i - s) / 2 + l * (a - r) / 2, y = -l * (i - s) / 2 + f * (a - r) / 2, M = u * u, P = p * p, E = v * v, L = y * y, S = M * P - M * L - P * E;
|
|
2663
|
+
S < 0 && (S = 0), S /= M * L + P * E, S = Math.sqrt(S) * (h === c ? -1 : 1);
|
|
2664
|
+
var T = S * u / p * y, k = S * -p / u * v, F = f * T - l * k + (i + s) / 2, X = l * T + f * k + (a + r) / 2, z = (v - T) / u, Y = (y - k) / p, tt = (-v - T) / u, et = (-y - k) / p, nt = e(1, 0, z, Y), K = e(z, Y, tt, et);
|
|
2665
|
+
return c === 0 && K > 0 && (K -= n), c === 1 && K < 0 && (K += n), [F, X, nt, K];
|
|
2581
2666
|
}
|
|
2582
2667
|
function o(i, a) {
|
|
2583
|
-
var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), h = Math.sin(i),
|
|
2584
|
-
return [r, h, r - h * s, h + r * s,
|
|
2668
|
+
var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), h = Math.sin(i), c = Math.cos(i + a), u = Math.sin(i + a);
|
|
2669
|
+
return [r, h, r - h * s, h + r * s, c + u * s, u - c * s, c, u];
|
|
2585
2670
|
}
|
|
2586
|
-
return
|
|
2587
|
-
var
|
|
2588
|
-
if (M === 0 &&
|
|
2671
|
+
return Yt = function(a, s, r, h, c, u, p, l, f) {
|
|
2672
|
+
var v = Math.sin(f * n / 360), y = Math.cos(f * n / 360), M = y * (a - r) / 2 + v * (s - h) / 2, P = -v * (a - r) / 2 + y * (s - h) / 2;
|
|
2673
|
+
if (M === 0 && P === 0)
|
|
2589
2674
|
return [];
|
|
2590
|
-
if (
|
|
2675
|
+
if (p === 0 || l === 0)
|
|
2591
2676
|
return [];
|
|
2592
|
-
|
|
2593
|
-
var
|
|
2594
|
-
|
|
2595
|
-
var
|
|
2596
|
-
|
|
2597
|
-
for (var X = 0; X <
|
|
2598
|
-
S.push(o(T,
|
|
2599
|
-
return S.map(function(
|
|
2600
|
-
for (var Y = 0; Y <
|
|
2601
|
-
var tt =
|
|
2602
|
-
tt *=
|
|
2603
|
-
var nt = y * tt -
|
|
2604
|
-
|
|
2677
|
+
p = Math.abs(p), l = Math.abs(l);
|
|
2678
|
+
var E = M * M / (p * p) + P * P / (l * l);
|
|
2679
|
+
E > 1 && (p *= Math.sqrt(E), l *= Math.sqrt(E));
|
|
2680
|
+
var L = t(a, s, r, h, c, u, p, l, v, y), S = [], T = L[2], k = L[3], F = Math.max(Math.ceil(Math.abs(k) / (n / 4)), 1);
|
|
2681
|
+
k /= F;
|
|
2682
|
+
for (var X = 0; X < F; X++)
|
|
2683
|
+
S.push(o(T, k)), T += k;
|
|
2684
|
+
return S.map(function(z) {
|
|
2685
|
+
for (var Y = 0; Y < z.length; Y += 2) {
|
|
2686
|
+
var tt = z[Y + 0], et = z[Y + 1];
|
|
2687
|
+
tt *= p, et *= l;
|
|
2688
|
+
var nt = y * tt - v * et, K = v * tt + y * et;
|
|
2689
|
+
z[Y + 0] = nt + L[0], z[Y + 1] = K + L[1];
|
|
2605
2690
|
}
|
|
2606
|
-
return
|
|
2691
|
+
return z;
|
|
2607
2692
|
});
|
|
2608
|
-
},
|
|
2693
|
+
}, Yt;
|
|
2609
2694
|
}
|
|
2610
|
-
var
|
|
2611
|
-
function
|
|
2612
|
-
if (
|
|
2613
|
-
|
|
2695
|
+
var Wt, k0;
|
|
2696
|
+
function Y1() {
|
|
2697
|
+
if (k0) return Wt;
|
|
2698
|
+
k0 = 1;
|
|
2614
2699
|
var n = 1e-10, e = Math.PI / 180;
|
|
2615
2700
|
function t(o, i, a) {
|
|
2616
2701
|
if (!(this instanceof t))
|
|
@@ -2623,24 +2708,24 @@ function R1() {
|
|
|
2623
2708
|
this.rx * (o[1] * i + o[3] * a),
|
|
2624
2709
|
this.ry * (-o[0] * a + o[2] * i),
|
|
2625
2710
|
this.ry * (-o[1] * a + o[3] * i)
|
|
2626
|
-
], r = s[0] * s[0] + s[2] * s[2], h = s[1] * s[1] + s[3] * s[3],
|
|
2627
|
-
if (
|
|
2628
|
-
return this.rx = this.ry = Math.sqrt(
|
|
2629
|
-
var
|
|
2630
|
-
|
|
2631
|
-
var l =
|
|
2632
|
-
return this.ax = Math.abs(
|
|
2633
|
-
Math.abs(
|
|
2711
|
+
], r = s[0] * s[0] + s[2] * s[2], h = s[1] * s[1] + s[3] * s[3], c = ((s[0] - s[3]) * (s[0] - s[3]) + (s[2] + s[1]) * (s[2] + s[1])) * ((s[0] + s[3]) * (s[0] + s[3]) + (s[2] - s[1]) * (s[2] - s[1])), u = (r + h) / 2;
|
|
2712
|
+
if (c < n * u)
|
|
2713
|
+
return this.rx = this.ry = Math.sqrt(u), this.ax = 0, this;
|
|
2714
|
+
var p = s[0] * s[1] + s[2] * s[3];
|
|
2715
|
+
c = Math.sqrt(c);
|
|
2716
|
+
var l = u + c / 2, f = u - c / 2;
|
|
2717
|
+
return this.ax = Math.abs(p) < n && Math.abs(l - h) < n ? 90 : Math.atan(
|
|
2718
|
+
Math.abs(p) > Math.abs(l - h) ? (l - r) / p : p / (l - h)
|
|
2634
2719
|
) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(l), this.ry = Math.sqrt(f)) : (this.ax += 90, this.rx = Math.sqrt(f), this.ry = Math.sqrt(l)), this;
|
|
2635
2720
|
}, t.prototype.isDegenerate = function() {
|
|
2636
2721
|
return this.rx < n * this.ry || this.ry < n * this.rx;
|
|
2637
|
-
},
|
|
2722
|
+
}, Wt = t, Wt;
|
|
2638
2723
|
}
|
|
2639
|
-
var
|
|
2640
|
-
function
|
|
2641
|
-
if (
|
|
2642
|
-
|
|
2643
|
-
var n =
|
|
2724
|
+
var Xt, I0;
|
|
2725
|
+
function W1() {
|
|
2726
|
+
if (I0) return Xt;
|
|
2727
|
+
I0 = 1;
|
|
2728
|
+
var n = H1(), e = U1(), t = te(), o = $1(), i = Y1();
|
|
2644
2729
|
function a(s) {
|
|
2645
2730
|
if (!(this instanceof a))
|
|
2646
2731
|
return new a(s);
|
|
@@ -2660,39 +2745,39 @@ function B1() {
|
|
|
2660
2745
|
throw new Error("SvgPath.from: invalid param type " + s);
|
|
2661
2746
|
}, a.prototype.__matrix = function(s) {
|
|
2662
2747
|
var r = this, h;
|
|
2663
|
-
s.queue.length && this.iterate(function(
|
|
2664
|
-
var f,
|
|
2665
|
-
switch (
|
|
2748
|
+
s.queue.length && this.iterate(function(c, u, p, l) {
|
|
2749
|
+
var f, v, y, M;
|
|
2750
|
+
switch (c[0]) {
|
|
2666
2751
|
// Process 'assymetric' commands separately
|
|
2667
2752
|
case "v":
|
|
2668
|
-
f = s.calc(0,
|
|
2753
|
+
f = s.calc(0, c[1], !0), v = f[0] === 0 ? ["v", f[1]] : ["l", f[0], f[1]];
|
|
2669
2754
|
break;
|
|
2670
2755
|
case "V":
|
|
2671
|
-
f = s.calc(
|
|
2756
|
+
f = s.calc(p, c[1], !1), v = f[0] === s.calc(p, l, !1)[0] ? ["V", f[1]] : ["L", f[0], f[1]];
|
|
2672
2757
|
break;
|
|
2673
2758
|
case "h":
|
|
2674
|
-
f = s.calc(
|
|
2759
|
+
f = s.calc(c[1], 0, !0), v = f[1] === 0 ? ["h", f[0]] : ["l", f[0], f[1]];
|
|
2675
2760
|
break;
|
|
2676
2761
|
case "H":
|
|
2677
|
-
f = s.calc(
|
|
2762
|
+
f = s.calc(c[1], l, !1), v = f[1] === s.calc(p, l, !1)[1] ? ["H", f[0]] : ["L", f[0], f[1]];
|
|
2678
2763
|
break;
|
|
2679
2764
|
case "a":
|
|
2680
2765
|
case "A":
|
|
2681
|
-
var
|
|
2682
|
-
if (
|
|
2683
|
-
|
|
2766
|
+
var P = s.toArray(), E = i(c[1], c[2], c[3]).transform(P);
|
|
2767
|
+
if (P[0] * P[3] - P[1] * P[2] < 0 && (c[5] = c[5] ? "0" : "1"), f = s.calc(c[6], c[7], c[0] === "a"), c[0] === "A" && c[6] === p && c[7] === l || c[0] === "a" && c[6] === 0 && c[7] === 0) {
|
|
2768
|
+
v = [c[0] === "a" ? "l" : "L", f[0], f[1]];
|
|
2684
2769
|
break;
|
|
2685
2770
|
}
|
|
2686
|
-
|
|
2771
|
+
E.isDegenerate() ? v = [c[0] === "a" ? "l" : "L", f[0], f[1]] : v = [c[0], E.rx, E.ry, E.ax, c[4], c[5], f[0], f[1]];
|
|
2687
2772
|
break;
|
|
2688
2773
|
case "m":
|
|
2689
|
-
M =
|
|
2774
|
+
M = u > 0, f = s.calc(c[1], c[2], M), v = ["m", f[0], f[1]];
|
|
2690
2775
|
break;
|
|
2691
2776
|
default:
|
|
2692
|
-
for (y =
|
|
2693
|
-
f = s.calc(
|
|
2777
|
+
for (y = c[0], v = [y], M = y.toLowerCase() === y, h = 1; h < c.length; h += 2)
|
|
2778
|
+
f = s.calc(c[h], c[h + 1], M), v.push(f[0], f[1]);
|
|
2694
2779
|
}
|
|
2695
|
-
r.segments[
|
|
2780
|
+
r.segments[u] = v;
|
|
2696
2781
|
}, !0);
|
|
2697
2782
|
}, a.prototype.__evaluateStack = function() {
|
|
2698
2783
|
var s, r;
|
|
@@ -2708,12 +2793,12 @@ function B1() {
|
|
|
2708
2793
|
}, a.prototype.toString = function() {
|
|
2709
2794
|
var s = "", r = "", h = !1;
|
|
2710
2795
|
this.__evaluateStack();
|
|
2711
|
-
for (var
|
|
2712
|
-
var
|
|
2796
|
+
for (var c = 0, u = this.segments.length; c < u; c++) {
|
|
2797
|
+
var p = this.segments[c], l = p[0];
|
|
2713
2798
|
l !== r || l === "m" || l === "M" ? (l === "m" && r === "z" && (s += " "), s += l, h = !1) : h = !0;
|
|
2714
|
-
for (var f = 1; f <
|
|
2715
|
-
var
|
|
2716
|
-
f === 1 ? h &&
|
|
2799
|
+
for (var f = 1; f < p.length; f++) {
|
|
2800
|
+
var v = p[f];
|
|
2801
|
+
f === 1 ? h && v >= 0 && (s += " ") : v >= 0 && (s += " "), s += v;
|
|
2717
2802
|
}
|
|
2718
2803
|
r = l;
|
|
2719
2804
|
}
|
|
@@ -2733,166 +2818,166 @@ function B1() {
|
|
|
2733
2818
|
}, a.prototype.transform = function(s) {
|
|
2734
2819
|
return s.trim() ? (this.__stack.push(e(s)), this) : this;
|
|
2735
2820
|
}, a.prototype.round = function(s) {
|
|
2736
|
-
var r = 0, h = 0,
|
|
2821
|
+
var r = 0, h = 0, c = 0, u = 0, p;
|
|
2737
2822
|
return s = s || 0, this.__evaluateStack(), this.segments.forEach(function(l) {
|
|
2738
2823
|
var f = l[0].toLowerCase() === l[0];
|
|
2739
2824
|
switch (l[0]) {
|
|
2740
2825
|
case "H":
|
|
2741
2826
|
case "h":
|
|
2742
|
-
f && (l[1] +=
|
|
2827
|
+
f && (l[1] += c), c = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
|
|
2743
2828
|
return;
|
|
2744
2829
|
case "V":
|
|
2745
2830
|
case "v":
|
|
2746
|
-
f && (l[1] +=
|
|
2831
|
+
f && (l[1] += u), u = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
|
|
2747
2832
|
return;
|
|
2748
2833
|
case "Z":
|
|
2749
2834
|
case "z":
|
|
2750
|
-
|
|
2835
|
+
c = r, u = h;
|
|
2751
2836
|
return;
|
|
2752
2837
|
case "M":
|
|
2753
2838
|
case "m":
|
|
2754
|
-
f && (l[1] +=
|
|
2839
|
+
f && (l[1] += c, l[2] += u), c = l[1] - l[1].toFixed(s), u = l[2] - l[2].toFixed(s), r = c, h = u, l[1] = +l[1].toFixed(s), l[2] = +l[2].toFixed(s);
|
|
2755
2840
|
return;
|
|
2756
2841
|
case "A":
|
|
2757
2842
|
case "a":
|
|
2758
|
-
f && (l[6] +=
|
|
2843
|
+
f && (l[6] += c, l[7] += u), c = l[6] - l[6].toFixed(s), u = l[7] - l[7].toFixed(s), l[1] = +l[1].toFixed(s), l[2] = +l[2].toFixed(s), l[3] = +l[3].toFixed(s + 2), l[6] = +l[6].toFixed(s), l[7] = +l[7].toFixed(s);
|
|
2759
2844
|
return;
|
|
2760
2845
|
default:
|
|
2761
|
-
|
|
2846
|
+
p = l.length, f && (l[p - 2] += c, l[p - 1] += u), c = l[p - 2] - l[p - 2].toFixed(s), u = l[p - 1] - l[p - 1].toFixed(s), l.forEach(function(v, y) {
|
|
2762
2847
|
y && (l[y] = +l[y].toFixed(s));
|
|
2763
2848
|
});
|
|
2764
2849
|
return;
|
|
2765
2850
|
}
|
|
2766
2851
|
}), this;
|
|
2767
2852
|
}, a.prototype.iterate = function(s, r) {
|
|
2768
|
-
var h = this.segments,
|
|
2769
|
-
if (r || this.__evaluateStack(), h.forEach(function(
|
|
2770
|
-
var S = s(
|
|
2771
|
-
Array.isArray(S) && (
|
|
2772
|
-
var T =
|
|
2773
|
-
switch (
|
|
2853
|
+
var h = this.segments, c = {}, u = !1, p = 0, l = 0, f = 0, v = 0, y, M, P;
|
|
2854
|
+
if (r || this.__evaluateStack(), h.forEach(function(E, L) {
|
|
2855
|
+
var S = s(E, L, p, l);
|
|
2856
|
+
Array.isArray(S) && (c[L] = S, u = !0);
|
|
2857
|
+
var T = E[0] === E[0].toLowerCase();
|
|
2858
|
+
switch (E[0]) {
|
|
2774
2859
|
case "m":
|
|
2775
2860
|
case "M":
|
|
2776
|
-
|
|
2861
|
+
p = E[1] + (T ? p : 0), l = E[2] + (T ? l : 0), f = p, v = l;
|
|
2777
2862
|
return;
|
|
2778
2863
|
case "h":
|
|
2779
2864
|
case "H":
|
|
2780
|
-
|
|
2865
|
+
p = E[1] + (T ? p : 0);
|
|
2781
2866
|
return;
|
|
2782
2867
|
case "v":
|
|
2783
2868
|
case "V":
|
|
2784
|
-
l =
|
|
2869
|
+
l = E[1] + (T ? l : 0);
|
|
2785
2870
|
return;
|
|
2786
2871
|
case "z":
|
|
2787
2872
|
case "Z":
|
|
2788
|
-
|
|
2873
|
+
p = f, l = v;
|
|
2789
2874
|
return;
|
|
2790
2875
|
default:
|
|
2791
|
-
|
|
2876
|
+
p = E[E.length - 2] + (T ? p : 0), l = E[E.length - 1] + (T ? l : 0);
|
|
2792
2877
|
}
|
|
2793
|
-
}), !
|
|
2878
|
+
}), !u)
|
|
2794
2879
|
return this;
|
|
2795
|
-
for (
|
|
2796
|
-
if (typeof
|
|
2797
|
-
for (M = 0; M <
|
|
2798
|
-
|
|
2880
|
+
for (P = [], y = 0; y < h.length; y++)
|
|
2881
|
+
if (typeof c[y] < "u")
|
|
2882
|
+
for (M = 0; M < c[y].length; M++)
|
|
2883
|
+
P.push(c[y][M]);
|
|
2799
2884
|
else
|
|
2800
|
-
|
|
2801
|
-
return this.segments =
|
|
2885
|
+
P.push(h[y]);
|
|
2886
|
+
return this.segments = P, this;
|
|
2802
2887
|
}, a.prototype.abs = function() {
|
|
2803
|
-
return this.iterate(function(s, r, h,
|
|
2804
|
-
var
|
|
2805
|
-
if (
|
|
2806
|
-
switch (s[0] =
|
|
2888
|
+
return this.iterate(function(s, r, h, c) {
|
|
2889
|
+
var u = s[0], p = u.toUpperCase(), l;
|
|
2890
|
+
if (u !== p)
|
|
2891
|
+
switch (s[0] = p, u) {
|
|
2807
2892
|
case "v":
|
|
2808
|
-
s[1] +=
|
|
2893
|
+
s[1] += c;
|
|
2809
2894
|
return;
|
|
2810
2895
|
case "a":
|
|
2811
|
-
s[6] += h, s[7] +=
|
|
2896
|
+
s[6] += h, s[7] += c;
|
|
2812
2897
|
return;
|
|
2813
2898
|
default:
|
|
2814
2899
|
for (l = 1; l < s.length; l++)
|
|
2815
|
-
s[l] += l % 2 ? h :
|
|
2900
|
+
s[l] += l % 2 ? h : c;
|
|
2816
2901
|
}
|
|
2817
2902
|
}, !0), this;
|
|
2818
2903
|
}, a.prototype.rel = function() {
|
|
2819
|
-
return this.iterate(function(s, r, h,
|
|
2820
|
-
var
|
|
2821
|
-
if (
|
|
2822
|
-
switch (s[0] =
|
|
2904
|
+
return this.iterate(function(s, r, h, c) {
|
|
2905
|
+
var u = s[0], p = u.toLowerCase(), l;
|
|
2906
|
+
if (u !== p && !(r === 0 && u === "M"))
|
|
2907
|
+
switch (s[0] = p, u) {
|
|
2823
2908
|
case "V":
|
|
2824
|
-
s[1] -=
|
|
2909
|
+
s[1] -= c;
|
|
2825
2910
|
return;
|
|
2826
2911
|
case "A":
|
|
2827
|
-
s[6] -= h, s[7] -=
|
|
2912
|
+
s[6] -= h, s[7] -= c;
|
|
2828
2913
|
return;
|
|
2829
2914
|
default:
|
|
2830
2915
|
for (l = 1; l < s.length; l++)
|
|
2831
|
-
s[l] -= l % 2 ? h :
|
|
2916
|
+
s[l] -= l % 2 ? h : c;
|
|
2832
2917
|
}
|
|
2833
2918
|
}, !0), this;
|
|
2834
2919
|
}, a.prototype.unarc = function() {
|
|
2835
|
-
return this.iterate(function(s, r, h,
|
|
2836
|
-
var
|
|
2837
|
-
return
|
|
2920
|
+
return this.iterate(function(s, r, h, c) {
|
|
2921
|
+
var u, p, l, f = [], v = s[0];
|
|
2922
|
+
return v !== "A" && v !== "a" ? null : (v === "a" ? (p = h + s[6], l = c + s[7]) : (p = s[6], l = s[7]), u = o(h, c, p, l, s[4], s[5], s[1], s[2], s[3]), u.length === 0 ? [[s[0] === "a" ? "l" : "L", s[6], s[7]]] : (u.forEach(function(y) {
|
|
2838
2923
|
f.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
|
|
2839
2924
|
}), f));
|
|
2840
2925
|
}), this;
|
|
2841
2926
|
}, a.prototype.unshort = function() {
|
|
2842
|
-
var s = this.segments, r, h,
|
|
2843
|
-
return this.iterate(function(l, f,
|
|
2844
|
-
var M = l[0],
|
|
2845
|
-
f && (
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2927
|
+
var s = this.segments, r, h, c, u, p;
|
|
2928
|
+
return this.iterate(function(l, f, v, y) {
|
|
2929
|
+
var M = l[0], P = M.toUpperCase(), E;
|
|
2930
|
+
f && (P === "T" ? (E = M === "t", c = s[f - 1], c[0] === "Q" ? (r = c[1] - v, h = c[2] - y) : c[0] === "q" ? (r = c[1] - c[3], h = c[2] - c[4]) : (r = 0, h = 0), u = -r, p = -h, E || (u += v, p += y), s[f] = [
|
|
2931
|
+
E ? "q" : "Q",
|
|
2932
|
+
u,
|
|
2933
|
+
p,
|
|
2849
2934
|
l[1],
|
|
2850
2935
|
l[2]
|
|
2851
|
-
]) :
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2936
|
+
]) : P === "S" && (E = M === "s", c = s[f - 1], c[0] === "C" ? (r = c[3] - v, h = c[4] - y) : c[0] === "c" ? (r = c[3] - c[5], h = c[4] - c[6]) : (r = 0, h = 0), u = -r, p = -h, E || (u += v, p += y), s[f] = [
|
|
2937
|
+
E ? "c" : "C",
|
|
2938
|
+
u,
|
|
2939
|
+
p,
|
|
2855
2940
|
l[1],
|
|
2856
2941
|
l[2],
|
|
2857
2942
|
l[3],
|
|
2858
2943
|
l[4]
|
|
2859
2944
|
]));
|
|
2860
2945
|
}), this;
|
|
2861
|
-
},
|
|
2946
|
+
}, Xt = a, Xt;
|
|
2862
2947
|
}
|
|
2863
|
-
var
|
|
2864
|
-
function
|
|
2865
|
-
return
|
|
2948
|
+
var Gt, _0;
|
|
2949
|
+
function X1() {
|
|
2950
|
+
return _0 || (_0 = 1, Gt = W1()), Gt;
|
|
2866
2951
|
}
|
|
2867
|
-
var
|
|
2868
|
-
const
|
|
2869
|
-
var
|
|
2870
|
-
function
|
|
2952
|
+
var G1 = X1();
|
|
2953
|
+
const V1 = /* @__PURE__ */ j1(G1);
|
|
2954
|
+
var Vt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Z1 = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
2955
|
+
function K1(n) {
|
|
2871
2956
|
var e = [];
|
|
2872
|
-
return n.replace(
|
|
2957
|
+
return n.replace(Z1, function(t, o, i) {
|
|
2873
2958
|
var a = o.toLowerCase();
|
|
2874
|
-
for (i =
|
|
2875
|
-
if (i.length ===
|
|
2959
|
+
for (i = J1(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
|
|
2960
|
+
if (i.length === Vt[a])
|
|
2876
2961
|
return i.unshift(o), e.push(i);
|
|
2877
|
-
if (i.length <
|
|
2962
|
+
if (i.length < Vt[a])
|
|
2878
2963
|
throw new Error("malformed path data");
|
|
2879
|
-
e.push([o].concat(i.splice(0,
|
|
2964
|
+
e.push([o].concat(i.splice(0, Vt[a])));
|
|
2880
2965
|
}
|
|
2881
2966
|
}), e;
|
|
2882
2967
|
}
|
|
2883
|
-
var
|
|
2884
|
-
function
|
|
2885
|
-
var e = n.match(
|
|
2968
|
+
var Q1 = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
2969
|
+
function J1(n) {
|
|
2970
|
+
var e = n.match(Q1);
|
|
2886
2971
|
return e ? e.map(Number) : [];
|
|
2887
2972
|
}
|
|
2888
2973
|
function it(n, e, t, o, i, a, s, r) {
|
|
2889
|
-
return new
|
|
2974
|
+
return new t0(n, e, t, o, i, a, s, r);
|
|
2890
2975
|
}
|
|
2891
|
-
function
|
|
2892
|
-
this.a = { x: n, y: e }, this.b = { x: t, y: o }, this.c = { x: i, y: a }, this.d = { x: s, y: r }, s != null && r !== null && r !== void 0 ? (this.getArcLength =
|
|
2976
|
+
function t0(n, e, t, o, i, a, s, r) {
|
|
2977
|
+
this.a = { x: n, y: e }, this.b = { x: t, y: o }, this.c = { x: i, y: a }, this.d = { x: s, y: r }, s != null && r !== null && r !== void 0 ? (this.getArcLength = cn, this.getPoint = nn, this.getDerivative = en) : (this.getArcLength = rn, this.getPoint = ee, this.getDerivative = tn), this.init();
|
|
2893
2978
|
}
|
|
2894
|
-
|
|
2895
|
-
constructor:
|
|
2979
|
+
t0.prototype = {
|
|
2980
|
+
constructor: t0,
|
|
2896
2981
|
init: function() {
|
|
2897
2982
|
this.length = this.getArcLength(
|
|
2898
2983
|
[this.a.x, this.b.x, this.c.x, this.d.x],
|
|
@@ -2951,14 +3036,14 @@ Jt.prototype = {
|
|
|
2951
3036
|
return { x: a.x, y: a.y, tangentX: i.x, tangentY: i.y };
|
|
2952
3037
|
}
|
|
2953
3038
|
};
|
|
2954
|
-
function
|
|
3039
|
+
function tn(n, e, t) {
|
|
2955
3040
|
return {
|
|
2956
3041
|
x: (1 - t) * 2 * (n[1] - n[0]) + t * 2 * (n[2] - n[1]),
|
|
2957
3042
|
y: (1 - t) * 2 * (e[1] - e[0]) + t * 2 * (e[2] - e[1])
|
|
2958
3043
|
};
|
|
2959
3044
|
}
|
|
2960
|
-
function
|
|
2961
|
-
var o =
|
|
3045
|
+
function en(n, e, t) {
|
|
3046
|
+
var o = ee(
|
|
2962
3047
|
[3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])],
|
|
2963
3048
|
[3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])],
|
|
2964
3049
|
t
|
|
@@ -2967,30 +3052,30 @@ function W1(n, e, t) {
|
|
|
2967
3052
|
}
|
|
2968
3053
|
function Zt(n, e, t, o, i) {
|
|
2969
3054
|
for (var a = 1, s = n / e, r = (n - t(o, i, s)) / e; a > 1e-3; ) {
|
|
2970
|
-
var h = t(o, i, s + r),
|
|
2971
|
-
|
|
3055
|
+
var h = t(o, i, s + r), c = t(o, i, s - r), u = Math.abs(n - h) / e, p = Math.abs(n - c) / e;
|
|
3056
|
+
u < a ? (a = u, s += r) : p < a ? (a = p, s -= r) : r /= 2;
|
|
2972
3057
|
}
|
|
2973
3058
|
return s;
|
|
2974
3059
|
}
|
|
2975
|
-
function
|
|
3060
|
+
function ee(n, e, t) {
|
|
2976
3061
|
var o = (1 - t) * (1 - t) * n[0] + 2 * (1 - t) * t * n[1] + t * t * n[2], i = (1 - t) * (1 - t) * e[0] + 2 * (1 - t) * t * e[1] + t * t * e[2];
|
|
2977
3062
|
return { x: o, y: i };
|
|
2978
3063
|
}
|
|
2979
|
-
function
|
|
3064
|
+
function nn(n, e, t) {
|
|
2980
3065
|
var o = (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], i = (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3];
|
|
2981
3066
|
return { x: o, y: i };
|
|
2982
3067
|
}
|
|
2983
|
-
function
|
|
3068
|
+
function rn(n, e, t) {
|
|
2984
3069
|
t === void 0 && (t = 1);
|
|
2985
|
-
var o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s),
|
|
3070
|
+
var o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s), c = a * a + s * s;
|
|
2986
3071
|
if (r === 0)
|
|
2987
3072
|
return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
2988
|
-
var
|
|
2989
|
-
return Math.sqrt(r) / 2 * (l * Math.sqrt(l * l + f) -
|
|
2990
|
-
(l + Math.sqrt(l * l + f)) / (
|
|
3073
|
+
var u = h / (2 * r), p = c / r, l = t + u, f = p - u * u;
|
|
3074
|
+
return Math.sqrt(r) / 2 * (l * Math.sqrt(l * l + f) - u * Math.sqrt(u * u + f) + f * Math.log(Math.abs(
|
|
3075
|
+
(l + Math.sqrt(l * l + f)) / (u + Math.sqrt(u * u + f))
|
|
2991
3076
|
)));
|
|
2992
3077
|
}
|
|
2993
|
-
var
|
|
3078
|
+
var on = [
|
|
2994
3079
|
[],
|
|
2995
3080
|
[],
|
|
2996
3081
|
[-0.5773502691896257, 0.5773502691896257],
|
|
@@ -3016,7 +3101,7 @@ var Z1 = [
|
|
|
3016
3101
|
[-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992],
|
|
3017
3102
|
[0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522],
|
|
3018
3103
|
[-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]
|
|
3019
|
-
],
|
|
3104
|
+
], sn = [
|
|
3020
3105
|
[],
|
|
3021
3106
|
[],
|
|
3022
3107
|
[1, 1],
|
|
@@ -3042,86 +3127,86 @@ var Z1 = [
|
|
|
3042
3127
|
[0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722],
|
|
3043
3128
|
[0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771],
|
|
3044
3129
|
[0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]
|
|
3045
|
-
],
|
|
3046
|
-
function
|
|
3047
|
-
return
|
|
3130
|
+
], an = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
|
|
3131
|
+
function hn(n, e) {
|
|
3132
|
+
return an[n][e];
|
|
3048
3133
|
}
|
|
3049
|
-
function
|
|
3134
|
+
function e0(n, e, t) {
|
|
3050
3135
|
var o = t.length - 1, i, a, s;
|
|
3051
3136
|
if (o === 0)
|
|
3052
3137
|
return 0;
|
|
3053
3138
|
if (n === 0) {
|
|
3054
3139
|
for (a = 0, s = 0; s <= o; s++)
|
|
3055
|
-
a +=
|
|
3140
|
+
a += hn(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
3056
3141
|
return a;
|
|
3057
3142
|
} else {
|
|
3058
3143
|
for (i = new Array(o), s = 0; s < o; s++)
|
|
3059
3144
|
i[s] = o * (t[s + 1] - t[s]);
|
|
3060
|
-
return
|
|
3145
|
+
return e0(n - 1, e, i);
|
|
3061
3146
|
}
|
|
3062
3147
|
}
|
|
3063
|
-
function
|
|
3064
|
-
var o =
|
|
3148
|
+
function ln(n, e, t) {
|
|
3149
|
+
var o = e0(1, t, n), i = e0(1, t, e), a = o * o + i * i;
|
|
3065
3150
|
return Math.sqrt(a);
|
|
3066
3151
|
}
|
|
3067
|
-
function
|
|
3152
|
+
function cn(n, e, t) {
|
|
3068
3153
|
var o, i, a, s;
|
|
3069
3154
|
t === void 0 && (t = 1);
|
|
3070
3155
|
var r = 20;
|
|
3071
3156
|
for (o = t / 2, i = 0, a = 0; a < r; a++)
|
|
3072
|
-
s = o *
|
|
3157
|
+
s = o * on[r][a] + o, i += sn[r][a] * ln(n, e, s);
|
|
3073
3158
|
return o * i;
|
|
3074
3159
|
}
|
|
3075
|
-
var
|
|
3076
|
-
function
|
|
3160
|
+
var Et = Math.PI * 2;
|
|
3161
|
+
function O0(n, e, t, o) {
|
|
3077
3162
|
var i = n * o - e * t < 0 ? -1 : 1, a = n * t + e * o;
|
|
3078
3163
|
return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
|
|
3079
3164
|
}
|
|
3080
|
-
function
|
|
3081
|
-
var
|
|
3082
|
-
M < 0 && (M = 0), M /= l * y + f *
|
|
3083
|
-
var
|
|
3084
|
-
return a === 0 && Y > 0 && (Y -=
|
|
3165
|
+
function un(n, e, t, o, i, a, s, r, h, c) {
|
|
3166
|
+
var u = c * (n - t) / 2 + h * (e - o) / 2, p = -h * (n - t) / 2 + c * (e - o) / 2, l = s * s, f = r * r, v = u * u, y = p * p, M = l * f - l * y - f * v;
|
|
3167
|
+
M < 0 && (M = 0), M /= l * y + f * v, M = Math.sqrt(M) * (i === a ? -1 : 1);
|
|
3168
|
+
var P = M * s / r * p, E = M * -r / s * u, L = c * P - h * E + (n + t) / 2, S = h * P + c * E + (e + o) / 2, T = (u - P) / s, k = (p - E) / r, F = (-u - P) / s, X = (-p - E) / r, z = O0(1, 0, T, k), Y = O0(T, k, F, X);
|
|
3169
|
+
return a === 0 && Y > 0 && (Y -= Et), a === 1 && Y < 0 && (Y += Et), [L, S, z, Y];
|
|
3085
3170
|
}
|
|
3086
|
-
function
|
|
3171
|
+
function fn(n, e) {
|
|
3087
3172
|
var t = 1.3333333333333333 * Math.tan(e / 4), o = Math.cos(n), i = Math.sin(n), a = Math.cos(n + e), s = Math.sin(n + e);
|
|
3088
3173
|
return [o, i, o - i * t, i + o * t, a + s * t, s - a * t, a, s];
|
|
3089
3174
|
}
|
|
3090
|
-
function
|
|
3091
|
-
var
|
|
3092
|
-
if (
|
|
3175
|
+
function gn(n, e, t, o, i, a, s, r, h) {
|
|
3176
|
+
var c = Math.sin(i * Et / 360), u = Math.cos(i * Et / 360), p = u * (n - r) / 2 + c * (e - h) / 2, l = -c * (n - r) / 2 + u * (e - h) / 2;
|
|
3177
|
+
if (p === 0 && l === 0)
|
|
3093
3178
|
return [];
|
|
3094
3179
|
if (t === 0 || o === 0)
|
|
3095
3180
|
return [];
|
|
3096
3181
|
t = Math.abs(t), o = Math.abs(o);
|
|
3097
|
-
var f =
|
|
3182
|
+
var f = p * p / (t * t) + l * l / (o * o);
|
|
3098
3183
|
f > 1 && (t *= Math.sqrt(f), o *= Math.sqrt(f));
|
|
3099
|
-
var
|
|
3100
|
-
|
|
3101
|
-
for (var
|
|
3102
|
-
y.push(
|
|
3184
|
+
var v = un(n, e, r, h, a, s, t, o, c, u), y = [], M = v[2], P = v[3], E = Math.max(Math.ceil(Math.abs(P) / (Et / 4)), 1);
|
|
3185
|
+
P /= E;
|
|
3186
|
+
for (var L = 0; L < E; L++)
|
|
3187
|
+
y.push(fn(M, P)), M += P;
|
|
3103
3188
|
return y.map(function(S) {
|
|
3104
3189
|
for (var T = 0; T < S.length; T += 2) {
|
|
3105
|
-
var
|
|
3106
|
-
|
|
3107
|
-
var X =
|
|
3108
|
-
S[T + 0] = X +
|
|
3190
|
+
var k = S[T + 0], F = S[T + 1];
|
|
3191
|
+
k *= t, F *= o;
|
|
3192
|
+
var X = u * k - c * F, z = c * k + u * F;
|
|
3193
|
+
S[T + 0] = X + v[0], S[T + 1] = z + v[1];
|
|
3109
3194
|
}
|
|
3110
3195
|
return S;
|
|
3111
3196
|
});
|
|
3112
3197
|
}
|
|
3113
|
-
function
|
|
3114
|
-
return new
|
|
3198
|
+
function N0(n, e, t, o, i, a, s, r, h) {
|
|
3199
|
+
return new n0(n, e, t, o, i, a, s, r, h);
|
|
3115
3200
|
}
|
|
3116
|
-
function
|
|
3117
|
-
var
|
|
3201
|
+
function n0(n, e, t, o, i, a, s, r, h) {
|
|
3202
|
+
var c = 0, u = [], p = [], l = gn(n, e, t, o, i, a, s, r, h);
|
|
3118
3203
|
l.forEach(function(f) {
|
|
3119
|
-
var
|
|
3120
|
-
|
|
3121
|
-
}), this.length =
|
|
3204
|
+
var v = new it(f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]), y = v.getTotalLength();
|
|
3205
|
+
c += y, u.push(y), p.push(v);
|
|
3206
|
+
}), this.length = c, this.partialLengths = u, this.curves = p;
|
|
3122
3207
|
}
|
|
3123
|
-
|
|
3124
|
-
constructor:
|
|
3208
|
+
n0.prototype = {
|
|
3209
|
+
constructor: n0,
|
|
3125
3210
|
init: function() {
|
|
3126
3211
|
},
|
|
3127
3212
|
getTotalLength: function() {
|
|
@@ -3151,33 +3236,33 @@ e0.prototype = {
|
|
|
3151
3236
|
}
|
|
3152
3237
|
};
|
|
3153
3238
|
function rt(n, e, t, o) {
|
|
3154
|
-
return new
|
|
3239
|
+
return new It(n, e, t, o);
|
|
3155
3240
|
}
|
|
3156
|
-
function
|
|
3241
|
+
function It(n, e, t, o) {
|
|
3157
3242
|
this.x0 = n, this.x1 = e, this.y0 = t, this.y1 = o;
|
|
3158
3243
|
}
|
|
3159
|
-
|
|
3244
|
+
It.prototype.getTotalLength = function() {
|
|
3160
3245
|
return Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
|
|
3161
3246
|
};
|
|
3162
|
-
|
|
3247
|
+
It.prototype.getPointAtLength = function(n) {
|
|
3163
3248
|
var e = n / Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), t = (this.x1 - this.x0) * e, o = (this.y1 - this.y0) * e;
|
|
3164
3249
|
return { x: this.x0 + t, y: this.y0 + o };
|
|
3165
3250
|
};
|
|
3166
|
-
|
|
3251
|
+
It.prototype.getTangentAtLength = function() {
|
|
3167
3252
|
var n = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
|
|
3168
3253
|
return { x: (this.x1 - this.x0) / n, y: (this.y1 - this.y0) / n };
|
|
3169
3254
|
};
|
|
3170
|
-
|
|
3255
|
+
It.prototype.getPropertiesAtLength = function(n) {
|
|
3171
3256
|
var e = this.getPointAtLength(n), t = this.getTangentAtLength();
|
|
3172
3257
|
return { x: e.x, y: e.y, tangentX: t.x, tangentY: t.y };
|
|
3173
3258
|
};
|
|
3174
|
-
function
|
|
3259
|
+
function pn(n) {
|
|
3175
3260
|
var e = 0, t = [], o = [];
|
|
3176
3261
|
function i(s) {
|
|
3177
3262
|
if (!s)
|
|
3178
3263
|
return null;
|
|
3179
|
-
for (var r =
|
|
3180
|
-
r[l][0] === "M" ? (h = [r[l][1], r[l][2]],
|
|
3264
|
+
for (var r = K1(s), h = [0, 0], c = [0, 0], u, p, l = 0; l < r.length; l++)
|
|
3265
|
+
r[l][0] === "M" ? (h = [r[l][1], r[l][2]], p = [h[0], h[1]], o.push(null)) : r[l][0] === "m" ? (h = [r[l][1] + h[0], r[l][2] + h[1]], p = [h[0], h[1]], o.push(null)) : r[l][0] === "L" ? (e = e + Math.sqrt(Math.pow(h[0] - r[l][1], 2) + Math.pow(h[1] - r[l][2], 2)), o.push(new rt(h[0], r[l][1], h[1], r[l][2])), h = [r[l][1], r[l][2]]) : r[l][0] === "l" ? (e = e + Math.sqrt(Math.pow(r[l][1], 2) + Math.pow(r[l][2], 2)), o.push(new rt(h[0], r[l][1] + h[0], h[1], r[l][2] + h[1])), h = [r[l][1] + h[0], r[l][2] + h[1]]) : r[l][0] === "H" ? (e = e + Math.abs(h[0] - r[l][1]), o.push(new rt(h[0], r[l][1], h[1], h[1])), h[0] = r[l][1]) : r[l][0] === "h" ? (e = e + Math.abs(r[l][1]), o.push(new rt(h[0], h[0] + r[l][1], h[1], h[1])), h[0] = r[l][1] + h[0]) : r[l][0] === "V" ? (e = e + Math.abs(h[1] - r[l][1]), o.push(new rt(h[0], h[0], h[1], r[l][1])), h[1] = r[l][1]) : r[l][0] === "v" ? (e = e + Math.abs(r[l][1]), o.push(new rt(h[0], h[0], h[1], h[1] + r[l][1])), h[1] = r[l][1] + h[1]) : r[l][0] === "z" || r[l][0] === "Z" ? (e = e + Math.sqrt(Math.pow(p[0] - h[0], 2) + Math.pow(p[1] - h[1], 2)), o.push(new rt(h[0], p[0], h[1], p[1])), h = [p[0], p[1]]) : r[l][0] === "C" ? (u = new it(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6]), e = e + u.getTotalLength(), h = [r[l][5], r[l][6]], o.push(u)) : r[l][0] === "c" ? (u = new it(h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4], h[0] + r[l][5], h[1] + r[l][6]), e = e + u.getTotalLength(), h = [r[l][5] + h[0], r[l][6] + h[1]], o.push(u)) : r[l][0] === "S" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? u = new it(h[0], h[1], 2 * h[0] - r[l - 1][r[l - 1].length - 4], 2 * h[1] - r[l - 1][r[l - 1].length - 3], r[l][1], r[l][2], r[l][3], r[l][4]) : u = new it(h[0], h[1], h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]), e = e + u.getTotalLength(), h = [r[l][3], r[l][4]], o.push(u)) : r[l][0] === "s" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? u = new it(h[0], h[1], h[0] + u.d.x - u.c.x, h[1] + u.d.y - u.c.y, h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]) : u = new it(h[0], h[1], h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]), e = e + u.getTotalLength(), h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(u)) : r[l][0] === "Q" ? (h[0] != r[l][1] && h[1] != r[l][2] ? u = new it(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]) : u = new rt(r[l][1], r[l][3], r[l][2], r[l][4]), e = e + u.getTotalLength(), o.push(u), h = [r[l][3], r[l][4]], c = [r[l][1], r[l][2]]) : r[l][0] === "q" ? (r[l][1] == 0 && r[l][2] == 0 ? u = new rt(h[0] + r[l][1], h[0] + r[l][3], h[1] + r[l][2], h[1] + r[l][4]) : u = new it(h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]), e = e + u.getTotalLength(), c = [h[0] + r[l][1], h[1] + r[l][2]], h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(u)) : r[l][0] === "T" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? u = new it(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], r[l][1], r[l][2]) : u = new rt(h[0], r[l][1], h[1], r[l][2]), o.push(u), e = e + u.getTotalLength(), c = [2 * h[0] - c[0], 2 * h[1] - c[1]], h = [r[l][1], r[l][2]]) : r[l][0] === "t" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? u = new it(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], h[0] + r[l][1], h[1] + r[l][2]) : u = new rt(h[0], h[0] + r[l][1], h[1], h[1] + r[l][2]), e = e + u.getTotalLength(), c = [2 * h[0] - c[0], 2 * h[1] - c[1]], h = [r[l][1] + h[0], r[l][2] + h[0]], o.push(u)) : r[l][0] === "A" ? (u = new N0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6], r[l][7]), e = e + u.getTotalLength(), h = [r[l][6], r[l][7]], o.push(u)) : r[l][0] === "a" && (u = new N0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], h[0] + r[l][6], h[1] + r[l][7]), e = e + u.getTotalLength(), h = [h[0] + r[l][6], h[1] + r[l][7]], o.push(u)), t.push(e);
|
|
3181
3266
|
return i;
|
|
3182
3267
|
}
|
|
3183
3268
|
i.getTotalLength = function() {
|
|
@@ -3200,49 +3285,49 @@ function on(n) {
|
|
|
3200
3285
|
};
|
|
3201
3286
|
return i(n);
|
|
3202
3287
|
}
|
|
3203
|
-
function
|
|
3288
|
+
function Ft(n, e) {
|
|
3204
3289
|
return Math.sqrt((n[0] - e[0]) * (n[0] - e[0]) + (n[1] - e[1]) * (n[1] - e[1]));
|
|
3205
3290
|
}
|
|
3206
|
-
function
|
|
3291
|
+
function ne(n, e, t) {
|
|
3207
3292
|
return [n[0] + (e[0] - n[0]) * t, n[1] + (e[1] - n[1]) * t];
|
|
3208
3293
|
}
|
|
3209
|
-
function
|
|
3210
|
-
return
|
|
3294
|
+
function dn(n, e) {
|
|
3295
|
+
return Ft(n, e) < 1e-9;
|
|
3211
3296
|
}
|
|
3212
|
-
function
|
|
3213
|
-
let o = n.map((i, a) =>
|
|
3297
|
+
function xn(n, e, t) {
|
|
3298
|
+
let o = n.map((i, a) => yn(i, e[a]));
|
|
3214
3299
|
return function(i) {
|
|
3215
3300
|
let a = o.map((s) => s(i));
|
|
3216
|
-
return t ?
|
|
3301
|
+
return t ? mn(a) : a;
|
|
3217
3302
|
};
|
|
3218
3303
|
}
|
|
3219
|
-
function
|
|
3304
|
+
function yn(n, e) {
|
|
3220
3305
|
return function(t) {
|
|
3221
3306
|
return n.map((o, i) => o + t * (e[i] - o));
|
|
3222
3307
|
};
|
|
3223
3308
|
}
|
|
3224
|
-
function
|
|
3309
|
+
function Rt(n) {
|
|
3225
3310
|
return typeof n == "number" && isFinite(n);
|
|
3226
3311
|
}
|
|
3227
|
-
const
|
|
3312
|
+
const r0 = `All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).
|
|
3228
3313
|
Example valid ways of supplying a shape would be:
|
|
3229
3314
|
[[0, 0], [10, 0], [10, 10]]
|
|
3230
3315
|
"M0,0 L10,0 L10,10Z"
|
|
3231
3316
|
`;
|
|
3232
|
-
function
|
|
3233
|
-
return new
|
|
3317
|
+
function vn(n) {
|
|
3318
|
+
return new V1(n).abs();
|
|
3234
3319
|
}
|
|
3235
|
-
function
|
|
3320
|
+
function wn(n) {
|
|
3236
3321
|
return n.toString().split("M").map((e, t) => (e = e.trim(), t && e ? "M" + e : e)).filter((e) => e);
|
|
3237
3322
|
}
|
|
3238
|
-
function
|
|
3323
|
+
function mn(n) {
|
|
3239
3324
|
return "M" + n.join("L") + "Z";
|
|
3240
3325
|
}
|
|
3241
|
-
function
|
|
3242
|
-
let t =
|
|
3243
|
-
return
|
|
3326
|
+
function bn(n, e) {
|
|
3327
|
+
let t = vn(n);
|
|
3328
|
+
return An(t) || Mn(t, e);
|
|
3244
3329
|
}
|
|
3245
|
-
function
|
|
3330
|
+
function An(n) {
|
|
3246
3331
|
let e = n.segments || [], t = [];
|
|
3247
3332
|
if (!e.length || e[0][0] !== "M")
|
|
3248
3333
|
return !1;
|
|
@@ -3261,11 +3346,11 @@ function gn(n) {
|
|
|
3261
3346
|
}
|
|
3262
3347
|
return t.length ? { ring: t } : !1;
|
|
3263
3348
|
}
|
|
3264
|
-
function
|
|
3265
|
-
let t =
|
|
3349
|
+
function Mn(n, e) {
|
|
3350
|
+
let t = wn(n)[0], o = [], i, a, s = 3;
|
|
3266
3351
|
if (!t)
|
|
3267
|
-
throw new TypeError(
|
|
3268
|
-
a =
|
|
3352
|
+
throw new TypeError(r0);
|
|
3353
|
+
a = Ln(t), i = a.getTotalLength(), e && Rt(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
|
|
3269
3354
|
for (let r = 0; r < s; r++) {
|
|
3270
3355
|
let h = a.getPointAtLength(i * r / s);
|
|
3271
3356
|
o.push([h.x, h.y]);
|
|
@@ -3275,331 +3360,331 @@ function pn(n, e) {
|
|
|
3275
3360
|
skipBisect: !0
|
|
3276
3361
|
};
|
|
3277
3362
|
}
|
|
3278
|
-
function
|
|
3363
|
+
function Ln(n) {
|
|
3279
3364
|
if (typeof window < "u" && window && window.document)
|
|
3280
3365
|
try {
|
|
3281
3366
|
let e = window.document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3282
3367
|
return e.setAttributeNS(null, "d", n), e;
|
|
3283
3368
|
} catch {
|
|
3284
3369
|
}
|
|
3285
|
-
return
|
|
3370
|
+
return pn(n);
|
|
3286
3371
|
}
|
|
3287
|
-
function
|
|
3288
|
-
const t = n.length + e, o =
|
|
3372
|
+
function R0(n, e) {
|
|
3373
|
+
const t = n.length + e, o = z1(n) / e;
|
|
3289
3374
|
let i = 0, a = 0, s = o / 2;
|
|
3290
3375
|
for (; n.length < t; ) {
|
|
3291
|
-
let r = n[i], h = n[(i + 1) % n.length],
|
|
3292
|
-
if (s <= a +
|
|
3293
|
-
n.splice(i + 1, 0,
|
|
3376
|
+
let r = n[i], h = n[(i + 1) % n.length], c = Ft(r, h);
|
|
3377
|
+
if (s <= a + c) {
|
|
3378
|
+
n.splice(i + 1, 0, c ? ne(r, h, (s - a) / c) : r.slice(0)), s += o;
|
|
3294
3379
|
continue;
|
|
3295
3380
|
}
|
|
3296
|
-
a +=
|
|
3381
|
+
a += c, i++;
|
|
3297
3382
|
}
|
|
3298
3383
|
}
|
|
3299
|
-
function
|
|
3384
|
+
function Tn(n, e = 1 / 0) {
|
|
3300
3385
|
for (let t = 0; t < n.length; t++) {
|
|
3301
3386
|
let o = n[t], i = t === n.length - 1 ? n[0] : n[t + 1];
|
|
3302
|
-
for (;
|
|
3303
|
-
i =
|
|
3387
|
+
for (; Ft(o, i) > e; )
|
|
3388
|
+
i = ne(o, i, 0.5), n.splice(t + 1, 0, i);
|
|
3304
3389
|
}
|
|
3305
3390
|
}
|
|
3306
|
-
function
|
|
3391
|
+
function F0(n, e) {
|
|
3307
3392
|
let t, o, i;
|
|
3308
3393
|
if (typeof n == "string") {
|
|
3309
|
-
let a =
|
|
3394
|
+
let a = bn(n, e);
|
|
3310
3395
|
n = a.ring, i = a.skipBisect;
|
|
3311
3396
|
} else if (!Array.isArray(n))
|
|
3312
|
-
throw new TypeError(
|
|
3313
|
-
if (t = n.slice(0), !
|
|
3314
|
-
throw new TypeError(
|
|
3315
|
-
return t.length > 1 &&
|
|
3397
|
+
throw new TypeError(r0);
|
|
3398
|
+
if (t = n.slice(0), !Cn(t))
|
|
3399
|
+
throw new TypeError(r0);
|
|
3400
|
+
return t.length > 1 && dn(t[0], t[t.length - 1]) && t.pop(), o = q1(t), o > 0 && t.reverse(), !i && e && Rt(e) && e > 0 && Tn(t, e), t;
|
|
3316
3401
|
}
|
|
3317
|
-
function
|
|
3402
|
+
function Cn(n) {
|
|
3318
3403
|
return n.every(function(e) {
|
|
3319
|
-
return Array.isArray(e) && e.length >= 2 &&
|
|
3404
|
+
return Array.isArray(e) && e.length >= 2 && Rt(e[0]) && Rt(e[1]);
|
|
3320
3405
|
});
|
|
3321
3406
|
}
|
|
3322
|
-
function
|
|
3407
|
+
function Pn(n, e) {
|
|
3323
3408
|
let t = n.length, o = 1 / 0, i, a, s;
|
|
3324
3409
|
for (let r = 0; r < t; r++)
|
|
3325
|
-
a = 0, e.forEach(function(h,
|
|
3326
|
-
let
|
|
3327
|
-
a +=
|
|
3410
|
+
a = 0, e.forEach(function(h, c) {
|
|
3411
|
+
let u = Ft(n[(r + c) % t], h);
|
|
3412
|
+
a += u * u;
|
|
3328
3413
|
}), a < o && (o = a, i = r);
|
|
3329
3414
|
i && (s = n.splice(0, i), n.splice(n.length, 0, ...s));
|
|
3330
3415
|
}
|
|
3331
|
-
function
|
|
3332
|
-
let i =
|
|
3416
|
+
function En(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
|
|
3417
|
+
let i = F0(n, t), a = F0(e, t), s = Sn(i, a, o);
|
|
3333
3418
|
return !o || typeof n != "string" && typeof e != "string" ? s : (r) => r < 1e-4 && typeof n == "string" ? n : 1 - r < 1e-4 && typeof e == "string" ? e : s(r);
|
|
3334
3419
|
}
|
|
3335
|
-
function
|
|
3420
|
+
function Sn(n, e, t) {
|
|
3336
3421
|
let o;
|
|
3337
|
-
return o = n.length - e.length,
|
|
3338
|
-
}
|
|
3339
|
-
var
|
|
3340
|
-
function
|
|
3341
|
-
if (
|
|
3342
|
-
|
|
3343
|
-
function n(g, x,
|
|
3344
|
-
|
|
3345
|
-
var
|
|
3422
|
+
return o = n.length - e.length, R0(n, o < 0 ? o * -1 : 0), R0(e, o > 0 ? o : 0), Pn(n, e), xn(n, e, t);
|
|
3423
|
+
}
|
|
3424
|
+
var _t = { exports: {} }, B0;
|
|
3425
|
+
function kn() {
|
|
3426
|
+
if (B0) return _t.exports;
|
|
3427
|
+
B0 = 1, _t.exports = n, _t.exports.default = n;
|
|
3428
|
+
function n(g, x, d) {
|
|
3429
|
+
d = d || 2;
|
|
3430
|
+
var w = x && x.length, m = w ? x[0] * d : g.length, b = e(g, 0, m, d, !0), A = [];
|
|
3346
3431
|
if (!b || b.next === b.prev) return A;
|
|
3347
|
-
var
|
|
3348
|
-
if (
|
|
3349
|
-
|
|
3350
|
-
for (var
|
|
3351
|
-
|
|
3352
|
-
|
|
3432
|
+
var C, N, _, $, j, B, V;
|
|
3433
|
+
if (w && (b = h(g, x, b, d)), g.length > 80 * d) {
|
|
3434
|
+
C = _ = g[0], N = $ = g[1];
|
|
3435
|
+
for (var H = d; H < m; H += d)
|
|
3436
|
+
j = g[H], B = g[H + 1], j < C && (C = j), B < N && (N = B), j > _ && (_ = j), B > $ && ($ = B);
|
|
3437
|
+
V = Math.max(_ - C, $ - N), V = V !== 0 ? 32767 / V : 0;
|
|
3353
3438
|
}
|
|
3354
|
-
return o(b, A,
|
|
3439
|
+
return o(b, A, d, C, N, V, 0), A;
|
|
3355
3440
|
}
|
|
3356
|
-
function e(g, x,
|
|
3441
|
+
function e(g, x, d, w, m) {
|
|
3357
3442
|
var b, A;
|
|
3358
|
-
if (
|
|
3359
|
-
for (b = x; b <
|
|
3443
|
+
if (m === Bt(g, x, d, w) > 0)
|
|
3444
|
+
for (b = x; b < d; b += w) A = et(b, g[b], g[b + 1], A);
|
|
3360
3445
|
else
|
|
3361
|
-
for (b =
|
|
3446
|
+
for (b = d - w; b >= x; b -= w) A = et(b, g[b], g[b + 1], A);
|
|
3362
3447
|
return A && S(A, A.next) && (nt(A), A = A.next), A;
|
|
3363
3448
|
}
|
|
3364
3449
|
function t(g, x) {
|
|
3365
3450
|
if (!g) return g;
|
|
3366
3451
|
x || (x = g);
|
|
3367
|
-
var
|
|
3452
|
+
var d = g, w;
|
|
3368
3453
|
do
|
|
3369
|
-
if (
|
|
3370
|
-
if (nt(
|
|
3371
|
-
|
|
3454
|
+
if (w = !1, !d.steiner && (S(d, d.next) || L(d.prev, d, d.next) === 0)) {
|
|
3455
|
+
if (nt(d), d = x = d.prev, d === d.next) break;
|
|
3456
|
+
w = !0;
|
|
3372
3457
|
} else
|
|
3373
|
-
|
|
3374
|
-
while (
|
|
3458
|
+
d = d.next;
|
|
3459
|
+
while (w || d !== x);
|
|
3375
3460
|
return x;
|
|
3376
3461
|
}
|
|
3377
|
-
function o(g, x,
|
|
3462
|
+
function o(g, x, d, w, m, b, A) {
|
|
3378
3463
|
if (g) {
|
|
3379
|
-
!A && b && f(g,
|
|
3380
|
-
for (var
|
|
3381
|
-
if (
|
|
3382
|
-
x.push(
|
|
3464
|
+
!A && b && f(g, w, m, b);
|
|
3465
|
+
for (var C = g, N, _; g.prev !== g.next; ) {
|
|
3466
|
+
if (N = g.prev, _ = g.next, b ? a(g, w, m, b) : i(g)) {
|
|
3467
|
+
x.push(N.i / d | 0), x.push(g.i / d | 0), x.push(_.i / d | 0), nt(g), g = _.next, C = _.next;
|
|
3383
3468
|
continue;
|
|
3384
3469
|
}
|
|
3385
|
-
if (g = _, g ===
|
|
3386
|
-
A ? A === 1 ? (g = s(t(g), x,
|
|
3470
|
+
if (g = _, g === C) {
|
|
3471
|
+
A ? A === 1 ? (g = s(t(g), x, d), o(g, x, d, w, m, b, 2)) : A === 2 && r(g, x, d, w, m, b) : o(t(g), x, d, w, m, b, 1);
|
|
3387
3472
|
break;
|
|
3388
3473
|
}
|
|
3389
3474
|
}
|
|
3390
3475
|
}
|
|
3391
3476
|
}
|
|
3392
3477
|
function i(g) {
|
|
3393
|
-
var x = g.prev,
|
|
3394
|
-
if (
|
|
3395
|
-
for (var
|
|
3396
|
-
if (
|
|
3397
|
-
|
|
3478
|
+
var x = g.prev, d = g, w = g.next;
|
|
3479
|
+
if (L(x, d, w) >= 0) return !1;
|
|
3480
|
+
for (var m = x.x, b = d.x, A = w.x, C = x.y, N = d.y, _ = w.y, $ = m < b ? m < A ? m : A : b < A ? b : A, j = C < N ? C < _ ? C : _ : N < _ ? N : _, B = m > b ? m > A ? m : A : b > A ? b : A, V = C > N ? C > _ ? C : _ : N > _ ? N : _, H = w.next; H !== x; ) {
|
|
3481
|
+
if (H.x >= $ && H.x <= B && H.y >= j && H.y <= V && P(m, C, b, N, A, _, H.x, H.y) && L(H.prev, H, H.next) >= 0) return !1;
|
|
3482
|
+
H = H.next;
|
|
3398
3483
|
}
|
|
3399
3484
|
return !0;
|
|
3400
3485
|
}
|
|
3401
|
-
function a(g, x,
|
|
3402
|
-
var
|
|
3403
|
-
if (
|
|
3404
|
-
for (var
|
|
3405
|
-
if (D.x >=
|
|
3486
|
+
function a(g, x, d, w) {
|
|
3487
|
+
var m = g.prev, b = g, A = g.next;
|
|
3488
|
+
if (L(m, b, A) >= 0) return !1;
|
|
3489
|
+
for (var C = m.x, N = b.x, _ = A.x, $ = m.y, j = b.y, B = A.y, V = C < N ? C < _ ? C : _ : N < _ ? N : _, H = $ < j ? $ < B ? $ : B : j < B ? j : B, Tt = C > N ? C > _ ? C : _ : N > _ ? N : _, Ct = $ > j ? $ > B ? $ : B : j > B ? j : B, u0 = y(V, H, x, d, w), f0 = y(Tt, Ct, x, d, w), D = g.prevZ, q = g.nextZ; D && D.z >= u0 && q && q.z <= f0; ) {
|
|
3490
|
+
if (D.x >= V && D.x <= Tt && D.y >= H && D.y <= Ct && D !== m && D !== A && P(C, $, N, j, _, B, D.x, D.y) && L(D.prev, D, D.next) >= 0 || (D = D.prevZ, q.x >= V && q.x <= Tt && q.y >= H && q.y <= Ct && q !== m && q !== A && P(C, $, N, j, _, B, q.x, q.y) && L(q.prev, q, q.next) >= 0)) return !1;
|
|
3406
3491
|
q = q.nextZ;
|
|
3407
3492
|
}
|
|
3408
|
-
for (; D && D.z >=
|
|
3409
|
-
if (D.x >=
|
|
3493
|
+
for (; D && D.z >= u0; ) {
|
|
3494
|
+
if (D.x >= V && D.x <= Tt && D.y >= H && D.y <= Ct && D !== m && D !== A && P(C, $, N, j, _, B, D.x, D.y) && L(D.prev, D, D.next) >= 0) return !1;
|
|
3410
3495
|
D = D.prevZ;
|
|
3411
3496
|
}
|
|
3412
|
-
for (; q && q.z <=
|
|
3413
|
-
if (q.x >=
|
|
3497
|
+
for (; q && q.z <= f0; ) {
|
|
3498
|
+
if (q.x >= V && q.x <= Tt && q.y >= H && q.y <= Ct && q !== m && q !== A && P(C, $, N, j, _, B, q.x, q.y) && L(q.prev, q, q.next) >= 0) return !1;
|
|
3414
3499
|
q = q.nextZ;
|
|
3415
3500
|
}
|
|
3416
3501
|
return !0;
|
|
3417
3502
|
}
|
|
3418
|
-
function s(g, x,
|
|
3419
|
-
var
|
|
3503
|
+
function s(g, x, d) {
|
|
3504
|
+
var w = g;
|
|
3420
3505
|
do {
|
|
3421
|
-
var
|
|
3422
|
-
!S(
|
|
3423
|
-
} while (
|
|
3424
|
-
return t(
|
|
3506
|
+
var m = w.prev, b = w.next.next;
|
|
3507
|
+
!S(m, b) && T(m, w, w.next, b) && z(m, b) && z(b, m) && (x.push(m.i / d | 0), x.push(w.i / d | 0), x.push(b.i / d | 0), nt(w), nt(w.next), w = g = b), w = w.next;
|
|
3508
|
+
} while (w !== g);
|
|
3509
|
+
return t(w);
|
|
3425
3510
|
}
|
|
3426
|
-
function r(g, x,
|
|
3511
|
+
function r(g, x, d, w, m, b) {
|
|
3427
3512
|
var A = g;
|
|
3428
3513
|
do {
|
|
3429
|
-
for (var
|
|
3430
|
-
if (A.i !==
|
|
3431
|
-
var
|
|
3432
|
-
A = t(A, A.next),
|
|
3514
|
+
for (var C = A.next.next; C !== A.prev; ) {
|
|
3515
|
+
if (A.i !== C.i && E(A, C)) {
|
|
3516
|
+
var N = tt(A, C);
|
|
3517
|
+
A = t(A, A.next), N = t(N, N.next), o(A, x, d, w, m, b, 0), o(N, x, d, w, m, b, 0);
|
|
3433
3518
|
return;
|
|
3434
3519
|
}
|
|
3435
|
-
|
|
3520
|
+
C = C.next;
|
|
3436
3521
|
}
|
|
3437
3522
|
A = A.next;
|
|
3438
3523
|
} while (A !== g);
|
|
3439
3524
|
}
|
|
3440
|
-
function h(g, x,
|
|
3441
|
-
var
|
|
3525
|
+
function h(g, x, d, w) {
|
|
3526
|
+
var m = [], b, A, C, N, _;
|
|
3442
3527
|
for (b = 0, A = x.length; b < A; b++)
|
|
3443
|
-
|
|
3444
|
-
for (
|
|
3445
|
-
|
|
3446
|
-
return
|
|
3528
|
+
C = x[b] * w, N = b < A - 1 ? x[b + 1] * w : g.length, _ = e(g, C, N, w, !1), _ === _.next && (_.steiner = !0), m.push(M(_));
|
|
3529
|
+
for (m.sort(c), b = 0; b < m.length; b++)
|
|
3530
|
+
d = u(m[b], d);
|
|
3531
|
+
return d;
|
|
3447
3532
|
}
|
|
3448
|
-
function
|
|
3533
|
+
function c(g, x) {
|
|
3449
3534
|
return g.x - x.x;
|
|
3450
3535
|
}
|
|
3451
|
-
function
|
|
3452
|
-
var
|
|
3453
|
-
if (!
|
|
3536
|
+
function u(g, x) {
|
|
3537
|
+
var d = p(g, x);
|
|
3538
|
+
if (!d)
|
|
3454
3539
|
return x;
|
|
3455
|
-
var
|
|
3456
|
-
return t(
|
|
3540
|
+
var w = tt(d, g);
|
|
3541
|
+
return t(w, w.next), t(d, d.next);
|
|
3457
3542
|
}
|
|
3458
|
-
function
|
|
3459
|
-
var
|
|
3543
|
+
function p(g, x) {
|
|
3544
|
+
var d = x, w = g.x, m = g.y, b = -1 / 0, A;
|
|
3460
3545
|
do {
|
|
3461
|
-
if (
|
|
3462
|
-
var
|
|
3463
|
-
if (
|
|
3546
|
+
if (m <= d.y && m >= d.next.y && d.next.y !== d.y) {
|
|
3547
|
+
var C = d.x + (m - d.y) * (d.next.x - d.x) / (d.next.y - d.y);
|
|
3548
|
+
if (C <= w && C > b && (b = C, A = d.x < d.next.x ? d : d.next, C === w))
|
|
3464
3549
|
return A;
|
|
3465
3550
|
}
|
|
3466
|
-
|
|
3467
|
-
} while (
|
|
3551
|
+
d = d.next;
|
|
3552
|
+
} while (d !== x);
|
|
3468
3553
|
if (!A) return null;
|
|
3469
|
-
var
|
|
3470
|
-
|
|
3554
|
+
var N = A, _ = A.x, $ = A.y, j = 1 / 0, B;
|
|
3555
|
+
d = A;
|
|
3471
3556
|
do
|
|
3472
|
-
|
|
3473
|
-
while (
|
|
3557
|
+
w >= d.x && d.x >= _ && w !== d.x && P(m < $ ? w : b, m, _, $, m < $ ? b : w, m, d.x, d.y) && (B = Math.abs(m - d.y) / (w - d.x), z(d, g) && (B < j || B === j && (d.x > A.x || d.x === A.x && l(A, d))) && (A = d, j = B)), d = d.next;
|
|
3558
|
+
while (d !== N);
|
|
3474
3559
|
return A;
|
|
3475
3560
|
}
|
|
3476
3561
|
function l(g, x) {
|
|
3477
|
-
return
|
|
3562
|
+
return L(g.prev, g, x.prev) < 0 && L(x.next, g, g.next) < 0;
|
|
3478
3563
|
}
|
|
3479
|
-
function f(g, x,
|
|
3480
|
-
var
|
|
3564
|
+
function f(g, x, d, w) {
|
|
3565
|
+
var m = g;
|
|
3481
3566
|
do
|
|
3482
|
-
|
|
3483
|
-
while (
|
|
3484
|
-
|
|
3567
|
+
m.z === 0 && (m.z = y(m.x, m.y, x, d, w)), m.prevZ = m.prev, m.nextZ = m.next, m = m.next;
|
|
3568
|
+
while (m !== g);
|
|
3569
|
+
m.prevZ.nextZ = null, m.prevZ = null, v(m);
|
|
3485
3570
|
}
|
|
3486
|
-
function
|
|
3487
|
-
var x,
|
|
3571
|
+
function v(g) {
|
|
3572
|
+
var x, d, w, m, b, A, C, N, _ = 1;
|
|
3488
3573
|
do {
|
|
3489
|
-
for (
|
|
3490
|
-
for (A++,
|
|
3574
|
+
for (d = g, g = null, b = null, A = 0; d; ) {
|
|
3575
|
+
for (A++, w = d, C = 0, x = 0; x < _ && (C++, w = w.nextZ, !!w); x++)
|
|
3491
3576
|
;
|
|
3492
|
-
for (
|
|
3493
|
-
|
|
3494
|
-
|
|
3577
|
+
for (N = _; C > 0 || N > 0 && w; )
|
|
3578
|
+
C !== 0 && (N === 0 || !w || d.z <= w.z) ? (m = d, d = d.nextZ, C--) : (m = w, w = w.nextZ, N--), b ? b.nextZ = m : g = m, m.prevZ = b, b = m;
|
|
3579
|
+
d = w;
|
|
3495
3580
|
}
|
|
3496
3581
|
b.nextZ = null, _ *= 2;
|
|
3497
3582
|
} while (A > 1);
|
|
3498
3583
|
return g;
|
|
3499
3584
|
}
|
|
3500
|
-
function y(g, x,
|
|
3501
|
-
return g = (g -
|
|
3585
|
+
function y(g, x, d, w, m) {
|
|
3586
|
+
return g = (g - d) * m | 0, x = (x - w) * m | 0, g = (g | g << 8) & 16711935, g = (g | g << 4) & 252645135, g = (g | g << 2) & 858993459, g = (g | g << 1) & 1431655765, x = (x | x << 8) & 16711935, x = (x | x << 4) & 252645135, x = (x | x << 2) & 858993459, x = (x | x << 1) & 1431655765, g | x << 1;
|
|
3502
3587
|
}
|
|
3503
3588
|
function M(g) {
|
|
3504
|
-
var x = g,
|
|
3589
|
+
var x = g, d = g;
|
|
3505
3590
|
do
|
|
3506
|
-
(x.x <
|
|
3591
|
+
(x.x < d.x || x.x === d.x && x.y < d.y) && (d = x), x = x.next;
|
|
3507
3592
|
while (x !== g);
|
|
3508
|
-
return
|
|
3593
|
+
return d;
|
|
3509
3594
|
}
|
|
3510
|
-
function
|
|
3511
|
-
return (
|
|
3595
|
+
function P(g, x, d, w, m, b, A, C) {
|
|
3596
|
+
return (m - A) * (x - C) >= (g - A) * (b - C) && (g - A) * (w - C) >= (d - A) * (x - C) && (d - A) * (b - C) >= (m - A) * (w - C);
|
|
3512
3597
|
}
|
|
3513
|
-
function
|
|
3598
|
+
function E(g, x) {
|
|
3514
3599
|
return g.next.i !== x.i && g.prev.i !== x.i && !X(g, x) && // dones't intersect other edges
|
|
3515
|
-
(
|
|
3516
|
-
(
|
|
3517
|
-
S(g, x) &&
|
|
3600
|
+
(z(g, x) && z(x, g) && Y(g, x) && // locally visible
|
|
3601
|
+
(L(g.prev, g, x.prev) || L(g, x.prev, x)) || // does not create opposite-facing sectors
|
|
3602
|
+
S(g, x) && L(g.prev, g, g.next) > 0 && L(x.prev, x, x.next) > 0);
|
|
3518
3603
|
}
|
|
3519
|
-
function
|
|
3520
|
-
return (x.y - g.y) * (
|
|
3604
|
+
function L(g, x, d) {
|
|
3605
|
+
return (x.y - g.y) * (d.x - x.x) - (x.x - g.x) * (d.y - x.y);
|
|
3521
3606
|
}
|
|
3522
3607
|
function S(g, x) {
|
|
3523
3608
|
return g.x === x.x && g.y === x.y;
|
|
3524
3609
|
}
|
|
3525
|
-
function T(g, x,
|
|
3526
|
-
var
|
|
3527
|
-
return !!(
|
|
3610
|
+
function T(g, x, d, w) {
|
|
3611
|
+
var m = F(L(g, x, d)), b = F(L(g, x, w)), A = F(L(d, w, g)), C = F(L(d, w, x));
|
|
3612
|
+
return !!(m !== b && A !== C || m === 0 && k(g, d, x) || b === 0 && k(g, w, x) || A === 0 && k(d, g, w) || C === 0 && k(d, x, w));
|
|
3528
3613
|
}
|
|
3529
|
-
function
|
|
3530
|
-
return x.x <= Math.max(g.x,
|
|
3614
|
+
function k(g, x, d) {
|
|
3615
|
+
return x.x <= Math.max(g.x, d.x) && x.x >= Math.min(g.x, d.x) && x.y <= Math.max(g.y, d.y) && x.y >= Math.min(g.y, d.y);
|
|
3531
3616
|
}
|
|
3532
|
-
function
|
|
3617
|
+
function F(g) {
|
|
3533
3618
|
return g > 0 ? 1 : g < 0 ? -1 : 0;
|
|
3534
3619
|
}
|
|
3535
3620
|
function X(g, x) {
|
|
3536
|
-
var
|
|
3621
|
+
var d = g;
|
|
3537
3622
|
do {
|
|
3538
|
-
if (
|
|
3539
|
-
|
|
3540
|
-
} while (
|
|
3623
|
+
if (d.i !== g.i && d.next.i !== g.i && d.i !== x.i && d.next.i !== x.i && T(d, d.next, g, x)) return !0;
|
|
3624
|
+
d = d.next;
|
|
3625
|
+
} while (d !== g);
|
|
3541
3626
|
return !1;
|
|
3542
3627
|
}
|
|
3543
|
-
function
|
|
3544
|
-
return
|
|
3628
|
+
function z(g, x) {
|
|
3629
|
+
return L(g.prev, g, g.next) < 0 ? L(g, x, g.next) >= 0 && L(g, g.prev, x) >= 0 : L(g, x, g.prev) < 0 || L(g, g.next, x) < 0;
|
|
3545
3630
|
}
|
|
3546
3631
|
function Y(g, x) {
|
|
3547
|
-
var
|
|
3632
|
+
var d = g, w = !1, m = (g.x + x.x) / 2, b = (g.y + x.y) / 2;
|
|
3548
3633
|
do
|
|
3549
|
-
|
|
3550
|
-
while (
|
|
3551
|
-
return
|
|
3634
|
+
d.y > b != d.next.y > b && d.next.y !== d.y && m < (d.next.x - d.x) * (b - d.y) / (d.next.y - d.y) + d.x && (w = !w), d = d.next;
|
|
3635
|
+
while (d !== g);
|
|
3636
|
+
return w;
|
|
3552
3637
|
}
|
|
3553
3638
|
function tt(g, x) {
|
|
3554
|
-
var
|
|
3555
|
-
return g.next = x, x.prev = g,
|
|
3639
|
+
var d = new K(g.i, g.x, g.y), w = new K(x.i, x.x, x.y), m = g.next, b = x.prev;
|
|
3640
|
+
return g.next = x, x.prev = g, d.next = m, m.prev = d, w.next = d, d.prev = w, b.next = w, w.prev = b, w;
|
|
3556
3641
|
}
|
|
3557
|
-
function et(g, x,
|
|
3558
|
-
var
|
|
3559
|
-
return
|
|
3642
|
+
function et(g, x, d, w) {
|
|
3643
|
+
var m = new K(g, x, d);
|
|
3644
|
+
return w ? (m.next = w.next, m.prev = w, w.next.prev = m, w.next = m) : (m.prev = m, m.next = m), m;
|
|
3560
3645
|
}
|
|
3561
3646
|
function nt(g) {
|
|
3562
3647
|
g.next.prev = g.prev, g.prev.next = g.next, g.prevZ && (g.prevZ.nextZ = g.nextZ), g.nextZ && (g.nextZ.prevZ = g.prevZ);
|
|
3563
3648
|
}
|
|
3564
|
-
function K(g, x,
|
|
3565
|
-
this.i = g, this.x = x, this.y =
|
|
3649
|
+
function K(g, x, d) {
|
|
3650
|
+
this.i = g, this.x = x, this.y = d, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1;
|
|
3566
3651
|
}
|
|
3567
|
-
n.deviation = function(g, x,
|
|
3568
|
-
var
|
|
3569
|
-
if (
|
|
3570
|
-
for (var
|
|
3571
|
-
var _ = x[
|
|
3572
|
-
A -= Math.abs(
|
|
3652
|
+
n.deviation = function(g, x, d, w) {
|
|
3653
|
+
var m = x && x.length, b = m ? x[0] * d : g.length, A = Math.abs(Bt(g, 0, b, d));
|
|
3654
|
+
if (m)
|
|
3655
|
+
for (var C = 0, N = x.length; C < N; C++) {
|
|
3656
|
+
var _ = x[C] * d, $ = C < N - 1 ? x[C + 1] * d : g.length;
|
|
3657
|
+
A -= Math.abs(Bt(g, _, $, d));
|
|
3573
3658
|
}
|
|
3574
|
-
var
|
|
3575
|
-
for (
|
|
3576
|
-
var B =
|
|
3577
|
-
|
|
3578
|
-
(g[B] - g[
|
|
3659
|
+
var j = 0;
|
|
3660
|
+
for (C = 0; C < w.length; C += 3) {
|
|
3661
|
+
var B = w[C] * d, V = w[C + 1] * d, H = w[C + 2] * d;
|
|
3662
|
+
j += Math.abs(
|
|
3663
|
+
(g[B] - g[H]) * (g[V + 1] - g[B + 1]) - (g[B] - g[V]) * (g[H + 1] - g[B + 1])
|
|
3579
3664
|
);
|
|
3580
3665
|
}
|
|
3581
|
-
return A === 0 &&
|
|
3666
|
+
return A === 0 && j === 0 ? 0 : Math.abs((j - A) / A);
|
|
3582
3667
|
};
|
|
3583
|
-
function
|
|
3584
|
-
for (var
|
|
3585
|
-
|
|
3586
|
-
return
|
|
3668
|
+
function Bt(g, x, d, w) {
|
|
3669
|
+
for (var m = 0, b = x, A = d - w; b < d; b += w)
|
|
3670
|
+
m += (g[A] - g[b]) * (g[b + 1] + g[A + 1]), A = b;
|
|
3671
|
+
return m;
|
|
3587
3672
|
}
|
|
3588
3673
|
return n.flatten = function(g) {
|
|
3589
|
-
for (var x = g[0][0].length,
|
|
3590
|
-
for (var b = 0; b < g[
|
|
3591
|
-
for (var A = 0; A < x; A++)
|
|
3592
|
-
|
|
3674
|
+
for (var x = g[0][0].length, d = { vertices: [], holes: [], dimensions: x }, w = 0, m = 0; m < g.length; m++) {
|
|
3675
|
+
for (var b = 0; b < g[m].length; b++)
|
|
3676
|
+
for (var A = 0; A < x; A++) d.vertices.push(g[m][b][A]);
|
|
3677
|
+
m > 0 && (w += g[m - 1].length, d.holes.push(w));
|
|
3593
3678
|
}
|
|
3594
|
-
return
|
|
3595
|
-
},
|
|
3679
|
+
return d;
|
|
3680
|
+
}, _t.exports;
|
|
3596
3681
|
}
|
|
3597
|
-
|
|
3598
|
-
function
|
|
3682
|
+
kn();
|
|
3683
|
+
function re(n, e) {
|
|
3599
3684
|
return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
|
|
3600
3685
|
}
|
|
3601
|
-
function
|
|
3602
|
-
return n.length === 1 && (n =
|
|
3686
|
+
function In(n) {
|
|
3687
|
+
return n.length === 1 && (n = _n(n)), {
|
|
3603
3688
|
left: function(e, t, o, i) {
|
|
3604
3689
|
for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
|
|
3605
3690
|
var a = o + i >>> 1;
|
|
@@ -3616,20 +3701,20 @@ function An(n) {
|
|
|
3616
3701
|
}
|
|
3617
3702
|
};
|
|
3618
3703
|
}
|
|
3619
|
-
function
|
|
3704
|
+
function _n(n) {
|
|
3620
3705
|
return function(e, t) {
|
|
3621
|
-
return
|
|
3706
|
+
return re(n(e), t);
|
|
3622
3707
|
};
|
|
3623
3708
|
}
|
|
3624
|
-
|
|
3625
|
-
function
|
|
3626
|
-
const o =
|
|
3709
|
+
In(re);
|
|
3710
|
+
function e2(n, e, t = 3) {
|
|
3711
|
+
const o = En(n, e, { maxSegmentLength: t });
|
|
3627
3712
|
return {
|
|
3628
3713
|
check: (i) => typeof i == "string",
|
|
3629
3714
|
interpolate: (i, a, s) => o(s)
|
|
3630
3715
|
};
|
|
3631
3716
|
}
|
|
3632
|
-
function
|
|
3717
|
+
function n2(n) {
|
|
3633
3718
|
const e = (o) => n.width * o, t = (o) => n.height * o;
|
|
3634
3719
|
return {
|
|
3635
3720
|
scaleX: e,
|
|
@@ -3640,7 +3725,7 @@ function Xn(n) {
|
|
|
3640
3725
|
})
|
|
3641
3726
|
};
|
|
3642
3727
|
}
|
|
3643
|
-
function
|
|
3728
|
+
function r2(n) {
|
|
3644
3729
|
const e = [];
|
|
3645
3730
|
if (n.isAllKey) {
|
|
3646
3731
|
for (let t = 0; t <= n.animations.length; t++)
|
|
@@ -3654,47 +3739,47 @@ function Gn(n) {
|
|
|
3654
3739
|
export {
|
|
3655
3740
|
xt as Alignment,
|
|
3656
3741
|
ot as Anchor,
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3742
|
+
s0 as Animate,
|
|
3743
|
+
zn as Arrow,
|
|
3744
|
+
Zn as BrowserCanvasRenderer,
|
|
3745
|
+
jn as Circle,
|
|
3661
3746
|
G as Color,
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3747
|
+
o0 as Easing,
|
|
3748
|
+
Nn as FadeIn,
|
|
3749
|
+
Rn as FadeOut,
|
|
3750
|
+
_e as FontStyle,
|
|
3751
|
+
Ne as FontWeight,
|
|
3752
|
+
Hn as Grid,
|
|
3753
|
+
g0 as Group,
|
|
3754
|
+
Fn as Hide,
|
|
3755
|
+
Dn as IFrame,
|
|
3756
|
+
Un as Image,
|
|
3757
|
+
$n as Line,
|
|
3758
|
+
Yn as Mask,
|
|
3674
3759
|
U as ObjectType,
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3760
|
+
t2 as Opaque,
|
|
3761
|
+
Wn as Path,
|
|
3762
|
+
Kn as Pause,
|
|
3763
|
+
Xn as Polygon,
|
|
3679
3764
|
W as Position,
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3765
|
+
Ve as Presentation,
|
|
3766
|
+
Gn as Rectangle,
|
|
3767
|
+
Vn as SVG,
|
|
3768
|
+
qn as ScreenCapture,
|
|
3769
|
+
Bn as Show,
|
|
3685
3770
|
at as Size,
|
|
3686
|
-
|
|
3771
|
+
Qn as Slide,
|
|
3687
3772
|
lt as SlideObject,
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3773
|
+
q0 as SlideWebExtra,
|
|
3774
|
+
De as Text,
|
|
3775
|
+
Jn as TextUnit,
|
|
3776
|
+
Ie as Transparent,
|
|
3777
|
+
D0 as Update,
|
|
3778
|
+
r2 as getKeySlideBuildIndices,
|
|
3779
|
+
n2 as getSizingFunctions,
|
|
3780
|
+
e2 as getSmoothPathInterpolator,
|
|
3781
|
+
Be as getTextContentLength,
|
|
3782
|
+
Qe as interpolateColor,
|
|
3783
|
+
t1 as interpolateNumber
|
|
3699
3784
|
};
|
|
3700
3785
|
//# sourceMappingURL=presenter.mjs.map
|