@taiga-ui/icons 3.60.0 → 3.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,697 +1,551 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rollup'), require('rollup-plugin-typescript2'), require('@rollup/pluginutils'), require('svgo'), require('fs'), require('prettier'), require('path')) :
3
- typeof define === 'function' && define.amd ? define('@taiga-ui/icons/scripts', ['exports', 'rollup', 'rollup-plugin-typescript2', '@rollup/pluginutils', 'svgo', 'fs', 'prettier', 'path'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].icons = global["taiga-ui"].icons || {}, global["taiga-ui"].icons.scripts = {}), global.rollup, global.typescript, global.pluginutils, global.svgo, global.fs, global.prettier, global.path));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rollup'), require('rollup-plugin-typescript2'), require('@rollup/pluginutils'), require('svgo'), require('fs'), require('prettier'), require('path')) :
3
+ typeof define === 'function' && define.amd ? define('@taiga-ui/icons/scripts', ['exports', 'rollup', 'rollup-plugin-typescript2', '@rollup/pluginutils', 'svgo', 'fs', 'prettier', 'path'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].icons = global["taiga-ui"].icons || {}, global["taiga-ui"].icons.scripts = {}), global.rollup, global.typescript, global.pluginutils, global.svgo, global.fs, global.prettier, global.path));
5
5
  })(this, (function (exports, rollup, typescript, pluginutils, svgo, fs, prettier, path) { 'use strict';
6
6
 
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
- var typescript__default = /*#__PURE__*/_interopDefaultLegacy(typescript);
10
- var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
11
- var prettier__default = /*#__PURE__*/_interopDefaultLegacy(prettier);
9
+ var typescript__default = /*#__PURE__*/_interopDefaultLegacy(typescript);
10
+ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
11
+ var prettier__default = /*#__PURE__*/_interopDefaultLegacy(prettier);
12
12
 
13
- /******************************************************************************
14
- Copyright (c) Microsoft Corporation.
13
+ /*! *****************************************************************************
14
+ Copyright (c) Microsoft Corporation.
15
15
 
16
- Permission to use, copy, modify, and/or distribute this software for any
17
- purpose with or without fee is hereby granted.
16
+ Permission to use, copy, modify, and/or distribute this software for any
17
+ purpose with or without fee is hereby granted.
18
18
 
19
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
- PERFORMANCE OF THIS SOFTWARE.
26
- ***************************************************************************** */
27
- /* global Reflect, Promise, SuppressedError, Symbol */
28
- var extendStatics = function (d, b) {
29
- extendStatics = Object.setPrototypeOf ||
30
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
31
- function (d, b) { for (var p in b)
32
- if (Object.prototype.hasOwnProperty.call(b, p))
33
- d[p] = b[p]; };
34
- return extendStatics(d, b);
35
- };
36
- function __extends(d, b) {
37
- if (typeof b !== "function" && b !== null)
38
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
39
- extendStatics(d, b);
40
- function __() { this.constructor = d; }
41
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42
- }
43
- var __assign = function () {
44
- __assign = Object.assign || function __assign(t) {
45
- for (var s, i = 1, n = arguments.length; i < n; i++) {
46
- s = arguments[i];
47
- for (var p in s)
48
- if (Object.prototype.hasOwnProperty.call(s, p))
49
- t[p] = s[p];
50
- }
51
- return t;
52
- };
53
- return __assign.apply(this, arguments);
54
- };
55
- function __rest(s, e) {
56
- var t = {};
57
- for (var p in s)
58
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
59
- t[p] = s[p];
60
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
61
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
62
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
63
- t[p[i]] = s[p[i]];
64
- }
65
- return t;
66
- }
67
- function __decorate(decorators, target, key, desc) {
68
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
69
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
70
- r = Reflect.decorate(decorators, target, key, desc);
71
- else
72
- for (var i = decorators.length - 1; i >= 0; i--)
73
- if (d = decorators[i])
74
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
75
- return c > 3 && r && Object.defineProperty(target, key, r), r;
76
- }
77
- function __param(paramIndex, decorator) {
78
- return function (target, key) { decorator(target, key, paramIndex); };
79
- }
80
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
81
- function accept(f) { if (f !== void 0 && typeof f !== "function")
82
- throw new TypeError("Function expected"); return f; }
83
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
84
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
85
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
86
- var _, done = false;
87
- for (var i = decorators.length - 1; i >= 0; i--) {
88
- var context = {};
89
- for (var p in contextIn)
90
- context[p] = p === "access" ? {} : contextIn[p];
91
- for (var p in contextIn.access)
92
- context.access[p] = contextIn.access[p];
93
- context.addInitializer = function (f) { if (done)
94
- throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
95
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
96
- if (kind === "accessor") {
97
- if (result === void 0)
98
- continue;
99
- if (result === null || typeof result !== "object")
100
- throw new TypeError("Object expected");
101
- if (_ = accept(result.get))
102
- descriptor.get = _;
103
- if (_ = accept(result.set))
104
- descriptor.set = _;
105
- if (_ = accept(result.init))
106
- initializers.unshift(_);
107
- }
108
- else if (_ = accept(result)) {
109
- if (kind === "field")
110
- initializers.unshift(_);
111
- else
112
- descriptor[key] = _;
113
- }
114
- }
115
- if (target)
116
- Object.defineProperty(target, contextIn.name, descriptor);
117
- done = true;
118
- }
119
- ;
120
- function __runInitializers(thisArg, initializers, value) {
121
- var useValue = arguments.length > 2;
122
- for (var i = 0; i < initializers.length; i++) {
123
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
124
- }
125
- return useValue ? value : void 0;
126
- }
127
- ;
128
- function __propKey(x) {
129
- return typeof x === "symbol" ? x : "".concat(x);
130
- }
131
- ;
132
- function __setFunctionName(f, name, prefix) {
133
- if (typeof name === "symbol")
134
- name = name.description ? "[".concat(name.description, "]") : "";
135
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
136
- }
137
- ;
138
- function __metadata(metadataKey, metadataValue) {
139
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
140
- return Reflect.metadata(metadataKey, metadataValue);
141
- }
142
- function __awaiter(thisArg, _arguments, P, generator) {
143
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
144
- return new (P || (P = Promise))(function (resolve, reject) {
145
- function fulfilled(value) { try {
146
- step(generator.next(value));
147
- }
148
- catch (e) {
149
- reject(e);
150
- } }
151
- function rejected(value) { try {
152
- step(generator["throw"](value));
153
- }
154
- catch (e) {
155
- reject(e);
156
- } }
157
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
158
- step((generator = generator.apply(thisArg, _arguments || [])).next());
159
- });
160
- }
161
- function __generator(thisArg, body) {
162
- var _ = { label: 0, sent: function () { if (t[0] & 1)
163
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
164
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
165
- function verb(n) { return function (v) { return step([n, v]); }; }
166
- function step(op) {
167
- if (f)
168
- throw new TypeError("Generator is already executing.");
169
- while (g && (g = 0, op[0] && (_ = 0)), _)
170
- try {
171
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
172
- return t;
173
- if (y = 0, t)
174
- op = [op[0] & 2, t.value];
175
- switch (op[0]) {
176
- case 0:
177
- case 1:
178
- t = op;
179
- break;
180
- case 4:
181
- _.label++;
182
- return { value: op[1], done: false };
183
- case 5:
184
- _.label++;
185
- y = op[1];
186
- op = [0];
187
- continue;
188
- case 7:
189
- op = _.ops.pop();
190
- _.trys.pop();
191
- continue;
192
- default:
193
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
194
- _ = 0;
195
- continue;
196
- }
197
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
198
- _.label = op[1];
199
- break;
200
- }
201
- if (op[0] === 6 && _.label < t[1]) {
202
- _.label = t[1];
203
- t = op;
204
- break;
205
- }
206
- if (t && _.label < t[2]) {
207
- _.label = t[2];
208
- _.ops.push(op);
209
- break;
210
- }
211
- if (t[2])
212
- _.ops.pop();
213
- _.trys.pop();
214
- continue;
215
- }
216
- op = body.call(thisArg, _);
217
- }
218
- catch (e) {
219
- op = [6, e];
220
- y = 0;
221
- }
222
- finally {
223
- f = t = 0;
224
- }
225
- if (op[0] & 5)
226
- throw op[1];
227
- return { value: op[0] ? op[1] : void 0, done: true };
228
- }
229
- }
230
- var __createBinding = Object.create ? (function (o, m, k, k2) {
231
- if (k2 === undefined)
232
- k2 = k;
233
- var desc = Object.getOwnPropertyDescriptor(m, k);
234
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
235
- desc = { enumerable: true, get: function () { return m[k]; } };
236
- }
237
- Object.defineProperty(o, k2, desc);
238
- }) : (function (o, m, k, k2) {
239
- if (k2 === undefined)
240
- k2 = k;
241
- o[k2] = m[k];
242
- });
243
- function __exportStar(m, o) {
244
- for (var p in m)
245
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
246
- __createBinding(o, m, p);
247
- }
248
- function __values(o) {
249
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
250
- if (m)
251
- return m.call(o);
252
- if (o && typeof o.length === "number")
253
- return {
254
- next: function () {
255
- if (o && i >= o.length)
256
- o = void 0;
257
- return { value: o && o[i++], done: !o };
258
- }
259
- };
260
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
261
- }
262
- function __read(o, n) {
263
- var m = typeof Symbol === "function" && o[Symbol.iterator];
264
- if (!m)
265
- return o;
266
- var i = m.call(o), r, ar = [], e;
267
- try {
268
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
269
- ar.push(r.value);
270
- }
271
- catch (error) {
272
- e = { error: error };
273
- }
274
- finally {
275
- try {
276
- if (r && !r.done && (m = i["return"]))
277
- m.call(i);
278
- }
279
- finally {
280
- if (e)
281
- throw e.error;
282
- }
283
- }
284
- return ar;
285
- }
286
- /** @deprecated */
287
- function __spread() {
288
- for (var ar = [], i = 0; i < arguments.length; i++)
289
- ar = ar.concat(__read(arguments[i]));
290
- return ar;
291
- }
292
- /** @deprecated */
293
- function __spreadArrays() {
294
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
295
- s += arguments[i].length;
296
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
297
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
298
- r[k] = a[j];
299
- return r;
300
- }
301
- function __spreadArray(to, from, pack) {
302
- if (pack || arguments.length === 2)
303
- for (var i = 0, l = from.length, ar; i < l; i++) {
304
- if (ar || !(i in from)) {
305
- if (!ar)
306
- ar = Array.prototype.slice.call(from, 0, i);
307
- ar[i] = from[i];
308
- }
309
- }
310
- return to.concat(ar || Array.prototype.slice.call(from));
311
- }
312
- function __await(v) {
313
- return this instanceof __await ? (this.v = v, this) : new __await(v);
314
- }
315
- function __asyncGenerator(thisArg, _arguments, generator) {
316
- if (!Symbol.asyncIterator)
317
- throw new TypeError("Symbol.asyncIterator is not defined.");
318
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
319
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
320
- function verb(n) { if (g[n])
321
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
322
- function resume(n, v) { try {
323
- step(g[n](v));
324
- }
325
- catch (e) {
326
- settle(q[0][3], e);
327
- } }
328
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
329
- function fulfill(value) { resume("next", value); }
330
- function reject(value) { resume("throw", value); }
331
- function settle(f, v) { if (f(v), q.shift(), q.length)
332
- resume(q[0][0], q[0][1]); }
333
- }
334
- function __asyncDelegator(o) {
335
- var i, p;
336
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
337
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
338
- }
339
- function __asyncValues(o) {
340
- if (!Symbol.asyncIterator)
341
- throw new TypeError("Symbol.asyncIterator is not defined.");
342
- var m = o[Symbol.asyncIterator], i;
343
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
344
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
345
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
346
- }
347
- function __makeTemplateObject(cooked, raw) {
348
- if (Object.defineProperty) {
349
- Object.defineProperty(cooked, "raw", { value: raw });
350
- }
351
- else {
352
- cooked.raw = raw;
353
- }
354
- return cooked;
355
- }
356
- ;
357
- var __setModuleDefault = Object.create ? (function (o, v) {
358
- Object.defineProperty(o, "default", { enumerable: true, value: v });
359
- }) : function (o, v) {
360
- o["default"] = v;
361
- };
362
- function __importStar(mod) {
363
- if (mod && mod.__esModule)
364
- return mod;
365
- var result = {};
366
- if (mod != null)
367
- for (var k in mod)
368
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
369
- __createBinding(result, mod, k);
370
- __setModuleDefault(result, mod);
371
- return result;
372
- }
373
- function __importDefault(mod) {
374
- return (mod && mod.__esModule) ? mod : { default: mod };
375
- }
376
- function __classPrivateFieldGet(receiver, state, kind, f) {
377
- if (kind === "a" && !f)
378
- throw new TypeError("Private accessor was defined without a getter");
379
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
380
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
381
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
382
- }
383
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
384
- if (kind === "m")
385
- throw new TypeError("Private method is not writable");
386
- if (kind === "a" && !f)
387
- throw new TypeError("Private accessor was defined without a setter");
388
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
389
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
390
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
391
- }
392
- function __classPrivateFieldIn(state, receiver) {
393
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
394
- throw new TypeError("Cannot use 'in' operator on non-object");
395
- return typeof state === "function" ? receiver === state : state.has(receiver);
396
- }
397
- function __addDisposableResource(env, value, async) {
398
- if (value !== null && value !== void 0) {
399
- if (typeof value !== "object" && typeof value !== "function")
400
- throw new TypeError("Object expected.");
401
- var dispose;
402
- if (async) {
403
- if (!Symbol.asyncDispose)
404
- throw new TypeError("Symbol.asyncDispose is not defined.");
405
- dispose = value[Symbol.asyncDispose];
406
- }
407
- if (dispose === void 0) {
408
- if (!Symbol.dispose)
409
- throw new TypeError("Symbol.dispose is not defined.");
410
- dispose = value[Symbol.dispose];
411
- }
412
- if (typeof dispose !== "function")
413
- throw new TypeError("Object not disposable.");
414
- env.stack.push({ value: value, dispose: dispose, async: async });
415
- }
416
- else if (async) {
417
- env.stack.push({ async: true });
418
- }
419
- return value;
420
- }
421
- var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
422
- var e = new Error(message);
423
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
424
- };
425
- function __disposeResources(env) {
426
- function fail(e) {
427
- env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
428
- env.hasError = true;
429
- }
430
- function next() {
431
- while (env.stack.length) {
432
- var rec = env.stack.pop();
433
- try {
434
- var result = rec.dispose && rec.dispose.call(rec.value);
435
- if (rec.async)
436
- return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
437
- }
438
- catch (e) {
439
- fail(e);
440
- }
441
- }
442
- if (env.hasError)
443
- throw env.error;
444
- }
445
- return next();
446
- }
447
- var tslib_es6 = {
448
- __extends: __extends,
449
- __assign: __assign,
450
- __rest: __rest,
451
- __decorate: __decorate,
452
- __param: __param,
453
- __metadata: __metadata,
454
- __awaiter: __awaiter,
455
- __generator: __generator,
456
- __createBinding: __createBinding,
457
- __exportStar: __exportStar,
458
- __values: __values,
459
- __read: __read,
460
- __spread: __spread,
461
- __spreadArrays: __spreadArrays,
462
- __spreadArray: __spreadArray,
463
- __await: __await,
464
- __asyncGenerator: __asyncGenerator,
465
- __asyncDelegator: __asyncDelegator,
466
- __asyncValues: __asyncValues,
467
- __makeTemplateObject: __makeTemplateObject,
468
- __importStar: __importStar,
469
- __importDefault: __importDefault,
470
- __classPrivateFieldGet: __classPrivateFieldGet,
471
- __classPrivateFieldSet: __classPrivateFieldSet,
472
- __classPrivateFieldIn: __classPrivateFieldIn,
473
- __addDisposableResource: __addDisposableResource,
474
- __disposeResources: __disposeResources,
475
- };
19
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
+ PERFORMANCE OF THIS SOFTWARE.
26
+ ***************************************************************************** */
27
+ /* global Reflect, Promise */
28
+ var extendStatics = function (d, b) {
29
+ extendStatics = Object.setPrototypeOf ||
30
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
31
+ function (d, b) { for (var p in b)
32
+ if (Object.prototype.hasOwnProperty.call(b, p))
33
+ d[p] = b[p]; };
34
+ return extendStatics(d, b);
35
+ };
36
+ function __extends(d, b) {
37
+ if (typeof b !== "function" && b !== null)
38
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
39
+ extendStatics(d, b);
40
+ function __() { this.constructor = d; }
41
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42
+ }
43
+ var __assign = function () {
44
+ __assign = Object.assign || function __assign(t) {
45
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
46
+ s = arguments[i];
47
+ for (var p in s)
48
+ if (Object.prototype.hasOwnProperty.call(s, p))
49
+ t[p] = s[p];
50
+ }
51
+ return t;
52
+ };
53
+ return __assign.apply(this, arguments);
54
+ };
55
+ function __rest(s, e) {
56
+ var t = {};
57
+ for (var p in s)
58
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
59
+ t[p] = s[p];
60
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
61
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
62
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
63
+ t[p[i]] = s[p[i]];
64
+ }
65
+ return t;
66
+ }
67
+ function __decorate(decorators, target, key, desc) {
68
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
69
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
70
+ r = Reflect.decorate(decorators, target, key, desc);
71
+ else
72
+ for (var i = decorators.length - 1; i >= 0; i--)
73
+ if (d = decorators[i])
74
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
75
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
76
+ }
77
+ function __param(paramIndex, decorator) {
78
+ return function (target, key) { decorator(target, key, paramIndex); };
79
+ }
80
+ function __metadata(metadataKey, metadataValue) {
81
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
82
+ return Reflect.metadata(metadataKey, metadataValue);
83
+ }
84
+ function __awaiter(thisArg, _arguments, P, generator) {
85
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
86
+ return new (P || (P = Promise))(function (resolve, reject) {
87
+ function fulfilled(value) { try {
88
+ step(generator.next(value));
89
+ }
90
+ catch (e) {
91
+ reject(e);
92
+ } }
93
+ function rejected(value) { try {
94
+ step(generator["throw"](value));
95
+ }
96
+ catch (e) {
97
+ reject(e);
98
+ } }
99
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
100
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
101
+ });
102
+ }
103
+ function __generator(thisArg, body) {
104
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
105
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
106
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
107
+ function verb(n) { return function (v) { return step([n, v]); }; }
108
+ function step(op) {
109
+ if (f)
110
+ throw new TypeError("Generator is already executing.");
111
+ while (_)
112
+ try {
113
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
114
+ return t;
115
+ if (y = 0, t)
116
+ op = [op[0] & 2, t.value];
117
+ switch (op[0]) {
118
+ case 0:
119
+ case 1:
120
+ t = op;
121
+ break;
122
+ case 4:
123
+ _.label++;
124
+ return { value: op[1], done: false };
125
+ case 5:
126
+ _.label++;
127
+ y = op[1];
128
+ op = [0];
129
+ continue;
130
+ case 7:
131
+ op = _.ops.pop();
132
+ _.trys.pop();
133
+ continue;
134
+ default:
135
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
136
+ _ = 0;
137
+ continue;
138
+ }
139
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
140
+ _.label = op[1];
141
+ break;
142
+ }
143
+ if (op[0] === 6 && _.label < t[1]) {
144
+ _.label = t[1];
145
+ t = op;
146
+ break;
147
+ }
148
+ if (t && _.label < t[2]) {
149
+ _.label = t[2];
150
+ _.ops.push(op);
151
+ break;
152
+ }
153
+ if (t[2])
154
+ _.ops.pop();
155
+ _.trys.pop();
156
+ continue;
157
+ }
158
+ op = body.call(thisArg, _);
159
+ }
160
+ catch (e) {
161
+ op = [6, e];
162
+ y = 0;
163
+ }
164
+ finally {
165
+ f = t = 0;
166
+ }
167
+ if (op[0] & 5)
168
+ throw op[1];
169
+ return { value: op[0] ? op[1] : void 0, done: true };
170
+ }
171
+ }
172
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
173
+ if (k2 === undefined)
174
+ k2 = k;
175
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
176
+ }) : (function (o, m, k, k2) {
177
+ if (k2 === undefined)
178
+ k2 = k;
179
+ o[k2] = m[k];
180
+ });
181
+ function __exportStar(m, o) {
182
+ for (var p in m)
183
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
184
+ __createBinding(o, m, p);
185
+ }
186
+ function __values(o) {
187
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
188
+ if (m)
189
+ return m.call(o);
190
+ if (o && typeof o.length === "number")
191
+ return {
192
+ next: function () {
193
+ if (o && i >= o.length)
194
+ o = void 0;
195
+ return { value: o && o[i++], done: !o };
196
+ }
197
+ };
198
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
199
+ }
200
+ function __read(o, n) {
201
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
202
+ if (!m)
203
+ return o;
204
+ var i = m.call(o), r, ar = [], e;
205
+ try {
206
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
207
+ ar.push(r.value);
208
+ }
209
+ catch (error) {
210
+ e = { error: error };
211
+ }
212
+ finally {
213
+ try {
214
+ if (r && !r.done && (m = i["return"]))
215
+ m.call(i);
216
+ }
217
+ finally {
218
+ if (e)
219
+ throw e.error;
220
+ }
221
+ }
222
+ return ar;
223
+ }
224
+ /** @deprecated */
225
+ function __spread() {
226
+ for (var ar = [], i = 0; i < arguments.length; i++)
227
+ ar = ar.concat(__read(arguments[i]));
228
+ return ar;
229
+ }
230
+ /** @deprecated */
231
+ function __spreadArrays() {
232
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
233
+ s += arguments[i].length;
234
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
235
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
236
+ r[k] = a[j];
237
+ return r;
238
+ }
239
+ function __spreadArray(to, from, pack) {
240
+ if (pack || arguments.length === 2)
241
+ for (var i = 0, l = from.length, ar; i < l; i++) {
242
+ if (ar || !(i in from)) {
243
+ if (!ar)
244
+ ar = Array.prototype.slice.call(from, 0, i);
245
+ ar[i] = from[i];
246
+ }
247
+ }
248
+ return to.concat(ar || from);
249
+ }
250
+ function __await(v) {
251
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
252
+ }
253
+ function __asyncGenerator(thisArg, _arguments, generator) {
254
+ if (!Symbol.asyncIterator)
255
+ throw new TypeError("Symbol.asyncIterator is not defined.");
256
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
257
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
258
+ function verb(n) { if (g[n])
259
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
260
+ function resume(n, v) { try {
261
+ step(g[n](v));
262
+ }
263
+ catch (e) {
264
+ settle(q[0][3], e);
265
+ } }
266
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
267
+ function fulfill(value) { resume("next", value); }
268
+ function reject(value) { resume("throw", value); }
269
+ function settle(f, v) { if (f(v), q.shift(), q.length)
270
+ resume(q[0][0], q[0][1]); }
271
+ }
272
+ function __asyncDelegator(o) {
273
+ var i, p;
274
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
275
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
276
+ }
277
+ function __asyncValues(o) {
278
+ if (!Symbol.asyncIterator)
279
+ throw new TypeError("Symbol.asyncIterator is not defined.");
280
+ var m = o[Symbol.asyncIterator], i;
281
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
282
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
283
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
284
+ }
285
+ function __makeTemplateObject(cooked, raw) {
286
+ if (Object.defineProperty) {
287
+ Object.defineProperty(cooked, "raw", { value: raw });
288
+ }
289
+ else {
290
+ cooked.raw = raw;
291
+ }
292
+ return cooked;
293
+ }
294
+ ;
295
+ var __setModuleDefault = Object.create ? (function (o, v) {
296
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
297
+ }) : function (o, v) {
298
+ o["default"] = v;
299
+ };
300
+ function __importStar(mod) {
301
+ if (mod && mod.__esModule)
302
+ return mod;
303
+ var result = {};
304
+ if (mod != null)
305
+ for (var k in mod)
306
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
307
+ __createBinding(result, mod, k);
308
+ __setModuleDefault(result, mod);
309
+ return result;
310
+ }
311
+ function __importDefault(mod) {
312
+ return (mod && mod.__esModule) ? mod : { default: mod };
313
+ }
314
+ function __classPrivateFieldGet(receiver, state, kind, f) {
315
+ if (kind === "a" && !f)
316
+ throw new TypeError("Private accessor was defined without a getter");
317
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
318
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
319
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
320
+ }
321
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
322
+ if (kind === "m")
323
+ throw new TypeError("Private method is not writable");
324
+ if (kind === "a" && !f)
325
+ throw new TypeError("Private accessor was defined without a setter");
326
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
327
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
328
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
329
+ }
476
330
 
477
- function tuiRollupSvgo(_c) {
478
- var _d = _c === void 0 ? {} : _c, _e = _d.include, include = _e === void 0 ? "**/*.svg" : _e, exclude = _d.exclude, options = _d.options;
479
- var filter = pluginutils.createFilter(include, exclude);
480
- return {
481
- name: "rollupSvgo",
482
- transform: function (svgString, path) {
483
- var _a, _b;
484
- var skip = !filter(path);
485
- if (skip) {
486
- console.info("\u001B[33m%s\u001B[0m", "[skip]", path);
487
- return;
488
- }
489
- var data;
490
- var errorMessage;
491
- try {
492
- var result = svgo.optimize(svgString, Object.assign({ path: path }, options));
493
- data = (result === null || result === void 0 ? void 0 : result.data) || {};
494
- errorMessage = (_a = result) === null || _a === void 0 ? void 0 : _a.error;
495
- }
496
- catch (err) {
497
- errorMessage = (_b = err) === null || _b === void 0 ? void 0 : _b.message;
498
- }
499
- if (errorMessage) {
500
- console.error("\u001B[31m%s\u001B[0m", "[error]", path, "\n" + svgString, "\n" + errorMessage);
501
- process.exit(1);
502
- }
503
- console.info("\u001B[32m%s\u001B[0m", "[success]", path);
504
- return {
505
- code: "export default " + JSON.stringify(data),
506
- map: { mappings: "" },
507
- };
508
- },
509
- };
510
- }
331
+ function tuiRollupSvgo(_c) {
332
+ var _d = _c === void 0 ? {} : _c, _e = _d.include, include = _e === void 0 ? '**/*.svg' : _e, exclude = _d.exclude, options = _d.options;
333
+ var filter = pluginutils.createFilter(include, exclude);
334
+ return {
335
+ name: 'rollupSvgo',
336
+ transform: function (svgString, path) {
337
+ var _a, _b;
338
+ var skip = !filter(path);
339
+ if (skip) {
340
+ console.info('\x1B[33m%s\x1B[0m', '[skip]', path);
341
+ return;
342
+ }
343
+ var data;
344
+ var errorMessage;
345
+ try {
346
+ var result = svgo.optimize(svgString, Object.assign({ path: path }, options));
347
+ data = (result === null || result === void 0 ? void 0 : result.data) || {};
348
+ errorMessage = (_a = result) === null || _a === void 0 ? void 0 : _a.error;
349
+ }
350
+ catch (err) {
351
+ errorMessage = (_b = err) === null || _b === void 0 ? void 0 : _b.message;
352
+ }
353
+ if (errorMessage) {
354
+ console.error('\x1B[31m%s\x1B[0m', '[error]', path, "\n" + svgString, "\n" + errorMessage);
355
+ process.exit(1);
356
+ }
357
+ console.info('\x1B[32m%s\x1B[0m', '[success]', path);
358
+ return {
359
+ code: "export default " + JSON.stringify(data),
360
+ map: { mappings: '' },
361
+ };
362
+ },
363
+ };
364
+ }
511
365
 
