fontawesome.js 114 KB

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