/*!
* Modernizr v2.6.1
* www.modernizr.com
*
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
* Available under the BSD and MIT licenses: www.modernizr.com/license/
*/
/*
* Modernizr tests which native CSS3 and HTML5 features are available in
* the current UA and makes the results available to you in two ways:
* as properties on a global Modernizr object, and as classes on the
* element. This information allows you to progressively enhance
* your pages with a granular level of control over the experience.
*
* Modernizr has an optional (not included) conditional resource loader
* called Modernizr.load(), based on Yepnope.js (yepnopejs.com).
* To get a build that includes Modernizr.load(), as well as choosing
* which tests to include, go to www.modernizr.com/download/
*
* Authors Faruk Ates, Paul Irish, Alex Sexton
* Contributors Ryan Seddon, Ben Alman
*/
window.Modernizr = function (a, b, c) { function D(a) { j.cssText = a } function E(a, b) { return D(n.join(a + ";") + (b || "")) } function F(a, b) { return typeof a === b } function G(a, b) { return !! ~("" + a).indexOf(b) } function H(a, b) { for (var d in a) { var e = a[d]; if (!G(e, "-") && j[e] !== c) return b == "pfx" ? e : !0 } return !1 } function I(a, b, d) { for (var e in a) { var f = b[a[e]]; if (f !== c) return d === !1 ? a[e] : F(f, "function") ? f.bind(d || b) : f } return !1 } function J(a, b, c) { var d = a.charAt(0).toUpperCase() + a.slice(1), e = (a + " " + p.join(d + " ") + d).split(" "); if (F(b, "string") || F(b, "undefined")) return H(e, b); e = (a + " " + q.join(d + " ") + d).split(" "); return I(e, b, c) } function K() { e.input = function (c) { for (var d = 0, e = c.length; d < e; d++) u[c[d]] = c[d] in k; u.list && (u.list = !!b.createElement("datalist") && !!a.HTMLDataListElement); return u } ("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")); e.inputtypes = function (a) { for (var d = 0, e, f, h, i = a.length; d < i; d++) { k.setAttribute("type", f = a[d]); e = k.type !== "text"; if (e) { k.value = l; k.style.cssText = "position:absolute;visibility:hidden;"; if (/^range$/.test(f) && k.style.WebkitAppearance !== c) { g.appendChild(k); h = b.defaultView; e = h.getComputedStyle && h.getComputedStyle(k, null).WebkitAppearance !== "textfield" && k.offsetHeight !== 0; g.removeChild(k) } else /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = k.checkValidity && k.checkValidity() === !1 : e = k.value != l) } t[a[d]] = !!e } return t } ("search tel url email datetime date month week time datetime-local number range color".split(" ")) } var d = "2.6.1", e = {}, f = !0, g = b.documentElement, h = "modernizr", i = b.createElement(h), j = i.style, k = b.createElement("input"), l = ":)", m = {}.toString, n = " -webkit- -moz- -o- -ms- ".split(" "), o = "Webkit Moz O ms", p = o.split(" "), q = o.toLowerCase().split(" "), r = { svg: "http://www.w3.org/2000/svg" }, s = {}, t = {}, u = {}, v = [], w = v.slice, x, y = function (a, c, d, e) { var f, i, j, k = b.createElement("div"), l = b.body, m = l ? l : b.createElement("body"); if (parseInt(d, 10)) while (d--) { j = b.createElement("div"); j.id = e ? e[d] : h + (d + 1); k.appendChild(j) } f = ["", '"].join(""); k.id = h; (l ? k : m).innerHTML += f; m.appendChild(k); if (!l) { m.style.background = ""; g.appendChild(m) } i = c(k, a); l ? k.parentNode.removeChild(k) : m.parentNode.removeChild(m); return !!i }, z = function (b) { var c = a.matchMedia || a.msMatchMedia; if (c) return c(b).matches; var d; y("@media " + b + " { #" + h + " { position: absolute; } }", function (b) { d = (a.getComputedStyle ? getComputedStyle(b, null) : b.currentStyle)["position"] == "absolute" }); return d }, A = function () { function d(d, e) { e = e || b.createElement(a[d] || "div"); d = "on" + d; var f = d in e; if (!f) { e.setAttribute || (e = b.createElement("div")); if (e.setAttribute && e.removeAttribute) { e.setAttribute(d, ""); f = F(e[d], "function"); F(e[d], "undefined") || (e[d] = c); e.removeAttribute(d) } } e = null; return f } var a = { select: "input", change: "input", submit: "form", reset: "form", error: "img", load: "img", abort: "img" }; return d } (), B = {}.hasOwnProperty, C; !F(B, "undefined") && !F(B.call, "undefined") ? C = function (a, b) { return B.call(a, b) } : C = function (a, b) { return b in a && F(a.constructor.prototype[b], "undefined") }; Function.prototype.bind || (Function.prototype.bind = function (b) { var c = this; if (typeof c != "function") throw new TypeError; var d = w.call(arguments, 1), e = function () { if (this instanceof e) { var a = function () { }; a.prototype = c.prototype; var f = new a, g = c.apply(f, d.concat(w.call(arguments))); return Object(g) === g ? g : f } return c.apply(b, d.concat(w.call(arguments))) }; return e }); s.flexbox = function () { return J("flexWrap") }; s.flexboxlegacy = function () { return J("boxDirection") }; s.canvas = function () { var a = b.createElement("canvas"); return !!a.getContext && !!a.getContext("2d") }; s.canvastext = function () { return !!e.canvas && !!F(b.createElement("canvas").getContext("2d").fillText, "function") }; s.webgl = function () { return !!a.WebGLRenderingContext }; s.touch = function () { var c; "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 : y(["@media (", n.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function (a) { c = a.offsetTop === 9 }); return c }; s.geolocation = function () { return "geolocation" in navigator }; s.postmessage = function () { return !!a.postMessage }; s.websqldatabase = function () { return !!a.openDatabase }; s.indexedDB = function () { return !!J("indexedDB", a) }; s.hashchange = function () { return A("hashchange", a) && (b.documentMode === c || b.documentMode > 7) }; s.history = function () { return !!a.history && !!history.pushState }; s.draganddrop = function () { var a = b.createElement("div"); return "draggable" in a || "ondragstart" in a && "ondrop" in a }; s.websockets = function () { return "WebSocket" in a || "MozWebSocket" in a }; s.rgba = function () { D("background-color:rgba(150,255,150,.5)"); return G(j.backgroundColor, "rgba") }; s.hsla = function () { D("background-color:hsla(120,40%,100%,.5)"); return G(j.backgroundColor, "rgba") || G(j.backgroundColor, "hsla") }; s.multiplebgs = function () { D("background:url(https://),url(https://),red url(https://)"); return /(url\s*\(.*?){3}/.test(j.background) }; s.backgroundsize = function () { return J("backgroundSize") }; s.borderimage = function () { return J("borderImage") }; s.borderradius = function () { return J("borderRadius") }; s.boxshadow = function () { return J("boxShadow") }; s.textshadow = function () { return b.createElement("div").style.textShadow === "" }; s.opacity = function () { E("opacity:.55"); return /^0.55$/.test(j.opacity) }; s.cssanimations = function () { return J("animationName") }; s.csscolumns = function () { return J("columnCount") }; s.cssgradients = function () { var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);"; D((a + "-webkit- ".split(" ").join(b + a) + n.join(c + a)).slice(0, -a.length)); return G(j.backgroundImage, "gradient") }; s.cssreflections = function () { return J("boxReflect") }; s.csstransforms = function () { return !!J("transform") }; s.csstransforms3d = function () { var a = !!J("perspective"); a && "webkitPerspective" in g.style && y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}", function (b, c) { a = b.offsetLeft === 9 && b.offsetHeight === 3 }); return a }; s.csstransitions = function () { return J("transition") }; s.fontface = function () { var a; y('@font-face {font-family:"font";src:url("https://")}', function (c, d) { var e = b.getElementById("smodernizr"), f = e.sheet || e.styleSheet, g = f ? f.cssRules && f.cssRules[0] ? f.cssRules[0].cssText : f.cssText || "" : ""; a = /src/i.test(g) && g.indexOf(d.split(" ")[0]) === 0 }); return a }; s.generatedcontent = function () { var a; y(['#modernizr:after{content:"', l, '";visibility:hidden}'].join(""), function (b) { a = b.offsetHeight >= 1 }); return a }; s.video = function () { var a = b.createElement("video"), c = !1; try { if (c = !!a.canPlayType) { c = new Boolean(c); c.ogg = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""); c.h264 = a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""); c.webm = a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "") } } catch (d) { } return c }; s.audio = function () { var a = b.createElement("audio"), c = !1; try { if (c = !!a.canPlayType) { c = new Boolean(c); c.ogg = a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""); c.mp3 = a.canPlayType("audio/mpeg;").replace(/^no$/, ""); c.wav = a.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""); c.m4a = (a.canPlayType("audio/x-m4a;") || a.canPlayType("audio/aac;")).replace(/^no$/, "") } } catch (d) { } return c }; s.localstorage = function () { try { localStorage.setItem(h, h); localStorage.removeItem(h); return !0 } catch (a) { return !1 } }; s.sessionstorage = function () { try { sessionStorage.setItem(h, h); sessionStorage.removeItem(h); return !0 } catch (a) { return !1 } }; s.webworkers = function () { return !!a.Worker }; s.applicationcache = function () { return !!a.applicationCache }; s.svg = function () { return !!b.createElementNS && !!b.createElementNS(r.svg, "svg").createSVGRect }; s.inlinesvg = function () { var a = b.createElement("div"); a.innerHTML = ""; return (a.firstChild && a.firstChild.namespaceURI) == r.svg }; s.smil = function () { return !!b.createElementNS && /SVGAnimate/.test(m.call(b.createElementNS(r.svg, "animate"))) }; s.svgclippaths = function () { return !!b.createElementNS && /SVGClipPath/.test(m.call(b.createElementNS(r.svg, "clipPath"))) }; for (var L in s) if (C(s, L)) { x = L.toLowerCase(); e[x] = s[L](); v.push((e[x] ? "" : "no-") + x) } e.input || K(); e.addTest = function (a, b) { if (typeof a == "object") for (var d in a) C(a, d) && e.addTest(d, a[d]); else { a = a.toLowerCase(); if (e[a] !== c) return e; b = typeof b == "function" ? b() : b; f && (g.className += " " + (b ? "" : "no-") + a); e[a] = b } return e }; D(""); i = k = null; (function (a, b) { function k(a, b) { var c = a.createElement("p"), d = a.getElementsByTagName("head")[0] || a.documentElement; c.innerHTML = "x"; return d.insertBefore(c.lastChild, d.firstChild) } function l() { var a = r.elements; return typeof a == "string" ? a.split(" ") : a } function m(a) { var b = i[a[g]]; if (!b) { b = {}; h++; a[g] = h; i[h] = b } return b } function n(a, c, f) { c || (c = b); if (j) return c.createElement(a); f || (f = m(c)); var g; f.cache[a] ? g = f.cache[a].cloneNode() : e.test(a) ? g = (f.cache[a] = f.createElem(a)).cloneNode() : g = f.createElem(a); return g.canHaveChildren && !d.test(a) ? f.frag.appendChild(g) : g } function o(a, c) { a || (a = b); if (j) return a.createDocumentFragment(); c = c || m(a); var d = c.frag.cloneNode(), e = 0, f = l(), g = f.length; for (; e < g; e++) d.createElement(f[e]); return d } function p(a, b) { if (!b.cache) { b.cache = {}; b.createElem = a.createElement; b.createFrag = a.createDocumentFragment; b.frag = b.createFrag() } a.createElement = function (c) { return r.shivMethods ? n(c, a, b) : b.createElem(c) }; a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + l().join().replace(/\w+/g, function (a) { b.createElem(a); b.frag.createElement(a); return 'c("' + a + '")' }) + ");return n}")(r, b.frag) } function q(a) { a || (a = b); var c = m(a); r.shivCSS && !f && !c.hasCSS && (c.hasCSS = !!k(a, "article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")); j || p(a, c); return a } var c = a.html5 || {}, d = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, e = /^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i, f, g = "_html5shiv", h = 0, i = {}, j; (function () { try { var a = b.createElement("a"); a.innerHTML = ""; f = "hidden" in a; j = a.childNodes.length == 1 || function () { b.createElement("a"); var a = b.createDocumentFragment(); return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement == "undefined" } () } catch (c) { f = !0; j = !0 } })(); var r = { elements: c.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video", shivCSS: c.shivCSS !== !1, supportsUnknownElements: j, shivMethods: c.shivMethods !== !1, type: "default", shivDocument: q, createElement: n, createDocumentFragment: o }; a.html5 = r; q(b) })(this, b); e._version = d; e._prefixes = n; e._domPrefixes = q; e._cssomPrefixes = p; e.mq = z; e.hasEvent = A; e.testProp = function (a) { return H([a]) }; e.testAllProps = J; e.testStyles = y; e.prefixed = function (a, b, c) { return b ? J(a, b, c) : J(a, "pfx") }; g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + v.join(" ") : ""); return e } (this, this.document);
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
window.matchMedia = window.matchMedia || (function (doc, undefined) {
"use strict";
var bool,
docElem = doc.documentElement,
refNode = docElem.firstElementChild || docElem.firstChild,
// fakeBody required for
fakeBody = doc.createElement("body"),
div = doc.createElement("div");
div.id = "mq-test-1";
div.style.cssText = "position:absolute;top:-100em";
fakeBody.style.background = "none";
fakeBody.appendChild(div);
return function (q) {
div.innerHTML = "";
docElem.insertBefore(fakeBody, refNode);
bool = div.offsetWidth === 42;
docElem.removeChild(fakeBody);
return {
matches: bool,
media: q
};
};
} (document));
/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
(function (win) {
"use strict";
//exposed namespace
var respond = {};
win.respond = respond;
//define update even in native-mq-supporting browsers, to avoid errors
respond.update = function () { };
//expose media query support flag for external use
respond.mediaQueriesSupported = win.matchMedia && win.matchMedia("only all").matches;
//if media queries are supported, exit here
if (respond.mediaQueriesSupported) {
return;
}
//define vars
var doc = win.document,
docElem = doc.documentElement,
mediastyles = [],
rules = [],
appendedEls = [],
parsedSheets = {},
resizeThrottle = 30,
head = doc.getElementsByTagName("head")[0] || docElem,
base = doc.getElementsByTagName("base")[0],
links = head.getElementsByTagName("link"),
requestQueue = [],
//loop stylesheets, send text content to translate
ripCSS = function () {
for (var i = 0; i < links.length; i++) {
var sheet = links[i],
href = sheet.href,
media = sheet.media,
isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
//only links plz and prevent re-parsing
if (!!href && isCSS && !parsedSheets[href]) {
// selectivizr exposes css through the rawCssText expando
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
translate(sheet.styleSheet.rawCssText, href, media);
parsedSheets[href] = true;
} else {
if ((!/^([a-zA-Z:]*\/\/)/.test(href) && !base) ||
href.replace(RegExp.$1, "").split("/")[0] === win.location.host) {
requestQueue.push({
href: href,
media: media
});
}
}
}
}
makeRequests();
},
//recurse through request queue, get css text
makeRequests = function () {
if (requestQueue.length) {
var thisRequest = requestQueue.shift();
ajax(thisRequest.href, function (styles) {
translate(styles, thisRequest.href, thisRequest.media);
parsedSheets[thisRequest.href] = true;
// by wrapping recursive function call in setTimeout
// we prevent "Stack overflow" error in IE7
setTimeout(function () { makeRequests(); }, 0);
});
}
},
//find media blocks in css text, convert to style blocks
translate = function (styles, href, media) {
var qs = styles.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),
ql = qs && qs.length || 0;
//try to get CSS path
href = href.substring(0, href.lastIndexOf("/"));
var repUrls = function (css) {
return css.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + href + "$2$3");
},
useMedia = !ql && media;
//if path exists, tack on trailing slash
if (href.length) { href += "/"; }
//if no internal queries exist, but media attr does, use that
//note: this currently lacks support for situations where a media attr is specified on a link AND
//its associated stylesheet has internal CSS media queries.
//In those cases, the media attribute will currently be ignored.
if (useMedia) {
ql = 1;
}
for (var i = 0; i < ql; i++) {
var fullq, thisq, eachq, eql;
//media attr
if (useMedia) {
fullq = media;
rules.push(repUrls(styles));
}
//parse for styles
else {
fullq = qs[i].match(/@media *([^\{]+)\{([\S\s]+?)$/) && RegExp.$1;
rules.push(RegExp.$2 && repUrls(RegExp.$2));
}
eachq = fullq.split(",");
eql = eachq.length;
for (var j = 0; j < eql; j++) {
thisq = eachq[j];
mediastyles.push({
media: thisq.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/) && RegExp.$2 || "all",
rules: rules.length - 1,
hasquery: thisq.indexOf("(") > -1,
minw: thisq.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
maxw: thisq.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
});
}
}
applyMedia();
},
lastCall,
resizeDefer,
// returns the value of 1em in pixels
getEmValue = function () {
var ret,
div = doc.createElement('div'),
body = doc.body,
fakeUsed = false;
div.style.cssText = "position:absolute;font-size:1em;width:1em";
if (!body) {
body = fakeUsed = doc.createElement("body");
body.style.background = "none";
}
body.appendChild(div);
docElem.insertBefore(body, docElem.firstChild);
ret = div.offsetWidth;
if (fakeUsed) {
docElem.removeChild(body);
}
else {
body.removeChild(div);
}
//also update eminpx before returning
ret = eminpx = parseFloat(ret);
return ret;
},
//cached container for 1em value, populated the first time it's needed
eminpx,
//enable/disable styles
applyMedia = function (fromResize) {
var name = "clientWidth",
docElemProp = docElem[name],
currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp,
styleBlocks = {},
lastLink = links[links.length - 1],
now = (new Date()).getTime();
//throttle resize calls
if (fromResize && lastCall && now - lastCall < resizeThrottle) {
clearTimeout(resizeDefer);
resizeDefer = setTimeout(applyMedia, resizeThrottle);
return;
}
else {
lastCall = now;
}
for (var i in mediastyles) {
if (mediastyles.hasOwnProperty(i)) {
var thisstyle = mediastyles[i],
min = thisstyle.minw,
max = thisstyle.maxw,
minnull = min === null,
maxnull = max === null,
em = "em";
if (!!min) {
min = parseFloat(min) * (min.indexOf(em) > -1 ? (eminpx || getEmValue()) : 1);
}
if (!!max) {
max = parseFloat(max) * (max.indexOf(em) > -1 ? (eminpx || getEmValue()) : 1);
}
// if there's no media query at all (the () part), or min or max is not null, and if either is present, they're true
if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
if (!styleBlocks[thisstyle.media]) {
styleBlocks[thisstyle.media] = [];
}
styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
}
}
}
//remove any existing respond style element(s)
for (var j in appendedEls) {
if (appendedEls.hasOwnProperty(j)) {
if (appendedEls[j] && appendedEls[j].parentNode === head) {
head.removeChild(appendedEls[j]);
}
}
}
//inject active styles, grouped by media type
for (var k in styleBlocks) {
if (styleBlocks.hasOwnProperty(k)) {
var ss = doc.createElement("style"),
css = styleBlocks[k].join("\n");
ss.type = "text/css";
ss.media = k;
//originally, ss was appended to a documentFragment and sheets were appended in bulk.
//this caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one!
head.insertBefore(ss, lastLink.nextSibling);
if (ss.styleSheet) {
ss.styleSheet.cssText = css;
}
else {
ss.appendChild(doc.createTextNode(css));
}
//push to appendedEls to track for later removal
appendedEls.push(ss);
}
}
},
//tweaked Ajax functions from Quirksmode
ajax = function (url, callback) {
var req = xmlHttp();
if (!req) {
return;
}
req.open("GET", url, true);
req.onreadystatechange = function () {
if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) {
return;
}
callback(req.responseText);
};
if (req.readyState === 4) {
return;
}
req.send(null);
},
//define ajax obj
xmlHttp = (function () {
var xmlhttpmethod = false;
try {
xmlhttpmethod = new win.XMLHttpRequest();
}
catch (e) {
xmlhttpmethod = new win.ActiveXObject("Microsoft.XMLHTTP");
}
return function () {
return xmlhttpmethod;
};
})();
//translate CSS
ripCSS();
//expose update for re-running respond later on
respond.update = ripCSS;
//adjust on resize
function callMedia() {
applyMedia(true);
}
if (win.addEventListener) {
win.addEventListener("resize", callMedia, false);
}
else if (win.attachEvent) {
win.attachEvent("onresize", callMedia);
}
})(this);
var hljs = new function () { function l(o) { return o.replace(/&/gm, "&").replace(//gm, ">") } function b(p) { for (var o = p.firstChild; o; o = o.nextSibling) { if (o.nodeName == "CODE") { return o } if (!(o.nodeType == 3 && o.nodeValue.match(/\s+/))) { break } } } function h(p, o) { return Array.prototype.map.call(p.childNodes, function (q) { if (q.nodeType == 3) { return o ? q.nodeValue.replace(/\n/g, "") : q.nodeValue } if (q.nodeName == "BR") { return "\n" } return h(q, o) }).join("") } function a(q) { var p = (q.className + " " + q.parentNode.className).split(/\s+/); p = p.map(function (r) { return r.replace(/^language-/, "") }); for (var o = 0; o < p.length; o++) { if (e[p[o]] || p[o] == "no-highlight") { return p[o] } } } function c(q) { var o = []; (function p(r, s) { for (var t = r.firstChild; t; t = t.nextSibling) { if (t.nodeType == 3) { s += t.nodeValue.length } else { if (t.nodeName == "BR") { s += 1 } else { if (t.nodeType == 1) { o.push({ event: "start", offset: s, node: t }); s = p(t, s); o.push({ event: "stop", offset: s, node: t }) } } } } return s })(q, 0); return o } function j(x, v, w) { var p = 0; var y = ""; var r = []; function t() { if (x.length && v.length) { if (x[0].offset != v[0].offset) { return (x[0].offset < v[0].offset) ? x : v } else { return v[0].event == "start" ? x : v } } else { return x.length ? x : v } } function s(A) { function z(B) { return " " + B.nodeName + '="' + l(B.value) + '"' } return "<" + A.nodeName + Array.prototype.map.call(A.attributes, z).join("") + ">" } while (x.length || v.length) { var u = t().splice(0, 1)[0]; y += l(w.substr(p, u.offset - p)); p = u.offset; if (u.event == "start") { y += s(u.node); r.push(u.node) } else { if (u.event == "stop") { var o, q = r.length; do { q--; o = r[q]; y += ("" + o.nodeName.toLowerCase() + ">") } while (o != u.node); r.splice(q, 1); while (q < r.length) { y += s(r[q]); q++ } } } } return y + l(w.substr(p)) } function f(q) { function o(s, r) { return RegExp(s, "m" + (q.cI ? "i" : "") + (r ? "g" : "")) } function p(y, w) { if (y.compiled) { return } y.compiled = true; var s = []; if (y.k) { var r = {}; function z(A, t) { t.split(" ").forEach(function (B) { var C = B.split("|"); r[C[0]] = [A, C[1] ? Number(C[1]) : 1]; s.push(C[0]) }) } y.lR = o(y.l || hljs.IR, true); if (typeof y.k == "string") { z("keyword", y.k) } else { for (var x in y.k) { if (!y.k.hasOwnProperty(x)) { continue } z(x, y.k[x]) } } y.k = r } if (w) { if (y.bWK) { y.b = "\\b(" + s.join("|") + ")\\s" } y.bR = o(y.b ? y.b : "\\B|\\b"); if (!y.e && !y.eW) { y.e = "\\B|\\b" } if (y.e) { y.eR = o(y.e) } y.tE = y.e || ""; if (y.eW && w.tE) { y.tE += (y.e ? "|" : "") + w.tE } } if (y.i) { y.iR = o(y.i) } if (y.r === undefined) { y.r = 1 } if (!y.c) { y.c = [] } for (var v = 0; v < y.c.length; v++) { if (y.c[v] == "self") { y.c[v] = y } p(y.c[v], y) } if (y.starts) { p(y.starts, w) } var u = []; for (var v = 0; v < y.c.length; v++) { u.push(y.c[v].b) } if (y.tE) { u.push(y.tE) } if (y.i) { u.push(y.i) } y.t = u.length ? o(u.join("|"), true) : { exec: function (t) { return null } } } p(q) } function d(D, E) { function o(r, M) { for (var L = 0; L < M.c.length; L++) { var K = M.c[L].bR.exec(r); if (K && K.index == 0) { return M.c[L] } } } function s(K, r) { if (K.e && K.eR.test(r)) { return K } if (K.eW) { return s(K.parent, r) } } function t(r, K) { return K.i && K.iR.test(r) } function y(L, r) { var K = F.cI ? r[0].toLowerCase() : r[0]; return L.k.hasOwnProperty(K) && L.k[K] } function G() { var K = l(w); if (!A.k) { return K } var r = ""; var N = 0; A.lR.lastIndex = 0; var L = A.lR.exec(K); while (L) { r += K.substr(N, L.index - N); var M = y(A, L); if (M) { v += M[1]; r += '' + L[0] + "" } else { r += L[0] } N = A.lR.lastIndex; L = A.lR.exec(K) } return r + K.substr(N) } function z() { if (A.sL && !e[A.sL]) { return l(w) } var r = A.sL ? d(A.sL, w) : g(w); if (A.r > 0) { v += r.keyword_count; B += r.r } return '' + r.value + "" } function J() { return A.sL !== undefined ? z() : G() } function I(L, r) { var K = L.cN ? '' : ""; if (L.rB) { x += K; w = "" } else { if (L.eB) { x += l(r) + K; w = "" } else { x += K; w = r } } A = Object.create(L, { parent: { value: A} }); B += L.r } function C(K, r) { w += K; if (r === undefined) { x += J(); return 0 } var L = o(r, A); if (L) { x += J(); I(L, r); return L.rB ? 0 : r.length } var M = s(A, r); if (M) { if (!(M.rE || M.eE)) { w += r } x += J(); do { if (A.cN) { x += "" } A = A.parent } while (A != M.parent); if (M.eE) { x += l(r) } w = ""; if (M.starts) { I(M.starts, "") } return M.rE ? 0 : r.length } if (t(r, A)) { throw "Illegal" } w += r; return r.length || 1 } var F = e[D]; f(F); var A = F; var w = ""; var B = 0; var v = 0; var x = ""; try { var u, q, p = 0; while (true) { A.t.lastIndex = p; u = A.t.exec(E); if (!u) { break } q = C(E.substr(p, u.index - p), u[0]); p = u.index + q } C(E.substr(p)); return { r: B, keyword_count: v, value: x, language: D} } catch (H) { if (H == "Illegal") { return { r: 0, keyword_count: 0, value: l(E)} } else { throw H } } } function g(s) { var o = { keyword_count: 0, r: 0, value: l(s) }; var q = o; for (var p in e) { if (!e.hasOwnProperty(p)) { continue } var r = d(p, s); r.language = p; if (r.keyword_count + r.r > q.keyword_count + q.r) { q = r } if (r.keyword_count + r.r > o.keyword_count + o.r) { q = o; o = r } } if (q.language) { o.second_best = q } return o } function i(q, p, o) { if (p) { q = q.replace(/^((<[^>]+>|\t)+)/gm, function (r, v, u, t) { return v.replace(/\t/g, p) }) } if (o) { q = q.replace(/\n/g, "
") } return q } function m(r, u, p) { var v = h(r, p); var t = a(r); if (t == "no-highlight") { return } var w = t ? d(t, v) : g(v); t = w.language; var o = c(r); if (o.length) { var q = document.createElement("pre"); q.innerHTML = w.value; w.value = j(o, c(q), v) } w.value = i(w.value, u, p); var s = r.className; if (!s.match("(\\s|^)(language-)?" + t + "(\\s|$)")) { s = s ? (s + " " + t) : t } r.innerHTML = w.value; r.className = s; r.result = { language: t, kw: w.keyword_count, re: w.r }; if (w.second_best) { r.second_best = { language: w.second_best.language, kw: w.second_best.keyword_count, re: w.second_best.r} } } function n() { if (n.called) { return } n.called = true; Array.prototype.map.call(document.getElementsByTagName("pre"), b).filter(Boolean).forEach(function (o) { m(o, hljs.tabReplace) }) } function k() { window.addEventListener("DOMContentLoaded", n, false); window.addEventListener("load", n, false) } var e = {}; this.LANGUAGES = e; this.highlight = d; this.highlightAuto = g; this.fixMarkup = i; this.highlightBlock = m; this.initHighlighting = n; this.initHighlightingOnLoad = k; this.IR = "[a-zA-Z][a-zA-Z0-9_]*"; this.UIR = "[a-zA-Z_][a-zA-Z0-9_]*"; this.NR = "\\b\\d+(\\.\\d+)?"; this.CNR = "(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"; this.BNR = "\\b(0b[01]+)"; this.RSR = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~"; this.BE = { b: "\\\\[\\s\\S]", r: 0 }; this.ASM = { cN: "string", b: "'", e: "'", i: "\\n", c: [this.BE], r: 0 }; this.QSM = { cN: "string", b: '"', e: '"', i: "\\n", c: [this.BE], r: 0 }; this.CLCM = { cN: "comment", b: "//", e: "$" }; this.CBLCLM = { cN: "comment", b: "/\\*", e: "\\*/" }; this.HCM = { cN: "comment", b: "#", e: "$" }; this.NM = { cN: "number", b: this.NR, r: 0 }; this.CNM = { cN: "number", b: this.CNR, r: 0 }; this.BNM = { cN: "number", b: this.BNR, r: 0 }; this.inherit = function (q, r) { var o = {}; for (var p in q) { o[p] = q[p] } if (r) { for (var p in r) { o[p] = r[p] } } return o } } (); hljs.LANGUAGES.javascript = function (a) { return { k: { keyword: "in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const", literal: "true false null undefined NaN Infinity" }, c: [a.ASM, a.QSM, a.CLCM, a.CBLCLM, a.CNM, { b: "(" + a.RSR + "|\\b(case|return|throw)\\b)\\s*", k: "return throw case", c: [a.CLCM, a.CBLCLM, { cN: "regexp", b: "/", e: "/[gim]*", i: "\\n", c: [{ b: "\\\\/"}] }, { b: "<", e: ">;", sL: "xml"}], r: 0 }, { cN: "function", bWK: true, e: "{", k: "function", c: [{ cN: "title", b: "[A-Za-z$_][0-9A-Za-z$_]*" }, { cN: "params", b: "\\(", e: "\\)", c: [a.CLCM, a.CBLCLM], i: "[\"'\\(]"}], i: "\\[|%"}]} } (hljs); hljs.LANGUAGES.css = function (a) { var b = { cN: "function", b: a.IR + "\\(", e: "\\)", c: [a.NM, a.ASM, a.QSM] }; return { cI: true, i: "[=/|']", c: [a.CBLCLM, { cN: "id", b: "\\#[A-Za-z0-9_-]+" }, { cN: "class", b: "\\.[A-Za-z0-9_-]+", r: 0 }, { cN: "attr_selector", b: "\\[", e: "\\]", i: "$" }, { cN: "pseudo", b: ":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+" }, { cN: "at_rule", b: "@(font-face|page)", l: "[a-z-]+", k: "font-face page" }, { cN: "at_rule", b: "@", e: "[{;]", eE: true, k: "import page media charset", c: [b, a.ASM, a.QSM, a.NM] }, { cN: "tag", b: a.IR, r: 0 }, { cN: "rules", b: "{", e: "}", i: "[^\\s]", r: 0, c: [a.CBLCLM, { cN: "rule", b: "[^\\s]", rB: true, e: ";", eW: true, c: [{ cN: "attribute", b: "[A-Z\\_\\.\\-]+", e: ":", eE: true, i: "[^\\s]", starts: { cN: "value", eW: true, eE: true, c: [b, a.NM, a.QSM, a.ASM, a.CBLCLM, { cN: "hexcolor", b: "\\#[0-9A-F]+" }, { cN: "important", b: "!important"}]}}]}]}]} } (hljs); hljs.LANGUAGES.xml = function (a) { var c = "[A-Za-z0-9\\._:-]+"; var b = { eW: true, c: [{ cN: "attribute", b: c, r: 0 }, { b: '="', rB: true, e: '"', c: [{ cN: "value", b: '"', eW: true}] }, { b: "='", rB: true, e: "'", c: [{ cN: "value", b: "'", eW: true}] }, { b: "=", c: [{ cN: "value", b: "[^\\s/>]+"}]}] }; return { cI: true, c: [{ cN: "pi", b: "<\\?", e: "\\?>", r: 10 }, { cN: "doctype", b: "", r: 10, c: [{ b: "\\[", e: "\\]"}] }, { cN: "comment", b: "", r: 10 }, { cN: "cdata", b: "<\\!\\[CDATA\\[", e: "\\]\\]>", r: 10 }, { cN: "tag", b: "", rE: true, sL: "css"} }, { cN: "tag", b: "