Repository navigation
Expand file tree
/
Copy pathbuild.js
More file actions
1 lines (1 loc) · 2.52 KB
/
Copy pathbuild.js
File metadata and controls
1 lines (1 loc) · 2.52 KB
1
globalThis.process={env:{NODE_ENV:"production"}};var cdn="./";globalThis.WCGlobalCDNPath&&(cdn=globalThis.WCGlobalCDNPath),globalThis.__appCDN&&(cdn=globalThis.__appCDN);var fname="wc-registry.json";globalThis.WCGlobalRegistryFileName&&(fname=globalThis.WCGlobalRegistryFileName),globalThis.WCAutoloadRegistryFile=cdn+fname;var autoloaderScriptLocation="build/es6/node_modules/@haxtheweb/wc-autoload/wc-autoload.js",anchor=globalThis.document.currentScript||globalThis.document.getElementsByTagName("script")[0];if("noModule"in HTMLScriptElement.prototype){var fallbackChecks=function(l){var a=globalThis.__appCDN;if(!globalThis.__appCDNBlockFallback){var o=globalThis.document.createElement("script");o.type="module","./"===a?(globalThis.__appCDN="https://cdn.hax.cloud/cdn/",globalThis.WCAutoloadRegistryFile=globalThis.WCAutoloadRegistryFile.replace(a,globalThis.__appCDN),o.src=globalThis.__appCDN+autoloaderScriptLocation,watchCDN(o),anchor.parentNode.insertBefore(o,anchor),console.warn(a+" failed to respond, falling back to alternative: "+globalThis.__appCDN)):"https://cdn.hax.cloud/cdn/"===a?(globalThis.__appCDN="https://cdn.webcomponents.psu.edu/cdn/",globalThis.WCAutoloadRegistryFile=globalThis.WCAutoloadRegistryFile.replace(a,globalThis.__appCDN),o.src=globalThis.__appCDN+autoloaderScriptLocation,watchCDN(o),anchor.parentNode.insertBefore(o,anchor),console.warn(a+" failed to respond, falling back to alternative: "+globalThis.__appCDN)):(globalThis.__appCDN="./",globalThis.WCAutoloadRegistryFile=globalThis.WCAutoloadRegistryFile.replace(a,globalThis.__appCDN),console.error("Local delivery failed and all alternative CDNs failed to load. You might be offline, in a secure environment or doing testing intentionally to generate this *shrug*"))}},watchCDN=function(l){var a=!1,o=setTimeout((function(){var l=globalThis.__appCDN;if(!(a||globalThis.__appCDNBlockFallback||"./"!==l&&"https://cdn.hax.cloud/cdn/"!==l)){if(a=!0,!globalThis.__appCDNDefineGuard){globalThis.__appCDNDefineGuard=!0;var o=globalThis.customElements.define;globalThis.customElements.define=function(l,a,e){if(!globalThis.customElements.get(l))return o.call(globalThis.customElements,l,a,e)}}fallbackChecks()}}),globalThis.WCGlobalCDNTimeout||1e4);l.onload=function(){a=!0,clearTimeout(o)},l.onerror=function(l){a||(a=!0,clearTimeout(o),fallbackChecks(l))}},build=globalThis.document.createElement("script");build.src=cdn+autoloaderScriptLocation,build.type="module",watchCDN(build),anchor.parentNode.insertBefore(build,anchor)}else console.error("ES modules not supported by this browser.");