aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/~partytown/debug/partytown.js
diff options
context:
space:
mode:
authorKevin Hoerr <kjhoerr@protonmail.com>2022-11-18 19:56:28 -0500
committerGitHub <noreply@github.com>2022-11-18 19:56:28 -0500
commit1bbecf5d56f103784aa32c550c87048090da0ec1 (patch)
tree645ce26fbfa164a384e54b087e0918e5794b1a02 /public/~partytown/debug/partytown.js
parent866a9f7991f43242995879c18fa7fc717cc3e8b6 (diff)
downloadsubmelon.dev-1bbecf5d56f103784aa32c550c87048090da0ec1.tar.gz
submelon.dev-1bbecf5d56f103784aa32c550c87048090da0ec1.tar.bz2
submelon.dev-1bbecf5d56f103784aa32c550c87048090da0ec1.zip
Site updates (#1)
* Add current page as reference * Upgrade dependencies: Gatsby 5.0.1 * Refactor components and styles to be consistent * Switch tense of BlockBody prop * Remove header on stylesheet * move timestamp to package version * Commit public dir for use with static site builders * Remove 1.0.7 file ref
Diffstat (limited to 'public/~partytown/debug/partytown.js')
-rw-r--r--public/~partytown/debug/partytown.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/public/~partytown/debug/partytown.js b/public/~partytown/debug/partytown.js
new file mode 100644
index 0000000..ee59243
--- /dev/null
+++ b/public/~partytown/debug/partytown.js
@@ -0,0 +1,72 @@
+/* Partytown 0.5.4 - MIT builder.io */
+!function(win, doc, nav, top, useAtomics, config, libPath, timeout, scripts, sandbox, mainForwardFn, isReady) {
+ function ready() {
+ if (!isReady) {
+ isReady = 1;
+ libPath = (config.lib || "/~partytown/") + (false !== config.debug ? "debug/" : "");
+ if ("/" == libPath[0]) {
+ scripts = doc.querySelectorAll('script[type="text/partytown"]');
+ if (top != win) {
+ top.dispatchEvent(new CustomEvent("pt1", {
+ detail: win
+ }));
+ } else {
+ timeout = setTimeout(fallback, 1e4);
+ doc.addEventListener("pt0", clearFallback);
+ useAtomics ? loadSandbox(1) : nav.serviceWorker ? nav.serviceWorker.register(libPath + (config.swPath || "partytown-sw.js"), {
+ scope: libPath
+ }).then((function(swRegistration) {
+ if (swRegistration.active) {
+ loadSandbox();
+ } else if (swRegistration.installing) {
+ swRegistration.installing.addEventListener("statechange", (function(ev) {
+ "activated" == ev.target.state && loadSandbox();
+ }));
+ } else {
+ console.warn(swRegistration);
+ }
+ }), console.error) : fallback();
+ }
+ } else {
+ console.warn('Partytown config.lib url must start with "/"');
+ }
+ }
+ }
+ function loadSandbox(isAtomics) {
+ sandbox = doc.createElement(isAtomics ? "script" : "iframe");
+ if (!isAtomics) {
+ sandbox.setAttribute("style", "display:block;width:0;height:0;border:0;visibility:hidden");
+ sandbox.setAttribute("aria-hidden", !0);
+ }
+ sandbox.src = libPath + "partytown-" + (isAtomics ? "atomics.js?v=0.5.4" : "sandbox-sw.html?" + Date.now());
+ doc.body.appendChild(sandbox);
+ }
+ function fallback(i, script) {
+ console.warn("Partytown script fallback");
+ clearFallback();
+ for (i = 0; i < scripts.length; i++) {
+ script = doc.createElement("script");
+ script.innerHTML = scripts[i].innerHTML;
+ doc.head.appendChild(script);
+ }
+ sandbox && sandbox.parentNode.removeChild(sandbox);
+ }
+ function clearFallback() {
+ clearTimeout(timeout);
+ }
+ config = win.partytown || {};
+ top == win && (config.forward || []).map((function(forwardProps) {
+ mainForwardFn = win;
+ forwardProps.split(".").map((function(_, i, forwardPropsArr) {
+ mainForwardFn = mainForwardFn[forwardPropsArr[i]] = i + 1 < forwardPropsArr.length ? "push" == forwardPropsArr[i + 1] ? [] : mainForwardFn[forwardPropsArr[i]] || {} : function() {
+ (win._ptf = win._ptf || []).push(forwardPropsArr, arguments);
+ };
+ }));
+ }));
+ if ("complete" == doc.readyState) {
+ ready();
+ } else {
+ win.addEventListener("DOMContentLoaded", ready);
+ win.addEventListener("load", ready);
+ }
+}(window, document, navigator, top, window.crossOriginIsolated); \ No newline at end of file