presenter 0.8.8 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export/powerpoint-renderer/objects/renderSpotlight.d.ts +3 -0
- package/dist/export/powerpoint-renderer/types/PowerPointObjectRenderer.d.ts +2 -0
- package/dist/export.js +46 -46
- package/dist/export.js.map +1 -1
- package/dist/export.mjs +909 -772
- package/dist/export.mjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/objects/Spotlight.d.ts +19 -0
- package/dist/presenter.js +2 -2
- package/dist/presenter.js.map +1 -1
- package/dist/presenter.mjs +1517 -1237
- package/dist/presenter.mjs.map +1 -1
- package/dist/renderer/browser-canvas/BrowserCanvasRenderer.d.ts +1 -0
- package/dist/renderer/browser-canvas/objects/renderSpotlight.d.ts +3 -0
- package/dist/renderer/browser-canvas/types/BrowserCanvasObjectRenderer.d.ts +3 -0
- package/dist/renderer/browser-canvas/utils/getSizeFromTextMetrics.d.ts +5 -1
- package/dist/renderer/browser-canvas/utils/variables/createVariableControlsElement.d.ts +6 -0
- package/dist/renderer/browser-canvas/utils/variables/mountVariableControls.d.ts +6 -0
- package/dist/types/ObjectType.d.ts +1 -0
- package/dist/types/Variable.d.ts +19 -0
- package/dist/utils/objects/spotlight/getSpotlightCutout.d.ts +8 -0
- package/dist/utils/objects/spotlight/getSpotlightPath.d.ts +10 -0
- package/dist/utils/storage/variableStorage.d.ts +2 -0
- package/package.json +1 -1
package/dist/presenter.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var k = (n, e, t) =>
|
|
4
|
-
const
|
|
1
|
+
var m0 = Object.defineProperty;
|
|
2
|
+
var b0 = (n, e, t) => e in n ? m0(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var k = (n, e, t) => b0(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const dt = {
|
|
5
5
|
/** Represents an animated change in an object's properties. */
|
|
6
6
|
ANIMATE: "Animate",
|
|
7
7
|
/** Represents a pause in the animation timeline. */
|
|
@@ -9,52 +9,52 @@ const ft = {
|
|
|
9
9
|
/** Represents an immediate update to an object's properties without animation. */
|
|
10
10
|
UPDATE: "Update"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function A0(n) {
|
|
13
13
|
return n * n * n;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function T0(n) {
|
|
16
16
|
return --n * n * n + 1;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function M0(n) {
|
|
19
19
|
return ((n *= 2) <= 1 ? n * n * n : (n -= 2) * n * n + 2) / 2;
|
|
20
20
|
}
|
|
21
|
-
var
|
|
21
|
+
var le = 1.70158;
|
|
22
22
|
(function n(e) {
|
|
23
23
|
e = +e;
|
|
24
24
|
function t(o) {
|
|
25
25
|
return (o = +o) * o * (e * (o - 1) + o);
|
|
26
26
|
}
|
|
27
27
|
return t.overshoot = n, t;
|
|
28
|
-
})(
|
|
28
|
+
})(le);
|
|
29
29
|
(function n(e) {
|
|
30
30
|
e = +e;
|
|
31
31
|
function t(o) {
|
|
32
32
|
return --o * o * ((o + 1) * e + o) + 1;
|
|
33
33
|
}
|
|
34
34
|
return t.overshoot = n, t;
|
|
35
|
-
})(
|
|
36
|
-
var
|
|
35
|
+
})(le);
|
|
36
|
+
var L0 = (function n(e) {
|
|
37
37
|
e = +e;
|
|
38
38
|
function t(o) {
|
|
39
39
|
return ((o *= 2) < 1 ? o * o * ((e + 1) * o - e) : (o -= 2) * o * ((e + 1) * o + e) + 2) / 2;
|
|
40
40
|
}
|
|
41
41
|
return t.overshoot = n, t;
|
|
42
|
-
})(
|
|
43
|
-
const
|
|
42
|
+
})(le);
|
|
43
|
+
const he = {
|
|
44
44
|
LINEAR: (n) => n,
|
|
45
|
-
CUBIC:
|
|
46
|
-
CUBIC_IN:
|
|
47
|
-
CUBIC_OUT:
|
|
48
|
-
BACK_IN_OUT:
|
|
49
|
-
},
|
|
50
|
-
function
|
|
45
|
+
CUBIC: M0,
|
|
46
|
+
CUBIC_IN: A0,
|
|
47
|
+
CUBIC_OUT: T0,
|
|
48
|
+
BACK_IN_OUT: L0.overshoot(0.8)
|
|
49
|
+
}, C0 = he.LINEAR;
|
|
50
|
+
function ce(n, e, t = {}) {
|
|
51
51
|
return {
|
|
52
|
-
type:
|
|
52
|
+
type: dt.ANIMATE,
|
|
53
53
|
object: n,
|
|
54
54
|
props: e,
|
|
55
55
|
delay: 0,
|
|
56
56
|
duration: 1e3,
|
|
57
|
-
easing:
|
|
57
|
+
easing: C0,
|
|
58
58
|
block: !1,
|
|
59
59
|
interpolators: null,
|
|
60
60
|
isKey: !1,
|
|
@@ -62,23 +62,23 @@ function a0(n, e, t = {}) {
|
|
|
62
62
|
...typeof t == "number" ? { duration: t } : t
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function gi(n, e = {}) {
|
|
66
|
+
return ce(n, { opacity: 1 }, {
|
|
67
67
|
duration: 500,
|
|
68
|
-
easing:
|
|
68
|
+
easing: he.CUBIC,
|
|
69
69
|
...typeof e == "number" ? { duration: e } : e
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
72
|
+
function pi(n, e = {}) {
|
|
73
|
+
return ce(n, { opacity: 0 }, {
|
|
74
74
|
duration: 500,
|
|
75
|
-
easing:
|
|
75
|
+
easing: he.CUBIC,
|
|
76
76
|
...typeof e == "number" ? { duration: e } : e
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Ke(n, e, t = {}) {
|
|
80
80
|
return {
|
|
81
|
-
type:
|
|
81
|
+
type: dt.UPDATE,
|
|
82
82
|
isKey: !1,
|
|
83
83
|
object: n,
|
|
84
84
|
props: e,
|
|
@@ -86,13 +86,13 @@ function j0(n, e, t = {}) {
|
|
|
86
86
|
...t
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
89
|
+
function xi(n) {
|
|
90
|
+
return Ke(n, { opacity: 0 });
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function yi(n) {
|
|
93
|
+
return Ke(n, { opacity: 1 });
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const lt = {
|
|
96
96
|
TOP_LEFT: "TopLeft",
|
|
97
97
|
TOP: "Top",
|
|
98
98
|
TOP_RIGHT: "TopRight",
|
|
@@ -102,11 +102,11 @@ const ot = {
|
|
|
102
102
|
BOTTOM_LEFT: "BottomLeft",
|
|
103
103
|
BOTTOM: "Bottom",
|
|
104
104
|
BOTTOM_RIGHT: "BottomRight"
|
|
105
|
-
},
|
|
105
|
+
}, et = lt.TOP_LEFT;
|
|
106
106
|
function G(n, e = 0, t = 0, o = 1) {
|
|
107
107
|
if (typeof n == "string") {
|
|
108
108
|
const i = n.replace("#", ""), a = parseInt(i, 16);
|
|
109
|
-
return isNaN(a) ? (console.warn("Invalid hex color format:", n),
|
|
109
|
+
return isNaN(a) ? (console.warn("Invalid hex color format:", n), J) : i.length === 6 ? {
|
|
110
110
|
red: a >> 16 & 255,
|
|
111
111
|
green: a >> 8 & 255,
|
|
112
112
|
blue: a & 255,
|
|
@@ -116,7 +116,7 @@ function G(n, e = 0, t = 0, o = 1) {
|
|
|
116
116
|
green: a >> 16 & 255,
|
|
117
117
|
blue: a >> 8 & 255,
|
|
118
118
|
alpha: (a & 255) / 255
|
|
119
|
-
} : (console.warn("Invalid hex color format:", n),
|
|
119
|
+
} : (console.warn("Invalid hex color format:", n), J);
|
|
120
120
|
} else if (typeof n == "number")
|
|
121
121
|
return {
|
|
122
122
|
red: n,
|
|
@@ -138,12 +138,12 @@ G.GREEN = G(0, 255, 0);
|
|
|
138
138
|
G.RED = G(255, 0, 0);
|
|
139
139
|
G.TRANSPARENT = G(0, 0, 0, 0);
|
|
140
140
|
G.WHITE = G(255, 255, 255);
|
|
141
|
-
const
|
|
142
|
-
function
|
|
141
|
+
const J = { red: 0, green: 0, blue: 0, alpha: 1 };
|
|
142
|
+
function Ze(n = null) {
|
|
143
143
|
return {
|
|
144
144
|
content: null,
|
|
145
145
|
setup: null,
|
|
146
|
-
anchor:
|
|
146
|
+
anchor: lt.TOP_LEFT,
|
|
147
147
|
height: 0,
|
|
148
148
|
width: 0,
|
|
149
149
|
x: 0,
|
|
@@ -151,92 +151,92 @@ function U0(n = null) {
|
|
|
151
151
|
...n
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Je(n, e = null) {
|
|
155
155
|
return n.alpha * (e ?? 1);
|
|
156
156
|
}
|
|
157
157
|
function It(n, e = null) {
|
|
158
|
-
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(
|
|
158
|
+
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(Je(n, e) * 255);
|
|
159
159
|
return `#${a.toString(16).padStart(6, "0")}${s !== 255 ? s.toString(16).padStart(2, "0") : ""}`;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function vi(n = null) {
|
|
162
162
|
const {
|
|
163
163
|
url: e = "https://wikipedia.org/",
|
|
164
164
|
backgroundColor: t = G.TRANSPARENT,
|
|
165
|
-
strokeColor: o =
|
|
165
|
+
strokeColor: o = J,
|
|
166
166
|
strokeWidth: i = 0,
|
|
167
167
|
pointerEvents: a = "auto",
|
|
168
168
|
scale: s = 1,
|
|
169
|
-
anchor: r =
|
|
170
|
-
height:
|
|
169
|
+
anchor: r = et,
|
|
170
|
+
height: l = 1e3,
|
|
171
171
|
width: c = 1e3,
|
|
172
172
|
x: u = 0,
|
|
173
|
-
y:
|
|
174
|
-
} = n || {},
|
|
175
|
-
|
|
173
|
+
y: g = 0
|
|
174
|
+
} = n || {}, h = document.createElement("iframe");
|
|
175
|
+
h.src = e, h.style.backgroundColor = It(t), h.style.border = i > 0 ? `${i}px solid ${It(o)}` : "none", h.style.pointerEvents = a;
|
|
176
176
|
const f = (100 / s).toFixed(3) + "%";
|
|
177
|
-
return
|
|
178
|
-
content:
|
|
177
|
+
return h.style.height = i === 0 ? f : `calc(${f} - ${i * 2}px)`, h.style.width = i === 0 ? f : `calc(${f} - ${i * 2}px)`, h.style.transform = `scale(${s})`, h.style.transformOrigin = "top left", Ze({
|
|
178
|
+
content: h,
|
|
179
179
|
anchor: r,
|
|
180
|
-
height:
|
|
180
|
+
height: l,
|
|
181
181
|
width: c,
|
|
182
182
|
x: u,
|
|
183
|
-
y:
|
|
183
|
+
y: g
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
const
|
|
186
|
+
const yt = {
|
|
187
187
|
LEFT: "left",
|
|
188
188
|
CENTER: "center",
|
|
189
189
|
RIGHT: "right"
|
|
190
|
-
},
|
|
191
|
-
function
|
|
190
|
+
}, S0 = yt.LEFT;
|
|
191
|
+
function ht(n, e) {
|
|
192
192
|
throw new Error("Unexpected value: " + n);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function wi(n = null) {
|
|
195
195
|
const {
|
|
196
|
-
alignment: e =
|
|
196
|
+
alignment: e = yt.LEFT,
|
|
197
197
|
scale: t = 1,
|
|
198
|
-
anchor: o =
|
|
198
|
+
anchor: o = et,
|
|
199
199
|
height: i = 1e3,
|
|
200
200
|
width: a = 1e3,
|
|
201
201
|
x: s = 0,
|
|
202
202
|
y: r = 0
|
|
203
203
|
} = n || {};
|
|
204
|
-
function
|
|
204
|
+
function l(c) {
|
|
205
205
|
const u = document.createElement("video");
|
|
206
206
|
switch (u.autoplay = !0, u.style.transform = `scale(${t})`, e) {
|
|
207
|
-
case
|
|
207
|
+
case yt.LEFT:
|
|
208
208
|
u.style.transformOrigin = "top left";
|
|
209
209
|
break;
|
|
210
|
-
case
|
|
210
|
+
case yt.CENTER:
|
|
211
211
|
u.style.transformOrigin = "top center";
|
|
212
212
|
break;
|
|
213
|
-
case
|
|
213
|
+
case yt.RIGHT:
|
|
214
214
|
u.style.transformOrigin = "top right";
|
|
215
215
|
break;
|
|
216
216
|
default:
|
|
217
|
-
|
|
217
|
+
ht(e);
|
|
218
218
|
}
|
|
219
219
|
c.appendChild(u);
|
|
220
|
-
const
|
|
220
|
+
const g = {
|
|
221
221
|
video: {
|
|
222
222
|
displaySurface: "window"
|
|
223
223
|
},
|
|
224
224
|
audio: !1
|
|
225
225
|
};
|
|
226
|
-
return navigator.mediaDevices.getDisplayMedia(
|
|
227
|
-
const f =
|
|
226
|
+
return navigator.mediaDevices.getDisplayMedia(g).then((h) => {
|
|
227
|
+
const f = h.getVideoTracks()[0];
|
|
228
228
|
f !== void 0 && (f.onended = function() {
|
|
229
229
|
u.style.display = "none";
|
|
230
|
-
}), u.srcObject =
|
|
231
|
-
}).catch((
|
|
232
|
-
console.error("Could not start screen capture -",
|
|
230
|
+
}), u.srcObject = h, u.play();
|
|
231
|
+
}).catch((h) => {
|
|
232
|
+
console.error("Could not start screen capture -", h);
|
|
233
233
|
}), () => {
|
|
234
234
|
u.srcObject.getTracks().forEach((f) => f.stop()), u.style.display = "none", u.srcObject = null;
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
return
|
|
237
|
+
return Ze({
|
|
238
238
|
content: null,
|
|
239
|
-
setup:
|
|
239
|
+
setup: l,
|
|
240
240
|
anchor: o,
|
|
241
241
|
height: i,
|
|
242
242
|
width: a,
|
|
@@ -244,7 +244,7 @@ function $n(n = null) {
|
|
|
244
244
|
y: r
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
-
const
|
|
247
|
+
const V = {
|
|
248
248
|
ARROW: "Arrow",
|
|
249
249
|
CIRCLE: "Circle",
|
|
250
250
|
GROUP: "Group",
|
|
@@ -255,22 +255,23 @@ const $ = {
|
|
|
255
255
|
POLYGON: "Polygon",
|
|
256
256
|
RECTANGLE: "Rectangle",
|
|
257
257
|
SLIDE_OBJECT: "SlideObject",
|
|
258
|
+
SPOTLIGHT: "Spotlight",
|
|
258
259
|
SVG: "SVG",
|
|
259
260
|
TEXT: "Text"
|
|
260
261
|
};
|
|
261
|
-
function
|
|
262
|
+
function nt(n) {
|
|
262
263
|
return {
|
|
263
|
-
objectType:
|
|
264
|
+
objectType: V.SLIDE_OBJECT,
|
|
264
265
|
opacity: 1,
|
|
265
266
|
...n
|
|
266
267
|
};
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
+
function mi(n = null) {
|
|
269
270
|
const { arrowheadSize: e, width: t = 10, ...o } = n || {}, i = e ?? t * 4;
|
|
270
|
-
return
|
|
271
|
-
objectType:
|
|
271
|
+
return nt({
|
|
272
|
+
objectType: V.ARROW,
|
|
272
273
|
arrowheadSize: i,
|
|
273
|
-
color:
|
|
274
|
+
color: J,
|
|
274
275
|
drawn: 1,
|
|
275
276
|
endX: 100,
|
|
276
277
|
endY: 100,
|
|
@@ -283,25 +284,25 @@ function Wn(n = null) {
|
|
|
283
284
|
...o
|
|
284
285
|
});
|
|
285
286
|
}
|
|
286
|
-
const
|
|
287
|
-
function
|
|
288
|
-
return
|
|
289
|
-
objectType:
|
|
290
|
-
anchor:
|
|
291
|
-
strokeColor:
|
|
287
|
+
const P0 = 50;
|
|
288
|
+
function bi(n = null) {
|
|
289
|
+
return nt({
|
|
290
|
+
objectType: V.CIRCLE,
|
|
291
|
+
anchor: et,
|
|
292
|
+
strokeColor: J,
|
|
292
293
|
strokeWidth: 0,
|
|
293
294
|
drawn: 1,
|
|
294
|
-
fillColor:
|
|
295
|
-
radius:
|
|
295
|
+
fillColor: J,
|
|
296
|
+
radius: P0,
|
|
296
297
|
x: 0,
|
|
297
298
|
y: 0,
|
|
298
299
|
...n
|
|
299
300
|
});
|
|
300
301
|
}
|
|
301
|
-
function
|
|
302
|
-
return
|
|
303
|
-
objectType:
|
|
304
|
-
anchor:
|
|
302
|
+
function we(n, e = null) {
|
|
303
|
+
return nt({
|
|
304
|
+
objectType: V.GROUP,
|
|
305
|
+
anchor: et,
|
|
305
306
|
height: 0,
|
|
306
307
|
objects: n,
|
|
307
308
|
previewColor: null,
|
|
@@ -323,38 +324,38 @@ function x0(n, e = null) {
|
|
|
323
324
|
...e
|
|
324
325
|
});
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function Ai(n) {
|
|
327
328
|
const {
|
|
328
|
-
anchor: e =
|
|
329
|
+
anchor: e = et,
|
|
329
330
|
cols: t = 1,
|
|
330
331
|
rows: o = 1,
|
|
331
332
|
gapX: i = 0,
|
|
332
333
|
gapY: a = 0,
|
|
333
334
|
groupProps: s = {},
|
|
334
335
|
width: r = 0,
|
|
335
|
-
height:
|
|
336
|
+
height: l = 0,
|
|
336
337
|
x: c = 0,
|
|
337
338
|
y: u = 0,
|
|
338
|
-
objects:
|
|
339
|
-
} = n,
|
|
339
|
+
objects: g = () => null
|
|
340
|
+
} = n, h = [], f = [];
|
|
340
341
|
let v = 0, y = 0;
|
|
341
|
-
for (let
|
|
342
|
-
const
|
|
342
|
+
for (let L = 0; L < o; L++) {
|
|
343
|
+
const P = [];
|
|
343
344
|
v = 0;
|
|
344
|
-
let
|
|
345
|
+
let S = 0;
|
|
345
346
|
for (let E = 0; E < t; E++) {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
const M = g(L, E), I = typeof r == "function" ? r(L, E) : r, F = typeof l == "function" ? l(L, E) : l;
|
|
348
|
+
P.push(M), M != null && f.push(
|
|
349
|
+
we([M], {
|
|
349
350
|
x: v,
|
|
350
351
|
y
|
|
351
352
|
})
|
|
352
|
-
), v += I + i,
|
|
353
|
+
), v += I + i, S = Math.max(S, F);
|
|
353
354
|
}
|
|
354
|
-
|
|
355
|
+
h.push(P), y += S + a;
|
|
355
356
|
}
|
|
356
357
|
return {
|
|
357
|
-
grid:
|
|
358
|
+
grid: we(f, {
|
|
358
359
|
x: c,
|
|
359
360
|
y: u,
|
|
360
361
|
height: y - a,
|
|
@@ -362,13 +363,13 @@ function Xn(n) {
|
|
|
362
363
|
anchor: e,
|
|
363
364
|
...s
|
|
364
365
|
}),
|
|
365
|
-
objects:
|
|
366
|
+
objects: h
|
|
366
367
|
};
|
|
367
368
|
}
|
|
368
|
-
function
|
|
369
|
-
return
|
|
370
|
-
objectType:
|
|
371
|
-
anchor:
|
|
369
|
+
function Ti(n = null) {
|
|
370
|
+
return nt({
|
|
371
|
+
objectType: V.IMAGE,
|
|
372
|
+
anchor: et,
|
|
372
373
|
cornerRadius: 0,
|
|
373
374
|
height: 100,
|
|
374
375
|
imageId: "",
|
|
@@ -379,10 +380,10 @@ function Gn(n = null) {
|
|
|
379
380
|
...n
|
|
380
381
|
});
|
|
381
382
|
}
|
|
382
|
-
function
|
|
383
|
-
return
|
|
384
|
-
objectType:
|
|
385
|
-
color:
|
|
383
|
+
function Mi(n = null) {
|
|
384
|
+
return nt({
|
|
385
|
+
objectType: V.LINE,
|
|
386
|
+
color: J,
|
|
386
387
|
drawn: 1,
|
|
387
388
|
endX: 100,
|
|
388
389
|
endY: 100,
|
|
@@ -394,10 +395,10 @@ function Kn(n = null) {
|
|
|
394
395
|
...n
|
|
395
396
|
});
|
|
396
397
|
}
|
|
397
|
-
function
|
|
398
|
-
return
|
|
399
|
-
objectType:
|
|
400
|
-
anchor:
|
|
398
|
+
function Li(n, e = null) {
|
|
399
|
+
return nt({
|
|
400
|
+
objectType: V.MASK,
|
|
401
|
+
anchor: et,
|
|
401
402
|
height: 100,
|
|
402
403
|
objects: n,
|
|
403
404
|
preview: !1,
|
|
@@ -407,53 +408,53 @@ function Vn(n, e = null) {
|
|
|
407
408
|
...e
|
|
408
409
|
});
|
|
409
410
|
}
|
|
410
|
-
var
|
|
411
|
-
const e = (n && n.length > 0 ? n : "M0,0").match(
|
|
411
|
+
var E0 = Object.defineProperty, _ = (n, e) => E0(n, "name", { value: e, configurable: !0 }), Pt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, I0 = /([astvzqmhlc])([^astvzqmhlc]*)/gi, k0 = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, O0 = _((n) => {
|
|
412
|
+
const e = (n && n.length > 0 ? n : "M0,0").match(I0);
|
|
412
413
|
if (!e) throw new Error(`No path elements found in string ${n}`);
|
|
413
414
|
return e.reduce((t, o) => {
|
|
414
|
-
let i = o.charAt(0), a = i.toLowerCase(), s =
|
|
415
|
+
let i = o.charAt(0), a = i.toLowerCase(), s = _0(o.substring(1));
|
|
415
416
|
if (a === "m" && s.length > 2 && (t.push([i, ...s.splice(0, 2)]), a = "l", i = i === "m" ? "l" : "L"), a.toLowerCase() === "a" && (s.length === 5 || s.length === 6)) {
|
|
416
417
|
const r = o.substring(1).trim().split(" ");
|
|
417
418
|
s = [Number(r[0]), Number(r[1]), Number(r[2]), Number(r[3].charAt(0)), Number(r[3].charAt(1)), Number(r[3].substring(2)), Number(r[4])];
|
|
418
419
|
}
|
|
419
420
|
for (; s.length >= 0; ) {
|
|
420
|
-
if (s.length ===
|
|
421
|
-
t.push([i, ...s.splice(0,
|
|
421
|
+
if (s.length === Pt[a]) {
|
|
422
|
+
t.push([i, ...s.splice(0, Pt[a])]);
|
|
422
423
|
break;
|
|
423
424
|
}
|
|
424
|
-
if (s.length <
|
|
425
|
-
t.push([i, ...s.splice(0,
|
|
425
|
+
if (s.length < Pt[a]) throw new Error(`Malformed path data: "${i}" must have ${Pt[a]} elements and has ${s.length}: ${o}`);
|
|
426
|
+
t.push([i, ...s.splice(0, Pt[a])]);
|
|
426
427
|
}
|
|
427
428
|
return t;
|
|
428
429
|
}, []);
|
|
429
|
-
}, "default"),
|
|
430
|
-
const e = n.match(
|
|
430
|
+
}, "default"), _0 = _((n) => {
|
|
431
|
+
const e = n.match(k0);
|
|
431
432
|
return e ? e.map(Number) : [];
|
|
432
|
-
}, "parseValues"), bt,
|
|
433
|
+
}, "parseValues"), bt, tt = (bt = class {
|
|
433
434
|
constructor(e, t, o, i) {
|
|
434
435
|
k(this, "x0");
|
|
435
436
|
k(this, "x1");
|
|
436
437
|
k(this, "y0");
|
|
437
438
|
k(this, "y1");
|
|
438
|
-
k(this, "getTotalLength",
|
|
439
|
-
k(this, "getPointAtLength",
|
|
439
|
+
k(this, "getTotalLength", _(() => Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), "getTotalLength"));
|
|
440
|
+
k(this, "getPointAtLength", _((e) => {
|
|
440
441
|
let t = e / Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
|
|
441
442
|
t = Number.isNaN(t) ? 1 : t;
|
|
442
443
|
const o = (this.x1 - this.x0) * t, i = (this.y1 - this.y0) * t;
|
|
443
444
|
return { x: this.x0 + o, y: this.y0 + i };
|
|
444
445
|
}, "getPointAtLength"));
|
|
445
|
-
k(this, "getTangentAtLength",
|
|
446
|
+
k(this, "getTangentAtLength", _((e) => {
|
|
446
447
|
const t = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
|
|
447
448
|
return { x: (this.x1 - this.x0) / t, y: (this.y1 - this.y0) / t };
|
|
448
449
|
}, "getTangentAtLength"));
|
|
449
|
-
k(this, "getPropertiesAtLength",
|
|
450
|
+
k(this, "getPropertiesAtLength", _((e) => {
|
|
450
451
|
const t = this.getPointAtLength(e), o = this.getTangentAtLength(e);
|
|
451
452
|
return { x: t.x, y: t.y, tangentX: o.x, tangentY: o.y };
|
|
452
453
|
}, "getPropertiesAtLength"));
|
|
453
454
|
this.x0 = e, this.x1 = t, this.y0 = o, this.y1 = i;
|
|
454
455
|
}
|
|
455
|
-
},
|
|
456
|
-
constructor(e, t, o, i, a, s, r,
|
|
456
|
+
}, _(bt, "LinearPosition"), bt), At, me = (At = class {
|
|
457
|
+
constructor(e, t, o, i, a, s, r, l, c) {
|
|
457
458
|
k(this, "x0");
|
|
458
459
|
k(this, "y0");
|
|
459
460
|
k(this, "rx");
|
|
@@ -464,13 +465,13 @@ var ye = Object.defineProperty, O = (n, e) => ye(n, "name", { value: e, configur
|
|
|
464
465
|
k(this, "x1");
|
|
465
466
|
k(this, "y1");
|
|
466
467
|
k(this, "length");
|
|
467
|
-
k(this, "getTotalLength",
|
|
468
|
-
k(this, "getPointAtLength",
|
|
468
|
+
k(this, "getTotalLength", _(() => this.length, "getTotalLength"));
|
|
469
|
+
k(this, "getPointAtLength", _((e) => {
|
|
469
470
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
470
|
-
const t =
|
|
471
|
+
const t = be({ x: this.x0, y: this.y0 }, this.rx, this.ry, this.xAxisRotate, this.LargeArcFlag, this.SweepFlag, { x: this.x1, y: this.y1 }, e / this.length);
|
|
471
472
|
return { x: t.x, y: t.y };
|
|
472
473
|
}, "getPointAtLength"));
|
|
473
|
-
k(this, "getTangentAtLength",
|
|
474
|
+
k(this, "getTangentAtLength", _((e) => {
|
|
474
475
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
475
476
|
const t = 0.05, o = this.getPointAtLength(e);
|
|
476
477
|
let i;
|
|
@@ -478,78 +479,78 @@ var ye = Object.defineProperty, O = (n, e) => ye(n, "name", { value: e, configur
|
|
|
478
479
|
const a = i.x - o.x, s = i.y - o.y, r = Math.sqrt(a * a + s * s);
|
|
479
480
|
return e < this.length - t ? { x: -a / r, y: -s / r } : { x: a / r, y: s / r };
|
|
480
481
|
}, "getTangentAtLength"));
|
|
481
|
-
k(this, "getPropertiesAtLength",
|
|
482
|
+
k(this, "getPropertiesAtLength", _((e) => {
|
|
482
483
|
const t = this.getTangentAtLength(e), o = this.getPointAtLength(e);
|
|
483
484
|
return { x: o.x, y: o.y, tangentX: t.x, tangentY: t.y };
|
|
484
485
|
}, "getPropertiesAtLength"));
|
|
485
|
-
this.x0 = e, this.y0 = t, this.rx = o, this.ry = i, this.xAxisRotate = a, this.LargeArcFlag = s, this.SweepFlag = r, this.x1 =
|
|
486
|
-
const u =
|
|
487
|
-
return
|
|
486
|
+
this.x0 = e, this.y0 = t, this.rx = o, this.ry = i, this.xAxisRotate = a, this.LargeArcFlag = s, this.SweepFlag = r, this.x1 = l, this.y1 = c;
|
|
487
|
+
const u = N0(300, function(g) {
|
|
488
|
+
return be({ x: e, y: t }, o, i, a, s, r, { x: l, y: c }, g);
|
|
488
489
|
});
|
|
489
490
|
this.length = u.arcLength;
|
|
490
491
|
}
|
|
491
|
-
},
|
|
492
|
-
e = Math.abs(e), t = Math.abs(t), o =
|
|
493
|
-
const
|
|
492
|
+
}, _(At, "Arc"), At), be = _((n, e, t, o, i, a, s, r) => {
|
|
493
|
+
e = Math.abs(e), t = Math.abs(t), o = R0(o, 360);
|
|
494
|
+
const l = F0(o);
|
|
494
495
|
if (n.x === s.x && n.y === s.y) return { x: n.x, y: n.y, ellipticalArcAngle: 0 };
|
|
495
496
|
if (e === 0 || t === 0) return { x: 0, y: 0, ellipticalArcAngle: 0 };
|
|
496
|
-
const c = (n.x - s.x) / 2, u = (n.y - s.y) / 2,
|
|
497
|
-
|
|
498
|
-
let f = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(
|
|
497
|
+
const c = (n.x - s.x) / 2, u = (n.y - s.y) / 2, g = { x: Math.cos(l) * c + Math.sin(l) * u, y: -Math.sin(l) * c + Math.cos(l) * u }, h = Math.pow(g.x, 2) / Math.pow(e, 2) + Math.pow(g.y, 2) / Math.pow(t, 2);
|
|
498
|
+
h > 1 && (e = Math.sqrt(h) * e, t = Math.sqrt(h) * t);
|
|
499
|
+
let f = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(g.y, 2) - Math.pow(t, 2) * Math.pow(g.x, 2)) / (Math.pow(e, 2) * Math.pow(g.y, 2) + Math.pow(t, 2) * Math.pow(g.x, 2));
|
|
499
500
|
f = f < 0 ? 0 : f;
|
|
500
|
-
const v = (i !== a ? 1 : -1) * Math.sqrt(f), y = v * (e *
|
|
501
|
-
let E =
|
|
501
|
+
const v = (i !== a ? 1 : -1) * Math.sqrt(f), y = v * (e * g.y / t), T = v * (-t * g.x / e), L = { x: Math.cos(l) * y - Math.sin(l) * T + (n.x + s.x) / 2, y: Math.sin(l) * y + Math.cos(l) * T + (n.y + s.y) / 2 }, P = { x: (g.x - y) / e, y: (g.y - T) / t }, S = Te({ x: 1, y: 0 }, P);
|
|
502
|
+
let E = Te(P, { x: (-g.x - y) / e, y: (-g.y - T) / t });
|
|
502
503
|
!a && E > 0 ? E -= 2 * Math.PI : a && E < 0 && (E += 2 * Math.PI), E %= 2 * Math.PI;
|
|
503
|
-
const
|
|
504
|
-
return { x: Math.cos(
|
|
505
|
-
}, "pointOnEllipticalArc"),
|
|
504
|
+
const M = S + E * r, I = e * Math.cos(M), F = t * Math.sin(M);
|
|
505
|
+
return { x: Math.cos(l) * I - Math.sin(l) * F + L.x, y: Math.sin(l) * I + Math.cos(l) * F + L.y, ellipticalArcStartAngle: S, ellipticalArcEndAngle: S + E, ellipticalArcAngle: M, ellipticalArcCenter: L, resultantRx: e, resultantRy: t };
|
|
506
|
+
}, "pointOnEllipticalArc"), N0 = _((n, e) => {
|
|
506
507
|
n = n ?? 500;
|
|
507
508
|
let t = 0;
|
|
508
509
|
const o = [], i = [];
|
|
509
510
|
let a, s = e(0);
|
|
510
511
|
for (let r = 0; r < n; r++) {
|
|
511
|
-
const
|
|
512
|
-
a = e(
|
|
512
|
+
const l = B0(r * (1 / n), 0, 1);
|
|
513
|
+
a = e(l), t += Ae(s, a), i.push([s, a]), o.push({ t: l, arcLength: t }), s = a;
|
|
513
514
|
}
|
|
514
|
-
return a = e(1), i.push([s, a]), t +=
|
|
515
|
-
}, "approximateArcLengthOfCurve"),
|
|
515
|
+
return a = e(1), i.push([s, a]), t += Ae(s, a), o.push({ t: 1, arcLength: t }), { arcLength: t, arcLengthMap: o, approximationLines: i };
|
|
516
|
+
}, "approximateArcLengthOfCurve"), R0 = _((n, e) => (n % e + e) % e, "mod"), F0 = _((n) => n * (Math.PI / 180), "toRadians"), Ae = _((n, e) => Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2)), "distance"), B0 = _((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), Te = _((n, e) => {
|
|
516
517
|
const t = n.x * e.x + n.y * e.y, o = Math.sqrt((Math.pow(n.x, 2) + Math.pow(n.y, 2)) * (Math.pow(e.x, 2) + Math.pow(e.y, 2)));
|
|
517
518
|
return (n.x * e.y - n.y * e.x < 0 ? -1 : 1) * Math.acos(t / o);
|
|
518
|
-
}, "angleBetween"), Ce = [[], [], [-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]], Pe = [[], [], [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]], Se = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], Ee = O((n, e, t) => ({ x: (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], y: (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3] }), "cubicPoint"), Ie = O((n, e, t) => W0([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"), ke = O((n, e, t) => {
|
|
519
|
+
}, "angleBetween"), D0 = [[], [], [-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]], q0 = [[], [], [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]], z0 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], V0 = _((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"), j0 = _((n, e, t) => Qe([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"), H0 = _((n, e, t) => {
|
|
519
520
|
let o, i;
|
|
520
521
|
const a = t / 2;
|
|
521
522
|
o = 0;
|
|
522
|
-
for (let s = 0; s < 20; s++) i = a *
|
|
523
|
+
for (let s = 0; s < 20; s++) i = a * D0[20][s] + a, o += q0[20][s] * t0(n, e, i);
|
|
523
524
|
return a * o;
|
|
524
|
-
}, "getCubicArcLength"),
|
|
525
|
+
}, "getCubicArcLength"), Qe = _((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"), U0 = _((n, e, t) => {
|
|
525
526
|
t === void 0 && (t = 1);
|
|
526
|
-
const o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i),
|
|
527
|
+
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), l = 4 * (o * a + i * s), c = a * a + s * s;
|
|
527
528
|
if (r === 0) return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
528
|
-
const u =
|
|
529
|
-
return Math.sqrt(r) / 2 * (
|
|
530
|
-
}, "getQuadraticArcLength"),
|
|
531
|
-
function
|
|
532
|
-
const o =
|
|
529
|
+
const u = l / (2 * r), g = t + u, h = c / r - u * u, f = g * g + h > 0 ? Math.sqrt(g * g + h) : 0, v = u * u + h > 0 ? Math.sqrt(u * u + h) : 0, y = u + Math.sqrt(u * u + h) !== 0 && (g + f) / (u + v) !== 0 ? h * Math.log(Math.abs((g + f) / (u + v))) : 0;
|
|
530
|
+
return Math.sqrt(r) / 2 * (g * f - u * v + y);
|
|
531
|
+
}, "getQuadraticArcLength"), $0 = _((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");
|
|
532
|
+
function t0(n, e, t) {
|
|
533
|
+
const o = te(1, t, n), i = te(1, t, e), a = o * o + i * i;
|
|
533
534
|
return Math.sqrt(a);
|
|
534
535
|
}
|
|
535
|
-
|
|
536
|
-
var
|
|
536
|
+
_(t0, "BFunc");
|
|
537
|
+
var te = _((n, e, t) => {
|
|
537
538
|
const o = t.length - 1;
|
|
538
539
|
let i, a;
|
|
539
540
|
if (o === 0) return 0;
|
|
540
541
|
if (n === 0) {
|
|
541
542
|
a = 0;
|
|
542
|
-
for (let s = 0; s <= o; s++) a +=
|
|
543
|
+
for (let s = 0; s <= o; s++) a += z0[o][s] * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
543
544
|
return a;
|
|
544
545
|
}
|
|
545
546
|
i = new Array(o);
|
|
546
547
|
for (let s = 0; s < o; s++) i[s] = o * (t[s + 1] - t[s]);
|
|
547
|
-
return
|
|
548
|
-
}, "getDerivative"),
|
|
548
|
+
return te(n - 1, e, i);
|
|
549
|
+
}, "getDerivative"), Vt = _((n, e, t) => {
|
|
549
550
|
let o = 1, i = n / e, a = (n - t(i)) / e, s = 0;
|
|
550
551
|
for (; o > 1e-3; ) {
|
|
551
|
-
const r = t(i + a),
|
|
552
|
-
if (
|
|
552
|
+
const r = t(i + a), l = Math.abs(n - r) / e;
|
|
553
|
+
if (l < o) o = l, i += a;
|
|
553
554
|
else {
|
|
554
555
|
const c = t(i - a), u = Math.abs(n - c) / e;
|
|
555
556
|
u < o ? (o = u, i -= a) : a /= 2;
|
|
@@ -557,8 +558,8 @@ var Qt = O((n, e, t) => {
|
|
|
557
558
|
if (s++, s > 500) break;
|
|
558
559
|
}
|
|
559
560
|
return i;
|
|
560
|
-
}, "t2length"),
|
|
561
|
-
constructor(e, t, o, i, a, s, r,
|
|
561
|
+
}, "t2length"), Tt, ct = (Tt = class {
|
|
562
|
+
constructor(e, t, o, i, a, s, r, l) {
|
|
562
563
|
k(this, "a");
|
|
563
564
|
k(this, "b");
|
|
564
565
|
k(this, "c");
|
|
@@ -567,59 +568,59 @@ var Qt = O((n, e, t) => {
|
|
|
567
568
|
k(this, "getArcLength");
|
|
568
569
|
k(this, "getPoint");
|
|
569
570
|
k(this, "getDerivative");
|
|
570
|
-
k(this, "getTotalLength",
|
|
571
|
-
k(this, "getPointAtLength",
|
|
572
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
571
|
+
k(this, "getTotalLength", _(() => this.length, "getTotalLength"));
|
|
572
|
+
k(this, "getPointAtLength", _((e) => {
|
|
573
|
+
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 = Vt(e, this.length, (a) => this.getArcLength(t, o, a));
|
|
573
574
|
return this.getPoint(t, o, i);
|
|
574
575
|
}, "getPointAtLength"));
|
|
575
|
-
k(this, "getTangentAtLength",
|
|
576
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
576
|
+
k(this, "getTangentAtLength", _((e) => {
|
|
577
|
+
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 = Vt(e, this.length, (l) => this.getArcLength(t, o, l)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
|
|
577
578
|
let r;
|
|
578
579
|
return r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 }, r;
|
|
579
580
|
}, "getTangentAtLength"));
|
|
580
|
-
k(this, "getPropertiesAtLength",
|
|
581
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
581
|
+
k(this, "getPropertiesAtLength", _((e) => {
|
|
582
|
+
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 = Vt(e, this.length, (c) => this.getArcLength(t, o, c)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
|
|
582
583
|
let r;
|
|
583
584
|
r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 };
|
|
584
|
-
const
|
|
585
|
-
return { x:
|
|
585
|
+
const l = this.getPoint(t, o, i);
|
|
586
|
+
return { x: l.x, y: l.y, tangentX: r.x, tangentY: r.y };
|
|
586
587
|
}, "getPropertiesAtLength"));
|
|
587
|
-
k(this, "getC",
|
|
588
|
-
k(this, "getD",
|
|
589
|
-
this.a = { x: e, y: t }, this.b = { x: o, y: i }, this.c = { x: a, y: s }, r !== void 0 &&
|
|
588
|
+
k(this, "getC", _(() => this.c, "getC"));
|
|
589
|
+
k(this, "getD", _(() => this.d, "getD"));
|
|
590
|
+
this.a = { x: e, y: t }, this.b = { x: o, y: i }, this.c = { x: a, y: s }, r !== void 0 && l !== void 0 ? (this.getArcLength = H0, this.getPoint = V0, this.getDerivative = j0, this.d = { x: r, y: l }) : (this.getArcLength = U0, this.getPoint = Qe, this.getDerivative = $0, this.d = { x: 0, y: 0 }), this.length = this.getArcLength([this.a.x, this.b.x, this.c.x, this.d.x], [this.a.y, this.b.y, this.c.y, this.d.y], 1);
|
|
590
591
|
}
|
|
591
|
-
},
|
|
592
|
+
}, _(Tt, "Bezier"), Tt), Mt, W0 = (Mt = class {
|
|
592
593
|
constructor(e) {
|
|
593
594
|
k(this, "length", 0);
|
|
594
595
|
k(this, "partial_lengths", []);
|
|
595
596
|
k(this, "functions", []);
|
|
596
597
|
k(this, "initial_point", null);
|
|
597
|
-
k(this, "getPartAtLength",
|
|
598
|
+
k(this, "getPartAtLength", _((e) => {
|
|
598
599
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
599
600
|
let t = this.partial_lengths.length - 1;
|
|
600
601
|
for (; this.partial_lengths[t] >= e && t > 0; ) t--;
|
|
601
602
|
return t++, { fraction: e - this.partial_lengths[t - 1], i: t };
|
|
602
603
|
}, "getPartAtLength"));
|
|
603
|
-
k(this, "getTotalLength",
|
|
604
|
-
k(this, "getPointAtLength",
|
|
604
|
+
k(this, "getTotalLength", _(() => this.length, "getTotalLength"));
|
|
605
|
+
k(this, "getPointAtLength", _((e) => {
|
|
605
606
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
606
607
|
if (o) return o.getPointAtLength(t.fraction);
|
|
607
608
|
if (this.initial_point) return this.initial_point;
|
|
608
609
|
throw new Error("Wrong function at this part.");
|
|
609
610
|
}, "getPointAtLength"));
|
|
610
|
-
k(this, "getTangentAtLength",
|
|
611
|
+
k(this, "getTangentAtLength", _((e) => {
|
|
611
612
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
612
613
|
if (o) return o.getTangentAtLength(t.fraction);
|
|
613
614
|
if (this.initial_point) return { x: 0, y: 0 };
|
|
614
615
|
throw new Error("Wrong function at this part.");
|
|
615
616
|
}, "getTangentAtLength"));
|
|
616
|
-
k(this, "getPropertiesAtLength",
|
|
617
|
+
k(this, "getPropertiesAtLength", _((e) => {
|
|
617
618
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
618
619
|
if (o) return o.getPropertiesAtLength(t.fraction);
|
|
619
620
|
if (this.initial_point) return { x: this.initial_point.x, y: this.initial_point.y, tangentX: 0, tangentY: 0 };
|
|
620
621
|
throw new Error("Wrong function at this part.");
|
|
621
622
|
}, "getPropertiesAtLength"));
|
|
622
|
-
k(this, "getParts",
|
|
623
|
+
k(this, "getParts", _(() => {
|
|
623
624
|
const e = [];
|
|
624
625
|
for (let t = 0; t < this.functions.length; t++) if (this.functions[t] !== null) {
|
|
625
626
|
this.functions[t] = this.functions[t];
|
|
@@ -628,95 +629,95 @@ var Qt = O((n, e, t) => {
|
|
|
628
629
|
}
|
|
629
630
|
return e;
|
|
630
631
|
}, "getParts"));
|
|
631
|
-
const t = Array.isArray(e) ? e :
|
|
632
|
+
const t = Array.isArray(e) ? e : O0(e);
|
|
632
633
|
let o, i = [0, 0], a = [0, 0], s = [0, 0];
|
|
633
634
|
for (let r = 0; r < t.length; r++) {
|
|
634
635
|
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] });
|
|
635
636
|
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);
|
|
636
|
-
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
|
|
637
|
-
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
|
|
638
|
-
else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new
|
|
639
|
-
else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new
|
|
640
|
-
else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new
|
|
641
|
-
else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new
|
|
642
|
-
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
|
|
637
|
+
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 tt(i[0], t[r][1], i[1], t[r][2])), i = [t[r][1], t[r][2]];
|
|
638
|
+
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 tt(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]];
|
|
639
|
+
else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new tt(i[0], t[r][1], i[1], i[1])), i[0] = t[r][1];
|
|
640
|
+
else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new tt(i[0], i[0] + t[r][1], i[1], i[1])), i[0] = t[r][1] + i[0];
|
|
641
|
+
else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new tt(i[0], i[0], i[1], t[r][1])), i[1] = t[r][1];
|
|
642
|
+
else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new tt(i[0], i[0], i[1], i[1] + t[r][1])), i[1] = t[r][1] + i[1];
|
|
643
|
+
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 tt(i[0], s[0], i[1], s[1])), i = [s[0], s[1]];
|
|
643
644
|
else if (t[r][0] === "C") o = new ct(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);
|
|
644
|
-
else if (t[r][0] === "c") o = new ct(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
|
|
645
|
+
else if (t[r][0] === "c") o = new ct(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 tt(i[0], i[0], i[1], i[1]));
|
|
645
646
|
else if (t[r][0] === "S") {
|
|
646
647
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
647
648
|
if (o) {
|
|
648
|
-
const
|
|
649
|
-
o = new ct(i[0], i[1], 2 * i[0] -
|
|
649
|
+
const l = o.getC();
|
|
650
|
+
o = new ct(i[0], i[1], 2 * i[0] - l.x, 2 * i[1] - l.y, t[r][1], t[r][2], t[r][3], t[r][4]);
|
|
650
651
|
}
|
|
651
652
|
} else o = new ct(i[0], i[1], i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4]);
|
|
652
653
|
o && (this.length += o.getTotalLength(), i = [t[r][3], t[r][4]], this.functions.push(o));
|
|
653
654
|
} else if (t[r][0] === "s") {
|
|
654
655
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
655
656
|
if (o) {
|
|
656
|
-
const
|
|
657
|
-
o = new ct(i[0], i[1], i[0] + c.x -
|
|
657
|
+
const l = o.getC(), c = o.getD();
|
|
658
|
+
o = new ct(i[0], i[1], i[0] + c.x - l.x, i[1] + c.y - l.y, i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
|
|
658
659
|
}
|
|
659
660
|
} else o = new ct(i[0], i[1], i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
|
|
660
661
|
o && (this.length += o.getTotalLength(), i = [t[r][3] + i[0], t[r][4] + i[1]], this.functions.push(o));
|
|
661
662
|
} else if (t[r][0] === "Q") {
|
|
662
663
|
if (i[0] === t[r][1] && i[1] === t[r][2]) {
|
|
663
|
-
const
|
|
664
|
-
this.length +=
|
|
664
|
+
const l = new tt(t[r][1], t[r][3], t[r][2], t[r][4]);
|
|
665
|
+
this.length += l.getTotalLength(), this.functions.push(l);
|
|
665
666
|
} else o = new ct(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);
|
|
666
667
|
i = [t[r][3], t[r][4]], a = [t[r][1], t[r][2]];
|
|
667
668
|
} else if (t[r][0] === "q") {
|
|
668
669
|
if (t[r][1] !== 0 || t[r][2] !== 0) o = new ct(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);
|
|
669
670
|
else {
|
|
670
|
-
const
|
|
671
|
-
this.length +=
|
|
671
|
+
const l = new tt(i[0] + t[r][1], i[0] + t[r][3], i[1] + t[r][2], i[1] + t[r][4]);
|
|
672
|
+
this.length += l.getTotalLength(), this.functions.push(l);
|
|
672
673
|
}
|
|
673
674
|
a = [i[0] + t[r][1], i[1] + t[r][2]], i = [t[r][3] + i[0], t[r][4] + i[1]];
|
|
674
675
|
} else if (t[r][0] === "T") {
|
|
675
676
|
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new ct(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();
|
|
676
677
|
else {
|
|
677
|
-
const
|
|
678
|
-
this.functions.push(
|
|
678
|
+
const l = new tt(i[0], t[r][1], i[1], t[r][2]);
|
|
679
|
+
this.functions.push(l), this.length += l.getTotalLength();
|
|
679
680
|
}
|
|
680
681
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1], t[r][2]];
|
|
681
682
|
} else if (t[r][0] === "t") {
|
|
682
683
|
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new ct(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);
|
|
683
684
|
else {
|
|
684
|
-
const
|
|
685
|
-
this.length +=
|
|
685
|
+
const l = new tt(i[0], i[0] + t[r][1], i[1], i[1] + t[r][2]);
|
|
686
|
+
this.length += l.getTotalLength(), this.functions.push(l);
|
|
686
687
|
}
|
|
687
688
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1] + i[0], t[r][2] + i[1]];
|
|
688
689
|
} else if (t[r][0] === "A") {
|
|
689
|
-
const
|
|
690
|
-
this.length +=
|
|
690
|
+
const l = new me(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, t[r][6], t[r][7]);
|
|
691
|
+
this.length += l.getTotalLength(), i = [t[r][6], t[r][7]], this.functions.push(l);
|
|
691
692
|
} else if (t[r][0] === "a") {
|
|
692
|
-
const
|
|
693
|
-
this.length +=
|
|
693
|
+
const l = new me(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, i[0] + t[r][6], i[1] + t[r][7]);
|
|
694
|
+
this.length += l.getTotalLength(), i = [i[0] + t[r][6], i[1] + t[r][7]], this.functions.push(l);
|
|
694
695
|
}
|
|
695
696
|
this.partial_lengths.push(this.length);
|
|
696
697
|
}
|
|
697
698
|
}
|
|
698
|
-
},
|
|
699
|
+
}, _(Mt, "SVGPathProperties"), Mt), Lt, ee = (Lt = class {
|
|
699
700
|
constructor(e) {
|
|
700
701
|
k(this, "inst");
|
|
701
|
-
k(this, "getTotalLength",
|
|
702
|
-
k(this, "getPointAtLength",
|
|
703
|
-
k(this, "getTangentAtLength",
|
|
704
|
-
k(this, "getPropertiesAtLength",
|
|
705
|
-
k(this, "getParts",
|
|
706
|
-
if (this.inst = new
|
|
707
|
-
}
|
|
708
|
-
},
|
|
709
|
-
function
|
|
702
|
+
k(this, "getTotalLength", _(() => this.inst.getTotalLength(), "getTotalLength"));
|
|
703
|
+
k(this, "getPointAtLength", _((e) => this.inst.getPointAtLength(e), "getPointAtLength"));
|
|
704
|
+
k(this, "getTangentAtLength", _((e) => this.inst.getTangentAtLength(e), "getTangentAtLength"));
|
|
705
|
+
k(this, "getPropertiesAtLength", _((e) => this.inst.getPropertiesAtLength(e), "getPropertiesAtLength"));
|
|
706
|
+
k(this, "getParts", _(() => this.inst.getParts(), "getParts"));
|
|
707
|
+
if (this.inst = new W0(e), !(this instanceof ee)) return new ee(e);
|
|
708
|
+
}
|
|
709
|
+
}, _(Lt, "_svgPathProperties"), Lt);
|
|
710
|
+
function Y0(n = G.BLACK) {
|
|
710
711
|
return { ...n, alpha: 0 };
|
|
711
712
|
}
|
|
712
|
-
function
|
|
713
|
-
const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100", c = new
|
|
714
|
-
return
|
|
715
|
-
objectType:
|
|
716
|
-
anchor:
|
|
717
|
-
strokeColor:
|
|
713
|
+
function Ci(n = null) {
|
|
714
|
+
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 ee(r).getTotalLength();
|
|
715
|
+
return nt({
|
|
716
|
+
objectType: V.PATH,
|
|
717
|
+
anchor: et,
|
|
718
|
+
strokeColor: J,
|
|
718
719
|
drawn: 1,
|
|
719
|
-
fillColor:
|
|
720
|
+
fillColor: Y0(),
|
|
720
721
|
isRounded: !1,
|
|
721
722
|
height: t,
|
|
722
723
|
path: r,
|
|
@@ -730,10 +731,10 @@ function Zn(n = null) {
|
|
|
730
731
|
...s
|
|
731
732
|
});
|
|
732
733
|
}
|
|
733
|
-
function
|
|
734
|
-
return
|
|
735
|
-
objectType:
|
|
736
|
-
strokeColor:
|
|
734
|
+
function Si(n = null) {
|
|
735
|
+
return nt({
|
|
736
|
+
objectType: V.POLYGON,
|
|
737
|
+
strokeColor: J,
|
|
737
738
|
strokeWidth: 0,
|
|
738
739
|
drawn: 1,
|
|
739
740
|
points: [
|
|
@@ -741,18 +742,18 @@ function Qn(n = null) {
|
|
|
741
742
|
{ x: 100, y: 0 },
|
|
742
743
|
{ x: 100, y: 100 }
|
|
743
744
|
],
|
|
744
|
-
fillColor:
|
|
745
|
+
fillColor: J,
|
|
745
746
|
...n
|
|
746
747
|
});
|
|
747
748
|
}
|
|
748
|
-
function
|
|
749
|
-
return
|
|
750
|
-
objectType:
|
|
751
|
-
anchor:
|
|
752
|
-
strokeColor:
|
|
749
|
+
function Pi(n = null) {
|
|
750
|
+
return nt({
|
|
751
|
+
objectType: V.RECTANGLE,
|
|
752
|
+
anchor: et,
|
|
753
|
+
strokeColor: J,
|
|
753
754
|
strokeWidth: 0,
|
|
754
755
|
drawn: 1,
|
|
755
|
-
fillColor:
|
|
756
|
+
fillColor: J,
|
|
756
757
|
height: 100,
|
|
757
758
|
cornerRadius: 0,
|
|
758
759
|
width: 100,
|
|
@@ -761,10 +762,23 @@ function Jn(n = null) {
|
|
|
761
762
|
...n
|
|
762
763
|
});
|
|
763
764
|
}
|
|
764
|
-
function
|
|
765
|
-
return
|
|
766
|
-
objectType:
|
|
767
|
-
anchor:
|
|
765
|
+
function Ei(n = null) {
|
|
766
|
+
return nt({
|
|
767
|
+
objectType: V.SPOTLIGHT,
|
|
768
|
+
anchor: et,
|
|
769
|
+
color: G(0, 0, 0, 0.8),
|
|
770
|
+
height: 200,
|
|
771
|
+
cornerRadius: 50,
|
|
772
|
+
width: 200,
|
|
773
|
+
x: 0,
|
|
774
|
+
y: 0,
|
|
775
|
+
...n
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
function Ii(n = null) {
|
|
779
|
+
return nt({
|
|
780
|
+
objectType: V.SVG,
|
|
781
|
+
anchor: et,
|
|
768
782
|
height: 100,
|
|
769
783
|
svg: "",
|
|
770
784
|
width: 100,
|
|
@@ -773,11 +787,11 @@ function tr(n = null) {
|
|
|
773
787
|
...n
|
|
774
788
|
});
|
|
775
789
|
}
|
|
776
|
-
const
|
|
790
|
+
const G0 = {
|
|
777
791
|
NORMAL: "normal",
|
|
778
792
|
ITALIC: "italic",
|
|
779
793
|
OBLIQUE: "oblique"
|
|
780
|
-
},
|
|
794
|
+
}, X0 = G0.NORMAL, K0 = {
|
|
781
795
|
THIN: 100,
|
|
782
796
|
EXTRA_LIGHT: 200,
|
|
783
797
|
LIGHT: 300,
|
|
@@ -787,47 +801,47 @@ const Fe = {
|
|
|
787
801
|
BOLD: 700,
|
|
788
802
|
EXTRA_BOLD: 800,
|
|
789
803
|
BLACK: 900
|
|
790
|
-
},
|
|
791
|
-
color:
|
|
804
|
+
}, Z0 = K0.NORMAL, J0 = {
|
|
805
|
+
color: J,
|
|
792
806
|
fontFamily: "sans-serif",
|
|
793
807
|
fontSize: 100,
|
|
794
|
-
fontStyle:
|
|
795
|
-
fontWeight:
|
|
808
|
+
fontStyle: X0,
|
|
809
|
+
fontWeight: Z0,
|
|
796
810
|
ligatures: !1,
|
|
797
811
|
subscript: !1,
|
|
798
812
|
superscript: !1
|
|
799
813
|
};
|
|
800
|
-
function
|
|
814
|
+
function e0(n) {
|
|
801
815
|
return typeof n == "string" ? [[{ text: n }]] : n.map((e) => e.map((t) => typeof t == "string" ? { text: t } : t));
|
|
802
816
|
}
|
|
803
|
-
function
|
|
804
|
-
return
|
|
817
|
+
function Q0(n) {
|
|
818
|
+
return e0(n).reduce(
|
|
805
819
|
(t, o) => t + o.reduce((i, a) => i + a.text.length, 0),
|
|
806
820
|
0
|
|
807
821
|
);
|
|
808
822
|
}
|
|
809
|
-
function
|
|
810
|
-
return
|
|
811
|
-
objectType:
|
|
812
|
-
alignment:
|
|
813
|
-
anchor:
|
|
823
|
+
function tn(n = "", e = null) {
|
|
824
|
+
return nt({
|
|
825
|
+
objectType: V.TEXT,
|
|
826
|
+
alignment: S0,
|
|
827
|
+
anchor: et,
|
|
814
828
|
length: null,
|
|
815
829
|
lineSpacing: 1,
|
|
816
830
|
text: n,
|
|
817
831
|
x: 0,
|
|
818
832
|
y: 0,
|
|
819
|
-
...
|
|
833
|
+
...J0,
|
|
820
834
|
...e
|
|
821
835
|
});
|
|
822
836
|
}
|
|
823
|
-
|
|
837
|
+
tn.writeOn = (n, e = {}) => ce(
|
|
824
838
|
n,
|
|
825
839
|
{
|
|
826
|
-
length:
|
|
840
|
+
length: Q0(n.text)
|
|
827
841
|
},
|
|
828
842
|
e
|
|
829
843
|
);
|
|
830
|
-
const
|
|
844
|
+
const ue = "presenter.navigator.state", mt = {
|
|
831
845
|
open: !1,
|
|
832
846
|
visibility: {
|
|
833
847
|
slides: !0,
|
|
@@ -835,28 +849,28 @@ const h0 = "presenter.navigator.state", mt = {
|
|
|
835
849
|
next: !0
|
|
836
850
|
}
|
|
837
851
|
};
|
|
838
|
-
function
|
|
852
|
+
function fe() {
|
|
839
853
|
return typeof document > "u" ? !1 : Array.from(document.scripts).some((n) => n.src.includes("/@vite/client"));
|
|
840
854
|
}
|
|
841
|
-
function
|
|
842
|
-
return
|
|
855
|
+
function en() {
|
|
856
|
+
return fe() ? de().open : !1;
|
|
843
857
|
}
|
|
844
|
-
function
|
|
845
|
-
|
|
846
|
-
...
|
|
858
|
+
function nn() {
|
|
859
|
+
i0({
|
|
860
|
+
...de(),
|
|
847
861
|
open: !0
|
|
848
862
|
});
|
|
849
863
|
}
|
|
850
|
-
function
|
|
864
|
+
function n0() {
|
|
851
865
|
var n;
|
|
852
|
-
(n =
|
|
866
|
+
(n = ge()) == null || n.removeItem(ue);
|
|
853
867
|
}
|
|
854
|
-
function
|
|
868
|
+
function de() {
|
|
855
869
|
var n, e, t, o;
|
|
856
|
-
if (!
|
|
870
|
+
if (!fe())
|
|
857
871
|
return mt;
|
|
858
872
|
try {
|
|
859
|
-
const i = (n =
|
|
873
|
+
const i = (n = ge()) == null ? void 0 : n.getItem(ue);
|
|
860
874
|
if (i == null)
|
|
861
875
|
return mt;
|
|
862
876
|
const a = JSON.parse(i);
|
|
@@ -872,28 +886,28 @@ function c0() {
|
|
|
872
886
|
return mt;
|
|
873
887
|
}
|
|
874
888
|
}
|
|
875
|
-
function
|
|
889
|
+
function i0(n) {
|
|
876
890
|
var e;
|
|
877
|
-
|
|
891
|
+
fe() && ((e = ge()) == null || e.setItem(ue, JSON.stringify(n)));
|
|
878
892
|
}
|
|
879
|
-
function
|
|
893
|
+
function ge() {
|
|
880
894
|
try {
|
|
881
895
|
return window.sessionStorage;
|
|
882
896
|
} catch {
|
|
883
897
|
return null;
|
|
884
898
|
}
|
|
885
899
|
}
|
|
886
|
-
function
|
|
900
|
+
function r0(n) {
|
|
887
901
|
return n.altKey || n.ctrlKey || n.metaKey || n.shiftKey;
|
|
888
902
|
}
|
|
889
|
-
function
|
|
903
|
+
function Me(n) {
|
|
890
904
|
var o, i;
|
|
891
905
|
if (n === null)
|
|
892
906
|
return !1;
|
|
893
907
|
const e = n, t = (o = e.tagName) == null ? void 0 : o.toLowerCase();
|
|
894
908
|
return t === "input" || t === "textarea" || t === "select" || t === "button" || e.isContentEditable ? !0 : (((i = e.closest) == null ? void 0 : i.call(e, "[contenteditable=''], [contenteditable='true']")) ?? null) !== null;
|
|
895
909
|
}
|
|
896
|
-
function
|
|
910
|
+
function rn(n) {
|
|
897
911
|
var o;
|
|
898
912
|
const { slides: e } = n, t = {
|
|
899
913
|
// First build of first slide
|
|
@@ -911,20 +925,20 @@ function We(n) {
|
|
|
911
925
|
if (a === void 0)
|
|
912
926
|
continue;
|
|
913
927
|
const s = a.shortcut;
|
|
914
|
-
|
|
928
|
+
jt(t, s, i, 0);
|
|
915
929
|
for (let r = 0; r < a.animations.length; r++) {
|
|
916
|
-
const
|
|
917
|
-
if (
|
|
918
|
-
if (Array.isArray(
|
|
919
|
-
for (const c of
|
|
920
|
-
|
|
930
|
+
const l = a.animations[r];
|
|
931
|
+
if (l !== void 0)
|
|
932
|
+
if (Array.isArray(l))
|
|
933
|
+
for (const c of l)
|
|
934
|
+
jt(t, c.shortcut, i, r + 1);
|
|
921
935
|
else
|
|
922
|
-
|
|
936
|
+
jt(t, l.shortcut, i, r + 1);
|
|
923
937
|
}
|
|
924
938
|
}
|
|
925
939
|
return t;
|
|
926
940
|
}
|
|
927
|
-
function
|
|
941
|
+
function jt(n, e, t, o) {
|
|
928
942
|
if (e !== null)
|
|
929
943
|
if (Array.isArray(e))
|
|
930
944
|
for (const i of e)
|
|
@@ -932,17 +946,17 @@ function zt(n, e, t, o) {
|
|
|
932
946
|
else
|
|
933
947
|
n[e] = { slideIndex: t, buildIndex: o };
|
|
934
948
|
}
|
|
935
|
-
function
|
|
949
|
+
function Le(n, e) {
|
|
936
950
|
const t = n[e];
|
|
937
951
|
return t !== void 0 ? t : isNaN(Number(e)) ? null : { slideIndex: Number(e) - 1, buildIndex: 0 };
|
|
938
952
|
}
|
|
939
|
-
function
|
|
940
|
-
t.shortcuts =
|
|
953
|
+
function o0(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }, { focusOnPointerDown: r = !1, keyEventTarget: l = e, signal: c } = {}) {
|
|
954
|
+
t.shortcuts = rn(n);
|
|
941
955
|
const u = c === void 0 ? void 0 : { signal: c };
|
|
942
956
|
r && (e.hasAttribute("tabindex") || (e.tabIndex = -1), e.addEventListener(
|
|
943
957
|
"pointerdown",
|
|
944
|
-
(
|
|
945
|
-
|
|
958
|
+
(g) => {
|
|
959
|
+
Me(g.target) || e.focus({ preventScroll: !0 });
|
|
946
960
|
},
|
|
947
961
|
u
|
|
948
962
|
)), e.addEventListener(
|
|
@@ -951,51 +965,51 @@ function Z0(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigat
|
|
|
951
965
|
e.style.cursor = "auto";
|
|
952
966
|
},
|
|
953
967
|
u
|
|
954
|
-
),
|
|
968
|
+
), l.addEventListener(
|
|
955
969
|
"keyup",
|
|
956
|
-
(
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
970
|
+
(g) => {
|
|
971
|
+
const h = g;
|
|
972
|
+
if (Me(h.target))
|
|
959
973
|
return;
|
|
960
|
-
if (
|
|
974
|
+
if (h.code === "Escape") {
|
|
961
975
|
t.textCommand = null;
|
|
962
976
|
return;
|
|
963
977
|
}
|
|
964
|
-
if (
|
|
965
|
-
o(
|
|
978
|
+
if (h.code === "ArrowRight" || h.code === "Space") {
|
|
979
|
+
o(h.shiftKey);
|
|
966
980
|
return;
|
|
967
981
|
}
|
|
968
|
-
if (
|
|
969
|
-
i(
|
|
982
|
+
if (h.code === "ArrowLeft") {
|
|
983
|
+
i(h.shiftKey);
|
|
970
984
|
return;
|
|
971
985
|
}
|
|
972
|
-
const f =
|
|
986
|
+
const f = on(h);
|
|
973
987
|
if (f !== null) {
|
|
974
|
-
const v =
|
|
988
|
+
const v = Le(
|
|
975
989
|
t.shortcuts,
|
|
976
990
|
f
|
|
977
991
|
);
|
|
978
|
-
t.textCommand = null, v !== null && (
|
|
992
|
+
t.textCommand = null, v !== null && (h.preventDefault(), a(v.slideIndex, v.buildIndex));
|
|
979
993
|
return;
|
|
980
994
|
}
|
|
981
995
|
if (t.textCommand !== null) {
|
|
982
|
-
if (
|
|
996
|
+
if (h.code === "Enter") {
|
|
983
997
|
const v = t.textCommand;
|
|
984
998
|
t.textCommand = null;
|
|
985
|
-
const y =
|
|
999
|
+
const y = Le(
|
|
986
1000
|
t.shortcuts,
|
|
987
1001
|
v
|
|
988
1002
|
);
|
|
989
1003
|
y !== null && a(y.slideIndex, y.buildIndex);
|
|
990
1004
|
return;
|
|
991
|
-
} else
|
|
1005
|
+
} else h.code === "Backspace" ? t.textCommand = t.textCommand.slice(0, -1) : t.textCommand += h.key;
|
|
992
1006
|
return;
|
|
993
1007
|
}
|
|
994
|
-
if (
|
|
1008
|
+
if (h.key === "g") {
|
|
995
1009
|
t.textCommand = "";
|
|
996
1010
|
return;
|
|
997
1011
|
}
|
|
998
|
-
if (
|
|
1012
|
+
if (h.key === "`" && !r0(h)) {
|
|
999
1013
|
s();
|
|
1000
1014
|
return;
|
|
1001
1015
|
}
|
|
@@ -1003,18 +1017,18 @@ function Z0(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigat
|
|
|
1003
1017
|
u
|
|
1004
1018
|
);
|
|
1005
1019
|
}
|
|
1006
|
-
function
|
|
1020
|
+
function on(n) {
|
|
1007
1021
|
return !n.altKey || n.ctrlKey || n.metaKey || n.shiftKey ? null : n.code.startsWith("Key") && n.code.length === 4 ? n.code.slice(3).toLowerCase() : n.code.startsWith("Digit") && n.code.length === 6 ? n.code.slice(5) : n.code.startsWith("Numpad") && n.code.length === 7 ? n.code.slice(6) : null;
|
|
1008
1022
|
}
|
|
1009
|
-
let R = null,
|
|
1010
|
-
const
|
|
1011
|
-
let
|
|
1023
|
+
let R = null, Rt = null, vt = null;
|
|
1024
|
+
const Ce = "__presenterNavigatorInstanceId";
|
|
1025
|
+
let s0 = {
|
|
1012
1026
|
width: 700,
|
|
1013
1027
|
height: 680,
|
|
1014
1028
|
left: 20,
|
|
1015
1029
|
top: 50
|
|
1016
1030
|
};
|
|
1017
|
-
function
|
|
1031
|
+
function sn({
|
|
1018
1032
|
presentation: n,
|
|
1019
1033
|
shortcutState: e,
|
|
1020
1034
|
onNavigateToSlide: t,
|
|
@@ -1023,20 +1037,20 @@ function Xe({
|
|
|
1023
1037
|
onPrevious: a,
|
|
1024
1038
|
forceRefresh: s = !1
|
|
1025
1039
|
}) {
|
|
1026
|
-
if (R !== null && !R.closed && (
|
|
1027
|
-
return R.focus(),
|
|
1028
|
-
if ((R === null || R.closed) && (R = window.open("", "Navigator",
|
|
1040
|
+
if (R !== null && !R.closed && (Ft(R), !s))
|
|
1041
|
+
return R.focus(), Rt;
|
|
1042
|
+
if ((R === null || R.closed) && (R = window.open("", "Navigator", cn())), R === null)
|
|
1029
1043
|
return console.error("Failed to open navigator window."), null;
|
|
1030
|
-
|
|
1031
|
-
const r =
|
|
1032
|
-
|
|
1033
|
-
const c =
|
|
1044
|
+
vt == null || vt();
|
|
1045
|
+
const r = un(R), l = new AbortController();
|
|
1046
|
+
vt = () => l.abort();
|
|
1047
|
+
const c = an(
|
|
1034
1048
|
n,
|
|
1035
1049
|
t,
|
|
1036
1050
|
i,
|
|
1037
1051
|
r.isActive
|
|
1038
1052
|
);
|
|
1039
|
-
return
|
|
1053
|
+
return Rt = c, nn(), R.document.title = n.title, R.document.body.replaceChildren(c.element), o0(
|
|
1040
1054
|
n,
|
|
1041
1055
|
c.element,
|
|
1042
1056
|
e,
|
|
@@ -1047,104 +1061,104 @@ function Xe({
|
|
|
1047
1061
|
onPrevious: (u) => {
|
|
1048
1062
|
r.isActive() && a(u);
|
|
1049
1063
|
},
|
|
1050
|
-
onRenderSlide: (u,
|
|
1051
|
-
r.isActive() && o(u,
|
|
1064
|
+
onRenderSlide: (u, g) => {
|
|
1065
|
+
r.isActive() && o(u, g);
|
|
1052
1066
|
},
|
|
1053
1067
|
onShowNavigator: () => {
|
|
1054
|
-
r.isActive() &&
|
|
1068
|
+
r.isActive() && ne();
|
|
1055
1069
|
}
|
|
1056
1070
|
},
|
|
1057
1071
|
{
|
|
1058
1072
|
keyEventTarget: R,
|
|
1059
|
-
signal:
|
|
1073
|
+
signal: l.signal
|
|
1060
1074
|
}
|
|
1061
|
-
), R.addEventListener("resize", () =>
|
|
1062
|
-
signal:
|
|
1075
|
+
), R.addEventListener("resize", () => Ft(R), {
|
|
1076
|
+
signal: l.signal
|
|
1063
1077
|
}), R.addEventListener(
|
|
1064
1078
|
"beforeunload",
|
|
1065
1079
|
() => {
|
|
1066
|
-
|
|
1080
|
+
Ft(R), n0();
|
|
1067
1081
|
},
|
|
1068
1082
|
{
|
|
1069
|
-
signal:
|
|
1083
|
+
signal: l.signal
|
|
1070
1084
|
}
|
|
1071
1085
|
), R.addEventListener(
|
|
1072
1086
|
"keyup",
|
|
1073
1087
|
(u) => {
|
|
1074
|
-
r.isActive() && (u.key === "Escape" || u.key === "`" && !
|
|
1088
|
+
r.isActive() && (u.key === "Escape" || u.key === "`" && !r0(u)) && ne();
|
|
1075
1089
|
},
|
|
1076
1090
|
{
|
|
1077
|
-
signal:
|
|
1091
|
+
signal: l.signal
|
|
1078
1092
|
}
|
|
1079
|
-
),
|
|
1093
|
+
), Rt;
|
|
1080
1094
|
}
|
|
1081
|
-
function
|
|
1095
|
+
function an(n, e, t, o = () => !0) {
|
|
1082
1096
|
const i = (R == null ? void 0 : R.document) ?? document, a = i.createElement("div");
|
|
1083
1097
|
a.style.boxSizing = "border-box", a.style.display = "grid", a.style.gridTemplateColumns = "260px 1fr", a.style.gap = "18px", a.style.height = "100vh", a.style.overflow = "hidden", a.style.padding = "18px", a.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', a.style.backgroundColor = "#f5f6f8", a.style.color = "#1f2937", i.body.style.margin = "0", i.body.style.overflow = "hidden";
|
|
1084
1098
|
const s = i.createElement("div");
|
|
1085
1099
|
s.style.display = "flex", s.style.flexDirection = "column", s.style.gap = "8px", s.style.minHeight = "0", s.style.overflowY = "auto", s.style.paddingRight = "4px";
|
|
1086
1100
|
const r = i.createElement("div");
|
|
1087
1101
|
r.style.display = "flex", r.style.flexDirection = "column", r.style.gap = "14px", r.style.minHeight = "0", r.style.minWidth = "0", r.style.overflow = "hidden";
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1102
|
+
const l = i.createElement("div");
|
|
1103
|
+
l.style.display = "flex", l.style.gap = "14px", l.style.alignItems = "center", l.style.flexWrap = "wrap", l.style.fontSize = "13px", l.style.color = "#4b5563";
|
|
1090
1104
|
const c = i.createElement("div");
|
|
1091
1105
|
c.style.display = "flex", c.style.gap = "14px", c.style.flex = "1 1 auto", c.style.minHeight = "0", c.style.minWidth = "0", c.style.overflow = "hidden";
|
|
1092
|
-
const u =
|
|
1093
|
-
|
|
1106
|
+
const u = Se("Current", n), g = Se("Next", n), h = de();
|
|
1107
|
+
g.container.style.cursor = "pointer", g.container.addEventListener("click", () => {
|
|
1094
1108
|
o() && t();
|
|
1095
1109
|
});
|
|
1096
|
-
const f = n.slides.map((E,
|
|
1097
|
-
const I =
|
|
1110
|
+
const f = n.slides.map((E, M) => {
|
|
1111
|
+
const I = ln(E, M);
|
|
1098
1112
|
return I.style.cursor = "pointer", I.addEventListener("click", (F) => {
|
|
1099
|
-
o() && (F.shiftKey &&
|
|
1113
|
+
o() && (F.shiftKey && ne(), e(M));
|
|
1100
1114
|
}), s.appendChild(I), I;
|
|
1101
|
-
}), v = Ht("Slides", s,
|
|
1115
|
+
}), v = Ht("Slides", s, h.visibility.slides), y = Ht(
|
|
1102
1116
|
"Current",
|
|
1103
1117
|
u.container,
|
|
1104
|
-
|
|
1105
|
-
),
|
|
1118
|
+
h.visibility.current
|
|
1119
|
+
), T = Ht(
|
|
1106
1120
|
"Next",
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
),
|
|
1110
|
-
const E = y.input.checked &&
|
|
1111
|
-
a.style.gridTemplateColumns = v.input.checked ? "260px 1fr" : "1fr", c.style.flexDirection = E ? "column" : "row", u.container.style.flex = "1 1 0",
|
|
1112
|
-
u.resize(),
|
|
1113
|
-
}),
|
|
1114
|
-
...
|
|
1121
|
+
g.container,
|
|
1122
|
+
h.visibility.next
|
|
1123
|
+
), L = () => {
|
|
1124
|
+
const E = y.input.checked && T.input.checked && S();
|
|
1125
|
+
a.style.gridTemplateColumns = v.input.checked ? "260px 1fr" : "1fr", c.style.flexDirection = E ? "column" : "row", u.container.style.flex = "1 1 0", g.container.style.flex = "1 1 0", requestAnimationFrame(() => {
|
|
1126
|
+
u.resize(), g.resize();
|
|
1127
|
+
}), i0({
|
|
1128
|
+
...h,
|
|
1115
1129
|
open: !0,
|
|
1116
1130
|
visibility: {
|
|
1117
1131
|
slides: v.input.checked,
|
|
1118
1132
|
current: y.input.checked,
|
|
1119
|
-
next:
|
|
1133
|
+
next: T.input.checked
|
|
1120
1134
|
}
|
|
1121
1135
|
});
|
|
1122
1136
|
};
|
|
1123
|
-
v.input.addEventListener("change",
|
|
1124
|
-
function
|
|
1125
|
-
o() && (f.forEach((
|
|
1137
|
+
v.input.addEventListener("change", L), y.input.addEventListener("change", L), T.input.addEventListener("change", L), R == null || R.addEventListener("resize", L), l.appendChild(v.element), l.appendChild(y.element), l.appendChild(T.element), c.appendChild(u.container), c.appendChild(g.container), r.appendChild(l), r.appendChild(c), a.appendChild(s), a.appendChild(r);
|
|
1138
|
+
function P(E, M, I, F) {
|
|
1139
|
+
o() && (f.forEach((Y, z) => {
|
|
1126
1140
|
const U = z === E;
|
|
1127
|
-
|
|
1128
|
-
}), u.label.textContent =
|
|
1141
|
+
Y.style.backgroundColor = U ? "#dbeafe" : "#ffffff", Y.style.borderColor = U ? "#60a5fa" : "#e5e7eb", Y.style.color = U ? "#1e3a8a" : "#1f2937";
|
|
1142
|
+
}), u.label.textContent = Pe(n, E, M), g.label.textContent = Pe(n, I, F), hn(f[E], s), L());
|
|
1129
1143
|
}
|
|
1130
|
-
function
|
|
1144
|
+
function S() {
|
|
1131
1145
|
const E = R;
|
|
1132
1146
|
if (E === null)
|
|
1133
1147
|
return !1;
|
|
1134
|
-
const
|
|
1148
|
+
const M = v.input.checked ? 278 : 0, I = E.innerWidth - 36 - M, F = E.innerHeight - 36 - l.offsetHeight - 14;
|
|
1135
1149
|
return I <= 0 || F <= 0 ? !1 : I / F < 1.1;
|
|
1136
1150
|
}
|
|
1137
1151
|
return {
|
|
1138
1152
|
element: a,
|
|
1139
1153
|
currentCanvas: u.canvas,
|
|
1140
|
-
nextCanvas:
|
|
1154
|
+
nextCanvas: g.canvas,
|
|
1141
1155
|
currentLabel: u.label,
|
|
1142
|
-
nextLabel:
|
|
1156
|
+
nextLabel: g.label,
|
|
1143
1157
|
isOpen: () => R !== null && !R.closed,
|
|
1144
|
-
update:
|
|
1158
|
+
update: P
|
|
1145
1159
|
};
|
|
1146
1160
|
}
|
|
1147
|
-
function
|
|
1161
|
+
function ln(n, e) {
|
|
1148
1162
|
const t = (R == null ? void 0 : R.document) ?? document, o = t.createElement("div");
|
|
1149
1163
|
o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "10px", o.style.padding = "8px 10px", o.style.backgroundColor = "#ffffff", o.style.border = "1px solid #e5e7eb", o.style.borderRadius = "6px", o.style.boxShadow = "0 1px 2px rgba(15, 23, 42, 0.06)", o.style.fontSize = "14px", o.style.lineHeight = "1", o.style.userSelect = "none";
|
|
1150
1164
|
const i = t.createElement("div");
|
|
@@ -1152,7 +1166,7 @@ function Ke(n, e) {
|
|
|
1152
1166
|
const a = t.createElement("div");
|
|
1153
1167
|
return a.textContent = n.title.length > 0 ? n.title : `Slide ${e + 1}`, a.style.overflow = "hidden", a.style.textOverflow = "ellipsis", a.style.whiteSpace = "nowrap", o.appendChild(i), o.appendChild(a), o;
|
|
1154
1168
|
}
|
|
1155
|
-
function
|
|
1169
|
+
function Se(n, e) {
|
|
1156
1170
|
var u;
|
|
1157
1171
|
const t = (R == null ? void 0 : R.document) ?? document, o = t.createElement("div");
|
|
1158
1172
|
o.style.display = "flex", o.style.alignItems = "center", o.style.flexDirection = "column", o.style.minHeight = "0", o.style.minWidth = "0";
|
|
@@ -1164,15 +1178,15 @@ function L0(n, e) {
|
|
|
1164
1178
|
s.style.flex = "1 1 auto", s.style.display = "flex", s.style.alignItems = "flex-start", s.style.justifyContent = "center", s.style.minHeight = "0", s.style.width = "100%", s.style.overflow = "hidden";
|
|
1165
1179
|
const r = t.createElement("canvas");
|
|
1166
1180
|
r.style.display = "block", r.style.width = "0", r.style.height = "0";
|
|
1167
|
-
function
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1181
|
+
function l() {
|
|
1182
|
+
const g = s.clientWidth, h = s.clientHeight;
|
|
1183
|
+
if (g <= 0 || h <= 0)
|
|
1170
1184
|
return;
|
|
1171
|
-
const f = e.size.width / e.size.height, v = Math.min(
|
|
1185
|
+
const f = e.size.width / e.size.height, v = Math.min(g, h * f), y = v / f;
|
|
1172
1186
|
r.style.width = `${v}px`, r.style.height = `${y}px`;
|
|
1173
1187
|
}
|
|
1174
1188
|
const c = (u = t.defaultView) == null ? void 0 : u.ResizeObserver;
|
|
1175
|
-
return c !== void 0 && new c(
|
|
1189
|
+
return c !== void 0 && new c(l).observe(s), R == null || R.addEventListener("resize", l), s.appendChild(r), o.appendChild(i), o.appendChild(a), o.appendChild(s), { container: o, label: a, canvas: r, resize: l };
|
|
1176
1190
|
}
|
|
1177
1191
|
function Ht(n, e, t) {
|
|
1178
1192
|
const o = (R == null ? void 0 : R.document) ?? document, i = e.style.display || "block", a = o.createElement("label");
|
|
@@ -1182,98 +1196,98 @@ function Ht(n, e, t) {
|
|
|
1182
1196
|
e.style.display = s.checked ? i : "none";
|
|
1183
1197
|
}), a.appendChild(s), a.appendChild(o.createTextNode(n)), { element: a, input: s };
|
|
1184
1198
|
}
|
|
1185
|
-
function
|
|
1199
|
+
function Pe(n, e, t) {
|
|
1186
1200
|
if (e === null)
|
|
1187
1201
|
return "End of presentation";
|
|
1188
1202
|
const o = n.slides[e];
|
|
1189
1203
|
return o === void 0 ? "No slide" : `Slide ${e + 1} of ${n.slides.length}, Build ${t + 1} of ${o.animations.length + 1}`;
|
|
1190
1204
|
}
|
|
1191
|
-
function
|
|
1205
|
+
function hn(n, e) {
|
|
1192
1206
|
if (n === void 0)
|
|
1193
1207
|
return;
|
|
1194
1208
|
const t = n.offsetTop, o = t + n.offsetHeight, i = e.scrollTop, a = i + e.clientHeight;
|
|
1195
1209
|
(t < i || o > a) && n.scrollIntoView({ block: "nearest" });
|
|
1196
1210
|
}
|
|
1197
|
-
function
|
|
1198
|
-
|
|
1211
|
+
function ne() {
|
|
1212
|
+
Ft(R), n0(), vt == null || vt(), R == null || R.close(), R = null, Rt = null, vt = null;
|
|
1199
1213
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const { width: n, height: e, left: t, top: o } =
|
|
1214
|
+
function cn() {
|
|
1215
|
+
const { width: n, height: e, left: t, top: o } = s0;
|
|
1202
1216
|
return `width=${n},height=${e},left=${t},top=${o}`;
|
|
1203
1217
|
}
|
|
1204
|
-
function
|
|
1205
|
-
n === null || n.closed || (
|
|
1218
|
+
function Ft(n) {
|
|
1219
|
+
n === null || n.closed || (s0 = {
|
|
1206
1220
|
width: n.outerWidth,
|
|
1207
1221
|
height: n.outerHeight,
|
|
1208
1222
|
left: n.screenX,
|
|
1209
1223
|
top: n.screenY
|
|
1210
1224
|
});
|
|
1211
1225
|
}
|
|
1212
|
-
function
|
|
1226
|
+
function un(n) {
|
|
1213
1227
|
var o;
|
|
1214
1228
|
const e = typeof ((o = globalThis.crypto) == null ? void 0 : o.randomUUID) == "function" ? globalThis.crypto.randomUUID() : `${Date.now()}-${Math.random()}`, t = n;
|
|
1215
|
-
return t[
|
|
1216
|
-
isActive: () => !n.closed && t[
|
|
1229
|
+
return t[Ce] = e, {
|
|
1230
|
+
isActive: () => !n.closed && t[Ce] === e
|
|
1217
1231
|
};
|
|
1218
1232
|
}
|
|
1219
|
-
function
|
|
1233
|
+
function Q(n = null) {
|
|
1220
1234
|
return {
|
|
1221
1235
|
height: 0,
|
|
1222
1236
|
width: 0,
|
|
1223
1237
|
...n
|
|
1224
1238
|
};
|
|
1225
1239
|
}
|
|
1226
|
-
const
|
|
1227
|
-
function
|
|
1240
|
+
const fn = Q({ width: 0, height: 0 });
|
|
1241
|
+
function dn(n = null) {
|
|
1228
1242
|
return {
|
|
1229
1243
|
backgroundColor: G.WHITE,
|
|
1230
1244
|
slides: [],
|
|
1231
1245
|
title: "Presentation",
|
|
1232
|
-
size:
|
|
1246
|
+
size: Q({ width: 3840, height: 2160 }),
|
|
1233
1247
|
resources: {
|
|
1234
1248
|
images: {}
|
|
1235
1249
|
},
|
|
1236
1250
|
...n
|
|
1237
1251
|
};
|
|
1238
1252
|
}
|
|
1239
|
-
function
|
|
1253
|
+
function gn(n) {
|
|
1240
1254
|
const e = Array.isArray(n) ? n : [n];
|
|
1241
1255
|
let t = 0, o = 0;
|
|
1242
1256
|
for (const i of e)
|
|
1243
1257
|
switch (i.type) {
|
|
1244
|
-
case
|
|
1258
|
+
case dt.PAUSE:
|
|
1245
1259
|
t += i.duration;
|
|
1246
1260
|
break;
|
|
1247
|
-
case
|
|
1261
|
+
case dt.ANIMATE:
|
|
1248
1262
|
o = Math.max(o, t + i.delay + i.duration), i.block && (t += i.delay + i.duration);
|
|
1249
1263
|
break;
|
|
1250
|
-
case
|
|
1264
|
+
case dt.UPDATE:
|
|
1251
1265
|
break;
|
|
1252
1266
|
default:
|
|
1253
|
-
|
|
1267
|
+
ht(i);
|
|
1254
1268
|
}
|
|
1255
1269
|
return o;
|
|
1256
1270
|
}
|
|
1257
|
-
function
|
|
1258
|
-
const { red: t, green: o, blue: i } = n, a =
|
|
1271
|
+
function pe(n, e = null) {
|
|
1272
|
+
const { red: t, green: o, blue: i } = n, a = Je(n, e);
|
|
1259
1273
|
return `rgba(${t}, ${o}, ${i}, ${a})`;
|
|
1260
1274
|
}
|
|
1261
|
-
function
|
|
1275
|
+
function a0(n) {
|
|
1262
1276
|
return n === document.body;
|
|
1263
1277
|
}
|
|
1264
|
-
function
|
|
1278
|
+
function pn(n, e) {
|
|
1265
1279
|
const t = document.createElement("div");
|
|
1266
|
-
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative",
|
|
1280
|
+
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", a0(e)) {
|
|
1267
1281
|
t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto", t.style.overflowY = "clip", document.title = n.title, document.documentElement.style.height = "100%", document.body.style.margin = "0", document.body.style.height = "100%", document.body.style.width = "100%", document.body.style.backgroundColor = "#000000";
|
|
1268
1282
|
const o = n.size.height / n.size.width;
|
|
1269
|
-
|
|
1283
|
+
Ee(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => Ee(t, o));
|
|
1270
1284
|
}
|
|
1271
1285
|
return t;
|
|
1272
1286
|
}
|
|
1273
|
-
function
|
|
1287
|
+
function Ee(n, e) {
|
|
1274
1288
|
window.innerHeight / window.innerWidth > e ? (n.style.width = "100%", n.style.height = "auto") : (n.style.width = "auto", n.style.height = "100%");
|
|
1275
1289
|
}
|
|
1276
|
-
const
|
|
1290
|
+
const xn = {
|
|
1277
1291
|
check: (n) => typeof n == "object" && n !== null && typeof n.red == "number" && typeof n.green == "number" && typeof n.blue == "number" && typeof n.alpha == "number",
|
|
1278
1292
|
interpolate: (n, e, t) => ({
|
|
1279
1293
|
red: Math.round(n.red + (e.red - n.red) * t),
|
|
@@ -1281,30 +1295,30 @@ const r1 = {
|
|
|
1281
1295
|
blue: Math.round(n.blue + (e.blue - n.blue) * t),
|
|
1282
1296
|
alpha: n.alpha + (e.alpha - n.alpha) * t
|
|
1283
1297
|
})
|
|
1284
|
-
},
|
|
1298
|
+
}, yn = {
|
|
1285
1299
|
check: (n) => !0,
|
|
1286
1300
|
interpolate: (n, e) => e
|
|
1287
|
-
},
|
|
1301
|
+
}, vn = {
|
|
1288
1302
|
check: (n) => typeof n == "number",
|
|
1289
1303
|
interpolate: (n, e, t) => n + (e - n) * t
|
|
1290
|
-
},
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1304
|
+
}, Ie = [
|
|
1305
|
+
vn,
|
|
1306
|
+
xn,
|
|
1307
|
+
yn
|
|
1294
1308
|
];
|
|
1295
|
-
function
|
|
1309
|
+
function wn(n, e, t, o = null) {
|
|
1296
1310
|
if (t === 0)
|
|
1297
1311
|
return n;
|
|
1298
1312
|
if (t === 1)
|
|
1299
1313
|
return { ...n, ...e };
|
|
1300
|
-
const i = o != null ? [...o, ...
|
|
1314
|
+
const i = o != null ? [...o, ...Ie] : Ie, a = {};
|
|
1301
1315
|
for (const s in e) {
|
|
1302
|
-
const r = n[s],
|
|
1316
|
+
const r = n[s], l = e[s];
|
|
1303
1317
|
for (const c of i)
|
|
1304
|
-
if (c.check(r, s) && c.check(
|
|
1318
|
+
if (c.check(r, s) && c.check(l, s)) {
|
|
1305
1319
|
a[s] = c.interpolate(
|
|
1306
1320
|
r,
|
|
1307
|
-
|
|
1321
|
+
l,
|
|
1308
1322
|
t
|
|
1309
1323
|
);
|
|
1310
1324
|
break;
|
|
@@ -1312,7 +1326,7 @@ function s1(n, e, t, o = null) {
|
|
|
1312
1326
|
}
|
|
1313
1327
|
return { ...n, ...a };
|
|
1314
1328
|
}
|
|
1315
|
-
function
|
|
1329
|
+
function ke(n, e, t = null) {
|
|
1316
1330
|
if (e === null)
|
|
1317
1331
|
return;
|
|
1318
1332
|
const o = Array.isArray(e) ? e : [e];
|
|
@@ -1321,11 +1335,11 @@ function S0(n, e, t = null) {
|
|
|
1321
1335
|
if (t !== null && i > t)
|
|
1322
1336
|
break;
|
|
1323
1337
|
switch (a.type) {
|
|
1324
|
-
case
|
|
1338
|
+
case dt.ANIMATE: {
|
|
1325
1339
|
const s = n.get(a.object);
|
|
1326
1340
|
if (s === void 0)
|
|
1327
1341
|
break;
|
|
1328
|
-
const r = t !== null ? t - i : null,
|
|
1342
|
+
const r = t !== null ? t - i : null, l = Math.max(
|
|
1329
1343
|
Math.min(
|
|
1330
1344
|
r !== null ? (r - a.delay) / a.duration : 1,
|
|
1331
1345
|
1
|
|
@@ -1334,16 +1348,16 @@ function S0(n, e, t = null) {
|
|
|
1334
1348
|
);
|
|
1335
1349
|
n.set(a.object, {
|
|
1336
1350
|
...s,
|
|
1337
|
-
...
|
|
1351
|
+
...wn(
|
|
1338
1352
|
s,
|
|
1339
1353
|
a.props,
|
|
1340
|
-
a.easing(
|
|
1354
|
+
a.easing(l),
|
|
1341
1355
|
a.interpolators
|
|
1342
1356
|
)
|
|
1343
1357
|
}), a.block && (i += a.delay + a.duration);
|
|
1344
1358
|
break;
|
|
1345
1359
|
}
|
|
1346
|
-
case
|
|
1360
|
+
case dt.UPDATE: {
|
|
1347
1361
|
const s = n.get(a.object);
|
|
1348
1362
|
if (s === void 0)
|
|
1349
1363
|
break;
|
|
@@ -1353,18 +1367,18 @@ function S0(n, e, t = null) {
|
|
|
1353
1367
|
});
|
|
1354
1368
|
break;
|
|
1355
1369
|
}
|
|
1356
|
-
case
|
|
1370
|
+
case dt.PAUSE:
|
|
1357
1371
|
i += a.duration;
|
|
1358
1372
|
break;
|
|
1359
1373
|
default:
|
|
1360
|
-
|
|
1374
|
+
ht(a);
|
|
1361
1375
|
}
|
|
1362
1376
|
}
|
|
1363
1377
|
}
|
|
1364
|
-
function
|
|
1378
|
+
function l0(n) {
|
|
1365
1379
|
return "objects" in n ? n.objects.filter((e) => "objectType" in e) : [];
|
|
1366
1380
|
}
|
|
1367
|
-
function
|
|
1381
|
+
function mn({
|
|
1368
1382
|
slide: n,
|
|
1369
1383
|
buildIndex: e,
|
|
1370
1384
|
buildTime: t
|
|
@@ -1372,7 +1386,7 @@ function a1({
|
|
|
1372
1386
|
const o = /* @__PURE__ */ new Map();
|
|
1373
1387
|
function i(s) {
|
|
1374
1388
|
o.set(s, s);
|
|
1375
|
-
for (const r of
|
|
1389
|
+
for (const r of l0(s))
|
|
1376
1390
|
i(r);
|
|
1377
1391
|
}
|
|
1378
1392
|
for (const s of n.objects)
|
|
@@ -1380,22 +1394,22 @@ function a1({
|
|
|
1380
1394
|
const a = t === null ? e : e - 1;
|
|
1381
1395
|
for (let s = 0; s < a; s++) {
|
|
1382
1396
|
const r = n.animations[s] ?? null;
|
|
1383
|
-
|
|
1397
|
+
ke(o, r);
|
|
1384
1398
|
}
|
|
1385
1399
|
if (t !== null && e > 0) {
|
|
1386
1400
|
const s = n.animations[e - 1] ?? null;
|
|
1387
|
-
|
|
1401
|
+
ke(o, s, t);
|
|
1388
1402
|
}
|
|
1389
1403
|
return o;
|
|
1390
1404
|
}
|
|
1391
|
-
function
|
|
1405
|
+
function bn(n) {
|
|
1392
1406
|
const e = {};
|
|
1393
1407
|
function t(o) {
|
|
1394
|
-
if (o.objectType ===
|
|
1408
|
+
if (o.objectType === V.SVG) {
|
|
1395
1409
|
const a = o.svg;
|
|
1396
1410
|
a !== void 0 && a.length > 0 && (e[a] = a);
|
|
1397
1411
|
}
|
|
1398
|
-
const i =
|
|
1412
|
+
const i = l0(o);
|
|
1399
1413
|
for (const a of i)
|
|
1400
1414
|
t(a);
|
|
1401
1415
|
}
|
|
@@ -1404,42 +1418,41 @@ function h1(n) {
|
|
|
1404
1418
|
t(i);
|
|
1405
1419
|
return e;
|
|
1406
1420
|
}
|
|
1407
|
-
const
|
|
1408
|
-
function
|
|
1409
|
-
const t = localStorage.getItem(
|
|
1421
|
+
const xt = "presenterState";
|
|
1422
|
+
function An(n, e) {
|
|
1423
|
+
const t = localStorage.getItem(xt);
|
|
1410
1424
|
if (t === null)
|
|
1411
1425
|
return null;
|
|
1412
1426
|
if (e === null)
|
|
1413
|
-
return localStorage.removeItem(
|
|
1427
|
+
return localStorage.removeItem(xt), null;
|
|
1414
1428
|
let o;
|
|
1415
1429
|
try {
|
|
1416
1430
|
o = JSON.parse(t);
|
|
1417
1431
|
} catch (c) {
|
|
1418
|
-
return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(
|
|
1432
|
+
return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(xt), null;
|
|
1419
1433
|
}
|
|
1420
1434
|
const { title: i, timestamp: a } = o;
|
|
1421
1435
|
let { slideIndex: s, buildIndex: r } = o;
|
|
1422
1436
|
if (typeof i != "string" || typeof s != "number" || typeof r != "number" || typeof a != "number" || i !== n.title || Date.now() - a > 1e3 * 60 * e)
|
|
1423
|
-
return localStorage.removeItem(
|
|
1437
|
+
return localStorage.removeItem(xt), null;
|
|
1424
1438
|
s > n.slides.length - 1 && (s = n.slides.length - 1, r = 0);
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1439
|
+
const l = n.slides[s];
|
|
1440
|
+
return l === void 0 ? (localStorage.removeItem(xt), null) : (r > l.animations.length && (r = l.animations.length), {
|
|
1427
1441
|
title: i,
|
|
1428
1442
|
slideIndex: s,
|
|
1429
1443
|
buildIndex: r
|
|
1430
1444
|
});
|
|
1431
1445
|
}
|
|
1432
|
-
function
|
|
1446
|
+
function Oe({ title: n, slideIndex: e, buildIndex: t }) {
|
|
1433
1447
|
localStorage.setItem(
|
|
1434
|
-
|
|
1448
|
+
xt,
|
|
1435
1449
|
JSON.stringify({ title: n, slideIndex: e, buildIndex: t, timestamp: Date.now() })
|
|
1436
1450
|
);
|
|
1437
1451
|
}
|
|
1438
|
-
const
|
|
1452
|
+
const _e = Object.freeze({
|
|
1439
1453
|
canvas: null,
|
|
1440
1454
|
extrasContainer: null,
|
|
1441
1455
|
mountedExtrasCleanups: [],
|
|
1442
|
-
mountedExtrasSlideIndex: null,
|
|
1443
1456
|
slideIndex: 0,
|
|
1444
1457
|
buildIndex: 0,
|
|
1445
1458
|
currentAnimationId: null,
|
|
@@ -1448,14 +1461,14 @@ const E0 = Object.freeze({
|
|
|
1448
1461
|
textCommand: null,
|
|
1449
1462
|
shortcuts: {}
|
|
1450
1463
|
}
|
|
1451
|
-
}),
|
|
1464
|
+
}), K = {
|
|
1452
1465
|
Browser: "browser",
|
|
1453
1466
|
Node: "node"
|
|
1454
1467
|
};
|
|
1455
|
-
function
|
|
1468
|
+
function Tn(n, e) {
|
|
1456
1469
|
e.context.clearRect(0, 0, n.width, n.height);
|
|
1457
1470
|
}
|
|
1458
|
-
function
|
|
1471
|
+
function Mn(n) {
|
|
1459
1472
|
const e = document.createElement("canvas");
|
|
1460
1473
|
return e.setAttribute("width", n.width.toString()), e.setAttribute("height", n.height.toString()), e.style.position = "absolute", e.style.width = "100%", e;
|
|
1461
1474
|
}
|
|
@@ -1463,34 +1476,34 @@ const gt = {
|
|
|
1463
1476
|
Browser: "browser",
|
|
1464
1477
|
Node: "node"
|
|
1465
1478
|
};
|
|
1466
|
-
function
|
|
1479
|
+
function Ln(n) {
|
|
1467
1480
|
const e = new Path2D(n);
|
|
1468
1481
|
return {
|
|
1469
1482
|
type: gt.Browser,
|
|
1470
1483
|
path: e
|
|
1471
1484
|
};
|
|
1472
1485
|
}
|
|
1473
|
-
function
|
|
1474
|
-
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter:
|
|
1475
|
-
x: E.x - I * Math.cos(
|
|
1476
|
-
y: E.y - I * Math.sin(
|
|
1477
|
-
},
|
|
1478
|
-
x: E.x - I * Math.cos(
|
|
1479
|
-
y: E.y - I * Math.sin(
|
|
1486
|
+
function Cn(n) {
|
|
1487
|
+
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: l } = n, c = { x: t, y: o }, u = { x: i, y: a }, g = Math.atan2(u.y - c.y, u.x - c.x), h = { x: c.x + (u.x - c.x) / 2, y: c.y + (u.y - c.y) / 2 }, f = u.x - c.x, v = u.y - c.y, T = Math.hypot(f, v) * e, L = Math.cos(g), P = Math.sin(g), S = l ? { x: h.x - L * T / 2, y: h.y - P * T / 2 } : c, E = l ? { x: h.x + L * T / 2, y: h.y + P * T / 2 } : { x: c.x + L * T, y: c.y + P * T }, M = r ? Math.PI / 6 : Math.PI / 4.5, I = T < s * 2 ? T / 2 : s, F = {
|
|
1488
|
+
x: E.x - I * Math.cos(g - M),
|
|
1489
|
+
y: E.y - I * Math.sin(g - M)
|
|
1490
|
+
}, Y = {
|
|
1491
|
+
x: E.x - I * Math.cos(g + M),
|
|
1492
|
+
y: E.y - I * Math.sin(g + M)
|
|
1480
1493
|
}, z = {
|
|
1481
|
-
x:
|
|
1482
|
-
y:
|
|
1494
|
+
x: S.x + I * Math.cos(g - M),
|
|
1495
|
+
y: S.y + I * Math.sin(g - M)
|
|
1483
1496
|
}, U = {
|
|
1484
|
-
x:
|
|
1485
|
-
y:
|
|
1497
|
+
x: S.x + I * Math.cos(g + M),
|
|
1498
|
+
y: S.y + I * Math.sin(g + M)
|
|
1486
1499
|
};
|
|
1487
1500
|
return {
|
|
1488
|
-
arrowPoints: [
|
|
1489
|
-
arrowheadPoints: [F, E,
|
|
1490
|
-
doubledArrowheadPoints: [z,
|
|
1501
|
+
arrowPoints: [S, E],
|
|
1502
|
+
arrowheadPoints: [F, E, Y],
|
|
1503
|
+
doubledArrowheadPoints: [z, S, U]
|
|
1491
1504
|
};
|
|
1492
1505
|
}
|
|
1493
|
-
function
|
|
1506
|
+
function wt({
|
|
1494
1507
|
ctx: n,
|
|
1495
1508
|
color: e,
|
|
1496
1509
|
drawn: t = null,
|
|
@@ -1499,52 +1512,52 @@ function vt({
|
|
|
1499
1512
|
opacity: a = null,
|
|
1500
1513
|
path: s,
|
|
1501
1514
|
pathLength: r = null,
|
|
1502
|
-
width:
|
|
1515
|
+
width: l
|
|
1503
1516
|
}) {
|
|
1504
|
-
if (!(
|
|
1517
|
+
if (!(l === 0 || t === 0)) {
|
|
1505
1518
|
if (t !== null && r !== null && t !== 1) {
|
|
1506
|
-
const c = r + (i ?
|
|
1507
|
-
|
|
1508
|
-
0
|
|
1509
|
-
|
|
1510
|
-
u
|
|
1511
|
-
(
|
|
1512
|
-
|
|
1519
|
+
const c = r + (i ? l : 0), u = r * t;
|
|
1520
|
+
if (!o)
|
|
1521
|
+
n.context.setLineDash([u, c - u]), n.context.lineDashOffset = 0;
|
|
1522
|
+
else {
|
|
1523
|
+
const g = c - u;
|
|
1524
|
+
n.context.setLineDash([u, g]), n.context.lineDashOffset = -g / 2;
|
|
1525
|
+
}
|
|
1513
1526
|
} else
|
|
1514
|
-
n.context.setLineDash([]);
|
|
1515
|
-
if (n.context.lineWidth =
|
|
1527
|
+
n.context.setLineDash([]), n.context.lineDashOffset = 0;
|
|
1528
|
+
if (n.context.lineWidth = l, n.context.strokeStyle = It(e, a), n.context.lineCap = i ? "round" : "butt", s === void 0) {
|
|
1516
1529
|
n.context.stroke();
|
|
1517
1530
|
return;
|
|
1518
1531
|
}
|
|
1519
1532
|
switch (n.type) {
|
|
1520
|
-
case
|
|
1533
|
+
case K.Browser:
|
|
1521
1534
|
s.type === gt.Browser ? n.context.stroke(s.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1522
1535
|
break;
|
|
1523
|
-
case
|
|
1536
|
+
case K.Node:
|
|
1524
1537
|
s.type === gt.Node ? n.context.stroke(s.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1525
1538
|
break;
|
|
1526
1539
|
default:
|
|
1527
|
-
|
|
1540
|
+
ht(n);
|
|
1528
1541
|
}
|
|
1529
1542
|
}
|
|
1530
1543
|
}
|
|
1531
|
-
function
|
|
1532
|
-
if (n.context.fillStyle =
|
|
1544
|
+
function pt({ ctx: n, path: e, color: t, opacity: o = null }) {
|
|
1545
|
+
if (n.context.fillStyle = pe(t, o), e === void 0) {
|
|
1533
1546
|
n.context.fill();
|
|
1534
1547
|
return;
|
|
1535
1548
|
}
|
|
1536
1549
|
switch (n.type) {
|
|
1537
|
-
case
|
|
1550
|
+
case K.Browser:
|
|
1538
1551
|
e.type === gt.Browser ? n.context.fill(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1539
1552
|
break;
|
|
1540
|
-
case
|
|
1553
|
+
case K.Node:
|
|
1541
1554
|
e.type === gt.Node ? n.context.fill(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1542
1555
|
break;
|
|
1543
1556
|
default:
|
|
1544
|
-
|
|
1557
|
+
ht(n);
|
|
1545
1558
|
}
|
|
1546
1559
|
}
|
|
1547
|
-
function
|
|
1560
|
+
function Ut(n, e) {
|
|
1548
1561
|
const t = e(), o = n[0];
|
|
1549
1562
|
if (o === void 0)
|
|
1550
1563
|
return { path: t, length: 0 };
|
|
@@ -1554,12 +1567,12 @@ function jt(n, e) {
|
|
|
1554
1567
|
const s = n[a], r = n[a - 1];
|
|
1555
1568
|
if (s === void 0 || r === void 0)
|
|
1556
1569
|
continue;
|
|
1557
|
-
const
|
|
1558
|
-
i += Math.hypot(
|
|
1570
|
+
const l = s.x - r.x, c = s.y - r.y;
|
|
1571
|
+
i += Math.hypot(l, c), t.path.lineTo(s.x, s.y);
|
|
1559
1572
|
}
|
|
1560
1573
|
return { path: t, length: i };
|
|
1561
1574
|
}
|
|
1562
|
-
const
|
|
1575
|
+
const Sn = ({
|
|
1563
1576
|
ctx: n,
|
|
1564
1577
|
object: e,
|
|
1565
1578
|
opacity: t,
|
|
@@ -1568,35 +1581,35 @@ const p1 = ({
|
|
|
1568
1581
|
const i = e.opacity * t;
|
|
1569
1582
|
if (i === 0 || e.drawn === 0)
|
|
1570
1583
|
return;
|
|
1571
|
-
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } =
|
|
1572
|
-
if (
|
|
1584
|
+
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = Cn(e), { path: l } = Ut(a, o), { path: c } = Ut(s, o);
|
|
1585
|
+
if (wt({
|
|
1573
1586
|
color: e.color,
|
|
1574
1587
|
ctx: n,
|
|
1575
|
-
path:
|
|
1588
|
+
path: l,
|
|
1576
1589
|
opacity: i,
|
|
1577
1590
|
width: e.width
|
|
1578
|
-
}), e.isArrowheadFilled && (c.path.closePath(),
|
|
1591
|
+
}), e.isArrowheadFilled && (c.path.closePath(), pt({
|
|
1579
1592
|
ctx: n,
|
|
1580
1593
|
path: c,
|
|
1581
1594
|
color: e.color,
|
|
1582
1595
|
opacity: i
|
|
1583
|
-
})),
|
|
1596
|
+
})), wt({
|
|
1584
1597
|
color: e.color,
|
|
1585
1598
|
ctx: n,
|
|
1586
1599
|
path: c,
|
|
1587
1600
|
opacity: i,
|
|
1588
1601
|
width: e.width
|
|
1589
1602
|
}), e.isArrowheadDoubled) {
|
|
1590
|
-
const { path: u } =
|
|
1603
|
+
const { path: u } = Ut(
|
|
1591
1604
|
r,
|
|
1592
1605
|
o
|
|
1593
1606
|
);
|
|
1594
|
-
e.isArrowheadFilled && (u.path.closePath(),
|
|
1607
|
+
e.isArrowheadFilled && (u.path.closePath(), pt({
|
|
1595
1608
|
ctx: n,
|
|
1596
1609
|
path: u,
|
|
1597
1610
|
color: e.color,
|
|
1598
1611
|
opacity: i
|
|
1599
|
-
})),
|
|
1612
|
+
})), wt({
|
|
1600
1613
|
color: e.color,
|
|
1601
1614
|
ctx: n,
|
|
1602
1615
|
path: u,
|
|
@@ -1605,32 +1618,32 @@ const p1 = ({
|
|
|
1605
1618
|
});
|
|
1606
1619
|
}
|
|
1607
1620
|
};
|
|
1608
|
-
function
|
|
1621
|
+
function Pn(n, e) {
|
|
1609
1622
|
const t = n.radius - n.strokeWidth / 2;
|
|
1610
1623
|
if (t <= 0)
|
|
1611
1624
|
return;
|
|
1612
1625
|
const o = e(), i = -Math.PI / 2;
|
|
1613
1626
|
return o.path.arc(n.x, n.y, t, i, i + 2 * Math.PI), o;
|
|
1614
1627
|
}
|
|
1615
|
-
function
|
|
1628
|
+
function En(n, e) {
|
|
1616
1629
|
const t = e(), o = -Math.PI / 2;
|
|
1617
1630
|
t.path.arc(n.x, n.y, n.radius, o, o + 2 * Math.PI);
|
|
1618
1631
|
const i = 2 * Math.PI * n.radius;
|
|
1619
1632
|
return { path: t, length: i };
|
|
1620
1633
|
}
|
|
1621
|
-
function
|
|
1634
|
+
function h0(n, e) {
|
|
1622
1635
|
switch (n.type) {
|
|
1623
|
-
case
|
|
1636
|
+
case K.Browser:
|
|
1624
1637
|
e.type === gt.Browser ? n.context.clip(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1625
1638
|
break;
|
|
1626
|
-
case
|
|
1639
|
+
case K.Node:
|
|
1627
1640
|
e.type === gt.Node ? n.context.clip(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1628
1641
|
break;
|
|
1629
1642
|
default:
|
|
1630
|
-
|
|
1643
|
+
ht(n);
|
|
1631
1644
|
}
|
|
1632
1645
|
}
|
|
1633
|
-
const
|
|
1646
|
+
const In = ({
|
|
1634
1647
|
ctx: n,
|
|
1635
1648
|
object: e,
|
|
1636
1649
|
opacity: t,
|
|
@@ -1639,13 +1652,13 @@ const v1 = ({
|
|
|
1639
1652
|
const i = e.opacity * t;
|
|
1640
1653
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1641
1654
|
return;
|
|
1642
|
-
const { path: a, length: s } =
|
|
1655
|
+
const { path: a, length: s } = En(e, o);
|
|
1643
1656
|
if (i < 1 && e.strokeWidth > 0) {
|
|
1644
|
-
const r =
|
|
1645
|
-
r !== void 0 && (n.context.save(),
|
|
1657
|
+
const r = Pn(e, o);
|
|
1658
|
+
r !== void 0 && (n.context.save(), h0(n, r), pt({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
|
|
1646
1659
|
} else
|
|
1647
|
-
|
|
1648
|
-
|
|
1660
|
+
pt({ ctx: n, path: a, color: e.fillColor, opacity: i });
|
|
1661
|
+
wt({
|
|
1649
1662
|
color: e.strokeColor,
|
|
1650
1663
|
ctx: n,
|
|
1651
1664
|
drawn: e.drawn,
|
|
@@ -1655,103 +1668,103 @@ const v1 = ({
|
|
|
1655
1668
|
width: e.strokeWidth
|
|
1656
1669
|
});
|
|
1657
1670
|
};
|
|
1658
|
-
function
|
|
1671
|
+
function $(n = null) {
|
|
1659
1672
|
return {
|
|
1660
1673
|
x: 0,
|
|
1661
1674
|
y: 0,
|
|
1662
1675
|
...n
|
|
1663
1676
|
};
|
|
1664
1677
|
}
|
|
1665
|
-
const
|
|
1678
|
+
const kn = $();
|
|
1666
1679
|
function ut(n = null) {
|
|
1667
1680
|
return {
|
|
1668
|
-
origin:
|
|
1669
|
-
size:
|
|
1681
|
+
origin: kn,
|
|
1682
|
+
size: fn,
|
|
1670
1683
|
...n
|
|
1671
1684
|
};
|
|
1672
1685
|
}
|
|
1673
1686
|
ut();
|
|
1674
|
-
function
|
|
1687
|
+
function ft(n, e, t) {
|
|
1675
1688
|
const { x: o, y: i } = n, { width: a, height: s } = t;
|
|
1676
1689
|
switch (e) {
|
|
1677
|
-
case
|
|
1690
|
+
case lt.TOP_LEFT:
|
|
1678
1691
|
return ut({
|
|
1679
|
-
origin:
|
|
1692
|
+
origin: $({ x: o, y: i }),
|
|
1680
1693
|
size: t
|
|
1681
1694
|
});
|
|
1682
|
-
case
|
|
1695
|
+
case lt.TOP:
|
|
1683
1696
|
return ut({
|
|
1684
|
-
origin:
|
|
1697
|
+
origin: $({ x: o - a / 2, y: i }),
|
|
1685
1698
|
size: t
|
|
1686
1699
|
});
|
|
1687
|
-
case
|
|
1700
|
+
case lt.TOP_RIGHT:
|
|
1688
1701
|
return ut({
|
|
1689
|
-
origin:
|
|
1702
|
+
origin: $({ x: o - a, y: i }),
|
|
1690
1703
|
size: t
|
|
1691
1704
|
});
|
|
1692
|
-
case
|
|
1705
|
+
case lt.LEFT:
|
|
1693
1706
|
return ut({
|
|
1694
|
-
origin:
|
|
1707
|
+
origin: $({ x: o, y: i - s / 2 }),
|
|
1695
1708
|
size: t
|
|
1696
1709
|
});
|
|
1697
|
-
case
|
|
1710
|
+
case lt.CENTER:
|
|
1698
1711
|
return ut({
|
|
1699
|
-
origin:
|
|
1712
|
+
origin: $({ x: o - a / 2, y: i - s / 2 }),
|
|
1700
1713
|
size: t
|
|
1701
1714
|
});
|
|
1702
|
-
case
|
|
1715
|
+
case lt.RIGHT:
|
|
1703
1716
|
return ut({
|
|
1704
|
-
origin:
|
|
1717
|
+
origin: $({ x: o - a, y: i - s / 2 }),
|
|
1705
1718
|
size: t
|
|
1706
1719
|
});
|
|
1707
|
-
case
|
|
1720
|
+
case lt.BOTTOM_LEFT:
|
|
1708
1721
|
return ut({
|
|
1709
|
-
origin:
|
|
1722
|
+
origin: $({ x: o, y: i - s }),
|
|
1710
1723
|
size: t
|
|
1711
1724
|
});
|
|
1712
|
-
case
|
|
1725
|
+
case lt.BOTTOM:
|
|
1713
1726
|
return ut({
|
|
1714
|
-
origin:
|
|
1727
|
+
origin: $({ x: o - a / 2, y: i - s }),
|
|
1715
1728
|
size: t
|
|
1716
1729
|
});
|
|
1717
|
-
case
|
|
1730
|
+
case lt.BOTTOM_RIGHT:
|
|
1718
1731
|
return ut({
|
|
1719
|
-
origin:
|
|
1732
|
+
origin: $({ x: o - a, y: i - s }),
|
|
1720
1733
|
size: t
|
|
1721
1734
|
});
|
|
1722
1735
|
default:
|
|
1723
|
-
|
|
1736
|
+
ht(e);
|
|
1724
1737
|
}
|
|
1725
1738
|
}
|
|
1726
|
-
const
|
|
1739
|
+
const On = ({
|
|
1727
1740
|
ctx: n,
|
|
1728
1741
|
object: e,
|
|
1729
1742
|
renderObject: t,
|
|
1730
1743
|
opacity: o
|
|
1731
1744
|
}) => {
|
|
1732
|
-
const i = e.scale * e.scaleX, a = e.scale * e.scaleY, s =
|
|
1733
|
-
|
|
1745
|
+
const i = e.scale * e.scaleX, a = e.scale * e.scaleY, s = ft(
|
|
1746
|
+
$({ x: e.x, y: e.y }),
|
|
1734
1747
|
e.anchor,
|
|
1735
|
-
|
|
1748
|
+
Q({
|
|
1736
1749
|
width: e.width * Math.abs(i),
|
|
1737
1750
|
height: e.height * Math.abs(a)
|
|
1738
1751
|
})
|
|
1739
|
-
), { rotation: r, rotateOriginX:
|
|
1752
|
+
), { rotation: r, rotateOriginX: l, rotateOriginY: c, skewOriginX: u, skewOriginY: g, skewX: h, skewY: f } = e;
|
|
1740
1753
|
if (!(i === 0 || a === 0)) {
|
|
1741
|
-
n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(
|
|
1754
|
+
n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(l, c), n.context.rotate(r * Math.PI / 180), n.context.translate(-l, -c), n.context.translate(u, g), n.context.transform(
|
|
1742
1755
|
1,
|
|
1743
1756
|
Math.tan(f * Math.PI / 180),
|
|
1744
|
-
Math.tan(
|
|
1757
|
+
Math.tan(h * Math.PI / 180),
|
|
1745
1758
|
1,
|
|
1746
1759
|
0,
|
|
1747
1760
|
0
|
|
1748
|
-
), n.context.translate(-u, -
|
|
1761
|
+
), n.context.translate(-u, -g);
|
|
1749
1762
|
for (const v of e.objects)
|
|
1750
1763
|
t(v, o * e.opacity);
|
|
1751
|
-
e.previewColor !== null && (n.context.fillStyle = It(e.previewColor), n.context.fillRect(0, 0, e.width, e.height)), e.rotateOriginPreviewSize > 0 && (n.context.fillStyle = "red", n.context.beginPath(), n.context.arc(
|
|
1764
|
+
e.previewColor !== null && (n.context.fillStyle = It(e.previewColor), n.context.fillRect(0, 0, e.width, e.height)), e.rotateOriginPreviewSize > 0 && (n.context.fillStyle = "red", n.context.beginPath(), n.context.arc(l, c, e.rotateOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), e.skewOriginPreviewSize > 0 && (n.context.fillStyle = "blue", n.context.beginPath(), n.context.arc(u, g, e.skewOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), n.context.restore();
|
|
1752
1765
|
}
|
|
1753
1766
|
};
|
|
1754
|
-
function
|
|
1767
|
+
function xe(n, e, t, o, i = 0) {
|
|
1755
1768
|
const a = o();
|
|
1756
1769
|
a.path.moveTo(n.x + t, n.y), a.path.lineTo(n.x + e.width - t, n.y), a.path.arcTo(
|
|
1757
1770
|
n.x + e.width,
|
|
@@ -1778,39 +1791,39 @@ function g0(n, e, t, o, i = 0) {
|
|
|
1778
1791
|
const kt = {
|
|
1779
1792
|
Browser: "browser",
|
|
1780
1793
|
Node: "node"
|
|
1781
|
-
},
|
|
1794
|
+
}, _n = ({
|
|
1782
1795
|
ctx: n,
|
|
1783
1796
|
imageById: e,
|
|
1784
1797
|
object: t,
|
|
1785
1798
|
opacity: o,
|
|
1786
1799
|
createPath2D: i
|
|
1787
1800
|
}) => {
|
|
1788
|
-
const a =
|
|
1789
|
-
|
|
1801
|
+
const a = ft(
|
|
1802
|
+
$({ x: t.x, y: t.y }),
|
|
1790
1803
|
t.anchor,
|
|
1791
|
-
|
|
1804
|
+
Q({ width: t.width, height: t.height })
|
|
1792
1805
|
), s = e[t.imageId];
|
|
1793
1806
|
if (s !== void 0) {
|
|
1794
1807
|
if (n.context.save(), t.cornerRadius > 0) {
|
|
1795
|
-
const r =
|
|
1808
|
+
const r = xe(
|
|
1796
1809
|
a.origin,
|
|
1797
1810
|
a.size,
|
|
1798
1811
|
t.cornerRadius,
|
|
1799
1812
|
i
|
|
1800
1813
|
);
|
|
1801
1814
|
switch (n.type) {
|
|
1802
|
-
case
|
|
1815
|
+
case K.Browser:
|
|
1803
1816
|
r.path.type === gt.Browser ? n.context.clip(r.path.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1804
1817
|
break;
|
|
1805
|
-
case
|
|
1818
|
+
case K.Node:
|
|
1806
1819
|
r.path.type === gt.Node ? n.context.clip(r.path.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1807
1820
|
break;
|
|
1808
1821
|
default:
|
|
1809
|
-
|
|
1822
|
+
ht(n);
|
|
1810
1823
|
}
|
|
1811
1824
|
}
|
|
1812
1825
|
switch (n.context.globalAlpha = o * t.opacity, n.context.imageSmoothingEnabled = t.smooth, n.type) {
|
|
1813
|
-
case
|
|
1826
|
+
case K.Browser:
|
|
1814
1827
|
s.type === kt.Browser ? n.context.drawImage(
|
|
1815
1828
|
s.image,
|
|
1816
1829
|
a.origin.x,
|
|
@@ -1819,7 +1832,7 @@ const kt = {
|
|
|
1819
1832
|
a.size.height
|
|
1820
1833
|
) : console.warn("Attempted to use Node Image in Browser Canvas context");
|
|
1821
1834
|
break;
|
|
1822
|
-
case
|
|
1835
|
+
case K.Node:
|
|
1823
1836
|
s.type === kt.Node ? n.context.drawImage(
|
|
1824
1837
|
s.image,
|
|
1825
1838
|
a.origin.x,
|
|
@@ -1829,18 +1842,18 @@ const kt = {
|
|
|
1829
1842
|
) : console.warn("Attempted to use Browser Image in Node Canvas context");
|
|
1830
1843
|
break;
|
|
1831
1844
|
default:
|
|
1832
|
-
|
|
1845
|
+
ht(n);
|
|
1833
1846
|
}
|
|
1834
1847
|
n.context.restore();
|
|
1835
1848
|
}
|
|
1836
1849
|
};
|
|
1837
|
-
function
|
|
1850
|
+
function Nn(n, e) {
|
|
1838
1851
|
const t = e();
|
|
1839
1852
|
t.path.moveTo(n.startX, n.startY), t.path.lineTo(n.endX, n.endY);
|
|
1840
1853
|
const o = Math.hypot(n.endX - n.startX, n.endY - n.startY);
|
|
1841
1854
|
return { path: t, length: o };
|
|
1842
1855
|
}
|
|
1843
|
-
const
|
|
1856
|
+
const Rn = ({
|
|
1844
1857
|
ctx: n,
|
|
1845
1858
|
object: e,
|
|
1846
1859
|
opacity: t,
|
|
@@ -1849,8 +1862,8 @@ const M1 = ({
|
|
|
1849
1862
|
const i = e.opacity * t;
|
|
1850
1863
|
if (i === 0 || e.drawn === 0)
|
|
1851
1864
|
return;
|
|
1852
|
-
const { path: a, length: s } =
|
|
1853
|
-
|
|
1865
|
+
const { path: a, length: s } = Nn(e, o);
|
|
1866
|
+
wt({
|
|
1854
1867
|
color: e.color,
|
|
1855
1868
|
ctx: n,
|
|
1856
1869
|
drawn: e.drawn,
|
|
@@ -1861,23 +1874,23 @@ const M1 = ({
|
|
|
1861
1874
|
opacity: i,
|
|
1862
1875
|
width: e.width
|
|
1863
1876
|
});
|
|
1864
|
-
},
|
|
1877
|
+
}, Fn = ({
|
|
1865
1878
|
ctx: n,
|
|
1866
1879
|
object: e,
|
|
1867
1880
|
opacity: t,
|
|
1868
1881
|
renderObject: o
|
|
1869
1882
|
}) => {
|
|
1870
1883
|
n.context.save();
|
|
1871
|
-
const i =
|
|
1872
|
-
|
|
1884
|
+
const i = ft(
|
|
1885
|
+
$({ x: e.x, y: e.y }),
|
|
1873
1886
|
e.anchor,
|
|
1874
|
-
|
|
1887
|
+
Q({ width: e.width, height: e.height })
|
|
1875
1888
|
);
|
|
1876
1889
|
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = It(G.RED), n.context.rect(i.origin.x, i.origin.y, i.size.width, i.size.height), n.context.stroke()), n.context.beginPath(), n.context.rect(i.origin.x, i.origin.y, i.size.width, i.size.height), n.context.closePath(), n.context.clip();
|
|
1877
1890
|
for (const a of e.objects)
|
|
1878
1891
|
o(a, t * e.opacity);
|
|
1879
1892
|
n.context.restore();
|
|
1880
|
-
},
|
|
1893
|
+
}, Bn = ({
|
|
1881
1894
|
ctx: n,
|
|
1882
1895
|
object: e,
|
|
1883
1896
|
opacity: t,
|
|
@@ -1886,17 +1899,17 @@ const M1 = ({
|
|
|
1886
1899
|
const i = e.opacity * t;
|
|
1887
1900
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1888
1901
|
return;
|
|
1889
|
-
const { origin: a } =
|
|
1890
|
-
|
|
1902
|
+
const { origin: a } = ft(
|
|
1903
|
+
$({ x: e.x, y: e.y }),
|
|
1891
1904
|
e.anchor,
|
|
1892
|
-
|
|
1905
|
+
Q({ width: e.width, height: e.height })
|
|
1893
1906
|
), s = o(e.path);
|
|
1894
|
-
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight),
|
|
1907
|
+
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight), pt({
|
|
1895
1908
|
ctx: n,
|
|
1896
1909
|
path: s,
|
|
1897
1910
|
color: e.fillColor,
|
|
1898
1911
|
opacity: i
|
|
1899
|
-
}),
|
|
1912
|
+
}), wt({
|
|
1900
1913
|
color: e.strokeColor,
|
|
1901
1914
|
ctx: n,
|
|
1902
1915
|
drawn: e.drawn,
|
|
@@ -1907,14 +1920,14 @@ const M1 = ({
|
|
|
1907
1920
|
width: e.strokeWidth
|
|
1908
1921
|
}), n.context.restore();
|
|
1909
1922
|
};
|
|
1910
|
-
function
|
|
1923
|
+
function Dn(n, e) {
|
|
1911
1924
|
const t = e(), o = n.points, i = o[0];
|
|
1912
1925
|
if (i === void 0)
|
|
1913
1926
|
return { path: t, length: 0 };
|
|
1914
1927
|
t.path.moveTo(i.x, i.y);
|
|
1915
1928
|
let a = 0, s = i;
|
|
1916
|
-
for (let
|
|
1917
|
-
const c = o[
|
|
1929
|
+
for (let l = 1; l < o.length; l++) {
|
|
1930
|
+
const c = o[l];
|
|
1918
1931
|
if (c === void 0)
|
|
1919
1932
|
continue;
|
|
1920
1933
|
t.path.lineTo(c.x, c.y);
|
|
@@ -1928,7 +1941,7 @@ function C1(n, e) {
|
|
|
1928
1941
|
);
|
|
1929
1942
|
return a += r, { path: t, length: a };
|
|
1930
1943
|
}
|
|
1931
|
-
const
|
|
1944
|
+
const qn = ({
|
|
1932
1945
|
ctx: n,
|
|
1933
1946
|
object: e,
|
|
1934
1947
|
opacity: t,
|
|
@@ -1937,13 +1950,13 @@ const P1 = ({
|
|
|
1937
1950
|
const i = e.opacity * t;
|
|
1938
1951
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1939
1952
|
return;
|
|
1940
|
-
const { path: a, length: s } =
|
|
1941
|
-
|
|
1953
|
+
const { path: a, length: s } = Dn(e, o);
|
|
1954
|
+
pt({
|
|
1942
1955
|
ctx: n,
|
|
1943
1956
|
path: a,
|
|
1944
1957
|
color: e.fillColor,
|
|
1945
1958
|
opacity: i
|
|
1946
|
-
}),
|
|
1959
|
+
}), wt({
|
|
1947
1960
|
color: e.strokeColor,
|
|
1948
1961
|
ctx: n,
|
|
1949
1962
|
drawn: e.drawn,
|
|
@@ -1953,34 +1966,34 @@ const P1 = ({
|
|
|
1953
1966
|
width: e.strokeWidth
|
|
1954
1967
|
});
|
|
1955
1968
|
};
|
|
1956
|
-
function
|
|
1957
|
-
const t = n.strokeWidth / 2, { origin: o, size: i } =
|
|
1958
|
-
|
|
1969
|
+
function zn(n, e) {
|
|
1970
|
+
const t = n.strokeWidth / 2, { origin: o, size: i } = ft(
|
|
1971
|
+
$({ x: n.x, y: n.y }),
|
|
1959
1972
|
n.anchor,
|
|
1960
|
-
|
|
1973
|
+
Q({ width: n.width, height: n.height })
|
|
1961
1974
|
), a = i.width - n.strokeWidth, s = i.height - n.strokeWidth;
|
|
1962
1975
|
if (a <= 0 || s <= 0)
|
|
1963
1976
|
return;
|
|
1964
|
-
const r =
|
|
1977
|
+
const r = $({ x: o.x + t, y: o.y + t }), l = Q({ width: a, height: s }), c = Math.max(
|
|
1965
1978
|
0,
|
|
1966
1979
|
Math.min(n.cornerRadius - t, Math.min(a, s) / 2)
|
|
1967
1980
|
);
|
|
1968
1981
|
if (c > 0)
|
|
1969
|
-
return
|
|
1982
|
+
return xe(r, l, c, e).path;
|
|
1970
1983
|
const u = e();
|
|
1971
1984
|
return u.path.moveTo(r.x, r.y), u.path.lineTo(r.x + a, r.y), u.path.lineTo(r.x + a, r.y + s), u.path.lineTo(r.x, r.y + s), u.path.closePath(), u;
|
|
1972
1985
|
}
|
|
1973
|
-
function
|
|
1974
|
-
const { origin: t, size: o } =
|
|
1975
|
-
|
|
1986
|
+
function Vn(n, e) {
|
|
1987
|
+
const { origin: t, size: o } = ft(
|
|
1988
|
+
$({ x: n.x, y: n.y }),
|
|
1976
1989
|
n.anchor,
|
|
1977
|
-
|
|
1990
|
+
Q({ width: n.width, height: n.height })
|
|
1978
1991
|
), i = Math.max(
|
|
1979
1992
|
0,
|
|
1980
1993
|
Math.min(n.cornerRadius, Math.min(o.width, o.height) / 2)
|
|
1981
1994
|
), a = Math.min(n.strokeWidth * 2, o.width - i);
|
|
1982
1995
|
if (i > 0)
|
|
1983
|
-
return
|
|
1996
|
+
return xe(t, o, i, e, a);
|
|
1984
1997
|
{
|
|
1985
1998
|
const s = e();
|
|
1986
1999
|
s.path.moveTo(t.x, t.y), s.path.lineTo(t.x + o.width, t.y), s.path.lineTo(t.x + o.width, t.y + o.height), s.path.lineTo(t.x, t.y + o.height), s.path.lineTo(t.x, t.y), s.path.lineTo(t.x + a, t.y);
|
|
@@ -1988,7 +2001,7 @@ function E1(n, e) {
|
|
|
1988
2001
|
return { path: s, length: r };
|
|
1989
2002
|
}
|
|
1990
2003
|
}
|
|
1991
|
-
const
|
|
2004
|
+
const jn = ({
|
|
1992
2005
|
ctx: n,
|
|
1993
2006
|
object: e,
|
|
1994
2007
|
opacity: t,
|
|
@@ -1997,13 +2010,13 @@ const I1 = ({
|
|
|
1997
2010
|
const i = e.opacity * t;
|
|
1998
2011
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1999
2012
|
return;
|
|
2000
|
-
const { path: a, length: s } =
|
|
2013
|
+
const { path: a, length: s } = Vn(e, o);
|
|
2001
2014
|
if (i < 1 && e.strokeWidth > 0) {
|
|
2002
|
-
const r =
|
|
2003
|
-
r !== void 0 && (n.context.save(),
|
|
2015
|
+
const r = zn(e, o);
|
|
2016
|
+
r !== void 0 && (n.context.save(), h0(n, r), pt({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
|
|
2004
2017
|
} else
|
|
2005
|
-
|
|
2006
|
-
|
|
2018
|
+
pt({ ctx: n, path: a, color: e.fillColor, opacity: i });
|
|
2019
|
+
wt({
|
|
2007
2020
|
color: e.strokeColor,
|
|
2008
2021
|
ctx: n,
|
|
2009
2022
|
drawn: e.drawn,
|
|
@@ -2012,7 +2025,70 @@ const I1 = ({
|
|
|
2012
2025
|
opacity: i,
|
|
2013
2026
|
width: e.strokeWidth
|
|
2014
2027
|
});
|
|
2015
|
-
}
|
|
2028
|
+
};
|
|
2029
|
+
function Hn(n) {
|
|
2030
|
+
const { origin: e, size: t } = ft(
|
|
2031
|
+
$({ x: n.x, y: n.y }),
|
|
2032
|
+
n.anchor,
|
|
2033
|
+
Q({ width: n.width, height: n.height })
|
|
2034
|
+
);
|
|
2035
|
+
return {
|
|
2036
|
+
origin: e,
|
|
2037
|
+
size: t,
|
|
2038
|
+
cornerRadius: Math.max(
|
|
2039
|
+
0,
|
|
2040
|
+
Math.min(n.cornerRadius, Math.min(t.width, t.height) / 2)
|
|
2041
|
+
)
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
function Un(n, e, t, o = {
|
|
2045
|
+
origin: $({ x: 0, y: 0 }),
|
|
2046
|
+
size: e
|
|
2047
|
+
}) {
|
|
2048
|
+
const i = t(), { origin: a, size: s, cornerRadius: r } = Hn(n), { origin: l, size: c } = o;
|
|
2049
|
+
return i.path.moveTo(l.x, l.y), i.path.lineTo(l.x + c.width, l.y), i.path.lineTo(l.x + c.width, l.y + c.height), i.path.lineTo(l.x, l.y + c.height), i.path.lineTo(l.x, l.y), r === 0 ? (i.path.moveTo(a.x, a.y), i.path.lineTo(a.x, a.y + s.height), i.path.lineTo(a.x + s.width, a.y + s.height), i.path.lineTo(a.x + s.width, a.y), i.path.lineTo(a.x, a.y), i) : (i.path.moveTo(a.x + r, a.y), i.path.arcTo(a.x, a.y, a.x, a.y + r, r), i.path.lineTo(a.x, a.y + s.height - r), i.path.arcTo(
|
|
2050
|
+
a.x,
|
|
2051
|
+
a.y + s.height,
|
|
2052
|
+
a.x + r,
|
|
2053
|
+
a.y + s.height,
|
|
2054
|
+
r
|
|
2055
|
+
), i.path.lineTo(a.x + s.width - r, a.y + s.height), i.path.arcTo(
|
|
2056
|
+
a.x + s.width,
|
|
2057
|
+
a.y + s.height,
|
|
2058
|
+
a.x + s.width,
|
|
2059
|
+
a.y + s.height - r,
|
|
2060
|
+
r
|
|
2061
|
+
), i.path.lineTo(a.x + s.width, a.y + r), i.path.arcTo(
|
|
2062
|
+
a.x + s.width,
|
|
2063
|
+
a.y,
|
|
2064
|
+
a.x + s.width - r,
|
|
2065
|
+
a.y,
|
|
2066
|
+
r
|
|
2067
|
+
), i.path.lineTo(a.x + r, a.y), i);
|
|
2068
|
+
}
|
|
2069
|
+
const $n = ({
|
|
2070
|
+
createPath2D: n,
|
|
2071
|
+
ctx: e,
|
|
2072
|
+
object: t,
|
|
2073
|
+
opacity: o,
|
|
2074
|
+
renderScale: i,
|
|
2075
|
+
slideSize: a
|
|
2076
|
+
}) => {
|
|
2077
|
+
const s = t.opacity * o;
|
|
2078
|
+
if (s === 0 || t.color.alpha === 0)
|
|
2079
|
+
return;
|
|
2080
|
+
const r = Q({
|
|
2081
|
+
width: a.width / i,
|
|
2082
|
+
height: a.height / i
|
|
2083
|
+
}), l = $({
|
|
2084
|
+
x: (a.width - r.width) / 2,
|
|
2085
|
+
y: (a.height - r.height) / 2
|
|
2086
|
+
}), c = Un(t, a, n, {
|
|
2087
|
+
origin: l,
|
|
2088
|
+
size: r
|
|
2089
|
+
});
|
|
2090
|
+
pt({ ctx: e, path: c, color: t.color, opacity: s });
|
|
2091
|
+
}, Wn = ({
|
|
2016
2092
|
ctx: n,
|
|
2017
2093
|
imageById: e,
|
|
2018
2094
|
object: t,
|
|
@@ -2024,13 +2100,13 @@ const I1 = ({
|
|
|
2024
2100
|
const a = e[t.svg];
|
|
2025
2101
|
if (a === void 0)
|
|
2026
2102
|
return;
|
|
2027
|
-
const s =
|
|
2028
|
-
|
|
2103
|
+
const s = ft(
|
|
2104
|
+
$({ x: t.x, y: t.y }),
|
|
2029
2105
|
t.anchor,
|
|
2030
|
-
|
|
2106
|
+
Q({ width: t.width, height: t.height })
|
|
2031
2107
|
);
|
|
2032
2108
|
switch (n.context.save(), n.context.globalAlpha = i, n.type) {
|
|
2033
|
-
case
|
|
2109
|
+
case K.Browser:
|
|
2034
2110
|
a.type === kt.Browser && n.context.drawImage(
|
|
2035
2111
|
a.image,
|
|
2036
2112
|
s.origin.x,
|
|
@@ -2039,7 +2115,7 @@ const I1 = ({
|
|
|
2039
2115
|
s.size.height
|
|
2040
2116
|
);
|
|
2041
2117
|
break;
|
|
2042
|
-
case
|
|
2118
|
+
case K.Node:
|
|
2043
2119
|
a.type === kt.Node && n.context.drawImage(
|
|
2044
2120
|
a.image,
|
|
2045
2121
|
s.origin.x,
|
|
@@ -2049,11 +2125,11 @@ const I1 = ({
|
|
|
2049
2125
|
);
|
|
2050
2126
|
break;
|
|
2051
2127
|
default:
|
|
2052
|
-
|
|
2128
|
+
ht(n);
|
|
2053
2129
|
}
|
|
2054
2130
|
n.context.restore();
|
|
2055
2131
|
};
|
|
2056
|
-
function
|
|
2132
|
+
function Yn(n) {
|
|
2057
2133
|
return {
|
|
2058
2134
|
color: n.color,
|
|
2059
2135
|
fontFamily: n.fontFamily,
|
|
@@ -2065,14 +2141,14 @@ function _1(n) {
|
|
|
2065
2141
|
superscript: n.superscript
|
|
2066
2142
|
};
|
|
2067
2143
|
}
|
|
2068
|
-
function
|
|
2144
|
+
function Gn(n, e = 1) {
|
|
2069
2145
|
const t = Math.max(...n.map((a) => a.reduce((s, r) => s + r.width, 0)));
|
|
2070
2146
|
let o = 0, i = 0;
|
|
2071
2147
|
for (let a = 0; a < n.length; a++) {
|
|
2072
2148
|
const s = n[a];
|
|
2073
2149
|
if (s === void 0)
|
|
2074
2150
|
continue;
|
|
2075
|
-
const r = Math.max(...s.map((
|
|
2151
|
+
const r = Math.max(...s.map((l) => l.height));
|
|
2076
2152
|
o += r + i * (e - 1), i = r;
|
|
2077
2153
|
}
|
|
2078
2154
|
return {
|
|
@@ -2080,8 +2156,8 @@ function O1(n, e = 1) {
|
|
|
2080
2156
|
width: t
|
|
2081
2157
|
};
|
|
2082
2158
|
}
|
|
2083
|
-
const
|
|
2084
|
-
function
|
|
2159
|
+
const Xn = 0.7, Kn = 0.3;
|
|
2160
|
+
function c0(n) {
|
|
2085
2161
|
const e = n.superscript, t = n.subscript && !e;
|
|
2086
2162
|
return !e && !t ? {
|
|
2087
2163
|
baselineShift: 0,
|
|
@@ -2089,33 +2165,45 @@ function ne(n) {
|
|
|
2089
2165
|
isSubscript: !1,
|
|
2090
2166
|
isSuperscript: !1
|
|
2091
2167
|
} : {
|
|
2092
|
-
baselineShift: n.fontSize *
|
|
2093
|
-
fontSize: n.fontSize *
|
|
2168
|
+
baselineShift: n.fontSize * Kn * (e ? -1 : 1),
|
|
2169
|
+
fontSize: n.fontSize * Xn,
|
|
2094
2170
|
isSubscript: t,
|
|
2095
2171
|
isSuperscript: e
|
|
2096
2172
|
};
|
|
2097
2173
|
}
|
|
2098
|
-
function
|
|
2174
|
+
function Ne(n, e = 0) {
|
|
2175
|
+
return n ?? e;
|
|
2176
|
+
}
|
|
2177
|
+
function Zn(n) {
|
|
2178
|
+
const e = Ne(
|
|
2179
|
+
n.fontBoundingBoxAscent,
|
|
2180
|
+
n.actualBoundingBoxAscent
|
|
2181
|
+
), t = Ne(
|
|
2182
|
+
n.fontBoundingBoxDescent,
|
|
2183
|
+
n.actualBoundingBoxDescent
|
|
2184
|
+
);
|
|
2099
2185
|
return {
|
|
2100
|
-
|
|
2101
|
-
height:
|
|
2186
|
+
bottom: t,
|
|
2187
|
+
height: e + t,
|
|
2188
|
+
top: e,
|
|
2189
|
+
width: n.width
|
|
2102
2190
|
};
|
|
2103
2191
|
}
|
|
2104
|
-
function
|
|
2105
|
-
const o =
|
|
2106
|
-
n.context.fillStyle =
|
|
2192
|
+
function u0(n, e, t = 1) {
|
|
2193
|
+
const o = c0(e);
|
|
2194
|
+
n.context.fillStyle = pe(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${o.fontSize}px ${e.fontFamily}`, n.type === K.Browser ? n.context.textRendering = e.ligatures ? "optimizeLegibility" : "optimizeSpeed" : n.context.fontVariant = e.ligatures ? "common-ligatures" : "no-common-ligatures";
|
|
2107
2195
|
}
|
|
2108
|
-
function
|
|
2196
|
+
function Jn(n, e, t) {
|
|
2109
2197
|
const o = [];
|
|
2110
2198
|
for (const i of n) {
|
|
2111
2199
|
const a = [];
|
|
2112
2200
|
for (const s of i) {
|
|
2113
|
-
const { text: r, ...
|
|
2114
|
-
|
|
2115
|
-
const u = t.context.measureText(r),
|
|
2201
|
+
const { text: r, ...l } = s, c = { ...e, ...l };
|
|
2202
|
+
u0(t, c);
|
|
2203
|
+
const u = t.context.measureText(r), g = Zn(u), { baselineShift: h } = c0(c), f = Math.max(0, g.top - h), v = Math.max(0, g.bottom + h);
|
|
2116
2204
|
a.push({
|
|
2117
|
-
...
|
|
2118
|
-
baselineShift:
|
|
2205
|
+
...g,
|
|
2206
|
+
baselineShift: h,
|
|
2119
2207
|
bottom: v,
|
|
2120
2208
|
height: f + v,
|
|
2121
2209
|
top: f
|
|
@@ -2125,81 +2213,82 @@ function B1(n, e, t) {
|
|
|
2125
2213
|
}
|
|
2126
2214
|
return o;
|
|
2127
2215
|
}
|
|
2128
|
-
const
|
|
2216
|
+
const Qn = ({ ctx: n, object: e, opacity: t }) => {
|
|
2129
2217
|
const o = e.opacity * t;
|
|
2130
2218
|
if (o === 0)
|
|
2131
2219
|
return;
|
|
2132
|
-
const { length: i } = e, a =
|
|
2133
|
-
let u = c.origin.x,
|
|
2220
|
+
const { length: i } = e, a = e0(e.text), s = Yn(e), r = Jn(a, s, n), l = Gn(r, e.lineSpacing), c = ft($({ x: e.x, y: e.y }), e.anchor, l);
|
|
2221
|
+
let u = c.origin.x, g = c.origin.y, h = 0, f = 0;
|
|
2134
2222
|
for (let v = 0; v < a.length; v++) {
|
|
2135
|
-
const y = a[v],
|
|
2136
|
-
if (y == null ||
|
|
2223
|
+
const y = a[v], T = r[v];
|
|
2224
|
+
if (y == null || T == null) {
|
|
2137
2225
|
console.error("Could not determine text units or sizes for line");
|
|
2138
2226
|
continue;
|
|
2139
2227
|
}
|
|
2140
|
-
const
|
|
2228
|
+
const L = T.reduce((I, F) => I + F.width, 0), P = T.length === 0 ? f : T.reduce((I, F) => Math.max(I, F.top), 0), S = T.length === 0 ? 0 : T.reduce((I, F) => Math.max(I, F.bottom), 0), E = P + S;
|
|
2141
2229
|
switch (e.alignment) {
|
|
2142
|
-
case
|
|
2230
|
+
case yt.LEFT:
|
|
2143
2231
|
u = c.origin.x;
|
|
2144
2232
|
break;
|
|
2145
|
-
case
|
|
2146
|
-
u = c.origin.x + (c.size.width -
|
|
2233
|
+
case yt.CENTER:
|
|
2234
|
+
u = c.origin.x + (c.size.width - L) / 2;
|
|
2147
2235
|
break;
|
|
2148
|
-
case
|
|
2149
|
-
u = c.origin.x + (c.size.width -
|
|
2236
|
+
case yt.RIGHT:
|
|
2237
|
+
u = c.origin.x + (c.size.width - L);
|
|
2150
2238
|
break;
|
|
2151
2239
|
default:
|
|
2152
|
-
|
|
2240
|
+
ht(e.alignment);
|
|
2153
2241
|
break;
|
|
2154
2242
|
}
|
|
2155
|
-
|
|
2156
|
-
const
|
|
2243
|
+
g += f * (e.lineSpacing - 1);
|
|
2244
|
+
const M = g + P;
|
|
2157
2245
|
f = E;
|
|
2158
|
-
for (let I = 0; I < y.length && !(i !== null &&
|
|
2159
|
-
const F = y[I],
|
|
2160
|
-
if (F == null ||
|
|
2246
|
+
for (let I = 0; I < y.length && !(i !== null && h >= i); I++) {
|
|
2247
|
+
const F = y[I], Y = T[I];
|
|
2248
|
+
if (F == null || Y == null) {
|
|
2161
2249
|
console.error("Could not determine text unit or size for unit");
|
|
2162
2250
|
continue;
|
|
2163
2251
|
}
|
|
2164
2252
|
const { text: z, ...U } = F;
|
|
2165
|
-
let
|
|
2166
|
-
if (i !== null &&
|
|
2167
|
-
const Z = i -
|
|
2168
|
-
|
|
2253
|
+
let it;
|
|
2254
|
+
if (i !== null && h + z.length > i) {
|
|
2255
|
+
const Z = i - h;
|
|
2256
|
+
it = z.slice(0, Z);
|
|
2169
2257
|
}
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
const
|
|
2173
|
-
|
|
2258
|
+
const rt = it ?? z;
|
|
2259
|
+
h += rt.length;
|
|
2260
|
+
const ot = { ...s, ...U };
|
|
2261
|
+
u0(n, ot, o), n.context.fillText(rt, u, M + Y.baselineShift), u += Y.width;
|
|
2174
2262
|
}
|
|
2175
|
-
|
|
2176
|
-
}
|
|
2177
|
-
},
|
|
2178
|
-
[
|
|
2179
|
-
[
|
|
2180
|
-
[
|
|
2181
|
-
[
|
|
2182
|
-
[
|
|
2183
|
-
[
|
|
2184
|
-
[
|
|
2185
|
-
[
|
|
2186
|
-
[
|
|
2187
|
-
[
|
|
2263
|
+
g += E;
|
|
2264
|
+
}
|
|
2265
|
+
}, t1 = {
|
|
2266
|
+
[V.ARROW]: Sn,
|
|
2267
|
+
[V.CIRCLE]: In,
|
|
2268
|
+
[V.GROUP]: On,
|
|
2269
|
+
[V.IMAGE]: _n,
|
|
2270
|
+
[V.LINE]: Rn,
|
|
2271
|
+
[V.MASK]: Fn,
|
|
2272
|
+
[V.PATH]: Bn,
|
|
2273
|
+
[V.POLYGON]: qn,
|
|
2274
|
+
[V.RECTANGLE]: jn,
|
|
2275
|
+
[V.SLIDE_OBJECT]: () => {
|
|
2188
2276
|
},
|
|
2189
|
-
[
|
|
2190
|
-
[
|
|
2277
|
+
[V.SPOTLIGHT]: $n,
|
|
2278
|
+
[V.SVG]: Wn,
|
|
2279
|
+
[V.TEXT]: Qn
|
|
2191
2280
|
};
|
|
2192
|
-
function
|
|
2281
|
+
function e1(n) {
|
|
2193
2282
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2194
2283
|
return e.setAttribute("viewBox", `0 0 ${n.width} ${n.height}`), e.style.backgroundColor = "transparent", e.style.position = "absolute", e.style.width = "100%", e;
|
|
2195
2284
|
}
|
|
2196
|
-
function
|
|
2285
|
+
function n1(n, e) {
|
|
2197
2286
|
if (n === null)
|
|
2198
2287
|
return null;
|
|
2199
|
-
const t =
|
|
2200
|
-
|
|
2288
|
+
const t = ft(
|
|
2289
|
+
$({ x: e.x, y: e.y }),
|
|
2201
2290
|
e.anchor,
|
|
2202
|
-
|
|
2291
|
+
Q({ width: e.width, height: e.height })
|
|
2203
2292
|
), o = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
|
|
2204
2293
|
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());
|
|
2205
2294
|
const i = e.content;
|
|
@@ -2213,14 +2302,14 @@ function H1(n, e) {
|
|
|
2213
2302
|
a !== null && a(), n.removeChild(o);
|
|
2214
2303
|
};
|
|
2215
2304
|
}
|
|
2216
|
-
async function
|
|
2305
|
+
async function i1(n) {
|
|
2217
2306
|
if (Object.keys(n).length === 0)
|
|
2218
2307
|
return {};
|
|
2219
2308
|
const e = {}, t = (i) => new Promise((a, s) => {
|
|
2220
2309
|
const r = new Image();
|
|
2221
2310
|
if (r.onload = () => a(r), r.onerror = (c) => s(c), i.includes("</svg>")) {
|
|
2222
|
-
const c = i.replace(/<\?xml[^?]*\?>\s*/g, ""), u = new Blob([c], { type: "image/svg+xml;charset=utf-8" }),
|
|
2223
|
-
r.src =
|
|
2311
|
+
const c = i.replace(/<\?xml[^?]*\?>\s*/g, ""), u = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), g = URL.createObjectURL(u);
|
|
2312
|
+
r.src = g;
|
|
2224
2313
|
} else
|
|
2225
2314
|
r.src = i;
|
|
2226
2315
|
}), o = Object.entries(n).map(async ([i, a]) => {
|
|
@@ -2237,79 +2326,266 @@ async function j1(n) {
|
|
|
2237
2326
|
}
|
|
2238
2327
|
return e;
|
|
2239
2328
|
}
|
|
2240
|
-
|
|
2329
|
+
const Re = "presenterPendingVariables:";
|
|
2330
|
+
function r1() {
|
|
2331
|
+
const n = f0();
|
|
2332
|
+
if (n === null)
|
|
2333
|
+
return {};
|
|
2334
|
+
try {
|
|
2335
|
+
const e = ie(), t = n.getItem(e);
|
|
2336
|
+
if (n.removeItem(e), t === null)
|
|
2337
|
+
return {};
|
|
2338
|
+
const o = JSON.parse(t);
|
|
2339
|
+
if (o.values === void 0 || typeof o.values != "object")
|
|
2340
|
+
return {};
|
|
2341
|
+
const i = {};
|
|
2342
|
+
for (const [a, s] of Object.entries(o.values))
|
|
2343
|
+
typeof s == "number" && Number.isFinite(s) && (i[a] = s);
|
|
2344
|
+
return i;
|
|
2345
|
+
} catch (e) {
|
|
2346
|
+
return console.error("Failed to parse pending presenter variable state from sessionStorage:", e), n.removeItem(ie()), {};
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
function o1(n) {
|
|
2350
|
+
const e = f0();
|
|
2351
|
+
e !== null && e.setItem(ie(), JSON.stringify({ values: n }));
|
|
2352
|
+
}
|
|
2353
|
+
function ie() {
|
|
2354
|
+
return typeof window > "u" ? Re : `${Re}${window.location.origin}${window.location.pathname}`;
|
|
2355
|
+
}
|
|
2356
|
+
function f0() {
|
|
2357
|
+
try {
|
|
2358
|
+
return typeof sessionStorage > "u" ? null : sessionStorage;
|
|
2359
|
+
} catch {
|
|
2360
|
+
return null;
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
const s1 = 0, a1 = 1, d0 = 0, l1 = 0.01, Dt = /* @__PURE__ */ new Map();
|
|
2364
|
+
let Ot = /* @__PURE__ */ new Map(), Fe = !1, Be = 1;
|
|
2365
|
+
function ki(n = null) {
|
|
2366
|
+
g1();
|
|
2367
|
+
const e = n ?? {}, t = d1(), o = f1(t, e), i = Ot.get(o.id);
|
|
2368
|
+
if (i !== void 0) {
|
|
2369
|
+
const a = g0(i, o);
|
|
2370
|
+
return Ot.set(o.id, a), a;
|
|
2371
|
+
}
|
|
2372
|
+
return o.default;
|
|
2373
|
+
}
|
|
2374
|
+
function h1() {
|
|
2375
|
+
return Array.from(Dt.values());
|
|
2376
|
+
}
|
|
2377
|
+
function c1(n) {
|
|
2378
|
+
const e = Dt.get(n);
|
|
2379
|
+
return e === void 0 ? d0 : Ot.get(e.id) ?? e.default;
|
|
2380
|
+
}
|
|
2381
|
+
function u1(n, e) {
|
|
2382
|
+
const t = Dt.get(n);
|
|
2383
|
+
if (t === void 0)
|
|
2384
|
+
return e;
|
|
2385
|
+
const o = g0(e, t);
|
|
2386
|
+
return Ot.set(t.id, o), o;
|
|
2387
|
+
}
|
|
2388
|
+
function f1(n, e) {
|
|
2389
|
+
const t = e.min ?? s1, o = e.max ?? a1, i = Math.min(t, o), a = Math.max(t, o), s = e.increment !== void 0 && e.increment > 0 ? e.increment : l1, r = {
|
|
2390
|
+
id: n,
|
|
2391
|
+
name: e.name ?? n,
|
|
2392
|
+
min: i,
|
|
2393
|
+
max: a,
|
|
2394
|
+
default: p0(e.default ?? d0, i, a),
|
|
2395
|
+
increment: s
|
|
2396
|
+
};
|
|
2397
|
+
return Dt.set(n, r), r;
|
|
2398
|
+
}
|
|
2399
|
+
function d1() {
|
|
2400
|
+
const n = `var${Be}`;
|
|
2401
|
+
return Be += 1, n;
|
|
2402
|
+
}
|
|
2403
|
+
function g1() {
|
|
2404
|
+
Fe || (Ot = new Map(Object.entries(r1())), Fe = !0);
|
|
2405
|
+
}
|
|
2406
|
+
function g0(n, e) {
|
|
2407
|
+
return p0(n, e.min, e.max);
|
|
2408
|
+
}
|
|
2409
|
+
function p0(n, e, t) {
|
|
2410
|
+
return Math.max(e, Math.min(t, n));
|
|
2411
|
+
}
|
|
2412
|
+
function p1({
|
|
2413
|
+
onCommit: n,
|
|
2414
|
+
onPreview: e
|
|
2415
|
+
}) {
|
|
2416
|
+
const t = h1();
|
|
2417
|
+
if (t.length === 0)
|
|
2418
|
+
return null;
|
|
2419
|
+
const o = document.createElement("div");
|
|
2420
|
+
Object.assign(o.style, {
|
|
2421
|
+
position: "absolute",
|
|
2422
|
+
right: "16px",
|
|
2423
|
+
bottom: "16px",
|
|
2424
|
+
zIndex: "20",
|
|
2425
|
+
display: "flex",
|
|
2426
|
+
flexDirection: "column",
|
|
2427
|
+
gap: "8px",
|
|
2428
|
+
width: "min(360px, calc(100% - 32px))",
|
|
2429
|
+
padding: "10px",
|
|
2430
|
+
boxSizing: "border-box",
|
|
2431
|
+
border: "1px solid rgba(255, 255, 255, 0.18)",
|
|
2432
|
+
borderRadius: "8px",
|
|
2433
|
+
background: "rgba(16, 18, 22, 0.82)",
|
|
2434
|
+
color: "#ffffff",
|
|
2435
|
+
fontFamily: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
2436
|
+
fontSize: "12px",
|
|
2437
|
+
lineHeight: "1.25",
|
|
2438
|
+
pointerEvents: "auto",
|
|
2439
|
+
boxShadow: "0 12px 36px rgba(0, 0, 0, 0.28)",
|
|
2440
|
+
backdropFilter: "blur(10px)"
|
|
2441
|
+
});
|
|
2442
|
+
for (const i of t)
|
|
2443
|
+
o.appendChild(x1(i, e, n));
|
|
2444
|
+
return o;
|
|
2445
|
+
}
|
|
2446
|
+
function x1(n, e, t) {
|
|
2447
|
+
const o = document.createElement("div");
|
|
2448
|
+
o.dataset.presenterVariableId = n.id, o.dataset.presenterVariableName = n.name, Object.assign(o.style, {
|
|
2449
|
+
display: "grid",
|
|
2450
|
+
gridTemplateColumns: "72px minmax(0, 1fr) 74px",
|
|
2451
|
+
alignItems: "center",
|
|
2452
|
+
gap: "8px"
|
|
2453
|
+
});
|
|
2454
|
+
const i = document.createElement("div");
|
|
2455
|
+
i.textContent = n.name, i.title = n.name, Object.assign(i.style, {
|
|
2456
|
+
overflow: "hidden",
|
|
2457
|
+
textOverflow: "ellipsis",
|
|
2458
|
+
whiteSpace: "nowrap",
|
|
2459
|
+
color: "rgba(255, 255, 255, 0.86)",
|
|
2460
|
+
fontWeight: "600"
|
|
2461
|
+
});
|
|
2462
|
+
const a = document.createElement("input");
|
|
2463
|
+
a.type = "range", a.min = n.min.toString(), a.max = n.max.toString(), a.step = n.increment.toString(), Object.assign(a.style, {
|
|
2464
|
+
width: "100%",
|
|
2465
|
+
minWidth: "0",
|
|
2466
|
+
accentColor: "#8bc7ff"
|
|
2467
|
+
});
|
|
2468
|
+
const s = document.createElement("input");
|
|
2469
|
+
s.type = "number", s.min = n.min.toString(), s.max = n.max.toString(), s.step = n.increment.toString(), Object.assign(s.style, {
|
|
2470
|
+
width: "100%",
|
|
2471
|
+
boxSizing: "border-box",
|
|
2472
|
+
border: "1px solid rgba(255, 255, 255, 0.24)",
|
|
2473
|
+
borderRadius: "6px",
|
|
2474
|
+
padding: "4px 6px",
|
|
2475
|
+
background: "rgba(255, 255, 255, 0.1)",
|
|
2476
|
+
color: "#ffffff",
|
|
2477
|
+
font: "inherit"
|
|
2478
|
+
});
|
|
2479
|
+
let r = c1(n.id);
|
|
2480
|
+
const l = (g) => {
|
|
2481
|
+
const h = y1(g);
|
|
2482
|
+
a.value = h, s.value = h;
|
|
2483
|
+
}, c = (g) => {
|
|
2484
|
+
Number.isFinite(g) && (r = e(n.id, g), l(r));
|
|
2485
|
+
}, u = (g) => {
|
|
2486
|
+
Number.isFinite(g) && (g !== r && c(g), t());
|
|
2487
|
+
};
|
|
2488
|
+
return a.addEventListener("input", () => c(a.valueAsNumber)), a.addEventListener("change", () => u(a.valueAsNumber)), s.addEventListener("change", () => u(s.valueAsNumber)), l(r), o.appendChild(i), o.appendChild(a), o.appendChild(s), o;
|
|
2489
|
+
}
|
|
2490
|
+
function y1(n) {
|
|
2491
|
+
return Number.isInteger(n) ? n.toString() : parseFloat(n.toFixed(6)).toString();
|
|
2492
|
+
}
|
|
2493
|
+
function v1({ container: n, onCommit: e }) {
|
|
2494
|
+
const t = p1({
|
|
2495
|
+
onPreview: (o, i) => {
|
|
2496
|
+
const a = u1(o, i);
|
|
2497
|
+
return o1({ [o]: a }), a;
|
|
2498
|
+
},
|
|
2499
|
+
onCommit: e
|
|
2500
|
+
});
|
|
2501
|
+
t !== null && n.appendChild(t);
|
|
2502
|
+
}
|
|
2503
|
+
class Oi {
|
|
2241
2504
|
constructor(e) {
|
|
2242
2505
|
this.navigator = null;
|
|
2243
2506
|
const { objectRenderers: t, scale: o = 1, ...i } = e;
|
|
2244
2507
|
this.props = {
|
|
2245
|
-
presentation:
|
|
2508
|
+
presentation: dn(),
|
|
2246
2509
|
element: document.body,
|
|
2247
2510
|
objectRenderers: {
|
|
2248
|
-
...
|
|
2511
|
+
...t1,
|
|
2249
2512
|
...t
|
|
2250
2513
|
},
|
|
2251
2514
|
cacheDurationMinutes: 15,
|
|
2252
|
-
scale:
|
|
2515
|
+
scale: w1(o),
|
|
2253
2516
|
...i
|
|
2254
|
-
}, this.state = { ...
|
|
2517
|
+
}, this.state = { ..._e };
|
|
2255
2518
|
}
|
|
2256
2519
|
/** Starts the presentation. */
|
|
2257
2520
|
async present() {
|
|
2258
|
-
const { presentation: e, element: t, scale: o } = this.props
|
|
2521
|
+
const { presentation: e, element: t, scale: o } = this.props;
|
|
2522
|
+
this.hideCursor();
|
|
2523
|
+
const i = Mn(e.size), a = e1(e.size);
|
|
2259
2524
|
a.style.transformOrigin = "center center", a.style.transform = `scale(${o})`, this.state = {
|
|
2260
|
-
...
|
|
2261
|
-
imageById: await
|
|
2525
|
+
..._e,
|
|
2526
|
+
imageById: await i1({
|
|
2262
2527
|
...e.resources.images,
|
|
2263
|
-
...
|
|
2528
|
+
...bn(e)
|
|
2264
2529
|
}),
|
|
2265
2530
|
canvas: i,
|
|
2266
2531
|
extrasContainer: a
|
|
2267
2532
|
};
|
|
2268
|
-
const s =
|
|
2533
|
+
const s = pn(e, t), r = a0(t), l = (g, h) => {
|
|
2269
2534
|
this.state.shortcutState.shortcuts.b = {
|
|
2270
2535
|
slideIndex: this.state.slideIndex,
|
|
2271
2536
|
buildIndex: this.state.buildIndex
|
|
2272
|
-
}, this.renderSlide(
|
|
2273
|
-
}, c = (
|
|
2274
|
-
r && (this.navigator =
|
|
2537
|
+
}, this.renderSlide(g ?? this.state.slideIndex, h);
|
|
2538
|
+
}, c = (g = !1) => {
|
|
2539
|
+
r && (this.navigator = sn({
|
|
2275
2540
|
presentation: e,
|
|
2276
2541
|
shortcutState: this.state.shortcutState,
|
|
2277
|
-
onNavigateToSlide: (
|
|
2278
|
-
onRenderSlide:
|
|
2279
|
-
onNext: (
|
|
2280
|
-
onPrevious: (
|
|
2281
|
-
forceRefresh:
|
|
2542
|
+
onNavigateToSlide: (h) => this.renderSlide(h),
|
|
2543
|
+
onRenderSlide: l,
|
|
2544
|
+
onNext: (h) => this.next(h),
|
|
2545
|
+
onPrevious: (h) => this.previous(h),
|
|
2546
|
+
forceRefresh: g
|
|
2282
2547
|
}), this.updateNavigator());
|
|
2283
2548
|
};
|
|
2284
|
-
|
|
2549
|
+
o0(
|
|
2285
2550
|
e,
|
|
2286
2551
|
s,
|
|
2287
2552
|
this.state.shortcutState,
|
|
2288
2553
|
{
|
|
2289
|
-
onNext: (
|
|
2290
|
-
onPrevious: (
|
|
2291
|
-
onRenderSlide:
|
|
2554
|
+
onNext: (g) => this.next(g),
|
|
2555
|
+
onPrevious: (g) => this.previous(g),
|
|
2556
|
+
onRenderSlide: l,
|
|
2292
2557
|
onShowNavigator: () => c()
|
|
2293
2558
|
},
|
|
2294
2559
|
{
|
|
2295
2560
|
focusOnPointerDown: !r,
|
|
2296
2561
|
keyEventTarget: r ? window : s
|
|
2297
2562
|
}
|
|
2298
|
-
), t.replaceChildren(), s.appendChild(i), s.appendChild(a),
|
|
2299
|
-
|
|
2300
|
-
|
|
2563
|
+
), t.replaceChildren(), s.appendChild(i), s.appendChild(a), v1({
|
|
2564
|
+
container: s,
|
|
2565
|
+
onCommit: () => this.reloadAfterVariableChange()
|
|
2566
|
+
}), t.appendChild(s);
|
|
2567
|
+
const u = An(e, this.props.cacheDurationMinutes);
|
|
2568
|
+
u !== null ? this.renderSlide(u.slideIndex, u.buildIndex) : this.renderSlide(0), en() && c(!0);
|
|
2569
|
+
}
|
|
2570
|
+
reloadAfterVariableChange() {
|
|
2571
|
+
const { presentation: e } = this.props;
|
|
2572
|
+
this.state.currentAnimationId !== null && (cancelAnimationFrame(this.state.currentAnimationId), this.state.currentAnimationId = null), Oe({
|
|
2573
|
+
title: e.title,
|
|
2574
|
+
slideIndex: this.state.slideIndex,
|
|
2575
|
+
buildIndex: this.state.buildIndex
|
|
2576
|
+
}), window.location.reload();
|
|
2301
2577
|
}
|
|
2302
2578
|
renderSlide(e, t = 0, o = null) {
|
|
2303
2579
|
const { presentation: i } = this.props, { canvas: a } = this.state, s = this.state.slideIndex !== e;
|
|
2304
|
-
this.state.slideIndex = e, this.state.buildIndex = t, o === null &&
|
|
2580
|
+
this.state.slideIndex = e, this.state.buildIndex = t, o === null && Oe({ title: i.title, slideIndex: e, buildIndex: t });
|
|
2305
2581
|
const r = i.slides[e];
|
|
2306
2582
|
if (!(r === void 0 || a === null)) {
|
|
2307
2583
|
if (s || this.state.mountedExtrasCleanups.length === 0 && r.extras.length > 0) {
|
|
2308
|
-
for (const
|
|
2309
|
-
|
|
2584
|
+
for (const l of this.state.mountedExtrasCleanups)
|
|
2585
|
+
l();
|
|
2310
2586
|
this.state.mountedExtrasCleanups = [];
|
|
2311
|
-
for (const
|
|
2312
|
-
const c =
|
|
2587
|
+
for (const l of r.extras) {
|
|
2588
|
+
const c = n1(this.state.extrasContainer, l);
|
|
2313
2589
|
c !== null && this.state.mountedExtrasCleanups.push(c);
|
|
2314
2590
|
}
|
|
2315
2591
|
}
|
|
@@ -2317,34 +2593,36 @@ class er {
|
|
|
2317
2593
|
}
|
|
2318
2594
|
}
|
|
2319
2595
|
renderCanvas(e, t, o = 0, i = null, a = 1) {
|
|
2320
|
-
const { objectRenderers: s, presentation: r } = this.props, { imageById:
|
|
2596
|
+
const { objectRenderers: s, presentation: r } = this.props, { imageById: l } = this.state;
|
|
2321
2597
|
e.width = r.size.width, e.height = r.size.height;
|
|
2322
2598
|
const c = e.getContext("2d");
|
|
2323
2599
|
if (c === null)
|
|
2324
2600
|
return;
|
|
2325
2601
|
const u = {
|
|
2326
|
-
type:
|
|
2602
|
+
type: K.Browser,
|
|
2327
2603
|
context: c
|
|
2328
2604
|
};
|
|
2329
|
-
|
|
2330
|
-
const
|
|
2331
|
-
if (
|
|
2605
|
+
Tn(e, u);
|
|
2606
|
+
const g = r.slides[t];
|
|
2607
|
+
if (g === void 0)
|
|
2332
2608
|
return;
|
|
2333
|
-
const
|
|
2334
|
-
slide:
|
|
2609
|
+
const h = mn({
|
|
2610
|
+
slide: g,
|
|
2335
2611
|
buildIndex: o,
|
|
2336
2612
|
buildTime: i
|
|
2337
2613
|
});
|
|
2338
|
-
u.context.fillStyle =
|
|
2339
|
-
function f(y,
|
|
2340
|
-
const
|
|
2341
|
-
|
|
2614
|
+
u.context.fillStyle = pe(r.backgroundColor), u.context.fillRect(0, 0, e.width, e.height);
|
|
2615
|
+
function f(y, T) {
|
|
2616
|
+
const L = s[y.objectType], P = h.get(y);
|
|
2617
|
+
L === void 0 || P === void 0 || L({
|
|
2342
2618
|
ctx: u,
|
|
2343
|
-
imageById:
|
|
2344
|
-
object:
|
|
2345
|
-
opacity:
|
|
2619
|
+
imageById: l,
|
|
2620
|
+
object: P,
|
|
2621
|
+
opacity: T,
|
|
2622
|
+
renderScale: a,
|
|
2346
2623
|
renderObject: f,
|
|
2347
|
-
createPath2D:
|
|
2624
|
+
createPath2D: Ln,
|
|
2625
|
+
slideSize: r.size
|
|
2348
2626
|
});
|
|
2349
2627
|
}
|
|
2350
2628
|
const v = a !== 1;
|
|
@@ -2352,7 +2630,7 @@ class er {
|
|
|
2352
2630
|
e.width * (1 - a) / 2,
|
|
2353
2631
|
e.height * (1 - a) / 2
|
|
2354
2632
|
), u.context.scale(a, a));
|
|
2355
|
-
for (const y of
|
|
2633
|
+
for (const y of g.objects)
|
|
2356
2634
|
f(y, 1);
|
|
2357
2635
|
v && u.context.restore();
|
|
2358
2636
|
}
|
|
@@ -2385,9 +2663,9 @@ class er {
|
|
|
2385
2663
|
return;
|
|
2386
2664
|
const r = s.animations[a];
|
|
2387
2665
|
if (r !== void 0 && !e) {
|
|
2388
|
-
const
|
|
2389
|
-
const
|
|
2390
|
-
|
|
2666
|
+
const l = performance.now(), c = gn(r), u = (g) => {
|
|
2667
|
+
const h = g - l;
|
|
2668
|
+
h < c ? (this.renderSlide(i, a + 1, h), this.state.currentAnimationId = requestAnimationFrame(u)) : this.renderSlide(i, a + 1, null);
|
|
2391
2669
|
};
|
|
2392
2670
|
this.state.currentAnimationId = requestAnimationFrame(u);
|
|
2393
2671
|
} else i + 1 < t.slides.length && this.renderSlide(i + 1);
|
|
@@ -2415,20 +2693,20 @@ class er {
|
|
|
2415
2693
|
this.props.element.style.cursor = "none", (t = (e = this.state.canvas) == null ? void 0 : e.parentElement) == null || t.style.setProperty("cursor", "none");
|
|
2416
2694
|
}
|
|
2417
2695
|
}
|
|
2418
|
-
function
|
|
2696
|
+
function w1(n) {
|
|
2419
2697
|
return n <= 0 || n > 1 ? (console.warn(
|
|
2420
2698
|
`BrowserCanvasRenderer scale must be positive and no greater than 1. Received ${n}; using 1 instead.`
|
|
2421
2699
|
), 1) : n;
|
|
2422
2700
|
}
|
|
2423
|
-
function
|
|
2701
|
+
function _i(n = 1e3) {
|
|
2424
2702
|
return {
|
|
2425
|
-
type:
|
|
2703
|
+
type: dt.PAUSE,
|
|
2426
2704
|
isKey: !1,
|
|
2427
2705
|
duration: n,
|
|
2428
2706
|
shortcut: null
|
|
2429
2707
|
};
|
|
2430
2708
|
}
|
|
2431
|
-
function
|
|
2709
|
+
function Ni(n = null) {
|
|
2432
2710
|
return {
|
|
2433
2711
|
objects: [],
|
|
2434
2712
|
animations: [],
|
|
@@ -2441,32 +2719,32 @@ function rr(n = null) {
|
|
|
2441
2719
|
...n
|
|
2442
2720
|
};
|
|
2443
2721
|
}
|
|
2444
|
-
function
|
|
2722
|
+
function Ri(n, e = {}) {
|
|
2445
2723
|
return {
|
|
2446
2724
|
...e,
|
|
2447
2725
|
text: n
|
|
2448
2726
|
};
|
|
2449
2727
|
}
|
|
2450
|
-
function
|
|
2728
|
+
function Fi(n = G.BLACK) {
|
|
2451
2729
|
return { ...n, alpha: 1 };
|
|
2452
2730
|
}
|
|
2453
|
-
function
|
|
2731
|
+
function m1(n) {
|
|
2454
2732
|
for (var e = -1, t = n.length, o, i = n[t - 1], a = 0; ++e < t; )
|
|
2455
2733
|
o = i, i = n[e], a += o[1] * i[0] - o[0] * i[1];
|
|
2456
2734
|
return a / 2;
|
|
2457
2735
|
}
|
|
2458
|
-
function
|
|
2459
|
-
for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1],
|
|
2460
|
-
i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r,
|
|
2461
|
-
return
|
|
2736
|
+
function b1(n) {
|
|
2737
|
+
for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1], l = 0; ++e < t; )
|
|
2738
|
+
i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r, l += Math.sqrt(i * i + a * a);
|
|
2739
|
+
return l;
|
|
2462
2740
|
}
|
|
2463
|
-
function
|
|
2741
|
+
function A1(n) {
|
|
2464
2742
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
2465
2743
|
}
|
|
2466
|
-
var
|
|
2467
|
-
function
|
|
2468
|
-
if (
|
|
2469
|
-
|
|
2744
|
+
var $t, De;
|
|
2745
|
+
function T1() {
|
|
2746
|
+
if (De) return $t;
|
|
2747
|
+
De = 1;
|
|
2470
2748
|
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 = [
|
|
2471
2749
|
5760,
|
|
2472
2750
|
6158,
|
|
@@ -2523,7 +2801,7 @@ function X1() {
|
|
|
2523
2801
|
function r(f) {
|
|
2524
2802
|
this.index = 0, this.path = f, this.max = f.length, this.result = [], this.param = 0, this.err = "", this.segmentStart = 0, this.data = [];
|
|
2525
2803
|
}
|
|
2526
|
-
function
|
|
2804
|
+
function l(f) {
|
|
2527
2805
|
for (; f.index < f.max && t(f.path.charCodeAt(f.index)); )
|
|
2528
2806
|
f.index++;
|
|
2529
2807
|
}
|
|
@@ -2540,36 +2818,36 @@ function X1() {
|
|
|
2540
2818
|
f.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + f.index + ")";
|
|
2541
2819
|
}
|
|
2542
2820
|
function u(f) {
|
|
2543
|
-
var v = f.index, y = v,
|
|
2544
|
-
if (y >=
|
|
2821
|
+
var v = f.index, y = v, T = f.max, L = !1, P = !1, S = !1, E = !1, M;
|
|
2822
|
+
if (y >= T) {
|
|
2545
2823
|
f.err = "SvgPath: missed param (at pos " + y + ")";
|
|
2546
2824
|
return;
|
|
2547
2825
|
}
|
|
2548
|
-
if (
|
|
2826
|
+
if (M = f.path.charCodeAt(y), (M === 43 || M === 45) && (y++, M = y < T ? f.path.charCodeAt(y) : 0), !a(M) && M !== 46) {
|
|
2549
2827
|
f.err = "SvgPath: param should start with 0..9 or `.` (at pos " + y + ")";
|
|
2550
2828
|
return;
|
|
2551
2829
|
}
|
|
2552
|
-
if (
|
|
2553
|
-
if (
|
|
2830
|
+
if (M !== 46) {
|
|
2831
|
+
if (L = M === 48, y++, M = y < T ? f.path.charCodeAt(y) : 0, L && y < T && M && a(M)) {
|
|
2554
2832
|
f.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + v + ")";
|
|
2555
2833
|
return;
|
|
2556
2834
|
}
|
|
2557
|
-
for (; y <
|
|
2558
|
-
y++,
|
|
2559
|
-
|
|
2835
|
+
for (; y < T && a(f.path.charCodeAt(y)); )
|
|
2836
|
+
y++, P = !0;
|
|
2837
|
+
M = y < T ? f.path.charCodeAt(y) : 0;
|
|
2560
2838
|
}
|
|
2561
|
-
if (
|
|
2839
|
+
if (M === 46) {
|
|
2562
2840
|
for (E = !0, y++; a(f.path.charCodeAt(y)); )
|
|
2563
|
-
y++,
|
|
2564
|
-
|
|
2841
|
+
y++, S = !0;
|
|
2842
|
+
M = y < T ? f.path.charCodeAt(y) : 0;
|
|
2565
2843
|
}
|
|
2566
|
-
if (
|
|
2567
|
-
if (E && !
|
|
2844
|
+
if (M === 101 || M === 69) {
|
|
2845
|
+
if (E && !P && !S) {
|
|
2568
2846
|
f.err = "SvgPath: invalid float exponent (at pos " + y + ")";
|
|
2569
2847
|
return;
|
|
2570
2848
|
}
|
|
2571
|
-
if (y++,
|
|
2572
|
-
for (; y <
|
|
2849
|
+
if (y++, M = y < T ? f.path.charCodeAt(y) : 0, (M === 43 || M === 45) && y++, y < T && a(f.path.charCodeAt(y)))
|
|
2850
|
+
for (; y < T && a(f.path.charCodeAt(y)); )
|
|
2573
2851
|
y++;
|
|
2574
2852
|
else {
|
|
2575
2853
|
f.err = "SvgPath: invalid float exponent (at pos " + y + ")";
|
|
@@ -2578,53 +2856,53 @@ function X1() {
|
|
|
2578
2856
|
}
|
|
2579
2857
|
f.index = y, f.param = parseFloat(f.path.slice(v, y)) + 0;
|
|
2580
2858
|
}
|
|
2581
|
-
function
|
|
2859
|
+
function g(f) {
|
|
2582
2860
|
var v, y;
|
|
2583
2861
|
v = f.path[f.segmentStart], y = v.toLowerCase();
|
|
2584
|
-
var
|
|
2585
|
-
if (y === "m" &&
|
|
2586
|
-
f.result.push([v].concat(
|
|
2862
|
+
var T = f.data;
|
|
2863
|
+
if (y === "m" && T.length > 2 && (f.result.push([v, T[0], T[1]]), T = T.slice(2), y = "l", v = v === "m" ? "l" : "L"), y === "r")
|
|
2864
|
+
f.result.push([v].concat(T));
|
|
2587
2865
|
else
|
|
2588
|
-
for (;
|
|
2866
|
+
for (; T.length >= n[y] && (f.result.push([v].concat(T.splice(0, n[y]))), !!n[y]); )
|
|
2589
2867
|
;
|
|
2590
2868
|
}
|
|
2591
|
-
function
|
|
2592
|
-
var v = f.max, y,
|
|
2593
|
-
if (f.segmentStart = f.index, y = f.path.charCodeAt(f.index),
|
|
2869
|
+
function h(f) {
|
|
2870
|
+
var v = f.max, y, T, L, P, S;
|
|
2871
|
+
if (f.segmentStart = f.index, y = f.path.charCodeAt(f.index), T = i(y), !o(y)) {
|
|
2594
2872
|
f.err = "SvgPath: bad command " + f.path[f.index] + " (at pos " + f.index + ")";
|
|
2595
2873
|
return;
|
|
2596
2874
|
}
|
|
2597
|
-
if (
|
|
2598
|
-
|
|
2875
|
+
if (P = n[f.path[f.index].toLowerCase()], f.index++, l(f), f.data = [], !P) {
|
|
2876
|
+
g(f);
|
|
2599
2877
|
return;
|
|
2600
2878
|
}
|
|
2601
|
-
for (
|
|
2602
|
-
for (
|
|
2603
|
-
if (
|
|
2604
|
-
|
|
2879
|
+
for (L = !1; ; ) {
|
|
2880
|
+
for (S = P; S > 0; S--) {
|
|
2881
|
+
if (T && (S === 3 || S === 4) ? c(f) : u(f), f.err.length) {
|
|
2882
|
+
g(f);
|
|
2605
2883
|
return;
|
|
2606
2884
|
}
|
|
2607
|
-
f.data.push(f.param),
|
|
2885
|
+
f.data.push(f.param), l(f), L = !1, f.index < v && f.path.charCodeAt(f.index) === 44 && (f.index++, l(f), L = !0);
|
|
2608
2886
|
}
|
|
2609
|
-
if (!
|
|
2887
|
+
if (!L && (f.index >= f.max || !s(f.path.charCodeAt(f.index))))
|
|
2610
2888
|
break;
|
|
2611
2889
|
}
|
|
2612
|
-
|
|
2890
|
+
g(f);
|
|
2613
2891
|
}
|
|
2614
|
-
return
|
|
2615
|
-
var y = new r(v),
|
|
2616
|
-
for (
|
|
2617
|
-
|
|
2892
|
+
return $t = function(v) {
|
|
2893
|
+
var y = new r(v), T = y.max;
|
|
2894
|
+
for (l(y); y.index < T && !y.err.length; )
|
|
2895
|
+
h(y);
|
|
2618
2896
|
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"), {
|
|
2619
2897
|
err: y.err,
|
|
2620
2898
|
segments: y.result
|
|
2621
2899
|
};
|
|
2622
|
-
},
|
|
2900
|
+
}, $t;
|
|
2623
2901
|
}
|
|
2624
|
-
var
|
|
2625
|
-
function
|
|
2626
|
-
if (
|
|
2627
|
-
|
|
2902
|
+
var Wt, qe;
|
|
2903
|
+
function x0() {
|
|
2904
|
+
if (qe) return Wt;
|
|
2905
|
+
qe = 1;
|
|
2628
2906
|
function n(t, o) {
|
|
2629
2907
|
return [
|
|
2630
2908
|
t[0] * o[0] + t[2] * o[1],
|
|
@@ -2669,13 +2947,13 @@ function ie() {
|
|
|
2669
2947
|
t * a[0] + o * a[2] + (i ? 0 : a[4]),
|
|
2670
2948
|
t * a[1] + o * a[3] + (i ? 0 : a[5])
|
|
2671
2949
|
]) : [t, o];
|
|
2672
|
-
},
|
|
2950
|
+
}, Wt = e, Wt;
|
|
2673
2951
|
}
|
|
2674
|
-
var
|
|
2675
|
-
function
|
|
2676
|
-
if (
|
|
2677
|
-
|
|
2678
|
-
var n =
|
|
2952
|
+
var Yt, ze;
|
|
2953
|
+
function M1() {
|
|
2954
|
+
if (ze) return Yt;
|
|
2955
|
+
ze = 1;
|
|
2956
|
+
var n = x0(), e = {
|
|
2679
2957
|
matrix: !0,
|
|
2680
2958
|
scale: !0,
|
|
2681
2959
|
rotate: !0,
|
|
@@ -2683,87 +2961,87 @@ function G1() {
|
|
|
2683
2961
|
skewX: !0,
|
|
2684
2962
|
skewY: !0
|
|
2685
2963
|
}, t = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, o = /[\s,]+/;
|
|
2686
|
-
return
|
|
2687
|
-
var s = new n(), r,
|
|
2964
|
+
return Yt = function(a) {
|
|
2965
|
+
var s = new n(), r, l;
|
|
2688
2966
|
return a.split(t).forEach(function(c) {
|
|
2689
2967
|
if (c.length) {
|
|
2690
2968
|
if (typeof e[c] < "u") {
|
|
2691
2969
|
r = c;
|
|
2692
2970
|
return;
|
|
2693
2971
|
}
|
|
2694
|
-
switch (
|
|
2972
|
+
switch (l = c.split(o).map(function(u) {
|
|
2695
2973
|
return +u || 0;
|
|
2696
2974
|
}), r) {
|
|
2697
2975
|
case "matrix":
|
|
2698
|
-
|
|
2976
|
+
l.length === 6 && s.matrix(l);
|
|
2699
2977
|
return;
|
|
2700
2978
|
case "scale":
|
|
2701
|
-
|
|
2979
|
+
l.length === 1 ? s.scale(l[0], l[0]) : l.length === 2 && s.scale(l[0], l[1]);
|
|
2702
2980
|
return;
|
|
2703
2981
|
case "rotate":
|
|
2704
|
-
|
|
2982
|
+
l.length === 1 ? s.rotate(l[0], 0, 0) : l.length === 3 && s.rotate(l[0], l[1], l[2]);
|
|
2705
2983
|
return;
|
|
2706
2984
|
case "translate":
|
|
2707
|
-
|
|
2985
|
+
l.length === 1 ? s.translate(l[0], 0) : l.length === 2 && s.translate(l[0], l[1]);
|
|
2708
2986
|
return;
|
|
2709
2987
|
case "skewX":
|
|
2710
|
-
|
|
2988
|
+
l.length === 1 && s.skewX(l[0]);
|
|
2711
2989
|
return;
|
|
2712
2990
|
case "skewY":
|
|
2713
|
-
|
|
2991
|
+
l.length === 1 && s.skewY(l[0]);
|
|
2714
2992
|
return;
|
|
2715
2993
|
}
|
|
2716
2994
|
}
|
|
2717
2995
|
}), s;
|
|
2718
|
-
},
|
|
2996
|
+
}, Yt;
|
|
2719
2997
|
}
|
|
2720
|
-
var
|
|
2721
|
-
function
|
|
2722
|
-
if (
|
|
2723
|
-
|
|
2998
|
+
var Gt, Ve;
|
|
2999
|
+
function L1() {
|
|
3000
|
+
if (Ve) return Gt;
|
|
3001
|
+
Ve = 1;
|
|
2724
3002
|
var n = Math.PI * 2;
|
|
2725
3003
|
function e(i, a, s, r) {
|
|
2726
|
-
var
|
|
2727
|
-
return c > 1 && (c = 1), c < -1 && (c = -1),
|
|
3004
|
+
var l = i * r - a * s < 0 ? -1 : 1, c = i * s + a * r;
|
|
3005
|
+
return c > 1 && (c = 1), c < -1 && (c = -1), l * Math.acos(c);
|
|
2728
3006
|
}
|
|
2729
|
-
function t(i, a, s, r,
|
|
2730
|
-
var v = f * (i - s) / 2 +
|
|
2731
|
-
E < 0 && (E = 0), E /=
|
|
2732
|
-
var
|
|
2733
|
-
return c === 0 && Z > 0 && (Z -= n), c === 1 && Z < 0 && (Z += n), [F,
|
|
3007
|
+
function t(i, a, s, r, l, c, u, g, h, f) {
|
|
3008
|
+
var v = f * (i - s) / 2 + h * (a - r) / 2, y = -h * (i - s) / 2 + f * (a - r) / 2, T = u * u, L = g * g, P = v * v, S = y * y, E = T * L - T * S - L * P;
|
|
3009
|
+
E < 0 && (E = 0), E /= T * S + L * P, E = Math.sqrt(E) * (l === c ? -1 : 1);
|
|
3010
|
+
var M = E * u / g * y, I = E * -g / u * v, F = f * M - h * I + (i + s) / 2, Y = h * M + f * I + (a + r) / 2, z = (v - M) / u, U = (y - I) / g, it = (-v - M) / u, rt = (-y - I) / g, ot = e(1, 0, z, U), Z = e(z, U, it, rt);
|
|
3011
|
+
return c === 0 && Z > 0 && (Z -= n), c === 1 && Z < 0 && (Z += n), [F, Y, ot, Z];
|
|
2734
3012
|
}
|
|
2735
3013
|
function o(i, a) {
|
|
2736
|
-
var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i),
|
|
2737
|
-
return [r,
|
|
3014
|
+
var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), l = Math.sin(i), c = Math.cos(i + a), u = Math.sin(i + a);
|
|
3015
|
+
return [r, l, r - l * s, l + r * s, c + u * s, u - c * s, c, u];
|
|
2738
3016
|
}
|
|
2739
|
-
return
|
|
2740
|
-
var v = Math.sin(f * n / 360), y = Math.cos(f * n / 360),
|
|
2741
|
-
if (
|
|
3017
|
+
return Gt = function(a, s, r, l, c, u, g, h, f) {
|
|
3018
|
+
var v = Math.sin(f * n / 360), y = Math.cos(f * n / 360), T = y * (a - r) / 2 + v * (s - l) / 2, L = -v * (a - r) / 2 + y * (s - l) / 2;
|
|
3019
|
+
if (T === 0 && L === 0)
|
|
2742
3020
|
return [];
|
|
2743
|
-
if (
|
|
3021
|
+
if (g === 0 || h === 0)
|
|
2744
3022
|
return [];
|
|
2745
|
-
|
|
2746
|
-
var
|
|
2747
|
-
|
|
2748
|
-
var
|
|
3023
|
+
g = Math.abs(g), h = Math.abs(h);
|
|
3024
|
+
var P = T * T / (g * g) + L * L / (h * h);
|
|
3025
|
+
P > 1 && (g *= Math.sqrt(P), h *= Math.sqrt(P));
|
|
3026
|
+
var S = t(a, s, r, l, c, u, g, h, v, y), E = [], M = S[2], I = S[3], F = Math.max(Math.ceil(Math.abs(I) / (n / 4)), 1);
|
|
2749
3027
|
I /= F;
|
|
2750
|
-
for (var
|
|
2751
|
-
E.push(o(
|
|
3028
|
+
for (var Y = 0; Y < F; Y++)
|
|
3029
|
+
E.push(o(M, I)), M += I;
|
|
2752
3030
|
return E.map(function(z) {
|
|
2753
3031
|
for (var U = 0; U < z.length; U += 2) {
|
|
2754
|
-
var
|
|
2755
|
-
|
|
2756
|
-
var
|
|
2757
|
-
z[U + 0] =
|
|
3032
|
+
var it = z[U + 0], rt = z[U + 1];
|
|
3033
|
+
it *= g, rt *= h;
|
|
3034
|
+
var ot = y * it - v * rt, Z = v * it + y * rt;
|
|
3035
|
+
z[U + 0] = ot + S[0], z[U + 1] = Z + S[1];
|
|
2758
3036
|
}
|
|
2759
3037
|
return z;
|
|
2760
3038
|
});
|
|
2761
|
-
},
|
|
3039
|
+
}, Gt;
|
|
2762
3040
|
}
|
|
2763
|
-
var Xt,
|
|
2764
|
-
function
|
|
2765
|
-
if (
|
|
2766
|
-
|
|
3041
|
+
var Xt, je;
|
|
3042
|
+
function C1() {
|
|
3043
|
+
if (je) return Xt;
|
|
3044
|
+
je = 1;
|
|
2767
3045
|
var n = 1e-10, e = Math.PI / 180;
|
|
2768
3046
|
function t(o, i, a) {
|
|
2769
3047
|
if (!(this instanceof t))
|
|
@@ -2776,24 +3054,24 @@ function V1() {
|
|
|
2776
3054
|
this.rx * (o[1] * i + o[3] * a),
|
|
2777
3055
|
this.ry * (-o[0] * a + o[2] * i),
|
|
2778
3056
|
this.ry * (-o[1] * a + o[3] * i)
|
|
2779
|
-
], r = s[0] * s[0] + s[2] * s[2],
|
|
3057
|
+
], r = s[0] * s[0] + s[2] * s[2], l = s[1] * s[1] + s[3] * s[3], c = ((s[0] - s[3]) * (s[0] - s[3]) + (s[2] + s[1]) * (s[2] + s[1])) * ((s[0] + s[3]) * (s[0] + s[3]) + (s[2] - s[1]) * (s[2] - s[1])), u = (r + l) / 2;
|
|
2780
3058
|
if (c < n * u)
|
|
2781
3059
|
return this.rx = this.ry = Math.sqrt(u), this.ax = 0, this;
|
|
2782
|
-
var
|
|
3060
|
+
var g = s[0] * s[1] + s[2] * s[3];
|
|
2783
3061
|
c = Math.sqrt(c);
|
|
2784
|
-
var
|
|
2785
|
-
return this.ax = Math.abs(
|
|
2786
|
-
Math.abs(
|
|
2787
|
-
) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(
|
|
3062
|
+
var h = u + c / 2, f = u - c / 2;
|
|
3063
|
+
return this.ax = Math.abs(g) < n && Math.abs(h - l) < n ? 90 : Math.atan(
|
|
3064
|
+
Math.abs(g) > Math.abs(h - l) ? (h - r) / g : g / (h - l)
|
|
3065
|
+
) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(h), this.ry = Math.sqrt(f)) : (this.ax += 90, this.rx = Math.sqrt(f), this.ry = Math.sqrt(h)), this;
|
|
2788
3066
|
}, t.prototype.isDegenerate = function() {
|
|
2789
3067
|
return this.rx < n * this.ry || this.ry < n * this.rx;
|
|
2790
3068
|
}, Xt = t, Xt;
|
|
2791
3069
|
}
|
|
2792
|
-
var
|
|
2793
|
-
function
|
|
2794
|
-
if (
|
|
2795
|
-
|
|
2796
|
-
var n =
|
|
3070
|
+
var Kt, He;
|
|
3071
|
+
function S1() {
|
|
3072
|
+
if (He) return Kt;
|
|
3073
|
+
He = 1;
|
|
3074
|
+
var n = T1(), e = M1(), t = x0(), o = L1(), i = C1();
|
|
2797
3075
|
function a(s) {
|
|
2798
3076
|
if (!(this instanceof a))
|
|
2799
3077
|
return new a(s);
|
|
@@ -2804,46 +3082,46 @@ function Z1() {
|
|
|
2804
3082
|
if (typeof s == "string") return new a(s);
|
|
2805
3083
|
if (s instanceof a) {
|
|
2806
3084
|
var r = new a("");
|
|
2807
|
-
return r.err = s.err, r.segments = s.segments.map(function(
|
|
2808
|
-
return
|
|
2809
|
-
}), r.__stack = s.__stack.map(function(
|
|
2810
|
-
return t().matrix(
|
|
3085
|
+
return r.err = s.err, r.segments = s.segments.map(function(l) {
|
|
3086
|
+
return l.slice();
|
|
3087
|
+
}), r.__stack = s.__stack.map(function(l) {
|
|
3088
|
+
return t().matrix(l.toArray());
|
|
2811
3089
|
}), r;
|
|
2812
3090
|
}
|
|
2813
3091
|
throw new Error("SvgPath.from: invalid param type " + s);
|
|
2814
3092
|
}, a.prototype.__matrix = function(s) {
|
|
2815
|
-
var r = this,
|
|
2816
|
-
s.queue.length && this.iterate(function(c, u,
|
|
2817
|
-
var f, v, y,
|
|
3093
|
+
var r = this, l;
|
|
3094
|
+
s.queue.length && this.iterate(function(c, u, g, h) {
|
|
3095
|
+
var f, v, y, T;
|
|
2818
3096
|
switch (c[0]) {
|
|
2819
3097
|
// Process 'assymetric' commands separately
|
|
2820
3098
|
case "v":
|
|
2821
3099
|
f = s.calc(0, c[1], !0), v = f[0] === 0 ? ["v", f[1]] : ["l", f[0], f[1]];
|
|
2822
3100
|
break;
|
|
2823
3101
|
case "V":
|
|
2824
|
-
f = s.calc(
|
|
3102
|
+
f = s.calc(g, c[1], !1), v = f[0] === s.calc(g, h, !1)[0] ? ["V", f[1]] : ["L", f[0], f[1]];
|
|
2825
3103
|
break;
|
|
2826
3104
|
case "h":
|
|
2827
3105
|
f = s.calc(c[1], 0, !0), v = f[1] === 0 ? ["h", f[0]] : ["l", f[0], f[1]];
|
|
2828
3106
|
break;
|
|
2829
3107
|
case "H":
|
|
2830
|
-
f = s.calc(c[1],
|
|
3108
|
+
f = s.calc(c[1], h, !1), v = f[1] === s.calc(g, h, !1)[1] ? ["H", f[0]] : ["L", f[0], f[1]];
|
|
2831
3109
|
break;
|
|
2832
3110
|
case "a":
|
|
2833
3111
|
case "A":
|
|
2834
|
-
var
|
|
2835
|
-
if (
|
|
3112
|
+
var L = s.toArray(), P = i(c[1], c[2], c[3]).transform(L);
|
|
3113
|
+
if (L[0] * L[3] - L[1] * L[2] < 0 && (c[5] = c[5] ? "0" : "1"), f = s.calc(c[6], c[7], c[0] === "a"), c[0] === "A" && c[6] === g && c[7] === h || c[0] === "a" && c[6] === 0 && c[7] === 0) {
|
|
2836
3114
|
v = [c[0] === "a" ? "l" : "L", f[0], f[1]];
|
|
2837
3115
|
break;
|
|
2838
3116
|
}
|
|
2839
|
-
|
|
3117
|
+
P.isDegenerate() ? v = [c[0] === "a" ? "l" : "L", f[0], f[1]] : v = [c[0], P.rx, P.ry, P.ax, c[4], c[5], f[0], f[1]];
|
|
2840
3118
|
break;
|
|
2841
3119
|
case "m":
|
|
2842
|
-
|
|
3120
|
+
T = u > 0, f = s.calc(c[1], c[2], T), v = ["m", f[0], f[1]];
|
|
2843
3121
|
break;
|
|
2844
3122
|
default:
|
|
2845
|
-
for (y = c[0], v = [y],
|
|
2846
|
-
f = s.calc(c[
|
|
3123
|
+
for (y = c[0], v = [y], T = y.toLowerCase() === y, l = 1; l < c.length; l += 2)
|
|
3124
|
+
f = s.calc(c[l], c[l + 1], T), v.push(f[0], f[1]);
|
|
2847
3125
|
}
|
|
2848
3126
|
r.segments[u] = v;
|
|
2849
3127
|
}, !0);
|
|
@@ -2859,24 +3137,24 @@ function Z1() {
|
|
|
2859
3137
|
this.__matrix(s), this.__stack = [];
|
|
2860
3138
|
}
|
|
2861
3139
|
}, a.prototype.toString = function() {
|
|
2862
|
-
var s = "", r = "",
|
|
3140
|
+
var s = "", r = "", l = !1;
|
|
2863
3141
|
this.__evaluateStack();
|
|
2864
3142
|
for (var c = 0, u = this.segments.length; c < u; c++) {
|
|
2865
|
-
var
|
|
2866
|
-
|
|
2867
|
-
for (var f = 1; f <
|
|
2868
|
-
var v =
|
|
2869
|
-
f === 1 ?
|
|
3143
|
+
var g = this.segments[c], h = g[0];
|
|
3144
|
+
h !== r || h === "m" || h === "M" ? (h === "m" && r === "z" && (s += " "), s += h, l = !1) : l = !0;
|
|
3145
|
+
for (var f = 1; f < g.length; f++) {
|
|
3146
|
+
var v = g[f];
|
|
3147
|
+
f === 1 ? l && v >= 0 && (s += " ") : v >= 0 && (s += " "), s += v;
|
|
2870
3148
|
}
|
|
2871
|
-
r =
|
|
3149
|
+
r = h;
|
|
2872
3150
|
}
|
|
2873
3151
|
return s;
|
|
2874
3152
|
}, a.prototype.translate = function(s, r) {
|
|
2875
3153
|
return this.__stack.push(t().translate(s, r || 0)), this;
|
|
2876
3154
|
}, a.prototype.scale = function(s, r) {
|
|
2877
3155
|
return this.__stack.push(t().scale(s, !r && r !== 0 ? s : r)), this;
|
|
2878
|
-
}, a.prototype.rotate = function(s, r,
|
|
2879
|
-
return this.__stack.push(t().rotate(s, r || 0,
|
|
3156
|
+
}, a.prototype.rotate = function(s, r, l) {
|
|
3157
|
+
return this.__stack.push(t().rotate(s, r || 0, l || 0)), this;
|
|
2880
3158
|
}, a.prototype.skewX = function(s) {
|
|
2881
3159
|
return this.__stack.push(t().skewX(s)), this;
|
|
2882
3160
|
}, a.prototype.skewY = function(s) {
|
|
@@ -2886,166 +3164,166 @@ function Z1() {
|
|
|
2886
3164
|
}, a.prototype.transform = function(s) {
|
|
2887
3165
|
return s.trim() ? (this.__stack.push(e(s)), this) : this;
|
|
2888
3166
|
}, a.prototype.round = function(s) {
|
|
2889
|
-
var r = 0,
|
|
2890
|
-
return s = s || 0, this.__evaluateStack(), this.segments.forEach(function(
|
|
2891
|
-
var f =
|
|
2892
|
-
switch (
|
|
3167
|
+
var r = 0, l = 0, c = 0, u = 0, g;
|
|
3168
|
+
return s = s || 0, this.__evaluateStack(), this.segments.forEach(function(h) {
|
|
3169
|
+
var f = h[0].toLowerCase() === h[0];
|
|
3170
|
+
switch (h[0]) {
|
|
2893
3171
|
case "H":
|
|
2894
3172
|
case "h":
|
|
2895
|
-
f && (
|
|
3173
|
+
f && (h[1] += c), c = h[1] - h[1].toFixed(s), h[1] = +h[1].toFixed(s);
|
|
2896
3174
|
return;
|
|
2897
3175
|
case "V":
|
|
2898
3176
|
case "v":
|
|
2899
|
-
f && (
|
|
3177
|
+
f && (h[1] += u), u = h[1] - h[1].toFixed(s), h[1] = +h[1].toFixed(s);
|
|
2900
3178
|
return;
|
|
2901
3179
|
case "Z":
|
|
2902
3180
|
case "z":
|
|
2903
|
-
c = r, u =
|
|
3181
|
+
c = r, u = l;
|
|
2904
3182
|
return;
|
|
2905
3183
|
case "M":
|
|
2906
3184
|
case "m":
|
|
2907
|
-
f && (
|
|
3185
|
+
f && (h[1] += c, h[2] += u), c = h[1] - h[1].toFixed(s), u = h[2] - h[2].toFixed(s), r = c, l = u, h[1] = +h[1].toFixed(s), h[2] = +h[2].toFixed(s);
|
|
2908
3186
|
return;
|
|
2909
3187
|
case "A":
|
|
2910
3188
|
case "a":
|
|
2911
|
-
f && (
|
|
3189
|
+
f && (h[6] += c, h[7] += u), c = h[6] - h[6].toFixed(s), u = h[7] - h[7].toFixed(s), h[1] = +h[1].toFixed(s), h[2] = +h[2].toFixed(s), h[3] = +h[3].toFixed(s + 2), h[6] = +h[6].toFixed(s), h[7] = +h[7].toFixed(s);
|
|
2912
3190
|
return;
|
|
2913
3191
|
default:
|
|
2914
|
-
|
|
2915
|
-
y && (
|
|
3192
|
+
g = h.length, f && (h[g - 2] += c, h[g - 1] += u), c = h[g - 2] - h[g - 2].toFixed(s), u = h[g - 1] - h[g - 1].toFixed(s), h.forEach(function(v, y) {
|
|
3193
|
+
y && (h[y] = +h[y].toFixed(s));
|
|
2916
3194
|
});
|
|
2917
3195
|
return;
|
|
2918
3196
|
}
|
|
2919
3197
|
}), this;
|
|
2920
3198
|
}, a.prototype.iterate = function(s, r) {
|
|
2921
|
-
var
|
|
2922
|
-
if (r || this.__evaluateStack(),
|
|
2923
|
-
var E = s(
|
|
2924
|
-
Array.isArray(E) && (c[
|
|
2925
|
-
var
|
|
2926
|
-
switch (
|
|
3199
|
+
var l = this.segments, c = {}, u = !1, g = 0, h = 0, f = 0, v = 0, y, T, L;
|
|
3200
|
+
if (r || this.__evaluateStack(), l.forEach(function(P, S) {
|
|
3201
|
+
var E = s(P, S, g, h);
|
|
3202
|
+
Array.isArray(E) && (c[S] = E, u = !0);
|
|
3203
|
+
var M = P[0] === P[0].toLowerCase();
|
|
3204
|
+
switch (P[0]) {
|
|
2927
3205
|
case "m":
|
|
2928
3206
|
case "M":
|
|
2929
|
-
|
|
3207
|
+
g = P[1] + (M ? g : 0), h = P[2] + (M ? h : 0), f = g, v = h;
|
|
2930
3208
|
return;
|
|
2931
3209
|
case "h":
|
|
2932
3210
|
case "H":
|
|
2933
|
-
|
|
3211
|
+
g = P[1] + (M ? g : 0);
|
|
2934
3212
|
return;
|
|
2935
3213
|
case "v":
|
|
2936
3214
|
case "V":
|
|
2937
|
-
|
|
3215
|
+
h = P[1] + (M ? h : 0);
|
|
2938
3216
|
return;
|
|
2939
3217
|
case "z":
|
|
2940
3218
|
case "Z":
|
|
2941
|
-
|
|
3219
|
+
g = f, h = v;
|
|
2942
3220
|
return;
|
|
2943
3221
|
default:
|
|
2944
|
-
|
|
3222
|
+
g = P[P.length - 2] + (M ? g : 0), h = P[P.length - 1] + (M ? h : 0);
|
|
2945
3223
|
}
|
|
2946
3224
|
}), !u)
|
|
2947
3225
|
return this;
|
|
2948
|
-
for (
|
|
3226
|
+
for (L = [], y = 0; y < l.length; y++)
|
|
2949
3227
|
if (typeof c[y] < "u")
|
|
2950
|
-
for (
|
|
2951
|
-
|
|
3228
|
+
for (T = 0; T < c[y].length; T++)
|
|
3229
|
+
L.push(c[y][T]);
|
|
2952
3230
|
else
|
|
2953
|
-
|
|
2954
|
-
return this.segments =
|
|
3231
|
+
L.push(l[y]);
|
|
3232
|
+
return this.segments = L, this;
|
|
2955
3233
|
}, a.prototype.abs = function() {
|
|
2956
|
-
return this.iterate(function(s, r,
|
|
2957
|
-
var u = s[0],
|
|
2958
|
-
if (u !==
|
|
2959
|
-
switch (s[0] =
|
|
3234
|
+
return this.iterate(function(s, r, l, c) {
|
|
3235
|
+
var u = s[0], g = u.toUpperCase(), h;
|
|
3236
|
+
if (u !== g)
|
|
3237
|
+
switch (s[0] = g, u) {
|
|
2960
3238
|
case "v":
|
|
2961
3239
|
s[1] += c;
|
|
2962
3240
|
return;
|
|
2963
3241
|
case "a":
|
|
2964
|
-
s[6] +=
|
|
3242
|
+
s[6] += l, s[7] += c;
|
|
2965
3243
|
return;
|
|
2966
3244
|
default:
|
|
2967
|
-
for (
|
|
2968
|
-
s[
|
|
3245
|
+
for (h = 1; h < s.length; h++)
|
|
3246
|
+
s[h] += h % 2 ? l : c;
|
|
2969
3247
|
}
|
|
2970
3248
|
}, !0), this;
|
|
2971
3249
|
}, a.prototype.rel = function() {
|
|
2972
|
-
return this.iterate(function(s, r,
|
|
2973
|
-
var u = s[0],
|
|
2974
|
-
if (u !==
|
|
2975
|
-
switch (s[0] =
|
|
3250
|
+
return this.iterate(function(s, r, l, c) {
|
|
3251
|
+
var u = s[0], g = u.toLowerCase(), h;
|
|
3252
|
+
if (u !== g && !(r === 0 && u === "M"))
|
|
3253
|
+
switch (s[0] = g, u) {
|
|
2976
3254
|
case "V":
|
|
2977
3255
|
s[1] -= c;
|
|
2978
3256
|
return;
|
|
2979
3257
|
case "A":
|
|
2980
|
-
s[6] -=
|
|
3258
|
+
s[6] -= l, s[7] -= c;
|
|
2981
3259
|
return;
|
|
2982
3260
|
default:
|
|
2983
|
-
for (
|
|
2984
|
-
s[
|
|
3261
|
+
for (h = 1; h < s.length; h++)
|
|
3262
|
+
s[h] -= h % 2 ? l : c;
|
|
2985
3263
|
}
|
|
2986
3264
|
}, !0), this;
|
|
2987
3265
|
}, a.prototype.unarc = function() {
|
|
2988
|
-
return this.iterate(function(s, r,
|
|
2989
|
-
var u,
|
|
2990
|
-
return v !== "A" && v !== "a" ? null : (v === "a" ? (
|
|
3266
|
+
return this.iterate(function(s, r, l, c) {
|
|
3267
|
+
var u, g, h, f = [], v = s[0];
|
|
3268
|
+
return v !== "A" && v !== "a" ? null : (v === "a" ? (g = l + s[6], h = c + s[7]) : (g = s[6], h = s[7]), u = o(l, c, g, h, s[4], s[5], s[1], s[2], s[3]), u.length === 0 ? [[s[0] === "a" ? "l" : "L", s[6], s[7]]] : (u.forEach(function(y) {
|
|
2991
3269
|
f.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
|
|
2992
3270
|
}), f));
|
|
2993
3271
|
}), this;
|
|
2994
3272
|
}, a.prototype.unshort = function() {
|
|
2995
|
-
var s = this.segments, r,
|
|
2996
|
-
return this.iterate(function(
|
|
2997
|
-
var
|
|
2998
|
-
f && (
|
|
2999
|
-
|
|
3273
|
+
var s = this.segments, r, l, c, u, g;
|
|
3274
|
+
return this.iterate(function(h, f, v, y) {
|
|
3275
|
+
var T = h[0], L = T.toUpperCase(), P;
|
|
3276
|
+
f && (L === "T" ? (P = T === "t", c = s[f - 1], c[0] === "Q" ? (r = c[1] - v, l = c[2] - y) : c[0] === "q" ? (r = c[1] - c[3], l = c[2] - c[4]) : (r = 0, l = 0), u = -r, g = -l, P || (u += v, g += y), s[f] = [
|
|
3277
|
+
P ? "q" : "Q",
|
|
3000
3278
|
u,
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
]) :
|
|
3005
|
-
|
|
3279
|
+
g,
|
|
3280
|
+
h[1],
|
|
3281
|
+
h[2]
|
|
3282
|
+
]) : L === "S" && (P = T === "s", c = s[f - 1], c[0] === "C" ? (r = c[3] - v, l = c[4] - y) : c[0] === "c" ? (r = c[3] - c[5], l = c[4] - c[6]) : (r = 0, l = 0), u = -r, g = -l, P || (u += v, g += y), s[f] = [
|
|
3283
|
+
P ? "c" : "C",
|
|
3006
3284
|
u,
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3285
|
+
g,
|
|
3286
|
+
h[1],
|
|
3287
|
+
h[2],
|
|
3288
|
+
h[3],
|
|
3289
|
+
h[4]
|
|
3012
3290
|
]));
|
|
3013
3291
|
}), this;
|
|
3014
|
-
},
|
|
3292
|
+
}, Kt = a, Kt;
|
|
3015
3293
|
}
|
|
3016
|
-
var
|
|
3017
|
-
function
|
|
3018
|
-
return
|
|
3294
|
+
var Zt, Ue;
|
|
3295
|
+
function P1() {
|
|
3296
|
+
return Ue || (Ue = 1, Zt = S1()), Zt;
|
|
3019
3297
|
}
|
|
3020
|
-
var
|
|
3021
|
-
const
|
|
3022
|
-
var
|
|
3023
|
-
function
|
|
3298
|
+
var E1 = P1();
|
|
3299
|
+
const I1 = /* @__PURE__ */ A1(E1);
|
|
3300
|
+
var Jt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, k1 = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
3301
|
+
function O1(n) {
|
|
3024
3302
|
var e = [];
|
|
3025
|
-
return n.replace(
|
|
3303
|
+
return n.replace(k1, function(t, o, i) {
|
|
3026
3304
|
var a = o.toLowerCase();
|
|
3027
|
-
for (i =
|
|
3028
|
-
if (i.length ===
|
|
3305
|
+
for (i = N1(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
|
|
3306
|
+
if (i.length === Jt[a])
|
|
3029
3307
|
return i.unshift(o), e.push(i);
|
|
3030
|
-
if (i.length <
|
|
3308
|
+
if (i.length < Jt[a])
|
|
3031
3309
|
throw new Error("malformed path data");
|
|
3032
|
-
e.push([o].concat(i.splice(0,
|
|
3310
|
+
e.push([o].concat(i.splice(0, Jt[a])));
|
|
3033
3311
|
}
|
|
3034
3312
|
}), e;
|
|
3035
3313
|
}
|
|
3036
|
-
var
|
|
3037
|
-
function
|
|
3038
|
-
var e = n.match(
|
|
3314
|
+
var _1 = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
3315
|
+
function N1(n) {
|
|
3316
|
+
var e = n.match(_1);
|
|
3039
3317
|
return e ? e.map(Number) : [];
|
|
3040
3318
|
}
|
|
3041
|
-
function
|
|
3042
|
-
return new
|
|
3319
|
+
function at(n, e, t, o, i, a, s, r) {
|
|
3320
|
+
return new re(n, e, t, o, i, a, s, r);
|
|
3043
3321
|
}
|
|
3044
|
-
function
|
|
3045
|
-
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 =
|
|
3322
|
+
function re(n, e, t, o, i, a, s, r) {
|
|
3323
|
+
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 = U1, this.getPoint = B1, this.getDerivative = F1) : (this.getArcLength = D1, this.getPoint = y0, this.getDerivative = R1), this.init();
|
|
3046
3324
|
}
|
|
3047
|
-
|
|
3048
|
-
constructor:
|
|
3325
|
+
re.prototype = {
|
|
3326
|
+
constructor: re,
|
|
3049
3327
|
init: function() {
|
|
3050
3328
|
this.length = this.getArcLength(
|
|
3051
3329
|
[this.a.x, this.b.x, this.c.x, this.d.x],
|
|
@@ -3056,7 +3334,7 @@ e0.prototype = {
|
|
|
3056
3334
|
return this.length;
|
|
3057
3335
|
},
|
|
3058
3336
|
getPointAtLength: function(n) {
|
|
3059
|
-
var e =
|
|
3337
|
+
var e = Qt(
|
|
3060
3338
|
n,
|
|
3061
3339
|
this.length,
|
|
3062
3340
|
this.getArcLength,
|
|
@@ -3070,7 +3348,7 @@ e0.prototype = {
|
|
|
3070
3348
|
);
|
|
3071
3349
|
},
|
|
3072
3350
|
getTangentAtLength: function(n) {
|
|
3073
|
-
var e =
|
|
3351
|
+
var e = Qt(
|
|
3074
3352
|
n,
|
|
3075
3353
|
this.length,
|
|
3076
3354
|
this.getArcLength,
|
|
@@ -3084,7 +3362,7 @@ e0.prototype = {
|
|
|
3084
3362
|
return o > 0 ? i = { x: t.x / o, y: t.y / o } : i = { x: 0, y: 0 }, i;
|
|
3085
3363
|
},
|
|
3086
3364
|
getPropertiesAtLength: function(n) {
|
|
3087
|
-
var e =
|
|
3365
|
+
var e = Qt(
|
|
3088
3366
|
n,
|
|
3089
3367
|
this.length,
|
|
3090
3368
|
this.getArcLength,
|
|
@@ -3104,46 +3382,46 @@ e0.prototype = {
|
|
|
3104
3382
|
return { x: a.x, y: a.y, tangentX: i.x, tangentY: i.y };
|
|
3105
3383
|
}
|
|
3106
3384
|
};
|
|
3107
|
-
function
|
|
3385
|
+
function R1(n, e, t) {
|
|
3108
3386
|
return {
|
|
3109
3387
|
x: (1 - t) * 2 * (n[1] - n[0]) + t * 2 * (n[2] - n[1]),
|
|
3110
3388
|
y: (1 - t) * 2 * (e[1] - e[0]) + t * 2 * (e[2] - e[1])
|
|
3111
3389
|
};
|
|
3112
3390
|
}
|
|
3113
|
-
function
|
|
3114
|
-
var o =
|
|
3391
|
+
function F1(n, e, t) {
|
|
3392
|
+
var o = y0(
|
|
3115
3393
|
[3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])],
|
|
3116
3394
|
[3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])],
|
|
3117
3395
|
t
|
|
3118
3396
|
);
|
|
3119
3397
|
return o;
|
|
3120
3398
|
}
|
|
3121
|
-
function
|
|
3399
|
+
function Qt(n, e, t, o, i) {
|
|
3122
3400
|
for (var a = 1, s = n / e, r = (n - t(o, i, s)) / e; a > 1e-3; ) {
|
|
3123
|
-
var
|
|
3124
|
-
u < a ? (a = u, s += r) :
|
|
3401
|
+
var l = t(o, i, s + r), c = t(o, i, s - r), u = Math.abs(n - l) / e, g = Math.abs(n - c) / e;
|
|
3402
|
+
u < a ? (a = u, s += r) : g < a ? (a = g, s -= r) : r /= 2;
|
|
3125
3403
|
}
|
|
3126
3404
|
return s;
|
|
3127
3405
|
}
|
|
3128
|
-
function
|
|
3406
|
+
function y0(n, e, t) {
|
|
3129
3407
|
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];
|
|
3130
3408
|
return { x: o, y: i };
|
|
3131
3409
|
}
|
|
3132
|
-
function
|
|
3410
|
+
function B1(n, e, t) {
|
|
3133
3411
|
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];
|
|
3134
3412
|
return { x: o, y: i };
|
|
3135
3413
|
}
|
|
3136
|
-
function
|
|
3414
|
+
function D1(n, e, t) {
|
|
3137
3415
|
t === void 0 && (t = 1);
|
|
3138
|
-
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),
|
|
3416
|
+
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), l = 4 * (o * a + i * s), c = a * a + s * s;
|
|
3139
3417
|
if (r === 0)
|
|
3140
3418
|
return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
3141
|
-
var u =
|
|
3142
|
-
return Math.sqrt(r) / 2 * (
|
|
3143
|
-
(
|
|
3419
|
+
var u = l / (2 * r), g = c / r, h = t + u, f = g - u * u;
|
|
3420
|
+
return Math.sqrt(r) / 2 * (h * Math.sqrt(h * h + f) - u * Math.sqrt(u * u + f) + f * Math.log(Math.abs(
|
|
3421
|
+
(h + Math.sqrt(h * h + f)) / (u + Math.sqrt(u * u + f))
|
|
3144
3422
|
)));
|
|
3145
3423
|
}
|
|
3146
|
-
var
|
|
3424
|
+
var q1 = [
|
|
3147
3425
|
[],
|
|
3148
3426
|
[],
|
|
3149
3427
|
[-0.5773502691896257, 0.5773502691896257],
|
|
@@ -3169,7 +3447,7 @@ var cn = [
|
|
|
3169
3447
|
[-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],
|
|
3170
3448
|
[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],
|
|
3171
3449
|
[-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]
|
|
3172
|
-
],
|
|
3450
|
+
], z1 = [
|
|
3173
3451
|
[],
|
|
3174
3452
|
[],
|
|
3175
3453
|
[1, 1],
|
|
@@ -3195,86 +3473,86 @@ var cn = [
|
|
|
3195
3473
|
[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],
|
|
3196
3474
|
[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],
|
|
3197
3475
|
[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]
|
|
3198
|
-
],
|
|
3199
|
-
function
|
|
3200
|
-
return
|
|
3476
|
+
], V1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
|
|
3477
|
+
function j1(n, e) {
|
|
3478
|
+
return V1[n][e];
|
|
3201
3479
|
}
|
|
3202
|
-
function
|
|
3480
|
+
function oe(n, e, t) {
|
|
3203
3481
|
var o = t.length - 1, i, a, s;
|
|
3204
3482
|
if (o === 0)
|
|
3205
3483
|
return 0;
|
|
3206
3484
|
if (n === 0) {
|
|
3207
3485
|
for (a = 0, s = 0; s <= o; s++)
|
|
3208
|
-
a +=
|
|
3486
|
+
a += j1(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
3209
3487
|
return a;
|
|
3210
3488
|
} else {
|
|
3211
3489
|
for (i = new Array(o), s = 0; s < o; s++)
|
|
3212
3490
|
i[s] = o * (t[s + 1] - t[s]);
|
|
3213
|
-
return
|
|
3491
|
+
return oe(n - 1, e, i);
|
|
3214
3492
|
}
|
|
3215
3493
|
}
|
|
3216
|
-
function
|
|
3217
|
-
var o =
|
|
3494
|
+
function H1(n, e, t) {
|
|
3495
|
+
var o = oe(1, t, n), i = oe(1, t, e), a = o * o + i * i;
|
|
3218
3496
|
return Math.sqrt(a);
|
|
3219
3497
|
}
|
|
3220
|
-
function
|
|
3498
|
+
function U1(n, e, t) {
|
|
3221
3499
|
var o, i, a, s;
|
|
3222
3500
|
t === void 0 && (t = 1);
|
|
3223
3501
|
var r = 20;
|
|
3224
3502
|
for (o = t / 2, i = 0, a = 0; a < r; a++)
|
|
3225
|
-
s = o *
|
|
3503
|
+
s = o * q1[r][a] + o, i += z1[r][a] * H1(n, e, s);
|
|
3226
3504
|
return o * i;
|
|
3227
3505
|
}
|
|
3228
3506
|
var Et = Math.PI * 2;
|
|
3229
|
-
function
|
|
3507
|
+
function $e(n, e, t, o) {
|
|
3230
3508
|
var i = n * o - e * t < 0 ? -1 : 1, a = n * t + e * o;
|
|
3231
3509
|
return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
|
|
3232
3510
|
}
|
|
3233
|
-
function
|
|
3234
|
-
var u = c * (n - t) / 2 +
|
|
3235
|
-
|
|
3236
|
-
var
|
|
3237
|
-
return a === 0 && U > 0 && (U -= Et), a === 1 && U < 0 && (U += Et), [
|
|
3511
|
+
function $1(n, e, t, o, i, a, s, r, l, c) {
|
|
3512
|
+
var u = c * (n - t) / 2 + l * (e - o) / 2, g = -l * (n - t) / 2 + c * (e - o) / 2, h = s * s, f = r * r, v = u * u, y = g * g, T = h * f - h * y - f * v;
|
|
3513
|
+
T < 0 && (T = 0), T /= h * y + f * v, T = Math.sqrt(T) * (i === a ? -1 : 1);
|
|
3514
|
+
var L = T * s / r * g, P = T * -r / s * u, S = c * L - l * P + (n + t) / 2, E = l * L + c * P + (e + o) / 2, M = (u - L) / s, I = (g - P) / r, F = (-u - L) / s, Y = (-g - P) / r, z = $e(1, 0, M, I), U = $e(M, I, F, Y);
|
|
3515
|
+
return a === 0 && U > 0 && (U -= Et), a === 1 && U < 0 && (U += Et), [S, E, z, U];
|
|
3238
3516
|
}
|
|
3239
|
-
function
|
|
3517
|
+
function W1(n, e) {
|
|
3240
3518
|
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);
|
|
3241
3519
|
return [o, i, o - i * t, i + o * t, a + s * t, s - a * t, a, s];
|
|
3242
3520
|
}
|
|
3243
|
-
function
|
|
3244
|
-
var c = Math.sin(i * Et / 360), u = Math.cos(i * Et / 360),
|
|
3245
|
-
if (
|
|
3521
|
+
function Y1(n, e, t, o, i, a, s, r, l) {
|
|
3522
|
+
var c = Math.sin(i * Et / 360), u = Math.cos(i * Et / 360), g = u * (n - r) / 2 + c * (e - l) / 2, h = -c * (n - r) / 2 + u * (e - l) / 2;
|
|
3523
|
+
if (g === 0 && h === 0)
|
|
3246
3524
|
return [];
|
|
3247
3525
|
if (t === 0 || o === 0)
|
|
3248
3526
|
return [];
|
|
3249
3527
|
t = Math.abs(t), o = Math.abs(o);
|
|
3250
|
-
var f =
|
|
3528
|
+
var f = g * g / (t * t) + h * h / (o * o);
|
|
3251
3529
|
f > 1 && (t *= Math.sqrt(f), o *= Math.sqrt(f));
|
|
3252
|
-
var v =
|
|
3253
|
-
|
|
3254
|
-
for (var
|
|
3255
|
-
y.push(
|
|
3530
|
+
var v = $1(n, e, r, l, a, s, t, o, c, u), y = [], T = v[2], L = v[3], P = Math.max(Math.ceil(Math.abs(L) / (Et / 4)), 1);
|
|
3531
|
+
L /= P;
|
|
3532
|
+
for (var S = 0; S < P; S++)
|
|
3533
|
+
y.push(W1(T, L)), T += L;
|
|
3256
3534
|
return y.map(function(E) {
|
|
3257
|
-
for (var
|
|
3258
|
-
var I = E[
|
|
3535
|
+
for (var M = 0; M < E.length; M += 2) {
|
|
3536
|
+
var I = E[M + 0], F = E[M + 1];
|
|
3259
3537
|
I *= t, F *= o;
|
|
3260
|
-
var
|
|
3261
|
-
E[
|
|
3538
|
+
var Y = u * I - c * F, z = c * I + u * F;
|
|
3539
|
+
E[M + 0] = Y + v[0], E[M + 1] = z + v[1];
|
|
3262
3540
|
}
|
|
3263
3541
|
return E;
|
|
3264
3542
|
});
|
|
3265
3543
|
}
|
|
3266
|
-
function
|
|
3267
|
-
return new
|
|
3544
|
+
function We(n, e, t, o, i, a, s, r, l) {
|
|
3545
|
+
return new se(n, e, t, o, i, a, s, r, l);
|
|
3268
3546
|
}
|
|
3269
|
-
function
|
|
3270
|
-
var c = 0, u = [],
|
|
3271
|
-
|
|
3272
|
-
var v = new
|
|
3273
|
-
c += y, u.push(y),
|
|
3274
|
-
}), this.length = c, this.partialLengths = u, this.curves =
|
|
3547
|
+
function se(n, e, t, o, i, a, s, r, l) {
|
|
3548
|
+
var c = 0, u = [], g = [], h = Y1(n, e, t, o, i, a, s, r, l);
|
|
3549
|
+
h.forEach(function(f) {
|
|
3550
|
+
var v = new at(f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]), y = v.getTotalLength();
|
|
3551
|
+
c += y, u.push(y), g.push(v);
|
|
3552
|
+
}), this.length = c, this.partialLengths = u, this.curves = g;
|
|
3275
3553
|
}
|
|
3276
|
-
|
|
3277
|
-
constructor:
|
|
3554
|
+
se.prototype = {
|
|
3555
|
+
constructor: se,
|
|
3278
3556
|
init: function() {
|
|
3279
3557
|
},
|
|
3280
3558
|
getTotalLength: function() {
|
|
@@ -3303,7 +3581,7 @@ r0.prototype = {
|
|
|
3303
3581
|
return { x: t.x, y: t.y, tangentX: e.x, tangentY: e.y };
|
|
3304
3582
|
}
|
|
3305
3583
|
};
|
|
3306
|
-
function
|
|
3584
|
+
function st(n, e, t, o) {
|
|
3307
3585
|
return new _t(n, e, t, o);
|
|
3308
3586
|
}
|
|
3309
3587
|
function _t(n, e, t, o) {
|
|
@@ -3324,13 +3602,13 @@ _t.prototype.getPropertiesAtLength = function(n) {
|
|
|
3324
3602
|
var e = this.getPointAtLength(n), t = this.getTangentAtLength();
|
|
3325
3603
|
return { x: e.x, y: e.y, tangentX: t.x, tangentY: t.y };
|
|
3326
3604
|
};
|
|
3327
|
-
function
|
|
3605
|
+
function G1(n) {
|
|
3328
3606
|
var e = 0, t = [], o = [];
|
|
3329
3607
|
function i(s) {
|
|
3330
3608
|
if (!s)
|
|
3331
3609
|
return null;
|
|
3332
|
-
for (var r =
|
|
3333
|
-
r[
|
|
3610
|
+
for (var r = O1(s), l = [0, 0], c = [0, 0], u, g, h = 0; h < r.length; h++)
|
|
3611
|
+
r[h][0] === "M" ? (l = [r[h][1], r[h][2]], g = [l[0], l[1]], o.push(null)) : r[h][0] === "m" ? (l = [r[h][1] + l[0], r[h][2] + l[1]], g = [l[0], l[1]], o.push(null)) : r[h][0] === "L" ? (e = e + Math.sqrt(Math.pow(l[0] - r[h][1], 2) + Math.pow(l[1] - r[h][2], 2)), o.push(new st(l[0], r[h][1], l[1], r[h][2])), l = [r[h][1], r[h][2]]) : r[h][0] === "l" ? (e = e + Math.sqrt(Math.pow(r[h][1], 2) + Math.pow(r[h][2], 2)), o.push(new st(l[0], r[h][1] + l[0], l[1], r[h][2] + l[1])), l = [r[h][1] + l[0], r[h][2] + l[1]]) : r[h][0] === "H" ? (e = e + Math.abs(l[0] - r[h][1]), o.push(new st(l[0], r[h][1], l[1], l[1])), l[0] = r[h][1]) : r[h][0] === "h" ? (e = e + Math.abs(r[h][1]), o.push(new st(l[0], l[0] + r[h][1], l[1], l[1])), l[0] = r[h][1] + l[0]) : r[h][0] === "V" ? (e = e + Math.abs(l[1] - r[h][1]), o.push(new st(l[0], l[0], l[1], r[h][1])), l[1] = r[h][1]) : r[h][0] === "v" ? (e = e + Math.abs(r[h][1]), o.push(new st(l[0], l[0], l[1], l[1] + r[h][1])), l[1] = r[h][1] + l[1]) : r[h][0] === "z" || r[h][0] === "Z" ? (e = e + Math.sqrt(Math.pow(g[0] - l[0], 2) + Math.pow(g[1] - l[1], 2)), o.push(new st(l[0], g[0], l[1], g[1])), l = [g[0], g[1]]) : r[h][0] === "C" ? (u = new at(l[0], l[1], r[h][1], r[h][2], r[h][3], r[h][4], r[h][5], r[h][6]), e = e + u.getTotalLength(), l = [r[h][5], r[h][6]], o.push(u)) : r[h][0] === "c" ? (u = new at(l[0], l[1], l[0] + r[h][1], l[1] + r[h][2], l[0] + r[h][3], l[1] + r[h][4], l[0] + r[h][5], l[1] + r[h][6]), e = e + u.getTotalLength(), l = [r[h][5] + l[0], r[h][6] + l[1]], o.push(u)) : r[h][0] === "S" ? (h > 0 && ["C", "c", "S", "s"].indexOf(r[h - 1][0]) > -1 ? u = new at(l[0], l[1], 2 * l[0] - r[h - 1][r[h - 1].length - 4], 2 * l[1] - r[h - 1][r[h - 1].length - 3], r[h][1], r[h][2], r[h][3], r[h][4]) : u = new at(l[0], l[1], l[0], l[1], r[h][1], r[h][2], r[h][3], r[h][4]), e = e + u.getTotalLength(), l = [r[h][3], r[h][4]], o.push(u)) : r[h][0] === "s" ? (h > 0 && ["C", "c", "S", "s"].indexOf(r[h - 1][0]) > -1 ? u = new at(l[0], l[1], l[0] + u.d.x - u.c.x, l[1] + u.d.y - u.c.y, l[0] + r[h][1], l[1] + r[h][2], l[0] + r[h][3], l[1] + r[h][4]) : u = new at(l[0], l[1], l[0], l[1], l[0] + r[h][1], l[1] + r[h][2], l[0] + r[h][3], l[1] + r[h][4]), e = e + u.getTotalLength(), l = [r[h][3] + l[0], r[h][4] + l[1]], o.push(u)) : r[h][0] === "Q" ? (l[0] != r[h][1] && l[1] != r[h][2] ? u = new at(l[0], l[1], r[h][1], r[h][2], r[h][3], r[h][4]) : u = new st(r[h][1], r[h][3], r[h][2], r[h][4]), e = e + u.getTotalLength(), o.push(u), l = [r[h][3], r[h][4]], c = [r[h][1], r[h][2]]) : r[h][0] === "q" ? (r[h][1] == 0 && r[h][2] == 0 ? u = new st(l[0] + r[h][1], l[0] + r[h][3], l[1] + r[h][2], l[1] + r[h][4]) : u = new at(l[0], l[1], l[0] + r[h][1], l[1] + r[h][2], l[0] + r[h][3], l[1] + r[h][4]), e = e + u.getTotalLength(), c = [l[0] + r[h][1], l[1] + r[h][2]], l = [r[h][3] + l[0], r[h][4] + l[1]], o.push(u)) : r[h][0] === "T" ? (h > 0 && ["Q", "q", "T", "t"].indexOf(r[h - 1][0]) > -1 ? u = new at(l[0], l[1], 2 * l[0] - c[0], 2 * l[1] - c[1], r[h][1], r[h][2]) : u = new st(l[0], r[h][1], l[1], r[h][2]), o.push(u), e = e + u.getTotalLength(), c = [2 * l[0] - c[0], 2 * l[1] - c[1]], l = [r[h][1], r[h][2]]) : r[h][0] === "t" ? (h > 0 && ["Q", "q", "T", "t"].indexOf(r[h - 1][0]) > -1 ? u = new at(l[0], l[1], 2 * l[0] - c[0], 2 * l[1] - c[1], l[0] + r[h][1], l[1] + r[h][2]) : u = new st(l[0], l[0] + r[h][1], l[1], l[1] + r[h][2]), e = e + u.getTotalLength(), c = [2 * l[0] - c[0], 2 * l[1] - c[1]], l = [r[h][1] + l[0], r[h][2] + l[0]], o.push(u)) : r[h][0] === "A" ? (u = new We(l[0], l[1], r[h][1], r[h][2], r[h][3], r[h][4], r[h][5], r[h][6], r[h][7]), e = e + u.getTotalLength(), l = [r[h][6], r[h][7]], o.push(u)) : r[h][0] === "a" && (u = new We(l[0], l[1], r[h][1], r[h][2], r[h][3], r[h][4], r[h][5], l[0] + r[h][6], l[1] + r[h][7]), e = e + u.getTotalLength(), l = [l[0] + r[h][6], l[1] + r[h][7]], o.push(u)), t.push(e);
|
|
3334
3612
|
return i;
|
|
3335
3613
|
}
|
|
3336
3614
|
i.getTotalLength = function() {
|
|
@@ -3353,49 +3631,49 @@ function wn(n) {
|
|
|
3353
3631
|
};
|
|
3354
3632
|
return i(n);
|
|
3355
3633
|
}
|
|
3356
|
-
function
|
|
3634
|
+
function qt(n, e) {
|
|
3357
3635
|
return Math.sqrt((n[0] - e[0]) * (n[0] - e[0]) + (n[1] - e[1]) * (n[1] - e[1]));
|
|
3358
3636
|
}
|
|
3359
|
-
function
|
|
3637
|
+
function v0(n, e, t) {
|
|
3360
3638
|
return [n[0] + (e[0] - n[0]) * t, n[1] + (e[1] - n[1]) * t];
|
|
3361
3639
|
}
|
|
3362
|
-
function
|
|
3363
|
-
return
|
|
3640
|
+
function X1(n, e) {
|
|
3641
|
+
return qt(n, e) < 1e-9;
|
|
3364
3642
|
}
|
|
3365
|
-
function
|
|
3366
|
-
let o = n.map((i, a) =>
|
|
3643
|
+
function K1(n, e, t) {
|
|
3644
|
+
let o = n.map((i, a) => Z1(i, e[a]));
|
|
3367
3645
|
return function(i) {
|
|
3368
3646
|
let a = o.map((s) => s(i));
|
|
3369
|
-
return t ?
|
|
3647
|
+
return t ? ti(a) : a;
|
|
3370
3648
|
};
|
|
3371
3649
|
}
|
|
3372
|
-
function
|
|
3650
|
+
function Z1(n, e) {
|
|
3373
3651
|
return function(t) {
|
|
3374
3652
|
return n.map((o, i) => o + t * (e[i] - o));
|
|
3375
3653
|
};
|
|
3376
3654
|
}
|
|
3377
|
-
function
|
|
3655
|
+
function Bt(n) {
|
|
3378
3656
|
return typeof n == "number" && isFinite(n);
|
|
3379
3657
|
}
|
|
3380
|
-
const
|
|
3658
|
+
const ae = `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).
|
|
3381
3659
|
Example valid ways of supplying a shape would be:
|
|
3382
3660
|
[[0, 0], [10, 0], [10, 10]]
|
|
3383
3661
|
"M0,0 L10,0 L10,10Z"
|
|
3384
3662
|
`;
|
|
3385
|
-
function
|
|
3386
|
-
return new
|
|
3663
|
+
function J1(n) {
|
|
3664
|
+
return new I1(n).abs();
|
|
3387
3665
|
}
|
|
3388
|
-
function
|
|
3666
|
+
function Q1(n) {
|
|
3389
3667
|
return n.toString().split("M").map((e, t) => (e = e.trim(), t && e ? "M" + e : e)).filter((e) => e);
|
|
3390
3668
|
}
|
|
3391
|
-
function
|
|
3669
|
+
function ti(n) {
|
|
3392
3670
|
return "M" + n.join("L") + "Z";
|
|
3393
3671
|
}
|
|
3394
|
-
function
|
|
3395
|
-
let t =
|
|
3396
|
-
return
|
|
3672
|
+
function ei(n, e) {
|
|
3673
|
+
let t = J1(n);
|
|
3674
|
+
return ni(t) || ii(t, e);
|
|
3397
3675
|
}
|
|
3398
|
-
function
|
|
3676
|
+
function ni(n) {
|
|
3399
3677
|
let e = n.segments || [], t = [];
|
|
3400
3678
|
if (!e.length || e[0][0] !== "M")
|
|
3401
3679
|
return !1;
|
|
@@ -3414,202 +3692,202 @@ function Pn(n) {
|
|
|
3414
3692
|
}
|
|
3415
3693
|
return t.length ? { ring: t } : !1;
|
|
3416
3694
|
}
|
|
3417
|
-
function
|
|
3418
|
-
let t =
|
|
3695
|
+
function ii(n, e) {
|
|
3696
|
+
let t = Q1(n)[0], o = [], i, a, s = 3;
|
|
3419
3697
|
if (!t)
|
|
3420
|
-
throw new TypeError(
|
|
3421
|
-
a =
|
|
3698
|
+
throw new TypeError(ae);
|
|
3699
|
+
a = ri(t), i = a.getTotalLength(), e && Bt(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
|
|
3422
3700
|
for (let r = 0; r < s; r++) {
|
|
3423
|
-
let
|
|
3424
|
-
o.push([
|
|
3701
|
+
let l = a.getPointAtLength(i * r / s);
|
|
3702
|
+
o.push([l.x, l.y]);
|
|
3425
3703
|
}
|
|
3426
3704
|
return {
|
|
3427
3705
|
ring: o,
|
|
3428
3706
|
skipBisect: !0
|
|
3429
3707
|
};
|
|
3430
3708
|
}
|
|
3431
|
-
function
|
|
3709
|
+
function ri(n) {
|
|
3432
3710
|
if (typeof window < "u" && window && window.document)
|
|
3433
3711
|
try {
|
|
3434
3712
|
let e = window.document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3435
3713
|
return e.setAttributeNS(null, "d", n), e;
|
|
3436
3714
|
} catch {
|
|
3437
3715
|
}
|
|
3438
|
-
return
|
|
3716
|
+
return G1(n);
|
|
3439
3717
|
}
|
|
3440
|
-
function
|
|
3441
|
-
const t = n.length + e, o =
|
|
3718
|
+
function Ye(n, e) {
|
|
3719
|
+
const t = n.length + e, o = b1(n) / e;
|
|
3442
3720
|
let i = 0, a = 0, s = o / 2;
|
|
3443
3721
|
for (; n.length < t; ) {
|
|
3444
|
-
let r = n[i],
|
|
3722
|
+
let r = n[i], l = n[(i + 1) % n.length], c = qt(r, l);
|
|
3445
3723
|
if (s <= a + c) {
|
|
3446
|
-
n.splice(i + 1, 0, c ?
|
|
3724
|
+
n.splice(i + 1, 0, c ? v0(r, l, (s - a) / c) : r.slice(0)), s += o;
|
|
3447
3725
|
continue;
|
|
3448
3726
|
}
|
|
3449
3727
|
a += c, i++;
|
|
3450
3728
|
}
|
|
3451
3729
|
}
|
|
3452
|
-
function
|
|
3730
|
+
function oi(n, e = 1 / 0) {
|
|
3453
3731
|
for (let t = 0; t < n.length; t++) {
|
|
3454
3732
|
let o = n[t], i = t === n.length - 1 ? n[0] : n[t + 1];
|
|
3455
|
-
for (;
|
|
3456
|
-
i =
|
|
3733
|
+
for (; qt(o, i) > e; )
|
|
3734
|
+
i = v0(o, i, 0.5), n.splice(t + 1, 0, i);
|
|
3457
3735
|
}
|
|
3458
3736
|
}
|
|
3459
|
-
function
|
|
3737
|
+
function Ge(n, e) {
|
|
3460
3738
|
let t, o, i;
|
|
3461
3739
|
if (typeof n == "string") {
|
|
3462
|
-
let a =
|
|
3740
|
+
let a = ei(n, e);
|
|
3463
3741
|
n = a.ring, i = a.skipBisect;
|
|
3464
3742
|
} else if (!Array.isArray(n))
|
|
3465
|
-
throw new TypeError(
|
|
3466
|
-
if (t = n.slice(0), !
|
|
3467
|
-
throw new TypeError(
|
|
3468
|
-
return t.length > 1 &&
|
|
3743
|
+
throw new TypeError(ae);
|
|
3744
|
+
if (t = n.slice(0), !si(t))
|
|
3745
|
+
throw new TypeError(ae);
|
|
3746
|
+
return t.length > 1 && X1(t[0], t[t.length - 1]) && t.pop(), o = m1(t), o > 0 && t.reverse(), !i && e && Bt(e) && e > 0 && oi(t, e), t;
|
|
3469
3747
|
}
|
|
3470
|
-
function
|
|
3748
|
+
function si(n) {
|
|
3471
3749
|
return n.every(function(e) {
|
|
3472
|
-
return Array.isArray(e) && e.length >= 2 &&
|
|
3750
|
+
return Array.isArray(e) && e.length >= 2 && Bt(e[0]) && Bt(e[1]);
|
|
3473
3751
|
});
|
|
3474
3752
|
}
|
|
3475
|
-
function
|
|
3753
|
+
function ai(n, e) {
|
|
3476
3754
|
let t = n.length, o = 1 / 0, i, a, s;
|
|
3477
3755
|
for (let r = 0; r < t; r++)
|
|
3478
|
-
a = 0, e.forEach(function(
|
|
3479
|
-
let u =
|
|
3756
|
+
a = 0, e.forEach(function(l, c) {
|
|
3757
|
+
let u = qt(n[(r + c) % t], l);
|
|
3480
3758
|
a += u * u;
|
|
3481
3759
|
}), a < o && (o = a, i = r);
|
|
3482
3760
|
i && (s = n.splice(0, i), n.splice(n.length, 0, ...s));
|
|
3483
3761
|
}
|
|
3484
|
-
function
|
|
3485
|
-
let i =
|
|
3762
|
+
function li(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
|
|
3763
|
+
let i = Ge(n, t), a = Ge(e, t), s = hi(i, a, o);
|
|
3486
3764
|
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);
|
|
3487
3765
|
}
|
|
3488
|
-
function
|
|
3766
|
+
function hi(n, e, t) {
|
|
3489
3767
|
let o;
|
|
3490
|
-
return o = n.length - e.length,
|
|
3768
|
+
return o = n.length - e.length, Ye(n, o < 0 ? o * -1 : 0), Ye(e, o > 0 ? o : 0), ai(n, e), K1(n, e, t);
|
|
3491
3769
|
}
|
|
3492
|
-
var
|
|
3493
|
-
function
|
|
3494
|
-
if (
|
|
3495
|
-
|
|
3496
|
-
function n(
|
|
3770
|
+
var Nt = { exports: {} }, Xe;
|
|
3771
|
+
function ci() {
|
|
3772
|
+
if (Xe) return Nt.exports;
|
|
3773
|
+
Xe = 1, Nt.exports = n, Nt.exports.default = n;
|
|
3774
|
+
function n(d, x, p) {
|
|
3497
3775
|
p = p || 2;
|
|
3498
|
-
var w = x && x.length, m = w ? x[0] * p :
|
|
3776
|
+
var w = x && x.length, m = w ? x[0] * p : d.length, b = e(d, 0, m, p, !0), A = [];
|
|
3499
3777
|
if (!b || b.next === b.prev) return A;
|
|
3500
|
-
var C, N,
|
|
3501
|
-
if (w && (b =
|
|
3502
|
-
C =
|
|
3503
|
-
for (var
|
|
3504
|
-
|
|
3505
|
-
|
|
3778
|
+
var C, N, O, W, j, B, X;
|
|
3779
|
+
if (w && (b = l(d, x, b, p)), d.length > 80 * p) {
|
|
3780
|
+
C = O = d[0], N = W = d[1];
|
|
3781
|
+
for (var H = p; H < m; H += p)
|
|
3782
|
+
j = d[H], B = d[H + 1], j < C && (C = j), B < N && (N = B), j > O && (O = j), B > W && (W = B);
|
|
3783
|
+
X = Math.max(O - C, W - N), X = X !== 0 ? 32767 / X : 0;
|
|
3506
3784
|
}
|
|
3507
|
-
return o(b, A, p, C, N,
|
|
3785
|
+
return o(b, A, p, C, N, X, 0), A;
|
|
3508
3786
|
}
|
|
3509
|
-
function e(
|
|
3787
|
+
function e(d, x, p, w, m) {
|
|
3510
3788
|
var b, A;
|
|
3511
|
-
if (m ===
|
|
3512
|
-
for (b = x; b < p; b += w) A =
|
|
3789
|
+
if (m === zt(d, x, p, w) > 0)
|
|
3790
|
+
for (b = x; b < p; b += w) A = rt(b, d[b], d[b + 1], A);
|
|
3513
3791
|
else
|
|
3514
|
-
for (b = p - w; b >= x; b -= w) A =
|
|
3515
|
-
return A && E(A, A.next) && (
|
|
3792
|
+
for (b = p - w; b >= x; b -= w) A = rt(b, d[b], d[b + 1], A);
|
|
3793
|
+
return A && E(A, A.next) && (ot(A), A = A.next), A;
|
|
3516
3794
|
}
|
|
3517
|
-
function t(
|
|
3518
|
-
if (!
|
|
3519
|
-
x || (x =
|
|
3520
|
-
var p =
|
|
3795
|
+
function t(d, x) {
|
|
3796
|
+
if (!d) return d;
|
|
3797
|
+
x || (x = d);
|
|
3798
|
+
var p = d, w;
|
|
3521
3799
|
do
|
|
3522
|
-
if (w = !1, !p.steiner && (E(p, p.next) ||
|
|
3523
|
-
if (
|
|
3800
|
+
if (w = !1, !p.steiner && (E(p, p.next) || S(p.prev, p, p.next) === 0)) {
|
|
3801
|
+
if (ot(p), p = x = p.prev, p === p.next) break;
|
|
3524
3802
|
w = !0;
|
|
3525
3803
|
} else
|
|
3526
3804
|
p = p.next;
|
|
3527
3805
|
while (w || p !== x);
|
|
3528
3806
|
return x;
|
|
3529
3807
|
}
|
|
3530
|
-
function o(
|
|
3531
|
-
if (
|
|
3532
|
-
!A && b && f(
|
|
3533
|
-
for (var C =
|
|
3534
|
-
if (N =
|
|
3535
|
-
x.push(N.i / p | 0), x.push(
|
|
3808
|
+
function o(d, x, p, w, m, b, A) {
|
|
3809
|
+
if (d) {
|
|
3810
|
+
!A && b && f(d, w, m, b);
|
|
3811
|
+
for (var C = d, N, O; d.prev !== d.next; ) {
|
|
3812
|
+
if (N = d.prev, O = d.next, b ? a(d, w, m, b) : i(d)) {
|
|
3813
|
+
x.push(N.i / p | 0), x.push(d.i / p | 0), x.push(O.i / p | 0), ot(d), d = O.next, C = O.next;
|
|
3536
3814
|
continue;
|
|
3537
3815
|
}
|
|
3538
|
-
if (
|
|
3539
|
-
A ? A === 1 ? (
|
|
3816
|
+
if (d = O, d === C) {
|
|
3817
|
+
A ? A === 1 ? (d = s(t(d), x, p), o(d, x, p, w, m, b, 2)) : A === 2 && r(d, x, p, w, m, b) : o(t(d), x, p, w, m, b, 1);
|
|
3540
3818
|
break;
|
|
3541
3819
|
}
|
|
3542
3820
|
}
|
|
3543
3821
|
}
|
|
3544
3822
|
}
|
|
3545
|
-
function i(
|
|
3546
|
-
var x =
|
|
3547
|
-
if (
|
|
3548
|
-
for (var m = x.x, b = p.x, A = w.x, C = x.y, N = p.y,
|
|
3549
|
-
if (
|
|
3550
|
-
|
|
3823
|
+
function i(d) {
|
|
3824
|
+
var x = d.prev, p = d, w = d.next;
|
|
3825
|
+
if (S(x, p, w) >= 0) return !1;
|
|
3826
|
+
for (var m = x.x, b = p.x, A = w.x, C = x.y, N = p.y, O = w.y, W = m < b ? m < A ? m : A : b < A ? b : A, j = C < N ? C < O ? C : O : N < O ? N : O, B = m > b ? m > A ? m : A : b > A ? b : A, X = C > N ? C > O ? C : O : N > O ? N : O, H = w.next; H !== x; ) {
|
|
3827
|
+
if (H.x >= W && H.x <= B && H.y >= j && H.y <= X && L(m, C, b, N, A, O, H.x, H.y) && S(H.prev, H, H.next) >= 0) return !1;
|
|
3828
|
+
H = H.next;
|
|
3551
3829
|
}
|
|
3552
3830
|
return !0;
|
|
3553
3831
|
}
|
|
3554
|
-
function a(
|
|
3555
|
-
var m =
|
|
3556
|
-
if (
|
|
3557
|
-
for (var C = m.x, N = b.x,
|
|
3558
|
-
if (D.x >=
|
|
3832
|
+
function a(d, x, p, w) {
|
|
3833
|
+
var m = d.prev, b = d, A = d.next;
|
|
3834
|
+
if (S(m, b, A) >= 0) return !1;
|
|
3835
|
+
for (var C = m.x, N = b.x, O = A.x, W = m.y, j = b.y, B = A.y, X = C < N ? C < O ? C : O : N < O ? N : O, H = W < j ? W < B ? W : B : j < B ? j : B, Ct = C > N ? C > O ? C : O : N > O ? N : O, St = W > j ? W > B ? W : B : j > B ? j : B, ye = y(X, H, x, p, w), ve = y(Ct, St, x, p, w), D = d.prevZ, q = d.nextZ; D && D.z >= ye && q && q.z <= ve; ) {
|
|
3836
|
+
if (D.x >= X && D.x <= Ct && D.y >= H && D.y <= St && D !== m && D !== A && L(C, W, N, j, O, B, D.x, D.y) && S(D.prev, D, D.next) >= 0 || (D = D.prevZ, q.x >= X && q.x <= Ct && q.y >= H && q.y <= St && q !== m && q !== A && L(C, W, N, j, O, B, q.x, q.y) && S(q.prev, q, q.next) >= 0)) return !1;
|
|
3559
3837
|
q = q.nextZ;
|
|
3560
3838
|
}
|
|
3561
|
-
for (; D && D.z >=
|
|
3562
|
-
if (D.x >=
|
|
3839
|
+
for (; D && D.z >= ye; ) {
|
|
3840
|
+
if (D.x >= X && D.x <= Ct && D.y >= H && D.y <= St && D !== m && D !== A && L(C, W, N, j, O, B, D.x, D.y) && S(D.prev, D, D.next) >= 0) return !1;
|
|
3563
3841
|
D = D.prevZ;
|
|
3564
3842
|
}
|
|
3565
|
-
for (; q && q.z <=
|
|
3566
|
-
if (q.x >=
|
|
3843
|
+
for (; q && q.z <= ve; ) {
|
|
3844
|
+
if (q.x >= X && q.x <= Ct && q.y >= H && q.y <= St && q !== m && q !== A && L(C, W, N, j, O, B, q.x, q.y) && S(q.prev, q, q.next) >= 0) return !1;
|
|
3567
3845
|
q = q.nextZ;
|
|
3568
3846
|
}
|
|
3569
3847
|
return !0;
|
|
3570
3848
|
}
|
|
3571
|
-
function s(
|
|
3572
|
-
var w =
|
|
3849
|
+
function s(d, x, p) {
|
|
3850
|
+
var w = d;
|
|
3573
3851
|
do {
|
|
3574
3852
|
var m = w.prev, b = w.next.next;
|
|
3575
|
-
!E(m, b) &&
|
|
3576
|
-
} while (w !==
|
|
3853
|
+
!E(m, b) && M(m, w, w.next, b) && z(m, b) && z(b, m) && (x.push(m.i / p | 0), x.push(w.i / p | 0), x.push(b.i / p | 0), ot(w), ot(w.next), w = d = b), w = w.next;
|
|
3854
|
+
} while (w !== d);
|
|
3577
3855
|
return t(w);
|
|
3578
3856
|
}
|
|
3579
|
-
function r(
|
|
3580
|
-
var A =
|
|
3857
|
+
function r(d, x, p, w, m, b) {
|
|
3858
|
+
var A = d;
|
|
3581
3859
|
do {
|
|
3582
3860
|
for (var C = A.next.next; C !== A.prev; ) {
|
|
3583
|
-
if (A.i !== C.i &&
|
|
3584
|
-
var N =
|
|
3861
|
+
if (A.i !== C.i && P(A, C)) {
|
|
3862
|
+
var N = it(A, C);
|
|
3585
3863
|
A = t(A, A.next), N = t(N, N.next), o(A, x, p, w, m, b, 0), o(N, x, p, w, m, b, 0);
|
|
3586
3864
|
return;
|
|
3587
3865
|
}
|
|
3588
3866
|
C = C.next;
|
|
3589
3867
|
}
|
|
3590
3868
|
A = A.next;
|
|
3591
|
-
} while (A !==
|
|
3869
|
+
} while (A !== d);
|
|
3592
3870
|
}
|
|
3593
|
-
function
|
|
3594
|
-
var m = [], b, A, C, N,
|
|
3871
|
+
function l(d, x, p, w) {
|
|
3872
|
+
var m = [], b, A, C, N, O;
|
|
3595
3873
|
for (b = 0, A = x.length; b < A; b++)
|
|
3596
|
-
C = x[b] * w, N = b < A - 1 ? x[b + 1] * w :
|
|
3874
|
+
C = x[b] * w, N = b < A - 1 ? x[b + 1] * w : d.length, O = e(d, C, N, w, !1), O === O.next && (O.steiner = !0), m.push(T(O));
|
|
3597
3875
|
for (m.sort(c), b = 0; b < m.length; b++)
|
|
3598
3876
|
p = u(m[b], p);
|
|
3599
3877
|
return p;
|
|
3600
3878
|
}
|
|
3601
|
-
function c(
|
|
3602
|
-
return
|
|
3879
|
+
function c(d, x) {
|
|
3880
|
+
return d.x - x.x;
|
|
3603
3881
|
}
|
|
3604
|
-
function u(
|
|
3605
|
-
var p = d
|
|
3882
|
+
function u(d, x) {
|
|
3883
|
+
var p = g(d, x);
|
|
3606
3884
|
if (!p)
|
|
3607
3885
|
return x;
|
|
3608
|
-
var w =
|
|
3886
|
+
var w = it(p, d);
|
|
3609
3887
|
return t(w, w.next), t(p, p.next);
|
|
3610
3888
|
}
|
|
3611
|
-
function d
|
|
3612
|
-
var p = x, w =
|
|
3889
|
+
function g(d, x) {
|
|
3890
|
+
var p = x, w = d.x, m = d.y, b = -1 / 0, A;
|
|
3613
3891
|
do {
|
|
3614
3892
|
if (m <= p.y && m >= p.next.y && p.next.y !== p.y) {
|
|
3615
3893
|
var C = p.x + (m - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
|
|
@@ -3619,140 +3897,140 @@ function Rn() {
|
|
|
3619
3897
|
p = p.next;
|
|
3620
3898
|
} while (p !== x);
|
|
3621
3899
|
if (!A) return null;
|
|
3622
|
-
var N = A,
|
|
3900
|
+
var N = A, O = A.x, W = A.y, j = 1 / 0, B;
|
|
3623
3901
|
p = A;
|
|
3624
3902
|
do
|
|
3625
|
-
w >= p.x && p.x >=
|
|
3903
|
+
w >= p.x && p.x >= O && w !== p.x && L(m < W ? w : b, m, O, W, m < W ? b : w, m, p.x, p.y) && (B = Math.abs(m - p.y) / (w - p.x), z(p, d) && (B < j || B === j && (p.x > A.x || p.x === A.x && h(A, p))) && (A = p, j = B)), p = p.next;
|
|
3626
3904
|
while (p !== N);
|
|
3627
3905
|
return A;
|
|
3628
3906
|
}
|
|
3629
|
-
function
|
|
3630
|
-
return
|
|
3907
|
+
function h(d, x) {
|
|
3908
|
+
return S(d.prev, d, x.prev) < 0 && S(x.next, d, d.next) < 0;
|
|
3631
3909
|
}
|
|
3632
|
-
function f(
|
|
3633
|
-
var m =
|
|
3910
|
+
function f(d, x, p, w) {
|
|
3911
|
+
var m = d;
|
|
3634
3912
|
do
|
|
3635
3913
|
m.z === 0 && (m.z = y(m.x, m.y, x, p, w)), m.prevZ = m.prev, m.nextZ = m.next, m = m.next;
|
|
3636
|
-
while (m !==
|
|
3914
|
+
while (m !== d);
|
|
3637
3915
|
m.prevZ.nextZ = null, m.prevZ = null, v(m);
|
|
3638
3916
|
}
|
|
3639
|
-
function v(
|
|
3640
|
-
var x, p, w, m, b, A, C, N,
|
|
3917
|
+
function v(d) {
|
|
3918
|
+
var x, p, w, m, b, A, C, N, O = 1;
|
|
3641
3919
|
do {
|
|
3642
|
-
for (p =
|
|
3643
|
-
for (A++, w = p, C = 0, x = 0; x <
|
|
3920
|
+
for (p = d, d = null, b = null, A = 0; p; ) {
|
|
3921
|
+
for (A++, w = p, C = 0, x = 0; x < O && (C++, w = w.nextZ, !!w); x++)
|
|
3644
3922
|
;
|
|
3645
|
-
for (N =
|
|
3646
|
-
C !== 0 && (N === 0 || !w || p.z <= w.z) ? (m = p, p = p.nextZ, C--) : (m = w, w = w.nextZ, N--), b ? b.nextZ = m :
|
|
3923
|
+
for (N = O; C > 0 || N > 0 && w; )
|
|
3924
|
+
C !== 0 && (N === 0 || !w || p.z <= w.z) ? (m = p, p = p.nextZ, C--) : (m = w, w = w.nextZ, N--), b ? b.nextZ = m : d = m, m.prevZ = b, b = m;
|
|
3647
3925
|
p = w;
|
|
3648
3926
|
}
|
|
3649
|
-
b.nextZ = null,
|
|
3927
|
+
b.nextZ = null, O *= 2;
|
|
3650
3928
|
} while (A > 1);
|
|
3651
|
-
return
|
|
3929
|
+
return d;
|
|
3652
3930
|
}
|
|
3653
|
-
function y(
|
|
3654
|
-
return
|
|
3931
|
+
function y(d, x, p, w, m) {
|
|
3932
|
+
return d = (d - p) * m | 0, x = (x - w) * m | 0, d = (d | d << 8) & 16711935, d = (d | d << 4) & 252645135, d = (d | d << 2) & 858993459, d = (d | d << 1) & 1431655765, x = (x | x << 8) & 16711935, x = (x | x << 4) & 252645135, x = (x | x << 2) & 858993459, x = (x | x << 1) & 1431655765, d | x << 1;
|
|
3655
3933
|
}
|
|
3656
|
-
function
|
|
3657
|
-
var x =
|
|
3934
|
+
function T(d) {
|
|
3935
|
+
var x = d, p = d;
|
|
3658
3936
|
do
|
|
3659
3937
|
(x.x < p.x || x.x === p.x && x.y < p.y) && (p = x), x = x.next;
|
|
3660
|
-
while (x !==
|
|
3938
|
+
while (x !== d);
|
|
3661
3939
|
return p;
|
|
3662
3940
|
}
|
|
3663
|
-
function
|
|
3664
|
-
return (m - A) * (x - C) >= (
|
|
3941
|
+
function L(d, x, p, w, m, b, A, C) {
|
|
3942
|
+
return (m - A) * (x - C) >= (d - A) * (b - C) && (d - A) * (w - C) >= (p - A) * (x - C) && (p - A) * (b - C) >= (m - A) * (w - C);
|
|
3665
3943
|
}
|
|
3666
|
-
function
|
|
3667
|
-
return
|
|
3668
|
-
(z(
|
|
3669
|
-
(
|
|
3670
|
-
E(
|
|
3944
|
+
function P(d, x) {
|
|
3945
|
+
return d.next.i !== x.i && d.prev.i !== x.i && !Y(d, x) && // dones't intersect other edges
|
|
3946
|
+
(z(d, x) && z(x, d) && U(d, x) && // locally visible
|
|
3947
|
+
(S(d.prev, d, x.prev) || S(d, x.prev, x)) || // does not create opposite-facing sectors
|
|
3948
|
+
E(d, x) && S(d.prev, d, d.next) > 0 && S(x.prev, x, x.next) > 0);
|
|
3671
3949
|
}
|
|
3672
|
-
function
|
|
3673
|
-
return (x.y -
|
|
3950
|
+
function S(d, x, p) {
|
|
3951
|
+
return (x.y - d.y) * (p.x - x.x) - (x.x - d.x) * (p.y - x.y);
|
|
3674
3952
|
}
|
|
3675
|
-
function E(
|
|
3676
|
-
return
|
|
3953
|
+
function E(d, x) {
|
|
3954
|
+
return d.x === x.x && d.y === x.y;
|
|
3677
3955
|
}
|
|
3678
|
-
function
|
|
3679
|
-
var m = F(
|
|
3680
|
-
return !!(m !== b && A !== C || m === 0 && I(
|
|
3956
|
+
function M(d, x, p, w) {
|
|
3957
|
+
var m = F(S(d, x, p)), b = F(S(d, x, w)), A = F(S(p, w, d)), C = F(S(p, w, x));
|
|
3958
|
+
return !!(m !== b && A !== C || m === 0 && I(d, p, x) || b === 0 && I(d, w, x) || A === 0 && I(p, d, w) || C === 0 && I(p, x, w));
|
|
3681
3959
|
}
|
|
3682
|
-
function I(
|
|
3683
|
-
return x.x <= Math.max(
|
|
3960
|
+
function I(d, x, p) {
|
|
3961
|
+
return x.x <= Math.max(d.x, p.x) && x.x >= Math.min(d.x, p.x) && x.y <= Math.max(d.y, p.y) && x.y >= Math.min(d.y, p.y);
|
|
3684
3962
|
}
|
|
3685
|
-
function F(
|
|
3686
|
-
return
|
|
3963
|
+
function F(d) {
|
|
3964
|
+
return d > 0 ? 1 : d < 0 ? -1 : 0;
|
|
3687
3965
|
}
|
|
3688
|
-
function
|
|
3689
|
-
var p =
|
|
3966
|
+
function Y(d, x) {
|
|
3967
|
+
var p = d;
|
|
3690
3968
|
do {
|
|
3691
|
-
if (p.i !==
|
|
3969
|
+
if (p.i !== d.i && p.next.i !== d.i && p.i !== x.i && p.next.i !== x.i && M(p, p.next, d, x)) return !0;
|
|
3692
3970
|
p = p.next;
|
|
3693
|
-
} while (p !==
|
|
3971
|
+
} while (p !== d);
|
|
3694
3972
|
return !1;
|
|
3695
3973
|
}
|
|
3696
|
-
function z(
|
|
3697
|
-
return
|
|
3974
|
+
function z(d, x) {
|
|
3975
|
+
return S(d.prev, d, d.next) < 0 ? S(d, x, d.next) >= 0 && S(d, d.prev, x) >= 0 : S(d, x, d.prev) < 0 || S(d, d.next, x) < 0;
|
|
3698
3976
|
}
|
|
3699
|
-
function U(
|
|
3700
|
-
var p =
|
|
3977
|
+
function U(d, x) {
|
|
3978
|
+
var p = d, w = !1, m = (d.x + x.x) / 2, b = (d.y + x.y) / 2;
|
|
3701
3979
|
do
|
|
3702
3980
|
p.y > b != p.next.y > b && p.next.y !== p.y && m < (p.next.x - p.x) * (b - p.y) / (p.next.y - p.y) + p.x && (w = !w), p = p.next;
|
|
3703
|
-
while (p !==
|
|
3981
|
+
while (p !== d);
|
|
3704
3982
|
return w;
|
|
3705
3983
|
}
|
|
3706
|
-
function
|
|
3707
|
-
var p = new Z(
|
|
3708
|
-
return
|
|
3984
|
+
function it(d, x) {
|
|
3985
|
+
var p = new Z(d.i, d.x, d.y), w = new Z(x.i, x.x, x.y), m = d.next, b = x.prev;
|
|
3986
|
+
return d.next = x, x.prev = d, p.next = m, m.prev = p, w.next = p, p.prev = w, b.next = w, w.prev = b, w;
|
|
3709
3987
|
}
|
|
3710
|
-
function
|
|
3711
|
-
var m = new Z(
|
|
3988
|
+
function rt(d, x, p, w) {
|
|
3989
|
+
var m = new Z(d, x, p);
|
|
3712
3990
|
return w ? (m.next = w.next, m.prev = w, w.next.prev = m, w.next = m) : (m.prev = m, m.next = m), m;
|
|
3713
3991
|
}
|
|
3714
|
-
function
|
|
3715
|
-
|
|
3992
|
+
function ot(d) {
|
|
3993
|
+
d.next.prev = d.prev, d.prev.next = d.next, d.prevZ && (d.prevZ.nextZ = d.nextZ), d.nextZ && (d.nextZ.prevZ = d.prevZ);
|
|
3716
3994
|
}
|
|
3717
|
-
function Z(
|
|
3718
|
-
this.i =
|
|
3995
|
+
function Z(d, x, p) {
|
|
3996
|
+
this.i = d, this.x = x, this.y = p, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1;
|
|
3719
3997
|
}
|
|
3720
|
-
n.deviation = function(
|
|
3721
|
-
var m = x && x.length, b = m ? x[0] * p :
|
|
3998
|
+
n.deviation = function(d, x, p, w) {
|
|
3999
|
+
var m = x && x.length, b = m ? x[0] * p : d.length, A = Math.abs(zt(d, 0, b, p));
|
|
3722
4000
|
if (m)
|
|
3723
4001
|
for (var C = 0, N = x.length; C < N; C++) {
|
|
3724
|
-
var
|
|
3725
|
-
A -= Math.abs(
|
|
4002
|
+
var O = x[C] * p, W = C < N - 1 ? x[C + 1] * p : d.length;
|
|
4003
|
+
A -= Math.abs(zt(d, O, W, p));
|
|
3726
4004
|
}
|
|
3727
|
-
var
|
|
4005
|
+
var j = 0;
|
|
3728
4006
|
for (C = 0; C < w.length; C += 3) {
|
|
3729
|
-
var B = w[C] * p,
|
|
3730
|
-
|
|
3731
|
-
(
|
|
4007
|
+
var B = w[C] * p, X = w[C + 1] * p, H = w[C + 2] * p;
|
|
4008
|
+
j += Math.abs(
|
|
4009
|
+
(d[B] - d[H]) * (d[X + 1] - d[B + 1]) - (d[B] - d[X]) * (d[H + 1] - d[B + 1])
|
|
3732
4010
|
);
|
|
3733
4011
|
}
|
|
3734
|
-
return A === 0 &&
|
|
4012
|
+
return A === 0 && j === 0 ? 0 : Math.abs((j - A) / A);
|
|
3735
4013
|
};
|
|
3736
|
-
function
|
|
4014
|
+
function zt(d, x, p, w) {
|
|
3737
4015
|
for (var m = 0, b = x, A = p - w; b < p; b += w)
|
|
3738
|
-
m += (
|
|
4016
|
+
m += (d[A] - d[b]) * (d[b + 1] + d[A + 1]), A = b;
|
|
3739
4017
|
return m;
|
|
3740
4018
|
}
|
|
3741
|
-
return n.flatten = function(
|
|
3742
|
-
for (var x =
|
|
3743
|
-
for (var b = 0; b <
|
|
3744
|
-
for (var A = 0; A < x; A++) p.vertices.push(
|
|
3745
|
-
m > 0 && (w +=
|
|
4019
|
+
return n.flatten = function(d) {
|
|
4020
|
+
for (var x = d[0][0].length, p = { vertices: [], holes: [], dimensions: x }, w = 0, m = 0; m < d.length; m++) {
|
|
4021
|
+
for (var b = 0; b < d[m].length; b++)
|
|
4022
|
+
for (var A = 0; A < x; A++) p.vertices.push(d[m][b][A]);
|
|
4023
|
+
m > 0 && (w += d[m - 1].length, p.holes.push(w));
|
|
3746
4024
|
}
|
|
3747
4025
|
return p;
|
|
3748
|
-
},
|
|
4026
|
+
}, Nt.exports;
|
|
3749
4027
|
}
|
|
3750
|
-
|
|
3751
|
-
function
|
|
4028
|
+
ci();
|
|
4029
|
+
function w0(n, e) {
|
|
3752
4030
|
return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
|
|
3753
4031
|
}
|
|
3754
|
-
function
|
|
3755
|
-
return n.length === 1 && (n =
|
|
4032
|
+
function ui(n) {
|
|
4033
|
+
return n.length === 1 && (n = fi(n)), {
|
|
3756
4034
|
left: function(e, t, o, i) {
|
|
3757
4035
|
for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
|
|
3758
4036
|
var a = o + i >>> 1;
|
|
@@ -3769,31 +4047,31 @@ function Fn(n) {
|
|
|
3769
4047
|
}
|
|
3770
4048
|
};
|
|
3771
4049
|
}
|
|
3772
|
-
function
|
|
4050
|
+
function fi(n) {
|
|
3773
4051
|
return function(e, t) {
|
|
3774
|
-
return
|
|
4052
|
+
return w0(n(e), t);
|
|
3775
4053
|
};
|
|
3776
4054
|
}
|
|
3777
|
-
|
|
3778
|
-
function
|
|
3779
|
-
const o =
|
|
4055
|
+
ui(w0);
|
|
4056
|
+
function Bi(n, e, t = 3) {
|
|
4057
|
+
const o = li(n, e, { maxSegmentLength: t });
|
|
3780
4058
|
return {
|
|
3781
4059
|
check: (i) => typeof i == "string",
|
|
3782
4060
|
interpolate: (i, a, s) => o(s)
|
|
3783
4061
|
};
|
|
3784
4062
|
}
|
|
3785
|
-
function
|
|
4063
|
+
function Di(n) {
|
|
3786
4064
|
const e = (o) => n.width * o, t = (o) => n.height * o;
|
|
3787
4065
|
return {
|
|
3788
4066
|
scaleX: e,
|
|
3789
4067
|
scaleY: t,
|
|
3790
|
-
position: (o, i) =>
|
|
4068
|
+
position: (o, i) => $({
|
|
3791
4069
|
x: e(o),
|
|
3792
4070
|
y: t(i)
|
|
3793
4071
|
})
|
|
3794
4072
|
};
|
|
3795
4073
|
}
|
|
3796
|
-
function
|
|
4074
|
+
function qi(n) {
|
|
3797
4075
|
const e = [];
|
|
3798
4076
|
if (n.isAllKey) {
|
|
3799
4077
|
for (let t = 0; t <= n.animations.length; t++)
|
|
@@ -3805,49 +4083,51 @@ function hr(n) {
|
|
|
3805
4083
|
}), n.isEndKey && e[e.length - 1] !== n.animations.length && e.push(n.animations.length), e;
|
|
3806
4084
|
}
|
|
3807
4085
|
export {
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
4086
|
+
yt as Alignment,
|
|
4087
|
+
lt as Anchor,
|
|
4088
|
+
ce as Animate,
|
|
4089
|
+
mi as Arrow,
|
|
4090
|
+
Oi as BrowserCanvasRenderer,
|
|
4091
|
+
bi as Circle,
|
|
3814
4092
|
G as Color,
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
4093
|
+
he as Easing,
|
|
4094
|
+
gi as FadeIn,
|
|
4095
|
+
pi as FadeOut,
|
|
4096
|
+
G0 as FontStyle,
|
|
4097
|
+
K0 as FontWeight,
|
|
4098
|
+
Ai as Grid,
|
|
4099
|
+
we as Group,
|
|
4100
|
+
xi as Hide,
|
|
4101
|
+
vi as IFrame,
|
|
4102
|
+
Ti as Image,
|
|
4103
|
+
Mi as Line,
|
|
4104
|
+
Li as Mask,
|
|
4105
|
+
V as ObjectType,
|
|
4106
|
+
Fi as Opaque,
|
|
4107
|
+
Ci as Path,
|
|
4108
|
+
_i as Pause,
|
|
4109
|
+
Si as Polygon,
|
|
4110
|
+
$ as Position,
|
|
4111
|
+
dn as Presentation,
|
|
4112
|
+
Pi as Rectangle,
|
|
4113
|
+
Ii as SVG,
|
|
4114
|
+
wi as ScreenCapture,
|
|
4115
|
+
yi as Show,
|
|
4116
|
+
Q as Size,
|
|
4117
|
+
Ni as Slide,
|
|
4118
|
+
nt as SlideObject,
|
|
4119
|
+
Ze as SlideWebExtra,
|
|
4120
|
+
Ei as Spotlight,
|
|
4121
|
+
tn as Text,
|
|
4122
|
+
Ri as TextUnit,
|
|
4123
|
+
Y0 as Transparent,
|
|
4124
|
+
Ke as Update,
|
|
4125
|
+
ki as Variable,
|
|
4126
|
+
qi as getKeySlideBuildIndices,
|
|
4127
|
+
Di as getSizingFunctions,
|
|
4128
|
+
Bi as getSmoothPathInterpolator,
|
|
4129
|
+
Q0 as getTextContentLength,
|
|
4130
|
+
xn as interpolateColor,
|
|
4131
|
+
vn as interpolateNumber
|
|
3852
4132
|
};
|
|
3853
4133
|
//# sourceMappingURL=presenter.mjs.map
|