@tsparticles/plugin-polygon-mask 3.0.0-alpha.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.
Files changed (112) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/browser/Enums/PolygonMaskInlineArrangement.js +1 -0
  4. package/browser/Enums/PolygonMaskMoveType.js +1 -0
  5. package/browser/Enums/PolygonMaskType.js +1 -0
  6. package/browser/Interfaces/ISvgPath.js +1 -0
  7. package/browser/Options/Classes/PolygonMask.js +56 -0
  8. package/browser/Options/Classes/PolygonMaskDraw.js +34 -0
  9. package/browser/Options/Classes/PolygonMaskDrawStroke.js +24 -0
  10. package/browser/Options/Classes/PolygonMaskInline.js +13 -0
  11. package/browser/Options/Classes/PolygonMaskLocalSvg.js +25 -0
  12. package/browser/Options/Classes/PolygonMaskMove.js +17 -0
  13. package/browser/Options/Interfaces/IPolygonMask.js +1 -0
  14. package/browser/Options/Interfaces/IPolygonMaskDraw.js +1 -0
  15. package/browser/Options/Interfaces/IPolygonMaskDrawStroke.js +1 -0
  16. package/browser/Options/Interfaces/IPolygonMaskInline.js +1 -0
  17. package/browser/Options/Interfaces/IPolygonMaskLocalSvg.js +1 -0
  18. package/browser/Options/Interfaces/IPolygonMaskMove.js +1 -0
  19. package/browser/PolygonMaskInstance.js +388 -0
  20. package/browser/index.js +33 -0
  21. package/browser/pathseg.js +1496 -0
  22. package/browser/types.js +1 -0
  23. package/browser/utils.js +108 -0
  24. package/cjs/Enums/PolygonMaskInlineArrangement.js +2 -0
  25. package/cjs/Enums/PolygonMaskMoveType.js +2 -0
  26. package/cjs/Enums/PolygonMaskType.js +2 -0
  27. package/cjs/Interfaces/ISvgPath.js +2 -0
  28. package/cjs/Options/Classes/PolygonMask.js +60 -0
  29. package/cjs/Options/Classes/PolygonMaskDraw.js +38 -0
  30. package/cjs/Options/Classes/PolygonMaskDrawStroke.js +28 -0
  31. package/cjs/Options/Classes/PolygonMaskInline.js +17 -0
  32. package/cjs/Options/Classes/PolygonMaskLocalSvg.js +29 -0
  33. package/cjs/Options/Classes/PolygonMaskMove.js +21 -0
  34. package/cjs/Options/Interfaces/IPolygonMask.js +2 -0
  35. package/cjs/Options/Interfaces/IPolygonMaskDraw.js +2 -0
  36. package/cjs/Options/Interfaces/IPolygonMaskDrawStroke.js +2 -0
  37. package/cjs/Options/Interfaces/IPolygonMaskInline.js +2 -0
  38. package/cjs/Options/Interfaces/IPolygonMaskLocalSvg.js +2 -0
  39. package/cjs/Options/Interfaces/IPolygonMaskMove.js +2 -0
  40. package/cjs/PolygonMaskInstance.js +407 -0
  41. package/cjs/index.js +62 -0
  42. package/cjs/pathseg.js +1496 -0
  43. package/cjs/types.js +2 -0
  44. package/cjs/utils.js +116 -0
  45. package/esm/Enums/PolygonMaskInlineArrangement.js +1 -0
  46. package/esm/Enums/PolygonMaskMoveType.js +1 -0
  47. package/esm/Enums/PolygonMaskType.js +1 -0
  48. package/esm/Interfaces/ISvgPath.js +1 -0
  49. package/esm/Options/Classes/PolygonMask.js +56 -0
  50. package/esm/Options/Classes/PolygonMaskDraw.js +34 -0
  51. package/esm/Options/Classes/PolygonMaskDrawStroke.js +24 -0
  52. package/esm/Options/Classes/PolygonMaskInline.js +13 -0
  53. package/esm/Options/Classes/PolygonMaskLocalSvg.js +25 -0
  54. package/esm/Options/Classes/PolygonMaskMove.js +17 -0
  55. package/esm/Options/Interfaces/IPolygonMask.js +1 -0
  56. package/esm/Options/Interfaces/IPolygonMaskDraw.js +1 -0
  57. package/esm/Options/Interfaces/IPolygonMaskDrawStroke.js +1 -0
  58. package/esm/Options/Interfaces/IPolygonMaskInline.js +1 -0
  59. package/esm/Options/Interfaces/IPolygonMaskLocalSvg.js +1 -0
  60. package/esm/Options/Interfaces/IPolygonMaskMove.js +1 -0
  61. package/esm/PolygonMaskInstance.js +388 -0
  62. package/esm/index.js +33 -0
  63. package/esm/pathseg.js +1496 -0
  64. package/esm/types.js +1 -0
  65. package/esm/utils.js +108 -0
  66. package/package.json +81 -0
  67. package/report.html +39 -0
  68. package/tsparticles.plugin.polygon-mask.js +2276 -0
  69. package/tsparticles.plugin.polygon-mask.min.js +2 -0
  70. package/tsparticles.plugin.polygon-mask.min.js.LICENSE.txt +8 -0
  71. package/types/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  72. package/types/Enums/PolygonMaskMoveType.d.ts +4 -0
  73. package/types/Enums/PolygonMaskType.d.ts +6 -0
  74. package/types/Interfaces/ISvgPath.d.ts +6 -0
  75. package/types/Options/Classes/PolygonMask.d.ts +23 -0
  76. package/types/Options/Classes/PolygonMaskDraw.d.ts +14 -0
  77. package/types/Options/Classes/PolygonMaskDrawStroke.d.ts +10 -0
  78. package/types/Options/Classes/PolygonMaskInline.d.ts +9 -0
  79. package/types/Options/Classes/PolygonMaskLocalSvg.d.ts +8 -0
  80. package/types/Options/Classes/PolygonMaskMove.d.ts +9 -0
  81. package/types/Options/Interfaces/IPolygonMask.d.ts +17 -0
  82. package/types/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
  83. package/types/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
  84. package/types/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
  85. package/types/Options/Interfaces/IPolygonMaskLocalSvg.d.ts +5 -0
  86. package/types/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
  87. package/types/PolygonMaskInstance.d.ts +37 -0
  88. package/types/index.d.ts +6 -0
  89. package/types/pathseg.d.ts +0 -0
  90. package/types/types.d.ts +15 -0
  91. package/types/utils.d.ts +11 -0
  92. package/umd/Enums/PolygonMaskInlineArrangement.js +12 -0
  93. package/umd/Enums/PolygonMaskMoveType.js +12 -0
  94. package/umd/Enums/PolygonMaskType.js +12 -0
  95. package/umd/Interfaces/ISvgPath.js +12 -0
  96. package/umd/Options/Classes/PolygonMask.js +70 -0
  97. package/umd/Options/Classes/PolygonMaskDraw.js +48 -0
  98. package/umd/Options/Classes/PolygonMaskDrawStroke.js +38 -0
  99. package/umd/Options/Classes/PolygonMaskInline.js +27 -0
  100. package/umd/Options/Classes/PolygonMaskLocalSvg.js +39 -0
  101. package/umd/Options/Classes/PolygonMaskMove.js +31 -0
  102. package/umd/Options/Interfaces/IPolygonMask.js +12 -0
  103. package/umd/Options/Interfaces/IPolygonMaskDraw.js +12 -0
  104. package/umd/Options/Interfaces/IPolygonMaskDrawStroke.js +12 -0
  105. package/umd/Options/Interfaces/IPolygonMaskInline.js +12 -0
  106. package/umd/Options/Interfaces/IPolygonMaskLocalSvg.js +12 -0
  107. package/umd/Options/Interfaces/IPolygonMaskMove.js +12 -0
  108. package/umd/PolygonMaskInstance.js +402 -0
  109. package/umd/index.js +61 -0
  110. package/umd/pathseg.js +1496 -0
  111. package/umd/types.js +12 -0
  112. package/umd/utils.js +126 -0
