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