presenter 0.7.1 → 0.7.3
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/export/image-renderer/types/ImageRendererProps.d.ts +1 -2
- package/dist/export/pdf-renderer/types/PDFRendererProps.d.ts +1 -2
- package/dist/export/powerpoint-renderer/objects/renderSvg.d.ts +3 -0
- package/dist/export/powerpoint-renderer/types/PowerPointRendererProps.d.ts +1 -2
- package/dist/export/powerpoint-renderer/utils/defaultObjectRenderers.d.ts +1 -6
- package/dist/export.js +30 -29
- package/dist/export.js.map +1 -0
- package/dist/export.mjs +933 -846
- package/dist/export.mjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/objects/SVG.d.ts +13 -0
- package/dist/presenter.js +3 -2
- package/dist/presenter.js.map +1 -0
- package/dist/presenter.mjs +742 -662
- package/dist/presenter.mjs.map +1 -0
- package/dist/renderer/browser-canvas/objects/renderSvg.d.ts +3 -0
- package/dist/renderer/browser-canvas/utils/defaultObjectRenderers.d.ts +1 -6
- package/dist/types/ObjectType.d.ts +1 -0
- package/dist/utils/interpolate/defaultInterpolators.d.ts +1 -1
- package/dist/utils/interpolate/interpolate.d.ts +1 -1
- package/dist/utils/presentation/getSvgImageUrlById.d.ts +7 -0
- package/package.json +5 -4
package/dist/presenter.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var I = (n, e, t) =>
|
|
1
|
+
var jt = Object.defineProperty;
|
|
2
|
+
var zt = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var I = (n, e, t) => zt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
const u0 = {
|
|
5
5
|
/** Represents an animated change in an object's properties. */
|
|
6
6
|
ANIMATE: "Animate",
|
|
@@ -12,10 +12,10 @@ const u0 = {
|
|
|
12
12
|
function Ut(n) {
|
|
13
13
|
return n * n * n;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Ht(n) {
|
|
16
16
|
return --n * n * n + 1;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Gt(n) {
|
|
19
19
|
return ((n *= 2) <= 1 ? n * n * n : (n -= 2) * n * n + 2) / 2;
|
|
20
20
|
}
|
|
21
21
|
var J0 = 1.70158;
|
|
@@ -42,9 +42,9 @@ var $t = (function n(e) {
|
|
|
42
42
|
})(J0);
|
|
43
43
|
const tt = {
|
|
44
44
|
LINEAR: (n) => n,
|
|
45
|
-
CUBIC:
|
|
45
|
+
CUBIC: Gt,
|
|
46
46
|
CUBIC_IN: Ut,
|
|
47
|
-
CUBIC_OUT:
|
|
47
|
+
CUBIC_OUT: Ht,
|
|
48
48
|
BACK_IN_OUT: $t.overshoot(0.8)
|
|
49
49
|
}, Wt = tt.LINEAR;
|
|
50
50
|
function et(n, e, t = {}) {
|
|
@@ -62,14 +62,14 @@ function et(n, e, t = {}) {
|
|
|
62
62
|
...typeof t == "number" ? { duration: t } : t
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function cn(n, e = {}) {
|
|
66
66
|
return et(n, { opacity: 1 }, {
|
|
67
67
|
duration: 500,
|
|
68
68
|
easing: tt.CUBIC,
|
|
69
69
|
...typeof e == "number" ? { duration: e } : e
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function un(n, e = {}) {
|
|
73
73
|
return et(n, { opacity: 0 }, {
|
|
74
74
|
duration: 500,
|
|
75
75
|
easing: tt.CUBIC,
|
|
@@ -85,10 +85,10 @@ function Ct(n, e) {
|
|
|
85
85
|
shortcut: null
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function fn(n) {
|
|
89
89
|
return Ct(n, { opacity: 0 });
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function gn(n) {
|
|
92
92
|
return Ct(n, { opacity: 1 });
|
|
93
93
|
}
|
|
94
94
|
const n0 = {
|
|
@@ -101,8 +101,8 @@ const n0 = {
|
|
|
101
101
|
BOTTOM_LEFT: "BottomLeft",
|
|
102
102
|
BOTTOM: "Bottom",
|
|
103
103
|
BOTTOM_RIGHT: "BottomRight"
|
|
104
|
-
},
|
|
105
|
-
function
|
|
104
|
+
}, o0 = n0.TOP_LEFT;
|
|
105
|
+
function W(n, e = 0, t = 0, o = 1) {
|
|
106
106
|
if (typeof n == "string") {
|
|
107
107
|
const i = n.replace("#", ""), a = parseInt(i, 16);
|
|
108
108
|
return isNaN(a) ? (console.warn("Invalid hex color format:", n), K) : i.length === 6 ? {
|
|
@@ -131,12 +131,12 @@ function Y(n, e = 0, t = 0, o = 1) {
|
|
|
131
131
|
...n
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
W.BLACK = W(0, 0, 0);
|
|
135
|
+
W.BLUE = W(0, 0, 255);
|
|
136
|
+
W.GREEN = W(0, 255, 0);
|
|
137
|
+
W.RED = W(255, 0, 0);
|
|
138
|
+
W.TRANSPARENT = W(0, 0, 0, 0);
|
|
139
|
+
W.WHITE = W(255, 255, 255);
|
|
140
140
|
const K = { red: 0, green: 0, blue: 0, alpha: 1 };
|
|
141
141
|
function Et(n = null) {
|
|
142
142
|
return {
|
|
@@ -157,15 +157,15 @@ function E0(n, e = null) {
|
|
|
157
157
|
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(St(n, e) * 255);
|
|
158
158
|
return `#${a.toString(16).padStart(6, "0")}${s !== 255 ? s.toString(16).padStart(2, "0") : ""}`;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function pn(n = null) {
|
|
161
161
|
const {
|
|
162
162
|
url: e = "https://wikipedia.org/",
|
|
163
|
-
backgroundColor: t =
|
|
163
|
+
backgroundColor: t = W.TRANSPARENT,
|
|
164
164
|
borderColor: o = K,
|
|
165
165
|
borderWidth: i = 0,
|
|
166
166
|
pointerEvents: a = "auto",
|
|
167
167
|
scale: s = 1,
|
|
168
|
-
anchor: r =
|
|
168
|
+
anchor: r = o0,
|
|
169
169
|
height: h = 1e3,
|
|
170
170
|
width: c = 1e3,
|
|
171
171
|
x: f = 0,
|
|
@@ -182,19 +182,19 @@ function fn(n = null) {
|
|
|
182
182
|
y: x
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const x0 = {
|
|
186
186
|
LEFT: "left",
|
|
187
187
|
CENTER: "center",
|
|
188
188
|
RIGHT: "right"
|
|
189
|
-
}, Yt =
|
|
190
|
-
function
|
|
189
|
+
}, Yt = x0.LEFT;
|
|
190
|
+
function r0(n, e) {
|
|
191
191
|
throw new Error("Unexpected value: " + n);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function dn(n = null) {
|
|
194
194
|
const {
|
|
195
|
-
alignment: e =
|
|
195
|
+
alignment: e = x0.LEFT,
|
|
196
196
|
scale: t = 1,
|
|
197
|
-
anchor: o =
|
|
197
|
+
anchor: o = o0,
|
|
198
198
|
height: i = 1e3,
|
|
199
199
|
width: a = 1e3,
|
|
200
200
|
x: s = 0,
|
|
@@ -203,17 +203,17 @@ function gn(n = null) {
|
|
|
203
203
|
function h(c) {
|
|
204
204
|
const f = document.createElement("video");
|
|
205
205
|
switch (f.autoplay = !0, f.style.transform = `scale(${t})`, e) {
|
|
206
|
-
case
|
|
206
|
+
case x0.LEFT:
|
|
207
207
|
f.style.transformOrigin = "top left";
|
|
208
208
|
break;
|
|
209
|
-
case
|
|
209
|
+
case x0.CENTER:
|
|
210
210
|
f.style.transformOrigin = "top center";
|
|
211
211
|
break;
|
|
212
|
-
case
|
|
212
|
+
case x0.RIGHT:
|
|
213
213
|
f.style.transformOrigin = "top right";
|
|
214
214
|
break;
|
|
215
215
|
default:
|
|
216
|
-
|
|
216
|
+
r0(e);
|
|
217
217
|
}
|
|
218
218
|
c.appendChild(f);
|
|
219
219
|
const x = {
|
|
@@ -243,7 +243,7 @@ function gn(n = null) {
|
|
|
243
243
|
y: r
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
const
|
|
246
|
+
const j = {
|
|
247
247
|
ARROW: "Arrow",
|
|
248
248
|
CIRCLE: "Circle",
|
|
249
249
|
GROUP: "Group",
|
|
@@ -254,19 +254,20 @@ const H = {
|
|
|
254
254
|
POLYGON: "Polygon",
|
|
255
255
|
RECTANGLE: "Rectangle",
|
|
256
256
|
SLIDE_OBJECT: "SlideObject",
|
|
257
|
+
SVG: "SVG",
|
|
257
258
|
TEXT: "Text"
|
|
258
259
|
};
|
|
259
|
-
function
|
|
260
|
+
function s0(n) {
|
|
260
261
|
return {
|
|
261
|
-
objectType:
|
|
262
|
+
objectType: j.SLIDE_OBJECT,
|
|
262
263
|
opacity: 1,
|
|
263
264
|
...n
|
|
264
265
|
};
|
|
265
266
|
}
|
|
266
|
-
function
|
|
267
|
+
function xn(n = null) {
|
|
267
268
|
const { arrowheadSize: e, width: t = 10, ...o } = n || {}, i = e ?? t * 4;
|
|
268
|
-
return
|
|
269
|
-
objectType:
|
|
269
|
+
return s0({
|
|
270
|
+
objectType: j.ARROW,
|
|
270
271
|
arrowheadSize: i,
|
|
271
272
|
color: K,
|
|
272
273
|
drawn: 1,
|
|
@@ -282,10 +283,10 @@ function pn(n = null) {
|
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
285
|
const Xt = 50;
|
|
285
|
-
function
|
|
286
|
-
return
|
|
287
|
-
objectType:
|
|
288
|
-
anchor:
|
|
286
|
+
function yn(n = null) {
|
|
287
|
+
return s0({
|
|
288
|
+
objectType: j.CIRCLE,
|
|
289
|
+
anchor: o0,
|
|
289
290
|
borderColor: K,
|
|
290
291
|
borderWidth: 0,
|
|
291
292
|
drawn: 1,
|
|
@@ -297,9 +298,9 @@ function dn(n = null) {
|
|
|
297
298
|
});
|
|
298
299
|
}
|
|
299
300
|
function st(n, e = null) {
|
|
300
|
-
return
|
|
301
|
-
objectType:
|
|
302
|
-
anchor:
|
|
301
|
+
return s0({
|
|
302
|
+
objectType: j.GROUP,
|
|
303
|
+
anchor: o0,
|
|
303
304
|
height: 0,
|
|
304
305
|
objects: n,
|
|
305
306
|
previewColor: null,
|
|
@@ -314,9 +315,9 @@ function st(n, e = null) {
|
|
|
314
315
|
...e
|
|
315
316
|
});
|
|
316
317
|
}
|
|
317
|
-
function
|
|
318
|
+
function vn(n) {
|
|
318
319
|
const {
|
|
319
|
-
anchor: e =
|
|
320
|
+
anchor: e = o0,
|
|
320
321
|
cols: t = 1,
|
|
321
322
|
rows: o = 1,
|
|
322
323
|
gapX: i = 0,
|
|
@@ -327,7 +328,7 @@ function xn(n) {
|
|
|
327
328
|
y: c = 0,
|
|
328
329
|
objects: f = () => null
|
|
329
330
|
} = n, x = [], l = [];
|
|
330
|
-
let u = 0,
|
|
331
|
+
let u = 0, m = 0;
|
|
331
332
|
for (let M = 0; M < o; M++) {
|
|
332
333
|
const C = [];
|
|
333
334
|
u = 0;
|
|
@@ -337,27 +338,27 @@ function xn(n) {
|
|
|
337
338
|
C.push(S), S != null && l.push(
|
|
338
339
|
st([S], {
|
|
339
340
|
x: u,
|
|
340
|
-
y:
|
|
341
|
+
y: m
|
|
341
342
|
})
|
|
342
343
|
), u += P + i, E = Math.max(E, F);
|
|
343
344
|
}
|
|
344
|
-
x.push(C),
|
|
345
|
+
x.push(C), m += E + a;
|
|
345
346
|
}
|
|
346
347
|
return {
|
|
347
348
|
grid: st(l, {
|
|
348
349
|
x: h,
|
|
349
350
|
y: c,
|
|
350
|
-
height:
|
|
351
|
+
height: m - a,
|
|
351
352
|
width: u - i,
|
|
352
353
|
anchor: e
|
|
353
354
|
}),
|
|
354
355
|
objects: x
|
|
355
356
|
};
|
|
356
357
|
}
|
|
357
|
-
function
|
|
358
|
-
return
|
|
359
|
-
objectType:
|
|
360
|
-
anchor:
|
|
358
|
+
function wn(n = null) {
|
|
359
|
+
return s0({
|
|
360
|
+
objectType: j.IMAGE,
|
|
361
|
+
anchor: o0,
|
|
361
362
|
height: 100,
|
|
362
363
|
imageId: "",
|
|
363
364
|
rounding: 0,
|
|
@@ -368,9 +369,9 @@ function yn(n = null) {
|
|
|
368
369
|
...n
|
|
369
370
|
});
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
-
return
|
|
373
|
-
objectType:
|
|
372
|
+
function mn(n = null) {
|
|
373
|
+
return s0({
|
|
374
|
+
objectType: j.LINE,
|
|
374
375
|
color: K,
|
|
375
376
|
drawn: 1,
|
|
376
377
|
endX: 100,
|
|
@@ -383,10 +384,10 @@ function vn(n = null) {
|
|
|
383
384
|
...n
|
|
384
385
|
});
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
-
return
|
|
388
|
-
objectType:
|
|
389
|
-
anchor:
|
|
387
|
+
function An(n, e = null) {
|
|
388
|
+
return s0({
|
|
389
|
+
objectType: j.MASK,
|
|
390
|
+
anchor: o0,
|
|
390
391
|
height: 100,
|
|
391
392
|
objects: n,
|
|
392
393
|
preview: !1,
|
|
@@ -396,11 +397,11 @@ function wn(n, e = null) {
|
|
|
396
397
|
...e
|
|
397
398
|
});
|
|
398
399
|
}
|
|
399
|
-
var
|
|
400
|
-
const e = (n && n.length > 0 ? n : "M0,0").match(
|
|
400
|
+
var Zt = Object.defineProperty, k = (n, e) => Zt(n, "name", { value: e, configurable: !0 }), P0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Vt = /([astvzqmhlc])([^astvzqmhlc]*)/gi, Kt = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, Qt = k((n) => {
|
|
401
|
+
const e = (n && n.length > 0 ? n : "M0,0").match(Vt);
|
|
401
402
|
if (!e) throw new Error(`No path elements found in string ${n}`);
|
|
402
403
|
return e.reduce((t, o) => {
|
|
403
|
-
let i = o.charAt(0), a = i.toLowerCase(), s =
|
|
404
|
+
let i = o.charAt(0), a = i.toLowerCase(), s = Jt(o.substring(1));
|
|
404
405
|
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)) {
|
|
405
406
|
const r = o.substring(1).trim().split(" ");
|
|
406
407
|
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])];
|
|
@@ -415,10 +416,10 @@ var Gt = Object.defineProperty, k = (n, e) => Gt(n, "name", { value: e, configur
|
|
|
415
416
|
}
|
|
416
417
|
return t;
|
|
417
418
|
}, []);
|
|
418
|
-
}, "default"),
|
|
419
|
+
}, "default"), Jt = k((n) => {
|
|
419
420
|
const e = n.match(Kt);
|
|
420
421
|
return e ? e.map(Number) : [];
|
|
421
|
-
}, "parseValues"), w0,
|
|
422
|
+
}, "parseValues"), w0, Q = (w0 = class {
|
|
422
423
|
constructor(e, t, o, i) {
|
|
423
424
|
I(this, "x0");
|
|
424
425
|
I(this, "x1");
|
|
@@ -441,7 +442,7 @@ var Gt = Object.defineProperty, k = (n, e) => Gt(n, "name", { value: e, configur
|
|
|
441
442
|
}, "getPropertiesAtLength"));
|
|
442
443
|
this.x0 = e, this.x1 = t, this.y0 = o, this.y1 = i;
|
|
443
444
|
}
|
|
444
|
-
}, k(w0, "LinearPosition"), w0),
|
|
445
|
+
}, k(w0, "LinearPosition"), w0), m0, at = (m0 = class {
|
|
445
446
|
constructor(e, t, o, i, a, s, r, h, c) {
|
|
446
447
|
I(this, "x0");
|
|
447
448
|
I(this, "y0");
|
|
@@ -472,51 +473,51 @@ var Gt = Object.defineProperty, k = (n, e) => Gt(n, "name", { value: e, configur
|
|
|
472
473
|
return { x: o.x, y: o.y, tangentX: t.x, tangentY: t.y };
|
|
473
474
|
}, "getPropertiesAtLength"));
|
|
474
475
|
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;
|
|
475
|
-
const f =
|
|
476
|
+
const f = t1(300, function(x) {
|
|
476
477
|
return ht({ x: e, y: t }, o, i, a, s, r, { x: h, y: c }, x);
|
|
477
478
|
});
|
|
478
479
|
this.length = f.arcLength;
|
|
479
480
|
}
|
|
480
|
-
}, k(
|
|
481
|
-
e = Math.abs(e), t = Math.abs(t), o =
|
|
482
|
-
const h =
|
|
481
|
+
}, k(m0, "Arc"), m0), ht = k((n, e, t, o, i, a, s, r) => {
|
|
482
|
+
e = Math.abs(e), t = Math.abs(t), o = e1(o, 360);
|
|
483
|
+
const h = n1(o);
|
|
483
484
|
if (n.x === s.x && n.y === s.y) return { x: n.x, y: n.y, ellipticalArcAngle: 0 };
|
|
484
485
|
if (e === 0 || t === 0) return { x: 0, y: 0, ellipticalArcAngle: 0 };
|
|
485
486
|
const c = (n.x - s.x) / 2, f = (n.y - s.y) / 2, x = { x: Math.cos(h) * c + Math.sin(h) * f, y: -Math.sin(h) * c + Math.cos(h) * f }, l = Math.pow(x.x, 2) / Math.pow(e, 2) + Math.pow(x.y, 2) / Math.pow(t, 2);
|
|
486
487
|
l > 1 && (e = Math.sqrt(l) * e, t = Math.sqrt(l) * t);
|
|
487
488
|
let u = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(x.y, 2) - Math.pow(t, 2) * Math.pow(x.x, 2)) / (Math.pow(e, 2) * Math.pow(x.y, 2) + Math.pow(t, 2) * Math.pow(x.x, 2));
|
|
488
489
|
u = u < 0 ? 0 : u;
|
|
489
|
-
const
|
|
490
|
+
const m = (i !== a ? 1 : -1) * Math.sqrt(u), y = m * (e * x.y / t), M = m * (-t * x.x / e), C = { 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: (x.x - y) / e, y: (x.y - M) / t }, L = ct({ x: 1, y: 0 }, E);
|
|
490
491
|
let S = ct(E, { x: (-x.x - y) / e, y: (-x.y - M) / t });
|
|
491
492
|
!a && S > 0 ? S -= 2 * Math.PI : a && S < 0 && (S += 2 * Math.PI), S %= 2 * Math.PI;
|
|
492
|
-
const P = L + S * r, F = e * Math.cos(P),
|
|
493
|
-
return { x: Math.cos(h) * F - Math.sin(h) *
|
|
494
|
-
}, "pointOnEllipticalArc"),
|
|
493
|
+
const P = L + S * r, F = e * Math.cos(P), H = t * Math.sin(P);
|
|
494
|
+
return { x: Math.cos(h) * F - Math.sin(h) * H + C.x, y: Math.sin(h) * F + Math.cos(h) * H + C.y, ellipticalArcStartAngle: L, ellipticalArcEndAngle: L + S, ellipticalArcAngle: P, ellipticalArcCenter: C, resultantRx: e, resultantRy: t };
|
|
495
|
+
}, "pointOnEllipticalArc"), t1 = k((n, e) => {
|
|
495
496
|
n = n ?? 500;
|
|
496
497
|
let t = 0;
|
|
497
498
|
const o = [], i = [];
|
|
498
499
|
let a, s = e(0);
|
|
499
500
|
for (let r = 0; r < n; r++) {
|
|
500
|
-
const h =
|
|
501
|
+
const h = r1(r * (1 / n), 0, 1);
|
|
501
502
|
a = e(h), t += lt(s, a), i.push([s, a]), o.push({ t: h, arcLength: t }), s = a;
|
|
502
503
|
}
|
|
503
504
|
return a = e(1), i.push([s, a]), t += lt(s, a), o.push({ t: 1, arcLength: t }), { arcLength: t, arcLengthMap: o, approximationLines: i };
|
|
504
|
-
}, "approximateArcLengthOfCurve"),
|
|
505
|
+
}, "approximateArcLengthOfCurve"), e1 = k((n, e) => (n % e + e) % e, "mod"), n1 = k((n) => n * (Math.PI / 180), "toRadians"), lt = k((n, e) => Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2)), "distance"), r1 = k((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), ct = k((n, e) => {
|
|
505
506
|
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)));
|
|
506
507
|
return (n.x * e.y - n.y * e.x < 0 ? -1 : 1) * Math.acos(t / o);
|
|
507
|
-
}, "angleBetween"), r1 = [[], [], [-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]], i1 = [[], [], [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]], o1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], s1 = k((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"), a1 = k((n, e, t) => It([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"), h1 = k((n, e, t) => {
|
|
508
|
+
}, "angleBetween"), i1 = [[], [], [-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]], o1 = [[], [], [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]], s1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], a1 = k((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"), h1 = k((n, e, t) => It([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"), l1 = k((n, e, t) => {
|
|
508
509
|
let o, i;
|
|
509
510
|
const a = t / 2;
|
|
510
511
|
o = 0;
|
|
511
|
-
for (let s = 0; s < 20; s++) i = a *
|
|
512
|
+
for (let s = 0; s < 20; s++) i = a * i1[20][s] + a, o += o1[20][s] * _t(n, e, i);
|
|
512
513
|
return a * o;
|
|
513
|
-
}, "getCubicArcLength"), It = k((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"),
|
|
514
|
+
}, "getCubicArcLength"), It = k((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"), c1 = k((n, e, t) => {
|
|
514
515
|
t === void 0 && (t = 1);
|
|
515
516
|
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;
|
|
516
517
|
if (r === 0) return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
517
|
-
const f = h / (2 * r), x = t + f, l = c / r - f * f, u = x * x + l > 0 ? Math.sqrt(x * x + l) : 0,
|
|
518
|
-
return Math.sqrt(r) / 2 * (x * u - f *
|
|
519
|
-
}, "getQuadraticArcLength"),
|
|
518
|
+
const f = h / (2 * r), x = t + f, l = c / r - f * f, u = x * x + l > 0 ? Math.sqrt(x * x + l) : 0, m = f * f + l > 0 ? Math.sqrt(f * f + l) : 0, y = f + Math.sqrt(f * f + l) !== 0 && (x + u) / (f + m) !== 0 ? l * Math.log(Math.abs((x + u) / (f + m))) : 0;
|
|
519
|
+
return Math.sqrt(r) / 2 * (x * u - f * m + y);
|
|
520
|
+
}, "getQuadraticArcLength"), u1 = k((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");
|
|
520
521
|
function _t(n, e, t) {
|
|
521
522
|
const o = Y0(1, t, n), i = Y0(1, t, e), a = o * o + i * i;
|
|
522
523
|
return Math.sqrt(a);
|
|
@@ -528,13 +529,13 @@ var Y0 = k((n, e, t) => {
|
|
|
528
529
|
if (o === 0) return 0;
|
|
529
530
|
if (n === 0) {
|
|
530
531
|
a = 0;
|
|
531
|
-
for (let s = 0; s <= o; s++) a +=
|
|
532
|
+
for (let s = 0; s <= o; s++) a += s1[o][s] * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
532
533
|
return a;
|
|
533
534
|
}
|
|
534
535
|
i = new Array(o);
|
|
535
536
|
for (let s = 0; s < o; s++) i[s] = o * (t[s + 1] - t[s]);
|
|
536
537
|
return Y0(n - 1, e, i);
|
|
537
|
-
}, "getDerivative"),
|
|
538
|
+
}, "getDerivative"), R0 = k((n, e, t) => {
|
|
538
539
|
let o = 1, i = n / e, a = (n - t(i)) / e, s = 0;
|
|
539
540
|
for (; o > 1e-3; ) {
|
|
540
541
|
const r = t(i + a), h = Math.abs(n - r) / e;
|
|
@@ -546,7 +547,7 @@ var Y0 = k((n, e, t) => {
|
|
|
546
547
|
if (s++, s > 500) break;
|
|
547
548
|
}
|
|
548
549
|
return i;
|
|
549
|
-
}, "t2length"),
|
|
550
|
+
}, "t2length"), A0, h0 = (A0 = class {
|
|
550
551
|
constructor(e, t, o, i, a, s, r, h) {
|
|
551
552
|
I(this, "a");
|
|
552
553
|
I(this, "b");
|
|
@@ -558,16 +559,16 @@ var Y0 = k((n, e, t) => {
|
|
|
558
559
|
I(this, "getDerivative");
|
|
559
560
|
I(this, "getTotalLength", k(() => this.length, "getTotalLength"));
|
|
560
561
|
I(this, "getPointAtLength", k((e) => {
|
|
561
|
-
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
|
+
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 = R0(e, this.length, (a) => this.getArcLength(t, o, a));
|
|
562
563
|
return this.getPoint(t, o, i);
|
|
563
564
|
}, "getPointAtLength"));
|
|
564
565
|
I(this, "getTangentAtLength", k((e) => {
|
|
565
|
-
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 =
|
|
566
|
+
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 = R0(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);
|
|
566
567
|
let r;
|
|
567
568
|
return r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 }, r;
|
|
568
569
|
}, "getTangentAtLength"));
|
|
569
570
|
I(this, "getPropertiesAtLength", k((e) => {
|
|
570
|
-
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 =
|
|
571
|
+
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 = R0(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);
|
|
571
572
|
let r;
|
|
572
573
|
r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 };
|
|
573
574
|
const h = this.getPoint(t, o, i);
|
|
@@ -575,9 +576,9 @@ var Y0 = k((n, e, t) => {
|
|
|
575
576
|
}, "getPropertiesAtLength"));
|
|
576
577
|
I(this, "getC", k(() => this.c, "getC"));
|
|
577
578
|
I(this, "getD", k(() => this.d, "getD"));
|
|
578
|
-
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 =
|
|
579
|
+
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 = l1, this.getPoint = a1, this.getDerivative = h1, this.d = { x: r, y: h }) : (this.getArcLength = c1, this.getPoint = It, this.getDerivative = u1, 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);
|
|
579
580
|
}
|
|
580
|
-
}, k(
|
|
581
|
+
}, k(A0, "Bezier"), A0), b0, f1 = (b0 = class {
|
|
581
582
|
constructor(e) {
|
|
582
583
|
I(this, "length", 0);
|
|
583
584
|
I(this, "partial_lengths", []);
|
|
@@ -617,60 +618,60 @@ var Y0 = k((n, e, t) => {
|
|
|
617
618
|
}
|
|
618
619
|
return e;
|
|
619
620
|
}, "getParts"));
|
|
620
|
-
const t = Array.isArray(e) ? e :
|
|
621
|
+
const t = Array.isArray(e) ? e : Qt(e);
|
|
621
622
|
let o, i = [0, 0], a = [0, 0], s = [0, 0];
|
|
622
623
|
for (let r = 0; r < t.length; r++) {
|
|
623
624
|
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] });
|
|
624
625
|
else if (t[r][0] === "m") i = [t[r][1] + i[0], t[r][2] + i[1]], s = [i[0], i[1]], this.functions.push(null);
|
|
625
|
-
else if (t[r][0] === "L") this.length += Math.sqrt(Math.pow(i[0] - t[r][1], 2) + Math.pow(i[1] - t[r][2], 2)), this.functions.push(new
|
|
626
|
-
else if (t[r][0] === "l") this.length += Math.sqrt(Math.pow(t[r][1], 2) + Math.pow(t[r][2], 2)), this.functions.push(new
|
|
627
|
-
else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new
|
|
628
|
-
else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new
|
|
629
|
-
else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new
|
|
630
|
-
else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new
|
|
631
|
-
else if (t[r][0] === "z" || t[r][0] === "Z") this.length += Math.sqrt(Math.pow(s[0] - i[0], 2) + Math.pow(s[1] - i[1], 2)), this.functions.push(new
|
|
632
|
-
else if (t[r][0] === "C") o = new
|
|
633
|
-
else if (t[r][0] === "c") o = new
|
|
626
|
+
else if (t[r][0] === "L") this.length += Math.sqrt(Math.pow(i[0] - t[r][1], 2) + Math.pow(i[1] - t[r][2], 2)), this.functions.push(new Q(i[0], t[r][1], i[1], t[r][2])), i = [t[r][1], t[r][2]];
|
|
627
|
+
else if (t[r][0] === "l") this.length += Math.sqrt(Math.pow(t[r][1], 2) + Math.pow(t[r][2], 2)), this.functions.push(new Q(i[0], t[r][1] + i[0], i[1], t[r][2] + i[1])), i = [t[r][1] + i[0], t[r][2] + i[1]];
|
|
628
|
+
else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new Q(i[0], t[r][1], i[1], i[1])), i[0] = t[r][1];
|
|
629
|
+
else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new Q(i[0], i[0] + t[r][1], i[1], i[1])), i[0] = t[r][1] + i[0];
|
|
630
|
+
else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new Q(i[0], i[0], i[1], t[r][1])), i[1] = t[r][1];
|
|
631
|
+
else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new Q(i[0], i[0], i[1], i[1] + t[r][1])), i[1] = t[r][1] + i[1];
|
|
632
|
+
else if (t[r][0] === "z" || t[r][0] === "Z") this.length += Math.sqrt(Math.pow(s[0] - i[0], 2) + Math.pow(s[1] - i[1], 2)), this.functions.push(new Q(i[0], s[0], i[1], s[1])), i = [s[0], s[1]];
|
|
633
|
+
else if (t[r][0] === "C") o = new h0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4], t[r][5], t[r][6]), this.length += o.getTotalLength(), i = [t[r][5], t[r][6]], this.functions.push(o);
|
|
634
|
+
else if (t[r][0] === "c") o = new h0(i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4], i[0] + t[r][5], i[1] + t[r][6]), o.getTotalLength() > 0 ? (this.length += o.getTotalLength(), this.functions.push(o), i = [t[r][5] + i[0], t[r][6] + i[1]]) : this.functions.push(new Q(i[0], i[0], i[1], i[1]));
|
|
634
635
|
else if (t[r][0] === "S") {
|
|
635
636
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
636
637
|
if (o) {
|
|
637
638
|
const h = o.getC();
|
|
638
|
-
o = new
|
|
639
|
+
o = new h0(i[0], i[1], 2 * i[0] - h.x, 2 * i[1] - h.y, t[r][1], t[r][2], t[r][3], t[r][4]);
|
|
639
640
|
}
|
|
640
|
-
} else o = new
|
|
641
|
+
} else o = new h0(i[0], i[1], i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4]);
|
|
641
642
|
o && (this.length += o.getTotalLength(), i = [t[r][3], t[r][4]], this.functions.push(o));
|
|
642
643
|
} else if (t[r][0] === "s") {
|
|
643
644
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
644
645
|
if (o) {
|
|
645
646
|
const h = o.getC(), c = o.getD();
|
|
646
|
-
o = new
|
|
647
|
+
o = new h0(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]);
|
|
647
648
|
}
|
|
648
|
-
} else o = new
|
|
649
|
+
} else o = new h0(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]);
|
|
649
650
|
o && (this.length += o.getTotalLength(), i = [t[r][3] + i[0], t[r][4] + i[1]], this.functions.push(o));
|
|
650
651
|
} else if (t[r][0] === "Q") {
|
|
651
652
|
if (i[0] === t[r][1] && i[1] === t[r][2]) {
|
|
652
|
-
const h = new
|
|
653
|
+
const h = new Q(t[r][1], t[r][3], t[r][2], t[r][4]);
|
|
653
654
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
654
|
-
} else o = new
|
|
655
|
+
} else o = new h0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
|
|
655
656
|
i = [t[r][3], t[r][4]], a = [t[r][1], t[r][2]];
|
|
656
657
|
} else if (t[r][0] === "q") {
|
|
657
|
-
if (t[r][1] !== 0 || t[r][2] !== 0) o = new
|
|
658
|
+
if (t[r][1] !== 0 || t[r][2] !== 0) o = new h0(i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
|
|
658
659
|
else {
|
|
659
|
-
const h = new
|
|
660
|
+
const h = new Q(i[0] + t[r][1], i[0] + t[r][3], i[1] + t[r][2], i[1] + t[r][4]);
|
|
660
661
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
661
662
|
}
|
|
662
663
|
a = [i[0] + t[r][1], i[1] + t[r][2]], i = [t[r][3] + i[0], t[r][4] + i[1]];
|
|
663
664
|
} else if (t[r][0] === "T") {
|
|
664
|
-
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new
|
|
665
|
+
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new h0(i[0], i[1], 2 * i[0] - a[0], 2 * i[1] - a[1], t[r][1], t[r][2], void 0, void 0), this.functions.push(o), this.length += o.getTotalLength();
|
|
665
666
|
else {
|
|
666
|
-
const h = new
|
|
667
|
+
const h = new Q(i[0], t[r][1], i[1], t[r][2]);
|
|
667
668
|
this.functions.push(h), this.length += h.getTotalLength();
|
|
668
669
|
}
|
|
669
670
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1], t[r][2]];
|
|
670
671
|
} else if (t[r][0] === "t") {
|
|
671
|
-
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new
|
|
672
|
+
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new h0(i[0], i[1], 2 * i[0] - a[0], 2 * i[1] - a[1], i[0] + t[r][1], i[1] + t[r][2], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
|
|
672
673
|
else {
|
|
673
|
-
const h = new
|
|
674
|
+
const h = new Q(i[0], i[0] + t[r][1], i[1], i[1] + t[r][2]);
|
|
674
675
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
675
676
|
}
|
|
676
677
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1] + i[0], t[r][2] + i[1]];
|
|
@@ -692,20 +693,20 @@ var Y0 = k((n, e, t) => {
|
|
|
692
693
|
I(this, "getTangentAtLength", k((e) => this.inst.getTangentAtLength(e), "getTangentAtLength"));
|
|
693
694
|
I(this, "getPropertiesAtLength", k((e) => this.inst.getPropertiesAtLength(e), "getPropertiesAtLength"));
|
|
694
695
|
I(this, "getParts", k(() => this.inst.getParts(), "getParts"));
|
|
695
|
-
if (this.inst = new
|
|
696
|
+
if (this.inst = new f1(e), !(this instanceof X0)) return new X0(e);
|
|
696
697
|
}
|
|
697
698
|
}, k(M0, "_svgPathProperties"), M0);
|
|
698
|
-
function
|
|
699
|
+
function g1(n = W.BLACK) {
|
|
699
700
|
return { ...n, alpha: 0 };
|
|
700
701
|
}
|
|
701
|
-
function
|
|
702
|
+
function bn(n = null) {
|
|
702
703
|
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 X0(r).getTotalLength();
|
|
703
|
-
return
|
|
704
|
-
objectType:
|
|
705
|
-
anchor:
|
|
704
|
+
return s0({
|
|
705
|
+
objectType: j.PATH,
|
|
706
|
+
anchor: o0,
|
|
706
707
|
color: K,
|
|
707
708
|
drawn: 1,
|
|
708
|
-
fill:
|
|
709
|
+
fill: g1(),
|
|
709
710
|
isRounded: !1,
|
|
710
711
|
height: t,
|
|
711
712
|
path: r,
|
|
@@ -719,9 +720,9 @@ function An(n = null) {
|
|
|
719
720
|
...s
|
|
720
721
|
});
|
|
721
722
|
}
|
|
722
|
-
function
|
|
723
|
-
return
|
|
724
|
-
objectType:
|
|
723
|
+
function Mn(n = null) {
|
|
724
|
+
return s0({
|
|
725
|
+
objectType: j.POLYGON,
|
|
725
726
|
borderColor: K,
|
|
726
727
|
borderWidth: 0,
|
|
727
728
|
drawn: 1,
|
|
@@ -734,10 +735,10 @@ function mn(n = null) {
|
|
|
734
735
|
...n
|
|
735
736
|
});
|
|
736
737
|
}
|
|
737
|
-
function
|
|
738
|
-
return
|
|
739
|
-
objectType:
|
|
740
|
-
anchor:
|
|
738
|
+
function Ln(n = null) {
|
|
739
|
+
return s0({
|
|
740
|
+
objectType: j.RECTANGLE,
|
|
741
|
+
anchor: o0,
|
|
741
742
|
borderColor: K,
|
|
742
743
|
borderWidth: 0,
|
|
743
744
|
drawn: 1,
|
|
@@ -750,11 +751,23 @@ function bn(n = null) {
|
|
|
750
751
|
...n
|
|
751
752
|
});
|
|
752
753
|
}
|
|
753
|
-
|
|
754
|
+
function Tn(n = null) {
|
|
755
|
+
return s0({
|
|
756
|
+
objectType: j.SVG,
|
|
757
|
+
anchor: o0,
|
|
758
|
+
height: 100,
|
|
759
|
+
svg: "",
|
|
760
|
+
width: 100,
|
|
761
|
+
x: 0,
|
|
762
|
+
y: 0,
|
|
763
|
+
...n
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
const p1 = {
|
|
754
767
|
NORMAL: "normal",
|
|
755
768
|
ITALIC: "italic",
|
|
756
769
|
OBLIQUE: "oblique"
|
|
757
|
-
},
|
|
770
|
+
}, d1 = p1.NORMAL, x1 = {
|
|
758
771
|
THIN: 100,
|
|
759
772
|
EXTRA_LIGHT: 200,
|
|
760
773
|
LIGHT: 300,
|
|
@@ -764,41 +777,41 @@ const g1 = {
|
|
|
764
777
|
BOLD: 700,
|
|
765
778
|
EXTRA_BOLD: 800,
|
|
766
779
|
BLACK: 900
|
|
767
|
-
},
|
|
780
|
+
}, y1 = x1.NORMAL, v1 = {
|
|
768
781
|
color: K,
|
|
769
782
|
fontFamily: "sans-serif",
|
|
770
783
|
fontSize: 100,
|
|
771
|
-
fontStyle:
|
|
772
|
-
fontWeight:
|
|
784
|
+
fontStyle: d1,
|
|
785
|
+
fontWeight: y1,
|
|
773
786
|
ligatures: !1
|
|
774
787
|
};
|
|
775
788
|
function kt(n) {
|
|
776
789
|
return typeof n == "string" ? [[{ text: n }]] : n.map((e) => e.map((t) => typeof t == "string" ? { text: t } : t));
|
|
777
790
|
}
|
|
778
|
-
function
|
|
791
|
+
function w1(n) {
|
|
779
792
|
return kt(n).reduce(
|
|
780
793
|
(t, o) => t + o.reduce((i, a) => i + a.text.length, 0),
|
|
781
794
|
0
|
|
782
795
|
);
|
|
783
796
|
}
|
|
784
|
-
function
|
|
785
|
-
return
|
|
786
|
-
objectType:
|
|
797
|
+
function m1(n = "", e = null) {
|
|
798
|
+
return s0({
|
|
799
|
+
objectType: j.TEXT,
|
|
787
800
|
alignment: Yt,
|
|
788
|
-
anchor:
|
|
801
|
+
anchor: o0,
|
|
789
802
|
length: null,
|
|
790
803
|
lineSpacing: 1,
|
|
791
804
|
text: n,
|
|
792
805
|
x: 0,
|
|
793
806
|
y: 0,
|
|
794
|
-
...
|
|
807
|
+
...v1,
|
|
795
808
|
...e
|
|
796
809
|
});
|
|
797
810
|
}
|
|
798
|
-
|
|
811
|
+
m1.writeOn = (n, e = {}) => et(
|
|
799
812
|
n,
|
|
800
813
|
{
|
|
801
|
-
length:
|
|
814
|
+
length: w1(n.text)
|
|
802
815
|
},
|
|
803
816
|
e
|
|
804
817
|
);
|
|
@@ -812,45 +825,45 @@ function A1({ presentation: n, onNavigateToSlide: e }) {
|
|
|
812
825
|
console.error("Failed to open navigator window.");
|
|
813
826
|
return;
|
|
814
827
|
}
|
|
815
|
-
const t =
|
|
828
|
+
const t = b1(n, e);
|
|
816
829
|
Z.document.title = n.title, Z.document.body.appendChild(t), Z.addEventListener("keyup", (o) => {
|
|
817
830
|
(o.key === "Escape" || o.key === "`") && (Z == null || Z.close(), Z = null);
|
|
818
831
|
});
|
|
819
832
|
}
|
|
820
|
-
function
|
|
833
|
+
function b1(n, e) {
|
|
821
834
|
const t = document.createElement("div");
|
|
822
835
|
return t.style.fontFamily = "Arial, sans-serif", n.slides.forEach((o, i) => {
|
|
823
|
-
const a =
|
|
836
|
+
const a = M1(o, i);
|
|
824
837
|
a.style.cursor = "pointer", a.addEventListener("click", (s) => {
|
|
825
838
|
s.shiftKey && (Z == null || Z.close()), e(i);
|
|
826
839
|
}), t.appendChild(a);
|
|
827
840
|
}), t;
|
|
828
841
|
}
|
|
829
|
-
function
|
|
842
|
+
function M1(n, e) {
|
|
830
843
|
const t = document.createElement("div");
|
|
831
844
|
return t.style.marginBottom = "8px", t.style.padding = "8px", t.style.backgroundColor = "#eceed7", t.style.borderRadius = "4px", t.style.userSelect = "none", t.innerHTML = `${e + 1}: ` + (n.title.length > 0 ? n.title : `Slide ${e + 1}`), t;
|
|
832
845
|
}
|
|
833
|
-
function
|
|
846
|
+
function i0(n = null) {
|
|
834
847
|
return {
|
|
835
848
|
height: 0,
|
|
836
849
|
width: 0,
|
|
837
850
|
...n
|
|
838
851
|
};
|
|
839
852
|
}
|
|
840
|
-
const
|
|
841
|
-
function
|
|
853
|
+
const L1 = i0({ width: 0, height: 0 });
|
|
854
|
+
function T1(n = null) {
|
|
842
855
|
return {
|
|
843
|
-
backgroundColor:
|
|
856
|
+
backgroundColor: W.WHITE,
|
|
844
857
|
slides: [],
|
|
845
858
|
title: "Presentation",
|
|
846
|
-
size:
|
|
859
|
+
size: i0({ width: 3840, height: 2160 }),
|
|
847
860
|
resources: {
|
|
848
861
|
images: {}
|
|
849
862
|
},
|
|
850
863
|
...n
|
|
851
864
|
};
|
|
852
865
|
}
|
|
853
|
-
function
|
|
866
|
+
function P1(n) {
|
|
854
867
|
const e = Array.isArray(n) ? n : [n];
|
|
855
868
|
let t = 0, o = 0;
|
|
856
869
|
for (const i of e)
|
|
@@ -864,7 +877,7 @@ function T1(n) {
|
|
|
864
877
|
case u0.UPDATE:
|
|
865
878
|
break;
|
|
866
879
|
default:
|
|
867
|
-
|
|
880
|
+
r0(i);
|
|
868
881
|
}
|
|
869
882
|
return o;
|
|
870
883
|
}
|
|
@@ -872,12 +885,12 @@ function nt(n, e = null) {
|
|
|
872
885
|
const { red: t, green: o, blue: i } = n, a = St(n, e);
|
|
873
886
|
return `rgba(${t}, ${o}, ${i}, ${a})`;
|
|
874
887
|
}
|
|
875
|
-
function
|
|
888
|
+
function C1(n) {
|
|
876
889
|
return n === document.body;
|
|
877
890
|
}
|
|
878
|
-
function
|
|
891
|
+
function E1(n, e) {
|
|
879
892
|
const t = document.createElement("div");
|
|
880
|
-
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto",
|
|
893
|
+
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto", C1(e)) {
|
|
881
894
|
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";
|
|
882
895
|
const o = n.size.height / n.size.width;
|
|
883
896
|
ut(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => ut(t, o));
|
|
@@ -887,7 +900,7 @@ function C1(n, e) {
|
|
|
887
900
|
function ut(n, e) {
|
|
888
901
|
window.innerHeight / window.innerWidth > e ? (n.style.width = "100%", n.style.height = "auto") : (n.style.width = "auto", n.style.height = "100%");
|
|
889
902
|
}
|
|
890
|
-
const
|
|
903
|
+
const S1 = {
|
|
891
904
|
check: (n) => typeof n == "object" && n !== null && typeof n.red == "number" && typeof n.green == "number" && typeof n.blue == "number" && typeof n.alpha == "number",
|
|
892
905
|
interpolate: (n, e, t) => ({
|
|
893
906
|
red: Math.round(n.red + (e.red - n.red) * t),
|
|
@@ -895,18 +908,18 @@ const E1 = {
|
|
|
895
908
|
blue: Math.round(n.blue + (e.blue - n.blue) * t),
|
|
896
909
|
alpha: n.alpha + (e.alpha - n.alpha) * t
|
|
897
910
|
})
|
|
898
|
-
},
|
|
911
|
+
}, I1 = {
|
|
899
912
|
check: (n) => !0,
|
|
900
913
|
interpolate: (n, e) => e
|
|
901
|
-
},
|
|
914
|
+
}, _1 = {
|
|
902
915
|
check: (n) => typeof n == "number",
|
|
903
916
|
interpolate: (n, e, t) => n + (e - n) * t
|
|
904
917
|
}, ft = [
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
918
|
+
_1,
|
|
919
|
+
S1,
|
|
920
|
+
I1
|
|
908
921
|
];
|
|
909
|
-
function
|
|
922
|
+
function k1(n, e, t, o = null) {
|
|
910
923
|
if (t === 0)
|
|
911
924
|
return n;
|
|
912
925
|
if (t === 1)
|
|
@@ -948,7 +961,7 @@ function gt(n, e, t = null) {
|
|
|
948
961
|
);
|
|
949
962
|
n.set(a.object, {
|
|
950
963
|
...s,
|
|
951
|
-
...
|
|
964
|
+
...k1(
|
|
952
965
|
s,
|
|
953
966
|
a.props,
|
|
954
967
|
a.easing(h),
|
|
@@ -971,11 +984,11 @@ function gt(n, e, t = null) {
|
|
|
971
984
|
i += a.duration;
|
|
972
985
|
break;
|
|
973
986
|
default:
|
|
974
|
-
|
|
987
|
+
r0(a);
|
|
975
988
|
}
|
|
976
989
|
}
|
|
977
990
|
}
|
|
978
|
-
function
|
|
991
|
+
function Ot(n) {
|
|
979
992
|
return "objects" in n ? n.objects.filter((e) => "objectType" in e) : [];
|
|
980
993
|
}
|
|
981
994
|
function O1({
|
|
@@ -986,7 +999,7 @@ function O1({
|
|
|
986
999
|
const o = /* @__PURE__ */ new Map();
|
|
987
1000
|
function i(s) {
|
|
988
1001
|
o.set(s, s);
|
|
989
|
-
for (const r of
|
|
1002
|
+
for (const r of Ot(s))
|
|
990
1003
|
i(r);
|
|
991
1004
|
}
|
|
992
1005
|
for (const s of n.objects)
|
|
@@ -1003,6 +1016,22 @@ function O1({
|
|
|
1003
1016
|
return o;
|
|
1004
1017
|
}
|
|
1005
1018
|
function F1(n) {
|
|
1019
|
+
const e = {};
|
|
1020
|
+
function t(o) {
|
|
1021
|
+
if (o.objectType === j.SVG) {
|
|
1022
|
+
const a = o.svg;
|
|
1023
|
+
a !== void 0 && a.length > 0 && (e[a] = a);
|
|
1024
|
+
}
|
|
1025
|
+
const i = Ot(o);
|
|
1026
|
+
for (const a of i)
|
|
1027
|
+
t(a);
|
|
1028
|
+
}
|
|
1029
|
+
for (const o of n.slides)
|
|
1030
|
+
for (const i of o.objects)
|
|
1031
|
+
t(i);
|
|
1032
|
+
return e;
|
|
1033
|
+
}
|
|
1034
|
+
function R1(n) {
|
|
1006
1035
|
var o;
|
|
1007
1036
|
const { slides: e } = n, t = {
|
|
1008
1037
|
// First build of first slide
|
|
@@ -1020,20 +1049,20 @@ function F1(n) {
|
|
|
1020
1049
|
if (a === void 0)
|
|
1021
1050
|
continue;
|
|
1022
1051
|
const s = a.shortcut;
|
|
1023
|
-
|
|
1052
|
+
N0(t, s, i, 0);
|
|
1024
1053
|
for (let r = 0; r < a.animations.length; r++) {
|
|
1025
1054
|
const h = a.animations[r];
|
|
1026
1055
|
if (h !== void 0)
|
|
1027
1056
|
if (Array.isArray(h))
|
|
1028
1057
|
for (const c of h)
|
|
1029
|
-
|
|
1058
|
+
N0(t, c.shortcut, i, r + 1);
|
|
1030
1059
|
else
|
|
1031
|
-
|
|
1060
|
+
N0(t, h.shortcut, i, r + 1);
|
|
1032
1061
|
}
|
|
1033
1062
|
}
|
|
1034
1063
|
return t;
|
|
1035
1064
|
}
|
|
1036
|
-
function
|
|
1065
|
+
function N0(n, e, t, o) {
|
|
1037
1066
|
if (e !== null)
|
|
1038
1067
|
if (Array.isArray(e))
|
|
1039
1068
|
for (const i of e)
|
|
@@ -1041,8 +1070,8 @@ function R0(n, e, t, o) {
|
|
|
1041
1070
|
else
|
|
1042
1071
|
n[e] = { slideIndex: t, buildIndex: o };
|
|
1043
1072
|
}
|
|
1044
|
-
function
|
|
1045
|
-
t.shortcuts =
|
|
1073
|
+
function N1(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }) {
|
|
1074
|
+
t.shortcuts = R1(n), e.addEventListener("mousemove", () => {
|
|
1046
1075
|
e.style.cursor = "auto";
|
|
1047
1076
|
}), e.addEventListener("keyup", (r) => {
|
|
1048
1077
|
if (r.code === "Escape") {
|
|
@@ -1077,34 +1106,34 @@ function R1(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigat
|
|
|
1077
1106
|
}
|
|
1078
1107
|
});
|
|
1079
1108
|
}
|
|
1080
|
-
const
|
|
1081
|
-
function
|
|
1082
|
-
const t = localStorage.getItem(
|
|
1109
|
+
const d0 = "presenterState";
|
|
1110
|
+
function q1(n, e) {
|
|
1111
|
+
const t = localStorage.getItem(d0);
|
|
1083
1112
|
if (t === null)
|
|
1084
1113
|
return null;
|
|
1085
1114
|
if (e === null)
|
|
1086
|
-
return localStorage.removeItem(
|
|
1115
|
+
return localStorage.removeItem(d0), null;
|
|
1087
1116
|
let o;
|
|
1088
1117
|
try {
|
|
1089
1118
|
o = JSON.parse(t);
|
|
1090
1119
|
} catch (c) {
|
|
1091
|
-
return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(
|
|
1120
|
+
return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(d0), null;
|
|
1092
1121
|
}
|
|
1093
1122
|
const { title: i, timestamp: a } = o;
|
|
1094
1123
|
let { slideIndex: s, buildIndex: r } = o;
|
|
1095
1124
|
if (typeof i != "string" || typeof s != "number" || typeof r != "number" || typeof a != "number" || i !== n.title || Date.now() - a > 1e3 * 60 * e)
|
|
1096
|
-
return localStorage.removeItem(
|
|
1125
|
+
return localStorage.removeItem(d0), null;
|
|
1097
1126
|
s > n.slides.length - 1 && (s = n.slides.length - 1, r = 0);
|
|
1098
1127
|
const h = n.slides[s];
|
|
1099
|
-
return h === void 0 ? (localStorage.removeItem(
|
|
1128
|
+
return h === void 0 ? (localStorage.removeItem(d0), null) : (r > h.animations.length && (r = h.animations.length), {
|
|
1100
1129
|
title: i,
|
|
1101
1130
|
slideIndex: s,
|
|
1102
1131
|
buildIndex: r
|
|
1103
1132
|
});
|
|
1104
1133
|
}
|
|
1105
|
-
function
|
|
1134
|
+
function B1({ title: n, slideIndex: e, buildIndex: t }) {
|
|
1106
1135
|
localStorage.setItem(
|
|
1107
|
-
|
|
1136
|
+
d0,
|
|
1108
1137
|
JSON.stringify({ title: n, slideIndex: e, buildIndex: t, timestamp: Date.now() })
|
|
1109
1138
|
);
|
|
1110
1139
|
}
|
|
@@ -1121,14 +1150,14 @@ const pt = Object.freeze({
|
|
|
1121
1150
|
textCommand: null,
|
|
1122
1151
|
shortcuts: {}
|
|
1123
1152
|
}
|
|
1124
|
-
}),
|
|
1153
|
+
}), V = {
|
|
1125
1154
|
Browser: "browser",
|
|
1126
1155
|
Node: "node"
|
|
1127
1156
|
};
|
|
1128
|
-
function
|
|
1157
|
+
function D1(n, e) {
|
|
1129
1158
|
e.context.clearRect(0, 0, n.width, n.height);
|
|
1130
1159
|
}
|
|
1131
|
-
function
|
|
1160
|
+
function j1(n) {
|
|
1132
1161
|
const e = document.createElement("canvas");
|
|
1133
1162
|
return e.setAttribute("width", n.width.toString()), e.setAttribute("height", n.height.toString()), e.style.position = "absolute", e.style.width = "100%", e;
|
|
1134
1163
|
}
|
|
@@ -1136,7 +1165,7 @@ const f0 = {
|
|
|
1136
1165
|
Browser: "browser",
|
|
1137
1166
|
Node: "node"
|
|
1138
1167
|
};
|
|
1139
|
-
function
|
|
1168
|
+
function z1(n) {
|
|
1140
1169
|
const e = new Path2D(n);
|
|
1141
1170
|
return {
|
|
1142
1171
|
type: f0.Browser,
|
|
@@ -1144,26 +1173,26 @@ function j1(n) {
|
|
|
1144
1173
|
};
|
|
1145
1174
|
}
|
|
1146
1175
|
function U1(n) {
|
|
1147
|
-
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n, c = { x: t, y: o }, f = { x: i, y: a }, x = Math.atan2(f.y - c.y, f.x - c.x), l = { x: c.x + (f.x - c.x) / 2, y: c.y + (f.y - c.y) / 2 }, u = f.x - c.x,
|
|
1176
|
+
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n, c = { x: t, y: o }, f = { x: i, y: a }, x = Math.atan2(f.y - c.y, f.x - c.x), l = { x: c.x + (f.x - c.x) / 2, y: c.y + (f.y - c.y) / 2 }, u = f.x - c.x, m = f.y - c.y, M = Math.hypot(u, m) * e, C = Math.cos(x), E = Math.sin(x), L = h ? { x: l.x - C * M / 2, y: l.y - E * M / 2 } : c, S = h ? { x: l.x + C * M / 2, y: l.y + E * M / 2 } : { x: c.x + C * M, y: c.y + E * M }, P = r ? Math.PI / 6 : Math.PI / 4.5, F = M < s * 2 ? M / 2 : s, H = {
|
|
1148
1177
|
x: S.x - F * Math.cos(x - P),
|
|
1149
1178
|
y: S.y - F * Math.sin(x - P)
|
|
1150
|
-
},
|
|
1179
|
+
}, X = {
|
|
1151
1180
|
x: S.x - F * Math.cos(x + P),
|
|
1152
1181
|
y: S.y - F * Math.sin(x + P)
|
|
1153
|
-
},
|
|
1182
|
+
}, z = {
|
|
1154
1183
|
x: L.x + F * Math.cos(x - P),
|
|
1155
1184
|
y: L.y + F * Math.sin(x - P)
|
|
1156
|
-
},
|
|
1185
|
+
}, G = {
|
|
1157
1186
|
x: L.x + F * Math.cos(x + P),
|
|
1158
1187
|
y: L.y + F * Math.sin(x + P)
|
|
1159
1188
|
};
|
|
1160
1189
|
return {
|
|
1161
1190
|
arrowPoints: [L, S],
|
|
1162
|
-
arrowheadPoints: [
|
|
1163
|
-
doubledArrowheadPoints: [
|
|
1191
|
+
arrowheadPoints: [H, S, X],
|
|
1192
|
+
doubledArrowheadPoints: [z, L, G]
|
|
1164
1193
|
};
|
|
1165
1194
|
}
|
|
1166
|
-
function
|
|
1195
|
+
function y0({
|
|
1167
1196
|
ctx: n,
|
|
1168
1197
|
color: e,
|
|
1169
1198
|
drawn: t = null,
|
|
@@ -1190,34 +1219,34 @@ function x0({
|
|
|
1190
1219
|
return;
|
|
1191
1220
|
}
|
|
1192
1221
|
switch (n.type) {
|
|
1193
|
-
case
|
|
1222
|
+
case V.Browser:
|
|
1194
1223
|
s.type === f0.Browser ? n.context.stroke(s.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1195
1224
|
break;
|
|
1196
|
-
case
|
|
1225
|
+
case V.Node:
|
|
1197
1226
|
s.type === f0.Node ? n.context.stroke(s.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1198
1227
|
break;
|
|
1199
1228
|
default:
|
|
1200
|
-
|
|
1229
|
+
r0(n);
|
|
1201
1230
|
}
|
|
1202
1231
|
}
|
|
1203
1232
|
}
|
|
1204
|
-
function
|
|
1233
|
+
function v0({ ctx: n, path: e, color: t, opacity: o = null }) {
|
|
1205
1234
|
if (n.context.fillStyle = nt(t, o), e === void 0) {
|
|
1206
1235
|
n.context.fill();
|
|
1207
1236
|
return;
|
|
1208
1237
|
}
|
|
1209
1238
|
switch (n.type) {
|
|
1210
|
-
case
|
|
1239
|
+
case V.Browser:
|
|
1211
1240
|
e.type === f0.Browser ? n.context.fill(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1212
1241
|
break;
|
|
1213
|
-
case
|
|
1242
|
+
case V.Node:
|
|
1214
1243
|
e.type === f0.Node ? n.context.fill(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1215
1244
|
break;
|
|
1216
1245
|
default:
|
|
1217
|
-
|
|
1246
|
+
r0(n);
|
|
1218
1247
|
}
|
|
1219
1248
|
}
|
|
1220
|
-
function
|
|
1249
|
+
function q0(n, e) {
|
|
1221
1250
|
const t = e(), o = n[0];
|
|
1222
1251
|
if (o === void 0)
|
|
1223
1252
|
return { path: t, length: 0 };
|
|
@@ -1232,7 +1261,7 @@ function N0(n, e) {
|
|
|
1232
1261
|
}
|
|
1233
1262
|
return { path: t, length: i };
|
|
1234
1263
|
}
|
|
1235
|
-
const
|
|
1264
|
+
const H1 = ({
|
|
1236
1265
|
ctx: n,
|
|
1237
1266
|
object: e,
|
|
1238
1267
|
opacity: t,
|
|
@@ -1241,35 +1270,35 @@ const z1 = ({
|
|
|
1241
1270
|
const i = e.opacity * t;
|
|
1242
1271
|
if (i === 0 || e.drawn === 0)
|
|
1243
1272
|
return;
|
|
1244
|
-
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = U1(e), { path: h } =
|
|
1245
|
-
if (
|
|
1273
|
+
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = U1(e), { path: h } = q0(a, o), { path: c } = q0(s, o);
|
|
1274
|
+
if (y0({
|
|
1246
1275
|
color: e.color,
|
|
1247
1276
|
ctx: n,
|
|
1248
1277
|
path: h,
|
|
1249
1278
|
opacity: i,
|
|
1250
1279
|
width: e.width
|
|
1251
|
-
}), e.isArrowheadFilled && (c.path.closePath(),
|
|
1280
|
+
}), e.isArrowheadFilled && (c.path.closePath(), v0({
|
|
1252
1281
|
ctx: n,
|
|
1253
1282
|
path: c,
|
|
1254
1283
|
color: e.color,
|
|
1255
1284
|
opacity: i
|
|
1256
|
-
})),
|
|
1285
|
+
})), y0({
|
|
1257
1286
|
color: e.color,
|
|
1258
1287
|
ctx: n,
|
|
1259
1288
|
path: c,
|
|
1260
1289
|
opacity: i,
|
|
1261
1290
|
width: e.width
|
|
1262
1291
|
}), e.isArrowheadDoubled) {
|
|
1263
|
-
const { path: f } =
|
|
1292
|
+
const { path: f } = q0(
|
|
1264
1293
|
r,
|
|
1265
1294
|
o
|
|
1266
1295
|
);
|
|
1267
|
-
e.isArrowheadFilled && (f.path.closePath(),
|
|
1296
|
+
e.isArrowheadFilled && (f.path.closePath(), v0({
|
|
1268
1297
|
ctx: n,
|
|
1269
1298
|
path: f,
|
|
1270
1299
|
color: e.color,
|
|
1271
1300
|
opacity: i
|
|
1272
|
-
})),
|
|
1301
|
+
})), y0({
|
|
1273
1302
|
color: e.color,
|
|
1274
1303
|
ctx: n,
|
|
1275
1304
|
path: f,
|
|
@@ -1278,7 +1307,7 @@ const z1 = ({
|
|
|
1278
1307
|
});
|
|
1279
1308
|
}
|
|
1280
1309
|
};
|
|
1281
|
-
function
|
|
1310
|
+
function G1(n, e) {
|
|
1282
1311
|
const t = n.radius - n.borderWidth / 2;
|
|
1283
1312
|
if (t <= 0)
|
|
1284
1313
|
return;
|
|
@@ -1291,16 +1320,16 @@ function $1(n, e) {
|
|
|
1291
1320
|
const i = 2 * Math.PI * n.radius;
|
|
1292
1321
|
return { path: t, length: i };
|
|
1293
1322
|
}
|
|
1294
|
-
function
|
|
1323
|
+
function Ft(n, e) {
|
|
1295
1324
|
switch (n.type) {
|
|
1296
|
-
case
|
|
1325
|
+
case V.Browser:
|
|
1297
1326
|
e.type === f0.Browser ? n.context.clip(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1298
1327
|
break;
|
|
1299
|
-
case
|
|
1328
|
+
case V.Node:
|
|
1300
1329
|
e.type === f0.Node ? n.context.clip(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1301
1330
|
break;
|
|
1302
1331
|
default:
|
|
1303
|
-
|
|
1332
|
+
r0(n);
|
|
1304
1333
|
}
|
|
1305
1334
|
}
|
|
1306
1335
|
const W1 = ({
|
|
@@ -1314,11 +1343,11 @@ const W1 = ({
|
|
|
1314
1343
|
return;
|
|
1315
1344
|
const { path: a, length: s } = $1(e, o);
|
|
1316
1345
|
if (i < 1 && e.borderWidth > 0) {
|
|
1317
|
-
const r =
|
|
1318
|
-
r !== void 0 && (n.context.save(),
|
|
1346
|
+
const r = G1(e, o);
|
|
1347
|
+
r !== void 0 && (n.context.save(), Ft(n, r), v0({ ctx: n, path: a, color: e.fill, opacity: i }), n.context.restore());
|
|
1319
1348
|
} else
|
|
1320
|
-
|
|
1321
|
-
|
|
1349
|
+
v0({ ctx: n, path: a, color: e.fill, opacity: i });
|
|
1350
|
+
y0({
|
|
1322
1351
|
color: e.borderColor,
|
|
1323
1352
|
ctx: n,
|
|
1324
1353
|
drawn: e.drawn,
|
|
@@ -1328,72 +1357,72 @@ const W1 = ({
|
|
|
1328
1357
|
width: e.borderWidth
|
|
1329
1358
|
});
|
|
1330
1359
|
};
|
|
1331
|
-
function
|
|
1360
|
+
function $(n = null) {
|
|
1332
1361
|
return {
|
|
1333
1362
|
x: 0,
|
|
1334
1363
|
y: 0,
|
|
1335
1364
|
...n
|
|
1336
1365
|
};
|
|
1337
1366
|
}
|
|
1338
|
-
const Y1 =
|
|
1339
|
-
function
|
|
1367
|
+
const Y1 = $();
|
|
1368
|
+
function l0(n = null) {
|
|
1340
1369
|
return {
|
|
1341
1370
|
origin: Y1,
|
|
1342
|
-
size:
|
|
1371
|
+
size: L1,
|
|
1343
1372
|
...n
|
|
1344
1373
|
};
|
|
1345
1374
|
}
|
|
1346
|
-
|
|
1347
|
-
function
|
|
1375
|
+
l0();
|
|
1376
|
+
function g0(n, e, t) {
|
|
1348
1377
|
const { x: o, y: i } = n, { width: a, height: s } = t;
|
|
1349
1378
|
switch (e) {
|
|
1350
1379
|
case n0.TOP_LEFT:
|
|
1351
|
-
return
|
|
1352
|
-
origin:
|
|
1380
|
+
return l0({
|
|
1381
|
+
origin: $({ x: o, y: i }),
|
|
1353
1382
|
size: t
|
|
1354
1383
|
});
|
|
1355
1384
|
case n0.TOP:
|
|
1356
|
-
return
|
|
1357
|
-
origin:
|
|
1385
|
+
return l0({
|
|
1386
|
+
origin: $({ x: o - a / 2, y: i }),
|
|
1358
1387
|
size: t
|
|
1359
1388
|
});
|
|
1360
1389
|
case n0.TOP_RIGHT:
|
|
1361
|
-
return
|
|
1362
|
-
origin:
|
|
1390
|
+
return l0({
|
|
1391
|
+
origin: $({ x: o - a, y: i }),
|
|
1363
1392
|
size: t
|
|
1364
1393
|
});
|
|
1365
1394
|
case n0.LEFT:
|
|
1366
|
-
return
|
|
1367
|
-
origin:
|
|
1395
|
+
return l0({
|
|
1396
|
+
origin: $({ x: o, y: i - s / 2 }),
|
|
1368
1397
|
size: t
|
|
1369
1398
|
});
|
|
1370
1399
|
case n0.CENTER:
|
|
1371
|
-
return
|
|
1372
|
-
origin:
|
|
1400
|
+
return l0({
|
|
1401
|
+
origin: $({ x: o - a / 2, y: i - s / 2 }),
|
|
1373
1402
|
size: t
|
|
1374
1403
|
});
|
|
1375
1404
|
case n0.RIGHT:
|
|
1376
|
-
return
|
|
1377
|
-
origin:
|
|
1405
|
+
return l0({
|
|
1406
|
+
origin: $({ x: o - a, y: i - s / 2 }),
|
|
1378
1407
|
size: t
|
|
1379
1408
|
});
|
|
1380
1409
|
case n0.BOTTOM_LEFT:
|
|
1381
|
-
return
|
|
1382
|
-
origin:
|
|
1410
|
+
return l0({
|
|
1411
|
+
origin: $({ x: o, y: i - s }),
|
|
1383
1412
|
size: t
|
|
1384
1413
|
});
|
|
1385
1414
|
case n0.BOTTOM:
|
|
1386
|
-
return
|
|
1387
|
-
origin:
|
|
1415
|
+
return l0({
|
|
1416
|
+
origin: $({ x: o - a / 2, y: i - s }),
|
|
1388
1417
|
size: t
|
|
1389
1418
|
});
|
|
1390
1419
|
case n0.BOTTOM_RIGHT:
|
|
1391
|
-
return
|
|
1392
|
-
origin:
|
|
1420
|
+
return l0({
|
|
1421
|
+
origin: $({ x: o - a, y: i - s }),
|
|
1393
1422
|
size: t
|
|
1394
1423
|
});
|
|
1395
1424
|
default:
|
|
1396
|
-
|
|
1425
|
+
r0(e);
|
|
1397
1426
|
}
|
|
1398
1427
|
}
|
|
1399
1428
|
const X1 = ({
|
|
@@ -1402,10 +1431,10 @@ const X1 = ({
|
|
|
1402
1431
|
renderObject: t,
|
|
1403
1432
|
opacity: o
|
|
1404
1433
|
}) => {
|
|
1405
|
-
const i =
|
|
1406
|
-
|
|
1434
|
+
const i = g0(
|
|
1435
|
+
$({ x: e.x, y: e.y }),
|
|
1407
1436
|
e.anchor,
|
|
1408
|
-
|
|
1437
|
+
i0({
|
|
1409
1438
|
width: e.width * e.scale,
|
|
1410
1439
|
height: e.height * e.scale
|
|
1411
1440
|
})
|
|
@@ -1441,20 +1470,20 @@ function rt(n, e, t, o, i = 0) {
|
|
|
1441
1470
|
const s = 2 * (e.width + e.height - 4 * t) + 2 * Math.PI * t + i;
|
|
1442
1471
|
return { path: a, length: s };
|
|
1443
1472
|
}
|
|
1444
|
-
const
|
|
1473
|
+
const S0 = {
|
|
1445
1474
|
Browser: "browser",
|
|
1446
1475
|
Node: "node"
|
|
1447
|
-
},
|
|
1476
|
+
}, Z1 = ({
|
|
1448
1477
|
ctx: n,
|
|
1449
1478
|
imageById: e,
|
|
1450
1479
|
object: t,
|
|
1451
1480
|
opacity: o,
|
|
1452
1481
|
createPath2D: i
|
|
1453
1482
|
}) => {
|
|
1454
|
-
const a =
|
|
1455
|
-
|
|
1483
|
+
const a = g0(
|
|
1484
|
+
$({ x: t.x, y: t.y }),
|
|
1456
1485
|
t.anchor,
|
|
1457
|
-
|
|
1486
|
+
i0({ width: t.width, height: t.height })
|
|
1458
1487
|
), s = e[t.imageId];
|
|
1459
1488
|
if (s !== void 0) {
|
|
1460
1489
|
if (n.context.save(), t.rounding > 0) {
|
|
@@ -1465,19 +1494,19 @@ const G0 = {
|
|
|
1465
1494
|
i
|
|
1466
1495
|
);
|
|
1467
1496
|
switch (n.type) {
|
|
1468
|
-
case
|
|
1497
|
+
case V.Browser:
|
|
1469
1498
|
r.path.type === f0.Browser ? n.context.clip(r.path.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1470
1499
|
break;
|
|
1471
|
-
case
|
|
1500
|
+
case V.Node:
|
|
1472
1501
|
r.path.type === f0.Node ? n.context.clip(r.path.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1473
1502
|
break;
|
|
1474
1503
|
default:
|
|
1475
|
-
|
|
1504
|
+
r0(n);
|
|
1476
1505
|
}
|
|
1477
1506
|
}
|
|
1478
1507
|
switch (n.context.globalAlpha = o * t.opacity, n.context.imageSmoothingEnabled = t.smooth, n.type) {
|
|
1479
|
-
case
|
|
1480
|
-
s.type ===
|
|
1508
|
+
case V.Browser:
|
|
1509
|
+
s.type === S0.Browser ? n.context.drawImage(
|
|
1481
1510
|
s.image,
|
|
1482
1511
|
a.origin.x,
|
|
1483
1512
|
a.origin.y,
|
|
@@ -1485,8 +1514,8 @@ const G0 = {
|
|
|
1485
1514
|
a.size.height
|
|
1486
1515
|
) : console.warn("Attempted to use Node Image in Browser Canvas context");
|
|
1487
1516
|
break;
|
|
1488
|
-
case
|
|
1489
|
-
s.type ===
|
|
1517
|
+
case V.Node:
|
|
1518
|
+
s.type === S0.Node ? n.context.drawImage(
|
|
1490
1519
|
s.image,
|
|
1491
1520
|
a.origin.x,
|
|
1492
1521
|
a.origin.y,
|
|
@@ -1495,12 +1524,12 @@ const G0 = {
|
|
|
1495
1524
|
) : console.warn("Attempted to use Browser Image in Node Canvas context");
|
|
1496
1525
|
break;
|
|
1497
1526
|
default:
|
|
1498
|
-
|
|
1527
|
+
r0(n);
|
|
1499
1528
|
}
|
|
1500
1529
|
n.context.restore();
|
|
1501
1530
|
}
|
|
1502
1531
|
};
|
|
1503
|
-
function
|
|
1532
|
+
function V1(n, e) {
|
|
1504
1533
|
const t = e();
|
|
1505
1534
|
t.path.moveTo(n.startX, n.startY), t.path.lineTo(n.endX, n.endY);
|
|
1506
1535
|
const o = Math.hypot(n.endX - n.startX, n.endY - n.startY);
|
|
@@ -1515,8 +1544,8 @@ const K1 = ({
|
|
|
1515
1544
|
const i = e.opacity * t;
|
|
1516
1545
|
if (i === 0 || e.drawn === 0)
|
|
1517
1546
|
return;
|
|
1518
|
-
const { path: a, length: s } =
|
|
1519
|
-
|
|
1547
|
+
const { path: a, length: s } = V1(e, o);
|
|
1548
|
+
y0({
|
|
1520
1549
|
color: e.color,
|
|
1521
1550
|
ctx: n,
|
|
1522
1551
|
drawn: e.drawn,
|
|
@@ -1527,23 +1556,23 @@ const K1 = ({
|
|
|
1527
1556
|
opacity: i,
|
|
1528
1557
|
width: e.width
|
|
1529
1558
|
});
|
|
1530
|
-
},
|
|
1559
|
+
}, Q1 = ({
|
|
1531
1560
|
ctx: n,
|
|
1532
1561
|
object: e,
|
|
1533
1562
|
opacity: t,
|
|
1534
1563
|
renderObject: o
|
|
1535
1564
|
}) => {
|
|
1536
1565
|
n.context.save();
|
|
1537
|
-
const i =
|
|
1538
|
-
|
|
1566
|
+
const i = g0(
|
|
1567
|
+
$({ x: e.x, y: e.y }),
|
|
1539
1568
|
e.anchor,
|
|
1540
|
-
|
|
1569
|
+
i0({ width: e.width, height: e.height })
|
|
1541
1570
|
);
|
|
1542
|
-
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = E0(
|
|
1571
|
+
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = E0(W.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();
|
|
1543
1572
|
for (const a of e.objects)
|
|
1544
1573
|
o(a, t * e.opacity);
|
|
1545
1574
|
n.context.restore();
|
|
1546
|
-
},
|
|
1575
|
+
}, J1 = ({
|
|
1547
1576
|
ctx: n,
|
|
1548
1577
|
object: e,
|
|
1549
1578
|
opacity: t,
|
|
@@ -1552,17 +1581,17 @@ const K1 = ({
|
|
|
1552
1581
|
const i = e.opacity * t;
|
|
1553
1582
|
if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
|
|
1554
1583
|
return;
|
|
1555
|
-
const { origin: a } =
|
|
1556
|
-
|
|
1584
|
+
const { origin: a } = g0(
|
|
1585
|
+
$({ x: e.x, y: e.y }),
|
|
1557
1586
|
e.anchor,
|
|
1558
|
-
|
|
1587
|
+
i0({ width: e.width, height: e.height })
|
|
1559
1588
|
), s = o(e.path);
|
|
1560
|
-
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight),
|
|
1589
|
+
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight), v0({
|
|
1561
1590
|
ctx: n,
|
|
1562
1591
|
path: s,
|
|
1563
1592
|
color: e.fill,
|
|
1564
1593
|
opacity: i
|
|
1565
|
-
}),
|
|
1594
|
+
}), y0({
|
|
1566
1595
|
color: e.color,
|
|
1567
1596
|
ctx: n,
|
|
1568
1597
|
drawn: e.drawn,
|
|
@@ -1573,7 +1602,7 @@ const K1 = ({
|
|
|
1573
1602
|
width: e.strokeWidth
|
|
1574
1603
|
}), n.context.restore();
|
|
1575
1604
|
};
|
|
1576
|
-
function
|
|
1605
|
+
function te(n, e) {
|
|
1577
1606
|
const t = e(), o = n.points, i = o[0];
|
|
1578
1607
|
if (i === void 0)
|
|
1579
1608
|
return { path: t, length: 0 };
|
|
@@ -1594,7 +1623,7 @@ function J1(n, e) {
|
|
|
1594
1623
|
);
|
|
1595
1624
|
return a += r, { path: t, length: a };
|
|
1596
1625
|
}
|
|
1597
|
-
const
|
|
1626
|
+
const ee = ({
|
|
1598
1627
|
ctx: n,
|
|
1599
1628
|
object: e,
|
|
1600
1629
|
opacity: t,
|
|
@@ -1603,13 +1632,13 @@ const te = ({
|
|
|
1603
1632
|
const i = e.opacity * t;
|
|
1604
1633
|
if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
|
|
1605
1634
|
return;
|
|
1606
|
-
const { path: a, length: s } =
|
|
1607
|
-
|
|
1635
|
+
const { path: a, length: s } = te(e, o);
|
|
1636
|
+
v0({
|
|
1608
1637
|
ctx: n,
|
|
1609
1638
|
path: a,
|
|
1610
1639
|
color: e.fill,
|
|
1611
1640
|
opacity: i
|
|
1612
|
-
}),
|
|
1641
|
+
}), y0({
|
|
1613
1642
|
color: e.borderColor,
|
|
1614
1643
|
ctx: n,
|
|
1615
1644
|
drawn: e.drawn,
|
|
@@ -1619,15 +1648,15 @@ const te = ({
|
|
|
1619
1648
|
width: e.borderWidth
|
|
1620
1649
|
});
|
|
1621
1650
|
};
|
|
1622
|
-
function
|
|
1623
|
-
const t = n.borderWidth / 2, { origin: o, size: i } =
|
|
1624
|
-
|
|
1651
|
+
function ne(n, e) {
|
|
1652
|
+
const t = n.borderWidth / 2, { origin: o, size: i } = g0(
|
|
1653
|
+
$({ x: n.x, y: n.y }),
|
|
1625
1654
|
n.anchor,
|
|
1626
|
-
|
|
1655
|
+
i0({ width: n.width, height: n.height })
|
|
1627
1656
|
), a = i.width - n.borderWidth, s = i.height - n.borderWidth;
|
|
1628
1657
|
if (a <= 0 || s <= 0)
|
|
1629
1658
|
return;
|
|
1630
|
-
const r =
|
|
1659
|
+
const r = $({ x: o.x + t, y: o.y + t }), h = i0({ width: a, height: s }), c = Math.max(
|
|
1631
1660
|
0,
|
|
1632
1661
|
Math.min(n.rounding - t, Math.min(a, s) / 2)
|
|
1633
1662
|
);
|
|
@@ -1636,11 +1665,11 @@ function ee(n, e) {
|
|
|
1636
1665
|
const f = e();
|
|
1637
1666
|
return f.path.moveTo(r.x, r.y), f.path.lineTo(r.x + a, r.y), f.path.lineTo(r.x + a, r.y + s), f.path.lineTo(r.x, r.y + s), f.path.closePath(), f;
|
|
1638
1667
|
}
|
|
1639
|
-
function
|
|
1640
|
-
const { origin: t, size: o } =
|
|
1641
|
-
|
|
1668
|
+
function re(n, e) {
|
|
1669
|
+
const { origin: t, size: o } = g0(
|
|
1670
|
+
$({ x: n.x, y: n.y }),
|
|
1642
1671
|
n.anchor,
|
|
1643
|
-
|
|
1672
|
+
i0({ width: n.width, height: n.height })
|
|
1644
1673
|
), i = Math.max(0, Math.min(n.rounding, Math.min(o.width, o.height) / 2)), a = Math.min(n.borderWidth * 2, o.width - i);
|
|
1645
1674
|
if (i > 0)
|
|
1646
1675
|
return rt(t, o, i, e, a);
|
|
@@ -1651,7 +1680,7 @@ function ne(n, e) {
|
|
|
1651
1680
|
return { path: s, length: r };
|
|
1652
1681
|
}
|
|
1653
1682
|
}
|
|
1654
|
-
const
|
|
1683
|
+
const ie = ({
|
|
1655
1684
|
ctx: n,
|
|
1656
1685
|
object: e,
|
|
1657
1686
|
opacity: t,
|
|
@@ -1660,13 +1689,13 @@ const re = ({
|
|
|
1660
1689
|
const i = e.opacity * t;
|
|
1661
1690
|
if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
|
|
1662
1691
|
return;
|
|
1663
|
-
const { path: a, length: s } =
|
|
1692
|
+
const { path: a, length: s } = re(e, o);
|
|
1664
1693
|
if (i < 1 && e.borderWidth > 0) {
|
|
1665
|
-
const r =
|
|
1666
|
-
r !== void 0 && (n.context.save(),
|
|
1694
|
+
const r = ne(e, o);
|
|
1695
|
+
r !== void 0 && (n.context.save(), Ft(n, r), v0({ ctx: n, path: a, color: e.fill, opacity: i }), n.context.restore());
|
|
1667
1696
|
} else
|
|
1668
|
-
|
|
1669
|
-
|
|
1697
|
+
v0({ ctx: n, path: a, color: e.fill, opacity: i });
|
|
1698
|
+
y0({
|
|
1670
1699
|
color: e.borderColor,
|
|
1671
1700
|
ctx: n,
|
|
1672
1701
|
drawn: e.drawn,
|
|
@@ -1675,8 +1704,48 @@ const re = ({
|
|
|
1675
1704
|
opacity: i,
|
|
1676
1705
|
width: e.borderWidth
|
|
1677
1706
|
});
|
|
1707
|
+
}, oe = ({
|
|
1708
|
+
ctx: n,
|
|
1709
|
+
imageById: e,
|
|
1710
|
+
object: t,
|
|
1711
|
+
opacity: o
|
|
1712
|
+
}) => {
|
|
1713
|
+
const i = t.opacity * o;
|
|
1714
|
+
if (i === 0 || !t.svg)
|
|
1715
|
+
return;
|
|
1716
|
+
const a = e[t.svg];
|
|
1717
|
+
if (a === void 0)
|
|
1718
|
+
return;
|
|
1719
|
+
const s = g0(
|
|
1720
|
+
$({ x: t.x, y: t.y }),
|
|
1721
|
+
t.anchor,
|
|
1722
|
+
i0({ width: t.width, height: t.height })
|
|
1723
|
+
);
|
|
1724
|
+
switch (n.context.save(), n.context.globalAlpha = i, n.type) {
|
|
1725
|
+
case V.Browser:
|
|
1726
|
+
a.type === S0.Browser && n.context.drawImage(
|
|
1727
|
+
a.image,
|
|
1728
|
+
s.origin.x,
|
|
1729
|
+
s.origin.y,
|
|
1730
|
+
s.size.width,
|
|
1731
|
+
s.size.height
|
|
1732
|
+
);
|
|
1733
|
+
break;
|
|
1734
|
+
case V.Node:
|
|
1735
|
+
a.type === S0.Node && n.context.drawImage(
|
|
1736
|
+
a.image,
|
|
1737
|
+
s.origin.x,
|
|
1738
|
+
s.origin.y,
|
|
1739
|
+
s.size.width,
|
|
1740
|
+
s.size.height
|
|
1741
|
+
);
|
|
1742
|
+
break;
|
|
1743
|
+
default:
|
|
1744
|
+
r0(n);
|
|
1745
|
+
}
|
|
1746
|
+
n.context.restore();
|
|
1678
1747
|
};
|
|
1679
|
-
function
|
|
1748
|
+
function se(n) {
|
|
1680
1749
|
return {
|
|
1681
1750
|
color: n.color,
|
|
1682
1751
|
fontFamily: n.fontFamily,
|
|
@@ -1686,7 +1755,7 @@ function ie(n) {
|
|
|
1686
1755
|
ligatures: n.ligatures
|
|
1687
1756
|
};
|
|
1688
1757
|
}
|
|
1689
|
-
function
|
|
1758
|
+
function ae(n, e = 1) {
|
|
1690
1759
|
const t = Math.max(...n.map((a) => a.reduce((s, r) => s + r.width, 0)));
|
|
1691
1760
|
let o = 0, i = 0;
|
|
1692
1761
|
for (let a = 0; a < n.length; a++) {
|
|
@@ -1701,54 +1770,54 @@ function oe(n, e = 1) {
|
|
|
1701
1770
|
width: t
|
|
1702
1771
|
};
|
|
1703
1772
|
}
|
|
1704
|
-
function
|
|
1773
|
+
function he(n) {
|
|
1705
1774
|
return {
|
|
1706
1775
|
width: n.width,
|
|
1707
1776
|
height: n.fontBoundingBoxAscent
|
|
1708
1777
|
};
|
|
1709
1778
|
}
|
|
1710
|
-
function
|
|
1711
|
-
n.context.fillStyle = nt(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`, n.type ===
|
|
1779
|
+
function Rt(n, e, t = 1) {
|
|
1780
|
+
n.context.fillStyle = nt(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`, n.type === V.Browser ? n.context.textRendering = e.ligatures ? "optimizeLegibility" : "optimizeSpeed" : n.context.fontVariant = e.ligatures ? "common-ligatures" : "no-common-ligatures";
|
|
1712
1781
|
}
|
|
1713
|
-
function
|
|
1782
|
+
function le(n, e, t) {
|
|
1714
1783
|
const o = [];
|
|
1715
1784
|
for (const i of n) {
|
|
1716
1785
|
const a = [];
|
|
1717
1786
|
for (const s of i) {
|
|
1718
1787
|
const { text: r, ...h } = s, c = { ...e, ...h };
|
|
1719
|
-
|
|
1788
|
+
Rt(t, c);
|
|
1720
1789
|
const f = t.context.measureText(r);
|
|
1721
|
-
a.push(
|
|
1790
|
+
a.push(he(f));
|
|
1722
1791
|
}
|
|
1723
1792
|
o.push(a);
|
|
1724
1793
|
}
|
|
1725
1794
|
return o;
|
|
1726
1795
|
}
|
|
1727
|
-
const
|
|
1796
|
+
const ce = ({ ctx: n, object: e, opacity: t }) => {
|
|
1728
1797
|
const o = e.opacity * t;
|
|
1729
1798
|
if (o === 0)
|
|
1730
1799
|
return;
|
|
1731
|
-
const { length: i } = e, a = kt(e.text), s =
|
|
1800
|
+
const { length: i } = e, a = kt(e.text), s = se(e), r = le(a, s, n), h = ae(r, e.lineSpacing), c = g0($({ x: e.x, y: e.y }), e.anchor, h);
|
|
1732
1801
|
let f = c.origin.x, x = c.origin.y, l = 0, u = 0;
|
|
1733
|
-
for (let
|
|
1734
|
-
const y = a[
|
|
1802
|
+
for (let m = 0; m < a.length; m++) {
|
|
1803
|
+
const y = a[m], M = r[m];
|
|
1735
1804
|
if (y == null || M == null) {
|
|
1736
1805
|
console.error("Could not determine text units or sizes for line");
|
|
1737
1806
|
continue;
|
|
1738
1807
|
}
|
|
1739
1808
|
const C = M.reduce((L, S) => L + S.width, 0), E = M.length === 0 ? u : M.reduce((L, S) => Math.max(L, S.height), 0);
|
|
1740
1809
|
switch (e.alignment) {
|
|
1741
|
-
case
|
|
1810
|
+
case x0.LEFT:
|
|
1742
1811
|
f = c.origin.x;
|
|
1743
1812
|
break;
|
|
1744
|
-
case
|
|
1813
|
+
case x0.CENTER:
|
|
1745
1814
|
f = c.origin.x + (c.size.width - C) / 2;
|
|
1746
1815
|
break;
|
|
1747
|
-
case
|
|
1816
|
+
case x0.RIGHT:
|
|
1748
1817
|
f = c.origin.x + (c.size.width - C);
|
|
1749
1818
|
break;
|
|
1750
1819
|
default:
|
|
1751
|
-
|
|
1820
|
+
r0(e.alignment);
|
|
1752
1821
|
break;
|
|
1753
1822
|
}
|
|
1754
1823
|
x += E + u * (e.lineSpacing - 1), u = E;
|
|
@@ -1758,43 +1827,44 @@ const he = ({ ctx: n, object: e, opacity: t }) => {
|
|
|
1758
1827
|
console.error("Could not determine text unit or size for unit");
|
|
1759
1828
|
continue;
|
|
1760
1829
|
}
|
|
1761
|
-
const { text: F, ...
|
|
1762
|
-
let
|
|
1830
|
+
const { text: F, ...H } = S;
|
|
1831
|
+
let X;
|
|
1763
1832
|
if (i !== null && l + F.length > i) {
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1833
|
+
const a0 = i - l;
|
|
1834
|
+
X = F.slice(0, a0);
|
|
1766
1835
|
}
|
|
1767
|
-
const
|
|
1768
|
-
l +=
|
|
1769
|
-
const
|
|
1770
|
-
|
|
1836
|
+
const z = X ?? F;
|
|
1837
|
+
l += z.length;
|
|
1838
|
+
const G = { ...s, ...H };
|
|
1839
|
+
Rt(n, G, o), n.context.fillText(z, f, x), f += P.width;
|
|
1771
1840
|
}
|
|
1772
1841
|
}
|
|
1773
|
-
},
|
|
1774
|
-
[
|
|
1775
|
-
[
|
|
1776
|
-
[
|
|
1777
|
-
[
|
|
1778
|
-
[
|
|
1779
|
-
[
|
|
1780
|
-
[
|
|
1781
|
-
[
|
|
1782
|
-
[
|
|
1783
|
-
[
|
|
1842
|
+
}, ue = {
|
|
1843
|
+
[j.ARROW]: H1,
|
|
1844
|
+
[j.CIRCLE]: W1,
|
|
1845
|
+
[j.GROUP]: X1,
|
|
1846
|
+
[j.IMAGE]: Z1,
|
|
1847
|
+
[j.LINE]: K1,
|
|
1848
|
+
[j.MASK]: Q1,
|
|
1849
|
+
[j.PATH]: J1,
|
|
1850
|
+
[j.POLYGON]: ee,
|
|
1851
|
+
[j.RECTANGLE]: ie,
|
|
1852
|
+
[j.SLIDE_OBJECT]: () => {
|
|
1784
1853
|
},
|
|
1785
|
-
[
|
|
1854
|
+
[j.SVG]: oe,
|
|
1855
|
+
[j.TEXT]: ce
|
|
1786
1856
|
};
|
|
1787
|
-
function
|
|
1857
|
+
function fe(n) {
|
|
1788
1858
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1789
1859
|
return e.setAttribute("viewBox", `0 0 ${n.width} ${n.height}`), e.style.backgroundColor = "transparent", e.style.position = "absolute", e.style.width = "100%", e;
|
|
1790
1860
|
}
|
|
1791
|
-
function
|
|
1861
|
+
function ge(n, e) {
|
|
1792
1862
|
if (n === null)
|
|
1793
1863
|
return null;
|
|
1794
|
-
const t =
|
|
1795
|
-
|
|
1864
|
+
const t = g0(
|
|
1865
|
+
$({ x: e.x, y: e.y }),
|
|
1796
1866
|
e.anchor,
|
|
1797
|
-
|
|
1867
|
+
i0({ width: e.width, height: e.height })
|
|
1798
1868
|
), o = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
|
|
1799
1869
|
o.setAttribute("x", t.origin.x.toString()), o.setAttribute("y", t.origin.y.toString()), o.setAttribute("width", e.width.toString()), o.setAttribute("height", e.height.toString());
|
|
1800
1870
|
const i = e.content;
|
|
@@ -1808,33 +1878,38 @@ function ue(n, e) {
|
|
|
1808
1878
|
a !== null && a(), n.removeChild(o);
|
|
1809
1879
|
};
|
|
1810
1880
|
}
|
|
1811
|
-
async function
|
|
1881
|
+
async function pe(n) {
|
|
1812
1882
|
if (Object.keys(n).length === 0)
|
|
1813
1883
|
return {};
|
|
1814
1884
|
const e = {}, t = (i) => new Promise((a, s) => {
|
|
1815
1885
|
const r = new Image();
|
|
1816
1886
|
if (r.onload = () => a(r), r.onerror = (c) => s(c), i.includes("</svg>")) {
|
|
1817
|
-
const c = new Blob([
|
|
1818
|
-
r.src =
|
|
1887
|
+
const c = i.replace(/<\?xml[^?]*\?>\s*/g, ""), f = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), x = URL.createObjectURL(f);
|
|
1888
|
+
r.src = x;
|
|
1819
1889
|
} else
|
|
1820
1890
|
r.src = i;
|
|
1821
1891
|
}), o = Object.entries(n).map(async ([i, a]) => {
|
|
1822
1892
|
const s = await t(a);
|
|
1823
1893
|
e[i] = {
|
|
1824
|
-
type:
|
|
1894
|
+
type: S0.Browser,
|
|
1825
1895
|
image: s
|
|
1826
1896
|
};
|
|
1827
1897
|
});
|
|
1828
|
-
|
|
1898
|
+
try {
|
|
1899
|
+
await Promise.all(o);
|
|
1900
|
+
} catch (i) {
|
|
1901
|
+
console.error("Error loading images:", i);
|
|
1902
|
+
}
|
|
1903
|
+
return e;
|
|
1829
1904
|
}
|
|
1830
|
-
class
|
|
1905
|
+
class Pn {
|
|
1831
1906
|
constructor(e) {
|
|
1832
1907
|
const { objectRenderers: t, ...o } = e;
|
|
1833
1908
|
this.props = {
|
|
1834
|
-
presentation:
|
|
1909
|
+
presentation: T1(),
|
|
1835
1910
|
element: document.body,
|
|
1836
1911
|
objectRenderers: {
|
|
1837
|
-
...
|
|
1912
|
+
...ue,
|
|
1838
1913
|
...t
|
|
1839
1914
|
},
|
|
1840
1915
|
cacheDurationMinutes: 15,
|
|
@@ -1843,15 +1918,18 @@ class Mn {
|
|
|
1843
1918
|
}
|
|
1844
1919
|
/** Starts the presentation. */
|
|
1845
1920
|
async present() {
|
|
1846
|
-
const { presentation: e, element: t } = this.props, o =
|
|
1921
|
+
const { presentation: e, element: t } = this.props, o = j1(e.size), i = fe(e.size);
|
|
1847
1922
|
this.state = {
|
|
1848
1923
|
...pt,
|
|
1849
|
-
imageById: await
|
|
1924
|
+
imageById: await pe({
|
|
1925
|
+
...e.resources.images,
|
|
1926
|
+
...F1(e)
|
|
1927
|
+
}),
|
|
1850
1928
|
canvas: o,
|
|
1851
1929
|
extrasContainer: i
|
|
1852
1930
|
};
|
|
1853
|
-
const a =
|
|
1854
|
-
|
|
1931
|
+
const a = E1(e, t);
|
|
1932
|
+
N1(e, t, this.state.shortcutState, {
|
|
1855
1933
|
onNext: (r) => this.next(r),
|
|
1856
1934
|
onPrevious: (r) => this.previous(r),
|
|
1857
1935
|
onRenderSlide: (r, h) => {
|
|
@@ -1865,21 +1943,21 @@ class Mn {
|
|
|
1865
1943
|
onNavigateToSlide: (r) => this.renderSlide(r)
|
|
1866
1944
|
})
|
|
1867
1945
|
}), t.replaceChildren(), a.appendChild(o), a.appendChild(i), t.appendChild(a);
|
|
1868
|
-
const s =
|
|
1946
|
+
const s = q1(e, this.props.cacheDurationMinutes);
|
|
1869
1947
|
s !== null ? this.renderSlide(s.slideIndex, s.buildIndex) : this.renderSlide(0);
|
|
1870
1948
|
}
|
|
1871
1949
|
renderSlide(e, t = 0, o = null) {
|
|
1872
1950
|
const { objectRenderers: i, presentation: a } = this.props, { canvas: s, imageById: r } = this.state, h = this.state.slideIndex !== e;
|
|
1873
|
-
this.state.slideIndex = e, this.state.buildIndex = t, o === null &&
|
|
1951
|
+
this.state.slideIndex = e, this.state.buildIndex = t, o === null && B1({ title: a.title, slideIndex: e, buildIndex: t });
|
|
1874
1952
|
const c = a.slides[e];
|
|
1875
1953
|
if (c === void 0 || s === null)
|
|
1876
1954
|
return;
|
|
1877
1955
|
if (h || this.state.mountedExtrasCleanups.length === 0 && c.extras.length > 0) {
|
|
1878
|
-
for (const
|
|
1879
|
-
|
|
1956
|
+
for (const m of this.state.mountedExtrasCleanups)
|
|
1957
|
+
m();
|
|
1880
1958
|
this.state.mountedExtrasCleanups = [];
|
|
1881
|
-
for (const
|
|
1882
|
-
const y =
|
|
1959
|
+
for (const m of c.extras) {
|
|
1960
|
+
const y = ge(this.state.extrasContainer, m);
|
|
1883
1961
|
y !== null && this.state.mountedExtrasCleanups.push(y);
|
|
1884
1962
|
}
|
|
1885
1963
|
}
|
|
@@ -1887,29 +1965,29 @@ class Mn {
|
|
|
1887
1965
|
if (f === null)
|
|
1888
1966
|
return;
|
|
1889
1967
|
const x = {
|
|
1890
|
-
type:
|
|
1968
|
+
type: V.Browser,
|
|
1891
1969
|
context: f
|
|
1892
1970
|
};
|
|
1893
|
-
|
|
1971
|
+
D1(s, x);
|
|
1894
1972
|
const l = O1({
|
|
1895
1973
|
slide: c,
|
|
1896
1974
|
buildIndex: t,
|
|
1897
1975
|
buildTime: o
|
|
1898
1976
|
});
|
|
1899
1977
|
x.context.fillStyle = nt(a.backgroundColor), x.context.fillRect(0, 0, s.width, s.height);
|
|
1900
|
-
function u(
|
|
1901
|
-
const M = i[
|
|
1978
|
+
function u(m, y) {
|
|
1979
|
+
const M = i[m.objectType], C = l.get(m);
|
|
1902
1980
|
M === void 0 || C === void 0 || M({
|
|
1903
1981
|
ctx: x,
|
|
1904
1982
|
imageById: r,
|
|
1905
1983
|
object: C,
|
|
1906
1984
|
opacity: y,
|
|
1907
1985
|
renderObject: u,
|
|
1908
|
-
createPath2D:
|
|
1986
|
+
createPath2D: z1
|
|
1909
1987
|
});
|
|
1910
1988
|
}
|
|
1911
|
-
for (const
|
|
1912
|
-
u(
|
|
1989
|
+
for (const m of c.objects)
|
|
1990
|
+
u(m, 1);
|
|
1913
1991
|
}
|
|
1914
1992
|
next(e = !1) {
|
|
1915
1993
|
const { presentation: t } = this.props, { currentAnimationId: o, slideIndex: i, buildIndex: a } = this.state;
|
|
@@ -1919,7 +1997,7 @@ class Mn {
|
|
|
1919
1997
|
return;
|
|
1920
1998
|
const r = s.animations[a];
|
|
1921
1999
|
if (r !== void 0 && !e) {
|
|
1922
|
-
const h = performance.now(), c =
|
|
2000
|
+
const h = performance.now(), c = P1(r), f = (x) => {
|
|
1923
2001
|
const l = x - h;
|
|
1924
2002
|
l < c ? (this.renderSlide(i, a + 1, l), this.state.currentAnimationId = requestAnimationFrame(f)) : this.renderSlide(i, a + 1, null);
|
|
1925
2003
|
};
|
|
@@ -1937,7 +2015,7 @@ class Mn {
|
|
|
1937
2015
|
this.renderSlide(0, 0);
|
|
1938
2016
|
}
|
|
1939
2017
|
}
|
|
1940
|
-
function
|
|
2018
|
+
function Cn(n = 1e3) {
|
|
1941
2019
|
return {
|
|
1942
2020
|
type: u0.PAUSE,
|
|
1943
2021
|
isKey: !1,
|
|
@@ -1945,7 +2023,7 @@ function Ln(n = 1e3) {
|
|
|
1945
2023
|
shortcut: null
|
|
1946
2024
|
};
|
|
1947
2025
|
}
|
|
1948
|
-
function
|
|
2026
|
+
function En(n = null) {
|
|
1949
2027
|
return {
|
|
1950
2028
|
objects: [],
|
|
1951
2029
|
animations: [],
|
|
@@ -1958,31 +2036,31 @@ function Tn(n = null) {
|
|
|
1958
2036
|
...n
|
|
1959
2037
|
};
|
|
1960
2038
|
}
|
|
1961
|
-
function
|
|
2039
|
+
function Sn(n, e = {}) {
|
|
1962
2040
|
return {
|
|
1963
2041
|
...e,
|
|
1964
2042
|
text: n
|
|
1965
2043
|
};
|
|
1966
2044
|
}
|
|
1967
|
-
function
|
|
2045
|
+
function In(n = W.BLACK) {
|
|
1968
2046
|
return { ...n, alpha: 1 };
|
|
1969
2047
|
}
|
|
1970
|
-
function
|
|
2048
|
+
function de(n) {
|
|
1971
2049
|
for (var e = -1, t = n.length, o, i = n[t - 1], a = 0; ++e < t; )
|
|
1972
2050
|
o = i, i = n[e], a += o[1] * i[0] - o[0] * i[1];
|
|
1973
2051
|
return a / 2;
|
|
1974
2052
|
}
|
|
1975
|
-
function
|
|
2053
|
+
function xe(n) {
|
|
1976
2054
|
for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1], h = 0; ++e < t; )
|
|
1977
2055
|
i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r, h += Math.sqrt(i * i + a * a);
|
|
1978
2056
|
return h;
|
|
1979
2057
|
}
|
|
1980
|
-
function
|
|
2058
|
+
function ye(n) {
|
|
1981
2059
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
1982
2060
|
}
|
|
1983
|
-
var
|
|
1984
|
-
function
|
|
1985
|
-
if (dt) return
|
|
2061
|
+
var B0, dt;
|
|
2062
|
+
function ve() {
|
|
2063
|
+
if (dt) return B0;
|
|
1986
2064
|
dt = 1;
|
|
1987
2065
|
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 = [
|
|
1988
2066
|
5760,
|
|
@@ -2045,19 +2123,19 @@ function xe() {
|
|
|
2045
2123
|
u.index++;
|
|
2046
2124
|
}
|
|
2047
2125
|
function c(u) {
|
|
2048
|
-
var
|
|
2049
|
-
if (
|
|
2126
|
+
var m = u.path.charCodeAt(u.index);
|
|
2127
|
+
if (m === 48) {
|
|
2050
2128
|
u.param = 0, u.index++;
|
|
2051
2129
|
return;
|
|
2052
2130
|
}
|
|
2053
|
-
if (
|
|
2131
|
+
if (m === 49) {
|
|
2054
2132
|
u.param = 1, u.index++;
|
|
2055
2133
|
return;
|
|
2056
2134
|
}
|
|
2057
2135
|
u.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + u.index + ")";
|
|
2058
2136
|
}
|
|
2059
2137
|
function f(u) {
|
|
2060
|
-
var
|
|
2138
|
+
var m = u.index, y = m, M = u.max, C = !1, E = !1, L = !1, S = !1, P;
|
|
2061
2139
|
if (y >= M) {
|
|
2062
2140
|
u.err = "SvgPath: missed param (at pos " + y + ")";
|
|
2063
2141
|
return;
|
|
@@ -2068,7 +2146,7 @@ function xe() {
|
|
|
2068
2146
|
}
|
|
2069
2147
|
if (P !== 46) {
|
|
2070
2148
|
if (C = P === 48, y++, P = y < M ? u.path.charCodeAt(y) : 0, C && y < M && P && a(P)) {
|
|
2071
|
-
u.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " +
|
|
2149
|
+
u.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + m + ")";
|
|
2072
2150
|
return;
|
|
2073
2151
|
}
|
|
2074
2152
|
for (; y < M && a(u.path.charCodeAt(y)); )
|
|
@@ -2093,20 +2171,20 @@ function xe() {
|
|
|
2093
2171
|
return;
|
|
2094
2172
|
}
|
|
2095
2173
|
}
|
|
2096
|
-
u.index = y, u.param = parseFloat(u.path.slice(
|
|
2174
|
+
u.index = y, u.param = parseFloat(u.path.slice(m, y)) + 0;
|
|
2097
2175
|
}
|
|
2098
2176
|
function x(u) {
|
|
2099
|
-
var
|
|
2100
|
-
|
|
2177
|
+
var m, y;
|
|
2178
|
+
m = u.path[u.segmentStart], y = m.toLowerCase();
|
|
2101
2179
|
var M = u.data;
|
|
2102
|
-
if (y === "m" && M.length > 2 && (u.result.push([
|
|
2103
|
-
u.result.push([
|
|
2180
|
+
if (y === "m" && M.length > 2 && (u.result.push([m, M[0], M[1]]), M = M.slice(2), y = "l", m = m === "m" ? "l" : "L"), y === "r")
|
|
2181
|
+
u.result.push([m].concat(M));
|
|
2104
2182
|
else
|
|
2105
|
-
for (; M.length >= n[y] && (u.result.push([
|
|
2183
|
+
for (; M.length >= n[y] && (u.result.push([m].concat(M.splice(0, n[y]))), !!n[y]); )
|
|
2106
2184
|
;
|
|
2107
2185
|
}
|
|
2108
2186
|
function l(u) {
|
|
2109
|
-
var
|
|
2187
|
+
var m = u.max, y, M, C, E, L;
|
|
2110
2188
|
if (u.segmentStart = u.index, y = u.path.charCodeAt(u.index), M = i(y), !o(y)) {
|
|
2111
2189
|
u.err = "SvgPath: bad command " + u.path[u.index] + " (at pos " + u.index + ")";
|
|
2112
2190
|
return;
|
|
@@ -2121,26 +2199,26 @@ function xe() {
|
|
|
2121
2199
|
x(u);
|
|
2122
2200
|
return;
|
|
2123
2201
|
}
|
|
2124
|
-
u.data.push(u.param), h(u), C = !1, u.index <
|
|
2202
|
+
u.data.push(u.param), h(u), C = !1, u.index < m && u.path.charCodeAt(u.index) === 44 && (u.index++, h(u), C = !0);
|
|
2125
2203
|
}
|
|
2126
2204
|
if (!C && (u.index >= u.max || !s(u.path.charCodeAt(u.index))))
|
|
2127
2205
|
break;
|
|
2128
2206
|
}
|
|
2129
2207
|
x(u);
|
|
2130
2208
|
}
|
|
2131
|
-
return
|
|
2132
|
-
var y = new r(
|
|
2209
|
+
return B0 = function(m) {
|
|
2210
|
+
var y = new r(m), M = y.max;
|
|
2133
2211
|
for (h(y); y.index < M && !y.err.length; )
|
|
2134
2212
|
l(y);
|
|
2135
2213
|
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"), {
|
|
2136
2214
|
err: y.err,
|
|
2137
2215
|
segments: y.result
|
|
2138
2216
|
};
|
|
2139
|
-
},
|
|
2217
|
+
}, B0;
|
|
2140
2218
|
}
|
|
2141
|
-
var
|
|
2142
|
-
function
|
|
2143
|
-
if (xt) return
|
|
2219
|
+
var D0, xt;
|
|
2220
|
+
function Nt() {
|
|
2221
|
+
if (xt) return D0;
|
|
2144
2222
|
xt = 1;
|
|
2145
2223
|
function n(t, o) {
|
|
2146
2224
|
return [
|
|
@@ -2186,13 +2264,13 @@ function Rt() {
|
|
|
2186
2264
|
t * a[0] + o * a[2] + (i ? 0 : a[4]),
|
|
2187
2265
|
t * a[1] + o * a[3] + (i ? 0 : a[5])
|
|
2188
2266
|
]) : [t, o];
|
|
2189
|
-
},
|
|
2267
|
+
}, D0 = e, D0;
|
|
2190
2268
|
}
|
|
2191
|
-
var
|
|
2192
|
-
function
|
|
2193
|
-
if (yt) return
|
|
2269
|
+
var j0, yt;
|
|
2270
|
+
function we() {
|
|
2271
|
+
if (yt) return j0;
|
|
2194
2272
|
yt = 1;
|
|
2195
|
-
var n =
|
|
2273
|
+
var n = Nt(), e = {
|
|
2196
2274
|
matrix: !0,
|
|
2197
2275
|
scale: !0,
|
|
2198
2276
|
rotate: !0,
|
|
@@ -2200,7 +2278,7 @@ function ye() {
|
|
|
2200
2278
|
skewX: !0,
|
|
2201
2279
|
skewY: !0
|
|
2202
2280
|
}, t = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, o = /[\s,]+/;
|
|
2203
|
-
return
|
|
2281
|
+
return j0 = function(a) {
|
|
2204
2282
|
var s = new n(), r, h;
|
|
2205
2283
|
return a.split(t).forEach(function(c) {
|
|
2206
2284
|
if (c.length) {
|
|
@@ -2232,11 +2310,11 @@ function ye() {
|
|
|
2232
2310
|
}
|
|
2233
2311
|
}
|
|
2234
2312
|
}), s;
|
|
2235
|
-
},
|
|
2313
|
+
}, j0;
|
|
2236
2314
|
}
|
|
2237
|
-
var
|
|
2238
|
-
function
|
|
2239
|
-
if (vt) return
|
|
2315
|
+
var z0, vt;
|
|
2316
|
+
function me() {
|
|
2317
|
+
if (vt) return z0;
|
|
2240
2318
|
vt = 1;
|
|
2241
2319
|
var n = Math.PI * 2;
|
|
2242
2320
|
function e(i, a, s, r) {
|
|
@@ -2244,17 +2322,17 @@ function ve() {
|
|
|
2244
2322
|
return c > 1 && (c = 1), c < -1 && (c = -1), h * Math.acos(c);
|
|
2245
2323
|
}
|
|
2246
2324
|
function t(i, a, s, r, h, c, f, x, l, u) {
|
|
2247
|
-
var
|
|
2325
|
+
var m = u * (i - s) / 2 + l * (a - r) / 2, y = -l * (i - s) / 2 + u * (a - r) / 2, M = f * f, C = x * x, E = m * m, L = y * y, S = M * C - M * L - C * E;
|
|
2248
2326
|
S < 0 && (S = 0), S /= M * L + C * E, S = Math.sqrt(S) * (h === c ? -1 : 1);
|
|
2249
|
-
var P = S * f / x * y, F = S * -x / f *
|
|
2250
|
-
return c === 0 && J > 0 && (J -= n), c === 1 && J < 0 && (J += n), [
|
|
2327
|
+
var P = S * f / x * y, F = S * -x / f * m, H = u * P - l * F + (i + s) / 2, X = l * P + u * F + (a + r) / 2, z = (m - P) / f, G = (y - F) / x, a0 = (-m - P) / f, p0 = (-y - F) / x, c0 = e(1, 0, z, G), J = e(z, G, a0, p0);
|
|
2328
|
+
return c === 0 && J > 0 && (J -= n), c === 1 && J < 0 && (J += n), [H, X, c0, J];
|
|
2251
2329
|
}
|
|
2252
2330
|
function o(i, a) {
|
|
2253
2331
|
var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), h = Math.sin(i), c = Math.cos(i + a), f = Math.sin(i + a);
|
|
2254
2332
|
return [r, h, r - h * s, h + r * s, c + f * s, f - c * s, c, f];
|
|
2255
2333
|
}
|
|
2256
|
-
return
|
|
2257
|
-
var
|
|
2334
|
+
return z0 = function(a, s, r, h, c, f, x, l, u) {
|
|
2335
|
+
var m = Math.sin(u * n / 360), y = Math.cos(u * n / 360), M = y * (a - r) / 2 + m * (s - h) / 2, C = -m * (a - r) / 2 + y * (s - h) / 2;
|
|
2258
2336
|
if (M === 0 && C === 0)
|
|
2259
2337
|
return [];
|
|
2260
2338
|
if (x === 0 || l === 0)
|
|
@@ -2262,23 +2340,23 @@ function ve() {
|
|
|
2262
2340
|
x = Math.abs(x), l = Math.abs(l);
|
|
2263
2341
|
var E = M * M / (x * x) + C * C / (l * l);
|
|
2264
2342
|
E > 1 && (x *= Math.sqrt(E), l *= Math.sqrt(E));
|
|
2265
|
-
var L = t(a, s, r, h, c, f, x, l,
|
|
2266
|
-
F /=
|
|
2267
|
-
for (var
|
|
2343
|
+
var L = t(a, s, r, h, c, f, x, l, m, y), S = [], P = L[2], F = L[3], H = Math.max(Math.ceil(Math.abs(F) / (n / 4)), 1);
|
|
2344
|
+
F /= H;
|
|
2345
|
+
for (var X = 0; X < H; X++)
|
|
2268
2346
|
S.push(o(P, F)), P += F;
|
|
2269
|
-
return S.map(function(
|
|
2270
|
-
for (var
|
|
2271
|
-
var
|
|
2272
|
-
|
|
2273
|
-
var c0 = y *
|
|
2274
|
-
|
|
2347
|
+
return S.map(function(z) {
|
|
2348
|
+
for (var G = 0; G < z.length; G += 2) {
|
|
2349
|
+
var a0 = z[G + 0], p0 = z[G + 1];
|
|
2350
|
+
a0 *= x, p0 *= l;
|
|
2351
|
+
var c0 = y * a0 - m * p0, J = m * a0 + y * p0;
|
|
2352
|
+
z[G + 0] = c0 + L[0], z[G + 1] = J + L[1];
|
|
2275
2353
|
}
|
|
2276
|
-
return
|
|
2354
|
+
return z;
|
|
2277
2355
|
});
|
|
2278
|
-
},
|
|
2356
|
+
}, z0;
|
|
2279
2357
|
}
|
|
2280
2358
|
var U0, wt;
|
|
2281
|
-
function
|
|
2359
|
+
function Ae() {
|
|
2282
2360
|
if (wt) return U0;
|
|
2283
2361
|
wt = 1;
|
|
2284
2362
|
var n = 1e-10, e = Math.PI / 180;
|
|
@@ -2306,11 +2384,11 @@ function we() {
|
|
|
2306
2384
|
return this.rx < n * this.ry || this.ry < n * this.rx;
|
|
2307
2385
|
}, U0 = t, U0;
|
|
2308
2386
|
}
|
|
2309
|
-
var
|
|
2310
|
-
function
|
|
2311
|
-
if (
|
|
2312
|
-
|
|
2313
|
-
var n =
|
|
2387
|
+
var H0, mt;
|
|
2388
|
+
function be() {
|
|
2389
|
+
if (mt) return H0;
|
|
2390
|
+
mt = 1;
|
|
2391
|
+
var n = ve(), e = we(), t = Nt(), o = me(), i = Ae();
|
|
2314
2392
|
function a(s) {
|
|
2315
2393
|
if (!(this instanceof a))
|
|
2316
2394
|
return new a(s);
|
|
@@ -2331,38 +2409,38 @@ function Ae() {
|
|
|
2331
2409
|
}, a.prototype.__matrix = function(s) {
|
|
2332
2410
|
var r = this, h;
|
|
2333
2411
|
s.queue.length && this.iterate(function(c, f, x, l) {
|
|
2334
|
-
var u,
|
|
2412
|
+
var u, m, y, M;
|
|
2335
2413
|
switch (c[0]) {
|
|
2336
2414
|
// Process 'assymetric' commands separately
|
|
2337
2415
|
case "v":
|
|
2338
|
-
u = s.calc(0, c[1], !0),
|
|
2416
|
+
u = s.calc(0, c[1], !0), m = u[0] === 0 ? ["v", u[1]] : ["l", u[0], u[1]];
|
|
2339
2417
|
break;
|
|
2340
2418
|
case "V":
|
|
2341
|
-
u = s.calc(x, c[1], !1),
|
|
2419
|
+
u = s.calc(x, c[1], !1), m = u[0] === s.calc(x, l, !1)[0] ? ["V", u[1]] : ["L", u[0], u[1]];
|
|
2342
2420
|
break;
|
|
2343
2421
|
case "h":
|
|
2344
|
-
u = s.calc(c[1], 0, !0),
|
|
2422
|
+
u = s.calc(c[1], 0, !0), m = u[1] === 0 ? ["h", u[0]] : ["l", u[0], u[1]];
|
|
2345
2423
|
break;
|
|
2346
2424
|
case "H":
|
|
2347
|
-
u = s.calc(c[1], l, !1),
|
|
2425
|
+
u = s.calc(c[1], l, !1), m = u[1] === s.calc(x, l, !1)[1] ? ["H", u[0]] : ["L", u[0], u[1]];
|
|
2348
2426
|
break;
|
|
2349
2427
|
case "a":
|
|
2350
2428
|
case "A":
|
|
2351
2429
|
var C = s.toArray(), E = i(c[1], c[2], c[3]).transform(C);
|
|
2352
2430
|
if (C[0] * C[3] - C[1] * C[2] < 0 && (c[5] = c[5] ? "0" : "1"), u = s.calc(c[6], c[7], c[0] === "a"), c[0] === "A" && c[6] === x && c[7] === l || c[0] === "a" && c[6] === 0 && c[7] === 0) {
|
|
2353
|
-
|
|
2431
|
+
m = [c[0] === "a" ? "l" : "L", u[0], u[1]];
|
|
2354
2432
|
break;
|
|
2355
2433
|
}
|
|
2356
|
-
E.isDegenerate() ?
|
|
2434
|
+
E.isDegenerate() ? m = [c[0] === "a" ? "l" : "L", u[0], u[1]] : m = [c[0], E.rx, E.ry, E.ax, c[4], c[5], u[0], u[1]];
|
|
2357
2435
|
break;
|
|
2358
2436
|
case "m":
|
|
2359
|
-
M = f > 0, u = s.calc(c[1], c[2], M),
|
|
2437
|
+
M = f > 0, u = s.calc(c[1], c[2], M), m = ["m", u[0], u[1]];
|
|
2360
2438
|
break;
|
|
2361
2439
|
default:
|
|
2362
|
-
for (y = c[0],
|
|
2363
|
-
u = s.calc(c[h], c[h + 1], M),
|
|
2440
|
+
for (y = c[0], m = [y], M = y.toLowerCase() === y, h = 1; h < c.length; h += 2)
|
|
2441
|
+
u = s.calc(c[h], c[h + 1], M), m.push(u[0], u[1]);
|
|
2364
2442
|
}
|
|
2365
|
-
r.segments[f] =
|
|
2443
|
+
r.segments[f] = m;
|
|
2366
2444
|
}, !0);
|
|
2367
2445
|
}, a.prototype.__evaluateStack = function() {
|
|
2368
2446
|
var s, r;
|
|
@@ -2382,8 +2460,8 @@ function Ae() {
|
|
|
2382
2460
|
var x = this.segments[c], l = x[0];
|
|
2383
2461
|
l !== r || l === "m" || l === "M" ? (l === "m" && r === "z" && (s += " "), s += l, h = !1) : h = !0;
|
|
2384
2462
|
for (var u = 1; u < x.length; u++) {
|
|
2385
|
-
var
|
|
2386
|
-
u === 1 ? h &&
|
|
2463
|
+
var m = x[u];
|
|
2464
|
+
u === 1 ? h && m >= 0 && (s += " ") : m >= 0 && (s += " "), s += m;
|
|
2387
2465
|
}
|
|
2388
2466
|
r = l;
|
|
2389
2467
|
}
|
|
@@ -2428,14 +2506,14 @@ function Ae() {
|
|
|
2428
2506
|
u && (l[6] += c, l[7] += f), c = l[6] - l[6].toFixed(s), f = 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);
|
|
2429
2507
|
return;
|
|
2430
2508
|
default:
|
|
2431
|
-
x = l.length, u && (l[x - 2] += c, l[x - 1] += f), c = l[x - 2] - l[x - 2].toFixed(s), f = l[x - 1] - l[x - 1].toFixed(s), l.forEach(function(
|
|
2509
|
+
x = l.length, u && (l[x - 2] += c, l[x - 1] += f), c = l[x - 2] - l[x - 2].toFixed(s), f = l[x - 1] - l[x - 1].toFixed(s), l.forEach(function(m, y) {
|
|
2432
2510
|
y && (l[y] = +l[y].toFixed(s));
|
|
2433
2511
|
});
|
|
2434
2512
|
return;
|
|
2435
2513
|
}
|
|
2436
2514
|
}), this;
|
|
2437
2515
|
}, a.prototype.iterate = function(s, r) {
|
|
2438
|
-
var h = this.segments, c = {}, f = !1, x = 0, l = 0, u = 0,
|
|
2516
|
+
var h = this.segments, c = {}, f = !1, x = 0, l = 0, u = 0, m = 0, y, M, C;
|
|
2439
2517
|
if (r || this.__evaluateStack(), h.forEach(function(E, L) {
|
|
2440
2518
|
var S = s(E, L, x, l);
|
|
2441
2519
|
Array.isArray(S) && (c[L] = S, f = !0);
|
|
@@ -2443,7 +2521,7 @@ function Ae() {
|
|
|
2443
2521
|
switch (E[0]) {
|
|
2444
2522
|
case "m":
|
|
2445
2523
|
case "M":
|
|
2446
|
-
x = E[1] + (P ? x : 0), l = E[2] + (P ? l : 0), u = x,
|
|
2524
|
+
x = E[1] + (P ? x : 0), l = E[2] + (P ? l : 0), u = x, m = l;
|
|
2447
2525
|
return;
|
|
2448
2526
|
case "h":
|
|
2449
2527
|
case "H":
|
|
@@ -2455,7 +2533,7 @@ function Ae() {
|
|
|
2455
2533
|
return;
|
|
2456
2534
|
case "z":
|
|
2457
2535
|
case "Z":
|
|
2458
|
-
x = u, l =
|
|
2536
|
+
x = u, l = m;
|
|
2459
2537
|
return;
|
|
2460
2538
|
default:
|
|
2461
2539
|
x = E[E.length - 2] + (P ? x : 0), l = E[E.length - 1] + (P ? l : 0);
|
|
@@ -2503,22 +2581,22 @@ function Ae() {
|
|
|
2503
2581
|
}, !0), this;
|
|
2504
2582
|
}, a.prototype.unarc = function() {
|
|
2505
2583
|
return this.iterate(function(s, r, h, c) {
|
|
2506
|
-
var f, x, l, u = [],
|
|
2507
|
-
return
|
|
2584
|
+
var f, x, l, u = [], m = s[0];
|
|
2585
|
+
return m !== "A" && m !== "a" ? null : (m === "a" ? (x = h + s[6], l = c + s[7]) : (x = s[6], l = s[7]), f = o(h, c, x, l, s[4], s[5], s[1], s[2], s[3]), f.length === 0 ? [[s[0] === "a" ? "l" : "L", s[6], s[7]]] : (f.forEach(function(y) {
|
|
2508
2586
|
u.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
|
|
2509
2587
|
}), u));
|
|
2510
2588
|
}), this;
|
|
2511
2589
|
}, a.prototype.unshort = function() {
|
|
2512
2590
|
var s = this.segments, r, h, c, f, x;
|
|
2513
|
-
return this.iterate(function(l, u,
|
|
2591
|
+
return this.iterate(function(l, u, m, y) {
|
|
2514
2592
|
var M = l[0], C = M.toUpperCase(), E;
|
|
2515
|
-
u && (C === "T" ? (E = M === "t", c = s[u - 1], c[0] === "Q" ? (r = c[1] -
|
|
2593
|
+
u && (C === "T" ? (E = M === "t", c = s[u - 1], c[0] === "Q" ? (r = c[1] - m, h = c[2] - y) : c[0] === "q" ? (r = c[1] - c[3], h = c[2] - c[4]) : (r = 0, h = 0), f = -r, x = -h, E || (f += m, x += y), s[u] = [
|
|
2516
2594
|
E ? "q" : "Q",
|
|
2517
2595
|
f,
|
|
2518
2596
|
x,
|
|
2519
2597
|
l[1],
|
|
2520
2598
|
l[2]
|
|
2521
|
-
]) : C === "S" && (E = M === "s", c = s[u - 1], c[0] === "C" ? (r = c[3] -
|
|
2599
|
+
]) : C === "S" && (E = M === "s", c = s[u - 1], c[0] === "C" ? (r = c[3] - m, h = c[4] - y) : c[0] === "c" ? (r = c[3] - c[5], h = c[4] - c[6]) : (r = 0, h = 0), f = -r, x = -h, E || (f += m, x += y), s[u] = [
|
|
2522
2600
|
E ? "c" : "C",
|
|
2523
2601
|
f,
|
|
2524
2602
|
x,
|
|
@@ -2528,20 +2606,20 @@ function Ae() {
|
|
|
2528
2606
|
l[4]
|
|
2529
2607
|
]));
|
|
2530
2608
|
}), this;
|
|
2531
|
-
},
|
|
2609
|
+
}, H0 = a, H0;
|
|
2532
2610
|
}
|
|
2533
|
-
var
|
|
2534
|
-
function
|
|
2535
|
-
return
|
|
2611
|
+
var G0, At;
|
|
2612
|
+
function Me() {
|
|
2613
|
+
return At || (At = 1, G0 = be()), G0;
|
|
2536
2614
|
}
|
|
2537
|
-
var
|
|
2538
|
-
const
|
|
2539
|
-
var $0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 },
|
|
2540
|
-
function
|
|
2615
|
+
var Le = Me();
|
|
2616
|
+
const Te = /* @__PURE__ */ ye(Le);
|
|
2617
|
+
var $0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Pe = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
2618
|
+
function Ce(n) {
|
|
2541
2619
|
var e = [];
|
|
2542
|
-
return n.replace(
|
|
2620
|
+
return n.replace(Pe, function(t, o, i) {
|
|
2543
2621
|
var a = o.toLowerCase();
|
|
2544
|
-
for (i =
|
|
2622
|
+
for (i = Se(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
|
|
2545
2623
|
if (i.length === $0[a])
|
|
2546
2624
|
return i.unshift(o), e.push(i);
|
|
2547
2625
|
if (i.length < $0[a])
|
|
@@ -2550,16 +2628,16 @@ function Te(n) {
|
|
|
2550
2628
|
}
|
|
2551
2629
|
}), e;
|
|
2552
2630
|
}
|
|
2553
|
-
var
|
|
2554
|
-
function
|
|
2555
|
-
var e = n.match(
|
|
2631
|
+
var Ee = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
2632
|
+
function Se(n) {
|
|
2633
|
+
var e = n.match(Ee);
|
|
2556
2634
|
return e ? e.map(Number) : [];
|
|
2557
2635
|
}
|
|
2558
2636
|
function e0(n, e, t, o, i, a, s, r) {
|
|
2559
2637
|
return new Z0(n, e, t, o, i, a, s, r);
|
|
2560
2638
|
}
|
|
2561
2639
|
function Z0(n, e, t, o, i, a, s, r) {
|
|
2562
|
-
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 =
|
|
2640
|
+
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 = De, this.getPoint = ke, this.getDerivative = _e) : (this.getArcLength = Oe, this.getPoint = qt, this.getDerivative = Ie), this.init();
|
|
2563
2641
|
}
|
|
2564
2642
|
Z0.prototype = {
|
|
2565
2643
|
constructor: Z0,
|
|
@@ -2621,14 +2699,14 @@ Z0.prototype = {
|
|
|
2621
2699
|
return { x: a.x, y: a.y, tangentX: i.x, tangentY: i.y };
|
|
2622
2700
|
}
|
|
2623
2701
|
};
|
|
2624
|
-
function
|
|
2702
|
+
function Ie(n, e, t) {
|
|
2625
2703
|
return {
|
|
2626
2704
|
x: (1 - t) * 2 * (n[1] - n[0]) + t * 2 * (n[2] - n[1]),
|
|
2627
2705
|
y: (1 - t) * 2 * (e[1] - e[0]) + t * 2 * (e[2] - e[1])
|
|
2628
2706
|
};
|
|
2629
2707
|
}
|
|
2630
|
-
function
|
|
2631
|
-
var o =
|
|
2708
|
+
function _e(n, e, t) {
|
|
2709
|
+
var o = qt(
|
|
2632
2710
|
[3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])],
|
|
2633
2711
|
[3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])],
|
|
2634
2712
|
t
|
|
@@ -2642,15 +2720,15 @@ function W0(n, e, t, o, i) {
|
|
|
2642
2720
|
}
|
|
2643
2721
|
return s;
|
|
2644
2722
|
}
|
|
2645
|
-
function
|
|
2723
|
+
function qt(n, e, t) {
|
|
2646
2724
|
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];
|
|
2647
2725
|
return { x: o, y: i };
|
|
2648
2726
|
}
|
|
2649
|
-
function
|
|
2727
|
+
function ke(n, e, t) {
|
|
2650
2728
|
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];
|
|
2651
2729
|
return { x: o, y: i };
|
|
2652
2730
|
}
|
|
2653
|
-
function
|
|
2731
|
+
function Oe(n, e, t) {
|
|
2654
2732
|
t === void 0 && (t = 1);
|
|
2655
2733
|
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;
|
|
2656
2734
|
if (r === 0)
|
|
@@ -2660,7 +2738,7 @@ function _e(n, e, t) {
|
|
|
2660
2738
|
(l + Math.sqrt(l * l + u)) / (f + Math.sqrt(f * f + u))
|
|
2661
2739
|
)));
|
|
2662
2740
|
}
|
|
2663
|
-
var
|
|
2741
|
+
var Fe = [
|
|
2664
2742
|
[],
|
|
2665
2743
|
[],
|
|
2666
2744
|
[-0.5773502691896257, 0.5773502691896257],
|
|
@@ -2686,7 +2764,7 @@ var ke = [
|
|
|
2686
2764
|
[-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],
|
|
2687
2765
|
[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],
|
|
2688
2766
|
[-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]
|
|
2689
|
-
],
|
|
2767
|
+
], Re = [
|
|
2690
2768
|
[],
|
|
2691
2769
|
[],
|
|
2692
2770
|
[1, 1],
|
|
@@ -2712,34 +2790,34 @@ var ke = [
|
|
|
2712
2790
|
[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],
|
|
2713
2791
|
[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],
|
|
2714
2792
|
[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]
|
|
2715
|
-
],
|
|
2716
|
-
function
|
|
2717
|
-
return
|
|
2793
|
+
], Ne = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
|
|
2794
|
+
function qe(n, e) {
|
|
2795
|
+
return Ne[n][e];
|
|
2718
2796
|
}
|
|
2719
|
-
function
|
|
2797
|
+
function V0(n, e, t) {
|
|
2720
2798
|
var o = t.length - 1, i, a, s;
|
|
2721
2799
|
if (o === 0)
|
|
2722
2800
|
return 0;
|
|
2723
2801
|
if (n === 0) {
|
|
2724
2802
|
for (a = 0, s = 0; s <= o; s++)
|
|
2725
|
-
a +=
|
|
2803
|
+
a += qe(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
2726
2804
|
return a;
|
|
2727
2805
|
} else {
|
|
2728
2806
|
for (i = new Array(o), s = 0; s < o; s++)
|
|
2729
2807
|
i[s] = o * (t[s + 1] - t[s]);
|
|
2730
|
-
return
|
|
2808
|
+
return V0(n - 1, e, i);
|
|
2731
2809
|
}
|
|
2732
2810
|
}
|
|
2733
|
-
function
|
|
2734
|
-
var o =
|
|
2811
|
+
function Be(n, e, t) {
|
|
2812
|
+
var o = V0(1, t, n), i = V0(1, t, e), a = o * o + i * i;
|
|
2735
2813
|
return Math.sqrt(a);
|
|
2736
2814
|
}
|
|
2737
|
-
function
|
|
2815
|
+
function De(n, e, t) {
|
|
2738
2816
|
var o, i, a, s;
|
|
2739
2817
|
t === void 0 && (t = 1);
|
|
2740
2818
|
var r = 20;
|
|
2741
2819
|
for (o = t / 2, i = 0, a = 0; a < r; a++)
|
|
2742
|
-
s = o *
|
|
2820
|
+
s = o * Fe[r][a] + o, i += Re[r][a] * Be(n, e, s);
|
|
2743
2821
|
return o * i;
|
|
2744
2822
|
}
|
|
2745
2823
|
var C0 = Math.PI * 2;
|
|
@@ -2747,17 +2825,17 @@ function bt(n, e, t, o) {
|
|
|
2747
2825
|
var i = n * o - e * t < 0 ? -1 : 1, a = n * t + e * o;
|
|
2748
2826
|
return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
|
|
2749
2827
|
}
|
|
2750
|
-
function
|
|
2751
|
-
var f = c * (n - t) / 2 + h * (e - o) / 2, x = -h * (n - t) / 2 + c * (e - o) / 2, l = s * s, u = r * r,
|
|
2752
|
-
M < 0 && (M = 0), M /= l * y + u *
|
|
2753
|
-
var C = M * s / r * x, E = M * -r / s * f, L = c * C - h * E + (n + t) / 2, S = h * C + c * E + (e + o) / 2, P = (f - C) / s, F = (x - E) / r,
|
|
2754
|
-
return a === 0 &&
|
|
2828
|
+
function je(n, e, t, o, i, a, s, r, h, c) {
|
|
2829
|
+
var f = c * (n - t) / 2 + h * (e - o) / 2, x = -h * (n - t) / 2 + c * (e - o) / 2, l = s * s, u = r * r, m = f * f, y = x * x, M = l * u - l * y - u * m;
|
|
2830
|
+
M < 0 && (M = 0), M /= l * y + u * m, M = Math.sqrt(M) * (i === a ? -1 : 1);
|
|
2831
|
+
var C = M * s / r * x, E = M * -r / s * f, L = c * C - h * E + (n + t) / 2, S = h * C + c * E + (e + o) / 2, P = (f - C) / s, F = (x - E) / r, H = (-f - C) / s, X = (-x - E) / r, z = bt(1, 0, P, F), G = bt(P, F, H, X);
|
|
2832
|
+
return a === 0 && G > 0 && (G -= C0), a === 1 && G < 0 && (G += C0), [L, S, z, G];
|
|
2755
2833
|
}
|
|
2756
|
-
function
|
|
2834
|
+
function ze(n, e) {
|
|
2757
2835
|
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);
|
|
2758
2836
|
return [o, i, o - i * t, i + o * t, a + s * t, s - a * t, a, s];
|
|
2759
2837
|
}
|
|
2760
|
-
function
|
|
2838
|
+
function Ue(n, e, t, o, i, a, s, r, h) {
|
|
2761
2839
|
var c = Math.sin(i * C0 / 360), f = Math.cos(i * C0 / 360), x = f * (n - r) / 2 + c * (e - h) / 2, l = -c * (n - r) / 2 + f * (e - h) / 2;
|
|
2762
2840
|
if (x === 0 && l === 0)
|
|
2763
2841
|
return [];
|
|
@@ -2766,32 +2844,32 @@ function je(n, e, t, o, i, a, s, r, h) {
|
|
|
2766
2844
|
t = Math.abs(t), o = Math.abs(o);
|
|
2767
2845
|
var u = x * x / (t * t) + l * l / (o * o);
|
|
2768
2846
|
u > 1 && (t *= Math.sqrt(u), o *= Math.sqrt(u));
|
|
2769
|
-
var
|
|
2847
|
+
var m = je(n, e, r, h, a, s, t, o, c, f), y = [], M = m[2], C = m[3], E = Math.max(Math.ceil(Math.abs(C) / (C0 / 4)), 1);
|
|
2770
2848
|
C /= E;
|
|
2771
2849
|
for (var L = 0; L < E; L++)
|
|
2772
|
-
y.push(
|
|
2850
|
+
y.push(ze(M, C)), M += C;
|
|
2773
2851
|
return y.map(function(S) {
|
|
2774
2852
|
for (var P = 0; P < S.length; P += 2) {
|
|
2775
|
-
var F = S[P + 0],
|
|
2776
|
-
F *= t,
|
|
2777
|
-
var
|
|
2778
|
-
S[P + 0] =
|
|
2853
|
+
var F = S[P + 0], H = S[P + 1];
|
|
2854
|
+
F *= t, H *= o;
|
|
2855
|
+
var X = f * F - c * H, z = c * F + f * H;
|
|
2856
|
+
S[P + 0] = X + m[0], S[P + 1] = z + m[1];
|
|
2779
2857
|
}
|
|
2780
2858
|
return S;
|
|
2781
2859
|
});
|
|
2782
2860
|
}
|
|
2783
2861
|
function Mt(n, e, t, o, i, a, s, r, h) {
|
|
2784
|
-
return new
|
|
2862
|
+
return new K0(n, e, t, o, i, a, s, r, h);
|
|
2785
2863
|
}
|
|
2786
|
-
function
|
|
2787
|
-
var c = 0, f = [], x = [], l =
|
|
2864
|
+
function K0(n, e, t, o, i, a, s, r, h) {
|
|
2865
|
+
var c = 0, f = [], x = [], l = Ue(n, e, t, o, i, a, s, r, h);
|
|
2788
2866
|
l.forEach(function(u) {
|
|
2789
|
-
var
|
|
2790
|
-
c += y, f.push(y), x.push(
|
|
2867
|
+
var m = new e0(u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]), y = m.getTotalLength();
|
|
2868
|
+
c += y, f.push(y), x.push(m);
|
|
2791
2869
|
}), this.length = c, this.partialLengths = f, this.curves = x;
|
|
2792
2870
|
}
|
|
2793
|
-
|
|
2794
|
-
constructor:
|
|
2871
|
+
K0.prototype = {
|
|
2872
|
+
constructor: K0,
|
|
2795
2873
|
init: function() {
|
|
2796
2874
|
},
|
|
2797
2875
|
getTotalLength: function() {
|
|
@@ -2821,32 +2899,32 @@ V0.prototype = {
|
|
|
2821
2899
|
}
|
|
2822
2900
|
};
|
|
2823
2901
|
function t0(n, e, t, o) {
|
|
2824
|
-
return new
|
|
2902
|
+
return new I0(n, e, t, o);
|
|
2825
2903
|
}
|
|
2826
|
-
function
|
|
2904
|
+
function I0(n, e, t, o) {
|
|
2827
2905
|
this.x0 = n, this.x1 = e, this.y0 = t, this.y1 = o;
|
|
2828
2906
|
}
|
|
2829
|
-
|
|
2907
|
+
I0.prototype.getTotalLength = function() {
|
|
2830
2908
|
return Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
|
|
2831
2909
|
};
|
|
2832
|
-
|
|
2910
|
+
I0.prototype.getPointAtLength = function(n) {
|
|
2833
2911
|
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;
|
|
2834
2912
|
return { x: this.x0 + t, y: this.y0 + o };
|
|
2835
2913
|
};
|
|
2836
|
-
|
|
2914
|
+
I0.prototype.getTangentAtLength = function() {
|
|
2837
2915
|
var n = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
|
|
2838
2916
|
return { x: (this.x1 - this.x0) / n, y: (this.y1 - this.y0) / n };
|
|
2839
2917
|
};
|
|
2840
|
-
|
|
2918
|
+
I0.prototype.getPropertiesAtLength = function(n) {
|
|
2841
2919
|
var e = this.getPointAtLength(n), t = this.getTangentAtLength();
|
|
2842
2920
|
return { x: e.x, y: e.y, tangentX: t.x, tangentY: t.y };
|
|
2843
2921
|
};
|
|
2844
|
-
function
|
|
2922
|
+
function He(n) {
|
|
2845
2923
|
var e = 0, t = [], o = [];
|
|
2846
2924
|
function i(s) {
|
|
2847
2925
|
if (!s)
|
|
2848
2926
|
return null;
|
|
2849
|
-
for (var r =
|
|
2927
|
+
for (var r = Ce(s), h = [0, 0], c = [0, 0], f, x, l = 0; l < r.length; l++)
|
|
2850
2928
|
r[l][0] === "M" ? (h = [r[l][1], r[l][2]], x = [h[0], h[1]], o.push(null)) : r[l][0] === "m" ? (h = [r[l][1] + h[0], r[l][2] + h[1]], x = [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 t0(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 t0(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 t0(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 t0(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 t0(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 t0(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(x[0] - h[0], 2) + Math.pow(x[1] - h[1], 2)), o.push(new t0(h[0], x[0], h[1], x[1])), h = [x[0], x[1]]) : r[l][0] === "C" ? (f = new e0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6]), e = e + f.getTotalLength(), h = [r[l][5], r[l][6]], o.push(f)) : r[l][0] === "c" ? (f = new e0(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 + f.getTotalLength(), h = [r[l][5] + h[0], r[l][6] + h[1]], o.push(f)) : r[l][0] === "S" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? f = new e0(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]) : f = new e0(h[0], h[1], h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]), e = e + f.getTotalLength(), h = [r[l][3], r[l][4]], o.push(f)) : r[l][0] === "s" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? f = new e0(h[0], h[1], h[0] + f.d.x - f.c.x, h[1] + f.d.y - f.c.y, h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]) : f = new e0(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 + f.getTotalLength(), h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(f)) : r[l][0] === "Q" ? (h[0] != r[l][1] && h[1] != r[l][2] ? f = new e0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]) : f = new t0(r[l][1], r[l][3], r[l][2], r[l][4]), e = e + f.getTotalLength(), o.push(f), 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 ? f = new t0(h[0] + r[l][1], h[0] + r[l][3], h[1] + r[l][2], h[1] + r[l][4]) : f = new e0(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 + f.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(f)) : r[l][0] === "T" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? f = new e0(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], r[l][1], r[l][2]) : f = new t0(h[0], r[l][1], h[1], r[l][2]), o.push(f), e = e + f.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 ? f = new e0(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], h[0] + r[l][1], h[1] + r[l][2]) : f = new t0(h[0], h[0] + r[l][1], h[1], h[1] + r[l][2]), e = e + f.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(f)) : r[l][0] === "A" ? (f = new Mt(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 + f.getTotalLength(), h = [r[l][6], r[l][7]], o.push(f)) : r[l][0] === "a" && (f = new Mt(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 + f.getTotalLength(), h = [h[0] + r[l][6], h[1] + r[l][7]], o.push(f)), t.push(e);
|
|
2851
2929
|
return i;
|
|
2852
2930
|
}
|
|
@@ -2870,28 +2948,28 @@ function Ue(n) {
|
|
|
2870
2948
|
};
|
|
2871
2949
|
return i(n);
|
|
2872
2950
|
}
|
|
2873
|
-
function
|
|
2951
|
+
function O0(n, e) {
|
|
2874
2952
|
return Math.sqrt((n[0] - e[0]) * (n[0] - e[0]) + (n[1] - e[1]) * (n[1] - e[1]));
|
|
2875
2953
|
}
|
|
2876
|
-
function
|
|
2954
|
+
function Bt(n, e, t) {
|
|
2877
2955
|
return [n[0] + (e[0] - n[0]) * t, n[1] + (e[1] - n[1]) * t];
|
|
2878
2956
|
}
|
|
2879
|
-
function
|
|
2880
|
-
return
|
|
2957
|
+
function Ge(n, e) {
|
|
2958
|
+
return O0(n, e) < 1e-9;
|
|
2881
2959
|
}
|
|
2882
|
-
function
|
|
2883
|
-
let o = n.map((i, a) =>
|
|
2960
|
+
function $e(n, e, t) {
|
|
2961
|
+
let o = n.map((i, a) => We(i, e[a]));
|
|
2884
2962
|
return function(i) {
|
|
2885
2963
|
let a = o.map((s) => s(i));
|
|
2886
|
-
return t ?
|
|
2964
|
+
return t ? Ze(a) : a;
|
|
2887
2965
|
};
|
|
2888
2966
|
}
|
|
2889
|
-
function
|
|
2967
|
+
function We(n, e) {
|
|
2890
2968
|
return function(t) {
|
|
2891
2969
|
return n.map((o, i) => o + t * (e[i] - o));
|
|
2892
2970
|
};
|
|
2893
2971
|
}
|
|
2894
|
-
function
|
|
2972
|
+
function k0(n) {
|
|
2895
2973
|
return typeof n == "number" && isFinite(n);
|
|
2896
2974
|
}
|
|
2897
2975
|
const Q0 = `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).
|
|
@@ -2899,20 +2977,20 @@ Example valid ways of supplying a shape would be:
|
|
|
2899
2977
|
[[0, 0], [10, 0], [10, 10]]
|
|
2900
2978
|
"M0,0 L10,0 L10,10Z"
|
|
2901
2979
|
`;
|
|
2902
|
-
function We(n) {
|
|
2903
|
-
return new Me(n).abs();
|
|
2904
|
-
}
|
|
2905
2980
|
function Ye(n) {
|
|
2906
|
-
return
|
|
2981
|
+
return new Te(n).abs();
|
|
2907
2982
|
}
|
|
2908
2983
|
function Xe(n) {
|
|
2984
|
+
return n.toString().split("M").map((e, t) => (e = e.trim(), t && e ? "M" + e : e)).filter((e) => e);
|
|
2985
|
+
}
|
|
2986
|
+
function Ze(n) {
|
|
2909
2987
|
return "M" + n.join("L") + "Z";
|
|
2910
2988
|
}
|
|
2911
|
-
function
|
|
2912
|
-
let t =
|
|
2913
|
-
return
|
|
2989
|
+
function Ve(n, e) {
|
|
2990
|
+
let t = Ye(n);
|
|
2991
|
+
return Ke(t) || Qe(t, e);
|
|
2914
2992
|
}
|
|
2915
|
-
function
|
|
2993
|
+
function Ke(n) {
|
|
2916
2994
|
let e = n.segments || [], t = [];
|
|
2917
2995
|
if (!e.length || e[0][0] !== "M")
|
|
2918
2996
|
return !1;
|
|
@@ -2931,11 +3009,11 @@ function Ze(n) {
|
|
|
2931
3009
|
}
|
|
2932
3010
|
return t.length ? { ring: t } : !1;
|
|
2933
3011
|
}
|
|
2934
|
-
function
|
|
2935
|
-
let t =
|
|
3012
|
+
function Qe(n, e) {
|
|
3013
|
+
let t = Xe(n)[0], o = [], i, a, s = 3;
|
|
2936
3014
|
if (!t)
|
|
2937
3015
|
throw new TypeError(Q0);
|
|
2938
|
-
a =
|
|
3016
|
+
a = Je(t), i = a.getTotalLength(), e && k0(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
|
|
2939
3017
|
for (let r = 0; r < s; r++) {
|
|
2940
3018
|
let h = a.getPointAtLength(i * r / s);
|
|
2941
3019
|
o.push([h.x, h.y]);
|
|
@@ -2945,90 +3023,90 @@ function Ke(n, e) {
|
|
|
2945
3023
|
skipBisect: !0
|
|
2946
3024
|
};
|
|
2947
3025
|
}
|
|
2948
|
-
function
|
|
3026
|
+
function Je(n) {
|
|
2949
3027
|
if (typeof window < "u" && window && window.document)
|
|
2950
3028
|
try {
|
|
2951
3029
|
let e = window.document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2952
3030
|
return e.setAttributeNS(null, "d", n), e;
|
|
2953
3031
|
} catch {
|
|
2954
3032
|
}
|
|
2955
|
-
return
|
|
3033
|
+
return He(n);
|
|
2956
3034
|
}
|
|
2957
3035
|
function Lt(n, e) {
|
|
2958
|
-
const t = n.length + e, o =
|
|
3036
|
+
const t = n.length + e, o = xe(n) / e;
|
|
2959
3037
|
let i = 0, a = 0, s = o / 2;
|
|
2960
3038
|
for (; n.length < t; ) {
|
|
2961
|
-
let r = n[i], h = n[(i + 1) % n.length], c =
|
|
3039
|
+
let r = n[i], h = n[(i + 1) % n.length], c = O0(r, h);
|
|
2962
3040
|
if (s <= a + c) {
|
|
2963
|
-
n.splice(i + 1, 0, c ?
|
|
3041
|
+
n.splice(i + 1, 0, c ? Bt(r, h, (s - a) / c) : r.slice(0)), s += o;
|
|
2964
3042
|
continue;
|
|
2965
3043
|
}
|
|
2966
3044
|
a += c, i++;
|
|
2967
3045
|
}
|
|
2968
3046
|
}
|
|
2969
|
-
function
|
|
3047
|
+
function tn(n, e = 1 / 0) {
|
|
2970
3048
|
for (let t = 0; t < n.length; t++) {
|
|
2971
3049
|
let o = n[t], i = t === n.length - 1 ? n[0] : n[t + 1];
|
|
2972
|
-
for (;
|
|
2973
|
-
i =
|
|
3050
|
+
for (; O0(o, i) > e; )
|
|
3051
|
+
i = Bt(o, i, 0.5), n.splice(t + 1, 0, i);
|
|
2974
3052
|
}
|
|
2975
3053
|
}
|
|
2976
3054
|
function Tt(n, e) {
|
|
2977
3055
|
let t, o, i;
|
|
2978
3056
|
if (typeof n == "string") {
|
|
2979
|
-
let a =
|
|
3057
|
+
let a = Ve(n, e);
|
|
2980
3058
|
n = a.ring, i = a.skipBisect;
|
|
2981
3059
|
} else if (!Array.isArray(n))
|
|
2982
3060
|
throw new TypeError(Q0);
|
|
2983
|
-
if (t = n.slice(0), !
|
|
3061
|
+
if (t = n.slice(0), !en(t))
|
|
2984
3062
|
throw new TypeError(Q0);
|
|
2985
|
-
return t.length > 1 &&
|
|
3063
|
+
return t.length > 1 && Ge(t[0], t[t.length - 1]) && t.pop(), o = de(t), o > 0 && t.reverse(), !i && e && k0(e) && e > 0 && tn(t, e), t;
|
|
2986
3064
|
}
|
|
2987
|
-
function
|
|
3065
|
+
function en(n) {
|
|
2988
3066
|
return n.every(function(e) {
|
|
2989
|
-
return Array.isArray(e) && e.length >= 2 &&
|
|
3067
|
+
return Array.isArray(e) && e.length >= 2 && k0(e[0]) && k0(e[1]);
|
|
2990
3068
|
});
|
|
2991
3069
|
}
|
|
2992
|
-
function
|
|
3070
|
+
function nn(n, e) {
|
|
2993
3071
|
let t = n.length, o = 1 / 0, i, a, s;
|
|
2994
3072
|
for (let r = 0; r < t; r++)
|
|
2995
3073
|
a = 0, e.forEach(function(h, c) {
|
|
2996
|
-
let f =
|
|
3074
|
+
let f = O0(n[(r + c) % t], h);
|
|
2997
3075
|
a += f * f;
|
|
2998
3076
|
}), a < o && (o = a, i = r);
|
|
2999
3077
|
i && (s = n.splice(0, i), n.splice(n.length, 0, ...s));
|
|
3000
3078
|
}
|
|
3001
|
-
function
|
|
3002
|
-
let i = Tt(n, t), a = Tt(e, t), s =
|
|
3079
|
+
function rn(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
|
|
3080
|
+
let i = Tt(n, t), a = Tt(e, t), s = on(i, a, o);
|
|
3003
3081
|
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);
|
|
3004
3082
|
}
|
|
3005
|
-
function
|
|
3083
|
+
function on(n, e, t) {
|
|
3006
3084
|
let o;
|
|
3007
|
-
return o = n.length - e.length, Lt(n, o < 0 ? o * -1 : 0), Lt(e, o > 0 ? o : 0),
|
|
3085
|
+
return o = n.length - e.length, Lt(n, o < 0 ? o * -1 : 0), Lt(e, o > 0 ? o : 0), nn(n, e), $e(n, e, t);
|
|
3008
3086
|
}
|
|
3009
|
-
var
|
|
3010
|
-
function
|
|
3011
|
-
if (Pt) return
|
|
3012
|
-
Pt = 1,
|
|
3087
|
+
var _0 = { exports: {} }, Pt;
|
|
3088
|
+
function sn() {
|
|
3089
|
+
if (Pt) return _0.exports;
|
|
3090
|
+
Pt = 1, _0.exports = n, _0.exports.default = n;
|
|
3013
3091
|
function n(g, d, p) {
|
|
3014
3092
|
p = p || 2;
|
|
3015
|
-
var v = d && d.length, w = v ? d[0] * p : g.length,
|
|
3016
|
-
if (!
|
|
3017
|
-
var T, O, _, U, B, R,
|
|
3018
|
-
if (v && (
|
|
3093
|
+
var v = d && d.length, w = v ? d[0] * p : g.length, A = e(g, 0, w, p, !0), b = [];
|
|
3094
|
+
if (!A || A.next === A.prev) return b;
|
|
3095
|
+
var T, O, _, U, B, R, Y;
|
|
3096
|
+
if (v && (A = h(g, d, A, p)), g.length > 80 * p) {
|
|
3019
3097
|
T = _ = g[0], O = U = g[1];
|
|
3020
3098
|
for (var D = p; D < w; D += p)
|
|
3021
3099
|
B = g[D], R = g[D + 1], B < T && (T = B), R < O && (O = R), B > _ && (_ = B), R > U && (U = R);
|
|
3022
|
-
|
|
3100
|
+
Y = Math.max(_ - T, U - O), Y = Y !== 0 ? 32767 / Y : 0;
|
|
3023
3101
|
}
|
|
3024
|
-
return o(
|
|
3102
|
+
return o(A, b, p, T, O, Y, 0), b;
|
|
3025
3103
|
}
|
|
3026
3104
|
function e(g, d, p, v, w) {
|
|
3027
|
-
var
|
|
3028
|
-
if (w ===
|
|
3029
|
-
for (
|
|
3105
|
+
var A, b;
|
|
3106
|
+
if (w === F0(g, d, p, v) > 0)
|
|
3107
|
+
for (A = d; A < p; A += v) b = p0(A, g[A], g[A + 1], b);
|
|
3030
3108
|
else
|
|
3031
|
-
for (
|
|
3109
|
+
for (A = p - v; A >= d; A -= v) b = p0(A, g[A], g[A + 1], b);
|
|
3032
3110
|
return b && S(b, b.next) && (c0(b), b = b.next), b;
|
|
3033
3111
|
}
|
|
3034
3112
|
function t(g, d) {
|
|
@@ -3044,16 +3122,16 @@ function rn() {
|
|
|
3044
3122
|
while (v || p !== d);
|
|
3045
3123
|
return d;
|
|
3046
3124
|
}
|
|
3047
|
-
function o(g, d, p, v, w,
|
|
3125
|
+
function o(g, d, p, v, w, A, b) {
|
|
3048
3126
|
if (g) {
|
|
3049
|
-
!b &&
|
|
3127
|
+
!b && A && u(g, v, w, A);
|
|
3050
3128
|
for (var T = g, O, _; g.prev !== g.next; ) {
|
|
3051
|
-
if (O = g.prev, _ = g.next,
|
|
3129
|
+
if (O = g.prev, _ = g.next, A ? a(g, v, w, A) : i(g)) {
|
|
3052
3130
|
d.push(O.i / p | 0), d.push(g.i / p | 0), d.push(_.i / p | 0), c0(g), g = _.next, T = _.next;
|
|
3053
3131
|
continue;
|
|
3054
3132
|
}
|
|
3055
3133
|
if (g = _, g === T) {
|
|
3056
|
-
b ? b === 1 ? (g = s(t(g), d, p), o(g, d, p, v, w,
|
|
3134
|
+
b ? b === 1 ? (g = s(t(g), d, p), o(g, d, p, v, w, A, 2)) : b === 2 && r(g, d, p, v, w, A) : o(t(g), d, p, v, w, A, 1);
|
|
3057
3135
|
break;
|
|
3058
3136
|
}
|
|
3059
3137
|
}
|
|
@@ -3062,25 +3140,25 @@ function rn() {
|
|
|
3062
3140
|
function i(g) {
|
|
3063
3141
|
var d = g.prev, p = g, v = g.next;
|
|
3064
3142
|
if (L(d, p, v) >= 0) return !1;
|
|
3065
|
-
for (var w = d.x,
|
|
3066
|
-
if (D.x >= U && D.x <= R && D.y >= B && D.y <=
|
|
3143
|
+
for (var w = d.x, A = p.x, b = v.x, T = d.y, O = p.y, _ = v.y, U = w < A ? w < b ? w : b : A < b ? A : b, B = T < O ? T < _ ? T : _ : O < _ ? O : _, R = w > A ? w > b ? w : b : A > b ? A : b, Y = T > O ? T > _ ? T : _ : O > _ ? O : _, D = v.next; D !== d; ) {
|
|
3144
|
+
if (D.x >= U && D.x <= R && D.y >= B && D.y <= Y && C(w, T, A, O, b, _, D.x, D.y) && L(D.prev, D, D.next) >= 0) return !1;
|
|
3067
3145
|
D = D.next;
|
|
3068
3146
|
}
|
|
3069
3147
|
return !0;
|
|
3070
3148
|
}
|
|
3071
3149
|
function a(g, d, p, v) {
|
|
3072
|
-
var w = g.prev,
|
|
3073
|
-
if (L(w,
|
|
3074
|
-
for (var T = w.x, O =
|
|
3075
|
-
if (N.x >=
|
|
3150
|
+
var w = g.prev, A = g, b = g.next;
|
|
3151
|
+
if (L(w, A, b) >= 0) return !1;
|
|
3152
|
+
for (var T = w.x, O = A.x, _ = b.x, U = w.y, B = A.y, R = b.y, Y = T < O ? T < _ ? T : _ : O < _ ? O : _, D = U < B ? U < R ? U : R : B < R ? B : R, L0 = T > O ? T > _ ? T : _ : O > _ ? O : _, T0 = U > B ? U > R ? U : R : B > R ? B : R, it = y(Y, D, d, p, v), ot = y(L0, T0, d, p, v), N = g.prevZ, q = g.nextZ; N && N.z >= it && q && q.z <= ot; ) {
|
|
3153
|
+
if (N.x >= Y && N.x <= L0 && N.y >= D && N.y <= T0 && N !== w && N !== b && C(T, U, O, B, _, R, N.x, N.y) && L(N.prev, N, N.next) >= 0 || (N = N.prevZ, q.x >= Y && q.x <= L0 && q.y >= D && q.y <= T0 && q !== w && q !== b && C(T, U, O, B, _, R, q.x, q.y) && L(q.prev, q, q.next) >= 0)) return !1;
|
|
3076
3154
|
q = q.nextZ;
|
|
3077
3155
|
}
|
|
3078
3156
|
for (; N && N.z >= it; ) {
|
|
3079
|
-
if (N.x >=
|
|
3157
|
+
if (N.x >= Y && N.x <= L0 && N.y >= D && N.y <= T0 && N !== w && N !== b && C(T, U, O, B, _, R, N.x, N.y) && L(N.prev, N, N.next) >= 0) return !1;
|
|
3080
3158
|
N = N.prevZ;
|
|
3081
3159
|
}
|
|
3082
3160
|
for (; q && q.z <= ot; ) {
|
|
3083
|
-
if (q.x >=
|
|
3161
|
+
if (q.x >= Y && q.x <= L0 && q.y >= D && q.y <= T0 && q !== w && q !== b && C(T, U, O, B, _, R, q.x, q.y) && L(q.prev, q, q.next) >= 0) return !1;
|
|
3084
3162
|
q = q.nextZ;
|
|
3085
3163
|
}
|
|
3086
3164
|
return !0;
|
|
@@ -3088,18 +3166,18 @@ function rn() {
|
|
|
3088
3166
|
function s(g, d, p) {
|
|
3089
3167
|
var v = g;
|
|
3090
3168
|
do {
|
|
3091
|
-
var w = v.prev,
|
|
3092
|
-
!S(w,
|
|
3169
|
+
var w = v.prev, A = v.next.next;
|
|
3170
|
+
!S(w, A) && P(w, v, v.next, A) && z(w, A) && z(A, w) && (d.push(w.i / p | 0), d.push(v.i / p | 0), d.push(A.i / p | 0), c0(v), c0(v.next), v = g = A), v = v.next;
|
|
3093
3171
|
} while (v !== g);
|
|
3094
3172
|
return t(v);
|
|
3095
3173
|
}
|
|
3096
|
-
function r(g, d, p, v, w,
|
|
3174
|
+
function r(g, d, p, v, w, A) {
|
|
3097
3175
|
var b = g;
|
|
3098
3176
|
do {
|
|
3099
3177
|
for (var T = b.next.next; T !== b.prev; ) {
|
|
3100
3178
|
if (b.i !== T.i && E(b, T)) {
|
|
3101
|
-
var O =
|
|
3102
|
-
b = t(b, b.next), O = t(O, O.next), o(b, d, p, v, w,
|
|
3179
|
+
var O = a0(b, T);
|
|
3180
|
+
b = t(b, b.next), O = t(O, O.next), o(b, d, p, v, w, A, 0), o(O, d, p, v, w, A, 0);
|
|
3103
3181
|
return;
|
|
3104
3182
|
}
|
|
3105
3183
|
T = T.next;
|
|
@@ -3108,11 +3186,11 @@ function rn() {
|
|
|
3108
3186
|
} while (b !== g);
|
|
3109
3187
|
}
|
|
3110
3188
|
function h(g, d, p, v) {
|
|
3111
|
-
var w = [],
|
|
3112
|
-
for (
|
|
3113
|
-
T = d[
|
|
3114
|
-
for (w.sort(c),
|
|
3115
|
-
p = f(w[
|
|
3189
|
+
var w = [], A, b, T, O, _;
|
|
3190
|
+
for (A = 0, b = d.length; A < b; A++)
|
|
3191
|
+
T = d[A] * v, O = A < b - 1 ? d[A + 1] * v : g.length, _ = e(g, T, O, v, !1), _ === _.next && (_.steiner = !0), w.push(M(_));
|
|
3192
|
+
for (w.sort(c), A = 0; A < w.length; A++)
|
|
3193
|
+
p = f(w[A], p);
|
|
3116
3194
|
return p;
|
|
3117
3195
|
}
|
|
3118
3196
|
function c(g, d) {
|
|
@@ -3122,15 +3200,15 @@ function rn() {
|
|
|
3122
3200
|
var p = x(g, d);
|
|
3123
3201
|
if (!p)
|
|
3124
3202
|
return d;
|
|
3125
|
-
var v =
|
|
3203
|
+
var v = a0(p, g);
|
|
3126
3204
|
return t(v, v.next), t(p, p.next);
|
|
3127
3205
|
}
|
|
3128
3206
|
function x(g, d) {
|
|
3129
|
-
var p = d, v = g.x, w = g.y,
|
|
3207
|
+
var p = d, v = g.x, w = g.y, A = -1 / 0, b;
|
|
3130
3208
|
do {
|
|
3131
3209
|
if (w <= p.y && w >= p.next.y && p.next.y !== p.y) {
|
|
3132
3210
|
var T = p.x + (w - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
|
|
3133
|
-
if (T <= v && T >
|
|
3211
|
+
if (T <= v && T > A && (A = T, b = p.x < p.next.x ? p : p.next, T === v))
|
|
3134
3212
|
return b;
|
|
3135
3213
|
}
|
|
3136
3214
|
p = p.next;
|
|
@@ -3139,7 +3217,7 @@ function rn() {
|
|
|
3139
3217
|
var O = b, _ = b.x, U = b.y, B = 1 / 0, R;
|
|
3140
3218
|
p = b;
|
|
3141
3219
|
do
|
|
3142
|
-
v >= p.x && p.x >= _ && v !== p.x && C(w < U ? v :
|
|
3220
|
+
v >= p.x && p.x >= _ && v !== p.x && C(w < U ? v : A, w, _, U, w < U ? A : v, w, p.x, p.y) && (R = Math.abs(w - p.y) / (v - p.x), z(p, g) && (R < B || R === B && (p.x > b.x || p.x === b.x && l(b, p))) && (b = p, B = R)), p = p.next;
|
|
3143
3221
|
while (p !== O);
|
|
3144
3222
|
return b;
|
|
3145
3223
|
}
|
|
@@ -3151,19 +3229,19 @@ function rn() {
|
|
|
3151
3229
|
do
|
|
3152
3230
|
w.z === 0 && (w.z = y(w.x, w.y, d, p, v)), w.prevZ = w.prev, w.nextZ = w.next, w = w.next;
|
|
3153
3231
|
while (w !== g);
|
|
3154
|
-
w.prevZ.nextZ = null, w.prevZ = null,
|
|
3232
|
+
w.prevZ.nextZ = null, w.prevZ = null, m(w);
|
|
3155
3233
|
}
|
|
3156
|
-
function
|
|
3157
|
-
var d, p, v, w,
|
|
3234
|
+
function m(g) {
|
|
3235
|
+
var d, p, v, w, A, b, T, O, _ = 1;
|
|
3158
3236
|
do {
|
|
3159
|
-
for (p = g, g = null,
|
|
3237
|
+
for (p = g, g = null, A = null, b = 0; p; ) {
|
|
3160
3238
|
for (b++, v = p, T = 0, d = 0; d < _ && (T++, v = v.nextZ, !!v); d++)
|
|
3161
3239
|
;
|
|
3162
3240
|
for (O = _; T > 0 || O > 0 && v; )
|
|
3163
|
-
T !== 0 && (O === 0 || !v || p.z <= v.z) ? (w = p, p = p.nextZ, T--) : (w = v, v = v.nextZ, O--),
|
|
3241
|
+
T !== 0 && (O === 0 || !v || p.z <= v.z) ? (w = p, p = p.nextZ, T--) : (w = v, v = v.nextZ, O--), A ? A.nextZ = w : g = w, w.prevZ = A, A = w;
|
|
3164
3242
|
p = v;
|
|
3165
3243
|
}
|
|
3166
|
-
|
|
3244
|
+
A.nextZ = null, _ *= 2;
|
|
3167
3245
|
} while (b > 1);
|
|
3168
3246
|
return g;
|
|
3169
3247
|
}
|
|
@@ -3177,12 +3255,12 @@ function rn() {
|
|
|
3177
3255
|
while (d !== g);
|
|
3178
3256
|
return p;
|
|
3179
3257
|
}
|
|
3180
|
-
function C(g, d, p, v, w,
|
|
3181
|
-
return (w - b) * (d - T) >= (g - b) * (
|
|
3258
|
+
function C(g, d, p, v, w, A, b, T) {
|
|
3259
|
+
return (w - b) * (d - T) >= (g - b) * (A - T) && (g - b) * (v - T) >= (p - b) * (d - T) && (p - b) * (A - T) >= (w - b) * (v - T);
|
|
3182
3260
|
}
|
|
3183
3261
|
function E(g, d) {
|
|
3184
|
-
return g.next.i !== d.i && g.prev.i !== d.i && !
|
|
3185
|
-
(
|
|
3262
|
+
return g.next.i !== d.i && g.prev.i !== d.i && !X(g, d) && // dones't intersect other edges
|
|
3263
|
+
(z(g, d) && z(d, g) && G(g, d) && // locally visible
|
|
3186
3264
|
(L(g.prev, g, d.prev) || L(g, d.prev, d)) || // does not create opposite-facing sectors
|
|
3187
3265
|
S(g, d) && L(g.prev, g, g.next) > 0 && L(d.prev, d, d.next) > 0);
|
|
3188
3266
|
}
|
|
@@ -3193,16 +3271,16 @@ function rn() {
|
|
|
3193
3271
|
return g.x === d.x && g.y === d.y;
|
|
3194
3272
|
}
|
|
3195
3273
|
function P(g, d, p, v) {
|
|
3196
|
-
var w =
|
|
3197
|
-
return !!(w !==
|
|
3274
|
+
var w = H(L(g, d, p)), A = H(L(g, d, v)), b = H(L(p, v, g)), T = H(L(p, v, d));
|
|
3275
|
+
return !!(w !== A && b !== T || w === 0 && F(g, p, d) || A === 0 && F(g, v, d) || b === 0 && F(p, g, v) || T === 0 && F(p, d, v));
|
|
3198
3276
|
}
|
|
3199
3277
|
function F(g, d, p) {
|
|
3200
3278
|
return d.x <= Math.max(g.x, p.x) && d.x >= Math.min(g.x, p.x) && d.y <= Math.max(g.y, p.y) && d.y >= Math.min(g.y, p.y);
|
|
3201
3279
|
}
|
|
3202
|
-
function
|
|
3280
|
+
function H(g) {
|
|
3203
3281
|
return g > 0 ? 1 : g < 0 ? -1 : 0;
|
|
3204
3282
|
}
|
|
3205
|
-
function
|
|
3283
|
+
function X(g, d) {
|
|
3206
3284
|
var p = g;
|
|
3207
3285
|
do {
|
|
3208
3286
|
if (p.i !== g.i && p.next.i !== g.i && p.i !== d.i && p.next.i !== d.i && P(p, p.next, g, d)) return !0;
|
|
@@ -3210,21 +3288,21 @@ function rn() {
|
|
|
3210
3288
|
} while (p !== g);
|
|
3211
3289
|
return !1;
|
|
3212
3290
|
}
|
|
3213
|
-
function
|
|
3291
|
+
function z(g, d) {
|
|
3214
3292
|
return L(g.prev, g, g.next) < 0 ? L(g, d, g.next) >= 0 && L(g, g.prev, d) >= 0 : L(g, d, g.prev) < 0 || L(g, g.next, d) < 0;
|
|
3215
3293
|
}
|
|
3216
|
-
function
|
|
3217
|
-
var p = g, v = !1, w = (g.x + d.x) / 2,
|
|
3294
|
+
function G(g, d) {
|
|
3295
|
+
var p = g, v = !1, w = (g.x + d.x) / 2, A = (g.y + d.y) / 2;
|
|
3218
3296
|
do
|
|
3219
|
-
p.y >
|
|
3297
|
+
p.y > A != p.next.y > A && p.next.y !== p.y && w < (p.next.x - p.x) * (A - p.y) / (p.next.y - p.y) + p.x && (v = !v), p = p.next;
|
|
3220
3298
|
while (p !== g);
|
|
3221
3299
|
return v;
|
|
3222
3300
|
}
|
|
3223
|
-
function
|
|
3224
|
-
var p = new J(g.i, g.x, g.y), v = new J(d.i, d.x, d.y), w = g.next,
|
|
3225
|
-
return g.next = d, d.prev = g, p.next = w, w.prev = p, v.next = p, p.prev = v,
|
|
3301
|
+
function a0(g, d) {
|
|
3302
|
+
var p = new J(g.i, g.x, g.y), v = new J(d.i, d.x, d.y), w = g.next, A = d.prev;
|
|
3303
|
+
return g.next = d, d.prev = g, p.next = w, w.prev = p, v.next = p, p.prev = v, A.next = v, v.prev = A, v;
|
|
3226
3304
|
}
|
|
3227
|
-
function
|
|
3305
|
+
function p0(g, d, p, v) {
|
|
3228
3306
|
var w = new J(g, d, p);
|
|
3229
3307
|
return v ? (w.next = v.next, w.prev = v, v.next.prev = w, v.next = w) : (w.prev = w, w.next = w), w;
|
|
3230
3308
|
}
|
|
@@ -3235,41 +3313,41 @@ function rn() {
|
|
|
3235
3313
|
this.i = g, this.x = d, this.y = p, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1;
|
|
3236
3314
|
}
|
|
3237
3315
|
n.deviation = function(g, d, p, v) {
|
|
3238
|
-
var w = d && d.length,
|
|
3316
|
+
var w = d && d.length, A = w ? d[0] * p : g.length, b = Math.abs(F0(g, 0, A, p));
|
|
3239
3317
|
if (w)
|
|
3240
3318
|
for (var T = 0, O = d.length; T < O; T++) {
|
|
3241
3319
|
var _ = d[T] * p, U = T < O - 1 ? d[T + 1] * p : g.length;
|
|
3242
|
-
b -= Math.abs(
|
|
3320
|
+
b -= Math.abs(F0(g, _, U, p));
|
|
3243
3321
|
}
|
|
3244
3322
|
var B = 0;
|
|
3245
3323
|
for (T = 0; T < v.length; T += 3) {
|
|
3246
|
-
var R = v[T] * p,
|
|
3324
|
+
var R = v[T] * p, Y = v[T + 1] * p, D = v[T + 2] * p;
|
|
3247
3325
|
B += Math.abs(
|
|
3248
|
-
(g[R] - g[D]) * (g[
|
|
3326
|
+
(g[R] - g[D]) * (g[Y + 1] - g[R + 1]) - (g[R] - g[Y]) * (g[D + 1] - g[R + 1])
|
|
3249
3327
|
);
|
|
3250
3328
|
}
|
|
3251
3329
|
return b === 0 && B === 0 ? 0 : Math.abs((B - b) / b);
|
|
3252
3330
|
};
|
|
3253
|
-
function
|
|
3254
|
-
for (var w = 0,
|
|
3255
|
-
w += (g[b] - g[
|
|
3331
|
+
function F0(g, d, p, v) {
|
|
3332
|
+
for (var w = 0, A = d, b = p - v; A < p; A += v)
|
|
3333
|
+
w += (g[b] - g[A]) * (g[A + 1] + g[b + 1]), b = A;
|
|
3256
3334
|
return w;
|
|
3257
3335
|
}
|
|
3258
3336
|
return n.flatten = function(g) {
|
|
3259
3337
|
for (var d = g[0][0].length, p = { vertices: [], holes: [], dimensions: d }, v = 0, w = 0; w < g.length; w++) {
|
|
3260
|
-
for (var
|
|
3261
|
-
for (var b = 0; b < d; b++) p.vertices.push(g[w][
|
|
3338
|
+
for (var A = 0; A < g[w].length; A++)
|
|
3339
|
+
for (var b = 0; b < d; b++) p.vertices.push(g[w][A][b]);
|
|
3262
3340
|
w > 0 && (v += g[w - 1].length, p.holes.push(v));
|
|
3263
3341
|
}
|
|
3264
3342
|
return p;
|
|
3265
|
-
},
|
|
3343
|
+
}, _0.exports;
|
|
3266
3344
|
}
|
|
3267
|
-
|
|
3268
|
-
function
|
|
3345
|
+
sn();
|
|
3346
|
+
function Dt(n, e) {
|
|
3269
3347
|
return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
|
|
3270
3348
|
}
|
|
3271
|
-
function
|
|
3272
|
-
return n.length === 1 && (n =
|
|
3349
|
+
function an(n) {
|
|
3350
|
+
return n.length === 1 && (n = hn(n)), {
|
|
3273
3351
|
left: function(e, t, o, i) {
|
|
3274
3352
|
for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
|
|
3275
3353
|
var a = o + i >>> 1;
|
|
@@ -3286,31 +3364,31 @@ function on(n) {
|
|
|
3286
3364
|
}
|
|
3287
3365
|
};
|
|
3288
3366
|
}
|
|
3289
|
-
function
|
|
3367
|
+
function hn(n) {
|
|
3290
3368
|
return function(e, t) {
|
|
3291
|
-
return
|
|
3369
|
+
return Dt(n(e), t);
|
|
3292
3370
|
};
|
|
3293
3371
|
}
|
|
3294
|
-
|
|
3295
|
-
function
|
|
3296
|
-
const o =
|
|
3372
|
+
an(Dt);
|
|
3373
|
+
function _n(n, e, t = 3) {
|
|
3374
|
+
const o = rn(n, e, { maxSegmentLength: t });
|
|
3297
3375
|
return {
|
|
3298
3376
|
check: (i) => typeof i == "string",
|
|
3299
3377
|
interpolate: (i, a, s) => o(s)
|
|
3300
3378
|
};
|
|
3301
3379
|
}
|
|
3302
|
-
function
|
|
3380
|
+
function kn(n) {
|
|
3303
3381
|
const e = (o) => n.width * o, t = (o) => n.height * o;
|
|
3304
3382
|
return {
|
|
3305
3383
|
scaleX: e,
|
|
3306
3384
|
scaleY: t,
|
|
3307
|
-
position: (o, i) =>
|
|
3385
|
+
position: (o, i) => $({
|
|
3308
3386
|
x: e(o),
|
|
3309
3387
|
y: t(i)
|
|
3310
3388
|
})
|
|
3311
3389
|
};
|
|
3312
3390
|
}
|
|
3313
|
-
function
|
|
3391
|
+
function On(n) {
|
|
3314
3392
|
const e = [];
|
|
3315
3393
|
if (n.isAllKey) {
|
|
3316
3394
|
for (let t = 0; t <= n.animations.length; t++)
|
|
@@ -3322,47 +3400,49 @@ function In(n) {
|
|
|
3322
3400
|
}), n.isEndKey && e[e.length - 1] !== n.animations.length && e.push(n.animations.length), e;
|
|
3323
3401
|
}
|
|
3324
3402
|
export {
|
|
3325
|
-
|
|
3403
|
+
x0 as Alignment,
|
|
3326
3404
|
n0 as Anchor,
|
|
3327
3405
|
et as Animate,
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3406
|
+
xn as Arrow,
|
|
3407
|
+
Pn as BrowserCanvasRenderer,
|
|
3408
|
+
yn as Circle,
|
|
3409
|
+
W as Color,
|
|
3332
3410
|
tt as Easing,
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3411
|
+
cn as FadeIn,
|
|
3412
|
+
un as FadeOut,
|
|
3413
|
+
p1 as FontStyle,
|
|
3414
|
+
x1 as FontWeight,
|
|
3415
|
+
vn as Grid,
|
|
3338
3416
|
st as Group,
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3417
|
+
fn as Hide,
|
|
3418
|
+
pn as IFrame,
|
|
3419
|
+
wn as Image,
|
|
3420
|
+
mn as Line,
|
|
3421
|
+
An as Mask,
|
|
3422
|
+
j as ObjectType,
|
|
3423
|
+
In as Opaque,
|
|
3424
|
+
bn as Path,
|
|
3425
|
+
Cn as Pause,
|
|
3426
|
+
Mn as Polygon,
|
|
3427
|
+
$ as Position,
|
|
3428
|
+
T1 as Presentation,
|
|
3429
|
+
Ln as Rectangle,
|
|
3430
|
+
Tn as SVG,
|
|
3431
|
+
dn as ScreenCapture,
|
|
3432
|
+
gn as Show,
|
|
3433
|
+
i0 as Size,
|
|
3434
|
+
En as Slide,
|
|
3435
|
+
s0 as SlideObject,
|
|
3357
3436
|
Et as SlideWebExtra,
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3437
|
+
m1 as Text,
|
|
3438
|
+
Sn as TextUnit,
|
|
3439
|
+
g1 as Transparent,
|
|
3361
3440
|
Ct as Update,
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3441
|
+
On as getKeySlideBuildIndices,
|
|
3442
|
+
kn as getSizingFunctions,
|
|
3443
|
+
_n as getSmoothPathInterpolator,
|
|
3444
|
+
w1 as getTextContentLength,
|
|
3445
|
+
S1 as interpolateColor,
|
|
3446
|
+
_1 as interpolateNumber
|
|
3368
3447
|
};
|
|
3448
|
+
//# sourceMappingURL=presenter.mjs.map
|