webfont 12.3.0 → 12.4.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.
package/dist/cli.mjs CHANGED
@@ -14,20 +14,21 @@ import { globby as te } from "globby";
14
14
  import { cosmiconfig as ne } from "cosmiconfig";
15
15
  import re from "deepmerge";
16
16
  import * as ie from "fs/promises";
17
- import ae from "ttf2woff";
18
- import oe from "wawoff2";
19
- import se from "ttf2eot";
20
- import ce from "fontverter";
21
- import le from "xml2js";
22
- import ue from "p-limit";
23
- import { SVGIcons2SVGFontStream as de, fileSorter as fe, getMetadataService as pe } from "svgicons2svgfont";
24
- import me from "crypto";
25
- import { optimize as he } from "svgo";
26
- import { Readable as ge } from "stream";
27
- import _e from "svg2ttf";
17
+ import { createFont as ae } from "fonteditor-core";
18
+ import oe from "ttf2woff";
19
+ import se from "wawoff2";
20
+ import ce from "ttf2eot";
21
+ import le from "fontverter";
22
+ import ue from "xml2js";
23
+ import de from "p-limit";
24
+ import { SVGIcons2SVGFontStream as fe, fileSorter as pe, getMetadataService as me } from "svgicons2svgfont";
25
+ import he from "crypto";
26
+ import { optimize as ge } from "svgo";
27
+ import { Readable as _e } from "stream";
28
+ import ve from "svg2ttf";
28
29
  //#region package.json
