forked from Schweigi/assembler-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fontHack.js
38 lines (38 loc) · 16.9 KB
/
fontHack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* The Typekit service used to deliver this font or fonts for use on websites
* is provided by Adobe and is subject to these Terms of Use
* http://www.adobe.com/products/eulas/tou_typekit. For font license
* information, see the list below.
*
* source-code-pro:
* - http://typekit.com/eulas/0000000000000000000179cf
*
* © 2009-2017 Adobe Systems Incorporated. All Rights Reserved.
*/
if(!window.Typekit)window.Typekit={};window.Typekit.config={"a":"9089820","c":[".tk-source-code-pro","\"source-code-pro\",sans-serif"],"dl":"AAAAOgAAAApV7OIGA94rKA","fi":[17454],"fc":[{"id":17454,"family":"source-code-pro","src":"https://use.typekit.net/af/32c94c/0000000000000000000179cf/27/{format}{?primer,subset_id,fvd,v}","descriptors":{"weight":"400","style":"normal","subset_id":1}}],"fn":["source-code-pro",["n4"]],"hn":"use.typekit.net","ht":"tk","js":"1.18.24","kt":"hpv3aoy","l":"typekit","ps":1,"ping":"https://p.typekit.net/p.gif{?s,k,ht,h,f,a,js,app,e,_}","pm":true,"type":"configurable"};
/*{"k":"1.18.24","auto_updating":true,"last_published":"2017-09-24 05:07:28 UTC"}*/
;(function(window,document,undefined){if(!document.querySelector){document.documentElement.className+=" wf-inactive";return;}function aa(a,b,c){return a.call.apply(a.bind,arguments)}function ba(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function h(a,b,c){h=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return h.apply(null,arguments)}var m=Date.now||function(){return+new Date};function ca(a){this.g=a||"-"}ca.prototype.b=function(a){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c].replace(/[\W_]+/g,"").toLowerCase());return b.join(this.g)};function da(){var a=[{name:"font-family",value:n.c[q+1]}];this.g=[n.c[q]];this.b=a}function ea(a){for(var b=a.g.join(","),c=[],d=0;d<a.b.length;d++){var e=a.b[d];c.push(e.name+":"+e.value+";")}return b+"{"+c.join("")+"}"};function r(a,b){return(a&65535)*b+(((a>>>16)*b&65535)<<16)};function t(a,b){this.b=b||Array(Math.ceil(a/32));if(!b)for(var c=0;c<this.b.length;c++)this.b[c]=0}t.prototype.set=function(a){if(Math.floor(a/32+1)>this.b.length)throw Error("Index is out of bounds.");var b=Math.floor(a/32);this.b[b]|=1<<a-32*b};t.prototype.has=function(a){if(Math.floor(a/32+1)>this.b.length)throw Error("Index is out of bounds.");var b=Math.floor(a/32);return!!(this.b[b]&1<<a-32*b)};function fa(a,b,c){this.b=a;this.i=b;this.g=new t(a,c)}var ga=[2449897292,4218179547,2675077685,1031960064,1478620578,1386343184,3194259988,2656050674,3012733295,2193273665];
fa.prototype.has=function(a){if("string"!==typeof a&&"number"!==typeof a)throw Error("Value should be a string or number.");for(var b="number"===typeof a,c=0;c<this.i;c++){var d;if(b)d=r(a&4294967295,3432918353),d=d<<15|d>>>17,d=r(d,461845907),d^=ga[c]||0,d=d<<13|d>>>19,d=r(d,5)+3864292196,d^=4,d^=d>>>16,d=r(d,2246822507),d^=d>>>13,d=r(d,3266489909),d^=d>>>16,d=(d>>>0)%this.b;else{d=ga[c]||0;var e,f,g=a.length%4,k=a.length-g;for(f=0;f<k;f+=4)e=(a.charCodeAt(f+0)&4294967295)<<0|(a.charCodeAt(f+1)&
4294967295)<<8|(a.charCodeAt(f+2)&4294967295)<<16|(a.charCodeAt(f+3)&4294967295)<<24,e=r(e,3432918353),e=e<<15|e>>>17,e=r(e,461845907),d^=e,d=d<<13|d>>>19,d=r(d,5)+3864292196;e=0;switch(g){case 3:e^=(a.charCodeAt(f+2)&4294967295)<<16;case 2:e^=(a.charCodeAt(f+1)&4294967295)<<8;case 1:e^=(a.charCodeAt(f+0)&4294967295)<<0,e=r(e,3432918353),e=e<<15|e>>>17,e=r(e,461845907),d^=e}d^=a.length;d=r(d^d>>>16,2246822507);d=r(d^d>>>13,3266489909);d=((d^d>>>16)>>>0)%this.b}if(!this.g.has(d))return!1}return!0};function ha(a){a.length%4&&(a+=Array(5-a.length%4).join("="));a=a.replace(/\-/g,"+").replace(/\_/g,"/");if(window.atob)a=window.atob(a);else{a=a.replace(/=+$/,"");if(1==a.length%4)throw Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var b=0,c,d,e=0,f="";d=a.charAt(e++);~d&&(c=b%4?64*c+d:d,b++%4)?f+=String.fromCharCode(255&c>>(-2*b&6)):0)d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(d);a=f}c=[];for(b=0;b<a.length;b+=4)c.push(a.charCodeAt(b)<<
24|a.charCodeAt(b+1)<<16|a.charCodeAt(b+2)<<8|a.charCodeAt(b+3)<<0);a=c.shift();b=c.shift();this.b=new fa(a,b,c)}ha.prototype.has=function(a){if(""===a)return!0;for(a=a.split(".");a.length;){var b=a.join("."),c="*."+b;if(this.b.has(b)||this.b.has(c)||this.b.has(encodeURIComponent(b))||this.b.has(encodeURIComponent(c)))return!0;a.shift()}return!1};function u(a,b,c,d){b=a.b.createElement(b);if(c)for(var e in c)c.hasOwnProperty(e)&&("style"==e?b.style.cssText=c[e]:b.setAttribute(e,c[e]));d&&b.appendChild(a.b.createTextNode(d));return b}function v(a,b,c){a=a.b.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(c,a.lastChild)}
function ia(a,b){a.b.body?b():a.b.addEventListener?a.b.addEventListener("DOMContentLoaded",b):a.b.attachEvent("onreadystatechange",function(){"interactive"!=a.b.readyState&&"complete"!=a.b.readyState||b()})}function y(a){a.parentNode&&a.parentNode.removeChild(a)}
function z(a,b,c){var d=b||[];c=c||[];b=a.className.split(/\s+/);for(var e,f=0;f<d.length;f+=1){e=!1;for(var g=0;g<b.length;g+=1)if(d[f]===b[g]){e=!0;break}e||b.push(d[f])}d=[];for(f=0;f<b.length;f+=1){e=!1;for(g=0;g<c.length;g+=1)if(b[f]===c[g]){e=!0;break}e||d.push(b[f])}a.className=d.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function ja(a,b){for(var c=a.className.split(/\s+/),d=0,e=c.length;d<e;d++)if(c[d]==b)return!0;return!1}
function A(a,b){var c=u(a,"style");c.setAttribute("type","text/css");c.styleSheet?(v(a,"head",c),c.styleSheet.cssText=b):(c.appendChild(document.createTextNode(b)),v(a,"head",c))}
function ka(a,b,c){var d=a.b.getElementsByTagName("head")[0];if(d){var e=u(a,"script",{src:b}),f=!1;e.onload=e.onreadystatechange=function(){f||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(f=!0,c&&c(null),e.onload=e.onreadystatechange=null,"HEAD"==e.parentNode.tagName&&d.removeChild(e))};d.appendChild(e);setTimeout(function(){f||(f=!0,c&&c(Error("Script load timeout")))},5E3)}};function B(a,b,c){this.g=a.g.document.documentElement;this.j=b;this.m=c;this.b=new ca("-");this.o=!1!==b.events;this.i=!1!==b.classes}function C(a){if(a.i){var b=ja(a.g,a.b.b("wf","active")),c=[],d=[a.b.b("wf","loading")];b||c.push(a.b.b("wf","inactive"));z(a.g,c,d)}D(a,"inactive")}function D(a,b,c){if(a.o&&a.j[b])try{if(c)a.j[b](c.b,E(c));else a.j[b]()}catch(d){console.error('Typekit: Error in "'+b+'" callback',d)}if(a.m[b])if(c)a.m[b](c.b,E(c));else a.m[b]()};function la(a,b,c){c=c||{};this.b=a;this.g=b;this.weight=c.weight||"400";this.style=c.style||"normal";this.B=c.primer||void 0;this.C=c.subset_id||void 0}function F(a){return("tk-"+a.b).slice(0,26)+"-"+E(a)}function G(a,b){return new la(b,a.g,{weight:a.weight,style:a.style,B:a.B,C:a.C})}function E(a){return a.style.charAt(0)+a.weight.charAt(0)};function ma(){var a=document,b=navigator.userAgent;if(/MSIE|Trident/.test(b)&&(a.documentMode?9>a.documentMode:1))b="i";else{a:{if(/AppleWebKit/.test(b)&&/Android/.test(b)&&!/OPR|Chrome|CrMo|CriOS/.test(b)&&(a=/Android ([^;)]+)/.exec(b))&&a[1]){a=parseFloat(a[1]);a=3.1<=a&&4.1>a;break a}a=!1}if(!a)a:{if(/Silk/.test(b)&&/Linux|Ubuntu|Android/.test(b)&&(b=/Silk\/([\d\._]+)/.exec(b))&&b[1]){a=2<=parseFloat(b[1]);break a}a=!1}b=a?"j":"k"}return b};function H(a){this.b=a}function I(a,b){return a.b.replace(/\{([^\{\}]+)\}/g,function(a,d){if("?"==d.charAt(0)){for(var e=d.slice(1).split(","),f=[],g=0;g<e.length;g++)b[e[g]]&&f.push(e[g]+"="+encodeURIComponent(b[e[g]]));return f.length?"?"+f.join("&"):""}return encodeURIComponent(b[d]||"")})};function J(){this.b=[]}function na(a,b){for(var c=0;c<b.length;c++)a.b.push(b[c])}function K(a,b){for(var c=0;c<a.b.length;c++)b(a.b[c],c,a)}
function oa(a,b){if("i"===b){var c={},d=new J;K(a,function(a){c[a.b]||(c[a.b]={});c[a.b][a.weight]||(c[a.b][a.weight]=[]);c[a.b][a.weight].push(a)});for(var e in c){for(var f=[400,300,200,100,500,600,700,800,900],g=400,k=0;k<f.length;k++)if(g=f[k],c[e][g]){na(d,c[e][g]);break}f=[700,800,900,600,500,400,300,200,100];for(k=0;k<f.length;k++){var l=f[k];if(c[e][l]&&g!==l){na(d,c[e][l]);break}}}K(a,function(a){a=G(a,a.b.replace(/(-1|-2)$/,"").slice(0,28)+"-"+E(a));d.b.push(a)});return d}return"x"===b?
new J:a}function qa(a,b,c){for(var d=[],e=0;e<b.length;e++){var f=b[e],g=I(new H(a.g),{format:f,primer:a.B,subset_id:a.C,fvd:E(a),extension:ra(f),token:c,v:"3"});"i"===f?d.push("url("+g+")"):d.push("url("+g+') format("'+sa(f)+'")')}return d.join(",")}function ta(a,b,c,d){if("x"===b)return"";var e=[];e.push("font-family:"+(d?F(a):a.b));b="k"===b?qa(a,["l","d","a"],c):qa(a,[b],c);e.push("src:"+b);e.push("font-weight:"+a.weight);e.push("font-style:"+a.style);return"@font-face{"+e.join(";")+";}"}
function sa(a){switch(a){case "d":return"woff";case "i":return"eot";case "l":return"woff2";default:return"opentype"}}function ra(a){switch(a){case "d":return"woff";case "i":return"eot";case "l":return"woff2";default:return"otf"}}function L(a,b,c,d){var e=[];K(a,function(a){e.push(ta(a,b,c,d))});return e.join("")};function M(a,b){this.g=a;this.i=b;this.b=u(this.g,"span",{"aria-hidden":"true"},this.i)}function N(a){v(a.g,"body",a.b)}
function O(a){return"display:block !important;position:absolute !important;top:-9999px !important;left:-9999px !important;font-size:300px !important;width:auto !important;height:auto !important;line-height:normal !important;margin:0 !important;padding:0 !important;font-variant:normal !important;white-space:nowrap !important;font-family:"+a.b+" !important;font-weight:"+a.weight+" !important;font-style:"+a.style+" !important;"};function ua(a,b,c,d,e,f,g,k){this.D=a;this.H=b;this.u=c;this.b=d;this.w=g||"BESbswy";this.g={};this.I=e||3E3;this.G=k;this.A=f||null;this.i=new M(this.u,this.w);this.j=new M(this.u,this.w);this.m=new M(this.u,this.w);this.o=new M(this.u,this.w);a=this.G?F(this.b):this.b.b;this.i.b.style.cssText=O(G(this.b,a+",serif"));this.j.b.style.cssText=O(G(this.b,a+",sans-serif"));this.m.b.style.cssText=O(G(this.b,"serif"));this.o.b.style.cssText=O(G(this.b,"sans-serif"));N(this.i);N(this.j);N(this.m);N(this.o)}
var P={K:"serif",J:"sans-serif"},Q=null;function va(){if(null===Q){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);Q=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return Q}ua.prototype.start=function(){this.g.serif=this.m.b.offsetWidth;this.g["sans-serif"]=this.o.b.offsetWidth;this.F=m();wa(this)};function xa(a,b,c){for(var d in P)if(P.hasOwnProperty(d)&&b===a.g[P[d]]&&c===a.g[P[d]])return!0;return!1}
function wa(a){var b=a.i.b.offsetWidth,c=a.j.b.offsetWidth,d;(d=b===a.g.serif&&c===a.g["sans-serif"])||(d=va()&&xa(a,b,c));d?m()-a.F>=a.I?va()&&xa(a,b,c)&&(!a.A||a.A.hasOwnProperty(a.b.b))?R(a,a.D):R(a,a.H):ya(a):R(a,a.D)}function ya(a){setTimeout(h(function(){wa(this)},a),50)}function R(a,b){setTimeout(h(function(){y(this.i.b);y(this.j.b);y(this.m.b);y(this.o.b);b(this.b)},a),0)};function za(a,b,c,d,e,f,g){this.i=a;this.u=b;this.b=d;this.m=c;this.g=e||3E3;this.o=f||void 0;this.j=g}za.prototype.start=function(){var a=this.m.g.document,b=this,c=m(),d=new Promise(function(d,e){function k(){m()-c>=b.g?e():a.fonts.load(b.b.style+" "+b.b.weight+" 300px "+(b.j?F(b.b):b.b.b),b.o).then(function(a){1<=a.length?d():setTimeout(k,25)},function(){e()})}k()}),e=new Promise(function(a,c){setTimeout(c,b.g)});Promise.race([e,d]).then(function(){b.i(b.b)},function(){b.u(b.b)})};function S(a,b,c,d){this.w=a;this.b=b;this.g=0;this.o=this.m=!1;this.A=c;this.u=d}var T=null;
function Aa(a,b,c){var d={},e=b.b.length;if(!e&&c)C(a.b);else{a.g+=e;c&&(a.m=c);var f=[];K(b,function(b){var c=a.b;c.i&&z(c.g,[c.b.b("wf",b.b,E(b),"loading")]);D(c,"fontloading",b);c=null;if(null===T)if(window.FontFace){var e=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),p=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent);T=e?42<parseInt(e[1],10):p&&/Apple/.exec(window.navigator.vendor)?603<=parseInt(p[1],10):!0}else T=!1;T?c=new za(h(a.i,a),h(a.j,a),
a.w,b,a.A,"BESbswy\ue000\ue001\ue002\ue003\ue004\ue005\ue006",a.u):c=new ua(h(a.i,a),h(a.j,a),a.w,b,a.A,d,"BESbswy\ue000\ue001\ue002\ue003\ue004\ue005\ue006",a.u);f.push(c)});for(b=0;b<f.length;b++)f[b].start()}}S.prototype.i=function(a){var b=this.b;b.i&&z(b.g,[b.b.b("wf",a.b,E(a),"active")],[b.b.b("wf",a.b,E(a),"loading"),b.b.b("wf",a.b,E(a),"inactive")]);D(b,"fontactive",a);this.o=!0;Ba(this)};
S.prototype.j=function(a){var b=this.b;if(b.i){var c=ja(b.g,b.b.b("wf",a.b,E(a),"active")),d=[],e=[b.b.b("wf",a.b,E(a),"loading")];c||d.push(b.b.b("wf",a.b,E(a),"inactive"));z(b.g,d,e)}D(b,"fontinactive",a);Ba(this)};function Ba(a){!--a.g&&a.m&&(a.o?(a=a.b,a.i&&z(a.g,[a.b.b("wf","active")],[a.b.b("wf","loading"),a.b.b("wf","inactive")]),D(a,"active")):C(a.b))};function U(a){this.b=a;this.m=null;this.g=[];this.j=this.u=null;this.o=new J;this.i=null}U.prototype.supportsConfiguredBrowser=function(){return!0};U.prototype.init=function(){if(0<this.g.length){for(var a=[],b=0;b<this.g.length;b++)a.push(ea(this.g[b]));A(this.b,a.join(""))}};
U.prototype.load=function(a,b,c){var d=this;c=c||{};if(this.j&&(a=location.hostname,!this.j.has(a))){console.error('Typekit: the domain "'+a+'" isn\'t in the list of published domains for kit "'+this.u+'".');C(new B(this.b,c,{}));return}a=c.timeout;var e=!!c.async,f=ma(),g=oa(this.o,f);c=new B(this.b,c,{active:function(){if(e){var a=L(g,f,d.i,!1);A(d.b,a)}if(d.m){var a=d.m,b=d.b,c=a.m,k=(window.__adobewebfontsappname__||a.app||"").toString().substr(0,20),b=b.g.location.hostname||b.i.location.hostname,
l=[],w=[];window.Typekit?(window.Typekit.fonts||(window.Typekit.fonts=[]),w=window.Typekit.fonts):window.TypekitPreview&&(window.TypekitPreview.fonts||(window.TypekitPreview.fonts=[]),w=window.TypekitPreview.fonts);for(var x=0;x<a.b.length;x++){for(var pa=!1,Z=0;Z<w.length;Z++)if(a.b[x]===w[Z]){pa=!0;break}pa||(l.push(a.b[x]),w.push(a.b[x]))}l.length&&Ca(I(c,{s:a.j,k:a.o,app:k,ht:a.i,h:b,f:l.join("."),a:a.g,js:a.version,e:"js",_:(+new Date).toString()}))}},inactive:function(){if(e){var a=L(g,f,d.i,
!1);A(d.b,a)}}});if(g.b.length){var k=L(g,f,this.i,e);A(this.b,k);var l=new S(this.b,c,a,e);ia(d.b,function(){Aa(l,g,b)})}else C(c)};function Da(a,b){this.j=a;this.g=b;this.b=[]}Da.prototype.i=function(a){this.b.push(a)};Da.prototype.load=function(a,b){var c=a,d=b||{};"string"==typeof c?c=[c]:c&&c.length||(d=c||{},c=[]);if(c.length)for(var e=this,f=c.length,g=0;g<c.length;g++)Ea(this,c[g],function(){--f||Fa(e,d)});else Fa(this,d)};function Ea(a,b,c){b=I(a.j,{id:b});ka(a.g,b,c)}
function Fa(a,b){if(a.b.length){for(var c=new B(a.g,b,{}),d=0;d<a.b.length;d++)a.b[d].init();c.i&&z(c.g,[c.b.b("wf","loading")]);D(c,"loading");for(c=0;c<a.b.length;c++)a.b[c].load(null,c==a.b.length-1,b);a.b=[]}};function Ga(){var a=n.ps,b=n.ht,c=n.fi,d=n.a,e=n.kt,f=n.js,g=n.l;this.m=new H(n.ping);this.j=a;this.i=b;this.b=c||[];this.g=d||null;this.o=e||null;this.version=f||null;this.app=g||null}function Ca(a){var b=new Image(1,1),c=!1;b.src=a;b.onload=function(){c=!0;b.onload=null};setTimeout(function(){c||(b.src="about:blank",b.onload=null)},3E3)};var Ha=new function(){var a=window;this.g=this.i=a;this.b=this.g.document};window.Typekit||(window.Typekit={});if(!window.Typekit.load){var V=new Da(new H("//"+(window.Typekit.config||{}).hn+"/{id}.js"),Ha);window.Typekit.load=function(){V.load.apply(V,arguments)};window.Typekit.addKit=function(){V.i.apply(V,arguments)}}var W,n=window.Typekit.config||{};W=new U(Ha);n.ping&&(W.m=new Ga);if(n.fc)for(var X=n.fc,Y=0;Y<X.length;Y++)W.o.b.push(new la(X[Y].family,X[Y].src,X[Y].descriptors));
if(n.dl){var Ia=n.dl;try{W.j=new ha(Ia)}catch(a){}}n.kt&&(W.u=n.kt);n.token&&(W.i=n.token);if(n.c)for(var q=0;q<n.c.length;q+=2)W.g.push(new da);window.Typekit.addKit(W);
if(n.pm&&1===Math.round(30*Math.random())){var Ja=window.Typekit.load,Ka=[];window.Typekit.load=function(a){a=a||{};var b=a.active||function(){},c=a.fontactive||function(){},d=(new Date).getTime();a.active=function(){b();if(!window.XDomainRequest){var a=new Image,c=function(a){a=JSON.stringify({fonts:Ka,augmentations:[],font_loading:window.FontFace?"native":"non-native",active_duration:(new Date).getTime()-d,javascript_version:n.js,kit_type:"configurable",ad_blocker:a});if(!window.XDomainRequest){var b=
new XMLHttpRequest;b.open("POST","https://performance.typekit.net/");b.send(a)}};a.src="https://p.typekit.net/p.gif?";a.onload=function(){for(var a=!1,b=0;b<document.styleSheets.length;b++)if(null===document.styleSheets[b].href&&/ghostery-purple-box/.test(document.styleSheets[b].ownerNode.textContent)){a=!0;break}c(a)};a.onerror=function(){c(!0)}}};a.fontactive=function(a,b){var g,k;c(a,b);a:{g=b.charAt(0);k=b.charAt(1);/[1-9]/.test(k)||(k=4);g="i"===g?"italic":"o"===g?"oblique":"normal";k+="00";
for(var l=n.fc,p=0;p<l.length;p++)if(l[p].family===a&&l[p].descriptors.weight===k&&l[p].descriptors.style===g){g=l[p].id;break a}g=0}Ka.push({id:g,duration:(new Date).getTime()-d,dynamic:!1})};Ja(a)}}if(window.WebFont)try{window.Typekit.load()}catch(a){};}(this,document));