Skip to content

Instantly share code, notes, and snippets.

@andy0130tw
Last active September 21, 2024 07:00
Show Gist options
  • Save andy0130tw/bb3f107f0e986a0bb1c72509d72e984f to your computer and use it in GitHub Desktop.
Save andy0130tw/bb3f107f0e986a0bb1c72509d72e984f to your computer and use it in GitHub Desktop.
Try to de-obfusticate CloudFlare Rocket Loader script as of 20190521.
'use strict';
!function() {
/**
* @return {?}
*/
function t$jscomp$0() {
return "cf-marker-" + Math.random().toString().slice(2);
}
/**
* @return {undefined}
*/
function e$jscomp$7() {
/** @type {!Array} */
var t$jscomp$1 = [];
/** @type {number} */
var e$jscomp$8 = 0;
for (; e$jscomp$8 < arguments.length; e$jscomp$8++) {
t$jscomp$1[e$jscomp$8] = arguments[e$jscomp$8];
}
(n$jscomp$4 = console.warn || console.log).call.apply(n$jscomp$4, [console, "[ROCKET LOADER] "].concat(t$jscomp$1));
var n$jscomp$4;
}
/**
* @param {?} t$jscomp$2
* @param {!Object} e$jscomp$9
* @return {undefined}
*/
function n$jscomp$3(t$jscomp$2, e$jscomp$9) {
var n$jscomp$5 = e$jscomp$9.parentNode;
if (n$jscomp$5) {
f$jscomp$1(t$jscomp$2, n$jscomp$5, e$jscomp$9);
}
}
/**
* @param {?} t$jscomp$3
* @param {!Element} e$jscomp$10
* @return {undefined}
*/
function r$jscomp$1(t$jscomp$3, e$jscomp$10) {
f$jscomp$1(t$jscomp$3, e$jscomp$10, e$jscomp$10.childNodes[0]);
}
/**
* @param {!Object} t$jscomp$4
* @return {undefined}
*/
function o$jscomp$0(t$jscomp$4) {
var e$jscomp$11 = t$jscomp$4.parentNode;
if (e$jscomp$11) {
e$jscomp$11.removeChild(t$jscomp$4);
}
}
/**
* @param {!Object} t$jscomp$5
* @return {?}
*/
function i$jscomp$3(t$jscomp$5) {
/** @type {string} */
var e$jscomp$12 = t$jscomp$5.namespaceURI === P$jscomp$0 ? "xlink:href" : "src";
return t$jscomp$5.getAttribute(e$jscomp$12);
}
/**
* @param {!Element} t$jscomp$6
* @return {?}
*/
function a$jscomp$0(t$jscomp$6) {
return !(t$jscomp$6.type && !E$jscomp$0[t$jscomp$6.type.trim()]) && ((!A$jscomp$0 || !t$jscomp$6.hasAttribute("nomodule")) && !(!A$jscomp$0 && "module" === t$jscomp$6.type));
}
/**
* @param {!Function} t$jscomp$7
* @param {!Function} e$jscomp$13
* @return {?}
*/
function c$jscomp$0(t$jscomp$7, e$jscomp$13) {
return function(n$jscomp$6) {
if (e$jscomp$13(), t$jscomp$7) {
return t$jscomp$7.call(this, n$jscomp$6);
}
};
}
/**
* @param {!Node} t$jscomp$8
* @param {!Function} e$jscomp$14
* @return {undefined}
*/
function s$jscomp$2(t$jscomp$8, e$jscomp$14) {
t$jscomp$8.onload = c$jscomp$0(t$jscomp$8.onload, e$jscomp$14);
t$jscomp$8.onerror = c$jscomp$0(t$jscomp$8.onerror, e$jscomp$14);
}
/**
* @param {!Node} t$jscomp$9
* @return {?}
*/
function u$jscomp$0(t$jscomp$9) {
/** @type {!Element} */
var e$jscomp$15 = document.createElementNS(t$jscomp$9.namespaceURI, "script");
e$jscomp$15.async = t$jscomp$9.hasAttribute("async");
e$jscomp$15.textContent = t$jscomp$9.textContent;
/** @type {number} */
var n$jscomp$7 = 0;
for (; n$jscomp$7 < t$jscomp$9.attributes.length; n$jscomp$7++) {
var r$jscomp$2 = t$jscomp$9.attributes[n$jscomp$7];
if (r$jscomp$2.namespaceURI) {
e$jscomp$15.setAttributeNS(r$jscomp$2.namespaceURI, r$jscomp$2.name, r$jscomp$2.value);
} else {
e$jscomp$15.setAttribute(r$jscomp$2.name, r$jscomp$2.value);
}
}
return e$jscomp$15;
}
/**
* @param {!HTMLElement} t$jscomp$10
* @param {string} e$jscomp$16
* @return {undefined}
*/
function p$jscomp$0(t$jscomp$10, e$jscomp$16) {
var n$jscomp$8 = new k$jscomp$0(e$jscomp$16);
t$jscomp$10.dispatchEvent(n$jscomp$8);
}
/**
* @param {!Element} e$jscomp$17
* @return {?}
*/
function l$jscomp$0(e$jscomp$17) {
/** @type {boolean} */
var n$jscomp$9 = e$jscomp$17.namespaceURI === P$jscomp$0;
var r$jscomp$3 = t$jscomp$0();
e$jscomp$17.setAttribute(r$jscomp$3, "");
var i$jscomp$4 = n$jscomp$9 ? "<svg>" + e$jscomp$17.outerHTML + "</svg>" : e$jscomp$17.outerHTML;
I$jscomp$0.call(document, i$jscomp$4);
/** @type {(Element|null)} */
var a$jscomp$1 = document.querySelector("[" + r$jscomp$3 + "]");
if (a$jscomp$1) {
a$jscomp$1.removeAttribute(r$jscomp$3);
/** @type {(Node|boolean|null)} */
var c$jscomp$1 = n$jscomp$9 && a$jscomp$1.parentNode;
if (c$jscomp$1) {
o$jscomp$0(c$jscomp$1);
}
}
return a$jscomp$1;
}
/**
* @param {!Object} t$jscomp$11
* @return {?}
*/
function d$jscomp$0(t$jscomp$11) {
if (t$jscomp$11 && "handleEvent" in t$jscomp$11) {
var e$jscomp$18 = t$jscomp$11.handleEvent;
return "function" == typeof e$jscomp$18 ? e$jscomp$18.bind(t$jscomp$11) : e$jscomp$18;
}
return t$jscomp$11;
}
/**
* @param {?} t$jscomp$12
* @param {!Element} e$jscomp$19
* @param {!Function} n$jscomp$10
* @return {undefined}
*/
function f$jscomp$1(t$jscomp$12, e$jscomp$19, n$jscomp$10) {
/** @type {function(?): ?} */
var r$jscomp$4 = n$jscomp$10 ? function(t$jscomp$13) {
return e$jscomp$19.insertBefore(t$jscomp$13, n$jscomp$10);
} : function(t$jscomp$14) {
return e$jscomp$19.appendChild(t$jscomp$14);
};
Array.prototype.slice.call(t$jscomp$12).forEach(r$jscomp$4);
}
/**
* @return {?}
*/
function h$jscomp$6() {
return /chrome/i.test(navigator.userAgent) && /google/i.test(navigator.vendor);
}
/**
* @param {!Function} t$jscomp$15
* @param {!Object} e$jscomp$20
* @return {undefined}
*/
function v$jscomp$0(t$jscomp$15, e$jscomp$20) {
/**
* @return {undefined}
*/
function n$jscomp$11() {
/** @type {!Function} */
this.constructor = t$jscomp$15;
}
_$jscomp$0(t$jscomp$15, e$jscomp$20);
t$jscomp$15.prototype = null === e$jscomp$20 ? Object.create(e$jscomp$20) : (n$jscomp$11.prototype = e$jscomp$20.prototype, new n$jscomp$11);
}
/**
* @param {!AudioNode} t$jscomp$16
* @return {?}
*/
function m$jscomp$0(t$jscomp$16) {
return t$jscomp$16 instanceof Window ? ["load"] : t$jscomp$16 instanceof Document ? ["DOMContentLoaded", "readystatechange"] : [];
}
/**
* @param {!Object} t$jscomp$17
* @return {?}
*/
function y$jscomp$59(t$jscomp$17) {
var e$jscomp$21 = t$jscomp$17.getAttribute(W$jscomp$0);
if (!e$jscomp$21) {
return null;
}
var n$jscomp$12 = e$jscomp$21.split(R$jscomp$0);
return {
nonce : n$jscomp$12[0],
handlerPrefixLength : +n$jscomp$12[1],
bailout : !t$jscomp$17.hasAttribute("defer")
};
}
/**
* @param {!Object} t$jscomp$18
* @return {undefined}
*/
function b$jscomp$0(t$jscomp$18) {
/** @type {string} */
var e$jscomp$22 = T$jscomp$0 + t$jscomp$18.nonce;
Array.prototype.forEach.call(document.querySelectorAll("[" + e$jscomp$22 + "]"), function(n$jscomp$13) {
n$jscomp$13.removeAttribute(e$jscomp$22);
Array.prototype.forEach.call(n$jscomp$13.attributes, function(e$jscomp$23) {
if (/^on/.test(e$jscomp$23.name) && "function" != typeof n$jscomp$13[e$jscomp$23.name]) {
n$jscomp$13.setAttribute(e$jscomp$23.name, e$jscomp$23.value.substring(t$jscomp$18.handlerPrefixLength));
}
});
});
}
/**
* @return {undefined}
*/
function g$jscomp$0() {
/** @type {!Window} */
var t$jscomp$19 = window;
if ("undefined" != typeof Promise) {
t$jscomp$19.__cfQR = {
done : new Promise(function(t$jscomp$20) {
return B$jscomp$0 = t$jscomp$20;
})
};
}
}
/**
* @param {?} t$jscomp$21
* @return {undefined}
*/
function S$jscomp$0(t$jscomp$21) {
var e$jscomp$24 = new D$jscomp$0(t$jscomp$21);
var n$jscomp$14 = new O$jscomp$0(e$jscomp$24);
e$jscomp$24.harvestScriptsInDocument();
(new j$jscomp$0(e$jscomp$24, {
blocking : true,
docWriteSimulator : n$jscomp$14,
callback : function() {
}
})).run();
}
/**
* @param {?} t$jscomp$22
* @return {undefined}
*/
function w$jscomp$7(t$jscomp$22) {
var e$jscomp$25 = new D$jscomp$0(t$jscomp$22);
var n$jscomp$15 = new O$jscomp$0(e$jscomp$25);
e$jscomp$25.harvestScriptsInDocument();
var r$jscomp$5 = new j$jscomp$0(e$jscomp$25, {
blocking : false,
docWriteSimulator : n$jscomp$15,
callback : function() {
/** @type {boolean} */
window.__cfRLUnblockHandlers = true;
r$jscomp$5.removePreloadHints();
x$jscomp$74(t$jscomp$22);
}
});
r$jscomp$5.insertPreloadHints();
M$jscomp$0.runOnLoad(function() {
r$jscomp$5.run();
});
}
/**
* @param {?} t$jscomp$23
* @return {undefined}
*/
function x$jscomp$74(t$jscomp$23) {
var e$jscomp$26 = new N$jscomp$0(t$jscomp$23);
M$jscomp$0.simulateStateBeforeDeferScriptsActivation();
e$jscomp$26.harvestDeferScriptsInDocument();
(new j$jscomp$0(e$jscomp$26, {
blocking : false,
callback : function() {
M$jscomp$0.simulateStateAfterDeferScriptsActivation();
if (B$jscomp$0) {
B$jscomp$0();
}
}
})).run();
}
/** @type {string} */
var P$jscomp$0 = "http://www.w3.org/2000/svg";
var E$jscomp$0 = {
"application/ecmascript" : true,
"application/javascript" : true,
"application/x-ecmascript" : true,
"application/x-javascript" : true,
"text/ecmascript" : true,
"text/javascript" : true,
"text/javascript1.0" : true,
"text/javascript1.1" : true,
"text/javascript1.2" : true,
"text/javascript1.3" : true,
"text/javascript1.4" : true,
"text/javascript1.5" : true,
"text/jscript" : true,
"text/livescript" : true,
"text/x-ecmascript" : true,
"text/x-javascript" : true,
module : true
};
/** @type {boolean} */
var A$jscomp$0 = void 0 !== document.createElement("script").noModule;
var k$jscomp$0 = function() {
/** @type {!Window} */
var t$jscomp$24 = window;
return t$jscomp$24.__rocketLoaderEventCtor || Object.defineProperty(t$jscomp$24, "__rocketLoaderEventCtor", {
value : Event
}), t$jscomp$24.__rocketLoaderEventCtor;
}();
/** @type {function(string=): undefined} */
var I$jscomp$0 = document.write;
/** @type {function(string=): undefined} */
var L$jscomp$0 = document.writeln;
/** @type {function(!Object, ?): !Object} */
var _$jscomp$0 = Object.setPrototypeOf || {
__proto__ : []
} instanceof Array && function(t$jscomp$25, e$jscomp$27) {
/** @type {!Object} */
t$jscomp$25.__proto__ = e$jscomp$27;
} || function(t$jscomp$26, e$jscomp$28) {
var n$jscomp$16;
for (n$jscomp$16 in e$jscomp$28) {
if (e$jscomp$28.hasOwnProperty(n$jscomp$16)) {
t$jscomp$26[n$jscomp$16] = e$jscomp$28[n$jscomp$16];
}
}
};
var H$jscomp$0 = function() {
/**
* @param {string} t$jscomp$28
* @return {undefined}
*/
function t$jscomp$27(t$jscomp$28) {
/** @type {string} */
this.nonce = t$jscomp$28;
/** @type {!Array} */
this.items = [];
}
return Object.defineProperty(t$jscomp$27.prototype, "hasItems", {
get : function() {
return this.items.length > 0;
},
enumerable : true,
configurable : true
}), t$jscomp$27.prototype.pop = function() {
return this.items.pop();
}, t$jscomp$27.prototype.forEach = function(t$jscomp$29) {
this.items.forEach(function(e$jscomp$29) {
var n$jscomp$17 = e$jscomp$29.script;
return t$jscomp$29(n$jscomp$17);
});
}, t$jscomp$27.prototype.harvestScripts = function(t$jscomp$30, e$jscomp$30) {
var n$jscomp$18 = this;
var r$jscomp$6 = e$jscomp$30.filter;
var o$jscomp$1 = e$jscomp$30.mutate;
Array.prototype.slice.call(t$jscomp$30.querySelectorAll("script")).filter(r$jscomp$6).reverse().forEach(function(t$jscomp$31) {
o$jscomp$1(t$jscomp$31);
n$jscomp$18.pushScriptOnStack(t$jscomp$31);
});
}, t$jscomp$27.prototype.pushScriptOnStack = function(t$jscomp$32) {
var e$jscomp$31 = t$jscomp$32.parentNode;
var n$jscomp$19 = this.createPlaceholder(t$jscomp$32);
/** @type {boolean} */
var r$jscomp$7 = !!i$jscomp$3(t$jscomp$32);
e$jscomp$31.replaceChild(n$jscomp$19, t$jscomp$32);
this.items.push({
script : t$jscomp$32,
placeholder : n$jscomp$19,
external : r$jscomp$7,
async : r$jscomp$7 && t$jscomp$32.hasAttribute("async"),
executable : a$jscomp$0(t$jscomp$32)
});
}, t$jscomp$27.prototype.hasNonce = function(t$jscomp$33) {
return 0 === t$jscomp$33.type.indexOf(this.nonce);
}, t$jscomp$27.prototype.removeNonce = function(t$jscomp$34) {
t$jscomp$34.type = t$jscomp$34.type.substr(this.nonce.length);
}, t$jscomp$27.prototype.makeNonExecutable = function(t$jscomp$35) {
t$jscomp$35.type = this.nonce + t$jscomp$35.type;
}, t$jscomp$27.prototype.isPendingDeferScript = function(t$jscomp$36) {
return t$jscomp$36.hasAttribute("defer") || t$jscomp$36.type === this.nonce + "module" && !t$jscomp$36.hasAttribute("async");
}, t$jscomp$27;
}();
var D$jscomp$0 = function(t$jscomp$37) {
/**
* @return {?}
*/
function e$jscomp$32() {
return null !== t$jscomp$37 && t$jscomp$37.apply(this, arguments) || this;
}
return v$jscomp$0(e$jscomp$32, t$jscomp$37), e$jscomp$32.prototype.harvestScriptsInDocument = function() {
var t$jscomp$38 = this;
this.harvestScripts(document, {
filter : function(e$jscomp$33) {
return t$jscomp$38.hasNonce(e$jscomp$33);
},
mutate : function(e$jscomp$34) {
if (!t$jscomp$38.isPendingDeferScript(e$jscomp$34)) {
t$jscomp$38.removeNonce(e$jscomp$34);
}
}
});
}, e$jscomp$32.prototype.harvestScriptsAfterDocWrite = function(t$jscomp$39) {
var e$jscomp$35 = this;
this.harvestScripts(t$jscomp$39, {
filter : a$jscomp$0,
mutate : function(t$jscomp$40) {
if (e$jscomp$35.isPendingDeferScript(t$jscomp$40)) {
e$jscomp$35.makeNonExecutable(t$jscomp$40);
}
}
});
}, e$jscomp$32.prototype.createPlaceholder = function(t$jscomp$41) {
return document.createComment(t$jscomp$41.outerHTML);
}, e$jscomp$32;
}(H$jscomp$0);
var N$jscomp$0 = function(t$jscomp$42) {
/**
* @return {?}
*/
function e$jscomp$36() {
return null !== t$jscomp$42 && t$jscomp$42.apply(this, arguments) || this;
}
return v$jscomp$0(e$jscomp$36, t$jscomp$42), e$jscomp$36.prototype.harvestDeferScriptsInDocument = function() {
var t$jscomp$43 = this;
this.harvestScripts(document, {
filter : function(e$jscomp$37) {
return t$jscomp$43.hasNonce(e$jscomp$37) && t$jscomp$43.isPendingDeferScript(e$jscomp$37);
},
mutate : function(e$jscomp$38) {
return t$jscomp$43.removeNonce(e$jscomp$38);
}
});
}, e$jscomp$36.prototype.createPlaceholder = function(t$jscomp$44) {
var e$jscomp$39 = u$jscomp$0(t$jscomp$44);
return this.makeNonExecutable(e$jscomp$39), e$jscomp$39;
}, e$jscomp$36;
}(H$jscomp$0);
var O$jscomp$0 = function() {
/**
* @param {?} t$jscomp$46
* @return {undefined}
*/
function t$jscomp$45(t$jscomp$46) {
this.scriptStack = t$jscomp$46;
}
return t$jscomp$45.prototype.enable = function(t$jscomp$47) {
var e$jscomp$40 = this;
/** @type {string} */
this.insertionPointMarker = t$jscomp$47;
/** @type {string} */
this.buffer = "";
/**
* @param {string=} p0
* @return {undefined}
*/
document.write = function() {
/** @type {!Array} */
var t$jscomp$48 = [];
/** @type {number} */
var n$jscomp$20 = 0;
for (; n$jscomp$20 < arguments.length; n$jscomp$20++) {
t$jscomp$48[n$jscomp$20] = arguments[n$jscomp$20];
}
return e$jscomp$40.write(t$jscomp$48, false);
};
/**
* @param {string=} p0
* @return {undefined}
*/
document.writeln = function() {
/** @type {!Array} */
var t$jscomp$49 = [];
/** @type {number} */
var n$jscomp$21 = 0;
for (; n$jscomp$21 < arguments.length; n$jscomp$21++) {
t$jscomp$49[n$jscomp$21] = arguments[n$jscomp$21];
}
return e$jscomp$40.write(t$jscomp$49, true);
};
}, t$jscomp$45.prototype.flushWrittenContentAndDisable = function() {
/** @type {function(string=): undefined} */
document.write = I$jscomp$0;
/** @type {function(string=): undefined} */
document.writeln = L$jscomp$0;
if (this.buffer.length) {
if (document.contains(this.insertionPointMarker)) {
if (this.insertionPointMarker.parentNode === document.head) {
this.insertContentInHead();
} else {
this.insertContentInBody();
}
} else {
e$jscomp$7("Insertion point marker for document.write was detached from document:", "Markup will not be inserted");
}
}
}, t$jscomp$45.prototype.insertContentInHead = function() {
/** @type {!DOMParser} */
var t$jscomp$50 = new DOMParser;
/** @type {string} */
var e$jscomp$41 = "<!DOCTYPE html><head>" + this.buffer + "</head>";
/** @type {(Document|null)} */
var o$jscomp$2 = t$jscomp$50.parseFromString(e$jscomp$41, "text/html");
if (this.scriptStack.harvestScriptsAfterDocWrite(o$jscomp$2), n$jscomp$3(o$jscomp$2.head.childNodes, this.insertionPointMarker), o$jscomp$2.body.childNodes.length) {
/** @type {!Array<?>} */
var i$jscomp$5 = Array.prototype.slice.call(o$jscomp$2.body.childNodes);
var a$jscomp$2 = this.insertionPointMarker.nextSibling;
for (; a$jscomp$2;) {
i$jscomp$5.push(a$jscomp$2);
a$jscomp$2 = a$jscomp$2.nextSibling;
}
if (!document.body) {
I$jscomp$0.call(document, "<body>");
}
r$jscomp$1(i$jscomp$5, document.body);
}
}, t$jscomp$45.prototype.insertContentInBody = function() {
var t$jscomp$51 = this.insertionPointMarker.parentElement;
/** @type {!Element} */
var e$jscomp$42 = document.createElement(t$jscomp$51.tagName);
e$jscomp$42.innerHTML = this.buffer;
this.scriptStack.harvestScriptsAfterDocWrite(e$jscomp$42);
n$jscomp$3(e$jscomp$42.childNodes, this.insertionPointMarker);
}, t$jscomp$45.prototype.write = function(t$jscomp$52, e$jscomp$43) {
/** @type {(HTMLScriptElement|null)} */
var n$jscomp$22 = document.currentScript;
if (n$jscomp$22 && i$jscomp$3(n$jscomp$22) && n$jscomp$22.hasAttribute("async")) {
(r$jscomp$8 = e$jscomp$43 ? L$jscomp$0 : I$jscomp$0).call.apply(r$jscomp$8, [document].concat(t$jscomp$52));
} else {
this.buffer += t$jscomp$52.map(String).join(e$jscomp$43 ? "\n" : "");
}
var r$jscomp$8;
}, t$jscomp$45;
}();
var C$jscomp$0 = function() {
/**
* @return {undefined}
*/
function t$jscomp$53() {
var t$jscomp$54 = this;
/** @type {string} */
this.simulatedReadyState = "loading";
/** @type {boolean} */
this.bypassEventsInProxies = false;
/** @type {function(this:Window, string, (EventListener|function(!Event): (boolean|undefined)|null), (AddEventListenerOptions|boolean)=): undefined} */
this.nativeWindowAddEventListener = window.addEventListener;
try {
Object.defineProperty(document, "readyState", {
get : function() {
return t$jscomp$54.simulatedReadyState;
}
});
} catch (e$jscomp$44) {
}
this.setupEventListenerProxy();
this.updateInlineHandlers();
}
return t$jscomp$53.prototype.runOnLoad = function(t$jscomp$55) {
var e$jscomp$45 = this;
this.nativeWindowAddEventListener.call(window, "load", function(n$jscomp$23) {
if (!e$jscomp$45.bypassEventsInProxies) {
return t$jscomp$55(n$jscomp$23);
}
});
}, t$jscomp$53.prototype.updateInlineHandlers = function() {
this.proxyInlineHandler(document, "onreadystatechange");
this.proxyInlineHandler(window, "onload");
if (document.body) {
this.proxyInlineHandler(document.body, "onload");
}
}, t$jscomp$53.prototype.simulateStateBeforeDeferScriptsActivation = function() {
/** @type {boolean} */
this.bypassEventsInProxies = true;
/** @type {string} */
this.simulatedReadyState = "interactive";
p$jscomp$0(document, "readystatechange");
/** @type {boolean} */
this.bypassEventsInProxies = false;
}, t$jscomp$53.prototype.simulateStateAfterDeferScriptsActivation = function() {
var t$jscomp$56 = this;
/** @type {boolean} */
this.bypassEventsInProxies = true;
p$jscomp$0(document, "DOMContentLoaded");
/** @type {string} */
this.simulatedReadyState = "complete";
p$jscomp$0(document, "readystatechange");
p$jscomp$0(window, "load");
/** @type {boolean} */
this.bypassEventsInProxies = false;
window.setTimeout(function() {
return t$jscomp$56.bypassEventsInProxies = true;
}, 0);
}, t$jscomp$53.prototype.setupEventListenerProxy = function() {
var t$jscomp$57 = this;
("undefined" != typeof EventTarget ? [EventTarget.prototype] : [Node.prototype, Window.prototype]).forEach(function(e$jscomp$46) {
return t$jscomp$57.patchEventTargetMethods(e$jscomp$46);
});
}, t$jscomp$53.prototype.patchEventTargetMethods = function(t$jscomp$58) {
var e$jscomp$47 = this;
/** @type {function(?, !Object): undefined} */
var n$jscomp$24 = t$jscomp$58.addEventListener;
/** @type {function(?, string): undefined} */
var r$jscomp$9 = t$jscomp$58.removeEventListener;
/**
* @param {?} t$jscomp$59
* @param {!Object} r$jscomp$10
* @return {undefined}
*/
t$jscomp$58.addEventListener = function(t$jscomp$59, r$jscomp$10) {
/** @type {!Array} */
var o$jscomp$3 = [];
/** @type {number} */
var i$jscomp$6 = 2;
for (; i$jscomp$6 < arguments.length; i$jscomp$6++) {
o$jscomp$3[i$jscomp$6 - 2] = arguments[i$jscomp$6];
}
var a$jscomp$3 = m$jscomp$0(this);
var c$jscomp$2 = r$jscomp$10 && r$jscomp$10.__rocketLoaderProxiedHandler;
if (!c$jscomp$2) {
var s$jscomp$3 = d$jscomp$0(r$jscomp$10);
if ("function" == typeof s$jscomp$3) {
/**
* @param {?} n$jscomp$25
* @return {?}
*/
c$jscomp$2 = function(n$jscomp$25) {
if (e$jscomp$47.bypassEventsInProxies || a$jscomp$3.indexOf(t$jscomp$59) < 0) {
return s$jscomp$3.call(this, n$jscomp$25);
}
};
Object.defineProperty(r$jscomp$10, "__rocketLoaderProxiedHandler", {
value : c$jscomp$2
});
} else {
/** @type {!Object} */
c$jscomp$2 = r$jscomp$10;
}
}
n$jscomp$24.call.apply(n$jscomp$24, [this, t$jscomp$59, c$jscomp$2].concat(o$jscomp$3));
};
/**
* @param {?} t$jscomp$60
* @param {string} e$jscomp$48
* @return {undefined}
*/
t$jscomp$58.removeEventListener = function(t$jscomp$60, e$jscomp$48) {
/** @type {!Array} */
var n$jscomp$26 = [];
/** @type {number} */
var o$jscomp$4 = 2;
for (; o$jscomp$4 < arguments.length; o$jscomp$4++) {
n$jscomp$26[o$jscomp$4 - 2] = arguments[o$jscomp$4];
}
var i$jscomp$7 = e$jscomp$48 && e$jscomp$48.__rocketLoaderProxiedHandler || e$jscomp$48;
r$jscomp$9.call.apply(r$jscomp$9, [this, t$jscomp$60, i$jscomp$7].concat(n$jscomp$26));
};
}, t$jscomp$53.prototype.proxyInlineHandler = function(t$jscomp$61, e$jscomp$49) {
var n$jscomp$27 = t$jscomp$61[e$jscomp$49];
if (n$jscomp$27 && !n$jscomp$27.__rocketLoaderInlineHandlerProxy) {
var r$jscomp$11 = this;
/**
* @param {?} t$jscomp$62
* @return {?}
*/
t$jscomp$61[e$jscomp$49] = function(t$jscomp$62) {
if (r$jscomp$11.bypassEventsInProxies) {
return n$jscomp$27.call(this, t$jscomp$62);
}
};
}
}, t$jscomp$53;
}();
var M$jscomp$0 = function() {
/** @type {!Window} */
var t$jscomp$63 = window;
return t$jscomp$63.__rocketLoaderLoadProgressSimulator || Object.defineProperty(t$jscomp$63, "__rocketLoaderLoadProgressSimulator", {
value : new C$jscomp$0
}), t$jscomp$63.__rocketLoaderLoadProgressSimulator;
}();
var j$jscomp$0 = function() {
/**
* @param {?} t$jscomp$65
* @param {!Object} e$jscomp$50
* @return {undefined}
*/
function t$jscomp$64(t$jscomp$65, e$jscomp$50) {
this.scriptStack = t$jscomp$65;
/** @type {!Object} */
this.settings = e$jscomp$50;
/** @type {!Array} */
this.preloadHints = [];
}
return t$jscomp$64.prototype.insertPreloadHints = function() {
var t$jscomp$66 = this;
this.scriptStack.forEach(function(e$jscomp$51) {
var n$jscomp$28 = i$jscomp$3(e$jscomp$51);
var r$jscomp$12 = h$jscomp$6() && e$jscomp$51.hasAttribute("integrity");
if (n$jscomp$28 && !r$jscomp$12) {
/** @type {!Element} */
var o$jscomp$5 = document.createElement("link");
o$jscomp$5.setAttribute("rel", "preload");
o$jscomp$5.setAttribute("as", "script");
o$jscomp$5.setAttribute("href", n$jscomp$28);
if (e$jscomp$51.crossOrigin) {
o$jscomp$5.setAttribute("crossorigin", e$jscomp$51.crossOrigin);
}
document.head.appendChild(o$jscomp$5);
t$jscomp$66.preloadHints.push(o$jscomp$5);
}
});
}, t$jscomp$64.prototype.removePreloadHints = function() {
this.preloadHints.forEach(function(t$jscomp$67) {
return o$jscomp$0(t$jscomp$67);
});
}, t$jscomp$64.prototype.run = function() {
var t$jscomp$68 = this;
var e$jscomp$52 = this;
for (; this.scriptStack.hasItems;) {
var n$jscomp$29 = function() {
var n$jscomp$30 = e$jscomp$52.settings.docWriteSimulator;
var r$jscomp$13 = e$jscomp$52.scriptStack.pop();
if (n$jscomp$30 && !r$jscomp$13.async) {
n$jscomp$30.enable(r$jscomp$13.placeholder);
}
var o$jscomp$6 = e$jscomp$52.activateScript(r$jscomp$13);
return o$jscomp$6 ? r$jscomp$13.external && r$jscomp$13.executable && !r$jscomp$13.async ? (s$jscomp$2(o$jscomp$6, function() {
t$jscomp$68.finalizeActivation(r$jscomp$13);
t$jscomp$68.run();
}), {
value : void 0
}) : void e$jscomp$52.finalizeActivation(r$jscomp$13) : (n$jscomp$30 && n$jscomp$30.flushWrittenContentAndDisable(), "continue");
}();
if ("object" == typeof n$jscomp$29) {
return n$jscomp$29.value;
}
}
if (!this.scriptStack.hasItems) {
this.settings.callback();
}
}, t$jscomp$64.prototype.finalizeActivation = function(t$jscomp$69) {
if (this.settings.docWriteSimulator && !t$jscomp$69.async) {
this.settings.docWriteSimulator.flushWrittenContentAndDisable();
}
M$jscomp$0.updateInlineHandlers();
o$jscomp$0(t$jscomp$69.placeholder);
}, t$jscomp$64.prototype.activateScript = function(t$jscomp$70) {
var n$jscomp$31 = t$jscomp$70.script;
var r$jscomp$14 = t$jscomp$70.placeholder;
var o$jscomp$7 = t$jscomp$70.external;
var i$jscomp$8 = t$jscomp$70.async;
var a$jscomp$4 = r$jscomp$14.parentNode;
if (!document.contains(r$jscomp$14)) {
return e$jscomp$7("Placeholder for script \n" + n$jscomp$31.outerHTML + "\n was detached from document.", "Script will not be executed."), null;
}
var c$jscomp$3 = this.settings.blocking && o$jscomp$7 && !i$jscomp$8 ? l$jscomp$0(n$jscomp$31) : u$jscomp$0(n$jscomp$31);
return c$jscomp$3 ? (a$jscomp$4.insertBefore(c$jscomp$3, r$jscomp$14), c$jscomp$3) : (e$jscomp$7("Failed to create activatable copy of script \n" + n$jscomp$31.outerHTML + "\n", "Script will not be executed."), null);
}, t$jscomp$64;
}();
/** @type {string} */
var W$jscomp$0 = "data-cf-settings";
/** @type {string} */
var R$jscomp$0 = "|";
/** @type {string} */
var T$jscomp$0 = "data-cf-modified-";
var B$jscomp$0 = void 0;
!function() {
/** @type {(HTMLScriptElement|null)} */
var t$jscomp$71 = document.currentScript;
if (t$jscomp$71) {
var n$jscomp$32 = y$jscomp$59(t$jscomp$71);
if (n$jscomp$32) {
o$jscomp$0(t$jscomp$71);
b$jscomp$0(n$jscomp$32);
M$jscomp$0.updateInlineHandlers();
if (n$jscomp$32.bailout) {
S$jscomp$0(n$jscomp$32.nonce);
} else {
g$jscomp$0();
w$jscomp$7(n$jscomp$32.nonce);
}
} else {
e$jscomp$7("Activator script doesn't have settings. No scripts will be executed.");
}
} else {
e$jscomp$7("Can't obtain activator script. No scripts will be executed.");
}
}();
}();
!function(){"use strict";function t(){return"cf-marker-"+Math.random().toString().slice(2)}function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];(n=console.warn||console.log).call.apply(n,[console,"[ROCKET LOADER] "].concat(t));var n}function n(t,e){var n=e.parentNode;n&&f(t,n,e)}function r(t,e){f(t,e,e.childNodes[0])}function o(t){var e=t.parentNode;e&&e.removeChild(t)}function i(t){var e=t.namespaceURI===P?"xlink:href":"src";return t.getAttribute(e)}function a(t){return!(t.type&&!E[t.type.trim()])&&((!A||!t.hasAttribute("nomodule"))&&!(!A&&"module"===t.type))}function c(t,e){return function(n){if(e(),t)return t.call(this,n)}}function s(t,e){t.onload=c(t.onload,e),t.onerror=c(t.onerror,e)}function u(t){var e=document.createElementNS(t.namespaceURI,"script");e.async=t.hasAttribute("async"),e.textContent=t.textContent;for(var n=0;n<t.attributes.length;n++){var r=t.attributes[n];r.namespaceURI?e.setAttributeNS(r.namespaceURI,r.name,r.value):e.setAttribute(r.name,r.value)}return e}function p(t,e){var n=new k(e);t.dispatchEvent(n)}function l(e){var n=e.namespaceURI===P,r=t();e.setAttribute(r,"");var i=n?"<svg>"+e.outerHTML+"</svg>":e.outerHTML;I.call(document,i);var a=document.querySelector("["+r+"]");if(a){a.removeAttribute(r);var c=n&&a.parentNode;c&&o(c)}return a}function d(t){if(t&&"handleEvent"in t){var e=t.handleEvent;return"function"==typeof e?e.bind(t):e}return t}function f(t,e,n){var r=n?function(t){return e.insertBefore(t,n)}:function(t){return e.appendChild(t)};Array.prototype.slice.call(t).forEach(r)}function h(){return/chrome/i.test(navigator.userAgent)&&/google/i.test(navigator.vendor)}function v(t,e){function n(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function m(t){return t instanceof Window?["load"]:t instanceof Document?["DOMContentLoaded","readystatechange"]:[]}function y(t){var e=t.getAttribute(W);if(!e)return null;var n=e.split(R);return{nonce:n[0],handlerPrefixLength:+n[1],bailout:!t.hasAttribute("defer")}}function b(t){var e=T+t.nonce;Array.prototype.forEach.call(document.querySelectorAll("["+e+"]"),function(n){n.removeAttribute(e),Array.prototype.forEach.call(n.attributes,function(e){/^on/.test(e.name)&&"function"!=typeof n[e.name]&&n.setAttribute(e.name,e.value.substring(t.handlerPrefixLength))})})}function g(){var t=window;"undefined"!=typeof Promise&&(t.__cfQR={done:new Promise(function(t){return B=t})})}function S(t){var e=new D(t),n=new O(e);e.harvestScriptsInDocument(),new j(e,{blocking:!0,docWriteSimulator:n,callback:function(){}}).run()}function w(t){var e=new D(t),n=new O(e);e.harvestScriptsInDocument();var r=new j(e,{blocking:!1,docWriteSimulator:n,callback:function(){window.__cfRLUnblockHandlers=!0,r.removePreloadHints(),x(t)}});r.insertPreloadHints(),M.runOnLoad(function(){r.run()})}function x(t){var e=new N(t);M.simulateStateBeforeDeferScriptsActivation(),e.harvestDeferScriptsInDocument(),new j(e,{blocking:!1,callback:function(){M.simulateStateAfterDeferScriptsActivation(),B&&B()}}).run()}var P="http://www.w3.org/2000/svg",E={"application/ecmascript":!0,"application/javascript":!0,"application/x-ecmascript":!0,"application/x-javascript":!0,"text/ecmascript":!0,"text/javascript":!0,"text/javascript1.0":!0,"text/javascript1.1":!0,"text/javascript1.2":!0,"text/javascript1.3":!0,"text/javascript1.4":!0,"text/javascript1.5":!0,"text/jscript":!0,"text/livescript":!0,"text/x-ecmascript":!0,"text/x-javascript":!0,module:!0},A=void 0!==document.createElement("script").noModule,k=function(){var t=window;return t.__rocketLoaderEventCtor||Object.defineProperty(t,"__rocketLoaderEventCtor",{value:Event}),t.__rocketLoaderEventCtor}(),I=document.write,L=document.writeln,_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},H=function(){function t(t){this.nonce=t,this.items=[]}return Object.defineProperty(t.prototype,"hasItems",{get:function(){return this.items.length>0},enumerable:!0,configurable:!0}),t.prototype.pop=function(){return this.items.pop()},t.prototype.forEach=function(t){this.items.forEach(function(e){var n=e.script;return t(n)})},t.prototype.harvestScripts=function(t,e){var n=this,r=e.filter,o=e.mutate;Array.prototype.slice.call(t.querySelectorAll("script")).filter(r).reverse().forEach(function(t){o(t),n.pushScriptOnStack(t)})},t.prototype.pushScriptOnStack=function(t){var e=t.parentNode,n=this.createPlaceholder(t),r=!!i(t);e.replaceChild(n,t),this.items.push({script:t,placeholder:n,external:r,async:r&&t.hasAttribute("async"),executable:a(t)})},t.prototype.hasNonce=function(t){return 0===t.type.indexOf(this.nonce)},t.prototype.removeNonce=function(t){t.type=t.type.substr(this.nonce.length)},t.prototype.makeNonExecutable=function(t){t.type=this.nonce+t.type},t.prototype.isPendingDeferScript=function(t){return t.hasAttribute("defer")||t.type===this.nonce+"module"&&!t.hasAttribute("async")},t}(),D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.harvestScriptsInDocument=function(){var t=this;this.harvestScripts(document,{filter:function(e){return t.hasNonce(e)},mutate:function(e){t.isPendingDeferScript(e)||t.removeNonce(e)}})},e.prototype.harvestScriptsAfterDocWrite=function(t){var e=this;this.harvestScripts(t,{filter:a,mutate:function(t){e.isPendingDeferScript(t)&&e.makeNonExecutable(t)}})},e.prototype.createPlaceholder=function(t){return document.createComment(t.outerHTML)},e}(H),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.harvestDeferScriptsInDocument=function(){var t=this;this.harvestScripts(document,{filter:function(e){return t.hasNonce(e)&&t.isPendingDeferScript(e)},mutate:function(e){return t.removeNonce(e)}})},e.prototype.createPlaceholder=function(t){var e=u(t);return this.makeNonExecutable(e),e},e}(H),O=function(){function t(t){this.scriptStack=t}return t.prototype.enable=function(t){var e=this;this.insertionPointMarker=t,this.buffer="",document.write=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.write(t,!1)},document.writeln=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.write(t,!0)}},t.prototype.flushWrittenContentAndDisable=function(){document.write=I,document.writeln=L,this.buffer.length&&(document.contains(this.insertionPointMarker)?this.insertionPointMarker.parentNode===document.head?this.insertContentInHead():this.insertContentInBody():e("Insertion point marker for document.write was detached from document:","Markup will not be inserted"))},t.prototype.insertContentInHead=function(){var t=new DOMParser,e="<!DOCTYPE html><head>"+this.buffer+"</head>",o=t.parseFromString(e,"text/html");if(this.scriptStack.harvestScriptsAfterDocWrite(o),n(o.head.childNodes,this.insertionPointMarker),o.body.childNodes.length){for(var i=Array.prototype.slice.call(o.body.childNodes),a=this.insertionPointMarker.nextSibling;a;)i.push(a),a=a.nextSibling;document.body||I.call(document,"<body>"),r(i,document.body)}},t.prototype.insertContentInBody=function(){var t=this.insertionPointMarker.parentElement,e=document.createElement(t.tagName);e.innerHTML=this.buffer,this.scriptStack.harvestScriptsAfterDocWrite(e),n(e.childNodes,this.insertionPointMarker)},t.prototype.write=function(t,e){var n=document.currentScript;n&&i(n)&&n.hasAttribute("async")?(r=e?L:I).call.apply(r,[document].concat(t)):this.buffer+=t.map(String).join(e?"\n":"");var r},t}(),C=function(){function t(){var t=this;this.simulatedReadyState="loading",this.bypassEventsInProxies=!1,this.nativeWindowAddEventListener=window.addEventListener;try{Object.defineProperty(document,"readyState",{get:function(){return t.simulatedReadyState}})}catch(e){}this.setupEventListenerProxy(),this.updateInlineHandlers()}return t.prototype.runOnLoad=function(t){var e=this;this.nativeWindowAddEventListener.call(window,"load",function(n){if(!e.bypassEventsInProxies)return t(n)})},t.prototype.updateInlineHandlers=function(){this.proxyInlineHandler(document,"onreadystatechange"),this.proxyInlineHandler(window,"onload"),document.body&&this.proxyInlineHandler(document.body,"onload")},t.prototype.simulateStateBeforeDeferScriptsActivation=function(){this.bypassEventsInProxies=!0,this.simulatedReadyState="interactive",p(document,"readystatechange"),this.bypassEventsInProxies=!1},t.prototype.simulateStateAfterDeferScriptsActivation=function(){var t=this;this.bypassEventsInProxies=!0,p(document,"DOMContentLoaded"),this.simulatedReadyState="complete",p(document,"readystatechange"),p(window,"load"),this.bypassEventsInProxies=!1,window.setTimeout(function(){return t.bypassEventsInProxies=!0},0)},t.prototype.setupEventListenerProxy=function(){var t=this;("undefined"!=typeof EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]).forEach(function(e){return t.patchEventTargetMethods(e)})},t.prototype.patchEventTargetMethods=function(t){var e=this,n=t.addEventListener,r=t.removeEventListener;t.addEventListener=function(t,r){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var a=m(this),c=r&&r.__rocketLoaderProxiedHandler;if(!c){var s=d(r);"function"==typeof s?(c=function(n){if(e.bypassEventsInProxies||a.indexOf(t)<0)return s.call(this,n)},Object.defineProperty(r,"__rocketLoaderProxiedHandler",{value:c})):c=r}n.call.apply(n,[this,t,c].concat(o))},t.removeEventListener=function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var i=e&&e.__rocketLoaderProxiedHandler||e;r.call.apply(r,[this,t,i].concat(n))}},t.prototype.proxyInlineHandler=function(t,e){var n=t[e];if(n&&!n.__rocketLoaderInlineHandlerProxy){var r=this;t[e]=function(t){if(r.bypassEventsInProxies)return n.call(this,t)}}},t}(),M=function(){var t=window;return t.__rocketLoaderLoadProgressSimulator||Object.defineProperty(t,"__rocketLoaderLoadProgressSimulator",{value:new C}),t.__rocketLoaderLoadProgressSimulator}(),j=function(){function t(t,e){this.scriptStack=t,this.settings=e,this.preloadHints=[]}return t.prototype.insertPreloadHints=function(){var t=this;this.scriptStack.forEach(function(e){var n=i(e),r=h()&&e.hasAttribute("integrity");if(n&&!r){var o=document.createElement("link");o.setAttribute("rel","preload"),o.setAttribute("as","script"),o.setAttribute("href",n),e.crossOrigin&&o.setAttribute("crossorigin",e.crossOrigin),document.head.appendChild(o),t.preloadHints.push(o)}})},t.prototype.removePreloadHints=function(){this.preloadHints.forEach(function(t){return o(t)})},t.prototype.run=function(){for(var t=this,e=this;this.scriptStack.hasItems;){var n=function(){var n=e.settings.docWriteSimulator,r=e.scriptStack.pop();n&&!r.async&&n.enable(r.placeholder);var o=e.activateScript(r);return o?r.external&&r.executable&&!r.async?(s(o,function(){t.finalizeActivation(r),t.run()}),{value:void 0}):void e.finalizeActivation(r):(n&&n.flushWrittenContentAndDisable(),"continue")}();if("object"==typeof n)return n.value}this.scriptStack.hasItems||this.settings.callback()},t.prototype.finalizeActivation=function(t){this.settings.docWriteSimulator&&!t.async&&this.settings.docWriteSimulator.flushWrittenContentAndDisable(),M.updateInlineHandlers(),o(t.placeholder)},t.prototype.activateScript=function(t){var n=t.script,r=t.placeholder,o=t.external,i=t.async,a=r.parentNode;if(!document.contains(r))return e("Placeholder for script \n"+n.outerHTML+"\n was detached from document.","Script will not be executed."),null;var c=this.settings.blocking&&o&&!i?l(n):u(n);return c?(a.insertBefore(c,r),c):(e("Failed to create activatable copy of script \n"+n.outerHTML+"\n","Script will not be executed."),null)},t}(),W="data-cf-settings",R="|",T="data-cf-modified-",B=void 0;!function(){var t=document.currentScript;if(t){var n=y(t);n?(o(t),b(n),M.updateInlineHandlers(),n.bailout?S(n.nonce):(g(),w(n.nonce))):e("Activator script doesn't have settings. No scripts will be executed.")}else e("Can't obtain activator script. No scripts will be executed.")}()}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment