@medely/fontawesome-svg-core 0.0.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/index.mjs ADDED
@@ -0,0 +1,3777 @@
1
+ function ownKeys(object, enumerableOnly) {
2
+ var keys = Object.keys(object);
3
+
4
+ if (Object.getOwnPropertySymbols) {
5
+ var symbols = Object.getOwnPropertySymbols(object);
6
+ enumerableOnly &&
7
+ (symbols = symbols.filter(function (sym) {
8
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
9
+ })),
10
+ keys.push.apply(keys, symbols);
11
+ }
12
+
13
+ return keys;
14
+ }
15
+
16
+ function _objectSpread2(target) {
17
+ for (var i = 1; i < arguments.length; i++) {
18
+ var source = null != arguments[i] ? arguments[i] : {};
19
+ i % 2
20
+ ? ownKeys(Object(source), !0).forEach(function (key) {
21
+ _defineProperty(target, key, source[key]);
22
+ })
23
+ : Object.getOwnPropertyDescriptors
24
+ ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source))
25
+ : ownKeys(Object(source)).forEach(function (key) {
26
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
27
+ });
28
+ }
29
+
30
+ return target;
31
+ }
32
+
33
+ function _typeof(obj) {
34
+ '@babel/helpers - typeof';
35
+
36
+ return (
37
+ (_typeof =
38
+ 'function' === typeof Symbol && 'symbol' === typeof Symbol.iterator
39
+ ? function (obj) {
40
+ return typeof obj;
41
+ }
42
+ : function (obj) {
43
+ return obj &&
44
+ 'function' === typeof Symbol &&
45
+ obj.constructor === Symbol &&
46
+ obj !== Symbol.prototype
47
+ ? 'symbol'
48
+ : typeof obj;
49
+ }),
50
+ _typeof(obj)
51
+ );
52
+ }
53
+
54
+ function _wrapRegExp() {
55
+ _wrapRegExp = function (re, groups) {
56
+ return new BabelRegExp(re, void 0, groups);
57
+ };
58
+
59
+ var _super = RegExp.prototype,
60
+ _groups = new WeakMap();
61
+
62
+ function BabelRegExp(re, flags, groups) {
63
+ var _this = new RegExp(re, flags);
64
+
65
+ return (
66
+ _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype)
67
+ );
68
+ }
69
+
70
+ function buildGroups(result, re) {
71
+ var g = _groups.get(re);
72
+
73
+ return Object.keys(g).reduce(function (groups, name) {
74
+ return (groups[name] = result[g[name]]), groups;
75
+ }, Object.create(null));
76
+ }
77
+
78
+ return (
79
+ _inherits(BabelRegExp, RegExp),
80
+ (BabelRegExp.prototype.exec = function (str) {
81
+ var result = _super.exec.call(this, str);
82
+
83
+ return result && (result.groups = buildGroups(result, this)), result;
84
+ }),
85
+ (BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
86
+ if ('string' === typeof substitution) {
87
+ var groups = _groups.get(this);
88
+
89
+ return _super[Symbol.replace].call(
90
+ this,
91
+ str,
92
+ substitution.replace(/\$<([^>]+)>/g, function (_, name) {
93
+ return '$' + groups[name];
94
+ }),
95
+ );
96
+ }
97
+
98
+ if ('function' === typeof substitution) {
99
+ var _this = this;
100
+
101
+ return _super[Symbol.replace].call(this, str, function () {
102
+ var args = arguments;
103
+ return (
104
+ 'object' !== typeof args[args.length - 1] &&
105
+ (args = [].slice.call(args)).push(buildGroups(args, _this)),
106
+ substitution.apply(this, args)
107
+ );
108
+ });
109
+ }
110
+
111
+ return _super[Symbol.replace].call(this, str, substitution);
112
+ }),
113
+ _wrapRegExp.apply(this, arguments)
114
+ );
115
+ }
116
+
117
+ function _classCallCheck(instance, Constructor) {
118
+ if (!(instance instanceof Constructor)) {
119
+ throw new TypeError('Cannot call a class as a function');
120
+ }
121
+ }
122
+
123
+ function _defineProperties(target, props) {
124
+ for (var i = 0; i < props.length; i++) {
125
+ var descriptor = props[i];
126
+ descriptor.enumerable = descriptor.enumerable || false;
127
+ descriptor.configurable = true;
128
+ if ('value' in descriptor) {
129
+ descriptor.writable = true;
130
+ }
131
+ Object.defineProperty(target, descriptor.key, descriptor);
132
+ }
133
+ }
134
+
135
+ function _createClass(Constructor, protoProps, staticProps) {
136
+ if (protoProps) {
137
+ _defineProperties(Constructor.prototype, protoProps);
138
+ }
139
+ if (staticProps) {
140
+ _defineProperties(Constructor, staticProps);
141
+ }
142
+ Object.defineProperty(Constructor, 'prototype', {
143
+ writable: false,
144
+ });
145
+ return Constructor;
146
+ }
147
+
148
+ function _defineProperty(obj, key, value) {
149
+ if (key in obj) {
150
+ Object.defineProperty(obj, key, {
151
+ value: value,
152
+ enumerable: true,
153
+ configurable: true,
154
+ writable: true,
155
+ });
156
+ } else {
157
+ obj[key] = value;
158
+ }
159
+
160
+ return obj;
161
+ }
162
+
163
+ function _inherits(subClass, superClass) {
164
+ if (typeof superClass !== 'function' && superClass !== null) {
165
+ throw new TypeError('Super expression must either be null or a function');
166
+ }
167
+
168
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
169
+ constructor: {
170
+ value: subClass,
171
+ writable: true,
172
+ configurable: true,
173
+ },
174
+ });
175
+ Object.defineProperty(subClass, 'prototype', {
176
+ writable: false,
177
+ });
178
+ if (superClass) {
179
+ _setPrototypeOf(subClass, superClass);
180
+ }
181
+ }
182
+
183
+ function _setPrototypeOf(o, p) {
184
+ _setPrototypeOf =
185
+ Object.setPrototypeOf ||
186
+ function _setPrototypeOf(o, p) {
187
+ o.__proto__ = p;
188
+ return o;
189
+ };
190
+
191
+ return _setPrototypeOf(o, p);
192
+ }
193
+
194
+ function _slicedToArray(arr, i) {
195
+ return (
196
+ _arrayWithHoles(arr) ||
197
+ _iterableToArrayLimit(arr, i) ||
198
+ _unsupportedIterableToArray(arr, i) ||
199
+ _nonIterableRest()
200
+ );
201
+ }
202
+
203
+ function _toConsumableArray(arr) {
204
+ return (
205
+ _arrayWithoutHoles(arr) ||
206
+ _iterableToArray(arr) ||
207
+ _unsupportedIterableToArray(arr) ||
208
+ _nonIterableSpread()
209
+ );
210
+ }
211
+
212
+ function _arrayWithoutHoles(arr) {
213
+ if (Array.isArray(arr)) {
214
+ return _arrayLikeToArray(arr);
215
+ }
216
+ }
217
+
218
+ function _arrayWithHoles(arr) {
219
+ if (Array.isArray(arr)) {
220
+ return arr;
221
+ }
222
+ }
223
+
224
+ function _iterableToArray(iter) {
225
+ if (
226
+ (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) ||
227
+ iter['@@iterator'] != null
228
+ ) {
229
+ return Array.from(iter);
230
+ }
231
+ }
232
+
233
+ function _iterableToArrayLimit(arr, i) {
234
+ var _i =
235
+ arr == null
236
+ ? null
237
+ : (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) || arr['@@iterator'];
238
+
239
+ if (_i == null) {
240
+ return;
241
+ }
242
+ var _arr = [];
243
+ var _n = true;
244
+ var _d = false;
245
+
246
+ var _s, _e;
247
+
248
+ try {
249
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
250
+ _arr.push(_s.value);
251
+
252
+ if (i && _arr.length === i) {
253
+ break;
254
+ }
255
+ }
256
+ } catch (err) {
257
+ _d = true;
258
+ _e = err;
259
+ } finally {
260
+ try {
261
+ if (!_n && _i['return'] != null) {
262
+ _i['return']();
263
+ }
264
+ } finally {
265
+ if (_d) {
266
+ throw _e;
267
+ }
268
+ }
269
+ }
270
+
271
+ return _arr;
272
+ }
273
+
274
+ function _unsupportedIterableToArray(o, minLen) {
275
+ if (!o) {
276
+ return;
277
+ }
278
+ if (typeof o === 'string') {
279
+ return _arrayLikeToArray(o, minLen);
280
+ }
281
+ var n = Object.prototype.toString.call(o).slice(8, -1);
282
+ if (n === 'Object' && o.constructor) {
283
+ n = o.constructor.name;
284
+ }
285
+ if (n === 'Map' || n === 'Set') {
286
+ return Array.from(o);
287
+ }
288
+ if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
289
+ return _arrayLikeToArray(o, minLen);
290
+ }
291
+ }
292
+
293
+ function _arrayLikeToArray(arr, len) {
294
+ if (len == null || len > arr.length) {
295
+ len = arr.length;
296
+ }
297
+
298
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
299
+ arr2[i] = arr[i];
300
+ }
301
+
302
+ return arr2;
303
+ }
304
+
305
+ function _nonIterableSpread() {
306
+ throw new TypeError(
307
+ 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
308
+ );
309
+ }
310
+
311
+ function _nonIterableRest() {
312
+ throw new TypeError(
313
+ 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
314
+ );
315
+ }
316
+
317
+ var noop = function noop() {};
318
+
319
+ var _WINDOW = {};
320
+ var _DOCUMENT = {};
321
+ var _MUTATION_OBSERVER = null;
322
+ var _PERFORMANCE = {
323
+ mark: noop,
324
+ measure: noop,
325
+ };
326
+
327
+ try {
328
+ if (typeof window !== 'undefined') {
329
+ _WINDOW = window;
330
+ }
331
+ if (typeof document !== 'undefined') {
332
+ _DOCUMENT = document;
333
+ }
334
+ if (typeof MutationObserver !== 'undefined') {
335
+ _MUTATION_OBSERVER = MutationObserver;
336
+ }
337
+ if (typeof performance !== 'undefined') {
338
+ _PERFORMANCE = performance;
339
+ }
340
+ } catch (e) {}
341
+
342
+ var _ref = _WINDOW.navigator || {},
343
+ _ref$userAgent = _ref.userAgent,
344
+ userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
345
+ var WINDOW = _WINDOW;
346
+ var DOCUMENT = _DOCUMENT;
347
+ var MUTATION_OBSERVER = _MUTATION_OBSERVER;
348
+ var PERFORMANCE = _PERFORMANCE;
349
+ var IS_BROWSER = !!WINDOW.document;
350
+ var IS_DOM =
351
+ !!DOCUMENT.documentElement &&
352
+ !!DOCUMENT.head &&
353
+ typeof DOCUMENT.addEventListener === 'function' &&
354
+ typeof DOCUMENT.createElement === 'function';
355
+ var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
356
+
357
+ var _familyProxy, _familyProxy2, _familyProxy3, _familyProxy4, _familyProxy5;
358
+
359
+ var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
360
+ var UNITS_IN_GRID = 16;
361
+ var DEFAULT_CSS_PREFIX = 'fa';
362
+ var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
363
+ var DATA_FA_I2SVG = 'data-fa-i2svg';
364
+ var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
365
+ var DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
366
+ var DATA_PREFIX = 'data-prefix';
367
+ var DATA_ICON = 'data-icon';
368
+ var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
369
+ var MUTATION_APPROACH_ASYNC = 'async';
370
+ var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
371
+ var PRODUCTION = (function () {
372
+ try {
373
+ return process.env.NODE_ENV === 'production';
374
+ } catch (e) {
375
+ return false;
376
+ }
377
+ })();
378
+ var FAMILY_CLASSIC = 'classic';
379
+ var FAMILY_SHARP = 'sharp';
380
+ var FAMILIES = [FAMILY_CLASSIC, FAMILY_SHARP];
381
+
382
+ function familyProxy(obj) {
383
+ // Defaults to the classic family if family is not available
384
+ return new Proxy(obj, {
385
+ get: function get(target, prop) {
386
+ return prop in target ? target[prop] : target[FAMILY_CLASSIC];
387
+ },
388
+ });
389
+ }
390
+ var PREFIX_TO_STYLE = familyProxy(
391
+ ((_familyProxy = {}),
392
+ _defineProperty(_familyProxy, FAMILY_CLASSIC, {
393
+ fa: 'solid',
394
+ fas: 'solid',
395
+ 'fa-solid': 'solid',
396
+ far: 'regular',
397
+ 'fa-regular': 'regular',
398
+ fal: 'light',
399
+ 'fa-light': 'light',
400
+ fat: 'thin',
401
+ 'fa-thin': 'thin',
402
+ fad: 'duotone',
403
+ 'fa-duotone': 'duotone',
404
+ fab: 'brands',
405
+ 'fa-brands': 'brands',
406
+ fak: 'kit',
407
+ 'fa-kit': 'kit',
408
+ }),
409
+ _defineProperty(_familyProxy, FAMILY_SHARP, {
410
+ fa: 'solid',
411
+ fass: 'solid',
412
+ 'fa-solid': 'solid',
413
+ fasr: 'regular',
414
+ 'fa-regular': 'regular',
415
+ fasl: 'light',
416
+ 'fa-light': 'light',
417
+ }),
418
+ _familyProxy),
419
+ );
420
+ var STYLE_TO_PREFIX = familyProxy(
421
+ ((_familyProxy2 = {}),
422
+ _defineProperty(_familyProxy2, FAMILY_CLASSIC, {
423
+ solid: 'fas',
424
+ regular: 'far',
425
+ light: 'fal',
426
+ thin: 'fat',
427
+ duotone: 'fad',
428
+ brands: 'fab',
429
+ kit: 'fak',
430
+ }),
431
+ _defineProperty(_familyProxy2, FAMILY_SHARP, {
432
+ solid: 'fass',
433
+ regular: 'fasr',
434
+ light: 'fasl',
435
+ }),
436
+ _familyProxy2),
437
+ );
438
+ var PREFIX_TO_LONG_STYLE = familyProxy(
439
+ ((_familyProxy3 = {}),
440
+ _defineProperty(_familyProxy3, FAMILY_CLASSIC, {
441
+ fab: 'fa-brands',
442
+ fad: 'fa-duotone',
443
+ fak: 'fa-kit',
444
+ fal: 'fa-light',
445
+ far: 'fa-regular',
446
+ fas: 'fa-solid',
447
+ fat: 'fa-thin',
448
+ }),
449
+ _defineProperty(_familyProxy3, FAMILY_SHARP, {
450
+ fass: 'fa-solid',
451
+ fasr: 'fa-regular',
452
+ fasl: 'fa-light',
453
+ }),
454
+ _familyProxy3),
455
+ );
456
+ var LONG_STYLE_TO_PREFIX = familyProxy(
457
+ ((_familyProxy4 = {}),
458
+ _defineProperty(_familyProxy4, FAMILY_CLASSIC, {
459
+ 'fa-brands': 'fab',
460
+ 'fa-duotone': 'fad',
461
+ 'fa-kit': 'fak',
462
+ 'fa-light': 'fal',
463
+ 'fa-regular': 'far',
464
+ 'fa-solid': 'fas',
465
+ 'fa-thin': 'fat',
466
+ }),
467
+ _defineProperty(_familyProxy4, FAMILY_SHARP, {
468
+ 'fa-solid': 'fass',
469
+ 'fa-regular': 'fasr',
470
+ 'fa-light': 'fasl',
471
+ }),
472
+ _familyProxy4),
473
+ );
474
+ var ICON_SELECTION_SYNTAX_PATTERN = /fa(s|r|l|t|d|b|k|ss|sr|sl)?[\-\ ]/; // eslint-disable-line no-useless-escape
475
+
476
+ var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
477
+ var FONT_FAMILY_PATTERN =
478
+ /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i;
479
+ var FONT_WEIGHT_TO_PREFIX = familyProxy(
480
+ ((_familyProxy5 = {}),
481
+ _defineProperty(_familyProxy5, FAMILY_CLASSIC, {
482
+ 900: 'fas',
483
+ 400: 'far',
484
+ normal: 'far',
485
+ 300: 'fal',
486
+ 100: 'fat',
487
+ }),
488
+ _defineProperty(_familyProxy5, FAMILY_SHARP, {
489
+ 900: 'fass',
490
+ 400: 'fasr',
491
+ 300: 'fasl',
492
+ }),
493
+ _familyProxy5),
494
+ );
495
+ var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
496
+ var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
497
+ var ATTRIBUTES_WATCHED_FOR_MUTATION = [
498
+ 'class',
499
+ 'data-prefix',
500
+ 'data-icon',
501
+ 'data-fa-transform',
502
+ 'data-fa-mask',
503
+ ];
504
+ var DUOTONE_CLASSES = {
505
+ GROUP: 'duotone-group',
506
+ SWAP_OPACITY: 'swap-opacity',
507
+ PRIMARY: 'primary',
508
+ SECONDARY: 'secondary',
509
+ };
510
+ var prefixes = new Set();
511
+ Object.keys(STYLE_TO_PREFIX[FAMILY_CLASSIC]).map(prefixes.add.bind(prefixes));
512
+ Object.keys(STYLE_TO_PREFIX[FAMILY_SHARP]).map(prefixes.add.bind(prefixes));
513
+ var RESERVED_CLASSES = []
514
+ .concat(FAMILIES, _toConsumableArray(prefixes), [
515
+ '2xs',
516
+ 'xs',
517
+ 'sm',
518
+ 'lg',
519
+ 'xl',
520
+ '2xl',
521
+ 'beat',
522
+ 'border',
523
+ 'fade',
524
+ 'beat-fade',
525
+ 'bounce',
526
+ 'flip-both',
527
+ 'flip-horizontal',
528
+ 'flip-vertical',
529
+ 'flip',
530
+ 'fw',
531
+ 'inverse',
532
+ 'layers-counter',
533
+ 'layers-text',
534
+ 'layers',
535
+ 'li',
536
+ 'pull-left',
537
+ 'pull-right',
538
+ 'pulse',
539
+ 'rotate-180',
540
+ 'rotate-270',
541
+ 'rotate-90',
542
+ 'rotate-by',
543
+ 'shake',
544
+ 'spin-pulse',
545
+ 'spin-reverse',
546
+ 'spin',
547
+ 'stack-1x',
548
+ 'stack-2x',
549
+ 'stack',
550
+ 'ul',
551
+ DUOTONE_CLASSES.GROUP,
552
+ DUOTONE_CLASSES.SWAP_OPACITY,
553
+ DUOTONE_CLASSES.PRIMARY,
554
+ DUOTONE_CLASSES.SECONDARY,
555
+ ])
556
+ .concat(
557
+ oneToTen.map(function (n) {
558
+ return ''.concat(n, 'x');
559
+ }),
560
+ )
561
+ .concat(
562
+ oneToTwenty.map(function (n) {
563
+ return 'w-'.concat(n);
564
+ }),
565
+ );
566
+
567
+ var initial = WINDOW.FontAwesomeConfig || {};
568
+
569
+ function getAttrConfig(attr) {
570
+ var element = DOCUMENT.querySelector('script[' + attr + ']');
571
+
572
+ if (element) {
573
+ return element.getAttribute(attr);
574
+ }
575
+ }
576
+
577
+ function coerce(val) {
578
+ // Getting an empty string will occur if the attribute is set on the HTML tag but without a value
579
+ // We'll assume that this is an indication that it should be toggled to true
580
+ if (val === '') {
581
+ return true;
582
+ }
583
+ if (val === 'false') {
584
+ return false;
585
+ }
586
+ if (val === 'true') {
587
+ return true;
588
+ }
589
+ return val;
590
+ }
591
+
592
+ if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
593
+ var attrs = [
594
+ ['data-family-prefix', 'familyPrefix'],
595
+ ['data-css-prefix', 'cssPrefix'],
596
+ ['data-family-default', 'familyDefault'],
597
+ ['data-style-default', 'styleDefault'],
598
+ ['data-replacement-class', 'replacementClass'],
599
+ ['data-auto-replace-svg', 'autoReplaceSvg'],
600
+ ['data-auto-add-css', 'autoAddCss'],
601
+ ['data-auto-a11y', 'autoA11y'],
602
+ ['data-search-pseudo-elements', 'searchPseudoElements'],
603
+ ['data-observe-mutations', 'observeMutations'],
604
+ ['data-mutate-approach', 'mutateApproach'],
605
+ ['data-keep-original-source', 'keepOriginalSource'],
606
+ ['data-measure-performance', 'measurePerformance'],
607
+ ['data-show-missing-icons', 'showMissingIcons'],
608
+ ];
609
+ attrs.forEach(function (_ref) {
610
+ var _ref2 = _slicedToArray(_ref, 2),
611
+ attr = _ref2[0],
612
+ key = _ref2[1];
613
+
614
+ var val = coerce(getAttrConfig(attr));
615
+
616
+ if (val !== undefined && val !== null) {
617
+ initial[key] = val;
618
+ }
619
+ });
620
+ }
621
+
622
+ var _default = {
623
+ styleDefault: 'solid',
624
+ familyDefault: 'classic',
625
+ cssPrefix: DEFAULT_CSS_PREFIX,
626
+ replacementClass: DEFAULT_REPLACEMENT_CLASS,
627
+ autoReplaceSvg: true,
628
+ autoAddCss: true,
629
+ autoA11y: true,
630
+ searchPseudoElements: false,
631
+ observeMutations: true,
632
+ mutateApproach: 'async',
633
+ keepOriginalSource: true,
634
+ measurePerformance: false,
635
+ showMissingIcons: true,
636
+ }; // familyPrefix is deprecated but we must still support it if present
637
+
638
+ if (initial.familyPrefix) {
639
+ initial.cssPrefix = initial.familyPrefix;
640
+ }
641
+
642
+ var _config = _objectSpread2(_objectSpread2({}, _default), initial);
643
+
644
+ if (!_config.autoReplaceSvg) {
645
+ _config.observeMutations = false;
646
+ }
647
+ var config = {};
648
+ Object.keys(_default).forEach(function (key) {
649
+ Object.defineProperty(config, key, {
650
+ enumerable: true,
651
+ set: function set(val) {
652
+ _config[key] = val;
653
+
654
+ _onChangeCb.forEach(function (cb) {
655
+ return cb(config);
656
+ });
657
+ },
658
+ get: function get() {
659
+ return _config[key];
660
+ },
661
+ });
662
+ }); // familyPrefix is deprecated as of 6.2.0 and should be removed in 7.0.0
663
+
664
+ Object.defineProperty(config, 'familyPrefix', {
665
+ enumerable: true,
666
+ set: function set(val) {
667
+ _config.cssPrefix = val;
668
+
669
+ _onChangeCb.forEach(function (cb) {
670
+ return cb(config);
671
+ });
672
+ },
673
+ get: function get() {
674
+ return _config.cssPrefix;
675
+ },
676
+ });
677
+ WINDOW.FontAwesomeConfig = config;
678
+ var _onChangeCb = [];
679
+ function onChange(cb) {
680
+ _onChangeCb.push(cb);
681
+
682
+ return function () {
683
+ _onChangeCb.splice(_onChangeCb.indexOf(cb), 1);
684
+ };
685
+ }
686
+
687
+ var d = UNITS_IN_GRID;
688
+ var meaninglessTransform = {
689
+ size: 16,
690
+ x: 0,
691
+ y: 0,
692
+ rotate: 0,
693
+ flipX: false,
694
+ flipY: false,
695
+ };
696
+ function insertCss(css) {
697
+ if (!css || !IS_DOM) {
698
+ return;
699
+ }
700
+
701
+ var style = DOCUMENT.createElement('style');
702
+ style.setAttribute('type', 'text/css');
703
+ style.innerHTML = css;
704
+ var headChildren = DOCUMENT.head.childNodes;
705
+ var beforeChild = null;
706
+
707
+ for (var i = headChildren.length - 1; i > -1; i--) {
708
+ var child = headChildren[i];
709
+ var tagName = (child.tagName || '').toUpperCase();
710
+
711
+ if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
712
+ beforeChild = child;
713
+ }
714
+ }
715
+
716
+ DOCUMENT.head.insertBefore(style, beforeChild);
717
+ return css;
718
+ }
719
+ var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
720
+ function nextUniqueId() {
721
+ var size = 12;
722
+ var id = '';
723
+
724
+ while (size-- > 0) {
725
+ id += idPool[(Math.random() * 62) | 0];
726
+ }
727
+
728
+ return id;
729
+ }
730
+ function toArray(obj) {
731
+ var array = [];
732
+
733
+ for (var i = (obj || []).length >>> 0; i--; ) {
734
+ array[i] = obj[i];
735
+ }
736
+
737
+ return array;
738
+ }
739
+ function classArray(node) {
740
+ if (node.classList) {
741
+ return toArray(node.classList);
742
+ } else {
743
+ return (node.getAttribute('class') || '').split(' ').filter(function (i) {
744
+ return i;
745
+ });
746
+ }
747
+ }
748
+ function htmlEscape(str) {
749
+ return ''
750
+ .concat(str)
751
+ .replace(/&/g, '&amp;')
752
+ .replace(/"/g, '&quot;')
753
+ .replace(/'/g, '&#39;')
754
+ .replace(/</g, '&lt;')
755
+ .replace(/>/g, '&gt;');
756
+ }
757
+ function joinAttributes(attributes) {
758
+ return Object.keys(attributes || {})
759
+ .reduce(function (acc, attributeName) {
760
+ return (
761
+ acc + ''.concat(attributeName, '="').concat(htmlEscape(attributes[attributeName]), '" ')
762
+ );
763
+ }, '')
764
+ .trim();
765
+ }
766
+ function joinStyles(styles) {
767
+ return Object.keys(styles || {}).reduce(function (acc, styleName) {
768
+ return acc + ''.concat(styleName, ': ').concat(styles[styleName].trim(), ';');
769
+ }, '');
770
+ }
771
+ function transformIsMeaningful(transform) {
772
+ return (
773
+ transform.size !== meaninglessTransform.size ||
774
+ transform.x !== meaninglessTransform.x ||
775
+ transform.y !== meaninglessTransform.y ||
776
+ transform.rotate !== meaninglessTransform.rotate ||
777
+ transform.flipX ||
778
+ transform.flipY
779
+ );
780
+ }
781
+ function transformForSvg(_ref) {
782
+ var transform = _ref.transform,
783
+ containerWidth = _ref.containerWidth,
784
+ iconWidth = _ref.iconWidth;
785
+ var outer = {
786
+ transform: 'translate('.concat(containerWidth / 2, ' 256)'),
787
+ };
788
+ var innerTranslate = 'translate('.concat(transform.x * 32, ', ').concat(transform.y * 32, ') ');
789
+ var innerScale = 'scale('
790
+ .concat((transform.size / 16) * (transform.flipX ? -1 : 1), ', ')
791
+ .concat((transform.size / 16) * (transform.flipY ? -1 : 1), ') ');
792
+ var innerRotate = 'rotate('.concat(transform.rotate, ' 0 0)');
793
+ var inner = {
794
+ transform: ''.concat(innerTranslate, ' ').concat(innerScale, ' ').concat(innerRotate),
795
+ };
796
+ var path = {
797
+ transform: 'translate('.concat((iconWidth / 2) * -1, ' -256)'),
798
+ };
799
+ return {
800
+ outer: outer,
801
+ inner: inner,
802
+ path: path,
803
+ };
804
+ }
805
+ function transformForCss(_ref2) {
806
+ var transform = _ref2.transform,
807
+ _ref2$width = _ref2.width,
808
+ width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,
809
+ _ref2$height = _ref2.height,
810
+ height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,
811
+ _ref2$startCentered = _ref2.startCentered,
812
+ startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;
813
+ var val = '';
814
+
815
+ if (startCentered && IS_IE) {
816
+ val += 'translate('
817
+ .concat(transform.x / d - width / 2, 'em, ')
818
+ .concat(transform.y / d - height / 2, 'em) ');
819
+ } else if (startCentered) {
820
+ val += 'translate(calc(-50% + '
821
+ .concat(transform.x / d, 'em), calc(-50% + ')
822
+ .concat(transform.y / d, 'em)) ');
823
+ } else {
824
+ val += 'translate('.concat(transform.x / d, 'em, ').concat(transform.y / d, 'em) ');
825
+ }
826
+
827
+ val += 'scale('
828
+ .concat((transform.size / d) * (transform.flipX ? -1 : 1), ', ')
829
+ .concat((transform.size / d) * (transform.flipY ? -1 : 1), ') ');
830
+ val += 'rotate('.concat(transform.rotate, 'deg) ');
831
+ return val;
832
+ }
833
+
834
+ var baseStyles =
835
+ ':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-counter-scale, 0.25));\n transform: scale(var(--fa-counter-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(var(--fa-li-width, 2em) * -1);\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n -webkit-animation-name: fa-beat;\n animation-name: fa-beat;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n -webkit-animation-name: fa-bounce;\n animation-name: fa-bounce;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n -webkit-animation-name: fa-fade;\n animation-name: fa-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n -webkit-animation-name: fa-beat-fade;\n animation-name: fa-beat-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n -webkit-animation-name: fa-flip;\n animation-name: fa-flip;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n -webkit-animation-name: fa-shake;\n animation-name: fa-shake;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 2s);\n animation-duration: var(--fa-animation-duration, 2s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n -webkit-animation-delay: -1ms;\n animation-delay: -1ms;\n -webkit-animation-duration: 1ms;\n animation-duration: 1ms;\n -webkit-animation-iteration-count: 1;\n animation-iteration-count: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n@-webkit-keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@-webkit-keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@-webkit-keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@-webkit-keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@-webkit-keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@-webkit-keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n -webkit-transform: rotate(var(--fa-rotate-angle, none));\n transform: rotate(var(--fa-rotate-angle, none));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';
836
+
837
+ function css() {
838
+ var dcp = DEFAULT_CSS_PREFIX;
839
+ var drc = DEFAULT_REPLACEMENT_CLASS;
840
+ var fp = config.cssPrefix;
841
+ var rc = config.replacementClass;
842
+ var s = baseStyles;
843
+
844
+ if (fp !== dcp || rc !== drc) {
845
+ var dPatt = new RegExp('\\.'.concat(dcp, '\\-'), 'g');
846
+ var customPropPatt = new RegExp('\\--'.concat(dcp, '\\-'), 'g');
847
+ var rPatt = new RegExp('\\.'.concat(drc), 'g');
848
+ s = s
849
+ .replace(dPatt, '.'.concat(fp, '-'))
850
+ .replace(customPropPatt, '--'.concat(fp, '-'))
851
+ .replace(rPatt, '.'.concat(rc));
852
+ }
853
+
854
+ return s;
855
+ }
856
+
857
+ var _cssInserted = false;
858
+
859
+ function ensureCss() {
860
+ if (config.autoAddCss && !_cssInserted) {
861
+ insertCss(css());
862
+ _cssInserted = true;
863
+ }
864
+ }
865
+
866
+ var InjectCSS = {
867
+ mixout: function mixout() {
868
+ return {
869
+ dom: {
870
+ css: css,
871
+ insertCss: ensureCss,
872
+ },
873
+ };
874
+ },
875
+ hooks: function hooks() {
876
+ return {
877
+ beforeDOMElementCreation: function beforeDOMElementCreation() {
878
+ ensureCss();
879
+ },
880
+ beforeI2svg: function beforeI2svg() {
881
+ ensureCss();
882
+ },
883
+ };
884
+ },
885
+ };
886
+
887
+ var w = WINDOW || {};
888
+ if (!w[NAMESPACE_IDENTIFIER]) {
889
+ w[NAMESPACE_IDENTIFIER] = {};
890
+ }
891
+ if (!w[NAMESPACE_IDENTIFIER].styles) {
892
+ w[NAMESPACE_IDENTIFIER].styles = {};
893
+ }
894
+ if (!w[NAMESPACE_IDENTIFIER].hooks) {
895
+ w[NAMESPACE_IDENTIFIER].hooks = {};
896
+ }
897
+ if (!w[NAMESPACE_IDENTIFIER].shims) {
898
+ w[NAMESPACE_IDENTIFIER].shims = [];
899
+ }
900
+ var namespace = w[NAMESPACE_IDENTIFIER];
901
+
902
+ var functions = [];
903
+
904
+ var listener = function listener() {
905
+ DOCUMENT.removeEventListener('DOMContentLoaded', listener);
906
+ loaded = 1;
907
+ functions.map(function (fn) {
908
+ return fn();
909
+ });
910
+ };
911
+
912
+ var loaded = false;
913
+
914
+ if (IS_DOM) {
915
+ loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(
916
+ DOCUMENT.readyState,
917
+ );
918
+ if (!loaded) {
919
+ DOCUMENT.addEventListener('DOMContentLoaded', listener);
920
+ }
921
+ }
922
+
923
+ function domready(fn) {
924
+ if (!IS_DOM) {
925
+ return;
926
+ }
927
+ loaded ? setTimeout(fn, 0) : functions.push(fn);
928
+ }
929
+
930
+ function toHtml(abstractNodes) {
931
+ var tag = abstractNodes.tag,
932
+ _abstractNodes$attrib = abstractNodes.attributes,
933
+ attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
934
+ _abstractNodes$childr = abstractNodes.children,
935
+ children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
936
+
937
+ if (typeof abstractNodes === 'string') {
938
+ return htmlEscape(abstractNodes);
939
+ } else {
940
+ return '<'
941
+ .concat(tag, ' ')
942
+ .concat(joinAttributes(attributes), '>')
943
+ .concat(children.map(toHtml).join(''), '</')
944
+ .concat(tag, '>');
945
+ }
946
+ }
947
+
948
+ function iconFromMapping(mapping, prefix, iconName) {
949
+ if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
950
+ return {
951
+ prefix: prefix,
952
+ iconName: iconName,
953
+ icon: mapping[prefix][iconName],
954
+ };
955
+ }
956
+ }
957
+
958
+ /**
959
+ * Internal helper to bind a function known to have 4 arguments
960
+ * to a given context.
961
+ */
962
+
963
+ var bindInternal4 = function bindInternal4(func, thisContext) {
964
+ return function (a, b, c, d) {
965
+ return func.call(thisContext, a, b, c, d);
966
+ };
967
+ };
968
+
969
+ /**
970
+ * # Reduce
971
+ *
972
+ * A fast object `.reduce()` implementation.
973
+ *
974
+ * @param {Object} subject The object to reduce over.
975
+ * @param {Function} fn The reducer function.
976
+ * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].
977
+ * @param {Object} thisContext The context for the reducer.
978
+ * @return {mixed} The final result.
979
+ */
980
+
981
+ var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
982
+ var keys = Object.keys(subject),
983
+ length = keys.length,
984
+ iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
985
+ i,
986
+ key,
987
+ result;
988
+
989
+ if (initialValue === undefined) {
990
+ i = 1;
991
+ result = subject[keys[0]];
992
+ } else {
993
+ i = 0;
994
+ result = initialValue;
995
+ }
996
+
997
+ for (; i < length; i++) {
998
+ key = keys[i];
999
+ result = iterator(result, subject[key], key, subject);
1000
+ }
1001
+
1002
+ return result;
1003
+ };
1004
+
1005
+ /**
1006
+ * ucs2decode() and codePointAt() are both works of Mathias Bynens and licensed under MIT
1007
+ *
1008
+ * Copyright Mathias Bynens <https://mathiasbynens.be/>
1009
+
1010
+ * Permission is hereby granted, free of charge, to any person obtaining
1011
+ * a copy of this software and associated documentation files (the
1012
+ * "Software"), to deal in the Software without restriction, including
1013
+ * without limitation the rights to use, copy, modify, merge, publish,
1014
+ * distribute, sublicense, and/or sell copies of the Software, and to
1015
+ * permit persons to whom the Software is furnished to do so, subject to
1016
+ * the following conditions:
1017
+
1018
+ * The above copyright notice and this permission notice shall be
1019
+ * included in all copies or substantial portions of the Software.
1020
+
1021
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1022
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1023
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1024
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1025
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1026
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1027
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1028
+ */
1029
+ function ucs2decode(string) {
1030
+ var output = [];
1031
+ var counter = 0;
1032
+ var length = string.length;
1033
+
1034
+ while (counter < length) {
1035
+ var value = string.charCodeAt(counter++);
1036
+
1037
+ if (value >= 0xd800 && value <= 0xdbff && counter < length) {
1038
+ var extra = string.charCodeAt(counter++);
1039
+
1040
+ if ((extra & 0xfc00) == 0xdc00) {
1041
+ // eslint-disable-line eqeqeq
1042
+ output.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
1043
+ } else {
1044
+ output.push(value);
1045
+ counter--;
1046
+ }
1047
+ } else {
1048
+ output.push(value);
1049
+ }
1050
+ }
1051
+
1052
+ return output;
1053
+ }
1054
+
1055
+ function toHex(unicode) {
1056
+ var decoded = ucs2decode(unicode);
1057
+ return decoded.length === 1 ? decoded[0].toString(16) : null;
1058
+ }
1059
+ function codePointAt(string, index) {
1060
+ var size = string.length;
1061
+ var first = string.charCodeAt(index);
1062
+ var second;
1063
+
1064
+ if (first >= 0xd800 && first <= 0xdbff && size > index + 1) {
1065
+ second = string.charCodeAt(index + 1);
1066
+
1067
+ if (second >= 0xdc00 && second <= 0xdfff) {
1068
+ return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000;
1069
+ }
1070
+ }
1071
+
1072
+ return first;
1073
+ }
1074
+
1075
+ function normalizeIcons(icons) {
1076
+ return Object.keys(icons).reduce(function (acc, iconName) {
1077
+ var icon = icons[iconName];
1078
+ var expanded = !!icon.icon;
1079
+
1080
+ if (expanded) {
1081
+ acc[icon.iconName] = icon.icon;
1082
+ } else {
1083
+ acc[iconName] = icon;
1084
+ }
1085
+
1086
+ return acc;
1087
+ }, {});
1088
+ }
1089
+
1090
+ function defineIcons(prefix, icons) {
1091
+ var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1092
+ var _params$skipHooks = params.skipHooks,
1093
+ skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
1094
+ var normalized = normalizeIcons(icons);
1095
+
1096
+ if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
1097
+ namespace.hooks.addPack(prefix, normalizeIcons(icons));
1098
+ } else {
1099
+ namespace.styles[prefix] = _objectSpread2(
1100
+ _objectSpread2({}, namespace.styles[prefix] || {}),
1101
+ normalized,
1102
+ );
1103
+ }
1104
+ /**
1105
+ * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
1106
+ * of new styles we needed to differentiate between them. Prefix `fa` is now an alias
1107
+ * for `fas` so we'll ease the upgrade process for our users by automatically defining
1108
+ * this as well.
1109
+ */
1110
+
1111
+ if (prefix === 'fas') {
1112
+ defineIcons('fa', icons);
1113
+ }
1114
+ }
1115
+
1116
+ var duotonePathRe = [
1117
+ /*#__PURE__*/ _wrapRegExp(/path d="((?:(?!")[\s\S])+)".*path d="((?:(?!")[\s\S])+)"/, {
1118
+ d1: 1,
1119
+ d2: 2,
1120
+ }),
1121
+ /*#__PURE__*/ _wrapRegExp(
1122
+ /path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)".*path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)"/,
1123
+ {
1124
+ cls1: 1,
1125
+ d1: 2,
1126
+ cls2: 3,
1127
+ d2: 4,
1128
+ },
1129
+ ),
1130
+ /*#__PURE__*/ _wrapRegExp(/path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)"/, {
1131
+ cls1: 1,
1132
+ d1: 2,
1133
+ }),
1134
+ ];
1135
+
1136
+ var _LONG_STYLE, _PREFIXES, _PREFIXES_FOR_FAMILY;
1137
+ var styles = namespace.styles,
1138
+ shims = namespace.shims;
1139
+ var LONG_STYLE =
1140
+ ((_LONG_STYLE = {}),
1141
+ _defineProperty(_LONG_STYLE, FAMILY_CLASSIC, Object.values(PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC])),
1142
+ _defineProperty(_LONG_STYLE, FAMILY_SHARP, Object.values(PREFIX_TO_LONG_STYLE[FAMILY_SHARP])),
1143
+ _LONG_STYLE);
1144
+ var _defaultUsablePrefix = null;
1145
+ var _byUnicode = {};
1146
+ var _byLigature = {};
1147
+ var _byOldName = {};
1148
+ var _byOldUnicode = {};
1149
+ var _byAlias = {};
1150
+ var PREFIXES =
1151
+ ((_PREFIXES = {}),
1152
+ _defineProperty(_PREFIXES, FAMILY_CLASSIC, Object.keys(PREFIX_TO_STYLE[FAMILY_CLASSIC])),
1153
+ _defineProperty(_PREFIXES, FAMILY_SHARP, Object.keys(PREFIX_TO_STYLE[FAMILY_SHARP])),
1154
+ _PREFIXES);
1155
+
1156
+ function isReserved(name) {
1157
+ return ~RESERVED_CLASSES.indexOf(name);
1158
+ }
1159
+
1160
+ function getIconName(cssPrefix, cls) {
1161
+ var parts = cls.split('-');
1162
+ var prefix = parts[0];
1163
+ var iconName = parts.slice(1).join('-');
1164
+
1165
+ if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {
1166
+ return iconName;
1167
+ } else {
1168
+ return null;
1169
+ }
1170
+ }
1171
+ var build = function build() {
1172
+ var lookup = function lookup(reducer) {
1173
+ return reduce(
1174
+ styles,
1175
+ function (o, style, prefix) {
1176
+ o[prefix] = reduce(style, reducer, {});
1177
+ return o;
1178
+ },
1179
+ {},
1180
+ );
1181
+ };
1182
+
1183
+ _byUnicode = lookup(function (acc, icon, iconName) {
1184
+ if (icon[3]) {
1185
+ acc[icon[3]] = iconName;
1186
+ }
1187
+
1188
+ if (icon[2]) {
1189
+ var aliases = icon[2].filter(function (a) {
1190
+ return typeof a === 'number';
1191
+ });
1192
+ aliases.forEach(function (alias) {
1193
+ acc[alias.toString(16)] = iconName;
1194
+ });
1195
+ }
1196
+
1197
+ return acc;
1198
+ });
1199
+ _byLigature = lookup(function (acc, icon, iconName) {
1200
+ acc[iconName] = iconName;
1201
+
1202
+ if (icon[2]) {
1203
+ var aliases = icon[2].filter(function (a) {
1204
+ return typeof a === 'string';
1205
+ });
1206
+ aliases.forEach(function (alias) {
1207
+ acc[alias] = iconName;
1208
+ });
1209
+ }
1210
+
1211
+ return acc;
1212
+ });
1213
+ _byAlias = lookup(function (acc, icon, iconName) {
1214
+ var aliases = icon[2];
1215
+ acc[iconName] = iconName;
1216
+ aliases.forEach(function (alias) {
1217
+ acc[alias] = iconName;
1218
+ });
1219
+ return acc;
1220
+ }); // If we have a Kit, we can't determine if regular is available since we
1221
+ // could be auto-fetching it. We'll have to assume that it is available.
1222
+
1223
+ var hasRegular = 'far' in styles || config.autoFetchSvg;
1224
+ var shimLookups = reduce(
1225
+ shims,
1226
+ function (acc, shim) {
1227
+ var maybeNameMaybeUnicode = shim[0];
1228
+ var prefix = shim[1];
1229
+ var iconName = shim[2];
1230
+
1231
+ if (prefix === 'far' && !hasRegular) {
1232
+ prefix = 'fas';
1233
+ }
1234
+
1235
+ if (typeof maybeNameMaybeUnicode === 'string') {
1236
+ acc.names[maybeNameMaybeUnicode] = {
1237
+ prefix: prefix,
1238
+ iconName: iconName,
1239
+ };
1240
+ }
1241
+
1242
+ if (typeof maybeNameMaybeUnicode === 'number') {
1243
+ acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {
1244
+ prefix: prefix,
1245
+ iconName: iconName,
1246
+ };
1247
+ }
1248
+
1249
+ return acc;
1250
+ },
1251
+ {
1252
+ names: {},
1253
+ unicodes: {},
1254
+ },
1255
+ );
1256
+ _byOldName = shimLookups.names;
1257
+ _byOldUnicode = shimLookups.unicodes;
1258
+ _defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {
1259
+ family: config.familyDefault,
1260
+ });
1261
+ };
1262
+ onChange(function (c) {
1263
+ _defaultUsablePrefix = getCanonicalPrefix(c.styleDefault, {
1264
+ family: config.familyDefault,
1265
+ });
1266
+ });
1267
+ build();
1268
+ function byUnicode(prefix, unicode) {
1269
+ return (_byUnicode[prefix] || {})[unicode];
1270
+ }
1271
+ function byLigature(prefix, ligature) {
1272
+ return (_byLigature[prefix] || {})[ligature];
1273
+ }
1274
+ function byAlias(prefix, alias) {
1275
+ return (_byAlias[prefix] || {})[alias];
1276
+ }
1277
+ function byOldName(name) {
1278
+ return (
1279
+ _byOldName[name] || {
1280
+ prefix: null,
1281
+ iconName: null,
1282
+ }
1283
+ );
1284
+ }
1285
+ function byOldUnicode(unicode) {
1286
+ var oldUnicode = _byOldUnicode[unicode];
1287
+ var newUnicode = byUnicode('fas', unicode);
1288
+ return (
1289
+ oldUnicode ||
1290
+ (newUnicode
1291
+ ? {
1292
+ prefix: 'fas',
1293
+ iconName: newUnicode,
1294
+ }
1295
+ : null) || {
1296
+ prefix: null,
1297
+ iconName: null,
1298
+ }
1299
+ );
1300
+ }
1301
+ function getDefaultUsablePrefix() {
1302
+ return _defaultUsablePrefix;
1303
+ }
1304
+ var emptyCanonicalIcon = function emptyCanonicalIcon() {
1305
+ return {
1306
+ prefix: null,
1307
+ iconName: null,
1308
+ rest: [],
1309
+ };
1310
+ };
1311
+ function getCanonicalPrefix(styleOrPrefix) {
1312
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1313
+ var _params$family = params.family,
1314
+ family = _params$family === void 0 ? FAMILY_CLASSIC : _params$family;
1315
+ var style = PREFIX_TO_STYLE[family][styleOrPrefix];
1316
+ var prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];
1317
+ var defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;
1318
+ return prefix || defined || null;
1319
+ }
1320
+ var PREFIXES_FOR_FAMILY =
1321
+ ((_PREFIXES_FOR_FAMILY = {}),
1322
+ _defineProperty(
1323
+ _PREFIXES_FOR_FAMILY,
1324
+ FAMILY_CLASSIC,
1325
+ Object.keys(PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC]),
1326
+ ),
1327
+ _defineProperty(
1328
+ _PREFIXES_FOR_FAMILY,
1329
+ FAMILY_SHARP,
1330
+ Object.keys(PREFIX_TO_LONG_STYLE[FAMILY_SHARP]),
1331
+ ),
1332
+ _PREFIXES_FOR_FAMILY);
1333
+ function getCanonicalIcon(values) {
1334
+ var _famProps;
1335
+
1336
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1337
+ var _params$skipLookups = params.skipLookups,
1338
+ skipLookups = _params$skipLookups === void 0 ? false : _params$skipLookups;
1339
+ var famProps =
1340
+ ((_famProps = {}),
1341
+ _defineProperty(
1342
+ _famProps,
1343
+ FAMILY_CLASSIC,
1344
+ ''.concat(config.cssPrefix, '-').concat(FAMILY_CLASSIC),
1345
+ ),
1346
+ _defineProperty(_famProps, FAMILY_SHARP, ''.concat(config.cssPrefix, '-').concat(FAMILY_SHARP)),
1347
+ _famProps);
1348
+ var givenPrefix = null;
1349
+ var family = FAMILY_CLASSIC;
1350
+
1351
+ if (
1352
+ values.includes(famProps[FAMILY_CLASSIC]) ||
1353
+ values.some(function (v) {
1354
+ return PREFIXES_FOR_FAMILY[FAMILY_CLASSIC].includes(v);
1355
+ })
1356
+ ) {
1357
+ family = FAMILY_CLASSIC;
1358
+ }
1359
+
1360
+ if (
1361
+ values.includes(famProps[FAMILY_SHARP]) ||
1362
+ values.some(function (v) {
1363
+ return PREFIXES_FOR_FAMILY[FAMILY_SHARP].includes(v);
1364
+ })
1365
+ ) {
1366
+ family = FAMILY_SHARP;
1367
+ }
1368
+
1369
+ var canonical = values.reduce(function (acc, cls) {
1370
+ var iconName = getIconName(config.cssPrefix, cls);
1371
+
1372
+ if (styles[cls]) {
1373
+ cls = LONG_STYLE[family].includes(cls) ? LONG_STYLE_TO_PREFIX[family][cls] : cls;
1374
+ givenPrefix = cls;
1375
+ acc.prefix = cls;
1376
+ } else if (PREFIXES[family].indexOf(cls) > -1) {
1377
+ givenPrefix = cls;
1378
+ acc.prefix = getCanonicalPrefix(cls, {
1379
+ family: family,
1380
+ });
1381
+ } else if (iconName) {
1382
+ acc.iconName = iconName;
1383
+ } else if (
1384
+ cls !== config.replacementClass &&
1385
+ cls !== famProps[FAMILY_CLASSIC] &&
1386
+ cls !== famProps[FAMILY_SHARP]
1387
+ ) {
1388
+ acc.rest.push(cls);
1389
+ }
1390
+
1391
+ if (!skipLookups && acc.prefix && acc.iconName) {
1392
+ var shim = givenPrefix === 'fa' ? byOldName(acc.iconName) : {};
1393
+ var aliasIconName = byAlias(acc.prefix, acc.iconName);
1394
+
1395
+ if (shim.prefix) {
1396
+ givenPrefix = null;
1397
+ }
1398
+
1399
+ acc.iconName = shim.iconName || aliasIconName || acc.iconName;
1400
+ acc.prefix = shim.prefix || acc.prefix;
1401
+
1402
+ if (acc.prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {
1403
+ // Allow a fallback from the regular style to solid if regular is not available
1404
+ // but only if we aren't auto-fetching SVGs
1405
+ acc.prefix = 'fas';
1406
+ }
1407
+ }
1408
+
1409
+ return acc;
1410
+ }, emptyCanonicalIcon());
1411
+
1412
+ if (values.includes('fa-brands') || values.includes('fab')) {
1413
+ canonical.prefix = 'fab';
1414
+ }
1415
+
1416
+ if (values.includes('fa-duotone') || values.includes('fad')) {
1417
+ canonical.prefix = 'fad';
1418
+ }
1419
+
1420
+ if (!canonical.prefix && family === FAMILY_SHARP && (styles['fass'] || config.autoFetchSvg)) {
1421
+ canonical.prefix = 'fass';
1422
+ canonical.iconName = byAlias(canonical.prefix, canonical.iconName) || canonical.iconName;
1423
+ }
1424
+
1425
+ if (canonical.prefix === 'fa' || givenPrefix === 'fa') {
1426
+ // The fa prefix is not canonical. So if it has made it through until this point
1427
+ // we will shift it to the correct prefix.
1428
+ canonical.prefix = getDefaultUsablePrefix() || 'fas';
1429
+ }
1430
+
1431
+ return canonical;
1432
+ }
1433
+
1434
+ /**
1435
+ * @type Library
1436
+ */
1437
+ var Library = /*#__PURE__*/ (function () {
1438
+ function Library() {
1439
+ _classCallCheck(this, Library);
1440
+
1441
+ this.definitions = {};
1442
+ }
1443
+
1444
+ _createClass(Library, [
1445
+ {
1446
+ key: 'add',
1447
+ value: function add() {
1448
+ var _this = this;
1449
+
1450
+ for (
1451
+ var _len = arguments.length, definitions = new Array(_len), _key = 0;
1452
+ _key < _len;
1453
+ _key++
1454
+ ) {
1455
+ definitions[_key] = arguments[_key];
1456
+ }
1457
+
1458
+ var additions = definitions.reduce(this._pullDefinitions, {});
1459
+ Object.keys(additions).forEach(function (key) {
1460
+ _this.definitions[key] = _objectSpread2(
1461
+ _objectSpread2({}, _this.definitions[key] || {}),
1462
+ additions[key],
1463
+ );
1464
+ defineIcons(key, additions[key]); // TODO can we stop doing this? We can't get the icons by 'fa-solid' any longer so this probably needs to change
1465
+
1466
+ var longPrefix = PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC][key];
1467
+ if (longPrefix) {
1468
+ defineIcons(longPrefix, additions[key]);
1469
+ }
1470
+ build();
1471
+ });
1472
+ },
1473
+ },
1474
+ {
1475
+ key: 'reset',
1476
+ value: function reset() {
1477
+ this.definitions = {};
1478
+ },
1479
+ },
1480
+ {
1481
+ key: '_pullDefinitions',
1482
+ value: function _pullDefinitions(additions, definition) {
1483
+ var normalized =
1484
+ definition.prefix && definition.iconName && definition.icon
1485
+ ? {
1486
+ 0: definition,
1487
+ }
1488
+ : definition;
1489
+ Object.keys(normalized).map(function (key) {
1490
+ var _normalized$key = normalized[key],
1491
+ prefix = _normalized$key.prefix,
1492
+ iconName = _normalized$key.iconName,
1493
+ icon = _normalized$key.icon;
1494
+ var aliases = icon[2];
1495
+ if (!additions[prefix]) {
1496
+ additions[prefix] = {};
1497
+ }
1498
+
1499
+ if (aliases.length > 0) {
1500
+ aliases.forEach(function (alias) {
1501
+ if (typeof alias === 'string') {
1502
+ additions[prefix][alias] = icon;
1503
+ }
1504
+ });
1505
+ }
1506
+
1507
+ additions[prefix][iconName] = icon;
1508
+ });
1509
+ return additions;
1510
+ },
1511
+ },
1512
+ ]);
1513
+
1514
+ return Library;
1515
+ })();
1516
+
1517
+ var _plugins = [];
1518
+ var _hooks = {};
1519
+ var providers = {};
1520
+ var defaultProviderKeys = Object.keys(providers);
1521
+ function registerPlugins(nextPlugins, _ref) {
1522
+ var obj = _ref.mixoutsTo;
1523
+ _plugins = nextPlugins;
1524
+ _hooks = {};
1525
+ Object.keys(providers).forEach(function (k) {
1526
+ if (defaultProviderKeys.indexOf(k) === -1) {
1527
+ delete providers[k];
1528
+ }
1529
+ });
1530
+
1531
+ _plugins.forEach(function (plugin) {
1532
+ var mixout = plugin.mixout ? plugin.mixout() : {};
1533
+ Object.keys(mixout).forEach(function (tk) {
1534
+ if (typeof mixout[tk] === 'function') {
1535
+ obj[tk] = mixout[tk];
1536
+ }
1537
+
1538
+ if (_typeof(mixout[tk]) === 'object') {
1539
+ Object.keys(mixout[tk]).forEach(function (sk) {
1540
+ if (!obj[tk]) {
1541
+ obj[tk] = {};
1542
+ }
1543
+
1544
+ obj[tk][sk] = mixout[tk][sk];
1545
+ });
1546
+ }
1547
+ });
1548
+
1549
+ if (plugin.hooks) {
1550
+ var hooks = plugin.hooks();
1551
+ Object.keys(hooks).forEach(function (hook) {
1552
+ if (!_hooks[hook]) {
1553
+ _hooks[hook] = [];
1554
+ }
1555
+
1556
+ _hooks[hook].push(hooks[hook]);
1557
+ });
1558
+ }
1559
+
1560
+ if (plugin.provides) {
1561
+ plugin.provides(providers);
1562
+ }
1563
+ });
1564
+
1565
+ return obj;
1566
+ }
1567
+ function chainHooks(hook, accumulator) {
1568
+ for (
1569
+ var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2;
1570
+ _key < _len;
1571
+ _key++
1572
+ ) {
1573
+ args[_key - 2] = arguments[_key];
1574
+ }
1575
+
1576
+ var hookFns = _hooks[hook] || [];
1577
+ hookFns.forEach(function (hookFn) {
1578
+ accumulator = hookFn.apply(null, [accumulator].concat(args)); // eslint-disable-line no-useless-call
1579
+ });
1580
+ return accumulator;
1581
+ }
1582
+ function callHooks(hook) {
1583
+ for (
1584
+ var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1;
1585
+ _key2 < _len2;
1586
+ _key2++
1587
+ ) {
1588
+ args[_key2 - 1] = arguments[_key2];
1589
+ }
1590
+
1591
+ var hookFns = _hooks[hook] || [];
1592
+ hookFns.forEach(function (hookFn) {
1593
+ hookFn.apply(null, args);
1594
+ });
1595
+ return undefined;
1596
+ }
1597
+ function callProvided() {
1598
+ var hook = arguments[0];
1599
+ var args = Array.prototype.slice.call(arguments, 1);
1600
+ return providers[hook] ? providers[hook].apply(null, args) : undefined;
1601
+ }
1602
+
1603
+ function findIconDefinition(iconLookup) {
1604
+ if (iconLookup.prefix === 'fa') {
1605
+ iconLookup.prefix = 'fas';
1606
+ }
1607
+
1608
+ var iconName = iconLookup.iconName;
1609
+ var prefix = iconLookup.prefix || getDefaultUsablePrefix();
1610
+ if (!iconName) {
1611
+ return;
1612
+ }
1613
+ iconName = byAlias(prefix, iconName) || iconName;
1614
+ return (
1615
+ iconFromMapping(library.definitions, prefix, iconName) ||
1616
+ iconFromMapping(namespace.styles, prefix, iconName)
1617
+ );
1618
+ }
1619
+ var library = new Library();
1620
+ var noAuto = function noAuto() {
1621
+ config.autoReplaceSvg = false;
1622
+ config.observeMutations = false;
1623
+ callHooks('noAuto');
1624
+ };
1625
+ var dom = {
1626
+ i2svg: function i2svg() {
1627
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1628
+
1629
+ if (IS_DOM) {
1630
+ callHooks('beforeI2svg', params);
1631
+ callProvided('pseudoElements2svg', params);
1632
+ return callProvided('i2svg', params);
1633
+ } else {
1634
+ return Promise.reject('Operation requires a DOM of some kind.');
1635
+ }
1636
+ },
1637
+ watch: function watch() {
1638
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1639
+ var autoReplaceSvgRoot = params.autoReplaceSvgRoot;
1640
+
1641
+ if (config.autoReplaceSvg === false) {
1642
+ config.autoReplaceSvg = true;
1643
+ }
1644
+
1645
+ config.observeMutations = true;
1646
+ domready(function () {
1647
+ autoReplace({
1648
+ autoReplaceSvgRoot: autoReplaceSvgRoot,
1649
+ });
1650
+ callHooks('watch', params);
1651
+ });
1652
+ },
1653
+ };
1654
+ var parse = {
1655
+ icon: function icon(_icon) {
1656
+ if (_icon === null) {
1657
+ return null;
1658
+ }
1659
+
1660
+ if (_typeof(_icon) === 'object' && _icon.prefix && _icon.iconName) {
1661
+ return {
1662
+ prefix: _icon.prefix,
1663
+ iconName: byAlias(_icon.prefix, _icon.iconName) || _icon.iconName,
1664
+ };
1665
+ }
1666
+
1667
+ if (Array.isArray(_icon) && _icon.length === 2) {
1668
+ var iconName = _icon[1].indexOf('fa-') === 0 ? _icon[1].slice(3) : _icon[1];
1669
+ var prefix = getCanonicalPrefix(_icon[0]);
1670
+ return {
1671
+ prefix: prefix,
1672
+ iconName: byAlias(prefix, iconName) || iconName,
1673
+ };
1674
+ }
1675
+
1676
+ if (
1677
+ typeof _icon === 'string' &&
1678
+ (_icon.indexOf(''.concat(config.cssPrefix, '-')) > -1 ||
1679
+ _icon.match(ICON_SELECTION_SYNTAX_PATTERN))
1680
+ ) {
1681
+ var canonicalIcon = getCanonicalIcon(_icon.split(' '), {
1682
+ skipLookups: true,
1683
+ });
1684
+ return {
1685
+ prefix: canonicalIcon.prefix || getDefaultUsablePrefix(),
1686
+ iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName,
1687
+ };
1688
+ }
1689
+
1690
+ if (typeof _icon === 'string') {
1691
+ var _prefix = getDefaultUsablePrefix();
1692
+
1693
+ return {
1694
+ prefix: _prefix,
1695
+ iconName: byAlias(_prefix, _icon) || _icon,
1696
+ };
1697
+ }
1698
+ },
1699
+ };
1700
+ var api = {
1701
+ noAuto: noAuto,
1702
+ config: config,
1703
+ dom: dom,
1704
+ parse: parse,
1705
+ library: library,
1706
+ findIconDefinition: findIconDefinition,
1707
+ toHtml: toHtml,
1708
+ };
1709
+
1710
+ var autoReplace = function autoReplace() {
1711
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1712
+ var _params$autoReplaceSv = params.autoReplaceSvgRoot,
1713
+ autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;
1714
+ if (
1715
+ (Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) &&
1716
+ IS_DOM &&
1717
+ config.autoReplaceSvg
1718
+ ) {
1719
+ api.dom.i2svg({
1720
+ node: autoReplaceSvgRoot,
1721
+ });
1722
+ }
1723
+ };
1724
+
1725
+ function domVariants(val, abstractCreator) {
1726
+ Object.defineProperty(val, 'abstract', {
1727
+ get: abstractCreator,
1728
+ });
1729
+ Object.defineProperty(val, 'html', {
1730
+ get: function get() {
1731
+ return val.abstract.map(function (a) {
1732
+ return toHtml(a);
1733
+ });
1734
+ },
1735
+ });
1736
+ Object.defineProperty(val, 'node', {
1737
+ get: function get() {
1738
+ if (!IS_DOM) {
1739
+ return;
1740
+ }
1741
+ var container = DOCUMENT.createElement('div');
1742
+ container.innerHTML = val.html;
1743
+ return container.children;
1744
+ },
1745
+ });
1746
+ return val;
1747
+ }
1748
+
1749
+ function asIcon(_ref) {
1750
+ var children = _ref.children,
1751
+ main = _ref.main,
1752
+ mask = _ref.mask,
1753
+ attributes = _ref.attributes,
1754
+ styles = _ref.styles,
1755
+ transform = _ref.transform;
1756
+
1757
+ if (transformIsMeaningful(transform) && main.found && !mask.found) {
1758
+ var width = main.width,
1759
+ height = main.height;
1760
+ var offset = {
1761
+ x: width / height / 2,
1762
+ y: 0.5,
1763
+ };
1764
+ attributes['style'] = joinStyles(
1765
+ _objectSpread2(
1766
+ _objectSpread2({}, styles),
1767
+ {},
1768
+ {
1769
+ 'transform-origin': ''
1770
+ .concat(offset.x + transform.x / 16, 'em ')
1771
+ .concat(offset.y + transform.y / 16, 'em'),
1772
+ },
1773
+ ),
1774
+ );
1775
+ }
1776
+
1777
+ return [
1778
+ {
1779
+ tag: 'svg',
1780
+ attributes: attributes,
1781
+ children: children,
1782
+ },
1783
+ ];
1784
+ }
1785
+
1786
+ function asSymbol(_ref) {
1787
+ var prefix = _ref.prefix,
1788
+ iconName = _ref.iconName,
1789
+ children = _ref.children,
1790
+ attributes = _ref.attributes,
1791
+ symbol = _ref.symbol;
1792
+ var id =
1793
+ symbol === true
1794
+ ? ''.concat(prefix, '-').concat(config.cssPrefix, '-').concat(iconName)
1795
+ : symbol;
1796
+ return [
1797
+ {
1798
+ tag: 'svg',
1799
+ attributes: {
1800
+ style: 'display: none;',
1801
+ },
1802
+ children: [
1803
+ {
1804
+ tag: 'symbol',
1805
+ attributes: _objectSpread2(
1806
+ _objectSpread2({}, attributes),
1807
+ {},
1808
+ {
1809
+ id: id,
1810
+ },
1811
+ ),
1812
+ children: children,
1813
+ },
1814
+ ],
1815
+ },
1816
+ ];
1817
+ }
1818
+
1819
+ function makeInlineSvgAbstract(params) {
1820
+ var _params$icons = params.icons,
1821
+ main = _params$icons.main,
1822
+ mask = _params$icons.mask,
1823
+ prefix = params.prefix,
1824
+ iconName = params.iconName,
1825
+ transform = params.transform,
1826
+ symbol = params.symbol,
1827
+ title = params.title,
1828
+ maskId = params.maskId,
1829
+ titleId = params.titleId,
1830
+ extra = params.extra,
1831
+ _params$watchable = params.watchable,
1832
+ watchable = _params$watchable === void 0 ? false : _params$watchable;
1833
+
1834
+ var _ref = mask.found ? mask : main,
1835
+ width = _ref.width,
1836
+ height = _ref.height;
1837
+
1838
+ var isUploadedIcon = prefix === 'fak';
1839
+ var attrClass = [
1840
+ config.replacementClass,
1841
+ iconName ? ''.concat(config.cssPrefix, '-').concat(iconName) : '',
1842
+ ]
1843
+ .filter(function (c) {
1844
+ return extra.classes.indexOf(c) === -1;
1845
+ })
1846
+ .filter(function (c) {
1847
+ return c !== '' || !!c;
1848
+ })
1849
+ .concat(extra.classes)
1850
+ .join(' ');
1851
+ var content = {
1852
+ children: [],
1853
+ attributes: _objectSpread2(
1854
+ _objectSpread2({}, extra.attributes),
1855
+ {},
1856
+ {
1857
+ 'data-prefix': prefix,
1858
+ 'data-icon': iconName,
1859
+ class: attrClass,
1860
+ role: extra.attributes.role || 'img',
1861
+ xmlns: 'http://www.w3.org/2000/svg',
1862
+ viewBox: '0 0 '.concat(width, ' ').concat(height),
1863
+ },
1864
+ ),
1865
+ };
1866
+ var uploadedIconWidthStyle =
1867
+ isUploadedIcon && !~extra.classes.indexOf('fa-fw')
1868
+ ? {
1869
+ width: ''.concat((width / height) * 16 * 0.0625, 'em'),
1870
+ }
1871
+ : {};
1872
+
1873
+ if (watchable) {
1874
+ content.attributes[DATA_FA_I2SVG] = '';
1875
+ }
1876
+
1877
+ if (title) {
1878
+ content.children.push({
1879
+ tag: 'title',
1880
+ attributes: {
1881
+ id: content.attributes['aria-labelledby'] || 'title-'.concat(titleId || nextUniqueId()),
1882
+ },
1883
+ children: [title],
1884
+ });
1885
+ delete content.attributes.title;
1886
+ }
1887
+
1888
+ var args = _objectSpread2(
1889
+ _objectSpread2({}, content),
1890
+ {},
1891
+ {
1892
+ prefix: prefix,
1893
+ iconName: iconName,
1894
+ main: main,
1895
+ mask: mask,
1896
+ maskId: maskId,
1897
+ transform: transform,
1898
+ symbol: symbol,
1899
+ styles: _objectSpread2(_objectSpread2({}, uploadedIconWidthStyle), extra.styles),
1900
+ },
1901
+ );
1902
+
1903
+ var _ref2 =
1904
+ mask.found && main.found
1905
+ ? callProvided('generateAbstractMask', args) || {
1906
+ children: [],
1907
+ attributes: {},
1908
+ }
1909
+ : callProvided('generateAbstractIcon', args) || {
1910
+ children: [],
1911
+ attributes: {},
1912
+ },
1913
+ children = _ref2.children,
1914
+ attributes = _ref2.attributes;
1915
+
1916
+ args.children = children;
1917
+ args.attributes = attributes;
1918
+
1919
+ if (symbol) {
1920
+ return asSymbol(args);
1921
+ } else {
1922
+ return asIcon(args);
1923
+ }
1924
+ }
1925
+ function makeLayersTextAbstract(params) {
1926
+ var content = params.content,
1927
+ width = params.width,
1928
+ height = params.height,
1929
+ transform = params.transform,
1930
+ title = params.title,
1931
+ extra = params.extra,
1932
+ _params$watchable2 = params.watchable,
1933
+ watchable = _params$watchable2 === void 0 ? false : _params$watchable2;
1934
+
1935
+ var attributes = _objectSpread2(
1936
+ _objectSpread2(
1937
+ _objectSpread2({}, extra.attributes),
1938
+ title
1939
+ ? {
1940
+ title: title,
1941
+ }
1942
+ : {},
1943
+ ),
1944
+ {},
1945
+ {
1946
+ class: extra.classes.join(' '),
1947
+ },
1948
+ );
1949
+
1950
+ if (watchable) {
1951
+ attributes[DATA_FA_I2SVG] = '';
1952
+ }
1953
+
1954
+ var styles = _objectSpread2({}, extra.styles);
1955
+
1956
+ if (transformIsMeaningful(transform)) {
1957
+ styles['transform'] = transformForCss({
1958
+ transform: transform,
1959
+ startCentered: true,
1960
+ width: width,
1961
+ height: height,
1962
+ });
1963
+ styles['-webkit-transform'] = styles['transform'];
1964
+ }
1965
+
1966
+ var styleString = joinStyles(styles);
1967
+
1968
+ if (styleString.length > 0) {
1969
+ attributes['style'] = styleString;
1970
+ }
1971
+
1972
+ var val = [];
1973
+ val.push({
1974
+ tag: 'span',
1975
+ attributes: attributes,
1976
+ children: [content],
1977
+ });
1978
+
1979
+ if (title) {
1980
+ val.push({
1981
+ tag: 'span',
1982
+ attributes: {
1983
+ class: 'sr-only',
1984
+ },
1985
+ children: [title],
1986
+ });
1987
+ }
1988
+
1989
+ return val;
1990
+ }
1991
+ function makeLayersCounterAbstract(params) {
1992
+ var content = params.content,
1993
+ title = params.title,
1994
+ extra = params.extra;
1995
+
1996
+ var attributes = _objectSpread2(
1997
+ _objectSpread2(
1998
+ _objectSpread2({}, extra.attributes),
1999
+ title
2000
+ ? {
2001
+ title: title,
2002
+ }
2003
+ : {},
2004
+ ),
2005
+ {},
2006
+ {
2007
+ class: extra.classes.join(' '),
2008
+ },
2009
+ );
2010
+
2011
+ var styleString = joinStyles(extra.styles);
2012
+
2013
+ if (styleString.length > 0) {
2014
+ attributes['style'] = styleString;
2015
+ }
2016
+
2017
+ var val = [];
2018
+ val.push({
2019
+ tag: 'span',
2020
+ attributes: attributes,
2021
+ children: [content],
2022
+ });
2023
+
2024
+ if (title) {
2025
+ val.push({
2026
+ tag: 'span',
2027
+ attributes: {
2028
+ class: 'sr-only',
2029
+ },
2030
+ children: [title],
2031
+ });
2032
+ }
2033
+
2034
+ return val;
2035
+ }
2036
+
2037
+ var styles$1 = namespace.styles;
2038
+ function asFoundIcon(icon) {
2039
+ var width = icon[0];
2040
+ var height = icon[1];
2041
+
2042
+ var _icon$slice = icon.slice(4),
2043
+ _icon$slice2 = _slicedToArray(_icon$slice, 1),
2044
+ vectorData = _icon$slice2[0];
2045
+
2046
+ var element = null;
2047
+
2048
+ if (Array.isArray(vectorData)) {
2049
+ element = {
2050
+ tag: 'g',
2051
+ attributes: {
2052
+ class: ''.concat(config.cssPrefix, '-').concat(DUOTONE_CLASSES.GROUP),
2053
+ },
2054
+ children: [
2055
+ {
2056
+ tag: 'path',
2057
+ attributes: {
2058
+ class: ''.concat(config.cssPrefix, '-').concat(DUOTONE_CLASSES.SECONDARY),
2059
+ fill: 'currentColor',
2060
+ d: vectorData[0],
2061
+ },
2062
+ },
2063
+ {
2064
+ tag: 'path',
2065
+ attributes: {
2066
+ class: ''.concat(config.cssPrefix, '-').concat(DUOTONE_CLASSES.PRIMARY),
2067
+ fill: 'currentColor',
2068
+ d: vectorData[1],
2069
+ },
2070
+ },
2071
+ ],
2072
+ };
2073
+ } else {
2074
+ element = {
2075
+ tag: 'path',
2076
+ attributes: {
2077
+ fill: 'currentColor',
2078
+ d: vectorData,
2079
+ },
2080
+ };
2081
+ }
2082
+
2083
+ return {
2084
+ found: true,
2085
+ width: width,
2086
+ height: height,
2087
+ icon: element,
2088
+ };
2089
+ }
2090
+ var missingIconResolutionMixin = {
2091
+ found: false,
2092
+ width: 512,
2093
+ height: 512,
2094
+ };
2095
+
2096
+ function maybeNotifyMissing(iconName, prefix) {
2097
+ if (!PRODUCTION && !config.showMissingIcons && iconName) {
2098
+ console.error(
2099
+ 'Icon with name "'.concat(iconName, '" and prefix "').concat(prefix, '" is missing.'),
2100
+ );
2101
+ }
2102
+ }
2103
+
2104
+ function findIcon(iconName, prefix) {
2105
+ var givenPrefix = prefix;
2106
+
2107
+ if (prefix === 'fa' && config.styleDefault !== null) {
2108
+ prefix = getDefaultUsablePrefix();
2109
+ }
2110
+
2111
+ return new Promise(function (resolve, reject) {
2112
+ var val = {
2113
+ found: false,
2114
+ width: 512,
2115
+ height: 512,
2116
+ icon: callProvided('missingIconAbstract') || {},
2117
+ };
2118
+
2119
+ if (givenPrefix === 'fa') {
2120
+ var shim = byOldName(iconName) || {};
2121
+ iconName = shim.iconName || iconName;
2122
+ prefix = shim.prefix || prefix;
2123
+ }
2124
+
2125
+ if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {
2126
+ var icon = styles$1[prefix][iconName];
2127
+ return resolve(asFoundIcon(icon));
2128
+ }
2129
+
2130
+ maybeNotifyMissing(iconName, prefix);
2131
+ resolve(
2132
+ _objectSpread2(
2133
+ _objectSpread2({}, missingIconResolutionMixin),
2134
+ {},
2135
+ {
2136
+ icon:
2137
+ config.showMissingIcons && iconName ? callProvided('missingIconAbstract') || {} : {},
2138
+ },
2139
+ ),
2140
+ );
2141
+ });
2142
+ }
2143
+
2144
+ var noop$1 = function noop() {};
2145
+
2146
+ var p =
2147
+ config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure
2148
+ ? PERFORMANCE
2149
+ : {
2150
+ mark: noop$1,
2151
+ measure: noop$1,
2152
+ };
2153
+ var preamble = 'FA "6.4.2"';
2154
+
2155
+ var begin = function begin(name) {
2156
+ p.mark(''.concat(preamble, ' ').concat(name, ' begins'));
2157
+ return function () {
2158
+ return end(name);
2159
+ };
2160
+ };
2161
+
2162
+ var end = function end(name) {
2163
+ p.mark(''.concat(preamble, ' ').concat(name, ' ends'));
2164
+ p.measure(
2165
+ ''.concat(preamble, ' ').concat(name),
2166
+ ''.concat(preamble, ' ').concat(name, ' begins'),
2167
+ ''.concat(preamble, ' ').concat(name, ' ends'),
2168
+ );
2169
+ };
2170
+
2171
+ var perf = {
2172
+ begin: begin,
2173
+ end: end,
2174
+ };
2175
+
2176
+ var noop$2 = function noop() {};
2177
+
2178
+ function isWatched(node) {
2179
+ var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
2180
+ return typeof i2svg === 'string';
2181
+ }
2182
+
2183
+ function hasPrefixAndIcon(node) {
2184
+ var prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;
2185
+ var icon = node.getAttribute ? node.getAttribute(DATA_ICON) : null;
2186
+ return prefix && icon;
2187
+ }
2188
+
2189
+ function hasBeenReplaced(node) {
2190
+ return (
2191
+ node &&
2192
+ node.classList &&
2193
+ node.classList.contains &&
2194
+ node.classList.contains(config.replacementClass)
2195
+ );
2196
+ }
2197
+
2198
+ function getMutator() {
2199
+ if (config.autoReplaceSvg === true) {
2200
+ return mutators.replace;
2201
+ }
2202
+
2203
+ var mutator = mutators[config.autoReplaceSvg];
2204
+ return mutator || mutators.replace;
2205
+ }
2206
+
2207
+ function createElementNS(tag) {
2208
+ return DOCUMENT.createElementNS('http://www.w3.org/2000/svg', tag);
2209
+ }
2210
+
2211
+ function createElement(tag) {
2212
+ return DOCUMENT.createElement(tag);
2213
+ }
2214
+
2215
+ function convertSVG(abstractObj) {
2216
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2217
+ var _params$ceFn = params.ceFn,
2218
+ ceFn =
2219
+ _params$ceFn === void 0
2220
+ ? abstractObj.tag === 'svg'
2221
+ ? createElementNS
2222
+ : createElement
2223
+ : _params$ceFn;
2224
+
2225
+ if (typeof abstractObj === 'string') {
2226
+ return DOCUMENT.createTextNode(abstractObj);
2227
+ }
2228
+
2229
+ var tag = ceFn(abstractObj.tag);
2230
+ Object.keys(abstractObj.attributes || []).forEach(function (key) {
2231
+ tag.setAttribute(key, abstractObj.attributes[key]);
2232
+ });
2233
+ var children = abstractObj.children || [];
2234
+ children.forEach(function (child) {
2235
+ tag.appendChild(
2236
+ convertSVG(child, {
2237
+ ceFn: ceFn,
2238
+ }),
2239
+ );
2240
+ });
2241
+ return tag;
2242
+ }
2243
+
2244
+ function nodeAsComment(node) {
2245
+ var comment = ' '.concat(node.outerHTML, ' ');
2246
+ /* BEGIN.ATTRIBUTION */
2247
+
2248
+ comment = ''.concat(comment, 'Font Awesome fontawesome.com ');
2249
+ /* END.ATTRIBUTION */
2250
+
2251
+ return comment;
2252
+ }
2253
+
2254
+ var mutators = {
2255
+ replace: function replace(mutation) {
2256
+ var node = mutation[0];
2257
+
2258
+ if (node.parentNode) {
2259
+ mutation[1].forEach(function (_abstract) {
2260
+ node.parentNode.insertBefore(convertSVG(_abstract), node);
2261
+ });
2262
+
2263
+ if (node.getAttribute(DATA_FA_I2SVG) === null && config.keepOriginalSource) {
2264
+ var comment = DOCUMENT.createComment(nodeAsComment(node));
2265
+ node.parentNode.replaceChild(comment, node);
2266
+ } else {
2267
+ node.remove();
2268
+ }
2269
+ }
2270
+ },
2271
+ nest: function nest(mutation) {
2272
+ var node = mutation[0];
2273
+ var _abstract2 = mutation[1]; // If we already have a replaced node we do not want to continue nesting within it.
2274
+ // Short-circuit to the standard replacement
2275
+
2276
+ if (~classArray(node).indexOf(config.replacementClass)) {
2277
+ return mutators.replace(mutation);
2278
+ }
2279
+
2280
+ var forSvg = new RegExp(''.concat(config.cssPrefix, '-.*'));
2281
+ delete _abstract2[0].attributes.id;
2282
+
2283
+ if (_abstract2[0].attributes.class) {
2284
+ var splitClasses = _abstract2[0].attributes.class.split(' ').reduce(
2285
+ function (acc, cls) {
2286
+ if (cls === config.replacementClass || cls.match(forSvg)) {
2287
+ acc.toSvg.push(cls);
2288
+ } else {
2289
+ acc.toNode.push(cls);
2290
+ }
2291
+
2292
+ return acc;
2293
+ },
2294
+ {
2295
+ toNode: [],
2296
+ toSvg: [],
2297
+ },
2298
+ );
2299
+
2300
+ _abstract2[0].attributes.class = splitClasses.toSvg.join(' ');
2301
+
2302
+ if (splitClasses.toNode.length === 0) {
2303
+ node.removeAttribute('class');
2304
+ } else {
2305
+ node.setAttribute('class', splitClasses.toNode.join(' '));
2306
+ }
2307
+ }
2308
+
2309
+ var newInnerHTML = _abstract2
2310
+ .map(function (a) {
2311
+ return toHtml(a);
2312
+ })
2313
+ .join('\n');
2314
+
2315
+ node.setAttribute(DATA_FA_I2SVG, '');
2316
+ node.innerHTML = newInnerHTML;
2317
+ },
2318
+ };
2319
+
2320
+ function performOperationSync(op) {
2321
+ op();
2322
+ }
2323
+
2324
+ function perform(mutations, callback) {
2325
+ var callbackFunction = typeof callback === 'function' ? callback : noop$2;
2326
+
2327
+ if (mutations.length === 0) {
2328
+ callbackFunction();
2329
+ } else {
2330
+ var frame = performOperationSync;
2331
+
2332
+ if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {
2333
+ frame = WINDOW.requestAnimationFrame || performOperationSync;
2334
+ }
2335
+
2336
+ frame(function () {
2337
+ var mutator = getMutator();
2338
+ var mark = perf.begin('mutate');
2339
+ mutations.map(mutator);
2340
+ mark();
2341
+ callbackFunction();
2342
+ });
2343
+ }
2344
+ }
2345
+ var disabled = false;
2346
+ function disableObservation() {
2347
+ disabled = true;
2348
+ }
2349
+ function enableObservation() {
2350
+ disabled = false;
2351
+ }
2352
+ var mo = null;
2353
+ function observe(options) {
2354
+ if (!MUTATION_OBSERVER) {
2355
+ return;
2356
+ }
2357
+
2358
+ if (!config.observeMutations) {
2359
+ return;
2360
+ }
2361
+
2362
+ var _options$treeCallback = options.treeCallback,
2363
+ treeCallback = _options$treeCallback === void 0 ? noop$2 : _options$treeCallback,
2364
+ _options$nodeCallback = options.nodeCallback,
2365
+ nodeCallback = _options$nodeCallback === void 0 ? noop$2 : _options$nodeCallback,
2366
+ _options$pseudoElemen = options.pseudoElementsCallback,
2367
+ pseudoElementsCallback = _options$pseudoElemen === void 0 ? noop$2 : _options$pseudoElemen,
2368
+ _options$observeMutat = options.observeMutationsRoot,
2369
+ observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;
2370
+ mo = new MUTATION_OBSERVER(function (objects) {
2371
+ if (disabled) {
2372
+ return;
2373
+ }
2374
+ var defaultPrefix = getDefaultUsablePrefix();
2375
+ toArray(objects).forEach(function (mutationRecord) {
2376
+ if (
2377
+ mutationRecord.type === 'childList' &&
2378
+ mutationRecord.addedNodes.length > 0 &&
2379
+ !isWatched(mutationRecord.addedNodes[0])
2380
+ ) {
2381
+ if (config.searchPseudoElements) {
2382
+ pseudoElementsCallback(mutationRecord.target);
2383
+ }
2384
+
2385
+ treeCallback(mutationRecord.target);
2386
+ }
2387
+
2388
+ if (
2389
+ mutationRecord.type === 'attributes' &&
2390
+ mutationRecord.target.parentNode &&
2391
+ config.searchPseudoElements
2392
+ ) {
2393
+ pseudoElementsCallback(mutationRecord.target.parentNode);
2394
+ }
2395
+
2396
+ if (
2397
+ mutationRecord.type === 'attributes' &&
2398
+ isWatched(mutationRecord.target) &&
2399
+ ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)
2400
+ ) {
2401
+ if (mutationRecord.attributeName === 'class' && hasPrefixAndIcon(mutationRecord.target)) {
2402
+ var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),
2403
+ prefix = _getCanonicalIcon.prefix,
2404
+ iconName = _getCanonicalIcon.iconName;
2405
+
2406
+ mutationRecord.target.setAttribute(DATA_PREFIX, prefix || defaultPrefix);
2407
+ if (iconName) {
2408
+ mutationRecord.target.setAttribute(DATA_ICON, iconName);
2409
+ }
2410
+ } else if (hasBeenReplaced(mutationRecord.target)) {
2411
+ nodeCallback(mutationRecord.target);
2412
+ }
2413
+ }
2414
+ });
2415
+ });
2416
+ if (!IS_DOM) {
2417
+ return;
2418
+ }
2419
+ mo.observe(observeMutationsRoot, {
2420
+ childList: true,
2421
+ attributes: true,
2422
+ characterData: true,
2423
+ subtree: true,
2424
+ });
2425
+ }
2426
+ function disconnect() {
2427
+ if (!mo) {
2428
+ return;
2429
+ }
2430
+ mo.disconnect();
2431
+ }
2432
+
2433
+ function styleParser(node) {
2434
+ var style = node.getAttribute('style');
2435
+ var val = [];
2436
+
2437
+ if (style) {
2438
+ val = style.split(';').reduce(function (acc, style) {
2439
+ var styles = style.split(':');
2440
+ var prop = styles[0];
2441
+ var value = styles.slice(1);
2442
+
2443
+ if (prop && value.length > 0) {
2444
+ acc[prop] = value.join(':').trim();
2445
+ }
2446
+
2447
+ return acc;
2448
+ }, {});
2449
+ }
2450
+
2451
+ return val;
2452
+ }
2453
+
2454
+ function classParser(node) {
2455
+ var existingPrefix = node.getAttribute('data-prefix');
2456
+ var existingIconName = node.getAttribute('data-icon');
2457
+ var innerText = node.innerText !== undefined ? node.innerText.trim() : '';
2458
+ var val = getCanonicalIcon(classArray(node));
2459
+
2460
+ if (!val.prefix) {
2461
+ val.prefix = getDefaultUsablePrefix();
2462
+ }
2463
+
2464
+ if (existingPrefix && existingIconName) {
2465
+ val.prefix = existingPrefix;
2466
+ val.iconName = existingIconName;
2467
+ }
2468
+
2469
+ if (val.iconName && val.prefix) {
2470
+ return val;
2471
+ }
2472
+
2473
+ if (val.prefix && innerText.length > 0) {
2474
+ val.iconName =
2475
+ byLigature(val.prefix, node.innerText) || byUnicode(val.prefix, toHex(node.innerText));
2476
+ }
2477
+
2478
+ if (
2479
+ !val.iconName &&
2480
+ config.autoFetchSvg &&
2481
+ node.firstChild &&
2482
+ node.firstChild.nodeType === Node.TEXT_NODE
2483
+ ) {
2484
+ val.iconName = node.firstChild.data;
2485
+ }
2486
+
2487
+ return val;
2488
+ }
2489
+
2490
+ function attributesParser(node) {
2491
+ var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {
2492
+ if (acc.name !== 'class' && acc.name !== 'style') {
2493
+ acc[attr.name] = attr.value;
2494
+ }
2495
+
2496
+ return acc;
2497
+ }, {});
2498
+ var title = node.getAttribute('title');
2499
+ var titleId = node.getAttribute('data-fa-title-id');
2500
+
2501
+ if (config.autoA11y) {
2502
+ if (title) {
2503
+ extraAttributes['aria-labelledby'] = ''
2504
+ .concat(config.replacementClass, '-title-')
2505
+ .concat(titleId || nextUniqueId());
2506
+ } else {
2507
+ extraAttributes['aria-hidden'] = 'true';
2508
+ extraAttributes['focusable'] = 'false';
2509
+ }
2510
+ }
2511
+
2512
+ return extraAttributes;
2513
+ }
2514
+
2515
+ function blankMeta() {
2516
+ return {
2517
+ iconName: null,
2518
+ title: null,
2519
+ titleId: null,
2520
+ prefix: null,
2521
+ transform: meaninglessTransform,
2522
+ symbol: false,
2523
+ mask: {
2524
+ iconName: null,
2525
+ prefix: null,
2526
+ rest: [],
2527
+ },
2528
+ maskId: null,
2529
+ extra: {
2530
+ classes: [],
2531
+ styles: {},
2532
+ attributes: {},
2533
+ },
2534
+ };
2535
+ }
2536
+ function parseMeta(node) {
2537
+ var parser =
2538
+ arguments.length > 1 && arguments[1] !== undefined
2539
+ ? arguments[1]
2540
+ : {
2541
+ styleParser: true,
2542
+ };
2543
+
2544
+ var _classParser = classParser(node),
2545
+ iconName = _classParser.iconName,
2546
+ prefix = _classParser.prefix,
2547
+ extraClasses = _classParser.rest;
2548
+
2549
+ var extraAttributes = attributesParser(node);
2550
+ var pluginMeta = chainHooks('parseNodeAttributes', {}, node);
2551
+ var extraStyles = parser.styleParser ? styleParser(node) : [];
2552
+ return _objectSpread2(
2553
+ {
2554
+ iconName: iconName,
2555
+ title: node.getAttribute('title'),
2556
+ titleId: node.getAttribute('data-fa-title-id'),
2557
+ prefix: prefix,
2558
+ transform: meaninglessTransform,
2559
+ mask: {
2560
+ iconName: null,
2561
+ prefix: null,
2562
+ rest: [],
2563
+ },
2564
+ maskId: null,
2565
+ symbol: false,
2566
+ extra: {
2567
+ classes: extraClasses,
2568
+ styles: extraStyles,
2569
+ attributes: extraAttributes,
2570
+ },
2571
+ },
2572
+ pluginMeta,
2573
+ );
2574
+ }
2575
+
2576
+ var styles$2 = namespace.styles;
2577
+
2578
+ function generateMutation(node) {
2579
+ var nodeMeta =
2580
+ config.autoReplaceSvg === 'nest'
2581
+ ? parseMeta(node, {
2582
+ styleParser: false,
2583
+ })
2584
+ : parseMeta(node);
2585
+
2586
+ if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
2587
+ return callProvided('generateLayersText', node, nodeMeta);
2588
+ } else {
2589
+ return callProvided('generateSvgReplacementMutation', node, nodeMeta);
2590
+ }
2591
+ }
2592
+
2593
+ var knownPrefixes = new Set();
2594
+ FAMILIES.map(function (family) {
2595
+ knownPrefixes.add('fa-'.concat(family));
2596
+ });
2597
+ Object.keys(PREFIX_TO_STYLE[FAMILY_CLASSIC]).map(knownPrefixes.add.bind(knownPrefixes));
2598
+ Object.keys(PREFIX_TO_STYLE[FAMILY_SHARP]).map(knownPrefixes.add.bind(knownPrefixes));
2599
+ knownPrefixes = _toConsumableArray(knownPrefixes);
2600
+
2601
+ function onTree(root) {
2602
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2603
+ if (!IS_DOM) {
2604
+ return Promise.resolve();
2605
+ }
2606
+ var htmlClassList = DOCUMENT.documentElement.classList;
2607
+
2608
+ var hclAdd = function hclAdd(suffix) {
2609
+ return htmlClassList.add(''.concat(HTML_CLASS_I2SVG_BASE_CLASS, '-').concat(suffix));
2610
+ };
2611
+
2612
+ var hclRemove = function hclRemove(suffix) {
2613
+ return htmlClassList.remove(''.concat(HTML_CLASS_I2SVG_BASE_CLASS, '-').concat(suffix));
2614
+ };
2615
+
2616
+ var prefixes = config.autoFetchSvg
2617
+ ? knownPrefixes
2618
+ : FAMILIES.map(function (f) {
2619
+ return 'fa-'.concat(f);
2620
+ }).concat(Object.keys(styles$2));
2621
+
2622
+ if (!prefixes.includes('fa')) {
2623
+ prefixes.push('fa');
2624
+ }
2625
+
2626
+ var prefixesDomQuery = ['.'.concat(LAYERS_TEXT_CLASSNAME, ':not([').concat(DATA_FA_I2SVG, '])')]
2627
+ .concat(
2628
+ prefixes.map(function (p) {
2629
+ return '.'.concat(p, ':not([').concat(DATA_FA_I2SVG, '])');
2630
+ }),
2631
+ )
2632
+ .join(', ');
2633
+
2634
+ if (prefixesDomQuery.length === 0) {
2635
+ return Promise.resolve();
2636
+ }
2637
+
2638
+ var candidates = [];
2639
+
2640
+ try {
2641
+ candidates = toArray(root.querySelectorAll(prefixesDomQuery));
2642
+ } catch (e) {
2643
+ // noop
2644
+ }
2645
+
2646
+ if (candidates.length > 0) {
2647
+ hclAdd('pending');
2648
+ hclRemove('complete');
2649
+ } else {
2650
+ return Promise.resolve();
2651
+ }
2652
+
2653
+ var mark = perf.begin('onTree');
2654
+ var mutations = candidates.reduce(function (acc, node) {
2655
+ try {
2656
+ var mutation = generateMutation(node);
2657
+
2658
+ if (mutation) {
2659
+ acc.push(mutation);
2660
+ }
2661
+ } catch (e) {
2662
+ if (!PRODUCTION) {
2663
+ if (e.name === 'MissingIcon') {
2664
+ console.error(e);
2665
+ }
2666
+ }
2667
+ }
2668
+
2669
+ return acc;
2670
+ }, []);
2671
+ return new Promise(function (resolve, reject) {
2672
+ Promise.all(mutations)
2673
+ .then(function (resolvedMutations) {
2674
+ perform(resolvedMutations, function () {
2675
+ hclAdd('active');
2676
+ hclAdd('complete');
2677
+ hclRemove('pending');
2678
+ if (typeof callback === 'function') {
2679
+ callback();
2680
+ }
2681
+ mark();
2682
+ resolve();
2683
+ });
2684
+ })
2685
+ .catch(function (e) {
2686
+ mark();
2687
+ reject(e);
2688
+ });
2689
+ });
2690
+ }
2691
+
2692
+ function onNode(node) {
2693
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2694
+ generateMutation(node).then(function (mutation) {
2695
+ if (mutation) {
2696
+ perform([mutation], callback);
2697
+ }
2698
+ });
2699
+ }
2700
+
2701
+ function resolveIcons(next) {
2702
+ return function (maybeIconDefinition) {
2703
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2704
+ var iconDefinition = (maybeIconDefinition || {}).icon
2705
+ ? maybeIconDefinition
2706
+ : findIconDefinition(maybeIconDefinition || {});
2707
+ var mask = params.mask;
2708
+
2709
+ if (mask) {
2710
+ mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
2711
+ }
2712
+
2713
+ return next(
2714
+ iconDefinition,
2715
+ _objectSpread2(
2716
+ _objectSpread2({}, params),
2717
+ {},
2718
+ {
2719
+ mask: mask,
2720
+ },
2721
+ ),
2722
+ );
2723
+ };
2724
+ }
2725
+
2726
+ var render = function render(iconDefinition) {
2727
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2728
+ var _params$transform = params.transform,
2729
+ transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
2730
+ _params$symbol = params.symbol,
2731
+ symbol = _params$symbol === void 0 ? false : _params$symbol,
2732
+ _params$mask = params.mask,
2733
+ mask = _params$mask === void 0 ? null : _params$mask,
2734
+ _params$maskId = params.maskId,
2735
+ maskId = _params$maskId === void 0 ? null : _params$maskId,
2736
+ _params$title = params.title,
2737
+ title = _params$title === void 0 ? null : _params$title,
2738
+ _params$titleId = params.titleId,
2739
+ titleId = _params$titleId === void 0 ? null : _params$titleId,
2740
+ _params$classes = params.classes,
2741
+ classes = _params$classes === void 0 ? [] : _params$classes,
2742
+ _params$attributes = params.attributes,
2743
+ attributes = _params$attributes === void 0 ? {} : _params$attributes,
2744
+ _params$styles = params.styles,
2745
+ styles = _params$styles === void 0 ? {} : _params$styles;
2746
+ if (!iconDefinition) {
2747
+ return;
2748
+ }
2749
+ var prefix = iconDefinition.prefix,
2750
+ iconName = iconDefinition.iconName,
2751
+ icon = iconDefinition.icon;
2752
+ return domVariants(
2753
+ _objectSpread2(
2754
+ {
2755
+ type: 'icon',
2756
+ },
2757
+ iconDefinition,
2758
+ ),
2759
+ function () {
2760
+ callHooks('beforeDOMElementCreation', {
2761
+ iconDefinition: iconDefinition,
2762
+ params: params,
2763
+ });
2764
+
2765
+ if (config.autoA11y) {
2766
+ if (title) {
2767
+ attributes['aria-labelledby'] = ''
2768
+ .concat(config.replacementClass, '-title-')
2769
+ .concat(titleId || nextUniqueId());
2770
+ } else {
2771
+ attributes['aria-hidden'] = 'true';
2772
+ attributes['focusable'] = 'false';
2773
+ }
2774
+ }
2775
+
2776
+ return makeInlineSvgAbstract({
2777
+ icons: {
2778
+ main: asFoundIcon(icon),
2779
+ mask: mask
2780
+ ? asFoundIcon(mask.icon)
2781
+ : {
2782
+ found: false,
2783
+ width: null,
2784
+ height: null,
2785
+ icon: {},
2786
+ },
2787
+ },
2788
+ prefix: prefix,
2789
+ iconName: iconName,
2790
+ transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
2791
+ symbol: symbol,
2792
+ title: title,
2793
+ maskId: maskId,
2794
+ titleId: titleId,
2795
+ extra: {
2796
+ attributes: attributes,
2797
+ styles: styles,
2798
+ classes: classes,
2799
+ },
2800
+ });
2801
+ },
2802
+ );
2803
+ };
2804
+ var ReplaceElements = {
2805
+ mixout: function mixout() {
2806
+ return {
2807
+ icon: resolveIcons(render),
2808
+ };
2809
+ },
2810
+ hooks: function hooks() {
2811
+ return {
2812
+ mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
2813
+ accumulator.treeCallback = onTree;
2814
+ accumulator.nodeCallback = onNode;
2815
+ return accumulator;
2816
+ },
2817
+ };
2818
+ },
2819
+ provides: function provides(providers$$1) {
2820
+ providers$$1.i2svg = function (params) {
2821
+ var _params$node = params.node,
2822
+ node = _params$node === void 0 ? DOCUMENT : _params$node,
2823
+ _params$callback = params.callback,
2824
+ callback = _params$callback === void 0 ? function () {} : _params$callback;
2825
+ return onTree(node, callback);
2826
+ };
2827
+
2828
+ providers$$1.generateSvgReplacementMutation = function (node, nodeMeta) {
2829
+ var iconName = nodeMeta.iconName,
2830
+ title = nodeMeta.title,
2831
+ titleId = nodeMeta.titleId,
2832
+ prefix = nodeMeta.prefix,
2833
+ transform = nodeMeta.transform,
2834
+ symbol = nodeMeta.symbol,
2835
+ mask = nodeMeta.mask,
2836
+ maskId = nodeMeta.maskId,
2837
+ extra = nodeMeta.extra;
2838
+ return new Promise(function (resolve, reject) {
2839
+ Promise.all([
2840
+ findIcon(iconName, prefix),
2841
+ mask.iconName
2842
+ ? findIcon(mask.iconName, mask.prefix)
2843
+ : Promise.resolve({
2844
+ found: false,
2845
+ width: 512,
2846
+ height: 512,
2847
+ icon: {},
2848
+ }),
2849
+ ])
2850
+ .then(function (_ref) {
2851
+ var _ref2 = _slicedToArray(_ref, 2),
2852
+ main = _ref2[0],
2853
+ mask = _ref2[1];
2854
+
2855
+ resolve([
2856
+ node,
2857
+ makeInlineSvgAbstract({
2858
+ icons: {
2859
+ main: main,
2860
+ mask: mask,
2861
+ },
2862
+ prefix: prefix,
2863
+ iconName: iconName,
2864
+ transform: transform,
2865
+ symbol: symbol,
2866
+ maskId: maskId,
2867
+ title: title,
2868
+ titleId: titleId,
2869
+ extra: extra,
2870
+ watchable: true,
2871
+ }),
2872
+ ]);
2873
+ })
2874
+ .catch(reject);
2875
+ });
2876
+ };
2877
+
2878
+ providers$$1.generateAbstractIcon = function (_ref3) {
2879
+ var children = _ref3.children,
2880
+ attributes = _ref3.attributes,
2881
+ main = _ref3.main,
2882
+ transform = _ref3.transform,
2883
+ styles = _ref3.styles;
2884
+ var styleString = joinStyles(styles);
2885
+
2886
+ if (styleString.length > 0) {
2887
+ attributes['style'] = styleString;
2888
+ }
2889
+
2890
+ var nextChild;
2891
+
2892
+ if (transformIsMeaningful(transform)) {
2893
+ nextChild = callProvided('generateAbstractTransformGrouping', {
2894
+ main: main,
2895
+ transform: transform,
2896
+ containerWidth: main.width,
2897
+ iconWidth: main.width,
2898
+ });
2899
+ }
2900
+
2901
+ children.push(nextChild || main.icon);
2902
+ return {
2903
+ children: children,
2904
+ attributes: attributes,
2905
+ };
2906
+ };
2907
+ },
2908
+ };
2909
+
2910
+ var Layers = {
2911
+ mixout: function mixout() {
2912
+ return {
2913
+ layer: function layer(assembler) {
2914
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2915
+ var _params$classes = params.classes,
2916
+ classes = _params$classes === void 0 ? [] : _params$classes;
2917
+ return domVariants(
2918
+ {
2919
+ type: 'layer',
2920
+ },
2921
+ function () {
2922
+ callHooks('beforeDOMElementCreation', {
2923
+ assembler: assembler,
2924
+ params: params,
2925
+ });
2926
+ var children = [];
2927
+ assembler(function (args) {
2928
+ Array.isArray(args)
2929
+ ? args.map(function (a) {
2930
+ children = children.concat(a.abstract);
2931
+ })
2932
+ : (children = children.concat(args.abstract));
2933
+ });
2934
+ return [
2935
+ {
2936
+ tag: 'span',
2937
+ attributes: {
2938
+ class: [''.concat(config.cssPrefix, '-layers')]
2939
+ .concat(_toConsumableArray(classes))
2940
+ .join(' '),
2941
+ },
2942
+ children: children,
2943
+ },
2944
+ ];
2945
+ },
2946
+ );
2947
+ },
2948
+ };
2949
+ },
2950
+ };
2951
+
2952
+ var LayersCounter = {
2953
+ mixout: function mixout() {
2954
+ return {
2955
+ counter: function counter(content) {
2956
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2957
+ var _params$title = params.title,
2958
+ title = _params$title === void 0 ? null : _params$title,
2959
+ _params$classes = params.classes,
2960
+ classes = _params$classes === void 0 ? [] : _params$classes,
2961
+ _params$attributes = params.attributes,
2962
+ attributes = _params$attributes === void 0 ? {} : _params$attributes,
2963
+ _params$styles = params.styles,
2964
+ styles = _params$styles === void 0 ? {} : _params$styles;
2965
+ return domVariants(
2966
+ {
2967
+ type: 'counter',
2968
+ content: content,
2969
+ },
2970
+ function () {
2971
+ callHooks('beforeDOMElementCreation', {
2972
+ content: content,
2973
+ params: params,
2974
+ });
2975
+ return makeLayersCounterAbstract({
2976
+ content: content.toString(),
2977
+ title: title,
2978
+ extra: {
2979
+ attributes: attributes,
2980
+ styles: styles,
2981
+ classes: [''.concat(config.cssPrefix, '-layers-counter')].concat(
2982
+ _toConsumableArray(classes),
2983
+ ),
2984
+ },
2985
+ });
2986
+ },
2987
+ );
2988
+ },
2989
+ };
2990
+ },
2991
+ };
2992
+
2993
+ var LayersText = {
2994
+ mixout: function mixout() {
2995
+ return {
2996
+ text: function text(content) {
2997
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2998
+ var _params$transform = params.transform,
2999
+ transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
3000
+ _params$title = params.title,
3001
+ title = _params$title === void 0 ? null : _params$title,
3002
+ _params$classes = params.classes,
3003
+ classes = _params$classes === void 0 ? [] : _params$classes,
3004
+ _params$attributes = params.attributes,
3005
+ attributes = _params$attributes === void 0 ? {} : _params$attributes,
3006
+ _params$styles = params.styles,
3007
+ styles = _params$styles === void 0 ? {} : _params$styles;
3008
+ return domVariants(
3009
+ {
3010
+ type: 'text',
3011
+ content: content,
3012
+ },
3013
+ function () {
3014
+ callHooks('beforeDOMElementCreation', {
3015
+ content: content,
3016
+ params: params,
3017
+ });
3018
+ return makeLayersTextAbstract({
3019
+ content: content,
3020
+ transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
3021
+ title: title,
3022
+ extra: {
3023
+ attributes: attributes,
3024
+ styles: styles,
3025
+ classes: [''.concat(config.cssPrefix, '-layers-text')].concat(
3026
+ _toConsumableArray(classes),
3027
+ ),
3028
+ },
3029
+ });
3030
+ },
3031
+ );
3032
+ },
3033
+ };
3034
+ },
3035
+ provides: function provides(providers$$1) {
3036
+ providers$$1.generateLayersText = function (node, nodeMeta) {
3037
+ var title = nodeMeta.title,
3038
+ transform = nodeMeta.transform,
3039
+ extra = nodeMeta.extra;
3040
+ var width = null;
3041
+ var height = null;
3042
+
3043
+ if (IS_IE) {
3044
+ var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
3045
+ var boundingClientRect = node.getBoundingClientRect();
3046
+ width = boundingClientRect.width / computedFontSize;
3047
+ height = boundingClientRect.height / computedFontSize;
3048
+ }
3049
+
3050
+ if (config.autoA11y && !title) {
3051
+ extra.attributes['aria-hidden'] = 'true';
3052
+ }
3053
+
3054
+ return Promise.resolve([
3055
+ node,
3056
+ makeLayersTextAbstract({
3057
+ content: node.innerHTML,
3058
+ width: width,
3059
+ height: height,
3060
+ transform: transform,
3061
+ title: title,
3062
+ extra: extra,
3063
+ watchable: true,
3064
+ }),
3065
+ ]);
3066
+ };
3067
+ },
3068
+ };
3069
+
3070
+ var CLEAN_CONTENT_PATTERN = new RegExp('"', 'ug');
3071
+ var SECONDARY_UNICODE_RANGE = [1105920, 1112319];
3072
+ function hexValueFromContent(content) {
3073
+ var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
3074
+ var codePoint = codePointAt(cleaned, 0);
3075
+ var isPrependTen =
3076
+ codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
3077
+ var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
3078
+ return {
3079
+ value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
3080
+ isSecondary: isPrependTen || isDoubled,
3081
+ };
3082
+ }
3083
+
3084
+ function replaceForPosition(node, position) {
3085
+ var pendingAttribute = ''
3086
+ .concat(DATA_FA_PSEUDO_ELEMENT_PENDING)
3087
+ .concat(position.replace(':', '-'));
3088
+ return new Promise(function (resolve, reject) {
3089
+ if (node.getAttribute(pendingAttribute) !== null) {
3090
+ // This node is already being processed
3091
+ return resolve();
3092
+ }
3093
+
3094
+ var children = toArray(node.children);
3095
+ var alreadyProcessedPseudoElement = children.filter(function (c) {
3096
+ return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
3097
+ })[0];
3098
+ var styles = WINDOW.getComputedStyle(node, position);
3099
+ var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
3100
+ var fontWeight = styles.getPropertyValue('font-weight');
3101
+ var content = styles.getPropertyValue('content');
3102
+
3103
+ if (alreadyProcessedPseudoElement && !fontFamily) {
3104
+ // If we've already processed it but the current computed style does not result in a font-family,
3105
+ // that probably means that a class name that was previously present to make the icon has been
3106
+ // removed. So we now should delete the icon.
3107
+ node.removeChild(alreadyProcessedPseudoElement);
3108
+ return resolve();
3109
+ } else if (fontFamily && content !== 'none' && content !== '') {
3110
+ var _content = styles.getPropertyValue('content');
3111
+
3112
+ var family = ~['Sharp'].indexOf(fontFamily[2]) ? FAMILY_SHARP : FAMILY_CLASSIC;
3113
+ var prefix = ~['Solid', 'Regular', 'Light', 'Thin', 'Duotone', 'Brands', 'Kit'].indexOf(
3114
+ fontFamily[2],
3115
+ )
3116
+ ? STYLE_TO_PREFIX[family][fontFamily[2].toLowerCase()]
3117
+ : FONT_WEIGHT_TO_PREFIX[family][fontWeight];
3118
+
3119
+ var _hexValueFromContent = hexValueFromContent(_content),
3120
+ hexValue = _hexValueFromContent.value,
3121
+ isSecondary = _hexValueFromContent.isSecondary;
3122
+
3123
+ var isV4 = fontFamily[0].startsWith('FontAwesome');
3124
+ var iconName = byUnicode(prefix, hexValue);
3125
+ var iconIdentifier = iconName;
3126
+
3127
+ if (isV4) {
3128
+ var iconName4 = byOldUnicode(hexValue);
3129
+
3130
+ if (iconName4.iconName && iconName4.prefix) {
3131
+ iconName = iconName4.iconName;
3132
+ prefix = iconName4.prefix;
3133
+ }
3134
+ } // Only convert the pseudo element in this ::before/::after position into an icon if we haven't
3135
+ // already done so with the same prefix and iconName
3136
+
3137
+ if (
3138
+ iconName &&
3139
+ !isSecondary &&
3140
+ (!alreadyProcessedPseudoElement ||
3141
+ alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix ||
3142
+ alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)
3143
+ ) {
3144
+ node.setAttribute(pendingAttribute, iconIdentifier);
3145
+
3146
+ if (alreadyProcessedPseudoElement) {
3147
+ // Delete the old one, since we're replacing it with a new one
3148
+ node.removeChild(alreadyProcessedPseudoElement);
3149
+ }
3150
+
3151
+ var meta = blankMeta();
3152
+ var extra = meta.extra;
3153
+ extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
3154
+ findIcon(iconName, prefix)
3155
+ .then(function (main) {
3156
+ var _abstract = makeInlineSvgAbstract(
3157
+ _objectSpread2(
3158
+ _objectSpread2({}, meta),
3159
+ {},
3160
+ {
3161
+ icons: {
3162
+ main: main,
3163
+ mask: emptyCanonicalIcon(),
3164
+ },
3165
+ prefix: prefix,
3166
+ iconName: iconIdentifier,
3167
+ extra: extra,
3168
+ watchable: true,
3169
+ },
3170
+ ),
3171
+ );
3172
+
3173
+ var element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');
3174
+
3175
+ if (position === '::before') {
3176
+ node.insertBefore(element, node.firstChild);
3177
+ } else {
3178
+ node.appendChild(element);
3179
+ }
3180
+
3181
+ element.outerHTML = _abstract
3182
+ .map(function (a) {
3183
+ return toHtml(a);
3184
+ })
3185
+ .join('\n');
3186
+ node.removeAttribute(pendingAttribute);
3187
+ resolve();
3188
+ })
3189
+ .catch(reject);
3190
+ } else {
3191
+ resolve();
3192
+ }
3193
+ } else {
3194
+ resolve();
3195
+ }
3196
+ });
3197
+ }
3198
+
3199
+ function replace(node) {
3200
+ return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
3201
+ }
3202
+
3203
+ function processable(node) {
3204
+ return (
3205
+ node.parentNode !== document.head &&
3206
+ !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) &&
3207
+ !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) &&
3208
+ (!node.parentNode || node.parentNode.tagName !== 'svg')
3209
+ );
3210
+ }
3211
+
3212
+ function searchPseudoElements(root) {
3213
+ if (!IS_DOM) {
3214
+ return;
3215
+ }
3216
+ return new Promise(function (resolve, reject) {
3217
+ var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
3218
+ var end = perf.begin('searchPseudoElements');
3219
+ disableObservation();
3220
+ Promise.all(operations)
3221
+ .then(function () {
3222
+ end();
3223
+ enableObservation();
3224
+ resolve();
3225
+ })
3226
+ .catch(function () {
3227
+ end();
3228
+ enableObservation();
3229
+ reject();
3230
+ });
3231
+ });
3232
+ }
3233
+
3234
+ var PseudoElements = {
3235
+ hooks: function hooks() {
3236
+ return {
3237
+ mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
3238
+ accumulator.pseudoElementsCallback = searchPseudoElements;
3239
+ return accumulator;
3240
+ },
3241
+ };
3242
+ },
3243
+ provides: function provides(providers$$1) {
3244
+ providers$$1.pseudoElements2svg = function (params) {
3245
+ var _params$node = params.node,
3246
+ node = _params$node === void 0 ? DOCUMENT : _params$node;
3247
+
3248
+ if (config.searchPseudoElements) {
3249
+ searchPseudoElements(node);
3250
+ }
3251
+ };
3252
+ },
3253
+ };
3254
+
3255
+ var _unwatched = false;
3256
+ var MutationObserver$1 = {
3257
+ mixout: function mixout() {
3258
+ return {
3259
+ dom: {
3260
+ unwatch: function unwatch() {
3261
+ disableObservation();
3262
+ _unwatched = true;
3263
+ },
3264
+ },
3265
+ };
3266
+ },
3267
+ hooks: function hooks() {
3268
+ return {
3269
+ bootstrap: function bootstrap() {
3270
+ observe(chainHooks('mutationObserverCallbacks', {}));
3271
+ },
3272
+ noAuto: function noAuto() {
3273
+ disconnect();
3274
+ },
3275
+ watch: function watch(params) {
3276
+ var observeMutationsRoot = params.observeMutationsRoot;
3277
+
3278
+ if (_unwatched) {
3279
+ enableObservation();
3280
+ } else {
3281
+ observe(
3282
+ chainHooks('mutationObserverCallbacks', {
3283
+ observeMutationsRoot: observeMutationsRoot,
3284
+ }),
3285
+ );
3286
+ }
3287
+ },
3288
+ };
3289
+ },
3290
+ };
3291
+
3292
+ var parseTransformString = function parseTransformString(transformString) {
3293
+ var transform = {
3294
+ size: 16,
3295
+ x: 0,
3296
+ y: 0,
3297
+ flipX: false,
3298
+ flipY: false,
3299
+ rotate: 0,
3300
+ };
3301
+ return transformString
3302
+ .toLowerCase()
3303
+ .split(' ')
3304
+ .reduce(function (acc, n) {
3305
+ var parts = n.toLowerCase().split('-');
3306
+ var first = parts[0];
3307
+ var rest = parts.slice(1).join('-');
3308
+
3309
+ if (first && rest === 'h') {
3310
+ acc.flipX = true;
3311
+ return acc;
3312
+ }
3313
+
3314
+ if (first && rest === 'v') {
3315
+ acc.flipY = true;
3316
+ return acc;
3317
+ }
3318
+
3319
+ rest = parseFloat(rest);
3320
+
3321
+ if (isNaN(rest)) {
3322
+ return acc;
3323
+ }
3324
+
3325
+ switch (first) {
3326
+ case 'grow':
3327
+ acc.size = acc.size + rest;
3328
+ break;
3329
+
3330
+ case 'shrink':
3331
+ acc.size = acc.size - rest;
3332
+ break;
3333
+
3334
+ case 'left':
3335
+ acc.x = acc.x - rest;
3336
+ break;
3337
+
3338
+ case 'right':
3339
+ acc.x = acc.x + rest;
3340
+ break;
3341
+
3342
+ case 'up':
3343
+ acc.y = acc.y - rest;
3344
+ break;
3345
+
3346
+ case 'down':
3347
+ acc.y = acc.y + rest;
3348
+ break;
3349
+
3350
+ case 'rotate':
3351
+ acc.rotate = acc.rotate + rest;
3352
+ break;
3353
+ }
3354
+
3355
+ return acc;
3356
+ }, transform);
3357
+ };
3358
+ var PowerTransforms = {
3359
+ mixout: function mixout() {
3360
+ return {
3361
+ parse: {
3362
+ transform: function transform(transformString) {
3363
+ return parseTransformString(transformString);
3364
+ },
3365
+ },
3366
+ };
3367
+ },
3368
+ hooks: function hooks() {
3369
+ return {
3370
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3371
+ var transformString = node.getAttribute('data-fa-transform');
3372
+
3373
+ if (transformString) {
3374
+ accumulator.transform = parseTransformString(transformString);
3375
+ }
3376
+
3377
+ return accumulator;
3378
+ },
3379
+ };
3380
+ },
3381
+ provides: function provides(providers) {
3382
+ providers.generateAbstractTransformGrouping = function (_ref) {
3383
+ var main = _ref.main,
3384
+ transform = _ref.transform,
3385
+ containerWidth = _ref.containerWidth,
3386
+ iconWidth = _ref.iconWidth;
3387
+ var outer = {
3388
+ transform: 'translate('.concat(containerWidth / 2, ' 256)'),
3389
+ };
3390
+ var innerTranslate = 'translate('
3391
+ .concat(transform.x * 32, ', ')
3392
+ .concat(transform.y * 32, ') ');
3393
+ var innerScale = 'scale('
3394
+ .concat((transform.size / 16) * (transform.flipX ? -1 : 1), ', ')
3395
+ .concat((transform.size / 16) * (transform.flipY ? -1 : 1), ') ');
3396
+ var innerRotate = 'rotate('.concat(transform.rotate, ' 0 0)');
3397
+ var inner = {
3398
+ transform: ''.concat(innerTranslate, ' ').concat(innerScale, ' ').concat(innerRotate),
3399
+ };
3400
+ var path = {
3401
+ transform: 'translate('.concat((iconWidth / 2) * -1, ' -256)'),
3402
+ };
3403
+ var operations = {
3404
+ outer: outer,
3405
+ inner: inner,
3406
+ path: path,
3407
+ };
3408
+ return {
3409
+ tag: 'g',
3410
+ attributes: _objectSpread2({}, operations.outer),
3411
+ children: [
3412
+ {
3413
+ tag: 'g',
3414
+ attributes: _objectSpread2({}, operations.inner),
3415
+ children: [
3416
+ {
3417
+ tag: main.icon.tag,
3418
+ children: main.icon.children,
3419
+ attributes: _objectSpread2(
3420
+ _objectSpread2({}, main.icon.attributes),
3421
+ operations.path,
3422
+ ),
3423
+ },
3424
+ ],
3425
+ },
3426
+ ],
3427
+ };
3428
+ };
3429
+ },
3430
+ };
3431
+
3432
+ var ALL_SPACE = {
3433
+ x: 0,
3434
+ y: 0,
3435
+ width: '100%',
3436
+ height: '100%',
3437
+ };
3438
+
3439
+ function fillBlack(_abstract) {
3440
+ var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
3441
+
3442
+ if (_abstract.attributes && (_abstract.attributes.fill || force)) {
3443
+ _abstract.attributes.fill = 'black';
3444
+ }
3445
+
3446
+ return _abstract;
3447
+ }
3448
+
3449
+ function deGroup(_abstract2) {
3450
+ if (_abstract2.tag === 'g') {
3451
+ return _abstract2.children;
3452
+ } else {
3453
+ return [_abstract2];
3454
+ }
3455
+ }
3456
+
3457
+ var Masks = {
3458
+ hooks: function hooks() {
3459
+ return {
3460
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3461
+ var maskData = node.getAttribute('data-fa-mask');
3462
+ var mask = !maskData
3463
+ ? emptyCanonicalIcon()
3464
+ : getCanonicalIcon(
3465
+ maskData.split(' ').map(function (i) {
3466
+ return i.trim();
3467
+ }),
3468
+ );
3469
+
3470
+ if (!mask.prefix) {
3471
+ mask.prefix = getDefaultUsablePrefix();
3472
+ }
3473
+
3474
+ accumulator.mask = mask;
3475
+ accumulator.maskId = node.getAttribute('data-fa-mask-id');
3476
+ return accumulator;
3477
+ },
3478
+ };
3479
+ },
3480
+ provides: function provides(providers) {
3481
+ providers.generateAbstractMask = function (_ref) {
3482
+ var children = _ref.children,
3483
+ attributes = _ref.attributes,
3484
+ main = _ref.main,
3485
+ mask = _ref.mask,
3486
+ explicitMaskId = _ref.maskId,
3487
+ transform = _ref.transform;
3488
+ var mainWidth = main.width,
3489
+ mainPath = main.icon;
3490
+ var maskWidth = mask.width,
3491
+ maskPath = mask.icon;
3492
+ var trans = transformForSvg({
3493
+ transform: transform,
3494
+ containerWidth: maskWidth,
3495
+ iconWidth: mainWidth,
3496
+ });
3497
+ var maskRect = {
3498
+ tag: 'rect',
3499
+ attributes: _objectSpread2(
3500
+ _objectSpread2({}, ALL_SPACE),
3501
+ {},
3502
+ {
3503
+ fill: 'white',
3504
+ },
3505
+ ),
3506
+ };
3507
+ var maskInnerGroupChildrenMixin = mainPath.children
3508
+ ? {
3509
+ children: mainPath.children.map(fillBlack),
3510
+ }
3511
+ : {};
3512
+ var maskInnerGroup = {
3513
+ tag: 'g',
3514
+ attributes: _objectSpread2({}, trans.inner),
3515
+ children: [
3516
+ fillBlack(
3517
+ _objectSpread2(
3518
+ {
3519
+ tag: mainPath.tag,
3520
+ attributes: _objectSpread2(_objectSpread2({}, mainPath.attributes), trans.path),
3521
+ },
3522
+ maskInnerGroupChildrenMixin,
3523
+ ),
3524
+ ),
3525
+ ],
3526
+ };
3527
+ var maskOuterGroup = {
3528
+ tag: 'g',
3529
+ attributes: _objectSpread2({}, trans.outer),
3530
+ children: [maskInnerGroup],
3531
+ };
3532
+ var maskId = 'mask-'.concat(explicitMaskId || nextUniqueId());
3533
+ var clipId = 'clip-'.concat(explicitMaskId || nextUniqueId());
3534
+ var maskTag = {
3535
+ tag: 'mask',
3536
+ attributes: _objectSpread2(
3537
+ _objectSpread2({}, ALL_SPACE),
3538
+ {},
3539
+ {
3540
+ id: maskId,
3541
+ maskUnits: 'userSpaceOnUse',
3542
+ maskContentUnits: 'userSpaceOnUse',
3543
+ },
3544
+ ),
3545
+ children: [maskRect, maskOuterGroup],
3546
+ };
3547
+ var defs = {
3548
+ tag: 'defs',
3549
+ children: [
3550
+ {
3551
+ tag: 'clipPath',
3552
+ attributes: {
3553
+ id: clipId,
3554
+ },
3555
+ children: deGroup(maskPath),
3556
+ },
3557
+ maskTag,
3558
+ ],
3559
+ };
3560
+ children.push(defs, {
3561
+ tag: 'rect',
3562
+ attributes: _objectSpread2(
3563
+ {
3564
+ fill: 'currentColor',
3565
+ 'clip-path': 'url(#'.concat(clipId, ')'),
3566
+ mask: 'url(#'.concat(maskId, ')'),
3567
+ },
3568
+ ALL_SPACE,
3569
+ ),
3570
+ });
3571
+ return {
3572
+ children: children,
3573
+ attributes: attributes,
3574
+ };
3575
+ };
3576
+ },
3577
+ };
3578
+
3579
+ var MissingIconIndicator = {
3580
+ provides: function provides(providers) {
3581
+ var reduceMotion = false;
3582
+
3583
+ if (WINDOW.matchMedia) {
3584
+ reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
3585
+ }
3586
+
3587
+ providers.missingIconAbstract = function () {
3588
+ var gChildren = [];
3589
+ var FILL = {
3590
+ fill: 'currentColor',
3591
+ };
3592
+ var ANIMATION_BASE = {
3593
+ attributeType: 'XML',
3594
+ repeatCount: 'indefinite',
3595
+ dur: '2s',
3596
+ }; // Ring
3597
+
3598
+ gChildren.push({
3599
+ tag: 'path',
3600
+ attributes: _objectSpread2(
3601
+ _objectSpread2({}, FILL),
3602
+ {},
3603
+ {
3604
+ d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z',
3605
+ },
3606
+ ),
3607
+ });
3608
+
3609
+ var OPACITY_ANIMATE = _objectSpread2(
3610
+ _objectSpread2({}, ANIMATION_BASE),
3611
+ {},
3612
+ {
3613
+ attributeName: 'opacity',
3614
+ },
3615
+ );
3616
+
3617
+ var dot = {
3618
+ tag: 'circle',
3619
+ attributes: _objectSpread2(
3620
+ _objectSpread2({}, FILL),
3621
+ {},
3622
+ {
3623
+ cx: '256',
3624
+ cy: '364',
3625
+ r: '28',
3626
+ },
3627
+ ),
3628
+ children: [],
3629
+ };
3630
+
3631
+ if (!reduceMotion) {
3632
+ dot.children.push(
3633
+ {
3634
+ tag: 'animate',
3635
+ attributes: _objectSpread2(
3636
+ _objectSpread2({}, ANIMATION_BASE),
3637
+ {},
3638
+ {
3639
+ attributeName: 'r',
3640
+ values: '28;14;28;28;14;28;',
3641
+ },
3642
+ ),
3643
+ },
3644
+ {
3645
+ tag: 'animate',
3646
+ attributes: _objectSpread2(
3647
+ _objectSpread2({}, OPACITY_ANIMATE),
3648
+ {},
3649
+ {
3650
+ values: '1;0;1;1;0;1;',
3651
+ },
3652
+ ),
3653
+ },
3654
+ );
3655
+ }
3656
+
3657
+ gChildren.push(dot);
3658
+ gChildren.push({
3659
+ tag: 'path',
3660
+ attributes: _objectSpread2(
3661
+ _objectSpread2({}, FILL),
3662
+ {},
3663
+ {
3664
+ opacity: '1',
3665
+ d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z',
3666
+ },
3667
+ ),
3668
+ children: reduceMotion
3669
+ ? []
3670
+ : [
3671
+ {
3672
+ tag: 'animate',
3673
+ attributes: _objectSpread2(
3674
+ _objectSpread2({}, OPACITY_ANIMATE),
3675
+ {},
3676
+ {
3677
+ values: '1;0;0;0;0;1;',
3678
+ },
3679
+ ),
3680
+ },
3681
+ ],
3682
+ });
3683
+
3684
+ if (!reduceMotion) {
3685
+ // Exclamation
3686
+ gChildren.push({
3687
+ tag: 'path',
3688
+ attributes: _objectSpread2(
3689
+ _objectSpread2({}, FILL),
3690
+ {},
3691
+ {
3692
+ opacity: '0',
3693
+ d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z',
3694
+ },
3695
+ ),
3696
+ children: [
3697
+ {
3698
+ tag: 'animate',
3699
+ attributes: _objectSpread2(
3700
+ _objectSpread2({}, OPACITY_ANIMATE),
3701
+ {},
3702
+ {
3703
+ values: '0;0;1;1;0;0;',
3704
+ },
3705
+ ),
3706
+ },
3707
+ ],
3708
+ });
3709
+ }
3710
+
3711
+ return {
3712
+ tag: 'g',
3713
+ attributes: {
3714
+ class: 'missing',
3715
+ },
3716
+ children: gChildren,
3717
+ };
3718
+ };
3719
+ },
3720
+ };
3721
+
3722
+ var SvgSymbols = {
3723
+ hooks: function hooks() {
3724
+ return {
3725
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3726
+ var symbolData = node.getAttribute('data-fa-symbol');
3727
+ var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
3728
+ accumulator['symbol'] = symbol;
3729
+ return accumulator;
3730
+ },
3731
+ };
3732
+ },
3733
+ };
3734
+
3735
+ var plugins = [
3736
+ InjectCSS,
3737
+ ReplaceElements,
3738
+ Layers,
3739
+ LayersCounter,
3740
+ LayersText,
3741
+ PseudoElements,
3742
+ MutationObserver$1,
3743
+ PowerTransforms,
3744
+ Masks,
3745
+ MissingIconIndicator,
3746
+ SvgSymbols,
3747
+ ];
3748
+
3749
+ registerPlugins(plugins, {
3750
+ mixoutsTo: api,
3751
+ });
3752
+ var noAuto$1 = api.noAuto;
3753
+ var config$1 = api.config;
3754
+ var library$1 = api.library;
3755
+ var dom$1 = api.dom;
3756
+ var parse$1 = api.parse;
3757
+ var findIconDefinition$1 = api.findIconDefinition;
3758
+ var toHtml$1 = api.toHtml;
3759
+ var icon = api.icon;
3760
+ var layer = api.layer;
3761
+ var text = api.text;
3762
+ var counter = api.counter;
3763
+
3764
+ export {
3765
+ noAuto$1 as noAuto,
3766
+ config$1 as config,
3767
+ library$1 as library,
3768
+ dom$1 as dom,
3769
+ parse$1 as parse,
3770
+ findIconDefinition$1 as findIconDefinition,
3771
+ toHtml$1 as toHtml,
3772
+ icon,
3773
+ layer,
3774
+ text,
3775
+ counter,
3776
+ api,
3777
+ };