{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./module/index.mjs","webpack:///./module/Elements.mjs","webpack:///./module/Form.mjs","webpack:///./module/Request.mjs","webpack:///./module/Response.mjs","webpack:///./module/util.mjs","webpack:///./module/SoundType.mjs"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","async","_util_mjs__WEBPACK_IMPORTED_MODULE_2__","window","document","body","appendChild","_Elements_mjs__WEBPACK_IMPORTED_MODULE_0__","templateBackgroundImage","content","loadDeferredStylesheetsAndBg","catch","console","error","ponisonusDivBgClickCatch","addEventListener","ponisonusImgBg","style","transform","_Form_mjs__WEBPACK_IMPORTED_MODULE_1__","init","__webpack_exports__","elements","Elements","[object Object]","getElementById","replace","toLowerCase","Proxy","target","getElementByProperty","has","element","HTMLElement","Form","this","soundTypeOptions","_SoundType_mjs__WEBPACK_IMPORTED_MODULE_3__","buttonGetAudio","ButtonGetAudio","divSoundTypes","DivSoundTypes","fieldsetTiming","FieldsetTiming","inputDesiredLengthSeconds","InputDesiredLengthSeconds","inputMaxDelaySeconds","InputMaxDelaySeconds","inputMinDelaySeconds","InputMinDelaySeconds","inputSelectAll","InputSelectAll","outputAudio","OutputAudio","selectOutputFormat","SelectOutputFormat","selectPonies","SelectPonies","onSubmit","onChange","bindChildEvents","addEventListeners","list","_Response_mjs__WEBPACK_IMPORTED_MODULE_2__","checkResponseError","JSON","parse","scriptList","textContent","Array","isArray","response","length","requestProperties","validOutputFormats","_util_mjs__WEBPACK_IMPORTED_MODULE_4__","max","maxDesiredLengthSeconds","maxlength","String","min","minDesiredLengthSeconds","setAttribute","minDelaySeconds","busy","request","_Request_mjs__WEBPACK_IMPORTED_MODULE_1__","requestType","desiredLengthSeconds","Number","maxDelaySeconds","outputFormat","ponies","soundTypes","selected","fetch","process","FormElement","constructor","isBusy","removeAttribute","newValue","args","firstChild","removeChild","TimingFormElement","Math","reduce","inputs","input","checked","push","newChecked","forEach","filter","state","indeterminate","assign","querySelectorAll","checkValue","super","isLoading","loading","createElement","newNode","Node","createTextNode","removeAllChildren","options","createDocumentFragment","pony","set","ponyName","cloneNode","updateInputs","Request","URL","webkitURL","API_URL","stringify","headers","Content-Type","method","Response","Error","responseType","responsePromise","format","output","responseObject","json","audio","outputFile","url","then","blob","audioUrl","createObjectURL","download","numRequests","toString","templateOutputAudio","audioElement","querySelector","srcObject","err","src","Blob","timingLog","type","_util_mjs__WEBPACK_IMPORTED_MODULE_1__","href","datetime","durationSeconds","sizeBytes","generationTimeElapsedSeconds","numberSoundTypesUsed","totalSoundTypesSelected","soundTypePercentageUsed","toFixed","isDocumentLoaded","Promise","resolve","readyState","attributes","parent","text","setAttributes","undefined","loadDeferredStylesheets","containerId","parser","DOMParser","loader","parseFromString","link","head","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","msRequestAnimationFrame","setTimeout","node","privates","WeakMap","template","Option","soundType","templateSoundType","getTemplate","id","label","encodeURI","numberAvailable","Options","Map","Selectors"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,W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M,kBAAAvM,QAEvBe,YAAA4G,EAAA2E,GACA5K,KAAA1B,QAAA0B,KAAA+D,YAAA+G,cAAA5E,WAAA,GACA,MAAA6E,WAAsBH,EAAAvO,KAAAmD,gBACtBkF,EAAA1E,KAAA1B,QAAA0J,cAAA,SACAgD,EAAAhL,KAAA1B,QAAA0J,cAAA,UACAtD,EAAAqG,GAAArG,EAAA3H,QAAAgO,EAAAH,EAAAvO,MACA2O,EAAAjI,aAAA,MAAAgI,GACAC,EAAA/I,eAAyB2I,EAAAvO,SACzBG,OAAA+L,EAAA,cAAA/L,CAAA,KAAsBgM,KAAAxK,OAAAiN,mBAAiChF,KAAY2E,EAAAvO,SAAeqD,OAAA,SAAA4I,KAAA,aAA0C0C,EAAAJ,EAAAM,iBAC5HF,EAAA7M,YAAAH,OAAAC,SAAA0H,eAAA,aAIAwF,gBAAAnN,OAAAoN,IACA/L,IAAAhC,GAAA4I,SAAWA,EAAAvC,eAA0B2B,MAAAW,IAAA3I,EAAA,IAAAgO,UAAApF,EAAAvC,WAGrC2H,UACAhM,YAAA4G,EAAAvC,GACA1D,KAAA1B,QAAAN,OAAAC,SAAA6H,yBACApC,EAAAoB,QAAA8F,GAAA5K,KAAA1B,QAAAH,YAAAwM,OAAAvN,OAAA6I,EAAA2E,GAAAtM","file":"js/index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","\"use strict\";\nimport { elements } from \"./Elements.mjs\";\nimport { Form } from \"./Form.mjs\";\nimport { isDocumentLoaded, loadDeferredStylesheets } from \"./util.mjs\";\n\n(async function onDocumentLoad() {\n\tasync function loadDeferredStylesheetsAndBg() {\n\t\tawait loadDeferredStylesheets();\n\t\twindow.document.body.appendChild(elements.templateBackgroundImage.content);\n\t}\n\n\tloadDeferredStylesheetsAndBg().catch(console.error);\n\tawait isDocumentLoaded;\n\telements.ponisonusDivBgClickCatch.addEventListener(\"click\", () => elements.ponisonusImgBg.style.transform = (elements.ponisonusImgBg.style.transform === \"\") ? \"rotate(110deg)\" : \"\", true);\n\tconst form = new Form();\n\tform.init();\n})().catch(console.error);","class Elements {\n\tstatic getElementByProperty(property) { return window.document.getElementById(property.replace(/([A-Z])/g, (c) => `-${c[0].toLowerCase()}`)); }\n}\n\nexport const elements = new window.Proxy(Elements, {\n\tget: function(target, property) {\n\t\tif (property in target)\n\t\t\treturn target[property];\n\t\treturn target[property] = Elements.getElementByProperty(property);\n\t},\n\thas: function(target, property) {\n\t\tif (property in target)\n\t\t\treturn true;\n\t\tconst element = Elements.getElementByProperty(property);\n\n\t\tif (!(element instanceof window.HTMLElement))\n\t\t\treturn false;\n\t\ttarget[property] = element;\n\t\treturn true;\n\t}\n});","import { elements } from \"./Elements.mjs\";\nimport { Request } from \"./Request.mjs\";\nimport { Response } from \"./Response.mjs\";\nimport * as SoundType from \"./SoundType.mjs\";\nimport { createElement, setAttributes } from \"./util.mjs\";\n\nexport class Form {\n\tconstructor() {\n\t\tthis.soundTypeOptions = new SoundType.Options();\n\t\tthis.buttonGetAudio = new ButtonGetAudio();\n\t\tthis.divSoundTypes = new DivSoundTypes();\n\t\tthis.fieldsetTiming = new FieldsetTiming();\n\t\tthis.inputDesiredLengthSeconds = new InputDesiredLengthSeconds();\n\t\tthis.inputMaxDelaySeconds = new InputMaxDelaySeconds();\n\t\tthis.inputMinDelaySeconds = new InputMinDelaySeconds();\n\t\tthis.inputSelectAll = new InputSelectAll();\n\t\tthis.outputAudio = new OutputAudio();\n\t\tthis.selectOutputFormat = new SelectOutputFormat();\n\t\tthis.selectPonies = new SelectPonies();\n\t}\n\taddEventListeners() {\n\t\tthis.buttonGetAudio.addEventListener(\"click\", this.onSubmit.bind(this), false);\n\t\tthis.divSoundTypes.addEventListener(\"change\", this.divSoundTypes.onChange, false);\n\t\tthis.fieldsetTiming.addEventListener(\"change\", this.fieldsetTiming.onChange, false);\n\t\tthis.inputSelectAll.addEventListener(\"change\", this.inputSelectAll.onChange, false);\n\t\tthis.selectPonies.addEventListener(\"change\", this.selectPonies.onChange, false);\n\t\treturn this;\n\t}\n\tbindChildEvents() {\n\t\tthis.divSoundTypes.onChange = this.divSoundTypes.onChange.bind(this.divSoundTypes, this.inputSelectAll);\n\t\tthis.fieldsetTiming.onChange = this.fieldsetTiming.onChange.bind(this.fieldsetTiming, this.inputDesiredLengthSeconds, this.inputMinDelaySeconds, this.inputMaxDelaySeconds);\n\t\tthis.inputSelectAll.onChange = this.inputSelectAll.onChange.bind(this.inputSelectAll, this.divSoundTypes);\n\t\tthis.selectPonies.onChange = this.selectPonies.onChange.bind(this.selectPonies, this.divSoundTypes, this.inputSelectAll, this.soundTypeOptions);\n\t\treturn this;\n\t}\n\tinit() {\n\t\tthis.bindChildEvents().addEventListeners();\n\t\tconst list = Response.checkResponseError(window.JSON.parse(elements.scriptList.textContent));\n\n\t\tif (!window.Array.isArray(list.response) || list.response.length === 0)\n\t\t\tthrow \"Received an invalid response\";\n\t\tthis.selectPonies.init(list.response, this.soundTypeOptions).onChange();\n\t\tthis.selectOutputFormat.init(list.requestProperties.validOutputFormats);\n\t\tsetAttributes(this.inputDesiredLengthSeconds.element, {\n\t\t\tmax: list.requestProperties.maxDesiredLengthSeconds,\n\t\t\tmaxlength: String(list.requestProperties.maxDesiredLengthSeconds).length,\n\t\t\tmin: list.requestProperties.minDesiredLengthSeconds\n\t\t});\n\t\tthis.inputMinDelaySeconds.element.setAttribute(\"min\", list.requestProperties.minDelaySeconds);\n\t\treturn this;\n\t}\n\tonSubmit() {\n\t\tthis.outputAudio.busy = true;\n\t\tconst request = new Request({\n\t\t\trequestType: \"audio\", \n\t\t\tdesiredLengthSeconds: window.Number(this.inputDesiredLengthSeconds.value),\n\t\t\tmaxDelaySeconds: window.Number(this.inputMaxDelaySeconds.value),\n\t\t\tminDelaySeconds: window.Number(this.inputMinDelaySeconds.value),\n\t\t\toutputFormat: this.selectOutputFormat.value,\n\t\t\tponies: [this.selectPonies.value], \n\t\t\tsoundTypes: this.divSoundTypes.selected\n\t\t});\n\t\tconst response = new Response(request.fetch());\n\t\tresponse.process(this.selectPonies.value, this.selectOutputFormat.value, this.outputAudio).catch(console.error);\n\t}\n}\n\nclass FormElement {\n\tconstructor() { this.element = elements[this.constructor.name.replace(/^([A-Z])/, (c) => c[0].toLowerCase())]; }\n\tget value() { return this.element.value; }\n\tset busy(isBusy) {\n\t\tif (isBusy)\n\t\t\tthis.element.setAttribute(\"aria-busy\", true);\n\t\telse\n\t\t\tthis.element.removeAttribute(\"aria-busy\");\n\t}\n\tset value(newValue) { this.element.value = newValue; }\n\taddEventListener(...args) { return this.element.addEventListener(...args); }\n\tremoveAllChildren() {\n\t\twhile (this.element.firstChild)\n\t\t\tthis.element.removeChild(this.element.firstChild);\n\t\treturn this;\n\t}\n}\n\nclass TimingFormElement extends FormElement {\n\tcheckValue() { this.value = window.Math.min(window.Math.max(Number(this.value), Number(this.min)), Number(this.max)); }\n\tget max() { return this.element.max; }\n\tget min() { return this.element.min; }\n}\n\nclass ButtonGetAudio extends FormElement {}\n\nclass DivSoundTypes extends FormElement {\n\tget selected() {\n\t\treturn Array.prototype.reduce.call(this.inputs, (selected, input) => {\n\t\t\tif (input.checked)\n\t\t\t\tselected.push(input.value);\n\t\t\treturn selected;\n\t\t}, new window.Array());\n\t}\n\tset checked(newChecked) { this.inputs.forEach((input) => input.checked = newChecked); }\n\tonChange(inputSelectAll) {\n\t\tconst selected = Array.prototype.filter.call(this.inputs, (input) => input.checked);\n\t\tlet state;\n\n\t\tif (selected.length === this.inputs.length)\n\t\t\tstate = { checked: true, indeterminate: false };\n\t\telse if (selected.length > 0)\n\t\t\tstate = { checked: false, indeterminate: true };\n\t\telse\n\t\t\tstate = { checked: false, indeterminate: false };\n\t\twindow.Object.assign(inputSelectAll.element, state);\n\t}\n\tupdateInputs() { this.inputs = this.element.querySelectorAll(\"input\"); }\n}\n\nclass FieldsetTiming extends FormElement {\n\tonChange(inputDesiredLengthSeconds, inputMinDelaySeconds, inputMaxDelaySeconds) {\n\t\tinputDesiredLengthSeconds.checkValue();\n\t\tsetAttributes(inputMinDelaySeconds.element, { max: inputDesiredLengthSeconds.value, maxlength: String(inputDesiredLengthSeconds.value).length + 2 });\n\t\tinputMinDelaySeconds.checkValue();\n\t\tsetAttributes(inputMaxDelaySeconds.element, { max: inputDesiredLengthSeconds.value, maxlength: String(inputDesiredLengthSeconds.value).length + 2, min: inputMinDelaySeconds.value });\n\t\tinputMaxDelaySeconds.checkValue();\n\t}\n}\n\nclass InputDesiredLengthSeconds extends TimingFormElement {}\nclass InputMaxDelaySeconds extends TimingFormElement {}\nclass InputMinDelaySeconds extends TimingFormElement {}\n\nclass InputSelectAll extends FormElement {\n\tonChange(divSoundTypes) { divSoundTypes.checked = this.element.checked; }\n}\n\nclass OutputAudio extends FormElement {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.isLoading = false;\n\t}\n\tget loading() { return this.isLoading; }\n\tset loading(isLoading) {\n\t\tif (isLoading && !this.loading)\n\t\t\tthis.value = window.document.createElement(\"progress\");\n\t\tthis.isLoading = isLoading;\n\t}\n\tset value(newNode) {\n\t\tif (!(newNode instanceof window.Node))\n\t\t\tnewNode = window.document.createTextNode(String(newNode));\n\t\tthis.removeAllChildren().element.appendChild(newNode);\n\t}\n}\n\nclass SelectOutputFormat extends FormElement {\n\tinit(validOutputFormats) {\n\t\tthis.busy = true;\n\t\tconst options = window.document.createDocumentFragment();\n\n\t\tfor (const outputFormat in validOutputFormats)\n\t\t\tcreateElement(\"option\", {}, options, outputFormat);\n\t\tthis.element.appendChild(options);\n\t\tthis.busy = false;\n\t\treturn this;\n\t}\n}\n\nclass SelectPonies extends FormElement {\n\tinit(ponies, soundTypeOptions) {\n\t\tthis.busy = true;\n\t\tconst options = window.document.createDocumentFragment();\n\t\tponies.forEach((pony) => {\n\t\t\tcreateElement(\"option\", {}, options, pony.name);\n\t\t\tsoundTypeOptions.set(pony.name, { ponyName: pony.name, soundTypes: pony.soundTypes });\n\t\t});\n\t\tthis.element.appendChild(options);\n\t\tthis.busy = false;\n\t\treturn this;\n\t}\n\tonChange(divSoundTypes, inputSelectAll, soundTypeOptions) {\n\t\tdivSoundTypes.busy = true;\n\t\tdivSoundTypes.removeAllChildren().element.appendChild(soundTypeOptions.get(this.value).content.cloneNode(true));\n\t\tinputSelectAll.element.checked = true;\n\t\tdivSoundTypes.updateInputs();\n\t\tdivSoundTypes.busy = false;\n\t\tdivSoundTypes.element.setAttribute(\"aria-live\", \"polite\");\n\t}\n}","const URL = window.URL || window.webkitURL;\n\nexport class Request extends window.Request {\n\tconstructor(body) {\n\t\tsuper(Request.API_URL, { body: window.JSON.stringify(body), headers: { [\"Content-Type\"]: \"application/json\" }, method: \"POST\" });\n\t\t// Request overwrites methods added in the usual way for some reason, so adding method here instead\n\t\tthis.fetch = () => window.fetch(this);\n\t}\n}\nRequest.API_URL = new URL(\"https://api.ponison.us/index.php\");","import { elements } from \"./Elements.mjs\";\nimport { setAttributes } from \"./util.mjs\";\nconst URL = window.URL || window.webkitURL;\n\nexport class Response {\n\tstatic checkResponseError(response) {\n\t\tif (!response)\n\t\t\tthrow new window.Error(\"Could not parse response or an empty response received\");\n\t\telse if (response.responseType === \"error\")\n\t\t\tthrow new window.Error(response.response);\n\t\treturn response;\n\t}\n\tconstructor(responsePromise) { this.responsePromise = responsePromise; }\n\tasync process(pony, format, output) {\n\t\tconst responseObject = await this.responsePromise;\n\t\tconst response = this.constructor.checkResponseError(await responseObject.json()).response;\n\t\tconst audio = await window.fetch(response.outputFile.url).then((response) => response.blob());\n\t\tconst audioUrl = URL.createObjectURL(audio);\n\t\tconst download = `PoniSonus ${pony}${(this.constructor.numRequests++ < 0) ? \"\" : ` ${this.constructor.numRequests.toString()}`}.${format}`;\n\t\tconst outputAudio = elements.templateOutputAudio.content.cloneNode(true);\n\t\tconst audioElement = outputAudio.querySelector(\"audio\");\n\t\ttry { audioElement.srcObject = audio; }\n\t\tcatch (err) { audioElement.src = audioUrl; }\n\t\toutputAudio.querySelector(\"track\").setAttribute(\"src\", URL.createObjectURL(new window.Blob([response.timingLog], { type: \"text/vtt\" })));\n\t\tsetAttributes(outputAudio.getElementById(\"a-download\"), { download, href: audioUrl }).removeAttribute(\"id\");\n\t\tsetAttributes(outputAudio.getElementById(\"time-duration\"), { datetime: `PT${response.outputFile.durationSeconds}S`, textContent: `${response.outputFile.durationSeconds} seconds` }).removeAttribute(\"id\");\n\t\tsetAttributes(outputAudio.getElementById(\"data-size\"), { textContent: `${response.outputFile.sizeBytes} bytes`, value: response.outputFile.sizeBytes }).removeAttribute(\"id\");\n\t\tsetAttributes(outputAudio.getElementById(\"time-processing\"), { datetime: `PT${response.generationTimeElapsedSeconds}S`, textContent: `${response.generationTimeElapsedSeconds} seconds`}).removeAttribute(\"id\");\n\t\tsetAttributes(outputAudio.getElementById(\"data-used-sound-types\"), { textContent: `${response.numberSoundTypesUsed} sound types`, value: response.numberSoundTypesUsed }).removeAttribute(\"id\");\n\t\tsetAttributes(outputAudio.getElementById(\"data-total-sound-types\"), { textContent: String(response.totalSoundTypesSelected), value: response.totalSoundTypesSelected }).removeAttribute(\"id\");\n\t\tconst soundTypePercentageUsed = response.numberSoundTypesUsed / response.totalSoundTypesSelected;\n\t\tsetAttributes(outputAudio.getElementById(\"data-percent-of-total\"), { textContent: `${Number(soundTypePercentageUsed * 100).toFixed(2)}%`, value: soundTypePercentageUsed }).removeAttribute(\"id\");\n\t\toutputAudio.querySelector(\"code\").textContent = JSON.stringify(response);\n\t\toutput.value = outputAudio;\n\t\toutput.busy = false;\n\t}\n}\nResponse.numRequests = -1;","export const isDocumentLoaded = new window.Promise((resolve) => {\n\tif (window.document.readyState === \"loading\")\n\t\twindow.document.addEventListener(\"DOMContentLoaded\", resolve, false);\n\telse\n\t\tresolve();\n});\n\nexport function createElement(name, attributes = {}, parent = undefined, text = undefined) {\n\tconst element = window.document.createElement(name);\n\tsetAttributes(element, attributes);\n\n\tif (text !== undefined)\n\t\telement.textContent = text;\n\n\tif (parent !== undefined)\n\t\tparent.appendChild(element);\n\treturn element;\n}\n\n// export function detectDynamicImport() {\n// \ttry { new window.Function(\"import(\\\"\\\")\"); }\n// \tcatch (err) { return false; }\n// \treturn true;\n// }\n\nexport async function loadDeferredStylesheets(containerId = \"noscript-deferred-stylesheets\") {\n\tconst parser = new window.DOMParser();\n\tconst loader = () => parser.parseFromString(document.getElementById(containerId).textContent, \"text/html\").querySelectorAll(\"link\").forEach((link) => window.document.head.appendChild(link));\n\tconst requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame;\n\n\tif (requestAnimationFrame)\n\t\trequestAnimationFrame(() => window.setTimeout(loader.call(undefined), 0));\n\telse {\n\t\tawait isDocumentLoaded;\n\t\tloader.call(undefined);\n\t}\n}\n\nexport function removeAllChildren(node) {\n\twhile (node.firstChild)\n\t\tnode.removeChild(node.firstChild);\n\treturn node;\n}\n\nexport function setAttributes(element, attributes = {}) {\n\tfor (const key in attributes)\n\t\tif (key === \"textContent\")\n\t\t\telement.textContent = attributes[key];\n\t\telse\n\t\t\telement.setAttribute(key, attributes[key]);\n\treturn element;\n}","import { elements } from \"./Elements.mjs\";\nimport { createElement } from \"./util.mjs\";\n\nconst privates = {\n\telement: new window.WeakMap(),\n\ttemplate: undefined\n};\n\nclass Option {\n\tstatic create(ponyName, soundType) { return new this(ponyName, soundType); }\n\tstatic getTemplate() { return privates.template ? privates.template : privates.template = elements.templateSoundType.content; }\n\n\tconstructor(ponyName, soundType) {\n\t\tthis.content = this.constructor.getTemplate().cloneNode(true);\n\t\tconst id = `input-${soundType.name.toLowerCase()}`;\n\t\tconst input = this.content.querySelector(\"input\");\n\t\tconst label = this.content.querySelector(\"label\");\n\t\t[input.id, input.value] = [id, soundType.name];\n\t\tlabel.setAttribute(\"for\", id);\n\t\tlabel.textContent = `${soundType.name} (`;\n\t\tcreateElement(\"a\", { href: window.encodeURI(`/pony/${ponyName}/${soundType.name}/`), target: \"_blank\", type: \"text/html\" }, label, soundType.numberAvailable);\n\t\tlabel.appendChild(window.document.createTextNode(\")\"));\n\t}\n}\n\nexport class Options extends window.Map {\n\tset(key, { ponyName, soundTypes }) { super.set(key, new Selectors(ponyName, soundTypes)); }\n}\n\nclass Selectors {\n\tconstructor(ponyName, soundTypes) {\n\t\tthis.content = window.document.createDocumentFragment();\n\t\tsoundTypes.forEach((soundType) => this.content.appendChild(Option.create(ponyName, soundType).content));\n\t}\n}"],"sourceRoot":""}