@ruffle-rs/ruffle 0.1.0-nightly.2022.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/022684bed3c073b639bf.wasm +0 -0
- package/LICENSE_APACHE +176 -0
- package/LICENSE_MIT +25 -0
- package/README.md +57 -0
- package/core.ruffle.0df698725502042784de.js +2 -0
- package/core.ruffle.0df698725502042784de.js.map +1 -0
- package/core.ruffle.64c3c6131fc33e0afa1a.js +2 -0
- package/core.ruffle.64c3c6131fc33e0afa1a.js.map +1 -0
- package/e1e6427701cd4a809457.wasm +0 -0
- package/package.json +1 -0
- package/release.zip +0 -0
- package/ruffle.js +2 -0
- package/ruffle.js.map +1 -0
package/ruffle.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruffle.js","mappings":"uBAAIA,EACAC,E,KCAAC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QAIfJ,EAAoBO,EAAID,ECxBxBN,EAAoBQ,EAAI,CAACJ,EAASK,KACjC,IAAI,IAAIC,KAAOD,EACXT,EAAoBW,EAAEF,EAAYC,KAASV,EAAoBW,EAAEP,EAASM,IAC5EE,OAAOC,eAAeT,EAASM,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EV,EAAoBgB,EAAI,GAGxBhB,EAAoBiB,EAAKC,GACjBC,QAAQC,IAAIR,OAAOS,KAAKrB,EAAoBgB,GAAGM,QAAO,CAACC,EAAUb,KACvEV,EAAoBgB,EAAEN,GAAKQ,EAASK,GAC7BA,IACL,KCNJvB,EAAoBwB,EAAKN,GAEjB,eAAiB,CAAC,IAAM,uBAAuB,IAAM,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CAAEigB,WAAW,EAAMC,SAAS,IK1HnDrB,CAASc,GAObF,kBXkGG,SAAuB7X,GACpB,YAAaqM,UAAUkM,SAAalM,UAAUkM,QAAiB,SACjEjiB,OAAOC,eAAe8V,UAAW,UAAW,CACxCjS,MAAO,IAAIwF,EAAkByM,UAAUkM,SACvCC,UAAU,IAGFnM,UAAUkM,QAClBtZ,QAAQe,KACZA,EAAOzH,OAAS,IACb,YAAa8T,UAAUoM,WAAepM,UAAUoM,UAAmB,SACtEniB,OAAOC,eAAe8V,UAAW,YAAa,CAC1CjS,MAAO,IAAIyE,EAAoBwN,UAAUoM,WACzCD,UAAU,IAGlB,MAAMC,EAAYpM,UAAUoM,UAC5B,IAAK,IAAIngB,EAAI,EAAGA,EAAI0H,EAAOzH,OAAQD,GAAK,EACpCmgB,EAAUxZ,QAAQe,EAAO1H,IMK7BogB,CAAczY,GKhHd0Y,eACI,MAAMrd,EAAOiF,EAAgB,gBAAiBoB,GAC9C,OAAOvJ,SAASM,cAAc4C,KDnDpB,W","sources":["webpack://ruffle-selfhosted/webpack/runtime/load script","webpack://ruffle-selfhosted/webpack/bootstrap","webpack://ruffle-selfhosted/webpack/runtime/define property getters","webpack://ruffle-selfhosted/webpack/runtime/ensure chunk","webpack://ruffle-selfhosted/webpack/runtime/get javascript chunk filename","webpack://ruffle-selfhosted/webpack/runtime/global","webpack://ruffle-selfhosted/webpack/runtime/hasOwnProperty shorthand","webpack://ruffle-selfhosted/webpack/runtime/make namespace object","webpack://ruffle-selfhosted/webpack/runtime/publicPath","webpack://ruffle-selfhosted/webpack/runtime/jsonp chunk loading","webpack://ruffle-selfhosted/../../node_modules/wasm-feature-detect/dist/esm/index.js","webpack://ruffle-selfhosted/../core/pkg/js-polyfills.js","webpack://ruffle-selfhosted/../core/pkg/public-path.js","webpack://ruffle-selfhosted/../core/pkg/load-ruffle.js","webpack://ruffle-selfhosted/../core/pkg/plugin-polyfill.js","webpack://ruffle-selfhosted/../core/pkg/shadow-template.js","webpack://ruffle-selfhosted/../core/pkg/register-element.js","webpack://ruffle-selfhosted/../core/pkg/ruffle-player.js","webpack://ruffle-selfhosted/../core/pkg/ruffle-embed.js","webpack://ruffle-selfhosted/../core/pkg/ruffle-object.js","webpack://ruffle-selfhosted/../core/pkg/polyfills.js","webpack://ruffle-selfhosted/../core/pkg/version.js","webpack://ruffle-selfhosted/../core/pkg/version-range.js","webpack://ruffle-selfhosted/../core/pkg/public-api.js","webpack://ruffle-selfhosted/./js/ruffle.js","webpack://ruffle-selfhosted/../core/pkg/source-api.js"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"ruffle-selfhosted:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"core.ruffle.\" + {\"662\":\"64c3c6131fc33e0afa1a\",\"966\":\"0df698725502042784de\"}[chunkId] + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"\";","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkIds[i]] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkruffle_selfhosted\"] = self[\"webpackChunkruffle_selfhosted\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","export const bigInt=()=>(async e=>{try{return(await WebAssembly.instantiate(e)).instance.exports.b(BigInt(0))===BigInt(0)}catch(e){return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,126,1,126,3,2,1,0,7,5,1,1,98,0,0,10,6,1,4,0,32,0,11])),bulkMemory=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),exceptions=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),multiValue=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,0,2,127,127,3,2,1,0,10,8,1,6,0,65,0,65,0,11])),mutableGlobals=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1])),referenceTypes=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11])),saturatedFloatToInt=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11])),signExtensions=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11])),simd=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),tailCall=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,6,1,4,0,18,0,11])),threads=()=>(async e=>{try{return\"undefined\"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch(e){return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));\n","/**\n * Polyfills the `Array.prototype.reduce` method.\n *\n * Production steps of ECMA-262, Edition 5, 15.4.4.21\n * Reference: https://es5.github.io/#x15.4.4.21\n * https://tc39.github.io/ecma262/#sec-array.prototype.reduce\n *\n */\nfunction polyfillArrayPrototypeReduce() {\n Object.defineProperty(Array.prototype, \"reduce\", {\n value(...args) {\n if (args.length === 0 &&\n window.Prototype &&\n window.Prototype.Version &&\n window.Prototype.Version < \"1.6.1\") {\n // Off-spec: compatibility with prototype.js\n return this.length > 1 ? this : this[0];\n }\n const callback = args[0];\n if (this === null) {\n throw new TypeError(\"Array.prototype.reduce called on null or undefined\");\n }\n if (typeof callback !== \"function\") {\n throw new TypeError(`${callback} is not a function`);\n }\n const o = Object(this);\n const len = o.length >>> 0;\n let k = 0;\n let value;\n if (args.length >= 2) {\n value = args[1];\n }\n else {\n while (k < len && !(k in o)) {\n k++;\n }\n if (k >= len) {\n throw new TypeError(\"Reduce of empty array with no initial value\");\n }\n value = o[k++];\n }\n while (k < len) {\n if (k in o) {\n value = callback(value, o[k], k, o);\n }\n k++;\n }\n return value;\n },\n });\n}\n/**\n * Polyfills the `Window` function.\n *\n */\nfunction polyfillWindow() {\n if (typeof window.constructor !== \"function\" ||\n !isNativeFunction(window.constructor)) {\n // Don't polyfill `Window` if `window.constructor` has been overridden.\n return;\n }\n // @ts-expect-error: `Function not assignable to { new (): Window; prototype: Window; }`\n window.Window = window.constructor;\n}\n/**\n * Polyfills the `Reflect` object and members.\n *\n * Currently it's a minimal implementation with only `get` and `set`\n * just enough for wasm-bindgen's stdlib to not crash on pages I've found.\n *\n */\nfunction tryPolyfillReflect() {\n if (window.Reflect == undefined) {\n // @ts-expect-error: {} indeed doesn't implement Reflect's interface.\n window.Reflect = {};\n }\n if (typeof Reflect.get !== \"function\") {\n Object.defineProperty(Reflect, \"get\", {\n value(target, key) {\n return target[key];\n },\n });\n }\n if (typeof Reflect.set !== \"function\") {\n Object.defineProperty(Reflect, \"set\", {\n value(target, key, value) {\n target[key] = value;\n },\n });\n }\n}\n/**\n * Determines whether a function is native or not.\n *\n * @param func The function to test.\n * @returns True if the function hasn't been overridden.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isNativeFunction(func) {\n const val = typeof Function.prototype.toString === \"function\"\n ? Function.prototype.toString()\n : null;\n if (typeof val === \"string\" && val.indexOf(\"[native code]\") >= 0) {\n return (Function.prototype.toString.call(func).indexOf(\"[native code]\") >= 0);\n }\n return false;\n}\n/**\n * Checks and applies the polyfills to the current window, if needed.\n *\n */\nexport function setPolyfillsOnLoad() {\n if (typeof Array.prototype.reduce !== \"function\" ||\n !isNativeFunction(Array.prototype.reduce)) {\n // Some external libraries override the `Array.prototype.reduce` method in a way\n // that causes Webpack to crash (#1507, #1865), so we need to override it again.\n polyfillArrayPrototypeReduce();\n }\n if (typeof Window !== \"function\" || !isNativeFunction(Window)) {\n // Overriding the native `Window` function causes issues in wasm-bindgen, as a\n // code like `window instanceof Window` will no longer work.\n polyfillWindow();\n }\n // Some pages override native `Reflect` with a new object without some properties,\n // which causes issues for wasm-bindgen's stdlib implementation.\n tryPolyfillReflect();\n}\n","// This must be in global scope because `document.currentScript`\n// works only while the script is initially being processed.\nlet currentScriptURL = \"\";\ntry {\n if (document.currentScript !== undefined &&\n document.currentScript !== null &&\n \"src\" in document.currentScript &&\n document.currentScript.src !== \"\") {\n currentScriptURL = new URL(\".\", document.currentScript.src).href;\n }\n}\ncatch (e) {\n console.warn(\"Unable to get currentScript URL\");\n}\n/**\n * Attempt to discover the public path of the current Ruffle source. This can\n * be used to configure Webpack.\n *\n * A global public path can be specified for all sources using the RufflePlayer\n * config:\n *\n * ```js\n * window.RufflePlayer.config.publicPath = \"/dist/\";\n * ```\n *\n * If no such config is specified, then the parent path of where this script is\n * hosted is assumed, which should be the correct default in most cases.\n *\n * @param config The `window.RufflePlayer.config` object.\n * @returns The public path for the given source.\n */\nexport function publicPath(config) {\n // Default to the directory where this script resides.\n let path = currentScriptURL;\n if (config !== undefined && config.publicPath !== undefined) {\n path = config.publicPath;\n }\n // Webpack expects the paths to end with a slash.\n if (path !== \"\" && !path.endsWith(\"/\")) {\n path += \"/\";\n }\n return path;\n}\n","/**\n * Conditional ruffle loader\n */\nimport { bulkMemory, simd, saturatedFloatToInt, signExtensions, } from \"wasm-feature-detect\";\nimport { setPolyfillsOnLoad } from \"./js-polyfills\";\nimport { publicPath } from \"./public-path\";\n/**\n * Load ruffle from an automatically-detected location.\n *\n * This function returns a new instance of Ruffle and downloads it every time.\n * You should not use it directly; this module will memoize the resource\n * download.\n *\n * @param config The `window.RufflePlayer.config` object.\n * @returns A ruffle constructor that may be used to create new Ruffle\n * instances.\n */\nasync function fetchRuffle(config) {\n // Apply some pure JavaScript polyfills to prevent conflicts with external\n // libraries, if needed.\n setPolyfillsOnLoad();\n // NOTE: Keep this list in sync with $RUSTFLAGS in the CI build config!\n const extensionsSupported = (await Promise.all([\n bulkMemory(),\n simd(),\n saturatedFloatToInt(),\n signExtensions(),\n ])).every(Boolean);\n if (!extensionsSupported) {\n console.log(\"Some WebAssembly extensions are NOT available, falling back to the vanilla WebAssembly module\");\n }\n __webpack_public_path__ = publicPath(config);\n // Note: The argument passed to import() has to be a simple string literal,\n // otherwise some bundler will get confused and won't include the module?\n const { default: init, Ruffle } = await (extensionsSupported\n ? import(\"../pkg/ruffle_web-wasm_extensions\")\n : import(\"../pkg/ruffle_web\"));\n await init();\n return Ruffle;\n}\nlet lastLoaded = null;\n/**\n * Obtain an instance of `Ruffle`.\n *\n * This function returns a promise which yields `Ruffle` asynchronously.\n *\n * @param config The `window.RufflePlayer.config` object.\n * @returns A ruffle constructor that may be used to create new Ruffle\n * instances.\n */\nexport function loadRuffle(config) {\n if (lastLoaded == null) {\n lastLoaded = fetchRuffle(config);\n }\n return lastLoaded;\n}\n","/**\n * Replacement object for `MimeTypeArray` that lets us install new fake mime\n * types.\n *\n * Unlike plugins we can at least enumerate mime types in Firefox, so we don't\n * lose data.\n *\n * We also expose a method called `install` which adds a new plugin. This is\n * used to falsify Flash detection. If the existing `navigator.mimeTypes` has an\n * `install` method, you should not use `RuffleMimeTypeArray` as some other\n * plugin emulator is already present.\n */\nclass RuffleMimeTypeArray {\n constructor(native_mimetype_array) {\n this.__mimetypes = [];\n this.__named_mimetypes = {};\n if (native_mimetype_array) {\n for (let i = 0; i < native_mimetype_array.length; i++) {\n this.install(native_mimetype_array[i]);\n }\n }\n }\n /**\n * Install a MIME Type into the array.\n *\n * @param mimetype The mimetype to install\n */\n install(mimetype) {\n const id = this.__mimetypes.length;\n this.__mimetypes.push(mimetype);\n this.__named_mimetypes[mimetype.type] = mimetype;\n this[mimetype.type] = mimetype;\n this[id] = mimetype;\n }\n item(index) {\n return this.__mimetypes[index];\n }\n namedItem(name) {\n return this.__named_mimetypes[name];\n }\n get length() {\n return this.__mimetypes.length;\n }\n [Symbol.iterator]() {\n return this.__mimetypes[Symbol.iterator]();\n }\n}\n/**\n * Equivalent object to `Plugin` that allows us to falsify plugins.\n */\nclass RufflePlugin extends RuffleMimeTypeArray {\n constructor(name, description, filename, mimetypes) {\n super(mimetypes);\n this.name = name;\n this.description = description;\n this.filename = filename;\n }\n install(mimetype) {\n super.install(mimetype);\n }\n [Symbol.iterator]() {\n return super[Symbol.iterator]();\n }\n}\n/**\n * Replacement object for `PluginArray` that lets us install new fake plugins.\n *\n * This object needs to wrap the native plugin array, since the user might have\n * actual plugins installed. Firefox doesn't let us enumerate the array, though,\n * which has some consequences. Namely, we can't actually perfectly wrap the\n * native plugin array, at least unless there's some secret \"unresolved object\n * property name handler\" that I've never known before in JS...\n *\n * We can still wrap `namedItem` perfectly at least.\n *\n * We also expose a method called `install` which adds a new plugin. This is\n * used to falsify Flash detection. If the existing `navigator.plugins` has an\n * `install` method, you should not use `RufflePluginArray` as some other plugin\n * emulator is already present.\n */\nclass RufflePluginArray {\n constructor(native_plugin_array) {\n this.__plugins = [];\n this.__named_plugins = {};\n for (let i = 0; i < native_plugin_array.length; i++) {\n this.install(native_plugin_array[i]);\n }\n }\n install(plugin) {\n const id = this.__plugins.length;\n this.__plugins.push(plugin);\n this.__named_plugins[plugin.name] = plugin;\n this[plugin.name] = plugin;\n this[id] = plugin;\n }\n item(index) {\n return this.__plugins[index];\n }\n namedItem(name) {\n return this.__named_plugins[name];\n }\n get length() {\n return this.__plugins.length;\n }\n}\n/**\n * A fake plugin designed to trigger Flash detection scripts.\n */\nexport const FLASH_PLUGIN = new RufflePlugin(\"Shockwave Flash\", \"Shockwave Flash 32.0 r0\", \"ruffle.js\", null);\nFLASH_PLUGIN.install({\n type: \"application/futuresplash\",\n description: \"Shockwave Flash\",\n suffixes: \"spl\",\n enabledPlugin: FLASH_PLUGIN,\n});\nFLASH_PLUGIN.install({\n type: \"application/x-shockwave-flash\",\n description: \"Shockwave Flash\",\n suffixes: \"swf\",\n enabledPlugin: FLASH_PLUGIN,\n});\nFLASH_PLUGIN.install({\n type: \"application/x-shockwave-flash2-preview\",\n description: \"Shockwave Flash\",\n suffixes: \"swf\",\n enabledPlugin: FLASH_PLUGIN,\n});\nFLASH_PLUGIN.install({\n type: \"application/vnd.adobe.flash-movie\",\n description: \"Shockwave Flash\",\n suffixes: \"swf\",\n enabledPlugin: FLASH_PLUGIN,\n});\n/**\n * Install a fake plugin such that detectors will see it in `navigator.plugins`.\n *\n * This function takes care to check if the existing implementation of\n * `navigator.plugins` already accepts fake plugin entries. If so, it will use\n * that version of the plugin array. This allows the plugin polyfill to compose\n * across multiple plugin emulators with the first emulator's polyfill winning.\n *\n * @param plugin The plugin to install\n */\nexport function installPlugin(plugin) {\n if (!(\"install\" in navigator.plugins) || !navigator.plugins[\"install\"]) {\n Object.defineProperty(navigator, \"plugins\", {\n value: new RufflePluginArray(navigator.plugins),\n writable: false,\n });\n }\n const plugins = navigator.plugins;\n plugins.install(plugin);\n if (plugin.length > 0 &&\n (!(\"install\" in navigator.mimeTypes) || !navigator.mimeTypes[\"install\"])) {\n Object.defineProperty(navigator, \"mimeTypes\", {\n value: new RuffleMimeTypeArray(navigator.mimeTypes),\n writable: false,\n });\n }\n const mimeTypes = navigator.mimeTypes;\n for (let i = 0; i < plugin.length; i += 1) {\n mimeTypes.install(plugin[i]);\n }\n}\n","/**\n * The shadow template which is used to fill the actual Ruffle player element\n * on the page.\n */\nexport const ruffleShadowTemplate = document.createElement(\"template\");\nruffleShadowTemplate.innerHTML = `\n <style>\n :host {\n --ruffle-blue: #37528c;\n --ruffle-orange: #ffad33;\n\n display: inline-block;\n position: relative;\n /* Default width/height; this will get overridden by user styles/attributes. */\n width: 550px;\n height: 400px;\n font-family: Arial, sans-serif;\n letter-spacing: 0.4px;\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n -webkit-tap-highlight-color: transparent;\n }\n\n /* Ruffle's width/height CSS interferes Safari fullscreen CSS. */\n /* Ensure that Safari's fullscreen mode actually fills the screen. */\n :host(:-webkit-full-screen) {\n display: block;\n width: 100% !important;\n height: 100% !important;\n }\n\n /* All of these use the dimensions specified by the embed. */\n #container,\n #play_button,\n #unmute_overlay,\n #unmute_overlay .background,\n #panic,\n #message_overlay {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n #container {\n overflow: hidden;\n }\n\n #container canvas {\n width: 100%;\n height: 100%;\n }\n\n #play_button,\n #unmute_overlay {\n cursor: pointer;\n display: none;\n }\n\n #unmute_overlay .background {\n background: black;\n opacity: 0.7;\n }\n\n #play_button .icon,\n #unmute_overlay .icon {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 50%;\n height: 50%;\n max-width: 384px;\n max-height: 384px;\n transform: translate(-50%, -50%);\n opacity: 0.8;\n }\n\n #play_button:hover .icon,\n #unmute_overlay:hover .icon {\n opacity: 1;\n }\n\n #panic {\n font-size: 20px;\n text-align: center;\n /* Inverted colors from play button! */\n background: linear-gradient(180deg, #fd3a40 0%, #fda138 100%);\n color: white;\n display: flex;\n flex-flow: column;\n justify-content: space-around;\n }\n\n #panic a {\n color: var(--ruffle-blue);\n font-weight: bold;\n }\n\n #panic-title {\n font-size: xxx-large;\n font-weight: bold;\n }\n\n #panic-body.details {\n flex: 0.9;\n margin: 0 10px;\n }\n\n #panic-body textarea {\n width: 100%;\n height: 100%;\n resize: none;\n }\n\n #panic ul {\n padding: 0;\n display: flex;\n list-style-type: none;\n justify-content: space-evenly;\n }\n\n #message_overlay {\n position: absolute;\n background: var(--ruffle-blue);\n color: var(--ruffle-orange);\n opacity: 1;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: auto;\n }\n\n #message_overlay .message {\n text-align: center;\n max-height: 100%;\n max-width: 100%;\n padding: 5%;\n }\n\n #message_overlay p {\n margin: 0.5em 0;\n }\n\n #message_overlay .message div {\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n column-gap: 1em;\n }\n\n #message_overlay a, #message_overlay button {\n cursor: pointer;\n background: var(--ruffle-blue);\n color: var(--ruffle-orange);\n border: 2px solid var(--ruffle-orange);\n font-weight: bold;\n font-size: 1.25em;\n border-radius: 0.6em;\n padding: 10px;\n text-decoration: none;\n margin: 2% 0;\n }\n\n #message_overlay a:hover, #message_overlay button:hover {\n background: #ffffff4c;\n }\n\n #continue-btn {\n cursor: pointer;\n background: var(--ruffle-blue);\n color: var(--ruffle-orange);\n border: 2px solid var(--ruffle-orange);\n font-weight: bold;\n font-size: 20px;\n border-radius: 20px;\n padding: 10px;\n }\n\n #continue-btn:hover {\n background: #ffffff4c;\n }\n\n #context-menu {\n display: none;\n color: black;\n background: #fafafa;\n border: 1px solid gray;\n box-shadow: 0px 5px 10px -5px black;\n position: absolute;\n font-size: 14px;\n text-align: left;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n #context-menu .menu_item {\n padding: 5px 10px;\n cursor: pointer;\n color: black;\n }\n\n #context-menu .menu_item.disabled {\n cursor: default;\n color: gray;\n }\n\n #context-menu .menu_item:not(.disabled):hover {\n background: lightgray;\n }\n\n #context-menu .menu_separator hr {\n border: none;\n border-bottom: 1px solid lightgray;\n margin: 2px;\n }\n </style>\n <style id=\"dynamic_styles\"></style>\n\n <div id=\"container\">\n <div id=\"play_button\"><div class=\"icon\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid\" viewBox=\"0 0 250 250\" style=\"width:100%;height:100%;\"><defs><linearGradient id=\"a\" gradientUnits=\"userSpaceOnUse\" x1=\"125\" y1=\"0\" x2=\"125\" y2=\"250\" spreadMethod=\"pad\"><stop offset=\"0%\" stop-color=\"#FDA138\"/><stop offset=\"100%\" stop-color=\"#FD3A40\"/></linearGradient><g id=\"b\"><path fill=\"url(#a)\" d=\"M250 125q0-52-37-88-36-37-88-37T37 37Q0 73 0 125t37 88q36 37 88 37t88-37q37-36 37-88M87 195V55l100 70-100 70z\"/><path fill=\"#FFF\" d=\"M87 55v140l100-70L87 55z\"/></g></defs><use xlink:href=\"#b\"/></svg></div></div>\n <div id=\"unmute_overlay\"><div class=\"background\"></div><div class=\"icon\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid\" viewBox=\"0 0 512 584\" style=\"width:100%;height:100%;scale:0.8;\"><path fill=\"#FFF\" stroke=\"#FFF\" d=\"m457.941 256 47.029-47.029c9.372-9.373 9.372-24.568 0-33.941-9.373-9.373-24.568-9.373-33.941 0l-47.029 47.029-47.029-47.029c-9.373-9.373-24.568-9.373-33.941 0-9.372 9.373-9.372 24.568 0 33.941l47.029 47.029-47.029 47.029c-9.372 9.373-9.372 24.568 0 33.941 4.686 4.687 10.827 7.03 16.97 7.03s12.284-2.343 16.971-7.029l47.029-47.03 47.029 47.029c4.687 4.687 10.828 7.03 16.971 7.03s12.284-2.343 16.971-7.029c9.372-9.373 9.372-24.568 0-33.941z\"/><path fill=\"#FFF\" stroke=\"#FFF\" d=\"m99 160h-55c-24.301 0-44 19.699-44 44v104c0 24.301 19.699 44 44 44h55c2.761 0 5-2.239 5-5v-182c0-2.761-2.239-5-5-5z\"/><path fill=\"#FFF\" stroke=\"#FFF\" d=\"m280 56h-24c-5.269 0-10.392 1.734-14.578 4.935l-103.459 79.116c-1.237.946-1.963 2.414-1.963 3.972v223.955c0 1.557.726 3.026 1.963 3.972l103.459 79.115c4.186 3.201 9.309 4.936 14.579 4.936h23.999c13.255 0 24-10.745 24-24v-352.001c0-13.255-10.745-24-24-24z\"/><text x=\"256\" y=\"560\" text-anchor=\"middle\" style=\"font-size:60px;fill:#FFF;stroke:#FFF;\">Click to unmute</text></svg></div></div>\n </div>\n\n <ul id=\"context-menu\"></ul>\n`;\n","/**\n * Number of times to try defining a custom element.\n */\nconst MAX_TRIES = 999;\n/**\n * A mapping between internal element IDs and DOM element IDs.\n */\nconst privateRegistry = {};\n/**\n * Lookup a previously registered custom element.\n *\n * The returned object will have `name`, `class`, and `internal_name`\n * properties listing the external name, implementing class, and internal name\n * respectively.\n *\n * @param elementName The internal element name, previously used to\n * register the element with the private registry.\n * @returns The element data in the registry, or null if there is\n * no such element name registered.\n */\nexport function lookupElement(elementName) {\n const data = privateRegistry[elementName];\n if (data !== undefined) {\n return {\n internalName: elementName,\n name: data.name,\n class: data.class,\n };\n }\n else {\n return null;\n }\n}\n/**\n * Register a custom element.\n *\n * This function is designed to be tolerant of naming conflicts. If\n * registration fails, we modify the name, and try again. As a result, this\n * function returns the real element name to use.\n *\n * Calling this function multiple times will *not* register multiple elements.\n * We store a private registry mapping internal element names to DOM names.\n * Thus, the proper way to use this function is to call it every time you are\n * about to work with custom element names.\n *\n * @param elementName The internal name of the element.\n * @param elementClass The class of the element.\n *\n * You must call this function with the same class every time.\n * @returns The actual element name.\n * @throws Throws an error if two different elements were registered with the\n * same internal name.\n */\nexport function registerElement(elementName, elementClass) {\n if (privateRegistry[elementName] !== undefined) {\n if (privateRegistry[elementName].class !== elementClass) {\n throw new Error(\"Internal naming conflict on \" + elementName);\n }\n else {\n return privateRegistry[elementName].name;\n }\n }\n let tries = 0;\n if (window.customElements !== undefined) {\n while (tries < MAX_TRIES) {\n let externalName = elementName;\n if (tries > 0) {\n externalName = externalName + \"-\" + tries;\n }\n if (window.customElements.get(externalName) !== undefined) {\n tries += 1;\n continue;\n }\n else {\n window.customElements.define(externalName, elementClass);\n }\n privateRegistry[elementName] = {\n class: elementClass,\n name: externalName,\n internalName: elementName,\n };\n return externalName;\n }\n }\n throw new Error(\"Failed to assign custom element \" + elementName);\n}\n","import { loadRuffle } from \"./load-ruffle\";\nimport { ruffleShadowTemplate } from \"./shadow-template\";\nimport { lookupElement } from \"./register-element\";\nexport const FLASH_MIMETYPE = \"application/x-shockwave-flash\";\nexport const FUTURESPLASH_MIMETYPE = \"application/futuresplash\";\nexport const FLASH7_AND_8_MIMETYPE = \"application/x-shockwave-flash2-preview\";\nexport const FLASH_MOVIE_MIMETYPE = \"application/vnd.adobe.flash-movie\";\nexport const FLASH_ACTIVEX_CLASSID = \"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\";\nconst RUFFLE_ORIGIN = \"https://ruffle.rs\";\nconst DIMENSION_REGEX = /^\\s*(\\d+(\\.\\d+)?(%)?)/;\nlet isAudioContextUnmuted = false;\n/**\n * Converts arbitrary input to an easy to use record object.\n *\n * @param parameters Parameters to sanitize\n * @returns A sanitized map of param name to param value\n */\nfunction sanitizeParameters(parameters) {\n if (parameters === null || parameters === undefined) {\n return {};\n }\n if (!(parameters instanceof URLSearchParams)) {\n parameters = new URLSearchParams(parameters);\n }\n const output = {};\n for (const [key, value] of parameters) {\n // Every value must be type of string\n output[key] = value.toString();\n }\n return output;\n}\n/**\n * The ruffle player element that should be inserted onto the page.\n *\n * This element will represent the rendered and intractable flash movie.\n */\nexport class RufflePlayer extends HTMLElement {\n /**\n * Constructs a new Ruffle flash player for insertion onto the page.\n */\n constructor() {\n super();\n this.hasContextMenu = false;\n // Allows the user to permanently disable the context menu.\n this.contextMenuForceDisabled = false;\n // Whether this device is a touch device.\n // Set to true when a touch event is encountered.\n this.isTouch = false;\n this.showSwfDownload = false;\n this.panicked = false;\n this.isExtension = false;\n /**\n * Any configuration that should apply to this specific player.\n * This will be defaulted with any global configuration.\n */\n this.config = {};\n this.shadow = this.attachShadow({ mode: \"open\" });\n this.shadow.appendChild(ruffleShadowTemplate.content.cloneNode(true));\n this.dynamicStyles = (this.shadow.getElementById(\"dynamic_styles\"));\n this.container = this.shadow.getElementById(\"container\");\n this.playButton = this.shadow.getElementById(\"play_button\");\n if (this.playButton) {\n this.playButton.addEventListener(\"click\", () => this.play());\n }\n this.unmuteOverlay = this.shadow.getElementById(\"unmute_overlay\");\n this.contextMenuElement = this.shadow.getElementById(\"context-menu\");\n this.addEventListener(\"contextmenu\", this.showContextMenu.bind(this));\n this.addEventListener(\"pointerdown\", this.pointerDown.bind(this));\n this.addEventListener(\"fullscreenchange\", this.fullScreenChange.bind(this));\n this.addEventListener(\"webkitfullscreenchange\", this.fullScreenChange.bind(this));\n window.addEventListener(\"click\", this.hideContextMenu.bind(this));\n this.instance = null;\n this.options = null;\n this.onFSCommand = null;\n this._readyState = 0 /* HaveNothing */;\n this._metadata = null;\n this.lastActivePlayingState = false;\n this.setupPauseOnTabHidden();\n return this;\n }\n /**\n * Indicates the readiness of the playing movie.\n *\n * @returns The `ReadyState` of the player.\n */\n get readyState() {\n return this._readyState;\n }\n /**\n * The metadata of the playing movie (such as movie width and height).\n * These are inherent properties stored in the SWF file and are not affected by runtime changes.\n * For example, `metadata.width` is the width of the SWF file, and not the width of the Ruffle player.\n *\n * @returns The metadata of the movie, or `null` if the movie metadata has not yet loaded.\n */\n get metadata() {\n return this._metadata;\n }\n /**\n * Setup event listener to detect when tab is not active to pause instance playback.\n * this.instance.play() is called when the tab becomes visible only if the\n * the instance was not paused before tab became hidden.\n *\n * See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n * @ignore\n * @internal\n */\n setupPauseOnTabHidden() {\n document.addEventListener(\"visibilitychange\", () => {\n if (!this.instance)\n return;\n // Tab just changed to be inactive. Record whether instance was playing.\n if (document.hidden) {\n this.lastActivePlayingState = this.instance.is_playing();\n this.instance.pause();\n }\n // Play only if instance was playing originally.\n if (!document.hidden && this.lastActivePlayingState === true) {\n this.instance.play();\n }\n }, false);\n }\n /**\n * @ignore\n * @internal\n */\n connectedCallback() {\n this.updateStyles();\n }\n /**\n * @ignore\n * @internal\n */\n static get observedAttributes() {\n return [\"width\", \"height\"];\n }\n /**\n * @ignore\n * @internal\n */\n attributeChangedCallback(name, _oldValue, _newValue) {\n if (name === \"width\" || name === \"height\") {\n this.updateStyles();\n }\n }\n /**\n * @ignore\n * @internal\n */\n disconnectedCallback() {\n this.destroy();\n }\n /**\n * Updates the internal shadow DOM to reflect any set attributes from\n * this element.\n *\n * @protected\n */\n updateStyles() {\n if (this.dynamicStyles.sheet) {\n if (this.dynamicStyles.sheet.rules) {\n for (let i = 0; i < this.dynamicStyles.sheet.rules.length; i++) {\n this.dynamicStyles.sheet.deleteRule(i);\n }\n }\n const widthAttr = this.attributes.getNamedItem(\"width\");\n if (widthAttr !== undefined && widthAttr !== null) {\n const width = RufflePlayer.htmlDimensionToCssDimension(widthAttr.value);\n if (width !== null) {\n this.dynamicStyles.sheet.insertRule(`:host { width: ${width}; }`);\n }\n }\n const heightAttr = this.attributes.getNamedItem(\"height\");\n if (heightAttr !== undefined && heightAttr !== null) {\n const height = RufflePlayer.htmlDimensionToCssDimension(heightAttr.value);\n if (height !== null) {\n this.dynamicStyles.sheet.insertRule(`:host { height: ${height}; }`);\n }\n }\n }\n }\n /**\n * Determine if this element is the fallback content of another Ruffle\n * player.\n *\n * This heuristic assumes Ruffle objects will never use their fallback\n * content. If this changes, then this code also needs to change.\n *\n * @private\n */\n isUnusedFallbackObject() {\n let parent = this.parentNode;\n const element = lookupElement(\"ruffle-object\");\n if (element !== null) {\n while (parent != document && parent != null) {\n if (parent.nodeName === element.name) {\n return true;\n }\n parent = parent.parentNode;\n }\n }\n return false;\n }\n /**\n * Ensure a fresh Ruffle instance is ready on this player before continuing.\n *\n * @throws Any exceptions generated by loading Ruffle Core will be logged\n * and passed on.\n *\n * @private\n */\n async ensureFreshInstance(config) {\n var _a;\n this.destroy();\n const ruffleConstructor = await loadRuffle(config).catch((e) => {\n console.error(`Serious error loading Ruffle: ${e}`);\n // Serious duck typing. In error conditions, let's not make assumptions.\n if (window.location.protocol === \"file:\") {\n e.ruffleIndexError = 2 /* FileProtocol */;\n }\n else {\n e.ruffleIndexError = 9 /* WasmNotFound */;\n const message = String(e.message).toLowerCase();\n if (message.includes(\"mime\")) {\n e.ruffleIndexError = 8 /* WasmMimeType */;\n }\n else if (message.includes(\"networkerror\") ||\n message.includes(\"failed to fetch\")) {\n e.ruffleIndexError = 6 /* WasmCors */;\n }\n else if (message.includes(\"disallowed by embedder\")) {\n e.ruffleIndexError = 1 /* CSPConflict */;\n }\n else if (e.name === \"CompileError\") {\n e.ruffleIndexError = 3 /* InvalidWasm */;\n }\n else if (message.includes(\"could not download wasm module\") &&\n e.name === \"TypeError\") {\n e.ruffleIndexError = 7 /* WasmDownload */;\n }\n else if (e.name === \"TypeError\") {\n e.ruffleIndexError = 5 /* JavascriptConflict */;\n }\n }\n this.panic(e);\n throw e;\n });\n this.instance = await new ruffleConstructor(this.container, this, config);\n console.log(\"New Ruffle instance created (WebAssembly extensions: \" +\n (ruffleConstructor.is_wasm_simd_used() ? \"ON\" : \"OFF\") +\n \")\");\n // In Firefox, AudioContext.state is always \"suspended\" when the object has just been created.\n // It may change by itself to \"running\" some milliseconds later. So we need to wait a little\n // bit before checking if autoplay is supported and applying the instance config.\n if (this.audioState() !== \"running\") {\n this.container.style.visibility = \"hidden\";\n await new Promise((resolve) => {\n window.setTimeout(() => {\n resolve();\n }, 200);\n });\n this.container.style.visibility = \"\";\n }\n this.unmuteAudioContext();\n // Treat unspecified and invalid values as `AutoPlay.Auto`.\n if (config.autoplay === \"on\" /* On */ ||\n (config.autoplay !== \"off\" /* Off */ &&\n this.audioState() === \"running\")) {\n this.play();\n if (this.audioState() !== \"running\") {\n // Treat unspecified and invalid values as `UnmuteOverlay.Visible`.\n if (config.unmuteOverlay !== \"hidden\" /* Hidden */) {\n this.unmuteOverlay.style.display = \"block\";\n }\n this.container.addEventListener(\"click\", this.unmuteOverlayClicked.bind(this), {\n once: true,\n });\n const audioContext = (_a = this.instance) === null || _a === void 0 ? void 0 : _a.audio_context();\n if (audioContext) {\n audioContext.onstatechange = () => {\n if (audioContext.state === \"running\") {\n this.unmuteOverlayClicked();\n }\n audioContext.onstatechange = null;\n };\n }\n }\n }\n else {\n this.playButton.style.display = \"block\";\n }\n }\n /**\n * Destroys the currently running instance of Ruffle.\n */\n destroy() {\n if (this.instance) {\n this.instance.destroy();\n this.instance = null;\n this._metadata = null;\n this._readyState = 0 /* HaveNothing */;\n console.log(\"Ruffle instance destroyed.\");\n }\n }\n /**\n * Loads a specified movie into this player.\n *\n * This will replace any existing movie that may be playing.\n *\n * @param options One of the following:\n * - A URL, passed as a string, which will load a URL with default options.\n * - A [[URLLoadOptions]] object, to load a URL with options.\n * - A [[DataLoadOptions]] object, to load data with options.\n *\n * The options will be defaulted by the [[config]] field, which itself\n * is defaulted by a global `window.RufflePlayer.config`.\n */\n async load(options) {\n var _a, _b;\n let optionsError = \"\";\n switch (typeof options) {\n case \"string\":\n options = { url: options };\n break;\n case \"object\":\n if (options === null) {\n optionsError = \"Argument 0 must be a string or object\";\n }\n else if (!(\"url\" in options) && !(\"data\" in options)) {\n optionsError =\n \"Argument 0 must contain a `url` or `data` key\";\n }\n else if (\"url\" in options &&\n typeof options.url !== \"string\") {\n optionsError = \"`url` must be a string\";\n }\n break;\n default:\n optionsError = \"Argument 0 must be a string or object\";\n break;\n }\n if (optionsError.length > 0) {\n const error = new TypeError(optionsError);\n error.ruffleIndexError = 4 /* JavascriptConfiguration */;\n this.panic(error);\n throw error;\n }\n if (!this.isConnected || this.isUnusedFallbackObject()) {\n console.warn(\"Ignoring attempt to play a disconnected or suspended Ruffle element\");\n return;\n }\n if (isFallbackElement(this)) {\n // Silently fail on attempt to play a Ruffle element inside a specific node.\n return;\n }\n try {\n const config = Object.assign(Object.assign(Object.assign({}, ((_b = (_a = window.RufflePlayer) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {})), this.config), options);\n // `allowScriptAccess` can only be set in `options`.\n config.allowScriptAccess = options.allowScriptAccess;\n this.showSwfDownload = config.showSwfDownload === true;\n this.options = options;\n this.hasContextMenu = config.contextMenu !== false;\n // Pre-emptively set background color of container while Ruffle/SWF loads.\n if (config.backgroundColor) {\n this.container.style.backgroundColor = config.backgroundColor;\n }\n await this.ensureFreshInstance(config);\n if (\"url\" in options) {\n console.log(`Loading SWF file ${options.url}`);\n try {\n this.swfUrl = new URL(options.url, document.location.href).href;\n }\n catch (_c) {\n this.swfUrl = options.url;\n }\n const parameters = Object.assign(Object.assign({}, sanitizeParameters(options.url.substring(options.url.indexOf(\"?\")))), sanitizeParameters(options.parameters));\n this.instance.stream_from(this.swfUrl, parameters);\n }\n else if (\"data\" in options) {\n console.log(\"Loading SWF data\");\n this.instance.load_data(new Uint8Array(options.data), sanitizeParameters(options.parameters));\n }\n }\n catch (err) {\n console.error(`Serious error occurred loading SWF file: ${err}`);\n throw err;\n }\n }\n /**\n * Plays or resumes the movie.\n */\n play() {\n if (this.instance) {\n this.instance.play();\n if (this.playButton) {\n this.playButton.style.display = \"none\";\n }\n }\n }\n /**\n * Checks if this player is allowed to be fullscreen by the browser.\n *\n * @returns True if you may call [[enterFullscreen]].\n */\n get fullscreenEnabled() {\n return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);\n }\n /**\n * Checks if this player is currently fullscreen inside the browser.\n *\n * @returns True if it is fullscreen.\n */\n get isFullscreen() {\n return ((document.fullscreenElement || document.webkitFullscreenElement) ===\n this);\n }\n /**\n * Exported function that requests the browser to change the fullscreen state if\n * it is allowed.\n *\n * @param isFull Whether to set to fullscreen or return to normal.\n */\n setFullscreen(isFull) {\n if (this.fullscreenEnabled) {\n if (isFull) {\n this.enterFullscreen();\n }\n else {\n this.exitFullscreen();\n }\n }\n }\n /**\n * Requests the browser to make this player fullscreen.\n *\n * This is not guaranteed to succeed, please check [[fullscreenEnabled]] first.\n */\n enterFullscreen() {\n const options = {\n navigationUI: \"hide\",\n };\n if (this.requestFullscreen) {\n this.requestFullscreen(options);\n }\n else if (this.webkitRequestFullscreen) {\n this.webkitRequestFullscreen(options);\n }\n else if (this.webkitRequestFullScreen) {\n this.webkitRequestFullScreen(options);\n }\n }\n /**\n * Requests the browser to no longer make this player fullscreen.\n */\n exitFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n }\n else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n /**\n * Called when entering / leaving fullscreen\n */\n fullScreenChange() {\n var _a;\n (_a = this.instance) === null || _a === void 0 ? void 0 : _a.set_fullscreen(this.isFullscreen);\n }\n pointerDown(event) {\n // Give option to disable context menu when touch support is being used\n // to avoid a long press triggering the context menu. (#1972)\n if (event.pointerType === \"touch\" || event.pointerType === \"pen\") {\n this.isTouch = true;\n }\n }\n /**\n * Fetches the loaded SWF and downloads it.\n */\n async downloadSwf() {\n try {\n if (this.swfUrl) {\n console.log(\"Downloading SWF: \" + this.swfUrl);\n const response = await fetch(this.swfUrl);\n if (!response.ok) {\n console.error(\"SWF download failed\");\n return;\n }\n const blob = await response.blob();\n const blobUrl = URL.createObjectURL(blob);\n const swfDownloadA = document.createElement(\"a\");\n swfDownloadA.style.display = \"none\";\n swfDownloadA.href = blobUrl;\n swfDownloadA.download = this.swfUrl.substring(this.swfUrl.lastIndexOf(\"/\") + 1);\n document.body.appendChild(swfDownloadA);\n swfDownloadA.click();\n document.body.removeChild(swfDownloadA);\n URL.revokeObjectURL(blobUrl);\n }\n else {\n console.error(\"SWF download failed\");\n }\n }\n catch (err) {\n console.error(\"SWF download failed\");\n }\n }\n contextMenuItems() {\n const CHECKMARK = String.fromCharCode(0x2713);\n const items = [];\n if (this.instance) {\n const customItems = this.instance.prepare_context_menu();\n customItems.forEach((item, index) => {\n if (item.separatorBefore)\n items.push(null);\n items.push({\n // TODO: better checkboxes\n text: item.caption + (item.checked ? ` (${CHECKMARK})` : ``),\n onClick: () => { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.run_context_menu_callback(index); },\n enabled: item.enabled,\n });\n });\n }\n items.push(null);\n if (this.fullscreenEnabled) {\n if (this.isFullscreen) {\n items.push({\n text: \"Exit fullscreen\",\n onClick: () => { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.set_fullscreen(false); },\n });\n }\n else {\n items.push({\n text: \"Enter fullscreen\",\n onClick: () => { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.set_fullscreen(true); },\n });\n }\n }\n if (this.instance && this.swfUrl && this.showSwfDownload) {\n items.push(null);\n items.push({\n text: `Download .swf`,\n onClick: this.downloadSwf.bind(this),\n });\n }\n items.push(null);\n const extensionString = this.isExtension ? \"extension\" : \"\";\n items.push({\n text: `About Ruffle ${extensionString} (nightly 2022-01-15)`,\n onClick() {\n window.open(RUFFLE_ORIGIN, \"_blank\");\n },\n });\n if (this.isTouch) {\n items.push(null);\n items.push({\n text: \"Hide this menu\",\n onClick: () => (this.contextMenuForceDisabled = true),\n });\n }\n return items;\n }\n showContextMenu(e) {\n e.preventDefault();\n if (!this.hasContextMenu || this.contextMenuForceDisabled) {\n return;\n }\n // Clear all context menu items.\n while (this.contextMenuElement.firstChild) {\n this.contextMenuElement.removeChild(this.contextMenuElement.firstChild);\n }\n // Populate context menu items.\n for (const item of this.contextMenuItems()) {\n if (item === null) {\n if (!this.contextMenuElement.lastElementChild)\n continue; // don't start with separators\n if (this.contextMenuElement.lastElementChild.classList.contains(\"menu_separator\"))\n continue; // don't repeat separators\n const menuSeparator = document.createElement(\"li\");\n menuSeparator.className = \"menu_separator\";\n const hr = document.createElement(\"hr\");\n menuSeparator.appendChild(hr);\n this.contextMenuElement.appendChild(menuSeparator);\n }\n else {\n const { text, onClick, enabled } = item;\n const menuItem = document.createElement(\"li\");\n menuItem.className = \"menu_item\";\n menuItem.textContent = text;\n this.contextMenuElement.appendChild(menuItem);\n if (enabled !== false) {\n menuItem.addEventListener(\"click\", onClick);\n }\n else {\n menuItem.classList.add(\"disabled\");\n }\n }\n }\n // Place a context menu in the top-left corner, so\n // its `clientWidth` and `clientHeight` are not clamped.\n this.contextMenuElement.style.left = \"0\";\n this.contextMenuElement.style.top = \"0\";\n this.contextMenuElement.style.display = \"block\";\n const rect = this.getBoundingClientRect();\n const x = e.clientX - rect.x;\n const y = e.clientY - rect.y;\n const maxX = rect.width - this.contextMenuElement.clientWidth - 1;\n const maxY = rect.height - this.contextMenuElement.clientHeight - 1;\n this.contextMenuElement.style.left =\n Math.floor(Math.min(x, maxX)) + \"px\";\n this.contextMenuElement.style.top =\n Math.floor(Math.min(y, maxY)) + \"px\";\n }\n hideContextMenu() {\n var _a;\n (_a = this.instance) === null || _a === void 0 ? void 0 : _a.clear_custom_menu_items();\n this.contextMenuElement.style.display = \"none\";\n }\n /**\n * Pauses this player.\n *\n * No more frames, scripts or sounds will be executed.\n * This movie will be considered inactive and will not wake up until resumed.\n */\n pause() {\n if (this.instance) {\n this.instance.pause();\n if (this.playButton) {\n this.playButton.style.display = \"block\";\n }\n }\n }\n audioState() {\n if (this.instance) {\n const audioContext = this.instance.audio_context();\n return (audioContext && audioContext.state) || \"running\";\n }\n return \"suspended\";\n }\n unmuteOverlayClicked() {\n if (this.instance) {\n if (this.audioState() !== \"running\") {\n const audioContext = this.instance.audio_context();\n if (audioContext) {\n audioContext.resume();\n }\n }\n if (this.unmuteOverlay) {\n this.unmuteOverlay.style.display = \"none\";\n }\n }\n }\n /**\n * Plays a silent sound based on the AudioContext's sample rate.\n *\n * This is used to unmute audio on iOS and iPadOS when silent mode is enabled on the device (issue 1552).\n */\n unmuteAudioContext() {\n // No need to play the dummy sound again once audio is unmuted.\n if (isAudioContextUnmuted)\n return;\n // TODO: Use `navigator.userAgentData` to detect the platform when support improves?\n if (navigator.maxTouchPoints < 1) {\n isAudioContextUnmuted = true;\n return;\n }\n this.container.addEventListener(\"click\", () => {\n var _a;\n if (isAudioContextUnmuted)\n return;\n const audioContext = (_a = this.instance) === null || _a === void 0 ? void 0 : _a.audio_context();\n if (!audioContext)\n return;\n const audio = new Audio();\n audio.src = (() => {\n // Returns a seven samples long 8 bit mono WAVE file.\n // This is required to prevent the AudioContext from desyncing and crashing.\n const arrayBuffer = new ArrayBuffer(10);\n const dataView = new DataView(arrayBuffer);\n const sampleRate = audioContext.sampleRate;\n dataView.setUint32(0, sampleRate, true);\n dataView.setUint32(4, sampleRate, true);\n dataView.setUint16(8, 1, true);\n const missingCharacters = window\n .btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)))\n .slice(0, 13);\n return `data:audio/wav;base64,UklGRisAAABXQVZFZm10IBAAAAABAAEA${missingCharacters}AgAZGF0YQcAAACAgICAgICAAAA=`;\n })();\n audio.load();\n audio\n .play()\n .then(() => {\n isAudioContextUnmuted = true;\n })\n .catch((err) => {\n console.warn(`Failed to play dummy sound: ${err}`);\n });\n }, { once: true });\n }\n /**\n * Copies attributes and children from another element to this player element.\n * Used by the polyfill elements, RuffleObject and RuffleEmbed.\n *\n * @param elem The element to copy all attributes from.\n * @protected\n */\n copyElement(elem) {\n if (elem) {\n for (let i = 0; i < elem.attributes.length; i++) {\n const attrib = elem.attributes[i];\n if (attrib.specified) {\n // Issue 468: Chrome \"Click to Active Flash\" box stomps on title attribute\n if (attrib.name === \"title\" &&\n attrib.value === \"Adobe Flash Player\") {\n continue;\n }\n try {\n this.setAttribute(attrib.name, attrib.value);\n }\n catch (err) {\n // The embed may have invalid attributes, so handle these gracefully.\n console.warn(`Unable to set attribute ${attrib.name} on Ruffle instance`);\n }\n }\n }\n for (const node of Array.from(elem.children)) {\n this.appendChild(node);\n }\n }\n }\n /**\n * Converts a dimension attribute on an HTML embed/object element to a valid CSS dimension.\n * HTML element dimensions are unitless, but can also be percentages.\n * Add a 'px' unit unless the value is a percentage.\n * Returns null if this is not a valid dimension.\n *\n * @param attribute The attribute to convert\n *\n * @private\n */\n static htmlDimensionToCssDimension(attribute) {\n if (attribute) {\n const match = attribute.match(DIMENSION_REGEX);\n if (match) {\n let out = match[1];\n if (!match[3]) {\n // Unitless -- add px for CSS.\n out += \"px\";\n }\n return out;\n }\n }\n return null;\n }\n /**\n * When a movie presents a new callback through `ExternalInterface.addCallback`,\n * we are informed so that we can expose the method on any relevant DOM element.\n *\n * This should only be called by Ruffle itself and not by users.\n *\n * @param name The name of the callback that is now available.\n *\n * @internal\n * @ignore\n */\n onCallbackAvailable(name) {\n const instance = this.instance;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this[name] = (...args) => {\n return instance === null || instance === void 0 ? void 0 : instance.call_exposed_callback(name, args);\n };\n }\n /**\n * Sets a trace observer on this flash player.\n *\n * The observer will be called, as a function, for each message that the playing movie will \"trace\" (output).\n *\n * @param observer The observer that will be called for each trace.\n */\n set traceObserver(observer) {\n var _a;\n (_a = this.instance) === null || _a === void 0 ? void 0 : _a.set_trace_observer(observer);\n }\n /**\n * Panics this specific player, forcefully destroying all resources and displays an error message to the user.\n *\n * This should be called when something went absolutely, incredibly and disastrously wrong and there is no chance\n * of recovery.\n *\n * Ruffle will attempt to isolate all damage to this specific player instance, but no guarantees can be made if there\n * was a core issue which triggered the panic. If Ruffle is unable to isolate the cause to a specific player, then\n * all players will panic and Ruffle will become \"poisoned\" - no more players will run on this page until it is\n * reloaded fresh.\n *\n * @param error The error, if any, that triggered this panic.\n */\n panic(error) {\n var _a;\n if (this.panicked) {\n // Only show the first major error, not any repeats - they aren't as important\n return;\n }\n this.panicked = true;\n if (error instanceof Error &&\n (error.name === \"AbortError\" ||\n error.message.includes(\"AbortError\"))) {\n // Firefox: Don't display the panic screen if the user leaves the page while something is still loading\n return;\n }\n const errorIndex = (_a = error === null || error === void 0 ? void 0 : error.ruffleIndexError) !== null && _a !== void 0 ? _a : 0 /* Unknown */;\n const errorArray = Object.assign([], {\n stackIndex: -1,\n });\n errorArray.push(\"# Error Info\\n\");\n if (error instanceof Error) {\n errorArray.push(`Error name: ${error.name}\\n`);\n errorArray.push(`Error message: ${error.message}\\n`);\n if (error.stack) {\n const stackIndex = errorArray.push(`Error stack:\\n\\`\\`\\`\\n${error.stack}\\n\\`\\`\\`\\n`) - 1;\n errorArray.stackIndex = stackIndex;\n }\n }\n else {\n errorArray.push(`Error: ${error}\\n`);\n }\n errorArray.push(\"\\n# Player Info\\n\");\n errorArray.push(this.debugPlayerInfo());\n errorArray.push(\"\\n# Page Info\\n\");\n errorArray.push(`Page URL: ${document.location.href}\\n`);\n if (this.swfUrl)\n errorArray.push(`SWF URL: ${this.swfUrl}\\n`);\n errorArray.push(\"\\n# Browser Info\\n\");\n errorArray.push(`Useragent: ${window.navigator.userAgent}\\n`);\n errorArray.push(`OS: ${window.navigator.platform}\\n`);\n errorArray.push(\"\\n# Ruffle Info\\n\");\n errorArray.push(`Version: 0.1.0\\n`);\n errorArray.push(`Name: nightly 2022-01-15\\n`);\n errorArray.push(`Channel: nightly\\n`);\n errorArray.push(`Built: 2022-01-15T00:14:26.227Z\\n`);\n errorArray.push(`Commit: 31443cc9e7017e2f14d56d415730746245feb31e\\n`);\n errorArray.push(`Is extension: ${this.isExtension}\\n`);\n const errorText = errorArray.join(\"\");\n // Remove query params for the issue title.\n const pageUrl = document.location.href.split(/[?#]/)[0];\n const issueTitle = `Error on ${pageUrl}`;\n let issueLink = `https://github.com/ruffle-rs/ruffle/issues/new?title=${encodeURIComponent(issueTitle)}&template=error_report.md&labels=error-report&body=`;\n let issueBody = encodeURIComponent(errorText);\n if (errorArray.stackIndex > -1 &&\n String(issueLink + issueBody).length > 8195) {\n // Strip the stack error from the array when the produced URL is way too long.\n // This should prevent \"414 Request-URI Too Large\" errors on Github.\n errorArray[errorArray.stackIndex] = null;\n issueBody = encodeURIComponent(errorArray.join(\"\"));\n }\n issueLink += issueBody;\n // Clears out any existing content (ie play button or canvas) and replaces it with the error screen\n let errorBody, errorFooter;\n switch (errorIndex) {\n case 2 /* FileProtocol */:\n // General error: Running on the `file:` protocol\n errorBody = `\n <p>It appears you are running Ruffle on the \"file:\" protocol.</p>\n <p>This doesn't work as browsers block many features from working for security reasons.</p>\n <p>Instead, we invite you to setup a local server or either use the web demo or the desktop application.</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"${RUFFLE_ORIGIN}/demo\">Web Demo</a></li>\n <li><a target=\"_top\" href=\"https://github.com/ruffle-rs/ruffle/tags\">Desktop Application</a></li>\n `;\n break;\n case 4 /* JavascriptConfiguration */:\n // General error: Incorrect JavaScript configuration\n errorBody = `\n <p>Ruffle has encountered a major issue due to an incorrect JavaScript configuration.</p>\n <p>If you are the server administrator, we invite you to check the error details to find out which parameter is at fault.</p>\n <p>You can also consult the Ruffle wiki for help.</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#javascript-api\">View Ruffle Wiki</a></li>\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n case 9 /* WasmNotFound */:\n // Self hosted: Cannot load `.wasm` file - file not found\n errorBody = `\n <p>Ruffle failed to load the required \".wasm\" file component.</p>\n <p>If you are the server administrator, please ensure the file has correctly been uploaded.</p>\n <p>If the issue persists, you may need to use the \"publicPath\" setting: please consult the Ruffle wiki for help.</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#configuration-options\">View Ruffle Wiki</a></li>\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n case 8 /* WasmMimeType */:\n // Self hosted: Cannot load `.wasm` file - incorrect MIME type\n errorBody = `\n <p>Ruffle has encountered a major issue whilst trying to initialize.</p>\n <p>This web server is not serving \".wasm\" files with the correct MIME type.</p>\n <p>If you are the server administrator, please consult the Ruffle wiki for help.</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#configure-webassembly-mime-type\">View Ruffle Wiki</a></li>\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n case 10 /* SwfFetchError */:\n errorBody = `\n <p>Ruffle failed to load the Flash SWF file.</p>\n <p>The most likely reason is that the file no longer exists, so there is nothing for Ruffle to load.</p>\n <p>Try contacting the website administrator for help.</p>\n `;\n errorFooter = `\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n case 6 /* WasmCors */:\n // Self hosted: Cannot load `.wasm` file - CORS issues\n errorBody = `\n <p>Ruffle failed to load the required \".wasm\" file component.</p>\n <p>Access to fetch has likely been blocked by CORS policy.</p>\n <p>If you are the server administrator, please consult the Ruffle wiki for help.</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#web\">View Ruffle Wiki</a></li>\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n case 3 /* InvalidWasm */:\n // Self hosted: Cannot load `.wasm` file - incorrect configuration or missing files\n errorBody = `\n <p>Ruffle has encountered a major issue whilst trying to initialize.</p>\n <p>It seems like this page has missing or invalid files for running Ruffle.</p>\n <p>If you are the server administrator, please consult the Ruffle wiki for help.</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#addressing-a-compileerror\">View Ruffle Wiki</a></li>\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n case 7 /* WasmDownload */:\n // Usually a transient network error or botched deployment\n errorBody = `\n <p>Ruffle has encountered a major issue whilst trying to initialize.</p>\n <p>This can often resolve itself, so you can try reloading the page.</p>\n <p>Otherwise, please contact the website administrator.</p>\n `;\n errorFooter = `\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n case 5 /* JavascriptConflict */:\n // Self hosted: Cannot load `.wasm` file - a native object / function is overriden\n errorBody = `\n <p>Ruffle has encountered a major issue whilst trying to initialize.</p>\n <p>It seems like this page uses JavaScript code that conflicts with Ruffle.</p>\n <p>If you are the server administrator, we invite you to try loading the file on a blank page.</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"${issueLink}\">Report Bug</a></li>\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n case 1 /* CSPConflict */:\n // General error: Cannot load `.wasm` file - a native object / function is overriden\n errorBody = `\n <p>Ruffle has encountered a major issue whilst trying to initialize.</p>\n <p>This web server's Content Security Policy does not allow the required \".wasm\" component to run.</p>\n <p>If you are the server administrator, please consult the Ruffle wiki for help.</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#configure-wasm-csp\">View Ruffle Wiki</a></li>\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n default:\n // Unknown error\n errorBody = `\n <p>Ruffle has encountered a major issue whilst trying to display this Flash content.</p>\n <p>This isn't supposed to happen, so we'd really appreciate if you could file a bug!</p>\n `;\n errorFooter = `\n <li><a target=\"_top\" href=\"${issueLink}\">Report Bug</a></li>\n <li><a href=\"#\" id=\"panic-view-details\">View Error Details</a></li>\n `;\n break;\n }\n this.container.innerHTML = `\n <div id=\"panic\">\n <div id=\"panic-title\">Something went wrong :(</div>\n <div id=\"panic-body\">${errorBody}</div>\n <div id=\"panic-footer\">\n <ul>${errorFooter}</ul>\n </div>\n </div>\n `;\n const viewDetails = (this.container.querySelector(\"#panic-view-details\"));\n if (viewDetails) {\n viewDetails.onclick = () => {\n const panicBody = (this.container.querySelector(\"#panic-body\"));\n panicBody.classList.add(\"details\");\n panicBody.innerHTML = `<textarea>${errorText}</textarea>`;\n return false;\n };\n }\n // Do this last, just in case it causes any cascading issues.\n this.destroy();\n }\n displayRootMovieDownloadFailedMessage() {\n const swfUrl = new URL(this.swfUrl);\n if (window.location.origin == swfUrl.origin ||\n !this.isExtension ||\n !window.location.protocol.includes(\"http\")) {\n const error = new Error(\"Failed to fetch: \" + this.swfUrl);\n error.ruffleIndexError = 10 /* SwfFetchError */;\n this.panic(error);\n return;\n }\n const div = document.createElement(\"div\");\n div.id = \"message_overlay\";\n div.innerHTML = `<div class=\"message\">\n <p>Ruffle wasn't able to run the Flash embedded in this page.</p>\n <p>You can try to open the file in a separate tab, to sidestep this issue.</p>\n <div>\n <a target=\"_blank\" href=\"${this.swfUrl}\">Open in a new tab</a>\n </div>\n </div>`;\n this.container.prepend(div);\n }\n displayUnsupportedMessage() {\n const div = document.createElement(\"div\");\n div.id = \"message_overlay\";\n // TODO: Change link to https://ruffle.rs/faq or similar\n // TODO: Pause content until message is dismissed\n div.innerHTML = `<div class=\"message\">\n <p>Flash Player has been removed from browsers in 2021.</p>\n <p>This content is not yet supported by the Ruffle emulator and will likely not run as intended.</p>\n <div>\n <a target=\"_blank\" class=\"more-info-link\" href=\"https://github.com/ruffle-rs/ruffle/wiki/Frequently-Asked-Questions-For-Users\">More info</a>\n <button id=\"run-anyway-btn\">Run anyway</button>\n </div>\n </div>`;\n this.container.prepend(div);\n const button = div.querySelector(\"#run-anyway-btn\");\n button.onclick = () => {\n div.parentNode.removeChild(div);\n };\n }\n displayMessage(message) {\n // Show a dismissible message in front of the player\n const div = document.createElement(\"div\");\n div.id = \"message_overlay\";\n div.innerHTML = `<div class=\"message\">\n <p>${message}</p>\n <div>\n <button id=\"continue-btn\">continue</button>\n </div>\n </div>`;\n this.container.prepend(div);\n (this.container.querySelector(\"#continue-btn\")).onclick = () => {\n div.parentNode.removeChild(div);\n };\n }\n debugPlayerInfo() {\n var _a, _b;\n return `Allows script access: ${(_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.allowScriptAccess) !== null && _b !== void 0 ? _b : false}\\n`;\n }\n setMetadata(metadata) {\n this._metadata = metadata;\n // TODO: Switch this to ReadyState.Loading when we have streaming support.\n this._readyState = 2 /* Loaded */;\n this.dispatchEvent(new Event(RufflePlayer.LOADED_METADATA));\n // TODO: Move this to whatever function changes the ReadyState to Loaded when we have streaming support.\n this.dispatchEvent(new Event(RufflePlayer.LOADED_DATA));\n }\n setIsExtension(isExtension) {\n this.isExtension = isExtension;\n }\n}\n/**\n * Triggered when a movie metadata has been loaded (such as movie width and height).\n *\n * @event RufflePlayer#loadedmetadata\n */\nRufflePlayer.LOADED_METADATA = \"loadedmetadata\";\n/**\n * Triggered when a movie is fully loaded.\n *\n * @event RufflePlayer#loadeddata\n */\nRufflePlayer.LOADED_DATA = \"loadeddata\";\n/**\n * Returns whether a SWF file can call JavaScript code in the surrounding HTML file.\n *\n * @param access The value of the `allowScriptAccess` attribute.\n * @param url The URL of the SWF file.\n * @returns True if script access is allowed.\n */\nexport function isScriptAccessAllowed(access, url) {\n if (!access) {\n access = \"sameDomain\";\n }\n switch (access.toLowerCase()) {\n case \"always\":\n return true;\n case \"never\":\n return false;\n case \"samedomain\":\n default:\n try {\n return (new URL(window.location.href).origin ===\n new URL(url, window.location.href).origin);\n }\n catch (_a) {\n return false;\n }\n }\n}\n/**\n * Returns whether a SWF file should show the built-in context menu items.\n *\n * @param menu The value of the `menu` attribute.\n * @returns True if the built-in context items should be shown.\n */\nexport function isBuiltInContextMenuVisible(menu) {\n if (menu === null || menu.toLowerCase() === \"true\") {\n return true;\n }\n return false;\n}\n/**\n * Returns whether the given filename ends in a known flash extension.\n *\n * @param filename The filename to test.\n * @returns True if the filename is a flash movie (swf or spl).\n */\nexport function isSwfFilename(filename) {\n if (filename) {\n let pathname = \"\";\n try {\n // A base URL is required if `filename` is a relative URL, but we don't need to detect the real URL origin.\n pathname = new URL(filename, RUFFLE_ORIGIN).pathname;\n }\n catch (err) {\n // Some invalid filenames, like `///`, could raise a TypeError. Let's fail silently in this situation.\n }\n if (pathname && pathname.length >= 4) {\n const extension = pathname.slice(-4).toLowerCase();\n if (extension === \".swf\" || extension === \".spl\") {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Determine if an element is a child of a node that was not supported\n * in non-HTML5 compliant browsers. If so, the element was meant to be\n * used as a fallback content.\n *\n * @param elem The element to test.\n * @returns True if the element is inside an <audio> or <video> node.\n */\nexport function isFallbackElement(elem) {\n let parent = elem.parentElement;\n while (parent !== null) {\n switch (parent.tagName) {\n case \"AUDIO\":\n case \"VIDEO\":\n return true;\n }\n parent = parent.parentElement;\n }\n return false;\n}\n","import { FLASH_MIMETYPE, FUTURESPLASH_MIMETYPE, FLASH7_AND_8_MIMETYPE, FLASH_MOVIE_MIMETYPE, isBuiltInContextMenuVisible, isFallbackElement, isScriptAccessAllowed, isSwfFilename, RufflePlayer, } from \"./ruffle-player\";\nimport { registerElement } from \"./register-element\";\n/**\n * A polyfill html element.\n *\n * This specific class tries to polyfill existing `<embed>` tags,\n * and should not be used. Prefer [[RufflePlayer]] instead.\n *\n * @internal\n */\nexport class RuffleEmbed extends RufflePlayer {\n /**\n * Constructs a new Ruffle flash player for insertion onto the page.\n *\n * This specific class tries to polyfill existing `<embed>` tags,\n * and should not be used. Prefer [[RufflePlayer]] instead.\n */\n constructor() {\n super();\n }\n /**\n * @ignore\n * @internal\n */\n connectedCallback() {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;\n super.connectedCallback();\n const src = this.attributes.getNamedItem(\"src\");\n if (src) {\n const allowScriptAccess = (_b = (_a = this.attributes.getNamedItem(\"allowScriptAccess\")) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null;\n const menu = (_d = (_c = this.attributes.getNamedItem(\"menu\")) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : null;\n // Kick off the SWF download.\n this.load({\n url: src.value,\n allowScriptAccess: isScriptAccessAllowed(allowScriptAccess, src.value),\n parameters: (_e = this.attributes.getNamedItem(\"flashvars\")) === null || _e === void 0 ? void 0 : _e.value,\n backgroundColor: (_f = this.attributes.getNamedItem(\"bgcolor\")) === null || _f === void 0 ? void 0 : _f.value,\n base: (_g = this.attributes.getNamedItem(\"base\")) === null || _g === void 0 ? void 0 : _g.value,\n menu: isBuiltInContextMenuVisible(menu),\n salign: (_j = (_h = this.attributes.getNamedItem(\"salign\")) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : \"\",\n quality: (_l = (_k = this.attributes.getNamedItem(\"quality\")) === null || _k === void 0 ? void 0 : _k.value) !== null && _l !== void 0 ? _l : \"high\",\n scale: (_o = (_m = this.attributes.getNamedItem(\"scale\")) === null || _m === void 0 ? void 0 : _m.value) !== null && _o !== void 0 ? _o : \"showAll\",\n });\n }\n }\n /**\n * Polyfill of HTMLObjectElement.\n *\n * @ignore\n * @internal\n */\n get src() {\n var _a;\n return (_a = this.attributes.getNamedItem(\"src\")) === null || _a === void 0 ? void 0 : _a.value;\n }\n /**\n * Polyfill of HTMLObjectElement.\n *\n * @ignore\n * @internal\n */\n set src(srcval) {\n if (srcval != undefined) {\n const attr = document.createAttribute(\"src\");\n attr.value = srcval;\n this.attributes.setNamedItem(attr);\n }\n else {\n this.attributes.removeNamedItem(\"src\");\n }\n }\n /**\n * @ignore\n * @internal\n */\n static get observedAttributes() {\n return [\"src\", \"width\", \"height\"];\n }\n /**\n * @ignore\n * @internal\n */\n attributeChangedCallback(name, oldValue, newValue) {\n var _a;\n super.attributeChangedCallback(name, oldValue, newValue);\n if (this.isConnected && name === \"src\") {\n let parameters;\n const flashvars = this.attributes.getNamedItem(\"flashvars\");\n if (flashvars) {\n parameters = flashvars.value;\n }\n const src = this.attributes.getNamedItem(\"src\");\n if (src) {\n this.load({\n url: src.value,\n parameters,\n base: (_a = this.attributes.getNamedItem(\"base\")) === null || _a === void 0 ? void 0 : _a.value,\n });\n }\n }\n }\n /**\n * Checks if the given element may be polyfilled with this one.\n *\n * @param elem Element to check.\n * @returns True if the element looks like a flash embed.\n */\n static isInterdictable(elem) {\n var _a;\n // Don't polyfill if the element is inside a specific node.\n if (isFallbackElement(elem)) {\n return false;\n }\n // Don't polyfill when no file is specified.\n if (!elem.getAttribute(\"src\")) {\n return false;\n }\n // Check for MIME type.\n const type = (_a = elem.getAttribute(\"type\")) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n if (type === FLASH_MIMETYPE.toLowerCase() ||\n type === FUTURESPLASH_MIMETYPE.toLowerCase() ||\n type === FLASH7_AND_8_MIMETYPE.toLowerCase() ||\n type === FLASH_MOVIE_MIMETYPE.toLowerCase()) {\n return true;\n }\n else if (type == null || type === \"\") {\n return isSwfFilename(elem.getAttribute(\"src\"));\n }\n return false;\n }\n /**\n * Creates a RuffleEmbed that will polyfill and replace the given element.\n *\n * @param elem Element to replace.\n * @returns Created RuffleEmbed.\n */\n static fromNativeEmbedElement(elem) {\n const externalName = registerElement(\"ruffle-embed\", RuffleEmbed);\n const ruffleObj = document.createElement(externalName);\n ruffleObj.copyElement(elem);\n return ruffleObj;\n }\n}\n","import { FLASH_MIMETYPE, FUTURESPLASH_MIMETYPE, FLASH7_AND_8_MIMETYPE, FLASH_MOVIE_MIMETYPE, FLASH_ACTIVEX_CLASSID, isBuiltInContextMenuVisible, isFallbackElement, isScriptAccessAllowed, isSwfFilename, RufflePlayer, } from \"./ruffle-player\";\nimport { registerElement } from \"./register-element\";\nimport { RuffleEmbed } from \"./ruffle-embed\";\n/**\n * Find and return the first value in obj with the given key.\n * Many Flash params were case insensitive, so we use this when checking for them.\n *\n * @param obj Object to check\n * @param key Key to find\n * @param defaultValue Value if not found\n * @returns Value if found, else [[defaultValue]]\n */\nfunction findCaseInsensitive(obj, key, defaultValue) {\n key = key.toLowerCase();\n for (const k in obj) {\n if (Object.hasOwnProperty.call(obj, k) && key === k.toLowerCase()) {\n return obj[k];\n }\n }\n return defaultValue;\n}\n/**\n * Returns all flash params ([[HTMLParamElement]]) that are for the given object.\n *\n * @param elem Element to check.\n * @returns A record of every parameter.\n */\nfunction paramsOf(elem) {\n var _a, _b;\n const params = {};\n for (const param of elem.children) {\n if (param instanceof HTMLParamElement) {\n const key = (_a = param.attributes.getNamedItem(\"name\")) === null || _a === void 0 ? void 0 : _a.value;\n const value = (_b = param.attributes.getNamedItem(\"value\")) === null || _b === void 0 ? void 0 : _b.value;\n if (key && value) {\n params[key] = value;\n }\n }\n }\n return params;\n}\n/**\n * A polyfill html element.\n *\n * This specific class tries to polyfill existing `<object>` tags,\n * and should not be used. Prefer [[RufflePlayer]] instead.\n *\n * @internal\n */\nexport class RuffleObject extends RufflePlayer {\n /**\n * Constructs a new Ruffle flash player for insertion onto the page.\n *\n * This specific class tries to polyfill existing `<object>` tags,\n * and should not be used. Prefer [[RufflePlayer]] instead.\n */\n constructor() {\n super();\n this.params = {};\n }\n /**\n * @ignore\n * @internal\n */\n connectedCallback() {\n var _a;\n super.connectedCallback();\n this.params = paramsOf(this);\n let url = null;\n if (this.attributes.getNamedItem(\"data\")) {\n url = (_a = this.attributes.getNamedItem(\"data\")) === null || _a === void 0 ? void 0 : _a.value;\n }\n else if (this.params.movie) {\n url = this.params.movie;\n }\n const allowScriptAccess = findCaseInsensitive(this.params, \"allowScriptAccess\", null);\n const parameters = findCaseInsensitive(this.params, \"flashvars\", this.getAttribute(\"flashvars\"));\n const backgroundColor = findCaseInsensitive(this.params, \"bgcolor\", this.getAttribute(\"bgcolor\"));\n const base = findCaseInsensitive(this.params, \"base\", this.getAttribute(\"base\"));\n const menu = findCaseInsensitive(this.params, \"menu\", null);\n const salign = findCaseInsensitive(this.params, \"salign\", \"\");\n const quality = findCaseInsensitive(this.params, \"quality\", \"high\");\n const scale = findCaseInsensitive(this.params, \"scale\", \"showAll\");\n if (url) {\n const options = { url };\n options.allowScriptAccess = isScriptAccessAllowed(allowScriptAccess, url);\n if (parameters) {\n options.parameters = parameters;\n }\n if (backgroundColor) {\n options.backgroundColor = backgroundColor;\n }\n if (base) {\n options.base = base;\n }\n options.menu = isBuiltInContextMenuVisible(menu);\n if (salign) {\n options.salign = salign;\n }\n if (quality) {\n options.quality = quality;\n }\n if (scale) {\n options.scale = scale;\n }\n // Kick off the SWF download.\n this.load(options);\n }\n }\n debugPlayerInfo() {\n var _a;\n let errorText = super.debugPlayerInfo();\n errorText += \"Player type: Object\\n\";\n let url = null;\n if (this.attributes.getNamedItem(\"data\")) {\n url = (_a = this.attributes.getNamedItem(\"data\")) === null || _a === void 0 ? void 0 : _a.value;\n }\n else if (this.params.movie) {\n url = this.params.movie;\n }\n errorText += `SWF URL: ${url}\\n`;\n Object.keys(this.params).forEach((key) => {\n errorText += `Param ${key}: ${this.params[key]}\\n`;\n });\n Object.keys(this.attributes).forEach((key) => {\n var _a;\n errorText += `Attribute ${key}: ${(_a = this.attributes.getNamedItem(key)) === null || _a === void 0 ? void 0 : _a.value}\\n`;\n });\n return errorText;\n }\n /**\n * Polyfill of HTMLObjectElement.\n *\n * @ignore\n * @internal\n */\n get data() {\n return this.getAttribute(\"data\");\n }\n /**\n * Polyfill of HTMLObjectElement.\n *\n * @ignore\n * @internal\n */\n set data(href) {\n if (href != undefined) {\n const attr = document.createAttribute(\"data\");\n attr.value = href;\n this.attributes.setNamedItem(attr);\n }\n else {\n this.attributes.removeNamedItem(\"data\");\n }\n }\n /**\n * Checks if the given element may be polyfilled with this one.\n *\n * @param elem Element to check.\n * @returns True if the element looks like a flash object.\n */\n static isInterdictable(elem) {\n var _a, _b, _c;\n // Don't polyfill if the element is inside a specific node.\n if (isFallbackElement(elem)) {\n return false;\n }\n // Don't polyfill if there's already a <ruffle-embed> inside the <object>.\n if (elem.getElementsByTagName(\"ruffle-embed\").length > 0) {\n return false;\n }\n // Don't polyfill if no movie specified.\n const data = (_a = elem.attributes.getNamedItem(\"data\")) === null || _a === void 0 ? void 0 : _a.value.toLowerCase();\n const params = paramsOf(elem);\n let isSwf;\n // Check for SWF file.\n if (data) {\n isSwf = isSwfFilename(data);\n }\n else if (params && params.movie) {\n isSwf = isSwfFilename(params.movie);\n }\n else {\n // Don't polyfill when no file is specified.\n return false;\n }\n // Check ActiveX class ID.\n const classid = (_b = elem.attributes\n .getNamedItem(\"classid\")) === null || _b === void 0 ? void 0 : _b.value.toLowerCase();\n if (classid === FLASH_ACTIVEX_CLASSID.toLowerCase()) {\n // classid is an old-IE style embed that would not work on modern browsers.\n // Often there will be an <embed> inside the <object> that would take precedence.\n // Only polyfill this <object> if it doesn't contain a polyfillable <embed>.\n return !Array.from(elem.getElementsByTagName(\"embed\")).some(RuffleEmbed.isInterdictable);\n }\n else if (classid != null && classid !== \"\") {\n // Non-Flash classid.\n return false;\n }\n // Check for MIME type.\n const type = (_c = elem.attributes.getNamedItem(\"type\")) === null || _c === void 0 ? void 0 : _c.value.toLowerCase();\n if (type === FLASH_MIMETYPE.toLowerCase() ||\n type === FUTURESPLASH_MIMETYPE.toLowerCase() ||\n type === FLASH7_AND_8_MIMETYPE.toLowerCase() ||\n type === FLASH_MOVIE_MIMETYPE.toLowerCase()) {\n return true;\n }\n else if (type != null && type !== \"\") {\n return false;\n }\n // If no MIME/class type is specified, polyfill if movie is an SWF file.\n return isSwf;\n }\n /**\n * Creates a RuffleObject that will polyfill and replace the given element.\n *\n * @param elem Element to replace.\n * @returns Created RuffleObject.\n */\n static fromNativeObjectElement(elem) {\n const externalName = registerElement(\"ruffle-object\", RuffleObject);\n const ruffleObj = (document.createElement(externalName));\n // Avoid copying embeds-inside-objects to avoid double polyfilling.\n for (const embedElem of Array.from(elem.getElementsByTagName(\"embed\"))) {\n if (RuffleEmbed.isInterdictable(embedElem)) {\n embedElem.remove();\n }\n }\n // Avoid copying objects-inside-objects to avoid double polyfilling.\n // This may happen when Internet Explorer's conditional comments are used.\n for (const objectElem of Array.from(elem.getElementsByTagName(\"object\"))) {\n if (RuffleObject.isInterdictable(objectElem)) {\n objectElem.remove();\n }\n }\n ruffleObj.copyElement(elem);\n return ruffleObj;\n }\n}\n","var _a, _b;\nimport { RuffleObject } from \"./ruffle-object\";\nimport { RuffleEmbed } from \"./ruffle-embed\";\nimport { installPlugin, FLASH_PLUGIN } from \"./plugin-polyfill\";\nimport { publicPath } from \"./public-path\";\nlet isExtension;\nconst globalConfig = (_b = (_a = window.RufflePlayer) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {};\nconst jsScriptUrl = publicPath(globalConfig) + \"ruffle.js\";\n/**\n * Polyfill native Flash elements with Ruffle equivalents.\n *\n * This polyfill isn't fool-proof: If there's a chance site JavaScript has\n * access to a pre-polyfill element, then this will break horribly. We can\n * keep native objects out of the DOM, and thus out of JavaScript's grubby\n * little hands, but only if we load first.\n */\nlet objects;\nlet embeds;\n/**\n *\n */\nfunction polyfillFlashInstances() {\n try {\n // Create live collections to track embed tags.\n objects = objects !== null && objects !== void 0 ? objects : document.getElementsByTagName(\"object\");\n embeds = embeds !== null && embeds !== void 0 ? embeds : document.getElementsByTagName(\"embed\");\n // Replace <object> first, because <object> often wraps <embed>.\n for (const elem of Array.from(objects)) {\n if (RuffleObject.isInterdictable(elem)) {\n const ruffleObject = RuffleObject.fromNativeObjectElement(elem);\n ruffleObject.setIsExtension(isExtension);\n elem.replaceWith(ruffleObject);\n }\n }\n for (const elem of Array.from(embeds)) {\n if (RuffleEmbed.isInterdictable(elem)) {\n const ruffleEmbed = RuffleEmbed.fromNativeEmbedElement(elem);\n ruffleEmbed.setIsExtension(isExtension);\n elem.replaceWith(ruffleEmbed);\n }\n }\n }\n catch (err) {\n console.error(`Serious error encountered when polyfilling native Flash elements: ${err}`);\n }\n}\n/**\n * Inject Ruffle into <iframe> and <frame> elements.\n *\n * This polyfill isn't fool-proof either: On self-hosted builds, it may\n * not work due to browsers CORS policy or be loaded too late for some\n * libraries like SWFObject. These should be less of a problem on the\n * web extension. This polyfill should, however, do the trick in most\n * cases, but users should be aware of its natural limits.\n */\nlet iframes;\nlet frames;\n/**\n *\n */\nfunction polyfillFrames() {\n // Create live collections to track embed tags.\n iframes = iframes !== null && iframes !== void 0 ? iframes : document.getElementsByTagName(\"iframe\");\n frames = frames !== null && frames !== void 0 ? frames : document.getElementsByTagName(\"frame\");\n [iframes, frames].forEach((elementsList) => {\n for (let i = 0; i < elementsList.length; i++) {\n const element = elementsList[i];\n if (element.dataset.rufflePolyfilled !== undefined) {\n // Don't re-polyfill elements with the \"data-ruffle-polyfilled\" attribute.\n continue;\n }\n element.dataset.rufflePolyfilled = \"\";\n const elementWindow = element.contentWindow;\n // Cross origin requests may reach an exception, so let's prepare for this eventuality.\n const errorMessage = `Couldn't load Ruffle into ${element.tagName}[${element.src}]: `;\n try {\n if (elementWindow.document.readyState === \"complete\") {\n injectRuffle(elementWindow, errorMessage);\n }\n }\n catch (err) {\n if (!isExtension) {\n // The web extension should be able to load Ruffle into cross origin frames\n // because it has \"all_frames\" set to true in its manifest.json: RufflePlayer\n // config won't be injected but it's not worth showing an error.\n console.warn(errorMessage + err);\n }\n }\n // Attach listener to the element to handle frame navigation.\n element.addEventListener(\"load\", () => {\n injectRuffle(elementWindow, errorMessage);\n }, false);\n }\n });\n}\n/**\n * @param elementWindow The (i)frame's window object.\n * @param errorMessage The message to log when Ruffle cannot access the (i)frame's document.\n */\nasync function injectRuffle(elementWindow, errorMessage) {\n var _a;\n // The document is supposed to be completely loaded when this function is run.\n // As Chrome may be unable to access the document properties, we have to delay the execution a little bit.\n await new Promise((resolve) => {\n window.setTimeout(() => {\n resolve();\n }, 100);\n });\n let elementDocument;\n try {\n elementDocument = elementWindow.document;\n if (!elementDocument) {\n // Don't polyfill if the window has no document: the element may have been removed from the parent window.\n return;\n }\n }\n catch (err) {\n if (!isExtension) {\n console.warn(errorMessage + err);\n }\n return;\n }\n if (!isExtension &&\n elementDocument.documentElement.dataset.ruffleOptout !== undefined) {\n // Don't polyfill elements with the \"data-ruffle-optout\" attribute.\n return;\n }\n if (!isExtension) {\n if (!elementWindow.RufflePlayer) {\n const script = elementDocument.createElement(\"script\");\n script.setAttribute(\"src\", jsScriptUrl);\n script.onload = () => {\n // Inject parent configuration once the script is loaded, preventing it from being ignored.\n elementWindow.RufflePlayer = {};\n elementWindow.RufflePlayer.config = globalConfig;\n };\n elementDocument.head.appendChild(script);\n }\n }\n else {\n if (!elementWindow.RufflePlayer) {\n elementWindow.RufflePlayer = {};\n }\n // Merge parent window and frame configurations, will likely be applied too late though.\n elementWindow.RufflePlayer.config = Object.assign(Object.assign({}, globalConfig), ((_a = elementWindow.RufflePlayer.config) !== null && _a !== void 0 ? _a : {}));\n }\n}\n/**\n * Listen for changes to the DOM.\n *\n */\nfunction initMutationObserver() {\n const observer = new MutationObserver(function (mutationsList) {\n // If any nodes were added, re-run the polyfill to detect any new instances.\n const nodesAdded = mutationsList.some((mutation) => mutation.addedNodes.length > 0);\n if (nodesAdded) {\n polyfillFlashInstances();\n polyfillFrames();\n }\n });\n observer.observe(document, { childList: true, subtree: true });\n}\n/**\n * Polyfills the detection of Flash plugins in the browser.\n */\nexport function pluginPolyfill() {\n installPlugin(FLASH_PLUGIN);\n}\n/**\n * Polyfills legacy Flash content on the page.\n *\n * @param isExt Whether or not Ruffle is running as a browser's extension.\n */\nexport function polyfill(isExt) {\n isExtension = isExt;\n polyfillFlashInstances();\n polyfillFrames();\n initMutationObserver();\n}\n","/**\n * A representation of a semver 2 compliant version string\n */\nexport class Version {\n /**\n * Construct a Version from specific components.\n *\n * If you wish to parse a string into a Version then please use [[fromSemver]].\n *\n * @param major The major version component.\n * @param minor The minor version component.\n * @param patch The patch version component.\n * @param prIdent A list of pre-release identifiers, if any\n * @param buildIdent A list of build identifiers, if any\n */\n constructor(major, minor, patch, prIdent, buildIdent) {\n this.major = major;\n this.minor = minor;\n this.patch = patch;\n this.prIdent = prIdent;\n this.buildIdent = buildIdent;\n }\n /**\n * Construct a version from a semver 2 compliant string.\n *\n * This function is intended for use with semver 2 compliant strings.\n * Malformed strings may still parse correctly, but this result is not\n * guaranteed.\n *\n * @param versionString A semver 2.0.0 compliant version string\n * @returns A version object\n */\n static fromSemver(versionString) {\n const buildSplit = versionString.split(\"+\"), prSplit = buildSplit[0].split(\"-\"), versionSplit = prSplit[0].split(\".\");\n const major = parseInt(versionSplit[0], 10);\n let minor = 0;\n let patch = 0;\n let prIdent = null;\n let buildIdent = null;\n if (versionSplit[1] != undefined) {\n minor = parseInt(versionSplit[1], 10);\n }\n if (versionSplit[2] != undefined) {\n patch = parseInt(versionSplit[2], 10);\n }\n if (prSplit[1] != undefined) {\n prIdent = prSplit[1].split(\".\");\n }\n if (buildSplit[1] != undefined) {\n buildIdent = buildSplit[1].split(\".\");\n }\n return new Version(major, minor, patch, prIdent, buildIdent);\n }\n /**\n * Returns true if a given version is compatible with this one.\n *\n * Compatibility is defined as having the same nonzero major version\n * number, or if both major versions are zero, the same nonzero minor\n * version number, or if both minor versions are zero, the same nonzero\n * patch version number.\n *\n * This implements the ^ operator in npm's semver package, with the\n * exception of the prerelease exclusion rule.\n *\n * @param other The other version to test against\n * @returns True if compatible\n */\n isCompatibleWith(other) {\n return ((this.major !== 0 && this.major === other.major) ||\n (this.major === 0 &&\n other.major === 0 &&\n this.minor !== 0 &&\n this.minor === other.minor) ||\n (this.major === 0 &&\n other.major === 0 &&\n this.minor === 0 &&\n other.minor === 0 &&\n this.patch !== 0 &&\n this.patch === other.patch));\n }\n /**\n * Returns true if this version has precedence over (is newer than) another\n * version.\n *\n * Precedence is defined as in the Semver 2 spec. This implements the >\n * operator in npm's semver package, with the exception of the prerelease\n * exclusion rule.\n *\n * @param other The other version to test against\n * @returns True if this version has precedence over the other one\n */\n hasPrecedenceOver(other) {\n if (this.major > other.major) {\n return true;\n }\n else if (this.major < other.major) {\n return false;\n }\n if (this.minor > other.minor) {\n return true;\n }\n else if (this.minor < other.minor) {\n return false;\n }\n if (this.patch > other.patch) {\n return true;\n }\n else if (this.patch < other.patch) {\n return false;\n }\n if (this.prIdent == null && other.prIdent != null) {\n return true;\n }\n else if (this.prIdent != null && other.prIdent != null) {\n const isNumeric = /^[0-9]*$/;\n for (let i = 0; i < this.prIdent.length && i < other.prIdent.length; i += 1) {\n if (!isNumeric.test(this.prIdent[i]) &&\n isNumeric.test(other.prIdent[i])) {\n return true;\n }\n else if (isNumeric.test(this.prIdent[i]) &&\n isNumeric.test(other.prIdent[i])) {\n if (parseInt(this.prIdent[i], 10) >\n parseInt(other.prIdent[i], 10)) {\n return true;\n }\n else if (parseInt(this.prIdent[i], 10) <\n parseInt(other.prIdent[i], 10)) {\n return false;\n }\n }\n else if (isNumeric.test(this.prIdent[i]) &&\n !isNumeric.test(other.prIdent[i])) {\n return false;\n }\n else if (!isNumeric.test(this.prIdent[i]) &&\n !isNumeric.test(other.prIdent[i])) {\n if (this.prIdent[i] > other.prIdent[i]) {\n return true;\n }\n else if (this.prIdent[i] < other.prIdent[i]) {\n return false;\n }\n }\n }\n return this.prIdent.length > other.prIdent.length;\n }\n return false;\n }\n /**\n * Tests if a given version is equivalent to this one.\n *\n * Build and prerelease tags are ignored.\n *\n * @param other The other version to test against\n * @returns True if the given version is equivalent\n */\n isEqual(other) {\n return (this.major === other.major &&\n this.minor === other.minor &&\n this.patch === other.patch);\n }\n /**\n * Tests if a given version is stable or a compatible prerelease for this\n * version.\n *\n * This implements the prerelease exclusion rule of NPM semver: a\n * prerelease version can only pass this check if the major/minor/patch\n * components of both versions are the same. Otherwise, the prerelease\n * version always fails.\n *\n * @param other The other version to test against\n * @returns True if the given version is either stable, or a\n * prerelease in the same series as this one.\n */\n isStableOrCompatiblePrerelease(other) {\n if (other.prIdent == null) {\n return true;\n }\n else {\n return (this.major === other.major &&\n this.minor === other.minor &&\n this.patch === other.patch);\n }\n }\n}\n","import { Version } from \"./version\";\n/**\n * Represents a set of version requirements.\n */\nexport class VersionRange {\n /**\n * Constructs a range of versions as specified by the given requirements.\n *\n * If you wish to construct this object from a string representation,\n * then use [[fromRequirementString]].\n *\n * @param requirements Requirements to set this range by\n */\n constructor(requirements) {\n this.requirements = requirements;\n }\n /**\n * Determine if a given version satisfies this range.\n *\n * @param fver A version object to test against.\n * @returns Whether or not the given version matches this range\n */\n satisfiedBy(fver) {\n for (let i = 0; i < this.requirements.length; i += 1) {\n let matches = true;\n for (let j = 0; j < this.requirements[i].length; j += 1) {\n const comparator = this.requirements[i][j].comparator;\n const version = this.requirements[i][j].version;\n matches =\n matches && version.isStableOrCompatiblePrerelease(fver);\n if (comparator === \"\" || comparator === \"=\") {\n matches = matches && version.isEqual(fver);\n }\n else if (comparator === \">\") {\n matches = matches && fver.hasPrecedenceOver(version);\n }\n else if (comparator === \">=\") {\n matches =\n matches &&\n (fver.hasPrecedenceOver(version) ||\n version.isEqual(fver));\n }\n else if (comparator === \"<\") {\n matches = matches && version.hasPrecedenceOver(fver);\n }\n else if (comparator === \"<=\") {\n matches =\n matches &&\n (version.hasPrecedenceOver(fver) ||\n version.isEqual(fver));\n }\n else if (comparator === \"^\") {\n matches = matches && version.isCompatibleWith(fver);\n }\n }\n if (matches) {\n return true;\n }\n }\n return false;\n }\n /**\n * Parse a requirement string into a version range.\n *\n * @param requirement The version requirements, consisting of a\n * series of space-separated strings, each one being a semver version\n * optionally prefixed by a comparator or a separator.\n *\n * Valid comparators are:\n * - `\"\"` or `\"=\"`: Precisely this version\n * - `\">`\": A version newer than this one\n * - `\">`=\": A version newer or equal to this one\n * - `\"<\"`: A version older than this one\n * - `\"<=\"`: A version older or equal to this one\n * - `\"^\"`: A version that is compatible with this one\n *\n * A separator is `\"||`\" which splits the requirement string into\n * left OR right.\n * @returns A version range object.\n */\n static fromRequirementString(requirement) {\n const components = requirement.split(\" \");\n let set = [];\n const requirements = [];\n for (let i = 0; i < components.length; i += 1) {\n if (components[i] === \"||\") {\n if (set.length > 0) {\n requirements.push(set);\n set = [];\n }\n }\n else if (components[i].length > 0) {\n const match = /[0-9]/.exec(components[i]);\n if (match) {\n const comparator = components[i]\n .slice(0, match.index)\n .trim();\n const version = Version.fromSemver(components[i].slice(match.index).trim());\n set.push({ comparator, version });\n }\n }\n }\n if (set.length > 0) {\n requirements.push(set);\n }\n return new VersionRange(requirements);\n }\n}\n","import { Version } from \"./version\";\nimport { VersionRange } from \"./version-range\";\n/**\n * Represents the Ruffle public API.\n *\n * The public API exists primarily to allow multiple installs of Ruffle on a\n * page (e.g. an extension install and a local one) to cooperate. In an ideal\n * situation, all Ruffle sources on the page install themselves into a single\n * public API, and then the public API picks the newest version by default.\n *\n * This API *is* versioned, in case we need to upgrade it. However, it must be\n * backwards- and forwards-compatible with all known sources.\n */\nexport class PublicAPI {\n /**\n * Construct the Ruffle public API.\n *\n * Do not use this function to negotiate a public API. Instead, use\n * `public_api` to register your Ruffle source with an existing public API\n * if it exists.\n *\n * Constructing a Public API will also trigger it to initialize Ruffle once\n * the page loads, if the API has not already been superseded.\n *\n * @param prev What used to be in the public API slot.\n *\n * This is used to upgrade from a prior version of the public API, or from\n * a user-defined configuration object placed in the public API slot.\n * @protected\n */\n constructor(prev) {\n this.sources = {};\n this.config = {};\n this.invoked = false;\n this.newestName = null;\n this.conflict = null;\n if (prev !== undefined && prev !== null) {\n if (prev instanceof PublicAPI) {\n /// We're upgrading from a previous API to a new one.\n this.sources = prev.sources;\n this.config = prev.config;\n this.invoked = prev.invoked;\n this.conflict = prev.conflict;\n this.newestName = prev.newestName;\n prev.superseded();\n }\n else if (prev.constructor === Object &&\n prev.config instanceof Object) {\n /// We're the first, install user configuration\n this.config = prev.config;\n }\n else {\n /// We're the first, but conflicting with someone else.\n this.conflict = prev;\n }\n }\n if (document.readyState === \"loading\") {\n window.addEventListener(\"DOMContentLoaded\", this.init.bind(this));\n }\n else {\n window.setTimeout(this.init.bind(this), 0);\n }\n }\n /**\n * The version of the public API.\n *\n * This is *not* the version of Ruffle itself.\n *\n * This allows a page with an old version of the Public API to be upgraded\n * to a new version of the API. The public API is intended to be changed\n * very infrequently, if at all, but this provides an escape mechanism for\n * newer Ruffle sources to upgrade older installations.\n *\n * @returns The version of this public API.\n */\n get version() {\n return \"0.1.0\";\n }\n /**\n * Register a given source with the Ruffle Public API.\n *\n * @param name The name of the source.\n * @param api The public API object. This must conform to the shape\n * of `SourceAPI`.\n */\n registerSource(name, api) {\n this.sources[name] = api;\n }\n /**\n * Determine the name of the newest registered source in the Public API.\n *\n * @returns The name of the source, or `null` if no source\n * has yet to be registered.\n */\n newestSourceName() {\n let newestName = null, newestVersion = Version.fromSemver(\"0.0.0\");\n for (const k in this.sources) {\n if (Object.prototype.hasOwnProperty.call(this.sources, k)) {\n const kVersion = Version.fromSemver(this.sources[k].version);\n if (kVersion.hasPrecedenceOver(newestVersion)) {\n newestName = k;\n newestVersion = kVersion;\n }\n }\n }\n return newestName;\n }\n /**\n * Negotiate and start Ruffle.\n *\n * This function reads the config parameter to determine which polyfills\n * should be enabled. If the configuration parameter is missing, then we\n * use a built-in set of defaults sufficient to fool sites with static\n * content and weak plugin detection.\n */\n init() {\n if (!this.invoked) {\n this.invoked = true;\n this.newestName = this.newestSourceName();\n if (this.newestName === null) {\n throw new Error(\"No registered Ruffle source!\");\n }\n const polyfills = this.config.polyfills;\n if (polyfills !== false) {\n this.sources[this.newestName].polyfill(this.newestName === \"extension\");\n }\n }\n }\n /**\n * Look up the newest Ruffle source and return it's API.\n *\n * @returns An instance of the Source API.\n */\n newest() {\n const name = this.newestSourceName();\n return name != null ? this.sources[name] : null;\n }\n /**\n * Look up a specific Ruffle version (or any version satisfying a given set\n * of requirements) and return it's API.\n *\n * @param ver_requirement A set of semantic version requirement\n * strings that the player version must satisfy.\n * @returns An instance of the Source API, if one or more\n * sources satisfied the requirement.\n */\n satisfying(ver_requirement) {\n const requirement = VersionRange.fromRequirementString(ver_requirement);\n let valid = null;\n for (const k in this.sources) {\n if (Object.prototype.hasOwnProperty.call(this.sources, k)) {\n const version = Version.fromSemver(this.sources[k].version);\n if (requirement.satisfiedBy(version)) {\n valid = this.sources[k];\n }\n }\n }\n return valid;\n }\n /**\n * Look up the newest Ruffle version compatible with the `local` source, if\n * it's installed. Otherwise, use the latest version.\n *\n * @returns An instance of the Source API\n */\n localCompatible() {\n if (this.sources.local !== undefined) {\n return this.satisfying(\"^\" + this.sources.local.version);\n }\n else {\n return this.newest();\n }\n }\n /**\n * Look up the newest Ruffle version with the exact same version as the\n * `local` source, if it's installed. Otherwise, use the latest version.\n *\n * @returns An instance of the Source API\n */\n local() {\n if (this.sources.local !== undefined) {\n return this.satisfying(\"=\" + this.sources.local.version);\n }\n else {\n return this.newest();\n }\n }\n /**\n * Indicates that this version of the public API has been superseded by a\n * newer version.\n *\n * This should only be called by a newer version of the Public API.\n * Identical versions of the Public API should not supersede older versions\n * of that same API.\n *\n * Unfortunately, we can't disable polyfills after-the-fact, so this\n * only lets you disable the init event...\n *\n * @protected\n */\n superseded() {\n this.invoked = true;\n }\n /**\n * Join a source into the public API, if it doesn't already exist.\n *\n * @param prevRuffle The previous iteration of the Ruffle API.\n *\n * The `prevRuffle` param lists the previous object in the RufflePlayer\n * slot. We perform some checks to see if this is a Ruffle public API or a\n * conflicting object. If this is conflicting, then a new public API will\n * be constructed (see the constructor information for what happens to\n * `prevRuffle`).\n *\n * Note that Public API upgrades are deliberately not enabled in this\n * version of Ruffle, since there is no Public API to upgrade from.\n * @param sourceName The name of this particular\n * Ruffle source.\n * @param sourceAPI The Ruffle source to add.\n *\n * If both parameters are provided they will be used to define a new Ruffle\n * source to register with the public API.\n * @returns The Ruffle Public API.\n */\n static negotiate(prevRuffle, sourceName, sourceAPI) {\n let publicAPI;\n if (prevRuffle instanceof PublicAPI) {\n publicAPI = prevRuffle;\n }\n else {\n publicAPI = new PublicAPI(prevRuffle);\n }\n if (sourceName !== undefined && sourceAPI !== undefined) {\n publicAPI.registerSource(sourceName, sourceAPI);\n // Install the faux plugin detection immediately.\n // This is necessary because scripts such as SWFObject check for the\n // Flash Player immediately when they load.\n // TODO: Maybe there's a better place for this.\n const polyfills = publicAPI.config.polyfills;\n if (polyfills !== false) {\n sourceAPI.pluginPolyfill();\n }\n }\n return publicAPI;\n }\n}\n","import { PublicAPI, SourceAPI } from \"ruffle-core\";\n\nwindow.RufflePlayer = PublicAPI.negotiate(\n window.RufflePlayer,\n \"local\",\n new SourceAPI(\"local\")\n);\n","import { pluginPolyfill, polyfill } from \"./polyfills\";\nimport { registerElement } from \"./register-element\";\nimport { RufflePlayer } from \"./ruffle-player\";\n/**\n * Represents this particular version of Ruffle.\n *\n * Multiple APIs can be instantiated from different sources; e.g. an \"extension\"\n * version, versus a \"local\" version. This expresses to the Public API\n * negotiator (see [[PublicAPI]]) what this particular version of Ruffle is and\n * how to control it.\n */\nexport class SourceAPI {\n /**\n * Construct a Source API.\n *\n * @param name The name of this particular source.\n */\n constructor(name) {\n this.name = name;\n }\n /**\n * The version of this particular API.\n *\n * This is returned as a string in a semver compatible format.\n *\n * @returns The version of this Ruffle source\n */\n get version() {\n return \"0.1.0\";\n }\n /**\n * Start up the polyfills.\n *\n * Do not run polyfills for more than one Ruffle source at a time.\n *\n * @param isExt Whether or not Ruffle is running as a browser's extension.\n */\n polyfill(isExt) {\n polyfill(isExt);\n }\n /**\n * Polyfill the plugin detection.\n *\n * This needs to run before any plugin detection script does.\n */\n pluginPolyfill() {\n pluginPolyfill();\n }\n /**\n * Create a Ruffle player element using this particular version of Ruffle.\n *\n * @returns The player element. This is a DOM element that may be inserted\n * into the current page as you wish.\n */\n createPlayer() {\n const name = registerElement(\"ruffle-player\", RufflePlayer);\n return document.createElement(name);\n }\n}\n"],"names":["inProgress","dataWebpackPrefix","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","d","definition","key","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","call","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","p","b","baseURI","self","location","href","installedChunks","j","installedChunkData","promise","resolve","reject","error","Error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","bulkMemory","async","WebAssembly","validate","Uint8Array","saturatedFloatToInt","signExtensions","simd","isNativeFunction","func","val","toString","indexOf","currentScriptURL","currentScript","URL","console","warn","publicPath","config","path","endsWith","lastLoaded","loadRuffle","Array","args","Prototype","Version","callback","TypeError","len","k","Window","constructor","Reflect","set","extensionsSupported","every","Boolean","log","default","init","Ruffle","fetchRuffle","RuffleMimeTypeArray","native_mimetype_array","__mimetypes","__named_mimetypes","install","mimetype","item","index","namedItem","iterator","RufflePlugin","description","filename","mimetypes","super","RufflePluginArray","native_plugin_array","__plugins","__named_plugins","plugin","FLASH_PLUGIN","suffixes","enabledPlugin","ruffleShadowTemplate","innerHTML","privateRegistry","registerElement","elementName","elementClass","class","tries","customElements","externalName","define","internalName","FLASH_MIMETYPE","FUTURESPLASH_MIMETYPE","FLASH7_AND_8_MIMETYPE","FLASH_MOVIE_MIMETYPE","RUFFLE_ORIGIN","DIMENSION_REGEX","isAudioContextUnmuted","sanitizeParameters","parameters","URLSearchParams","output","RufflePlayer","HTMLElement","hasContextMenu","contextMenuForceDisabled","isTouch","showSwfDownload","panicked","isExtension","shadow","attachShadow","mode","content","cloneNode","dynamicStyles","getElementById","container","playButton","addEventListener","play","unmuteOverlay","contextMenuElement","showContextMenu","pointerDown","fullScreenChange","hideContextMenu","instance","options","onFSCommand","_readyState","_metadata","lastActivePlayingState","setupPauseOnTabHidden","readyState","metadata","hidden","is_playing","pause","connectedCallback","updateStyles","observedAttributes","attributeChangedCallback","_oldValue","_newValue","disconnectedCallback","destroy","sheet","rules","deleteRule","widthAttr","attributes","getNamedItem","width","htmlDimensionToCssDimension","insertRule","heightAttr","height","isUnusedFallbackObject","parent","element","lookupElement","nodeName","_a","ruffleConstructor","catch","protocol","ruffleIndexError","String","toLowerCase","includes","panic","is_wasm_simd_used","audioState","style","visibility","unmuteAudioContext","autoplay","display","unmuteOverlayClicked","once","audioContext","audio_context","onstatechange","state","_b","optionsError","isConnected","isFallbackElement","assign","allowScriptAccess","contextMenu","backgroundColor","ensureFreshInstance","swfUrl","_c","substring","stream_from","load_data","err","fullscreenEnabled","webkitFullscreenEnabled","isFullscreen","fullscreenElement","webkitFullscreenElement","setFullscreen","isFull","enterFullscreen","exitFullscreen","navigationUI","requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","webkitExitFullscreen","webkitCancelFullScreen","set_fullscreen","pointerType","response","fetch","ok","blob","blobUrl","createObjectURL","swfDownloadA","download","lastIndexOf","body","click","revokeObjectURL","contextMenuItems","CHECKMARK","fromCharCode","items","prepare_context_menu","separatorBefore","text","caption","checked","onClick","run_context_menu_callback","enabled","downloadSwf","extensionString","open","preventDefault","firstChild","lastElementChild","classList","contains","menuSeparator","className","hr","menuItem","textContent","add","left","top","rect","getBoundingClientRect","x","clientX","y","clientY","maxX","clientWidth","maxY","clientHeight","Math","floor","min","clear_custom_menu_items","resume","navigator","maxTouchPoints","audio","Audio","arrayBuffer","ArrayBuffer","dataView","DataView","sampleRate","setUint32","setUint16","btoa","slice","load","then","copyElement","elem","attrib","specified","node","from","children","static","attribute","match","out","onCallbackAvailable","call_exposed_callback","traceObserver","observer","set_trace_observer","errorIndex","errorArray","stackIndex","stack","debugPlayerInfo","userAgent","platform","errorText","join","pageUrl","split","errorBody","errorFooter","issueLink","encodeURIComponent","issueBody","viewDetails","querySelector","onclick","panicBody","displayRootMovieDownloadFailedMessage","origin","div","prepend","displayUnsupportedMessage","displayMessage","setMetadata","dispatchEvent","Event","LOADED_METADATA","LOADED_DATA","setIsExtension","isScriptAccessAllowed","access","isBuiltInContextMenuVisible","menu","isSwfFilename","pathname","extension","parentElement","tagName","RuffleEmbed","_d","_e","_f","_g","_h","_j","_k","_l","_m","_o","base","salign","quality","scale","srcval","attr","createAttribute","setNamedItem","removeNamedItem","oldValue","newValue","flashvars","ruffleObj","findCaseInsensitive","defaultValue","paramsOf","params","param","HTMLParamElement","RuffleObject","movie","isSwf","classid","isInterdictable","embedElem","remove","objectElem","globalConfig","jsScriptUrl","objects","iframes","polyfillFlashInstances","ruffleObject","fromNativeObjectElement","replaceWith","ruffleEmbed","fromNativeEmbedElement","polyfillFrames","elementsList","dataset","rufflePolyfilled","elementWindow","contentWindow","errorMessage","injectRuffle","elementDocument","documentElement","ruffleOptout","major","minor","patch","prIdent","buildIdent","versionString","buildSplit","prSplit","versionSplit","parseInt","isCompatibleWith","other","hasPrecedenceOver","isNumeric","test","isEqual","isStableOrCompatiblePrerelease","VersionRange","requirements","satisfiedBy","fver","matches","comparator","version","requirement","components","exec","trim","fromSemver","PublicAPI","sources","invoked","newestName","conflict","superseded","registerSource","api","newestSourceName","newestVersion","kVersion","polyfills","polyfill","newest","satisfying","ver_requirement","fromRequirementString","valid","localCompatible","local","prevRuffle","sourceName","sourceAPI","publicAPI","pluginPolyfill","negotiate","isExt","MutationObserver","mutationsList","mutation","addedNodes","observe","childList","subtree","plugins","writable","mimeTypes","installPlugin","createPlayer"],"sourceRoot":""}
|