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