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