29
- var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w, T, E, Oe, ke, Ae = r((() => {
30
- ve = "webfont", ye = "12.3.0", be = "Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding)", xe = {
30
+ var p, ye, be, xe, Se, Ce, we, Te, Ee, De, m, h, g, _, v, y, b, x, S, C, w, T, E, Oe, ke, Ae, je = r((() => {
31
+ p = "webfont", ye = "12.4.1", be = "Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding)", xe = {
31
32
  lib: "dist",
32
33
  source: "src"
33
34
  }, Se = [
@@ -38,7 +39,7 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
38
39
  "!**/__mocks__",
39
40
  "README.md",
40
41
  "NOTICE.md"
41
- ], Ce = "commonjs", we = "dist/index.js", Te = "dist/index.mjs", Ee = "dist/browser.js", De = "dist/cli.mjs", p = "src/index.ts", m = "dist/src/index.d.ts", h = "dist/src/index.d.ts", g = {
42
+ ], Ce = "commonjs", we = "dist/index.js", Te = "dist/index.mjs", Ee = "dist/browser.js", De = "dist/cli.mjs", m = "src/index.ts", h = "dist/src/index.d.ts", g = "dist/src/index.d.ts", _ = {
42
43
  ".": {
43
44
  browser: {
44
45
  types: "./dist/src/index.d.ts",
@@ -60,10 +61,16 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
60
61
  }
61
62
  },
62
63
  "./package.json": "./package.json"
63
- }, _ = {
64
+ }, v = {
64
65
  build: "vite build --mode library && vite build --mode library-esm && vite build --mode browser && vite build --mode cli && node scripts/emit-mts-types.mjs",
65
66
  clean: "rm -rf dist/ temp/",
66
67
  demo: "node dist/cli.mjs './src/fixtures/svg-icons/*.svg' -d demo -t html --normalize --center-horizontally",
68
+ "docs:build": "npm run build && npm run docs:site",
69
+ "docs:demo": "node dist/cli.mjs './src/fixtures/svg-icons/*.svg' -d public/font-demo -t html --normalize --center-horizontally --dest-create",
70
+ "predocs:site": "node -e \"require('node:fs').existsSync('dist/cli.mjs')||require('node:child_process').execSync('npm run build',{stdio:'inherit'})\"",
71
+ "docs:site": "npm run docs:demo && vitepress build",
72
+ "docs:dev": "vitepress dev",
73
+ "docs:preview": "vitepress preview",
67
74
  lint: "biome check .",
68
75
  "lint:suppressions": "node scripts/check-no-suppressions.mjs",
69
76
  typecheck: "tsc -p tsconfig.json --noEmit",
@@ -83,9 +90,10 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
83
90
  "test-debug": "vitest run src --no-file-parallelism",
84
91
  testu: "vitest run src -u",
85
92
  "deprecate-pre-12": "npm deprecate 'webfont@>=10.0.0 <12.0.0' 'Deprecated: upgrade to webfont@12. v10–11 enabled ligatures by default (browser hangs on large fonts, #558). 12.x: ligatures off, Node 24.14+, named import, unicode-range off, template fixes. See MIGRATION.md'"
86
- }, v = {
93
+ }, y = {
87
94
  cosmiconfig: "9.0.2",
88
95
  deepmerge: "^4.2.2",
96
+ "fonteditor-core": "2.6.3",
89
97
  fontverter: "2.0.0",
90
98
  globby: "16.2.0",
91
99
  meow: "14.1.0",
@@ -99,7 +107,7 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
99
107
  ttf2woff: "^3.0.0",
100
108
  wawoff2: "2.0.1",
101
109
  xml2js: "0.6.2"
102
- }, y = {
110
+ }, b = {
103
111
  "@arethetypeswrong/cli": "0.18.4",
104
112
  "@biomejs/biome": "2.5.2",
105
113
  "@types/node": "26.1.0",
@@ -122,15 +130,16 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
122
130
  vite: "8.1.3",
123
131
  "vite-plugin-checker": "0.14.4",
124
132
  "vite-plugin-dts": "5.0.3",
133
+ vitepress: "1.6.4",
125
134
  vitest: "4.1.9"
126
- }, b = {
135
+ }, x = {
127
136
  minimatch: "10.2.5",
128
137
  "test-exclude": "7.0.2",
129
138
  "woff2sfnt-sfnt2woff": "1.0.0"
130
- }, x = {
139
+ }, S = {
131
140
  type: "git",
132
141
  url: "git+https://github.com/itgalaxy/webfont.git"
133
- }, S = "itgalaxy <development@itgalaxy.company>", C = [{
142
+ }, C = "itgalaxy <development@itgalaxy.company>", w = [{
134
143
  name: "Alexander Krasnoyarov",
135
144
  email: "alexander.krasnoyarov@itgalaxy.company",
136
145
  url: "https://vk.com/sterling_archer"
@@ -138,7 +147,7 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
138
147
  name: "Jimmy Andrade",
139
148
  email: "webfont@jimmyandrade.com",
140
149
  url: "https://github.com/jimmyandrade"
141
- }], w = { url: "https://github.com/itgalaxy/webfont/issues" }, T = "https://github.com/itgalaxy/webfont#readme", E = { node: ">=24.14.0" }, Oe = [
150
+ }], T = { url: "https://github.com/itgalaxy/webfont/issues" }, E = "https://github.com/itgalaxy/webfont#readme", Oe = { node: ">=24.14.0" }, ke = [
142
151
  "cli",
143
152
  "standalone",
144
153
  "font",
@@ -158,8 +167,8 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
158
167
  "scss",
159
168
  "builder",
160
169
  "generator"
161
- ], ke = {
162
- name: ve,
170
+ ], Ae = {
171
+ name: p,
163
172
  version: ye,
164
173
  description: be,
165
174
  directories: xe,
@@ -170,25 +179,25 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
170
179
  module: Te,
171
180
  browser: Ee,
172
181
  bin: De,
173
- source: p,
174
- types: m,
175
- typings: h,
176
- exports: g,
177
- scripts: _,
178
- dependencies: v,
179
- devDependencies: y,
180
- overrides: b,
181
- repository: x,
182
- author: S,
182
+ source: m,
183
+ types: h,
184
+ typings: g,
185
+ exports: _,
186
+ scripts: v,
187
+ dependencies: y,
188
+ devDependencies: b,
189
+ overrides: x,
190
+ repository: S,
191
+ author: C,
183
192
  license: "MIT",
184
- contributors: C,
185
- bugs: w,
186
- homepage: T,
187
- engines: E,
188
- keywords: Oe
193
+ contributors: w,
194
+ bugs: T,
195
+ homepage: E,
196
+ engines: Oe,
197
+ keywords: ke
189
198
  };
190
- })), je, Me, Ne = r((() => {
191
- je = "\n Usage: webfont [input] [options]\n\n Input: File(s) or glob(s).\n\n SVG icons: one or more `.svg` files (default pipeline).\n Webfont decompression: one or more `.woff` / `.woff2` paths, globs, or http(s) URLs.\n You must have rights to any font file you process (see NOTICE.md).\n\n If an input argument is wrapped in quotation marks, it will be passed to \"fast-glob\"\n for cross-platform glob support.\n\n Options:\n\n --config\n\n Path to a specific configuration file (JSON, YAML, or CommonJS)\n or the name of a module in `node_modules` that points to one.\n If no `--config` argument is provided, webfont will search for\n configuration files in the following places, in this order:\n - a `webfont` property in `package.json`\n - a `.webfontrc` file (with or without filename extension:\n `.json`, `.yaml`, and `.js` are available)\n - a `webfont.config.js` file exporting a JS object\n The search will begin in the working directory and move up the\n directory tree until a configuration file is found.\n\n -u, --fontName\n\n The font family name you want, default: \"webfont\".\n\n -h, --help\n\n Output usage information.\n\n -v, --version\n\n Output the version number.\n\n -f, --formats\n\n Font formats to generate. Pass a JSON array (e.g. '[\"woff2\"]') or a\n comma-separated list (e.g. woff2 or svg, ttf, woff2).\n SVG input: svg, ttf, eot, woff, woff2 (not otf).\n WOFF/WOFF2 input: ttf and/or otf matching the embedded SFNT flavor.\n\n -d, --dest\n\n Destination for generated fonts.\n\n -m, --dest-create\n\n Create destination directory if it does not exist.\n\n -t, --template\n\n Built-in template name(s) ('css', 'scss', 'styl', 'html', 'json') or path to a custom template.\n Pass a JSON array (e.g. '[\"html\",\"scss\"]') or comma-separated list for multiple outputs.\n\n -s, --destTemplate\n\n Destination for generated template. If not passed used `dest` argument value.\n\n -c, --templateClassName\n\n Class name in css template.\n\n -p, --templateFontPath\n\n Font path in css template.\n\n -n, --templateFontName\n\n Font name in css template.\n\n --templateCacheString\n\n Specify cache string in scss/css template.\n\n --no-sort\n\n Keeps the files in the same order of entry\n\n --ligatures\n\n Add OpenType ligature glyphs (icon names as text). Off by default — large\n icon sets can hang Firefox on Windows (#558). Prefer class + codepoint CSS.\n\n --unicode-range\n\n Emit unicode-range in built-in @font-face rules (computed from glyph code points).\n Off by default — enabling may prevent ligature names from rendering; see README.\n\n --no-template-font-ligatures\n\n Omit font-feature-settings: \"liga\" from the built-in HTML preview template\n\n --optimize-svg\n\n Run a conservative SVGO pass on each SVG before font generation\n (does not convert strokes to fills; use glyphContentTransformFn for that)\n\n --verbose\n\n Tell me everything!.\n\n --svg-diagnose\n\n (Alpha) Scan SVG icons for icon-font incompatibilities (stroke-only paths,\n fill-rule: evenodd, unsupported elements) and log warnings.\n\n For \"svgicons2svgfont\":\n\n --fontId\n\n The font id you want, default as \"--fontName\".\n\n --fontStyle\n\n The font style you want.\n\n --fontWeight\n\n The font weight you want.\n\n --fixedWidth\n\n Creates a monospace font of the width of the largest input icon.\n\n --centerHorizontally\n\n Calculate the bounds of a glyph and center it horizontally.\n\n --centerVertically\n\n Center the glyphs vertically in the generated font.\n\n --normalize\n\n Normalize icons by scaling them to the height of the highest icon.\n\n --fontHeight\n\n The outputted font height [MAX(icons.height)].\n\n --round\n\n Setup the SVG path rounding [10e12].\n\n --descent\n\n The font descent [0].\n\n --ascent\n\n The font ascent [height - descent].\n\n --startUnicode\n\n The start unicode codepoint for files without prefix [0xEA01].\n\n --prependUnicode\n\n Prefix files with their automatically allocated unicode codepoint.\n\n --metadata\n\n Content of the metadata tag.\n\n --addHashInFontUrl\n\n Append an MD5 content hash to font URLs in built-in templates\n (?v=[hash]) while keeping output filenames stable (fontName.woff2, etc.).\n Use with a fixed fontName — do not randomize fontName for cache busting.\n", Me = {
199
+ })), Me, Ne, Pe = r((() => {
200
+ Me = "\n Usage: webfont [input] [options]\n\n Input: File(s) or glob(s).\n\n SVG icons: one or more `.svg` files (default pipeline).\n Webfont decompression: one or more `.woff` / `.woff2` paths, globs, or http(s) URLs.\n You must have rights to any font file you process (see NOTICE.md).\n\n If an input argument is wrapped in quotation marks, it will be passed to \"fast-glob\"\n for cross-platform glob support.\n\n Options:\n\n --config\n\n Path to a specific configuration file (JSON, YAML, or CommonJS)\n or the name of a module in `node_modules` that points to one.\n If no `--config` argument is provided, webfont will search for\n configuration files in the following places, in this order:\n - a `webfont` property in `package.json`\n - a `.webfontrc` file (with or without filename extension:\n `.json`, `.yaml`, and `.js` are available)\n - a `webfont.config.js` file exporting a JS object\n The search will begin in the working directory and move up the\n directory tree until a configuration file is found.\n\n -u, --fontName\n\n The font family name you want, default: \"webfont\".\n\n -h, --help\n\n Output usage information.\n\n -v, --version\n\n Output the version number.\n\n -f, --formats\n\n Font formats to generate. Pass a JSON array (e.g. '[\"woff2\"]') or a\n comma-separated list (e.g. woff2 or svg, ttf, woff2).\n SVG input: svg, ttf, eot, woff, woff2 (not otf).\n WOFF/WOFF2 input: ttf and/or otf matching the embedded SFNT flavor.\n\n -d, --dest\n\n Destination for generated fonts.\n\n -m, --dest-create\n\n Create destination directory if it does not exist.\n\n -t, --template\n\n Built-in template name(s) ('css', 'scss', 'styl', 'html', 'json') or path to a custom template.\n Pass a JSON array (e.g. '[\"html\",\"scss\"]') or comma-separated list for multiple outputs.\n\n -s, --destTemplate\n\n Destination for generated template. If not passed used `dest` argument value.\n\n -c, --templateClassName\n\n Class name in css template.\n\n -p, --templateFontPath\n\n Font path in css template.\n\n -n, --templateFontName\n\n Font name in css template.\n\n --templateCacheString\n\n Specify cache string in scss/css template.\n\n --no-sort\n\n Keeps the files in the same order of entry\n\n --ligatures\n\n Add OpenType ligature glyphs (icon names as text). Off by default — large\n icon sets can hang Firefox on Windows (#558). Prefer class + codepoint CSS.\n\n --unicode-range\n\n Emit unicode-range in built-in @font-face rules (computed from glyph code points).\n Off by default — enabling may prevent ligature names from rendering; see README.\n\n --no-template-font-ligatures\n\n Omit font-feature-settings: \"liga\" from the built-in HTML preview template\n\n --optimize-svg\n\n Run a conservative SVGO pass on each SVG before font generation\n (does not convert strokes to fills; use glyphContentTransformFn for that)\n\n --verbose\n\n Tell me everything!.\n\n --svg-diagnose\n\n (Alpha) Scan SVG icons for icon-font incompatibilities (stroke-only paths,\n fill-rule: evenodd, unsupported elements) and log warnings.\n\n For \"svgicons2svgfont\":\n\n --fontId\n\n The font id you want, default as \"--fontName\".\n\n --fontStyle\n\n The font style you want.\n\n --fontWeight\n\n The font weight you want.\n\n --fixedWidth\n\n Creates a monospace font of the width of the largest input icon.\n\n --centerHorizontally\n\n Calculate the bounds of a glyph and center it horizontally.\n\n --centerVertically\n\n Center the glyphs vertically in the generated font.\n\n --normalize\n\n Normalize icons by scaling them to the height of the highest icon.\n\n --fontHeight\n\n The outputted font height [MAX(icons.height)].\n\n --round\n\n Setup the SVG path rounding [10e12].\n\n --descent\n\n The font descent [0].\n\n --ascent\n\n The font ascent [height - descent].\n\n --startUnicode\n\n The start unicode codepoint for files without prefix [0xEA01].\n\n --prependUnicode\n\n Prefix files with their automatically allocated unicode codepoint.\n\n --metadata\n\n Content of the metadata tag.\n\n --addHashInFontUrl\n\n Append an MD5 content hash to font URLs in built-in templates\n (?v=[hash]) while keeping output filenames stable (fontName.woff2, etc.).\n Use with a fixed fontName — do not randomize fontName for cache busting.\n", Ne = {
192
201
  ascent: { type: "string" },
193
202
  centerHorizontally: { type: "boolean" },
194
203
  centerVertically: { type: "boolean" },
@@ -287,98 +296,102 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
287
296
  type: "boolean"
288
297
  }
289
298
  };
290
- })), Pe, Fe, Ie = r((() => {
291
- Ae(), Ne(), Pe = { url: s(t).href }, Fe = (e = process.argv.slice(2)) => c(je, {
299
+ })), Fe, Ie, Le = r((() => {
300
+ je(), Pe(), Fe = { url: s(t).href }, Ie = (e = process.argv.slice(2)) => c(Me, {
292
301
  argv: [...e],
293
302
  autoHelp: !1,
294
303
  autoVersion: !1,
295
- flags: Me,
296
- importMeta: Pe,
297
- pkg: ke
304
+ flags: Ne,
305
+ importMeta: Fe,
306
+ pkg: Ae
298
307
  });
299
- })), Le, Re = r((() => {
300
- Ie(), Ne(), Le = Fe();
301
- })), ze, D, O, Be, Ve, He, k = r((() => {
302
- ze = /^https?:\/\//iu, D = (e) => ze.test(e), O = (e) => {
308
+ })), Re, ze = r((() => {
309
+ Le(), Pe(), Re = Ie();
310
+ })), Be, D, O, Ve, He, Ue, k = r((() => {
311
+ Be = /^https?:\/\//iu, D = (e) => Be.test(e), O = (e) => {
303
312
  if (D(e)) try {
304
313
  return f.extname(new URL(e).pathname).toLowerCase();
305
314
  } catch {
306
315
  return "";
307
316
  }
308
317
  return f.extname(e).toLowerCase();
309
- }, Be = (e) => {
318
+ }, Ve = (e) => {
310
319
  let t = e;
311
320
  D(e) && (t = new URL(e).pathname);
312
321
  let n = f.basename(t), r = O(e);
313
322
  return r === ".woff2" ? n.slice(0, -6) : r === ".woff" ? n.slice(0, -5) : n.replace(/\.[^.]+$/u, "");
314
- }, Ve = {
323
+ }, He = {
315
324
  ".woff": "-woff",
316
325
  ".woff2": "-woff2"
317
- }, He = (e) => {
318
- let t = e.map((e) => Be(e)), n = /* @__PURE__ */ new Map();
326
+ }, Ue = (e) => {
327
+ let t = e.map((e) => Ve(e)), n = /* @__PURE__ */ new Map();
319
328
  for (let e of t) n.set(e, (n.get(e) ?? 0) + 1);
320
329
  return e.map((e, r) => {
321
330
  let i = t[r], a = (n.get(i) ?? 0) > 1, o = O(e);
322
- return a ? `${i}${Ve[o] ?? `-${r + 1}`}` : i;
331
+ return a ? `${i}${He[o] ?? `-${r + 1}`}` : i;
323
332
  });
324
333
  };
325
- })), Ue, We = r((() => {
326
- k(), Ue = async (e) => (await Promise.all(e.map((e) => D(e) ? Promise.resolve([e]) : te(e)))).flat();
327
- })), Ge, Ke, qe, A, Je = r((() => {
328
- Ge = 1330926671, Ke = 1953658213, qe = 65536, A = (e) => {
334
+ })), We, Ge = r((() => {
335
+ k(), We = async (e) => (await Promise.all(e.map((e) => D(e) ? Promise.resolve([e]) : te(e)))).flat();
336
+ })), Ke, qe, Je, A, Ye = r((() => {
337
+ Ke = 1330926671, qe = 1953658213, Je = 65536, A = (e) => {
329
338
  if (e.length < 4) throw Error("SFNT buffer is too short to read flavor");
330
339
  let t = e.readUInt32BE(0);
331
- if (t === Ge) return "otf";
332
- if (t === Ke || t === qe) return "ttf";
340
+ if (t === Ke) return "otf";
341
+ if (t === qe || t === Je) return "ttf";
333
342
  throw Error(`Unsupported SFNT flavor 0x${t.toString(16)}`);
334
343
  };
335
- })), Ye, Xe = r((() => {
336
- Ye = (e) => Buffer.from(se(e));
337
- })), j, M, N, Ze = r((() => {
338
- Xe(), j = (e) => Ye(e), M = (e, t = {}) => Buffer.from(ae(e, t).buffer), N = async (e) => Buffer.from(await oe.compress(e));
339
- })), P, F, I, L, R, z, B, Qe, $e, et, V, tt, nt, rt, H = r((() => {
344
+ })), Xe, Ze = r((() => {
345
+ Xe = (e) => Buffer.from(ce(e));
346
+ })), j, Qe, M, N, $e = r((() => {
347
+ Ze(), j = (e) => Xe(e), Qe = (e, t = {}) => ae(e, { type: "ttf" }).write({
348
+ type: "svg",
349
+ metadata: t.metadata
350
+ }), M = (e, t = {}) => Buffer.from(oe(e, t).buffer), N = async (e) => Buffer.from(await se.compress(e));
351
+ })), P, F, I, L, R, z, B, et, tt, nt, V, rt, it, at, H = r((() => {
340
352
  k(), P = /* @__PURE__ */ new Set([".woff", ".woff2"]), F = ".svg", I = ".ttf", L = [
341
353
  "svg",
342
354
  "ttf",
343
355
  "eot",
344
356
  "woff",
345
357
  "woff2"
346
- ], R = (e) => e === F, z = (e) => e === I, B = (e) => P.has(e), Qe = (e) => R(e) || B(e) || z(e), $e = (e) => {
358
+ ], R = (e) => e === F, z = (e) => e === I, B = (e) => P.has(e), et = (e) => R(e) || B(e) || z(e), tt = (e) => {
347
359
  if (e.length === 0) return "empty";
348
360
  let t = e.map((e) => O(e));
349
- if (!t.every(Qe)) return "empty";
361
+ if (!t.every(et)) return "empty";
350
362
  let n = t.some(R), r = t.some(B), i = t.some(z);
351
363
  return [
352
364
  n,
353
365
  r,
354
366
  i
355
367
  ].filter(Boolean).length > 1 ? "mixed" : r ? "webfont" : i ? "ttf" : n ? "svg" : "empty";
356
- }, et = (e) => {
368
+ }, nt = (e) => {
357
369
  if (e.includes("otf")) throw Error("OTF output is only supported when converting WOFF/WOFF2 input. Request \"ttf\" for SVG icons, or pass a .woff/.woff2 file.");
358
- }, V = (e, t) => t === "svg" ? e.filter((e) => O(e) === F) : t === "webfont" ? e.filter((e) => P.has(O(e))) : t === "ttf" ? e.filter((e) => O(e) === I) : [], tt = /* @__PURE__ */ new Set([
370
+ }, V = (e, t) => t === "svg" ? e.filter((e) => O(e) === F) : t === "webfont" ? e.filter((e) => P.has(O(e))) : t === "ttf" ? e.filter((e) => O(e) === I) : [], rt = /* @__PURE__ */ new Set([
359
371
  "ttf",
372
+ "svg",
360
373
  "eot",
361
374
  "woff",
362
375
  "woff2"
363
- ]), nt = (e) => {
364
- let t = e.filter((e) => tt.has(e));
376
+ ]), it = (e) => {
377
+ let t = e.filter((e) => rt.has(e));
365
378
  if (e.length === L.length && L.every((t) => e.includes(t))) return ["woff", "woff2"];
366
- if (t.length === 0) throw Error("formats must include at least one of \"ttf\", \"eot\", \"woff\", or \"woff2\" when converting TTF input");
379
+ if (t.length === 0) throw Error("formats must include at least one of \"svg\", \"ttf\", \"eot\", \"woff\", or \"woff2\" when converting TTF input");
367
380
  return [...new Set(t)];
368
- }, rt = (e) => {
381
+ }, at = (e) => {
369
382
  let t = e.filter((e) => e === "ttf" || e === "otf");
370
383
  if (e.length === L.length && L.every((t) => e.includes(t))) return ["ttf"];
371
384
  if (t.length === 0) throw Error("formats must include \"ttf\" and/or \"otf\" when converting WOFF/WOFF2 input");
372
385
  return [...new Set(t)];
373
386
  };
374
- })), it, at, ot, st, ct, lt, ut = r((() => {
375
- k(), Je(), Ze(), H(), it = (e) => {
387
+ })), ot, st, ct, U, lt, ut, dt, ft = r((() => {
388
+ k(), Ye(), $e(), H(), ot = (e) => {
376
389
  if (e.length === 0) throw Error("No TTF files matched");
377
- }, at = (e) => {
390
+ }, st = (e) => {
378
391
  if (e.template) throw Error("Templates are not supported when converting TTF input");
379
392
  if (e.glyphTransformFn) throw Error("glyphTransformFn is not supported when converting TTF input");
380
393
  if (e.glyphContentTransformFn) throw Error("glyphContentTransformFn is not supported when converting TTF input");
381
- }, ot = (e, t) => {
394
+ }, ct = (e, t) => {
382
395
  let n;
383
396
  try {
384
397
  n = A(e);
@@ -386,55 +399,60 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
386
399
  throw Error(`Input is not a valid TrueType font: ${t}`);
387
400
  }
388
401
  if (n !== "ttf") throw Error(`OpenType (OTF) input is not supported for webfont encoding. Use a .ttf file for ${t}.`);
389
- }, st = async (e, t, n, r) => {
402
+ }, U = (e) => {
403
+ if (typeof e.metadata == "string") return e.metadata;
404
+ }, lt = async (e, t, n, r) => {
390
405
  if (n === "ttf") {
391
406
  e.ttf = t;
392
407
  return;
393
408
  }
409
+ if (n === "svg") {
410
+ e.svg = Qe(t, { metadata: U(r) });
411
+ return;
412
+ }
394
413
  if (n === "eot") {
395
414
  e.eot = j(t);
396
415
  return;
397
416
  }
398
417
  if (n === "woff") {
399
- let n;
400
- typeof r.metadata == "string" && (n = r.metadata), e.woff = M(t, { metadata: n });
418
+ e.woff = M(t, { metadata: U(r) });
401
419
  return;
402
420
  }
403
421
  e.woff2 = await N(t);
404
- }, ct = async (e, t, n, r) => {
422
+ }, ut = async (e, t, n, r) => {
405
423
  if (D(e)) throw Error(`Remote TTF URLs are not supported. Download the file first: ${e}`);
406
424
  r && console.log(`Encoding ${e}...`);
407
425
  let i = await ie.readFile(e);
408
- ot(i, e);
426
+ ct(i, e);
409
427
  let a = { source: e };
410
- return await Promise.all(t.map((e) => st(a, i, e, n))), a;
411
- }, lt = async (e, t) => {
412
- at(t), it(e);
413
- let n = nt(t.formats), r = await Promise.all(e.map((e) => ct(e, n, t, t.verbose))), i = {
428
+ return await Promise.all(t.map((e) => lt(a, i, e, n))), a;
429
+ }, dt = async (e, t) => {
430
+ st(t), ot(e);
431
+ let n = it(t.formats), r = await Promise.all(e.map((e) => ut(e, n, t, t.verbose))), i = {
414
432
  config: { ...t },
415
433
  transcodedFonts: r
416
434
  };
417
435
  if (r.length === 1) {
418
436
  let [e] = r;
419
- i.ttf = e.ttf, i.eot = e.eot, i.woff = e.woff, i.woff2 = e.woff2;
437
+ i.svg = e.svg, i.ttf = e.ttf, i.eot = e.eot, i.woff = e.woff, i.woff2 = e.woff2;
420
438
  }
421
439
  return i;
422
440
  };
423
- })), dt = /* @__PURE__ */ a(((e, t) => {
441
+ })), pt = /* @__PURE__ */ a(((e, t) => {
424
442
  t.exports = function(e) {
425
443
  return !e || e.length < 8 ? !1 : e[0] === 119 && e[1] === 79 && e[2] === 70 && e[3] === 70 && e[4] === 0 && e[5] === 1 && e[6] === 0 && e[7] === 0 || e[4] === 79 && e[5] === 84 && e[6] === 84 && e[7] === 79;
426
444
  };
427
- })), ft = /* @__PURE__ */ a(((e, t) => {
445
+ })), mt = /* @__PURE__ */ a(((e, t) => {
428
446
  t.exports = function(e) {
429
447
  return !e || e.length < 8 ? !1 : e[0] === 119 && e[1] === 79 && e[2] === 70 && e[3] === 50 && e[4] === 0 && e[5] === 1 && e[6] === 0 && e[7] === 0;
430
448
  };
431
- })), pt, mt, ht, gt, _t = r((() => {
432
- pt = /* @__PURE__ */ n(dt()), mt = /* @__PURE__ */ n(ft()), k(), ht = (e, t) => {
449
+ })), ht, gt, _t, vt, yt = r((() => {
450
+ ht = /* @__PURE__ */ n(pt()), gt = /* @__PURE__ */ n(mt()), k(), _t = (e, t) => {
433
451
  let n = O(t);
434
- if (n === ".woff2" && !(0, mt.default)(e)) throw Error(`URL did not return a valid WOFF2 font: ${t}`);
435
- if (n === ".woff" && !(0, pt.default)(e)) throw Error(`URL did not return a valid WOFF font: ${t}`);
452
+ if (n === ".woff2" && !(0, gt.default)(e)) throw Error(`URL did not return a valid WOFF2 font: ${t}`);
453
+ if (n === ".woff" && !(0, ht.default)(e)) throw Error(`URL did not return a valid WOFF font: ${t}`);
436
454
  if (e.length === 0) throw Error(`URL returned an empty response: ${t}`);
437
- }, gt = async (e) => {
455
+ }, vt = async (e) => {
438
456
  let t;
439
457
  try {
440
458
  t = await fetch(e);
@@ -444,16 +462,16 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
444
462
  }
445
463
  if (!t.ok) throw Error(`Failed to fetch font URL ${e}: HTTP ${t.status} ${t.statusText}`);
446
464
  let n = await t.arrayBuffer(), r = Buffer.from(n);
447
- return ht(r, e), r;
465
+ return _t(r, e), r;
448
466
  };
449
- })), vt, yt, bt, xt, St, Ct, wt = r((() => {
450
- k(), Je(), _t(), H(), vt = (e) => {
467
+ })), bt, xt, St, Ct, wt, Tt, Et = r((() => {
468
+ k(), Ye(), yt(), H(), bt = (e) => {
451
469
  if (e.length === 0) throw Error("No WOFF or WOFF2 files matched");
452
- }, yt = (e) => {
470
+ }, xt = (e) => {
453
471
  if (e.template) throw Error("Templates are not supported when converting WOFF/WOFF2 input");
454
472
  if (e.glyphTransformFn) throw Error("glyphTransformFn is not supported when converting WOFF/WOFF2 input");
455
473
  if (e.glyphContentTransformFn) throw Error("glyphContentTransformFn is not supported when converting WOFF/WOFF2 input");
456
- }, bt = (e) => {
474
+ }, St = (e) => {
457
475
  let { decompressed: t, sfnt: n, format: r, flavor: i, source: a } = e;
458
476
  if (r === "ttf" && i !== "ttf") throw Error(`Input decompresses to OpenType (OTF). Request "otf" format instead of "ttf" for ${a}.`);
459
477
  if (r === "otf" && i !== "otf") throw Error(`Input decompresses to TrueType (TTF). Request "ttf" format instead of "otf" for ${a}.`);
@@ -462,10 +480,10 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
462
480
  return;
463
481
  }
464
482
  t.otf = n;
465
- }, xt = (e) => D(e) ? gt(e) : ie.readFile(e), St = async (e, t, n) => {
483
+ }, Ct = (e) => D(e) ? vt(e) : ie.readFile(e), wt = async (e, t, n) => {
466
484
  n && console.log(`Decompressing ${e}...`);
467
- let r = await xt(e), i = Buffer.from(await ce.convert(r, "sfnt")), a = A(i), o = { source: e };
468
- for (let n of t) bt({
485
+ let r = await Ct(e), i = Buffer.from(await le.convert(r, "sfnt")), a = A(i), o = { source: e };
486
+ for (let n of t) St({
469
487
  decompressed: o,
470
488
  sfnt: i,
471
489
  format: n,
@@ -473,28 +491,28 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
473
491
  source: e
474
492
  });
475
493
  return o;
476
- }, Ct = async (e, t) => {
477
- yt(t), vt(e);
478
- let n = rt(t.formats), r = await Promise.all(e.map((e) => St(e, n, t.verbose))), i = {
494
+ }, Tt = async (e, t) => {
495
+ xt(t), bt(e);
496
+ let n = at(t.formats), r = await Promise.all(e.map((e) => wt(e, n, t.verbose))), i = {
479
497
  config: { ...t },
480
498
  decompressedFonts: r
481
499
  };
482
500
  return r.length === 1 && (i.ttf = r[0].ttf, i.otf = r[0].otf), i;
483
501
  };
484
- })), Tt, Et = r((() => {
485
- Tt = ue;
486
- })), Dt, Ot, kt, At = r((() => {
487
- Dt = (e) => ({
502
+ })), Dt, Ot = r((() => {
503
+ Dt = de;
504
+ })), kt, At, jt, Mt = r((() => {
505
+ kt = (e) => ({
488
506
  prependUnicode: !!e.prependUnicode,
489
507
  startUnicode: Number(e.startUnicode)
490
- }), Ot = (e) => {
508
+ }), At = (e) => {
491
509
  if (e == null) return;
492
510
  if (typeof e == "number") return Number.isFinite(e) ? e : void 0;
493
511
  let t = e.trim();
494
512
  if (t.length === 0) return;
495
513
  let n = Number(t);
496
514
  if (Number.isFinite(n)) return n;
497
- }, kt = (e) => ({
515
+ }, jt = (e) => ({
498
516
  ascent: e.ascent,
499
517
  centerHorizontally: e.centerHorizontally,
500
518
  centerVertically: e.centerVertically,
@@ -507,14 +525,14 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
507
525
  fontWeight: e.fontWeight,
508
526
  metadata: e.metadata,
509
527
  normalize: e.normalize,
510
- round: Ot(e.round)
528
+ round: At(e.round)
511
529
  });
512
- })), jt, Mt, Nt, Pt = r((() => {
513
- Et(), At(), jt = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], Mt = (e) => ({
530
+ })), Nt, Pt, Ft, It = r((() => {
531
+ Ot(), Mt(), Nt = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], Pt = (e) => ({
514
532
  name: e.name,
515
- unicode: jt(e.unicode)
516
- }), Nt = (e, t) => {
517
- let n = t.metadataProvider || pe(Dt(t)), r = new le.Parser(), i = Tt(t.maxConcurrency);
533
+ unicode: Nt(e.unicode)
534
+ }), Ft = (e, t) => {
535
+ let n = t.metadataProvider || me(kt(t)), r = new ue.Parser(), i = Dt(t.maxConcurrency);
518
536
  return Promise.all(e.map((e) => i(() => new Promise((t, n) => {
519
537
  let i = u(e), a = "";
520
538
  i.on("error", (e) => n(e)).on("data", (e) => {
@@ -525,20 +543,20 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
525
543
  })));
526
544
  })))).then((e) => {
527
545
  let r = e;
528
- t.sort && (r = e.sort((e, t) => fe(e.srcPath, t.srcPath)));
546
+ t.sort && (r = e.sort((e, t) => pe(e.srcPath, t.srcPath)));
529
547
  let { ligatures: i } = t;
530
548
  return Promise.all(r.map((e) => new Promise((t, r) => {
531
549
  n(e.srcPath, (n, a) => {
532
550
  if (n) return r(n);
533
551
  if (!a) return r(/* @__PURE__ */ Error(`Missing metadata for ${e.srcPath}`));
534
- let o = Mt(a);
552
+ let o = Pt(a);
535
553
  return i && o.unicode.push(a.name.replace(/-/gu, "_")), e.metadata = o, t(e);
536
554
  });
537
555
  })));
538
556
  });
539
557
  };
540
- })), Ft, It = r((() => {
541
- Ft = () => ({
558
+ })), Lt, Rt = r((() => {
559
+ Lt = () => ({
542
560
  centerHorizontally: !1,
543
561
  centerVertically: !1,
544
562
  descent: 0,
@@ -572,16 +590,16 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
572
590
  unicodeRange: !1,
573
591
  verbose: !1
574
592
  });
575
- })), Lt, Rt = r((() => {
576
- It(), Lt = (e) => {
593
+ })), zt, Bt = r((() => {
594
+ Rt(), zt = (e) => {
577
595
  if (!e?.files) throw Error("You must pass webfont a `files` glob");
578
596
  return {
579
- ...Ft(),
597
+ ...Lt(),
580
598
  ...e
581
599
  };
582
600
  };
583
- })), zt, Bt, Vt, Ht = r((() => {
584
- zt = () => ({
601
+ })), Vt, Ht, Ut, Wt = r((() => {
602
+ Vt = () => ({
585
603
  multipass: !1,
586
604
  plugins: [
587
605
  "removeDoctype",
@@ -593,54 +611,54 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
593
611
  "cleanupAttrs",
594
612
  "removeUnusedNS"
595
613
  ]
596
- }), Bt = (e) => {
597
- let t = zt();
614
+ }), Ht = (e) => {
615
+ let t = Vt();
598
616
  return e ? {
599
617
  ...t,
600
618
  ...e,
601
619
  plugins: e.plugins ?? t.plugins
602
620
  } : t;
603
- }, Vt = (e, t, n) => he(e, {
604
- ...Bt(n),
621
+ }, Ut = (e, t, n) => ge(e, {
622
+ ...Ht(n),
605
623
  path: t
606
624
  }).data;
607
- })), Ut, Wt = r((() => {
608
- Ht(), Ut = (e, t) => e.map((e) => ({
625
+ })), Gt, Kt = r((() => {
626
+ Wt(), Gt = (e, t) => e.map((e) => ({
609
627
  ...e,
610
- contents: Vt(e.contents, e.srcPath, t)
628
+ contents: Ut(e.contents, e.srcPath, t)
611
629
  }));
612
- })), Gt, Kt, qt = r((() => {
613
- Gt = (e, t) => t && e > 2e3, Kt = (e) => `Warning: ${e} glyphs with ligatures enabled may cause severe browser slowdown or hangs (especially Firefox on Windows). Ligatures are off by default; enable only if needed: --ligatures or ligatures: true. See TROUBLESHOOTING.md and https://github.com/itgalaxy/webfont/issues/558`;
614
- })), Jt, Yt, Xt, Zt, Qt, $t, en, tn = r((() => {
615
- Jt = /<glyph\b([^>/]*)(?:\/>|>)/giu, Yt = /\bglyph-name=["']([^"']+)["']/iu, Xt = /\bd=["']([^"']*)["']/iu, Zt = (e) => {
630
+ })), qt, Jt, Yt = r((() => {
631
+ qt = (e, t) => t && e > 2e3, Jt = (e) => `Warning: ${e} glyphs with ligatures enabled may cause severe browser slowdown or hangs (especially Firefox on Windows). Ligatures are off by default; enable only if needed: --ligatures or ligatures: true. See TROUBLESHOOTING.md and https://github.com/itgalaxy/webfont/issues/558`;
632
+ })), Xt, Zt, Qt, $t, en, tn, nn, rn = r((() => {
633
+ Xt = /<glyph\b([^>/]*)(?:\/>|>)/giu, Zt = /\bglyph-name=["']([^"']+)["']/iu, Qt = /\bd=["']([^"']*)["']/iu, $t = (e) => {
616
634
  let t = [];
617
- for (let n of e.matchAll(Jt)) {
618
- let e = n[1] ?? "", r = Yt.exec(e);
619
- r && (Xt.exec(e)?.[1] ?? "").trim().length === 0 && t.push(r[1]);
635
+ for (let n of e.matchAll(Xt)) {
636
+ let e = n[1] ?? "", r = Zt.exec(e);
637
+ r && (Qt.exec(e)?.[1] ?? "").trim().length === 0 && t.push(r[1]);
620
638
  }
621
639
  return t;
622
- }, Qt = (e, t) => {
640
+ }, en = (e, t) => {
623
641
  for (let n of t) {
624
642
  let t = n.metadata?.name;
625
643
  if (t && (e === t || e.startsWith(`${t}-`))) return n.srcPath;
626
644
  }
627
- }, $t = (e, t) => {
645
+ }, tn = (e, t) => {
628
646
  let n = /* @__PURE__ */ new Set(), r = [];
629
647
  for (let i of e) {
630
- let e = Qt(i, t), a = e ?? i;
648
+ let e = en(i, t), a = e ?? i;
631
649
  n.has(a) || (n.add(a), e ? r.push(`${i} (${e})`) : r.push(i));
632
650
  }
633
651
  return r.join("; ");
634
- }, en = (e, t) => {
635
- let n = Zt(e);
652
+ }, nn = (e, t) => {
653
+ let n = $t(e);
636
654
  if (n.length === 0) return;
637
- let r = $t(n, t);
655
+ let r = tn(n, t);
638
656
  throw Error(`Empty glyph path(s) in SVG font output for: ${r}. Stroke-only SVGs (fill="none" with stroke) often produce empty glyphs because svgicons2svgfont does not convert strokes. Convert strokes to filled paths in your design tool, preprocess with glyphContentTransformFn (for example svg-outline-stroke), or run with --svg-diagnose for compatibility warnings. See TROUBLESHOOTING.md ("Stroke-only SVGs produce blank icons").`);
639
657
  };
640
- })), nn, rn, an = r((() => {
641
- nn = /fill-rule\s*:\s*evenodd|fill-rule\s*=\s*["']evenodd["']/iu, rn = (e) => nn.test(e);
642
- })), on, sn, cn, ln, un, dn, fn, U, pn, mn, hn, gn = r((() => {
643
- an(), on = /\bstroke\s*=|\bstroke\s*:/iu, sn = /fill\s*=\s*["']none["']|fill\s*:\s*none/iu, cn = /<(line|polyline|clipPath)\b/iu, ln = /<use\b/iu, un = (e) => on.test(e) ? sn.test(e) : !1, dn = (e) => cn.test(e), fn = (e) => ln.test(e), U = (e, t) => {
658
+ })), an, on, sn = r((() => {
659
+ an = /fill-rule\s*:\s*evenodd|fill-rule\s*=\s*["']evenodd["']/iu, on = (e) => an.test(e);
660
+ })), cn, ln, un, dn, fn, pn, mn, W, hn, gn, _n, vn = r((() => {
661
+ sn(), cn = /\bstroke\s*=|\bstroke\s*:/iu, ln = /fill\s*=\s*["']none["']|fill\s*:\s*none/iu, un = /<(line|polyline|clipPath)\b/iu, dn = /<use\b/iu, fn = (e) => cn.test(e) ? ln.test(e) : !1, pn = (e) => un.test(e), mn = (e) => dn.test(e), W = (e, t) => {
644
662
  switch (e) {
645
663
  case "evenodd-fill-rule": return `[webfont:diagnose] ${t} uses fill-rule: evenodd. Icon fonts render glyphs with the nonzero fill rule, so holes and counter-shapes can disappear. See TROUBLESHOOTING.md ("Icon details missing after export").`;
646
664
  case "stroke-only": return `[webfont:diagnose] ${t} uses stroke-based paths (fill="none"). svgicons2svgfont ignores stroke; outlines may render as solid shapes or lose detail. Preprocess with glyphContentTransformFn (for example svg-outline-stroke) before conversion. See TROUBLESHOOTING.md ("Icon details missing after export").`;
@@ -648,36 +666,36 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
648
666
  case "use-reference": return `[webfont:diagnose] ${t} contains <use> (symbol/instance references). svgicons2svgfont does not resolve <use> or apply transform on references — the glyph may be empty or wrong. Flatten to paths in your editor, or preprocess with SVGO / glyphContentTransformFn before conversion. See TROUBLESHOOTING.md ("SVG transform and <use> references", #612).`;
649
667
  default: return e;
650
668
  }
651
- }, pn = (e, t) => {
669
+ }, hn = (e, t) => {
652
670
  let n = [];
653
- return rn(t) && n.push({
671
+ return on(t) && n.push({
654
672
  code: "evenodd-fill-rule",
655
- message: U("evenodd-fill-rule", e),
673
+ message: W("evenodd-fill-rule", e),
656
674
  srcPath: e
657
- }), un(t) && n.push({
675
+ }), fn(t) && n.push({
658
676
  code: "stroke-only",
659
- message: U("stroke-only", e),
677
+ message: W("stroke-only", e),
660
678
  srcPath: e
661
- }), dn(t) && n.push({
679
+ }), pn(t) && n.push({
662
680
  code: "unsupported-element",
663
- message: U("unsupported-element", e),
681
+ message: W("unsupported-element", e),
664
682
  srcPath: e
665
- }), fn(t) && n.push({
683
+ }), mn(t) && n.push({
666
684
  code: "use-reference",
667
- message: U("use-reference", e),
685
+ message: W("use-reference", e),
668
686
  srcPath: e
669
687
  }), n;
670
- }, mn = (e) => e.flatMap((e) => pn(e.srcPath, e.contents)), hn = (e, t) => t.diagnose ? !0 : !!(t.verbose && e.code === "evenodd-fill-rule");
671
- })), _n, vn = r((() => {
672
- _n = (e) => {
688
+ }, gn = (e) => e.flatMap((e) => hn(e.srcPath, e.contents)), _n = (e, t) => t.diagnose ? !0 : !!(t.verbose && e.code === "evenodd-fill-rule");
689
+ })), yn, bn = r((() => {
690
+ yn = (e) => {
673
691
  if (!e || !e.diagnose) return;
674
692
  let t = { diagnose: !0 };
675
693
  return e.onMessage && (t.onMessage = e.onMessage), t;
676
694
  };
677
- })), yn, bn = r((() => {
678
- gn(), vn(), yn = (e, t, n = {}) => {
679
- let r = _n(t), i = mn(e), { reporter: a, verbose: o = !1 } = n;
680
- for (let e of i) hn(e, {
695
+ })), xn, Sn = r((() => {
696
+ vn(), bn(), xn = (e, t, n = {}) => {
697
+ let r = yn(t), i = gn(e), { reporter: a, verbose: o = !1 } = n;
698
+ for (let e of i) _n(e, {
681
699
  diagnose: r?.diagnose,
682
700
  verbose: o
683
701
  }) && a?.(e.message);
@@ -687,24 +705,24 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
687
705
  glyphs: e
688
706
  };
689
707
  };
690
- })), xn, Sn = r((() => {
691
- bn(), xn = (e, t, n = {}) => {
692
- let { diagnostics: r, glyphs: i } = yn(e, t, n);
708
+ })), Cn, wn = r((() => {
709
+ Sn(), Cn = (e, t, n = {}) => {
710
+ let { diagnostics: r, glyphs: i } = xn(e, t, n);
693
711
  return {
694
712
  diagnostics: r,
695
713
  glyphs: i
696
714
  };
697
715
  };
698
- })), Cn, wn = r((() => {
699
- At(), Cn = (e, t) => {
716
+ })), Tn, En = r((() => {
717
+ Mt(), Tn = (e, t) => {
700
718
  let n = "";
701
719
  return new Promise((r, i) => {
702
720
  t.verbose && console.log("Generating SVG font...");
703
- let a = new de(kt(t)).on("finish", () => r(n)).on("data", (e) => {
721
+ let a = new fe(jt(t)).on("finish", () => r(n)).on("data", (e) => {
704
722
  n += e;
705
723
  }).on("error", (e) => i(e));
706
724
  e.forEach((e) => {
707
- let t = new ge();
725
+ let t = new _e();
708
726
  t.push(e.contents), t.push(null), t.metadata = e.metadata ?? {
709
727
  name: "",
710
728
  unicode: []
@@ -712,10 +730,10 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
712
730
  }), a.end();
713
731
  });
714
732
  };
715
- })), Tn, En = r((() => {
716
- Tn = (e, t = {}) => Buffer.from(_e(e, t).buffer);
717
- })), Dn, On, kn, An, jn = r((() => {
718
- Wt(), qt(), tn(), Sn(), Ze(), wn(), En(), Dn = (e) => j(e), On = (e, t) => M(e, t), kn = (e) => N(e), An = async (e, t) => {
733
+ })), Dn, On = r((() => {
734
+ Dn = (e, t = {}) => Buffer.from(ve(e, t).buffer);
735
+ })), kn, An, jn, Mn, Nn = r((() => {
736
+ Kt(), Yt(), rn(), wn(), $e(), En(), On(), kn = (e) => j(e), An = (e, t) => M(e, t), jn = (e) => N(e), Mn = async (e, t) => {
719
737
  let n = (e) => {
720
738
  if (t.svgTools?.onMessage) {
721
739
  t.svgTools.onMessage(e);
@@ -724,11 +742,11 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
724
742
  (t.svgTools?.diagnose || t.verbose) && console.log(e);
725
743
  }, r = !!(t.svgTools?.onMessage || t.svgTools?.diagnose || t.verbose), i;
726
744
  r && (i = n);
727
- let { diagnostics: a, glyphs: o } = xn(e, t.svgTools, {
745
+ let { diagnostics: a, glyphs: o } = Cn(e, t.svgTools, {
728
746
  reporter: i,
729
747
  verbose: t.verbose
730
748
  }), s = o;
731
- if (t.optimizeSvg && (s = Ut(s, t.svgoConfig)), t.glyphContentTransformFn) {
749
+ if (t.optimizeSvg && (s = Gt(s, t.svgoConfig)), t.glyphContentTransformFn) {
732
750
  let e = t.glyphContentTransformFn;
733
751
  s = await Promise.all(s.map(async (t) => {
734
752
  let n = await e(t);
@@ -751,12 +769,12 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
751
769
  };
752
770
  }));
753
771
  }
754
- Gt(s.length, t.ligatures) && console.log(Kt(s.length));
772
+ qt(s.length, t.ligatures) && console.log(Jt(s.length));
755
773
  let c = {};
756
774
  t.formatsOptions?.ttf && (c = t.formatsOptions.ttf);
757
- let l = await Cn(s, t);
758
- en(l, s);
759
- let u = Tn(l, c);
775
+ let l = await Tn(s, t);
776
+ nn(l, s);
777
+ let u = Dn(l, c);
760
778
  if (t.ttfPostProcess) {
761
779
  let e = await t.ttfPostProcess(u, {
762
780
  fontName: t.fontName,
@@ -767,50 +785,50 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
767
785
  let d = {
768
786
  config: t,
769
787
  glyphsData: s,
770
- hash: me.createHash("md5").update(l).digest("hex"),
788
+ hash: he.createHash("md5").update(l).digest("hex"),
771
789
  svg: l,
772
790
  ttf: u
773
791
  };
774
792
  a.length > 0 && (d.svgDiagnostics = a);
775
793
  let { formats: f } = t;
776
- if (f.includes("eot") && (d.eot = Dn(u)), f.includes("woff")) {
794
+ if (f.includes("eot") && (d.eot = kn(u)), f.includes("woff")) {
777
795
  let e;
778
- typeof t.metadata == "string" && (e = t.metadata), d.woff = On(u, { metadata: e });
796
+ typeof t.metadata == "string" && (e = t.metadata), d.woff = An(u, { metadata: e });
779
797
  }
780
- if (f.includes("woff2") && (d.woff2 = Buffer.from(await kn(u))), t.template) {
798
+ if (f.includes("woff2") && (d.woff2 = Buffer.from(await jn(u))), t.template) {
781
799
  let { renderTemplates: e } = await import("./renderTemplates-CXVKq3Op.mjs"), { templates: n, usedBuildInTemplate: r } = e(t, d, f);
782
800
  n.length > 0 && (d.templates = n, d.template = n[0]?.content, d.usedBuildInTemplate = r);
783
801
  }
784
802
  return f.includes("svg") || delete d.svg, f.includes("ttf") || delete d.ttf, f.includes("otf") || delete d.otf, d;
785
803
  };
786
- })), W, Mn, G, K, Nn, Pn = r((() => {
787
- W = /* @__PURE__ */ new Set([
804
+ })), G, Pn, K, q, Fn, In = r((() => {
805
+ G = /* @__PURE__ */ new Set([
788
806
  "eot",
789
807
  "otf",
790
808
  "svg",
791
809
  "ttf",
792
810
  "woff",
793
811
  "woff2"
794
- ]), Mn = [...W].join(", "), G = (e) => {
795
- if (typeof e != "string" || !W.has(e)) throw Error(`Invalid format "${String(e)}". Expected one of: ${Mn}`);
812
+ ]), Pn = [...G].join(", "), K = (e) => {
813
+ if (typeof e != "string" || !G.has(e)) throw Error(`Invalid format "${String(e)}". Expected one of: ${Pn}`);
796
814
  return e;
797
- }, K = (e) => {
815
+ }, q = (e) => {
798
816
  if (e.length === 0) throw Error("formats must not be empty");
799
- return e.map(G);
800
- }, Nn = (e) => {
817
+ return e.map(K);
818
+ }, Fn = (e) => {
801
819
  if (!Array.isArray(e)) throw Error("formats must be an array of format names (e.g. [\"woff2\", \"svg\"])");
802
- return K(e);
820
+ return q(e);
803
821
  };
804
- })), q, Fn, J, In, Ln, Rn, zn = r((() => {
805
- Pn(), o(), q = (e, t) => {
822
+ })), J, Ln, Y, Rn, zn, Bn, Vn = r((() => {
823
+ In(), o(), J = (e, t) => {
806
824
  if (t !== void 0 && typeof t != "string") throw Error(`${e} must be a string`);
807
- }, Fn = (e, t) => {
825
+ }, Ln = (e, t) => {
808
826
  if (t !== void 0 && typeof t != "boolean" && typeof t != "string") throw Error(`${e} must be a boolean or string`);
809
- }, J = (e, t) => {
827
+ }, Y = (e, t) => {
810
828
  if (t !== void 0 && typeof t != "boolean") throw Error(`${e} must be a boolean`);
811
- }, In = (e, t) => {
829
+ }, Rn = (e, t) => {
812
830
  if (t !== void 0 && (typeof t != "object" || !t || Array.isArray(t))) throw Error(`${e} must be an object`);
813
- }, Ln = (e) => {
831
+ }, zn = (e) => {
814
832
  if (typeof e == "string") {
815
833
  if (e.length === 0) throw Error("files must not be empty");
816
834
  return;
@@ -821,52 +839,52 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
821
839
  return;
822
840
  }
823
841
  throw Error("files must be a string or an array of strings");
824
- }, Rn = (e) => (Ln(e.files), e.formats = Nn(e.formats), q("fontName", e.fontName), Fn("unicodeRange", e.unicodeRange), J("optimizeSvg", e.optimizeSvg), In("svgoConfig", e.svgoConfig), J("templateFontLigatures", e.templateFontLigatures), e.template !== void 0 && i(e.template), q("templateFontPath", e.templateFontPath), e);
825
- })), Bn, Y, Vn, Hn, Un = r((() => {
826
- We(), ut(), wt(), Pt(), H(), Rt(), jn(), zn(), Bn = (e) => "filepath" in e, Y = async (e) => {
842
+ }, Bn = (e) => (zn(e.files), e.formats = Fn(e.formats), J("fontName", e.fontName), Ln("unicodeRange", e.unicodeRange), Y("optimizeSvg", e.optimizeSvg), Rn("svgoConfig", e.svgoConfig), Y("templateFontLigatures", e.templateFontLigatures), e.template !== void 0 && i(e.template), J("templateFontPath", e.templateFontPath), e);
843
+ })), Hn, X, Un, Wn, Gn = r((() => {
844
+ Ge(), ft(), Et(), It(), H(), Bt(), Nn(), Vn(), Hn = (e) => "filepath" in e, X = async (e) => {
827
845
  let t = ne("webfont", { searchStrategy: "global" });
828
846
  if (e.configFile) {
829
847
  let n = f.resolve(process.cwd(), e.configFile);
830
848
  return await t.load(n) ?? {};
831
849
  }
832
850
  return await t.search(process.cwd()) ?? {};
833
- }, Vn = Y, Hn = async (e) => {
834
- let t = Lt(e);
851
+ }, Un = X, Wn = async (e) => {
852
+ let t = zt(e);
835
853
  delete t.filePath;
836
- let n = await Y({ configFile: t.configFile }), r;
837
- Bn(n) && (t = re(t, n.config, { arrayMerge: (e, t) => t }), r = n.filepath), t = Rn(t);
854
+ let n = await X({ configFile: t.configFile }), r;
855
+ Hn(n) && (t = re(t, n.config, { arrayMerge: (e, t) => t }), r = n.filepath), t = Bn(t);
838
856
  let i;
839
857
  i = Array.isArray(t.files) ? t.files : [t.files];
840
- let a = await Ue(i), o = $e(a);
858
+ let a = await We(i), o = tt(a);
841
859
  if (o === "mixed") throw Error("Cannot mix SVG icons, TTF fonts, and WOFF/WOFF2 files in the same run");
842
860
  if (o === "empty") throw Error("Files glob patterns specified did not match any supported files");
843
861
  if (o === "webfont") {
844
- let e = await Ct(V(a, o), t);
862
+ let e = await Tt(V(a, o), t);
845
863
  return r && (e.config = {
846
864
  ...t,
847
865
  filePath: r
848
866
  }), e;
849
867
  }
850
868
  if (o === "ttf") {
851
- let e = await lt(V(a, o), t);
869
+ let e = await dt(V(a, o), t);
852
870
  return r && (e.config = {
853
871
  ...t,
854
872
  filePath: r
855
873
  }), e;
856
874
  }
857
- et(t.formats);
858
- let s = await An(await Nt(V(a, "svg"), t), t);
875
+ nt(t.formats);
876
+ let s = await Mn(await Ft(V(a, "svg"), t), t);
859
877
  return r ? s.config = {
860
878
  ...t,
861
879
  filePath: r
862
880
  } : s.config = t, s;
863
881
  };
864
- })), Wn, Gn = r((() => {
865
- Wn = (e) => {
882
+ })), Kn, qn = r((() => {
883
+ Kn = (e) => {
866
884
  if (e.svgDiagnose) return { diagnose: !0 };
867
885
  };
868
- })), Kn, qn = r((() => {
869
- Pn(), Kn = (e) => {
886
+ })), Jn, Yn = r((() => {
887
+ In(), Jn = (e) => {
870
888
  if (e === void 0) return;
871
889
  let t = e.trim();
872
890
  if (t.length === 0) throw Error("formats must not be empty");
@@ -878,12 +896,12 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
878
896
  throw Error("formats must be a JSON array (e.g. [\"woff2\",\"svg\"]) or comma-separated list");
879
897
  }
880
898
  if (!Array.isArray(e)) throw Error("formats must be a JSON array (e.g. [\"woff2\",\"svg\"]) or comma-separated list");
881
- return K(e);
899
+ return q(e);
882
900
  }
883
- return t.split(",").map((e) => e.trim()).filter((e) => e.length > 0).map(G);
901
+ return t.split(",").map((e) => e.trim()).filter((e) => e.length > 0).map(K);
884
902
  };
885
- })), Jn, Yn = r((() => {
886
- o(), Jn = (e) => {
903
+ })), Xn, Zn = r((() => {
904
+ o(), Xn = (e) => {
887
905
  if (e === void 0) return;
888
906
  let t = e.trim();
889
907
  if (t.length === 0) throw Error("template must not be empty");
@@ -899,16 +917,16 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
899
917
  }
900
918
  return t.includes(",") ? i(t.split(",").map((e) => e.trim()).filter((e) => e.length > 0)) : t;
901
919
  };
902
- })), Xn, X, Zn = r((() => {
903
- Un(), Xn = (e) => {
920
+ })), Qn, $n, er = r((() => {
921
+ Gn(), Qn = (e) => {
904
922
  if (!(!("config" in e) || e.config?.files === void 0)) return Array.isArray(e.config.files) ? e.config.files : [e.config.files];
905
- }, X = async (e, t) => {
906
- let n = await Vn({ configFile: t.configFile }), r = Xn(n);
923
+ }, $n = async (e, t) => {
924
+ let n = await Un({ configFile: t.configFile }), r = Qn(n);
907
925
  if (e.input.length > 0 && r !== void 0) throw Error("Cannot specify input files on the command line when `files` is set in the config file");
908
926
  return e.input.length > 0 ? e.input : r === void 0 ? [] : r;
909
927
  };
910
- })), Qn, $n, Z, er, Q, tr, nr, rr, ir, ar, or, $, sr, cr, lr, ur, dr, fr, pr, mr = r((() => {
911
- We(), Un(), Gn(), qn(), Yn(), Zn(), Qn = [
928
+ })), tr, nr, Z, rr, Q, ir, ar, or, sr, cr, lr, $, ur, dr, fr, pr, mr, hr, gr, _r = r((() => {
929
+ Ge(), Gn(), qn(), Yn(), Zn(), er(), tr = [
912
930
  "svg",
913
931
  "ttf",
914
932
  "otf",
@@ -917,37 +935,37 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
917
935
  "woff2",
918
936
  "hash",
919
937
  "template"
920
- ], $n = (e) => {
938
+ ], nr = (e) => {
921
939
  let t = {};
922
- typeof e.flags.config == "string" && (t.configFile = ee.silent(process.cwd(), e.flags.config) || d.join(process.cwd(), e.flags.config)), e.flags.fontName && (t.fontName = e.flags.fontName), e.flags.formats && (t.formats = Kn(e.flags.formats)), e.flags.dest && (t.dest = e.flags.dest), e.flags.destCreate && (t.destCreate = e.flags.destCreate), e.flags.template && (t.template = Jn(e.flags.template)), e.flags.templateClassName && (t.templateClassName = e.flags.templateClassName), e.flags.templateFontPath && (t.templateFontPath = e.flags.templateFontPath), e.flags.templateFontName && (t.templateFontName = e.flags.templateFontName), e.flags.templateCacheString && (t.templateCacheString = e.flags.templateCacheString), e.flags.destTemplate && (t.destTemplate = e.flags.destTemplate), e.flags.verbose && (t.verbose = e.flags.verbose), e.flags.fontId && (t.fontId = e.flags.fontId), e.flags.fontStyle && (t.fontStyle = e.flags.fontStyle), e.flags.fontWeight && (t.fontWeight = e.flags.fontWeight), e.flags.fixedWidth && (t.fixedWidth = e.flags.fixedWidth), e.flags.centerHorizontally && (t.centerHorizontally = e.flags.centerHorizontally), e.flags.centerVertically && (t.centerVertically = e.flags.centerVertically), e.flags.normalize && (t.normalize = e.flags.normalize), e.flags.optimizeSvg && (t.optimizeSvg = e.flags.optimizeSvg), e.flags.fontHeight && (t.fontHeight = e.flags.fontHeight), e.flags.round && (t.round = e.flags.round), e.flags.descent && (t.descent = e.flags.descent), e.flags.ascent && (t.ascent = e.flags.ascent), e.flags.startUnicode && (t.startUnicode = e.flags.startUnicode), e.flags.prependUnicode && (t.prependUnicode = e.flags.prependUnicode), e.flags.metadata && (t.metadata = e.flags.metadata), e.flags.sort === !1 && (t.sort = e.flags.sort), e.flags.ligatures && (t.ligatures = e.flags.ligatures), e.flags.unicodeRange && (t.unicodeRange = e.flags.unicodeRange), e.flags.templateFontLigatures === !1 && (t.templateFontLigatures = e.flags.templateFontLigatures), e.flags.addHashInFontUrl && (t.addHashInFontUrl = e.flags.addHashInFontUrl);
923
- let n = Wn(e.flags);
940
+ typeof e.flags.config == "string" && (t.configFile = ee.silent(process.cwd(), e.flags.config) || d.join(process.cwd(), e.flags.config)), e.flags.fontName && (t.fontName = e.flags.fontName), e.flags.formats && (t.formats = Jn(e.flags.formats)), e.flags.dest && (t.dest = e.flags.dest), e.flags.destCreate && (t.destCreate = e.flags.destCreate), e.flags.template && (t.template = Xn(e.flags.template)), e.flags.templateClassName && (t.templateClassName = e.flags.templateClassName), e.flags.templateFontPath && (t.templateFontPath = e.flags.templateFontPath), e.flags.templateFontName && (t.templateFontName = e.flags.templateFontName), e.flags.templateCacheString && (t.templateCacheString = e.flags.templateCacheString), e.flags.destTemplate && (t.destTemplate = e.flags.destTemplate), e.flags.verbose && (t.verbose = e.flags.verbose), e.flags.fontId && (t.fontId = e.flags.fontId), e.flags.fontStyle && (t.fontStyle = e.flags.fontStyle), e.flags.fontWeight && (t.fontWeight = e.flags.fontWeight), e.flags.fixedWidth && (t.fixedWidth = e.flags.fixedWidth), e.flags.centerHorizontally && (t.centerHorizontally = e.flags.centerHorizontally), e.flags.centerVertically && (t.centerVertically = e.flags.centerVertically), e.flags.normalize && (t.normalize = e.flags.normalize), e.flags.optimizeSvg && (t.optimizeSvg = e.flags.optimizeSvg), e.flags.fontHeight && (t.fontHeight = e.flags.fontHeight), e.flags.round && (t.round = e.flags.round), e.flags.descent && (t.descent = e.flags.descent), e.flags.ascent && (t.ascent = e.flags.ascent), e.flags.startUnicode && (t.startUnicode = e.flags.startUnicode), e.flags.prependUnicode && (t.prependUnicode = e.flags.prependUnicode), e.flags.metadata && (t.metadata = e.flags.metadata), e.flags.sort === !1 && (t.sort = e.flags.sort), e.flags.ligatures && (t.ligatures = e.flags.ligatures), e.flags.unicodeRange && (t.unicodeRange = e.flags.unicodeRange), e.flags.templateFontLigatures === !1 && (t.templateFontLigatures = e.flags.templateFontLigatures), e.flags.addHashInFontUrl && (t.addHashInFontUrl = e.flags.addHashInFontUrl);
941
+ let n = Kn(e.flags);
924
942
  return n && (t.svgTools = n), t;
925
943
  }, Z = (e) => {
926
944
  if (!e.config) throw Error("Missing config in webfont result");
927
945
  return e.config;
928
- }, er = (e, t) => (e.config = {
946
+ }, rr = (e, t) => (e.config = {
929
947
  ...Z(e),
930
948
  dest: t.dest,
931
949
  destTemplate: t.destTemplate
932
950
  }, e), Q = (e, t, n) => {
933
951
  let r = t.dest ?? process.cwd();
934
952
  return typeof t.destTemplate == "string" && (r = t.destTemplate), n ? d.join(r, `${t.fontName}.${e}`) : d.join(r, d.basename(e).replace(".njk", ""));
935
- }, tr = (e) => Array.isArray(e) ? e[0] : e, nr = (e, t) => {
953
+ }, ir = (e) => Array.isArray(e) ? e[0] : e, ar = (e, t) => {
936
954
  if (!e.template) return;
937
- let n = tr(t.template);
955
+ let n = ir(t.template);
938
956
  if (e.usedBuildInTemplate && n) return Q(n, t, !0);
939
957
  if (n) return Q(n, t, !1);
940
958
  let r = t.dest ?? process.cwd();
941
959
  return typeof t.destTemplate == "string" ? t.destTemplate : r;
942
- }, rr = async (e, t) => {
960
+ }, or = async (e, t) => {
943
961
  await Promise.all(e.map(async (e) => {
944
962
  let n = d.resolve(Q(e.template, t, !!e.builtIn));
945
963
  await l.promises.mkdir(d.dirname(n), { recursive: !0 }), await l.promises.writeFile(n, e.content);
946
964
  }));
947
- }, ir = (e, t, n, r) => {
965
+ }, sr = (e, t, n, r) => {
948
966
  let i = n.fontName, a = n.dest ?? process.cwd();
949
967
  return e === "template" ? d.resolve(r ?? a) : e === "hash" ? d.resolve(d.join(a, `${i}.hash`)) : d.resolve(d.join(a, `${i}.${e}`));
950
- }, ar = (e) => /* @__PURE__ */ Error(`Destination directory "${e}" does not exist. Use --dest-create (-m) to create it.`), or = async (e, t) => {
968
+ }, cr = (e) => /* @__PURE__ */ Error(`Destination directory "${e}" does not exist. Use --dest-create (-m) to create it.`), lr = async (e, t) => {
951
969
  try {
952
970
  await l.promises.access(e, l.constants.F_OK);
953
971
  } catch {
@@ -955,42 +973,42 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
955
973
  await l.promises.mkdir(e, { recursive: !0 });
956
974
  return;
957
975
  }
958
- throw ar(e);
976
+ throw cr(e);
959
977
  }
960
- }, $ = (e, t, n) => e.length === 1 && n.fontName ? n.fontName : He(e.map((e) => e.source))[e.indexOf(t)] ?? n.fontName, sr = async (e, t, n) => {
978
+ }, $ = (e, t, n) => e.length === 1 && n.fontName ? n.fontName : Ue(e.map((e) => e.source))[e.indexOf(t)] ?? n.fontName, ur = async (e, t, n) => {
961
979
  await Promise.all(e.flatMap((r) => {
962
980
  let i = $(e, r, t), a = [];
963
981
  return r.ttf && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.ttf`)), r.ttf)), r.otf && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.otf`)), r.otf)), a;
964
982
  }));
965
- }, cr = (e, t, n) => $(e, t, n), lr = async (e, t, n) => {
983
+ }, dr = (e, t, n) => $(e, t, n), fr = async (e, t, n) => {
966
984
  await Promise.all(e.flatMap((r) => {
967
- let i = cr(e, r, t), a = [];
968
- return r.ttf && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.ttf`)), r.ttf)), r.eot && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.eot`)), r.eot)), r.woff && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.woff`)), r.woff)), r.woff2 && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.woff2`)), r.woff2)), a;
985
+ let i = dr(e, r, t), a = [];
986
+ return r.svg && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.svg`)), r.svg)), r.ttf && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.ttf`)), r.ttf)), r.eot && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.eot`)), r.eot)), r.woff && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.woff`)), r.woff)), r.woff2 && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.woff2`)), r.woff2)), a;
969
987
  }));
970
- }, ur = async (e) => {
971
- let t = Z(e), n = t.dest ?? process.cwd(), r = nr(e, t);
972
- return e.template && delete e.hash, await or(n, t.destCreate), e.templates && e.templates.length > 0 && await rr(e.templates, t), e.transcodedFonts && e.transcodedFonts.length > 1 ? (await lr(e.transcodedFonts, t, n), e) : e.decompressedFonts && e.decompressedFonts.length > 1 ? (await sr(e.decompressedFonts, t, n), e) : (await Promise.all(Qn.filter((t) => t === "template" && e.templates && e.templates.length > 0 ? !1 : e[t] !== void 0).map(async (n) => {
988
+ }, pr = async (e) => {
989
+ let t = Z(e), n = t.dest ?? process.cwd(), r = ar(e, t);
990
+ return e.template && delete e.hash, await lr(n, t.destCreate), e.templates && e.templates.length > 0 && await or(e.templates, t), e.transcodedFonts && e.transcodedFonts.length > 1 ? (await fr(e.transcodedFonts, t, n), e) : e.decompressedFonts && e.decompressedFonts.length > 1 ? (await ur(e.decompressedFonts, t, n), e) : (await Promise.all(tr.filter((t) => t === "template" && e.templates && e.templates.length > 0 ? !1 : e[t] !== void 0).map(async (n) => {
973
991
  let i = e[n];
974
992
  if (i === void 0) return;
975
- let a = ir(n, e, t, r);
993
+ let a = sr(n, e, t, r);
976
994
  await l.promises.writeFile(a, i);
977
995
  })), e);
978
- }, dr = (e) => typeof e == "object" && e && "code" in e && typeof e.code == "number" ? e.code : 1, fr = (e) => {
979
- pr(e).catch((e) => {
980
- console.log(e.stack), process.exit(dr(e));
996
+ }, mr = (e) => typeof e == "object" && e && "code" in e && typeof e.code == "number" ? e.code : 1, hr = (e) => {
997
+ gr(e).catch((e) => {
998
+ console.log(e.stack), process.exit(mr(e));
981
999
  });
982
- }, pr = async (e) => {
1000
+ }, gr = async (e) => {
983
1001
  e.flags.help && e.showHelp(), e.flags.version && e.showVersion();
984
- let t = $n(e), n = await X(e, t);
1002
+ let t = nr(e), n = await $n(e, t);
985
1003
  n.length === 0 && e.showHelp();
986
1004
  let r = {
987
1005
  ...t,
988
1006
  files: n
989
- }, i = await Hn(r);
990
- return er(i, r), ur(i);
1007
+ }, i = await Wn(r);
1008
+ return rr(i, r), pr(i);
991
1009
  };
992
- })), hr = /* @__PURE__ */ a((() => {
993
- Re(), mr(), fr(Le);
1010
+ })), vr = /* @__PURE__ */ a((() => {
1011
+ ze(), _r(), hr(Re);
994
1012
  }));
995
1013
  //#endregion
996
- export default hr();
1014
+ export default vr();