512
- var banner = "\n/**\n * @description:\n * DO NOT CHANGE THIS FILE. AUTOGENERATED\n *\n * This file contains inline svg icons\n * for users who wants insert into js bundle\n */\n";
513
- function tuiConvertAllCompileFileToAllFile(config) {
514
- return __awaiter(this, void 0, void 0, function () {
515
- var from, to, prt2Options, include, inputOptions, bundle;
516
- return __generator(this, function (_a) {
517
- switch (_a.label) {
518
- case 0:
519
- from = config.from, to = config.to, prt2Options = config.prt2Options, include = config.include;
520
- inputOptions = {
521
- input: from,
522
- output: {
523
- generatedCode: {
524
- constBindings: true,
525
- },
526
- },
527
- plugins: [
528
- typescript__default["default"](prt2Options),
529
- tuiRollupSvgo({
530
- include: include,
531
- options: {
532
- plugins: [
533
- {
534
- name: "preset-default",
535
- params: {
536
- overrides: {
537
- removeViewBox: false,
538
- collapseGroups: false,
539
- removeUnknownsAndDefaults: false,
540
- cleanupIds: {},
541
- sortAttrs: {
542
- xmlnsOrder: "alphabetical",
543
- },
544
- },
545
- },
546
- },
547
- ],
548
- },
549
- }),
550
- ],
551
- };
552
- console.info("\u001B[36m%s\u001B[0m", "TypeScript options: ", prt2Options);
553
- return [4 /*yield*/, rollup.rollup(inputOptions)];
554
- case 1:
555
- bundle = _a.sent();
556
- return [4 /*yield*/, bundle.write({
557
- banner: banner,
558
- file: to,
559
- format: "es",
560
- generatedCode: {
561
- constBindings: true,
562
- },
563
- })];
564
- case 2:
565
- _a.sent();
566
- /**
567
- * @note:
568
- * The rollup bundle must be closed once `write` is finished to let plugins clean up their external
569
- * processes or services via the `closeBundle` hook, otherwise it can lead to memory leaks.
570
- */
571
- return [4 /*yield*/, bundle.close()];
572
- case 3:
573
- /**
574
- * @note:
575
- * The rollup bundle must be closed once `write` is finished to let plugins clean up their external
576
- * processes or services via the `closeBundle` hook, otherwise it can lead to memory leaks.
577
- */
578
- _a.sent();
579
- return [2 /*return*/];
580
- }
581
- });
582
- });
583
- }
366
+ var banner = "\n/**\n * @description:\n * DO NOT CHANGE THIS FILE. AUTOGENERATED\n *\n * This file contains inline svg icons\n * for users who wants insert into js bundle\n */\n";
367
+ function tuiConvertAllCompileFileToAllFile(config) {
368
+ return __awaiter(this, void 0, void 0, function () {
369
+ var from, to, prt2Options, include, inputOptions, bundle;
370
+ return __generator(this, function (_a) {
371
+ switch (_a.label) {
372
+ case 0:
373
+ from = config.from, to = config.to, prt2Options = config.prt2Options, include = config.include;
374
+ inputOptions = {
375
+ input: from,
376
+ output: {
377
+ generatedCode: {
378
+ constBindings: true,
379
+ },
380
+ },
381
+ plugins: [
382
+ typescript__default["default"](prt2Options),
383
+ tuiRollupSvgo({
384
+ include: include,
385
+ options: {
386
+ plugins: [
387
+ {
388
+ name: 'preset-default',
389
+ params: {
390
+ overrides: {
391
+ removeViewBox: false,
392
+ collapseGroups: false,
393
+ removeUnknownsAndDefaults: false,
394
+ cleanupIds: {},
395
+ sortAttrs: {
396
+ xmlnsOrder: 'alphabetical',
397
+ },
398
+ },
399
+ },
400
+ },
401
+ ],
402
+ },
403
+ }),
404
+ ],
405
+ };
406
+ console.info('\x1B[36m%s\x1B[0m', 'TypeScript options: ', prt2Options);
407
+ return [4 /*yield*/, rollup.rollup(inputOptions)];
408
+ case 1:
409
+ bundle = _a.sent();
410
+ return [4 /*yield*/, bundle.write({
411
+ banner: banner,
412
+ file: to,
413
+ format: 'es',
414
+ generatedCode: {
415
+ constBindings: true,
416
+ },
417
+ })];
418
+ case 2:
419
+ _a.sent();
420
+ /**
421
+ * @note:
422
+ * The rollup bundle must be closed once `write` is finished to let plugins clean up their external
423
+ * processes or services via the `closeBundle` hook, otherwise it can lead to memory leaks.
424
+ */
425
+ return [4 /*yield*/, bundle.close()];
426
+ case 3:
427
+ /**
428
+ * @note:
429
+ * The rollup bundle must be closed once `write` is finished to let plugins clean up their external
430
+ * processes or services via the `closeBundle` hook, otherwise it can lead to memory leaks.
431
+ */
432
+ _a.sent();
433
+ return [2 /*return*/];
434
+ }
435
+ });
436
+ });
437
+ }
584
438
 
