{ "version": 3, "sources": ["../../../quotes/create.ts"], "sourcesContent": ["// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later\nexport {};\n\n// TODO: use map instead of object\nconst realAuthors: Record = {};\nfor (\n const child\n of (document.getElementById(\"quote-list\") as HTMLDataListElement)\n .children\n) {\n // put the quotes with their authors into an object\n realAuthors[\n (child as unknown as { value: string }).value.toLowerCase()\n ] = ((child as { attributes: NamedNodeMap })\n .attributes\n .getNamedItem(\"data-author\")!)\n .value;\n}\n\nconst quoteInput = document.getElementById(\"quote-input\") as HTMLInputElement;\nconst realAuthorInput = document.getElementById(\n \"real-author-input\",\n) as HTMLInputElement;\nquoteInput.oninput = () => {\n const author = realAuthors[quoteInput.value.toLowerCase()];\n // when real author is found disable input and set the value\n realAuthorInput.disabled = !!author; // !! ≙ check of truthiness\n if (author) {\n realAuthorInput.value = author;\n }\n};\n"], "mappings": "AAAA;AAIA,IAAMA,EAAsC,CAAC,EAC7C,QACUC,KACE,SAAS,eAAe,YAAY,EACnC,SAGTD,EACKC,EAAuC,MAAM,YAAY,CAC9D,EAAMA,EACD,WACA,aAAa,aAAa,EAC1B,MAGT,IAAMC,EAAa,SAAS,eAAe,aAAa,EAClDC,EAAkB,SAAS,eAC7B,mBACJ,EACAD,EAAW,QAAU,IAAM,CACvB,IAAME,EAASJ,EAAYE,EAAW,MAAM,YAAY,CAAC,EAEzDC,EAAgB,SAAW,CAAC,CAACC,EACzBA,IACAD,EAAgB,MAAQC,EAEhC", "names": ["realAuthors", "child", "quoteInput", "realAuthorInput", "author"] }