conflict-detection.min.dev.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. "use strict";
  2. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3. /*!
  4. * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
  5. * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
  6. */
  7. var e, t;
  8. e = void 0, t = function t(e) {
  9. "use strict";
  10. function t(e) {
  11. return (t = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
  12. return _typeof(e);
  13. } : function (e) {
  14. return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
  15. })(e);
  16. }
  17. function a(r) {
  18. for (var e = 1; e < arguments.length; e++) {
  19. var i = null != arguments[e] ? arguments[e] : {},
  20. t = Object.keys(i);
  21. "function" == typeof Object.getOwnPropertySymbols && (t = t.concat(Object.getOwnPropertySymbols(i).filter(function (e) {
  22. return Object.getOwnPropertyDescriptor(i, e).enumerable;
  23. }))), t.forEach(function (e) {
  24. var t, n, o;
  25. t = r, o = i[n = e], n in t ? Object.defineProperty(t, n, {
  26. value: o,
  27. enumerable: !0,
  28. configurable: !0,
  29. writable: !0
  30. }) : t[n] = o;
  31. });
  32. }
  33. return r;
  34. }
  35. var n = {},
  36. o = {};
  37. try {
  38. "undefined" != typeof window && (n = window), "undefined" != typeof document && (o = document);
  39. } catch (e) {}
  40. var r = (n.navigator || {}).userAgent,
  41. i = void 0 === r ? "" : r,
  42. l = n,
  43. u = o,
  44. c = !!l.document,
  45. s = !!u.documentElement && !!u.head && "function" == typeof u.addEventListener && "function" == typeof u.createElement,
  46. f = (~i.indexOf("MSIE") || i.indexOf("Trident/"), []),
  47. d = !1;
  48. function m(e) {
  49. s && (d ? setTimeout(e, 0) : f.push(e));
  50. }
  51. s && ((d = (u.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(u.readyState)) || u.addEventListener("DOMContentLoaded", function e() {
  52. u.removeEventListener("DOMContentLoaded", e), d = 1, f.map(function (e) {
  53. return e();
  54. });
  55. }));
  56. var h = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
  57. var g,
  58. p = (function (c) {
  59. !function (e) {
  60. function u(e, t) {
  61. var n = (65535 & e) + (65535 & t);
  62. return (e >> 16) + (t >> 16) + (n >> 16) << 16 | 65535 & n;
  63. }
  64. function a(e, t, n, o, r, i) {
  65. return u((c = u(u(t, e), u(o, i))) << (a = r) | c >>> 32 - a, n);
  66. var c, a;
  67. }
  68. function d(e, t, n, o, r, i, c) {
  69. return a(t & n | ~t & o, e, t, r, i, c);
  70. }
  71. function m(e, t, n, o, r, i, c) {
  72. return a(t & o | n & ~o, e, t, r, i, c);
  73. }
  74. function h(e, t, n, o, r, i, c) {
  75. return a(t ^ n ^ o, e, t, r, i, c);
  76. }
  77. function g(e, t, n, o, r, i, c) {
  78. return a(n ^ (t | ~o), e, t, r, i, c);
  79. }
  80. function s(e, t) {
  81. var n, o, r, i, c;
  82. e[t >> 5] |= 128 << t % 32, e[14 + (t + 64 >>> 9 << 4)] = t;
  83. var a = 1732584193,
  84. s = -271733879,
  85. f = -1732584194,
  86. l = 271733878;
  87. for (n = 0; n < e.length; n += 16) {
  88. s = g(s = g(s = g(s = g(s = h(s = h(s = h(s = h(s = m(s = m(s = m(s = m(s = d(s = d(s = d(s = d(r = s, f = d(i = f, l = d(c = l, a = d(o = a, s, f, l, e[n], 7, -680876936), s, f, e[n + 1], 12, -389564586), a, s, e[n + 2], 17, 606105819), l, a, e[n + 3], 22, -1044525330), f = d(f, l = d(l, a = d(a, s, f, l, e[n + 4], 7, -176418897), s, f, e[n + 5], 12, 1200080426), a, s, e[n + 6], 17, -1473231341), l, a, e[n + 7], 22, -45705983), f = d(f, l = d(l, a = d(a, s, f, l, e[n + 8], 7, 1770035416), s, f, e[n + 9], 12, -1958414417), a, s, e[n + 10], 17, -42063), l, a, e[n + 11], 22, -1990404162), f = d(f, l = d(l, a = d(a, s, f, l, e[n + 12], 7, 1804603682), s, f, e[n + 13], 12, -40341101), a, s, e[n + 14], 17, -1502002290), l, a, e[n + 15], 22, 1236535329), f = m(f, l = m(l, a = m(a, s, f, l, e[n + 1], 5, -165796510), s, f, e[n + 6], 9, -1069501632), a, s, e[n + 11], 14, 643717713), l, a, e[n], 20, -373897302), f = m(f, l = m(l, a = m(a, s, f, l, e[n + 5], 5, -701558691), s, f, e[n + 10], 9, 38016083), a, s, e[n + 15], 14, -660478335), l, a, e[n + 4], 20, -405537848), f = m(f, l = m(l, a = m(a, s, f, l, e[n + 9], 5, 568446438), s, f, e[n + 14], 9, -1019803690), a, s, e[n + 3], 14, -187363961), l, a, e[n + 8], 20, 1163531501), f = m(f, l = m(l, a = m(a, s, f, l, e[n + 13], 5, -1444681467), s, f, e[n + 2], 9, -51403784), a, s, e[n + 7], 14, 1735328473), l, a, e[n + 12], 20, -1926607734), f = h(f, l = h(l, a = h(a, s, f, l, e[n + 5], 4, -378558), s, f, e[n + 8], 11, -2022574463), a, s, e[n + 11], 16, 1839030562), l, a, e[n + 14], 23, -35309556), f = h(f, l = h(l, a = h(a, s, f, l, e[n + 1], 4, -1530992060), s, f, e[n + 4], 11, 1272893353), a, s, e[n + 7], 16, -155497632), l, a, e[n + 10], 23, -1094730640), f = h(f, l = h(l, a = h(a, s, f, l, e[n + 13], 4, 681279174), s, f, e[n], 11, -358537222), a, s, e[n + 3], 16, -722521979), l, a, e[n + 6], 23, 76029189), f = h(f, l = h(l, a = h(a, s, f, l, e[n + 9], 4, -640364487), s, f, e[n + 12], 11, -421815835), a, s, e[n + 15], 16, 530742520), l, a, e[n + 2], 23, -995338651), f = g(f, l = g(l, a = g(a, s, f, l, e[n], 6, -198630844), s, f, e[n + 7], 10, 1126891415), a, s, e[n + 14], 15, -1416354905), l, a, e[n + 5], 21, -57434055), f = g(f, l = g(l, a = g(a, s, f, l, e[n + 12], 6, 1700485571), s, f, e[n + 3], 10, -1894986606), a, s, e[n + 10], 15, -1051523), l, a, e[n + 1], 21, -2054922799), f = g(f, l = g(l, a = g(a, s, f, l, e[n + 8], 6, 1873313359), s, f, e[n + 15], 10, -30611744), a, s, e[n + 6], 15, -1560198380), l, a, e[n + 13], 21, 1309151649), f = g(f, l = g(l, a = g(a, s, f, l, e[n + 4], 6, -145523070), s, f, e[n + 11], 10, -1120210379), a, s, e[n + 2], 15, 718787259), l, a, e[n + 9], 21, -343485551), a = u(a, o), s = u(s, r), f = u(f, i), l = u(l, c);
  89. }
  90. return [a, s, f, l];
  91. }
  92. function f(e) {
  93. var t,
  94. n = "",
  95. o = 32 * e.length;
  96. for (t = 0; t < o; t += 8) {
  97. n += String.fromCharCode(e[t >> 5] >>> t % 32 & 255);
  98. }
  99. return n;
  100. }
  101. function l(e) {
  102. var t,
  103. n = [];
  104. for (n[(e.length >> 2) - 1] = void 0, t = 0; t < n.length; t += 1) {
  105. n[t] = 0;
  106. }
  107. var o = 8 * e.length;
  108. for (t = 0; t < o; t += 8) {
  109. n[t >> 5] |= (255 & e.charCodeAt(t / 8)) << t % 32;
  110. }
  111. return n;
  112. }
  113. function o(e) {
  114. var t,
  115. n,
  116. o = "0123456789abcdef",
  117. r = "";
  118. for (n = 0; n < e.length; n += 1) {
  119. t = e.charCodeAt(n), r += o.charAt(t >>> 4 & 15) + o.charAt(15 & t);
  120. }
  121. return r;
  122. }
  123. function n(e) {
  124. return unescape(encodeURIComponent(e));
  125. }
  126. function r(e) {
  127. return f(s(l(t = n(e)), 8 * t.length));
  128. var t;
  129. }
  130. function i(e, t) {
  131. return function (e, t) {
  132. var n,
  133. o,
  134. r = l(e),
  135. i = [],
  136. c = [];
  137. for (i[15] = c[15] = void 0, 16 < r.length && (r = s(r, 8 * e.length)), n = 0; n < 16; n += 1) {
  138. i[n] = 909522486 ^ r[n], c[n] = 1549556828 ^ r[n];
  139. }
  140. return o = s(i.concat(l(t)), 512 + 8 * t.length), f(s(c.concat(o), 640));
  141. }(n(e), n(t));
  142. }
  143. function t(e, t, n) {
  144. return t ? n ? i(t, e) : o(i(t, e)) : n ? r(e) : o(r(e));
  145. }
  146. c.exports ? c.exports = t : e.md5 = t;
  147. }(h);
  148. }(g = {
  149. exports: {}
  150. }, g.exports), g.exports);
  151. function v(e) {
  152. if (null !== e && "object" === t(e)) return e.src ? p(e.src) : e.href ? p(e.href) : e.innerText && "" !== e.innerText ? p(e.innerText) : void 0;
  153. }
  154. var y = "fa-kits-diag",
  155. b = "fa-kits-node-under-test",
  156. w = "data-md5",
  157. x = "data-fa-detection-ignore",
  158. A = "data-fa-detection-timeout",
  159. T = "data-fa-detection-results-collection-max-wait";
  160. function D(e) {
  161. var t = e.fn,
  162. c = void 0 === t ? function () {
  163. return !0;
  164. } : t,
  165. n = e.initialDuration,
  166. o = void 0 === n ? 1 : n,
  167. r = e.maxDuration,
  168. a = void 0 === r ? l.FontAwesomeDetection.timeout : r,
  169. i = e.showProgress,
  170. s = void 0 !== i && i,
  171. f = e.progressIndicator;
  172. return new Promise(function (r, i) {
  173. !function n(e, o) {
  174. setTimeout(function () {
  175. var e = c();
  176. if (s && console.info(f), e) r(e);else {
  177. var t = 250 + o;
  178. t <= a ? n(250, t) : i("timeout");
  179. }
  180. }, e);
  181. }(o, 0);
  182. });
  183. }
  184. function E(e) {
  185. var t = e.nodesTested,
  186. n = e.nodesFound;
  187. l.FontAwesomeDetection = l.FontAwesomeDetection || {}, l.FontAwesomeDetection.nodesTested = t, l.FontAwesomeDetection.nodesFound = n, l.FontAwesomeDetection.detectionDone = !0;
  188. }
  189. function C() {
  190. var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : function () {},
  191. n = {
  192. conflict: {},
  193. noConflict: {}
  194. };
  195. l.onmessage = function (e) {
  196. "file://" !== l.location.origin && e.origin !== l.location.origin || e && e.data && ("fontawesome-conflict" === e.data.type ? n.conflict[e.data.md5] = e.data : "no-conflict" === e.data.type && (n.noConflict[e.data.md5] = e.data));
  197. };
  198. var e = function (t) {
  199. for (var c = Array.from(u.scripts).filter(function (e) {
  200. return !e.hasAttribute(x) && e !== t;
  201. }), a = {}, e = function e(_e) {
  202. var t = u.createElement("iframe");
  203. t.setAttribute("style", "display:none;");
  204. var n = u.createElement("script");
  205. n.setAttribute("id", b);
  206. var o = v(c[_e]);
  207. n.setAttribute(w, o), a[o] = c[_e], "" !== c[_e].src && (n.src = c[_e].src), "" !== c[_e].innerText && (n.innerText = c[_e].innerText), n.async = !0;
  208. var r = u.createElement("script");
  209. r.setAttribute("id", y);
  210. var i = "file://" === l.location.origin ? "*" : l.location.origin;
  211. r.innerText = "(".concat(function (n, o, r) {
  212. parent.FontAwesomeDetection.__pollUntil({
  213. fn: function fn() {
  214. return !!window.FontAwesomeConfig;
  215. }
  216. }).then(function () {
  217. var e = document.getElementById(n);
  218. parent.postMessage({
  219. type: "fontawesome-conflict",
  220. technology: "js",
  221. src: e.src,
  222. innerText: e.innerText,
  223. tagName: e.tagName,
  224. md5: o
  225. }, r);
  226. })["catch"](function (e) {
  227. var t = document.getElementById(n);
  228. "timeout" === e ? parent.postMessage({
  229. type: "no-conflict",
  230. src: t.src,
  231. innerText: t.innerText,
  232. tagName: t.tagName,
  233. md5: o
  234. }, r) : console.error(e);
  235. });
  236. }.toString(), ")('").concat(b, "', '").concat(o, "', '").concat(i, "');"), t.onload = function () {
  237. t.contentDocument.head.appendChild(r), t.contentDocument.head.appendChild(n);
  238. }, m(function () {
  239. return u.body.appendChild(t);
  240. });
  241. }, n = 0; n < c.length; n++) {
  242. e(n);
  243. }
  244. return a;
  245. }(u.currentScript),
  246. o = function () {
  247. var e = Array.from(u.getElementsByTagName("link")).filter(function (e) {
  248. return !e.hasAttribute(x);
  249. }),
  250. t = Array.from(u.getElementsByTagName("style")).filter(function (e) {
  251. return !(e.hasAttribute(x) || l.FontAwesomeConfig && e.innerText.match(new RegExp("svg:not\\(:root\\)\\.".concat(l.FontAwesomeConfig.replacementClass))));
  252. });
  253. function n(e, t) {
  254. var n = u.createElement("iframe");
  255. n.setAttribute("style", "visibility: hidden; position: absolute; height: 0; width: 0;");
  256. var o = "fa-test-icon-" + t,
  257. r = u.createElement("i");
  258. r.setAttribute("class", "fa fa-coffee"), r.setAttribute("id", o);
  259. var i = u.createElement("script");
  260. i.setAttribute("id", y);
  261. var c = "file://" === l.location.origin ? "*" : l.location.origin;
  262. i.innerText = "(".concat(function (n, o, r, i) {
  263. parent.FontAwesomeDetection.__pollUntil({
  264. fn: function fn() {
  265. var e = document.getElementById(o),
  266. t = window.getComputedStyle(e).getPropertyValue("font-family");
  267. return !(!t.match(/FontAwesome/) && !t.match(/Font Awesome 5/));
  268. }
  269. }).then(function () {
  270. var e = document.getElementById(n);
  271. parent.postMessage({
  272. type: "fontawesome-conflict",
  273. technology: "webfont",
  274. href: e.href,
  275. innerText: e.innerText,
  276. tagName: e.tagName,
  277. md5: r
  278. }, i);
  279. })["catch"](function (e) {
  280. var t = document.getElementById(n);
  281. "timeout" === e ? parent.postMessage({
  282. type: "no-conflict",
  283. technology: "webfont",
  284. href: t.src,
  285. innerText: t.innerText,
  286. tagName: t.tagName,
  287. md5: r
  288. }, i) : console.error(e);
  289. });
  290. }.toString(), ")('").concat(b, "', '").concat(o || "foo", "', '").concat(t, "', '").concat(c, "');"), n.onload = function () {
  291. n.contentDocument.head.appendChild(i), n.contentDocument.head.appendChild(e), n.contentDocument.body.appendChild(r);
  292. }, m(function () {
  293. return u.body.appendChild(n);
  294. });
  295. }
  296. for (var o = {}, r = 0; r < e.length; r++) {
  297. var i = u.createElement("link");
  298. i.setAttribute("id", b), i.setAttribute("href", e[r].href), i.setAttribute("rel", e[r].rel);
  299. var c = v(e[r]);
  300. i.setAttribute(w, c), o[c] = e[r], n(i, c);
  301. }
  302. for (var a = 0; a < t.length; a++) {
  303. var s = u.createElement("style");
  304. s.setAttribute("id", b);
  305. var f = v(t[a]);
  306. s.setAttribute(w, f), s.innerText = t[a].innerText, o[f] = t[a], n(s, f);
  307. }
  308. return o;
  309. }(),
  310. r = a({}, e, o),
  311. i = Object.keys(e).length + Object.keys(o).length,
  312. c = l.FontAwesomeDetection.timeout + l.FontAwesomeDetection.resultsCollectionMaxWait;
  313. console.group("Font Awesome Detector"), 0 === i ? (console.info("%cAll Good!", "color: green; font-size: large"), console.info("We didn't find anything that needs testing for conflicts. Ergo, no conflicts.")) : (console.info("Testing ".concat(i, " possible conflicts.")), console.info("We'll wait about ".concat(Math.round(l.FontAwesomeDetection.timeout / 10) / 100, " seconds while testing these and\n") + "then up to another ".concat(Math.round(l.FontAwesomeDetection.resultsCollectionMaxWait / 10) / 100, " to allow the browser time\n") + "to accumulate the results. But we'll probably be outta here way before then.\n\n"), console.info("You can adjust those durations by assigning values to these attributes on the <script> element that loads this detection:"), console.info("\t%c".concat(A, "%c: milliseconds to wait for each test before deciding whether it's a conflict."), "font-weight: bold;", "font-size: normal;"), console.info("\t%c".concat(T, "%c: milliseconds to wait for the browser to accumulate test results before giving up."), "font-weight: bold;", "font-size: normal;"), D({
  314. maxDuration: c,
  315. showProgress: !0,
  316. progressIndicator: "waiting...",
  317. fn: function fn() {
  318. return Object.keys(n.conflict).length + Object.keys(n.noConflict).length >= i;
  319. }
  320. }).then(function () {
  321. console.info("DONE!"), E({
  322. nodesTested: n,
  323. nodesFound: r
  324. }), t({
  325. nodesTested: n,
  326. nodesFound: r
  327. }), console.groupEnd();
  328. })["catch"](function (e) {
  329. "timeout" === e ? console.info("TIME OUT! We waited until we got tired. Here's what we found:") : (console.info("Whoops! We hit an error:", e), console.info("Here's what we'd found up until that error:")), E({
  330. nodesTested: n,
  331. nodesFound: r
  332. }), t({
  333. nodesTested: n,
  334. nodesFound: r
  335. }), console.groupEnd();
  336. }));
  337. }
  338. var F = l.FontAwesomeDetection || {},
  339. O = a({}, {
  340. report: function report(e) {
  341. var t = e.nodesTested,
  342. n = e.nodesFound,
  343. o = {};
  344. for (var r in n) {
  345. t.conflict[r] || t.noConflict[r] || (o[r] = n[r]);
  346. }
  347. var i = Object.keys(t.conflict).length;
  348. if (0 < i) {
  349. console.info("%cConflict".concat(1 < i ? "s" : "", " found:"), "color: darkred; font-size: large");
  350. var c = {};
  351. for (var a in t.conflict) {
  352. var s = t.conflict[a];
  353. c[a] = {
  354. tagName: s.tagName,
  355. "src/href": s.src || s.href || "n/a",
  356. "innerText excerpt": s.innerText && "" !== s.innerText ? s.innerText.slice(0, 200) + "..." : "(empty)"
  357. };
  358. }
  359. console.table(c);
  360. }
  361. var f = Object.keys(t.noConflict).length;
  362. if (0 < f) {
  363. console.info("%cNo conflict".concat(1 < f ? "s" : "", " found with ").concat(1 == f ? "this" : "these", ":"), "color: green; font-size: large");
  364. var l = {};
  365. for (var u in t.noConflict) {
  366. var d = t.noConflict[u];
  367. l[u] = {
  368. tagName: d.tagName,
  369. "src/href": d.src || d.href || "n/a",
  370. "innerText excerpt": d.innerText && "" !== d.innerText ? d.innerText.slice(0, 200) + "..." : "(empty)"
  371. };
  372. }
  373. console.table(l);
  374. }
  375. var m = Object.keys(o).length;
  376. if (0 < m) {
  377. console.info("%cLeftovers--we timed out before collecting test results for ".concat(1 == m ? "this" : "these", ":"), "color: blue; font-size: large");
  378. var h = {};
  379. for (var g in o) {
  380. var p = o[g];
  381. h[g] = {
  382. tagName: p.tagName,
  383. "src/href": p.src || p.href || "n/a",
  384. "innerText excerpt": p.innerText && "" !== p.innerText ? p.innerText.slice(0, 200) + "..." : "(empty)"
  385. };
  386. }
  387. console.table(h);
  388. }
  389. },
  390. timeout: +(u.currentScript.getAttribute(A) || "2000"),
  391. resultsCollectionMaxWait: +(u.currentScript.getAttribute(T) || "5000")
  392. }, F, {
  393. __pollUntil: D,
  394. md5ForNode: v,
  395. detectionDone: !1,
  396. nodesTested: null,
  397. nodesFound: null
  398. });
  399. l.FontAwesomeDetection = O;
  400. var N = function () {
  401. try {
  402. return "production" === process.env.NODE_ENV;
  403. } catch (e) {
  404. return !1;
  405. }
  406. }();
  407. !function (e) {
  408. try {
  409. e();
  410. } catch (e) {
  411. if (!N) throw e;
  412. }
  413. }(function () {
  414. c && s && C(window.FontAwesomeDetection.report);
  415. }), e.conflictDetection = C, Object.defineProperty(e, "__esModule", {
  416. value: !0
  417. });
  418. }, "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t(e["fontawesome-free-conflict-detection"] = {});