585
- function tuiPostPrettierFormat(_a) {
586
- var file = _a.file, config = _a.config;
587
- return __awaiter(this, void 0, void 0, function () {
588
- var bundledBody, formatted;
589
- return __generator(this, function (_a) {
590
- switch (_a.label) {
591
- case 0:
592
- console.info("\u001B[36m%s\u001B[0m", "format: " + file + " by parser - " + config.parser);
593
- bundledBody = fs.readFileSync(file, "utf8");
594
- return [4 /*yield*/, prettier__default["default"].format(bundledBody, config)];
595
- case 1:
596
- formatted = _a.sent();
597
- fs.writeFileSync(file, formatted);
598
- return [2 /*return*/];
599
- }
600
- });
601
- });
602
- }
439
+ function tuiPostPrettierFormat(_a) {
440
+ var file = _a.file, config = _a.config;
441
+ return __awaiter(this, void 0, void 0, function () {
442
+ var bundledBody, formatted;
443
+ return __generator(this, function (_a) {
444
+ switch (_a.label) {
445
+ case 0:
446
+ console.info('\x1B[36m%s\x1B[0m', "format: " + file + " by parser - " + config.parser);
447
+ bundledBody = fs.readFileSync(file, 'utf8');
448
+ return [4 /*yield*/, prettier__default["default"].format(bundledBody, config)];
449
+ case 1:
450
+ formatted = _a.sent();
451
+ fs.writeFileSync(file, formatted);
452
+ return [2 /*return*/];
453
+ }
454
+ });
455
+ });
456
+ }
603
457
 
