1 | function ownKeys(object, enumerableOnly) {
|
2 | var keys = Object.keys(object);
|
3 |
|
4 | if (Object.getOwnPropertySymbols) {
|
5 | var symbols = Object.getOwnPropertySymbols(object);
|
6 | enumerableOnly && (symbols = symbols.filter(function (sym) {
|
7 | return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
8 | })), keys.push.apply(keys, symbols);
|
9 | }
|
10 |
|
11 | return keys;
|
12 | }
|
13 |
|
14 | function _objectSpread2(target) {
|
15 | for (var i = 1; i < arguments.length; i++) {
|
16 | var source = null != arguments[i] ? arguments[i] : {};
|
17 | i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
18 | _defineProperty(target, key, source[key]);
|
19 | }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
20 | Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
21 | });
|
22 | }
|
23 |
|
24 | return target;
|
25 | }
|
26 |
|
27 | function _typeof(obj) {
|
28 | "@babel/helpers - typeof";
|
29 |
|
30 | return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
31 | return typeof obj;
|
32 | } : function (obj) {
|
33 | return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
34 | }, _typeof(obj);
|
35 | }
|
36 |
|
37 | function _wrapRegExp() {
|
38 | _wrapRegExp = function (re, groups) {
|
39 | return new BabelRegExp(re, void 0, groups);
|
40 | };
|
41 |
|
42 | var _super = RegExp.prototype,
|
43 | _groups = new WeakMap();
|
44 |
|
45 | function BabelRegExp(re, flags, groups) {
|
46 | var _this = new RegExp(re, flags);
|
47 |
|
48 | return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype);
|
49 | }
|
50 |
|
51 | function buildGroups(result, re) {
|
52 | var g = _groups.get(re);
|
53 |
|
54 | return Object.keys(g).reduce(function (groups, name) {
|
55 | return groups[name] = result[g[name]], groups;
|
56 | }, Object.create(null));
|
57 | }
|
58 |
|
59 | return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
|
60 | var result = _super.exec.call(this, str);
|
61 |
|
62 | return result && (result.groups = buildGroups(result, this)), result;
|
63 | }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
64 | if ("string" == typeof substitution) {
|
65 | var groups = _groups.get(this);
|
66 |
|
67 | return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
68 | return "$" + groups[name];
|
69 | }));
|
70 | }
|
71 |
|
72 | if ("function" == typeof substitution) {
|
73 | var _this = this;
|
74 |
|
75 | return _super[Symbol.replace].call(this, str, function () {
|
76 | var args = arguments;
|
77 | return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args);
|
78 | });
|
79 | }
|
80 |
|
81 | return _super[Symbol.replace].call(this, str, substitution);
|
82 | }, _wrapRegExp.apply(this, arguments);
|
83 | }
|
84 |
|
85 | function _classCallCheck(instance, Constructor) {
|
86 | if (!(instance instanceof Constructor)) {
|
87 | throw new TypeError("Cannot call a class as a function");
|
88 | }
|
89 | }
|
90 |
|
91 | function _defineProperties(target, props) {
|
92 | for (var i = 0; i < props.length; i++) {
|
93 | var descriptor = props[i];
|
94 | descriptor.enumerable = descriptor.enumerable || false;
|
95 | descriptor.configurable = true;
|
96 | if ("value" in descriptor) descriptor.writable = true;
|
97 | Object.defineProperty(target, descriptor.key, descriptor);
|
98 | }
|
99 | }
|
100 |
|
101 | function _createClass(Constructor, protoProps, staticProps) {
|
102 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
103 | if (staticProps) _defineProperties(Constructor, staticProps);
|
104 | Object.defineProperty(Constructor, "prototype", {
|
105 | writable: false
|
106 | });
|
107 | return Constructor;
|
108 | }
|
109 |
|
110 | function _defineProperty(obj, key, value) {
|
111 | if (key in obj) {
|
112 | Object.defineProperty(obj, key, {
|
113 | value: value,
|
114 | enumerable: true,
|
115 | configurable: true,
|
116 | writable: true
|
117 | });
|
118 | } else {
|
119 | obj[key] = value;
|
120 | }
|
121 |
|
122 | return obj;
|
123 | }
|
124 |
|
125 | function _inherits(subClass, superClass) {
|
126 | if (typeof superClass !== "function" && superClass !== null) {
|
127 | throw new TypeError("Super expression must either be null or a function");
|
128 | }
|
129 |
|
130 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
131 | constructor: {
|
132 | value: subClass,
|
133 | writable: true,
|
134 | configurable: true
|
135 | }
|
136 | });
|
137 | Object.defineProperty(subClass, "prototype", {
|
138 | writable: false
|
139 | });
|
140 | if (superClass) _setPrototypeOf(subClass, superClass);
|
141 | }
|
142 |
|
143 | function _setPrototypeOf(o, p) {
|
144 | _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
145 | o.__proto__ = p;
|
146 | return o;
|
147 | };
|
148 |
|
149 | return _setPrototypeOf(o, p);
|
150 | }
|
151 |
|
152 | function _slicedToArray(arr, i) {
|
153 | return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
154 | }
|
155 |
|
156 | function _toConsumableArray(arr) {
|
157 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
158 | }
|
159 |
|
160 | function _arrayWithoutHoles(arr) {
|
161 | if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
162 | }
|
163 |
|
164 | function _arrayWithHoles(arr) {
|
165 | if (Array.isArray(arr)) return arr;
|
166 | }
|
167 |
|
168 | function _iterableToArray(iter) {
|
169 | if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
170 | }
|
171 |
|
172 | function _iterableToArrayLimit(arr, i) {
|
173 | var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
174 |
|
175 | if (_i == null) return;
|
176 | var _arr = [];
|
177 | var _n = true;
|
178 | var _d = false;
|
179 |
|
180 | var _s, _e;
|
181 |
|
182 | try {
|
183 | for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
184 | _arr.push(_s.value);
|
185 |
|
186 | if (i && _arr.length === i) break;
|
187 | }
|
188 | } catch (err) {
|
189 | _d = true;
|
190 | _e = err;
|
191 | } finally {
|
192 | try {
|
193 | if (!_n && _i["return"] != null) _i["return"]();
|
194 | } finally {
|
195 | if (_d) throw _e;
|
196 | }
|
197 | }
|
198 |
|
199 | return _arr;
|
200 | }
|
201 |
|
202 | function _unsupportedIterableToArray(o, minLen) {
|
203 | if (!o) return;
|
204 | if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
205 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
206 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
207 | if (n === "Map" || n === "Set") return Array.from(o);
|
208 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
209 | }
|
210 |
|
211 | function _arrayLikeToArray(arr, len) {
|
212 | if (len == null || len > arr.length) len = arr.length;
|
213 |
|
214 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
215 |
|
216 | return arr2;
|
217 | }
|
218 |
|
219 | function _nonIterableSpread() {
|
220 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
221 | }
|
222 |
|
223 | function _nonIterableRest() {
|
224 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
225 | }
|
226 |
|
227 | var noop = function noop() {};
|
228 |
|
229 | var _WINDOW = {};
|
230 | var _DOCUMENT = {};
|
231 | var _MUTATION_OBSERVER = null;
|
232 | var _PERFORMANCE = {
|
233 | mark: noop,
|
234 | measure: noop
|
235 | };
|
236 |
|
237 | try {
|
238 | if (typeof window !== 'undefined') _WINDOW = window;
|
239 | if (typeof document !== 'undefined') _DOCUMENT = document;
|
240 | if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
|
241 | if (typeof performance !== 'undefined') _PERFORMANCE = performance;
|
242 | } catch (e) {}
|
243 |
|
244 | var _ref = _WINDOW.navigator || {},
|
245 | _ref$userAgent = _ref.userAgent,
|
246 | userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
|
247 | var WINDOW = _WINDOW;
|
248 | var DOCUMENT = _DOCUMENT;
|
249 | var MUTATION_OBSERVER = _MUTATION_OBSERVER;
|
250 | var PERFORMANCE = _PERFORMANCE;
|
251 | var IS_BROWSER = !!WINDOW.document;
|
252 | var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
|
253 | var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
|
254 |
|
255 | var _familyProxy, _familyProxy2, _familyProxy3, _familyProxy4, _familyProxy5;
|
256 |
|
257 | var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
|
258 | var UNITS_IN_GRID = 16;
|
259 | var DEFAULT_CSS_PREFIX = 'fa';
|
260 | var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
|
261 | var DATA_FA_I2SVG = 'data-fa-i2svg';
|
262 | var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
|
263 | var DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
|
264 | var DATA_PREFIX = 'data-prefix';
|
265 | var DATA_ICON = 'data-icon';
|
266 | var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
|
267 | var MUTATION_APPROACH_ASYNC = 'async';
|
268 | var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
|
269 | var PRODUCTION = function () {
|
270 | try {
|
271 | return process.env.NODE_ENV === 'production';
|
272 | } catch (e) {
|
273 | return false;
|
274 | }
|
275 | }();
|
276 | var FAMILY_CLASSIC = 'classic';
|
277 | var FAMILY_SHARP = 'sharp';
|
278 | var FAMILIES = [FAMILY_CLASSIC, FAMILY_SHARP];
|
279 |
|
280 | function familyProxy(obj) {
|
281 |
|
282 | return new Proxy(obj, {
|
283 | get: function get(target, prop) {
|
284 | return prop in target ? target[prop] : target[FAMILY_CLASSIC];
|
285 | }
|
286 | });
|
287 | }
|
288 | var PREFIX_TO_STYLE = familyProxy((_familyProxy = {}, _defineProperty(_familyProxy, FAMILY_CLASSIC, {
|
289 | 'fa': 'solid',
|
290 | 'fas': 'solid',
|
291 | 'fa-solid': 'solid',
|
292 | 'far': 'regular',
|
293 | 'fa-regular': 'regular',
|
294 | 'fal': 'light',
|
295 | 'fa-light': 'light',
|
296 | 'fat': 'thin',
|
297 | 'fa-thin': 'thin',
|
298 | 'fad': 'duotone',
|
299 | 'fa-duotone': 'duotone',
|
300 | 'fab': 'brands',
|
301 | 'fa-brands': 'brands',
|
302 | 'fak': 'kit',
|
303 | 'fa-kit': 'kit'
|
304 | }), _defineProperty(_familyProxy, FAMILY_SHARP, {
|
305 | 'fa': 'solid',
|
306 | 'fass': 'solid',
|
307 | 'fa-solid': 'solid'
|
308 | }), _familyProxy));
|
309 | var STYLE_TO_PREFIX = familyProxy((_familyProxy2 = {}, _defineProperty(_familyProxy2, FAMILY_CLASSIC, {
|
310 | 'solid': 'fas',
|
311 | 'regular': 'far',
|
312 | 'light': 'fal',
|
313 | 'thin': 'fat',
|
314 | 'duotone': 'fad',
|
315 | 'brands': 'fab',
|
316 | 'kit': 'fak'
|
317 | }), _defineProperty(_familyProxy2, FAMILY_SHARP, {
|
318 | 'solid': 'fass'
|
319 | }), _familyProxy2));
|
320 | var PREFIX_TO_LONG_STYLE = familyProxy((_familyProxy3 = {}, _defineProperty(_familyProxy3, FAMILY_CLASSIC, {
|
321 | 'fab': 'fa-brands',
|
322 | 'fad': 'fa-duotone',
|
323 | 'fak': 'fa-kit',
|
324 | 'fal': 'fa-light',
|
325 | 'far': 'fa-regular',
|
326 | 'fas': 'fa-solid',
|
327 | 'fat': 'fa-thin'
|
328 | }), _defineProperty(_familyProxy3, FAMILY_SHARP, {
|
329 | 'fass': 'fa-solid'
|
330 | }), _familyProxy3));
|
331 | var LONG_STYLE_TO_PREFIX = familyProxy((_familyProxy4 = {}, _defineProperty(_familyProxy4, FAMILY_CLASSIC, {
|
332 | 'fa-brands': 'fab',
|
333 | 'fa-duotone': 'fad',
|
334 | 'fa-kit': 'fak',
|
335 | 'fa-light': 'fal',
|
336 | 'fa-regular': 'far',
|
337 | 'fa-solid': 'fas',
|
338 | 'fa-thin': 'fat'
|
339 | }), _defineProperty(_familyProxy4, FAMILY_SHARP, {
|
340 | 'fa-solid': 'fass'
|
341 | }), _familyProxy4));
|
342 | var ICON_SELECTION_SYNTAX_PATTERN = /fa(s|r|l|t|d|b|k|ss)?[\-\ ]/;
|
343 |
|
344 | var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
|
345 | var FONT_FAMILY_PATTERN = /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i;
|
346 |
|
347 |
|
348 | var FONT_WEIGHT_TO_PREFIX = familyProxy((_familyProxy5 = {}, _defineProperty(_familyProxy5, FAMILY_CLASSIC, {
|
349 | '900': 'fas',
|
350 | '400': 'far',
|
351 | 'normal': 'far',
|
352 | '300': 'fal',
|
353 | '100': 'fat'
|
354 | }), _defineProperty(_familyProxy5, FAMILY_SHARP, {
|
355 | '900': 'fass'
|
356 | }), _familyProxy5));
|
357 | var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
358 | var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
|
359 | var ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
|
360 | var DUOTONE_CLASSES = {
|
361 | GROUP: 'duotone-group',
|
362 | SWAP_OPACITY: 'swap-opacity',
|
363 | PRIMARY: 'primary',
|
364 | SECONDARY: 'secondary'
|
365 | };
|
366 | var prefixes = new Set();
|
367 | Object.keys(STYLE_TO_PREFIX[FAMILY_CLASSIC]).map(prefixes.add.bind(prefixes));
|
368 | Object.keys(STYLE_TO_PREFIX[FAMILY_SHARP]).map(prefixes.add.bind(prefixes));
|
369 | var RESERVED_CLASSES = [].concat(FAMILIES, _toConsumableArray(prefixes), ['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', 'beat', 'border', 'fade', 'beat-fade', 'bounce', 'flip-both', 'flip-horizontal', 'flip-vertical', 'flip', 'fw', 'inverse', 'layers-counter', 'layers-text', 'layers', 'li', 'pull-left', 'pull-right', 'pulse', 'rotate-180', 'rotate-270', 'rotate-90', 'rotate-by', 'shake', 'spin-pulse', 'spin-reverse', 'spin', 'stack-1x', 'stack-2x', 'stack', 'ul', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY]).concat(oneToTen.map(function (n) {
|
370 | return "".concat(n, "x");
|
371 | })).concat(oneToTwenty.map(function (n) {
|
372 | return "w-".concat(n);
|
373 | }));
|
374 |
|
375 | var initial = WINDOW.FontAwesomeConfig || {};
|
376 |
|
377 | function getAttrConfig(attr) {
|
378 | var element = DOCUMENT.querySelector('script[' + attr + ']');
|
379 |
|
380 | if (element) {
|
381 | return element.getAttribute(attr);
|
382 | }
|
383 | }
|
384 |
|
385 | function coerce(val) {
|
386 |
|
387 |
|
388 | if (val === '') return true;
|
389 | if (val === 'false') return false;
|
390 | if (val === 'true') return true;
|
391 | return val;
|
392 | }
|
393 |
|
394 | if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
|
395 | var attrs = [['data-family-prefix', 'familyPrefix'], ['data-css-prefix', 'cssPrefix'], ['data-family-default', 'familyDefault'], ['data-style-default', 'styleDefault'], ['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']];
|
396 | attrs.forEach(function (_ref) {
|
397 | var _ref2 = _slicedToArray(_ref, 2),
|
398 | attr = _ref2[0],
|
399 | key = _ref2[1];
|
400 |
|
401 | var val = coerce(getAttrConfig(attr));
|
402 |
|
403 | if (val !== undefined && val !== null) {
|
404 | initial[key] = val;
|
405 | }
|
406 | });
|
407 | }
|
408 |
|
409 | var _default = {
|
410 | styleDefault: 'solid',
|
411 | familyDefault: 'classic',
|
412 | cssPrefix: DEFAULT_CSS_PREFIX,
|
413 | replacementClass: DEFAULT_REPLACEMENT_CLASS,
|
414 | autoReplaceSvg: true,
|
415 | autoAddCss: true,
|
416 | autoA11y: true,
|
417 | searchPseudoElements: false,
|
418 | observeMutations: true,
|
419 | mutateApproach: 'async',
|
420 | keepOriginalSource: true,
|
421 | measurePerformance: false,
|
422 | showMissingIcons: true
|
423 | };
|
424 |
|
425 | if (initial.familyPrefix) {
|
426 | initial.cssPrefix = initial.familyPrefix;
|
427 | }
|
428 |
|
429 | var _config = _objectSpread2(_objectSpread2({}, _default), initial);
|
430 |
|
431 | if (!_config.autoReplaceSvg) _config.observeMutations = false;
|
432 | var config = {};
|
433 | Object.keys(_default).forEach(function (key) {
|
434 | Object.defineProperty(config, key, {
|
435 | enumerable: true,
|
436 | set: function set(val) {
|
437 | _config[key] = val;
|
438 |
|
439 | _onChangeCb.forEach(function (cb) {
|
440 | return cb(config);
|
441 | });
|
442 | },
|
443 | get: function get() {
|
444 | return _config[key];
|
445 | }
|
446 | });
|
447 | });
|
448 |
|
449 | Object.defineProperty(config, 'familyPrefix', {
|
450 | enumerable: true,
|
451 | set: function set(val) {
|
452 | _config.cssPrefix = val;
|
453 |
|
454 | _onChangeCb.forEach(function (cb) {
|
455 | return cb(config);
|
456 | });
|
457 | },
|
458 | get: function get() {
|
459 | return _config.cssPrefix;
|
460 | }
|
461 | });
|
462 | WINDOW.FontAwesomeConfig = config;
|
463 | var _onChangeCb = [];
|
464 | function onChange(cb) {
|
465 | _onChangeCb.push(cb);
|
466 |
|
467 | return function () {
|
468 | _onChangeCb.splice(_onChangeCb.indexOf(cb), 1);
|
469 | };
|
470 | }
|
471 |
|
472 | var d = UNITS_IN_GRID;
|
473 | var meaninglessTransform = {
|
474 | size: 16,
|
475 | x: 0,
|
476 | y: 0,
|
477 | rotate: 0,
|
478 | flipX: false,
|
479 | flipY: false
|
480 | };
|
481 | function insertCss(css) {
|
482 | if (!css || !IS_DOM) {
|
483 | return;
|
484 | }
|
485 |
|
486 | var style = DOCUMENT.createElement('style');
|
487 | style.setAttribute('type', 'text/css');
|
488 | style.innerHTML = css;
|
489 | var headChildren = DOCUMENT.head.childNodes;
|
490 | var beforeChild = null;
|
491 |
|
492 | for (var i = headChildren.length - 1; i > -1; i--) {
|
493 | var child = headChildren[i];
|
494 | var tagName = (child.tagName || '').toUpperCase();
|
495 |
|
496 | if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
|
497 | beforeChild = child;
|
498 | }
|
499 | }
|
500 |
|
501 | DOCUMENT.head.insertBefore(style, beforeChild);
|
502 | return css;
|
503 | }
|
504 | var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
505 | function nextUniqueId() {
|
506 | var size = 12;
|
507 | var id = '';
|
508 |
|
509 | while (size-- > 0) {
|
510 | id += idPool[Math.random() * 62 | 0];
|
511 | }
|
512 |
|
513 | return id;
|
514 | }
|
515 | function toArray(obj) {
|
516 | var array = [];
|
517 |
|
518 | for (var i = (obj || []).length >>> 0; i--;) {
|
519 | array[i] = obj[i];
|
520 | }
|
521 |
|
522 | return array;
|
523 | }
|
524 | function classArray(node) {
|
525 | if (node.classList) {
|
526 | return toArray(node.classList);
|
527 | } else {
|
528 | return (node.getAttribute('class') || '').split(' ').filter(function (i) {
|
529 | return i;
|
530 | });
|
531 | }
|
532 | }
|
533 | function htmlEscape(str) {
|
534 | return "".concat(str).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');
|
535 | }
|
536 | function joinAttributes(attributes) {
|
537 | return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
|
538 | return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
|
539 | }, '').trim();
|
540 | }
|
541 | function joinStyles(styles) {
|
542 | return Object.keys(styles || {}).reduce(function (acc, styleName) {
|
543 | return acc + "".concat(styleName, ": ").concat(styles[styleName].trim(), ";");
|
544 | }, '');
|
545 | }
|
546 | function transformIsMeaningful(transform) {
|
547 | return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
|
548 | }
|
549 | function transformForSvg(_ref) {
|
550 | var transform = _ref.transform,
|
551 | containerWidth = _ref.containerWidth,
|
552 | iconWidth = _ref.iconWidth;
|
553 | var outer = {
|
554 | transform: "translate(".concat(containerWidth / 2, " 256)")
|
555 | };
|
556 | var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
|
557 | var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
|
558 | var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
|
559 | var inner = {
|
560 | transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
|
561 | };
|
562 | var path = {
|
563 | transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
|
564 | };
|
565 | return {
|
566 | outer: outer,
|
567 | inner: inner,
|
568 | path: path
|
569 | };
|
570 | }
|
571 | function transformForCss(_ref2) {
|
572 | var transform = _ref2.transform,
|
573 | _ref2$width = _ref2.width,
|
574 | width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,
|
575 | _ref2$height = _ref2.height,
|
576 | height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,
|
577 | _ref2$startCentered = _ref2.startCentered,
|
578 | startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;
|
579 | var val = '';
|
580 |
|
581 | if (startCentered && IS_IE) {
|
582 | val += "translate(".concat(transform.x / d - width / 2, "em, ").concat(transform.y / d - height / 2, "em) ");
|
583 | } else if (startCentered) {
|
584 | val += "translate(calc(-50% + ".concat(transform.x / d, "em), calc(-50% + ").concat(transform.y / d, "em)) ");
|
585 | } else {
|
586 | val += "translate(".concat(transform.x / d, "em, ").concat(transform.y / d, "em) ");
|
587 | }
|
588 |
|
589 | val += "scale(".concat(transform.size / d * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d * (transform.flipY ? -1 : 1), ") ");
|
590 | val += "rotate(".concat(transform.rotate, "deg) ");
|
591 | return val;
|
592 | }
|
593 |
|
594 | var baseStyles = ":root, :host {\n --fa-font-solid: normal 900 1em/1 \"Font Awesome 6 Solid\";\n --fa-font-regular: normal 400 1em/1 \"Font Awesome 6 Regular\";\n --fa-font-light: normal 300 1em/1 \"Font Awesome 6 Light\";\n --fa-font-thin: normal 100 1em/1 \"Font Awesome 6 Thin\";\n --fa-font-duotone: normal 900 1em/1 \"Font Awesome 6 Duotone\";\n --fa-font-sharp-solid: normal 900 1em/1 \"Font Awesome 6 Sharp\";\n --fa-font-brands: normal 400 1em/1 \"Font Awesome 6 Brands\";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-counter-scale, 0.25));\n transform: scale(var(--fa-counter-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(var(--fa-li-width, 2em) * -1);\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n -webkit-animation-name: fa-beat;\n animation-name: fa-beat;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n -webkit-animation-name: fa-bounce;\n animation-name: fa-bounce;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n -webkit-animation-name: fa-fade;\n animation-name: fa-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n -webkit-animation-name: fa-beat-fade;\n animation-name: fa-beat-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n -webkit-animation-name: fa-flip;\n animation-name: fa-flip;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n -webkit-animation-name: fa-shake;\n animation-name: fa-shake;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 2s);\n animation-duration: var(--fa-animation-duration, 2s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n -webkit-animation-delay: -1ms;\n animation-delay: -1ms;\n -webkit-animation-duration: 1ms;\n animation-duration: 1ms;\n -webkit-animation-iteration-count: 1;\n animation-iteration-count: 1;\n transition-delay: 0s;\n transition-duration: 0s;\n }\n}\n@-webkit-keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@-webkit-keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@-webkit-keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@-webkit-keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@-webkit-keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@-webkit-keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n -webkit-transform: rotate(var(--fa-rotate-angle, none));\n transform: rotate(var(--fa-rotate-angle, none));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}";
|
595 |
|
596 | function css() {
|
597 | var dcp = DEFAULT_CSS_PREFIX;
|
598 | var drc = DEFAULT_REPLACEMENT_CLASS;
|
599 | var fp = config.cssPrefix;
|
600 | var rc = config.replacementClass;
|
601 | var s = baseStyles;
|
602 |
|
603 | if (fp !== dcp || rc !== drc) {
|
604 | var dPatt = new RegExp("\\.".concat(dcp, "\\-"), 'g');
|
605 | var customPropPatt = new RegExp("\\--".concat(dcp, "\\-"), 'g');
|
606 | var rPatt = new RegExp("\\.".concat(drc), 'g');
|
607 | s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
|
608 | }
|
609 |
|
610 | return s;
|
611 | }
|
612 |
|
613 | var _cssInserted = false;
|
614 |
|
615 | function ensureCss() {
|
616 | if (config.autoAddCss && !_cssInserted) {
|
617 | insertCss(css());
|
618 | _cssInserted = true;
|
619 | }
|
620 | }
|
621 |
|
622 | var InjectCSS = {
|
623 | mixout: function mixout() {
|
624 | return {
|
625 | dom: {
|
626 | css: css,
|
627 | insertCss: ensureCss
|
628 | }
|
629 | };
|
630 | },
|
631 | hooks: function hooks() {
|
632 | return {
|
633 | beforeDOMElementCreation: function beforeDOMElementCreation() {
|
634 | ensureCss();
|
635 | },
|
636 | beforeI2svg: function beforeI2svg() {
|
637 | ensureCss();
|
638 | }
|
639 | };
|
640 | }
|
641 | };
|
642 |
|
643 | var w = WINDOW || {};
|
644 | if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
|
645 | if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
|
646 | if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
|
647 | if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
|
648 | var namespace = w[NAMESPACE_IDENTIFIER];
|
649 |
|
650 | var functions = [];
|
651 |
|
652 | var listener = function listener() {
|
653 | DOCUMENT.removeEventListener('DOMContentLoaded', listener);
|
654 | loaded = 1;
|
655 | functions.map(function (fn) {
|
656 | return fn();
|
657 | });
|
658 | };
|
659 |
|
660 | var loaded = false;
|
661 |
|
662 | if (IS_DOM) {
|
663 | loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
|
664 | if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
|
665 | }
|
666 |
|
667 | function domready (fn) {
|
668 | if (!IS_DOM) return;
|
669 | loaded ? setTimeout(fn, 0) : functions.push(fn);
|
670 | }
|
671 |
|
672 | function toHtml(abstractNodes) {
|
673 | var tag = abstractNodes.tag,
|
674 | _abstractNodes$attrib = abstractNodes.attributes,
|
675 | attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
|
676 | _abstractNodes$childr = abstractNodes.children,
|
677 | children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
|
678 |
|
679 | if (typeof abstractNodes === 'string') {
|
680 | return htmlEscape(abstractNodes);
|
681 | } else {
|
682 | return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
|
683 | }
|
684 | }
|
685 |
|
686 | function iconFromMapping(mapping, prefix, iconName) {
|
687 | if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
|
688 | return {
|
689 | prefix: prefix,
|
690 | iconName: iconName,
|
691 | icon: mapping[prefix][iconName]
|
692 | };
|
693 | }
|
694 | }
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 | var bindInternal4 = function bindInternal4(func, thisContext) {
|
702 | return function (a, b, c, d) {
|
703 | return func.call(thisContext, a, b, c, d);
|
704 | };
|
705 | };
|
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 | var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
|
721 | var keys = Object.keys(subject),
|
722 | length = keys.length,
|
723 | iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
|
724 | i,
|
725 | key,
|
726 | result;
|
727 |
|
728 | if (initialValue === undefined) {
|
729 | i = 1;
|
730 | result = subject[keys[0]];
|
731 | } else {
|
732 | i = 0;
|
733 | result = initialValue;
|
734 | }
|
735 |
|
736 | for (; i < length; i++) {
|
737 | key = keys[i];
|
738 | result = iterator(result, subject[key], key, subject);
|
739 | }
|
740 |
|
741 | return result;
|
742 | };
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 | function ucs2decode(string) {
|
769 | var output = [];
|
770 | var counter = 0;
|
771 | var length = string.length;
|
772 |
|
773 | while (counter < length) {
|
774 | var value = string.charCodeAt(counter++);
|
775 |
|
776 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
777 | var extra = string.charCodeAt(counter++);
|
778 |
|
779 | if ((extra & 0xFC00) == 0xDC00) {
|
780 |
|
781 | output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
782 | } else {
|
783 | output.push(value);
|
784 | counter--;
|
785 | }
|
786 | } else {
|
787 | output.push(value);
|
788 | }
|
789 | }
|
790 |
|
791 | return output;
|
792 | }
|
793 |
|
794 | function toHex(unicode) {
|
795 | var decoded = ucs2decode(unicode);
|
796 | return decoded.length === 1 ? decoded[0].toString(16) : null;
|
797 | }
|
798 | function codePointAt(string, index) {
|
799 | var size = string.length;
|
800 | var first = string.charCodeAt(index);
|
801 | var second;
|
802 |
|
803 | if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
|
804 | second = string.charCodeAt(index + 1);
|
805 |
|
806 | if (second >= 0xDC00 && second <= 0xDFFF) {
|
807 | return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
|
808 | }
|
809 | }
|
810 |
|
811 | return first;
|
812 | }
|
813 |
|
814 | function normalizeIcons(icons) {
|
815 | return Object.keys(icons).reduce(function (acc, iconName) {
|
816 | var icon = icons[iconName];
|
817 | var expanded = !!icon.icon;
|
818 |
|
819 | if (expanded) {
|
820 | acc[icon.iconName] = icon.icon;
|
821 | } else {
|
822 | acc[iconName] = icon;
|
823 | }
|
824 |
|
825 | return acc;
|
826 | }, {});
|
827 | }
|
828 |
|
829 | function defineIcons(prefix, icons) {
|
830 | var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
831 | var _params$skipHooks = params.skipHooks,
|
832 | skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
|
833 | var normalized = normalizeIcons(icons);
|
834 |
|
835 | if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
|
836 | namespace.hooks.addPack(prefix, normalizeIcons(icons));
|
837 | } else {
|
838 | namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), normalized);
|
839 | }
|
840 | |
841 |
|
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 |
|
848 | if (prefix === 'fas') {
|
849 | defineIcons('fa', icons);
|
850 | }
|
851 | }
|
852 |
|
853 | var duotonePathRe = [_wrapRegExp(/path d="((?:(?!")[\s\S])+)".*path d="((?:(?!")[\s\S])+)"/, {
|
854 | d1: 1,
|
855 | d2: 2
|
856 | }), _wrapRegExp(/path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)".*path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)"/, {
|
857 | cls1: 1,
|
858 | d1: 2,
|
859 | cls2: 3,
|
860 | d2: 4
|
861 | }), _wrapRegExp(/path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)"/, {
|
862 | cls1: 1,
|
863 | d1: 2
|
864 | })];
|
865 |
|
866 | var _LONG_STYLE, _PREFIXES, _PREFIXES_FOR_FAMILY;
|
867 | var styles = namespace.styles,
|
868 | shims = namespace.shims;
|
869 | var LONG_STYLE = (_LONG_STYLE = {}, _defineProperty(_LONG_STYLE, FAMILY_CLASSIC, Object.values(PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC])), _defineProperty(_LONG_STYLE, FAMILY_SHARP, Object.values(PREFIX_TO_LONG_STYLE[FAMILY_SHARP])), _LONG_STYLE);
|
870 | var _defaultUsablePrefix = null;
|
871 | var _byUnicode = {};
|
872 | var _byLigature = {};
|
873 | var _byOldName = {};
|
874 | var _byOldUnicode = {};
|
875 | var _byAlias = {};
|
876 | var PREFIXES = (_PREFIXES = {}, _defineProperty(_PREFIXES, FAMILY_CLASSIC, Object.keys(PREFIX_TO_STYLE[FAMILY_CLASSIC])), _defineProperty(_PREFIXES, FAMILY_SHARP, Object.keys(PREFIX_TO_STYLE[FAMILY_SHARP])), _PREFIXES);
|
877 |
|
878 | function isReserved(name) {
|
879 | return ~RESERVED_CLASSES.indexOf(name);
|
880 | }
|
881 |
|
882 | function getIconName(cssPrefix, cls) {
|
883 | var parts = cls.split('-');
|
884 | var prefix = parts[0];
|
885 | var iconName = parts.slice(1).join('-');
|
886 |
|
887 | if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {
|
888 | return iconName;
|
889 | } else {
|
890 | return null;
|
891 | }
|
892 | }
|
893 | var build = function build() {
|
894 | var lookup = function lookup(reducer) {
|
895 | return reduce(styles, function (o, style, prefix) {
|
896 | o[prefix] = reduce(style, reducer, {});
|
897 | return o;
|
898 | }, {});
|
899 | };
|
900 |
|
901 | _byUnicode = lookup(function (acc, icon, iconName) {
|
902 | if (icon[3]) {
|
903 | acc[icon[3]] = iconName;
|
904 | }
|
905 |
|
906 | if (icon[2]) {
|
907 | var aliases = icon[2].filter(function (a) {
|
908 | return typeof a === 'number';
|
909 | });
|
910 | aliases.forEach(function (alias) {
|
911 | acc[alias.toString(16)] = iconName;
|
912 | });
|
913 | }
|
914 |
|
915 | return acc;
|
916 | });
|
917 | _byLigature = lookup(function (acc, icon, iconName) {
|
918 | acc[iconName] = iconName;
|
919 |
|
920 | if (icon[2]) {
|
921 | var aliases = icon[2].filter(function (a) {
|
922 | return typeof a === 'string';
|
923 | });
|
924 | aliases.forEach(function (alias) {
|
925 | acc[alias] = iconName;
|
926 | });
|
927 | }
|
928 |
|
929 | return acc;
|
930 | });
|
931 | _byAlias = lookup(function (acc, icon, iconName) {
|
932 | var aliases = icon[2];
|
933 | acc[iconName] = iconName;
|
934 | aliases.forEach(function (alias) {
|
935 | acc[alias] = iconName;
|
936 | });
|
937 | return acc;
|
938 | });
|
939 |
|
940 |
|
941 | var hasRegular = 'far' in styles || config.autoFetchSvg;
|
942 | var shimLookups = reduce(shims, function (acc, shim) {
|
943 | var maybeNameMaybeUnicode = shim[0];
|
944 | var prefix = shim[1];
|
945 | var iconName = shim[2];
|
946 |
|
947 | if (prefix === 'far' && !hasRegular) {
|
948 | prefix = 'fas';
|
949 | }
|
950 |
|
951 | if (typeof maybeNameMaybeUnicode === 'string') {
|
952 | acc.names[maybeNameMaybeUnicode] = {
|
953 | prefix: prefix,
|
954 | iconName: iconName
|
955 | };
|
956 | }
|
957 |
|
958 | if (typeof maybeNameMaybeUnicode === 'number') {
|
959 | acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {
|
960 | prefix: prefix,
|
961 | iconName: iconName
|
962 | };
|
963 | }
|
964 |
|
965 | return acc;
|
966 | }, {
|
967 | names: {},
|
968 | unicodes: {}
|
969 | });
|
970 | _byOldName = shimLookups.names;
|
971 | _byOldUnicode = shimLookups.unicodes;
|
972 | _defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {
|
973 | family: config.familyDefault
|
974 | });
|
975 | };
|
976 | onChange(function (c) {
|
977 | _defaultUsablePrefix = getCanonicalPrefix(c.styleDefault, {
|
978 | family: config.familyDefault
|
979 | });
|
980 | });
|
981 | build();
|
982 | function byUnicode(prefix, unicode) {
|
983 | return (_byUnicode[prefix] || {})[unicode];
|
984 | }
|
985 | function byLigature(prefix, ligature) {
|
986 | return (_byLigature[prefix] || {})[ligature];
|
987 | }
|
988 | function byAlias(prefix, alias) {
|
989 | return (_byAlias[prefix] || {})[alias];
|
990 | }
|
991 | function byOldName(name) {
|
992 | return _byOldName[name] || {
|
993 | prefix: null,
|
994 | iconName: null
|
995 | };
|
996 | }
|
997 | function byOldUnicode(unicode) {
|
998 | var oldUnicode = _byOldUnicode[unicode];
|
999 | var newUnicode = byUnicode('fas', unicode);
|
1000 | return oldUnicode || (newUnicode ? {
|
1001 | prefix: 'fas',
|
1002 | iconName: newUnicode
|
1003 | } : null) || {
|
1004 | prefix: null,
|
1005 | iconName: null
|
1006 | };
|
1007 | }
|
1008 | function getDefaultUsablePrefix() {
|
1009 | return _defaultUsablePrefix;
|
1010 | }
|
1011 | var emptyCanonicalIcon = function emptyCanonicalIcon() {
|
1012 | return {
|
1013 | prefix: null,
|
1014 | iconName: null,
|
1015 | rest: []
|
1016 | };
|
1017 | };
|
1018 | function getCanonicalPrefix(styleOrPrefix) {
|
1019 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1020 | var _params$family = params.family,
|
1021 | family = _params$family === void 0 ? FAMILY_CLASSIC : _params$family;
|
1022 | var style = PREFIX_TO_STYLE[family][styleOrPrefix];
|
1023 | var prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];
|
1024 | var defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;
|
1025 | return prefix || defined || null;
|
1026 | }
|
1027 | var PREFIXES_FOR_FAMILY = (_PREFIXES_FOR_FAMILY = {}, _defineProperty(_PREFIXES_FOR_FAMILY, FAMILY_CLASSIC, Object.keys(PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC])), _defineProperty(_PREFIXES_FOR_FAMILY, FAMILY_SHARP, Object.keys(PREFIX_TO_LONG_STYLE[FAMILY_SHARP])), _PREFIXES_FOR_FAMILY);
|
1028 | function getCanonicalIcon(values) {
|
1029 | var _famProps;
|
1030 |
|
1031 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1032 | var _params$skipLookups = params.skipLookups,
|
1033 | skipLookups = _params$skipLookups === void 0 ? false : _params$skipLookups;
|
1034 | var famProps = (_famProps = {}, _defineProperty(_famProps, FAMILY_CLASSIC, "".concat(config.cssPrefix, "-").concat(FAMILY_CLASSIC)), _defineProperty(_famProps, FAMILY_SHARP, "".concat(config.cssPrefix, "-").concat(FAMILY_SHARP)), _famProps);
|
1035 | var givenPrefix = null;
|
1036 | var family = FAMILY_CLASSIC;
|
1037 |
|
1038 | if (values.includes(famProps[FAMILY_CLASSIC]) || values.some(function (v) {
|
1039 | return PREFIXES_FOR_FAMILY[FAMILY_CLASSIC].includes(v);
|
1040 | })) {
|
1041 | family = FAMILY_CLASSIC;
|
1042 | }
|
1043 |
|
1044 | if (values.includes(famProps[FAMILY_SHARP]) || values.some(function (v) {
|
1045 | return PREFIXES_FOR_FAMILY[FAMILY_SHARP].includes(v);
|
1046 | })) {
|
1047 | family = FAMILY_SHARP;
|
1048 | }
|
1049 |
|
1050 | var canonical = values.reduce(function (acc, cls) {
|
1051 | var iconName = getIconName(config.cssPrefix, cls);
|
1052 |
|
1053 | if (styles[cls]) {
|
1054 | cls = LONG_STYLE[family].includes(cls) ? LONG_STYLE_TO_PREFIX[family][cls] : cls;
|
1055 | givenPrefix = cls;
|
1056 | acc.prefix = cls;
|
1057 | } else if (PREFIXES[family].indexOf(cls) > -1) {
|
1058 | givenPrefix = cls;
|
1059 | acc.prefix = getCanonicalPrefix(cls, {
|
1060 | family: family
|
1061 | });
|
1062 | } else if (iconName) {
|
1063 | acc.iconName = iconName;
|
1064 | } else if (cls !== config.replacementClass && cls !== famProps[FAMILY_CLASSIC] && cls !== famProps[FAMILY_SHARP]) {
|
1065 | acc.rest.push(cls);
|
1066 | }
|
1067 |
|
1068 | if (!skipLookups && acc.prefix && acc.iconName) {
|
1069 | var shim = givenPrefix === 'fa' ? byOldName(acc.iconName) : {};
|
1070 | var aliasIconName = byAlias(acc.prefix, acc.iconName);
|
1071 |
|
1072 | if (shim.prefix) {
|
1073 | givenPrefix = null;
|
1074 | }
|
1075 |
|
1076 | acc.iconName = shim.iconName || aliasIconName || acc.iconName;
|
1077 | acc.prefix = shim.prefix || acc.prefix;
|
1078 |
|
1079 | if (acc.prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {
|
1080 |
|
1081 |
|
1082 | acc.prefix = 'fas';
|
1083 | }
|
1084 | }
|
1085 |
|
1086 | return acc;
|
1087 | }, emptyCanonicalIcon());
|
1088 |
|
1089 | if (values.includes('fa-brands') || values.includes('fab')) {
|
1090 | canonical.prefix = 'fab';
|
1091 | }
|
1092 |
|
1093 | if (values.includes('fa-duotone') || values.includes('fad')) {
|
1094 | canonical.prefix = 'fad';
|
1095 | }
|
1096 |
|
1097 | if (!canonical.prefix && family === FAMILY_SHARP && (styles['fass'] || config.autoFetchSvg)) {
|
1098 | canonical.prefix = 'fass';
|
1099 | canonical.iconName = byAlias(canonical.prefix, canonical.iconName) || canonical.iconName;
|
1100 | }
|
1101 |
|
1102 | if (canonical.prefix === 'fa' || givenPrefix === 'fa') {
|
1103 |
|
1104 |
|
1105 | canonical.prefix = getDefaultUsablePrefix() || 'fas';
|
1106 | }
|
1107 |
|
1108 | return canonical;
|
1109 | }
|
1110 |
|
1111 | var Library = function () {
|
1112 | function Library() {
|
1113 | _classCallCheck(this, Library);
|
1114 |
|
1115 | this.definitions = {};
|
1116 | }
|
1117 |
|
1118 | _createClass(Library, [{
|
1119 | key: "add",
|
1120 | value: function add() {
|
1121 | var _this = this;
|
1122 |
|
1123 | for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
|
1124 | definitions[_key] = arguments[_key];
|
1125 | }
|
1126 |
|
1127 | var additions = definitions.reduce(this._pullDefinitions, {});
|
1128 | Object.keys(additions).forEach(function (key) {
|
1129 | _this.definitions[key] = _objectSpread2(_objectSpread2({}, _this.definitions[key] || {}), additions[key]);
|
1130 | defineIcons(key, additions[key]);
|
1131 |
|
1132 | var longPrefix = PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC][key];
|
1133 | if (longPrefix) defineIcons(longPrefix, additions[key]);
|
1134 | build();
|
1135 | });
|
1136 | }
|
1137 | }, {
|
1138 | key: "reset",
|
1139 | value: function reset() {
|
1140 | this.definitions = {};
|
1141 | }
|
1142 | }, {
|
1143 | key: "_pullDefinitions",
|
1144 | value: function _pullDefinitions(additions, definition) {
|
1145 | var normalized = definition.prefix && definition.iconName && definition.icon ? {
|
1146 | 0: definition
|
1147 | } : definition;
|
1148 | Object.keys(normalized).map(function (key) {
|
1149 | var _normalized$key = normalized[key],
|
1150 | prefix = _normalized$key.prefix,
|
1151 | iconName = _normalized$key.iconName,
|
1152 | icon = _normalized$key.icon;
|
1153 | var aliases = icon[2];
|
1154 | if (!additions[prefix]) additions[prefix] = {};
|
1155 |
|
1156 | if (aliases.length > 0) {
|
1157 | aliases.forEach(function (alias) {
|
1158 | if (typeof alias === 'string') {
|
1159 | additions[prefix][alias] = icon;
|
1160 | }
|
1161 | });
|
1162 | }
|
1163 |
|
1164 | additions[prefix][iconName] = icon;
|
1165 | });
|
1166 | return additions;
|
1167 | }
|
1168 | }]);
|
1169 |
|
1170 | return Library;
|
1171 | }();
|
1172 |
|
1173 | var _plugins = [];
|
1174 | var _hooks = {};
|
1175 | var providers = {};
|
1176 | var defaultProviderKeys = Object.keys(providers);
|
1177 | function registerPlugins(nextPlugins, _ref) {
|
1178 | var obj = _ref.mixoutsTo;
|
1179 | _plugins = nextPlugins;
|
1180 | _hooks = {};
|
1181 | Object.keys(providers).forEach(function (k) {
|
1182 | if (defaultProviderKeys.indexOf(k) === -1) {
|
1183 | delete providers[k];
|
1184 | }
|
1185 | });
|
1186 |
|
1187 | _plugins.forEach(function (plugin) {
|
1188 | var mixout = plugin.mixout ? plugin.mixout() : {};
|
1189 | Object.keys(mixout).forEach(function (tk) {
|
1190 | if (typeof mixout[tk] === 'function') {
|
1191 | obj[tk] = mixout[tk];
|
1192 | }
|
1193 |
|
1194 | if (_typeof(mixout[tk]) === 'object') {
|
1195 | Object.keys(mixout[tk]).forEach(function (sk) {
|
1196 | if (!obj[tk]) {
|
1197 | obj[tk] = {};
|
1198 | }
|
1199 |
|
1200 | obj[tk][sk] = mixout[tk][sk];
|
1201 | });
|
1202 | }
|
1203 | });
|
1204 |
|
1205 | if (plugin.hooks) {
|
1206 | var hooks = plugin.hooks();
|
1207 | Object.keys(hooks).forEach(function (hook) {
|
1208 | if (!_hooks[hook]) {
|
1209 | _hooks[hook] = [];
|
1210 | }
|
1211 |
|
1212 | _hooks[hook].push(hooks[hook]);
|
1213 | });
|
1214 | }
|
1215 |
|
1216 | if (plugin.provides) {
|
1217 | plugin.provides(providers);
|
1218 | }
|
1219 | });
|
1220 |
|
1221 | return obj;
|
1222 | }
|
1223 | function chainHooks(hook, accumulator) {
|
1224 | for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
1225 | args[_key - 2] = arguments[_key];
|
1226 | }
|
1227 |
|
1228 | var hookFns = _hooks[hook] || [];
|
1229 | hookFns.forEach(function (hookFn) {
|
1230 | accumulator = hookFn.apply(null, [accumulator].concat(args));
|
1231 | });
|
1232 | return accumulator;
|
1233 | }
|
1234 | function callHooks(hook) {
|
1235 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
1236 | args[_key2 - 1] = arguments[_key2];
|
1237 | }
|
1238 |
|
1239 | var hookFns = _hooks[hook] || [];
|
1240 | hookFns.forEach(function (hookFn) {
|
1241 | hookFn.apply(null, args);
|
1242 | });
|
1243 | return undefined;
|
1244 | }
|
1245 | function callProvided() {
|
1246 | var hook = arguments[0];
|
1247 | var args = Array.prototype.slice.call(arguments, 1);
|
1248 | return providers[hook] ? providers[hook].apply(null, args) : undefined;
|
1249 | }
|
1250 |
|
1251 | function findIconDefinition(iconLookup) {
|
1252 | if (iconLookup.prefix === 'fa') {
|
1253 | iconLookup.prefix = 'fas';
|
1254 | }
|
1255 |
|
1256 | var iconName = iconLookup.iconName;
|
1257 | var prefix = iconLookup.prefix || getDefaultUsablePrefix();
|
1258 | if (!iconName) return;
|
1259 | iconName = byAlias(prefix, iconName) || iconName;
|
1260 | return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
|
1261 | }
|
1262 | var library = new Library();
|
1263 | var noAuto = function noAuto() {
|
1264 | config.autoReplaceSvg = false;
|
1265 | config.observeMutations = false;
|
1266 | callHooks('noAuto');
|
1267 | };
|
1268 | var dom = {
|
1269 | i2svg: function i2svg() {
|
1270 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1271 |
|
1272 | if (IS_DOM) {
|
1273 | callHooks('beforeI2svg', params);
|
1274 | callProvided('pseudoElements2svg', params);
|
1275 | return callProvided('i2svg', params);
|
1276 | } else {
|
1277 | return Promise.reject('Operation requires a DOM of some kind.');
|
1278 | }
|
1279 | },
|
1280 | watch: function watch() {
|
1281 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1282 | var autoReplaceSvgRoot = params.autoReplaceSvgRoot;
|
1283 |
|
1284 | if (config.autoReplaceSvg === false) {
|
1285 | config.autoReplaceSvg = true;
|
1286 | }
|
1287 |
|
1288 | config.observeMutations = true;
|
1289 | domready(function () {
|
1290 | autoReplace({
|
1291 | autoReplaceSvgRoot: autoReplaceSvgRoot
|
1292 | });
|
1293 | callHooks('watch', params);
|
1294 | });
|
1295 | }
|
1296 | };
|
1297 | var parse = {
|
1298 | icon: function icon(_icon) {
|
1299 | if (_icon === null) {
|
1300 | return null;
|
1301 | }
|
1302 |
|
1303 | if (_typeof(_icon) === 'object' && _icon.prefix && _icon.iconName) {
|
1304 | return {
|
1305 | prefix: _icon.prefix,
|
1306 | iconName: byAlias(_icon.prefix, _icon.iconName) || _icon.iconName
|
1307 | };
|
1308 | }
|
1309 |
|
1310 | if (Array.isArray(_icon) && _icon.length === 2) {
|
1311 | var iconName = _icon[1].indexOf('fa-') === 0 ? _icon[1].slice(3) : _icon[1];
|
1312 | var prefix = getCanonicalPrefix(_icon[0]);
|
1313 | return {
|
1314 | prefix: prefix,
|
1315 | iconName: byAlias(prefix, iconName) || iconName
|
1316 | };
|
1317 | }
|
1318 |
|
1319 | if (typeof _icon === 'string' && (_icon.indexOf("".concat(config.cssPrefix, "-")) > -1 || _icon.match(ICON_SELECTION_SYNTAX_PATTERN))) {
|
1320 | var canonicalIcon = getCanonicalIcon(_icon.split(' '), {
|
1321 | skipLookups: true
|
1322 | });
|
1323 | return {
|
1324 | prefix: canonicalIcon.prefix || getDefaultUsablePrefix(),
|
1325 | iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName
|
1326 | };
|
1327 | }
|
1328 |
|
1329 | if (typeof _icon === 'string') {
|
1330 | var _prefix = getDefaultUsablePrefix();
|
1331 |
|
1332 | return {
|
1333 | prefix: _prefix,
|
1334 | iconName: byAlias(_prefix, _icon) || _icon
|
1335 | };
|
1336 | }
|
1337 | }
|
1338 | };
|
1339 | var api = {
|
1340 | noAuto: noAuto,
|
1341 | config: config,
|
1342 | dom: dom,
|
1343 | parse: parse,
|
1344 | library: library,
|
1345 | findIconDefinition: findIconDefinition,
|
1346 | toHtml: toHtml
|
1347 | };
|
1348 |
|
1349 | var autoReplace = function autoReplace() {
|
1350 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1351 | var _params$autoReplaceSv = params.autoReplaceSvgRoot,
|
1352 | autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;
|
1353 | if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({
|
1354 | node: autoReplaceSvgRoot
|
1355 | });
|
1356 | };
|
1357 |
|
1358 | function domVariants(val, abstractCreator) {
|
1359 | Object.defineProperty(val, 'abstract', {
|
1360 | get: abstractCreator
|
1361 | });
|
1362 | Object.defineProperty(val, 'html', {
|
1363 | get: function get() {
|
1364 | return val.abstract.map(function (a) {
|
1365 | return toHtml(a);
|
1366 | });
|
1367 | }
|
1368 | });
|
1369 | Object.defineProperty(val, 'node', {
|
1370 | get: function get() {
|
1371 | if (!IS_DOM) return;
|
1372 | var container = DOCUMENT.createElement('div');
|
1373 | container.innerHTML = val.html;
|
1374 | return container.children;
|
1375 | }
|
1376 | });
|
1377 | return val;
|
1378 | }
|
1379 |
|
1380 | function asIcon (_ref) {
|
1381 | var children = _ref.children,
|
1382 | main = _ref.main,
|
1383 | mask = _ref.mask,
|
1384 | attributes = _ref.attributes,
|
1385 | styles = _ref.styles,
|
1386 | transform = _ref.transform;
|
1387 |
|
1388 | if (transformIsMeaningful(transform) && main.found && !mask.found) {
|
1389 | var width = main.width,
|
1390 | height = main.height;
|
1391 | var offset = {
|
1392 | x: width / height / 2,
|
1393 | y: 0.5
|
1394 | };
|
1395 | attributes['style'] = joinStyles(_objectSpread2(_objectSpread2({}, styles), {}, {
|
1396 | 'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
|
1397 | }));
|
1398 | }
|
1399 |
|
1400 | return [{
|
1401 | tag: 'svg',
|
1402 | attributes: attributes,
|
1403 | children: children
|
1404 | }];
|
1405 | }
|
1406 |
|
1407 | function asSymbol (_ref) {
|
1408 | var prefix = _ref.prefix,
|
1409 | iconName = _ref.iconName,
|
1410 | children = _ref.children,
|
1411 | attributes = _ref.attributes,
|
1412 | symbol = _ref.symbol;
|
1413 | var id = symbol === true ? "".concat(prefix, "-").concat(config.cssPrefix, "-").concat(iconName) : symbol;
|
1414 | return [{
|
1415 | tag: 'svg',
|
1416 | attributes: {
|
1417 | style: 'display: none;'
|
1418 | },
|
1419 | children: [{
|
1420 | tag: 'symbol',
|
1421 | attributes: _objectSpread2(_objectSpread2({}, attributes), {}, {
|
1422 | id: id
|
1423 | }),
|
1424 | children: children
|
1425 | }]
|
1426 | }];
|
1427 | }
|
1428 |
|
1429 | function makeInlineSvgAbstract(params) {
|
1430 | var _params$icons = params.icons,
|
1431 | main = _params$icons.main,
|
1432 | mask = _params$icons.mask,
|
1433 | prefix = params.prefix,
|
1434 | iconName = params.iconName,
|
1435 | transform = params.transform,
|
1436 | symbol = params.symbol,
|
1437 | title = params.title,
|
1438 | maskId = params.maskId,
|
1439 | titleId = params.titleId,
|
1440 | extra = params.extra,
|
1441 | _params$watchable = params.watchable,
|
1442 | watchable = _params$watchable === void 0 ? false : _params$watchable;
|
1443 |
|
1444 | var _ref = mask.found ? mask : main,
|
1445 | width = _ref.width,
|
1446 | height = _ref.height;
|
1447 |
|
1448 | var isUploadedIcon = prefix === 'fak';
|
1449 | var attrClass = [config.replacementClass, iconName ? "".concat(config.cssPrefix, "-").concat(iconName) : ''].filter(function (c) {
|
1450 | return extra.classes.indexOf(c) === -1;
|
1451 | }).filter(function (c) {
|
1452 | return c !== '' || !!c;
|
1453 | }).concat(extra.classes).join(' ');
|
1454 | var content = {
|
1455 | children: [],
|
1456 | attributes: _objectSpread2(_objectSpread2({}, extra.attributes), {}, {
|
1457 | 'data-prefix': prefix,
|
1458 | 'data-icon': iconName,
|
1459 | 'class': attrClass,
|
1460 | 'role': extra.attributes.role || 'img',
|
1461 | 'xmlns': 'http://www.w3.org/2000/svg',
|
1462 | 'viewBox': "0 0 ".concat(width, " ").concat(height)
|
1463 | })
|
1464 | };
|
1465 | var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
|
1466 | width: "".concat(width / height * 16 * 0.0625, "em")
|
1467 | } : {};
|
1468 |
|
1469 | if (watchable) {
|
1470 | content.attributes[DATA_FA_I2SVG] = '';
|
1471 | }
|
1472 |
|
1473 | if (title) {
|
1474 | content.children.push({
|
1475 | tag: 'title',
|
1476 | attributes: {
|
1477 | id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
|
1478 | },
|
1479 | children: [title]
|
1480 | });
|
1481 | delete content.attributes.title;
|
1482 | }
|
1483 |
|
1484 | var args = _objectSpread2(_objectSpread2({}, content), {}, {
|
1485 | prefix: prefix,
|
1486 | iconName: iconName,
|
1487 | main: main,
|
1488 | mask: mask,
|
1489 | maskId: maskId,
|
1490 | transform: transform,
|
1491 | symbol: symbol,
|
1492 | styles: _objectSpread2(_objectSpread2({}, uploadedIconWidthStyle), extra.styles)
|
1493 | });
|
1494 |
|
1495 | var _ref2 = mask.found && main.found ? callProvided('generateAbstractMask', args) || {
|
1496 | children: [],
|
1497 | attributes: {}
|
1498 | } : callProvided('generateAbstractIcon', args) || {
|
1499 | children: [],
|
1500 | attributes: {}
|
1501 | },
|
1502 | children = _ref2.children,
|
1503 | attributes = _ref2.attributes;
|
1504 |
|
1505 | args.children = children;
|
1506 | args.attributes = attributes;
|
1507 |
|
1508 | if (symbol) {
|
1509 | return asSymbol(args);
|
1510 | } else {
|
1511 | return asIcon(args);
|
1512 | }
|
1513 | }
|
1514 | function makeLayersTextAbstract(params) {
|
1515 | var content = params.content,
|
1516 | width = params.width,
|
1517 | height = params.height,
|
1518 | transform = params.transform,
|
1519 | title = params.title,
|
1520 | extra = params.extra,
|
1521 | _params$watchable2 = params.watchable,
|
1522 | watchable = _params$watchable2 === void 0 ? false : _params$watchable2;
|
1523 |
|
1524 | var attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
|
1525 | 'title': title
|
1526 | } : {}), {}, {
|
1527 | 'class': extra.classes.join(' ')
|
1528 | });
|
1529 |
|
1530 | if (watchable) {
|
1531 | attributes[DATA_FA_I2SVG] = '';
|
1532 | }
|
1533 |
|
1534 | var styles = _objectSpread2({}, extra.styles);
|
1535 |
|
1536 | if (transformIsMeaningful(transform)) {
|
1537 | styles['transform'] = transformForCss({
|
1538 | transform: transform,
|
1539 | startCentered: true,
|
1540 | width: width,
|
1541 | height: height
|
1542 | });
|
1543 | styles['-webkit-transform'] = styles['transform'];
|
1544 | }
|
1545 |
|
1546 | var styleString = joinStyles(styles);
|
1547 |
|
1548 | if (styleString.length > 0) {
|
1549 | attributes['style'] = styleString;
|
1550 | }
|
1551 |
|
1552 | var val = [];
|
1553 | val.push({
|
1554 | tag: 'span',
|
1555 | attributes: attributes,
|
1556 | children: [content]
|
1557 | });
|
1558 |
|
1559 | if (title) {
|
1560 | val.push({
|
1561 | tag: 'span',
|
1562 | attributes: {
|
1563 | class: 'sr-only'
|
1564 | },
|
1565 | children: [title]
|
1566 | });
|
1567 | }
|
1568 |
|
1569 | return val;
|
1570 | }
|
1571 | function makeLayersCounterAbstract(params) {
|
1572 | var content = params.content,
|
1573 | title = params.title,
|
1574 | extra = params.extra;
|
1575 |
|
1576 | var attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
|
1577 | 'title': title
|
1578 | } : {}), {}, {
|
1579 | 'class': extra.classes.join(' ')
|
1580 | });
|
1581 |
|
1582 | var styleString = joinStyles(extra.styles);
|
1583 |
|
1584 | if (styleString.length > 0) {
|
1585 | attributes['style'] = styleString;
|
1586 | }
|
1587 |
|
1588 | var val = [];
|
1589 | val.push({
|
1590 | tag: 'span',
|
1591 | attributes: attributes,
|
1592 | children: [content]
|
1593 | });
|
1594 |
|
1595 | if (title) {
|
1596 | val.push({
|
1597 | tag: 'span',
|
1598 | attributes: {
|
1599 | class: 'sr-only'
|
1600 | },
|
1601 | children: [title]
|
1602 | });
|
1603 | }
|
1604 |
|
1605 | return val;
|
1606 | }
|
1607 |
|
1608 | var styles$1 = namespace.styles;
|
1609 | function asFoundIcon(icon) {
|
1610 | var width = icon[0];
|
1611 | var height = icon[1];
|
1612 |
|
1613 | var _icon$slice = icon.slice(4),
|
1614 | _icon$slice2 = _slicedToArray(_icon$slice, 1),
|
1615 | vectorData = _icon$slice2[0];
|
1616 |
|
1617 | var element = null;
|
1618 |
|
1619 | if (Array.isArray(vectorData)) {
|
1620 | element = {
|
1621 | tag: 'g',
|
1622 | attributes: {
|
1623 | class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
|
1624 | },
|
1625 | children: [{
|
1626 | tag: 'path',
|
1627 | attributes: {
|
1628 | class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
|
1629 | fill: 'currentColor',
|
1630 | d: vectorData[0]
|
1631 | }
|
1632 | }, {
|
1633 | tag: 'path',
|
1634 | attributes: {
|
1635 | class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
|
1636 | fill: 'currentColor',
|
1637 | d: vectorData[1]
|
1638 | }
|
1639 | }]
|
1640 | };
|
1641 | } else {
|
1642 | element = {
|
1643 | tag: 'path',
|
1644 | attributes: {
|
1645 | fill: 'currentColor',
|
1646 | d: vectorData
|
1647 | }
|
1648 | };
|
1649 | }
|
1650 |
|
1651 | return {
|
1652 | found: true,
|
1653 | width: width,
|
1654 | height: height,
|
1655 | icon: element
|
1656 | };
|
1657 | }
|
1658 | var missingIconResolutionMixin = {
|
1659 | found: false,
|
1660 | width: 512,
|
1661 | height: 512
|
1662 | };
|
1663 |
|
1664 | function maybeNotifyMissing(iconName, prefix) {
|
1665 | if (!PRODUCTION && !config.showMissingIcons && iconName) {
|
1666 | console.error("Icon with name \"".concat(iconName, "\" and prefix \"").concat(prefix, "\" is missing."));
|
1667 | }
|
1668 | }
|
1669 |
|
1670 | function findIcon(iconName, prefix) {
|
1671 | var givenPrefix = prefix;
|
1672 |
|
1673 | if (prefix === 'fa' && config.styleDefault !== null) {
|
1674 | prefix = getDefaultUsablePrefix();
|
1675 | }
|
1676 |
|
1677 | return new Promise(function (resolve, reject) {
|
1678 | var val = {
|
1679 | found: false,
|
1680 | width: 512,
|
1681 | height: 512,
|
1682 | icon: callProvided('missingIconAbstract') || {}
|
1683 | };
|
1684 |
|
1685 | if (givenPrefix === 'fa') {
|
1686 | var shim = byOldName(iconName) || {};
|
1687 | iconName = shim.iconName || iconName;
|
1688 | prefix = shim.prefix || prefix;
|
1689 | }
|
1690 |
|
1691 | if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {
|
1692 | var icon = styles$1[prefix][iconName];
|
1693 | return resolve(asFoundIcon(icon));
|
1694 | }
|
1695 |
|
1696 | maybeNotifyMissing(iconName, prefix);
|
1697 | resolve(_objectSpread2(_objectSpread2({}, missingIconResolutionMixin), {}, {
|
1698 | icon: config.showMissingIcons && iconName ? callProvided('missingIconAbstract') || {} : {}
|
1699 | }));
|
1700 | });
|
1701 | }
|
1702 |
|
1703 | var noop$1 = function noop() {};
|
1704 |
|
1705 | var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
|
1706 | mark: noop$1,
|
1707 | measure: noop$1
|
1708 | };
|
1709 | var preamble = "FA \"6.2.1\"";
|
1710 |
|
1711 | var begin = function begin(name) {
|
1712 | p.mark("".concat(preamble, " ").concat(name, " begins"));
|
1713 | return function () {
|
1714 | return end(name);
|
1715 | };
|
1716 | };
|
1717 |
|
1718 | var end = function end(name) {
|
1719 | p.mark("".concat(preamble, " ").concat(name, " ends"));
|
1720 | p.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
|
1721 | };
|
1722 |
|
1723 | var perf = {
|
1724 | begin: begin,
|
1725 | end: end
|
1726 | };
|
1727 |
|
1728 | var noop$2 = function noop() {};
|
1729 |
|
1730 | function isWatched(node) {
|
1731 | var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
|
1732 | return typeof i2svg === 'string';
|
1733 | }
|
1734 |
|
1735 | function hasPrefixAndIcon(node) {
|
1736 | var prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;
|
1737 | var icon = node.getAttribute ? node.getAttribute(DATA_ICON) : null;
|
1738 | return prefix && icon;
|
1739 | }
|
1740 |
|
1741 | function hasBeenReplaced(node) {
|
1742 | return node && node.classList && node.classList.contains && node.classList.contains(config.replacementClass);
|
1743 | }
|
1744 |
|
1745 | function getMutator() {
|
1746 | if (config.autoReplaceSvg === true) {
|
1747 | return mutators.replace;
|
1748 | }
|
1749 |
|
1750 | var mutator = mutators[config.autoReplaceSvg];
|
1751 | return mutator || mutators.replace;
|
1752 | }
|
1753 |
|
1754 | function createElementNS(tag) {
|
1755 | return DOCUMENT.createElementNS('http://www.w3.org/2000/svg', tag);
|
1756 | }
|
1757 |
|
1758 | function createElement(tag) {
|
1759 | return DOCUMENT.createElement(tag);
|
1760 | }
|
1761 |
|
1762 | function convertSVG(abstractObj) {
|
1763 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1764 | var _params$ceFn = params.ceFn,
|
1765 | ceFn = _params$ceFn === void 0 ? abstractObj.tag === 'svg' ? createElementNS : createElement : _params$ceFn;
|
1766 |
|
1767 | if (typeof abstractObj === 'string') {
|
1768 | return DOCUMENT.createTextNode(abstractObj);
|
1769 | }
|
1770 |
|
1771 | var tag = ceFn(abstractObj.tag);
|
1772 | Object.keys(abstractObj.attributes || []).forEach(function (key) {
|
1773 | tag.setAttribute(key, abstractObj.attributes[key]);
|
1774 | });
|
1775 | var children = abstractObj.children || [];
|
1776 | children.forEach(function (child) {
|
1777 | tag.appendChild(convertSVG(child, {
|
1778 | ceFn: ceFn
|
1779 | }));
|
1780 | });
|
1781 | return tag;
|
1782 | }
|
1783 |
|
1784 | function nodeAsComment(node) {
|
1785 | var comment = " ".concat(node.outerHTML, " ");
|
1786 |
|
1787 |
|
1788 | comment = "".concat(comment, "Font Awesome fontawesome.com ");
|
1789 |
|
1790 |
|
1791 | return comment;
|
1792 | }
|
1793 |
|
1794 | var mutators = {
|
1795 | replace: function replace(mutation) {
|
1796 | var node = mutation[0];
|
1797 |
|
1798 | if (node.parentNode) {
|
1799 | mutation[1].forEach(function (abstract) {
|
1800 | node.parentNode.insertBefore(convertSVG(abstract), node);
|
1801 | });
|
1802 |
|
1803 | if (node.getAttribute(DATA_FA_I2SVG) === null && config.keepOriginalSource) {
|
1804 | var comment = DOCUMENT.createComment(nodeAsComment(node));
|
1805 | node.parentNode.replaceChild(comment, node);
|
1806 | } else {
|
1807 | node.remove();
|
1808 | }
|
1809 | }
|
1810 | },
|
1811 | nest: function nest(mutation) {
|
1812 | var node = mutation[0];
|
1813 | var abstract = mutation[1];
|
1814 |
|
1815 |
|
1816 | if (~classArray(node).indexOf(config.replacementClass)) {
|
1817 | return mutators.replace(mutation);
|
1818 | }
|
1819 |
|
1820 | var forSvg = new RegExp("".concat(config.cssPrefix, "-.*"));
|
1821 | delete abstract[0].attributes.id;
|
1822 |
|
1823 | if (abstract[0].attributes.class) {
|
1824 | var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {
|
1825 | if (cls === config.replacementClass || cls.match(forSvg)) {
|
1826 | acc.toSvg.push(cls);
|
1827 | } else {
|
1828 | acc.toNode.push(cls);
|
1829 | }
|
1830 |
|
1831 | return acc;
|
1832 | }, {
|
1833 | toNode: [],
|
1834 | toSvg: []
|
1835 | });
|
1836 | abstract[0].attributes.class = splitClasses.toSvg.join(' ');
|
1837 |
|
1838 | if (splitClasses.toNode.length === 0) {
|
1839 | node.removeAttribute('class');
|
1840 | } else {
|
1841 | node.setAttribute('class', splitClasses.toNode.join(' '));
|
1842 | }
|
1843 | }
|
1844 |
|
1845 | var newInnerHTML = abstract.map(function (a) {
|
1846 | return toHtml(a);
|
1847 | }).join('\n');
|
1848 | node.setAttribute(DATA_FA_I2SVG, '');
|
1849 | node.innerHTML = newInnerHTML;
|
1850 | }
|
1851 | };
|
1852 |
|
1853 | function performOperationSync(op) {
|
1854 | op();
|
1855 | }
|
1856 |
|
1857 | function perform(mutations, callback) {
|
1858 | var callbackFunction = typeof callback === 'function' ? callback : noop$2;
|
1859 |
|
1860 | if (mutations.length === 0) {
|
1861 | callbackFunction();
|
1862 | } else {
|
1863 | var frame = performOperationSync;
|
1864 |
|
1865 | if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {
|
1866 | frame = WINDOW.requestAnimationFrame || performOperationSync;
|
1867 | }
|
1868 |
|
1869 | frame(function () {
|
1870 | var mutator = getMutator();
|
1871 | var mark = perf.begin('mutate');
|
1872 | mutations.map(mutator);
|
1873 | mark();
|
1874 | callbackFunction();
|
1875 | });
|
1876 | }
|
1877 | }
|
1878 | var disabled = false;
|
1879 | function disableObservation() {
|
1880 | disabled = true;
|
1881 | }
|
1882 | function enableObservation() {
|
1883 | disabled = false;
|
1884 | }
|
1885 | var mo = null;
|
1886 | function observe(options) {
|
1887 | if (!MUTATION_OBSERVER) {
|
1888 | return;
|
1889 | }
|
1890 |
|
1891 | if (!config.observeMutations) {
|
1892 | return;
|
1893 | }
|
1894 |
|
1895 | var _options$treeCallback = options.treeCallback,
|
1896 | treeCallback = _options$treeCallback === void 0 ? noop$2 : _options$treeCallback,
|
1897 | _options$nodeCallback = options.nodeCallback,
|
1898 | nodeCallback = _options$nodeCallback === void 0 ? noop$2 : _options$nodeCallback,
|
1899 | _options$pseudoElemen = options.pseudoElementsCallback,
|
1900 | pseudoElementsCallback = _options$pseudoElemen === void 0 ? noop$2 : _options$pseudoElemen,
|
1901 | _options$observeMutat = options.observeMutationsRoot,
|
1902 | observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;
|
1903 | mo = new MUTATION_OBSERVER(function (objects) {
|
1904 | if (disabled) return;
|
1905 | var defaultPrefix = getDefaultUsablePrefix();
|
1906 | toArray(objects).forEach(function (mutationRecord) {
|
1907 | if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
|
1908 | if (config.searchPseudoElements) {
|
1909 | pseudoElementsCallback(mutationRecord.target);
|
1910 | }
|
1911 |
|
1912 | treeCallback(mutationRecord.target);
|
1913 | }
|
1914 |
|
1915 | if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
|
1916 | pseudoElementsCallback(mutationRecord.target.parentNode);
|
1917 | }
|
1918 |
|
1919 | if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
|
1920 | if (mutationRecord.attributeName === 'class' && hasPrefixAndIcon(mutationRecord.target)) {
|
1921 | var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),
|
1922 | prefix = _getCanonicalIcon.prefix,
|
1923 | iconName = _getCanonicalIcon.iconName;
|
1924 |
|
1925 | mutationRecord.target.setAttribute(DATA_PREFIX, prefix || defaultPrefix);
|
1926 | if (iconName) mutationRecord.target.setAttribute(DATA_ICON, iconName);
|
1927 | } else if (hasBeenReplaced(mutationRecord.target)) {
|
1928 | nodeCallback(mutationRecord.target);
|
1929 | }
|
1930 | }
|
1931 | });
|
1932 | });
|
1933 | if (!IS_DOM) return;
|
1934 | mo.observe(observeMutationsRoot, {
|
1935 | childList: true,
|
1936 | attributes: true,
|
1937 | characterData: true,
|
1938 | subtree: true
|
1939 | });
|
1940 | }
|
1941 | function disconnect() {
|
1942 | if (!mo) return;
|
1943 | mo.disconnect();
|
1944 | }
|
1945 |
|
1946 | function styleParser (node) {
|
1947 | var style = node.getAttribute('style');
|
1948 | var val = [];
|
1949 |
|
1950 | if (style) {
|
1951 | val = style.split(';').reduce(function (acc, style) {
|
1952 | var styles = style.split(':');
|
1953 | var prop = styles[0];
|
1954 | var value = styles.slice(1);
|
1955 |
|
1956 | if (prop && value.length > 0) {
|
1957 | acc[prop] = value.join(':').trim();
|
1958 | }
|
1959 |
|
1960 | return acc;
|
1961 | }, {});
|
1962 | }
|
1963 |
|
1964 | return val;
|
1965 | }
|
1966 |
|
1967 | function classParser (node) {
|
1968 | var existingPrefix = node.getAttribute('data-prefix');
|
1969 | var existingIconName = node.getAttribute('data-icon');
|
1970 | var innerText = node.innerText !== undefined ? node.innerText.trim() : '';
|
1971 | var val = getCanonicalIcon(classArray(node));
|
1972 |
|
1973 | if (!val.prefix) {
|
1974 | val.prefix = getDefaultUsablePrefix();
|
1975 | }
|
1976 |
|
1977 | if (existingPrefix && existingIconName) {
|
1978 | val.prefix = existingPrefix;
|
1979 | val.iconName = existingIconName;
|
1980 | }
|
1981 |
|
1982 | if (val.iconName && val.prefix) {
|
1983 | return val;
|
1984 | }
|
1985 |
|
1986 | if (val.prefix && innerText.length > 0) {
|
1987 | val.iconName = byLigature(val.prefix, node.innerText) || byUnicode(val.prefix, toHex(node.innerText));
|
1988 | }
|
1989 |
|
1990 | if (!val.iconName && config.autoFetchSvg && node.firstChild && node.firstChild.nodeType === Node.TEXT_NODE) {
|
1991 | val.iconName = node.firstChild.data;
|
1992 | }
|
1993 |
|
1994 | return val;
|
1995 | }
|
1996 |
|
1997 | function attributesParser (node) {
|
1998 | var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {
|
1999 | if (acc.name !== 'class' && acc.name !== 'style') {
|
2000 | acc[attr.name] = attr.value;
|
2001 | }
|
2002 |
|
2003 | return acc;
|
2004 | }, {});
|
2005 | var title = node.getAttribute('title');
|
2006 | var titleId = node.getAttribute('data-fa-title-id');
|
2007 |
|
2008 | if (config.autoA11y) {
|
2009 | if (title) {
|
2010 | extraAttributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
|
2011 | } else {
|
2012 | extraAttributes['aria-hidden'] = 'true';
|
2013 | extraAttributes['focusable'] = 'false';
|
2014 | }
|
2015 | }
|
2016 |
|
2017 | return extraAttributes;
|
2018 | }
|
2019 |
|
2020 | function blankMeta() {
|
2021 | return {
|
2022 | iconName: null,
|
2023 | title: null,
|
2024 | titleId: null,
|
2025 | prefix: null,
|
2026 | transform: meaninglessTransform,
|
2027 | symbol: false,
|
2028 | mask: {
|
2029 | iconName: null,
|
2030 | prefix: null,
|
2031 | rest: []
|
2032 | },
|
2033 | maskId: null,
|
2034 | extra: {
|
2035 | classes: [],
|
2036 | styles: {},
|
2037 | attributes: {}
|
2038 | }
|
2039 | };
|
2040 | }
|
2041 | function parseMeta(node) {
|
2042 | var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
2043 | styleParser: true
|
2044 | };
|
2045 |
|
2046 | var _classParser = classParser(node),
|
2047 | iconName = _classParser.iconName,
|
2048 | prefix = _classParser.prefix,
|
2049 | extraClasses = _classParser.rest;
|
2050 |
|
2051 | var extraAttributes = attributesParser(node);
|
2052 | var pluginMeta = chainHooks('parseNodeAttributes', {}, node);
|
2053 | var extraStyles = parser.styleParser ? styleParser(node) : [];
|
2054 | return _objectSpread2({
|
2055 | iconName: iconName,
|
2056 | title: node.getAttribute('title'),
|
2057 | titleId: node.getAttribute('data-fa-title-id'),
|
2058 | prefix: prefix,
|
2059 | transform: meaninglessTransform,
|
2060 | mask: {
|
2061 | iconName: null,
|
2062 | prefix: null,
|
2063 | rest: []
|
2064 | },
|
2065 | maskId: null,
|
2066 | symbol: false,
|
2067 | extra: {
|
2068 | classes: extraClasses,
|
2069 | styles: extraStyles,
|
2070 | attributes: extraAttributes
|
2071 | }
|
2072 | }, pluginMeta);
|
2073 | }
|
2074 |
|
2075 | var styles$2 = namespace.styles;
|
2076 |
|
2077 | function generateMutation(node) {
|
2078 | var nodeMeta = config.autoReplaceSvg === 'nest' ? parseMeta(node, {
|
2079 | styleParser: false
|
2080 | }) : parseMeta(node);
|
2081 |
|
2082 | if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
|
2083 | return callProvided('generateLayersText', node, nodeMeta);
|
2084 | } else {
|
2085 | return callProvided('generateSvgReplacementMutation', node, nodeMeta);
|
2086 | }
|
2087 | }
|
2088 |
|
2089 | var knownPrefixes = new Set();
|
2090 | FAMILIES.map(function (family) {
|
2091 | knownPrefixes.add("fa-".concat(family));
|
2092 | });
|
2093 | Object.keys(PREFIX_TO_STYLE[FAMILY_CLASSIC]).map(knownPrefixes.add.bind(knownPrefixes));
|
2094 | Object.keys(PREFIX_TO_STYLE[FAMILY_SHARP]).map(knownPrefixes.add.bind(knownPrefixes));
|
2095 | knownPrefixes = _toConsumableArray(knownPrefixes);
|
2096 |
|
2097 | function onTree(root) {
|
2098 | var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
2099 | if (!IS_DOM) return Promise.resolve();
|
2100 | var htmlClassList = DOCUMENT.documentElement.classList;
|
2101 |
|
2102 | var hclAdd = function hclAdd(suffix) {
|
2103 | return htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
|
2104 | };
|
2105 |
|
2106 | var hclRemove = function hclRemove(suffix) {
|
2107 | return htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
|
2108 | };
|
2109 |
|
2110 | var prefixes = config.autoFetchSvg ? knownPrefixes : FAMILIES.map(function (f) {
|
2111 | return "fa-".concat(f);
|
2112 | }).concat(Object.keys(styles$2));
|
2113 |
|
2114 | if (!prefixes.includes('fa')) {
|
2115 | prefixes.push('fa');
|
2116 | }
|
2117 |
|
2118 | var prefixesDomQuery = [".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])")].concat(prefixes.map(function (p) {
|
2119 | return ".".concat(p, ":not([").concat(DATA_FA_I2SVG, "])");
|
2120 | })).join(', ');
|
2121 |
|
2122 | if (prefixesDomQuery.length === 0) {
|
2123 | return Promise.resolve();
|
2124 | }
|
2125 |
|
2126 | var candidates = [];
|
2127 |
|
2128 | try {
|
2129 | candidates = toArray(root.querySelectorAll(prefixesDomQuery));
|
2130 | } catch (e) {
|
2131 | }
|
2132 |
|
2133 | if (candidates.length > 0) {
|
2134 | hclAdd('pending');
|
2135 | hclRemove('complete');
|
2136 | } else {
|
2137 | return Promise.resolve();
|
2138 | }
|
2139 |
|
2140 | var mark = perf.begin('onTree');
|
2141 | var mutations = candidates.reduce(function (acc, node) {
|
2142 | try {
|
2143 | var mutation = generateMutation(node);
|
2144 |
|
2145 | if (mutation) {
|
2146 | acc.push(mutation);
|
2147 | }
|
2148 | } catch (e) {
|
2149 | if (!PRODUCTION) {
|
2150 | if (e.name === 'MissingIcon') {
|
2151 | console.error(e);
|
2152 | }
|
2153 | }
|
2154 | }
|
2155 |
|
2156 | return acc;
|
2157 | }, []);
|
2158 | return new Promise(function (resolve, reject) {
|
2159 | Promise.all(mutations).then(function (resolvedMutations) {
|
2160 | perform(resolvedMutations, function () {
|
2161 | hclAdd('active');
|
2162 | hclAdd('complete');
|
2163 | hclRemove('pending');
|
2164 | if (typeof callback === 'function') callback();
|
2165 | mark();
|
2166 | resolve();
|
2167 | });
|
2168 | }).catch(function (e) {
|
2169 | mark();
|
2170 | reject(e);
|
2171 | });
|
2172 | });
|
2173 | }
|
2174 |
|
2175 | function onNode(node) {
|
2176 | var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
2177 | generateMutation(node).then(function (mutation) {
|
2178 | if (mutation) {
|
2179 | perform([mutation], callback);
|
2180 | }
|
2181 | });
|
2182 | }
|
2183 |
|
2184 | function resolveIcons(next) {
|
2185 | return function (maybeIconDefinition) {
|
2186 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2187 | var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
|
2188 | var mask = params.mask;
|
2189 |
|
2190 | if (mask) {
|
2191 | mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
|
2192 | }
|
2193 |
|
2194 | return next(iconDefinition, _objectSpread2(_objectSpread2({}, params), {}, {
|
2195 | mask: mask
|
2196 | }));
|
2197 | };
|
2198 | }
|
2199 |
|
2200 | var render = function render(iconDefinition) {
|
2201 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2202 | var _params$transform = params.transform,
|
2203 | transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
|
2204 | _params$symbol = params.symbol,
|
2205 | symbol = _params$symbol === void 0 ? false : _params$symbol,
|
2206 | _params$mask = params.mask,
|
2207 | mask = _params$mask === void 0 ? null : _params$mask,
|
2208 | _params$maskId = params.maskId,
|
2209 | maskId = _params$maskId === void 0 ? null : _params$maskId,
|
2210 | _params$title = params.title,
|
2211 | title = _params$title === void 0 ? null : _params$title,
|
2212 | _params$titleId = params.titleId,
|
2213 | titleId = _params$titleId === void 0 ? null : _params$titleId,
|
2214 | _params$classes = params.classes,
|
2215 | classes = _params$classes === void 0 ? [] : _params$classes,
|
2216 | _params$attributes = params.attributes,
|
2217 | attributes = _params$attributes === void 0 ? {} : _params$attributes,
|
2218 | _params$styles = params.styles,
|
2219 | styles = _params$styles === void 0 ? {} : _params$styles;
|
2220 | if (!iconDefinition) return;
|
2221 | var prefix = iconDefinition.prefix,
|
2222 | iconName = iconDefinition.iconName,
|
2223 | icon = iconDefinition.icon;
|
2224 | return domVariants(_objectSpread2({
|
2225 | type: 'icon'
|
2226 | }, iconDefinition), function () {
|
2227 | callHooks('beforeDOMElementCreation', {
|
2228 | iconDefinition: iconDefinition,
|
2229 | params: params
|
2230 | });
|
2231 |
|
2232 | if (config.autoA11y) {
|
2233 | if (title) {
|
2234 | attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
|
2235 | } else {
|
2236 | attributes['aria-hidden'] = 'true';
|
2237 | attributes['focusable'] = 'false';
|
2238 | }
|
2239 | }
|
2240 |
|
2241 | return makeInlineSvgAbstract({
|
2242 | icons: {
|
2243 | main: asFoundIcon(icon),
|
2244 | mask: mask ? asFoundIcon(mask.icon) : {
|
2245 | found: false,
|
2246 | width: null,
|
2247 | height: null,
|
2248 | icon: {}
|
2249 | }
|
2250 | },
|
2251 | prefix: prefix,
|
2252 | iconName: iconName,
|
2253 | transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
|
2254 | symbol: symbol,
|
2255 | title: title,
|
2256 | maskId: maskId,
|
2257 | titleId: titleId,
|
2258 | extra: {
|
2259 | attributes: attributes,
|
2260 | styles: styles,
|
2261 | classes: classes
|
2262 | }
|
2263 | });
|
2264 | });
|
2265 | };
|
2266 | var ReplaceElements = {
|
2267 | mixout: function mixout() {
|
2268 | return {
|
2269 | icon: resolveIcons(render)
|
2270 | };
|
2271 | },
|
2272 | hooks: function hooks() {
|
2273 | return {
|
2274 | mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
|
2275 | accumulator.treeCallback = onTree;
|
2276 | accumulator.nodeCallback = onNode;
|
2277 | return accumulator;
|
2278 | }
|
2279 | };
|
2280 | },
|
2281 | provides: function provides(providers$$1) {
|
2282 | providers$$1.i2svg = function (params) {
|
2283 | var _params$node = params.node,
|
2284 | node = _params$node === void 0 ? DOCUMENT : _params$node,
|
2285 | _params$callback = params.callback,
|
2286 | callback = _params$callback === void 0 ? function () {} : _params$callback;
|
2287 | return onTree(node, callback);
|
2288 | };
|
2289 |
|
2290 | providers$$1.generateSvgReplacementMutation = function (node, nodeMeta) {
|
2291 | var iconName = nodeMeta.iconName,
|
2292 | title = nodeMeta.title,
|
2293 | titleId = nodeMeta.titleId,
|
2294 | prefix = nodeMeta.prefix,
|
2295 | transform = nodeMeta.transform,
|
2296 | symbol = nodeMeta.symbol,
|
2297 | mask = nodeMeta.mask,
|
2298 | maskId = nodeMeta.maskId,
|
2299 | extra = nodeMeta.extra;
|
2300 | return new Promise(function (resolve, reject) {
|
2301 | Promise.all([findIcon(iconName, prefix), mask.iconName ? findIcon(mask.iconName, mask.prefix) : Promise.resolve({
|
2302 | found: false,
|
2303 | width: 512,
|
2304 | height: 512,
|
2305 | icon: {}
|
2306 | })]).then(function (_ref) {
|
2307 | var _ref2 = _slicedToArray(_ref, 2),
|
2308 | main = _ref2[0],
|
2309 | mask = _ref2[1];
|
2310 |
|
2311 | resolve([node, makeInlineSvgAbstract({
|
2312 | icons: {
|
2313 | main: main,
|
2314 | mask: mask
|
2315 | },
|
2316 | prefix: prefix,
|
2317 | iconName: iconName,
|
2318 | transform: transform,
|
2319 | symbol: symbol,
|
2320 | maskId: maskId,
|
2321 | title: title,
|
2322 | titleId: titleId,
|
2323 | extra: extra,
|
2324 | watchable: true
|
2325 | })]);
|
2326 | }).catch(reject);
|
2327 | });
|
2328 | };
|
2329 |
|
2330 | providers$$1.generateAbstractIcon = function (_ref3) {
|
2331 | var children = _ref3.children,
|
2332 | attributes = _ref3.attributes,
|
2333 | main = _ref3.main,
|
2334 | transform = _ref3.transform,
|
2335 | styles = _ref3.styles;
|
2336 | var styleString = joinStyles(styles);
|
2337 |
|
2338 | if (styleString.length > 0) {
|
2339 | attributes['style'] = styleString;
|
2340 | }
|
2341 |
|
2342 | var nextChild;
|
2343 |
|
2344 | if (transformIsMeaningful(transform)) {
|
2345 | nextChild = callProvided('generateAbstractTransformGrouping', {
|
2346 | main: main,
|
2347 | transform: transform,
|
2348 | containerWidth: main.width,
|
2349 | iconWidth: main.width
|
2350 | });
|
2351 | }
|
2352 |
|
2353 | children.push(nextChild || main.icon);
|
2354 | return {
|
2355 | children: children,
|
2356 | attributes: attributes
|
2357 | };
|
2358 | };
|
2359 | }
|
2360 | };
|
2361 |
|
2362 | var Layers = {
|
2363 | mixout: function mixout() {
|
2364 | return {
|
2365 | layer: function layer(assembler) {
|
2366 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2367 | var _params$classes = params.classes,
|
2368 | classes = _params$classes === void 0 ? [] : _params$classes;
|
2369 | return domVariants({
|
2370 | type: 'layer'
|
2371 | }, function () {
|
2372 | callHooks('beforeDOMElementCreation', {
|
2373 | assembler: assembler,
|
2374 | params: params
|
2375 | });
|
2376 | var children = [];
|
2377 | assembler(function (args) {
|
2378 | Array.isArray(args) ? args.map(function (a) {
|
2379 | children = children.concat(a.abstract);
|
2380 | }) : children = children.concat(args.abstract);
|
2381 | });
|
2382 | return [{
|
2383 | tag: 'span',
|
2384 | attributes: {
|
2385 | class: ["".concat(config.cssPrefix, "-layers")].concat(_toConsumableArray(classes)).join(' ')
|
2386 | },
|
2387 | children: children
|
2388 | }];
|
2389 | });
|
2390 | }
|
2391 | };
|
2392 | }
|
2393 | };
|
2394 |
|
2395 | var LayersCounter = {
|
2396 | mixout: function mixout() {
|
2397 | return {
|
2398 | counter: function counter(content) {
|
2399 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2400 | var _params$title = params.title,
|
2401 | title = _params$title === void 0 ? null : _params$title,
|
2402 | _params$classes = params.classes,
|
2403 | classes = _params$classes === void 0 ? [] : _params$classes,
|
2404 | _params$attributes = params.attributes,
|
2405 | attributes = _params$attributes === void 0 ? {} : _params$attributes,
|
2406 | _params$styles = params.styles,
|
2407 | styles = _params$styles === void 0 ? {} : _params$styles;
|
2408 | return domVariants({
|
2409 | type: 'counter',
|
2410 | content: content
|
2411 | }, function () {
|
2412 | callHooks('beforeDOMElementCreation', {
|
2413 | content: content,
|
2414 | params: params
|
2415 | });
|
2416 | return makeLayersCounterAbstract({
|
2417 | content: content.toString(),
|
2418 | title: title,
|
2419 | extra: {
|
2420 | attributes: attributes,
|
2421 | styles: styles,
|
2422 | classes: ["".concat(config.cssPrefix, "-layers-counter")].concat(_toConsumableArray(classes))
|
2423 | }
|
2424 | });
|
2425 | });
|
2426 | }
|
2427 | };
|
2428 | }
|
2429 | };
|
2430 |
|
2431 | var LayersText = {
|
2432 | mixout: function mixout() {
|
2433 | return {
|
2434 | text: function text(content) {
|
2435 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2436 | var _params$transform = params.transform,
|
2437 | transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
|
2438 | _params$title = params.title,
|
2439 | title = _params$title === void 0 ? null : _params$title,
|
2440 | _params$classes = params.classes,
|
2441 | classes = _params$classes === void 0 ? [] : _params$classes,
|
2442 | _params$attributes = params.attributes,
|
2443 | attributes = _params$attributes === void 0 ? {} : _params$attributes,
|
2444 | _params$styles = params.styles,
|
2445 | styles = _params$styles === void 0 ? {} : _params$styles;
|
2446 | return domVariants({
|
2447 | type: 'text',
|
2448 | content: content
|
2449 | }, function () {
|
2450 | callHooks('beforeDOMElementCreation', {
|
2451 | content: content,
|
2452 | params: params
|
2453 | });
|
2454 | return makeLayersTextAbstract({
|
2455 | content: content,
|
2456 | transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
|
2457 | title: title,
|
2458 | extra: {
|
2459 | attributes: attributes,
|
2460 | styles: styles,
|
2461 | classes: ["".concat(config.cssPrefix, "-layers-text")].concat(_toConsumableArray(classes))
|
2462 | }
|
2463 | });
|
2464 | });
|
2465 | }
|
2466 | };
|
2467 | },
|
2468 | provides: function provides(providers$$1) {
|
2469 | providers$$1.generateLayersText = function (node, nodeMeta) {
|
2470 | var title = nodeMeta.title,
|
2471 | transform = nodeMeta.transform,
|
2472 | extra = nodeMeta.extra;
|
2473 | var width = null;
|
2474 | var height = null;
|
2475 |
|
2476 | if (IS_IE) {
|
2477 | var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
|
2478 | var boundingClientRect = node.getBoundingClientRect();
|
2479 | width = boundingClientRect.width / computedFontSize;
|
2480 | height = boundingClientRect.height / computedFontSize;
|
2481 | }
|
2482 |
|
2483 | if (config.autoA11y && !title) {
|
2484 | extra.attributes['aria-hidden'] = 'true';
|
2485 | }
|
2486 |
|
2487 | return Promise.resolve([node, makeLayersTextAbstract({
|
2488 | content: node.innerHTML,
|
2489 | width: width,
|
2490 | height: height,
|
2491 | transform: transform,
|
2492 | title: title,
|
2493 | extra: extra,
|
2494 | watchable: true
|
2495 | })]);
|
2496 | };
|
2497 | }
|
2498 | };
|
2499 |
|
2500 | var CLEAN_CONTENT_PATTERN = new RegExp("\"", 'ug');
|
2501 | var SECONDARY_UNICODE_RANGE = [1105920, 1112319];
|
2502 | function hexValueFromContent(content) {
|
2503 | var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
|
2504 | var codePoint = codePointAt(cleaned, 0);
|
2505 | var isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
|
2506 | var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
|
2507 | return {
|
2508 | value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
|
2509 | isSecondary: isPrependTen || isDoubled
|
2510 | };
|
2511 | }
|
2512 |
|
2513 | function replaceForPosition(node, position) {
|
2514 | var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
|
2515 | return new Promise(function (resolve, reject) {
|
2516 | if (node.getAttribute(pendingAttribute) !== null) {
|
2517 |
|
2518 | return resolve();
|
2519 | }
|
2520 |
|
2521 | var children = toArray(node.children);
|
2522 | var alreadyProcessedPseudoElement = children.filter(function (c) {
|
2523 | return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
|
2524 | })[0];
|
2525 | var styles = WINDOW.getComputedStyle(node, position);
|
2526 | var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
|
2527 | var fontWeight = styles.getPropertyValue('font-weight');
|
2528 | var content = styles.getPropertyValue('content');
|
2529 |
|
2530 | if (alreadyProcessedPseudoElement && !fontFamily) {
|
2531 |
|
2532 |
|
2533 |
|
2534 | node.removeChild(alreadyProcessedPseudoElement);
|
2535 | return resolve();
|
2536 | } else if (fontFamily && content !== 'none' && content !== '') {
|
2537 | var _content = styles.getPropertyValue('content');
|
2538 |
|
2539 | var family = ~['Sharp'].indexOf(fontFamily[2]) ? FAMILY_SHARP : FAMILY_CLASSIC;
|
2540 | var prefix = ~['Solid', 'Regular', 'Light', 'Thin', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[family][fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[family][fontWeight];
|
2541 |
|
2542 | var _hexValueFromContent = hexValueFromContent(_content),
|
2543 | hexValue = _hexValueFromContent.value,
|
2544 | isSecondary = _hexValueFromContent.isSecondary;
|
2545 |
|
2546 | var isV4 = fontFamily[0].startsWith('FontAwesome');
|
2547 | var iconName = byUnicode(prefix, hexValue);
|
2548 | var iconIdentifier = iconName;
|
2549 |
|
2550 | if (isV4) {
|
2551 | var iconName4 = byOldUnicode(hexValue);
|
2552 |
|
2553 | if (iconName4.iconName && iconName4.prefix) {
|
2554 | iconName = iconName4.iconName;
|
2555 | prefix = iconName4.prefix;
|
2556 | }
|
2557 | }
|
2558 |
|
2559 |
|
2560 |
|
2561 | if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
|
2562 | node.setAttribute(pendingAttribute, iconIdentifier);
|
2563 |
|
2564 | if (alreadyProcessedPseudoElement) {
|
2565 |
|
2566 | node.removeChild(alreadyProcessedPseudoElement);
|
2567 | }
|
2568 |
|
2569 | var meta = blankMeta();
|
2570 | var extra = meta.extra;
|
2571 | extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
|
2572 | findIcon(iconName, prefix).then(function (main) {
|
2573 | var abstract = makeInlineSvgAbstract(_objectSpread2(_objectSpread2({}, meta), {}, {
|
2574 | icons: {
|
2575 | main: main,
|
2576 | mask: emptyCanonicalIcon()
|
2577 | },
|
2578 | prefix: prefix,
|
2579 | iconName: iconIdentifier,
|
2580 | extra: extra,
|
2581 | watchable: true
|
2582 | }));
|
2583 | var element = DOCUMENT.createElement('svg');
|
2584 |
|
2585 | if (position === '::before') {
|
2586 | node.insertBefore(element, node.firstChild);
|
2587 | } else {
|
2588 | node.appendChild(element);
|
2589 | }
|
2590 |
|
2591 | element.outerHTML = abstract.map(function (a) {
|
2592 | return toHtml(a);
|
2593 | }).join('\n');
|
2594 | node.removeAttribute(pendingAttribute);
|
2595 | resolve();
|
2596 | }).catch(reject);
|
2597 | } else {
|
2598 | resolve();
|
2599 | }
|
2600 | } else {
|
2601 | resolve();
|
2602 | }
|
2603 | });
|
2604 | }
|
2605 |
|
2606 | function replace(node) {
|
2607 | return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
|
2608 | }
|
2609 |
|
2610 | function processable(node) {
|
2611 | 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');
|
2612 | }
|
2613 |
|
2614 | function searchPseudoElements(root) {
|
2615 | if (!IS_DOM) return;
|
2616 | return new Promise(function (resolve, reject) {
|
2617 | var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
|
2618 | var end = perf.begin('searchPseudoElements');
|
2619 | disableObservation();
|
2620 | Promise.all(operations).then(function () {
|
2621 | end();
|
2622 | enableObservation();
|
2623 | resolve();
|
2624 | }).catch(function () {
|
2625 | end();
|
2626 | enableObservation();
|
2627 | reject();
|
2628 | });
|
2629 | });
|
2630 | }
|
2631 |
|
2632 | var PseudoElements = {
|
2633 | hooks: function hooks() {
|
2634 | return {
|
2635 | mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
|
2636 | accumulator.pseudoElementsCallback = searchPseudoElements;
|
2637 | return accumulator;
|
2638 | }
|
2639 | };
|
2640 | },
|
2641 | provides: function provides(providers$$1) {
|
2642 | providers$$1.pseudoElements2svg = function (params) {
|
2643 | var _params$node = params.node,
|
2644 | node = _params$node === void 0 ? DOCUMENT : _params$node;
|
2645 |
|
2646 | if (config.searchPseudoElements) {
|
2647 | searchPseudoElements(node);
|
2648 | }
|
2649 | };
|
2650 | }
|
2651 | };
|
2652 |
|
2653 | var _unwatched = false;
|
2654 | var MutationObserver$1 = {
|
2655 | mixout: function mixout() {
|
2656 | return {
|
2657 | dom: {
|
2658 | unwatch: function unwatch() {
|
2659 | disableObservation();
|
2660 | _unwatched = true;
|
2661 | }
|
2662 | }
|
2663 | };
|
2664 | },
|
2665 | hooks: function hooks() {
|
2666 | return {
|
2667 | bootstrap: function bootstrap() {
|
2668 | observe(chainHooks('mutationObserverCallbacks', {}));
|
2669 | },
|
2670 | noAuto: function noAuto() {
|
2671 | disconnect();
|
2672 | },
|
2673 | watch: function watch(params) {
|
2674 | var observeMutationsRoot = params.observeMutationsRoot;
|
2675 |
|
2676 | if (_unwatched) {
|
2677 | enableObservation();
|
2678 | } else {
|
2679 | observe(chainHooks('mutationObserverCallbacks', {
|
2680 | observeMutationsRoot: observeMutationsRoot
|
2681 | }));
|
2682 | }
|
2683 | }
|
2684 | };
|
2685 | }
|
2686 | };
|
2687 |
|
2688 | var parseTransformString = function parseTransformString(transformString) {
|
2689 | var transform = {
|
2690 | size: 16,
|
2691 | x: 0,
|
2692 | y: 0,
|
2693 | flipX: false,
|
2694 | flipY: false,
|
2695 | rotate: 0
|
2696 | };
|
2697 | return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
|
2698 | var parts = n.toLowerCase().split('-');
|
2699 | var first = parts[0];
|
2700 | var rest = parts.slice(1).join('-');
|
2701 |
|
2702 | if (first && rest === 'h') {
|
2703 | acc.flipX = true;
|
2704 | return acc;
|
2705 | }
|
2706 |
|
2707 | if (first && rest === 'v') {
|
2708 | acc.flipY = true;
|
2709 | return acc;
|
2710 | }
|
2711 |
|
2712 | rest = parseFloat(rest);
|
2713 |
|
2714 | if (isNaN(rest)) {
|
2715 | return acc;
|
2716 | }
|
2717 |
|
2718 | switch (first) {
|
2719 | case 'grow':
|
2720 | acc.size = acc.size + rest;
|
2721 | break;
|
2722 |
|
2723 | case 'shrink':
|
2724 | acc.size = acc.size - rest;
|
2725 | break;
|
2726 |
|
2727 | case 'left':
|
2728 | acc.x = acc.x - rest;
|
2729 | break;
|
2730 |
|
2731 | case 'right':
|
2732 | acc.x = acc.x + rest;
|
2733 | break;
|
2734 |
|
2735 | case 'up':
|
2736 | acc.y = acc.y - rest;
|
2737 | break;
|
2738 |
|
2739 | case 'down':
|
2740 | acc.y = acc.y + rest;
|
2741 | break;
|
2742 |
|
2743 | case 'rotate':
|
2744 | acc.rotate = acc.rotate + rest;
|
2745 | break;
|
2746 | }
|
2747 |
|
2748 | return acc;
|
2749 | }, transform);
|
2750 | };
|
2751 | var PowerTransforms = {
|
2752 | mixout: function mixout() {
|
2753 | return {
|
2754 | parse: {
|
2755 | transform: function transform(transformString) {
|
2756 | return parseTransformString(transformString);
|
2757 | }
|
2758 | }
|
2759 | };
|
2760 | },
|
2761 | hooks: function hooks() {
|
2762 | return {
|
2763 | parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
|
2764 | var transformString = node.getAttribute('data-fa-transform');
|
2765 |
|
2766 | if (transformString) {
|
2767 | accumulator.transform = parseTransformString(transformString);
|
2768 | }
|
2769 |
|
2770 | return accumulator;
|
2771 | }
|
2772 | };
|
2773 | },
|
2774 | provides: function provides(providers) {
|
2775 | providers.generateAbstractTransformGrouping = function (_ref) {
|
2776 | var main = _ref.main,
|
2777 | transform = _ref.transform,
|
2778 | containerWidth = _ref.containerWidth,
|
2779 | iconWidth = _ref.iconWidth;
|
2780 | var outer = {
|
2781 | transform: "translate(".concat(containerWidth / 2, " 256)")
|
2782 | };
|
2783 | var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
|
2784 | var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
|
2785 | var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
|
2786 | var inner = {
|
2787 | transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
|
2788 | };
|
2789 | var path = {
|
2790 | transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
|
2791 | };
|
2792 | var operations = {
|
2793 | outer: outer,
|
2794 | inner: inner,
|
2795 | path: path
|
2796 | };
|
2797 | return {
|
2798 | tag: 'g',
|
2799 | attributes: _objectSpread2({}, operations.outer),
|
2800 | children: [{
|
2801 | tag: 'g',
|
2802 | attributes: _objectSpread2({}, operations.inner),
|
2803 | children: [{
|
2804 | tag: main.icon.tag,
|
2805 | children: main.icon.children,
|
2806 | attributes: _objectSpread2(_objectSpread2({}, main.icon.attributes), operations.path)
|
2807 | }]
|
2808 | }]
|
2809 | };
|
2810 | };
|
2811 | }
|
2812 | };
|
2813 |
|
2814 | var ALL_SPACE = {
|
2815 | x: 0,
|
2816 | y: 0,
|
2817 | width: '100%',
|
2818 | height: '100%'
|
2819 | };
|
2820 |
|
2821 | function fillBlack(abstract) {
|
2822 | var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
2823 |
|
2824 | if (abstract.attributes && (abstract.attributes.fill || force)) {
|
2825 | abstract.attributes.fill = 'black';
|
2826 | }
|
2827 |
|
2828 | return abstract;
|
2829 | }
|
2830 |
|
2831 | function deGroup(abstract) {
|
2832 | if (abstract.tag === 'g') {
|
2833 | return abstract.children;
|
2834 | } else {
|
2835 | return [abstract];
|
2836 | }
|
2837 | }
|
2838 |
|
2839 | var Masks = {
|
2840 | hooks: function hooks() {
|
2841 | return {
|
2842 | parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
|
2843 | var maskData = node.getAttribute('data-fa-mask');
|
2844 | var mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(function (i) {
|
2845 | return i.trim();
|
2846 | }));
|
2847 |
|
2848 | if (!mask.prefix) {
|
2849 | mask.prefix = getDefaultUsablePrefix();
|
2850 | }
|
2851 |
|
2852 | accumulator.mask = mask;
|
2853 | accumulator.maskId = node.getAttribute('data-fa-mask-id');
|
2854 | return accumulator;
|
2855 | }
|
2856 | };
|
2857 | },
|
2858 | provides: function provides(providers) {
|
2859 | providers.generateAbstractMask = function (_ref) {
|
2860 | var children = _ref.children,
|
2861 | attributes = _ref.attributes,
|
2862 | main = _ref.main,
|
2863 | mask = _ref.mask,
|
2864 | explicitMaskId = _ref.maskId,
|
2865 | transform = _ref.transform;
|
2866 | var mainWidth = main.width,
|
2867 | mainPath = main.icon;
|
2868 | var maskWidth = mask.width,
|
2869 | maskPath = mask.icon;
|
2870 | var trans = transformForSvg({
|
2871 | transform: transform,
|
2872 | containerWidth: maskWidth,
|
2873 | iconWidth: mainWidth
|
2874 | });
|
2875 | var maskRect = {
|
2876 | tag: 'rect',
|
2877 | attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
|
2878 | fill: 'white'
|
2879 | })
|
2880 | };
|
2881 | var maskInnerGroupChildrenMixin = mainPath.children ? {
|
2882 | children: mainPath.children.map(fillBlack)
|
2883 | } : {};
|
2884 | var maskInnerGroup = {
|
2885 | tag: 'g',
|
2886 | attributes: _objectSpread2({}, trans.inner),
|
2887 | children: [fillBlack(_objectSpread2({
|
2888 | tag: mainPath.tag,
|
2889 | attributes: _objectSpread2(_objectSpread2({}, mainPath.attributes), trans.path)
|
2890 | }, maskInnerGroupChildrenMixin))]
|
2891 | };
|
2892 | var maskOuterGroup = {
|
2893 | tag: 'g',
|
2894 | attributes: _objectSpread2({}, trans.outer),
|
2895 | children: [maskInnerGroup]
|
2896 | };
|
2897 | var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
|
2898 | var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
|
2899 | var maskTag = {
|
2900 | tag: 'mask',
|
2901 | attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
|
2902 | id: maskId,
|
2903 | maskUnits: 'userSpaceOnUse',
|
2904 | maskContentUnits: 'userSpaceOnUse'
|
2905 | }),
|
2906 | children: [maskRect, maskOuterGroup]
|
2907 | };
|
2908 | var defs = {
|
2909 | tag: 'defs',
|
2910 | children: [{
|
2911 | tag: 'clipPath',
|
2912 | attributes: {
|
2913 | id: clipId
|
2914 | },
|
2915 | children: deGroup(maskPath)
|
2916 | }, maskTag]
|
2917 | };
|
2918 | children.push(defs, {
|
2919 | tag: 'rect',
|
2920 | attributes: _objectSpread2({
|
2921 | fill: 'currentColor',
|
2922 | 'clip-path': "url(#".concat(clipId, ")"),
|
2923 | mask: "url(#".concat(maskId, ")")
|
2924 | }, ALL_SPACE)
|
2925 | });
|
2926 | return {
|
2927 | children: children,
|
2928 | attributes: attributes
|
2929 | };
|
2930 | };
|
2931 | }
|
2932 | };
|
2933 |
|
2934 | var MissingIconIndicator = {
|
2935 | provides: function provides(providers) {
|
2936 | var reduceMotion = false;
|
2937 |
|
2938 | if (WINDOW.matchMedia) {
|
2939 | reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
2940 | }
|
2941 |
|
2942 | providers.missingIconAbstract = function () {
|
2943 | var gChildren = [];
|
2944 | var FILL = {
|
2945 | fill: 'currentColor'
|
2946 | };
|
2947 | var ANIMATION_BASE = {
|
2948 | attributeType: 'XML',
|
2949 | repeatCount: 'indefinite',
|
2950 | dur: '2s'
|
2951 | };
|
2952 |
|
2953 | gChildren.push({
|
2954 | tag: 'path',
|
2955 | attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
|
2956 | 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'
|
2957 | })
|
2958 | });
|
2959 |
|
2960 | var OPACITY_ANIMATE = _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
|
2961 | attributeName: 'opacity'
|
2962 | });
|
2963 |
|
2964 | var dot = {
|
2965 | tag: 'circle',
|
2966 | attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
|
2967 | cx: '256',
|
2968 | cy: '364',
|
2969 | r: '28'
|
2970 | }),
|
2971 | children: []
|
2972 | };
|
2973 |
|
2974 | if (!reduceMotion) {
|
2975 | dot.children.push({
|
2976 | tag: 'animate',
|
2977 | attributes: _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
|
2978 | attributeName: 'r',
|
2979 | values: '28;14;28;28;14;28;'
|
2980 | })
|
2981 | }, {
|
2982 | tag: 'animate',
|
2983 | attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
|
2984 | values: '1;0;1;1;0;1;'
|
2985 | })
|
2986 | });
|
2987 | }
|
2988 |
|
2989 | gChildren.push(dot);
|
2990 | gChildren.push({
|
2991 | tag: 'path',
|
2992 | attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
|
2993 | opacity: '1',
|
2994 | 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'
|
2995 | }),
|
2996 | children: reduceMotion ? [] : [{
|
2997 | tag: 'animate',
|
2998 | attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
|
2999 | values: '1;0;0;0;0;1;'
|
3000 | })
|
3001 | }]
|
3002 | });
|
3003 |
|
3004 | if (!reduceMotion) {
|
3005 |
|
3006 | gChildren.push({
|
3007 | tag: 'path',
|
3008 | attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
|
3009 | opacity: '0',
|
3010 | 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'
|
3011 | }),
|
3012 | children: [{
|
3013 | tag: 'animate',
|
3014 | attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
|
3015 | values: '0;0;1;1;0;0;'
|
3016 | })
|
3017 | }]
|
3018 | });
|
3019 | }
|
3020 |
|
3021 | return {
|
3022 | tag: 'g',
|
3023 | attributes: {
|
3024 | 'class': 'missing'
|
3025 | },
|
3026 | children: gChildren
|
3027 | };
|
3028 | };
|
3029 | }
|
3030 | };
|
3031 |
|
3032 | var SvgSymbols = {
|
3033 | hooks: function hooks() {
|
3034 | return {
|
3035 | parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
|
3036 | var symbolData = node.getAttribute('data-fa-symbol');
|
3037 | var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
|
3038 | accumulator['symbol'] = symbol;
|
3039 | return accumulator;
|
3040 | }
|
3041 | };
|
3042 | }
|
3043 | };
|
3044 |
|
3045 | var plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];
|
3046 |
|
3047 | registerPlugins(plugins, {
|
3048 | mixoutsTo: api
|
3049 | });
|
3050 | var noAuto$1 = api.noAuto;
|
3051 | var config$1 = api.config;
|
3052 | var library$1 = api.library;
|
3053 | var dom$1 = api.dom;
|
3054 | var parse$1 = api.parse;
|
3055 | var findIconDefinition$1 = api.findIconDefinition;
|
3056 | var toHtml$1 = api.toHtml;
|
3057 | var icon = api.icon;
|
3058 | var layer = api.layer;
|
3059 | var text = api.text;
|
3060 | var counter = api.counter;
|
3061 |
|
3062 | export { noAuto$1 as noAuto, config$1 as config, library$1 as library, dom$1 as dom, parse$1 as parse, findIconDefinition$1 as findIconDefinition, toHtml$1 as toHtml, icon, layer, text, counter, api };
|