@xplortech/apollo-core 0.0.2 → 0.0.3

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.
@@ -4,9 +4,2496 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5a391b2a.js');
6
6
 
7
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
+
9
+ /*!
10
+ * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com
11
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
12
+ */
13
+ (function () {
14
+
15
+ function _typeof(obj) {
16
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
17
+ _typeof = function (obj) {
18
+ return typeof obj;
19
+ };
20
+ } else {
21
+ _typeof = function (obj) {
22
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
23
+ };
24
+ }
25
+
26
+ return _typeof(obj);
27
+ }
28
+
29
+ function _classCallCheck(instance, Constructor) {
30
+ if (!(instance instanceof Constructor)) {
31
+ throw new TypeError("Cannot call a class as a function");
32
+ }
33
+ }
34
+
35
+ function _defineProperties(target, props) {
36
+ for (var i = 0; i < props.length; i++) {
37
+ var descriptor = props[i];
38
+ descriptor.enumerable = descriptor.enumerable || false;
39
+ descriptor.configurable = true;
40
+ if ("value" in descriptor) descriptor.writable = true;
41
+ Object.defineProperty(target, descriptor.key, descriptor);
42
+ }
43
+ }
44
+
45
+ function _createClass(Constructor, protoProps, staticProps) {
46
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
47
+ if (staticProps) _defineProperties(Constructor, staticProps);
48
+ return Constructor;
49
+ }
50
+
51
+ function _defineProperty(obj, key, value) {
52
+ if (key in obj) {
53
+ Object.defineProperty(obj, key, {
54
+ value: value,
55
+ enumerable: true,
56
+ configurable: true,
57
+ writable: true
58
+ });
59
+ } else {
60
+ obj[key] = value;
61
+ }
62
+
63
+ return obj;
64
+ }
65
+
66
+ function _objectSpread(target) {
67
+ for (var i = 1; i < arguments.length; i++) {
68
+ var source = arguments[i] != null ? arguments[i] : {};
69
+ var ownKeys = Object.keys(source);
70
+
71
+ if (typeof Object.getOwnPropertySymbols === 'function') {
72
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
73
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
74
+ }));
75
+ }
76
+
77
+ ownKeys.forEach(function (key) {
78
+ _defineProperty(target, key, source[key]);
79
+ });
80
+ }
81
+
82
+ return target;
83
+ }
84
+
85
+ function _slicedToArray(arr, i) {
86
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
87
+ }
88
+
89
+ function _toConsumableArray(arr) {
90
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
91
+ }
92
+
93
+ function _arrayWithoutHoles(arr) {
94
+ if (Array.isArray(arr)) {
95
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
96
+
97
+ return arr2;
98
+ }
99
+ }
100
+
101
+ function _arrayWithHoles(arr) {
102
+ if (Array.isArray(arr)) return arr;
103
+ }
104
+
105
+ function _iterableToArray(iter) {
106
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
107
+ }
108
+
109
+ function _iterableToArrayLimit(arr, i) {
110
+ var _arr = [];
111
+ var _n = true;
112
+ var _d = false;
113
+ var _e = undefined;
114
+
115
+ try {
116
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
117
+ _arr.push(_s.value);
118
+
119
+ if (i && _arr.length === i) break;
120
+ }
121
+ } catch (err) {
122
+ _d = true;
123
+ _e = err;
124
+ } finally {
125
+ try {
126
+ if (!_n && _i["return"] != null) _i["return"]();
127
+ } finally {
128
+ if (_d) throw _e;
129
+ }
130
+ }
131
+
132
+ return _arr;
133
+ }
134
+
135
+ function _nonIterableSpread() {
136
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
137
+ }
138
+
139
+ function _nonIterableRest() {
140
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
141
+ }
142
+
143
+ var noop = function noop() {};
144
+
145
+ var _WINDOW = {};
146
+ var _DOCUMENT = {};
147
+ var _MUTATION_OBSERVER = null;
148
+ var _PERFORMANCE = {
149
+ mark: noop,
150
+ measure: noop
151
+ };
152
+
153
+ try {
154
+ if (typeof window !== 'undefined') _WINDOW = window;
155
+ if (typeof document !== 'undefined') _DOCUMENT = document;
156
+ if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
157
+ if (typeof performance !== 'undefined') _PERFORMANCE = performance;
158
+ } catch (e) {}
159
+
160
+ var _ref = _WINDOW.navigator || {},
161
+ _ref$userAgent = _ref.userAgent,
162
+ userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
163
+
164
+ var WINDOW = _WINDOW;
165
+ var DOCUMENT = _DOCUMENT;
166
+ var MUTATION_OBSERVER = _MUTATION_OBSERVER;
167
+ var PERFORMANCE = _PERFORMANCE;
168
+ var IS_BROWSER = !!WINDOW.document;
169
+ var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
170
+ var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
171
+
172
+ var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
173
+ var UNITS_IN_GRID = 16;
174
+ var DEFAULT_FAMILY_PREFIX = 'fa';
175
+ var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
176
+ var DATA_FA_I2SVG = 'data-fa-i2svg';
177
+ var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
178
+ var DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
179
+ var DATA_PREFIX = 'data-prefix';
180
+ var DATA_ICON = 'data-icon';
181
+ var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
182
+ var MUTATION_APPROACH_ASYNC = 'async';
183
+ var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
184
+ var PRODUCTION = function () {
185
+ try {
186
+ return "production" === 'production';
187
+ } catch (e) {
188
+ return false;
189
+ }
190
+ }();
191
+ var PREFIX_TO_STYLE = {
192
+ 'fas': 'solid',
193
+ 'far': 'regular',
194
+ 'fal': 'light',
195
+ 'fad': 'duotone',
196
+ 'fab': 'brands',
197
+ 'fak': 'kit',
198
+ 'fa': 'solid'
199
+ };
200
+ var STYLE_TO_PREFIX = {
201
+ 'solid': 'fas',
202
+ 'regular': 'far',
203
+ 'light': 'fal',
204
+ 'duotone': 'fad',
205
+ 'brands': 'fab',
206
+ 'kit': 'fak'
207
+ };
208
+ var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
209
+ var FONT_FAMILY_PATTERN = /Font Awesome ([5 ]*)(Solid|Regular|Light|Duotone|Brands|Free|Pro|Kit).*/; // TODO: do we need to handle font-weight for kit SVG pseudo-elements?
210
+
211
+ var FONT_WEIGHT_TO_PREFIX = {
212
+ '900': 'fas',
213
+ '400': 'far',
214
+ 'normal': 'far',
215
+ '300': 'fal'
216
+ };
217
+ var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
218
+ var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
219
+ var ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
220
+ var DUOTONE_CLASSES = {
221
+ GROUP: 'group',
222
+ SWAP_OPACITY: 'swap-opacity',
223
+ PRIMARY: 'primary',
224
+ SECONDARY: 'secondary'
225
+ };
226
+ var RESERVED_CLASSES = ['xs', 'sm', 'lg', 'fw', 'ul', 'li', 'border', 'pull-left', 'pull-right', 'spin', 'pulse', 'rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'flip-both', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY].concat(oneToTen.map(function (n) {
227
+ return "".concat(n, "x");
228
+ })).concat(oneToTwenty.map(function (n) {
229
+ return "w-".concat(n);
230
+ }));
231
+
232
+ var initial = WINDOW.FontAwesomeConfig || {};
233
+
234
+ function getAttrConfig(attr) {
235
+ var element = DOCUMENT.querySelector('script[' + attr + ']');
236
+
237
+ if (element) {
238
+ return element.getAttribute(attr);
239
+ }
240
+ }
241
+
242
+ function coerce(val) {
243
+ // Getting an empty string will occur if the attribute is set on the HTML tag but without a value
244
+ // We'll assume that this is an indication that it should be toggled to true
245
+ // For example <script data-search-pseudo-elements src="..."></script>
246
+ if (val === '') return true;
247
+ if (val === 'false') return false;
248
+ if (val === 'true') return true;
249
+ return val;
250
+ }
251
+
252
+ if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
253
+ var attrs = [['data-family-prefix', 'familyPrefix'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];
254
+ attrs.forEach(function (_ref) {
255
+ var _ref2 = _slicedToArray(_ref, 2),
256
+ attr = _ref2[0],
257
+ key = _ref2[1];
258
+
259
+ var val = coerce(getAttrConfig(attr));
260
+
261
+ if (val !== undefined && val !== null) {
262
+ initial[key] = val;
263
+ }
264
+ });
265
+ }
266
+
267
+ var _default = {
268
+ familyPrefix: DEFAULT_FAMILY_PREFIX,
269
+ replacementClass: DEFAULT_REPLACEMENT_CLASS,
270
+ autoReplaceSvg: true,
271
+ autoAddCss: true,
272
+ autoA11y: true,
273
+ searchPseudoElements: false,
274
+ observeMutations: true,
275
+ mutateApproach: 'async',
276
+ keepOriginalSource: true,
277
+ measurePerformance: false,
278
+ showMissingIcons: true
279
+ };
280
+
281
+ var _config = _objectSpread({}, _default, initial);
282
+
283
+ if (!_config.autoReplaceSvg) _config.observeMutations = false;
284
+
285
+ var config = _objectSpread({}, _config);
286
+
287
+ WINDOW.FontAwesomeConfig = config;
288
+
289
+ var w = WINDOW || {};
290
+ if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
291
+ if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
292
+ if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
293
+ if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
294
+ var namespace = w[NAMESPACE_IDENTIFIER];
295
+
296
+ var functions = [];
297
+
298
+ var listener = function listener() {
299
+ DOCUMENT.removeEventListener('DOMContentLoaded', listener);
300
+ loaded = 1;
301
+ functions.map(function (fn) {
302
+ return fn();
303
+ });
304
+ };
305
+
306
+ var loaded = false;
307
+
308
+ if (IS_DOM) {
309
+ loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
310
+ if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
311
+ }
312
+
313
+ function domready (fn) {
314
+ if (!IS_DOM) return;
315
+ loaded ? setTimeout(fn, 0) : functions.push(fn);
316
+ }
317
+
318
+ var PENDING = 'pending';
319
+ var SETTLED = 'settled';
320
+ var FULFILLED = 'fulfilled';
321
+ var REJECTED = 'rejected';
322
+
323
+ var NOOP = function NOOP() {};
324
+
325
+ var isNode = typeof commonjsGlobal !== 'undefined' && typeof commonjsGlobal.process !== 'undefined' && typeof commonjsGlobal.process.emit === 'function';
326
+ var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
327
+ var asyncQueue = [];
328
+ var asyncTimer;
329
+
330
+ function asyncFlush() {
331
+ // run promise callbacks
332
+ for (var i = 0; i < asyncQueue.length; i++) {
333
+ asyncQueue[i][0](asyncQueue[i][1]);
334
+ } // reset async asyncQueue
335
+
336
+
337
+ asyncQueue = [];
338
+ asyncTimer = false;
339
+ }
340
+
341
+ function asyncCall(callback, arg) {
342
+ asyncQueue.push([callback, arg]);
343
+
344
+ if (!asyncTimer) {
345
+ asyncTimer = true;
346
+ asyncSetTimer(asyncFlush, 0);
347
+ }
348
+ }
349
+
350
+ function invokeResolver(resolver, promise) {
351
+ function resolvePromise(value) {
352
+ resolve(promise, value);
353
+ }
354
+
355
+ function rejectPromise(reason) {
356
+ reject(promise, reason);
357
+ }
358
+
359
+ try {
360
+ resolver(resolvePromise, rejectPromise);
361
+ } catch (e) {
362
+ rejectPromise(e);
363
+ }
364
+ }
365
+
366
+ function invokeCallback(subscriber) {
367
+ var owner = subscriber.owner;
368
+ var settled = owner._state;
369
+ var value = owner._data;
370
+ var callback = subscriber[settled];
371
+ var promise = subscriber.then;
372
+
373
+ if (typeof callback === 'function') {
374
+ settled = FULFILLED;
375
+
376
+ try {
377
+ value = callback(value);
378
+ } catch (e) {
379
+ reject(promise, e);
380
+ }
381
+ }
382
+
383
+ if (!handleThenable(promise, value)) {
384
+ if (settled === FULFILLED) {
385
+ resolve(promise, value);
386
+ }
387
+
388
+ if (settled === REJECTED) {
389
+ reject(promise, value);
390
+ }
391
+ }
392
+ }
393
+
394
+ function handleThenable(promise, value) {
395
+ var resolved;
396
+
397
+ try {
398
+ if (promise === value) {
399
+ throw new TypeError('A promises callback cannot return that same promise.');
400
+ }
401
+
402
+ if (value && (typeof value === 'function' || _typeof(value) === 'object')) {
403
+ // then should be retrieved only once
404
+ var then = value.then;
405
+
406
+ if (typeof then === 'function') {
407
+ then.call(value, function (val) {
408
+ if (!resolved) {
409
+ resolved = true;
410
+
411
+ if (value === val) {
412
+ fulfill(promise, val);
413
+ } else {
414
+ resolve(promise, val);
415
+ }
416
+ }
417
+ }, function (reason) {
418
+ if (!resolved) {
419
+ resolved = true;
420
+ reject(promise, reason);
421
+ }
422
+ });
423
+ return true;
424
+ }
425
+ }
426
+ } catch (e) {
427
+ if (!resolved) {
428
+ reject(promise, e);
429
+ }
430
+
431
+ return true;
432
+ }
433
+
434
+ return false;
435
+ }
436
+
437
+ function resolve(promise, value) {
438
+ if (promise === value || !handleThenable(promise, value)) {
439
+ fulfill(promise, value);
440
+ }
441
+ }
442
+
443
+ function fulfill(promise, value) {
444
+ if (promise._state === PENDING) {
445
+ promise._state = SETTLED;
446
+ promise._data = value;
447
+ asyncCall(publishFulfillment, promise);
448
+ }
449
+ }
450
+
451
+ function reject(promise, reason) {
452
+ if (promise._state === PENDING) {
453
+ promise._state = SETTLED;
454
+ promise._data = reason;
455
+ asyncCall(publishRejection, promise);
456
+ }
457
+ }
458
+
459
+ function publish(promise) {
460
+ promise._then = promise._then.forEach(invokeCallback);
461
+ }
462
+
463
+ function publishFulfillment(promise) {
464
+ promise._state = FULFILLED;
465
+ publish(promise);
466
+ }
467
+
468
+ function publishRejection(promise) {
469
+ promise._state = REJECTED;
470
+ publish(promise);
471
+
472
+ if (!promise._handled && isNode) {
473
+ commonjsGlobal.process.emit('unhandledRejection', promise._data, promise);
474
+ }
475
+ }
476
+
477
+ function notifyRejectionHandled(promise) {
478
+ commonjsGlobal.process.emit('rejectionHandled', promise);
479
+ }
480
+ /**
481
+ * @class
482
+ */
483
+
484
+
485
+ function P(resolver) {
486
+ if (typeof resolver !== 'function') {
487
+ throw new TypeError('Promise resolver ' + resolver + ' is not a function');
488
+ }
489
+
490
+ if (this instanceof P === false) {
491
+ throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
492
+ }
493
+
494
+ this._then = [];
495
+ invokeResolver(resolver, this);
496
+ }
497
+
498
+ P.prototype = {
499
+ constructor: P,
500
+ _state: PENDING,
501
+ _then: null,
502
+ _data: undefined,
503
+ _handled: false,
504
+ then: function then(onFulfillment, onRejection) {
505
+ var subscriber = {
506
+ owner: this,
507
+ then: new this.constructor(NOOP),
508
+ fulfilled: onFulfillment,
509
+ rejected: onRejection
510
+ };
511
+
512
+ if ((onRejection || onFulfillment) && !this._handled) {
513
+ this._handled = true;
514
+
515
+ if (this._state === REJECTED && isNode) {
516
+ asyncCall(notifyRejectionHandled, this);
517
+ }
518
+ }
519
+
520
+ if (this._state === FULFILLED || this._state === REJECTED) {
521
+ // already resolved, call callback async
522
+ asyncCall(invokeCallback, subscriber);
523
+ } else {
524
+ // subscribe
525
+ this._then.push(subscriber);
526
+ }
527
+
528
+ return subscriber.then;
529
+ },
530
+ catch: function _catch(onRejection) {
531
+ return this.then(null, onRejection);
532
+ }
533
+ };
534
+
535
+ P.all = function (promises) {
536
+ if (!Array.isArray(promises)) {
537
+ throw new TypeError('You must pass an array to Promise.all().');
538
+ }
539
+
540
+ return new P(function (resolve, reject) {
541
+ var results = [];
542
+ var remaining = 0;
543
+
544
+ function resolver(index) {
545
+ remaining++;
546
+ return function (value) {
547
+ results[index] = value;
548
+
549
+ if (! --remaining) {
550
+ resolve(results);
551
+ }
552
+ };
553
+ }
554
+
555
+ for (var i = 0, promise; i < promises.length; i++) {
556
+ promise = promises[i];
557
+
558
+ if (promise && typeof promise.then === 'function') {
559
+ promise.then(resolver(i), reject);
560
+ } else {
561
+ results[i] = promise;
562
+ }
563
+ }
564
+
565
+ if (!remaining) {
566
+ resolve(results);
567
+ }
568
+ });
569
+ };
570
+
571
+ P.race = function (promises) {
572
+ if (!Array.isArray(promises)) {
573
+ throw new TypeError('You must pass an array to Promise.race().');
574
+ }
575
+
576
+ return new P(function (resolve, reject) {
577
+ for (var i = 0, promise; i < promises.length; i++) {
578
+ promise = promises[i];
579
+
580
+ if (promise && typeof promise.then === 'function') {
581
+ promise.then(resolve, reject);
582
+ } else {
583
+ resolve(promise);
584
+ }
585
+ }
586
+ });
587
+ };
588
+
589
+ P.resolve = function (value) {
590
+ if (value && _typeof(value) === 'object' && value.constructor === P) {
591
+ return value;
592
+ }
593
+
594
+ return new P(function (resolve) {
595
+ resolve(value);
596
+ });
597
+ };
598
+
599
+ P.reject = function (reason) {
600
+ return new P(function (resolve, reject) {
601
+ reject(reason);
602
+ });
603
+ };
604
+
605
+ var picked = typeof Promise === 'function' ? Promise : P;
606
+
607
+ var d = UNITS_IN_GRID;
608
+ var meaninglessTransform = {
609
+ size: 16,
610
+ x: 0,
611
+ y: 0,
612
+ rotate: 0,
613
+ flipX: false,
614
+ flipY: false
615
+ };
616
+
617
+ function isReserved(name) {
618
+ return ~RESERVED_CLASSES.indexOf(name);
619
+ }
620
+
621
+ function bunker(fn) {
622
+ try {
623
+ fn();
624
+ } catch (e) {
625
+ if (!PRODUCTION) {
626
+ throw e;
627
+ }
628
+ }
629
+ }
630
+ function insertCss(css) {
631
+ if (!css || !IS_DOM) {
632
+ return;
633
+ }
634
+
635
+ var style = DOCUMENT.createElement('style');
636
+ style.setAttribute('type', 'text/css');
637
+ style.innerHTML = css;
638
+ var headChildren = DOCUMENT.head.childNodes;
639
+ var beforeChild = null;
640
+
641
+ for (var i = headChildren.length - 1; i > -1; i--) {
642
+ var child = headChildren[i];
643
+ var tagName = (child.tagName || '').toUpperCase();
644
+
645
+ if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
646
+ beforeChild = child;
647
+ }
648
+ }
649
+
650
+ DOCUMENT.head.insertBefore(style, beforeChild);
651
+ return css;
652
+ }
653
+ var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
654
+ function nextUniqueId() {
655
+ var size = 12;
656
+ var id = '';
657
+
658
+ while (size-- > 0) {
659
+ id += idPool[Math.random() * 62 | 0];
660
+ }
661
+
662
+ return id;
663
+ }
664
+ function toArray(obj) {
665
+ var array = [];
666
+
667
+ for (var i = (obj || []).length >>> 0; i--;) {
668
+ array[i] = obj[i];
669
+ }
670
+
671
+ return array;
672
+ }
673
+ function classArray(node) {
674
+ if (node.classList) {
675
+ return toArray(node.classList);
676
+ } else {
677
+ return (node.getAttribute('class') || '').split(' ').filter(function (i) {
678
+ return i;
679
+ });
680
+ }
681
+ }
682
+ function getIconName(familyPrefix, cls) {
683
+ var parts = cls.split('-');
684
+ var prefix = parts[0];
685
+ var iconName = parts.slice(1).join('-');
686
+
687
+ if (prefix === familyPrefix && iconName !== '' && !isReserved(iconName)) {
688
+ return iconName;
689
+ } else {
690
+ return null;
691
+ }
692
+ }
693
+ function htmlEscape(str) {
694
+ return "".concat(str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
695
+ }
696
+ function joinAttributes(attributes) {
697
+ return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
698
+ return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
699
+ }, '').trim();
700
+ }
701
+ function joinStyles(styles) {
702
+ return Object.keys(styles || {}).reduce(function (acc, styleName) {
703
+ return acc + "".concat(styleName, ": ").concat(styles[styleName], ";");
704
+ }, '');
705
+ }
706
+ function transformIsMeaningful(transform) {
707
+ return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
708
+ }
709
+ function transformForSvg(_ref) {
710
+ var transform = _ref.transform,
711
+ containerWidth = _ref.containerWidth,
712
+ iconWidth = _ref.iconWidth;
713
+ var outer = {
714
+ transform: "translate(".concat(containerWidth / 2, " 256)")
715
+ };
716
+ var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
717
+ var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
718
+ var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
719
+ var inner = {
720
+ transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
721
+ };
722
+ var path = {
723
+ transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
724
+ };
725
+ return {
726
+ outer: outer,
727
+ inner: inner,
728
+ path: path
729
+ };
730
+ }
731
+ function transformForCss(_ref2) {
732
+ var transform = _ref2.transform,
733
+ _ref2$width = _ref2.width,
734
+ width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,
735
+ _ref2$height = _ref2.height,
736
+ height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,
737
+ _ref2$startCentered = _ref2.startCentered,
738
+ startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;
739
+ var val = '';
740
+
741
+ if (startCentered && IS_IE) {
742
+ val += "translate(".concat(transform.x / d - width / 2, "em, ").concat(transform.y / d - height / 2, "em) ");
743
+ } else if (startCentered) {
744
+ val += "translate(calc(-50% + ".concat(transform.x / d, "em), calc(-50% + ").concat(transform.y / d, "em)) ");
745
+ } else {
746
+ val += "translate(".concat(transform.x / d, "em, ").concat(transform.y / d, "em) ");
747
+ }
748
+
749
+ val += "scale(".concat(transform.size / d * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d * (transform.flipY ? -1 : 1), ") ");
750
+ val += "rotate(".concat(transform.rotate, "deg) ");
751
+ return val;
752
+ }
753
+
754
+ var ALL_SPACE = {
755
+ x: 0,
756
+ y: 0,
757
+ width: '100%',
758
+ height: '100%'
759
+ };
760
+
761
+ function fillBlack(abstract) {
762
+ var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
763
+
764
+ if (abstract.attributes && (abstract.attributes.fill || force)) {
765
+ abstract.attributes.fill = 'black';
766
+ }
767
+
768
+ return abstract;
769
+ }
770
+
771
+ function deGroup(abstract) {
772
+ if (abstract.tag === 'g') {
773
+ return abstract.children;
774
+ } else {
775
+ return [abstract];
776
+ }
777
+ }
778
+
779
+ function makeIconMasking (_ref) {
780
+ var children = _ref.children,
781
+ attributes = _ref.attributes,
782
+ main = _ref.main,
783
+ mask = _ref.mask,
784
+ explicitMaskId = _ref.maskId,
785
+ transform = _ref.transform;
786
+ var mainWidth = main.width,
787
+ mainPath = main.icon;
788
+ var maskWidth = mask.width,
789
+ maskPath = mask.icon;
790
+ var trans = transformForSvg({
791
+ transform: transform,
792
+ containerWidth: maskWidth,
793
+ iconWidth: mainWidth
794
+ });
795
+ var maskRect = {
796
+ tag: 'rect',
797
+ attributes: _objectSpread({}, ALL_SPACE, {
798
+ fill: 'white'
799
+ })
800
+ };
801
+ var maskInnerGroupChildrenMixin = mainPath.children ? {
802
+ children: mainPath.children.map(fillBlack)
803
+ } : {};
804
+ var maskInnerGroup = {
805
+ tag: 'g',
806
+ attributes: _objectSpread({}, trans.inner),
807
+ children: [fillBlack(_objectSpread({
808
+ tag: mainPath.tag,
809
+ attributes: _objectSpread({}, mainPath.attributes, trans.path)
810
+ }, maskInnerGroupChildrenMixin))]
811
+ };
812
+ var maskOuterGroup = {
813
+ tag: 'g',
814
+ attributes: _objectSpread({}, trans.outer),
815
+ children: [maskInnerGroup]
816
+ };
817
+ var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
818
+ var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
819
+ var maskTag = {
820
+ tag: 'mask',
821
+ attributes: _objectSpread({}, ALL_SPACE, {
822
+ id: maskId,
823
+ maskUnits: 'userSpaceOnUse',
824
+ maskContentUnits: 'userSpaceOnUse'
825
+ }),
826
+ children: [maskRect, maskOuterGroup]
827
+ };
828
+ var defs = {
829
+ tag: 'defs',
830
+ children: [{
831
+ tag: 'clipPath',
832
+ attributes: {
833
+ id: clipId
834
+ },
835
+ children: deGroup(maskPath)
836
+ }, maskTag]
837
+ };
838
+ children.push(defs, {
839
+ tag: 'rect',
840
+ attributes: _objectSpread({
841
+ fill: 'currentColor',
842
+ 'clip-path': "url(#".concat(clipId, ")"),
843
+ mask: "url(#".concat(maskId, ")")
844
+ }, ALL_SPACE)
845
+ });
846
+ return {
847
+ children: children,
848
+ attributes: attributes
849
+ };
850
+ }
851
+
852
+ function makeIconStandard (_ref) {
853
+ var children = _ref.children,
854
+ attributes = _ref.attributes,
855
+ main = _ref.main,
856
+ transform = _ref.transform,
857
+ styles = _ref.styles;
858
+ var styleString = joinStyles(styles);
859
+
860
+ if (styleString.length > 0) {
861
+ attributes['style'] = styleString;
862
+ }
863
+
864
+ if (transformIsMeaningful(transform)) {
865
+ var trans = transformForSvg({
866
+ transform: transform,
867
+ containerWidth: main.width,
868
+ iconWidth: main.width
869
+ });
870
+ children.push({
871
+ tag: 'g',
872
+ attributes: _objectSpread({}, trans.outer),
873
+ children: [{
874
+ tag: 'g',
875
+ attributes: _objectSpread({}, trans.inner),
876
+ children: [{
877
+ tag: main.icon.tag,
878
+ children: main.icon.children,
879
+ attributes: _objectSpread({}, main.icon.attributes, trans.path)
880
+ }]
881
+ }]
882
+ });
883
+ } else {
884
+ children.push(main.icon);
885
+ }
886
+
887
+ return {
888
+ children: children,
889
+ attributes: attributes
890
+ };
891
+ }
892
+
893
+ function asIcon (_ref) {
894
+ var children = _ref.children,
895
+ main = _ref.main,
896
+ mask = _ref.mask,
897
+ attributes = _ref.attributes,
898
+ styles = _ref.styles,
899
+ transform = _ref.transform;
900
+
901
+ if (transformIsMeaningful(transform) && main.found && !mask.found) {
902
+ var width = main.width,
903
+ height = main.height;
904
+ var offset = {
905
+ x: width / height / 2,
906
+ y: 0.5
907
+ };
908
+ attributes['style'] = joinStyles(_objectSpread({}, styles, {
909
+ 'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
910
+ }));
911
+ }
912
+
913
+ return [{
914
+ tag: 'svg',
915
+ attributes: attributes,
916
+ children: children
917
+ }];
918
+ }
919
+
920
+ function asSymbol (_ref) {
921
+ var prefix = _ref.prefix,
922
+ iconName = _ref.iconName,
923
+ children = _ref.children,
924
+ attributes = _ref.attributes,
925
+ symbol = _ref.symbol;
926
+ var id = symbol === true ? "".concat(prefix, "-").concat(config.familyPrefix, "-").concat(iconName) : symbol;
927
+ return [{
928
+ tag: 'svg',
929
+ attributes: {
930
+ style: 'display: none;'
931
+ },
932
+ children: [{
933
+ tag: 'symbol',
934
+ attributes: _objectSpread({}, attributes, {
935
+ id: id
936
+ }),
937
+ children: children
938
+ }]
939
+ }];
940
+ }
941
+
942
+ function makeInlineSvgAbstract(params) {
943
+ var _params$icons = params.icons,
944
+ main = _params$icons.main,
945
+ mask = _params$icons.mask,
946
+ prefix = params.prefix,
947
+ iconName = params.iconName,
948
+ transform = params.transform,
949
+ symbol = params.symbol,
950
+ title = params.title,
951
+ maskId = params.maskId,
952
+ titleId = params.titleId,
953
+ extra = params.extra,
954
+ _params$watchable = params.watchable,
955
+ watchable = _params$watchable === void 0 ? false : _params$watchable;
956
+
957
+ var _ref = mask.found ? mask : main,
958
+ width = _ref.width,
959
+ height = _ref.height;
960
+
961
+ var isUploadedIcon = prefix === 'fak';
962
+ var widthClass = isUploadedIcon ? '' : "fa-w-".concat(Math.ceil(width / height * 16));
963
+ var attrClass = [config.replacementClass, iconName ? "".concat(config.familyPrefix, "-").concat(iconName) : '', widthClass].filter(function (c) {
964
+ return extra.classes.indexOf(c) === -1;
965
+ }).filter(function (c) {
966
+ return c !== '' || !!c;
967
+ }).concat(extra.classes).join(' ');
968
+ var content = {
969
+ children: [],
970
+ attributes: _objectSpread({}, extra.attributes, {
971
+ 'data-prefix': prefix,
972
+ 'data-icon': iconName,
973
+ 'class': attrClass,
974
+ 'role': extra.attributes.role || 'img',
975
+ 'xmlns': 'http://www.w3.org/2000/svg',
976
+ 'viewBox': "0 0 ".concat(width, " ").concat(height)
977
+ })
978
+ };
979
+ var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
980
+ width: "".concat(width / height * 16 * 0.0625, "em")
981
+ } : {};
982
+
983
+ if (watchable) {
984
+ content.attributes[DATA_FA_I2SVG] = '';
985
+ }
986
+
987
+ if (title) content.children.push({
988
+ tag: 'title',
989
+ attributes: {
990
+ id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
991
+ },
992
+ children: [title]
993
+ });
994
+
995
+ var args = _objectSpread({}, content, {
996
+ prefix: prefix,
997
+ iconName: iconName,
998
+ main: main,
999
+ mask: mask,
1000
+ maskId: maskId,
1001
+ transform: transform,
1002
+ symbol: symbol,
1003
+ styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)
1004
+ });
1005
+
1006
+ var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),
1007
+ children = _ref2.children,
1008
+ attributes = _ref2.attributes;
1009
+
1010
+ args.children = children;
1011
+ args.attributes = attributes;
1012
+
1013
+ if (symbol) {
1014
+ return asSymbol(args);
1015
+ } else {
1016
+ return asIcon(args);
1017
+ }
1018
+ }
1019
+ function makeLayersTextAbstract(params) {
1020
+ var content = params.content,
1021
+ width = params.width,
1022
+ height = params.height,
1023
+ transform = params.transform,
1024
+ title = params.title,
1025
+ extra = params.extra,
1026
+ _params$watchable2 = params.watchable,
1027
+ watchable = _params$watchable2 === void 0 ? false : _params$watchable2;
1028
+
1029
+ var attributes = _objectSpread({}, extra.attributes, title ? {
1030
+ 'title': title
1031
+ } : {}, {
1032
+ 'class': extra.classes.join(' ')
1033
+ });
1034
+
1035
+ if (watchable) {
1036
+ attributes[DATA_FA_I2SVG] = '';
1037
+ }
1038
+
1039
+ var styles = _objectSpread({}, extra.styles);
1040
+
1041
+ if (transformIsMeaningful(transform)) {
1042
+ styles['transform'] = transformForCss({
1043
+ transform: transform,
1044
+ startCentered: true,
1045
+ width: width,
1046
+ height: height
1047
+ });
1048
+ styles['-webkit-transform'] = styles['transform'];
1049
+ }
1050
+
1051
+ var styleString = joinStyles(styles);
1052
+
1053
+ if (styleString.length > 0) {
1054
+ attributes['style'] = styleString;
1055
+ }
1056
+
1057
+ var val = [];
1058
+ val.push({
1059
+ tag: 'span',
1060
+ attributes: attributes,
1061
+ children: [content]
1062
+ });
1063
+
1064
+ if (title) {
1065
+ val.push({
1066
+ tag: 'span',
1067
+ attributes: {
1068
+ class: 'sr-only'
1069
+ },
1070
+ children: [title]
1071
+ });
1072
+ }
1073
+
1074
+ return val;
1075
+ }
1076
+ function makeLayersCounterAbstract(params) {
1077
+ var content = params.content,
1078
+ title = params.title,
1079
+ extra = params.extra;
1080
+
1081
+ var attributes = _objectSpread({}, extra.attributes, title ? {
1082
+ 'title': title
1083
+ } : {}, {
1084
+ 'class': extra.classes.join(' ')
1085
+ });
1086
+
1087
+ var styleString = joinStyles(extra.styles);
1088
+
1089
+ if (styleString.length > 0) {
1090
+ attributes['style'] = styleString;
1091
+ }
1092
+
1093
+ var val = [];
1094
+ val.push({
1095
+ tag: 'span',
1096
+ attributes: attributes,
1097
+ children: [content]
1098
+ });
1099
+
1100
+ if (title) {
1101
+ val.push({
1102
+ tag: 'span',
1103
+ attributes: {
1104
+ class: 'sr-only'
1105
+ },
1106
+ children: [title]
1107
+ });
1108
+ }
1109
+
1110
+ return val;
1111
+ }
1112
+
1113
+ var noop$1 = function noop() {};
1114
+
1115
+ var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
1116
+ mark: noop$1,
1117
+ measure: noop$1
1118
+ };
1119
+ var preamble = "FA \"5.15.3\"";
1120
+
1121
+ var begin = function begin(name) {
1122
+ p.mark("".concat(preamble, " ").concat(name, " begins"));
1123
+ return function () {
1124
+ return end(name);
1125
+ };
1126
+ };
1127
+
1128
+ var end = function end(name) {
1129
+ p.mark("".concat(preamble, " ").concat(name, " ends"));
1130
+ p.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
1131
+ };
1132
+
1133
+ var perf = {
1134
+ begin: begin,
1135
+ end: end
1136
+ };
1137
+
1138
+ /**
1139
+ * Internal helper to bind a function known to have 4 arguments
1140
+ * to a given context.
1141
+ */
1142
+
1143
+ var bindInternal4 = function bindInternal4(func, thisContext) {
1144
+ return function (a, b, c, d) {
1145
+ return func.call(thisContext, a, b, c, d);
1146
+ };
1147
+ };
1148
+
1149
+ /**
1150
+ * # Reduce
1151
+ *
1152
+ * A fast object `.reduce()` implementation.
1153
+ *
1154
+ * @param {Object} subject The object to reduce over.
1155
+ * @param {Function} fn The reducer function.
1156
+ * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].
1157
+ * @param {Object} thisContext The context for the reducer.
1158
+ * @return {mixed} The final result.
1159
+ */
1160
+
1161
+
1162
+ var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
1163
+ var keys = Object.keys(subject),
1164
+ length = keys.length,
1165
+ iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
1166
+ i,
1167
+ key,
1168
+ result;
1169
+
1170
+ if (initialValue === undefined) {
1171
+ i = 1;
1172
+ result = subject[keys[0]];
1173
+ } else {
1174
+ i = 0;
1175
+ result = initialValue;
1176
+ }
1177
+
1178
+ for (; i < length; i++) {
1179
+ key = keys[i];
1180
+ result = iterator(result, subject[key], key, subject);
1181
+ }
1182
+
1183
+ return result;
1184
+ };
1185
+
1186
+ function toHex(unicode) {
1187
+ var result = '';
1188
+
1189
+ for (var i = 0; i < unicode.length; i++) {
1190
+ var hex = unicode.charCodeAt(i).toString(16);
1191
+ result += ('000' + hex).slice(-4);
1192
+ }
1193
+
1194
+ return result;
1195
+ }
1196
+
1197
+ function defineIcons(prefix, icons) {
1198
+ var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1199
+ var _params$skipHooks = params.skipHooks,
1200
+ skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
1201
+ var normalized = Object.keys(icons).reduce(function (acc, iconName) {
1202
+ var icon = icons[iconName];
1203
+ var expanded = !!icon.icon;
1204
+
1205
+ if (expanded) {
1206
+ acc[icon.iconName] = icon.icon;
1207
+ } else {
1208
+ acc[iconName] = icon;
1209
+ }
1210
+
1211
+ return acc;
1212
+ }, {});
1213
+
1214
+ if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
1215
+ namespace.hooks.addPack(prefix, normalized);
1216
+ } else {
1217
+ namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);
1218
+ }
1219
+ /**
1220
+ * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
1221
+ * of new styles we needed to differentiate between them. Prefix `fa` is now an alias
1222
+ * for `fas` so we'll easy the upgrade process for our users by automatically defining
1223
+ * this as well.
1224
+ */
1225
+
1226
+
1227
+ if (prefix === 'fas') {
1228
+ defineIcons('fa', icons);
1229
+ }
1230
+ }
1231
+
1232
+ var styles = namespace.styles,
1233
+ shims = namespace.shims;
1234
+ var _byUnicode = {};
1235
+ var _byLigature = {};
1236
+ var _byOldName = {};
1237
+ var build = function build() {
1238
+ var lookup = function lookup(reducer) {
1239
+ return reduce(styles, function (o, style, prefix) {
1240
+ o[prefix] = reduce(style, reducer, {});
1241
+ return o;
1242
+ }, {});
1243
+ };
1244
+
1245
+ _byUnicode = lookup(function (acc, icon, iconName) {
1246
+ if (icon[3]) {
1247
+ acc[icon[3]] = iconName;
1248
+ }
1249
+
1250
+ return acc;
1251
+ });
1252
+ _byLigature = lookup(function (acc, icon, iconName) {
1253
+ var ligatures = icon[2];
1254
+ acc[iconName] = iconName;
1255
+ ligatures.forEach(function (ligature) {
1256
+ acc[ligature] = iconName;
1257
+ });
1258
+ return acc;
1259
+ });
1260
+ var hasRegular = 'far' in styles;
1261
+ _byOldName = reduce(shims, function (acc, shim) {
1262
+ var oldName = shim[0];
1263
+ var prefix = shim[1];
1264
+ var iconName = shim[2];
1265
+
1266
+ if (prefix === 'far' && !hasRegular) {
1267
+ prefix = 'fas';
1268
+ }
1269
+
1270
+ acc[oldName] = {
1271
+ prefix: prefix,
1272
+ iconName: iconName
1273
+ };
1274
+ return acc;
1275
+ }, {});
1276
+ };
1277
+ build();
1278
+ function byUnicode(prefix, unicode) {
1279
+ return (_byUnicode[prefix] || {})[unicode];
1280
+ }
1281
+ function byLigature(prefix, ligature) {
1282
+ return (_byLigature[prefix] || {})[ligature];
1283
+ }
1284
+ function byOldName(name) {
1285
+ return _byOldName[name] || {
1286
+ prefix: null,
1287
+ iconName: null
1288
+ };
1289
+ }
1290
+
1291
+ var styles$1 = namespace.styles;
1292
+ var emptyCanonicalIcon = function emptyCanonicalIcon() {
1293
+ return {
1294
+ prefix: null,
1295
+ iconName: null,
1296
+ rest: []
1297
+ };
1298
+ };
1299
+ function getCanonicalIcon(values) {
1300
+ return values.reduce(function (acc, cls) {
1301
+ var iconName = getIconName(config.familyPrefix, cls);
1302
+
1303
+ if (styles$1[cls]) {
1304
+ acc.prefix = cls;
1305
+ } else if (config.autoFetchSvg && Object.keys(PREFIX_TO_STYLE).indexOf(cls) > -1) {
1306
+ acc.prefix = cls;
1307
+ } else if (iconName) {
1308
+ var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};
1309
+ acc.iconName = shim.iconName || iconName;
1310
+ acc.prefix = shim.prefix || acc.prefix;
1311
+ } else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {
1312
+ acc.rest.push(cls);
1313
+ }
1314
+
1315
+ return acc;
1316
+ }, emptyCanonicalIcon());
1317
+ }
1318
+ function iconFromMapping(mapping, prefix, iconName) {
1319
+ if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
1320
+ return {
1321
+ prefix: prefix,
1322
+ iconName: iconName,
1323
+ icon: mapping[prefix][iconName]
1324
+ };
1325
+ }
1326
+ }
1327
+
1328
+ function toHtml(abstractNodes) {
1329
+ var tag = abstractNodes.tag,
1330
+ _abstractNodes$attrib = abstractNodes.attributes,
1331
+ attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
1332
+ _abstractNodes$childr = abstractNodes.children,
1333
+ children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
1334
+
1335
+ if (typeof abstractNodes === 'string') {
1336
+ return htmlEscape(abstractNodes);
1337
+ } else {
1338
+ return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
1339
+ }
1340
+ }
1341
+
1342
+ var noop$2 = function noop() {};
1343
+
1344
+ function isWatched(node) {
1345
+ var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
1346
+ return typeof i2svg === 'string';
1347
+ }
1348
+
1349
+ function getMutator() {
1350
+ if (config.autoReplaceSvg === true) {
1351
+ return mutators.replace;
1352
+ }
1353
+
1354
+ var mutator = mutators[config.autoReplaceSvg];
1355
+ return mutator || mutators.replace;
1356
+ }
1357
+
1358
+ var mutators = {
1359
+ replace: function replace(mutation) {
1360
+ var node = mutation[0];
1361
+ var abstract = mutation[1];
1362
+ var newOuterHTML = abstract.map(function (a) {
1363
+ return toHtml(a);
1364
+ }).join('\n');
1365
+
1366
+ if (node.parentNode && node.outerHTML) {
1367
+ node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? "<!-- ".concat(node.outerHTML, " Font Awesome fontawesome.com -->") : '');
1368
+ } else if (node.parentNode) {
1369
+ var newNode = document.createElement('span');
1370
+ node.parentNode.replaceChild(newNode, node);
1371
+ newNode.outerHTML = newOuterHTML;
1372
+ }
1373
+ },
1374
+ nest: function nest(mutation) {
1375
+ var node = mutation[0];
1376
+ var abstract = mutation[1]; // If we already have a replaced node we do not want to continue nesting within it.
1377
+ // Short-circuit to the standard replacement
1378
+
1379
+ if (~classArray(node).indexOf(config.replacementClass)) {
1380
+ return mutators.replace(mutation);
1381
+ }
1382
+
1383
+ var forSvg = new RegExp("".concat(config.familyPrefix, "-.*"));
1384
+ delete abstract[0].attributes.style;
1385
+ delete abstract[0].attributes.id;
1386
+ var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {
1387
+ if (cls === config.replacementClass || cls.match(forSvg)) {
1388
+ acc.toSvg.push(cls);
1389
+ } else {
1390
+ acc.toNode.push(cls);
1391
+ }
1392
+
1393
+ return acc;
1394
+ }, {
1395
+ toNode: [],
1396
+ toSvg: []
1397
+ });
1398
+ abstract[0].attributes.class = splitClasses.toSvg.join(' ');
1399
+ var newInnerHTML = abstract.map(function (a) {
1400
+ return toHtml(a);
1401
+ }).join('\n');
1402
+ node.setAttribute('class', splitClasses.toNode.join(' '));
1403
+ node.setAttribute(DATA_FA_I2SVG, '');
1404
+ node.innerHTML = newInnerHTML;
1405
+ }
1406
+ };
1407
+
1408
+ function performOperationSync(op) {
1409
+ op();
1410
+ }
1411
+
1412
+ function perform(mutations, callback) {
1413
+ var callbackFunction = typeof callback === 'function' ? callback : noop$2;
1414
+
1415
+ if (mutations.length === 0) {
1416
+ callbackFunction();
1417
+ } else {
1418
+ var frame = performOperationSync;
1419
+
1420
+ if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {
1421
+ frame = WINDOW.requestAnimationFrame || performOperationSync;
1422
+ }
1423
+
1424
+ frame(function () {
1425
+ var mutator = getMutator();
1426
+ var mark = perf.begin('mutate');
1427
+ mutations.map(mutator);
1428
+ mark();
1429
+ callbackFunction();
1430
+ });
1431
+ }
1432
+ }
1433
+ var disabled = false;
1434
+ function disableObservation() {
1435
+ disabled = true;
1436
+ }
1437
+ function enableObservation() {
1438
+ disabled = false;
1439
+ }
1440
+ var mo = null;
1441
+ function observe(options) {
1442
+ if (!MUTATION_OBSERVER) {
1443
+ return;
1444
+ }
1445
+
1446
+ if (!config.observeMutations) {
1447
+ return;
1448
+ }
1449
+
1450
+ var treeCallback = options.treeCallback,
1451
+ nodeCallback = options.nodeCallback,
1452
+ pseudoElementsCallback = options.pseudoElementsCallback,
1453
+ _options$observeMutat = options.observeMutationsRoot,
1454
+ observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;
1455
+ mo = new MUTATION_OBSERVER(function (objects) {
1456
+ if (disabled) return;
1457
+ toArray(objects).forEach(function (mutationRecord) {
1458
+ if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
1459
+ if (config.searchPseudoElements) {
1460
+ pseudoElementsCallback(mutationRecord.target);
1461
+ }
1462
+
1463
+ treeCallback(mutationRecord.target);
1464
+ }
1465
+
1466
+ if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
1467
+ pseudoElementsCallback(mutationRecord.target.parentNode);
1468
+ }
1469
+
1470
+ if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
1471
+ if (mutationRecord.attributeName === 'class') {
1472
+ var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),
1473
+ prefix = _getCanonicalIcon.prefix,
1474
+ iconName = _getCanonicalIcon.iconName;
1475
+
1476
+ if (prefix) mutationRecord.target.setAttribute('data-prefix', prefix);
1477
+ if (iconName) mutationRecord.target.setAttribute('data-icon', iconName);
1478
+ } else {
1479
+ nodeCallback(mutationRecord.target);
1480
+ }
1481
+ }
1482
+ });
1483
+ });
1484
+ if (!IS_DOM) return;
1485
+ mo.observe(observeMutationsRoot, {
1486
+ childList: true,
1487
+ attributes: true,
1488
+ characterData: true,
1489
+ subtree: true
1490
+ });
1491
+ }
1492
+ function disconnect() {
1493
+ if (!mo) return;
1494
+ mo.disconnect();
1495
+ }
1496
+
1497
+ function styleParser (node) {
1498
+ var style = node.getAttribute('style');
1499
+ var val = [];
1500
+
1501
+ if (style) {
1502
+ val = style.split(';').reduce(function (acc, style) {
1503
+ var styles = style.split(':');
1504
+ var prop = styles[0];
1505
+ var value = styles.slice(1);
1506
+
1507
+ if (prop && value.length > 0) {
1508
+ acc[prop] = value.join(':').trim();
1509
+ }
1510
+
1511
+ return acc;
1512
+ }, {});
1513
+ }
1514
+
1515
+ return val;
1516
+ }
1517
+
1518
+ function classParser (node) {
1519
+ var existingPrefix = node.getAttribute('data-prefix');
1520
+ var existingIconName = node.getAttribute('data-icon');
1521
+ var innerText = node.innerText !== undefined ? node.innerText.trim() : '';
1522
+ var val = getCanonicalIcon(classArray(node));
1523
+
1524
+ if (existingPrefix && existingIconName) {
1525
+ val.prefix = existingPrefix;
1526
+ val.iconName = existingIconName;
1527
+ }
1528
+
1529
+ if (val.prefix && innerText.length > 1) {
1530
+ val.iconName = byLigature(val.prefix, node.innerText);
1531
+ } else if (val.prefix && innerText.length === 1) {
1532
+ val.iconName = byUnicode(val.prefix, toHex(node.innerText));
1533
+ }
1534
+
1535
+ return val;
1536
+ }
1537
+
1538
+ var parseTransformString = function parseTransformString(transformString) {
1539
+ var transform = {
1540
+ size: 16,
1541
+ x: 0,
1542
+ y: 0,
1543
+ flipX: false,
1544
+ flipY: false,
1545
+ rotate: 0
1546
+ };
1547
+
1548
+ if (!transformString) {
1549
+ return transform;
1550
+ } else {
1551
+ return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
1552
+ var parts = n.toLowerCase().split('-');
1553
+ var first = parts[0];
1554
+ var rest = parts.slice(1).join('-');
1555
+
1556
+ if (first && rest === 'h') {
1557
+ acc.flipX = true;
1558
+ return acc;
1559
+ }
1560
+
1561
+ if (first && rest === 'v') {
1562
+ acc.flipY = true;
1563
+ return acc;
1564
+ }
1565
+
1566
+ rest = parseFloat(rest);
1567
+
1568
+ if (isNaN(rest)) {
1569
+ return acc;
1570
+ }
1571
+
1572
+ switch (first) {
1573
+ case 'grow':
1574
+ acc.size = acc.size + rest;
1575
+ break;
1576
+
1577
+ case 'shrink':
1578
+ acc.size = acc.size - rest;
1579
+ break;
1580
+
1581
+ case 'left':
1582
+ acc.x = acc.x - rest;
1583
+ break;
1584
+
1585
+ case 'right':
1586
+ acc.x = acc.x + rest;
1587
+ break;
1588
+
1589
+ case 'up':
1590
+ acc.y = acc.y - rest;
1591
+ break;
1592
+
1593
+ case 'down':
1594
+ acc.y = acc.y + rest;
1595
+ break;
1596
+
1597
+ case 'rotate':
1598
+ acc.rotate = acc.rotate + rest;
1599
+ break;
1600
+ }
1601
+
1602
+ return acc;
1603
+ }, transform);
1604
+ }
1605
+ };
1606
+ function transformParser (node) {
1607
+ return parseTransformString(node.getAttribute('data-fa-transform'));
1608
+ }
1609
+
1610
+ function symbolParser (node) {
1611
+ var symbol = node.getAttribute('data-fa-symbol');
1612
+ return symbol === null ? false : symbol === '' ? true : symbol;
1613
+ }
1614
+
1615
+ function attributesParser (node) {
1616
+ var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {
1617
+ if (acc.name !== 'class' && acc.name !== 'style') {
1618
+ acc[attr.name] = attr.value;
1619
+ }
1620
+
1621
+ return acc;
1622
+ }, {});
1623
+ var title = node.getAttribute('title');
1624
+ var titleId = node.getAttribute('data-fa-title-id');
1625
+
1626
+ if (config.autoA11y) {
1627
+ if (title) {
1628
+ extraAttributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
1629
+ } else {
1630
+ extraAttributes['aria-hidden'] = 'true';
1631
+ extraAttributes['focusable'] = 'false';
1632
+ }
1633
+ }
1634
+
1635
+ return extraAttributes;
1636
+ }
1637
+
1638
+ function maskParser (node) {
1639
+ var mask = node.getAttribute('data-fa-mask');
1640
+
1641
+ if (!mask) {
1642
+ return emptyCanonicalIcon();
1643
+ } else {
1644
+ return getCanonicalIcon(mask.split(' ').map(function (i) {
1645
+ return i.trim();
1646
+ }));
1647
+ }
1648
+ }
1649
+
1650
+ function blankMeta() {
1651
+ return {
1652
+ iconName: null,
1653
+ title: null,
1654
+ titleId: null,
1655
+ prefix: null,
1656
+ transform: meaninglessTransform,
1657
+ symbol: false,
1658
+ mask: null,
1659
+ maskId: null,
1660
+ extra: {
1661
+ classes: [],
1662
+ styles: {},
1663
+ attributes: {}
1664
+ }
1665
+ };
1666
+ }
1667
+ function parseMeta(node) {
1668
+ var _classParser = classParser(node),
1669
+ iconName = _classParser.iconName,
1670
+ prefix = _classParser.prefix,
1671
+ extraClasses = _classParser.rest;
1672
+
1673
+ var extraStyles = styleParser(node);
1674
+ var transform = transformParser(node);
1675
+ var symbol = symbolParser(node);
1676
+ var extraAttributes = attributesParser(node);
1677
+ var mask = maskParser(node);
1678
+ return {
1679
+ iconName: iconName,
1680
+ title: node.getAttribute('title'),
1681
+ titleId: node.getAttribute('data-fa-title-id'),
1682
+ prefix: prefix,
1683
+ transform: transform,
1684
+ symbol: symbol,
1685
+ mask: mask,
1686
+ maskId: node.getAttribute('data-fa-mask-id'),
1687
+ extra: {
1688
+ classes: extraClasses,
1689
+ styles: extraStyles,
1690
+ attributes: extraAttributes
1691
+ }
1692
+ };
1693
+ }
1694
+
1695
+ function MissingIcon(error) {
1696
+ this.name = 'MissingIcon';
1697
+ this.message = error || 'Icon unavailable';
1698
+ this.stack = new Error().stack;
1699
+ }
1700
+ MissingIcon.prototype = Object.create(Error.prototype);
1701
+ MissingIcon.prototype.constructor = MissingIcon;
1702
+
1703
+ var FILL = {
1704
+ fill: 'currentColor'
1705
+ };
1706
+ var ANIMATION_BASE = {
1707
+ attributeType: 'XML',
1708
+ repeatCount: 'indefinite',
1709
+ dur: '2s'
1710
+ };
1711
+ var RING = {
1712
+ tag: 'path',
1713
+ attributes: _objectSpread({}, FILL, {
1714
+ 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'
1715
+ })
1716
+ };
1717
+
1718
+ var OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {
1719
+ attributeName: 'opacity'
1720
+ });
1721
+
1722
+ var DOT = {
1723
+ tag: 'circle',
1724
+ attributes: _objectSpread({}, FILL, {
1725
+ cx: '256',
1726
+ cy: '364',
1727
+ r: '28'
1728
+ }),
1729
+ children: [{
1730
+ tag: 'animate',
1731
+ attributes: _objectSpread({}, ANIMATION_BASE, {
1732
+ attributeName: 'r',
1733
+ values: '28;14;28;28;14;28;'
1734
+ })
1735
+ }, {
1736
+ tag: 'animate',
1737
+ attributes: _objectSpread({}, OPACITY_ANIMATE, {
1738
+ values: '1;0;1;1;0;1;'
1739
+ })
1740
+ }]
1741
+ };
1742
+ var QUESTION = {
1743
+ tag: 'path',
1744
+ attributes: _objectSpread({}, FILL, {
1745
+ opacity: '1',
1746
+ 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'
1747
+ }),
1748
+ children: [{
1749
+ tag: 'animate',
1750
+ attributes: _objectSpread({}, OPACITY_ANIMATE, {
1751
+ values: '1;0;0;0;0;1;'
1752
+ })
1753
+ }]
1754
+ };
1755
+ var EXCLAMATION = {
1756
+ tag: 'path',
1757
+ attributes: _objectSpread({}, FILL, {
1758
+ opacity: '0',
1759
+ 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'
1760
+ }),
1761
+ children: [{
1762
+ tag: 'animate',
1763
+ attributes: _objectSpread({}, OPACITY_ANIMATE, {
1764
+ values: '0;0;1;1;0;0;'
1765
+ })
1766
+ }]
1767
+ };
1768
+ var missing = {
1769
+ tag: 'g',
1770
+ children: [RING, DOT, QUESTION, EXCLAMATION]
1771
+ };
1772
+
1773
+ var styles$2 = namespace.styles;
1774
+ function asFoundIcon(icon) {
1775
+ var width = icon[0];
1776
+ var height = icon[1];
1777
+
1778
+ var _icon$slice = icon.slice(4),
1779
+ _icon$slice2 = _slicedToArray(_icon$slice, 1),
1780
+ vectorData = _icon$slice2[0];
1781
+
1782
+ var element = null;
1783
+
1784
+ if (Array.isArray(vectorData)) {
1785
+ element = {
1786
+ tag: 'g',
1787
+ attributes: {
1788
+ class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
1789
+ },
1790
+ children: [{
1791
+ tag: 'path',
1792
+ attributes: {
1793
+ class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
1794
+ fill: 'currentColor',
1795
+ d: vectorData[0]
1796
+ }
1797
+ }, {
1798
+ tag: 'path',
1799
+ attributes: {
1800
+ class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
1801
+ fill: 'currentColor',
1802
+ d: vectorData[1]
1803
+ }
1804
+ }]
1805
+ };
1806
+ } else {
1807
+ element = {
1808
+ tag: 'path',
1809
+ attributes: {
1810
+ fill: 'currentColor',
1811
+ d: vectorData
1812
+ }
1813
+ };
1814
+ }
1815
+
1816
+ return {
1817
+ found: true,
1818
+ width: width,
1819
+ height: height,
1820
+ icon: element
1821
+ };
1822
+ }
1823
+ function findIcon(iconName, prefix) {
1824
+ return new picked(function (resolve, reject) {
1825
+ var val = {
1826
+ found: false,
1827
+ width: 512,
1828
+ height: 512,
1829
+ icon: missing
1830
+ };
1831
+
1832
+ if (iconName && prefix && styles$2[prefix] && styles$2[prefix][iconName]) {
1833
+ var icon = styles$2[prefix][iconName];
1834
+ return resolve(asFoundIcon(icon));
1835
+ }
1836
+
1837
+ if (iconName && prefix && !config.showMissingIcons) {
1838
+ reject(new MissingIcon("Icon is missing for prefix ".concat(prefix, " with icon name ").concat(iconName)));
1839
+ } else {
1840
+ resolve(val);
1841
+ }
1842
+ });
1843
+ }
1844
+
1845
+ var styles$3 = namespace.styles;
1846
+
1847
+ function generateSvgReplacementMutation(node, nodeMeta) {
1848
+ var iconName = nodeMeta.iconName,
1849
+ title = nodeMeta.title,
1850
+ titleId = nodeMeta.titleId,
1851
+ prefix = nodeMeta.prefix,
1852
+ transform = nodeMeta.transform,
1853
+ symbol = nodeMeta.symbol,
1854
+ mask = nodeMeta.mask,
1855
+ maskId = nodeMeta.maskId,
1856
+ extra = nodeMeta.extra;
1857
+ return new picked(function (resolve, reject) {
1858
+ picked.all([findIcon(iconName, prefix), findIcon(mask.iconName, mask.prefix)]).then(function (_ref) {
1859
+ var _ref2 = _slicedToArray(_ref, 2),
1860
+ main = _ref2[0],
1861
+ mask = _ref2[1];
1862
+
1863
+ resolve([node, makeInlineSvgAbstract({
1864
+ icons: {
1865
+ main: main,
1866
+ mask: mask
1867
+ },
1868
+ prefix: prefix,
1869
+ iconName: iconName,
1870
+ transform: transform,
1871
+ symbol: symbol,
1872
+ mask: mask,
1873
+ maskId: maskId,
1874
+ title: title,
1875
+ titleId: titleId,
1876
+ extra: extra,
1877
+ watchable: true
1878
+ })]);
1879
+ });
1880
+ });
1881
+ }
1882
+
1883
+ function generateLayersText(node, nodeMeta) {
1884
+ var title = nodeMeta.title,
1885
+ transform = nodeMeta.transform,
1886
+ extra = nodeMeta.extra;
1887
+ var width = null;
1888
+ var height = null;
1889
+
1890
+ if (IS_IE) {
1891
+ var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
1892
+ var boundingClientRect = node.getBoundingClientRect();
1893
+ width = boundingClientRect.width / computedFontSize;
1894
+ height = boundingClientRect.height / computedFontSize;
1895
+ }
1896
+
1897
+ if (config.autoA11y && !title) {
1898
+ extra.attributes['aria-hidden'] = 'true';
1899
+ }
1900
+
1901
+ return picked.resolve([node, makeLayersTextAbstract({
1902
+ content: node.innerHTML,
1903
+ width: width,
1904
+ height: height,
1905
+ transform: transform,
1906
+ title: title,
1907
+ extra: extra,
1908
+ watchable: true
1909
+ })]);
1910
+ }
1911
+
1912
+ function generateMutation(node) {
1913
+ var nodeMeta = parseMeta(node);
1914
+
1915
+ if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
1916
+ return generateLayersText(node, nodeMeta);
1917
+ } else {
1918
+ return generateSvgReplacementMutation(node, nodeMeta);
1919
+ }
1920
+ }
1921
+
1922
+ function onTree(root) {
1923
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1924
+ if (!IS_DOM) return;
1925
+ var htmlClassList = DOCUMENT.documentElement.classList;
1926
+
1927
+ var hclAdd = function hclAdd(suffix) {
1928
+ return htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
1929
+ };
1930
+
1931
+ var hclRemove = function hclRemove(suffix) {
1932
+ return htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
1933
+ };
1934
+
1935
+ var prefixes = config.autoFetchSvg ? Object.keys(PREFIX_TO_STYLE) : Object.keys(styles$3);
1936
+ var prefixesDomQuery = [".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])")].concat(prefixes.map(function (p) {
1937
+ return ".".concat(p, ":not([").concat(DATA_FA_I2SVG, "])");
1938
+ })).join(', ');
1939
+
1940
+ if (prefixesDomQuery.length === 0) {
1941
+ return;
1942
+ }
1943
+
1944
+ var candidates = [];
1945
+
1946
+ try {
1947
+ candidates = toArray(root.querySelectorAll(prefixesDomQuery));
1948
+ } catch (e) {// noop
1949
+ }
1950
+
1951
+ if (candidates.length > 0) {
1952
+ hclAdd('pending');
1953
+ hclRemove('complete');
1954
+ } else {
1955
+ return;
1956
+ }
1957
+
1958
+ var mark = perf.begin('onTree');
1959
+ var mutations = candidates.reduce(function (acc, node) {
1960
+ try {
1961
+ var mutation = generateMutation(node);
1962
+
1963
+ if (mutation) {
1964
+ acc.push(mutation);
1965
+ }
1966
+ } catch (e) {
1967
+ if (!PRODUCTION) {
1968
+ if (e instanceof MissingIcon) {
1969
+ console.error(e);
1970
+ }
1971
+ }
1972
+ }
1973
+
1974
+ return acc;
1975
+ }, []);
1976
+ return new picked(function (resolve, reject) {
1977
+ picked.all(mutations).then(function (resolvedMutations) {
1978
+ perform(resolvedMutations, function () {
1979
+ hclAdd('active');
1980
+ hclAdd('complete');
1981
+ hclRemove('pending');
1982
+ if (typeof callback === 'function') callback();
1983
+ mark();
1984
+ resolve();
1985
+ });
1986
+ }).catch(function () {
1987
+ mark();
1988
+ reject();
1989
+ });
1990
+ });
1991
+ }
1992
+ function onNode(node) {
1993
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1994
+ generateMutation(node).then(function (mutation) {
1995
+ if (mutation) {
1996
+ perform([mutation], callback);
1997
+ }
1998
+ });
1999
+ }
2000
+
2001
+ function replaceForPosition(node, position) {
2002
+ var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
2003
+ return new picked(function (resolve, reject) {
2004
+ if (node.getAttribute(pendingAttribute) !== null) {
2005
+ // This node is already being processed
2006
+ return resolve();
2007
+ }
2008
+
2009
+ var children = toArray(node.children);
2010
+ var alreadyProcessedPseudoElement = children.filter(function (c) {
2011
+ return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
2012
+ })[0];
2013
+ var styles = WINDOW.getComputedStyle(node, position);
2014
+ var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
2015
+ var fontWeight = styles.getPropertyValue('font-weight');
2016
+ var content = styles.getPropertyValue('content');
2017
+
2018
+ if (alreadyProcessedPseudoElement && !fontFamily) {
2019
+ // If we've already processed it but the current computed style does not result in a font-family,
2020
+ // that probably means that a class name that was previously present to make the icon has been
2021
+ // removed. So we now should delete the icon.
2022
+ node.removeChild(alreadyProcessedPseudoElement);
2023
+ return resolve();
2024
+ } else if (fontFamily && content !== 'none' && content !== '') {
2025
+ var _content = styles.getPropertyValue('content');
2026
+
2027
+ var prefix = ~['Solid', 'Regular', 'Light', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];
2028
+ var hexValue = toHex(_content.length === 3 ? _content.substr(1, 1) : _content);
2029
+ var iconName = byUnicode(prefix, hexValue);
2030
+ var iconIdentifier = iconName; // Only convert the pseudo element in this :before/:after position into an icon if we haven't
2031
+ // already done so with the same prefix and iconName
2032
+
2033
+ if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
2034
+ node.setAttribute(pendingAttribute, iconIdentifier);
2035
+
2036
+ if (alreadyProcessedPseudoElement) {
2037
+ // Delete the old one, since we're replacing it with a new one
2038
+ node.removeChild(alreadyProcessedPseudoElement);
2039
+ }
2040
+
2041
+ var meta = blankMeta();
2042
+ var extra = meta.extra;
2043
+ extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
2044
+ findIcon(iconName, prefix).then(function (main) {
2045
+ var abstract = makeInlineSvgAbstract(_objectSpread({}, meta, {
2046
+ icons: {
2047
+ main: main,
2048
+ mask: emptyCanonicalIcon()
2049
+ },
2050
+ prefix: prefix,
2051
+ iconName: iconIdentifier,
2052
+ extra: extra,
2053
+ watchable: true
2054
+ }));
2055
+ var element = DOCUMENT.createElement('svg');
2056
+
2057
+ if (position === ':before') {
2058
+ node.insertBefore(element, node.firstChild);
2059
+ } else {
2060
+ node.appendChild(element);
2061
+ }
2062
+
2063
+ element.outerHTML = abstract.map(function (a) {
2064
+ return toHtml(a);
2065
+ }).join('\n');
2066
+ node.removeAttribute(pendingAttribute);
2067
+ resolve();
2068
+ }).catch(reject);
2069
+ } else {
2070
+ resolve();
2071
+ }
2072
+ } else {
2073
+ resolve();
2074
+ }
2075
+ });
2076
+ }
2077
+
2078
+ function replace(node) {
2079
+ return picked.all([replaceForPosition(node, ':before'), replaceForPosition(node, ':after')]);
2080
+ }
2081
+
2082
+ function processable(node) {
2083
+ return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');
2084
+ }
2085
+
2086
+ function searchPseudoElements (root) {
2087
+ if (!IS_DOM) return;
2088
+ return new picked(function (resolve, reject) {
2089
+ var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
2090
+ var end = perf.begin('searchPseudoElements');
2091
+ disableObservation();
2092
+ picked.all(operations).then(function () {
2093
+ end();
2094
+ enableObservation();
2095
+ resolve();
2096
+ }).catch(function () {
2097
+ end();
2098
+ enableObservation();
2099
+ reject();
2100
+ });
2101
+ });
2102
+ }
2103
+
2104
+ var baseStyles = "svg:not(:root).svg-inline--fa{overflow:visible}.svg-inline--fa{display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em}.svg-inline--fa.fa-lg{vertical-align:-.225em}.svg-inline--fa.fa-w-1{width:.0625em}.svg-inline--fa.fa-w-2{width:.125em}.svg-inline--fa.fa-w-3{width:.1875em}.svg-inline--fa.fa-w-4{width:.25em}.svg-inline--fa.fa-w-5{width:.3125em}.svg-inline--fa.fa-w-6{width:.375em}.svg-inline--fa.fa-w-7{width:.4375em}.svg-inline--fa.fa-w-8{width:.5em}.svg-inline--fa.fa-w-9{width:.5625em}.svg-inline--fa.fa-w-10{width:.625em}.svg-inline--fa.fa-w-11{width:.6875em}.svg-inline--fa.fa-w-12{width:.75em}.svg-inline--fa.fa-w-13{width:.8125em}.svg-inline--fa.fa-w-14{width:.875em}.svg-inline--fa.fa-w-15{width:.9375em}.svg-inline--fa.fa-w-16{width:1em}.svg-inline--fa.fa-w-17{width:1.0625em}.svg-inline--fa.fa-w-18{width:1.125em}.svg-inline--fa.fa-w-19{width:1.1875em}.svg-inline--fa.fa-w-20{width:1.25em}.svg-inline--fa.fa-pull-left{margin-right:.3em;width:auto}.svg-inline--fa.fa-pull-right{margin-left:.3em;width:auto}.svg-inline--fa.fa-border{height:1.5em}.svg-inline--fa.fa-li{width:2em}.svg-inline--fa.fa-fw{width:1.25em}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.fa-layers{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers-text{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter{background-color:#ff253a;border-radius:1em;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;height:1.5em;line-height:1;max-width:5em;min-width:1.5em;overflow:hidden;padding:.25em;right:0;text-overflow:ellipsis;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:0;right:0;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:0;left:0;right:auto;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{right:0;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:0;right:auto;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top left;transform-origin:top left}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;position:relative;width:2.5em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.svg-inline--fa.fa-stack-1x{height:1em;width:1.25em}.svg-inline--fa.fa-stack-2x{height:2em;width:2.5em}.fa-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:1;opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:1;opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}.fad.fa-inverse{color:#fff}";
2105
+
2106
+ function css () {
2107
+ var dfp = DEFAULT_FAMILY_PREFIX;
2108
+ var drc = DEFAULT_REPLACEMENT_CLASS;
2109
+ var fp = config.familyPrefix;
2110
+ var rc = config.replacementClass;
2111
+ var s = baseStyles;
2112
+
2113
+ if (fp !== dfp || rc !== drc) {
2114
+ var dPatt = new RegExp("\\.".concat(dfp, "\\-"), 'g');
2115
+ var customPropPatt = new RegExp("\\--".concat(dfp, "\\-"), 'g');
2116
+ var rPatt = new RegExp("\\.".concat(drc), 'g');
2117
+ s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
2118
+ }
2119
+
2120
+ return s;
2121
+ }
2122
+
2123
+ var Library =
2124
+ /*#__PURE__*/
2125
+ function () {
2126
+ function Library() {
2127
+ _classCallCheck(this, Library);
2128
+
2129
+ this.definitions = {};
2130
+ }
2131
+
2132
+ _createClass(Library, [{
2133
+ key: "add",
2134
+ value: function add() {
2135
+ var _this = this;
2136
+
2137
+ for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
2138
+ definitions[_key] = arguments[_key];
2139
+ }
2140
+
2141
+ var additions = definitions.reduce(this._pullDefinitions, {});
2142
+ Object.keys(additions).forEach(function (key) {
2143
+ _this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);
2144
+ defineIcons(key, additions[key]);
2145
+ build();
2146
+ });
2147
+ }
2148
+ }, {
2149
+ key: "reset",
2150
+ value: function reset() {
2151
+ this.definitions = {};
2152
+ }
2153
+ }, {
2154
+ key: "_pullDefinitions",
2155
+ value: function _pullDefinitions(additions, definition) {
2156
+ var normalized = definition.prefix && definition.iconName && definition.icon ? {
2157
+ 0: definition
2158
+ } : definition;
2159
+ Object.keys(normalized).map(function (key) {
2160
+ var _normalized$key = normalized[key],
2161
+ prefix = _normalized$key.prefix,
2162
+ iconName = _normalized$key.iconName,
2163
+ icon = _normalized$key.icon;
2164
+ if (!additions[prefix]) additions[prefix] = {};
2165
+ additions[prefix][iconName] = icon;
2166
+ });
2167
+ return additions;
2168
+ }
2169
+ }]);
2170
+
2171
+ return Library;
2172
+ }();
2173
+
2174
+ function ensureCss() {
2175
+ if (config.autoAddCss && !_cssInserted) {
2176
+ insertCss(css());
2177
+
2178
+ _cssInserted = true;
2179
+ }
2180
+ }
2181
+
2182
+ function apiObject(val, abstractCreator) {
2183
+ Object.defineProperty(val, 'abstract', {
2184
+ get: abstractCreator
2185
+ });
2186
+ Object.defineProperty(val, 'html', {
2187
+ get: function get() {
2188
+ return val.abstract.map(function (a) {
2189
+ return toHtml(a);
2190
+ });
2191
+ }
2192
+ });
2193
+ Object.defineProperty(val, 'node', {
2194
+ get: function get() {
2195
+ if (!IS_DOM) return;
2196
+ var container = DOCUMENT.createElement('div');
2197
+ container.innerHTML = val.html;
2198
+ return container.children;
2199
+ }
2200
+ });
2201
+ return val;
2202
+ }
2203
+
2204
+ function findIconDefinition(iconLookup) {
2205
+ var _iconLookup$prefix = iconLookup.prefix,
2206
+ prefix = _iconLookup$prefix === void 0 ? 'fa' : _iconLookup$prefix,
2207
+ iconName = iconLookup.iconName;
2208
+ if (!iconName) return;
2209
+ return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
2210
+ }
2211
+
2212
+ function resolveIcons(next) {
2213
+ return function (maybeIconDefinition) {
2214
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2215
+ var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
2216
+ var mask = params.mask;
2217
+
2218
+ if (mask) {
2219
+ mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
2220
+ }
2221
+
2222
+ return next(iconDefinition, _objectSpread({}, params, {
2223
+ mask: mask
2224
+ }));
2225
+ };
2226
+ }
2227
+
2228
+ var library = new Library();
2229
+ var noAuto = function noAuto() {
2230
+ config.autoReplaceSvg = false;
2231
+ config.observeMutations = false;
2232
+ disconnect();
2233
+ };
2234
+ var _cssInserted = false;
2235
+ var dom = {
2236
+ i2svg: function i2svg() {
2237
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2238
+
2239
+ if (IS_DOM) {
2240
+ ensureCss();
2241
+ var _params$node = params.node,
2242
+ node = _params$node === void 0 ? DOCUMENT : _params$node,
2243
+ _params$callback = params.callback,
2244
+ callback = _params$callback === void 0 ? function () {} : _params$callback;
2245
+
2246
+ if (config.searchPseudoElements) {
2247
+ searchPseudoElements(node);
2248
+ }
2249
+
2250
+ return onTree(node, callback);
2251
+ } else {
2252
+ return picked.reject('Operation requires a DOM of some kind.');
2253
+ }
2254
+ },
2255
+ css: css,
2256
+ insertCss: function insertCss$$1() {
2257
+ if (!_cssInserted) {
2258
+ insertCss(css());
2259
+
2260
+ _cssInserted = true;
2261
+ }
2262
+ },
2263
+ watch: function watch() {
2264
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2265
+ var autoReplaceSvgRoot = params.autoReplaceSvgRoot,
2266
+ observeMutationsRoot = params.observeMutationsRoot;
2267
+
2268
+ if (config.autoReplaceSvg === false) {
2269
+ config.autoReplaceSvg = true;
2270
+ }
2271
+
2272
+ config.observeMutations = true;
2273
+ domready(function () {
2274
+ autoReplace({
2275
+ autoReplaceSvgRoot: autoReplaceSvgRoot
2276
+ });
2277
+ observe({
2278
+ treeCallback: onTree,
2279
+ nodeCallback: onNode,
2280
+ pseudoElementsCallback: searchPseudoElements,
2281
+ observeMutationsRoot: observeMutationsRoot
2282
+ });
2283
+ });
2284
+ }
2285
+ };
2286
+ var parse = {
2287
+ transform: function transform(transformString) {
2288
+ return parseTransformString(transformString);
2289
+ }
2290
+ };
2291
+ var icon = resolveIcons(function (iconDefinition) {
2292
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2293
+ var _params$transform = params.transform,
2294
+ transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
2295
+ _params$symbol = params.symbol,
2296
+ symbol = _params$symbol === void 0 ? false : _params$symbol,
2297
+ _params$mask = params.mask,
2298
+ mask = _params$mask === void 0 ? null : _params$mask,
2299
+ _params$maskId = params.maskId,
2300
+ maskId = _params$maskId === void 0 ? null : _params$maskId,
2301
+ _params$title = params.title,
2302
+ title = _params$title === void 0 ? null : _params$title,
2303
+ _params$titleId = params.titleId,
2304
+ titleId = _params$titleId === void 0 ? null : _params$titleId,
2305
+ _params$classes = params.classes,
2306
+ classes = _params$classes === void 0 ? [] : _params$classes,
2307
+ _params$attributes = params.attributes,
2308
+ attributes = _params$attributes === void 0 ? {} : _params$attributes,
2309
+ _params$styles = params.styles,
2310
+ styles = _params$styles === void 0 ? {} : _params$styles;
2311
+ if (!iconDefinition) return;
2312
+ var prefix = iconDefinition.prefix,
2313
+ iconName = iconDefinition.iconName,
2314
+ icon = iconDefinition.icon;
2315
+ return apiObject(_objectSpread({
2316
+ type: 'icon'
2317
+ }, iconDefinition), function () {
2318
+ ensureCss();
2319
+
2320
+ if (config.autoA11y) {
2321
+ if (title) {
2322
+ attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
2323
+ } else {
2324
+ attributes['aria-hidden'] = 'true';
2325
+ attributes['focusable'] = 'false';
2326
+ }
2327
+ }
2328
+
2329
+ return makeInlineSvgAbstract({
2330
+ icons: {
2331
+ main: asFoundIcon(icon),
2332
+ mask: mask ? asFoundIcon(mask.icon) : {
2333
+ found: false,
2334
+ width: null,
2335
+ height: null,
2336
+ icon: {}
2337
+ }
2338
+ },
2339
+ prefix: prefix,
2340
+ iconName: iconName,
2341
+ transform: _objectSpread({}, meaninglessTransform, transform),
2342
+ symbol: symbol,
2343
+ title: title,
2344
+ maskId: maskId,
2345
+ titleId: titleId,
2346
+ extra: {
2347
+ attributes: attributes,
2348
+ styles: styles,
2349
+ classes: classes
2350
+ }
2351
+ });
2352
+ });
2353
+ });
2354
+ var text = function text(content) {
2355
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2356
+ var _params$transform2 = params.transform,
2357
+ transform = _params$transform2 === void 0 ? meaninglessTransform : _params$transform2,
2358
+ _params$title2 = params.title,
2359
+ title = _params$title2 === void 0 ? null : _params$title2,
2360
+ _params$classes2 = params.classes,
2361
+ classes = _params$classes2 === void 0 ? [] : _params$classes2,
2362
+ _params$attributes2 = params.attributes,
2363
+ attributes = _params$attributes2 === void 0 ? {} : _params$attributes2,
2364
+ _params$styles2 = params.styles,
2365
+ styles = _params$styles2 === void 0 ? {} : _params$styles2;
2366
+ return apiObject({
2367
+ type: 'text',
2368
+ content: content
2369
+ }, function () {
2370
+ ensureCss();
2371
+ return makeLayersTextAbstract({
2372
+ content: content,
2373
+ transform: _objectSpread({}, meaninglessTransform, transform),
2374
+ title: title,
2375
+ extra: {
2376
+ attributes: attributes,
2377
+ styles: styles,
2378
+ classes: ["".concat(config.familyPrefix, "-layers-text")].concat(_toConsumableArray(classes))
2379
+ }
2380
+ });
2381
+ });
2382
+ };
2383
+ var counter = function counter(content) {
2384
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2385
+ var _params$title3 = params.title,
2386
+ title = _params$title3 === void 0 ? null : _params$title3,
2387
+ _params$classes3 = params.classes,
2388
+ classes = _params$classes3 === void 0 ? [] : _params$classes3,
2389
+ _params$attributes3 = params.attributes,
2390
+ attributes = _params$attributes3 === void 0 ? {} : _params$attributes3,
2391
+ _params$styles3 = params.styles,
2392
+ styles = _params$styles3 === void 0 ? {} : _params$styles3;
2393
+ return apiObject({
2394
+ type: 'counter',
2395
+ content: content
2396
+ }, function () {
2397
+ ensureCss();
2398
+ return makeLayersCounterAbstract({
2399
+ content: content.toString(),
2400
+ title: title,
2401
+ extra: {
2402
+ attributes: attributes,
2403
+ styles: styles,
2404
+ classes: ["".concat(config.familyPrefix, "-layers-counter")].concat(_toConsumableArray(classes))
2405
+ }
2406
+ });
2407
+ });
2408
+ };
2409
+ var layer = function layer(assembler) {
2410
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2411
+ var _params$classes4 = params.classes,
2412
+ classes = _params$classes4 === void 0 ? [] : _params$classes4;
2413
+ return apiObject({
2414
+ type: 'layer'
2415
+ }, function () {
2416
+ ensureCss();
2417
+ var children = [];
2418
+ assembler(function (args) {
2419
+ Array.isArray(args) ? args.map(function (a) {
2420
+ children = children.concat(a.abstract);
2421
+ }) : children = children.concat(args.abstract);
2422
+ });
2423
+ return [{
2424
+ tag: 'span',
2425
+ attributes: {
2426
+ class: ["".concat(config.familyPrefix, "-layers")].concat(_toConsumableArray(classes)).join(' ')
2427
+ },
2428
+ children: children
2429
+ }];
2430
+ });
2431
+ };
2432
+ var api = {
2433
+ noAuto: noAuto,
2434
+ config: config,
2435
+ dom: dom,
2436
+ library: library,
2437
+ parse: parse,
2438
+ findIconDefinition: findIconDefinition,
2439
+ icon: icon,
2440
+ text: text,
2441
+ counter: counter,
2442
+ layer: layer,
2443
+ toHtml: toHtml
2444
+ };
2445
+
2446
+ var autoReplace = function autoReplace() {
2447
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2448
+ var _params$autoReplaceSv = params.autoReplaceSvgRoot,
2449
+ autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;
2450
+ if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({
2451
+ node: autoReplaceSvgRoot
2452
+ });
2453
+ };
2454
+
2455
+ function bootstrap() {
2456
+ if (IS_BROWSER) {
2457
+ if (!WINDOW.FontAwesome) {
2458
+ WINDOW.FontAwesome = api;
2459
+ }
2460
+
2461
+ domready(function () {
2462
+ autoReplace();
2463
+ observe({
2464
+ treeCallback: onTree,
2465
+ nodeCallback: onNode,
2466
+ pseudoElementsCallback: searchPseudoElements
2467
+ });
2468
+ });
2469
+ }
2470
+
2471
+ namespace.hooks = _objectSpread({}, namespace.hooks, {
2472
+ addPack: function addPack(prefix, icons) {
2473
+ namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, icons);
2474
+ build();
2475
+ autoReplace();
2476
+ },
2477
+ addShims: function addShims(shims) {
2478
+ var _namespace$shims;
2479
+
2480
+ (_namespace$shims = namespace.shims).push.apply(_namespace$shims, _toConsumableArray(shims));
2481
+
2482
+ build();
2483
+ autoReplace();
2484
+ }
2485
+ });
2486
+ }
2487
+
2488
+ bunker(bootstrap);
2489
+
2490
+ }());
2491
+
7
2492
  const XplButton = class {
8
2493
  constructor(hostRef) {
9
2494
  index.registerInstance(this, hostRef);
2495
+ this.size = "default";
2496
+ this.type = "primary";
10
2497
  }
11
2498
  render() {
12
2499
  let className = "xpl-button";
@@ -14,12 +2501,19 @@ const XplButton = class {
14
2501
  className += " xpl-button--secondary";
15
2502
  if (this.type === "subtle")
16
2503
  className += " xpl-button--subtle";
2504
+ if (this.type === "error")
2505
+ className += " xpl-button--error";
2506
+ if (this.size === "sm")
2507
+ className += " xpl-button--sm";
2508
+ if (this.size === "xs")
2509
+ className += " xpl-button--xs";
2510
+ const icon = this.icon ? index.h("i", { class: `fas fa-${this.icon} ${this.iconTrailing ? "trailing" : ""}` }) : null;
17
2511
  return (index.h(index.Host, null,
18
2512
  /**
19
2513
  * Conditionally render either an <a> or <button> element
20
2514
  * depending on if there's an `href` or not
21
2515
  */
22
- this.href ? (index.h("a", { class: className, href: this.href, role: "button" }, index.h("slot", null))) : this.disabled ? (index.h("button", { class: className, role: "button", disabled: true }, index.h("slot", null))) : (index.h("button", { class: className, role: "button" }, index.h("slot", null)))));
2516
+ this.href ? (index.h("a", { class: className, href: this.href, role: "button" }, !this.iconTrailing && icon, index.h("slot", null), this.iconTrailing && icon)) : this.disabled ? (index.h("button", { class: className, role: "button", disabled: true }, !this.iconTrailing && icon, index.h("slot", null), this.iconTrailing && icon)) : (index.h("button", { class: className, role: "button" }, !this.iconTrailing && icon, index.h("slot", null), this.iconTrailing && icon))));
23
2517
  }