@@ -0,0 +1,2276 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.0.0-alpha.0
8
+ */
9
+ (function webpackUniversalModuleDefinition(root, factory) {
10
+ if(typeof exports === 'object' && typeof module === 'object')
11
+ module.exports = factory(require("@tsparticles/engine"));
12
+ else if(typeof define === 'function' && define.amd)
13
+ define(["@tsparticles/engine"], factory);
14
+ else {
15
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
16
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
17
+ }
18
+ })(this, (__WEBPACK_EXTERNAL_MODULE__533__) => {
19
+ return /******/ (() => { // webpackBootstrap
20
+ /******/ "use strict";
21
+ /******/ var __webpack_modules__ = ({
22
+
23
+ /***/ 505:
24
+ /***/ (() => {
25
+
26
+
27
+
28
+ (function () {
29
+ "use strict";
30
+
31
+ try {
32
+ if (typeof window === "undefined") return;
33
+ if (!("SVGPathSeg" in window)) {
34
+ window.SVGPathSeg = function (type, typeAsLetter, owningPathSegList) {
35
+ this.pathSegType = type;
36
+ this.pathSegTypeAsLetter = typeAsLetter;
37
+ this._owningPathSegList = owningPathSegList;
38
+ };
39
+ window.SVGPathSeg.prototype.classname = "SVGPathSeg";
40
+ window.SVGPathSeg.PATHSEG_UNKNOWN = 0;
41
+ window.SVGPathSeg.PATHSEG_CLOSEPATH = 1;
42
+ window.SVGPathSeg.PATHSEG_MOVETO_ABS = 2;
43
+ window.SVGPathSeg.PATHSEG_MOVETO_REL = 3;
44
+ window.SVGPathSeg.PATHSEG_LINETO_ABS = 4;
45
+ window.SVGPathSeg.PATHSEG_LINETO_REL = 5;
46
+ window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6;
47
+ window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7;
48
+ window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8;
49
+ window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9;
50
+ window.SVGPathSeg.PATHSEG_ARC_ABS = 10;
51
+ window.SVGPathSeg.PATHSEG_ARC_REL = 11;
52
+ window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12;
53
+ window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13;
54
+ window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14;
55
+ window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15;
56
+ window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16;
57
+ window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;
58
+ window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
59
+ window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
60
+ window.SVGPathSeg.prototype._segmentChanged = function () {
61
+ if (this._owningPathSegList) this._owningPathSegList.segmentChanged(this);
62
+ };
63
+ window.SVGPathSegClosePath = function (owningPathSegList) {
64
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CLOSEPATH, "z", owningPathSegList);
65
+ };
66
+ window.SVGPathSegClosePath.prototype = Object.create(window.SVGPathSeg.prototype);
67
+ window.SVGPathSegClosePath.prototype.toString = function () {
68
+ return "[object SVGPathSegClosePath]";
69
+ };
70
+ window.SVGPathSegClosePath.prototype._asPathString = function () {
71
+ return this.pathSegTypeAsLetter;
72
+ };
73
+ window.SVGPathSegClosePath.prototype.clone = function () {
74
+ return new window.SVGPathSegClosePath(undefined);
75
+ };
76
+ window.SVGPathSegMovetoAbs = function (owningPathSegList, x, y) {
77
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_ABS, "M", owningPathSegList);
78
+ this._x = x;
79
+ this._y = y;
80
+ };
81
+ window.SVGPathSegMovetoAbs.prototype = Object.create(window.SVGPathSeg.prototype);
82
+ window.SVGPathSegMovetoAbs.prototype.toString = function () {
83
+ return "[object SVGPathSegMovetoAbs]";
84
+ };
85
+ window.SVGPathSegMovetoAbs.prototype._asPathString = function () {
86
+ return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
87
+ };
88
+ window.SVGPathSegMovetoAbs.prototype.clone = function () {
89
+ return new window.SVGPathSegMovetoAbs(undefined, this._x, this._y);
90
+ };
91
+ Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "x", {
92
+ get: function () {
93
+ return this._x;
94
+ },
95
+ set: function (x) {
96
+ this._x = x;
97
+ this._segmentChanged();
98
+ },
99
+ enumerable: true
100
+ });
101
+ Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "y", {
102
+ get: function () {
103
+ return this._y;
104
+ },
105
+ set: function (y) {
106
+ this._y = y;
107
+ this._segmentChanged();
108
+ },
109
+ enumerable: true
110
+ });
111
+ window.SVGPathSegMovetoRel = function (owningPathSegList, x, y) {
112
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_REL, "m", owningPathSegList);
113
+ this._x = x;
114
+ this._y = y;
115
+ };
116
+ window.SVGPathSegMovetoRel.prototype = Object.create(window.SVGPathSeg.prototype);
117
+ window.SVGPathSegMovetoRel.prototype.toString = function () {
118
+ return "[object SVGPathSegMovetoRel]";
119
+ };
120
+ window.SVGPathSegMovetoRel.prototype._asPathString = function () {
121
+ return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
122
+ };
123
+ window.SVGPathSegMovetoRel.prototype.clone = function () {
124
+ return new window.SVGPathSegMovetoRel(undefined, this._x, this._y);
125
+ };
126
+ Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "x", {
127
+ get: function () {
128
+ return this._x;
129
+ },
130
+ set: function (x) {
131
+ this._x = x;
132
+ this._segmentChanged();
133
+ },
134
+ enumerable: true
135
+ });
136
+ Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "y", {
137
+ get: function () {
138
+ return this._y;
139
+ },
140
+ set: function (y) {
141
+ this._y = y;
142
+ this._segmentChanged();
143
+ },
144
+ enumerable: true
145
+ });
146
+ window.SVGPathSegLinetoAbs = function (owningPathSegList, x, y) {
147
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_ABS, "L", owningPathSegList);
148
+ this._x = x;
149
+ this._y = y;
150
+ };
151
+ window.SVGPathSegLinetoAbs.prototype = Object.create(window.SVGPathSeg.prototype);
152
+ window.SVGPathSegLinetoAbs.prototype.toString = function () {
153
+ return "[object SVGPathSegLinetoAbs]";
154
+ };
155
+ window.SVGPathSegLinetoAbs.prototype._asPathString = function () {
156
+ return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
157
+ };
158
+ window.SVGPathSegLinetoAbs.prototype.clone = function () {
159
+ return new window.SVGPathSegLinetoAbs(undefined, this._x, this._y);
160
+ };
161
+ Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "x", {
162
+ get: function () {
163
+ return this._x;
164
+ },
165
+ set: function (x) {
166
+ this._x = x;
167
+ this._segmentChanged();
168
+ },
169
+ enumerable: true
170
+ });
171
+ Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "y", {
172
+ get: function () {
173
+ return this._y;
174
+ },
175
+ set: function (y) {
176
+ this._y = y;
177
+ this._segmentChanged();
178
+ },
179
+ enumerable: true
180
+ });
181
+ window.SVGPathSegLinetoRel = function (owningPathSegList, x, y) {
182
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_REL, "l", owningPathSegList);
183
+ this._x = x;
184
+ this._y = y;
185
+ };
186
+ window.SVGPathSegLinetoRel.prototype = Object.create(window.SVGPathSeg.prototype);
187
+ window.SVGPathSegLinetoRel.prototype.toString = function () {
188
+ return "[object SVGPathSegLinetoRel]";
189
+ };
190
+ window.SVGPathSegLinetoRel.prototype._asPathString = function () {
191
+ return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
192
+ };
193
+ window.SVGPathSegLinetoRel.prototype.clone = function () {
194
+ return new window.SVGPathSegLinetoRel(undefined, this._x, this._y);
195
+ };
196
+ Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "x", {
197
+ get: function () {
198
+ return this._x;
199
+ },
200
+ set: function (x) {
201
+ this._x = x;
202
+ this._segmentChanged();
203
+ },
204
+ enumerable: true
205
+ });
206
+ Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "y", {
207
+ get: function () {
208
+ return this._y;
209
+ },
210
+ set: function (y) {
211
+ this._y = y;
212
+ this._segmentChanged();
213
+ },
214
+ enumerable: true
215
+ });
216
+ window.SVGPathSegCurvetoCubicAbs = function (owningPathSegList, x, y, x1, y1, x2, y2) {
217
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, "C", owningPathSegList);
218
+ this._x = x;
219
+ this._y = y;
220
+ this._x1 = x1;
221
+ this._y1 = y1;
222
+ this._x2 = x2;
223
+ this._y2 = y2;
224
+ };
225
+ window.SVGPathSegCurvetoCubicAbs.prototype = Object.create(window.SVGPathSeg.prototype);
226
+ window.SVGPathSegCurvetoCubicAbs.prototype.toString = function () {
227
+ return "[object SVGPathSegCurvetoCubicAbs]";
228
+ };
229
+ window.SVGPathSegCurvetoCubicAbs.prototype._asPathString = function () {
230
+ return `${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x2} ${this._y2} ${this._x} ${this._y}`;
231
+ };
232
+ window.SVGPathSegCurvetoCubicAbs.prototype.clone = function () {
233
+ return new window.SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2);
234
+ };
235
+ Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x", {
236
+ get: function () {
237
+ return this._x;
238
+ },
239
+ set: function (x) {
240
+ this._x = x;
241
+ this._segmentChanged();
242
+ },
243
+ enumerable: true
244
+ });
245
+ Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y", {
246
+ get: function () {
247
+ return this._y;
248
+ },
249
+ set: function (y) {
250
+ this._y = y;
251
+ this._segmentChanged();
252
+ },
253
+ enumerable: true
254
+ });
255
+ Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x1", {
256
+ get: function () {
257
+ return this._x1;
258
+ },
259
+ set: function (x1) {
260
+ this._x1 = x1;
261
+ this._segmentChanged();
262
+ },
263
+ enumerable: true
264
+ });
265
+ Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y1", {
266
+ get: function () {
267
+ return this._y1;
268
+ },
269
+ set: function (y1) {
270
+ this._y1 = y1;
271
+ this._segmentChanged();
272
+ },
273
+ enumerable: true
274
+ });
275
+ Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x2", {
276
+ get: function () {
277
+ return this._x2;
278
+ },
279
+ set: function (x2) {
280
+ this._x2 = x2;
281
+ this._segmentChanged();
282
+ },
283
+ enumerable: true
284
+ });
285
+ Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y2", {
286
+ get: function () {
287
+ return this._y2;
288
+ },
289
+ set: function (y2) {
290
+ this._y2 = y2;
291
+ this._segmentChanged();
292
+ },
293
+ enumerable: true
294
+ });
295
+ window.SVGPathSegCurvetoCubicRel = function (owningPathSegList, x, y, x1, y1, x2, y2) {
296
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, "c", owningPathSegList);
297
+ this._x = x;
298
+ this._y = y;
299
+ this._x1 = x1;
300
+ this._y1 = y1;
301
+ this._x2 = x2;
302
+ this._y2 = y2;
303
+ };
304
+ window.SVGPathSegCurvetoCubicRel.prototype = Object.create(window.SVGPathSeg.prototype);
305
+ window.SVGPathSegCurvetoCubicRel.prototype.toString = function () {
306
+ return "[object SVGPathSegCurvetoCubicRel]";
307
+ };
308
+ window.SVGPathSegCurvetoCubicRel.prototype._asPathString = function () {
309
+ return `${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x2} ${this._y2} ${this._x} ${this._y}`;
310
+ };
311
+ window.SVGPathSegCurvetoCubicRel.prototype.clone = function () {
312
+ return new window.SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2);
313
+ };
314
+ Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x", {
315
+ get: function () {
316
+ return this._x;
317
+ },
318
+ set: function (x) {
319
+ this._x = x;
320
+ this._segmentChanged();
321
+ },
322
+ enumerable: true
323
+ });
324
+ Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y", {
325
+ get: function () {
326
+ return this._y;
327
+ },
328
+ set: function (y) {
329
+ this._y = y;
330
+ this._segmentChanged();
331
+ },
332
+ enumerable: true
333
+ });
334
+ Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x1", {
335
+ get: function () {
336
+ return this._x1;
337
+ },
338
+ set: function (x1) {
339
+ this._x1 = x1;
340
+ this._segmentChanged();
341
+ },
342
+ enumerable: true
343
+ });
344
+ Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y1", {
345
+ get: function () {
346
+ return this._y1;
347
+ },
348
+ set: function (y1) {
349
+ this._y1 = y1;
350
+ this._segmentChanged();
351
+ },
352
+ enumerable: true
353
+ });
354
+ Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x2", {
355
+ get: function () {
356
+ return this._x2;
357
+ },
358
+ set: function (x2) {
359
+ this._x2 = x2;
360
+ this._segmentChanged();
361
+ },
362
+ enumerable: true
363
+ });
364
+ Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y2", {
365
+ get: function () {
366
+ return this._y2;
367
+ },
368
+ set: function (y2) {
369
+ this._y2 = y2;
370
+ this._segmentChanged();
371
+ },
372
+ enumerable: true
373
+ });
374
+ window.SVGPathSegCurvetoQuadraticAbs = function (owningPathSegList, x, y, x1, y1) {
375
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, "Q", owningPathSegList);
376
+ this._x = x;
377
+ this._y = y;
378
+ this._x1 = x1;
379
+ this._y1 = y1;
380
+ };
381
+ window.SVGPathSegCurvetoQuadraticAbs.prototype = Object.create(window.SVGPathSeg.prototype);
382
+ window.SVGPathSegCurvetoQuadraticAbs.prototype.toString = function () {
383
+ return "[object SVGPathSegCurvetoQuadraticAbs]";
384
+ };
385
+ window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString = function () {
386
+ return `${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x} ${this._y}`;
387
+ };
388
+ window.SVGPathSegCurvetoQuadraticAbs.prototype.clone = function () {
389
+ return new window.SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1);
390
+ };
391
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x", {
392
+ get: function () {
393
+ return this._x;
394
+ },
395
+ set: function (x) {
396
+ this._x = x;
397
+ this._segmentChanged();
398
+ },
399
+ enumerable: true
400
+ });
401
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y", {
402
+ get: function () {
403
+ return this._y;
404
+ },
405
+ set: function (y) {
406
+ this._y = y;
407
+ this._segmentChanged();
408
+ },
409
+ enumerable: true
410
+ });
411
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x1", {
412
+ get: function () {
413
+ return this._x1;
414
+ },
415
+ set: function (x1) {
416
+ this._x1 = x1;
417
+ this._segmentChanged();
418
+ },
419
+ enumerable: true
420
+ });
421
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y1", {
422
+ get: function () {
423
+ return this._y1;
424
+ },
425
+ set: function (y1) {
426
+ this._y1 = y1;
427
+ this._segmentChanged();
428
+ },
429
+ enumerable: true
430
+ });
431
+ window.SVGPathSegCurvetoQuadraticRel = function (owningPathSegList, x, y, x1, y1) {
432
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, "q", owningPathSegList);
433
+ this._x = x;
434
+ this._y = y;
435
+ this._x1 = x1;
436
+ this._y1 = y1;
437
+ };
438
+ window.SVGPathSegCurvetoQuadraticRel.prototype = Object.create(window.SVGPathSeg.prototype);
439
+ window.SVGPathSegCurvetoQuadraticRel.prototype.toString = function () {
440
+ return "[object SVGPathSegCurvetoQuadraticRel]";
441
+ };
442
+ window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString = function () {
443
+ return `${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x} ${this._y}`;
444
+ };
445
+ window.SVGPathSegCurvetoQuadraticRel.prototype.clone = function () {
446
+ return new window.SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1);
447
+ };
448
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x", {
449
+ get: function () {
450
+ return this._x;
451
+ },
452
+ set: function (x) {
453
+ this._x = x;
454
+ this._segmentChanged();
455
+ },
456
+ enumerable: true
457
+ });
458
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y", {
459
+ get: function () {
460
+ return this._y;
461
+ },
462
+ set: function (y) {
463
+ this._y = y;
464
+ this._segmentChanged();
465
+ },
466
+ enumerable: true
467
+ });
468
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x1", {
469
+ get: function () {
470
+ return this._x1;
471
+ },
472
+ set: function (x1) {
473
+ this._x1 = x1;
474
+ this._segmentChanged();
475
+ },
476
+ enumerable: true
477
+ });
478
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y1", {
479
+ get: function () {
480
+ return this._y1;
481
+ },
482
+ set: function (y1) {
483
+ this._y1 = y1;
484
+ this._segmentChanged();
485
+ },
486
+ enumerable: true
487
+ });
488
+ window.SVGPathSegArcAbs = function (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
489
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_ABS, "A", owningPathSegList);
490
+ this._x = x;
491
+ this._y = y;
492
+ this._r1 = r1;
493
+ this._r2 = r2;
494
+ this._angle = angle;
495
+ this._largeArcFlag = largeArcFlag;
496
+ this._sweepFlag = sweepFlag;
497
+ };
498
+ window.SVGPathSegArcAbs.prototype = Object.create(window.SVGPathSeg.prototype);
499
+ window.SVGPathSegArcAbs.prototype.toString = function () {
500
+ return "[object SVGPathSegArcAbs]";
501
+ };
502
+ window.SVGPathSegArcAbs.prototype._asPathString = function () {
503
+ return `${this.pathSegTypeAsLetter} ${this._r1} ${this._r2} ${this._angle} ${this._largeArcFlag ? "1" : "0"} ${this._sweepFlag ? "1" : "0"} ${this._x} ${this._y}`;
504
+ };
505
+ window.SVGPathSegArcAbs.prototype.clone = function () {
506
+ return new window.SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag);
507
+ };
508
+ Object.defineProperty(window.SVGPathSegArcAbs.prototype, "x", {
509
+ get: function () {
510
+ return this._x;
511
+ },
512
+ set: function (x) {
513
+ this._x = x;
514
+ this._segmentChanged();
515
+ },
516
+ enumerable: true
517
+ });
518
+ Object.defineProperty(window.SVGPathSegArcAbs.prototype, "y", {
519
+ get: function () {
520
+ return this._y;
521
+ },
522
+ set: function (y) {
523
+ this._y = y;
524
+ this._segmentChanged();
525
+ },
526
+ enumerable: true
527
+ });
528
+ Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r1", {
529
+ get: function () {
530
+ return this._r1;
531
+ },
532
+ set: function (r1) {
533
+ this._r1 = r1;
534
+ this._segmentChanged();
535
+ },
536
+ enumerable: true
537
+ });
538
+ Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r2", {
539
+ get: function () {
540
+ return this._r2;
541
+ },
542
+ set: function (r2) {
543
+ this._r2 = r2;
544
+ this._segmentChanged();
545
+ },
546
+ enumerable: true
547
+ });
548
+ Object.defineProperty(window.SVGPathSegArcAbs.prototype, "angle", {
549
+ get: function () {
550
+ return this._angle;
551
+ },
552
+ set: function (angle) {
553
+ this._angle = angle;
554
+ this._segmentChanged();
555
+ },
556
+ enumerable: true
557
+ });
558
+ Object.defineProperty(window.SVGPathSegArcAbs.prototype, "largeArcFlag", {
559
+ get: function () {
560
+ return this._largeArcFlag;
561
+ },
562
+ set: function (largeArcFlag) {
563
+ this._largeArcFlag = largeArcFlag;
564
+ this._segmentChanged();
565
+ },
566
+ enumerable: true
567
+ });
568
+ Object.defineProperty(window.SVGPathSegArcAbs.prototype, "sweepFlag", {
569
+ get: function () {
570
+ return this._sweepFlag;
571
+ },
572
+ set: function (sweepFlag) {
573
+ this._sweepFlag = sweepFlag;
574
+ this._segmentChanged();
575
+ },
576
+ enumerable: true
577
+ });
578
+ window.SVGPathSegArcRel = function (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
579
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_REL, "a", owningPathSegList);
580
+ this._x = x;
581
+ this._y = y;
582
+ this._r1 = r1;
583
+ this._r2 = r2;
584
+ this._angle = angle;
585
+ this._largeArcFlag = largeArcFlag;
586
+ this._sweepFlag = sweepFlag;
587
+ };
588
+ window.SVGPathSegArcRel.prototype = Object.create(window.SVGPathSeg.prototype);
589
+ window.SVGPathSegArcRel.prototype.toString = function () {
590
+ return "[object SVGPathSegArcRel]";
591
+ };
592
+ window.SVGPathSegArcRel.prototype._asPathString = function () {
593
+ return `${this.pathSegTypeAsLetter} ${this._r1} ${this._r2} ${this._angle} ${this._largeArcFlag ? "1" : "0"} ${this._sweepFlag ? "1" : "0"} ${this._x} ${this._y}`;
594
+ };
595
+ window.SVGPathSegArcRel.prototype.clone = function () {
596
+ return new window.SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag);
597
+ };
598
+ Object.defineProperty(window.SVGPathSegArcRel.prototype, "x", {
599
+ get: function () {
600
+ return this._x;
601
+ },
602
+ set: function (x) {
603
+ this._x = x;
604
+ this._segmentChanged();
605
+ },
606
+ enumerable: true
607
+ });
608
+ Object.defineProperty(window.SVGPathSegArcRel.prototype, "y", {
609
+ get: function () {
610
+ return this._y;
611
+ },
612
+ set: function (y) {
613
+ this._y = y;
614
+ this._segmentChanged();
615
+ },
616
+ enumerable: true
617
+ });
618
+ Object.defineProperty(window.SVGPathSegArcRel.prototype, "r1", {
619
+ get: function () {
620
+ return this._r1;
621
+ },
622
+ set: function (r1) {
623
+ this._r1 = r1;
624
+ this._segmentChanged();
625
+ },
626
+ enumerable: true
627
+ });
628
+ Object.defineProperty(window.SVGPathSegArcRel.prototype, "r2", {
629
+ get: function () {
630
+ return this._r2;
631
+ },
632
+ set: function (r2) {
633
+ this._r2 = r2;
634
+ this._segmentChanged();
635
+ },
636
+ enumerable: true
637
+ });
638
+ Object.defineProperty(window.SVGPathSegArcRel.prototype, "angle", {
639
+ get: function () {
640
+ return this._angle;
641
+ },
642
+ set: function (angle) {
643
+ this._angle = angle;
644
+ this._segmentChanged();
645
+ },
646
+ enumerable: true
647
+ });
648
+ Object.defineProperty(window.SVGPathSegArcRel.prototype, "largeArcFlag", {
649
+ get: function () {
650
+ return this._largeArcFlag;
651
+ },
652
+ set: function (largeArcFlag) {
653
+ this._largeArcFlag = largeArcFlag;
654
+ this._segmentChanged();
655
+ },
656
+ enumerable: true
657
+ });
658
+ Object.defineProperty(window.SVGPathSegArcRel.prototype, "sweepFlag", {
659
+ get: function () {
660
+ return this._sweepFlag;
661
+ },
662
+ set: function (sweepFlag) {
663
+ this._sweepFlag = sweepFlag;
664
+ this._segmentChanged();
665
+ },
666
+ enumerable: true
667
+ });
668
+ window.SVGPathSegLinetoHorizontalAbs = function (owningPathSegList, x) {
669
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, "H", owningPathSegList);
670
+ this._x = x;
671
+ };
672
+ window.SVGPathSegLinetoHorizontalAbs.prototype = Object.create(window.SVGPathSeg.prototype);
673
+ window.SVGPathSegLinetoHorizontalAbs.prototype.toString = function () {
674
+ return "[object SVGPathSegLinetoHorizontalAbs]";
675
+ };
676
+ window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString = function () {
677
+ return `${this.pathSegTypeAsLetter} ${this._x}`;
678
+ };
679
+ window.SVGPathSegLinetoHorizontalAbs.prototype.clone = function () {
680
+ return new window.SVGPathSegLinetoHorizontalAbs(undefined, this._x);
681
+ };
682
+ Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype, "x", {
683
+ get: function () {
684
+ return this._x;
685
+ },
686
+ set: function (x) {
687
+ this._x = x;
688
+ this._segmentChanged();
689
+ },
690
+ enumerable: true
691
+ });
692
+ window.SVGPathSegLinetoHorizontalRel = function (owningPathSegList, x) {
693
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, "h", owningPathSegList);
694
+ this._x = x;
695
+ };
696
+ window.SVGPathSegLinetoHorizontalRel.prototype = Object.create(window.SVGPathSeg.prototype);
697
+ window.SVGPathSegLinetoHorizontalRel.prototype.toString = function () {
698
+ return "[object SVGPathSegLinetoHorizontalRel]";
699
+ };
700
+ window.SVGPathSegLinetoHorizontalRel.prototype._asPathString = function () {
701
+ return `${this.pathSegTypeAsLetter} ${this._x}`;
702
+ };
703
+ window.SVGPathSegLinetoHorizontalRel.prototype.clone = function () {
704
+ return new window.SVGPathSegLinetoHorizontalRel(undefined, this._x);
705
+ };
706
+ Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype, "x", {
707
+ get: function () {
708
+ return this._x;
709
+ },
710
+ set: function (x) {
711
+ this._x = x;
712
+ this._segmentChanged();
713
+ },
714
+ enumerable: true
715
+ });
716
+ window.SVGPathSegLinetoVerticalAbs = function (owningPathSegList, y) {
717
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, "V", owningPathSegList);
718
+ this._y = y;
719
+ };
720
+ window.SVGPathSegLinetoVerticalAbs.prototype = Object.create(window.SVGPathSeg.prototype);
721
+ window.SVGPathSegLinetoVerticalAbs.prototype.toString = function () {
722
+ return "[object SVGPathSegLinetoVerticalAbs]";
723
+ };
724
+ window.SVGPathSegLinetoVerticalAbs.prototype._asPathString = function () {
725
+ return `${this.pathSegTypeAsLetter} ${this._y}`;
726
+ };
727
+ window.SVGPathSegLinetoVerticalAbs.prototype.clone = function () {
728
+ return new window.SVGPathSegLinetoVerticalAbs(undefined, this._y);
729
+ };
730
+ Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype, "y", {
731
+ get: function () {
732
+ return this._y;
733
+ },
734
+ set: function (y) {
735
+ this._y = y;
736
+ this._segmentChanged();
737
+ },
738
+ enumerable: true
739
+ });
740
+ window.SVGPathSegLinetoVerticalRel = function (owningPathSegList, y) {
741
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, "v", owningPathSegList);
742
+ this._y = y;
743
+ };
744
+ window.SVGPathSegLinetoVerticalRel.prototype = Object.create(window.SVGPathSeg.prototype);
745
+ window.SVGPathSegLinetoVerticalRel.prototype.toString = function () {
746
+ return "[object SVGPathSegLinetoVerticalRel]";
747
+ };
748
+ window.SVGPathSegLinetoVerticalRel.prototype._asPathString = function () {
749
+ return `${this.pathSegTypeAsLetter} ${this._y}`;
750
+ };
751
+ window.SVGPathSegLinetoVerticalRel.prototype.clone = function () {
752
+ return new window.SVGPathSegLinetoVerticalRel(undefined, this._y);
753
+ };
754
+ Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype, "y", {
755
+ get: function () {
756
+ return this._y;
757
+ },
758
+ set: function (y) {
759
+ this._y = y;
760
+ this._segmentChanged();
761
+ },
762
+ enumerable: true
763
+ });
764
+ window.SVGPathSegCurvetoCubicSmoothAbs = function (owningPathSegList, x, y, x2, y2) {
765
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, "S", owningPathSegList);
766
+ this._x = x;
767
+ this._y = y;
768
+ this._x2 = x2;
769
+ this._y2 = y2;
770
+ };
771
+ window.SVGPathSegCurvetoCubicSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype);
772
+ window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString = function () {
773
+ return "[object SVGPathSegCurvetoCubicSmoothAbs]";
774
+ };
775
+ window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString = function () {
776
+ return `${this.pathSegTypeAsLetter} ${this._x2} ${this._y2} ${this._x} ${this._y}`;
777
+ };
778
+ window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone = function () {
779
+ return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2);
780
+ };
781
+ Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x", {
782
+ get: function () {
783
+ return this._x;
784
+ },
785
+ set: function (x) {
786
+ this._x = x;
787
+ this._segmentChanged();
788
+ },
789
+ enumerable: true
790
+ });
791
+ Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y", {
792
+ get: function () {
793
+ return this._y;
794
+ },
795
+ set: function (y) {
796
+ this._y = y;
797
+ this._segmentChanged();
798
+ },
799
+ enumerable: true
800
+ });
801
+ Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x2", {
802
+ get: function () {
803
+ return this._x2;
804
+ },
805
+ set: function (x2) {
806
+ this._x2 = x2;
807
+ this._segmentChanged();
808
+ },
809
+ enumerable: true
810
+ });
811
+ Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y2", {
812
+ get: function () {
813
+ return this._y2;
814
+ },
815
+ set: function (y2) {
816
+ this._y2 = y2;
817
+ this._segmentChanged();
818
+ },
819
+ enumerable: true
820
+ });
821
+ window.SVGPathSegCurvetoCubicSmoothRel = function (owningPathSegList, x, y, x2, y2) {
822
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, "s", owningPathSegList);
823
+ this._x = x;
824
+ this._y = y;
825
+ this._x2 = x2;
826
+ this._y2 = y2;
827
+ };
828
+ window.SVGPathSegCurvetoCubicSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype);
829
+ window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString = function () {
830
+ return "[object SVGPathSegCurvetoCubicSmoothRel]";
831
+ };
832
+ window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString = function () {
833
+ return `${this.pathSegTypeAsLetter} ${this._x2} ${this._y2} ${this._x} ${this._y}`;
834
+ };
835
+ window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone = function () {
836
+ return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2);
837
+ };
838
+ Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x", {
839
+ get: function () {
840
+ return this._x;
841
+ },
842
+ set: function (x) {
843
+ this._x = x;
844
+ this._segmentChanged();
845
+ },
846
+ enumerable: true
847
+ });
848
+ Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y", {
849
+ get: function () {
850
+ return this._y;
851
+ },
852
+ set: function (y) {
853
+ this._y = y;
854
+ this._segmentChanged();
855
+ },
856
+ enumerable: true
857
+ });
858
+ Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x2", {
859
+ get: function () {
860
+ return this._x2;
861
+ },
862
+ set: function (x2) {
863
+ this._x2 = x2;
864
+ this._segmentChanged();
865
+ },
866
+ enumerable: true
867
+ });
868
+ Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y2", {
869
+ get: function () {
870
+ return this._y2;
871
+ },
872
+ set: function (y2) {
873
+ this._y2 = y2;
874
+ this._segmentChanged();
875
+ },
876
+ enumerable: true
877
+ });
878
+ window.SVGPathSegCurvetoQuadraticSmoothAbs = function (owningPathSegList, x, y) {
879
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, "T", owningPathSegList);
880
+ this._x = x;
881
+ this._y = y;
882
+ };
883
+ window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype);
884
+ window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString = function () {
885
+ return "[object SVGPathSegCurvetoQuadraticSmoothAbs]";
886
+ };
887
+ window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString = function () {
888
+ return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
889
+ };
890
+ window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone = function () {
891
+ return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y);
892
+ };
893
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "x", {
894
+ get: function () {
895
+ return this._x;
896
+ },
897
+ set: function (x) {
898
+ this._x = x;
899
+ this._segmentChanged();
900
+ },
901
+ enumerable: true
902
+ });
903
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "y", {
904
+ get: function () {
905
+ return this._y;
906
+ },
907
+ set: function (y) {
908
+ this._y = y;
909
+ this._segmentChanged();
910
+ },
911
+ enumerable: true
912
+ });
913
+ window.SVGPathSegCurvetoQuadraticSmoothRel = function (owningPathSegList, x, y) {
914
+ window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, "t", owningPathSegList);
915
+ this._x = x;
916
+ this._y = y;
917
+ };
918
+ window.SVGPathSegCurvetoQuadraticSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype);
919
+ window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString = function () {
920
+ return "[object SVGPathSegCurvetoQuadraticSmoothRel]";
921
+ };
922
+ window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString = function () {
923
+ return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
924
+ };
925
+ window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone = function () {
926
+ return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y);
927
+ };
928
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "x", {
929
+ get: function () {
930
+ return this._x;
931
+ },
932
+ set: function (x) {
933
+ this._x = x;
934
+ this._segmentChanged();
935
+ },
936
+ enumerable: true
937
+ });
938
+ Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "y", {
939
+ get: function () {
940
+ return this._y;
941
+ },
942
+ set: function (y) {
943
+ this._y = y;
944
+ this._segmentChanged();
945
+ },
946
+ enumerable: true
947
+ });
948
+ window.SVGPathElement.prototype.createSVGPathSegClosePath = function () {
949
+ return new window.SVGPathSegClosePath(undefined);
950
+ };
951
+ window.SVGPathElement.prototype.createSVGPathSegMovetoAbs = function (x, y) {
952
+ return new window.SVGPathSegMovetoAbs(undefined, x, y);
953
+ };
954
+ window.SVGPathElement.prototype.createSVGPathSegMovetoRel = function (x, y) {
955
+ return new window.SVGPathSegMovetoRel(undefined, x, y);
956
+ };
957
+ window.SVGPathElement.prototype.createSVGPathSegLinetoAbs = function (x, y) {
958
+ return new window.SVGPathSegLinetoAbs(undefined, x, y);
959
+ };
960
+ window.SVGPathElement.prototype.createSVGPathSegLinetoRel = function (x, y) {
961
+ return new window.SVGPathSegLinetoRel(undefined, x, y);
962
+ };
963
+ window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function (x, y, x1, y1, x2, y2) {
964
+ return new window.SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2);
965
+ };
966
+ window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function (x, y, x1, y1, x2, y2) {
967
+ return new window.SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2);
968
+ };
969
+ window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function (x, y, x1, y1) {
970
+ return new window.SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1);
971
+ };
972
+ window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function (x, y, x1, y1) {
973
+ return new window.SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1);
974
+ };
975
+ window.SVGPathElement.prototype.createSVGPathSegArcAbs = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
976
+ return new window.SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
977
+ };
978
+ window.SVGPathElement.prototype.createSVGPathSegArcRel = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
979
+ return new window.SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
980
+ };
981
+ window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function (x) {
982
+ return new window.SVGPathSegLinetoHorizontalAbs(undefined, x);
983
+ };
984
+ window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function (x) {
985
+ return new window.SVGPathSegLinetoHorizontalRel(undefined, x);
986
+ };
987
+ window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function (y) {
988
+ return new window.SVGPathSegLinetoVerticalAbs(undefined, y);
989
+ };
990
+ window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function (y) {
991
+ return new window.SVGPathSegLinetoVerticalRel(undefined, y);
992
+ };
993
+ window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function (x, y, x2, y2) {
994
+ return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2);
995
+ };
996
+ window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function (x, y, x2, y2) {
997
+ return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2);
998
+ };
999
+ window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function (x, y) {
1000
+ return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y);
1001
+ };
1002
+ window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function (x, y) {
1003
+ return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y);
1004
+ };
1005
+ if (!("getPathSegAtLength" in window.SVGPathElement.prototype)) {
1006
+ window.SVGPathElement.prototype.getPathSegAtLength = function (distance) {
1007
+ if (distance === undefined || !isFinite(distance)) throw "Invalid arguments.";
1008
+ const measurementElement = document.createElementNS("http://www.w3.org/2000/svg", "path");
1009
+ measurementElement.setAttribute("d", this.getAttribute("d"));
1010
+ let lastPathSegment = measurementElement.pathSegList.numberOfItems - 1;
1011
+ if (lastPathSegment <= 0) return 0;
1012
+ do {
1013
+ measurementElement.pathSegList.removeItem(lastPathSegment);
1014
+ if (distance > measurementElement.getTotalLength()) break;
1015
+ lastPathSegment--;
1016
+ } while (lastPathSegment > 0);
1017
+ return lastPathSegment;
1018
+ };
1019
+ }
1020
+ }
1021
+ if (!("SVGPathSegList" in window) || !("appendItem" in window.SVGPathSegList.prototype)) {
1022
+ window.SVGPathSegList = function (pathElement) {
1023
+ this._pathElement = pathElement;
1024
+ this._list = this._parsePath(this._pathElement.getAttribute("d"));
1025
+ this._mutationObserverConfig = {
1026
+ attributes: true,
1027
+ attributeFilter: ["d"]
1028
+ };
1029
+ this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));
1030
+ this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
1031
+ };
1032
+ window.SVGPathSegList.prototype.classname = "SVGPathSegList";
1033
+ Object.defineProperty(window.SVGPathSegList.prototype, "numberOfItems", {
1034
+ get: function () {
1035
+ this._checkPathSynchronizedToList();
1036
+ return this._list.length;
1037
+ },
1038
+ enumerable: true
1039
+ });
1040
+ Object.defineProperty(window.SVGPathSegList.prototype, "length", {
1041
+ get: function () {
1042
+ this._checkPathSynchronizedToList();
1043
+ return this._list.length;
1044
+ },
1045
+ enumerable: true
1046
+ });
1047
+ Object.defineProperty(window.SVGPathElement.prototype, "pathSegList", {
1048
+ get: function () {
1049
+ if (!this._pathSegList) this._pathSegList = new window.SVGPathSegList(this);
1050
+ return this._pathSegList;
1051
+ },
1052
+ enumerable: true
1053
+ });
1054
+ Object.defineProperty(window.SVGPathElement.prototype, "normalizedPathSegList", {
1055
+ get: function () {
1056
+ return this.pathSegList;
1057
+ },
1058
+ enumerable: true
1059
+ });
1060
+ Object.defineProperty(window.SVGPathElement.prototype, "animatedPathSegList", {
1061
+ get: function () {
1062
+ return this.pathSegList;
1063
+ },
1064
+ enumerable: true
1065
+ });
1066
+ Object.defineProperty(window.SVGPathElement.prototype, "animatedNormalizedPathSegList", {
1067
+ get: function () {
1068
+ return this.pathSegList;
1069
+ },
1070
+ enumerable: true
1071
+ });
1072
+ window.SVGPathSegList.prototype._checkPathSynchronizedToList = function () {
1073
+ this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
1074
+ };
1075
+ window.SVGPathSegList.prototype._updateListFromPathMutations = function (mutationRecords) {
1076
+ if (!this._pathElement) return;
1077
+ let hasPathMutations = false;
1078
+ mutationRecords.forEach(function (record) {
1079
+ if (record.attributeName == "d") hasPathMutations = true;
1080
+ });
1081
+ if (hasPathMutations) this._list = this._parsePath(this._pathElement.getAttribute("d"));
1082
+ };
1083
+ window.SVGPathSegList.prototype._writeListToPath = function () {
1084
+ this._pathElementMutationObserver.disconnect();
1085
+ this._pathElement.setAttribute("d", window.SVGPathSegList._pathSegArrayAsString(this._list));
1086
+ this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
1087
+ };
1088
+ window.SVGPathSegList.prototype.segmentChanged = function (pathSeg) {
1089
+ this._writeListToPath();
1090
+ };
1091
+ window.SVGPathSegList.prototype.clear = function () {
1092
+ this._checkPathSynchronizedToList();
1093
+ this._list.forEach(function (pathSeg) {
1094
+ pathSeg._owningPathSegList = null;
1095
+ });
1096
+ this._list = [];
1097
+ this._writeListToPath();
1098
+ };
1099
+ window.SVGPathSegList.prototype.initialize = function (newItem) {
1100
+ this._checkPathSynchronizedToList();
1101
+ this._list = [newItem];
1102
+ newItem._owningPathSegList = this;
1103
+ this._writeListToPath();
1104
+ return newItem;
1105
+ };
1106
+ window.SVGPathSegList.prototype._checkValidIndex = function (index) {
1107
+ if (isNaN(index) || index < 0 || index >= this.numberOfItems) throw "INDEX_SIZE_ERR";
1108
+ };
1109
+ window.SVGPathSegList.prototype.getItem = function (index) {
1110
+ this._checkPathSynchronizedToList();
1111
+ this._checkValidIndex(index);
1112
+ return this._list[index];
1113
+ };
1114
+ window.SVGPathSegList.prototype.insertItemBefore = function (newItem, index) {
1115
+ this._checkPathSynchronizedToList();
1116
+ if (index > this.numberOfItems) index = this.numberOfItems;
1117
+ if (newItem._owningPathSegList) {
1118
+ newItem = newItem.clone();
1119
+ }
1120
+ this._list.splice(index, 0, newItem);
1121
+ newItem._owningPathSegList = this;
1122
+ this._writeListToPath();
1123
+ return newItem;
1124
+ };
1125
+ window.SVGPathSegList.prototype.replaceItem = function (newItem, index) {
1126
+ this._checkPathSynchronizedToList();
1127
+ if (newItem._owningPathSegList) {
1128
+ newItem = newItem.clone();
1129
+ }
1130
+ this._checkValidIndex(index);
1131
+ this._list[index] = newItem;
1132
+ newItem._owningPathSegList = this;
1133
+ this._writeListToPath();
1134
+ return newItem;
1135
+ };
1136
+ window.SVGPathSegList.prototype.removeItem = function (index) {
1137
+ this._checkPathSynchronizedToList();
1138
+ this._checkValidIndex(index);
1139
+ const item = this._list[index];
1140
+ this._list.splice(index, 1);
1141
+ this._writeListToPath();
1142
+ return item;
1143
+ };
1144
+ window.SVGPathSegList.prototype.appendItem = function (newItem) {
1145
+ this._checkPathSynchronizedToList();
1146
+ if (newItem._owningPathSegList) {
1147
+ newItem = newItem.clone();
1148
+ }
1149
+ this._list.push(newItem);
1150
+ newItem._owningPathSegList = this;
1151
+ this._writeListToPath();
1152
+ return newItem;
1153
+ };
1154
+ window.SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
1155
+ let string = "";
1156
+ let first = true;
1157
+ pathSegArray.forEach(function (pathSeg) {
1158
+ if (first) {
1159
+ first = false;
1160
+ string += pathSeg._asPathString();
1161
+ } else {
1162
+ string += ` ${pathSeg._asPathString()}`;
1163
+ }
1164
+ });
1165
+ return string;
1166
+ };
1167
+ window.SVGPathSegList.prototype._parsePath = function (string) {
1168
+ if (!string || !string.length) return [];
1169
+ const owningPathSegList = this;
1170
+ const Builder = function () {
1171
+ this.pathSegList = [];
1172
+ };
1173
+ Builder.prototype.appendSegment = function (pathSeg) {
1174
+ this.pathSegList.push(pathSeg);
1175
+ };
1176
+ const Source = function (string) {
1177
+ this._string = string;
1178
+ this._currentIndex = 0;
1179
+ this._endIndex = this._string.length;
1180
+ this._previousCommand = window.SVGPathSeg.PATHSEG_UNKNOWN;
1181
+ this._skipOptionalSpaces();
1182
+ };
1183
+ Source.prototype._isCurrentSpace = function () {
1184
+ const character = this._string[this._currentIndex];
1185
+ return character <= " " && (character == " " || character == "\n" || character == "\t" || character == "\r" || character == "\f");
1186
+ };
1187
+ Source.prototype._skipOptionalSpaces = function () {
1188
+ while (this._currentIndex < this._endIndex && this._isCurrentSpace()) this._currentIndex++;
1189
+ return this._currentIndex < this._endIndex;
1190
+ };
1191
+ Source.prototype._skipOptionalSpacesOrDelimiter = function () {
1192
+ if (this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string.charAt(this._currentIndex) != ",") return false;
1193
+ if (this._skipOptionalSpaces()) {
1194
+ if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ",") {
1195
+ this._currentIndex++;
1196
+ this._skipOptionalSpaces();
1197
+ }
1198
+ }
1199
+ return this._currentIndex < this._endIndex;
1200
+ };
1201
+ Source.prototype.hasMoreData = function () {
1202
+ return this._currentIndex < this._endIndex;
1203
+ };
1204
+ Source.prototype.peekSegmentType = function () {
1205
+ const lookahead = this._string[this._currentIndex];
1206
+ return this._pathSegTypeFromChar(lookahead);
1207
+ };
1208
+ Source.prototype._pathSegTypeFromChar = function (lookahead) {
1209
+ switch (lookahead) {
1210
+ case "Z":
1211
+ case "z":
1212
+ return window.SVGPathSeg.PATHSEG_CLOSEPATH;
1213
+ case "M":
1214
+ return window.SVGPathSeg.PATHSEG_MOVETO_ABS;
1215
+ case "m":
1216
+ return window.SVGPathSeg.PATHSEG_MOVETO_REL;
1217
+ case "L":
1218
+ return window.SVGPathSeg.PATHSEG_LINETO_ABS;
1219
+ case "l":
1220
+ return window.SVGPathSeg.PATHSEG_LINETO_REL;
1221
+ case "C":
1222
+ return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;
1223
+ case "c":
1224
+ return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;
1225
+ case "Q":
1226
+ return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;
1227
+ case "q":
1228
+ return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;
1229
+ case "A":
1230
+ return window.SVGPathSeg.PATHSEG_ARC_ABS;
1231
+ case "a":
1232
+ return window.SVGPathSeg.PATHSEG_ARC_REL;
1233
+ case "H":
1234
+ return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;
1235
+ case "h":
1236
+ return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;
1237
+ case "V":
1238
+ return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;
1239
+ case "v":
1240
+ return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;
1241
+ case "S":
1242
+ return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
1243
+ case "s":
1244
+ return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
1245
+ case "T":
1246
+ return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
1247
+ case "t":
1248
+ return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
1249
+ default:
1250
+ return window.SVGPathSeg.PATHSEG_UNKNOWN;
1251
+ }
1252
+ };
1253
+ Source.prototype._nextCommandHelper = function (lookahead, previousCommand) {
1254
+ if ((lookahead == "+" || lookahead == "-" || lookahead == "." || lookahead >= "0" && lookahead <= "9") && previousCommand != window.SVGPathSeg.PATHSEG_CLOSEPATH) {
1255
+ if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_ABS) return window.SVGPathSeg.PATHSEG_LINETO_ABS;
1256
+ if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_REL) return window.SVGPathSeg.PATHSEG_LINETO_REL;
1257
+ return previousCommand;
1258
+ }
1259
+ return window.SVGPathSeg.PATHSEG_UNKNOWN;
1260
+ };
1261
+ Source.prototype.initialCommandIsMoveTo = function () {
1262
+ if (!this.hasMoreData()) return true;
1263
+ const command = this.peekSegmentType();
1264
+ return command == window.SVGPathSeg.PATHSEG_MOVETO_ABS || command == window.SVGPathSeg.PATHSEG_MOVETO_REL;
1265
+ };
1266
+ Source.prototype._parseNumber = function () {
1267
+ let exponent = 0;
1268
+ let integer = 0;
1269
+ let frac = 1;
1270
+ let decimal = 0;
1271
+ let sign = 1;
1272
+ let expsign = 1;
1273
+ const startIndex = this._currentIndex;
1274
+ this._skipOptionalSpaces();
1275
+ if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "+") this._currentIndex++;else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "-") {
1276
+ this._currentIndex++;
1277
+ sign = -1;
1278
+ }
1279
+ if (this._currentIndex == this._endIndex || (this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") && this._string.charAt(this._currentIndex) != ".") return undefined;
1280
+ const startIntPartIndex = this._currentIndex;
1281
+ while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") this._currentIndex++;
1282
+ if (this._currentIndex != startIntPartIndex) {
1283
+ let scanIntPartIndex = this._currentIndex - 1;
1284
+ let multiplier = 1;
1285
+ while (scanIntPartIndex >= startIntPartIndex) {
1286
+ integer += multiplier * (this._string.charAt(scanIntPartIndex--) - "0");
1287
+ multiplier *= 10;
1288
+ }
1289
+ }
1290
+ if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ".") {
1291
+ this._currentIndex++;
1292
+ if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") return undefined;
1293
+ while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") {
1294
+ frac *= 10;
1295
+ decimal += (this._string.charAt(this._currentIndex) - "0") / frac;
1296
+ this._currentIndex += 1;
1297
+ }
1298
+ }
1299
+ if (this._currentIndex != startIndex && this._currentIndex + 1 < this._endIndex && (this._string.charAt(this._currentIndex) == "e" || this._string.charAt(this._currentIndex) == "E") && this._string.charAt(this._currentIndex + 1) != "x" && this._string.charAt(this._currentIndex + 1) != "m") {
1300
+ this._currentIndex++;
1301
+ if (this._string.charAt(this._currentIndex) == "+") {
1302
+ this._currentIndex++;
1303
+ } else if (this._string.charAt(this._currentIndex) == "-") {
1304
+ this._currentIndex++;
1305
+ expsign = -1;
1306
+ }
1307
+ if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") return undefined;
1308
+ while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") {
1309
+ exponent *= 10;
1310
+ exponent += this._string.charAt(this._currentIndex) - "0";
1311
+ this._currentIndex++;
1312
+ }
1313
+ }
1314
+ let number = integer + decimal;
1315
+ number *= sign;
1316
+ if (exponent) number *= Math.pow(10, expsign * exponent);
1317
+ if (startIndex == this._currentIndex) return undefined;
1318
+ this._skipOptionalSpacesOrDelimiter();
1319
+ return number;
1320
+ };
1321
+ Source.prototype._parseArcFlag = function () {
1322
+ if (this._currentIndex >= this._endIndex) return undefined;
1323
+ let flag = false;
1324
+ const flagChar = this._string.charAt(this._currentIndex++);
1325
+ if (flagChar == "0") flag = false;else if (flagChar == "1") flag = true;else return undefined;
1326
+ this._skipOptionalSpacesOrDelimiter();
1327
+ return flag;
1328
+ };
1329
+ Source.prototype.parseSegment = function () {
1330
+ const lookahead = this._string[this._currentIndex];
1331
+ let command = this._pathSegTypeFromChar(lookahead);
1332
+ if (command == window.SVGPathSeg.PATHSEG_UNKNOWN) {
1333
+ if (this._previousCommand == window.SVGPathSeg.PATHSEG_UNKNOWN) return null;
1334
+ command = this._nextCommandHelper(lookahead, this._previousCommand);
1335
+ if (command == window.SVGPathSeg.PATHSEG_UNKNOWN) return null;
1336
+ } else {
1337
+ this._currentIndex++;
1338
+ }
1339
+ this._previousCommand = command;
1340
+ let points;
1341
+ switch (command) {
1342
+ case window.SVGPathSeg.PATHSEG_MOVETO_REL:
1343
+ return new window.SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());
1344
+ case window.SVGPathSeg.PATHSEG_MOVETO_ABS:
1345
+ return new window.SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
1346
+ case window.SVGPathSeg.PATHSEG_LINETO_REL:
1347
+ return new window.SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());
1348
+ case window.SVGPathSeg.PATHSEG_LINETO_ABS:
1349
+ return new window.SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
1350
+ case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:
1351
+ return new window.SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber());
1352
+ case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:
1353
+ return new window.SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber());
1354
+ case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:
1355
+ return new window.SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber());
1356
+ case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:
1357
+ return new window.SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber());
1358
+ case window.SVGPathSeg.PATHSEG_CLOSEPATH:
1359
+ this._skipOptionalSpaces();
1360
+ return new window.SVGPathSegClosePath(owningPathSegList);
1361
+ case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:
1362
+ points = {
1363
+ x1: this._parseNumber(),
1364
+ y1: this._parseNumber(),
1365
+ x2: this._parseNumber(),
1366
+ y2: this._parseNumber(),
1367
+ x: this._parseNumber(),
1368
+ y: this._parseNumber()
1369
+ };
1370
+ return new window.SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
1371
+ case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:
1372
+ points = {
1373
+ x1: this._parseNumber(),
1374
+ y1: this._parseNumber(),
1375
+ x2: this._parseNumber(),
1376
+ y2: this._parseNumber(),
1377
+ x: this._parseNumber(),
1378
+ y: this._parseNumber()
1379
+ };
1380
+ return new window.SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
1381
+ case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
1382
+ points = {
1383
+ x2: this._parseNumber(),
1384
+ y2: this._parseNumber(),
1385
+ x: this._parseNumber(),
1386
+ y: this._parseNumber()
1387
+ };
1388
+ return new window.SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2);
1389
+ case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
1390
+ points = {
1391
+ x2: this._parseNumber(),
1392
+ y2: this._parseNumber(),
1393
+ x: this._parseNumber(),
1394
+ y: this._parseNumber()
1395
+ };
1396
+ return new window.SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2);
1397
+ case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:
1398
+ points = {
1399
+ x1: this._parseNumber(),
1400
+ y1: this._parseNumber(),
1401
+ x: this._parseNumber(),
1402
+ y: this._parseNumber()
1403
+ };
1404
+ return new window.SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1);
1405
+ case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:
1406
+ points = {
1407
+ x1: this._parseNumber(),
1408
+ y1: this._parseNumber(),
1409
+ x: this._parseNumber(),
1410
+ y: this._parseNumber()
1411
+ };
1412
+ return new window.SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1);
1413
+ case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
1414
+ return new window.SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber());
1415
+ case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
1416
+ return new window.SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
1417
+ case window.SVGPathSeg.PATHSEG_ARC_REL:
1418
+ points = {
1419
+ x1: this._parseNumber(),
1420
+ y1: this._parseNumber(),
1421
+ arcAngle: this._parseNumber(),
1422
+ arcLarge: this._parseArcFlag(),
1423
+ arcSweep: this._parseArcFlag(),
1424
+ x: this._parseNumber(),
1425
+ y: this._parseNumber()
1426
+ };
1427
+ return new window.SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
1428
+ case window.SVGPathSeg.PATHSEG_ARC_ABS:
1429
+ points = {
1430
+ x1: this._parseNumber(),
1431
+ y1: this._parseNumber(),
1432
+ arcAngle: this._parseNumber(),
1433
+ arcLarge: this._parseArcFlag(),
1434
+ arcSweep: this._parseArcFlag(),
1435
+ x: this._parseNumber(),
1436
+ y: this._parseNumber()
1437
+ };
1438
+ return new window.SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
1439
+ default:
1440
+ throw "Unknown path seg type.";
1441
+ }
1442
+ };
1443
+ const builder = new Builder();
1444
+ const source = new Source(string);
1445
+ if (!source.initialCommandIsMoveTo()) return [];
1446
+ while (source.hasMoreData()) {
1447
+ const pathSeg = source.parseSegment();
1448
+ if (!pathSeg) return [];
1449
+ builder.appendSegment(pathSeg);
1450
+ }
1451
+ return builder.pathSegList;
1452
+ };
1453
+ }
1454
+ } catch (e) {
1455
+ console.warn("An error occurred in tsParticles pathseg polyfill. If the Polygon Mask is not working, please open an issue here: https://github.com/matteobruni/tsparticles", e);
1456
+ }
1457
+ })();
1458
+
1459
+ /***/ }),
1460
+
1461
+ /***/ 533:
1462
+ /***/ ((module) => {
1463
+
1464
+ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
1465
+
1466
+ /***/ })
1467
+
1468
+ /******/ });
1469
+ /************************************************************************/
1470
+ /******/ // The module cache
1471
+ /******/ var __webpack_module_cache__ = {};
1472
+ /******/
1473
+ /******/ // The require function
1474
+ /******/ function __webpack_require__(moduleId) {
1475
+ /******/ // Check if module is in cache
1476
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
1477
+ /******/ if (cachedModule !== undefined) {
1478
+ /******/ return cachedModule.exports;
1479
+ /******/ }
1480
+ /******/ // Create a new module (and put it into the cache)
1481
+ /******/ var module = __webpack_module_cache__[moduleId] = {
1482
+ /******/ // no module.id needed
1483
+ /******/ // no module.loaded needed
1484
+ /******/ exports: {}
1485
+ /******/ };
1486
+ /******/
1487
+ /******/ // Execute the module function
1488
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1489
+ /******/
1490
+ /******/ // Return the exports of the module
1491
+ /******/ return module.exports;
1492
+ /******/ }
1493
+ /******/
1494
+ /************************************************************************/
1495
+ /******/ /* webpack/runtime/define property getters */
1496
+ /******/ (() => {
1497
+ /******/ // define getter functions for harmony exports
1498
+ /******/ __webpack_require__.d = (exports, definition) => {
1499
+ /******/ for(var key in definition) {
1500
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1501
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1502
+ /******/ }
1503
+ /******/ }
1504
+ /******/ };
1505
+ /******/ })();
1506
+ /******/
1507
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1508
+ /******/ (() => {
1509
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1510
+ /******/ })();
1511
+ /******/
1512
+ /******/ /* webpack/runtime/make namespace object */
1513
+ /******/ (() => {
1514
+ /******/ // define __esModule on exports
1515
+ /******/ __webpack_require__.r = (exports) => {
1516
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1517
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1518
+ /******/ }
1519
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
1520
+ /******/ };
1521
+ /******/ })();
1522
+ /******/
1523
+ /************************************************************************/
1524
+ var __webpack_exports__ = {};
1525
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
1526
+ (() => {
1527
+ // ESM COMPAT FLAG
1528
+ __webpack_require__.r(__webpack_exports__);
1529
+
1530
+ // EXPORTS
1531
+ __webpack_require__.d(__webpack_exports__, {
1532
+ "loadPolygonMaskPlugin": () => (/* binding */ loadPolygonMaskPlugin)
1533
+ });
1534
+
1535
+ // EXTERNAL MODULE: ./dist/browser/pathseg.js
1536
+ var pathseg = __webpack_require__(505);
1537
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
1538
+ var engine_root_window_ = __webpack_require__(533);
1539
+ ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/PolygonMaskDrawStroke.js
1540
+
1541
+ class PolygonMaskDrawStroke {
1542
+ constructor() {
1543
+ this.color = new engine_root_window_.OptionsColor();
1544
+ this.width = 0.5;
1545
+ this.opacity = 1;
1546
+ }
1547
+ load(data) {
1548
+ var _a;
1549
+ if (!data) {
1550
+ return;
1551
+ }
1552
+ this.color = engine_root_window_.OptionsColor.create(this.color, data.color);
1553
+ if (typeof this.color.value === "string") {
1554
+ this.opacity = (_a = (0,engine_root_window_.stringToAlpha)(this.color.value)) !== null && _a !== void 0 ? _a : this.opacity;
1555
+ }
1556
+ if (data.opacity !== undefined) {
1557
+ this.opacity = data.opacity;
1558
+ }
1559
+ if (data.width !== undefined) {
1560
+ this.width = data.width;
1561
+ }
1562
+ }
1563
+ }
1564
+ ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/PolygonMaskDraw.js
1565
+
1566
+
1567
+ class PolygonMaskDraw {
1568
+ constructor() {
1569
+ this.enable = false;
1570
+ this.stroke = new PolygonMaskDrawStroke();
1571
+ }
1572
+ get lineColor() {
1573
+ return this.stroke.color;
1574
+ }
1575
+ set lineColor(value) {
1576
+ this.stroke.color = engine_root_window_.OptionsColor.create(this.stroke.color, value);
1577
+ }
1578
+ get lineWidth() {
1579
+ return this.stroke.width;
1580
+ }
1581
+ set lineWidth(value) {
1582
+ this.stroke.width = value;
1583
+ }
1584
+ load(data) {
1585
+ var _a;
1586
+ if (!data) {
1587
+ return;
1588
+ }
1589
+ if (data.enable !== undefined) {
1590
+ this.enable = data.enable;
1591
+ }
1592
+ const stroke = (_a = data.stroke) !== null && _a !== void 0 ? _a : {
1593
+ color: data.lineColor,
1594
+ width: data.lineWidth
1595
+ };
1596
+ this.stroke.load(stroke);
1597
+ }
1598
+ }
1599
+ ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/PolygonMaskInline.js
1600
+ class PolygonMaskInline {
1601
+ constructor() {
1602
+ this.arrangement = "one-per-point";
1603
+ }
1604
+ load(data) {
1605
+ if (!data) {
1606
+ return;
1607
+ }
1608
+ if (data.arrangement !== undefined) {
1609
+ this.arrangement = data.arrangement;
1610
+ }
1611
+ }
1612
+ }
1613
+ ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/PolygonMaskLocalSvg.js
1614
+ class PolygonMaskLocalSvg {
1615
+ constructor() {
1616
+ this.path = [];
1617
+ this.size = {
1618
+ height: 0,
1619
+ width: 0
1620
+ };
1621
+ }
1622
+ load(data) {
1623
+ if (!data) {
1624
+ return;
1625
+ }
1626
+ if (data.path !== undefined) {
1627
+ this.path = data.path;
1628
+ }
1629
+ if (data.size !== undefined) {
1630
+ if (data.size.width !== undefined) {
1631
+ this.size.width = data.size.width;
1632
+ }
1633
+ if (data.size.height !== undefined) {
1634
+ this.size.height = data.size.height;
1635
+ }
1636
+ }
1637
+ }
1638
+ }
1639
+ ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/PolygonMaskMove.js
1640
+ class PolygonMaskMove {
1641
+ constructor() {
1642
+ this.radius = 10;
1643
+ this.type = "path";
1644
+ }
1645
+ load(data) {
1646
+ if (!data) {
1647
+ return;
1648
+ }
1649
+ if (data.radius !== undefined) {
1650
+ this.radius = data.radius;
1651
+ }
1652
+ if (data.type !== undefined) {
1653
+ this.type = data.type;
1654
+ }
1655
+ }
1656
+ }
1657
+ ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/PolygonMask.js
1658
+
1659
+
1660
+
1661
+
1662
+
1663
+ class PolygonMask {
1664
+ constructor() {
1665
+ this.draw = new PolygonMaskDraw();
1666
+ this.enable = false;
1667
+ this.inline = new PolygonMaskInline();
1668
+ this.move = new PolygonMaskMove();
1669
+ this.scale = 1;
1670
+ this.type = "none";
1671
+ }
1672
+ get inlineArrangement() {
1673
+ return this.inline.arrangement;
1674
+ }
1675
+ set inlineArrangement(value) {
1676
+ this.inline.arrangement = value;
1677
+ }
1678
+ load(data) {
1679
+ if (!data) {
1680
+ return;
1681
+ }
1682
+ this.draw.load(data.draw);
1683
+ this.inline.load(data.inline);
1684
+ this.move.load(data.move);
1685
+ if (data.scale !== undefined) {
1686
+ this.scale = data.scale;
1687
+ }
1688
+ if (data.type !== undefined) {
1689
+ this.type = data.type;
1690
+ }
1691
+ if (data.enable !== undefined) {
1692
+ this.enable = data.enable;
1693
+ } else {
1694
+ this.enable = this.type !== "none";
1695
+ }
1696
+ if (data.url !== undefined) {
1697
+ this.url = data.url;
1698
+ }
1699
+ if (data.data !== undefined) {
1700
+ if (typeof data.data === "string") {
1701
+ this.data = data.data;
1702
+ } else {
1703
+ this.data = new PolygonMaskLocalSvg();
1704
+ this.data.load(data.data);
1705
+ }
1706
+ }
1707
+ if (data.position !== undefined) {
1708
+ this.position = (0,engine_root_window_.deepExtend)({}, data.position);
1709
+ }
1710
+ }
1711
+ }
1712
+ ;// CONCATENATED MODULE: ./dist/browser/utils.js
1713
+
1714
+ function drawPolygonMask(context, rawData, stroke) {
1715
+ const color = (0,engine_root_window_.rangeColorToRgb)(stroke.color);
1716
+ if (!color) {
1717
+ return;
1718
+ }
1719
+ context.beginPath();
1720
+ context.moveTo(rawData[0].x, rawData[0].y);
1721
+ for (const item of rawData) {
1722
+ context.lineTo(item.x, item.y);
1723
+ }
1724
+ context.closePath();
1725
+ context.strokeStyle = (0,engine_root_window_.getStyleFromRgb)(color);
1726
+ context.lineWidth = stroke.width;
1727
+ context.stroke();
1728
+ }
1729
+ function drawPolygonMaskPath(context, path, stroke, position) {
1730
+ context.setTransform(1, 0, 0, 1, position.x, position.y);
1731
+ const color = (0,engine_root_window_.rangeColorToRgb)(stroke.color);
1732
+ if (!color) {
1733
+ return;
1734
+ }
1735
+ context.strokeStyle = (0,engine_root_window_.getStyleFromRgb)(color, stroke.opacity);
1736
+ context.lineWidth = stroke.width;
1737
+ context.stroke(path);
1738
+ context.setTransform(1, 0, 0, 1, 0, 0);
1739
+ }
1740
+ function parsePaths(paths, scale, offset) {
1741
+ var _a;
1742
+ const res = [];
1743
+ for (const path of paths) {
1744
+ const segments = path.element.pathSegList,
1745
+ len = (_a = segments === null || segments === void 0 ? void 0 : segments.numberOfItems) !== null && _a !== void 0 ? _a : 0,
1746
+ p = {
1747
+ x: 0,
1748
+ y: 0
1749
+ };
1750
+ for (let i = 0; i < len; i++) {
1751
+ const segment = segments === null || segments === void 0 ? void 0 : segments.getItem(i);
1752
+ const svgPathSeg = window.SVGPathSeg;
1753
+ switch (segment === null || segment === void 0 ? void 0 : segment.pathSegType) {
1754
+ case svgPathSeg.PATHSEG_MOVETO_ABS:
1755
+ case svgPathSeg.PATHSEG_LINETO_ABS:
1756
+ case svgPathSeg.PATHSEG_CURVETO_CUBIC_ABS:
1757
+ case svgPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:
1758
+ case svgPathSeg.PATHSEG_ARC_ABS:
1759
+ case svgPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
1760
+ case svgPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
1761
+ {
1762
+ const absSeg = segment;
1763
+ p.x = absSeg.x;
1764
+ p.y = absSeg.y;
1765
+ break;
1766
+ }
1767
+ case svgPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:
1768
+ p.x = segment.x;
1769
+ break;
1770
+ case svgPathSeg.PATHSEG_LINETO_VERTICAL_ABS:
1771
+ p.y = segment.y;
1772
+ break;
1773
+ case svgPathSeg.PATHSEG_LINETO_REL:
1774
+ case svgPathSeg.PATHSEG_MOVETO_REL:
1775
+ case svgPathSeg.PATHSEG_CURVETO_CUBIC_REL:
1776
+ case svgPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:
1777
+ case svgPathSeg.PATHSEG_ARC_REL:
1778
+ case svgPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
1779
+ case svgPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
1780
+ {
1781
+ const relSeg = segment;
1782
+ p.x += relSeg.x;
1783
+ p.y += relSeg.y;
1784
+ break;
1785
+ }
1786
+ case svgPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:
1787
+ p.x += segment.x;
1788
+ break;
1789
+ case svgPathSeg.PATHSEG_LINETO_VERTICAL_REL:
1790
+ p.y += segment.y;
1791
+ break;
1792
+ case svgPathSeg.PATHSEG_UNKNOWN:
1793
+ case svgPathSeg.PATHSEG_CLOSEPATH:
1794
+ continue;
1795
+ }
1796
+ res.push({
1797
+ x: p.x * scale + offset.x,
1798
+ y: p.y * scale + offset.y
1799
+ });
1800
+ }
1801
+ }
1802
+ return res;
1803
+ }
1804
+ function calcClosestPtOnSegment(s1, s2, pos) {
1805
+ const {
1806
+ dx: dx1,
1807
+ dy: dy1
1808
+ } = (0,engine_root_window_.getDistances)(pos, s1),
1809
+ {
1810
+ dx: dx2,
1811
+ dy: dy2
1812
+ } = (0,engine_root_window_.getDistances)(s2, s1),
1813
+ t = (dx1 * dx2 + dy1 * dy2) / (dx2 ** 2 + dy2 ** 2),
1814
+ res = {
1815
+ x: s1.x + dx2 * t,
1816
+ y: s1.y + dy2 * t,
1817
+ isOnSegment: t >= 0 && t <= 1
1818
+ };
1819
+ if (t < 0) {
1820
+ res.x = s1.x;
1821
+ res.y = s1.y;
1822
+ } else if (t > 1) {
1823
+ res.x = s2.x;
1824
+ res.y = s2.y;
1825
+ }
1826
+ return res;
1827
+ }
1828
+ function segmentBounce(start, stop, velocity) {
1829
+ const {
1830
+ dx,
1831
+ dy
1832
+ } = (0,engine_root_window_.getDistances)(start, stop),
1833
+ wallAngle = Math.atan2(dy, dx),
1834
+ wallNormal = engine_root_window_.Vector.create(Math.sin(wallAngle), -Math.cos(wallAngle)),
1835
+ d = 2 * (velocity.x * wallNormal.x + velocity.y * wallNormal.y);
1836
+ wallNormal.multTo(d);
1837
+ velocity.subFrom(wallNormal);
1838
+ }
1839
+ ;// CONCATENATED MODULE: ./dist/browser/PolygonMaskInstance.js
1840
+
1841
+
1842
+ const noPolygonDataLoaded = "No polygon data loaded.",
1843
+ noPolygonFound = "No polygon found, you need to specify SVG url in config.";
1844
+ class PolygonMaskInstance {
1845
+ constructor(container, engine) {
1846
+ this._container = container;
1847
+ this._engine = engine;
1848
+ this.dimension = {
1849
+ height: 0,
1850
+ width: 0
1851
+ };
1852
+ this._moveRadius = 0;
1853
+ this._scale = 1;
1854
+ }
1855
+ clickPositionValid(position) {
1856
+ const options = this._container.actualOptions.polygon;
1857
+ return !!(options === null || options === void 0 ? void 0 : options.enable) && options.type !== "none" && options.type !== "inline" && this.checkInsidePolygon(position);
1858
+ }
1859
+ draw(context) {
1860
+ var _a;
1861
+ if (!((_a = this.paths) === null || _a === void 0 ? void 0 : _a.length)) {
1862
+ return;
1863
+ }
1864
+ const options = this._container.actualOptions.polygon;
1865
+ if (!(options === null || options === void 0 ? void 0 : options.enable)) {
1866
+ return;
1867
+ }
1868
+ const polygonDraw = options.draw;
1869
+ if (!polygonDraw.enable) {
1870
+ return;
1871
+ }
1872
+ const rawData = this.raw;
1873
+ for (const path of this.paths) {
1874
+ const path2d = path.path2d;
1875
+ if (!context) {
1876
+ continue;
1877
+ }
1878
+ if (path2d && this.offset) {
1879
+ drawPolygonMaskPath(context, path2d, polygonDraw.stroke, this.offset);
1880
+ } else if (rawData) {
1881
+ drawPolygonMask(context, rawData, polygonDraw.stroke);
1882
+ }
1883
+ }
1884
+ }
1885
+ async init() {
1886
+ const container = this._container,
1887
+ polygonMaskOptions = container.actualOptions.polygon,
1888
+ pxRatio = container.retina.pixelRatio;
1889
+ if (!polygonMaskOptions) {
1890
+ return;
1891
+ }
1892
+ this._moveRadius = polygonMaskOptions.move.radius * pxRatio;
1893
+ this._scale = polygonMaskOptions.scale * pxRatio;
1894
+ if (polygonMaskOptions.enable) {
1895
+ await this.initRawData();
1896
+ }
1897
+ }
1898
+ particleBounce(particle, delta, direction) {
1899
+ return this.polygonBounce(particle, delta, direction);
1900
+ }
1901
+ particlePosition(position) {
1902
+ var _a, _b;
1903
+ const options = this._container.actualOptions.polygon;
1904
+ if (!((options === null || options === void 0 ? void 0 : options.enable) && ((_b = (_a = this.raw) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0)) {
1905
+ return;
1906
+ }
1907
+ return (0,engine_root_window_.deepExtend)({}, position ? position : this.randomPoint());
1908
+ }
1909
+ particlesInitialization() {
1910
+ const options = this._container.actualOptions.polygon;
1911
+ if ((options === null || options === void 0 ? void 0 : options.enable) && options.type === "inline" && (options.inline.arrangement === "one-per-point" || options.inline.arrangement === "per-point")) {
1912
+ this.drawPoints();
1913
+ return true;
1914
+ }
1915
+ return false;
1916
+ }
1917
+ resize() {
1918
+ const container = this._container,
1919
+ options = container.actualOptions.polygon;
1920
+ if (!((options === null || options === void 0 ? void 0 : options.enable) && options.type !== "none")) {
1921
+ return;
1922
+ }
1923
+ if (this.redrawTimeout) {
1924
+ clearTimeout(this.redrawTimeout);
1925
+ }
1926
+ this.redrawTimeout = window.setTimeout(async () => {
1927
+ await this.initRawData(true);
1928
+ await container.particles.redraw();
1929
+ }, 250);
1930
+ }
1931
+ stop() {
1932
+ delete this.raw;
1933
+ delete this.paths;
1934
+ }
1935
+ checkInsidePolygon(position) {
1936
+ var _a, _b;
1937
+ const container = this._container,
1938
+ options = container.actualOptions.polygon;
1939
+ if (!(options === null || options === void 0 ? void 0 : options.enable) || options.type === "none" || options.type === "inline") {
1940
+ return true;
1941
+ }
1942
+ if (!this.raw) {
1943
+ throw new Error(noPolygonFound);
1944
+ }
1945
+ const canvasSize = container.canvas.size,
1946
+ x = (_a = position === null || position === void 0 ? void 0 : position.x) !== null && _a !== void 0 ? _a : (0,engine_root_window_.getRandom)() * canvasSize.width,
1947
+ y = (_b = position === null || position === void 0 ? void 0 : position.y) !== null && _b !== void 0 ? _b : (0,engine_root_window_.getRandom)() * canvasSize.height;
1948
+ let inside = false;
1949
+ for (let i = 0, j = this.raw.length - 1; i < this.raw.length; j = i++) {
1950
+ const pi = this.raw[i],
1951
+ pj = this.raw[j],
1952
+ intersect = pi.y > y !== pj.y > y && x < (pj.x - pi.x) * (y - pi.y) / (pj.y - pi.y) + pi.x;
1953
+ if (intersect) {
1954
+ inside = !inside;
1955
+ }
1956
+ }
1957
+ return options.type === "inside" ? inside : options.type === "outside" ? !inside : false;
1958
+ }
1959
+ createPath2D() {
1960
+ var _a, _b;
1961
+ const container = this._container,
1962
+ options = container.actualOptions.polygon;
1963
+ if (!options || !((_a = this.paths) === null || _a === void 0 ? void 0 : _a.length)) {
1964
+ return;
1965
+ }
1966
+ for (const path of this.paths) {
1967
+ const pathData = (_b = path.element) === null || _b === void 0 ? void 0 : _b.getAttribute("d");
1968
+ if (pathData) {
1969
+ const path2d = new Path2D(pathData),
1970
+ matrix = document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGMatrix(),
1971
+ finalPath = new Path2D(),
1972
+ transform = matrix.scale(this._scale);
1973
+ if (finalPath.addPath) {
1974
+ finalPath.addPath(path2d, transform);
1975
+ path.path2d = finalPath;
1976
+ } else {
1977
+ delete path.path2d;
1978
+ }
1979
+ } else {
1980
+ delete path.path2d;
1981
+ }
1982
+ if (path.path2d || !this.raw) {
1983
+ continue;
1984
+ }
1985
+ path.path2d = new Path2D();
1986
+ path.path2d.moveTo(this.raw[0].x, this.raw[0].y);
1987
+ this.raw.forEach((pos, i) => {
1988
+ var _a;
1989
+ if (i > 0) {
1990
+ (_a = path.path2d) === null || _a === void 0 ? void 0 : _a.lineTo(pos.x, pos.y);
1991
+ }
1992
+ });
1993
+ path.path2d.closePath();
1994
+ }
1995
+ }
1996
+ async downloadSvgPath(svgUrl, force) {
1997
+ const options = this._container.actualOptions.polygon;
1998
+ if (!options) {
1999
+ return;
2000
+ }
2001
+ const url = svgUrl || options.url,
2002
+ forceDownload = force !== null && force !== void 0 ? force : false;
2003
+ if (!url || this.paths !== undefined && !forceDownload) {
2004
+ return this.raw;
2005
+ }
2006
+ const req = await fetch(url);
2007
+ if (!req.ok) {
2008
+ throw new Error("tsParticles Error - Error occurred during polygon mask download");
2009
+ }
2010
+ return this.parseSvgPath(await req.text(), force);
2011
+ }
2012
+ drawPoints() {
2013
+ if (!this.raw) {
2014
+ return;
2015
+ }
2016
+ for (const item of this.raw) {
2017
+ this._container.particles.addParticle({
2018
+ x: item.x,
2019
+ y: item.y
2020
+ });
2021
+ }
2022
+ }
2023
+ getEquidistantPointByIndex(index) {
2024
+ var _a, _b, _c, _d, _e, _f, _g;
2025
+ const container = this._container,
2026
+ options = container.actualOptions,
2027
+ polygonMaskOptions = options.polygon;
2028
+ if (!polygonMaskOptions) {
2029
+ return;
2030
+ }
2031
+ if (!this.raw || !this.raw.length || !((_a = this.paths) === null || _a === void 0 ? void 0 : _a.length)) throw new Error(noPolygonDataLoaded);
2032
+ let offset = 0,
2033
+ point;
2034
+ const totalLength = this.paths.reduce((tot, path) => tot + path.length, 0),
2035
+ distance = totalLength / options.particles.number.value;
2036
+ for (const path of this.paths) {
2037
+ const pathDistance = distance * index - offset;
2038
+ if (pathDistance <= path.length) {
2039
+ point = path.element.getPointAtLength(pathDistance);
2040
+ break;
2041
+ } else {
2042
+ offset += path.length;
2043
+ }
2044
+ }
2045
+ const scale = this._scale;
2046
+ return {
2047
+ x: ((_b = point === null || point === void 0 ? void 0 : point.x) !== null && _b !== void 0 ? _b : 0) * scale + ((_d = (_c = this.offset) === null || _c === void 0 ? void 0 : _c.x) !== null && _d !== void 0 ? _d : 0),
2048
+ y: ((_e = point === null || point === void 0 ? void 0 : point.y) !== null && _e !== void 0 ? _e : 0) * scale + ((_g = (_f = this.offset) === null || _f === void 0 ? void 0 : _f.y) !== null && _g !== void 0 ? _g : 0)
2049
+ };
2050
+ }
2051
+ getPointByIndex(index) {
2052
+ if (!this.raw || !this.raw.length) {
2053
+ throw new Error(noPolygonDataLoaded);
2054
+ }
2055
+ const coords = this.raw[index % this.raw.length];
2056
+ return {
2057
+ x: coords.x,
2058
+ y: coords.y
2059
+ };
2060
+ }
2061
+ getRandomPoint() {
2062
+ if (!this.raw || !this.raw.length) {
2063
+ throw new Error(noPolygonDataLoaded);
2064
+ }
2065
+ const coords = (0,engine_root_window_.itemFromArray)(this.raw);
2066
+ return {
2067
+ x: coords.x,
2068
+ y: coords.y
2069
+ };
2070
+ }
2071
+ getRandomPointByLength() {
2072
+ var _a, _b, _c;
2073
+ const container = this._container,
2074
+ options = container.actualOptions.polygon;
2075
+ if (!options) {
2076
+ return;
2077
+ }
2078
+ if (!this.raw || !this.raw.length || !((_a = this.paths) === null || _a === void 0 ? void 0 : _a.length)) {
2079
+ throw new Error(noPolygonDataLoaded);
2080
+ }
2081
+ const path = (0,engine_root_window_.itemFromArray)(this.paths),
2082
+ distance = Math.floor((0,engine_root_window_.getRandom)() * path.length) + 1,
2083
+ point = path.element.getPointAtLength(distance),
2084
+ scale = this._scale;
2085
+ return {
2086
+ x: point.x * scale + (((_b = this.offset) === null || _b === void 0 ? void 0 : _b.x) || 0),
2087
+ y: point.y * scale + (((_c = this.offset) === null || _c === void 0 ? void 0 : _c.y) || 0)
2088
+ };
2089
+ }
2090
+ async initRawData(force) {
2091
+ const options = this._container.actualOptions.polygon;
2092
+ if (!options) {
2093
+ return;
2094
+ }
2095
+ if (options.url) {
2096
+ this.raw = await this.downloadSvgPath(options.url, force);
2097
+ } else if (options.data) {
2098
+ const data = options.data;
2099
+ let svg;
2100
+ if (typeof data !== "string") {
2101
+ const path = data.path instanceof Array ? data.path.map(t => `<path d="${t}" />`).join("") : `<path d="${data.path}" />`;
2102
+ const namespaces = 'xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"';
2103
+ svg = `<svg ${namespaces} width="${data.size.width}" height="${data.size.height}">${path}</svg>`;
2104
+ } else {
2105
+ svg = data;
2106
+ }
2107
+ this.raw = this.parseSvgPath(svg, force);
2108
+ }
2109
+ this.createPath2D();
2110
+ this._engine.dispatchEvent("polygonMaskLoaded", {
2111
+ container: this._container
2112
+ });
2113
+ }
2114
+ parseSvgPath(xml, force) {
2115
+ var _a, _b, _c;
2116
+ const forceDownload = force !== null && force !== void 0 ? force : false;
2117
+ if (this.paths !== undefined && !forceDownload) {
2118
+ return this.raw;
2119
+ }
2120
+ const container = this._container,
2121
+ options = container.actualOptions.polygon;
2122
+ if (!options) {
2123
+ return;
2124
+ }
2125
+ const parser = new DOMParser(),
2126
+ doc = parser.parseFromString(xml, "image/svg+xml"),
2127
+ svg = doc.getElementsByTagName("svg")[0];
2128
+ let svgPaths = svg.getElementsByTagName("path");
2129
+ if (!svgPaths.length) {
2130
+ svgPaths = doc.getElementsByTagName("path");
2131
+ }
2132
+ this.paths = [];
2133
+ for (let i = 0; i < svgPaths.length; i++) {
2134
+ const path = svgPaths.item(i);
2135
+ if (path) {
2136
+ this.paths.push({
2137
+ element: path,
2138
+ length: path.getTotalLength()
2139
+ });
2140
+ }
2141
+ }
2142
+ const scale = this._scale;
2143
+ this.dimension.width = parseFloat((_a = svg.getAttribute("width")) !== null && _a !== void 0 ? _a : "0") * scale;
2144
+ this.dimension.height = parseFloat((_b = svg.getAttribute("height")) !== null && _b !== void 0 ? _b : "0") * scale;
2145
+ const position = (_c = options.position) !== null && _c !== void 0 ? _c : {
2146
+ x: 50,
2147
+ y: 50
2148
+ };
2149
+ this.offset = {
2150
+ x: container.canvas.size.width * position.x / 100 - this.dimension.width / 2,
2151
+ y: container.canvas.size.height * position.y / 100 - this.dimension.height / 2
2152
+ };
2153
+ return parsePaths(this.paths, scale, this.offset);
2154
+ }
2155
+ polygonBounce(particle, _delta, direction) {
2156
+ const options = this._container.actualOptions.polygon;
2157
+ if (!this.raw || !(options === null || options === void 0 ? void 0 : options.enable) || direction !== "top") {
2158
+ return false;
2159
+ }
2160
+ if (options.type === "inside" || options.type === "outside") {
2161
+ let closest, dx, dy;
2162
+ const pos = particle.getPosition(),
2163
+ radius = particle.getRadius();
2164
+ for (let i = 0, j = this.raw.length - 1; i < this.raw.length; j = i++) {
2165
+ const pi = this.raw[i],
2166
+ pj = this.raw[j];
2167
+ closest = calcClosestPtOnSegment(pi, pj, pos);
2168
+ const dist = (0,engine_root_window_.getDistances)(pos, closest);
2169
+ [dx, dy] = [dist.dx, dist.dy];
2170
+ if (dist.distance < radius) {
2171
+ segmentBounce(pi, pj, particle.velocity);
2172
+ return true;
2173
+ }
2174
+ }
2175
+ if (closest && dx !== undefined && dy !== undefined && !this.checkInsidePolygon(pos)) {
2176
+ const factor = {
2177
+ x: 1,
2178
+ y: 1
2179
+ };
2180
+ if (particle.position.x >= closest.x) {
2181
+ factor.x = -1;
2182
+ }
2183
+ if (particle.position.y >= closest.y) {
2184
+ factor.y = -1;
2185
+ }
2186
+ particle.position.x = closest.x + radius * 2 * factor.x;
2187
+ particle.position.y = closest.y + radius * 2 * factor.y;
2188
+ particle.velocity.mult(-1);
2189
+ return true;
2190
+ }
2191
+ } else if (options.type === "inline" && particle.initialPosition) {
2192
+ const dist = (0,engine_root_window_.getDistance)(particle.initialPosition, particle.getPosition());
2193
+ if (dist > this._moveRadius) {
2194
+ particle.velocity.x = particle.velocity.y / 2 - particle.velocity.x;
2195
+ particle.velocity.y = particle.velocity.x / 2 - particle.velocity.y;
2196
+ return true;
2197
+ }
2198
+ }
2199
+ return false;
2200
+ }
2201
+ randomPoint() {
2202
+ const container = this._container,
2203
+ options = container.actualOptions.polygon;
2204
+ if (!options) {
2205
+ return;
2206
+ }
2207
+ let position;
2208
+ if (options.type === "inline") {
2209
+ switch (options.inline.arrangement) {
2210
+ case "random-point":
2211
+ position = this.getRandomPoint();
2212
+ break;
2213
+ case "random-length":
2214
+ position = this.getRandomPointByLength();
2215
+ break;
2216
+ case "equidistant":
2217
+ position = this.getEquidistantPointByIndex(container.particles.count);
2218
+ break;
2219
+ case "one-per-point":
2220
+ case "per-point":
2221
+ default:
2222
+ position = this.getPointByIndex(container.particles.count);
2223
+ }
2224
+ } else {
2225
+ position = {
2226
+ x: (0,engine_root_window_.getRandom)() * container.canvas.size.width,
2227
+ y: (0,engine_root_window_.getRandom)() * container.canvas.size.height
2228
+ };
2229
+ }
2230
+ if (this.checkInsidePolygon(position)) {
2231
+ return position;
2232
+ } else {
2233
+ return this.randomPoint();
2234
+ }
2235
+ }
2236
+ }
2237
+ ;// CONCATENATED MODULE: ./dist/browser/index.js
2238
+
2239
+
2240
+
2241
+ class PolygonMaskPlugin {
2242
+ constructor(engine) {
2243
+ this.id = "polygonMask";
2244
+ this._engine = engine;
2245
+ }
2246
+ getPlugin(container) {
2247
+ return new PolygonMaskInstance(container, this._engine);
2248
+ }
2249
+ loadOptions(options, source) {
2250
+ if (!this.needsPlugin(source)) {
2251
+ return;
2252
+ }
2253
+ let polygonOptions = options.polygon;
2254
+ if ((polygonOptions === null || polygonOptions === void 0 ? void 0 : polygonOptions.load) === undefined) {
2255
+ options.polygon = polygonOptions = new PolygonMask();
2256
+ }
2257
+ polygonOptions.load(source === null || source === void 0 ? void 0 : source.polygon);
2258
+ }
2259
+ needsPlugin(options) {
2260
+ var _a, _b, _c;
2261
+ return (_b = (_a = options === null || options === void 0 ? void 0 : options.polygon) === null || _a === void 0 ? void 0 : _a.enable) !== null && _b !== void 0 ? _b : ((_c = options === null || options === void 0 ? void 0 : options.polygon) === null || _c === void 0 ? void 0 : _c.type) !== undefined && options.polygon.type !== "none";
2262
+ }
2263
+ }
2264
+ async function loadPolygonMaskPlugin(engine) {
2265
+ const plugin = new PolygonMaskPlugin(engine);
2266
+ await engine.addPlugin(plugin);
2267
+ }
2268
+
2269
+
2270
+
2271
+ })();
2272
+
2273
+ /******/ return __webpack_exports__;
2274
+ /******/ })()
2275
+ ;
2276
+ });