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