604
- function tuiPrepareAllToCompileFile(iconsSrc, entryPointTs) {
605
- var icons = fs.readdirSync(iconsSrc).filter(function (file) { return file.endsWith(".svg"); });
606
- console.info("\u001B[36m%s\u001B[0m", "Combine all svg icons into one file for bundling: " + icons.length);
607
- var importDeclarations = "";
608
- var exportDeclarations = "";
609
- icons.forEach(function (iconPath) {
610
- var fileName = iconPath.split(".").shift();
611
- var filePath = "./src/" + fileName + ".svg";
612
- importDeclarations += "import " + fileName + " from '" + filePath + "';\n";
613
- exportDeclarations += fileName + ", ";
614
- });
615
- fs.writeFileSync(entryPointTs, importDeclarations + " \n export { " + exportDeclarations + " }");
616
- }
458
+ function tuiPrepareAllToCompileFile(iconsSrc, entryPointTs) {
459
+ var icons = fs.readdirSync(iconsSrc).filter(function (file) { return file.endsWith('.svg'); });
460
+ console.info('\x1B[36m%s\x1B[0m', "Combine all svg icons into one file for bundling: " + icons.length);
461
+ var importDeclarations = '';
462
+ var exportDeclarations = '';
463
+ icons.forEach(function (iconPath) {
464
+ var fileName = iconPath.split('.').shift();
465
+ var filePath = "./src/" + fileName + ".svg";
466
+ importDeclarations += "import " + fileName + " from '" + filePath + "';\n";
467
+ exportDeclarations += fileName + ", ";
468
+ });
469
+ fs.writeFileSync(entryPointTs, importDeclarations + " \n export { " + exportDeclarations + " }");
470
+ }
617
471
 
