ipx 4.0.0-alpha.2 → 4.0.0-beta.1

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.
@@ -38,7 +38,7 @@ var l = e(((e) => {
38
38
  }, s = a.fn(e, o, t);
39
39
  s != null && C(e, s);
40
40
  }
41
- }, T = ({ name: e, plugins: t }) => ({
41
+ }, ee = ({ name: e, plugins: t }) => ({
42
42
  name: e,
43
43
  isPreset: !0,
44
44
  plugins: Object.freeze(t),
@@ -51,40 +51,40 @@ var l = e(((e) => {
51
51
  w(n, i, t, o, s);
52
52
  }
53
53
  });
54
- function E(e) {
54
+ function T(e) {
55
55
  let t = /* @__PURE__ */ new Map();
56
56
  for (let n of e.children) t.set(n, e), C(n, { element: { enter: (e, n) => {
57
57
  t.set(e, n);
58
58
  } } }, e);
59
59
  return t;
60
60
  }
61
- let D = (e) => e.type === `element`, ee = (e, t) => t.some(((t) => D(t) && (e(t) || ee(e, O(t))))), te = (e, t) => e.attributes[t], O = (e) => e.children || [], ne = (e) => e.name, re = (e) => e.children[0].type === `text` || e.children[0].type === `cdata` ? e.children[0].value : ``, ie = (e, t) => e.attributes[t] !== void 0, ae = (e, t) => {
61
+ let E = (e) => e.type === `element`, te = (e, t) => t.some(((t) => E(t) && (e(t) || te(e, D(t))))), ne = (e, t) => e.attributes[t], D = (e) => e.children || [], re = (e) => e.name, ie = (e) => e.children[0].type === `text` || e.children[0].type === `cdata` ? e.children[0].value : ``, ae = (e, t) => e.attributes[t] !== void 0, oe = (e, t) => {
62
62
  let n = [];
63
- for (let r of t) D(r) && (e(r) && n.push(r), n.push(...ae(e, O(r))));
63
+ for (let r of t) E(r) && (e(r) && n.push(r), n.push(...oe(e, D(r))));
64
64
  return n;
65
- }, oe = (e, t) => {
66
- for (let n of t) if (D(n)) {
65
+ }, se = (e, t) => {
66
+ for (let n of t) if (E(n)) {
67
67
  if (e(n)) return n;
68
- let t = oe(e, O(n));
68
+ let t = se(e, D(n));
69
69
  if (t) return t;
70
70
  }
71
71
  return null;
72
72
  };
73
- function se(e, t) {
74
- let n = (n) => (t ||= E(e), t.get(n) || null);
73
+ function ce(e, t) {
74
+ let n = (n) => (t ||= T(e), t.get(n) || null);
75
75
  return {
76
- isTag: D,
77
- existsOne: ee,
78
- getAttributeValue: te,
79
- getChildren: O,
80
- getName: ne,
76
+ isTag: E,
77
+ existsOne: te,
78
+ getAttributeValue: ne,
79
+ getChildren: D,
80
+ getName: re,
81
81
  getParent: n,
82
82
  getSiblings: (e) => {
83
83
  let t = n(e);
84
- return t ? O(t) : [];
84
+ return t ? D(t) : [];
85
85
  },
86
- getText: re,
87
- hasAttrib: ie,
86
+ getText: ie,
87
+ hasAttrib: ae,
88
88
  removeSubsets: (e) => {
89
89
  let t = e.length, r, i, a;
90
90
  for (; --t > -1;) {
@@ -99,51 +99,51 @@ var l = e(((e) => {
99
99
  }
100
100
  return e;
101
101
  },
102
- findAll: ae,
103
- findOne: oe
102
+ findAll: oe,
103
+ findOne: se
104
104
  };
105
105
  }
106
- function ce(e, t) {
106
+ function le(e, t) {
107
107
  return {
108
108
  xmlMode: !0,
109
- adapter: se(e, t)
109
+ adapter: ce(e, t)
110
110
  };
111
111
  }
112
- let k = (e, t, n) => f.selectAll(t, e, ce(e, n)), le = (e, t, n) => f.selectOne(t, e, ce(e, n)), ue = (e, t, n) => f.is(e, t, ce(e, n)), A = (e, t) => {
112
+ let O = (e, t, n) => f.selectAll(t, e, le(e, n)), ue = (e, t, n) => f.selectOne(t, e, le(e, n)), de = (e, t, n) => f.is(e, t, le(e, n)), k = (e, t) => {
113
113
  t.children = t.children.filter(((t) => t !== e));
114
114
  };
115
- var de = Object.freeze({
115
+ var fe = Object.freeze({
116
116
  __proto__: null,
117
117
  description: `removes doctype declaration`,
118
118
  fn: () => ({ doctype: { enter: (e, t) => {
119
- A(e, t);
119
+ k(e, t);
120
120
  } } }),
121
121
  name: `removeDoctype`
122
- }), fe = Object.freeze({
122
+ }), pe = Object.freeze({
123
123
  __proto__: null,
124
124
  description: `removes XML processing instructions`,
125
125
  fn: () => ({ instruction: { enter: (e, t) => {
126
- e.name === `xml` && A(e, t);
126
+ e.name === `xml` && k(e, t);
127
127
  } } }),
128
128
  name: `removeXMLProcInst`
129
129
  });
130
- let pe = [/^!/];
131
- var me = Object.freeze({
130
+ let me = [/^!/];
131
+ var he = Object.freeze({
132
132
  __proto__: null,
133
133
  description: `removes comments`,
134
134
  fn: (e, t) => {
135
- let { preservePatterns: n = pe } = t;
135
+ let { preservePatterns: n = me } = t;
136
136
  return { comment: { enter: (e, t) => {
137
137
  if (n) {
138
138
  if (!Array.isArray(n)) throw Error(`Expected array in removeComments preservePatterns parameter but received ${n}`);
139
139
  if (n.some(((t) => new RegExp(t).test(e.value)))) return;
140
140
  }
141
- A(e, t);
141
+ k(e, t);
142
142
  } } };
143
143
  },
144
144
  name: `removeComments`
145
145
  });
146
- let j = {
146
+ let A = {
147
147
  animation: /* @__PURE__ */ new Set([
148
148
  `animate`,
149
149
  `animateColor`,
@@ -253,15 +253,15 @@ var l = e(((e) => {
253
253
  `feTile`,
254
254
  `feTurbulence`
255
255
  ])
256
- }, he = /* @__PURE__ */ new Set([
257
- ...j.textContent,
256
+ }, ge = /* @__PURE__ */ new Set([
257
+ ...A.textContent,
258
258
  `pre`,
259
259
  `title`
260
- ]), ge = /* @__PURE__ */ new Set([
260
+ ]), _e = /* @__PURE__ */ new Set([
261
261
  `glyph`,
262
262
  `missing-glyph`,
263
263
  `path`
264
- ]), M = {
264
+ ]), j = {
265
265
  animationAddition: /* @__PURE__ */ new Set([`additive`, `accumulate`]),
266
266
  animationAttributeTarget: /* @__PURE__ */ new Set([`attributeType`, `attributeName`]),
267
267
  animationEvent: /* @__PURE__ */ new Set([
@@ -354,7 +354,7 @@ var l = e(((e) => {
354
354
  `tableValues`,
355
355
  `type`
356
356
  ])
357
- }, _e = {
357
+ }, ve = {
358
358
  core: { "xml:space": `default` },
359
359
  presentation: {
360
360
  clip: `auto`,
@@ -416,7 +416,7 @@ var l = e(((e) => {
416
416
  exponent: `1`,
417
417
  offset: `0`
418
418
  }
419
- }, ve = {
419
+ }, ye = {
420
420
  animationAttributeTarget: { unsafe: /* @__PURE__ */ new Set([`attributeType`]) },
421
421
  conditionalProcessing: { unsafe: /* @__PURE__ */ new Set([`requiredFeatures`]) },
422
422
  core: { unsafe: /* @__PURE__ */ new Set([
@@ -432,7 +432,7 @@ var l = e(((e) => {
432
432
  `glyph-orientation-vertical`,
433
433
  `kerning`
434
434
  ]) }
435
- }, ye = {
435
+ }, be = {
436
436
  a: {
437
437
  attrsGroups: /* @__PURE__ */ new Set([
438
438
  `conditionalProcessing`,
@@ -2258,7 +2258,7 @@ var l = e(((e) => {
2258
2258
  `u2`
2259
2259
  ]) }
2260
2260
  }
2261
- }, be = /* @__PURE__ */ new Set([
2261
+ }, xe = /* @__PURE__ */ new Set([
2262
2262
  `http://creativecommons.org/ns#`,
2263
2263
  `http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd`,
2264
2264
  `http://krita.org/namespaces/svg/krita`,
@@ -2283,7 +2283,7 @@ var l = e(((e) => {
2283
2283
  `http://www.vector.evaxdesign.sk`,
2284
2284
  `http://www.w3.org/1999/02/22-rdf-syntax-ns#`,
2285
2285
  `https://boxy-svg.com`
2286
- ]), N = /* @__PURE__ */ new Set([
2286
+ ]), M = /* @__PURE__ */ new Set([
2287
2287
  `clip-path`,
2288
2288
  `color-profile`,
2289
2289
  `fill`,
@@ -2294,7 +2294,7 @@ var l = e(((e) => {
2294
2294
  `mask`,
2295
2295
  `stroke`,
2296
2296
  `style`
2297
- ]), P = new Set(`clip-rule.color-interpolation-filters.color-interpolation.color-profile.color-rendering.color.cursor.direction.dominant-baseline.fill-opacity.fill-rule.fill.font-family.font-size-adjust.font-size.font-stretch.font-style.font-variant.font-weight.font.glyph-orientation-horizontal.glyph-orientation-vertical.image-rendering.letter-spacing.marker-end.marker-mid.marker-start.marker.paint-order.pointer-events.shape-rendering.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.stroke.text-anchor.text-rendering.transform.visibility.word-spacing.writing-mode`.split(`.`)), xe = /* @__PURE__ */ new Set([
2297
+ ]), N = new Set(`clip-rule.color-interpolation-filters.color-interpolation.color-profile.color-rendering.color.cursor.direction.dominant-baseline.fill-opacity.fill-rule.fill.font-family.font-size-adjust.font-size.font-stretch.font-style.font-variant.font-weight.font.glyph-orientation-horizontal.glyph-orientation-vertical.image-rendering.letter-spacing.marker-end.marker-mid.marker-start.marker.paint-order.pointer-events.shape-rendering.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.stroke.text-anchor.text-rendering.transform.visibility.word-spacing.writing-mode`.split(`.`)), Se = /* @__PURE__ */ new Set([
2298
2298
  `clip-path`,
2299
2299
  `display`,
2300
2300
  `filter`,
@@ -2303,7 +2303,7 @@ var l = e(((e) => {
2303
2303
  `text-decoration`,
2304
2304
  `transform`,
2305
2305
  `unicode-bidi`
2306
- ]), Se = {
2306
+ ]), Ce = {
2307
2307
  aliceblue: `#f0f8ff`,
2308
2308
  antiquewhite: `#faebd7`,
2309
2309
  aqua: `#0ff`,
@@ -2452,7 +2452,7 @@ var l = e(((e) => {
2452
2452
  whitesmoke: `#f5f5f5`,
2453
2453
  yellow: `#ff0`,
2454
2454
  yellowgreen: `#9acd32`
2455
- }, Ce = {
2455
+ }, we = {
2456
2456
  "#f0ffff": `azure`,
2457
2457
  "#f5f5dc": `beige`,
2458
2458
  "#ffe4c4": `bisque`,
@@ -2485,14 +2485,14 @@ var l = e(((e) => {
2485
2485
  "#ff6347": `tomato`,
2486
2486
  "#ee82ee": `violet`,
2487
2487
  "#f5deb3": `wheat`
2488
- }, we = /* @__PURE__ */ new Set([
2488
+ }, Te = /* @__PURE__ */ new Set([
2489
2489
  `color`,
2490
2490
  `fill`,
2491
2491
  `flood-color`,
2492
2492
  `lighting-color`,
2493
2493
  `stop-color`,
2494
2494
  `stroke`
2495
- ]), Te = {
2495
+ ]), Ee = {
2496
2496
  displayState: /* @__PURE__ */ new Set([
2497
2497
  `fullscreen`,
2498
2498
  `modal`,
@@ -2561,25 +2561,25 @@ var l = e(((e) => {
2561
2561
  `has`
2562
2562
  ])
2563
2563
  };
2564
- var Ee = Object.freeze({
2564
+ var De = Object.freeze({
2565
2565
  __proto__: null,
2566
- attrsGroups: M,
2567
- attrsGroupsDefaults: _e,
2568
- attrsGroupsDeprecated: ve,
2569
- colorsNames: Se,
2570
- colorsProps: we,
2571
- colorsShortNames: Ce,
2572
- editorNamespaces: be,
2573
- elems: ye,
2574
- elemsGroups: j,
2575
- inheritableAttrs: P,
2576
- pathElems: ge,
2577
- presentationNonInheritableGroupAttrs: xe,
2578
- pseudoClasses: Te,
2579
- referencesProps: N,
2580
- textElems: he
2566
+ attrsGroups: j,
2567
+ attrsGroupsDefaults: ve,
2568
+ attrsGroupsDeprecated: ye,
2569
+ colorsNames: Ce,
2570
+ colorsProps: Te,
2571
+ colorsShortNames: we,
2572
+ editorNamespaces: xe,
2573
+ elems: be,
2574
+ elemsGroups: A,
2575
+ inheritableAttrs: N,
2576
+ pathElems: _e,
2577
+ presentationNonInheritableGroupAttrs: Se,
2578
+ pseudoClasses: Ee,
2579
+ referencesProps: M,
2580
+ textElems: ge
2581
2581
  });
2582
- let De = b.walk.skip, Oe = (e, t) => {
2582
+ let Oe = b.walk.skip, ke = (e, t) => {
2583
2583
  let n = [];
2584
2584
  e.block.children.forEach(((e) => {
2585
2585
  e.type === `Declaration` && n.push({
@@ -2602,23 +2602,23 @@ var l = e(((e) => {
2602
2602
  });
2603
2603
  }
2604
2604
  })), r;
2605
- }, ke = (e, t) => {
2605
+ }, Ae = (e, t) => {
2606
2606
  let n = [], r = b.parse(e, {
2607
2607
  parseValue: !1,
2608
2608
  parseAtrulePrelude: !1
2609
2609
  });
2610
2610
  return b.walk(r, ((e) => {
2611
- if (e.type === `Rule`) return n.push(...Oe(e, t || !1)), De;
2611
+ if (e.type === `Rule`) return n.push(...ke(e, t || !1)), Oe;
2612
2612
  if (e.type === `Atrule`) return [
2613
2613
  `keyframes`,
2614
2614
  `-webkit-keyframes`,
2615
2615
  `-o-keyframes`,
2616
2616
  `-moz-keyframes`
2617
2617
  ].includes(e.name) || b.walk(e, ((e) => {
2618
- if (e.type === `Rule`) return n.push(...Oe(e, t || !0)), De;
2619
- })), De;
2618
+ if (e.type === `Rule`) return n.push(...ke(e, t || !0)), Oe;
2619
+ })), Oe;
2620
2620
  })), n;
2621
- }, Ae = (e) => {
2621
+ }, je = (e) => {
2622
2622
  let t = [], n = b.parse(e, {
2623
2623
  context: `declarationList`,
2624
2624
  parseValue: !1
@@ -2630,14 +2630,14 @@ var l = e(((e) => {
2630
2630
  important: e.important === !0
2631
2631
  });
2632
2632
  })), t;
2633
- }, je = (e, t, n) => {
2633
+ }, Me = (e, t, n) => {
2634
2634
  let r = {}, i = /* @__PURE__ */ new Map();
2635
- for (let [e, n] of Object.entries(t.attributes)) M.presentation.has(e) && (r[e] = {
2635
+ for (let [e, n] of Object.entries(t.attributes)) j.presentation.has(e) && (r[e] = {
2636
2636
  type: `static`,
2637
2637
  inherited: !1,
2638
2638
  value: n
2639
2639
  }, i.set(e, !1));
2640
- for (let { selector: a, declarations: o, dynamic: s } of e.rules) if (ue(t, a, n)) for (let { name: e, value: t, important: n } of o) {
2640
+ for (let { selector: a, declarations: o, dynamic: s } of e.rules) if (de(t, a, n)) for (let { name: e, value: t, important: n } of o) {
2641
2641
  let a = r[e];
2642
2642
  if (!(a && a.type === `dynamic`)) {
2643
2643
  if (s) {
@@ -2654,7 +2654,7 @@ var l = e(((e) => {
2654
2654
  }, i.set(e, n));
2655
2655
  }
2656
2656
  }
2657
- let a = t.attributes.style == null ? [] : Ae(t.attributes.style);
2657
+ let a = t.attributes.style == null ? [] : je(t.attributes.style);
2658
2658
  for (let { name: e, value: t, important: n } of a) {
2659
2659
  let a = r[e];
2660
2660
  a && a.type === `dynamic` || (a == null || n === !0 || i.get(e) === !1) && (r[e] = {
@@ -2664,40 +2664,40 @@ var l = e(((e) => {
2664
2664
  }, i.set(e, n));
2665
2665
  }
2666
2666
  return r;
2667
- }, Me = (e, t) => {
2667
+ }, Ne = (e, t) => {
2668
2668
  for (let n = 0; n < 4; n += 1) {
2669
2669
  if (e[n] < t[n]) return -1;
2670
2670
  if (e[n] > t[n]) return 1;
2671
2671
  }
2672
2672
  return 0;
2673
- }, F = (e) => {
2673
+ }, P = (e) => {
2674
2674
  let t = [], n = /* @__PURE__ */ new Map();
2675
2675
  return C(e, { element: { enter: (e, r) => {
2676
2676
  if (n.set(e, r), e.name === `style` && (e.attributes.type == null || e.attributes.type === `` || e.attributes.type === `text/css`)) {
2677
2677
  let n = e.attributes.media != null && e.attributes.media !== `all`;
2678
- for (let r of e.children) r.type !== `text` && r.type !== `cdata` || t.push(...ke(r.value, n));
2678
+ for (let r of e.children) r.type !== `text` && r.type !== `cdata` || t.push(...Ae(r.value, n));
2679
2679
  }
2680
- } } }), t.sort(((e, t) => Me(e.specificity, t.specificity))), {
2680
+ } } }), t.sort(((e, t) => Ne(e.specificity, t.specificity))), {
2681
2681
  rules: t,
2682
2682
  parents: n
2683
2683
  };
2684
- }, I = (e, t) => {
2685
- let { parents: n } = e, r = je(e, t, n), i = n.get(t);
2684
+ }, F = (e, t) => {
2685
+ let { parents: n } = e, r = Me(e, t, n), i = n.get(t);
2686
2686
  for (; i != null && i.type !== `root`;) {
2687
- let t = je(e, i, n);
2688
- for (let [e, n] of Object.entries(t)) r[e] == null && P.has(e) && !xe.has(e) && (r[e] = {
2687
+ let t = Me(e, i, n);
2688
+ for (let [e, n] of Object.entries(t)) r[e] == null && N.has(e) && !Se.has(e) && (r[e] = {
2689
2689
  ...n,
2690
2690
  inherited: !0
2691
2691
  });
2692
2692
  i = n.get(i);
2693
2693
  }
2694
2694
  return r;
2695
- }, Ne = (e, t, n = null, r = !1) => {
2695
+ }, Pe = (e, t, n = null, r = !1) => {
2696
2696
  let i = typeof e == `string` ? y.parse(e) : y.parse(b.generate(e.data));
2697
2697
  for (let e of i) if (e.some(((i, a) => r && (a === e.length - 1 || !y.isTraversal(e[a + 1])) || i.type !== `attribute` || i.name !== t ? !1 : n == null || i.value === n))) return !0;
2698
2698
  return !1;
2699
2699
  };
2700
- function Pe(e) {
2700
+ function Fe(e) {
2701
2701
  let t = /* @__PURE__ */ new Set();
2702
2702
  return e.rules.forEach(((e) => {
2703
2703
  y.parse(e.selector).forEach(((e) => {
@@ -2707,40 +2707,40 @@ var l = e(((e) => {
2707
2707
  }));
2708
2708
  })), t;
2709
2709
  }
2710
- function Fe(e, t, n, r) {
2710
+ function Ie(e, t, n, r) {
2711
2711
  t && (t.safe && t.safe.forEach(((t) => {
2712
2712
  r.has(t) || delete e.attributes[t];
2713
2713
  })), n.removeUnsafe && t.unsafe && t.unsafe.forEach(((t) => {
2714
2714
  r.has(t) || delete e.attributes[t];
2715
2715
  })));
2716
2716
  }
2717
- function Ie(e, t) {
2718
- let n = Pe(F(e));
2717
+ function Le(e, t) {
2718
+ let n = Fe(P(e));
2719
2719
  return { element: { enter: (e) => {
2720
- let r = ye[e.name];
2720
+ let r = be[e.name];
2721
2721
  r && (r.attrsGroups.has(`core`) && e.attributes[`xml:lang`] && !n.has(`xml:lang`) && e.attributes.lang && delete e.attributes[`xml:lang`], r.attrsGroups.forEach(((r) => {
2722
- Fe(e, ve[r], t, n);
2723
- })), Fe(e, r.deprecated, t, n));
2722
+ Ie(e, ye[r], t, n);
2723
+ })), Ie(e, r.deprecated, t, n));
2724
2724
  } } };
2725
2725
  }
2726
- var Le = Object.freeze({
2726
+ var Re = Object.freeze({
2727
2727
  __proto__: null,
2728
2728
  description: `removes deprecated attributes`,
2729
- fn: Ie,
2729
+ fn: Le,
2730
2730
  name: `removeDeprecatedAttrs`
2731
- }), Re = Object.freeze({
2731
+ }), ze = Object.freeze({
2732
2732
  __proto__: null,
2733
2733
  description: `removes <metadata>`,
2734
2734
  fn: () => ({ element: { enter: (e, t) => {
2735
- e.name === `metadata` && A(e, t);
2735
+ e.name === `metadata` && k(e, t);
2736
2736
  } } }),
2737
2737
  name: `removeMetadata`
2738
- }), ze = Object.freeze({
2738
+ }), Be = Object.freeze({
2739
2739
  __proto__: null,
2740
2740
  description: `removes editors namespaces, elements and attributes`,
2741
2741
  fn: (e, t) => {
2742
- let n = [...be];
2743
- Array.isArray(t.additionalNamespaces) && (n = [...be, ...t.additionalNamespaces]);
2742
+ let n = [...xe];
2743
+ Array.isArray(t.additionalNamespaces) && (n = [...xe, ...t.additionalNamespaces]);
2744
2744
  let r = [];
2745
2745
  return { element: { enter: (e, t) => {
2746
2746
  if (e.name === `svg`) for (let [t, i] of Object.entries(e.attributes)) t.startsWith(`xmlns:`) && n.includes(i) && (r.push(t.slice(6)), delete e.attributes[t]);
@@ -2750,24 +2750,24 @@ var l = e(((e) => {
2750
2750
  }
2751
2751
  if (e.name.includes(`:`)) {
2752
2752
  let [n] = e.name.split(`:`);
2753
- r.includes(n) && A(e, t);
2753
+ r.includes(n) && k(e, t);
2754
2754
  }
2755
2755
  } } };
2756
2756
  },
2757
2757
  name: `removeEditorsNSData`
2758
2758
  });
2759
- let Be = /(\S)\r?\n(\S)/g, Ve = /\r?\n/g, He = /\s{2,}/g;
2760
- var Ue = Object.freeze({
2759
+ let Ve = /(\S)\r?\n(\S)/g, He = /\r?\n/g, Ue = /\s{2,}/g;
2760
+ var We = Object.freeze({
2761
2761
  __proto__: null,
2762
2762
  description: `cleanups attributes from newlines, trailing and repeating spaces`,
2763
2763
  fn: (e, t) => {
2764
2764
  let { newlines: n = !0, trim: r = !0, spaces: i = !0 } = t;
2765
2765
  return { element: { enter: (e) => {
2766
- for (let t of Object.keys(e.attributes)) n && (e.attributes[t] = e.attributes[t].replace(Be, ((e, t, n) => t + ` ` + n)), e.attributes[t] = e.attributes[t].replace(Ve, ``)), r && (e.attributes[t] = e.attributes[t].trim()), i && (e.attributes[t] = e.attributes[t].replace(He, ` `));
2766
+ for (let t of Object.keys(e.attributes)) n && (e.attributes[t] = e.attributes[t].replace(Ve, ((e, t, n) => t + ` ` + n)), e.attributes[t] = e.attributes[t].replace(He, ``)), r && (e.attributes[t] = e.attributes[t].trim()), i && (e.attributes[t] = e.attributes[t].replace(Ue, ` `));
2767
2767
  } } };
2768
2768
  },
2769
2769
  name: `cleanupAttrs`
2770
- }), We = Object.freeze({
2770
+ }), Ge = Object.freeze({
2771
2771
  __proto__: null,
2772
2772
  description: `merge multiple style elements into one`,
2773
2773
  fn: () => {
@@ -2778,10 +2778,10 @@ var l = e(((e) => {
2778
2778
  let a = ``;
2779
2779
  for (let e of r.children) e.type === `text` && (a += e.value), e.type === `cdata` && (n = `cdata`, a += e.value);
2780
2780
  if (a.trim().length === 0) {
2781
- A(r, i);
2781
+ k(r, i);
2782
2782
  return;
2783
2783
  }
2784
- r.attributes.media == null ? t += a : (t += `@media ${r.attributes.media}{${a}}`, delete r.attributes.media), e == null ? e = r : (A(r, i), e.children = [{
2784
+ r.attributes.media == null ? t += a : (t += `@media ${r.attributes.media}{${a}}`, delete r.attributes.media), e == null ? e = r : (k(r, i), e.children = [{
2785
2785
  type: n,
2786
2786
  value: t
2787
2787
  }]);
@@ -2789,8 +2789,8 @@ var l = e(((e) => {
2789
2789
  },
2790
2790
  name: `mergeStyles`
2791
2791
  });
2792
- let Ge = [...Te.functional, ...Te.treeStructural];
2793
- var Ke = Object.freeze({
2792
+ let Ke = [...Ee.functional, ...Ee.treeStructural];
2793
+ var qe = Object.freeze({
2794
2794
  __proto__: null,
2795
2795
  description: `inline styles (additional options)`,
2796
2796
  fn: (e, t) => {
@@ -2820,7 +2820,7 @@ var l = e(((e) => {
2820
2820
  if (t.type === `Selector`) {
2821
2821
  let r = [];
2822
2822
  t.children.forEach(((e, t, n) => {
2823
- (e.type === `PseudoClassSelector` || e.type === `PseudoElementSelector`) && !Ge.includes(e.name) && r.push({
2823
+ (e.type === `PseudoClassSelector` || e.type === `PseudoElementSelector`) && !Ke.includes(e.name) && r.push({
2824
2824
  item: t,
2825
2825
  list: n
2826
2826
  });
@@ -2842,11 +2842,14 @@ var l = e(((e) => {
2842
2842
  } },
2843
2843
  root: { exit: () => {
2844
2844
  if (o.length === 0) return;
2845
- let t = s.slice().sort(((e, t) => Me(h.syntax.specificity(e.item.data), h.syntax.specificity(t.item.data)))).reverse();
2845
+ let t = s.slice().sort(((e, t) => {
2846
+ let n = h.syntax.specificity(e.item.data), r = h.syntax.specificity(t.item.data);
2847
+ return Ne(n, r);
2848
+ })).reverse();
2846
2849
  for (let i of t) {
2847
2850
  let t = b.generate(i.item.data), a = [];
2848
2851
  try {
2849
- for (let n of k(e, t)) n.type === `element` && a.push(n);
2852
+ for (let n of O(e, t)) n.type === `element` && a.push(n);
2850
2853
  } catch {
2851
2854
  continue;
2852
2855
  }
@@ -2867,7 +2870,7 @@ var l = e(((e) => {
2867
2870
  visit: `Declaration`,
2868
2871
  enter(i) {
2869
2872
  let a = i.property;
2870
- M.presentation.has(a) && !s.some(((e) => Ne(e.item, a))) && delete e.attributes[a];
2873
+ j.presentation.has(a) && !s.some(((e) => Pe(e.item, a))) && delete e.attributes[a];
2871
2874
  let o = n.get(a), c = t.children.createItem(i);
2872
2875
  o == null ? t.children.insert(c, r) : o.data.important !== !0 && i.important === !0 && (t.children.replace(o, c), n.set(a, c));
2873
2876
  }
@@ -2881,17 +2884,17 @@ var l = e(((e) => {
2881
2884
  if (r) {
2882
2885
  for (let e of t) if (e.matchedElements != null && !(n && e.matchedElements.length > 1)) for (let t of e.matchedElements) {
2883
2886
  let n = new Set(t.attributes.class == null ? null : t.attributes.class.split(` `));
2884
- for (let t of e.node.children) t.type !== `ClassSelector` || s.some(((e) => Ne(e.item, `class`, t.name, !0))) || n.delete(t.name);
2887
+ for (let t of e.node.children) t.type !== `ClassSelector` || s.some(((e) => Pe(e.item, `class`, t.name, !0))) || n.delete(t.name);
2885
2888
  n.size === 0 ? delete t.attributes.class : t.attributes.class = Array.from(n).join(` `);
2886
2889
  let r = e.node.children.first;
2887
- r?.type !== `IdSelector` || t.attributes.id !== r.name || s.some(((e) => Ne(e.item, `id`, r.name, !0))) || delete t.attributes.id;
2890
+ r?.type !== `IdSelector` || t.attributes.id !== r.name || s.some(((e) => Pe(e.item, `id`, r.name, !0))) || delete t.attributes.id;
2888
2891
  }
2889
2892
  for (let e of o) if (b.walk(e.cssAst, {
2890
2893
  visit: `Rule`,
2891
2894
  enter: function(e, t, n) {
2892
2895
  e.type === `Rule` && e.prelude.type === `SelectorList` && e.prelude.children.isEmpty && n.remove(t);
2893
2896
  }
2894
- }), e.cssAst.children.isEmpty) A(e.node, e.parentNode);
2897
+ }), e.cssAst.children.isEmpty) k(e.node, e.parentNode);
2895
2898
  else {
2896
2899
  let t = e.node.children[0];
2897
2900
  t.type !== `text` && t.type !== `cdata` || (t.value = b.generate(e.cssAst));
@@ -2902,45 +2905,45 @@ var l = e(((e) => {
2902
2905
  },
2903
2906
  name: `inlineStyles`
2904
2907
  });
2905
- let qe = /\burl\((["'])?#(.+?)\1\)/g, Je = /^#(.+?)$/, Ye = /(\w+)\.[a-zA-Z]/, Xe = (e, t) => {
2908
+ let Je = /\burl\((["'])?#(.+?)\1\)/g, Ye = /^#(.+?)$/, Xe = /(\w+)\.[a-zA-Z]/, Ze = (e, t) => {
2906
2909
  let n = `data:image/svg+xml`;
2907
2910
  return t && t !== `base64` ? t === `enc` ? e = n + `,` + encodeURIComponent(e) : t === `unenc` && (e = n + `,` + e) : (n += `;base64,`, e = n + Buffer.from(e).toString(`base64`)), e;
2908
- }, L = (e, t, n) => {
2911
+ }, I = (e, t, n) => {
2909
2912
  let r = ``, i, a;
2910
2913
  return e.forEach(((e, n) => {
2911
2914
  i = ` `, n == 0 && (i = ``), t.noSpaceAfterFlags;
2912
- let o = t.leadingZero ? R(e) : e.toString();
2915
+ let o = t.leadingZero ? L(e) : e.toString();
2913
2916
  t.negativeExtraSpace && i != `` && (e < 0 || o.charAt(0) === `.` && a % 1 != 0) && (i = ``), a = e, r += i + o;
2914
2917
  })), r;
2915
- }, R = (e) => {
2918
+ }, L = (e) => {
2916
2919
  let t = e.toString();
2917
2920
  return 0 < e && e < 1 && t.startsWith(`0`) ? t.slice(1) : -1 < e && e < 0 && t[1] === `0` ? t[0] + t.slice(2) : t;
2918
- }, Ze = [
2919
- ...M.animationEvent,
2920
- ...M.documentEvent,
2921
- ...M.documentElementEvent,
2922
- ...M.globalEvent,
2923
- ...M.graphicalEvent
2924
- ], Qe = (e) => e.name === `script` && e.children.length !== 0 || e.name === `a` && Object.entries(e.attributes).some((([e, t]) => (e === `href` || e.endsWith(`:href`)) && t != null && t.trimStart().startsWith(`javascript:`))) ? !0 : Ze.some(((t) => e.attributes[t] != null)), $e = (e) => new RegExp(qe).test(e), et = (e, t) => {
2921
+ }, Qe = [
2922
+ ...j.animationEvent,
2923
+ ...j.documentEvent,
2924
+ ...j.documentElementEvent,
2925
+ ...j.globalEvent,
2926
+ ...j.graphicalEvent
2927
+ ], $e = (e) => e.name === `script` && e.children.length !== 0 || e.name === `a` && Object.entries(e.attributes).some((([e, t]) => (e === `href` || e.endsWith(`:href`)) && t != null && t.trimStart().toLowerCase().startsWith(`javascript:`))) ? !0 : Qe.some(((t) => e.attributes[t] != null)), et = (e) => new RegExp(Je).test(e), tt = (e) => /var\s*\(\s*--/.test(e), nt = (e, t) => {
2925
2928
  let n = [];
2926
- if (N.has(e)) {
2927
- let e = t.matchAll(qe);
2929
+ if (M.has(e)) {
2930
+ let e = t.matchAll(Je);
2928
2931
  for (let t of e) n.push(t[2]);
2929
2932
  }
2930
2933
  if (e === `href` || e.endsWith(`:href`)) {
2931
- let e = Je.exec(t);
2934
+ let e = Ye.exec(t);
2932
2935
  e != null && n.push(e[1]);
2933
2936
  }
2934
2937
  if (e === `begin`) {
2935
- let e = Ye.exec(t);
2938
+ let e = Xe.exec(t);
2936
2939
  e != null && n.push(e[1]);
2937
2940
  }
2938
2941
  return n.map(((e) => decodeURI(e)));
2939
- }, z = (e, t) => {
2942
+ }, R = (e, t) => {
2940
2943
  let n = 10 ** t;
2941
2944
  return Math.round(e * n) / n;
2942
2945
  };
2943
- var tt = Object.freeze({
2946
+ var rt = Object.freeze({
2944
2947
  __proto__: null,
2945
2948
  description: `minifies styles and removes unused styles`,
2946
2949
  fn: (e, { usage: t, ...n }) => {
@@ -2949,7 +2952,7 @@ var l = e(((e) => {
2949
2952
  let f = !1;
2950
2953
  return {
2951
2954
  element: { enter: (e, t) => {
2952
- if (Qe(e) && (f = !0), a.add(e.name), e.attributes.id != null && o.add(e.attributes.id), e.attributes.class != null) for (let t of e.attributes.class.split(/\s+/)) s.add(t);
2955
+ if ($e(e) && (f = !0), a.add(e.name), e.attributes.id != null && o.add(e.attributes.id), e.attributes.class != null) for (let t of e.attributes.class.split(/\s+/)) s.add(t);
2953
2956
  e.name === `style` && e.children.length !== 0 ? r.set(e, t) : e.attributes.style != null && i.push(e);
2954
2957
  } },
2955
2958
  root: { exit: () => {
@@ -2961,7 +2964,7 @@ var l = e(((e) => {
2961
2964
  usage: e
2962
2965
  }).css;
2963
2966
  if (a.length === 0) {
2964
- A(t, i);
2967
+ k(t, i);
2965
2968
  continue;
2966
2969
  }
2967
2970
  r.indexOf(`>`) >= 0 || r.indexOf(`<`) >= 0 ? (t.children[0].type = `cdata`, t.children[0].value = a) : (t.children[0].type = `text`, t.children[0].value = a);
@@ -2975,16 +2978,16 @@ var l = e(((e) => {
2975
2978
  },
2976
2979
  name: `minifyStyles`
2977
2980
  });
2978
- let nt = `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``), rt = nt.length - 1, it = (e, t) => {
2981
+ let it = `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``), at = it.length - 1, ot = (e, t) => {
2979
2982
  for (let n of t) if (e.startsWith(n)) return !0;
2980
2983
  return !1;
2981
- }, at = (e) => {
2984
+ }, st = (e) => {
2982
2985
  if (e == null) return [0];
2983
2986
  e[e.length - 1] += 1;
2984
- for (let t = e.length - 1; t > 0; t--) e[t] > rt && (e[t] = 0, e[t - 1] !== void 0 && e[t - 1]++);
2985
- return e[0] > rt && (e[0] = 0, e.unshift(0)), e;
2986
- }, ot = (e) => e.map(((e) => nt[e])).join(``);
2987
- var st = Object.freeze({
2987
+ for (let t = e.length - 1; t > 0; t--) e[t] > at && (e[t] = 0, e[t - 1] !== void 0 && e[t - 1]++);
2988
+ return e[0] > at && (e[0] = 0, e.unshift(0)), e;
2989
+ }, ct = (e) => e.map(((e) => it[e])).join(``);
2990
+ var lt = Object.freeze({
2988
2991
  __proto__: null,
2989
2992
  description: `removes unused IDs and minifies used`,
2990
2993
  fn: (e, t) => {
@@ -2992,7 +2995,7 @@ var l = e(((e) => {
2992
2995
  return {
2993
2996
  element: { enter: (e) => {
2994
2997
  if (!o) {
2995
- if (e.name === `style` && e.children.length !== 0 || Qe(e)) {
2998
+ if (e.name === `style` && e.children.length !== 0 || $e(e)) {
2996
2999
  d = !0;
2997
3000
  return;
2998
3001
  }
@@ -3009,7 +3012,7 @@ var l = e(((e) => {
3009
3012
  let t = n;
3010
3013
  l.has(t) ? delete e.attributes.id : l.set(t, e);
3011
3014
  } else {
3012
- let r = et(t, n);
3015
+ let r = nt(t, n);
3013
3016
  for (let n of r) {
3014
3017
  let r = u.get(n);
3015
3018
  r ?? (r = [], u.set(n, r)), r.push({
@@ -3021,14 +3024,14 @@ var l = e(((e) => {
3021
3024
  } },
3022
3025
  root: { exit: () => {
3023
3026
  if (d) return;
3024
- let e = (e) => s.has(e) || it(e, c), t = null;
3027
+ let e = (e) => s.has(e) || ot(e, c), t = null;
3025
3028
  for (let [n, i] of u) {
3026
3029
  let a = l.get(n);
3027
3030
  if (a != null) {
3028
3031
  if (r && e(n) === !1) {
3029
3032
  let r;
3030
3033
  do
3031
- t = at(t), r = ot(t);
3034
+ t = st(t), r = ct(t);
3032
3035
  while (e(r) || u.has(r) && l.get(r) == null);
3033
3036
  a.attributes.id = r;
3034
3037
  for (let { element: e, name: t } of i) {
@@ -3045,21 +3048,21 @@ var l = e(((e) => {
3045
3048
  },
3046
3049
  name: `cleanupIds`
3047
3050
  });
3048
- let ct = () => ({ element: { enter: (e, t) => {
3049
- if (e.name === `defs` || j.nonRendering.has(e.name) && e.attributes.id == null) {
3051
+ let ut = () => ({ element: { enter: (e, t) => {
3052
+ if (e.name === `defs` || A.nonRendering.has(e.name) && e.attributes.id == null) {
3050
3053
  let n = [];
3051
- lt(e, n), n.length === 0 && A(e, t), e.children = n;
3054
+ dt(e, n), n.length === 0 && k(e, t), e.children = n;
3052
3055
  }
3053
- } } }), lt = (e, t) => {
3054
- for (let n of e.children) n.type === `element` && (n.attributes.id != null || n.name === `style` ? t.push(n) : lt(n, t));
3056
+ } } }), dt = (e, t) => {
3057
+ for (let n of e.children) n.type === `element` && (n.attributes.id != null || n.name === `style` ? t.push(n) : dt(n, t));
3055
3058
  };
3056
- var ut = Object.freeze({
3059
+ var ft = Object.freeze({
3057
3060
  __proto__: null,
3058
3061
  description: `removes elements in <defs> without id`,
3059
- fn: ct,
3062
+ fn: ut,
3060
3063
  name: `removeUselessDefs`
3061
3064
  });
3062
- let dt = /^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/, ft = {
3065
+ let pt = /^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/, mt = {
3063
3066
  cm: 96 / 2.54,
3064
3067
  mm: 96 / 25.4,
3065
3068
  in: 96,
@@ -3067,7 +3070,7 @@ var l = e(((e) => {
3067
3070
  pc: 16,
3068
3071
  px: 1
3069
3072
  };
3070
- var pt = Object.freeze({
3073
+ var ht = Object.freeze({
3071
3074
  __proto__: null,
3072
3075
  description: `rounds numeric values to the fixed precision, removes default "px" units`,
3073
3076
  fn: (e, t) => {
@@ -3082,23 +3085,23 @@ var l = e(((e) => {
3082
3085
  }
3083
3086
  for (let [t, o] of Object.entries(e.attributes)) {
3084
3087
  if (t === `version`) continue;
3085
- let s = dt.exec(o);
3088
+ let s = pt.exec(o);
3086
3089
  if (s) {
3087
3090
  let o = Number(Number(s[1]).toFixed(n)), c = s[3] || ``;
3088
- if (a && c !== `` && c in ft) {
3089
- let e = Number((ft[c] * Number(s[1])).toFixed(n));
3091
+ if (a && c !== `` && c in mt) {
3092
+ let e = Number((mt[c] * Number(s[1])).toFixed(n));
3090
3093
  e.toString().length < s[0].length && (o = e, c = `px`);
3091
3094
  }
3092
3095
  let l;
3093
- l = r ? R(o) : o.toString(), i && c === `px` && (c = ``), e.attributes[t] = l + c;
3096
+ l = r ? L(o) : o.toString(), i && c === `px` && (c = ``), e.attributes[t] = l + c;
3094
3097
  }
3095
3098
  }
3096
3099
  } } };
3097
3100
  },
3098
3101
  name: `cleanupNumericValues`
3099
3102
  });
3100
- let mt = RegExp(`^rgb\\(\\s*([+-]?(?:\\d*\\.\\d+|\\d+\\.?)%?)(?:\\s*,\\s*|\\s+)([+-]?(?:\\d*\\.\\d+|\\d+\\.?)%?)(?:\\s*,\\s*|\\s+)([+-]?(?:\\d*\\.\\d+|\\d+\\.?)%?)\\s*\\)$`), ht = /^#(([a-fA-F0-9])\2){3}$/, gt = ([e, t, n]) => `#` + ((256 + e << 8 | t) << 8 | n).toString(16).slice(1).toUpperCase();
3101
- var _t = Object.freeze({
3103
+ let gt = RegExp(`^rgb\\(\\s*([+-]?(?:\\d*\\.\\d+|\\d+\\.?)%?)(?:\\s*,\\s*|\\s+)([+-]?(?:\\d*\\.\\d+|\\d+\\.?)%?)(?:\\s*,\\s*|\\s+)([+-]?(?:\\d*\\.\\d+|\\d+\\.?)%?)\\s*\\)$`), _t = /^#(([a-fA-F0-9])\2){3}$/, vt = ([e, t, n]) => `#` + ((256 + e << 8 | t) << 8 | n).toString(16).slice(1).toUpperCase();
3104
+ var yt = Object.freeze({
3102
3105
  __proto__: null,
3103
3106
  description: `converts colors: rgb() to #rrggbb and #rrggbb to #rgb`,
3104
3107
  fn: (e, t) => {
@@ -3106,7 +3109,7 @@ var l = e(((e) => {
3106
3109
  return { element: {
3107
3110
  enter: (e) => {
3108
3111
  e.name === `mask` && c++;
3109
- for (let [t, l] of Object.entries(e.attributes)) if (we.has(t)) {
3112
+ for (let [t, l] of Object.entries(e.attributes)) if (Te.has(t)) {
3110
3113
  let u = l;
3111
3114
  if (n && c === 0) {
3112
3115
  let e;
@@ -3114,22 +3117,25 @@ var l = e(((e) => {
3114
3117
  }
3115
3118
  if (r) {
3116
3119
  let e = u.toLowerCase();
3117
- Se[e] != null && (u = Se[e]);
3120
+ Ce[e] != null && (u = Ce[e]);
3118
3121
  }
3119
3122
  if (i) {
3120
- let e = u.match(mt);
3121
- e != null && (u = gt(e.slice(1, 4).map(((e) => {
3122
- let t;
3123
- return t = e.indexOf(`%`) > -1 ? Math.round(parseFloat(e) * 2.55) : Number(e), Math.max(0, Math.min(t, 255));
3124
- }))));
3123
+ let e = u.match(gt);
3124
+ if (e != null) {
3125
+ let t = e.slice(1, 4).map(((e) => {
3126
+ let t;
3127
+ return t = e.indexOf(`%`) > -1 ? Math.round(parseFloat(e) * 2.55) : Number(e), Math.max(0, Math.min(t, 255));
3128
+ }));
3129
+ u = vt(t);
3130
+ }
3125
3131
  }
3126
- if (a && !$e(u) && u !== `currentColor` && (a === `lower` ? u = u.toLowerCase() : a === `upper` && (u = u.toUpperCase())), o) {
3127
- let e = ht.exec(u);
3132
+ if (!a || et(u) || tt(u) || u === `currentColor` || (a === `lower` ? u = u.toLowerCase() : a === `upper` && (u = u.toUpperCase())), o) {
3133
+ let e = _t.exec(u);
3128
3134
  e != null && (u = `#` + e[0][1] + e[0][3] + e[0][5]);
3129
3135
  }
3130
3136
  if (s) {
3131
3137
  let e = u.toLowerCase();
3132
- Ce[e] != null && (u = Ce[e]);
3138
+ we[e] != null && (u = we[e]);
3133
3139
  }
3134
3140
  e.attributes[t] = u;
3135
3141
  }
@@ -3141,12 +3147,12 @@ var l = e(((e) => {
3141
3147
  },
3142
3148
  name: `convertColors`
3143
3149
  });
3144
- let vt = /* @__PURE__ */ new Map(), yt = /* @__PURE__ */ new Map(), bt = /* @__PURE__ */ new Map();
3145
- for (let [e, t] of Object.entries(ye)) {
3150
+ let bt = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Map(), St = /* @__PURE__ */ new Map();
3151
+ for (let [e, t] of Object.entries(be)) {
3146
3152
  let n = /* @__PURE__ */ new Set();
3147
3153
  if (t.content) for (let e of t.content) n.add(e);
3148
3154
  if (t.contentGroups) for (let e of t.contentGroups) {
3149
- let t = j[e];
3155
+ let t = A[e];
3150
3156
  if (t) for (let e of t) n.add(e);
3151
3157
  }
3152
3158
  let r = /* @__PURE__ */ new Set();
@@ -3154,18 +3160,18 @@ var l = e(((e) => {
3154
3160
  let i = /* @__PURE__ */ new Map();
3155
3161
  if (t.defaults) for (let [e, n] of Object.entries(t.defaults)) i.set(e, n);
3156
3162
  for (let e of t.attrsGroups) {
3157
- let t = M[e];
3163
+ let t = j[e];
3158
3164
  if (t) for (let e of t) r.add(e);
3159
- let n = _e[e];
3165
+ let n = ve[e];
3160
3166
  if (n) for (let [e, t] of Object.entries(n)) i.set(e, t);
3161
3167
  }
3162
- vt.set(e, n), yt.set(e, r), bt.set(e, i);
3168
+ bt.set(e, n), xt.set(e, r), St.set(e, i);
3163
3169
  }
3164
- var xt = Object.freeze({
3170
+ var Ct = Object.freeze({
3165
3171
  __proto__: null,
3166
3172
  description: `removes unknown elements content and attributes, removes attrs with default values`,
3167
3173
  fn: (e, t) => {
3168
- let { unknownContent: n = !0, unknownAttrs: r = !0, defaultAttrs: i = !0, defaultMarkupDeclarations: a = !0, uselessOverrides: o = !0, keepDataAttrs: s = !0, keepAriaAttrs: c = !0, keepRoleAttr: l = !1 } = t, u = F(e);
3174
+ let { unknownContent: n = !0, unknownAttrs: r = !0, defaultAttrs: i = !0, defaultMarkupDeclarations: a = !0, uselessOverrides: o = !0, keepDataAttrs: s = !0, keepAriaAttrs: c = !0, keepRoleAttr: l = !1 } = t, u = P(e);
3169
3175
  return {
3170
3176
  instruction: { enter: (e) => {
3171
3177
  a && (e.value = e.value.replace(/\s*standalone\s*=\s*(["'])no\1/, ``));
@@ -3174,52 +3180,52 @@ var l = e(((e) => {
3174
3180
  if (e.name.includes(`:`)) return;
3175
3181
  if (e.name === `foreignObject`) return S;
3176
3182
  if (n && t.type === `element`) {
3177
- let n = vt.get(t.name);
3183
+ let n = bt.get(t.name);
3178
3184
  if (n == null || n.size === 0) {
3179
- if (vt.get(e.name) == null) {
3180
- A(e, t);
3185
+ if (bt.get(e.name) == null) {
3186
+ k(e, t);
3181
3187
  return;
3182
3188
  }
3183
3189
  } else if (n.has(e.name) === !1) {
3184
- A(e, t);
3190
+ k(e, t);
3185
3191
  return;
3186
3192
  }
3187
3193
  }
3188
- let a = yt.get(e.name), d = bt.get(e.name), f = t.type === `element` ? I(u, t) : null;
3194
+ let a = xt.get(e.name), d = St.get(e.name), f = t.type === `element` ? F(u, t) : null;
3189
3195
  for (let [t, n] of Object.entries(e.attributes)) if (!(s && t.startsWith(`data-`)) && !(c && t.startsWith(`aria-`)) && !(l && t === `role`) && t !== `xmlns`) {
3190
3196
  if (t.includes(`:`)) {
3191
3197
  let [e] = t.split(`:`);
3192
3198
  if (e !== `xml` && e !== `xlink`) continue;
3193
3199
  }
3194
- if (r && a && a.has(t) === !1 && delete e.attributes[t], i && e.attributes.id == null && d && d.get(t) === n && (f?.[t] != null || u.rules.some(((e) => Ne(e.selector, t))) || delete e.attributes[t]), o && e.attributes.id == null) {
3200
+ if (r && a && a.has(t) === !1 && delete e.attributes[t], i && e.attributes.id == null && d && d.get(t) === n && (f?.[t] != null || u.rules.some(((e) => Pe(e.selector, t))) || delete e.attributes[t]), o && e.attributes.id == null) {
3195
3201
  let r = f?.[t];
3196
- xe.has(t) === !1 && r != null && r.type === `static` && r.value === n && delete e.attributes[t];
3202
+ Se.has(t) === !1 && r != null && r.type === `static` && r.value === n && delete e.attributes[t];
3197
3203
  }
3198
3204
  }
3199
3205
  } }
3200
3206
  };
3201
3207
  },
3202
3208
  name: `removeUnknownsAndDefaults`
3203
- }), St = Object.freeze({
3209
+ }), wt = Object.freeze({
3204
3210
  __proto__: null,
3205
3211
  description: `removes non-inheritable group's presentational attributes`,
3206
3212
  fn: () => ({ element: { enter: (e) => {
3207
- if (e.name === `g`) for (let t of Object.keys(e.attributes)) !M.presentation.has(t) || P.has(t) || xe.has(t) || delete e.attributes[t];
3213
+ if (e.name === `g`) for (let t of Object.keys(e.attributes)) !j.presentation.has(t) || N.has(t) || Se.has(t) || delete e.attributes[t];
3208
3214
  } } }),
3209
3215
  name: `removeNonInheritableGroupAttrs`
3210
- }), Ct = Object.freeze({
3216
+ }), Tt = Object.freeze({
3211
3217
  __proto__: null,
3212
3218
  description: `removes useless stroke and fill attributes`,
3213
3219
  fn: (e, t) => {
3214
3220
  let { stroke: n = !0, fill: r = !0, removeNone: i = !1 } = t, a = !1;
3215
3221
  if (C(e, { element: { enter: (e) => {
3216
- (e.name === `style` || Qe(e)) && (a = !0);
3222
+ (e.name === `style` || $e(e)) && (a = !0);
3217
3223
  } } }), a) return null;
3218
- let o = F(e);
3224
+ let o = P(e);
3219
3225
  return { element: { enter: (e, t) => {
3220
3226
  if (e.attributes.id != null) return S;
3221
- if (!j.shape.has(e.name)) return;
3222
- let a = I(o, e), s = a.stroke, c = a[`stroke-opacity`], l = a[`stroke-width`], u = a[`marker-end`], d = a.fill, f = a[`fill-opacity`], p = t.type === `element` ? I(o, t) : null, m = p == null ? null : p.stroke;
3227
+ if (!A.shape.has(e.name)) return;
3228
+ let a = F(o, e), s = a.stroke, c = a[`stroke-opacity`], l = a[`stroke-width`], u = a[`marker-end`], d = a.fill, f = a[`fill-opacity`], p = t.type === `element` ? F(o, t) : null, m = p == null ? null : p.stroke;
3223
3229
  if (n && (s == null || s.type === `static` && s.value == `none` || c != null && c.type === `static` && c.value === `0` || l != null && l.type === `static` && l.value === `0`) && (l != null && l.type === `static` && l.value === `0` || u == null)) {
3224
3230
  for (let t of Object.keys(e.attributes)) t.startsWith(`stroke`) && delete e.attributes[t];
3225
3231
  m != null && m.type === `static` && m.value !== `none` && (e.attributes.stroke = `none`);
@@ -3228,12 +3234,12 @@ var l = e(((e) => {
3228
3234
  for (let t of Object.keys(e.attributes)) t.startsWith(`fill-`) && delete e.attributes[t];
3229
3235
  (d == null || d.type === `static` && d.value !== `none`) && (e.attributes.fill = `none`);
3230
3236
  }
3231
- i && (s != null && e.attributes.stroke !== `none` || (d == null || d.type !== `static` || d.value !== `none`) && e.attributes.fill !== `none` || A(e, t));
3237
+ i && (s != null && e.attributes.stroke !== `none` || (d == null || d.type !== `static` || d.value !== `none`) && e.attributes.fill !== `none` || k(e, t));
3232
3238
  } } };
3233
3239
  },
3234
3240
  name: `removeUselessStrokeAndFill`
3235
3241
  });
3236
- let wt = /^new\s0\s0\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)$/, Tt = (e) => {
3242
+ let Et = /^new\s0\s0\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)$/, Dt = (e) => {
3237
3243
  let t = !1;
3238
3244
  return C(e, { element: { enter: (e) => {
3239
3245
  e.name === `filter` && (t = !0);
@@ -3252,28 +3258,28 @@ var l = e(((e) => {
3252
3258
  }
3253
3259
  let i = e.attributes.width != null && e.attributes.height != null;
3254
3260
  if ((e.name === `svg` || e.name === `mask` || e.name === `pattern`) && i) {
3255
- let t = e.attributes[`enable-background`], i = Et(t, e.name, e.attributes.width, e.attributes.height);
3261
+ let t = e.attributes[`enable-background`], i = Ot(t, e.name, e.attributes.width, e.attributes.height);
3256
3262
  if (i ? e.attributes[`enable-background`] = i : delete e.attributes[`enable-background`], n?.type === `DeclarationList` && r) {
3257
- let t = Et(b.generate(r.data.value), e.name, e.attributes.width, e.attributes.height);
3258
- t ? r.data.value = {
3263
+ let t = b.generate(r.data.value), i = Ot(t, e.name, e.attributes.width, e.attributes.height);
3264
+ i ? r.data.value = {
3259
3265
  type: `Raw`,
3260
- value: t
3266
+ value: i
3261
3267
  } : n.children.remove(r);
3262
3268
  }
3263
3269
  }
3264
3270
  n?.type === `DeclarationList` && (n.children.isEmpty ? delete e.attributes.style : e.attributes.style = b.generate(n));
3265
3271
  } } };
3266
- }, Et = (e, t, n, r) => {
3267
- let i = wt.exec(e);
3272
+ }, Ot = (e, t, n, r) => {
3273
+ let i = Et.exec(e);
3268
3274
  return i != null && n === i[1] && r === i[3] ? t === `svg` ? void 0 : `new` : e;
3269
3275
  };
3270
- var Dt = Object.freeze({
3276
+ var kt = Object.freeze({
3271
3277
  __proto__: null,
3272
3278
  description: `remove or cleanup enable-background attribute when possible`,
3273
- fn: Tt,
3279
+ fn: Dt,
3274
3280
  name: `cleanupEnableBackground`
3275
3281
  });
3276
- let Ot = {
3282
+ let At = {
3277
3283
  M: 2,
3278
3284
  m: 2,
3279
3285
  Z: 0,
@@ -3294,11 +3300,11 @@ var l = e(((e) => {
3294
3300
  t: 2,
3295
3301
  A: 7,
3296
3302
  a: 7
3297
- }, kt = (e) => e in Ot, At = (e) => e === ` ` || e === ` ` || e === `\r` || e === `
3298
- `, jt = (e) => {
3303
+ }, jt = (e) => e in At, Mt = (e) => e === ` ` || e === ` ` || e === `\r` || e === `
3304
+ `, Nt = (e) => {
3299
3305
  let t = e.codePointAt(0);
3300
- return t == null ? !1 : 48 <= t && t <= 57;
3301
- }, Mt = (e, t) => {
3306
+ return t != null && 48 <= t && t <= 57;
3307
+ }, Pt = (e, t) => {
3302
3308
  let n = t, r = ``, i = `none`;
3303
3309
  for (; n < e.length; n += 1) {
3304
3310
  let t = e[n];
@@ -3312,7 +3318,7 @@ var l = e(((e) => {
3312
3318
  continue;
3313
3319
  }
3314
3320
  }
3315
- if (jt(t)) {
3321
+ if (Nt(t)) {
3316
3322
  if (i === `none` || i === `sign` || i === `whole`) {
3317
3323
  i = `whole`, r += t;
3318
3324
  continue;
@@ -3338,22 +3344,22 @@ var l = e(((e) => {
3338
3344
  }
3339
3345
  let a = Number.parseFloat(r);
3340
3346
  return Number.isNaN(a) ? [t, null] : [n - 1, a];
3341
- }, Nt = (e) => {
3347
+ }, Ft = (e) => {
3342
3348
  let t = [], n = null, r = [], i = 0, a = !1, o = !1;
3343
3349
  for (let s = 0; s < e.length; s += 1) {
3344
3350
  let c = e.charAt(s);
3345
- if (At(c)) continue;
3351
+ if (Mt(c)) continue;
3346
3352
  if (a && c === `,`) {
3347
3353
  if (o) break;
3348
3354
  o = !0;
3349
3355
  continue;
3350
3356
  }
3351
- if (kt(c)) {
3357
+ if (jt(c)) {
3352
3358
  if (o) return t;
3353
3359
  if (n == null) {
3354
3360
  if (c !== `M` && c !== `m`) return t;
3355
3361
  } else if (r.length !== 0) return t;
3356
- n = c, r = [], i = Ot[n], a = !1, i === 0 && t.push({
3362
+ n = c, r = [], i = At[n], a = !1, i === 0 && t.push({
3357
3363
  command: n,
3358
3364
  args: r
3359
3365
  });
@@ -3363,65 +3369,65 @@ var l = e(((e) => {
3363
3369
  let l = s, u = null;
3364
3370
  if (n === `A` || n === `a`) {
3365
3371
  let t = r.length;
3366
- t !== 0 && t !== 1 || c !== `+` && c !== `-` && ([l, u] = Mt(e, s)), t !== 2 && t !== 5 && t !== 6 || ([l, u] = Mt(e, s)), (t === 3 || t === 4) && (c === `0` && (u = 0), c === `1` && (u = 1));
3367
- } else [l, u] = Mt(e, s);
3372
+ t !== 0 && t !== 1 && t !== 2 && t !== 5 && t !== 6 || ([l, u] = Pt(e, s)), (t === 3 || t === 4) && (c === `0` && (u = 0), c === `1` && (u = 1));
3373
+ } else [l, u] = Pt(e, s);
3368
3374
  if (u == null) return t;
3369
- r.push(u), a = !0, o = !1, s = l, r.length === i && (t.push({
3375
+ r.push(u), a = !0, o = !1, s = l, r.length === i && ((n === `A` || n === `a`) && (r[0] = Math.abs(r[0]), r[1] = Math.abs(r[1])), t.push({
3370
3376
  command: n,
3371
3377
  args: r
3372
3378
  }), n === `M` && (n = `L`), n === `m` && (n = `l`), r = []);
3373
3379
  }
3374
3380
  return t;
3375
- }, Pt = (e, t) => (t != null && (e = z(e, t)), {
3376
- roundedStr: R(e),
3381
+ }, It = (e, t) => (t != null && (e = R(e, t)), {
3382
+ roundedStr: L(e),
3377
3383
  rounded: e
3378
- }), Ft = (e, t, n, r) => {
3384
+ }), Lt = (e, t, n, r) => {
3379
3385
  let i = ``, a;
3380
3386
  for (let o = 0; o < t.length; o++) {
3381
- let { roundedStr: s, rounded: c } = Pt(t[o], n);
3382
- !r || e !== `A` && e !== `a` || o % 7 != 4 && o % 7 != 5 ? o === 0 || c < 0 ? i += s : Number.isInteger(a) || jt(s[0]) ? i += ` ${s}` : i += s : i += s, a = c;
3387
+ let { roundedStr: s, rounded: c } = It(t[o], n);
3388
+ !r || e !== `A` && e !== `a` || o % 7 != 4 && o % 7 != 5 ? o === 0 || c < 0 ? i += s : Number.isInteger(a) || Nt(s[0]) ? i += ` ${s}` : i += s : i += s, a = c;
3383
3389
  }
3384
3390
  return i;
3385
- }, B = ({ pathData: e, precision: t, disableSpaceAfterFlags: n }) => {
3391
+ }, z = ({ pathData: e, precision: t, disableSpaceAfterFlags: n }) => {
3386
3392
  if (e.length === 1) {
3387
3393
  let { command: r, args: i } = e[0];
3388
- return r + Ft(r, i, t, n);
3394
+ return r + Lt(r, i, t, n);
3389
3395
  }
3390
3396
  let r = ``, i = { ...e[0] };
3391
3397
  e[1].command === `L` ? i.command = `M` : e[1].command === `l` && (i.command = `m`);
3392
3398
  for (let a = 1; a < e.length; a++) {
3393
3399
  let { command: o, args: s } = e[a];
3394
- i.command === o && i.command !== `M` && i.command !== `m` || i.command === `M` && o === `L` || i.command === `m` && o === `l` ? (i.args = [...i.args, ...s], a === e.length - 1 && (r += i.command + Ft(i.command, i.args, t, n))) : (r += i.command + Ft(i.command, i.args, t, n), a === e.length - 1 ? r += o + Ft(o, s, t, n) : i = {
3400
+ i.command === o && i.command !== `M` && i.command !== `m` || i.command === `M` && o === `L` || i.command === `m` && o === `l` ? (i.args = [...i.args, ...s], a === e.length - 1 && (r += i.command + Lt(i.command, i.args, t, n))) : (r += i.command + Lt(i.command, i.args, t, n), a === e.length - 1 ? r += o + Lt(o, s, t, n) : i = {
3395
3401
  command: o,
3396
3402
  args: s
3397
3403
  });
3398
3404
  }
3399
3405
  return r;
3400
- }, It = j.nonRendering;
3401
- var Lt = Object.freeze({
3406
+ }, Rt = A.nonRendering;
3407
+ var zt = Object.freeze({
3402
3408
  __proto__: null,
3403
3409
  description: `removes hidden elements (zero sized, with absent attributes)`,
3404
3410
  fn: (e, t) => {
3405
- let { isHidden: n = !0, displayNone: r = !0, opacity0: i = !0, circleR0: a = !0, ellipseRX0: o = !0, ellipseRY0: s = !0, rectWidth0: c = !0, rectHeight0: l = !0, patternWidth0: u = !0, patternHeight0: d = !0, imageWidth0: f = !0, imageHeight0: p = !0, pathEmptyD: m = !0, polylineEmptyPoints: h = !0, polygonEmptyPoints: g = !0 } = t, _ = F(e), v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map(), T = !1;
3406
- function E(e) {
3411
+ let { isHidden: n = !0, displayNone: r = !0, opacity0: i = !0, circleR0: a = !0, ellipseRX0: o = !0, ellipseRY0: s = !0, rectWidth0: c = !0, rectHeight0: l = !0, patternWidth0: u = !0, patternHeight0: d = !0, imageWidth0: f = !0, imageHeight0: p = !0, pathEmptyD: m = !0, polylineEmptyPoints: h = !0, polygonEmptyPoints: g = !0 } = t, _ = P(e), v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map(), ee = !1;
3412
+ function T(e) {
3407
3413
  if (x.has(e.attributes.id)) return !1;
3408
- for (let t of e.children) if (t.type === `element` && !E(t)) return !1;
3414
+ for (let t of e.children) if (t.type === `element` && !T(t)) return !1;
3409
3415
  return !0;
3410
3416
  }
3411
- function D(e, t) {
3412
- e.type === `element` && e.attributes.id != null && t.type === `element` && t.name === `defs` && y.add(e.attributes.id), A(e, t);
3417
+ function E(e, t) {
3418
+ e.type === `element` && e.attributes.id != null && t.type === `element` && t.name === `defs` && y.add(e.attributes.id), k(e, t);
3413
3419
  }
3414
3420
  return C(e, { element: { enter: (e, t) => {
3415
- if (It.has(e.name)) return v.set(e, t), S;
3416
- let n = I(_, e);
3421
+ if (Rt.has(e.name)) return v.set(e, t), S;
3422
+ let n = F(_, e);
3417
3423
  if (i && n.opacity && n.opacity.type === `static` && n.opacity.value === `0`) {
3418
3424
  if (e.name === `path`) return v.set(e, t), S;
3419
- D(e, t);
3425
+ E(e, t);
3420
3426
  }
3421
3427
  } } }), {
3422
3428
  element: { enter: (e, t) => {
3423
- if (e.name === `style` && e.children.length !== 0 || Qe(e)) {
3424
- T = !0;
3429
+ if (e.name === `style` && e.children.length !== 0 || $e(e)) {
3430
+ ee = !0;
3425
3431
  return;
3426
3432
  }
3427
3433
  if (e.name === `defs` && b.set(e, t), e.name === `use`) for (let n of Object.keys(e.attributes)) {
@@ -3433,102 +3439,102 @@ var l = e(((e) => {
3433
3439
  });
3434
3440
  }
3435
3441
  if (a && e.name === `circle` && e.children.length === 0 && e.attributes.r === `0`) {
3436
- D(e, t);
3442
+ E(e, t);
3437
3443
  return;
3438
3444
  }
3439
3445
  if (o && e.name === `ellipse` && e.children.length === 0 && e.attributes.rx === `0`) {
3440
- D(e, t);
3446
+ E(e, t);
3441
3447
  return;
3442
3448
  }
3443
3449
  if (s && e.name === `ellipse` && e.children.length === 0 && e.attributes.ry === `0`) {
3444
- D(e, t);
3450
+ E(e, t);
3445
3451
  return;
3446
3452
  }
3447
3453
  if (c && e.name === `rect` && e.children.length === 0 && e.attributes.width === `0`) {
3448
- D(e, t);
3454
+ E(e, t);
3449
3455
  return;
3450
3456
  }
3451
3457
  if (l && c && e.name === `rect` && e.children.length === 0 && e.attributes.height === `0`) {
3452
- D(e, t);
3458
+ E(e, t);
3453
3459
  return;
3454
3460
  }
3455
3461
  if (u && e.name === `pattern` && e.attributes.width === `0`) {
3456
- D(e, t);
3462
+ E(e, t);
3457
3463
  return;
3458
3464
  }
3459
3465
  if (d && e.name === `pattern` && e.attributes.height === `0`) {
3460
- D(e, t);
3466
+ E(e, t);
3461
3467
  return;
3462
3468
  }
3463
3469
  if (f && e.name === `image` && e.attributes.width === `0`) {
3464
- D(e, t);
3470
+ E(e, t);
3465
3471
  return;
3466
3472
  }
3467
3473
  if (p && e.name === `image` && e.attributes.height === `0`) {
3468
- D(e, t);
3474
+ E(e, t);
3469
3475
  return;
3470
3476
  }
3471
3477
  if (h && e.name === `polyline` && e.attributes.points == null) {
3472
- D(e, t);
3478
+ E(e, t);
3473
3479
  return;
3474
3480
  }
3475
3481
  if (g && e.name === `polygon` && e.attributes.points == null) {
3476
- D(e, t);
3482
+ E(e, t);
3477
3483
  return;
3478
3484
  }
3479
- let i = I(_, e);
3480
- if (n && i.visibility && i.visibility.type === `static` && i.visibility.value === `hidden` && le(e, `[visibility=visible]`) == null) {
3481
- D(e, t);
3485
+ let i = F(_, e);
3486
+ if (n && i.visibility && i.visibility.type === `static` && i.visibility.value === `hidden` && ue(e, `[visibility=visible]`) == null) {
3487
+ E(e, t);
3482
3488
  return;
3483
3489
  }
3484
3490
  if (r && i.display && i.display.type === `static` && i.display.value === `none` && e.name !== `marker`) {
3485
- D(e, t);
3491
+ E(e, t);
3486
3492
  return;
3487
3493
  }
3488
3494
  if (m && e.name === `path`) {
3489
3495
  if (e.attributes.d == null) {
3490
- D(e, t);
3496
+ E(e, t);
3491
3497
  return;
3492
3498
  }
3493
- let n = Nt(e.attributes.d);
3499
+ let n = Ft(e.attributes.d);
3494
3500
  if (n.length === 0) {
3495
- D(e, t);
3501
+ E(e, t);
3496
3502
  return;
3497
3503
  }
3498
3504
  if (n.length === 1 && i[`marker-start`] == null && i[`marker-end`] == null) {
3499
- D(e, t);
3505
+ E(e, t);
3500
3506
  return;
3501
3507
  }
3502
3508
  }
3503
3509
  for (let [t, n] of Object.entries(e.attributes)) {
3504
- let e = et(t, n);
3510
+ let e = nt(t, n);
3505
3511
  for (let t of e) x.add(t);
3506
3512
  }
3507
3513
  } },
3508
3514
  root: { exit: () => {
3509
3515
  for (let e of y) {
3510
3516
  let t = w.get(e);
3511
- if (t) for (let { node: e, parentNode: n } of t) A(e, n);
3517
+ if (t) for (let { node: e, parentNode: n } of t) k(e, n);
3512
3518
  }
3513
- if (!T) for (let [e, t] of v.entries()) E(e) && A(e, t);
3514
- for (let [e, t] of b.entries()) e.children.length === 0 && A(e, t);
3519
+ if (!ee) for (let [e, t] of v.entries()) T(e) && k(e, t);
3520
+ for (let [e, t] of b.entries()) e.children.length === 0 && k(e, t);
3515
3521
  } }
3516
3522
  };
3517
3523
  },
3518
3524
  name: `removeHiddenElems`
3519
- }), Rt = Object.freeze({
3525
+ }), Bt = Object.freeze({
3520
3526
  __proto__: null,
3521
3527
  description: `removes empty <text> elements`,
3522
3528
  fn: (e, t) => {
3523
3529
  let { text: n = !0, tspan: r = !0, tref: i = !0 } = t;
3524
3530
  return { element: { enter: (e, t) => {
3525
- n && e.name === `text` && e.children.length === 0 && A(e, t), r && e.name === `tspan` && e.children.length === 0 && A(e, t), i && e.name === `tref` && e.attributes[`xlink:href`] == null && A(e, t);
3531
+ n && e.name === `text` && e.children.length === 0 && k(e, t), r && e.name === `tspan` && e.children.length === 0 && k(e, t), i && e.name === `tref` && e.attributes[`xlink:href`] == null && k(e, t);
3526
3532
  } } };
3527
3533
  },
3528
3534
  name: `removeEmptyText`
3529
3535
  });
3530
- let zt = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g;
3531
- var Bt = Object.freeze({
3536
+ let Vt = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g;
3537
+ var Ht = Object.freeze({
3532
3538
  __proto__: null,
3533
3539
  description: `converts basic shapes to more compact path form`,
3534
3540
  fn: (e, t) => {
@@ -3559,7 +3565,7 @@ var l = e(((e) => {
3559
3565
  args: []
3560
3566
  }
3561
3567
  ];
3562
- e.name = `path`, e.attributes.d = B({
3568
+ e.name = `path`, e.attributes.d = z({
3563
3569
  pathData: o,
3564
3570
  precision: r
3565
3571
  }), delete e.attributes.x, delete e.attributes.y, delete e.attributes.width, delete e.attributes.height;
@@ -3574,15 +3580,15 @@ var l = e(((e) => {
3574
3580
  command: `L`,
3575
3581
  args: [i, a]
3576
3582
  }];
3577
- e.name = `path`, e.attributes.d = B({
3583
+ e.name = `path`, e.attributes.d = z({
3578
3584
  pathData: o,
3579
3585
  precision: r
3580
3586
  }), delete e.attributes.x1, delete e.attributes.y1, delete e.attributes.x2, delete e.attributes.y2;
3581
3587
  }
3582
3588
  if ((e.name === `polyline` || e.name === `polygon`) && e.attributes.points != null) {
3583
- let n = (e.attributes.points.match(zt) || []).map(Number);
3589
+ let n = (e.attributes.points.match(Vt) || []).map(Number);
3584
3590
  if (n.length < 4) {
3585
- A(e, t);
3591
+ k(e, t);
3586
3592
  return;
3587
3593
  }
3588
3594
  let i = [];
@@ -3593,7 +3599,7 @@ var l = e(((e) => {
3593
3599
  e.name === `polygon` && i.push({
3594
3600
  command: `z`,
3595
3601
  args: []
3596
- }), e.name = `path`, e.attributes.d = B({
3602
+ }), e.name = `path`, e.attributes.d = z({
3597
3603
  pathData: i,
3598
3604
  precision: r
3599
3605
  }), delete e.attributes.points;
@@ -3635,7 +3641,7 @@ var l = e(((e) => {
3635
3641
  args: []
3636
3642
  }
3637
3643
  ];
3638
- e.name = `path`, e.attributes.d = B({
3644
+ e.name = `path`, e.attributes.d = z({
3639
3645
  pathData: a,
3640
3646
  precision: r
3641
3647
  }), delete e.attributes.cx, delete e.attributes.cy, delete e.attributes.r;
@@ -3677,7 +3683,7 @@ var l = e(((e) => {
3677
3683
  args: []
3678
3684
  }
3679
3685
  ];
3680
- e.name = `path`, e.attributes.d = B({
3686
+ e.name = `path`, e.attributes.d = z({
3681
3687
  pathData: o,
3682
3688
  precision: r
3683
3689
  }), delete e.attributes.cx, delete e.attributes.cy, delete e.attributes.rx, delete e.attributes.ry;
@@ -3685,7 +3691,7 @@ var l = e(((e) => {
3685
3691
  } } };
3686
3692
  },
3687
3693
  name: `convertShapeToPath`
3688
- }), Vt = Object.freeze({
3694
+ }), Ut = Object.freeze({
3689
3695
  __proto__: null,
3690
3696
  description: `converts non-eccentric <ellipse>s to <circle>s`,
3691
3697
  fn: () => ({ element: { enter: (e) => {
@@ -3699,7 +3705,7 @@ var l = e(((e) => {
3699
3705
  }
3700
3706
  } } }),
3701
3707
  name: `convertEllipseToCircle`
3702
- }), Ht = Object.freeze({
3708
+ }), Wt = Object.freeze({
3703
3709
  __proto__: null,
3704
3710
  description: `Move common attributes of group children to the group`,
3705
3711
  fn: (e) => {
@@ -3709,9 +3715,9 @@ var l = e(((e) => {
3709
3715
  } } }), { element: { exit: (e) => {
3710
3716
  if (e.name !== `g` || e.children.length <= 1 || t) return;
3711
3717
  let n = /* @__PURE__ */ new Map(), r = !0, i = !0;
3712
- for (let t of e.children) if (t.type === `element`) if (ge.has(t.name) || (i = !1), r) {
3718
+ for (let t of e.children) if (t.type === `element`) if (_e.has(t.name) || (i = !1), r) {
3713
3719
  r = !1;
3714
- for (let [e, r] of Object.entries(t.attributes)) P.has(e) && n.set(e, r);
3720
+ for (let [e, r] of Object.entries(t.attributes)) N.has(e) && n.set(e, r);
3715
3721
  } else for (let [e, r] of n) t.attributes[e] !== r && n.delete(e);
3716
3722
  e.attributes.filter == null && e.attributes[`clip-path`] == null && e.attributes.mask == null || n.delete(`transform`), i && n.delete(`transform`);
3717
3723
  for (let [t, r] of n) t === `transform` ? e.attributes.transform == null ? e.attributes.transform = r : e.attributes.transform = `${e.attributes.transform} ${r}` : e.attributes[t] = r;
@@ -3720,16 +3726,16 @@ var l = e(((e) => {
3720
3726
  },
3721
3727
  name: `moveElemsAttrsToGroup`
3722
3728
  });
3723
- let Ut = [
3724
- ...ge,
3729
+ let Gt = [
3730
+ ..._e,
3725
3731
  `g`,
3726
3732
  `text`
3727
3733
  ];
3728
- var Wt = Object.freeze({
3734
+ var Kt = Object.freeze({
3729
3735
  __proto__: null,
3730
3736
  description: `moves some group attributes to the content elements`,
3731
3737
  fn: () => ({ element: { enter: (e) => {
3732
- if (e.name === `g` && e.children.length !== 0 && e.attributes.transform != null && Object.entries(e.attributes).some((([e, t]) => N.has(e) && $e(t))) === !1 && e.children.every(((e) => e.type === `element` && Ut.includes(e.name) && e.attributes.id == null))) {
3738
+ if (e.name === `g` && e.children.length !== 0 && e.attributes.transform != null && Object.entries(e.attributes).some((([e, t]) => M.has(e) && et(t))) === !1 && e.children.every(((e) => e.type === `element` && Gt.includes(e.name) && e.attributes.id == null))) {
3733
3739
  for (let t of e.children) {
3734
3740
  let n = e.attributes.transform;
3735
3741
  t.type === `element` && (t.attributes.transform == null ? t.attributes.transform = n : t.attributes.transform = `${n} ${t.attributes.transform}`);
@@ -3739,36 +3745,36 @@ var l = e(((e) => {
3739
3745
  } } }),
3740
3746
  name: `moveGroupAttrsToElems`
3741
3747
  });
3742
- let Gt = (e, t) => {
3748
+ let qt = (e, t) => {
3743
3749
  if (e.type === `element`) {
3744
- if (j.animation.has(e.name) && e.attributes.attributeName === t) return !0;
3745
- for (let n of e.children) if (Gt(n, t)) return !0;
3750
+ if (A.animation.has(e.name) && e.attributes.attributeName === t) return !0;
3751
+ for (let n of e.children) if (qt(n, t)) return !0;
3746
3752
  }
3747
3753
  return !1;
3748
3754
  };
3749
- var Kt = Object.freeze({
3755
+ var Jt = Object.freeze({
3750
3756
  __proto__: null,
3751
3757
  description: `collapses useless groups`,
3752
3758
  fn: (e) => {
3753
- let t = F(e);
3759
+ let t = P(e);
3754
3760
  return { element: { exit: (e, n) => {
3755
- if (!(n.type === `root` || n.name === `switch`) && !(e.name !== `g` || e.children.length === 0)) {
3761
+ if (n.type !== `root` && n.name !== `switch` && e.name === `g` && e.children.length !== 0) {
3756
3762
  if (Object.keys(e.attributes).length !== 0 && e.children.length === 1) {
3757
- let n = e.children[0], r = !!(e.attributes.filter || I(t, e).filter);
3763
+ let n = e.children[0], r = !!(e.attributes.filter || F(t, e).filter);
3758
3764
  if (n.type === `element` && n.attributes.id == null && !r && (e.attributes.class == null || n.attributes.class == null) && (e.attributes[`clip-path`] == null && e.attributes.mask == null || n.name === `g` && e.attributes.transform == null && n.attributes.transform == null)) {
3759
3765
  let t = { ...n.attributes };
3760
3766
  for (let [r, i] of Object.entries(e.attributes)) {
3761
- if (Gt(n, r)) return;
3767
+ if (qt(n, r)) return;
3762
3768
  if (t[r] == null) t[r] = i;
3763
3769
  else if (r === `transform`) t[r] = i + ` ` + t[r];
3764
3770
  else if (t[r] === `inherit`) t[r] = i;
3765
- else if (!P.has(r) && t[r] !== i) return;
3771
+ else if (!N.has(r) && t[r] !== i) return;
3766
3772
  }
3767
3773
  e.attributes = {}, n.attributes = t;
3768
3774
  }
3769
3775
  }
3770
3776
  if (Object.keys(e.attributes).length === 0) {
3771
- for (let t of e.children) if (t.type === `element` && j.animation.has(t.name)) return;
3777
+ for (let t of e.children) if (t.type === `element` && A.animation.has(t.name)) return;
3772
3778
  let t = n.children.indexOf(e);
3773
3779
  n.children.splice(t, 1, ...e.children);
3774
3780
  }
@@ -3777,22 +3783,22 @@ var l = e(((e) => {
3777
3783
  },
3778
3784
  name: `collapseGroups`
3779
3785
  });
3780
- let V, qt = (e) => {
3786
+ let B, Yt = (e) => {
3781
3787
  if (e.pathJS) return e.pathJS;
3782
- let t = [], n = Nt(e.attributes.d);
3788
+ let t = [], n = Ft(e.attributes.d);
3783
3789
  for (let { command: e, args: r } of n) t.push({
3784
3790
  command: e,
3785
3791
  args: r
3786
3792
  });
3787
3793
  return t.length && t[0].command == `m` && (t[0].command = `M`), e.pathJS = t, t;
3788
- }, Jt = (e) => {
3794
+ }, Xt = (e) => {
3789
3795
  let t = [], n = [0, 0], r = [0, 0];
3790
3796
  for (let { command: i, args: a } of e) a = a.slice(), i === `m` && (a[0] += r[0], a[1] += r[1], i = `M`), i === `M` && (r[0] = a[0], r[1] = a[1], n[0] = r[0], n[1] = r[1]), i === `h` && (a[0] += r[0], i = `H`), i === `H` && (r[0] = a[0]), i === `v` && (a[0] += r[1], i = `V`), i === `V` && (r[1] = a[0]), i === `l` && (a[0] += r[0], a[1] += r[1], i = `L`), i === `L` && (r[0] = a[0], r[1] = a[1]), i === `c` && (a[0] += r[0], a[1] += r[1], a[2] += r[0], a[3] += r[1], a[4] += r[0], a[5] += r[1], i = `C`), i === `C` && (r[0] = a[4], r[1] = a[5]), i === `s` && (a[0] += r[0], a[1] += r[1], a[2] += r[0], a[3] += r[1], i = `S`), i === `S` && (r[0] = a[2], r[1] = a[3]), i === `q` && (a[0] += r[0], a[1] += r[1], a[2] += r[0], a[3] += r[1], i = `Q`), i === `Q` && (r[0] = a[2], r[1] = a[3]), i === `t` && (a[0] += r[0], a[1] += r[1], i = `T`), i === `T` && (r[0] = a[0], r[1] = a[1]), i === `a` && (a[5] += r[0], a[6] += r[1], i = `A`), i === `A` && (r[0] = a[5], r[1] = a[6]), (i === `z` || i === `Z`) && (r[0] = n[0], r[1] = n[1], i = `z`), t.push({
3791
3797
  command: i,
3792
3798
  args: a
3793
3799
  });
3794
3800
  return t;
3795
- }, Yt = function(e, t, n) {
3801
+ }, Zt = function(e, t, n) {
3796
3802
  e.pathJS = t;
3797
3803
  let r = [];
3798
3804
  for (let e of t) {
@@ -3805,67 +3811,67 @@ var l = e(((e) => {
3805
3811
  args: e.args
3806
3812
  });
3807
3813
  }
3808
- e.attributes.d = B({
3814
+ e.attributes.d = z({
3809
3815
  pathData: r,
3810
3816
  precision: n.floatPrecision,
3811
3817
  disableSpaceAfterFlags: n.noSpaceAfterFlags
3812
3818
  });
3813
3819
  };
3814
- function H(e, t) {
3820
+ function V(e, t) {
3815
3821
  return e[0] = t[t.length - 2], e[1] = t[t.length - 1], e;
3816
3822
  }
3817
- let Xt = function(e, t) {
3818
- let n = en(Jt(e)), r = en(Jt(t));
3823
+ let Qt = function(e, t) {
3824
+ let n = nn(Xt(e)), r = nn(Xt(t));
3819
3825
  if (n.maxX <= r.minX || r.maxX <= n.minX || n.maxY <= r.minY || r.maxY <= n.minY || n.list.every(((e) => r.list.every(((t) => e.list[e.maxX][0] <= t.list[t.minX][0] || t.list[t.maxX][0] <= e.list[e.minX][0] || e.list[e.maxY][1] <= t.list[t.minY][1] || t.list[t.maxY][1] <= e.list[e.minY][1]))))) return !1;
3820
- let i = n.list.map(tn), a = r.list.map(tn);
3826
+ let i = n.list.map(rn), a = r.list.map(rn);
3821
3827
  return i.some((function(e) {
3822
3828
  return e.list.length < 3 ? !1 : a.some((function(t) {
3823
3829
  if (t.list.length < 3) return !1;
3824
- let n = [o(e, t, [1, 0])], r = U(n[0]), i = 1e4;
3830
+ let n = [o(e, t, [1, 0])], r = H(n[0]), i = 1e4;
3825
3831
  for (;;) {
3826
3832
  if (i-- == 0) return console.error(`Error: infinite loop while processing mergePaths plugin.`), !0;
3827
- if (n.push(o(e, t, r)), W(r, n[n.length - 1]) <= 0) return !1;
3828
- if (Zt(n, r)) return !0;
3833
+ if (n.push(o(e, t, r)), U(r, n[n.length - 1]) <= 0) return !1;
3834
+ if ($t(n, r)) return !0;
3829
3835
  }
3830
3836
  }));
3831
3837
  }));
3832
3838
  function o(e, t, n) {
3833
- return Qt(s(e, n), s(t, U(n)));
3839
+ return en(s(e, n), s(t, H(n)));
3834
3840
  }
3835
3841
  function s(e, t) {
3836
3842
  let n = t[1] >= 0 ? t[0] < 0 ? e.maxY : e.maxX : t[0] < 0 ? e.minX : e.minY, r = -Infinity, i;
3837
- for (; (i = W(e.list[n], t)) > r;) r = i, n = ++n % e.list.length;
3843
+ for (; (i = U(e.list[n], t)) > r;) r = i, n = ++n % e.list.length;
3838
3844
  return e.list[(n || e.list.length) - 1];
3839
3845
  }
3840
3846
  };
3841
- function Zt(e, t) {
3847
+ function $t(e, t) {
3842
3848
  if (e.length == 2) {
3843
- let n = e[1], r = e[0], i = U(e[1]), a = Qt(r, n);
3844
- W(i, a) > 0 ? H(t, $t(a, n)) : (H(t, i), e.shift());
3849
+ let n = e[1], r = e[0], i = H(e[1]), a = en(r, n);
3850
+ U(i, a) > 0 ? V(t, tn(a, n)) : (V(t, i), e.shift());
3845
3851
  } else {
3846
- let n = e[2], r = e[1], i = e[0], a = Qt(r, n), o = Qt(i, n), s = U(n), c = $t(a, o), l = $t(o, a);
3847
- if (W(c, s) > 0) W(a, s) > 0 ? (H(t, c), e.shift()) : (H(t, s), e.splice(0, 2));
3852
+ let n = e[2], r = e[1], i = e[0], a = en(r, n), o = en(i, n), s = H(n), c = tn(a, o), l = tn(o, a);
3853
+ if (U(c, s) > 0) U(a, s) > 0 ? (V(t, c), e.shift()) : (V(t, s), e.splice(0, 2));
3848
3854
  else {
3849
- if (!(W(l, s) > 0)) return !0;
3850
- W(o, s) > 0 ? (H(t, l), e.splice(1, 1)) : (H(t, s), e.splice(0, 2));
3855
+ if (!(U(l, s) > 0)) return !0;
3856
+ U(o, s) > 0 ? (V(t, l), e.splice(1, 1)) : (V(t, s), e.splice(0, 2));
3851
3857
  }
3852
3858
  }
3853
3859
  return !1;
3854
3860
  }
3855
- function U(e) {
3861
+ function H(e) {
3856
3862
  return [-e[0], -e[1]];
3857
3863
  }
3858
- function Qt(e, t) {
3864
+ function en(e, t) {
3859
3865
  return [e[0] - t[0], e[1] - t[1]];
3860
3866
  }
3861
- function W(e, t) {
3867
+ function U(e, t) {
3862
3868
  return e[0] * t[0] + e[1] * t[1];
3863
3869
  }
3864
- function $t(e, t) {
3870
+ function tn(e, t) {
3865
3871
  let n = [-e[1], e[0]];
3866
- return W(n, U(t)) < 0 ? U(n) : n;
3872
+ return U(n, H(t)) < 0 ? H(n) : n;
3867
3873
  }
3868
- function en(e) {
3874
+ function nn(e) {
3869
3875
  let t = {
3870
3876
  list: [],
3871
3877
  minX: 0,
@@ -3900,40 +3906,38 @@ var l = e(((e) => {
3900
3906
  c != null && n(o, [c[0], l[0]]);
3901
3907
  break;
3902
3908
  case `Q`:
3903
- n(o, l.slice(0, 2)), V = [l[2] - l[0], l[3] - l[1]];
3909
+ n(o, l.slice(0, 2)), B = [l[2] - l[0], l[3] - l[1]];
3904
3910
  break;
3905
3911
  case `T`:
3906
- c != null && s != null && (s.command == `Q` || s.command == `T`) && (u = [c[0] + V[0], c[1] + V[1]], n(o, u), V = [l[0] - u[0], l[1] - u[1]]);
3912
+ c != null && s != null && (s.command == `Q` || s.command == `T`) && (u = [c[0] + B[0], c[1] + B[1]], n(o, u), B = [l[0] - u[0], l[1] - u[1]]);
3907
3913
  break;
3908
3914
  case `C`:
3909
- c != null && n(o, [.5 * (c[0] + l[0]), .5 * (c[1] + l[1])]), n(o, [.5 * (l[0] + l[2]), .5 * (l[1] + l[3])]), n(o, [.5 * (l[2] + l[4]), .5 * (l[3] + l[5])]), V = [l[4] - l[2], l[5] - l[3]];
3915
+ c != null && n(o, [.5 * (c[0] + l[0]), .5 * (c[1] + l[1])]), n(o, [.5 * (l[0] + l[2]), .5 * (l[1] + l[3])]), n(o, [.5 * (l[2] + l[4]), .5 * (l[3] + l[5])]), B = [l[4] - l[2], l[5] - l[3]];
3910
3916
  break;
3911
3917
  case `S`:
3912
- c != null && s != null && (s.command == `C` || s.command == `S`) && (n(o, [c[0] + .5 * V[0], c[1] + .5 * V[1]]), u = [c[0] + V[0], c[1] + V[1]]), u != null && n(o, [.5 * (u[0] + l[0]), .5 * (u[1] + l[1])]), n(o, [.5 * (l[0] + l[2]), .5 * (l[1] + l[3])]), V = [l[2] - l[0], l[3] - l[1]];
3913
- break;
3914
- case `A`:
3915
- if (c != null) {
3916
- let e = rn.apply(0, c.concat(l));
3917
- for (var r; (r = e.splice(0, 6).map(d)).length;) c != null && n(o, [.5 * (c[0] + r[0]), .5 * (c[1] + r[1])]), n(o, [.5 * (r[0] + r[2]), .5 * (r[1] + r[3])]), n(o, [.5 * (r[2] + r[4]), .5 * (r[3] + r[5])]), e.length && n(o, c = r.slice(-2));
3918
- }
3918
+ c != null && s != null && (s.command == `C` || s.command == `S`) && (n(o, [c[0] + .5 * B[0], c[1] + .5 * B[1]]), u = [c[0] + B[0], c[1] + B[1]]), u != null && n(o, [.5 * (u[0] + l[0]), .5 * (u[1] + l[1])]), n(o, [.5 * (l[0] + l[2]), .5 * (l[1] + l[3])]), B = [l[2] - l[0], l[3] - l[1]];
3919
3919
  break;
3920
+ case `A`: if (c != null) {
3921
+ let e = on.apply(0, c.concat(l));
3922
+ for (var r; (r = e.splice(0, 6).map(d)).length;) c != null && n(o, [.5 * (c[0] + r[0]), .5 * (c[1] + r[1])]), n(o, [.5 * (r[0] + r[2]), .5 * (r[1] + r[3])]), n(o, [.5 * (r[2] + r[4]), .5 * (r[3] + r[5])]), e.length && n(o, c = r.slice(-2));
3923
+ }
3920
3924
  }
3921
3925
  l.length >= 2 && n(o, l.slice(-2));
3922
3926
  }
3923
3927
  return t;
3924
3928
  }
3925
- function tn(e) {
3929
+ function rn(e) {
3926
3930
  e.list.sort((function(e, t) {
3927
3931
  return e[0] == t[0] ? e[1] - t[1] : e[0] - t[0];
3928
3932
  }));
3929
3933
  let t = [], n = 0, r = 0;
3930
3934
  for (let i = 0; i < e.list.length; i++) {
3931
- for (; t.length >= 2 && nn(t[t.length - 2], t[t.length - 1], e.list[i]) <= 0;) t.pop();
3935
+ for (; t.length >= 2 && an(t[t.length - 2], t[t.length - 1], e.list[i]) <= 0;) t.pop();
3932
3936
  e.list[i][1] < e.list[n][1] && (n = i, r = t.length), t.push(e.list[i]);
3933
3937
  }
3934
3938
  let i = [], a = e.list.length - 1, o = 0;
3935
3939
  for (let t = e.list.length; t--;) {
3936
- for (; i.length >= 2 && nn(i[i.length - 2], i[i.length - 1], e.list[t]) <= 0;) i.pop();
3940
+ for (; i.length >= 2 && an(i[i.length - 2], i[i.length - 1], e.list[t]) <= 0;) i.pop();
3937
3941
  e.list[t][1] > e.list[a][1] && (a = t, o = i.length), i.push(e.list[t]);
3938
3942
  }
3939
3943
  i.pop(), t.pop();
@@ -3946,10 +3950,10 @@ var l = e(((e) => {
3946
3950
  maxY: (t.length + o) % s.length
3947
3951
  };
3948
3952
  }
3949
- function nn(e, t, n) {
3953
+ function an(e, t, n) {
3950
3954
  return (t[0] - e[0]) * (n[1] - e[1]) - (t[1] - e[1]) * (n[0] - e[0]);
3951
3955
  }
3952
- let rn = (e, t, n, r, i, a, o, s, c, l) => {
3956
+ let on = (e, t, n, r, i, a, o, s, c, l) => {
3953
3957
  let u = Math.PI * 120 / 180, d = Math.PI / 180 * (+i || 0), f = [], p = (e, t, n) => e * Math.cos(n) - t * Math.sin(n), m = (e, t, n) => e * Math.sin(n) + t * Math.cos(n);
3954
3958
  if (l) _ = l[0], v = l[1], h = l[2], g = l[3];
3955
3959
  else {
@@ -3963,7 +3967,7 @@ var l = e(((e) => {
3963
3967
  let y = v - _;
3964
3968
  if (Math.abs(y) > u) {
3965
3969
  let e = v, t = s, a = c;
3966
- v = _ + u * (o && v > _ ? 1 : -1), s = h + n * Math.cos(v), c = g + r * Math.sin(v), f = rn(s, c, n, r, i, 0, o, t, a, [
3970
+ v = _ + u * (o && v > _ ? 1 : -1), s = h + n * Math.cos(v), c = g + r * Math.sin(v), f = on(s, c, n, r, i, 0, o, t, a, [
3967
3971
  v,
3968
3972
  e,
3969
3973
  h,
@@ -3971,58 +3975,58 @@ var l = e(((e) => {
3971
3975
  ]);
3972
3976
  }
3973
3977
  y = v - _;
3974
- let b = Math.cos(_), x = Math.sin(_), S = Math.cos(v), C = Math.sin(v), w = Math.tan(y / 4), T = 4 / 3 * n * w, E = 4 / 3 * r * w, D = [
3975
- -T * x,
3976
- E * b,
3977
- s + T * C - e,
3978
- c - E * S - t,
3978
+ let b = Math.cos(_), x = Math.sin(_), S = Math.cos(v), C = Math.sin(v), w = Math.tan(y / 4), ee = 4 / 3 * n * w, T = 4 / 3 * r * w, E = [
3979
+ -ee * x,
3980
+ T * b,
3981
+ s + ee * C - e,
3982
+ c - T * S - t,
3979
3983
  s - e,
3980
3984
  c - t
3981
3985
  ];
3982
- if (l) return D.concat(f);
3986
+ if (l) return E.concat(f);
3983
3987
  {
3984
- f = D.concat(f);
3988
+ f = E.concat(f);
3985
3989
  let e = [];
3986
3990
  for (let t = 0, n = f.length; t < n; t++) e[t] = t % 2 ? m(f[t - 1], f[t], d) : p(f[t], f[t + 1], d);
3987
3991
  return e;
3988
3992
  }
3989
- }, an = /* @__PURE__ */ new Set([
3993
+ }, sn = /* @__PURE__ */ new Set([
3990
3994
  `matrix`,
3991
3995
  `rotate`,
3992
3996
  `scale`,
3993
3997
  `skewX`,
3994
3998
  `skewY`,
3995
3999
  `translate`
3996
- ]), on = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, sn = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g, cn = (e) => {
4000
+ ]), cn = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, ln = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g, un = (e) => {
3997
4001
  let t = [], n = null;
3998
- for (let r of e.split(on)) if (r) if (an.has(r)) n = {
4002
+ for (let r of e.split(cn)) if (r) if (sn.has(r)) n = {
3999
4003
  name: r,
4000
4004
  data: []
4001
4005
  }, t.push(n);
4002
4006
  else {
4003
4007
  let e;
4004
- for (; e = sn.exec(r);) e = Number(e), n?.data.push(e);
4008
+ for (; e = ln.exec(r);) e = Number(e), n?.data.push(e);
4005
4009
  }
4006
4010
  return n == null || n.data.length == 0 ? [] : t;
4007
- }, ln = (e) => {
4008
- let t = e.map(((e) => e.name === `matrix` ? e.data : vn(e)));
4011
+ }, dn = (e) => {
4012
+ let t = e.map(((e) => e.name === `matrix` ? e.data : bn(e)));
4009
4013
  return {
4010
4014
  name: `matrix`,
4011
- data: t.length > 0 ? t.reduce(bn) : []
4015
+ data: t.length > 0 ? t.reduce(Sn) : []
4012
4016
  };
4013
- }, G = {
4017
+ }, W = {
4014
4018
  rad: (e) => e * Math.PI / 180,
4015
4019
  deg: (e) => e * 180 / Math.PI,
4016
- cos: (e) => Math.cos(G.rad(e)),
4017
- acos: (e, t) => z(G.deg(Math.acos(e)), t),
4018
- sin: (e) => Math.sin(G.rad(e)),
4019
- asin: (e, t) => z(G.deg(Math.asin(e)), t),
4020
- tan: (e) => Math.tan(G.rad(e)),
4021
- atan: (e, t) => z(G.deg(Math.atan(e)), t)
4022
- }, un = (e) => {
4023
- let t = [], n = dn(e), r = fn(e);
4020
+ cos: (e) => Math.cos(W.rad(e)),
4021
+ acos: (e, t) => R(W.deg(Math.acos(e)), t),
4022
+ sin: (e) => Math.sin(W.rad(e)),
4023
+ asin: (e, t) => R(W.deg(Math.asin(e)), t),
4024
+ tan: (e) => Math.tan(W.rad(e)),
4025
+ atan: (e, t) => R(W.deg(Math.atan(e)), t)
4026
+ }, fn = (e) => {
4027
+ let t = [], n = pn(e), r = mn(e);
4024
4028
  return n && t.push(n), r && t.push(r), t;
4025
- }, dn = (e) => {
4029
+ }, pn = (e) => {
4026
4030
  let [t, n, r, i, a, o] = e.data, s = t * i - n * r;
4027
4031
  if (s === 0) return;
4028
4032
  let c = Math.hypot(t, n);
@@ -4036,7 +4040,7 @@ var l = e(((e) => {
4036
4040
  l.push({
4037
4041
  name: `rotate`,
4038
4042
  data: [
4039
- G.deg(n < 0 ? -e : e),
4043
+ W.deg(n < 0 ? -e : e),
4040
4044
  0,
4041
4045
  0
4042
4046
  ]
@@ -4050,9 +4054,9 @@ var l = e(((e) => {
4050
4054
  let p = t * r + n * i;
4051
4055
  return p && l.push({
4052
4056
  name: `skewX`,
4053
- data: [G.deg(Math.atan(p / (t * t + n * n)))]
4057
+ data: [W.deg(Math.atan(p / (t * t + n * n)))]
4054
4058
  }), l;
4055
- }, fn = (e) => {
4059
+ }, mn = (e) => {
4056
4060
  let [t, n, r, i, a, o] = e.data, s = t * i - n * r;
4057
4061
  if (s === 0) return;
4058
4062
  let c = Math.hypot(r, i);
@@ -4066,7 +4070,7 @@ var l = e(((e) => {
4066
4070
  l.push({
4067
4071
  name: `rotate`,
4068
4072
  data: [
4069
- G.deg(u),
4073
+ W.deg(u),
4070
4074
  0,
4071
4075
  0
4072
4076
  ]
@@ -4079,10 +4083,10 @@ var l = e(((e) => {
4079
4083
  let p = t * r + n * i;
4080
4084
  return p && l.push({
4081
4085
  name: `skewY`,
4082
- data: [G.deg(Math.atan(p / (r * r + i * i)))]
4086
+ data: [W.deg(Math.atan(p / (r * r + i * i)))]
4083
4087
  }), l;
4084
- }, pn = (e, t, n) => {
4085
- let r = G.rad(n), i = 1 - Math.cos(r), a = Math.sin(r), o = (i * t + a * e) / (i * i + a * a);
4088
+ }, hn = (e, t, n) => {
4089
+ let r = W.rad(n), i = 1 - Math.cos(r), a = Math.sin(r), o = (i * t + a * e) / (i * i + a * a);
4086
4090
  return {
4087
4091
  name: `rotate`,
4088
4092
  data: [
@@ -4091,7 +4095,7 @@ var l = e(((e) => {
4091
4095
  o
4092
4096
  ]
4093
4097
  };
4094
- }, mn = (e) => {
4098
+ }, gn = (e) => {
4095
4099
  switch (e.name) {
4096
4100
  case `rotate`:
4097
4101
  case `skewX`:
@@ -4100,11 +4104,11 @@ var l = e(((e) => {
4100
4104
  case `translate`: return e.data[0] === 0 && e.data[1] === 0;
4101
4105
  }
4102
4106
  return !1;
4103
- }, hn = (e, t) => {
4107
+ }, _n = (e, t) => {
4104
4108
  let n = [];
4105
4109
  for (let r = 0; r < e.length; r++) {
4106
4110
  let i = e[r];
4107
- if (mn(i)) continue;
4111
+ if (gn(i)) continue;
4108
4112
  let a = i.data;
4109
4113
  switch (i.name) {
4110
4114
  case `rotate`:
@@ -4113,7 +4117,7 @@ var l = e(((e) => {
4113
4117
  case -180:
4114
4118
  {
4115
4119
  let t = e[r + 1];
4116
- t && t.name === `scale` ? (n.push(gn(t.data.map(((e) => -e)))), r++) : n.push({
4120
+ t && t.name === `scale` ? (n.push(vn(t.data.map(((e) => -e)))), r++) : n.push({
4117
4121
  name: `scale`,
4118
4122
  data: [-1]
4119
4123
  });
@@ -4126,7 +4130,7 @@ var l = e(((e) => {
4126
4130
  });
4127
4131
  break;
4128
4132
  case `scale`:
4129
- n.push(gn(a));
4133
+ n.push(vn(a));
4130
4134
  break;
4131
4135
  case `skewX`:
4132
4136
  case `skewY`:
@@ -4140,7 +4144,7 @@ var l = e(((e) => {
4140
4144
  let i = e[r + 1];
4141
4145
  if (i && i.name === `rotate` && i.data[0] !== 180 && i.data[0] !== -180 && i.data[0] !== 0 && i.data[1] === 0 && i.data[2] === 0) {
4142
4146
  let e = t[r].data;
4143
- n.push(pn(e[0], e[1], t[r + 1].data[0])), r++;
4147
+ n.push(hn(e[0], e[1], t[r + 1].data[0])), r++;
4144
4148
  continue;
4145
4149
  }
4146
4150
  }
@@ -4148,27 +4152,29 @@ var l = e(((e) => {
4148
4152
  name: `translate`,
4149
4153
  data: a.slice(0, a[1] ? 2 : 1)
4150
4154
  });
4151
- break;
4152
4155
  }
4153
4156
  }
4154
4157
  return n.length ? n : [{
4155
4158
  name: `scale`,
4156
4159
  data: [1]
4157
4160
  }];
4158
- }, gn = (e) => ({
4161
+ }, vn = (e) => ({
4159
4162
  name: `scale`,
4160
4163
  data: e.slice(0, e[0] === e[1] ? 1 : 2)
4161
- }), _n = (e, t) => {
4162
- let n = un(e), r, i = Number.MAX_VALUE;
4164
+ }), yn = (e, t) => {
4165
+ let n = fn(e), r, i = Number.MAX_VALUE;
4163
4166
  for (let e of n) {
4164
- let n = hn(e.map(((e) => xn({
4165
- name: e.name,
4166
- data: [...e.data]
4167
- }, t))), e), a = Dn(n, t).length;
4168
- a < i && (r = n, i = a);
4167
+ let n = e.map(((e) => {
4168
+ let n = {
4169
+ name: e.name,
4170
+ data: [...e.data]
4171
+ };
4172
+ return Cn(n, t);
4173
+ })), a = _n(n, e), o = kn(a, t).length;
4174
+ o < i && (r = a, i = o);
4169
4175
  }
4170
4176
  return r ?? [e];
4171
- }, vn = (e) => {
4177
+ }, bn = (e) => {
4172
4178
  if (e.name === `matrix`) return e.data;
4173
4179
  switch (e.name) {
4174
4180
  case `translate`: return [
@@ -4188,7 +4194,7 @@ var l = e(((e) => {
4188
4194
  0
4189
4195
  ];
4190
4196
  case `rotate`:
4191
- var t = G.cos(e.data[0]), n = G.sin(e.data[0]), r = e.data[1] || 0, i = e.data[2] || 0;
4197
+ var t = W.cos(e.data[0]), n = W.sin(e.data[0]), r = e.data[1] || 0, i = e.data[2] || 0;
4192
4198
  return [
4193
4199
  t,
4194
4200
  n,
@@ -4200,14 +4206,14 @@ var l = e(((e) => {
4200
4206
  case `skewX`: return [
4201
4207
  1,
4202
4208
  0,
4203
- G.tan(e.data[0]),
4209
+ W.tan(e.data[0]),
4204
4210
  1,
4205
4211
  0,
4206
4212
  0
4207
4213
  ];
4208
4214
  case `skewY`: return [
4209
4215
  1,
4210
- G.tan(e.data[0]),
4216
+ W.tan(e.data[0]),
4211
4217
  0,
4212
4218
  1,
4213
4219
  0,
@@ -4215,156 +4221,155 @@ var l = e(((e) => {
4215
4221
  ];
4216
4222
  default: throw Error(`Unknown transform ${e.name}`);
4217
4223
  }
4218
- }, yn = (e, t, n) => {
4224
+ }, xn = (e, t, n) => {
4219
4225
  let r = t[5] - e[0], i = t[6] - e[1], a = t[0], o = t[1], s = t[2] * Math.PI / 180, c = Math.cos(s), l = Math.sin(s);
4220
4226
  if (a > 0 && o > 0) {
4221
4227
  let e = (r * c + i * l) ** 2 / (4 * a * a) + (i * c - r * l) ** 2 / (4 * o * o);
4222
4228
  e > 1 && (e = Math.sqrt(e), a *= e, o *= e);
4223
4229
  }
4224
- let u = bn(n, [
4230
+ let u = [
4225
4231
  a * c,
4226
4232
  a * l,
4227
4233
  -o * l,
4228
4234
  o * c,
4229
4235
  0,
4230
4236
  0
4231
- ]), d = u[2] * u[2] + u[3] * u[3], f = u[0] * u[0] + u[1] * u[1] + d, p = Math.hypot(u[0] - u[3], u[1] + u[2]) * Math.hypot(u[0] + u[3], u[1] - u[2]);
4232
- if (p) {
4233
- let e = (f + p) / 2, n = (f - p) / 2, r = Math.abs(e - d) > 1e-6, i = (r ? e : n) - d, a = u[0] * u[2] + u[1] * u[3], o = u[0] * i + u[2] * a, s = u[1] * i + u[3] * a;
4237
+ ], d = Sn(n, u), f = d[2] * d[2] + d[3] * d[3], p = d[0] * d[0] + d[1] * d[1] + f, m = Math.hypot(d[0] - d[3], d[1] + d[2]) * Math.hypot(d[0] + d[3], d[1] - d[2]);
4238
+ if (m) {
4239
+ let e = (p + m) / 2, n = (p - m) / 2, r = Math.abs(e - f) > 1e-6, i = (r ? e : n) - f, a = d[0] * d[2] + d[1] * d[3], o = d[0] * i + d[2] * a, s = d[1] * i + d[3] * a;
4234
4240
  t[0] = Math.sqrt(e), t[1] = Math.sqrt(n), t[2] = ((r ? s < 0 : o > 0) ? -1 : 1) * Math.acos((r ? o : s) / Math.hypot(o, s)) * 180 / Math.PI;
4235
- } else t[0] = t[1] = Math.sqrt(f / 2), t[2] = 0;
4241
+ } else t[0] = t[1] = Math.sqrt(p / 2), t[2] = 0;
4236
4242
  return n[0] < 0 != n[3] < 0 && (t[4] = 1 - t[4]), t;
4237
- }, bn = (e, t) => [
4243
+ }, Sn = (e, t) => [
4238
4244
  e[0] * t[0] + e[2] * t[1],
4239
4245
  e[1] * t[0] + e[3] * t[1],
4240
4246
  e[0] * t[2] + e[2] * t[3],
4241
4247
  e[1] * t[2] + e[3] * t[3],
4242
4248
  e[0] * t[4] + e[2] * t[5] + e[4],
4243
4249
  e[1] * t[4] + e[3] * t[5] + e[5]
4244
- ], xn = (e, t) => {
4250
+ ], Cn = (e, t) => {
4245
4251
  switch (e.name) {
4246
4252
  case `translate`:
4247
- e.data = Cn(e.data, t);
4253
+ e.data = Tn(e.data, t);
4248
4254
  break;
4249
4255
  case `rotate`:
4250
- e.data = [...Sn(e.data.slice(0, 1), t), ...Cn(e.data.slice(1), t)];
4256
+ e.data = [...wn(e.data.slice(0, 1), t), ...Tn(e.data.slice(1), t)];
4251
4257
  break;
4252
4258
  case `skewX`:
4253
4259
  case `skewY`:
4254
- e.data = Sn(e.data, t);
4255
- break;
4256
- case `scale`:
4257
4260
  e.data = wn(e.data, t);
4258
4261
  break;
4259
- case `matrix`:
4260
- e.data = [...wn(e.data.slice(0, 4), t), ...Cn(e.data.slice(4), t)];
4262
+ case `scale`:
4263
+ e.data = En(e.data, t);
4261
4264
  break;
4265
+ case `matrix`: e.data = [...En(e.data.slice(0, 4), t), ...Tn(e.data.slice(4), t)];
4262
4266
  }
4263
4267
  return e;
4264
- }, Sn = (e, t) => t.degPrecision != null && t.degPrecision >= 1 && t.floatPrecision < 20 ? En(t.degPrecision, e) : Tn(e), Cn = (e, t) => t.floatPrecision >= 1 && t.floatPrecision < 20 ? En(t.floatPrecision, e) : Tn(e), wn = (e, t) => t.transformPrecision >= 1 && t.floatPrecision < 20 ? En(t.transformPrecision, e) : Tn(e), Tn = (e) => e.map(Math.round), En = (e, t) => {
4265
- for (let n = t.length, r = +(.1 ** e).toFixed(e); n--;) if (z(t[n], e) !== t[n]) {
4268
+ }, wn = (e, t) => t.degPrecision != null && t.degPrecision >= 1 && t.floatPrecision < 20 ? On(t.degPrecision, e) : Dn(e), Tn = (e, t) => t.floatPrecision >= 1 && t.floatPrecision < 20 ? On(t.floatPrecision, e) : Dn(e), En = (e, t) => t.transformPrecision >= 1 && t.floatPrecision < 20 ? On(t.transformPrecision, e) : Dn(e), Dn = (e) => e.map(Math.round), On = (e, t) => {
4269
+ for (let n = t.length, r = +(.1 ** e).toFixed(e); n--;) if (R(t[n], e) !== t[n]) {
4266
4270
  let i = +t[n].toFixed(e - 1);
4267
4271
  t[n] = +Math.abs(i - t[n]).toFixed(e + 1) >= r ? +t[n].toFixed(e) : i;
4268
4272
  }
4269
4273
  return t;
4270
- }, Dn = (e, t) => e.map(((e) => (xn(e, t), `${e.name}(${L(e.data, t)})`))).join(``), On = /[-+]?(\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g, kn = (e, t) => {
4271
- let n = F(e);
4274
+ }, kn = (e, t) => e.map(((e) => (Cn(e, t), `${e.name}(${I(e.data, t)})`))).join(``), An = /[-+]?(\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g, jn = (e, t) => {
4275
+ let n = P(e);
4272
4276
  return { element: { enter: (e) => {
4273
- if (e.attributes.d == null || e.attributes.id != null || e.attributes.transform == null || e.attributes.transform === `` || e.attributes.style != null || Object.entries(e.attributes).some((([e, t]) => N.has(e) && $e(t)))) return;
4274
- let r = I(n, e), i = r.transform;
4277
+ if (e.attributes.d == null || e.attributes.id != null || e.attributes.transform == null || e.attributes.transform === `` || e.attributes.style != null || Object.entries(e.attributes).some((([e, t]) => M.has(e) && et(t)))) return;
4278
+ let r = F(n, e), i = r.transform;
4275
4279
  if (i.type === `static` && i.value !== e.attributes.transform) return;
4276
- let a = ln(cn(e.attributes.transform)), o = r.stroke?.type === `static` ? r.stroke.value : null, s = r[`stroke-width`]?.type === `static` ? r[`stroke-width`].value : null, c = t.transformPrecision;
4280
+ let a = dn(un(e.attributes.transform)), o = r.stroke?.type === `static` ? r.stroke.value : null, s = r[`stroke-width`]?.type === `static` ? r[`stroke-width`].value : null, c = t.transformPrecision;
4277
4281
  if (r.stroke?.type === `dynamic` || r[`stroke-width`]?.type === `dynamic`) return;
4278
4282
  let l = Number(Math.hypot(a.data[0], a.data[1]).toFixed(c));
4279
4283
  if (o && o != `none`) {
4280
4284
  if (!t.applyTransformsStroked || (a.data[0] !== a.data[3] || a.data[1] !== -a.data[2]) && (a.data[0] !== -a.data[3] || a.data[1] !== a.data[2])) return;
4281
- l !== 1 && e.attributes[`vector-effect`] !== `non-scaling-stroke` && (e.attributes[`stroke-width`] = (s || _e.presentation[`stroke-width`]).trim().replace(On, ((e) => R(Number(e) * l))), e.attributes[`stroke-dashoffset`] != null && (e.attributes[`stroke-dashoffset`] = e.attributes[`stroke-dashoffset`].trim().replace(On, ((e) => R(Number(e) * l)))), e.attributes[`stroke-dasharray`] != null && (e.attributes[`stroke-dasharray`] = e.attributes[`stroke-dasharray`].trim().replace(On, ((e) => R(Number(e) * l)))));
4285
+ l !== 1 && e.attributes[`vector-effect`] !== `non-scaling-stroke` && (e.attributes[`stroke-width`] = (s || ve.presentation[`stroke-width`]).trim().replace(An, ((e) => L(Number(e) * l))), e.attributes[`stroke-dashoffset`] != null && (e.attributes[`stroke-dashoffset`] = e.attributes[`stroke-dashoffset`].trim().replace(An, ((e) => L(Number(e) * l)))), e.attributes[`stroke-dasharray`] != null && (e.attributes[`stroke-dasharray`] = e.attributes[`stroke-dasharray`].trim().replace(An, ((e) => L(Number(e) * l)))));
4282
4286
  }
4283
- An(qt(e), a.data), delete e.attributes.transform;
4287
+ let u = Yt(e);
4288
+ Mn(u, a.data), delete e.attributes.transform;
4284
4289
  } } };
4285
- }, K = (e, t, n) => [e[0] * t + e[2] * n + e[4], e[1] * t + e[3] * n + e[5]], q = (e, t, n) => [e[0] * t + e[2] * n, e[1] * t + e[3] * n], An = (e, t) => {
4290
+ }, G = (e, t, n) => [e[0] * t + e[2] * n + e[4], e[1] * t + e[3] * n + e[5]], K = (e, t, n) => [e[0] * t + e[2] * n, e[1] * t + e[3] * n], Mn = (e, t) => {
4286
4291
  let n = [0, 0], r = [0, 0];
4287
4292
  for (let i of e) {
4288
4293
  let { command: e, args: a } = i;
4289
4294
  if (e === `M`) {
4290
4295
  r[0] = a[0], r[1] = a[1], n[0] = r[0], n[1] = r[1];
4291
- let [e, i] = K(t, a[0], a[1]);
4296
+ let [e, i] = G(t, a[0], a[1]);
4292
4297
  a[0] = e, a[1] = i;
4293
4298
  }
4294
4299
  if (e === `m`) {
4295
4300
  r[0] += a[0], r[1] += a[1], n[0] = r[0], n[1] = r[1];
4296
- let [e, i] = q(t, a[0], a[1]);
4301
+ let [e, i] = K(t, a[0], a[1]);
4297
4302
  a[0] = e, a[1] = i;
4298
4303
  }
4299
4304
  if (e === `H` && (e = `L`, a = [a[0], r[1]]), e === `h` && (e = `l`, a = [a[0], 0]), e === `V` && (e = `L`, a = [r[0], a[0]]), e === `v` && (e = `l`, a = [0, a[0]]), e === `L`) {
4300
4305
  r[0] = a[0], r[1] = a[1];
4301
- let [e, n] = K(t, a[0], a[1]);
4306
+ let [e, n] = G(t, a[0], a[1]);
4302
4307
  a[0] = e, a[1] = n;
4303
4308
  }
4304
4309
  if (e === `l`) {
4305
4310
  r[0] += a[0], r[1] += a[1];
4306
- let [e, n] = q(t, a[0], a[1]);
4311
+ let [e, n] = K(t, a[0], a[1]);
4307
4312
  a[0] = e, a[1] = n;
4308
4313
  }
4309
4314
  if (e === `C`) {
4310
4315
  r[0] = a[4], r[1] = a[5];
4311
- let [e, n] = K(t, a[0], a[1]), [i, o] = K(t, a[2], a[3]), [s, c] = K(t, a[4], a[5]);
4316
+ let [e, n] = G(t, a[0], a[1]), [i, o] = G(t, a[2], a[3]), [s, c] = G(t, a[4], a[5]);
4312
4317
  a[0] = e, a[1] = n, a[2] = i, a[3] = o, a[4] = s, a[5] = c;
4313
4318
  }
4314
4319
  if (e === `c`) {
4315
4320
  r[0] += a[4], r[1] += a[5];
4316
- let [e, n] = q(t, a[0], a[1]), [i, o] = q(t, a[2], a[3]), [s, c] = q(t, a[4], a[5]);
4321
+ let [e, n] = K(t, a[0], a[1]), [i, o] = K(t, a[2], a[3]), [s, c] = K(t, a[4], a[5]);
4317
4322
  a[0] = e, a[1] = n, a[2] = i, a[3] = o, a[4] = s, a[5] = c;
4318
4323
  }
4319
4324
  if (e === `S`) {
4320
4325
  r[0] = a[2], r[1] = a[3];
4321
- let [e, n] = K(t, a[0], a[1]), [i, o] = K(t, a[2], a[3]);
4326
+ let [e, n] = G(t, a[0], a[1]), [i, o] = G(t, a[2], a[3]);
4322
4327
  a[0] = e, a[1] = n, a[2] = i, a[3] = o;
4323
4328
  }
4324
4329
  if (e === `s`) {
4325
4330
  r[0] += a[2], r[1] += a[3];
4326
- let [e, n] = q(t, a[0], a[1]), [i, o] = q(t, a[2], a[3]);
4331
+ let [e, n] = K(t, a[0], a[1]), [i, o] = K(t, a[2], a[3]);
4327
4332
  a[0] = e, a[1] = n, a[2] = i, a[3] = o;
4328
4333
  }
4329
4334
  if (e === `Q`) {
4330
4335
  r[0] = a[2], r[1] = a[3];
4331
- let [e, n] = K(t, a[0], a[1]), [i, o] = K(t, a[2], a[3]);
4336
+ let [e, n] = G(t, a[0], a[1]), [i, o] = G(t, a[2], a[3]);
4332
4337
  a[0] = e, a[1] = n, a[2] = i, a[3] = o;
4333
4338
  }
4334
4339
  if (e === `q`) {
4335
4340
  r[0] += a[2], r[1] += a[3];
4336
- let [e, n] = q(t, a[0], a[1]), [i, o] = q(t, a[2], a[3]);
4341
+ let [e, n] = K(t, a[0], a[1]), [i, o] = K(t, a[2], a[3]);
4337
4342
  a[0] = e, a[1] = n, a[2] = i, a[3] = o;
4338
4343
  }
4339
4344
  if (e === `T`) {
4340
4345
  r[0] = a[0], r[1] = a[1];
4341
- let [e, n] = K(t, a[0], a[1]);
4346
+ let [e, n] = G(t, a[0], a[1]);
4342
4347
  a[0] = e, a[1] = n;
4343
4348
  }
4344
4349
  if (e === `t`) {
4345
4350
  r[0] += a[0], r[1] += a[1];
4346
- let [e, n] = q(t, a[0], a[1]);
4351
+ let [e, n] = K(t, a[0], a[1]);
4347
4352
  a[0] = e, a[1] = n;
4348
4353
  }
4349
4354
  if (e === `A`) {
4350
- if (yn(r, a, t), r[0] = a[5], r[1] = a[6], Math.abs(a[2]) > 80) {
4355
+ if (xn(r, a, t), r[0] = a[5], r[1] = a[6], Math.abs(a[2]) > 80) {
4351
4356
  let e = a[0], t = a[2];
4352
4357
  a[0] = a[1], a[1] = e, a[2] = t + (t > 0 ? -90 : 90);
4353
4358
  }
4354
- let [e, n] = K(t, a[5], a[6]);
4359
+ let [e, n] = G(t, a[5], a[6]);
4355
4360
  a[5] = e, a[6] = n;
4356
4361
  }
4357
4362
  if (e === `a`) {
4358
- if (yn([0, 0], a, t), r[0] += a[5], r[1] += a[6], Math.abs(a[2]) > 80) {
4363
+ if (xn([0, 0], a, t), r[0] += a[5], r[1] += a[6], Math.abs(a[2]) > 80) {
4359
4364
  let e = a[0], t = a[2];
4360
4365
  a[0] = a[1], a[1] = e, a[2] = t + (t > 0 ? -90 : 90);
4361
4366
  }
4362
- let [e, n] = q(t, a[5], a[6]);
4367
+ let [e, n] = K(t, a[5], a[6]);
4363
4368
  a[5] = e, a[6] = n;
4364
4369
  }
4365
4370
  (e === `z` || e === `Z`) && (r[0] = n[0], r[1] = n[1]), i.command = e, i.args = a;
4366
4371
  }
4367
- }, J, Y, X, jn, Mn, Nn = (e, t) => {
4372
+ }, q, J, Y, Nn, Pn, Fn = (e, t) => {
4368
4373
  let { applyTransforms: n = !0, applyTransformsStroked: r = !0, makeArcs: i = {
4369
4374
  threshold: 2.5,
4370
4375
  tolerance: .5
@@ -4388,30 +4393,30 @@ var l = e(((e) => {
4388
4393
  noSpaceAfterFlags: v,
4389
4394
  forceAbsolutePath: y
4390
4395
  };
4391
- n && C(e, kn(e, {
4396
+ n && C(e, jn(e, {
4392
4397
  transformPrecision: d,
4393
4398
  applyTransformsStroked: r
4394
4399
  }));
4395
- let x = F(e);
4400
+ let x = P(e);
4396
4401
  return { element: { enter: (e) => {
4397
- if (ge.has(e.name) && e.attributes.d != null) {
4398
- let t = I(x, e);
4399
- Y = u, X = Y === !1 ? .01 : +(.1 ** Y).toFixed(Y), J = Y && Y > 0 && Y < 20 ? zn : Bn, i && (jn = i.threshold, Mn = i.tolerance);
4400
- let n = t[`marker-mid`] != null, r = t.stroke && (t.stroke.type === `dynamic` || t.stroke.value !== `none`), a = t[`stroke-linecap`] && (t[`stroke-linecap`].type === `dynamic` || t[`stroke-linecap`].value !== `butt`), o = r && a, s = !r || t[`stroke-linecap`]?.type === `static` && t[`stroke-linecap`].value === `round` && t[`stroke-linejoin`]?.type === `static` && t[`stroke-linejoin`].value === `round`, c = qt(e);
4402
+ if (_e.has(e.name) && e.attributes.d != null) {
4403
+ let t = F(x, e);
4404
+ J = u, Y = J === !1 ? .01 : +(.1 ** J).toFixed(J), q = J && J > 0 && J < 20 ? Vn : Hn, i && (Nn = i.threshold, Pn = i.tolerance);
4405
+ let n = t[`marker-mid`] != null, r = t.stroke && (t.stroke.type === `dynamic` || t.stroke.value !== `none`), a = t[`stroke-linecap`] && (t[`stroke-linecap`].type === `dynamic` || t[`stroke-linecap`].value !== `butt`), o = !r || t[`stroke-linecap`]?.type === `static` && t[`stroke-linecap`].value === `round` && t[`stroke-linejoin`]?.type === `static` && t[`stroke-linejoin`].value === `round`, s = (e, t) => r ? e ? !a : t : !0, c = Yt(e);
4401
4406
  if (c.length) {
4402
4407
  let t = c.some(((e) => e.command !== `m` && e.command !== `M`));
4403
- Pn(c), c = Fn(c, b, {
4404
- isSafeToUseZ: s,
4405
- maybeHasStrokeAndLinecap: o,
4408
+ In(c), c = Ln(c, b, {
4409
+ isSafeToUseZ: o,
4410
+ isSafeToRemove: s,
4406
4411
  hasMarkerMid: n
4407
- }), h && (c = In(c, b)), (e.attributes[`marker-start`] != null || e.attributes[`marker-end`] != null) && t && c.every(((e) => e.command === `m` || e.command === `M`)) && c.push({
4412
+ }), h && (c = Rn(c, b)), (e.attributes[`marker-start`] != null || e.attributes[`marker-end`] != null) && t && c.every(((e) => e.command === `m` || e.command === `M`)) && c.push({
4408
4413
  command: `z`,
4409
4414
  args: []
4410
- }), Yt(e, c, b);
4415
+ }), Zt(e, c, b);
4411
4416
  }
4412
4417
  }
4413
4418
  } } };
4414
- }, Pn = (e) => {
4419
+ }, In = (e) => {
4415
4420
  let t = [0, 0], n = [0, 0], r = [0, 0];
4416
4421
  for (let i = 0; i < e.length; i += 1) {
4417
4422
  let a = e[i], { command: o, args: s } = a;
@@ -4419,8 +4424,8 @@ var l = e(((e) => {
4419
4424
  }
4420
4425
  return e;
4421
4426
  };
4422
- function Fn(e, t, { isSafeToUseZ: n, maybeHasStrokeAndLinecap: r, hasMarkerMid: i }) {
4423
- let a = Xn.bind(null, t), o = [0, 0], s = [0, 0], c = {}, l;
4427
+ function Ln(e, t, { isSafeToUseZ: n, isSafeToRemove: r, hasMarkerMid: i }) {
4428
+ let a = Qn.bind(null, t), o = [0, 0], s = [0, 0], c = {}, l;
4424
4429
  return e = e.filter((function(e, u, d) {
4425
4430
  let f = l, p = e.command, m = e.args, h = d[u + 1];
4426
4431
  if (p !== `Z` && p !== `z`) {
@@ -4430,8 +4435,8 @@ var l = e(((e) => {
4430
4435
  let e = c.args, t = e.length;
4431
4436
  l[0] = e[t - 2] - e[t - 4], l[1] = e[t - 1] - e[t - 3];
4432
4437
  }
4433
- if (t.makeArcs && (p == `c` || p == `s`) && Ln(l) && (_ = Kn(l))) {
4434
- let t = J([_.radius])[0], n = Yn(l, _), r = +(l[5] * l[0] - l[4] * l[1] > 0), i = {
4438
+ if (t.makeArcs && (p == `c` || p == `s`) && zn(l) && (_ = Jn(l))) {
4439
+ let t = q([_.radius])[0], n = Zn(l, _), r = +(l[5] * l[0] - l[4] * l[1] > 0), i = {
4435
4440
  command: `a`,
4436
4441
  args: [
4437
4442
  t,
@@ -4448,9 +4453,9 @@ var l = e(((e) => {
4448
4453
  center: f,
4449
4454
  radius: _.radius
4450
4455
  }, y = [e], b = 0, x = ``, S;
4451
- if (c.command == `c` && Ln(c.args) && Jn(c.args, _) || c.command == `a` && c.sdata && Jn(c.sdata, _)) {
4456
+ if (c.command == `c` && zn(c.args) && Xn(c.args, _) || c.command == `a` && c.sdata && Xn(c.sdata, _)) {
4452
4457
  y.unshift(c), i.base = c.base, i.args[5] = i.coords[0] - i.base[0], i.args[6] = i.coords[1] - i.base[1];
4453
- let e = c.command == `a` ? c.sdata : c.args, t = Yn(e, {
4458
+ let e = c.command == `a` ? c.sdata : c.args, t = Zn(e, {
4454
4459
  center: [e[4] + _.center[0], e[5] + _.center[1]],
4455
4460
  radius: _.radius
4456
4461
  });
@@ -4458,10 +4463,10 @@ var l = e(((e) => {
4458
4463
  }
4459
4464
  for (var g = u; (h = d[++g]) && (h.command === `c` || h.command === `s`);) {
4460
4465
  let e = h.args;
4461
- if (h.command == `s` && (S = Z({
4466
+ if (h.command == `s` && (S = X({
4462
4467
  command: `s`,
4463
4468
  args: h.args.slice()
4464
- }, d[g - 1].args), e = S.args, S.args = e.slice(0, 2), x = a([S])), !Ln(e) || !qn(e, v) || (n += Yn(e, v), n - 2 * Math.PI > .001)) break;
4469
+ }, d[g - 1].args), e = S.args, S.args = e.slice(0, 2), x = a([S])), !zn(e) || !Yn(e, v) || (n += Zn(e, v), n - 2 * Math.PI > .001)) break;
4465
4470
  if (n > Math.PI && (i.args[3] = 1), y.push(h), !(2 * Math.PI - n > .001)) {
4466
4471
  i.args[5] = 2 * (v.center[0] - e[4]), i.args[6] = 2 * (v.center[1] - e[5]), i.coords = [i.base[0] + i.args[5], i.base[1] + i.args[6]], i = {
4467
4472
  command: `a`,
@@ -4482,61 +4487,61 @@ var l = e(((e) => {
4482
4487
  i.coords = h.coords, i.args[5] = i.coords[0] - i.base[0], i.args[6] = i.coords[1] - i.base[1], f[0] -= e[4], f[1] -= e[5];
4483
4488
  }
4484
4489
  if ((a(s) + x).length < a(y).length) {
4485
- if (d[g] && d[g].command == `s` && Z(d[g], d[g - 1].args), b) {
4490
+ if (d[g] && d[g].command == `s` && X(d[g], d[g - 1].args), b) {
4486
4491
  let t = s.shift();
4487
- J(t.args), o[0] += t.args[5] - c.args[c.args.length - 2], o[1] += t.args[6] - c.args[c.args.length - 1], c.command = `a`, c.args = t.args, e.base = c.coords = t.coords;
4492
+ q(t.args), o[0] += t.args[5] - c.args[c.args.length - 2], o[1] += t.args[6] - c.args[c.args.length - 1], c.command = `a`, c.args = t.args, e.base = c.coords = t.coords;
4488
4493
  }
4489
4494
  if (i = s.shift(), y.length == 1 ? e.sdata = l.slice() : y.length - 1 - b > 0 && d.splice(u + 1, y.length - 1 - b, ...s), !i) return !1;
4490
4495
  p = `a`, m = i.args, e.coords = i.coords;
4491
4496
  }
4492
4497
  }
4493
- if (Y !== !1) {
4498
+ if (J !== !1) {
4494
4499
  if (p === `m` || p === `l` || p === `t` || p === `q` || p === `s` || p === `c`) for (let t = m.length; t--;) m[t] += e.base[t % 2] - o[t % 2];
4495
4500
  else p == `h` ? m[0] += e.base[0] - o[0] : p == `v` ? m[0] += e.base[1] - o[1] : p == `a` && (m[5] += e.base[0] - o[0], m[6] += e.base[1] - o[1]);
4496
- J(m), p == `h` ? o[0] += m[0] : p == `v` ? o[1] += m[0] : (o[0] += m[m.length - 2], o[1] += m[m.length - 1]), J(o), (p === `M` || p === `m`) && (s[0] = o[0], s[1] = o[1]);
4501
+ q(m), p == `h` ? o[0] += m[0] : p == `v` ? o[1] += m[0] : (o[0] += m[m.length - 2], o[1] += m[m.length - 1]), q(o), (p === `M` || p === `m`) && (s[0] = o[0], s[1] = o[1]);
4497
4502
  }
4498
- let v = p === `a` ? Hn(m) : void 0;
4499
- if (t.smartArcRounding && v !== void 0 && Y) for (let e = Y; e >= 0; e--) {
4500
- let t = z(m[0], e), n = Hn([
4503
+ let v = p === `a` ? Wn(m) : void 0;
4504
+ if (t.smartArcRounding && v !== void 0 && J) for (let e = J; e >= 0; e--) {
4505
+ let t = R(m[0], e), n = Wn([
4501
4506
  t,
4502
4507
  t,
4503
4508
  ...m.slice(2)
4504
4509
  ]);
4505
- if (!(Math.abs(v - n) < X)) break;
4510
+ if (!(Math.abs(v - n) < Y)) break;
4506
4511
  m[0] = t, m[1] = t;
4507
4512
  }
4508
- if (t.straightCurves && (p === `c` && Vn(m) || p === `s` && Vn(l) ? (h && h.command == `s` && Z(h, m), p = `l`, m = m.slice(-2)) : p === `q` && Vn(m) ? (h && h.command == `t` && Z(h, m), p = `l`, m = m.slice(-2)) : (p === `t` && c.command !== `q` && c.command !== `t` || p === `a` && (m[0] === 0 || m[1] === 0 || v !== void 0 && v < X)) && (p = `l`, m = m.slice(-2))), t.convertToQ && p == `c`) {
4513
+ if (t.straightCurves && (p === `c` && Un(m) || p === `s` && Un(l) ? (h && h.command == `s` && X(h, m), p = `l`, m = m.slice(-2)) : p === `q` && Un(m) || p === `t` && c.command !== `q` && c.command !== `t` ? (p == `q` && h && h.command == `t` && X(h, m), p == `t` && h && h.command == `t` && (h.command = `q`, h.args.unshift(2 * e.coords[0] - e.base[0] - e.coords[0], 2 * e.coords[1] - e.base[1] - e.coords[1])), p = `l`, m = m.slice(-2)) : p === `a` && (m[0] === 0 || m[1] === 0 || v !== void 0 && v < Y) && (p = `l`, m = m.slice(-2))), t.convertToQ && p == `c`) {
4509
4514
  let n = .75 * (e.base[0] + m[0]) - .25 * e.base[0], r = .75 * (e.base[0] + m[2]) - .25 * (e.base[0] + m[4]);
4510
- if (Math.abs(n - r) < X * 2) {
4515
+ if (Math.abs(n - r) < Y * 2) {
4511
4516
  let i = .75 * (e.base[1] + m[1]) - .25 * e.base[1], a = .75 * (e.base[1] + m[3]) - .25 * (e.base[1] + m[5]);
4512
- if (Math.abs(i - a) < X * 2) {
4517
+ if (Math.abs(i - a) < Y * 2) {
4513
4518
  let o = m.slice();
4514
- o.splice(0, 4, n + r - e.base[0], i + a - e.base[1]), J(o);
4515
- let s = L(m, t).length;
4516
- L(o, t).length < s && (p = `q`, m = o, h && h.command == `s` && Z(h, m));
4519
+ o.splice(0, 4, n + r - e.base[0], i + a - e.base[1]), q(o);
4520
+ let s = I(m, t).length;
4521
+ I(o, t).length < s && (p = `q`, m = o, h && h.command == `s` && X(h, m));
4517
4522
  }
4518
4523
  }
4519
4524
  }
4520
4525
  if (t.lineShorthands && p === `l` && (m[1] === 0 ? (p = `h`, m.pop()) : m[0] === 0 && (p = `v`, m.shift())), t.collapseRepeated && i === !1 && (p === `m` || p === `h` || p === `v`) && c.command && p == c.command.toLowerCase() && (p != `h` && p != `v` || c.args[0] >= 0 == m[0] >= 0)) return c.args[0] += m[0], p != `h` && p != `v` && (c.args[1] += m[1]), c.coords = e.coords, d[u] = c, !1;
4521
4526
  if (t.curveSmoothShorthands && c.command) {
4522
- if (p === `c`) (c.command === `c` && Math.abs(m[0] - -(c.args[2] - c.args[4])) < X && Math.abs(m[1] - -(c.args[3] - c.args[5])) < X || c.command === `s` && Math.abs(m[0] - -(c.args[0] - c.args[2])) < X && Math.abs(m[1] - -(c.args[1] - c.args[3])) < X || c.command !== `c` && c.command !== `s` && Math.abs(m[0]) < X && Math.abs(m[1]) < X) && (p = `s`, m = m.slice(2));
4527
+ if (p === `c`) (c.command === `c` && Math.abs(m[0] - -(c.args[2] - c.args[4])) < Y && Math.abs(m[1] - -(c.args[3] - c.args[5])) < Y || c.command === `s` && Math.abs(m[0] - -(c.args[0] - c.args[2])) < Y && Math.abs(m[1] - -(c.args[1] - c.args[3])) < Y || c.command !== `c` && c.command !== `s` && Math.abs(m[0]) < Y && Math.abs(m[1]) < Y) && (p = `s`, m = m.slice(2));
4523
4528
  else if (p === `q`) {
4524
- if (c.command === `q` && Math.abs(m[0] - (c.args[2] - c.args[0])) < X && Math.abs(m[1] - (c.args[3] - c.args[1])) < X) p = `t`, m = m.slice(2);
4529
+ if (c.command === `q` && Math.abs(m[0] - (c.args[2] - c.args[0])) < Y && Math.abs(m[1] - (c.args[3] - c.args[1])) < Y) p = `t`, m = m.slice(2);
4525
4530
  else if (c.command === `t`) {
4526
- let t = Wn(f, e.base), n = [m[0] + e.base[0], m[1] + e.base[1]];
4527
- Math.abs(t[0] - n[0]) < X && Math.abs(t[1] - n[1]) < X && (p = `t`, m = m.slice(2));
4531
+ let t = Kn(f, e.base), n = [m[0] + e.base[0], m[1] + e.base[1]];
4532
+ Math.abs(t[0] - n[0]) < Y && Math.abs(t[1] - n[1]) < Y && (p = `t`, m = m.slice(2));
4528
4533
  }
4529
4534
  }
4530
4535
  }
4531
- if (t.removeUseless && !r && ((p === `l` || p === `h` || p === `v` || p === `q` || p === `t` || p === `c` || p === `s`) && m.every((function(e) {
4536
+ if (t.removeUseless && r(c.command == `m` || c.command == `M`, !0) && ((p === `l` || p === `h` || p === `v` || p === `q` || p === `t` || p === `c` || p === `s`) && m.every((function(e) {
4532
4537
  return e === 0;
4533
4538
  })) || p === `a` && m[5] === 0 && m[6] === 0)) return d[u] = c, !1;
4534
- t.convertToZ && (n || h?.command === `Z` || h?.command === `z`) && (p === `l` || p === `h` || p === `v`) && Math.abs(s[0] - e.coords[0]) < X && Math.abs(s[1] - e.coords[1]) < X && (p = `z`, m = []), e.command = p, e.args = m;
4539
+ t.convertToZ && (n || h?.command === `Z` || h?.command === `z`) && (p === `l` || p === `h` || p === `v`) && Math.abs(s[0] - e.coords[0]) < Y && Math.abs(s[1] - e.coords[1]) < Y && (p = `z`, m = []), e.command = p, e.args = m;
4535
4540
  } else if (o[0] = s[0], o[1] = s[1], c.command === `Z` || c.command === `z`) return !1;
4536
- return (p === `Z` || p === `z`) && t.removeUseless && n && Math.abs(e.base[0] - e.coords[0]) < X / 10 && Math.abs(e.base[1] - e.coords[1]) < X / 10 ? !1 : (l = p === `q` ? [m[0] + e.base[0], m[1] + e.base[1]] : p === `t` ? f ? Wn(f, e.base) : e.coords : void 0, c = e, !0);
4541
+ return (p === `Z` || p === `z`) && t.removeUseless && r(c.command == `m` || c.command == `M`, n) && Math.abs(e.base[0] - e.coords[0]) < Y / 10 && Math.abs(e.base[1] - e.coords[1]) < Y / 10 ? !1 : (l = p === `q` ? [m[0] + e.base[0], m[1] + e.base[1]] : p === `t` ? f ? Kn(f, e.base) : e.coords : void 0, c = e, !0);
4537
4542
  })), e;
4538
4543
  }
4539
- function In(e, t) {
4544
+ function Rn(e, t) {
4540
4545
  let n = e[0];
4541
4546
  return e = e.filter((function(e, r) {
4542
4547
  if (r == 0) return !0;
@@ -4544,13 +4549,13 @@ var l = e(((e) => {
4544
4549
  let i = e.command, a = e.args, o = a.slice(), s = a.slice();
4545
4550
  if (i === `m` || i === `l` || i === `t` || i === `q` || i === `s` || i === `c`) for (let t = o.length; t--;) o[t] += e.base[t % 2];
4546
4551
  else i == `h` ? o[0] += e.base[0] : i == `v` ? o[0] += e.base[1] : i == `a` && (o[5] += e.base[0], o[6] += e.base[1]);
4547
- J(o), J(s);
4548
- let c = L(o, t), l = L(s, t);
4552
+ q(o), q(s);
4553
+ let c = I(o, t), l = I(s, t);
4549
4554
  return (t.forceAbsolutePath || c.length < l.length && !(t.negativeExtraSpace && i == n.command && n.command.charCodeAt(0) > 96 && c.length == l.length - 1 && (a[0] < 0 || Math.floor(a[0]) === 0 && !Number.isInteger(a[0]) && n.args[n.args.length - 1] % 1))) && (e.command = i.toUpperCase(), e.args = o), n = e, !0;
4550
4555
  })), e;
4551
4556
  }
4552
- function Ln(e) {
4553
- let t = Rn([
4557
+ function zn(e) {
4558
+ let t = Bn([
4554
4559
  0,
4555
4560
  0,
4556
4561
  e[2],
@@ -4562,63 +4567,61 @@ var l = e(((e) => {
4562
4567
  ]);
4563
4568
  return t != null && e[2] < t[0] == t[0] < 0 && e[3] < t[1] == t[1] < 0 && e[4] < t[0] == t[0] < e[0] && e[5] < t[1] == t[1] < e[1];
4564
4569
  }
4565
- function Rn(e) {
4570
+ function Bn(e) {
4566
4571
  let t = e[1] - e[3], n = e[2] - e[0], r = e[0] * e[3] - e[2] * e[1], i = e[5] - e[7], a = e[6] - e[4], o = e[4] * e[7] - e[5] * e[6], s = t * a - i * n;
4567
4572
  if (!s) return;
4568
4573
  let c = [(n * o - a * r) / s, (t * o - i * r) / -s];
4569
4574
  if (!isNaN(c[0]) && !isNaN(c[1]) && isFinite(c[0]) && isFinite(c[1])) return c;
4570
4575
  }
4571
- function zn(e) {
4572
- let t = Y || 0;
4576
+ function Vn(e) {
4577
+ let t = J || 0;
4573
4578
  for (let n = e.length; n-- > 0;) {
4574
- let r = z(e[n], t);
4579
+ let r = R(e[n], t);
4575
4580
  if (r !== e[n]) {
4576
- let i = z(e[n], t - 1);
4577
- e[n] = z(Math.abs(i - e[n]), t + 1) >= X ? r : i;
4581
+ let i = R(e[n], t - 1);
4582
+ e[n] = R(Math.abs(i - e[n]), t + 1) >= Y ? r : i;
4578
4583
  }
4579
4584
  }
4580
4585
  return e;
4581
4586
  }
4582
- function Bn(e) {
4587
+ function Hn(e) {
4583
4588
  for (let t = e.length; t-- > 0;) e[t] = Math.round(e[t]);
4584
4589
  return e;
4585
4590
  }
4586
- function Vn(e) {
4591
+ function Un(e) {
4587
4592
  let t = e.length - 2, n = -e[t + 1], r = e[t], i = 1 / (n * n + r * r);
4588
4593
  if (t <= 1 || !isFinite(i)) return !1;
4589
- for (; (t -= 2) >= 0;) if (Math.sqrt((n * e[t] + r * e[t + 1]) ** 2 * i) > X) return !1;
4594
+ for (; (t -= 2) >= 0;) if (Math.sqrt((n * e[t] + r * e[t + 1]) ** 2 * i) > Y) return !1;
4590
4595
  return !0;
4591
4596
  }
4592
- function Hn(e) {
4597
+ function Wn(e) {
4593
4598
  if (e[3] === 1) return;
4594
4599
  let [t, n] = e;
4595
- if (Math.abs(t - n) > X) return;
4600
+ if (Math.abs(t - n) > Y) return;
4596
4601
  let r = Math.hypot(e[5], e[6]);
4597
4602
  if (!(r > t * 2)) return t - Math.sqrt(t ** 2 - .25 * r ** 2);
4598
4603
  }
4599
- function Z(e, t) {
4604
+ function X(e, t) {
4600
4605
  switch (e.command) {
4601
4606
  case `s`:
4602
4607
  e.command = `c`;
4603
4608
  break;
4604
- case `t`:
4605
- e.command = `q`;
4606
- break;
4609
+ case `t`: e.command = `q`;
4607
4610
  }
4608
4611
  return e.args.unshift(t[t.length - 2] - t[t.length - 4], t[t.length - 1] - t[t.length - 3]), e;
4609
4612
  }
4610
- function Un(e, t) {
4613
+ function Gn(e, t) {
4611
4614
  return Math.hypot(e[0] - t[0], e[1] - t[1]);
4612
4615
  }
4613
- function Wn(e, t) {
4616
+ function Kn(e, t) {
4614
4617
  return [2 * t[0] - e[0], 2 * t[1] - e[1]];
4615
4618
  }
4616
- function Gn(e, t) {
4619
+ function qn(e, t) {
4617
4620
  let n = t * t, r = n * t, i = 1 - t, a = i * i;
4618
4621
  return [3 * a * t * e[0] + 3 * i * n * e[2] + r * e[4], 3 * a * t * e[1] + 3 * i * n * e[3] + r * e[5]];
4619
4622
  }
4620
- function Kn(e) {
4621
- let t = Gn(e, .5), n = [t[0] / 2, t[1] / 2], r = [(t[0] + e[4]) / 2, (t[1] + e[5]) / 2], i = Rn([
4623
+ function Jn(e) {
4624
+ let t = qn(e, .5), n = [t[0] / 2, t[1] / 2], r = [(t[0] + e[4]) / 2, (t[1] + e[5]) / 2], i = Bn([
4622
4625
  n[0],
4623
4626
  n[1],
4624
4627
  n[0] + n[1],
@@ -4627,16 +4630,16 @@ var l = e(((e) => {
4627
4630
  r[1],
4628
4631
  r[0] + (r[1] - t[1]),
4629
4632
  r[1] - (r[0] - t[0])
4630
- ]), a = i && Un([0, 0], i), o = Math.min(jn * X, Mn * a / 100);
4633
+ ]), a = i && Gn([0, 0], i), o = Math.min(Nn * Y, Pn * a / 100);
4631
4634
  if (i && a < 0x38d7ea4c68000 && [1 / 4, 3 / 4].every((function(t) {
4632
- return Math.abs(Un(Gn(e, t), i) - a) <= o;
4635
+ return Math.abs(Gn(qn(e, t), i) - a) <= o;
4633
4636
  }))) return {
4634
4637
  center: i,
4635
4638
  radius: a
4636
4639
  };
4637
4640
  }
4638
- function qn(e, t) {
4639
- let n = Math.min(jn * X, Mn * t.radius / 100);
4641
+ function Yn(e, t) {
4642
+ let n = Math.min(Nn * Y, Pn * t.radius / 100);
4640
4643
  return [
4641
4644
  0,
4642
4645
  1 / 4,
@@ -4644,32 +4647,32 @@ var l = e(((e) => {
4644
4647
  3 / 4,
4645
4648
  1
4646
4649
  ].every((function(r) {
4647
- return Math.abs(Un(Gn(e, r), t.center) - t.radius) <= n;
4650
+ return Math.abs(Gn(qn(e, r), t.center) - t.radius) <= n;
4648
4651
  }));
4649
4652
  }
4650
- function Jn(e, t) {
4651
- return qn(e, {
4653
+ function Xn(e, t) {
4654
+ return Yn(e, {
4652
4655
  center: [t.center[0] + e[4], t.center[1] + e[5]],
4653
4656
  radius: t.radius
4654
4657
  });
4655
4658
  }
4656
- function Yn(e, t) {
4659
+ function Zn(e, t) {
4657
4660
  let n = -t.center[0], r = -t.center[1], i = e[4] - t.center[0], a = e[5] - t.center[1];
4658
4661
  return Math.acos((n * i + r * a) / Math.sqrt((n * n + r * r) * (i * i + a * a)));
4659
4662
  }
4660
- function Xn(e, t) {
4663
+ function Qn(e, t) {
4661
4664
  return t.reduce((function(t, n) {
4662
4665
  let r = ``;
4663
- return n.args && (r = L(J(n.args.slice()), e)), t + n.command + r;
4666
+ return n.args && (r = I(q(n.args.slice()), e)), t + n.command + r;
4664
4667
  }), ``);
4665
4668
  }
4666
- var Zn = Object.freeze({
4669
+ var $n = Object.freeze({
4667
4670
  __proto__: null,
4668
4671
  description: `optimizes path data: writes in shorter form, applies transformations`,
4669
- fn: Nn,
4672
+ fn: Fn,
4670
4673
  name: `convertPathData`
4671
4674
  });
4672
- let Qn = (e, t) => {
4675
+ let er = (e, t) => {
4673
4676
  let { convertToShorts: n = !0, degPrecision: r, floatPrecision: i = 3, transformPrecision: a = 5, matrixToTransform: o = !0, shortTranslate: s = !0, shortScale: c = !0, shortRotate: l = !0, removeUseless: u = !0, collapseIntoOne: d = !0, leadingZero: f = !0, negativeExtraSpace: p = !1 } = t, m = {
4674
4677
  convertToShorts: n,
4675
4678
  degPrecision: r,
@@ -4685,27 +4688,27 @@ var l = e(((e) => {
4685
4688
  negativeExtraSpace: p
4686
4689
  };
4687
4690
  return { element: { enter: (e) => {
4688
- e.attributes.transform != null && $n(e, `transform`, m), e.attributes.gradientTransform != null && $n(e, `gradientTransform`, m), e.attributes.patternTransform != null && $n(e, `patternTransform`, m);
4691
+ e.attributes.transform != null && tr(e, `transform`, m), e.attributes.gradientTransform != null && tr(e, `gradientTransform`, m), e.attributes.patternTransform != null && tr(e, `patternTransform`, m);
4689
4692
  } } };
4690
- }, $n = (e, t, n) => {
4691
- let r = cn(e.attributes[t]);
4692
- n = er(r, n), n.collapseIntoOne && r.length > 1 && (r = [ln(r)]), n.convertToShorts ? r = nr(r, n) : r.forEach(((e) => xn(e, n))), n.removeUseless && (r = rr(r)), r.length ? e.attributes[t] = Dn(r, n) : delete e.attributes[t];
4693
- }, er = (e, { ...t }) => {
4693
+ }, tr = (e, t, n) => {
4694
+ let r = un(e.attributes[t]);
4695
+ n = nr(r, n), n.collapseIntoOne && r.length > 1 && (r = [dn(r)]), n.convertToShorts ? r = ir(r, n) : r.forEach(((e) => Cn(e, n))), n.removeUseless && (r = ar(r)), r.length ? e.attributes[t] = kn(r, n) : delete e.attributes[t];
4696
+ }, nr = (e, { ...t }) => {
4694
4697
  let n = [];
4695
4698
  for (let t of e) t.name == `matrix` && n.push(...t.data.slice(0, 4));
4696
4699
  let r = t.transformPrecision;
4697
- return n.length && (t.transformPrecision = Math.min(t.transformPrecision, Math.max.apply(Math, n.map(tr)) || t.transformPrecision), r = Math.max.apply(Math, n.map(((e) => e.toString().replace(/\D+/g, ``).length)))), t.degPrecision ??= Math.max(0, Math.min(t.floatPrecision, r - 2)), t;
4698
- }, tr = (e) => {
4700
+ return n.length && (t.transformPrecision = Math.min(t.transformPrecision, Math.max.apply(Math, n.map(rr)) || t.transformPrecision), r = Math.max.apply(Math, n.map(((e) => e.toString().replace(/\D+/g, ``).length)))), t.degPrecision ??= Math.max(0, Math.min(t.floatPrecision, r - 2)), t;
4701
+ }, rr = (e) => {
4699
4702
  let t = e.toString();
4700
4703
  return t.slice(t.indexOf(`.`)).length - 1;
4701
- }, nr = (e, t) => {
4704
+ }, ir = (e, t) => {
4702
4705
  for (let n = 0; n < e.length; n++) {
4703
4706
  let r = e[n];
4704
4707
  if (t.matrixToTransform && r.name === `matrix`) {
4705
- let i = _n(r, t);
4706
- Dn(i, t).length <= Dn([r], t).length && e.splice(n, 1, ...i), r = e[n];
4708
+ let i = yn(r, t);
4709
+ kn(i, t).length <= kn([r], t).length && e.splice(n, 1, ...i), r = e[n];
4707
4710
  }
4708
- xn(r, t), t.shortTranslate && r.name === `translate` && r.data.length === 2 && !r.data[1] && r.data.pop(), t.shortScale && r.name === `scale` && r.data.length === 2 && r.data[0] === r.data[1] && r.data.pop(), t.shortRotate && e[n - 2]?.name === `translate` && e[n - 1].name === `rotate` && e[n].name === `translate` && e[n - 2].data[0] === -e[n].data[0] && e[n - 2].data[1] === -e[n].data[1] && (e.splice(n - 2, 3, {
4711
+ Cn(r, t), t.shortTranslate && r.name === `translate` && r.data.length === 2 && !r.data[1] && r.data.pop(), t.shortScale && r.name === `scale` && r.data.length === 2 && r.data[0] === r.data[1] && r.data.pop(), t.shortRotate && e[n - 2]?.name === `translate` && e[n - 1].name === `rotate` && e[n].name === `translate` && e[n - 2].data[0] === -e[n].data[0] && e[n - 2].data[1] === -e[n].data[1] && (e.splice(n - 2, 3, {
4709
4712
  name: `rotate`,
4710
4713
  data: [
4711
4714
  e[n - 1].data[0],
@@ -4715,34 +4718,34 @@ var l = e(((e) => {
4715
4718
  }), n -= 2);
4716
4719
  }
4717
4720
  return e;
4718
- }, rr = (e) => e.filter(((e) => !([
4721
+ }, ar = (e) => e.filter(((e) => !([
4719
4722
  `translate`,
4720
4723
  `rotate`,
4721
4724
  `skewX`,
4722
4725
  `skewY`
4723
4726
  ].indexOf(e.name) > -1 && (e.data.length == 1 || e.name == `rotate`) && !e.data[0] || e.name == `translate` && !e.data[0] && !e.data[1] || e.name == `scale` && e.data[0] == 1 && (e.data.length < 2 || e.data[1] == 1) || e.name == `matrix` && e.data[0] == 1 && e.data[3] == 1 && !(e.data[1] || e.data[2] || e.data[4] || e.data[5]))));
4724
- var ir = Object.freeze({
4727
+ var or = Object.freeze({
4725
4728
  __proto__: null,
4726
4729
  description: `collapses multiple transformations and optimizes it`,
4727
- fn: Qn,
4730
+ fn: er,
4728
4731
  name: `convertTransform`
4729
- }), ar = Object.freeze({
4732
+ }), sr = Object.freeze({
4730
4733
  __proto__: null,
4731
4734
  description: `removes empty attributes`,
4732
4735
  fn: () => ({ element: { enter: (e) => {
4733
- for (let [t, n] of Object.entries(e.attributes)) n !== `` || M.conditionalProcessing.has(t) || delete e.attributes[t];
4736
+ for (let [t, n] of Object.entries(e.attributes)) n !== `` || j.conditionalProcessing.has(t) || delete e.attributes[t];
4734
4737
  } } }),
4735
4738
  name: `removeEmptyAttrs`
4736
- }), or = Object.freeze({
4739
+ }), cr = Object.freeze({
4737
4740
  __proto__: null,
4738
4741
  description: `removes empty container elements`,
4739
4742
  fn: (e) => {
4740
- let t = F(e), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
4743
+ let t = P(e), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
4741
4744
  return {
4742
4745
  element: {
4743
4746
  enter: (e, t) => {
4744
4747
  if (e.name === `use`) for (let [n, i] of Object.entries(e.attributes)) {
4745
- let a = et(n, i);
4748
+ let a = nt(n, i);
4746
4749
  for (let n of a) {
4747
4750
  let i = r.get(n);
4748
4751
  i === void 0 && (i = [], r.set(n, i)), i.push({
@@ -4753,32 +4756,32 @@ var l = e(((e) => {
4753
4756
  }
4754
4757
  },
4755
4758
  exit: (e, r) => {
4756
- e.name === `svg` || !j.container.has(e.name) || e.children.length !== 0 || e.name === `pattern` && Object.keys(e.attributes).length !== 0 || e.name === `mask` && e.attributes.id != null || r.type === `element` && r.name === `switch` || e.name === `g` && (e.attributes.filter != null || I(t, e).filter) || (A(e, r), e.attributes.id && n.add(e.attributes.id));
4759
+ e.name === `svg` || !A.container.has(e.name) || e.children.length !== 0 || (e.name !== `pattern` || Object.keys(e.attributes).length === 0) && (e.name !== `mask` || e.attributes.id == null) && (r.type !== `element` || r.name !== `switch`) && (e.name === `g` && (e.attributes.filter != null || F(t, e).filter) || (k(e, r), e.attributes.id && n.add(e.attributes.id)));
4757
4760
  }
4758
4761
  },
4759
4762
  root: { exit: () => {
4760
4763
  for (let e of n) {
4761
4764
  let t = r.get(e);
4762
- if (t) for (let e of t) A(e.node, e.parent);
4765
+ if (t) for (let e of t) k(e.node, e.parent);
4763
4766
  }
4764
4767
  } }
4765
4768
  };
4766
4769
  },
4767
4770
  name: `removeEmptyContainers`
4768
4771
  });
4769
- function sr(e, t) {
4772
+ function lr(e, t) {
4770
4773
  let n = e[t];
4771
- return n?.type === `static` ? $e(n.value) : !1;
4774
+ return n?.type === `static` && et(n.value);
4772
4775
  }
4773
- var cr = Object.freeze({
4776
+ var ur = Object.freeze({
4774
4777
  __proto__: null,
4775
4778
  description: `merges multiple paths in one if possible`,
4776
4779
  fn: (e, t) => {
4777
- let { force: n = !1, floatPrecision: r = 3, noSpaceAfterFlags: i = !1 } = t, a = F(e);
4780
+ let { force: n = !1, floatPrecision: r = 3, noSpaceAfterFlags: i = !1 } = t, a = P(e);
4778
4781
  return { element: { enter: (e) => {
4779
4782
  if (e.children.length <= 1) return;
4780
- let t = [], o = e.children[0], s = null, c = (e, t) => {
4781
- Yt(e, t, {
4783
+ let t = /* @__PURE__ */ new Set(), o = e.children[0], s = null, c = (e, t) => {
4784
+ Zt(e, t, {
4782
4785
  floatPrecision: r,
4783
4786
  noSpaceAfterFlags: i
4784
4787
  }), s = null;
@@ -4793,12 +4796,12 @@ var l = e(((e) => {
4793
4796
  s && c(o, s), o = i;
4794
4797
  continue;
4795
4798
  }
4796
- let l = I(a, i);
4799
+ let l = F(a, i);
4797
4800
  if (l[`marker-start`] || l[`marker-mid`] || l[`marker-end`] || l[`clip-path`] || l.mask || l[`mask-image`] || [
4798
4801
  `fill`,
4799
4802
  `filter`,
4800
4803
  `stroke`
4801
- ].some(((e) => sr(l, e)))) {
4804
+ ].some(((e) => lr(l, e)))) {
4802
4805
  s && c(o, s), o = i;
4803
4806
  continue;
4804
4807
  }
@@ -4811,18 +4814,18 @@ var l = e(((e) => {
4811
4814
  s && c(o, s), o = i;
4812
4815
  continue;
4813
4816
  }
4814
- let d = s != null, f = qt(i);
4815
- if (s ??= qt(o), n || !Xt(s, f)) {
4816
- s.push(...f), t.push(i);
4817
+ let d = s != null, f = Yt(i);
4818
+ if (s ??= Yt(o), n || !Qt(s, f)) {
4819
+ s.push(...f), t.add(i);
4817
4820
  continue;
4818
4821
  }
4819
4822
  d && c(o, s), o = i, s = null;
4820
4823
  }
4821
- s && o.type === `element` && c(o, s), e.children = e.children.filter(((e) => !t.includes(e)));
4824
+ s && o.type === `element` && c(o, s), e.children = e.children.filter(((e) => !t.has(e)));
4822
4825
  } } };
4823
4826
  },
4824
4827
  name: `mergePaths`
4825
- }), lr = Object.freeze({
4828
+ }), dr = Object.freeze({
4826
4829
  __proto__: null,
4827
4830
  description: `removes unused namespaces declaration`,
4828
4831
  fn: () => {
@@ -4852,7 +4855,7 @@ var l = e(((e) => {
4852
4855
  } };
4853
4856
  },
4854
4857
  name: `removeUnusedNS`
4855
- }), ur = Object.freeze({
4858
+ }), fr = Object.freeze({
4856
4859
  __proto__: null,
4857
4860
  description: `Sort element attributes for better compression`,
4858
4861
  fn: (e, t) => {
@@ -4901,7 +4904,7 @@ var l = e(((e) => {
4901
4904
  } } };
4902
4905
  },
4903
4906
  name: `sortAttrs`
4904
- }), dr = Object.freeze({
4907
+ }), pr = Object.freeze({
4905
4908
  __proto__: null,
4906
4909
  description: `Sorts children of <defs> to improve compression`,
4907
4910
  fn: () => ({ element: { enter: (e) => {
@@ -4925,58 +4928,58 @@ var l = e(((e) => {
4925
4928
  } } }),
4926
4929
  name: `sortDefsChildren`
4927
4930
  });
4928
- let fr = /^(Created with|Created using)/;
4929
- var pr = Object.freeze({
4931
+ let mr = /^(Created with|Created using)/;
4932
+ var hr = Object.freeze({
4930
4933
  __proto__: null,
4931
4934
  description: `removes <desc>`,
4932
4935
  fn: (e, t) => {
4933
4936
  let { removeAny: n = !1 } = t;
4934
4937
  return { element: { enter: (e, t) => {
4935
- e.name === `desc` && (n || e.children.length === 0 || e.children[0].type === `text` && fr.test(e.children[0].value)) && A(e, t);
4938
+ e.name === `desc` && (n || e.children.length === 0 || e.children[0].type === `text` && mr.test(e.children[0].value)) && k(e, t);
4936
4939
  } } };
4937
4940
  },
4938
4941
  name: `removeDesc`
4939
4942
  });
4940
- let mr = T({
4943
+ let gr = ee({
4941
4944
  name: `preset-default`,
4942
4945
  plugins: [
4943
- de,
4944
4946
  fe,
4945
- me,
4946
- Le,
4947
+ pe,
4948
+ he,
4947
4949
  Re,
4948
4950
  ze,
4949
- Ue,
4951
+ Be,
4950
4952
  We,
4951
- Ke,
4952
- tt,
4953
- st,
4954
- ut,
4955
- pt,
4956
- _t,
4957
- xt,
4958
- St,
4953
+ Ge,
4954
+ qe,
4955
+ rt,
4956
+ lt,
4957
+ ft,
4958
+ ht,
4959
+ yt,
4959
4960
  Ct,
4960
- Dt,
4961
- Lt,
4962
- Rt,
4961
+ wt,
4962
+ Tt,
4963
+ kt,
4964
+ zt,
4963
4965
  Bt,
4964
- Vt,
4965
4966
  Ht,
4967
+ Ut,
4966
4968
  Wt,
4967
4969
  Kt,
4968
- Zn,
4969
- ir,
4970
- ar,
4970
+ Jt,
4971
+ $n,
4971
4972
  or,
4973
+ sr,
4972
4974
  cr,
4973
- lr,
4974
4975
  ur,
4975
4976
  dr,
4976
- pr
4977
+ fr,
4978
+ pr,
4979
+ hr
4977
4980
  ]
4978
4981
  });
4979
- var hr = Object.freeze({
4982
+ var _r = Object.freeze({
4980
4983
  __proto__: null,
4981
4984
  description: `adds attributes to an outer <svg> element`,
4982
4985
  fn: (e, t) => {
@@ -5026,7 +5029,7 @@ plugins: [
5026
5029
  } } };
5027
5030
  },
5028
5031
  name: `addAttributesToSVGElement`
5029
- }), gr = Object.freeze({
5032
+ }), vr = Object.freeze({
5030
5033
  __proto__: null,
5031
5034
  description: `adds classnames to an outer <svg> element`,
5032
5035
  fn: (e, t, n) => {
@@ -5066,7 +5069,7 @@ plugins: [
5066
5069
  },
5067
5070
  name: `addClassesToSVGElement`
5068
5071
  });
5069
- let _r = /^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/, vr = /\s+,?\s*|,\s*/, yr = {
5072
+ let yr = /^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/, br = /\s+,?\s*|,\s*/, xr = {
5070
5073
  cm: 96 / 2.54,
5071
5074
  mm: 96 / 25.4,
5072
5075
  in: 96,
@@ -5074,22 +5077,22 @@ plugins: [
5074
5077
  pc: 16,
5075
5078
  px: 1
5076
5079
  };
5077
- var br = Object.freeze({
5080
+ var Sr = Object.freeze({
5078
5081
  __proto__: null,
5079
5082
  description: `rounds list of values to the fixed precision`,
5080
5083
  fn: (e, t) => {
5081
5084
  let { floatPrecision: n = 3, leadingZero: r = !0, defaultPx: i = !0, convertToPx: a = !0 } = t, o = (e) => {
5082
5085
  let t = [];
5083
- for (let o of e.split(vr)) {
5084
- let e = o.match(_r), s = o.match(/new/);
5086
+ for (let o of e.split(br)) {
5087
+ let e = o.match(yr), s = o.match(/new/);
5085
5088
  if (e) {
5086
5089
  let o = Number(Number(e[1]).toFixed(n)), s = e[3] || ``;
5087
- if (a && s && s in yr) {
5088
- let t = Number((yr[s] * Number(e[1])).toFixed(n));
5090
+ if (a && s && s in xr) {
5091
+ let t = Number((xr[s] * Number(e[1])).toFixed(n));
5089
5092
  t.toString().length < e[0].length && (o = t, s = `px`);
5090
5093
  }
5091
5094
  let c;
5092
- c = r ? R(o) : o.toString(), i && s === `px` && (s = ``), t.push(c + s);
5095
+ c = r ? L(o) : o.toString(), i && s === `px` && (s = ``), t.push(c + s);
5093
5096
  } else s ? t.push(`new`) : o && t.push(o);
5094
5097
  }
5095
5098
  return t.join(` `);
@@ -5099,11 +5102,11 @@ plugins: [
5099
5102
  } } };
5100
5103
  },
5101
5104
  name: `cleanupListOfValues`
5102
- }), xr = Object.freeze({
5105
+ }), Cr = Object.freeze({
5103
5106
  __proto__: null,
5104
5107
  description: `converts one-stop (single color) gradients to a plain color`,
5105
5108
  fn: (e) => {
5106
- let t = F(e), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = 0;
5109
+ let t = P(e), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = 0;
5107
5110
  return { element: {
5108
5111
  enter: (o, s) => {
5109
5112
  if (o.attributes[`xlink:href`] != null && a++, o.name === `defs`) {
@@ -5111,7 +5114,7 @@ plugins: [
5111
5114
  return;
5112
5115
  }
5113
5116
  if (o.name !== `linearGradient` && o.name !== `radialGradient`) return;
5114
- let c = o.children.filter(((e) => e.type === `element` && e.name === `stop`)), l = o.attributes[`xlink:href`] || o.attributes.href, u = c.length === 0 && l != null && l.startsWith(`#`) ? le(e, l) : o;
5117
+ let c = o.children.filter(((e) => e.type === `element` && e.name === `stop`)), l = o.attributes[`xlink:href`] || o.attributes.href, u = c.length === 0 && l != null && l.startsWith(`#`) ? ue(e, l) : o;
5115
5118
  if (u == null || u.type !== `element`) {
5116
5119
  i.set(o, s);
5117
5120
  return;
@@ -5119,39 +5122,39 @@ plugins: [
5119
5122
  let d = u.children.filter(((e) => e.type === `element` && e.name === `stop`));
5120
5123
  if (d.length !== 1 || d[0].type !== `element`) return;
5121
5124
  s.type === `element` && s.name === `defs` && n.add(s), i.set(o, s);
5122
- let f, p = I(t, d[0])[`stop-color`];
5125
+ let f, p = F(t, d[0])[`stop-color`];
5123
5126
  p != null && p.type === `static` && (f = p.value);
5124
- let m = `url(#${o.attributes.id})`, h = k(e, [...we].map(((e) => `[${e}="${m}"]`)).join(`,`));
5125
- for (let e of h) if (e.type === `element`) for (let t of we) e.attributes[t] === m && (f == null ? delete e.attributes[t] : e.attributes[t] = f);
5126
- let g = k(e, `[style*=${m}]`);
5127
- for (let e of g) e.type === `element` && (e.attributes.style = e.attributes.style.replace(m, f || _e.presentation[`stop-color`]));
5127
+ let m = `url(#${o.attributes.id})`, h = [...Te].map(((e) => `[${e}="${m}"]`)).join(`,`), g = O(e, h);
5128
+ for (let e of g) if (e.type === `element`) for (let t of Te) e.attributes[t] === m && (f == null ? delete e.attributes[t] : e.attributes[t] = f);
5129
+ let _ = O(e, `[style*=${m}]`);
5130
+ for (let e of _) e.type === `element` && (e.attributes.style = e.attributes.style.replace(m, f || ve.presentation[`stop-color`]));
5128
5131
  },
5129
5132
  exit: (e) => {
5130
5133
  if (e.name === `svg`) {
5131
- for (let [e, t] of i.entries()) e.attributes[`xlink:href`] != null && a--, A(e, t);
5134
+ for (let [e, t] of i.entries()) e.attributes[`xlink:href`] != null && a--, k(e, t);
5132
5135
  a === 0 && delete e.attributes[`xmlns:xlink`];
5133
- for (let [e, t] of r.entries()) n.has(e) && e.children.length === 0 && A(e, t);
5136
+ for (let [e, t] of r.entries()) n.has(e) && e.children.length === 0 && k(e, t);
5134
5137
  }
5135
5138
  }
5136
5139
  } };
5137
5140
  },
5138
5141
  name: `convertOneStopGradients`
5139
5142
  });
5140
- let Sr = (...e) => `(?:` + e.join(`|`) + `)`, Cr = M.presentation, wr = `\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.)`, Tr = `\\s*(` + Sr(`[^:;\\\\]`, wr) + `*?)\\s*`, Er = `'(?:[^'\\n\\r\\\\]|\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.))*?(?:'|$)`, Dr = `"(?:[^"\\n\\r\\\\]|\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.))*?(?:"|$)`, Or = RegExp(`^` + Sr(Er, Dr) + `$`), kr = `\\s*(` + Sr(`[^!'"();\\\\]+?`, wr, Er, Dr, `\\(` + Sr(`[^'"()\\\\]+`, wr, Er, Dr) + `*?\\)`, `[^;]*?`) + `*?)`, Ar = RegExp(Tr + `:` + kr + `(\\s*!important(?![-(\\w]))?\\s*(?:;\\s*|$)`, `ig`), jr = new RegExp(Sr(wr, Er, Dr, `/\\*[^]*?\\*/`), `ig`);
5141
- var Mr = Object.freeze({
5143
+ let wr = (...e) => `(?:` + e.join(`|`) + `)`, Tr = j.presentation, Er = `\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.)`, Dr = `\\s*(` + wr(`[^:;\\\\]`, Er) + `*?)\\s*`, Or = `'(?:[^'\\n\\r\\\\]|\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.))*?(?:'|$)`, kr = `"(?:[^"\\n\\r\\\\]|\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.))*?(?:"|$)`, Ar = RegExp(`^` + wr(Or, kr) + `$`), jr = `\\s*(` + wr(`[^!'"();\\\\]+?`, Er, Or, kr, `\\(` + wr(`[^'"()\\\\]+`, Er, Or, kr) + `*?\\)`, `[^;]*?`) + `*?)`, Mr = RegExp(Dr + `:` + jr + `(\\s*!important(?![-(\\w]))?\\s*(?:;\\s*|$)`, `ig`), Nr = new RegExp(wr(Er, Or, kr, `/\\*[^]*?\\*/`), `ig`);
5144
+ var Pr = Object.freeze({
5142
5145
  __proto__: null,
5143
5146
  description: `converts style to attributes`,
5144
5147
  fn: (e, t) => {
5145
5148
  let { keepImportant: n = !1 } = t;
5146
5149
  return { element: { enter: (e) => {
5147
5150
  if (e.attributes.style != null) {
5148
- let r = [], i = {}, a = e.attributes.style.replace(jr, ((e) => e[0] == `/` ? `` : e[0] == `\\` && /[-g-z]/i.test(e[1]) ? e[1] : e));
5149
- Ar.lastIndex = 0;
5150
- for (var t; t = Ar.exec(a);) n && t[3] || r.push([t[1], t[2]]);
5151
+ let r = [], i = {}, a = e.attributes.style.replace(Nr, ((e) => e[0] == `/` ? `` : e[0] == `\\` && /[-g-z]/i.test(e[1]) ? e[1] : e));
5152
+ Mr.lastIndex = 0;
5153
+ for (var t; t = Mr.exec(a);) n && t[3] || r.push([t[1], t[2]]);
5151
5154
  r.length && (r = r.filter((function(e) {
5152
5155
  if (e[0]) {
5153
5156
  let t = e[0].toLowerCase(), n = e[1];
5154
- if (Or.test(n) && (n = n.slice(1, -1)), Cr.has(t)) return i[t] = n, !1;
5157
+ if (Ar.test(n) && (n = n.slice(1, -1)), Tr.has(t)) return i[t] = n, !1;
5155
5158
  }
5156
5159
  return !0;
5157
5160
  })), Object.assign(e.attributes, i), r.length ? e.attributes.style = r.map(((e) => e.join(`:`))).join(`;`) : delete e.attributes.style);
@@ -5160,26 +5163,26 @@ plugins: [
5160
5163
  },
5161
5164
  name: `convertStyleToAttrs`
5162
5165
  });
5163
- let Nr = (e) => {
5166
+ let Fr = (e) => {
5164
5167
  let t = /[/\\]?([^/\\]+)$/.exec(e);
5165
5168
  return t ? t[1] : ``;
5166
- }, Pr = (e) => e.replace(/[. ]/g, `_`), Fr = (e) => e.startsWith(`"`) && e.endsWith(`"`) || e.startsWith(`'`) && e.endsWith(`'`) ? e.slice(1, -1) : e, Ir = (e, t) => {
5169
+ }, Ir = (e) => e.replace(/[. ]/g, `_`), Lr = (e) => e.startsWith(`"`) && e.endsWith(`"`) || e.startsWith(`'`) && e.endsWith(`'`) ? e.slice(1, -1) : e, Rr = (e, t) => {
5167
5170
  let n = e(t);
5168
5171
  return t.startsWith(n) ? t : n + t;
5169
- }, Lr = (e, t) => t.startsWith(`#`) ? `#` + Ir(e, t.slice(1)) : null, Rr = (e, t, n, r, i, a) => {
5172
+ }, zr = (e, t) => t.startsWith(`#`) ? `#` + Rr(e, t.slice(1)) : null, Br = (e, t, n, r, i, a) => {
5170
5173
  if (typeof r == `function`) {
5171
5174
  let o = a.get(e);
5172
5175
  return o ?? (o = r(t, n) + i, a.set(e, o), o);
5173
5176
  }
5174
- return typeof r == `string` ? r + i : r === !1 ? `` : n.path != null && n.path.length > 0 ? Pr(Nr(n.path)) + i : `prefix` + i;
5177
+ return typeof r == `string` ? r + i : r === !1 ? `` : n.path != null && n.path.length > 0 ? Ir(Fr(n.path)) + i : `prefix` + i;
5175
5178
  };
5176
- var zr = Object.freeze({
5179
+ var Vr = Object.freeze({
5177
5180
  __proto__: null,
5178
5181
  description: `prefix IDs`,
5179
5182
  fn: (e, t, n) => {
5180
5183
  let { delim: r = `__`, prefix: i, prefixIds: a = !0, prefixClassNames: o = !0 } = t, s = /* @__PURE__ */ new Map();
5181
5184
  return { element: { enter: (e) => {
5182
- let t = (t) => Rr(t, e, n, i, r, s);
5185
+ let t = (t) => Br(t, e, n, i, r, s);
5183
5186
  if (e.name === `style`) {
5184
5187
  if (e.children.length === 0) return;
5185
5188
  for (let n of e.children) {
@@ -5195,30 +5198,30 @@ plugins: [
5195
5198
  }
5196
5199
  b.walk(r, ((e) => {
5197
5200
  if (a && e.type === `IdSelector` || o && e.type === `ClassSelector`) {
5198
- e.name = Ir(t, e.name);
5201
+ e.name = Rr(t, e.name);
5199
5202
  return;
5200
5203
  }
5201
5204
  if (e.type === `Url` && e.value.length > 0) {
5202
- let n = Lr(t, Fr(e.value));
5205
+ let n = zr(t, Lr(e.value));
5203
5206
  n != null && (e.value = n);
5204
5207
  }
5205
5208
  })), n.value = b.generate(r);
5206
5209
  }
5207
5210
  }
5208
- a && e.attributes.id != null && e.attributes.id.length !== 0 && (e.attributes.id = Ir(t, e.attributes.id)), o && e.attributes.class != null && e.attributes.class.length !== 0 && (e.attributes.class = e.attributes.class.split(/\s+/).map(((e) => Ir(t, e))).join(` `));
5211
+ a && e.attributes.id != null && e.attributes.id.length !== 0 && (e.attributes.id = Rr(t, e.attributes.id)), o && e.attributes.class != null && e.attributes.class.length !== 0 && (e.attributes.class = e.attributes.class.split(/\s+/).map(((e) => Rr(t, e))).join(` `));
5209
5212
  for (let n of [`href`, `xlink:href`]) if (e.attributes[n] != null && e.attributes[n].length !== 0) {
5210
- let r = Lr(t, e.attributes[n]);
5213
+ let r = zr(t, e.attributes[n]);
5211
5214
  r != null && (e.attributes[n] = r);
5212
5215
  }
5213
- for (let n of N) e.attributes[n] != null && e.attributes[n].length !== 0 && (e.attributes[n] = e.attributes[n].replace(/\burl\((["'])?(#.+?)\1\)/gi, ((e, n, r) => {
5214
- let i = Lr(t, r);
5216
+ for (let n of M) e.attributes[n] != null && e.attributes[n].length !== 0 && (e.attributes[n] = e.attributes[n].replace(/\burl\((["'])?(#.+?)\1\)/gi, ((e, n, r) => {
5217
+ let i = zr(t, r);
5215
5218
  return i == null ? e : `url(${i})`;
5216
5219
  })));
5217
5220
  for (let n of [`begin`, `end`]) if (e.attributes[n] != null && e.attributes[n].length !== 0) {
5218
5221
  let r = e.attributes[n].split(/\s*;\s+/).map(((e) => {
5219
5222
  if (e.endsWith(`.end`) || e.endsWith(`.start`)) {
5220
5223
  let [n, r] = e.split(`.`);
5221
- return `${Ir(t, n)}.${r}`;
5224
+ return `${Rr(t, n)}.${r}`;
5222
5225
  }
5223
5226
  return e;
5224
5227
  }));
@@ -5227,20 +5230,23 @@ plugins: [
5227
5230
  } } };
5228
5231
  },
5229
5232
  name: `prefixIds`
5230
- }), Br = Object.freeze({
5233
+ }), Hr = Object.freeze({
5231
5234
  __proto__: null,
5232
5235
  description: `removes attributes of elements that match a css selector`,
5233
5236
  fn: (e, t) => {
5237
+ if (!Array.isArray(t.selectors) && (!t.selector || !t.attributes)) return console.warn(`Warning: The plugin "removeAttributesBySelector" is missing parameters.
5238
+ It should have a list of "selectors", or one "selector" and one "attributes".
5239
+ Without either, the plugin is a noop.`), null;
5234
5240
  let n = Array.isArray(t.selectors) ? t.selectors : [t];
5235
5241
  for (let { selector: t, attributes: r } of n) {
5236
- let n = k(e, t);
5242
+ let n = O(e, t);
5237
5243
  for (let e of n) if (e.type === `element`) if (Array.isArray(r)) for (let t of r) delete e.attributes[t];
5238
5244
  else delete e.attributes[r];
5239
5245
  }
5240
5246
  return {};
5241
5247
  },
5242
5248
  name: `removeAttributesBySelector`
5243
- }), Vr = Object.freeze({
5249
+ }), Ur = Object.freeze({
5244
5250
  __proto__: null,
5245
5251
  description: `removes specified attributes`,
5246
5252
  fn: (e, t) => {
@@ -5278,7 +5284,7 @@ plugins: [
5278
5284
  } } };
5279
5285
  },
5280
5286
  name: `removeAttrs`
5281
- }), Hr = Object.freeze({
5287
+ }), Wr = Object.freeze({
5282
5288
  __proto__: null,
5283
5289
  description: `removes width and height in presence of viewBox (opposite to removeViewBox)`,
5284
5290
  fn: () => ({ element: { enter: (e) => {
@@ -5291,23 +5297,23 @@ plugins: [
5291
5297
  }
5292
5298
  } } }),
5293
5299
  name: `removeDimensions`
5294
- }), Ur = Object.freeze({
5300
+ }), Gr = Object.freeze({
5295
5301
  __proto__: null,
5296
5302
  description: `removes arbitrary elements by ID or className`,
5297
5303
  fn: (e, t) => {
5298
5304
  let n = t.id == null ? [] : Array.isArray(t.id) ? t.id : [t.id], r = t.class == null ? [] : Array.isArray(t.class) ? t.class : [t.class];
5299
5305
  return { element: { enter: (e, t) => {
5300
- if (e.attributes.id != null && n.length !== 0 && n.includes(e.attributes.id) && A(e, t), e.attributes.class && r.length !== 0) {
5306
+ if (e.attributes.id != null && n.length !== 0 && n.includes(e.attributes.id) && k(e, t), e.attributes.class && r.length !== 0) {
5301
5307
  let n = e.attributes.class.split(` `);
5302
5308
  for (let i of r) if (n.includes(i)) {
5303
- A(e, t);
5309
+ k(e, t);
5304
5310
  break;
5305
5311
  }
5306
5312
  }
5307
5313
  } } };
5308
5314
  },
5309
5315
  name: `removeElementsByAttr`
5310
- }), Wr = Object.freeze({
5316
+ }), Kr = Object.freeze({
5311
5317
  __proto__: null,
5312
5318
  description: `removes elements that are drawn outside of the viewBox`,
5313
5319
  fn: () => {
@@ -5330,7 +5336,7 @@ plugins: [
5330
5336
  }
5331
5337
  if (t.attributes.transform != null) return S;
5332
5338
  if (t.name === `path` && t.attributes.d != null && e != null) {
5333
- let r = Nt(t.attributes.d), i = !1;
5339
+ let r = Ft(t.attributes.d), i = !1;
5334
5340
  for (let t of r) if (t.command === `M`) {
5335
5341
  let [n, r] = t.args;
5336
5342
  n >= e.left && n <= e.right && r >= e.top && r <= e.bottom && (i = !0);
@@ -5341,7 +5347,7 @@ plugins: [
5341
5347
  args: []
5342
5348
  });
5343
5349
  let { left: a, top: o, width: s, height: c } = e;
5344
- Xt([
5350
+ Qt([
5345
5351
  {
5346
5352
  command: `M`,
5347
5353
  args: [a, o]
@@ -5362,73 +5368,97 @@ plugins: [
5362
5368
  command: `z`,
5363
5369
  args: []
5364
5370
  }
5365
- ], r) === !1 && A(t, n);
5371
+ ], r) === !1 && k(t, n);
5366
5372
  }
5367
5373
  } } };
5368
5374
  },
5369
5375
  name: `removeOffCanvasPaths`
5370
- }), Gr = Object.freeze({
5376
+ }), qr = Object.freeze({
5371
5377
  __proto__: null,
5372
5378
  description: `removes raster images`,
5373
5379
  fn: () => ({ element: { enter: (e, t) => {
5374
- e.name === `image` && e.attributes[`xlink:href`] != null && /(\.|image\/)(jpe?g|png|gif)/.test(e.attributes[`xlink:href`]) && A(e, t);
5380
+ e.name === `image` && e.attributes[`xlink:href`] != null && /(\.|image\/)(jpe?g|png|gif)/.test(e.attributes[`xlink:href`]) && k(e, t);
5375
5381
  } } }),
5376
5382
  name: `removeRasterImages`
5377
5383
  });
5378
- let Kr = [
5379
- ...M.animationEvent,
5380
- ...M.documentEvent,
5381
- ...M.documentElementEvent,
5382
- ...M.globalEvent,
5383
- ...M.graphicalEvent
5384
- ];
5385
- var qr = Object.freeze({
5384
+ let Jr = [
5385
+ ...j.animationEvent,
5386
+ ...j.documentEvent,
5387
+ ...j.documentElementEvent,
5388
+ ...j.globalEvent,
5389
+ ...j.graphicalEvent
5390
+ ], Yr = [`http://www.w3.org/2000/svg`, `http://www.w3.org/1999/xhtml`];
5391
+ function Xr(e, t, n, r) {
5392
+ if (e === t) return !0;
5393
+ if (e.includes(`:`)) {
5394
+ let [i, a] = e.split(`:`, 2);
5395
+ if (t === a) {
5396
+ let e = n.get(i), t = e[e.length - 1];
5397
+ return r.includes(t);
5398
+ }
5399
+ }
5400
+ return !1;
5401
+ }
5402
+ var Zr = Object.freeze({
5386
5403
  __proto__: null,
5387
5404
  description: `removes scripts`,
5388
- fn: () => ({ element: {
5389
- enter: (e, t) => {
5390
- if (e.name === `script`) {
5391
- A(e, t);
5392
- return;
5393
- }
5394
- for (let t of Kr) e.attributes[t] != null && delete e.attributes[t];
5395
- },
5396
- exit: (e, t) => {
5397
- if (e.name === `a`) {
5398
- for (let n of Object.keys(e.attributes)) if (n === `href` || n.endsWith(`:href`)) {
5399
- if (e.attributes[n] == null || !e.attributes[n].trimStart().startsWith(`javascript:`)) continue;
5400
- let r = t.children.indexOf(e), i = e.children.filter(((e) => e.type !== `text`));
5401
- t.children.splice(r, 1, ...i);
5405
+ fn: () => {
5406
+ let e = /* @__PURE__ */ new Map();
5407
+ return { element: {
5408
+ enter: (t, n) => {
5409
+ for (let [n, r] of Object.entries(t.attributes)) {
5410
+ if (!n.startsWith(`xmlns:`)) continue;
5411
+ let t = n.slice(6);
5412
+ e.has(t) ? e.get(t).push(r) : e.set(t, [r]);
5413
+ }
5414
+ if (Xr(t.name, `script`, e, Yr)) {
5415
+ k(t, n);
5416
+ return;
5417
+ }
5418
+ for (let e of Jr) t.attributes[e] != null && delete t.attributes[e];
5419
+ },
5420
+ exit: (t, n) => {
5421
+ for (let n of Object.keys(t.attributes)) {
5422
+ if (!n.startsWith(`xmlns:`)) continue;
5423
+ let t = n.slice(6);
5424
+ e.get(t).pop();
5425
+ }
5426
+ if (t.name === `a`) {
5427
+ for (let e of Object.keys(t.attributes)) if (e === `href` || e.endsWith(`:href`)) {
5428
+ if (t.attributes[e] == null || !t.attributes[e].trimStart().toLowerCase().startsWith(`javascript:`)) continue;
5429
+ let r = n.children.indexOf(t), i = t.children.filter(((e) => e.type !== `text`));
5430
+ n.children.splice(r, 1, ...i);
5431
+ }
5402
5432
  }
5403
5433
  }
5404
- }
5405
- } }),
5434
+ } };
5435
+ },
5406
5436
  name: `removeScripts`
5407
- }), Jr = Object.freeze({
5437
+ }), Qr = Object.freeze({
5408
5438
  __proto__: null,
5409
5439
  description: `removes <style> element`,
5410
5440
  fn: () => ({ element: { enter: (e, t) => {
5411
- e.name === `style` && A(e, t);
5441
+ e.name === `style` && k(e, t);
5412
5442
  } } }),
5413
5443
  name: `removeStyleElement`
5414
- }), Yr = Object.freeze({
5444
+ }), $r = Object.freeze({
5415
5445
  __proto__: null,
5416
5446
  description: `removes <title>`,
5417
5447
  fn: () => ({ element: { enter: (e, t) => {
5418
- e.name === `title` && A(e, t);
5448
+ e.name === `title` && k(e, t);
5419
5449
  } } }),
5420
5450
  name: `removeTitle`
5421
5451
  });
5422
- let Xr = /* @__PURE__ */ new Set([
5452
+ let ei = /* @__PURE__ */ new Set([
5423
5453
  `pattern`,
5424
5454
  `svg`,
5425
5455
  `symbol`
5426
5456
  ]);
5427
- var Zr = Object.freeze({
5457
+ var ti = Object.freeze({
5428
5458
  __proto__: null,
5429
5459
  description: `removes viewBox attribute when possible`,
5430
5460
  fn: () => ({ element: { enter: (e, t) => {
5431
- if (Xr.has(e.name) && e.attributes.viewBox != null && e.attributes.width != null && e.attributes.height != null) {
5461
+ if (ei.has(e.name) && e.attributes.viewBox != null && e.attributes.width != null && e.attributes.height != null) {
5432
5462
  if (e.name === `svg` && t.type !== `root`) return;
5433
5463
  let n = e.attributes.viewBox.split(/[ ,]+/g);
5434
5464
  n[0] === `0` && n[1] === `0` && e.attributes.width.replace(/px$/, ``) === n[2] && e.attributes.height.replace(/px$/, ``) === n[3] && delete e.attributes.viewBox;
@@ -5436,17 +5466,17 @@ plugins: [
5436
5466
  } } }),
5437
5467
  name: `removeViewBox`
5438
5468
  });
5439
- let Qr = `http://www.w3.org/1999/xlink`, $r = {
5469
+ let ni = `http://www.w3.org/1999/xlink`, ri = {
5440
5470
  new: `_blank`,
5441
5471
  replace: `_self`
5442
- }, ei = /* @__PURE__ */ new Set([
5472
+ }, ii = /* @__PURE__ */ new Set([
5443
5473
  `cursor`,
5444
5474
  `filter`,
5445
5475
  `font-face-uri`,
5446
5476
  `glyphRef`,
5447
5477
  `tref`
5448
- ]), ti = (e, t, n) => t.map(((e) => `${e}:${n}`)).filter(((t) => e.attributes[t] != null));
5449
- var ni = Object.freeze({
5478
+ ]), ai = (e, t, n) => t.map(((e) => `${e}:${n}`)).filter(((t) => e.attributes[t] != null));
5479
+ var oi = Object.freeze({
5450
5480
  __proto__: null,
5451
5481
  description: `remove xlink namespace and replaces attributes with the SVG 2 equivalent where applicable`,
5452
5482
  fn: (e, t) => {
@@ -5455,23 +5485,23 @@ plugins: [
5455
5485
  enter: (e) => {
5456
5486
  for (let [t, n] of Object.entries(e.attributes)) if (t.startsWith(`xmlns:`)) {
5457
5487
  let e = t.split(`:`, 2)[1];
5458
- if (n === Qr) {
5488
+ if (n === ni) {
5459
5489
  r.push(e);
5460
5490
  continue;
5461
5491
  }
5462
5492
  r.includes(e) && i.push(e);
5463
5493
  }
5464
5494
  if (i.some(((e) => r.includes(e)))) return;
5465
- let t = ti(e, r, `show`), o = e.attributes.target != null;
5495
+ let t = ai(e, r, `show`), o = e.attributes.target != null;
5466
5496
  for (let n = t.length - 1; n >= 0; n--) {
5467
- let r = t[n], i = $r[e.attributes[r]];
5468
- if (o || i == null) {
5497
+ let r = t[n], i = e.attributes[r], a = ri[i];
5498
+ if (o || a == null) {
5469
5499
  delete e.attributes[r];
5470
5500
  continue;
5471
5501
  }
5472
- i !== ye[e.name]?.defaults?.target && (e.attributes.target = i), delete e.attributes[r], o = !0;
5502
+ a !== be[e.name]?.defaults?.target && (e.attributes.target = a), delete e.attributes[r], o = !0;
5473
5503
  }
5474
- let s = ti(e, r, `title`);
5504
+ let s = ai(e, r, `title`);
5475
5505
  for (let t = s.length - 1; t >= 0; t--) {
5476
5506
  let n = s[t], r = e.attributes[n];
5477
5507
  if (e.children.filter(((e) => e.type === `element` && e.name === `title`)).length > 0) {
@@ -5492,8 +5522,8 @@ plugins: [
5492
5522
  value: e
5493
5523
  }), e.children.unshift(i), delete e.attributes[n];
5494
5524
  }
5495
- let c = ti(e, r, `href`);
5496
- if (c.length > 0 && ei.has(e.name) && !n) {
5525
+ let c = ai(e, r, `href`);
5526
+ if (c.length > 0 && ii.has(e.name) && !n) {
5497
5527
  c.map(((e) => e.split(`:`, 1)[0])).forEach(((e) => a.push(e)));
5498
5528
  return;
5499
5529
  }
@@ -5514,7 +5544,7 @@ plugins: [
5514
5544
  continue;
5515
5545
  }
5516
5546
  if (t.startsWith(`xmlns:`) && !a.includes(c)) {
5517
- if (o === Qr) {
5547
+ if (o === ni) {
5518
5548
  let n = r.indexOf(c);
5519
5549
  r.splice(n, 1), delete e.attributes[t];
5520
5550
  continue;
@@ -5529,18 +5559,18 @@ plugins: [
5529
5559
  } };
5530
5560
  },
5531
5561
  name: `removeXlink`
5532
- }), ri = Object.freeze({
5562
+ }), si = Object.freeze({
5533
5563
  __proto__: null,
5534
5564
  description: `removes xmlns attribute (for inline svg)`,
5535
5565
  fn: () => ({ element: { enter: (e) => {
5536
5566
  e.name === `svg` && delete e.attributes.xmlns;
5537
5567
  } } }),
5538
5568
  name: `removeXMLNS`
5539
- }), ii = Object.freeze({
5569
+ }), ci = Object.freeze({
5540
5570
  __proto__: null,
5541
5571
  description: `Finds <path> elements with the same d, fill, and stroke, and converts them to <use> elements referencing a single <path> def.`,
5542
5572
  fn: (e) => {
5543
- let t = F(e), n = /* @__PURE__ */ new Map(), r, i = /* @__PURE__ */ new Set();
5573
+ let t = P(e), n = /* @__PURE__ */ new Map(), r, i = /* @__PURE__ */ new Set();
5544
5574
  return { element: {
5545
5575
  enter: (e, t) => {
5546
5576
  if (e.name === `path` && e.attributes.d != null) {
@@ -5579,13 +5609,13 @@ plugins: [
5579
5609
  for (let t of r) {
5580
5610
  if (delete t.attributes.d, delete t.attributes.stroke, delete t.attributes.fill, a.children.includes(t) && t.children.length === 0) {
5581
5611
  if (Object.keys(t.attributes).length === 0) {
5582
- A(t, a);
5612
+ k(t, a);
5583
5613
  continue;
5584
5614
  }
5585
5615
  if (Object.keys(t.attributes).length === 1 && t.attributes.id != null) {
5586
- A(t, a);
5616
+ k(t, a);
5587
5617
  let r = `[xlink\\:href=#${t.attributes.id}], [href=#${t.attributes.id}]`;
5588
- for (let t of k(e, r)) if (t.type === `element`) for (let e of [`href`, `xlink:href`]) t.attributes[e] != null && (t.attributes[e] = `#` + n.attributes.id);
5618
+ for (let t of O(e, r)) if (t.type === `element`) for (let e of [`href`, `xlink:href`]) t.attributes[e] != null && (t.attributes[e] = `#` + n.attributes.id);
5589
5619
  continue;
5590
5620
  }
5591
5621
  }
@@ -5599,63 +5629,63 @@ plugins: [
5599
5629
  },
5600
5630
  name: `reusePaths`
5601
5631
  });
5602
- let ai = Object.freeze([
5603
- mr,
5604
- hr,
5632
+ let li = Object.freeze([
5605
5633
  gr,
5606
- Ue,
5607
- Dt,
5608
- st,
5609
- br,
5610
- pt,
5611
- Kt,
5612
- _t,
5613
- Vt,
5614
- xr,
5615
- Zn,
5616
- Bt,
5617
- Mr,
5618
- ir,
5619
- Ke,
5620
- cr,
5634
+ _r,
5635
+ vr,
5621
5636
  We,
5622
- tt,
5637
+ kt,
5638
+ lt,
5639
+ Sr,
5640
+ ht,
5641
+ Jt,
5642
+ yt,
5643
+ Ut,
5644
+ Cr,
5645
+ $n,
5623
5646
  Ht,
5647
+ Pr,
5648
+ or,
5649
+ qe,
5650
+ ur,
5651
+ Ge,
5652
+ rt,
5624
5653
  Wt,
5625
- zr,
5626
- Br,
5654
+ Kt,
5627
5655
  Vr,
5628
- me,
5629
- Le,
5630
- pr,
5631
5656
  Hr,
5632
- de,
5633
- ze,
5634
5657
  Ur,
5635
- ar,
5636
- or,
5637
- Rt,
5638
- Lt,
5658
+ he,
5639
5659
  Re,
5640
- St,
5660
+ hr,
5641
5661
  Wr,
5662
+ fe,
5663
+ Be,
5642
5664
  Gr,
5665
+ sr,
5666
+ cr,
5667
+ Bt,
5668
+ zt,
5669
+ ze,
5670
+ wt,
5671
+ Kr,
5643
5672
  qr,
5644
- Jr,
5645
- Yr,
5646
- xt,
5647
- lr,
5648
- ut,
5649
- Ct,
5650
5673
  Zr,
5651
- ni,
5652
- ri,
5653
- fe,
5654
- ii,
5655
- ur,
5656
- dr
5674
+ Qr,
5675
+ $r,
5676
+ Ct,
5677
+ dr,
5678
+ ft,
5679
+ Tt,
5680
+ ti,
5681
+ oi,
5682
+ si,
5683
+ pe,
5684
+ ci,
5685
+ fr,
5686
+ pr
5657
5687
  ]);
5658
- var oi = class e extends Error {
5688
+ var ui = class e extends Error {
5659
5689
  constructor(t, n, r, i, a) {
5660
5690
  super(t), this.name = `SvgoParserError`, this.message = `${a || `<input>`}:${n}:${r}: ${t}`, this.reason = t, this.line = n, this.column = r, this.source = i, Error.captureStackTrace && Error.captureStackTrace(this, e);
5661
5691
  }
@@ -5674,7 +5704,7 @@ plugins: [
5674
5704
  return `${this.name}: ${this.message}\n\n${o}\n`;
5675
5705
  }
5676
5706
  };
5677
- let si = /<!ENTITY\s+(\S+)\s+(?:'([^']+)'|"([^"]+)")\s*>/g, ci = {
5707
+ let di = /<!ENTITY\s+(\S+)\s+(?:'([^']+)'|"([^"]+)")\s*>/g, fi = {
5678
5708
  strict: !0,
5679
5709
  trim: !1,
5680
5710
  normalize: !1,
@@ -5682,8 +5712,8 @@ plugins: [
5682
5712
  xmlns: !0,
5683
5713
  position: !0,
5684
5714
  unparsedEntities: !0
5685
- }, li = (e, t) => {
5686
- let n = g.parser(ci.strict, ci), r = {
5715
+ }, pi = (e, t) => {
5716
+ let n = g.parser(fi.strict, fi), r = {
5687
5717
  type: `root`,
5688
5718
  children: []
5689
5719
  }, i = r, a = [r], o = (e) => {
@@ -5697,21 +5727,23 @@ plugins: [
5697
5727
  });
5698
5728
  let r = t.indexOf(`[`);
5699
5729
  if (r >= 0) {
5700
- si.lastIndex = r;
5701
- let t = si.exec(e);
5702
- for (; t != null;) n.ENTITIES[t[1]] = t[2] || t[3], t = si.exec(e);
5730
+ di.lastIndex = r;
5731
+ let t = di.exec(e);
5732
+ for (; t != null;) n.ENTITIES[t[1]] = t[2] || t[3], t = di.exec(e);
5703
5733
  }
5704
5734
  }, n.onprocessinginstruction = (e) => {
5705
- o({
5735
+ let t = {
5706
5736
  type: `instruction`,
5707
5737
  name: e.name,
5708
5738
  value: e.body
5709
- });
5739
+ };
5740
+ o(t);
5710
5741
  }, n.oncomment = (e) => {
5711
- o({
5742
+ let t = {
5712
5743
  type: `comment`,
5713
5744
  value: e.trim()
5714
- });
5745
+ };
5746
+ o(t);
5715
5747
  }, n.oncdata = (e) => {
5716
5748
  o({
5717
5749
  type: `cdata`,
@@ -5727,7 +5759,7 @@ plugins: [
5727
5759
  for (let [n, r] of Object.entries(e.attributes)) t.attributes[n] = r.value;
5728
5760
  o(t), i = t, a.push(t);
5729
5761
  }, n.ontext = (e) => {
5730
- if (i.type === `element`) if (he.has(i.name)) o({
5762
+ if (i.type === `element`) if (ge.has(i.name)) o({
5731
5763
  type: `text`,
5732
5764
  value: e
5733
5765
  });
@@ -5742,10 +5774,10 @@ plugins: [
5742
5774
  a.pop(), i = a[a.length - 1];
5743
5775
  }, n.onerror = (r) => {
5744
5776
  let i = r.message.split(`
5745
- `)[0], a = new oi(i, n.line + 1, n.column, e, t);
5777
+ `)[0], a = new ui(i, n.line + 1, n.column, e, t);
5746
5778
  if (r.message.indexOf(`Unexpected end`) === -1) throw a;
5747
5779
  }, n.write(e).close(), r;
5748
- }, Q = {
5780
+ }, Z = {
5749
5781
  doctypeStart: `<!DOCTYPE`,
5750
5782
  doctypeEnd: `>`,
5751
5783
  procInstStart: `<?`,
@@ -5767,20 +5799,20 @@ plugins: [
5767
5799
  indent: 4,
5768
5800
  regEntities: /[&'"<>]/g,
5769
5801
  regValEntities: /[&"<>]/g,
5770
- encodeEntity: (e) => ui[e],
5802
+ encodeEntity: (e) => mi[e],
5771
5803
  pretty: !1,
5772
5804
  useShortTags: !0,
5773
5805
  eol: `lf`,
5774
5806
  finalNewline: !1
5775
- }, ui = {
5807
+ }, mi = {
5776
5808
  "&": `&amp;`,
5777
5809
  "'": `&apos;`,
5778
5810
  "\"": `&quot;`,
5779
5811
  ">": `&gt;`,
5780
5812
  "<": `&lt;`
5781
- }, di = (e, t = {}) => {
5813
+ }, hi = (e, t = {}) => {
5782
5814
  let n = {
5783
- ...Q,
5815
+ ...Z,
5784
5816
  ...t
5785
5817
  }, r = n.indent, i = ` `;
5786
5818
  typeof r == `number` && Number.isNaN(r) === !1 ? i = r < 0 ? ` ` : ` `.repeat(r) : typeof r == `string` && (i = r);
@@ -5792,55 +5824,55 @@ plugins: [
5792
5824
  ` : `
5793
5825
  `;
5794
5826
  n.pretty && (n.doctypeEnd += o, n.procInstEnd += o, n.commentEnd += o, n.cdataEnd += o, n.tagShortEnd += o, n.tagOpenEnd += o, n.tagCloseEnd += o, n.textEnd += o);
5795
- let s = fi(e, n, a);
5827
+ let s = gi(e, n, a);
5796
5828
  return n.finalNewline && s.length > 0 && !s.endsWith(`
5797
5829
  `) && (s += o), s;
5798
- }, fi = (e, t, n) => {
5830
+ }, gi = (e, t, n) => {
5799
5831
  let r = ``;
5800
5832
  n.indentLevel++;
5801
5833
  for (let i of e.children) switch (i.type) {
5802
5834
  case `element`:
5803
- r += _i(i, t, n);
5835
+ r += xi(i, t, n);
5804
5836
  break;
5805
5837
  case `text`:
5806
- r += yi(i, t, n);
5838
+ r += Ci(i, t, n);
5807
5839
  break;
5808
5840
  case `doctype`:
5809
- r += pi(i, t);
5841
+ r += _i(i, t);
5810
5842
  break;
5811
5843
  case `instruction`:
5812
- r += mi(i, t);
5844
+ r += vi(i, t);
5813
5845
  break;
5814
5846
  case `comment`:
5815
- r += hi(i, t);
5847
+ r += yi(i, t);
5816
5848
  break;
5817
- case `cdata`: r += gi(i, t, n);
5849
+ case `cdata`: r += bi(i, t, n);
5818
5850
  }
5819
5851
  return n.indentLevel--, r;
5820
- }, $ = (e, t) => {
5852
+ }, Q = (e, t) => {
5821
5853
  let n = ``;
5822
5854
  return e.pretty && t.textContext == null && (n = t.indent.repeat(t.indentLevel - 1)), n;
5823
- }, pi = (e, t) => t.doctypeStart + e.data.doctype + t.doctypeEnd, mi = (e, t) => t.procInstStart + e.name + ` ` + e.value + t.procInstEnd, hi = (e, t) => t.commentStart + e.value + t.commentEnd, gi = (e, t, n) => $(t, n) + t.cdataStart + e.value + t.cdataEnd, _i = (e, t, n) => {
5824
- if (e.children.length === 0) return t.useShortTags ? $(t, n) + t.tagShortStart + e.name + vi(e, t) + t.tagShortEnd : $(t, n) + t.tagShortStart + e.name + vi(e, t) + t.tagOpenEnd + t.tagCloseStart + e.name + t.tagCloseEnd;
5825
- let r = t.tagOpenStart, i = t.tagOpenEnd, a = t.tagCloseStart, o = t.tagCloseEnd, s = $(t, n), c = $(t, n);
5826
- n.textContext ? (r = Q.tagOpenStart, i = Q.tagOpenEnd, a = Q.tagCloseStart, o = Q.tagCloseEnd, s = ``) : he.has(e.name) && (i = Q.tagOpenEnd, a = Q.tagCloseStart, c = ``, n.textContext = e);
5827
- let l = fi(e, t, n);
5828
- return n.textContext === e && (n.textContext = null), s + r + e.name + vi(e, t) + i + l + c + a + e.name + o;
5829
- }, vi = (e, t) => {
5855
+ }, _i = (e, t) => t.doctypeStart + e.data.doctype + t.doctypeEnd, vi = (e, t) => t.procInstStart + e.name + ` ` + e.value + t.procInstEnd, yi = (e, t) => t.commentStart + e.value + t.commentEnd, bi = (e, t, n) => Q(t, n) + t.cdataStart + e.value + t.cdataEnd, xi = (e, t, n) => {
5856
+ if (e.children.length === 0) return t.useShortTags ? Q(t, n) + t.tagShortStart + e.name + Si(e, t) + t.tagShortEnd : Q(t, n) + t.tagShortStart + e.name + Si(e, t) + t.tagOpenEnd + t.tagCloseStart + e.name + t.tagCloseEnd;
5857
+ let r = t.tagOpenStart, i = t.tagOpenEnd, a = t.tagCloseStart, o = t.tagCloseEnd, s = Q(t, n), c = Q(t, n);
5858
+ n.textContext ? (r = Z.tagOpenStart, i = Z.tagOpenEnd, a = Z.tagCloseStart, o = Z.tagCloseEnd, s = ``) : ge.has(e.name) && (i = Z.tagOpenEnd, a = Z.tagCloseStart, c = ``, n.textContext = e);
5859
+ let l = gi(e, t, n);
5860
+ return n.textContext === e && (n.textContext = null), s + r + e.name + Si(e, t) + i + l + c + a + e.name + o;
5861
+ }, Si = (e, t) => {
5830
5862
  let n = ``;
5831
5863
  for (let [r, i] of Object.entries(e.attributes)) if (n += ` ` + r, i !== void 0) {
5832
5864
  let e = i.toString().replace(t.regValEntities, t.encodeEntity);
5833
5865
  n += t.attrStart + e + t.attrEnd;
5834
5866
  }
5835
5867
  return n;
5836
- }, yi = (e, t, n) => $(t, n) + t.textStart + e.value.replace(t.regEntities, t.encodeEntity) + (n.textContext ? `` : t.textEnd), bi = /* @__PURE__ */ new Map();
5837
- for (let e of ai) bi.set(e.name, e);
5838
- function xi(e) {
5839
- return e === `removeScriptElement` ? (console.warn(`Warning: removeScriptElement has been renamed to removeScripts, please update your SVGO config`), bi.get(`removeScripts`)) : bi.get(e);
5868
+ }, Ci = (e, t, n) => Q(t, n) + t.textStart + e.value.replace(t.regEntities, t.encodeEntity) + (n.textContext ? `` : t.textEnd), wi = /* @__PURE__ */ new Map();
5869
+ for (let e of li) wi.set(e.name, e);
5870
+ function Ti(e) {
5871
+ return e === `removeScriptElement` ? (console.warn(`Warning: removeScriptElement has been renamed to removeScripts, please update your SVGO config`), wi.get(`removeScripts`)) : wi.get(e);
5840
5872
  }
5841
- let Si = (e) => {
5873
+ let Ei = (e) => {
5842
5874
  if (typeof e == `string`) {
5843
- let t = xi(e);
5875
+ let t = Ti(e);
5844
5876
  if (t == null) throw Error(`Unknown builtin plugin "${e}" specified.`);
5845
5877
  return {
5846
5878
  name: e,
@@ -5852,7 +5884,7 @@ plugins: [
5852
5884
  if (e.name == null) throw Error(`Plugin name must be specified`);
5853
5885
  let t = e.fn;
5854
5886
  if (t == null) {
5855
- let n = xi(e.name);
5887
+ let n = Ti(e.name);
5856
5888
  if (n == null) throw Error(`Unknown builtin plugin "${e.name}" specified.`);
5857
5889
  t = n.fn;
5858
5890
  }
@@ -5863,49 +5895,49 @@ plugins: [
5863
5895
  };
5864
5896
  }
5865
5897
  return null;
5866
- }, Ci = (e, t) => {
5898
+ }, Di = (e, t) => {
5867
5899
  if (t ??= {}, typeof t != `object`) throw Error(`Config should be an object`);
5868
5900
  let n = t.multipass ? 10 : 1, r = Infinity, i = ``, a = {};
5869
5901
  t.path != null && (a.path = t.path);
5870
5902
  for (let o = 0; o < n; o += 1) {
5871
5903
  a.multipassCount = o;
5872
- let n = li(e, t.path), s = t.plugins || [`preset-default`];
5904
+ let n = pi(e, t.path), s = t.plugins || [`preset-default`];
5873
5905
  if (!Array.isArray(s)) throw Error("malformed config, `plugins` property must be an array.\nSee more info here: https://github.com/svg/svgo#configuration");
5874
- let c = s.filter(((e) => e != null)).map(Si);
5906
+ let c = s.filter(((e) => e != null)).map(Ei);
5875
5907
  c.length < s.length && console.warn(`Warning: plugins list includes null or undefined elements, these will be ignored.`);
5876
5908
  let l = {};
5877
- if (t.floatPrecision != null && (l.floatPrecision = t.floatPrecision), w(n, a, c, null, l), i = di(n, t.js2svg), !(i.length < r)) break;
5909
+ if (t.floatPrecision != null && (l.floatPrecision = t.floatPrecision), w(n, a, c, null, l), i = hi(n, t.js2svg), !(i.length < r)) break;
5878
5910
  e = i, r = i.length;
5879
5911
  }
5880
- return t.datauri && (i = Xe(i, t.datauri)), { data: i };
5881
- }, wi = async (e) => {
5912
+ return t.datauri && (i = Ze(i, t.datauri)), { data: i };
5913
+ }, $ = async (e) => {
5882
5914
  let t = d.resolve(e), n = (await import(_.pathToFileURL(t).toString())).default;
5883
5915
  if (typeof n != `object` || !n || Array.isArray(n)) throw Error(`Invalid config file "${e}"`);
5884
5916
  return n;
5885
- }, Ti = async (e) => {
5917
+ }, Oi = async (e) => {
5886
5918
  try {
5887
5919
  return (await u.stat(e)).isFile();
5888
5920
  } catch {
5889
5921
  return !1;
5890
5922
  }
5891
5923
  };
5892
- e.VERSION = `4.0.1`, e._collections = Ee, e.builtinPlugins = ai, e.loadConfig = async (e, t = process.cwd()) => {
5893
- if (e != null) return d.isAbsolute(e) ? wi(e) : wi(d.join(t, e));
5924
+ e.VERSION = `4.0.2`, e._collections = De, e.builtinPlugins = li, e.loadConfig = async (e, t = process.cwd()) => {
5925
+ if (e != null) return d.isAbsolute(e) ? $(e) : $(d.join(t, e));
5894
5926
  let n = t;
5895
5927
  for (;;) {
5896
5928
  let e = d.join(n, `svgo.config.js`);
5897
- if (await Ti(e)) return wi(e);
5929
+ if (await Oi(e)) return $(e);
5898
5930
  let t = d.join(n, `svgo.config.mjs`);
5899
- if (await Ti(t)) return wi(t);
5931
+ if (await Oi(t)) return $(t);
5900
5932
  let r = d.join(n, `svgo.config.cjs`);
5901
- if (await Ti(r)) return wi(r);
5933
+ if (await Oi(r)) return $(r);
5902
5934
  let i = d.dirname(n);
5903
5935
  if (n === i) return null;
5904
5936
  n = i;
5905
5937
  }
5906
- }, e.mapNodesToParents = E, e.optimize = (e, t) => {
5938
+ }, e.mapNodesToParents = T, e.optimize = (e, t) => {
5907
5939
  if (t ??= {}, typeof t != `object`) throw Error(`Config should be an object`);
5908
- return Ci(e, {
5940
+ return Di(e, {
5909
5941
  ...t,
5910
5942
  js2svg: {
5911
5943
  eol: l.EOL === `\r
@@ -5913,6 +5945,6 @@ plugins: [
5913
5945
  ...t.js2svg
5914
5946
  }
5915
5947
  });
5916
- }, e.querySelector = le, e.querySelectorAll = k;
5948
+ }, e.querySelector = ue, e.querySelectorAll = O;
5917
5949
  }));
5918
5950
  export { l as require_svgo_node };