24
2518
  };
25
2519
 
@@ -80,7 +2574,7 @@ const XplPagination = class {
80
2574
  }
81
2575
  const showingFirst = (this.current - 1) * this.perPage + 1;
82
2576
  const showingLast = Math.min(showingFirst + this.perPage - 1, this.total);
83
- return (index.h(index.Host, null, index.h("div", { class: "xpl-pagination" }, index.h("div", null, index.h("p", null, "Showing", " ", index.h("span", null, showingFirst), " ", "to", " ", index.h("span", null, showingLast), " ", "of", " ", index.h("span", null, this.total), " ", "results")), index.h("div", null, index.h("nav", { "aria-label": "Pagination" }, index.h("button", { onClick: this.goPrev, class: "xpl-pagination-prev" }, index.h("span", null, "Previous"), index.h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" }, index.h("path", { "fill-rule": "evenodd", d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z", "clip-rule": "evenodd" }))), showing.map((n) => {
2577
+ return (index.h(index.Host, null, index.h("div", { class: "xpl-pagination" }, index.h("div", null, index.h("p", null, "Showing ", index.h("span", null, showingFirst), " to ", index.h("span", null, showingLast), " ", "of ", index.h("span", null, this.total), " results")), index.h("div", null, index.h("nav", { "aria-label": "Pagination" }, index.h("button", { onClick: this.goPrev, class: "xpl-pagination-prev" }, index.h("span", null, "Previous"), index.h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" }, index.h("path", { "fill-rule": "evenodd", d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z", "clip-rule": "evenodd" }))), showing.map((n) => {
84
2578
  if (n === "...") {
85
2579
  return index.h("span", { class: "xpl-pagination-ellipsis" }, "...");
86
2580
  }