618
- var START = "<svg";
619
- var WIDTH_SEARCH = "width=\"";
620
- var HEIGHT_SEARCH = "height=\"";
621
- function wrapIcon(source, name) {
622
- var src = source.slice(Math.max(0, source.indexOf(START)));
623
- var attributes = src.slice(0, Math.max(0, src.indexOf(">")));
624
- if (!(attributes === null || attributes === void 0 ? void 0 : attributes.includes(WIDTH_SEARCH)) || !attributes.includes(HEIGHT_SEARCH)) {
625
- return src;
626
- }
627
- var indexOfWidth = attributes.indexOf(WIDTH_SEARCH);
628
- var indexOfHeight = attributes.indexOf(HEIGHT_SEARCH);
629
- var widthOffset = indexOfWidth + WIDTH_SEARCH.length;
630
- var heightOffset = indexOfHeight + HEIGHT_SEARCH.length;
631
- var widthString = attributes.slice(widthOffset, attributes.indexOf("\"", widthOffset));
632
- var heightString = attributes.slice(heightOffset, attributes.indexOf("\"", heightOffset));
633
- if (!heightString ||
634
- !widthString ||
635
- widthString.includes("%") ||
636
- heightString.includes("%")) {
637
- return src.replace(START, "<svg id=\"" + name + "\"");
638
- }
639
- var width = parseInt(widthString, 10);
640
- var height = parseInt(heightString, 10);
641
- var emWidth = width / 16;
642
- var emHeight = height / 16;
643
- return {
644
- width: emWidth + "em",
645
- height: emHeight + "em",
646
- src: ("\n <g id=\"" + name + "\" xmlns=\"http://www.w3.org/2000/svg\">\n <svg x=\"50%\" y=\"50%\" width=\"" + emWidth + "em\" height=\"" + emHeight + "em\" overflow=\"visible\" viewBox=\"0 0 " + width + " " + height + "\">\n <svg x=\"" + -width / 2 + "\" y=\"" + -height / 2 + "\">" + src + "</svg>\n </svg>\n </g>").trim(),
647
- };
648
- }
649
- function tuiProcessIcons(files, interceptor) {
650
- var e_1, _a;
651
- try {
652
- for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
653
- var file = files_1_1.value;
654
- var baseContent = String(fs__default["default"].readFileSync(file));
655
- var src = interceptor ? interceptor(baseContent) : baseContent;
656
- var name = path.parse(file).base.replace(".svg", "");
657
- if (src.includes("id=\"" + name + "\"") || name.includes("Outline")) {
658
- console.info("\u001B[33m%s\u001B[0m", "[skip]:", file);
659
- continue;
660
- }
661
- var wrapped = wrapIcon(src, name);
662
- var final = typeof wrapped === "string"
663
- ? wrapped.replace(START, "<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"" + name + "\" xmlns=\"http://www.w3.org/2000/svg\"><svg") + "</g></svg>"
664
- : "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + wrapped.width + "\" height=\"" + wrapped.height + "\">" + wrapped.src + "</svg>";
665
- fs__default["default"].writeFileSync(file, final);
666
- console.info("\u001B[32m%s\u001B[0m", "[preprocessed]:", file);
667
- }
668
- }
669
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
670
- finally {
671
- try {
672
- if (files_1_1 && !files_1_1.done && (_a = files_1.return)) _a.call(files_1);
673
- }
674
- finally { if (e_1) throw e_1.error; }
675
- }
676
- }
677
- /**
678
- * @deprecated:
679
- * use @{link tuiProcessIcons}
680
- */
681
- var processIcons = tuiProcessIcons;
472
+ var START = '<svg';
473
+ var WIDTH_SEARCH = 'width="';
474
+ var HEIGHT_SEARCH = 'height="';
475
+ function wrapIcon(source, name) {
476
+ var src = source.slice(Math.max(0, source.indexOf(START)));
477
+ var attributes = src.slice(0, Math.max(0, src.indexOf('>')));
478
+ if (!(attributes === null || attributes === void 0 ? void 0 : attributes.includes(WIDTH_SEARCH)) || !attributes.includes(HEIGHT_SEARCH)) {
479
+ return src;
480
+ }
481
+ var indexOfWidth = attributes.indexOf(WIDTH_SEARCH);
482
+ var indexOfHeight = attributes.indexOf(HEIGHT_SEARCH);
483
+ var widthOffset = indexOfWidth + WIDTH_SEARCH.length;
484
+ var heightOffset = indexOfHeight + HEIGHT_SEARCH.length;
485
+ var widthString = attributes.slice(widthOffset, attributes.indexOf('"', widthOffset));
486
+ var heightString = attributes.slice(heightOffset, attributes.indexOf('"', heightOffset));
487
+ if (!heightString ||
488
+ !widthString ||
489
+ widthString.includes('%') ||
490
+ heightString.includes('%')) {
491
+ return src.replace(START, "<svg id=\"" + name + "\"");
492
+ }
493
+ var width = parseInt(widthString, 10);
494
+ var height = parseInt(heightString, 10);
495
+ var emWidth = width / 16;
496
+ var emHeight = height / 16;
497
+ return {
498
+ width: emWidth + "em",
499
+ height: emHeight + "em",
500
+ src: ("\n <g id=\"" + name + "\" xmlns=\"http://www.w3.org/2000/svg\">\n <svg x=\"50%\" y=\"50%\" width=\"" + emWidth + "em\" height=\"" + emHeight + "em\" overflow=\"visible\" viewBox=\"0 0 " + width + " " + height + "\">\n <svg x=\"" + -width / 2 + "\" y=\"" + -height / 2 + "\">" + src + "</svg>\n </svg>\n </g>").trim(),
501
+ };
502
+ }
503
+ function tuiProcessIcons(files, interceptor) {
504
+ var e_1, _a;
505
+ try {
506
+ for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
507
+ var file = files_1_1.value;
508
+ var baseContent = String(fs__default["default"].readFileSync(file));
509
+ var src = interceptor ? interceptor(baseContent) : baseContent;
510
+ var name = path.parse(file).base.replace('.svg', '');
511
+ if (src.includes("id=\"" + name + "\"") || name.includes('Outline')) {
512
+ console.info('\x1B[33m%s\x1B[0m', '[skip]:', file);
513
+ continue;
514
+ }
515
+ var wrapped = wrapIcon(src, name);
516
+ var final = typeof wrapped === 'string'
517
+ ? wrapped.replace(START, "<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"" + name + "\" xmlns=\"http://www.w3.org/2000/svg\"><svg") + "</g></svg>"
518
+ : "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + wrapped.width + "\" height=\"" + wrapped.height + "\">" + wrapped.src + "</svg>";
519
+ fs__default["default"].writeFileSync(file, final);
520
+ console.info('\x1B[32m%s\x1B[0m', '[preprocessed]:', file);
521
+ }
522
+ }
523
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
524
+ finally {
525
+ try {
526
+ if (files_1_1 && !files_1_1.done && (_a = files_1.return)) _a.call(files_1);
527
+ }
528
+ finally { if (e_1) throw e_1.error; }
529
+ }
530
+ }
531
+ /**
532
+ * @deprecated:
533
+ * use @{link tuiProcessIcons}
534
+ */
535
+ var processIcons = tuiProcessIcons;
682
536
 
683
- /**
684
- * Generated bundle index. Do not edit.
685
- */
537
+ /**
538
+ * Generated bundle index. Do not edit.
539
+ */
686
540
 
687
- exports.processIcons = processIcons;
688
- exports.tuiConvertAllCompileFileToAllFile = tuiConvertAllCompileFileToAllFile;
689
- exports.tuiPostPrettierFormat = tuiPostPrettierFormat;
690
- exports.tuiPrepareAllToCompileFile = tuiPrepareAllToCompileFile;
691
- exports.tuiProcessIcons = tuiProcessIcons;
692
- exports.tuiRollupSvgo = tuiRollupSvgo;
541
+ exports.processIcons = processIcons;
542
+ exports.tuiConvertAllCompileFileToAllFile = tuiConvertAllCompileFileToAllFile;
543
+ exports.tuiPostPrettierFormat = tuiPostPrettierFormat;
544
+ exports.tuiPrepareAllToCompileFile = tuiPrepareAllToCompileFile;
545
+ exports.tuiProcessIcons = tuiProcessIcons;
546
+ exports.tuiRollupSvgo = tuiRollupSvgo;
693
547
 
694
- Object.defineProperty(exports, '__esModule', { value: true });
548
+ Object.defineProperty(exports, '__esModule', { value: true });
695
549
 
696
550
  }));
697
551
  //# sourceMappingURL=taiga-ui-icons-scripts.umd.js.map