diff --git a/builds/respec-w3c.js b/builds/respec-w3c.js index 305e7e6a7c..4317b2b36b 100644 --- a/builds/respec-w3c.js +++ b/builds/respec-w3c.js @@ -1,51 +1,9052 @@ "use strict"; -window.respecVersion = "24.35.2"; -"use strict";window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const modules=[Promise.resolve().then((function(){return baseRunner})),Promise.resolve().then((function(){return ui$1})),Promise.resolve().then((function(){return reindent$1})),Promise.resolve().then((function(){return locationHash})),Promise.resolve().then((function(){return l10n$1})),Promise.resolve().then((function(){return defaults})),Promise.resolve().then((function(){return style})),Promise.resolve().then((function(){return style$1})),Promise.resolve().then((function(){return l10n$2})),Promise.resolve().then((function(){return github$1})),Promise.resolve().then((function(){return dataInclude})),Promise.resolve().then((function(){return markdown})),Promise.resolve().then((function(){return headers})),Promise.resolve().then((function(){return abstract})),Promise.resolve().then((function(){return dataTransform})),Promise.resolve().then((function(){return dataAbbr})),Promise.resolve().then((function(){return inlines})),Promise.resolve().then((function(){return conformance})),Promise.resolve().then((function(){return dfn})),Promise.resolve().then((function(){return pluralize$2})),Promise.resolve().then((function(){return examples})),Promise.resolve().then((function(){return issuesNotes})),Promise.resolve().then((function(){return requirements})),Promise.resolve().then((function(){return bestPractices})),Promise.resolve().then((function(){return figures})),Promise.resolve().then((function(){return webidl})),Promise.resolve().then((function(){return dataCite})),Promise.resolve().then((function(){return biblio$1})),Promise.resolve().then((function(){return webidlIndex})),Promise.resolve().then((function(){return linkToDfn})),Promise.resolve().then((function(){return renderBiblio})),Promise.resolve().then((function(){return contrib})),Promise.resolve().then((function(){return fixHeaders})),Promise.resolve().then((function(){return structure$1})),Promise.resolve().then((function(){return informative})),Promise.resolve().then((function(){return idHeaders})),Promise.resolve().then((function(){return caniuse})),Promise.resolve().then((function(){return mdnAnnotation})),Promise.resolve().then((function(){return saveHtml})),Promise.resolve().then((function(){return searchSpecref})),Promise.resolve().then((function(){return searchXref})),Promise.resolve().then((function(){return dfnList})),Promise.resolve().then((function(){return aboutRespec})),Promise.resolve().then((function(){return seo})),Promise.resolve().then((function(){return seo$1})),Promise.resolve().then((function(){return highlight})),Promise.resolve().then((function(){return webidlClipboard})),Promise.resolve().then((function(){return dataTests})),Promise.resolve().then((function(){return listSorter})),Promise.resolve().then((function(){return highlightVars$1})),Promise.resolve().then((function(){return dataType})),Promise.resolve().then((function(){return algorithms})),Promise.resolve().then((function(){return anchorExpander})),Promise.resolve().then((function(){return index})),Promise.resolve().then((function(){return linter$1}))];async function domReady(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(async()=>{const[e,{ui:t},...n]=await Promise.all(modules);try{t.show(),await domReady(),await e.runAll(n)}finally{t.enable()}})().catch(e=>{console.error(e)});const inAmd=!!window.require;if(!inAmd){const e=function(e,t){const n=e.map(e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]});Promise.all(n).then(e=>t(...e))};e.modules={},window.require=e}function expose(e,t){inAmd||(window.require.modules[e]=t)}const name="core/pubsubhub",subscriptions=new Map;function pub(e,...t){if(!subscriptions.has(e))return;if(Array.from(subscriptions.get(e)).forEach(e=>{try{e(...t)}catch(t){pub("error",`Error when calling function ${e.name}. See developer console.`),console.error(t)}}),window.parent===window.self)return;const n=t.map(e=>String(JSON.stringify(e.stack||e)));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function sub(e,t,n={once:!1}){return n.once?sub(e,(function n(...r){unsub({topic:e,cb:n}),t(...r)})):(subscriptions.has(e)?subscriptions.get(e).add(t):subscriptions.set(e,new Set([t])),{topic:e,cb:t})}function unsub({topic:e,cb:t}){const n=subscriptions.get(e);return n&&n.has(t)?n.delete(t):(console.warn("Already unsubscribed:",e,t),!1)}sub("error",e=>{console.error(e,e.stack)}),sub("warn",e=>{console.warn(e)}),expose(name,{sub:sub});const userConfig={},amendConfig=e=>Object.assign(userConfig,e),removeList=["githubToken","githubUser"];function overrideConfig(e){const t=document.location.search.replace(/;/g,"&"),n=new URLSearchParams(t),r=Array.from(n).filter(([e,t])=>!!e&&!!t).map(([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return{key:n,value:o}}).reduce((e,{key:t,value:n})=>(e[t]=n,e),{});Object.assign(e,r),pub("amend-user-config",r)}sub("start-all",amendConfig),sub("amend-user-config",amendConfig),sub("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of removeList)e in userConfig&&delete userConfig[e];e.innerHTML=JSON.stringify(userConfig,null,2),document.head.appendChild(e)}),sub("start-all",overrideConfig,{once:!0});const respecDonePromise=new Promise(e=>{sub("end-all",e,{once:!0})});let doneResolver;Object.defineProperty(document,"respecIsReady",{get:()=>respecDonePromise});const done=new Promise(e=>{doneResolver=e});let doneResolver$1;sub("plugins-done",async e=>{const t=[];if(Array.isArray(e.postProcess)){const n=e.postProcess.filter(e=>{const t="function"==typeof e;return t||pub("error","Every item in `postProcess` must be a JS function."),t}).map(async t=>{try{return await t(e,document)}catch(e){pub("error",`Function ${t.name} threw an error during \`postProcess\`. See developer console.`),console.error(e)}}),r=await Promise.all(n);t.push(...r)}"function"==typeof e.afterEnd&&t.push(await e.afterEnd(e,document)),doneResolver(t)},{once:!0});const done$1=new Promise(e=>{doneResolver$1=e});sub("start-all",async e=>{const t=[];if(Array.isArray(e.preProcess)){const n=e.preProcess.filter(e=>{const t="function"==typeof e;return t||pub("error","Every item in `preProcess` must be a JS function."),t}).map(async t=>{try{return await t(e,document)}catch(e){pub("error",`Function ${t.name} threw an error during \`preProcess\`. See developer console.`),console.error(e)}}),r=await Promise.all(n);t.push(...r)}doneResolver$1(t)},{once:!0});const name$1="core/l10n",html=document.documentElement;html&&!html.hasAttribute("lang")&&(html.lang="en",html.hasAttribute("dir")||(html.dir="ltr"));const base={about_respec:"About",abstract:"Abstract",author:"Author:",authors:"Authors:",bug_tracker:"Bug tracker:",close_parens:")",definition_list:"Definitions",editor:"Editor:",editors_note:"Editor's note",editors:"Editors:",feature_at_risk:"(Feature at Risk) Issue",former_editor:"Former editor:",former_editors:"Former editors:",info_references:"Informative references",issue_summary:"Issue Summary",issue:"Issue",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",list_of_definitions:"List of Definitions",norm_references:"Normative references",note:"Note",open_bugs:"open bugs",open_parens:"(",participate:"Participate",references:"References",save_as:"Save as",save_snapshot:"Export",search_specref:"Search Specref",sotd:"Status of This Document",this_version:"This version:",toc:"Table of Contents",warning:"Warning"},ko={abstract:"요약",author:"저자:",authors:"저자:",latest_published_version:"최신 버전:",sotd:"현재 문서의 상태",this_version:"현재 버전:"},zh={about_respec:"关于",abstract:"摘要",bug_tracker:"错误跟踪:",editor:"编辑:",editors:"编辑:",file_a_bug:"反馈错误",former_editor:"原编辑:",former_editors:"原编辑:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",note:"注",open_bugs:"修正中的错误",participate:"参与:",sotd:"关于本文档",this_version:"本版本:",toc:"内容大纲"},ja={abstract:"要約",author:"著者:",authors:"著者:",bug_tracker:"バグの追跡履歴:",editor:"編者:",editors:"編者:",file_a_bug:"問題報告",former_editor:"以前の版の編者:",former_editors:"以前の版の編者:",latest_editors_draft:"最新の編集用草案:",latest_published_version:"最新バージョン:",note:"注",open_bugs:"改修されていないバグ",participate:"参加方法:",sotd:"この文書の位置付け",this_version:"このバージョン:",toc:"目次"},nl={about_respec:"Over",abstract:"Samenvatting",author:"Auteur:",authors:"Auteurs:",bug_tracker:"Meldingensysteem:",definition_list:"Lijst van Definities",editor:"Redacteur:",editors_note:"Redactionele noot",editors:"Redacteurs:",file_a_bug:"Dien een melding in",info_references:"Informatieve referenties",issue_summary:"Lijst met issues",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",list_of_definitions:"Lijst van Definities",norm_references:"Normatieve referenties",note:"Noot",open_bugs:"open meldingen",participate:"Doe mee",references:"Referenties",save_as:"Bewaar als",save_snapshot:"Bewaar Snapshot",search_specref:"Doorzoek Specref",sotd:"Status van dit document",this_version:"Deze versie:",toc:"Inhoudsopgave",warning:"Waarschuwing"},es={abstract:"Resumen",author:"Autor:",authors:"Autores:",bug_tracker:"Repositorio de bugs:",close_parens:")",editor:"Editor:",editors_note:"Nota de editor",editors:"Editores:",file_a_bug:"Nota un bug",info_references:"Referencias informativas",issue_summary:"Resumen de la cuestión",issue:"Cuestión",latest_editors_draft:"Borrador de editor mas reciente:",latest_published_version:"Versión publicada mas reciente:",norm_references:"Referencias normativas",note:"Nota",open_bugs:"Bugs abiertos",open_parens:"(",participate:"Participad",references:"Referencias",sotd:"Estado de este Document",this_version:"Ésta versión:",toc:"Tabla de Contenidos",warning:"Aviso"},l10n={en:{...base},ko:{...base,...ko},zh:{...base,...zh},ja:{...base,...ja},nl:{...base,...nl},es:{...base,...es}};l10n["zh-hans"]=l10n.zh,l10n["zh-cn"]=l10n.zh;const lang=html&&html.lang in l10n?html.lang:"en";function run(e){e.l10n=l10n[lang]||l10n.en}var l10n$1=Object.freeze({__proto__:null,name:name$1,l10n:l10n,lang:lang,run:run});const dashes=/-/g,ISODate=new Intl.DateTimeFormat(["en-ca-iso8601"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),resourceHints=new Set(["dns-prefetch","preconnect","preload","prerender"]),fetchDestinations=new Set(["document","embed","font","image","manifest","media","object","report","script","serviceworker","sharedworker","style","worker","xslt",""]),nonNormativeSelector=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function createResourceHint(e){if(!e||"object"!=typeof e)throw new TypeError("Missing options");if(!resourceHints.has(e.hint))throw new TypeError("Invalid resources hint");const t=new URL(e.href,location.href),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&"string"==typeof e.as&&(fetchDestinations.has(e.as)||console.warn(`Unknown request destination: ${e.as}`),n.setAttribute("as",e.as))}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function removeReSpec(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach(e=>{e.remove()})}function showInlineWarning(e,t,n){Array.isArray(e)||(e=[e]);const r=e.map((e,r)=>(markAsOffending(e,t,n),generateMarkdownLink(e,r))).join(", ");pub("warn",`${t} at: ${r}.`),console.warn(t,e)}function showInlineError(e,t,n,{details:r}={}){Array.isArray(e)||(e=[e]);const o=e.map((e,r)=>(markAsOffending(e,t,n),generateMarkdownLink(e,r))).join(", ");let i=`${t} at: ${o}.`;r&&(i+=`\n\n
${r}
`),pub("error",i),console.error(t,e)}function markAsOffending(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||addId(e,"respec-offender")}function generateMarkdownLink(e,t){return`[${t+1}](#${e.id})`}class IDBKeyVal{constructor(e,t){this.idb=e,this.storeName=t}async get(e){return await this.idb.transaction(this.storeName).objectStore(this.storeName).get(e)}async getMany(e){const t=new Set(e),n=new Map;let r=await this.idb.transaction(this.storeName).store.openCursor();for(;r;)t.has(r.key)&&n.set(r.key,r.value),r=await r.continue();return n}async set(e,t){const n=this.idb.transaction(this.storeName,"readwrite");return n.objectStore(this.storeName).put(t,e),await n.done}async addMany(e){const t=this.idb.transaction(this.storeName,"readwrite");for(const[n,r]of e)t.objectStore(this.storeName).put(r,n);return await t.done}async clear(){const e=this.idb.transaction(this.storeName,"readwrite");return e.objectStore(this.storeName).clear(),await e.done}async keys(){const e=this.idb.transaction(this.storeName),t=e.objectStore(this.storeName).getAllKeys();return await e.done,t}}function joinAnd(e=[],t=(e=>e),n=lang){const r=e.map(t);if(Intl.ListFormat&&"function"==typeof Intl.ListFormat){return new Intl.ListFormat(n,{style:"long",type:"conjunction"}).format(r)}switch(r.length){case 0:case 1:return r.toString();case 2:return r.join(" and ");default:{const e=r.join(", "),t=e.lastIndexOf(",");return`${e.substr(0,t+1)} and ${e.slice(t+2)}`}}}function xmlEscape(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/`${e}${n}${JSON.stringify(t)}`).join(t)}function linkCSS(e,t){const n=[].concat(t).map(t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n}).reduce((e,t)=>(e.appendChild(t),e),e.createDocumentFragment());e.head.appendChild(n)}function runTransforms(e,t){let n=[this,e];const r=Array.from(arguments);if(r.shift(),r.shift(),n=n.concat(r),t){const r=t.split(/\s+/);for(let t=0;tnew Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const a=await fetch(n);if(!a.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&a.ok){const e=a.clone(),r=new Headers(a.headers),i=new Date(Date.now()+t);r.set("Expires",i.toString());const s=new Response(await e.blob(),{headers:r});await o.put(n,s).catch(console.error)}return a}function flatten(e,t){const n=Array.isArray(t)?t.slice().reduce(flatten,[]):[t];return e.push(...n),e}function addId(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if((o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""))?"example"===t?o=n:!/\.$/.test(o)&&/^[a-z]/i.test(o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)n=`${o}-${t+=1}`;o=n}return e.id=o,o}function getTextNodes(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT),i=[];let a;for(;a=o.nextNode();)i.push(a);return i}function getDfnTitles(e){const t=new Set,n="ltNodefault"in e.dataset?"":norm(e.textContent),r=e.children[0];return e.dataset.lt?e.dataset.lt.split("|").map(e=>norm(e)).forEach(e=>t.add(e)):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),[...t]}function getLinkTargets(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return getDfnTitles(e).reduce((e,t)=>{const r=t.split(".");return 2===r.length&&e.push({for:r[0],title:r[1]}),e.push({for:n,title:t}),""!==n&&e.push({for:"",title:t}),e},[])}function renameElement(e,t){if(e.localName===t)return e;const n=e.ownerDocument.createElement(t);for(const{name:t,value:r}of e.attributes)n.setAttribute(t,r);return n.append(...e.childNodes),e.replaceWith(n),n}function refTypeFromContext(e,t){const n=t.closest(nonNormativeSelector);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function wrapInner(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function parents(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function children(e,t){try{return e.querySelectorAll(`:scope > ${t}`)}catch{let n="";e.id||(n=`temp-${String(Math.random()).substr(2)}`,e.id=n);const r=`#${e.id} > ${t}`,o=e.parentElement.querySelectorAll(r);return n&&(e.id=""),o}}function msgIdGenerator(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}class InsensitiveStringSet extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some(t=>t.toLowerCase()===e.toLowerCase())}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find(t=>t.toLowerCase()===e.toLowerCase())}}function makeSafeCopy(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>renameElement(e,"span")),t.hasAttribute("id")&&t.removeAttribute("id"),removeCommentNodes(t),t}function removeCommentNodes(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...walkTree(t)])e.remove()}function*walkTree(e){for(;e.nextNode();)yield e.currentNode}const name$2="core/base-runner",canMeasure=performance.mark&&performance.measure;function toRunnable(e){const t=e.name||"";return t||console.warn("Plugin lacks name:",e),n=>new Promise(async(r,o)=>{const i=setTimeout(()=>{const n=`Plugin ${t} took too long.`;console.error(n,e),o(new Error(n))},15e3);canMeasure&&performance.mark(`${t}-start`);try{e.run.length<=1?(await e.run(n),r()):(console.warn(`Plugin ${t} uses a deprecated callback signature. Return a Promise instead. Read more at: https://github.com/w3c/respec/wiki/Developers-Guide#plugins`),e.run(n,document,r))}catch(e){o(e)}finally{clearTimeout(i)}canMeasure&&(performance.mark(`${t}-end`),performance.measure(t,`${t}-start`,`${t}-end`))})}async function runAll(e){pub("start-all",respecConfig),canMeasure&&performance.mark(`${name$2}-start`),await done$1;const t=e.filter(e=>e&&e.run).map(toRunnable);for(const e of t)try{await e(respecConfig)}catch(e){console.error(e)}pub("plugins-done",respecConfig),await done,pub("end-all",respecConfig),removeReSpec(document),canMeasure&&(performance.mark(`${name$2}-end`),performance.measure(name$2,`${name$2}-start`,`${name$2}-end`))}var baseRunner=Object.freeze({__proto__:null,name:name$2,runAll:runAll});async function fetchBase(e){const t=await fetch(new URL(`../../${e}`,"undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("respec-w3c.js",document.baseURI).href));return await t.text()}async function fetchAsset(e){return fetchBase(`assets/${e}`)}const instanceOfAny=(e,t)=>t.some(t=>e instanceof t);let idbProxyableTypes,cursorAdvanceMethods;function getIdbProxyableTypes(){return idbProxyableTypes||(idbProxyableTypes=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function getCursorAdvanceMethods(){return cursorAdvanceMethods||(cursorAdvanceMethods=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const cursorRequestMap=new WeakMap,transactionDoneMap=new WeakMap,transactionStoreNamesMap=new WeakMap,transformCache=new WeakMap,reverseTransformCache=new WeakMap;function promisifyRequest(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(wrap(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&cursorRequestMap.set(t,e)}).catch(()=>{}),reverseTransformCache.set(t,e),t}function cacheDonePromiseForTransaction(e){if(transactionDoneMap.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});transactionDoneMap.set(e,t)}let idbProxyTraps={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return transactionDoneMap.get(e);if("objectStoreNames"===t)return e.objectStoreNames||transactionStoreNamesMap.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return wrap(e[t])},has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function addTraps(e){idbProxyTraps=e(idbProxyTraps)}function wrapFunction(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?getCursorAdvanceMethods().includes(e)?function(...t){return e.apply(unwrap(this),t),wrap(cursorRequestMap.get(this))}:function(...t){return wrap(e.apply(unwrap(this),t))}:function(t,...n){const r=e.call(unwrap(this),t,...n);return transactionStoreNamesMap.set(r,t.sort?t.sort():[t]),wrap(r)}}function transformCachableValue(e){return"function"==typeof e?wrapFunction(e):(e instanceof IDBTransaction&&cacheDonePromiseForTransaction(e),instanceOfAny(e,getIdbProxyableTypes())?new Proxy(e,idbProxyTraps):e)}function wrap(e){if(e instanceof IDBRequest)return promisifyRequest(e);if(transformCache.has(e))return transformCache.get(e);const t=transformCachableValue(e);return t!==e&&(transformCache.set(e,t),reverseTransformCache.set(t,e)),t}const unwrap=e=>reverseTransformCache.get(e);function openDB(e,t,{blocked:n,upgrade:r,blocking:o}={}){const i=indexedDB.open(e,t),a=wrap(i);return r&&i.addEventListener("upgradeneeded",e=>{r(wrap(i.result),e.oldVersion,e.newVersion,wrap(i.transaction))}),n&&i.addEventListener("blocked",()=>n()),o&&a.then(e=>e.addEventListener("versionchange",o)).catch(()=>{}),a}function deleteDB(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),wrap(n).then(()=>void 0)}const readMethods=["get","getKey","getAll","getAllKeys","count"],writeMethods=["put","add","delete","clear"],cachedMethods=new Map;function getMethod(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(cachedMethods.get(t))return cachedMethods.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=writeMethods.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!readMethods.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let a=i.store;r&&(a=a.index(t.shift()));const s=a[n](...t);return o&&await i.done,s};return cachedMethods.set(t,i),i}addTraps(e=>({get:(t,n,r)=>getMethod(t,n)||e.get(t,n,r),has:(t,n)=>!!getMethod(t,n)||e.has(t,n)}));var _idb=Object.freeze({__proto__:null,openDB:openDB,deleteDB:deleteDB,unwrap:unwrap,wrap:wrap});function lastLine(e){const t=e.split("\n");return t[t.length-1]}function error(e,t,n,r,o,{level:i="error",autofix:a,ruleName:s}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const o=n.map(e=>e.trivia+e.value).join(""),i=e[t];return"eof"===i.type?o:r?o+i.trivia:o.slice(i.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=lastLine(l(c(-5),{precedes:!0})),p=c(5),h=l(p),f=d+h.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===o?"since":"inside",g=`${o} error at line ${u}${e.name?` in ${e.name}`:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${n.type} ${n.name}\``:""}:\n${f}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:i,ruleName:s,autofix:a,input:h,tokens:p}}function syntaxError(e,t,n,r){return error(e,t,n,r,"Syntax")}function validationError(e,t,n,r,o={}){return o.ruleName=n,error(t.source,e.index,t,r,"Validation",o)}class Base{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function idlTypeIncludesDictionary(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const o=idlTypeIncludesDictionary(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,o),o)return{reference:e,dictionary:o.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=idlTypeIncludesDictionary(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function dictionaryIncludesRequiredField(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);if(t.cache.dictionaryIncludesRequiredField.set(e,void 0),e.inheritance){const n=t.unique.get(e.inheritance);if(!n)return!0;if(dictionaryIncludesRequiredField(n,t))return!0}const n=e.members.some(e=>e.required);return t.cache.dictionaryIncludesRequiredField.set(e,n),n}function generic_type(e,t){const n=e.consume("FrozenArray","Promise","sequence","record");if(!n)return;const r=autoParenter(new Type({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error(`No opening bracket after ${n.type}`),n.type){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=return_type(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":{const o=type_with_extended_attributes(e,t)||e.error(`Missing ${n.type} subtype`);r.subtype.push(o);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...stringTypes)||e.error(`Record key must be one of: ${stringTypes.join(", ")}`),o=new Type({source:e.source,tokens:{base:n}});o.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),o.type=t;const i=type_with_extended_attributes(e,t)||e.error("Error parsing generic type record");r.subtype.push(o,i);break}}return r.idlType||e.error(`Error parsing generic type ${n.type}`),r.tokens.close=e.consume(">")||e.error(`Missing closing bracket after ${n.type}`),r.this}function type_suffix(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function single_type(e,t){let n=generic_type(e,t)||primitive_type(e);if(!n){const t=e.consume("identifier",...stringTypes,...typeNameKeywords);if(!t)return;n=new Type({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error(`Unsupported generic type ${t.value}`)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,type_suffix(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}function union_type(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=autoParenter(new Type({source:e.source,tokens:n}));for(r.type=t||null;;){const t=type_with_extended_attributes(e)||e.error("No type after open parenthesis or 'or' in union type");"any"===t.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===t.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(t);const n=e.consume("or");if(!n)break;t.tokens.separator=n}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),type_suffix(e,r),r.this}class Type extends Base{static parse(e,t){return single_type(e,t)||union_type(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=[]}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return unescape([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter(e=>e).map(e=>e.value).join(" "))}*validate(e){const t=!this.union&&e.unique.get(this.idlType),n=this.union?this:t&&"typedef"===t.type?t.idlType:void 0;if(n&&this.nullable){const{reference:t}=idlTypeIncludesDictionary(n,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type";yield validationError(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}}class Default extends Base{static parse(e){const t=e.consume("=");if(!t)return null;const n=const_value(e)||e.consume("string","null","[","{")||e.error("No value for default"),r=[n];if("["===n.type){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.type){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new Default({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return const_data(this.expression[0]).type}get value(){return const_data(this.expression[0]).value}get negative(){return const_data(this.expression[0]).negative}}class ArrayBase extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class Token extends Base{static parser(e,t){return()=>{const n=e.consume(t);if(n)return new Token({source:e.source,tokens:{value:n}})}}get value(){return unescape(this.tokens.value.value)}}function tokens(e,t){return list(e,{parser:Token.parser(e,t),listName:t+" list"})}function identifiersOrStrings(e){let t=tokens(e,"identifier");return t.length?t:(t=tokens(e,"string")).length?t:void e.error("Expected identifiers or strings but none found")}class ExtendedAttributeParameters extends Base{static parse(e){const t={assign:e.consume("=")},n=autoParenter(new ExtendedAttributeParameters({source:e.source,tokens:t}));return t.assign&&(t.secondaryName=e.consume("identifier","decimal","integer","string")),t.open=e.consume("("),t.open?(n.list=n.rhsIsList?identifiersOrStrings(e):argument_list(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):n.hasRhs&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.secondaryName?this.tokens.secondaryName.type:null}}class SimpleExtendedAttribute extends Base{static parse(e){const t=e.consume("identifier");if(t)return new SimpleExtendedAttribute({source:e.source,tokens:{name:t},params:ExtendedAttributeParameters.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;return e?{type:e,value:this.params.rhsIsList?n:unescape(t.secondaryName.value)}:null}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){if("NoInterfaceObject"===this.name){const e="`[NoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/heycam/webidl/pull/609) for more information.";yield validationError(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}for(const t of this.arguments)yield*t.validate(e)}}class ExtendedAttributes extends ArrayBase{static parse(e){const t={};if(t.open=e.consume("["),!t.open)return new ExtendedAttributes({});const n=new ExtendedAttributes({source:e.source,tokens:t});return n.push(...list(e,{parser:SimpleExtendedAttribute.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Unexpected closing token of extended attribute"),n.length||e.error("Found an empty extended attribute"),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n}*validate(e){for(const t of this)yield*t.validate(e)}}class Argument extends Base{static parse(e){const t=e.position,n={},r=autoParenter(new Argument({source:e.source,tokens:n}));return r.extAttrs=ExtendedAttributes.parse(e),n.optional=e.consume("optional"),r.idlType=type_with_extended_attributes(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consume("identifier",...argumentNameKeywords),n.name?(r.default=n.optional?Default.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return unescape(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e);const t=idlTypeIncludesDictionary(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield validationError(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield validationError(this.tokens.name,this,"dict-arg-default",e,{autofix:autofixOptionalDictionaryDefaultValue(this)})}}else if(this.parent&&!dictionaryIncludesRequiredField(t.dictionary,e)&&isLastRequiredArgument(this)){const e="Dictionary argument must be optional if it has no required fields";yield validationError(this.tokens.name,this,"dict-arg-optional",e,{autofix:autofixDictionaryArgumentOptionality(this)})}}}function isLastRequiredArgument(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e);return!t.slice(n+1).some(e=>!e.optional)}function autofixDictionaryArgumentOptionality(e){return()=>{const t=getFirstToken(e.idlType);e.tokens.optional={type:"optional",value:"optional",trivia:t.trivia},t.trivia=" ",autofixOptionalDictionaryDefaultValue(e)()}}function autofixOptionalDictionaryDefaultValue(e){return()=>{e.default=Default.parse(new Tokeniser(" = {}"))}}class Operation extends Base{static parse(e,{special:t,regular:n}={}){const r={special:t},o=autoParenter(new Operation({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(o.arguments=[],o):(t||n||(r.special=e.consume("getter","setter","deleter")),o.idlType=return_type(e)||e.error("Missing return type"),r.name=e.consume("identifier","includes"),r.open=e.consume("(")||e.error("Invalid operation"),o.arguments=argument_list(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),o.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?unescape(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield validationError(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}}class Attribute extends Base{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const o=e.position,i={special:t},a=autoParenter(new Attribute({source:e.source,tokens:i}));if(t||n||(i.special=e.consume("inherit")),"inherit"===a.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),i.readonly=e.consume("readonly"),r&&!i.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),i.base=e.consume("attribute"),i.base){switch(a.idlType=type_with_extended_attributes(e,"attribute-type")||e.error("Attribute lacks a type"),a.idlType.generic){case"sequence":case"record":e.error(`Attributes cannot accept ${a.idlType.generic} types`)}return i.name=e.consume("identifier","async","required")||e.error("Attribute lacks a name"),i.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),a.this}e.unconsume(o)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return unescape(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}}function unescape(e){return e.startsWith("_")?e.slice(1):e}function list(e,{parser:t,allowDangler:n,listName:r="list"}){const o=t(e);if(!o)return[];o.tokens.separator=e.consume(",");const i=[o];for(;o.tokens.separator;){const o=t(e);if(!o){n||e.error(`Trailing comma in ${r}`);break}if(o.tokens.separator=e.consume(","),i.push(o),!o.tokens.separator)break}return i}function const_value(e){return e.consume("true","false","Infinity","-Infinity","NaN","decimal","integer")}function const_data({type:e,value:t}){switch(e){case"true":case"false":return{type:"boolean",value:"true"===e};case"Infinity":case"-Infinity":return{type:"Infinity",negative:e.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)};default:return{type:e}}}function primitive_type(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const o=e.consume("long");return new Type({source:t,tokens:{prefix:n,base:r,postfix:o}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new Type({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("boolean","byte","octet");return r?new Type({source:t,tokens:{base:r}}):void 0}function argument_list(e){return list(e,{parser:Argument.parse,listName:"arguments list"})}function type_with_extended_attributes(e,t){const n=ExtendedAttributes.parse(e),r=Type.parse(e,t);return r&&(autoParenter(r).extAttrs=n),r}function return_type(e,t){const n=Type.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new Type({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function stringifier(e){const t=e.consume("stringifier");if(t)return Attribute.parse(e,{special:t})||Operation.parse(e,{special:t})||e.error("Unterminated stringifier")}function getLastIndentation(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function getMemberIndentation(e){const t=getLastIndentation(e),n=t.includes("\t")?"\t":" ";return t+n}function autofixAddExposedWindow(e){return()=>{if(e.extAttrs.length){const t=new Tokeniser("Exposed=Window,"),n=SimpleExtendedAttribute.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=` ${r.tokens.name.trivia}`),e.extAttrs.unshift(n)}else{autoParenter(e).extAttrs=ExtendedAttributes.parse(new Tokeniser("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${getLastIndentation(t)}`}}}function getFirstToken(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return getFirstToken(e.idlType);return Object.values(e.tokens).sort((e,t)=>e.index-t.index)[0]}function findLastIndex(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}function autoParenter(e,t){return t||(t=e),e?new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)?autoParenter(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}}):e}const tokenRe={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/((\/(\/.*|\*([^*]|\*[^/])*\*\/)[\t\n\r ]*)+)/y,other:/[^\t\n\r 0-9A-Za-z]/y},typeNameKeywords=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","Float32Array","Float64Array","any","object","symbol"],stringTypes=["ByteString","DOMString","USVString"],argumentNameKeywords=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],nonRegexTerminals=["-Infinity","FrozenArray","Infinity","NaN","Promise","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","unsigned","void"].concat(argumentNameKeywords,stringTypes,typeNameKeywords),punctuations=["(",")",",","...",":",";","<","=",">","?","[","]","{","}"],reserved=["_constructor","toString","_toString"];function tokenise(e){const t=[];let n=0,r="",o=1,i=0;for(;nthis.position&&this.source[this.position].type===e}consume(...e){for(const t of e){if(!this.probe(t))continue;const e=this.source[this.position];return this.position++,e}}unconsume(e){this.position=e}}class WebIDLParseError extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:o,input:i,tokens:a}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=o,this.input=i,this.tokens=a}}class EnumValue extends Token{static parse(e){const t=e.consume("string");if(t)return new EnumValue({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}}class Enum extends Base{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consume("identifier")||e.error("No name for enum");const n=autoParenter(new Enum({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=list(e,{parser:EnumValue.parse,allowDangler:!0,listName:"enumeration"}),e.probe("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return unescape(this.tokens.name.value)}}class Includes extends Base{static parse(e){const t=e.consume("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consume("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new Includes({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return unescape(this.tokens.target.value)}get includes(){return unescape(this.tokens.mixin.value)}}class Typedef extends Base{static parse(e){const t={},n=autoParenter(new Typedef({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=type_with_extended_attributes(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consume("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return unescape(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}}class CallbackFunction extends Base{static parse(e,t){const n={base:t},r=autoParenter(new CallbackFunction({source:e.source,tokens:n}));return n.name=e.consume("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=return_type(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=argument_list(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return unescape(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}}function inheritance(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consume("identifier")||e.error("Inheritance lacks a type")}:{}}class Container extends Base{static parse(e,t,{type:n,inheritable:r,allowedMembers:o}){const{tokens:i}=t;for(i.name=e.consume("identifier")||e.error(`Missing name in ${t.type}`),e.current=t,t=autoParenter(t),r&&Object.assign(i,inheritance(e)),i.open=e.consume("{")||e.error(`Bodyless ${n}`),t.members=[];;){if(i.close=e.consume("}"),i.close)return i.termination=e.consume(";")||e.error(`Missing semicolon after ${n}`),t.this;const r=ExtendedAttributes.parse(e);let a;for(const[t,...n]of o)if(a=autoParenter(t(e,...n)))break;a||e.error("Unknown member"),a.extAttrs=r,t.members.push(a.this)}}get partial(){return!!this.tokens.partial}get name(){return unescape(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?unescape(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}}class Constant extends Base{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=primitive_type(e);if(!n){const t=e.consume("identifier")||e.error("Const lacks a type");n=new Type({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consume("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=const_value(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Constant({source:e.source,tokens:t});return autoParenter(r).idlType=n,r}get type(){return"const"}get name(){return unescape(this.tokens.name.value)}get value(){return const_data(this.tokens.value)}}class IterableLike extends Base{static parse(e){const t=e.position,n={},r=autoParenter(new IterableLike({source:e.source,tokens:n}));if(n.readonly=e.consume("readonly"),n.readonly||(n.async=e.consume("async")),n.base=n.readonly?e.consume("maplike","setlike"):n.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!n.base)return void e.unconsume(t);const{type:o}=r,i="maplike"===o||r.async,a=i||"iterable"===o;n.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${o} declaration`);const s=type_with_extended_attributes(e)||e.error(`Missing a type argument in ${o} declaration`);return r.idlType=[s],a&&(s.tokens.separator=e.consume(","),s.tokens.separator?r.idlType.push(type_with_extended_attributes(e)):i&&e.error(`Missing second type argument in ${o} declaration`)),n.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${o} declaration`),n.termination=e.consume(";")||e.error(`Missing semicolon after ${o} declaration`),r.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}}function*checkInterfaceMemberDuplication(e,t){const n=new Set(a(t).map(e=>e.name)),r=e.partials.get(t.name)||[],o=e.mixinMap.get(t.name)||[];for(const e of[...r,...o]){const r=a(e);yield*i(r,n,e,t);for(const e of r)n.add(e.name)}function*i(e,t,n,r){for(const o of e){const{name:e}=o;if(e&&t.has(e)){const t=`The operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield validationError(o.tokens.name,n,"no-cross-overload",t)}}}function a(e){return e.members.filter(({type:e})=>"operation"===e)}}class Constructor extends Base{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=argument_list(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const o=new Constructor({source:e.source,tokens:n});return autoParenter(o).arguments=r,o}get type(){return"constructor"}*validate(e){this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}}function static_member(e){const t=e.consume("static");if(t)return Attribute.parse(e,{special:t})||Operation.parse(e,{special:t})||e.error("No body in static member")}class Interface extends Container{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return Container.parse(e,new Interface({source:e.source,tokens:r}),{type:"interface",inheritable:!n,allowedMembers:[[Constant.parse],[Constructor.parse],[static_member],[stringifier],[IterableLike.parse],[Attribute.parse],[Operation.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)&&this.extAttrs.every(e=>"NoInterfaceObject"!==e.name)){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield validationError(this.tokens.name,this,"require-exposed",e,{autofix:autofixAddExposedWindow(this)})}const t=this.extAttrs.filter(e=>"Constructor"===e.name);for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield validationError(e.tokens.name,this,"constructor-member",t,{autofix:autofixConstructor(this,e)})}if(this.extAttrs.some(e=>"Global"===e.name)){const e=this.extAttrs.filter(e=>"NamedConstructor"===e.name);for(const t of e){const e="Interfaces marked as `[Global]` cannot have named constructors.";yield validationError(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter(e=>"constructor"===e.type);for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield validationError(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*checkInterfaceMemberDuplication(e,this))}}function autofixConstructor(e,t){return e=autoParenter(e),()=>{const n=getLastIndentation(e.extAttrs.tokens.open.trivia),r=e.members.length?getLastIndentation(getFirstToken(e.members[0]).trivia):getMemberIndentation(n),o=Constructor.parse(new Tokeniser(`\n${r}constructor();`));o.extAttrs=[],autoParenter(o).arguments=t.arguments;const i=findLastIndex(e.members,e=>"constructor"===e.type);e.members.splice(i+1,0,o);const{close:a}=e.tokens;a.trivia.includes("\n")||(a.trivia+=`\n${n}`);const{extAttrs:s}=e,c=s.indexOf(t),l=s.splice(c,1);s.length?s.length===c?s[c-1].tokens.separator=void 0:s[c].tokens.name.trivia.trim()||(s[c].tokens.name.trivia=l[0].tokens.name.trivia):s.tokens.open=s.tokens.close=void 0}}class Mixin extends Container{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return Container.parse(e,new Mixin({source:e.source,tokens:r}),{type:"interface mixin",allowedMembers:[[Constant.parse],[stringifier],[Attribute.parse,{noInherit:!0}],[Operation.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Field extends Base{static parse(e){const t={},n=autoParenter(new Field({source:e.source,tokens:t}));return n.extAttrs=ExtendedAttributes.parse(e),t.required=e.consume("required"),n.idlType=type_with_extended_attributes(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consume("identifier")||e.error("Dictionary member lacks a name"),n.default=Default.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return unescape(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}}class Dictionary extends Container{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return Container.parse(e,new Dictionary({source:e.source,tokens:n}),{type:"dictionary",inheritable:!t,allowedMembers:[[Field.parse]]})}get type(){return"dictionary"}}class Namespace extends Container{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return Container.parse(e,new Namespace({source:e.source,tokens:n}),{type:"namespace",allowedMembers:[[Attribute.parse,{noInherit:!0,readonly:!0}],[Operation.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield validationError(this.tokens.name,this,"require-exposed",e,{autofix:autofixAddExposedWindow(this)})}yield*super.validate(e)}}class CallbackInterface extends Container{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return Container.parse(e,new CallbackInterface({source:e.source,tokens:r}),{type:"callback interface",inheritable:!n,allowedMembers:[[Constant.parse],[Operation.parse,{regular:!0}]]})}get type(){return"callback interface"}}function parseByTokens(e,t){const n=e.source;function r(t){e.error(t)}function o(...t){return e.consume(...t)}function i(t){const n=o("interface");if(n)return Mixin.parse(e,n,t)||Interface.parse(e,n,t)||r("Interface has no proper body")}function a(){return function(){const t=o("callback");if(t)return e.probe("interface")?CallbackInterface.parse(e,t):CallbackFunction.parse(e,t)}()||i()||function(){const t=o("partial");if(t)return Dictionary.parse(e,{partial:t})||i({partial:t})||Namespace.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Dictionary.parse(e)||Enum.parse(e)||Typedef.parse(e)||Includes.parse(e)||Namespace.parse(e)}const s=function(){if(!n.length)return[];const i=[];for(;;){const t=ExtendedAttributes.parse(e),n=a();if(!n){t.length&&r("Stray extended attributes");break}autoParenter(n).extAttrs=t,i.push(n)}const s=o("eof");return t.concrete&&i.push(s),i}();return e.positione.join(""),trivia:noop,name:noop,reference:noop,type:noop,generic:noop,nameless:noop,inheritance:noop,definition:noop,extendedAttribute:noop,extendedAttributeReference:noop};function write(e,{templates:t=templates}={}){function n(e,{unescaped:n,context:r}){return n||(n=e.startsWith("_")?e.slice(1):e),t.reference(e,n,r)}function r(e,n=noop,...r){if(!e)return"";const o=n(e.value,...r);return t.wrap([t.trivia(e.trivia),o])}function o(e,t){return r(e,n,{context:t})}function i(e,n){return r(e,t.name,n)}function a(e){if(e.union||e.generic)return t.wrap([r(e.tokens.base,t.generic),r(e.tokens.open),...e.subtype.map(s),r(e.tokens.close)]);const o=e.tokens.prefix||e.tokens.base,i=e.tokens.prefix?[e.tokens.prefix.value,t.trivia(e.tokens.base.trivia)]:[],a=n(t.wrap([...i,e.tokens.base.value,r(e.tokens.postfix)]),{unescaped:e.idlType,context:e});return t.wrap([t.trivia(o.trivia),a])}function s(e){return t.wrap([p(e.extAttrs),a(e),r(e.tokens.nullable),r(e.tokens.separator)])}function c(e){return e?t.wrap([r(e.tokens.assign),...e.expression.map(e=>r(e))]):""}function l(e){return t.wrap([p(e.extAttrs),r(e.tokens.optional),t.type(s(e.idlType)),r(e.tokens.variadic),i(e.tokens.name,{data:e}),c(e.default),r(e.tokens.separator)])}function u(e){return t.wrap([r(e.tokens.value),r(e.tokens.separator)])}function d(e){const{rhsType:n}=e.params;return t.wrap([t.trivia(e.tokens.name.trivia),t.extendedAttribute(t.wrap([t.extendedAttributeReference(e.name),r(e.params.tokens.assign),o(e.params.tokens.secondaryName,e),r(e.params.tokens.open),...e.params.list?e.params.list.map("identifier-list"===n?n=>(function(e,n){return t.wrap([o(e.tokens.value,n),r(e.tokens.separator)])})(n,e):"string-list"===n?u:l):[],r(e.params.tokens.close)])),r(e.tokens.separator)])}function p(e){return e.length?t.wrap([r(e.tokens.open),...e.map(d),r(e.tokens.close)]):""}function h(e){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.callback),r(e.tokens.partial),r(e.tokens.base),r(e.tokens.mixin),i(e.tokens.name,{data:e}),(o=e,o.tokens.inheritance?t.wrap([r(o.tokens.colon),t.trivia(o.tokens.inheritance.trivia),t.inheritance(n(o.tokens.inheritance.value,{context:o}))]):""),r(e.tokens.open),g(e.members,e),r(e.tokens.close),r(e.tokens.termination)]),{data:e});var o}function f(e,n){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.readonly),r(e.tokens.async),r(e.tokens.base,t.generic),r(e.tokens.open),t.wrap(e.idlType.map(s)),r(e.tokens.close),r(e.tokens.termination)]),{data:e,parent:n})}t=Object.assign({},templates,t);const m={interface:h,"interface mixin":h,namespace:h,operation:function(e,n){const o=e.idlType?[t.type(s(e.idlType)),i(e.tokens.name,{data:e,parent:n}),r(e.tokens.open),t.wrap(e.arguments.map(l)),r(e.tokens.close)]:[];return t.definition(t.wrap([p(e.extAttrs),e.tokens.name?r(e.tokens.special):r(e.tokens.special,t.nameless,{data:e,parent:n}),...o,r(e.tokens.termination)]),{data:e,parent:n})},attribute:function(e,n){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.special),r(e.tokens.readonly),r(e.tokens.base),t.type(s(e.idlType)),i(e.tokens.name,{data:e,parent:n}),r(e.tokens.termination)]),{data:e,parent:n})},constructor:function(e,n){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.base,t.nameless,{data:e,parent:n}),r(e.tokens.open),t.wrap(e.arguments.map(l)),r(e.tokens.close),r(e.tokens.termination)]),{data:e,parent:n})},dictionary:h,field:function(e,n){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.required),t.type(s(e.idlType)),i(e.tokens.name,{data:e,parent:n}),c(e.default),r(e.tokens.termination)]),{data:e,parent:n})},const:function(e,n){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.base),t.type(s(e.idlType)),i(e.tokens.name,{data:e,parent:n}),r(e.tokens.assign),r(e.tokens.value),r(e.tokens.termination)]),{data:e,parent:n})},typedef:function(e){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.base),t.type(s(e.idlType)),i(e.tokens.name,{data:e}),r(e.tokens.termination)]),{data:e})},includes:function(e){return t.definition(t.wrap([p(e.extAttrs),o(e.tokens.target,e),r(e.tokens.includes),o(e.tokens.mixin,e),r(e.tokens.termination)]),{data:e})},callback:function(e){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.base),i(e.tokens.name,{data:e}),r(e.tokens.assign),t.type(s(e.idlType)),r(e.tokens.open),...e.arguments.map(l),r(e.tokens.close),r(e.tokens.termination)]),{data:e})},enum:function(e){return t.definition(t.wrap([p(e.extAttrs),r(e.tokens.base),i(e.tokens.name,{data:e}),r(e.tokens.open),g(e.values,e),r(e.tokens.close),r(e.tokens.termination)]),{data:e})},"enum-value":function(e,n){return t.wrap([t.trivia(e.tokens.value.trivia),t.definition(t.wrap(['"',t.name(e.value,{data:e,parent:n}),'"']),{data:e,parent:n}),r(e.tokens.separator)])},iterable:f,maplike:f,setlike:f,"callback interface":h,eof:function(e){return t.trivia(e.trivia)}};function g(e,n){if(!e)return;const r=e.map(e=>(function(e,t){if(!m[e.type])throw new Error(`Type "${e.type}" is unsupported`);return m[e.type](e,t)})(e,n));return t.wrap(r)}return g(e)}function getMixinMap(e,t){const n=new Map,r=e.filter(e=>"includes"===e.type);for(const e of r){const r=t.get(e.includes);if(!r)continue;const o=n.get(e.target);o?o.push(r):n.set(e.target,[r])}return n}function groupDefinitions(e){const t=new Map,n=new Set,r=new Map;for(const o of e)if(o.partial){const e=r.get(o.name);e?e.push(o):r.set(o.name,[o])}else o.name&&(t.has(o.name)?n.add(o):t.set(o.name,o));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:getMixinMap(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}function*checkDuplicatedNames({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield validationError(n.tokens.name,n,"no-duplicate",r)}}function*validateIterable(e){const t=groupDefinitions(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*checkDuplicatedNames(t)}function flatten$1(e){return e.flat?e.flat():[].concat(...e)}function validate(e){return[...validateIterable(flatten$1(e))]}var _webidl2=Object.freeze({__proto__:null,parse:parse,write:write,validate:validate,WebIDLParseError:WebIDLParseError}),hyperHTML=function(e){/*! (c) Andrea Giammarchi - ISC */var t={};try{t.WeakMap=WeakMap}catch(o){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=i.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(a,this)}function a(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={}; -/*! (c) Andrea Giammarchi - ISC */try{r.WeakSet=WeakSet}catch(o){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}var o=r.WeakSet,i={}; -/*! (c) Andrea Giammarchi - ISC */try{i.Map=Map}catch(o){i.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var i=r(o);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:function(e){return r(e)},set:function(o,i){return n[r(o)?e:t.push(o)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}function a(e,t,n,r,o,i){for(var a=("selectedIndex"in t),s=a;r>>0;na;)--c;l=s+r-c;var w=Array(l),$=u[c];for(--n;$;){for(var v=$,k=v.newi,x=v.oldi;k"+e+"",r=n.querySelectorAll(o)}else n.innerHTML=e,r=n.childNodes;return O(t,r),t},function(e,t){return("svg"===t?function(e){var t=H(C),n=H("div");return n.innerHTML=''+e+"",O(t,n.firstChild.childNodes),t}:_)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===C?L.createDocumentFragment():L.createElementNS("http://www.w3.org/1999/xhtml",e)} -/*! (c) Andrea Giammarchi - ISC */var j,W,U,F,z,B,q,G,V,Z=(W="appendChild",U="cloneNode",F="createTextNode",B=(z="importNode")in(j=e),(q=j.createDocumentFragment())[W](j[F]("g")),q[W](j[F]("")),(B?j[z](q,!0):q[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),o=t.childNodes||[],i=o.length,a=0;n&&a

',G.content.childNodes[0].getAttribute(V)==Y)||(Y="_dt: "+Y.slice(1,-1)+";",J=!0)}catch(o){}var X="\x3c!--"+Y+"--\x3e",Q=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,oe=" \\f\\n\\r\\t",ie="[^"+oe+"\\/>\"'=]+",ae="["+oe+"]+"+ie,se="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ie.replace("\\/","")+"))?)",le=new RegExp(se+ae+ce+"+)(["+oe+"]*/?>)","g"),ue=new RegExp(se+ae+ce+"*)(["+oe+"]*/>)","g"),de=new RegExp("("+ae+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,he)+r}function he(e,t,n){return t+(n||'"')+Y+(n||'"')}function fe(e,t,n){return re.test(t)?e:"<"+t+n+">"}function me(e,t){for(var n=t.length,r=0;r ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:g,table:g,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};function r(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||k.defaults,this.rules=n.normal,this.options.pedantic?this.rules=n.pedantic:this.options.gfm&&(this.rules=n.gfm)}n._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,n._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,n.def=p(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d{1,9}\.)/,n.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,n.item=p(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=p(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",n._comment=//,n.html=p(n.html,"i").replace("comment",n._comment).replace("tag",n._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),n.paragraph=p(n._paragraph).replace("hr",n.hr).replace("heading"," {0,3}#{1,6} +").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}|~{3,})[^`\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",n._tag).getRegex(),n.blockquote=p(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=b({},n),n.gfm=b({},n.normal,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),n.pedantic=b({},n.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",n._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:g,paragraph:p(n.normal._paragraph).replace("hr",n.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",n.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()}),r.rules=n,r.lex=function(e,t){return new r(t).lex(e)},r.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},r.prototype.token=function(e,t){var r,o,i,a,s,c,l,d,p,h,f,m,g,b,$,v;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e)){var k=this.tokens[this.tokens.length-1];e=e.substring(i[0].length),k&&"paragraph"===k.type?k.text+="\n"+i[0].trimRight():(i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?i:w(i,"\n")}))}else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2]?i[2].trim():i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if((i=this.rules.nptable.exec(e))&&(c={type:"table",header:y(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===c.align.length){for(e=e.substring(i[0].length),f=0;f ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l={type:"list_start",ordered:b=(a=i[2]).length>1,start:b?+a:"",loose:!1},this.tokens.push(l),d=[],r=!1,g=(i=i[0].match(this.rules.item)).length,f=0;f1?1===s.length:s.length>1||this.options.smartLists&&s!==a)&&(e=i.slice(f+1).join("\n")+e,f=g-1)),o=r||/\n\n(?!\s*$)/.test(c),f!==g-1&&(r="\n"===c.charAt(c.length-1),o||(o=r)),o&&(l.loose=!0),v=void 0,($=/^\[[ xX]\] /.test(c))&&(v=" "!==c[1],c=c.replace(/^\[[ xX]\] +/,"")),p={type:"list_item_start",task:$,checked:v,loose:o},d.push(p),this.tokens.push(p),this.token(c,!1),this.tokens.push({type:"list_item_end"});if(l.loose)for(g=d.length,f=0;f?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:g,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:g,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~",o.em=p(o.em).replace(/punctuation/g,o._punctuation).getRegex(),o._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,o._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,o._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,o.autolink=p(o.autolink).replace("scheme",o._scheme).replace("email",o._email).getRegex(),o._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,o.tag=p(o.tag).replace("comment",n._comment).replace("attribute",o._attribute).getRegex(),o._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,o._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,o._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,o.link=p(o.link).replace("label",o._label).replace("href",o._href).replace("title",o._title).getRegex(),o.reflink=p(o.reflink).replace("label",o._label).getRegex(),o.normal=b({},o),o.pedantic=b({},o.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",o._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",o._label).getRegex()}),o.gfm=b({},o.normal,{escape:p(o.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\/i.test(a[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(this.inRawBlock=!1),e=e.substring(a[0].length),c+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):u(a[0]):a[0];else if(a=this.rules.link.exec(e)){var l=$(a[2],"()");if(l>-1){var d=4+a[1].length+l;a[2]=a[2].substring(0,l),a[0]=a[0].substring(0,d).trim(),a[3]=""}e=e.substring(a[0].length),this.inLink=!0,r=a[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],o=t[3]):o="":o=a[3]?a[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),c+=this.outputLink(a,{href:i.escapes(r),title:i.escapes(o)}),this.inLink=!1}else if((a=this.rules.reflink.exec(e))||(a=this.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){c+=a[0].charAt(0),e=a[0].substring(1)+e;continue}this.inLink=!0,c+=this.outputLink(a,t),this.inLink=!1}else if(a=this.rules.strong.exec(e))e=e.substring(a[0].length),c+=this.renderer.strong(this.output(a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.em.exec(e))e=e.substring(a[0].length),c+=this.renderer.em(this.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.code.exec(e))e=e.substring(a[0].length),c+=this.renderer.codespan(u(a[2].trim(),!0));else if(a=this.rules.br.exec(e))e=e.substring(a[0].length),c+=this.renderer.br();else if(a=this.rules.del.exec(e))e=e.substring(a[0].length),c+=this.renderer.del(this.output(a[1]));else if(a=this.rules.autolink.exec(e))e=e.substring(a[0].length),r="@"===a[2]?"mailto:"+(n=u(this.mangle(a[1]))):n=u(a[1]),c+=this.renderer.link(r,null,n);else if(this.inLink||!(a=this.rules.url.exec(e))){if(a=this.rules.text.exec(e))e=e.substring(a[0].length),this.inRawBlock?c+=this.renderer.text(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):u(a[0]):a[0]):c+=this.renderer.text(u(this.smartypants(a[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===a[2])r="mailto:"+(n=u(a[0]));else{do{s=a[0],a[0]=this.rules._backpedal.exec(a[0])[0]}while(s!==a[0]);n=u(a[0]),r="www."===a[1]?"http://"+n:n}e=e.substring(a[0].length),c+=this.renderer.link(r,null,n)}return c},i.escapes=function(e){return e?e.replace(i.rules._escapes,"$1"):e},i.prototype.outputLink=function(e,t){var n=t.href,r=t.title?u(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,u(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,o=0;o.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},a.prototype.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,r);null!=o&&o!==e&&(n=!0,e=o)}return r?'
'+(n?e:u(e,!0))+"
\n":"
"+(n?e:u(e,!0))+"
"},a.prototype.blockquote=function(e){return"
\n"+e+"
\n"},a.prototype.html=function(e){return e},a.prototype.heading=function(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"},a.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},a.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},a.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},a.prototype.checkbox=function(e){return" "},a.prototype.paragraph=function(e){return"

    "+e+"

    \n"},a.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},a.prototype.tablerow=function(e){return"\n"+e+"\n"},a.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},a.prototype.strong=function(e){return""+e+""},a.prototype.em=function(e){return""+e+""},a.prototype.codespan=function(e){return""+e+""},a.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},a.prototype.del=function(e){return""+e+""},a.prototype.link=function(e,t,n){if(null===(e=h(this.options.sanitize,this.options.baseUrl,e)))return n;var r='"},a.prototype.image=function(e,t,n){if(null===(e=h(this.options.sanitize,this.options.baseUrl,e)))return n;var r=''+n+'":">"},a.prototype.text=function(e){return e},s.prototype.strong=s.prototype.em=s.prototype.codespan=s.prototype.del=s.prototype.text=function(e){return e},s.prototype.link=s.prototype.image=function(e,t,n){return""+n},s.prototype.br=function(){return""},c.parse=function(e,t){return new c(t).parse(e)},c.prototype.parse=function(e){this.inline=new i(e.links,this.options),this.inlineText=new i(e.links,b({},this.options,{renderer:new s})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},c.prototype.next=function(){return this.token=this.tokens.pop(),this.token},c.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},c.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},c.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,d(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,o="",i="";for(n="",e=0;e?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},u.escapeTest=/[&<>"']/,u.escapeReplace=/[&<>"']/g,u.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},u.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,u.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var f={},m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(){}function b(e){for(var t,n,r=1;r=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.lengthAn error occurred:

    "+u(e.message+"",!0)+"
    ";throw e}}g.exec=g,k.options=k.setOptions=function(e){return b(k.defaults,e),k},k.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new a,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1}},k.defaults=k.getDefaults(),k.Parser=c,k.parser=c.parse,k.Renderer=a,k.TextRenderer=s,k.Lexer=r,k.lexer=r.lex,k.InlineLexer=i,k.inlineLexer=i.output,k.Slugger=l,k.parse=k,e.exports=k}()})),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function createCommonjsModule$1(e,t){return e(t={exports:{}},t.exports),t.exports}var pluralize=createCommonjsModule$1((function(e,t){!function(t,n){"function"==typeof commonjsRequire?e.exports=n():t.pluralize=n()}(commonjsGlobal,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function c(e,t){return e.replace(t[0],(function(n,r){var o=s(t[1],arguments);return a(""===n?e[r-1]:n,o)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return c(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?a(r,o):e.hasOwnProperty(o)?a(r,e[o]):l(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&l(o,o,n)===o}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(o,r,e),p.isPlural=d(o,r,e),p.singular=u(r,o,t),p.isSingular=d(r,o,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}))}));const idb=_idb,webidl2=_webidl2,hyperHTML$1=hyperHTML,marked$1=marked,pluralize$1=pluralize,name$3="core/markdown",gtEntity=/>/gm,ampEntity=/&/gm,endsWithSpace=/\s+$/gm,inlineElems=new Set(["a","abbr","acronym","b","bdo","big","br","button","cite","code","dfn","em","i","img","input","kbd","label","map","object","q","samp","script","select","small","span","strong","sub","sup","textarea","time","tt","var"]);class Renderer extends marked$1.Renderer{code(e,t,n){return"webidl"===t?`
    ${e}
    `:super.code(e,t,n)}}function normalizePadding(e){if(!e)return"";if("string"!=typeof e)throw TypeError("Invalid input");if("\n"===e)return"\n";function t(e){return null!==e&&e.nodeType===Node.TEXT_NODE}const n=document.createRange().createContextualFragment(e);var r;Array.from(n.children).filter(e=>!inlineElems.has(e.localName)).filter(e=>"pre"!==e.localName).filter(e=>"table"!==e.localName).forEach(e=>{e.innerHTML=normalizePadding(e.innerHTML)}),Array.from(n.childNodes).filter(e=>t(e)&&""===e.textContent.trim()).forEach(e=>e.replaceWith("\n")),null!==(r=n.firstChild)&&r.nodeType===Node.ELEMENT_NODE&&Array.from(n.firstChild.children).filter(e=>"table"!==e.localName).forEach(e=>{e.innerHTML=normalizePadding(e.innerHTML)}),n.normalize();const o=n.textContent.replace(/^ *\n/,"").split("\n").filter(e=>e&&e.startsWith(" "))[0],i=o?o.match(/ +/)[0].length:0;if(i){Array.from(n.childNodes).filter(e=>"PRE"!==e.nodeName).filter(t).filter(e=>{const t=e.previousElementSibling,n=t&&t.localName;return!inlineElems.has(n)||e.textContent.trim().includes("\n")}).reduce((e,t)=>{let n="";const r=t.previousElementSibling,o=r&&r.localName;return/^[\t ]/.test(t.textContent)&&inlineElems.has(o)&&(n=t.textContent.match(/^\s+/)[0]),t.textContent=n+t.textContent.replace(e,""),e},new RegExp(`^ {1,${i}}`,"gm"));const e=new RegExp(`\\ {${i}}$`,"gm");Array.from(n.querySelectorAll("pre")).map(e=>e.previousSibling).filter(t).reduce((t,n)=>(e.test(n.textContent)&&(n.textContent=n.textContent.substr(0,n.textContent.length-t)),t),i)}const a=document.createElement("body");return a.append(n),endsWithSpace.test(a.innerHTML)?`${a.innerHTML.trimRight()}\n`:a.innerHTML}function markdownToHtml(e){const t=normalizePadding(e).replace(gtEntity,">").replace(ampEntity,"&");return marked$1(t,{sanitize:!1,gfm:!0,headerIds:!1,renderer:new Renderer})}function processElements(e){return t=>{const n=Array.from(t.querySelectorAll(e));return n.reverse().forEach(e=>{e.innerHTML=markdownToHtml(e.innerHTML)}),n}}class Builder{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e])return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e,t){const n=this.findHeader(e),r=n?this.findPosition(n):1,o=this.findParent(r);n&&e.removeChild(n),e.appendChild(t(e)),n&&e.prepend(n),o.appendChild(e),this.current=o}addElement(e){this.current.appendChild(e)}}function structure(e,t){return function e(n){const r=new Builder(t);for(;n.firstChild;){const t=n.firstChild;if(t.nodeType===Node.ELEMENT_NODE)switch(t.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":r.addHeader(t);break;case"section":r.addSection(t,e);break;default:r.addElement(t)}else n.removeChild(t)}return r.root}(e)}function substituteWithTextNodes(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}const processMDSections=processElements("[data-format='markdown']:not(body)"),processBlockLevelElements=processElements("[data-format=markdown]:not(body), section, div, address, article, aside, figure, header, main, body");function run$1(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void processMDSections(document.body).map(e=>{return{structuredInternals:structure(e,e.ownerDocument),elem:e}}).forEach(({elem:e,structuredInternals:t})=>{if(e.setAttribute("aria-busy","true"),"section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t),e.setAttribute("aria-busy","false")});const r=document.getElementById("respec-ui");r.remove();const o=document.createElement("html"),i=document.createElement("body");i.innerHTML=document.body.innerHTML,o.appendChild(i),processBlockLevelElements(o);const a=i.innerHTML.replace(/

    \s*<\/p>/gm,"");i.innerHTML=a,substituteWithTextNodes(i.querySelectorAll(".nolinks a[href]"));const s=structure(i,document);i.appendChild(s),i.prepend(r),document.body.replaceWith(i)}var markdown=Object.freeze({__proto__:null,name:name$3,markdownToHtml:markdownToHtml,run:run$1}),shortcut={all_shortcuts:{},add:function(e,t,n){var r={type:"keydown",propagate:!1,disable_in_input:!1,target:document,keycode:!1};if(n)for(var o in r)void 0===n[o]&&(n[o]=r[o]);else n=r;var i=n.target;"string"==typeof n.target&&(i=document.getElementById(n.target)),e=e.toLowerCase();var a=function(r){var o,i;if((r=r||window.event,n.disable_in_input)&&(r.target?i=r.target:r.srcElement&&(i=r.srcElement),3==i.nodeType&&(i=i.parentNode),"INPUT"==i.tagName||"TEXTAREA"==i.tagName))return;r.keyCode?o=r.keyCode:r.which&&(o=r.which);var a=String.fromCharCode(o).toLowerCase();188==o&&(a=","),190==o&&(a=".");var s=e.split("+"),c=0,l={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"},u={esc:27,escape:27,tab:9,space:32,return:13,enter:13,backspace:8,scrolllock:145,scroll_lock:145,scroll:145,capslock:20,caps_lock:20,caps:20,numlock:144,num_lock:144,num:144,pause:19,break:19,insert:45,home:36,delete:46,end:35,pageup:33,page_up:33,pu:33,pagedown:34,page_down:34,pd:34,left:37,up:38,right:39,down:40,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},d={shift:{wanted:!1,pressed:!1},ctrl:{wanted:!1,pressed:!1},alt:{wanted:!1,pressed:!1},meta:{wanted:!1,pressed:!1}};r.ctrlKey&&(d.ctrl.pressed=!0),r.shiftKey&&(d.shift.pressed=!0),r.altKey&&(d.alt.pressed=!0),r.metaKey&&(d.meta.pressed=!0);for(var p,h=0;p=s[h],h1?u[p]==o&&c++:n.keycode?n.keycode==o&&c++:a==p?c++:l[a]&&r.shiftKey&&(a=l[a])==p&&c++;if(c==s.length&&d.ctrl.pressed==d.ctrl.wanted&&d.shift.pressed==d.shift.wanted&&d.alt.pressed==d.alt.wanted&&d.meta.pressed==d.meta.wanted&&(t(r),!n.propagate))return r.cancelBubble=!0,r.returnValue=!1,r.stopPropagation&&(r.stopPropagation(),r.preventDefault()),!1};this.all_shortcuts[e]={callback:a,target:i,event:n.type},i.addEventListener?i.addEventListener(n.type,a,!1):i.attachEvent?i.attachEvent("on"+n.type,a):i["on"+n.type]=a}};const name$4="core/ui";async function loadStyle(){try{return(await Promise.resolve().then((function(){return ui$3}))).default}catch{return fetchAsset("ui.css")}}async function insertStyle(){const e=document.createElement("style");return e.id="respec-ui-styles",e.textContent=await loadStyle(),e.classList.add("removeOnSave"),document.head.appendChild(e),e}function ariaDecorate(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute(`aria-${t}`,n)})}insertStyle();const respecUI=hyperHTML$1`

    `,menu=hyperHTML$1``;let modal,overlay;const errors=[],warnings=[],buttons={};sub("start-all",()=>document.body.prepend(respecUI),{once:!0}),sub("end-all",()=>document.body.prepend(respecUI),{once:!0});const respecPill=hyperHTML$1``;respecUI.appendChild(respecPill),respecPill.addEventListener("click",e=>{e.stopPropagation(),menu.hidden?(menu.classList.remove("respec-hidden"),menu.classList.add("respec-visible")):(menu.classList.add("respec-hidden"),menu.classList.remove("respec-visible")),respecPill.setAttribute("aria-expanded",String(menu.hidden)),menu.hidden=!menu.hidden}),document.documentElement.addEventListener("click",()=>{menu.hidden||(menu.classList.remove("respec-visible"),menu.classList.add("respec-hidden"),menu.hidden=!0)}),respecUI.appendChild(menu);const ariaMap=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function errWarn(e,t,n,r){t.push(e),buttons.hasOwnProperty(n)||(buttons[n]=createWarnButton(n,t,r),respecUI.appendChild(buttons[n])),buttons[n].textContent=t.length}function createWarnButton(e,t,n){const r=hyperHTML$1``,a=hyperHTML$1`
  • ${i}
  • `;return a.addEventListener("click",t),menu.appendChild(a),n&&shortcut.add(n,t),i},error(e){errWarn(e,errors,"error","Errors")},warning(e){errWarn(e,warnings,"warning","Warnings")},closeModal(e){overlay&&(overlay.classList.remove("respec-show-overlay"),overlay.classList.add("respec-hide-overlay"),overlay.addEventListener("transitionend",()=>{overlay.remove(),overlay=null})),e&&e.setAttribute("aria-expanded","false"),modal&&(modal.remove(),modal=null)},freshModal(e,t,n){modal&&modal.remove(),overlay&&overlay.remove(),overlay=hyperHTML$1`
    `;const r=`${n.id}-modal`,o=`${r}-heading`;modal=hyperHTML$1``;const i=new Map([["labelledby",o]]);ariaDecorate(modal,i),document.body.append(overlay,modal),overlay.addEventListener("click",()=>this.closeModal(n)),overlay.classList.toggle("respec-show-overlay"),modal.hidden=!1}};shortcut.add("Esc",()=>ui.closeModal()),shortcut.add("Ctrl+Alt+Shift+E",()=>{buttons.error&&buttons.error.click()}),shortcut.add("Ctrl+Alt+Shift+W",()=>{buttons.warning&&buttons.warning.click()}),window.respecUI=ui,sub("error",e=>ui.error(e)),sub("warn",e=>ui.warning(e));var ui$1=Object.freeze({__proto__:null,name:name$4,ui:ui});const name$5="core/reindent";function reindent(e){if(!e)return e;const t=e.trimRight().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter(e=>e.trim()).map(e=>e.search(/[^\s]/)),r=Math.min(...n);return t.map(e=>e.slice(r)).join("\n")}function run$2(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=reindent(e.innerHTML)}var reindent$1=Object.freeze({__proto__:null,name:name$5,run:run$2});const name$6="core/location-hash";function run$3(){pub("start","core/location-hash"),location.hash&&document.respecIsReady.then(()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash=`#${e}`})}var locationHash=Object.freeze({__proto__:null,name:name$6,run:run$3});const privs=new WeakMap;function canLint(e,t){return!(!1===e.hasOwnProperty("lint")||!1===e.lint||!e.lint[t])}class LinterRule{constructor(e,t){privs.set(this,{name:e,lintingFunction:t})}get name(){return privs.get(this).name}lint(e={lint:{[this.name]:!1}},t=document){if(canLint(e,this.name))return privs.get(this).lintingFunction(e,t)}}const name$7="check-charset",meta={en:{description:"Document must only contain one `` tag with charset set to 'utf-8'",howToFix:'Add this line in your document `` section - `` or set charset to "utf-8" if not set already.'}},lang$1=lang in meta?lang:"en";function linterFunction(e,t){const n=t.querySelectorAll("meta[charset]"),r=[];for(const e of n)r.push(e.getAttribute("charset").trim().toLowerCase());return r.includes("utf-8")&&1===n.length?[]:{name:name$7,occurrences:n.length,...meta[lang$1]}}const rule=new LinterRule(name$7,linterFunction),name$8="check-internal-slots",meta$1={en:{description:"Internal slots should be preceded by a '.'",howToFix:"Add a '.' between the elements mentioned.",help:"See developer console."}},lang$2=lang in meta$1?lang:"en";function linterFunction$1(e,t){const n=[...t.querySelectorAll("var+a")].filter(({previousSibling:{nodeName:e}})=>{return e&&"VAR"===e});if(n.length)return{name:name$8,offendingElements:n,occurrences:n.length,...meta$1[lang$2]}}const rule$1=new LinterRule(name$8,linterFunction$1),name$9="check-punctuation",punctuationMarks=[".",":","!","?"],humanMarks=punctuationMarks.map(e=>`"${e}"`).join(", "),meta$2={en:{description:"`p` elements should end with a punctuation mark.",howToFix:`Please make sure \`p\` elements end with one of: ${humanMarks}.`}},lang$3=lang in meta$2?lang:"en";function lintingFunction(e,t){const n=new RegExp(`[${punctuationMarks.join("")}\\]]$|^ *$`,"m"),r=[...t.querySelectorAll("p:not(#back-to-top)")].filter(e=>!n.test(e.textContent.trim()));if(r.length)return{name:name$9,offendingElements:r,occurrences:r.length,...meta$2[lang$3]}}const rule$2=new LinterRule(name$9,lintingFunction),name$a="core/linter",privates=new WeakMap;class Linter{constructor(){privates.set(this,{rules:new Set})}get rules(){return privates.get(this).rules}register(...e){e.forEach(e=>this.rules.add(e))}async lint(e,t=window.document){const n=[...privates.get(this).rules].map(n=>toLinterWarning(n.lint(e,t)));await n}}const linter=new Linter,baseResult={name:"unknown",description:"",occurrences:0,howToFix:"",offendingElements:[],help:""};async function toLinterWarning(e){const t=await e;if(!t)return;const n={...baseResult,...t},{description:r,help:o,howToFix:i,name:a,occurrences:s,offendingElements:c}=n,l=`Linter (${a}): ${r} ${i} ${o}`;c.length?showInlineWarning(c,`${l} Occured`):pub("warn",`${l} (Count: ${s})`)}function run$4(e){!1!==e.lint&&(async()=>{await document.respecIsReady;try{await linter.lint(e,document)}catch(e){console.error("Error ocurred while running the linter",e)}})()}var linter$1=Object.freeze({__proto__:null,name:name$a,default:linter,run:run$4});const name$b="local-refs-exist",meta$3={en:{description:"Broken local reference found in document.",howToFix:"Please fix the links mentioned.",help:"See developer console."}},lang$4=lang in meta$3?lang:"en";function linterFunction$2(e,t){const n=[...t.querySelectorAll("a[href^='#']")].filter(isBrokenHyperlink);if(n.length)return{name:name$b,offendingElements:n,occurrences:n.length,...meta$3[lang$4]}}const rule$3=new LinterRule(name$b,linterFunction$2);function isBrokenHyperlink(e){const t=e.getAttribute("href").substring(1);return!e.ownerDocument.getElementById(t)}const name$c="no-headingless-sections",meta$4={en:{description:"All sections must start with a `h2-6` element.",howToFix:"Add a `h2-6` to the offending section or use a `
    `.",help:"See developer console."},nl:{description:"Alle secties moeten beginnen met een `h2-6` element.",howToFix:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `
    `.",help:"Zie de developer console."}},lang$5=lang in meta$4?lang:"en",hasNoHeading=({firstElementChild:e})=>null===e||!1===/^h[1-6]$/.test(e.localName);function linterFunction$3(e,t){const n=[...t.querySelectorAll("section")].filter(hasNoHeading);if(n.length)return{name:name$c,offendingElements:n,occurrences:n.length,...meta$4[lang$5]}}const rule$4=new LinterRule(name$c,linterFunction$3),name$d="no-http-props",meta$5={en:{description:"Insecure URLs are not allowed in `respecConfig`.",howToFix:"Please change the following properties to 'https://': "}},lang$6=lang in meta$5?lang:"en";function lintingFunction$1(e,t){if(!t.location.href.startsWith("http"))return;const n=Object.getOwnPropertyNames(e).filter(e=>e.endsWith("URI")||"prevED"===e).filter(n=>new URL(e[n],t.location.href).href.startsWith("http://"));if(!n.length)return;const r={name:name$d,occurrences:n.length,...meta$5[lang$6]};return r.howToFix+=`${n.map(e=>`\`${e}\``).join(", ")}.`,r}const rule$5=new LinterRule(name$d,lintingFunction$1),name$e="privsec-section",meta$6={en:{description:"Document must a 'Privacy and/or Security' Considerations section.",howToFix:"Add a privacy and/or security considerations section.",help:"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}},lang$7=lang in meta$6?lang:"en";function hasPriSecConsiderations(e){return Array.from(e.querySelectorAll("h2, h3, h4, h5, h6")).some(({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})}function lintingFunction$2(e,t){if(e.isRecTrack&&!hasPriSecConsiderations(t))return{name:name$e,occurrences:1,...meta$6[lang$7]}}const rule$6=new LinterRule(name$e,lintingFunction$2);linter.register(rule$5,rule$4,rule$2,rule$3,rule$1,rule,rule$6);const coreDefaults={lint:{"no-headingless-sections":!0,"no-http-props":!0,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!1,specStatus:"base",highlightVars:!0,addSectionLinks:!0},definitionMap=Object.create(null);function registerDefinition(e,t){for(const n of t.map(e=>e.toLowerCase()))n in definitionMap==!1?definitionMap[n]=[e]:definitionMap[n].includes(e)||definitionMap[n].push(e)}const name$f="w3c/defaults";linter.register(rule$6);const w3cDefaults={lint:{"privsec-section":!0},pluralize:!0,doJsonLd:!1,license:"w3c-software-doc",logos:[{src:"https://www.w3.org/StyleSheets/TR/2016/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"}],xref:!0};function run$5(e){if("unofficial"===e.specStatus)return;const t=!1!==e.lint&&{...coreDefaults.lint,...w3cDefaults.lint,...e.lint};Object.assign(e,{...coreDefaults,...w3cDefaults,...e,lint:t}),Object.assign(e,{definitionMap:definitionMap})}var defaults=Object.freeze({__proto__:null,name:name$f,run:run$5});const name$g="core/style",styleElement=insertStyle$1();async function loadStyle$1(){try{return(await Promise.resolve().then((function(){return respec2$1}))).default}catch{return fetchAsset("respec2.css")}}async function insertStyle$1(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=await loadStyle$1(),document.head.appendChild(e),e}async function run$6(e){e.noReSpecCSS&&(await styleElement).remove()}var style=Object.freeze({__proto__:null,name:name$g,run:run$6});const name$h="w3c/style";function attachFixupScript(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",()=>{window.location.href=location.hash},{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}function createMetaViewport(){const e=document.createElement("meta");e.name="viewport";return e.content=toKeyValuePairs({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}function createBaseStyle(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}function selectStyleVersion(e){let t="";switch(e){case null:case!0:t="2016";break;default:e&&!isNaN(e)&&(t=e.toString().trim())}return t}function createResourceHints(){return[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/logos/W3C",as:"image"}].map(createResourceHint).reduce((e,t)=>(e.appendChild(t),e),document.createDocumentFragment())}const elements=createResourceHints();function styleMover(e){return t=>{const n=t.querySelector(`head link[href="${e}"]`);t.querySelector("head").append(n)}}function run$7(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",pub("warn",t)}let t="W3C-";switch(e.specStatus.toUpperCase()){case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":t=e.specStatus.toLowerCase();break;case"FPWD":case"LC":case"WD-NOTE":case"LC-NOTE":t+="WD";break;case"WG-NOTE":case"FPWD-NOTE":t+="WG-NOTE.css";break;case"UNOFFICIAL":t+="UD";break;case"FINDING":case"FINDING-DRAFT":case"BASE":t="base.css";break;default:t+=e.specStatus}const n=selectStyleVersion(e.useExperimentalStyles||"2016");n&&!e.noToc&&sub("end-all",()=>{attachFixupScript(document,n)},{once:!0});const r=`https://www.w3.org/StyleSheets/TR/${n?`${n}/`:""}${t}`;linkCSS(document,r),sub("beforesave",styleMover(r))}elements.appendChild(createBaseStyle()),document.head.querySelector("meta[name=viewport]")||elements.prepend(createMetaViewport()),document.head.prepend(elements);var style$1=Object.freeze({__proto__:null,name:name$h,run:run$7});const name$i="w3c/l10n",additions={en:{status_at_publication:"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/."},ko:{status_at_publication:"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/."},zh:{status_at_publication:"本章节描述了本文档的发布状态。其它更新版本可能会覆盖本文档。W3C的文档列 表和最新版本可通过W3C技术报告索引访问。"},ja:{status_at_publication:"この節には、公開時点でのこの文書の位置づけが記されている。他の文書によって置き換えられる可能性がある。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 W3C technical reports index (https://www.w3.org/TR/)"},nl:{status_at_publication:"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/."},es:{status_at_publication:"Esta sección describe el estado del presente documento al momento de su publicación. El presente documento puede ser remplazado por otros. Una lista de las publicaciones actuales del W3C y la última revisión del presente informe técnico puede hallarse en http://www.w3.org/TR/ el índice de informes técnicos del W3C."}};Object.keys(additions).forEach(e=>{Object.assign(l10n[e],additions[e])});var l10n$2=Object.freeze({__proto__:null,name:name$i});const name$j="core/github";let resolveGithubPromise,rejectGithubPromise;const github=new Promise((e,t)=>{resolveGithubPromise=e,rejectGithubPromise=e=>{pub("error",e),t(new Error(e))}}),localizationStrings={en:{file_a_bug:"File a bug",participate:"Participate",commit_history:"Commit history"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe"}},lang$8=lang in localizationStrings?lang:"en",l10n$3=localizationStrings[lang$8];async function run$8(e){if(!e.hasOwnProperty("github")||!e.github)return void resolveGithubPromise(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){return void rejectGithubPromise("Config option `[github](https://github.com/w3c/respec/wiki/github)` is missing property `repoURL`.")}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{return void rejectGithubPromise(`\`respecConf.github\` is not a valid URL? (${t})`)}if("https://github.com"!==t.origin){return void rejectGithubPromise(`\`respecConf.github\` must be HTTPS and pointing to GitHub. (${t})`)}const[r,o]=t.pathname.split("/").filter(e=>e);if(!r||!o){return void rejectGithubPromise("`respecConf.github` URL needs a path with, for example, w3c/my-spec")}const i=e.github.branch||"gh-pages",a=new URL("./issues/",t).href,s={edDraftURI:`https://${r.toLowerCase()}.github.io/${o}/`,githubToken:void 0,githubUser:void 0,issueBase:a,atRiskBase:a,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:o},c={key:l10n$3.participate,data:[{value:`GitHub ${r}/${o}`,href:t},{value:l10n$3.file_a_bug,href:s.issueBase},{value:l10n$3.commit_history,href:new URL(`./commits/${i}`,t.href).href},{value:"Pull requests",href:s.pullBase}]};let l=`https://respec.org/github/${r}/${o}/`;if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{pub("warn","`respecConfig.githubAPI` should not be added manually.")}const u={branch:i,repoURL:t.href};resolveGithubPromise({api:l,...u});const d={...s,...e,github:u,githubAPI:l};Object.assign(e,d),e.otherLinks.unshift(c)}var github$1=Object.freeze({__proto__:null,name:name$j,github:github,run:run$8});const name$k="core/data-include";function processResponse(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=r.ownerDocument,i=runTransforms(e,r.dataset.oninclude,n),a="string"==typeof r.dataset.includeReplace;let s;switch(r.dataset.includeFormat){case"text":a?(s=o.createTextNode(i),r.replaceWith(s)):r.textContent=i;break;default:if(r.innerHTML=i,a){for(s=o.createDocumentFragment();r.hasChildNodes();)s.append(r.removeChild(r.firstChild));r.replaceWith(s)}}o.contains(r)&&cleanUp(r)}function cleanUp(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach(t=>e.removeAttribute(t))}async function run$9(){const e=document.querySelectorAll("[data-include]"),t=Array.from(e).map(async e=>{const t=e.dataset.include;if(!t)return;const n=`include-${String(Math.random()).substr(2)}`;e.dataset.includeId=n;try{const e=await fetch(t);processResponse(await e.text(),n,t)}catch(n){const r=`\`data-include\` failed: \`${t}\` (${n.message}). See console for details.`;console.error("data-include failed for element: ",e,n),pub("error",r)}});await Promise.all(t)}var dataInclude=Object.freeze({__proto__:null,name:name$k,run:run$9});const html$1=hyperHTML$1;var showLink=e=>{if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return pub("warn",t),void console.warn("warn",t,e)}return html$1` -
    ${e.key}:
    - ${e.data?e.data.map(showLinkData):showLinkData(e)} - `};function showLinkData(e){return html$1` -
    - ${e.href?html$1` - ${e.value||e.href} - `:""} +window.respecVersion = "24.35.3"; +'use strict'; + +// In case everything else fails, we want the error +window.addEventListener("error", ev => { + console.error(ev.error, ev.message, ev); +}); + +const modules = [ + // order is significant + Promise.resolve().then(function () { return baseRunner; }), + Promise.resolve().then(function () { return ui$1; }), + Promise.resolve().then(function () { return reindent$1; }), + Promise.resolve().then(function () { return locationHash; }), + Promise.resolve().then(function () { return l10n$1; }), + Promise.resolve().then(function () { return defaults; }), + Promise.resolve().then(function () { return style; }), + Promise.resolve().then(function () { return style$1; }), + Promise.resolve().then(function () { return l10n$2; }), + Promise.resolve().then(function () { return github$1; }), + Promise.resolve().then(function () { return dataInclude; }), + Promise.resolve().then(function () { return markdown; }), + Promise.resolve().then(function () { return headers; }), + Promise.resolve().then(function () { return abstract; }), + Promise.resolve().then(function () { return dataTransform; }), + Promise.resolve().then(function () { return dataAbbr; }), + Promise.resolve().then(function () { return inlines; }), + Promise.resolve().then(function () { return conformance; }), + Promise.resolve().then(function () { return dfn; }), + Promise.resolve().then(function () { return pluralize$2; }), + Promise.resolve().then(function () { return examples; }), + Promise.resolve().then(function () { return issuesNotes; }), + Promise.resolve().then(function () { return requirements; }), + Promise.resolve().then(function () { return bestPractices; }), + Promise.resolve().then(function () { return figures; }), + Promise.resolve().then(function () { return webidl; }), + Promise.resolve().then(function () { return dataCite; }), + Promise.resolve().then(function () { return biblio$1; }), + Promise.resolve().then(function () { return webidlIndex; }), + Promise.resolve().then(function () { return linkToDfn; }), + Promise.resolve().then(function () { return renderBiblio; }), + Promise.resolve().then(function () { return contrib; }), + Promise.resolve().then(function () { return fixHeaders; }), + Promise.resolve().then(function () { return structure$1; }), + Promise.resolve().then(function () { return informative; }), + Promise.resolve().then(function () { return idHeaders; }), + Promise.resolve().then(function () { return caniuse; }), + Promise.resolve().then(function () { return mdnAnnotation; }), + Promise.resolve().then(function () { return saveHtml; }), + Promise.resolve().then(function () { return searchSpecref; }), + Promise.resolve().then(function () { return searchXref; }), + Promise.resolve().then(function () { return dfnList; }), + Promise.resolve().then(function () { return aboutRespec; }), + Promise.resolve().then(function () { return seo; }), + Promise.resolve().then(function () { return seo$1; }), + Promise.resolve().then(function () { return highlight; }), + Promise.resolve().then(function () { return webidlClipboard; }), + Promise.resolve().then(function () { return dataTests; }), + Promise.resolve().then(function () { return listSorter; }), + Promise.resolve().then(function () { return highlightVars$1; }), + Promise.resolve().then(function () { return dataType; }), + Promise.resolve().then(function () { return algorithms; }), + Promise.resolve().then(function () { return anchorExpander; }), + Promise.resolve().then(function () { return index; }), + /* Linter must be the last thing to run */ + Promise.resolve().then(function () { return linter$1; }), +]; + +async function domReady() { + if (document.readyState === "loading") { + await new Promise(resolve => + document.addEventListener("DOMContentLoaded", resolve) + ); + } +} + +(async () => { + const [runner, { ui }, ...plugins] = await Promise.all(modules); + try { + ui.show(); + await domReady(); + await runner.runAll(plugins); + } finally { + ui.enable(); + } +})().catch(err => { + console.error(err); +}); + +// @ts-check +const inAmd = !!window.require; +if (!inAmd) { + /** + * @type {any} + * @param {string[]} deps + * @param {(...modules: any[]) => void} callback + */ + const require = function(deps, callback) { + const modules = deps.map(dep => { + if (!(dep in window.require.modules)) { + throw new Error(`Unsupported dependency name: ${dep}`); + } + return window.require.modules[dep]; + }); + Promise.all(modules).then(results => callback(...results)); + }; + require.modules = {}; + window.require = require; +} + +/** + * @param {string} name + * @param {object | Promise} object + */ +function expose(name, object) { + if (!inAmd) { + window.require.modules[name] = object; + } +} + +// @ts-check + +/** + * Module core/pubsubhub + * + * Returns a singleton that can be used for message broadcasting + * and message receiving. Replaces legacy "msg" code in ReSpec. + */ +const name = "core/pubsubhub"; + +const subscriptions = new Map(); + +function pub(topic, ...data) { + if (!subscriptions.has(topic)) { + return; // Nothing to do... + } + Array.from(subscriptions.get(topic)).forEach(cb => { + try { + cb(...data); + } catch (err) { + pub( + "error", + `Error when calling function ${cb.name}. See developer console.` + ); + console.error(err); + } + }); + if (window.parent === window.self) { + return; + } + // If this is an iframe, postMessage parent (used in testing). + const args = data + // to structured clonable + .map(arg => String(JSON.stringify(arg.stack || arg))); + window.parent.postMessage({ topic, args }, window.parent.location.origin); +} +/** + * Subscribes to a message type. + * + * @param {string} topic The topic to subscribe to (e.g., "start-all") + * @param {Function} cb Callback function + * @param {Object} [opts] + * @param {Boolean} [opts.once] Add prop "once" for single notification. + * @return {Object} An object that should be considered opaque, + * used for unsubscribing from messages. + */ +function sub(topic, cb, opts = { once: false }) { + if (opts.once) { + return sub(topic, function wrapper(...args) { + unsub({ topic, cb: wrapper }); + cb(...args); + }); + } + if (subscriptions.has(topic)) { + subscriptions.get(topic).add(cb); + } else { + subscriptions.set(topic, new Set([cb])); + } + return { topic, cb }; +} +/** + * Unsubscribe from messages. + * + * @param {Object} opaque The object that was returned from calling sub() + */ +function unsub({ topic, cb }) { + // opaque is whatever is returned by sub() + const callbacks = subscriptions.get(topic); + if (!callbacks || !callbacks.has(cb)) { + console.warn("Already unsubscribed:", topic, cb); + return false; + } + return callbacks.delete(cb); +} + +sub("error", err => { + console.error(err, err.stack); +}); + +sub("warn", str => { + console.warn(str); +}); + +expose(name, { sub }); + +// @ts-check + +const userConfig = {}; +const amendConfig = newValues => Object.assign(userConfig, newValues); +const removeList = ["githubToken", "githubUser"]; + +sub("start-all", amendConfig); +sub("amend-user-config", amendConfig); +sub("end-all", () => { + const script = document.createElement("script"); + script.id = "initialUserConfig"; + script.type = "application/json"; + for (const prop of removeList) { + if (prop in userConfig) delete userConfig[prop]; + } + script.innerHTML = JSON.stringify(userConfig, null, 2); + document.head.appendChild(script); +}); + +// @ts-check + +function overrideConfig(config) { + // For legacy reasons, we still support both ";" and "&" + const searchQuery = document.location.search.replace(/;/g, "&"); + const params = new URLSearchParams(searchQuery); + const overrideProps = Array.from(params) + .filter(([key, value]) => !!key && !!value) + .map(([codedKey, codedValue]) => { + const key = decodeURIComponent(codedKey); + const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, "=")); + let value; + try { + value = JSON.parse(decodedValue); + } catch { + value = decodedValue; + } + return { key, value }; + }) + .reduce((collector, { key, value }) => { + collector[key] = value; + return collector; + }, {}); + Object.assign(config, overrideProps); + pub("amend-user-config", overrideProps); +} +sub("start-all", overrideConfig, { once: true }); + +// @ts-check + +/** @type {Promise} */ +const respecDonePromise = new Promise(resolve => { + sub("end-all", resolve, { once: true }); +}); + +Object.defineProperty(document, "respecIsReady", { + get() { + return respecDonePromise; + }, +}); + +// @ts-check + +let doneResolver; +const done = new Promise(resolve => { + doneResolver = resolve; +}); + +sub( + "plugins-done", + async config => { + const result = []; + if (Array.isArray(config.postProcess)) { + const promises = config.postProcess + .filter(f => { + const isFunction = typeof f === "function"; + if (!isFunction) { + pub("error", "Every item in `postProcess` must be a JS function."); + } + return isFunction; + }) + .map(async f => { + try { + return await f(config, document); + } catch (err) { + pub( + "error", + `Function ${f.name} threw an error during \`postProcess\`. See developer console.` + ); + console.error(err); + } + }); + const values = await Promise.all(promises); + result.push(...values); + } + if (typeof config.afterEnd === "function") { + result.push(await config.afterEnd(config, document)); + } + doneResolver(result); + }, + { once: true } +); + +// @ts-check + +let doneResolver$1; +const done$1 = new Promise(resolve => { + doneResolver$1 = resolve; +}); + +sub( + "start-all", + async config => { + const result = []; + if (Array.isArray(config.preProcess)) { + const promises = config.preProcess + .filter(f => { + const isFunction = typeof f === "function"; + if (!isFunction) { + pub("error", "Every item in `preProcess` must be a JS function."); + } + return isFunction; + }) + .map(async f => { + try { + return await f(config, document); + } catch (err) { + pub( + "error", + `Function ${f.name} threw an error during \`preProcess\`. See developer console.` + ); + console.error(err); + } + }); + const values = await Promise.all(promises); + result.push(...values); + } + doneResolver$1(result); + }, + { once: true } +); + +// @ts-check +/** + * Module core/l10n + * + * Looks at the lang attribute on the root element and uses it + * to manage the config.l10n object so that other parts of the system can + * localize their text. + */ +const name$1 = "core/l10n"; + +const html = document.documentElement; +if (html && !html.hasAttribute("lang")) { + html.lang = "en"; + if (!html.hasAttribute("dir")) { + html.dir = "ltr"; + } +} + +// We use en-US as the base +const base = { + about_respec: "About", + abstract: "Abstract", + author: "Author:", + authors: "Authors:", + bug_tracker: "Bug tracker:", + close_parens: ")", + definition_list: "Definitions", + editor: "Editor:", + editors_note: "Editor's note", + editors: "Editors:", + feature_at_risk: "(Feature at Risk) Issue", + former_editor: "Former editor:", + former_editors: "Former editors:", + info_references: "Informative references", + issue_summary: "Issue Summary", + issue: "Issue", + latest_editors_draft: "Latest editor's draft:", + latest_published_version: "Latest published version:", + list_of_definitions: "List of Definitions", + norm_references: "Normative references", + note: "Note", + open_bugs: "open bugs", + open_parens: "(", + participate: "Participate", + references: "References", + save_as: "Save as", + save_snapshot: "Export", + search_specref: "Search Specref", + sotd: "Status of This Document", + this_version: "This version:", + toc: "Table of Contents", + warning: "Warning", +}; + +const ko = { + abstract: "요약", + author: "저자:", + authors: "저자:", + latest_published_version: "최신 버전:", + sotd: "현재 문서의 상태", + this_version: "현재 버전:", +}; + +const zh = { + about_respec: "关于", + abstract: "摘要", + bug_tracker: "错误跟踪:", + editor: "编辑:", + editors: "编辑:", + file_a_bug: "反馈错误", + former_editor: "原编辑:", + former_editors: "原编辑:", + latest_editors_draft: "最新编辑草稿:", + latest_published_version: "最新发布版本:", + note: "注", + open_bugs: "修正中的错误", + participate: "参与:", + sotd: "关于本文档", + this_version: "本版本:", + toc: "内容大纲", +}; + +const ja = { + abstract: "要約", + author: "著者:", + authors: "著者:", + bug_tracker: "バグの追跡履歴:", + editor: "編者:", + editors: "編者:", + file_a_bug: "問題報告", + former_editor: "以前の版の編者:", + former_editors: "以前の版の編者:", + latest_editors_draft: "最新の編集用草案:", + latest_published_version: "最新バージョン:", + note: "注", + open_bugs: "改修されていないバグ", + participate: "参加方法:", + sotd: "この文書の位置付け", + this_version: "このバージョン:", + toc: "目次", +}; + +const nl = { + about_respec: "Over", + abstract: "Samenvatting", + author: "Auteur:", + authors: "Auteurs:", + bug_tracker: "Meldingensysteem:", + definition_list: "Lijst van Definities", + editor: "Redacteur:", + editors_note: "Redactionele noot", + editors: "Redacteurs:", + file_a_bug: "Dien een melding in", + info_references: "Informatieve referenties", + issue_summary: "Lijst met issues", + latest_editors_draft: "Laatste werkversie:", + latest_published_version: "Laatst gepubliceerde versie:", + list_of_definitions: "Lijst van Definities", + norm_references: "Normatieve referenties", + note: "Noot", + open_bugs: "open meldingen", + participate: "Doe mee", + references: "Referenties", + save_as: "Bewaar als", + save_snapshot: "Bewaar Snapshot", + search_specref: "Doorzoek Specref", + sotd: "Status van dit document", + this_version: "Deze versie:", + toc: "Inhoudsopgave", + warning: "Waarschuwing", +}; + +const es = { + abstract: "Resumen", + author: "Autor:", + authors: "Autores:", + bug_tracker: "Repositorio de bugs:", + close_parens: ")", + editor: "Editor:", + editors_note: "Nota de editor", + editors: "Editores:", + file_a_bug: "Nota un bug", + info_references: "Referencias informativas", + issue_summary: "Resumen de la cuestión", + issue: "Cuestión", + latest_editors_draft: "Borrador de editor mas reciente:", + latest_published_version: "Versión publicada mas reciente:", + norm_references: "Referencias normativas", + note: "Nota", + open_bugs: "Bugs abiertos", + open_parens: "(", + participate: "Participad", + references: "Referencias", + sotd: "Estado de este Document", + this_version: "Ésta versión:", + toc: "Tabla de Contenidos", + warning: "Aviso", +}; + +const l10n = { + en: { ...base }, + ko: { ...base, ...ko }, + zh: { ...base, ...zh }, + ja: { ...base, ...ja }, + nl: { ...base, ...nl }, + es: { ...base, ...es }, +}; + +l10n["zh-hans"] = l10n.zh; +l10n["zh-cn"] = l10n.zh; + +const lang = html && html.lang in l10n ? html.lang : "en"; + +function run(config) { + config.l10n = l10n[lang] || l10n.en; +} + +var l10n$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$1, + l10n: l10n, + lang: lang, + run: run +}); + +// @ts-check +const dashes = /-/g; + +const ISODate = new Intl.DateTimeFormat(["en-ca-iso8601"], { + timeZone: "UTC", + year: "numeric", + month: "2-digit", + day: "2-digit", +}); + +const resourceHints = new Set([ + "dns-prefetch", + "preconnect", + "preload", + "prerender", +]); + +const fetchDestinations = new Set([ + "document", + "embed", + "font", + "image", + "manifest", + "media", + "object", + "report", + "script", + "serviceworker", + "sharedworker", + "style", + "worker", + "xslt", + "", +]); + +// CSS selector for matching elements that are non-normative +const nonNormativeSelector = + ".informative, .note, .issue, .example, .ednote, .practice, .introductory"; +/** + * Creates a link element that represents a resource hint. + * + * @param {Object} opts Configure the resource hint. + * @param {String} opts.hint The type of hint (see resourceHints). + * @param {String} opts.href The URL for the resource or origin. + * @param {String} [opts.corsMode] Optional, the CORS mode to use (see HTML spec). + * @param {String} [opts.as] Optional, fetch destination type (see fetchDestinations). + * @param {boolean} [opts.dontRemove] If the hint should remain in the spec after processing. + * @return {HTMLLinkElement} A link element ready to use. + */ +function createResourceHint(opts) { + if (!opts || typeof opts !== "object") { + throw new TypeError("Missing options"); + } + if (!resourceHints.has(opts.hint)) { + throw new TypeError("Invalid resources hint"); + } + const url = new URL(opts.href, location.href); + const linkElem = document.createElement("link"); + let { href } = url; + linkElem.rel = opts.hint; + switch (linkElem.rel) { + case "dns-prefetch": + case "preconnect": + href = url.origin; + if (opts.corsMode || url.origin !== document.location.origin) { + linkElem.crossOrigin = opts.corsMode || "anonymous"; + } + break; + case "preload": + if ("as" in opts && typeof opts.as === "string") { + if (!fetchDestinations.has(opts.as)) { + console.warn(`Unknown request destination: ${opts.as}`); + } + linkElem.setAttribute("as", opts.as); + } + break; + } + linkElem.href = href; + if (!opts.dontRemove) { + linkElem.classList.add("removeOnSave"); + } + return linkElem; +} + +// RESPEC STUFF +function removeReSpec(doc) { + doc.querySelectorAll(".remove, script[data-requiremodule]").forEach(elem => { + elem.remove(); + }); +} + +/** + * Adds error class to each element while emitting a warning + * @param {HTMLElement|HTMLElement[]} elems + * @param {String} msg message to show in warning + * @param {String=} title error message to add on each element + */ +function showInlineWarning(elems, msg, title) { + if (!Array.isArray(elems)) elems = [elems]; + const links = elems + .map((element, i) => { + markAsOffending(element, msg, title); + return generateMarkdownLink(element, i); + }) + .join(", "); + pub("warn", `${msg} at: ${links}.`); + console.warn(msg, elems); +} + +/** + * Adds error class to each element while emitting a warning + * @param {HTMLElement|HTMLElement[]} elems + * @param {String} msg message to show in warning + * @param {String} title error message to add on each element + * @param {object} [options] + * @param {string} [options.details] + */ +function showInlineError(elems, msg, title, { details } = {}) { + if (!Array.isArray(elems)) elems = [elems]; + const links = elems + .map((element, i) => { + markAsOffending(element, msg, title); + return generateMarkdownLink(element, i); + }) + .join(", "); + let message = `${msg} at: ${links}.`; + if (details) { + message += `\n\n
    ${details}
    `; + } + pub("error", message); + console.error(msg, elems); +} + +/** + * Adds error class to each element while emitting a warning + * @param {HTMLElement} elem + * @param {String} msg message to show in warning + * @param {String=} title error message to add on each element + */ +function markAsOffending(elem, msg, title) { + elem.classList.add("respec-offending-element"); + if (!elem.hasAttribute("title")) { + elem.setAttribute("title", title || msg); + } + if (!elem.id) { + addId(elem, "respec-offender"); + } +} + +/** + * @param {Element} element + * @param {number} i + */ +function generateMarkdownLink(element, i) { + return `[${i + 1}](#${element.id})`; +} + +class IDBKeyVal { + /** + * @param {import("idb").IDBPDatabase} idb + * @param {string} storeName + */ + constructor(idb, storeName) { + this.idb = idb; + this.storeName = storeName; + } + + /** @param {string} key */ + async get(key) { + return await this.idb + .transaction(this.storeName) + .objectStore(this.storeName) + .get(key); + } + + /** + * @param {string[]} keys + */ + async getMany(keys) { + const keySet = new Set(keys); + /** @type {Map} */ + const results = new Map(); + let cursor = await this.idb.transaction(this.storeName).store.openCursor(); + while (cursor) { + if (keySet.has(cursor.key)) { + results.set(cursor.key, cursor.value); + } + cursor = await cursor.continue(); + } + return results; + } + + /** + * @param {string} key + * @param {any} value + */ + async set(key, value) { + const tx = this.idb.transaction(this.storeName, "readwrite"); + tx.objectStore(this.storeName).put(value, key); + return await tx.done; + } + + async addMany(entries) { + const tx = this.idb.transaction(this.storeName, "readwrite"); + for (const [key, value] of entries) { + tx.objectStore(this.storeName).put(value, key); + } + return await tx.done; + } + + async clear() { + const tx = this.idb.transaction(this.storeName, "readwrite"); + tx.objectStore(this.storeName).clear(); + return await tx.done; + } + + async keys() { + const tx = this.idb.transaction(this.storeName); + /** @type {Promise} */ + const keys = tx.objectStore(this.storeName).getAllKeys(); + await tx.done; + return keys; + } +} + +// STRING HELPERS +// Takes an array and returns a string that separates each of its items with the proper commas and +// "and". The second argument is a mapping function that can convert the items before they are +// joined +function joinAnd(array = [], mapper = item => item, lang$1 = lang) { + const items = array.map(mapper); + if (Intl.ListFormat && typeof Intl.ListFormat === "function") { + const formatter = new Intl.ListFormat(lang$1, { + style: "long", + type: "conjunction", + }); + return formatter.format(items); + } + switch (items.length) { + case 0: + case 1: // "x" + return items.toString(); + case 2: // x and y + return items.join(" and "); + default: { + // x, y, and z + const str = items.join(", "); + const lastComma = str.lastIndexOf(","); + return `${str.substr(0, lastComma + 1)} and ${str.slice(lastComma + 2)}`; + } + } +} + +// Takes a string, applies some XML escapes, and returns the escaped string. +// Note that overall using either Handlebars' escaped output or jQuery is much +// preferred to operating on strings directly. +function xmlEscape(s) { + return s + .replace(/&/g, "&") + .replace(/>/g, ">") + .replace(/"/g, """) + .replace(/ `${key}${separator}${JSON.stringify(value)}`) + .join(delimiter); +} + +// STYLE HELPERS +// take a document and either a link or an array of links to CSS and appends +// a element to the head pointing to each +function linkCSS(doc, styles) { + const stylesArray = [].concat(styles); + const frag = stylesArray + .map(url => { + const link = doc.createElement("link"); + link.rel = "stylesheet"; + link.href = url; + return link; + }) + .reduce((elem, nextLink) => { + elem.appendChild(nextLink); + return elem; + }, doc.createDocumentFragment()); + doc.head.appendChild(frag); +} + +// TRANSFORMATIONS +// Run list of transforms over content and return result. +// Please note that this is a legacy method that is only kept in order +// to maintain compatibility +// with RSv1. It is therefore not tested and not actively supported. +/** + * @this {any} + * @param {string} [flist] + */ +function runTransforms(content, flist) { + let args = [this, content]; + const funcArgs = Array.from(arguments); + funcArgs.shift(); + funcArgs.shift(); + args = args.concat(funcArgs); + if (flist) { + const methods = flist.split(/\s+/); + for (let j = 0; j < methods.length; j++) { + const meth = methods[j]; + /** @type {any} */ + const method = window[meth]; + if (method) { + // the initial call passed |this| directly, so we keep it that way + try { + content = method.apply(this, args); + } catch (e) { + pub( + "warn", + `call to \`${meth}()\` failed with: ${e}. See error console for stack trace.` + ); + console.error(e); + } + } + } + } + return content; +} + +/** + * Cached request handler + * @param {RequestInfo} input + * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours (86400000 ms) + * @return {Promise} + * if a cached response is available and it's not stale, return it + * else: request from network, cache and return fresh response. + * If network fails, return a stale cached version if exists (else throw) + */ +async function fetchAndCache(input, maxAge = 86400000) { + const request = new Request(input); + const url = new URL(request.url); + + // use data from cache data if valid and render + let cache; + let cachedResponse; + if ("caches" in window) { + try { + cache = await caches.open(url.origin); + cachedResponse = await cache.match(request); + if ( + cachedResponse && + new Date(cachedResponse.headers.get("Expires")) > new Date() + ) { + return cachedResponse; + } + } catch (err) { + console.error("Failed to use Cache API.", err); + } + } + + // otherwise fetch new data and cache + const response = await fetch(request); + if (!response.ok) { + if (cachedResponse) { + // return stale version + console.warn(`Returning a stale cached response for ${url}`); + return cachedResponse; + } + } + + // cache response + if (cache && response.ok) { + const clonedResponse = response.clone(); + const customHeaders = new Headers(response.headers); + const expiryDate = new Date(Date.now() + maxAge); + customHeaders.set("Expires", expiryDate.toString()); + const cacheResponse = new Response(await clonedResponse.blob(), { + headers: customHeaders, + }); + // put in cache, and forget it (there is no recovery if it throws, but that's ok). + await cache.put(request, cacheResponse).catch(console.error); + } + return response; +} + +// --- COLLECTION/ITERABLE HELPERS --------------- +/** + * Spreads one iterable into another. + * + * @param {Array} collector + * @param {any|Array} item + * @returns {Array} + */ +function flatten(collector, item) { + const items = !Array.isArray(item) + ? [item] + : item.slice().reduce(flatten, []); + collector.push(...items); + return collector; +} + +// --- DOM HELPERS ------------------------------- + +/** + * Creates and sets an ID to an element (elem) + * using a specific prefix if provided, and a specific text if given. + * @param {HTMLElement} elem element + * @param {String} pfx prefix + * @param {String} txt text + * @param {Boolean} noLC do not convert to lowercase + * @returns {String} generated (or existing) id for element + */ +function addId(elem, pfx = "", txt = "", noLC = false) { + if (elem.id) { + return elem.id; + } + if (!txt) { + txt = (elem.title ? elem.title : elem.textContent).trim(); + } + let id = noLC ? txt : txt.toLowerCase(); + id = id + .trim() + .normalize("NFD") + .replace(/[\u0300-\u036f]/g, "") + .replace(/\W+/gim, "-") + .replace(/^-+/, "") + .replace(/-+$/, ""); + + if (!id) { + id = "generatedID"; + } else if (pfx === "example") { + id = txt; + } else if (/\.$/.test(id) || !/^[a-z]/i.test(id)) { + id = `x${id}`; // trailing . doesn't play well with jQuery + } + if (pfx) { + id = `${pfx}-${id}`; + } + if (elem.ownerDocument.getElementById(id)) { + let i = 0; + let nextId = `${id}-${i}`; + while (elem.ownerDocument.getElementById(nextId)) { + i += 1; + nextId = `${id}-${i}`; + } + id = nextId; + } + elem.id = id; + return id; +} + +/** + * Returns all the descendant text nodes of an element. + * @param {Node} el + * @param {string[]} exclusions node localName to exclude + * @param {object} options + * @param {boolean} options.wsNodes if nodes that only have whitespace are returned. + * @returns {Text[]} + */ +function getTextNodes(el, exclusions = [], options = { wsNodes: true }) { + const exclusionQuery = exclusions.join(", "); + const acceptNode = (/** @type {Text} */ node) => { + if (!options.wsNodes && !node.data.trim()) { + return NodeFilter.FILTER_REJECT; + } + if (exclusionQuery && node.parentElement.closest(exclusionQuery)) { + return NodeFilter.FILTER_REJECT; + } + return NodeFilter.FILTER_ACCEPT; + }; + const nodeIterator = document.createNodeIterator( + el, + NodeFilter.SHOW_TEXT, + acceptNode + ); + /** @type {Text[]} */ + const textNodes = []; + let node; + while ((node = nodeIterator.nextNode())) { + textNodes.push(/** @type {Text} */ (node)); + } + return textNodes; +} + +/** + * For any element, returns an array of title strings that applies + * the algorithm used for determining the actual title of a + * element (but can apply to other as well). + * if args.isDefinition is true, then the element is a definition, not a + * reference to a definition. Any @title will be replaced with + * @data-lt to be consistent with Bikeshed / Shepherd. + * This method now *prefers* the data-lt attribute for the list of + * titles. That attribute is added by this method to dfn elements, so + * subsequent calls to this method will return the data-lt based list. + * @param {HTMLElement} elem + * @returns {String[]} array of title strings + */ +function getDfnTitles(elem) { + const titleSet = new Set(); + // data-lt-noDefault avoid using the text content of a definition + // in the definition list. + // ltNodefault is === "data-lt-noDefault"... someone screwed up 😖 + const normText = "ltNodefault" in elem.dataset ? "" : norm(elem.textContent); + const child = /** @type {HTMLElement | undefined} */ (elem.children[0]); + if (elem.dataset.lt) { + // prefer @data-lt for the list of title aliases + elem.dataset.lt + .split("|") + .map(item => norm(item)) + .forEach(item => titleSet.add(item)); + } else if ( + elem.childNodes.length === 1 && + elem.getElementsByTagName("abbr").length === 1 && + child.title + ) { + titleSet.add(child.title); + } else if (elem.textContent === '""') { + titleSet.add("the-empty-string"); + } + + titleSet.add(normText); + titleSet.delete(""); + const titles = [...titleSet]; + return titles; +} + +/** + * For an element (usually ), returns an array of targets that + * element might refer to, of the form + * @typedef {object} LinkTarget + * @property {string} for + * @property {string} title + * + * For an element like: + *

    Int3.member

    + * we'll return: + * * {for: "int2", title: "int3.member"} + * * {for: "int3", title: "member"} + * * {for: "", title: "int3.member"} + * @param {HTMLElement} elem + * @returns {LinkTarget[]} + */ +function getLinkTargets(elem) { + /** @type {HTMLElement} */ + const linkForElem = elem.closest("[data-link-for]"); + const linkFor = linkForElem ? linkForElem.dataset.linkFor : ""; + const titles = getDfnTitles(elem); + const results = titles.reduce((result, title) => { + // supports legacy Foo.Bar() definitions + const split = title.split("."); + if (split.length === 2) { + // If there are multiple '.'s, this won't match an + // Interface/member pair anyway. + result.push({ for: split[0], title: split[1] }); + } + result.push({ for: linkFor, title }); + + // Finally, we can try to match without link for + if (linkFor !== "") result.push({ for: "", title }); + return result; + }, []); + return results; +} + +/** + * Changes name of a DOM Element + * @param {Element} elem element to rename + * @param {String} newName new element name + * @returns {Element} new renamed element + */ +function renameElement(elem, newName) { + if (elem.localName === newName) return elem; + const newElement = elem.ownerDocument.createElement(newName); + // copy attributes + for (const { name, value } of elem.attributes) { + newElement.setAttribute(name, value); + } + // copy child nodes + newElement.append(...elem.childNodes); + elem.replaceWith(newElement); + return newElement; +} + +function refTypeFromContext(ref, element) { + const closestInformative = element.closest(nonNormativeSelector); + let isInformative = false; + if (closestInformative) { + // check if parent is not normative + isInformative = + !element.closest(".normative") || + !closestInformative.querySelector(".normative"); + } + // prefixes `!` and `?` override section behavior + if (ref.startsWith("!")) { + if (isInformative) { + // A (forced) normative reference in informative section is illegal + return { type: "informative", illegal: true }; + } + isInformative = false; + } else if (ref.startsWith("?")) { + isInformative = true; + } + const type = isInformative ? "informative" : "normative"; + return { type, illegal: false }; +} + +/** + * Wraps inner contents with the wrapper node + * @param {Node} outer outer node to be modified + * @param {Element} wrapper wrapper node to be appended + */ +function wrapInner(outer, wrapper) { + wrapper.append(...outer.childNodes); + outer.appendChild(wrapper); + return outer; +} + +/** + * Applies the selector for all its ancestors. + * @param {Element} element + * @param {string} selector + */ +function parents(element, selector) { + /** @type {Element[]} */ + const list = []; + let parent = element.parentElement; + while (parent) { + const closest = parent.closest(selector); + if (!closest) { + break; + } + list.push(closest); + parent = closest.parentElement; + } + return list; +} + +/** + * Applies the selector for direct descendants. + * This is a helper function for browsers without :scope support. + * Note that this doesn't support comma separated selectors. + * @param {Element} element + * @param {string} selector + * @returns {NodeListOf} + */ +function children(element, selector) { + try { + return element.querySelectorAll(`:scope > ${selector}`); + } catch { + let tempId = ""; + // We give a temporary id, to overcome lack of ":scope" support in Edge. + if (!element.id) { + tempId = `temp-${String(Math.random()).substr(2)}`; + element.id = tempId; + } + const query = `#${element.id} > ${selector}`; + /** @type {NodeListOf} */ + const elements = element.parentElement.querySelectorAll(query); + if (tempId) { + element.id = ""; + } + return elements; + } +} + +/** + * Generates simple ids. The id's increment after it yields. + * + * @param {String} namespace A string like "highlight". + * @param {number} counter A number, which can start at a given value. + */ +function msgIdGenerator(namespace, counter = 0) { + function* idGenerator(namespace, counter) { + while (true) { + yield `${namespace}:${counter}`; + counter++; + } + } + const gen = idGenerator(namespace, counter); + return () => { + return gen.next().value; + }; +} + +class InsensitiveStringSet extends Set { + /** + * @param {Array} [keys] Optional, initial keys + */ + constructor(keys = []) { + super(); + for (const key of keys) { + this.add(key); + } + } + /** + * @param {string} key + */ + add(key) { + if (!this.has(key) && !this.getCanonicalKey(key)) { + return super.add(key); + } + return this; + } + /** + * @param {string} key + */ + has(key) { + return ( + super.has(key) || + [...this.keys()].some( + existingKey => existingKey.toLowerCase() === key.toLowerCase() + ) + ); + } + /** + * @param {string} key + */ + delete(key) { + return super.has(key) + ? super.delete(key) + : super.delete(this.getCanonicalKey(key)); + } + /** + * @param {string} key + */ + getCanonicalKey(key) { + return super.has(key) + ? key + : [...this.keys()].find( + existingKey => existingKey.toLowerCase() === key.toLowerCase() + ); + } +} + +function makeSafeCopy(node) { + const clone = node.cloneNode(true); + clone.querySelectorAll("[id]").forEach(elem => elem.removeAttribute("id")); + clone.querySelectorAll("dfn").forEach(dfn => renameElement(dfn, "span")); + if (clone.hasAttribute("id")) clone.removeAttribute("id"); + removeCommentNodes(clone); + return clone; +} + +function removeCommentNodes(node) { + const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT); + for (const comment of [...walkTree(walker)]) { + comment.remove(); + } +} + +/** + * @template {Node} T + * @param {TreeWalker} walker + * @return {IterableIterator} + */ +function* walkTree(walker) { + while (walker.nextNode()) { + yield /** @type {T} */ (walker.currentNode); + } +} + +// @ts-check + +const name$2 = "core/base-runner"; +const canMeasure = performance.mark && performance.measure; + +function toRunnable(plug) { + const name = plug.name || ""; + if (!name) { + console.warn("Plugin lacks name:", plug); + } + return config => { + // eslint-disable-next-line no-async-promise-executor + return new Promise(async (resolve, reject) => { + const timerId = setTimeout(() => { + const msg = `Plugin ${name} took too long.`; + console.error(msg, plug); + reject(new Error(msg)); + }, 15000); + if (canMeasure) { + performance.mark(`${name}-start`); + } + try { + if (plug.run.length <= 1) { + await plug.run(config); + resolve(); + } else { + console.warn( + `Plugin ${name} uses a deprecated callback signature. Return a Promise instead. Read more at: https://github.com/w3c/respec/wiki/Developers-Guide#plugins` + ); + plug.run(config, document, resolve); + } + } catch (err) { + reject(err); + } finally { + clearTimeout(timerId); + } + if (canMeasure) { + performance.mark(`${name}-end`); + performance.measure(name, `${name}-start`, `${name}-end`); + } + }); + }; +} + +async function runAll(plugs) { + pub("start-all", respecConfig); + if (canMeasure) { + performance.mark(`${name$2}-start`); + } + await done$1; + const runnables = plugs.filter(plug => plug && plug.run).map(toRunnable); + for (const task of runnables) { + try { + await task(respecConfig); + } catch (err) { + console.error(err); + } + } + pub("plugins-done", respecConfig); + await done; + pub("end-all", respecConfig); + removeReSpec(document); + if (canMeasure) { + performance.mark(`${name$2}-end`); + performance.measure(name$2, `${name$2}-start`, `${name$2}-end`); + } +} + +var baseRunner = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$2, + runAll: runAll +}); + +/** + * @param {string} path + */ +async function fetchBase(path) { + const response = await fetch(new URL(`../../${path}`, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('respec-w3c.js', document.baseURI).href)))); + return await response.text(); +} + +/** + * @param {string} fileName + */ +async function fetchAsset(fileName) { + return fetchBase(`assets/${fileName}`); +} + +const instanceOfAny = (object, constructors) => constructors.some(c => object instanceof c); + +let idbProxyableTypes; +let cursorAdvanceMethods; +// This is a function to prevent it throwing up in node environments. +function getIdbProxyableTypes() { + return (idbProxyableTypes || + (idbProxyableTypes = [ + IDBDatabase, + IDBObjectStore, + IDBIndex, + IDBCursor, + IDBTransaction, + ])); +} +// This is a function to prevent it throwing up in node environments. +function getCursorAdvanceMethods() { + return (cursorAdvanceMethods || + (cursorAdvanceMethods = [ + IDBCursor.prototype.advance, + IDBCursor.prototype.continue, + IDBCursor.prototype.continuePrimaryKey, + ])); +} +const cursorRequestMap = new WeakMap(); +const transactionDoneMap = new WeakMap(); +const transactionStoreNamesMap = new WeakMap(); +const transformCache = new WeakMap(); +const reverseTransformCache = new WeakMap(); +function promisifyRequest(request) { + const promise = new Promise((resolve, reject) => { + const unlisten = () => { + request.removeEventListener('success', success); + request.removeEventListener('error', error); + }; + const success = () => { + resolve(wrap(request.result)); + unlisten(); + }; + const error = () => { + reject(request.error); + unlisten(); + }; + request.addEventListener('success', success); + request.addEventListener('error', error); + }); + promise + .then(value => { + // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval + // (see wrapFunction). + if (value instanceof IDBCursor) { + cursorRequestMap.set(value, request); + } + // Catching to avoid "Uncaught Promise exceptions" + }) + .catch(() => { }); + // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This + // is because we create many promises from a single IDBRequest. + reverseTransformCache.set(promise, request); + return promise; +} +function cacheDonePromiseForTransaction(tx) { + // Early bail if we've already created a done promise for this transaction. + if (transactionDoneMap.has(tx)) + return; + const done = new Promise((resolve, reject) => { + const unlisten = () => { + tx.removeEventListener('complete', complete); + tx.removeEventListener('error', error); + tx.removeEventListener('abort', error); + }; + const complete = () => { + resolve(); + unlisten(); + }; + const error = () => { + reject(tx.error); + unlisten(); + }; + tx.addEventListener('complete', complete); + tx.addEventListener('error', error); + tx.addEventListener('abort', error); + }); + // Cache it for later retrieval. + transactionDoneMap.set(tx, done); +} +let idbProxyTraps = { + get(target, prop, receiver) { + if (target instanceof IDBTransaction) { + // Special handling for transaction.done. + if (prop === 'done') + return transactionDoneMap.get(target); + // Polyfill for objectStoreNames because of Edge. + if (prop === 'objectStoreNames') { + return target.objectStoreNames || transactionStoreNamesMap.get(target); + } + // Make tx.store return the only store in the transaction, or undefined if there are many. + if (prop === 'store') { + return receiver.objectStoreNames[1] + ? undefined + : receiver.objectStore(receiver.objectStoreNames[0]); + } + } + // Else transform whatever we get back. + return wrap(target[prop]); + }, + has(target, prop) { + if (target instanceof IDBTransaction && + (prop === 'done' || prop === 'store')) { + return true; + } + return prop in target; + }, +}; +function addTraps(callback) { + idbProxyTraps = callback(idbProxyTraps); +} +function wrapFunction(func) { + // Due to expected object equality (which is enforced by the caching in `wrap`), we + // only create one new func per func. + // Edge doesn't support objectStoreNames (booo), so we polyfill it here. + if (func === IDBDatabase.prototype.transaction && + !('objectStoreNames' in IDBTransaction.prototype)) { + return function (storeNames, ...args) { + const tx = func.call(unwrap(this), storeNames, ...args); + transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]); + return wrap(tx); + }; + } + // Cursor methods are special, as the behaviour is a little more different to standard IDB. In + // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the + // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense + // with real promises, so each advance methods returns a new promise for the cursor object, or + // undefined if the end of the cursor has been reached. + if (getCursorAdvanceMethods().includes(func)) { + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + func.apply(unwrap(this), args); + return wrap(cursorRequestMap.get(this)); + }; + } + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + return wrap(func.apply(unwrap(this), args)); + }; +} +function transformCachableValue(value) { + if (typeof value === 'function') + return wrapFunction(value); + // This doesn't return, it just creates a 'done' promise for the transaction, + // which is later returned for transaction.done (see idbObjectHandler). + if (value instanceof IDBTransaction) + cacheDonePromiseForTransaction(value); + if (instanceOfAny(value, getIdbProxyableTypes())) + return new Proxy(value, idbProxyTraps); + // Return the same value back if we're not going to transform it. + return value; +} +function wrap(value) { + // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because + // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached. + if (value instanceof IDBRequest) + return promisifyRequest(value); + // If we've already transformed this value before, reuse the transformed value. + // This is faster, but it also provides object equality. + if (transformCache.has(value)) + return transformCache.get(value); + const newValue = transformCachableValue(value); + // Not all types are transformed. + // These may be primitive types, so they can't be WeakMap keys. + if (newValue !== value) { + transformCache.set(value, newValue); + reverseTransformCache.set(newValue, value); + } + return newValue; +} +const unwrap = (value) => reverseTransformCache.get(value); + +/** + * Open a database. + * + * @param name Name of the database. + * @param version Schema version. + * @param callbacks Additional callbacks. + */ +function openDB(name, version, { blocked, upgrade, blocking } = {}) { + const request = indexedDB.open(name, version); + const openPromise = wrap(request); + if (upgrade) { + request.addEventListener('upgradeneeded', event => { + upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction)); + }); + } + if (blocked) + request.addEventListener('blocked', () => blocked()); + if (blocking) { + openPromise.then(db => db.addEventListener('versionchange', blocking)).catch(() => { }); + } + return openPromise; +} +/** + * Delete a database. + * + * @param name Name of the database. + */ +function deleteDB(name, { blocked } = {}) { + const request = indexedDB.deleteDatabase(name); + if (blocked) + request.addEventListener('blocked', () => blocked()); + return wrap(request).then(() => undefined); +} + +const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count']; +const writeMethods = ['put', 'add', 'delete', 'clear']; +const cachedMethods = new Map(); +function getMethod(target, prop) { + if (!(target instanceof IDBDatabase && + !(prop in target) && + typeof prop === 'string')) { + return; + } + if (cachedMethods.get(prop)) + return cachedMethods.get(prop); + const targetFuncName = prop.replace(/FromIndex$/, ''); + const useIndex = prop !== targetFuncName; + const isWrite = writeMethods.includes(targetFuncName); + if ( + // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge. + !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || + !(isWrite || readMethods.includes(targetFuncName))) { + return; + } + const method = async function (storeName, ...args) { + // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :( + const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly'); + let target = tx.store; + if (useIndex) + target = target.index(args.shift()); + const returnVal = target[targetFuncName](...args); + if (isWrite) + await tx.done; + return returnVal; + }; + cachedMethods.set(prop, method); + return method; +} +addTraps(oldTraps => ({ + get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver), + has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop), +})); + +var _idb = /*#__PURE__*/Object.freeze({ + __proto__: null, + openDB: openDB, + deleteDB: deleteDB, + unwrap: unwrap, + wrap: wrap +}); + +/** + * @param {string} text + */ +function lastLine(text) { + const splitted = text.split("\n"); + return splitted[splitted.length - 1]; +} + +/** + * @typedef {object} WebIDL2ErrorOptions + * @property {"error" | "warning"} [level] + * @property {Function} [autofix] + * + * @param {string} message error message + * @param {"Syntax" | "Validation"} kind error type + * @param {WebIDL2ErrorOptions} [options] + */ +function error(source, position, current, message, kind, { level = "error", autofix, ruleName } = {}) { + /** + * @param {number} count + */ + function sliceTokens(count) { + return count > 0 ? + source.slice(position, position + count) : + source.slice(Math.max(position + count, 0), position); + } + + function tokensToText(inputs, { precedes } = {}) { + const text = inputs.map(t => t.trivia + t.value).join(""); + const nextToken = source[position]; + if (nextToken.type === "eof") { + return text; + } + if (precedes) { + return text + nextToken.trivia; + } + return text.slice(nextToken.trivia.length); + } + + const maxTokens = 5; // arbitrary but works well enough + const line = + source[position].type !== "eof" ? source[position].line : + source.length > 1 ? source[position - 1].line : + 1; + + const precedingLastLine = lastLine( + tokensToText(sliceTokens(-maxTokens), { precedes: true }) + ); + + const subsequentTokens = sliceTokens(maxTokens); + const subsequentText = tokensToText(subsequentTokens); + const subsequentFirstLine = subsequentText.split("\n")[0]; + + const spaced = " ".repeat(precedingLastLine.length) + "^"; + const sourceContext = precedingLastLine + subsequentFirstLine + "\n" + spaced; + + const contextType = kind === "Syntax" ? "since" : "inside"; + const inSourceName = source.name ? ` in ${source.name}` : ""; + const grammaticalContext = (current && current.name) ? `, ${contextType} \`${current.partial ? "partial " : ""}${current.type} ${current.name}\`` : ""; + const context = `${kind} error at line ${line}${inSourceName}${grammaticalContext}:\n${sourceContext}`; + return { + message: `${context} ${message}`, + bareMessage: message, + context, + line, + sourceName: source.name, + level, + ruleName, + autofix, + input: subsequentText, + tokens: subsequentTokens + }; +} + +/** + * @param {string} message error message + */ +function syntaxError(source, position, current, message) { + return error(source, position, current, message, "Syntax"); +} + +/** + * @param {string} message error message + * @param {WebIDL2ErrorOptions} [options] + */ +function validationError(token, current, ruleName, message, options = {}) { + options.ruleName = ruleName; + return error(current.source, token.index, current, message, "Validation", options); +} + +// @ts-check + +class Base { + /** + * @param {object} initializer + * @param {Base["source"]} initializer.source + * @param {Base["tokens"]} initializer.tokens + */ + constructor({ source, tokens }) { + Object.defineProperties(this, { + source: { value: source }, + tokens: { value: tokens }, + parent: { value: null, writable: true }, + this: { value: this } // useful when escaping from proxy + }); + } + + toJSON() { + const json = { type: undefined, name: undefined, inheritance: undefined }; + let proto = this; + while (proto !== Object.prototype) { + const descMap = Object.getOwnPropertyDescriptors(proto); + for (const [key, value] of Object.entries(descMap)) { + if (value.enumerable || value.get) { + // @ts-ignore - allow indexing here + json[key] = this[key]; + } + } + proto = Object.getPrototypeOf(proto); + } + return json; + } +} + +// @ts-check + +/** + * @typedef {import("../productions/dictionary.js").Dictionary} Dictionary + * + * @param {*} idlType + * @param {import("../validator.js").Definitions} defs + * @param {object} [options] + * @param {boolean} [options.useNullableInner] use when the input idlType is nullable and you want to use its inner type + * @return {{ reference: *, dictionary: Dictionary }} the type reference that ultimately includes dictionary. + */ +function idlTypeIncludesDictionary(idlType, defs, { useNullableInner } = {}) { + if (!idlType.union) { + const def = defs.unique.get(idlType.idlType); + if (!def) { + return; + } + if (def.type === "typedef") { + const { typedefIncludesDictionary } = defs.cache; + if (typedefIncludesDictionary.has(def)) { + // Note that this also halts when it met indeterminate state + // to prevent infinite recursion + return typedefIncludesDictionary.get(def); + } + defs.cache.typedefIncludesDictionary.set(def, undefined); // indeterminate state + const result = idlTypeIncludesDictionary(def.idlType, defs); + defs.cache.typedefIncludesDictionary.set(def, result); + if (result) { + return { + reference: idlType, + dictionary: result.dictionary + }; + } + } + if (def.type === "dictionary" && (useNullableInner || !idlType.nullable)) { + return { + reference: idlType, + dictionary: def + }; + } + } + for (const subtype of idlType.subtype) { + const result = idlTypeIncludesDictionary(subtype, defs); + if (result) { + if (subtype.union) { + return result; + } + return { + reference: subtype, + dictionary: result.dictionary + }; + } + } +} + +/** + * @param {*} dict dictionary type + * @param {import("../validator.js").Definitions} defs + * @return {boolean} + */ +function dictionaryIncludesRequiredField(dict, defs) { + if (defs.cache.dictionaryIncludesRequiredField.has(dict)) { + return defs.cache.dictionaryIncludesRequiredField.get(dict); + } + defs.cache.dictionaryIncludesRequiredField.set(dict, undefined); // indeterminate + if (dict.inheritance) { + const superdict = defs.unique.get(dict.inheritance); + if (!superdict) { + return true; + } + if (dictionaryIncludesRequiredField(superdict, defs)) { + return true; + } + } + const result = dict.members.some(field => field.required); + defs.cache.dictionaryIncludesRequiredField.set(dict, result); + return result; +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {string} typeName + */ +function generic_type(tokeniser, typeName) { + const base = tokeniser.consume("FrozenArray", "Promise", "sequence", "record"); + if (!base) { + return; + } + const ret = autoParenter(new Type({ source: tokeniser.source, tokens: { base } })); + ret.tokens.open = tokeniser.consume("<") || tokeniser.error(`No opening bracket after ${base.type}`); + switch (base.type) { + case "Promise": { + if (tokeniser.probe("[")) tokeniser.error("Promise type cannot have extended attribute"); + const subtype = return_type(tokeniser, typeName) || tokeniser.error("Missing Promise subtype"); + ret.subtype.push(subtype); + break; + } + case "sequence": + case "FrozenArray": { + const subtype = type_with_extended_attributes(tokeniser, typeName) || tokeniser.error(`Missing ${base.type} subtype`); + ret.subtype.push(subtype); + break; + } + case "record": { + if (tokeniser.probe("[")) tokeniser.error("Record key cannot have extended attribute"); + const keyType = tokeniser.consume(...stringTypes) || tokeniser.error(`Record key must be one of: ${stringTypes.join(", ")}`); + const keyIdlType = new Type({ source: tokeniser.source, tokens: { base: keyType }}); + keyIdlType.tokens.separator = tokeniser.consume(",") || tokeniser.error("Missing comma after record key type"); + keyIdlType.type = typeName; + const valueType = type_with_extended_attributes(tokeniser, typeName) || tokeniser.error("Error parsing generic type record"); + ret.subtype.push(keyIdlType, valueType); + break; + } + } + if (!ret.idlType) tokeniser.error(`Error parsing generic type ${base.type}`); + ret.tokens.close = tokeniser.consume(">") || tokeniser.error(`Missing closing bracket after ${base.type}`); + return ret.this; +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ +function type_suffix(tokeniser, obj) { + const nullable = tokeniser.consume("?"); + if (nullable) { + obj.tokens.nullable = nullable; + } + if (tokeniser.probe("?")) tokeniser.error("Can't nullable more than once"); +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {string} typeName + */ +function single_type(tokeniser, typeName) { + let ret = generic_type(tokeniser, typeName) || primitive_type(tokeniser); + if (!ret) { + const base = tokeniser.consume("identifier", ...stringTypes, ...typeNameKeywords); + if (!base) { + return; + } + ret = new Type({ source: tokeniser.source, tokens: { base } }); + if (tokeniser.probe("<")) tokeniser.error(`Unsupported generic type ${base.value}`); + } + if (ret.generic === "Promise" && tokeniser.probe("?")) { + tokeniser.error("Promise type cannot be nullable"); + } + ret.type = typeName || null; + type_suffix(tokeniser, ret); + if (ret.nullable && ret.idlType === "any") tokeniser.error("Type `any` cannot be made nullable"); + return ret; +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {string} type + */ +function union_type(tokeniser, type) { + const tokens = {}; + tokens.open = tokeniser.consume("("); + if (!tokens.open) return; + const ret = autoParenter(new Type({ source: tokeniser.source, tokens })); + ret.type = type || null; + while (true) { + const typ = type_with_extended_attributes(tokeniser) || tokeniser.error("No type after open parenthesis or 'or' in union type"); + if (typ.idlType === "any") tokeniser.error("Type `any` cannot be included in a union type"); + if (typ.generic === "Promise") tokeniser.error("Type `Promise` cannot be included in a union type"); + ret.subtype.push(typ); + const or = tokeniser.consume("or"); + if (or) { + typ.tokens.separator = or; + } + else break; + } + if (ret.idlType.length < 2) { + tokeniser.error("At least two types are expected in a union type but found less"); + } + tokens.close = tokeniser.consume(")") || tokeniser.error("Unterminated union type"); + type_suffix(tokeniser, ret); + return ret.this; +} + +class Type extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {string} typeName + */ + static parse(tokeniser, typeName) { + return single_type(tokeniser, typeName) || union_type(tokeniser, typeName); + } + + constructor({ source, tokens }) { + super({ source, tokens }); + Object.defineProperty(this, "subtype", { value: [], writable: true }); + this.extAttrs = []; + } + + get generic() { + if (this.subtype.length && this.tokens.base) { + return this.tokens.base.value; + } + return ""; + } + get nullable() { + return Boolean(this.tokens.nullable); + } + get union() { + return Boolean(this.subtype.length) && !this.tokens.base; + } + get idlType() { + if (this.subtype.length) { + return this.subtype; + } + // Adding prefixes/postfixes for "unrestricted float", etc. + const name = [ + this.tokens.prefix, + this.tokens.base, + this.tokens.postfix + ].filter(t => t).map(t => t.value).join(" "); + return unescape(name); + } + + *validate(defs) { + /* + * If a union is nullable, its subunions cannot include a dictionary + * If not, subunions may include dictionaries if each union is not nullable + */ + const typedef = !this.union && defs.unique.get(this.idlType); + const target = + this.union ? this : + (typedef && typedef.type === "typedef") ? typedef.idlType : + undefined; + if (target && this.nullable) { + // do not allow any dictionary + const { reference } = idlTypeIncludesDictionary(target, defs) || {}; + if (reference) { + const targetToken = (this.union ? reference : this).tokens.base; + const message = `Nullable union cannot include a dictionary type`; + yield validationError(targetToken, this, "no-nullable-union-dict", message); + } + } else { + // allow some dictionary + for (const subtype of this.subtype) { + yield* subtype.validate(defs); + } + } + } +} + +class Default extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const assign = tokeniser.consume("="); + if (!assign) { + return null; + } + const def = const_value(tokeniser) || tokeniser.consume("string", "null", "[", "{") || tokeniser.error("No value for default"); + const expression = [def]; + if (def.type === "[") { + const close = tokeniser.consume("]") || tokeniser.error("Default sequence value must be empty"); + expression.push(close); + } else if (def.type === "{") { + const close = tokeniser.consume("}") || tokeniser.error("Default dictionary value must be empty"); + expression.push(close); + } + return new Default({ source: tokeniser.source, tokens: { assign }, expression }); + } + + constructor({ source, tokens, expression }) { + super({ source, tokens }); + expression.parent = this; + Object.defineProperty(this, "expression", { value: expression }); + } + + get type() { + return const_data(this.expression[0]).type; + } + get value() { + return const_data(this.expression[0]).value; + } + get negative() { + return const_data(this.expression[0]).negative; + } +} + +// @ts-check + +class ArrayBase extends Array { + constructor({ source, tokens }) { + super(); + Object.defineProperties(this, { + source: { value: source }, + tokens: { value: tokens }, + parent: { value: null, writable: true } + }); + } +} + +// @ts-check + +class Token extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {string} type + */ + static parser(tokeniser, type) { + return () => { + const value = tokeniser.consume(type); + if (value) { + return new Token({ source: tokeniser.source, tokens: { value } }); + } + }; + } + + get value() { + return unescape(this.tokens.value.value); + } +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {string} tokenName + */ +function tokens(tokeniser, tokenName) { + const toks = list(tokeniser, { + parser: Token.parser(tokeniser, tokenName), + listName: tokenName + " list" + }); + return toks; +} + +/** + * This will allow a set of identifiers or strings to be parsed. + * @param {import("../tokeniser").Tokeniser} tokeniser + */ +function identifiersOrStrings(tokeniser) { + let toks = tokens(tokeniser, "identifier"); + if (toks.length) { + return toks; + } + toks = tokens(tokeniser, "string"); + if (toks.length) { + return toks; + } + tokeniser.error(`Expected identifiers or strings but none found`); +} + + +class ExtendedAttributeParameters extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const tokens = { assign: tokeniser.consume("=") }; + const ret = autoParenter(new ExtendedAttributeParameters({ source: tokeniser.source, tokens })); + if (tokens.assign) { + tokens.secondaryName = tokeniser.consume("identifier", "decimal", "integer", "string"); + } + tokens.open = tokeniser.consume("("); + if (tokens.open) { + ret.list = ret.rhsIsList ? + // [Exposed=(Window,Worker)] + identifiersOrStrings(tokeniser) : + // [NamedConstructor=Audio(DOMString src)] or [Constructor(DOMString str)] + argument_list(tokeniser); + tokens.close = tokeniser.consume(")") || tokeniser.error("Unexpected token in extended attribute argument list"); + } else if (ret.hasRhs && !tokens.secondaryName) { + tokeniser.error("No right hand side to extended attribute assignment"); + } + return ret.this; + } + + get rhsIsList() { + return this.tokens.assign && !this.tokens.secondaryName; + } + + get rhsType() { + if (this.rhsIsList) { + return this.list[0].tokens.value.type + "-list"; + } + if (this.tokens.secondaryName) { + return this.tokens.secondaryName.type; + } + return null; + } +} + +class SimpleExtendedAttribute extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const name = tokeniser.consume("identifier"); + if (name) { + return new SimpleExtendedAttribute({ + source: tokeniser.source, + tokens: { name }, + params: ExtendedAttributeParameters.parse(tokeniser) + }); + } + } + + constructor({ source, tokens, params }) { + super({ source, tokens }); + params.parent = this; + Object.defineProperty(this, "params", { value: params }); + } + + get type() { + return "extended-attribute"; + } + get name() { + return this.tokens.name.value; + } + get rhs() { + const { rhsType: type, tokens, list } = this.params; + if (!type) { + return null; + } + const value = this.params.rhsIsList ? list : unescape(tokens.secondaryName.value); + return { type, value }; + } + get arguments() { + const { rhsIsList, list } = this.params; + if (!list || rhsIsList) { + return []; + } + return list; + } + + *validate(defs) { + if (this.name === "NoInterfaceObject") { + const message = `\`[NoInterfaceObject]\` extended attribute is an \ +undesirable feature that may be removed from Web IDL in the future. Refer to the \ +[relevant upstream PR](https://github.com/heycam/webidl/pull/609) for more \ +information.`; + yield validationError(this.tokens.name, this, "no-nointerfaceobject", message, { level: "warning" }); + } + for (const arg of this.arguments) { + yield* arg.validate(defs); + } + } +} + +// Note: we parse something simpler than the official syntax. It's all that ever +// seems to be used +class ExtendedAttributes extends ArrayBase { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const tokens = {}; + tokens.open = tokeniser.consume("["); + if (!tokens.open) return new ExtendedAttributes({}); + const ret = new ExtendedAttributes({ source: tokeniser.source, tokens }); + ret.push(...list(tokeniser, { + parser: SimpleExtendedAttribute.parse, + listName: "extended attribute" + })); + tokens.close = tokeniser.consume("]") || tokeniser.error("Unexpected closing token of extended attribute"); + if (!ret.length) { + tokeniser.error("Found an empty extended attribute"); + } + if (tokeniser.probe("[")) { + tokeniser.error("Illegal double extended attribute lists, consider merging them"); + } + return ret; + } + + *validate(defs) { + for (const extAttr of this) { + yield* extAttr.validate(defs); + } + } +} + +// @ts-check + +class Argument extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const start_position = tokeniser.position; + /** @type {Base["tokens"]} */ + const tokens = {}; + const ret = autoParenter(new Argument({ source: tokeniser.source, tokens })); + ret.extAttrs = ExtendedAttributes.parse(tokeniser); + tokens.optional = tokeniser.consume("optional"); + ret.idlType = type_with_extended_attributes(tokeniser, "argument-type"); + if (!ret.idlType) { + return tokeniser.unconsume(start_position); + } + if (!tokens.optional) { + tokens.variadic = tokeniser.consume("..."); + } + tokens.name = tokeniser.consume("identifier", ...argumentNameKeywords); + if (!tokens.name) { + return tokeniser.unconsume(start_position); + } + ret.default = tokens.optional ? Default.parse(tokeniser) : null; + return ret.this; + } + + get type() { + return "argument"; + } + get optional() { + return !!this.tokens.optional; + } + get variadic() { + return !!this.tokens.variadic; + } + get name() { + return unescape(this.tokens.name.value); + } + + /** + * @param {import("../validator.js").Definitions} defs + */ + *validate(defs) { + yield* this.idlType.validate(defs); + const result = idlTypeIncludesDictionary(this.idlType, defs, { useNullableInner: true }); + if (result) { + if (this.idlType.nullable) { + const message = `Dictionary arguments cannot be nullable.`; + yield validationError(this.tokens.name, this, "no-nullable-dict-arg", message); + } else if (!this.optional) { + if (this.parent && !dictionaryIncludesRequiredField(result.dictionary, defs) && isLastRequiredArgument(this)) { + const message = `Dictionary argument must be optional if it has no required fields`; + yield validationError(this.tokens.name, this, "dict-arg-optional", message, { + autofix: autofixDictionaryArgumentOptionality(this) + }); + } + } else if (!this.default) { + const message = `Optional dictionary arguments must have a default value of \`{}\`.`; + yield validationError(this.tokens.name, this, "dict-arg-default", message, { + autofix: autofixOptionalDictionaryDefaultValue(this) + }); + } + } + } +} + +/** + * @param {Argument} arg + */ +function isLastRequiredArgument(arg) { + const list = arg.parent.arguments || arg.parent.list; + const index = list.indexOf(arg); + const requiredExists = list.slice(index + 1).some(a => !a.optional); + return !requiredExists; +} + +/** + * @param {Argument} arg + */ +function autofixDictionaryArgumentOptionality(arg) { + return () => { + const firstToken = getFirstToken(arg.idlType); + arg.tokens.optional = { type: "optional", value: "optional", trivia: firstToken.trivia }; + firstToken.trivia = " "; + autofixOptionalDictionaryDefaultValue(arg)(); + }; +} + +/** + * @param {Argument} arg + */ +function autofixOptionalDictionaryDefaultValue(arg) { + return () => { + arg.default = Default.parse(new Tokeniser(" = {}")); + }; +} + +class Operation extends Base { + /** + * @typedef {import("../tokeniser.js").Token} Token + * + * @param {import("../tokeniser.js").Tokeniser} tokeniser + * @param {object} [options] + * @param {Token} [options.special] + * @param {Token} [options.regular] + */ + static parse(tokeniser, { special, regular } = {}) { + const tokens = { special }; + const ret = autoParenter(new Operation({ source: tokeniser.source, tokens })); + if (special && special.value === "stringifier") { + tokens.termination = tokeniser.consume(";"); + if (tokens.termination) { + ret.arguments = []; + return ret; + } + } + if (!special && !regular) { + tokens.special = tokeniser.consume("getter", "setter", "deleter"); + } + ret.idlType = return_type(tokeniser) || tokeniser.error("Missing return type"); + tokens.name = tokeniser.consume("identifier", "includes"); + tokens.open = tokeniser.consume("(") || tokeniser.error("Invalid operation"); + ret.arguments = argument_list(tokeniser); + tokens.close = tokeniser.consume(")") || tokeniser.error("Unterminated operation"); + tokens.termination = tokeniser.consume(";") || tokeniser.error("Unterminated operation, expected `;`"); + return ret.this; + } + + get type() { + return "operation"; + } + get name() { + const { name } = this.tokens; + if (!name) { + return ""; + } + return unescape(name.value); + } + get special() { + if (!this.tokens.special) { + return ""; + } + return this.tokens.special.value; + } + + *validate(defs) { + if (!this.name && ["", "static"].includes(this.special)) { + const message = `Regular or static operations must have both a return type and an identifier.`; + yield validationError(this.tokens.open, this, "incomplete-op", message); + } + if (this.idlType) { + yield* this.idlType.validate(defs); + } + for (const argument of this.arguments) { + yield* argument.validate(defs); + } + } +} + +class Attribute extends Base { + /** + * @param {import("../tokeniser.js").Tokeniser} tokeniser + */ + static parse(tokeniser, { special, noInherit = false, readonly = false } = {}) { + const start_position = tokeniser.position; + const tokens = { special }; + const ret = autoParenter(new Attribute({ source: tokeniser.source, tokens })); + if (!special && !noInherit) { + tokens.special = tokeniser.consume("inherit"); + } + if (ret.special === "inherit" && tokeniser.probe("readonly")) { + tokeniser.error("Inherited attributes cannot be read-only"); + } + tokens.readonly = tokeniser.consume("readonly"); + if (readonly && !tokens.readonly && tokeniser.probe("attribute")) { + tokeniser.error("Attributes must be readonly in this context"); + } + tokens.base = tokeniser.consume("attribute"); + if (!tokens.base) { + tokeniser.unconsume(start_position); + return; + } + ret.idlType = type_with_extended_attributes(tokeniser, "attribute-type") || tokeniser.error("Attribute lacks a type"); + switch (ret.idlType.generic) { + case "sequence": + case "record": tokeniser.error(`Attributes cannot accept ${ret.idlType.generic} types`); + } + tokens.name = tokeniser.consume("identifier", "async", "required") || tokeniser.error("Attribute lacks a name"); + tokens.termination = tokeniser.consume(";") || tokeniser.error("Unterminated attribute, expected `;`"); + return ret.this; + } + + get type() { + return "attribute"; + } + get special() { + if (!this.tokens.special) { + return ""; + } + return this.tokens.special.value; + } + get readonly() { + return !!this.tokens.readonly; + } + get name() { + return unescape(this.tokens.name.value); + } + + *validate(defs) { + yield* this.idlType.validate(defs); + } +} + +/** + * @param {string} identifier + */ +function unescape(identifier) { + return identifier.startsWith('_') ? identifier.slice(1) : identifier; +} + +/** + * Parses comma-separated list + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {object} args + * @param {Function} args.parser parser function for each item + * @param {boolean} [args.allowDangler] whether to allow dangling comma + * @param {string} [args.listName] the name to be shown on error messages + */ +function list(tokeniser, { parser, allowDangler, listName = "list" }) { + const first = parser(tokeniser); + if (!first) { + return []; + } + first.tokens.separator = tokeniser.consume(","); + const items = [first]; + while (first.tokens.separator) { + const item = parser(tokeniser); + if (!item) { + if (!allowDangler) { + tokeniser.error(`Trailing comma in ${listName}`); + } + break; + } + item.tokens.separator = tokeniser.consume(","); + items.push(item); + if (!item.tokens.separator) break; + } + return items; +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ +function const_value(tokeniser) { + return tokeniser.consume("true", "false", "Infinity", "-Infinity", "NaN", "decimal", "integer"); +} + +/** + * @param {object} token + * @param {string} token.type + * @param {string} token.value + */ +function const_data({ type, value }) { + switch (type) { + case "true": + case "false": + return { type: "boolean", value: type === "true" }; + case "Infinity": + case "-Infinity": + return { type: "Infinity", negative: type.startsWith("-") }; + case "[": + return { type: "sequence", value: [] }; + case "{": + return { type: "dictionary" }; + case "decimal": + case "integer": + return { type: "number", value }; + case "string": + return { type: "string", value: value.slice(1, -1) }; + default: + return { type }; + } +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ +function primitive_type(tokeniser) { + function integer_type() { + const prefix = tokeniser.consume("unsigned"); + const base = tokeniser.consume("short", "long"); + if (base) { + const postfix = tokeniser.consume("long"); + return new Type({ source, tokens: { prefix, base, postfix } }); + } + if (prefix) tokeniser.error("Failed to parse integer type"); + } + + function decimal_type() { + const prefix = tokeniser.consume("unrestricted"); + const base = tokeniser.consume("float", "double"); + if (base) { + return new Type({ source, tokens: { prefix, base } }); + } + if (prefix) tokeniser.error("Failed to parse float type"); + } + + const { source } = tokeniser; + const num_type = integer_type() || decimal_type(); + if (num_type) return num_type; + const base = tokeniser.consume("boolean", "byte", "octet"); + if (base) { + return new Type({ source, tokens: { base } }); + } +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ +function argument_list(tokeniser) { + return list(tokeniser, { parser: Argument.parse, listName: "arguments list" }); +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {string} typeName + */ +function type_with_extended_attributes(tokeniser, typeName) { + const extAttrs = ExtendedAttributes.parse(tokeniser); + const ret = Type.parse(tokeniser, typeName); + if (ret) autoParenter(ret).extAttrs = extAttrs; + return ret; +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {string} typeName + */ +function return_type(tokeniser, typeName) { + const typ = Type.parse(tokeniser, typeName || "return-type"); + if (typ) { + return typ; + } + const voidToken = tokeniser.consume("void"); + if (voidToken) { + const ret = new Type({ source: tokeniser.source, tokens: { base: voidToken } }); + ret.type = "return-type"; + return ret; + } +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ +function stringifier(tokeniser) { + const special = tokeniser.consume("stringifier"); + if (!special) return; + const member = Attribute.parse(tokeniser, { special }) || + Operation.parse(tokeniser, { special }) || + tokeniser.error("Unterminated stringifier"); + return member; +} + +/** + * @param {string} str + */ +function getLastIndentation(str) { + const lines = str.split("\n"); + // the first line visually binds to the preceding token + if (lines.length) { + const match = lines[lines.length - 1].match(/^\s+/); + if (match) { + return match[0]; + } + } + return ""; +} + +/** + * @param {string} parentTrivia + */ +function getMemberIndentation(parentTrivia) { + const indentation = getLastIndentation(parentTrivia); + const indentCh = indentation.includes("\t") ? "\t" : " "; + return indentation + indentCh; +} + +/** + * @param {object} def + * @param {import("./extended-attributes.js").ExtendedAttributes} def.extAttrs + */ +function autofixAddExposedWindow(def) { + return () => { + if (def.extAttrs.length){ + const tokeniser = new Tokeniser("Exposed=Window,"); + const exposed = SimpleExtendedAttribute.parse(tokeniser); + exposed.tokens.separator = tokeniser.consume(","); + const existing = def.extAttrs[0]; + if (!/^\s/.test(existing.tokens.name.trivia)) { + existing.tokens.name.trivia = ` ${existing.tokens.name.trivia}`; + } + def.extAttrs.unshift(exposed); + } else { + autoParenter(def).extAttrs = ExtendedAttributes.parse(new Tokeniser("[Exposed=Window]")); + const trivia = def.tokens.base.trivia; + def.extAttrs.tokens.open.trivia = trivia; + def.tokens.base.trivia = `\n${getLastIndentation(trivia)}`; + } + }; +} + +/** + * Get the first syntax token for the given IDL object. + * @param {*} data + */ +function getFirstToken(data) { + if (data.extAttrs.length) { + return data.extAttrs.tokens.open; + } + if (data.type === "operation" && !data.special) { + return getFirstToken(data.idlType); + } + const tokens = Object.values(data.tokens).sort((x, y) => x.index - y.index); + return tokens[0]; +} + +/** + * @template T + * @param {T[]} array + * @param {(item: T) => boolean} predicate + */ +function findLastIndex(array, predicate) { + const index = array.slice().reverse().findIndex(predicate); + if (index === -1) { + return index; + } + return array.length - index - 1; +} + +/** + * Returns a proxy that auto-assign `parent` field. + * @template T + * @param {T} data + * @param {*} [parent] The object that will be assigned to `parent`. + * If absent, it will be `data` by default. + * @return {T} + */ +function autoParenter(data, parent) { + if (!parent) { + // Defaults to `data` unless specified otherwise. + parent = data; + } + if (!data) { + // This allows `autoParenter(undefined)` which again allows + // `autoParenter(parse())` where the function may return nothing. + return data; + } + return new Proxy(data, { + get(target, p) { + const value = target[p]; + if (Array.isArray(value)) { + // Wraps the array so that any added items will also automatically + // get their `parent` values. + return autoParenter(value, target); + } + return value; + }, + set(target, p, value) { + target[p] = value; + if (!value) { + return true; + } else if (Array.isArray(value)) { + // Assigning an array will add `parent` to its items. + for (const item of value) { + if (typeof item.parent !== "undefined") { + item.parent = parent; + } + } + } else if (typeof value.parent !== "undefined") { + value.parent = parent; + } + return true; + } + }); +} + +// These regular expressions use the sticky flag so they will only match at +// the current location (ie. the offset of lastIndex). +const tokenRe = { + // This expression uses a lookahead assertion to catch false matches + // against integers early. + "decimal": /-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y, + "integer": /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y, + "identifier": /[_-]?[A-Za-z][0-9A-Z_a-z-]*/y, + "string": /"[^"]*"/y, + "whitespace": /[\t\n\r ]+/y, + "comment": /((\/(\/.*|\*([^*]|\*[^/])*\*\/)[\t\n\r ]*)+)/y, + "other": /[^\t\n\r 0-9A-Za-z]/y +}; + +const typeNameKeywords = [ + "ArrayBuffer", + "DataView", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint16Array", + "Uint32Array", + "Uint8ClampedArray", + "Float32Array", + "Float64Array", + "any", + "object", + "symbol" +]; + +const stringTypes = [ + "ByteString", + "DOMString", + "USVString" +]; + +const argumentNameKeywords = [ + "async", + "attribute", + "callback", + "const", + "constructor", + "deleter", + "dictionary", + "enum", + "getter", + "includes", + "inherit", + "interface", + "iterable", + "maplike", + "namespace", + "partial", + "required", + "setlike", + "setter", + "static", + "stringifier", + "typedef", + "unrestricted" +]; + +const nonRegexTerminals = [ + "-Infinity", + "FrozenArray", + "Infinity", + "NaN", + "Promise", + "boolean", + "byte", + "double", + "false", + "float", + "long", + "mixin", + "null", + "octet", + "optional", + "or", + "readonly", + "record", + "sequence", + "short", + "true", + "unsigned", + "void" +].concat(argumentNameKeywords, stringTypes, typeNameKeywords); + +const punctuations = [ + "(", + ")", + ",", + "...", + ":", + ";", + "<", + "=", + ">", + "?", + "[", + "]", + "{", + "}" +]; + +const reserved = [ + // "constructor" is now a keyword + "_constructor", + "toString", + "_toString", +]; + +/** + * @typedef {ArrayItemType>} Token + * @param {string} str + */ +function tokenise(str) { + const tokens = []; + let lastCharIndex = 0; + let trivia = ""; + let line = 1; + let index = 0; + while (lastCharIndex < str.length) { + const nextChar = str.charAt(lastCharIndex); + let result = -1; + + if (/[\t\n\r ]/.test(nextChar)) { + result = attemptTokenMatch("whitespace", { noFlushTrivia: true }); + } else if (nextChar === '/') { + result = attemptTokenMatch("comment", { noFlushTrivia: true }); + } + + if (result !== -1) { + const currentTrivia = tokens.pop().value; + line += (currentTrivia.match(/\n/g) || []).length; + trivia += currentTrivia; + index -= 1; + } else if (/[-0-9.A-Z_a-z]/.test(nextChar)) { + result = attemptTokenMatch("decimal"); + if (result === -1) { + result = attemptTokenMatch("integer"); + } + if (result === -1) { + result = attemptTokenMatch("identifier"); + const lastIndex = tokens.length - 1; + const token = tokens[lastIndex]; + if (result !== -1) { + if (reserved.includes(token.value)) { + const message = `${unescape(token.value)} is a reserved identifier and must not be used.`; + throw new WebIDLParseError(syntaxError(tokens, lastIndex, null, message)); + } else if (nonRegexTerminals.includes(token.value)) { + token.type = token.value; + } + } + } + } else if (nextChar === '"') { + result = attemptTokenMatch("string"); + } + + for (const punctuation of punctuations) { + if (str.startsWith(punctuation, lastCharIndex)) { + tokens.push({ type: punctuation, value: punctuation, trivia, line, index }); + trivia = ""; + lastCharIndex += punctuation.length; + result = lastCharIndex; + break; + } + } + + // other as the last try + if (result === -1) { + result = attemptTokenMatch("other"); + } + if (result === -1) { + throw new Error("Token stream not progressing"); + } + lastCharIndex = result; + index += 1; + } + + // remaining trivia as eof + tokens.push({ + type: "eof", + value: "", + trivia + }); + + return tokens; + + /** + * @param {keyof typeof tokenRe} type + * @param {object} options + * @param {boolean} [options.noFlushTrivia] + */ + function attemptTokenMatch(type, { noFlushTrivia } = {}) { + const re = tokenRe[type]; + re.lastIndex = lastCharIndex; + const result = re.exec(str); + if (result) { + tokens.push({ type, value: result[0], trivia, line, index }); + if (!noFlushTrivia) { + trivia = ""; + } + return re.lastIndex; + } + return -1; + } +} + +class Tokeniser { + /** + * @param {string} idl + */ + constructor(idl) { + this.source = tokenise(idl); + this.position = 0; + } + + /** + * @param {string} message + * @return {never} + */ + error(message) { + throw new WebIDLParseError(syntaxError(this.source, this.position, this.current, message)); + } + + /** + * @param {string} type + */ + probe(type) { + return this.source.length > this.position && this.source[this.position].type === type; + } + + /** + * @param {...string} candidates + */ + consume(...candidates) { + for (const type of candidates) { + if (!this.probe(type)) continue; + const token = this.source[this.position]; + this.position++; + return token; + } + } + + /** + * @param {number} position + */ + unconsume(position) { + this.position = position; + } +} + +class WebIDLParseError extends Error { + /** + * @param {object} options + * @param {string} options.message + * @param {string} options.bareMessage + * @param {string} options.context + * @param {number} options.line + * @param {*} options.sourceName + * @param {string} options.input + * @param {*[]} options.tokens + */ + constructor({ message, bareMessage, context, line, sourceName, input, tokens }) { + super(message); + + this.name = "WebIDLParseError"; // not to be mangled + this.bareMessage = bareMessage; + this.context = context; + this.line = line; + this.sourceName = sourceName; + this.input = input; + this.tokens = tokens; + } +} + +class EnumValue extends Token { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const value = tokeniser.consume("string"); + if (value) { + return new EnumValue({ source: tokeniser.source, tokens: { value } }); + } + } + + get type() { + return "enum-value"; + } + get value() { + return super.value.slice(1, -1); + } +} + +class Enum extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + /** @type {Base["tokens"]} */ + const tokens = {}; + tokens.base = tokeniser.consume("enum"); + if (!tokens.base) { + return; + } + tokens.name = tokeniser.consume("identifier") || tokeniser.error("No name for enum"); + const ret = autoParenter(new Enum({ source: tokeniser.source, tokens })); + tokeniser.current = ret.this; + tokens.open = tokeniser.consume("{") || tokeniser.error("Bodyless enum"); + ret.values = list(tokeniser, { + parser: EnumValue.parse, + allowDangler: true, + listName: "enumeration" + }); + if (tokeniser.probe("string")) { + tokeniser.error("No comma between enum values"); + } + tokens.close = tokeniser.consume("}") || tokeniser.error("Unexpected value in enum"); + if (!ret.values.length) { + tokeniser.error("No value in enum"); + } + tokens.termination = tokeniser.consume(";") || tokeniser.error("No semicolon after enum"); + return ret.this; + } + + get type() { + return "enum"; + } + get name() { + return unescape(this.tokens.name.value); + } +} + +// @ts-check + +class Includes extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const target = tokeniser.consume("identifier"); + if (!target) { + return; + } + const tokens = { target }; + tokens.includes = tokeniser.consume("includes"); + if (!tokens.includes) { + tokeniser.unconsume(target.index); + return; + } + tokens.mixin = tokeniser.consume("identifier") || tokeniser.error("Incomplete includes statement"); + tokens.termination = tokeniser.consume(";") || tokeniser.error("No terminating ; for includes statement"); + return new Includes({ source: tokeniser.source, tokens }); + } + + get type() { + return "includes"; + } + get target() { + return unescape(this.tokens.target.value); + } + get includes() { + return unescape(this.tokens.mixin.value); + } +} + +class Typedef extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + /** @type {Base["tokens"]} */ + const tokens = {}; + const ret = autoParenter(new Typedef({ source: tokeniser.source, tokens })); + tokens.base = tokeniser.consume("typedef"); + if (!tokens.base) { + return; + } + ret.idlType = type_with_extended_attributes(tokeniser, "typedef-type") || tokeniser.error("Typedef lacks a type"); + tokens.name = tokeniser.consume("identifier") || tokeniser.error("Typedef lacks a name"); + tokeniser.current = ret.this; + tokens.termination = tokeniser.consume(";") || tokeniser.error("Unterminated typedef, expected `;`"); + return ret.this; + } + + get type() { + return "typedef"; + } + get name() { + return unescape(this.tokens.name.value); + } + + *validate(defs) { + yield* this.idlType.validate(defs); + } +} + +class CallbackFunction extends Base { + /** + * @param {import("../tokeniser.js").Tokeniser} tokeniser + */ + static parse(tokeniser, base) { + const tokens = { base }; + const ret = autoParenter(new CallbackFunction({ source: tokeniser.source, tokens })); + tokens.name = tokeniser.consume("identifier") || tokeniser.error("Callback lacks a name"); + tokeniser.current = ret.this; + tokens.assign = tokeniser.consume("=") || tokeniser.error("Callback lacks an assignment"); + ret.idlType = return_type(tokeniser) || tokeniser.error("Callback lacks a return type"); + tokens.open = tokeniser.consume("(") || tokeniser.error("Callback lacks parentheses for arguments"); + ret.arguments = argument_list(tokeniser); + tokens.close = tokeniser.consume(")") || tokeniser.error("Unterminated callback"); + tokens.termination = tokeniser.consume(";") || tokeniser.error("Unterminated callback, expected `;`"); + return ret.this; + } + + get type() { + return "callback"; + } + get name() { + return unescape(this.tokens.name.value); + } + + *validate(defs) { + yield* this.idlType.validate(defs); + } +} + +/** + * @param {import("../tokeniser.js").Tokeniser} tokeniser + */ +function inheritance(tokeniser) { + const colon = tokeniser.consume(":"); + if (!colon) { + return {}; + } + const inheritance = tokeniser.consume("identifier") || tokeniser.error("Inheritance lacks a type"); + return { colon, inheritance }; +} + +class Container extends Base { + /** + * @template T + * @param {import("../tokeniser.js").Tokeniser} tokeniser + * @param {T} instance + * @param {*} args + */ + static parse(tokeniser, instance, { type, inheritable, allowedMembers }) { + const { tokens } = instance; + tokens.name = tokeniser.consume("identifier") || tokeniser.error(`Missing name in ${instance.type}`); + tokeniser.current = instance; + instance = autoParenter(instance); + if (inheritable) { + Object.assign(tokens, inheritance(tokeniser)); + } + tokens.open = tokeniser.consume("{") || tokeniser.error(`Bodyless ${type}`); + instance.members = []; + while (true) { + tokens.close = tokeniser.consume("}"); + if (tokens.close) { + tokens.termination = tokeniser.consume(";") || tokeniser.error(`Missing semicolon after ${type}`); + return instance.this; + } + const ea = ExtendedAttributes.parse(tokeniser); + let mem; + for (const [parser, ...args] of allowedMembers) { + mem = autoParenter(parser(tokeniser, ...args)); + if (mem) { + break; + } + } + if (!mem) { + tokeniser.error("Unknown member"); + } + mem.extAttrs = ea; + instance.members.push(mem.this); + } + } + + get partial() { + return !!this.tokens.partial; + } + get name() { + return unescape(this.tokens.name.value); + } + get inheritance() { + if (!this.tokens.inheritance) { + return null; + } + return unescape(this.tokens.inheritance.value); + } + + *validate(defs) { + for (const member of this.members) { + if (member.validate) { + yield* member.validate(defs); + } + } + } + } + +class Constant extends Base { + /** + * @param {import("../tokeniser.js").Tokeniser} tokeniser + */ + static parse(tokeniser) { + /** @type {Base["tokens"]} */ + const tokens = {}; + tokens.base = tokeniser.consume("const"); + if (!tokens.base) { + return; + } + let idlType = primitive_type(tokeniser); + if (!idlType) { + const base = tokeniser.consume("identifier") || tokeniser.error("Const lacks a type"); + idlType = new Type({ source: tokeniser.source, tokens: { base } }); + } + if (tokeniser.probe("?")) { + tokeniser.error("Unexpected nullable constant type"); + } + idlType.type = "const-type"; + tokens.name = tokeniser.consume("identifier") || tokeniser.error("Const lacks a name"); + tokens.assign = tokeniser.consume("=") || tokeniser.error("Const lacks value assignment"); + tokens.value = const_value(tokeniser) || tokeniser.error("Const lacks a value"); + tokens.termination = tokeniser.consume(";") || tokeniser.error("Unterminated const, expected `;`"); + const ret = new Constant({ source: tokeniser.source, tokens }); + autoParenter(ret).idlType = idlType; + return ret; + } + + get type() { + return "const"; + } + get name() { + return unescape(this.tokens.name.value); + } + get value() { + return const_data(this.tokens.value); + } +} + +class IterableLike extends Base { + /** + * @param {import("../tokeniser.js").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const start_position = tokeniser.position; + const tokens = {}; + const ret = autoParenter(new IterableLike({ source: tokeniser.source, tokens })); + tokens.readonly = tokeniser.consume("readonly"); + if (!tokens.readonly) { + tokens.async = tokeniser.consume("async"); + } + tokens.base = + tokens.readonly ? tokeniser.consume("maplike", "setlike") : + tokens.async ? tokeniser.consume("iterable") : + tokeniser.consume("iterable", "maplike", "setlike"); + if (!tokens.base) { + tokeniser.unconsume(start_position); + return; + } + + const { type } = ret; + const secondTypeRequired = type === "maplike" || ret.async; + const secondTypeAllowed = secondTypeRequired || type === "iterable"; + + tokens.open = tokeniser.consume("<") || tokeniser.error(`Missing less-than sign \`<\` in ${type} declaration`); + const first = type_with_extended_attributes(tokeniser) || tokeniser.error(`Missing a type argument in ${type} declaration`); + ret.idlType = [first]; + if (secondTypeAllowed) { + first.tokens.separator = tokeniser.consume(","); + if (first.tokens.separator) { + ret.idlType.push(type_with_extended_attributes(tokeniser)); + } + else if (secondTypeRequired) { + tokeniser.error(`Missing second type argument in ${type} declaration`); + } + } + tokens.close = tokeniser.consume(">") || tokeniser.error(`Missing greater-than sign \`>\` in ${type} declaration`); + tokens.termination = tokeniser.consume(";") || tokeniser.error(`Missing semicolon after ${type} declaration`); + + return ret.this; + } + + get type() { + return this.tokens.base.value; + } + get readonly() { + return !!this.tokens.readonly; + } + get async() { + return !!this.tokens.async; + } +} + +// @ts-check + +function* checkInterfaceMemberDuplication(defs, i) { + const opNames = new Set(getOperations(i).map(op => op.name)); + const partials = defs.partials.get(i.name) || []; + const mixins = defs.mixinMap.get(i.name) || []; + for (const ext of [...partials, ...mixins]) { + const additions = getOperations(ext); + yield* forEachExtension(additions, opNames, ext, i); + for (const addition of additions) { + opNames.add(addition.name); + } + } + + function* forEachExtension(additions, existings, ext, base) { + for (const addition of additions) { + const { name } = addition; + if (name && existings.has(name)) { + const message = `The operation "${name}" has already been defined for the base interface "${base.name}" either in itself or in a mixin`; + yield validationError(addition.tokens.name, ext, "no-cross-overload", message); + } + } + } + + function getOperations(i) { + return i.members + .filter(({type}) => type === "operation"); + } +} + +class Constructor extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + const base = tokeniser.consume("constructor"); + if (!base) { + return; + } + /** @type {Base["tokens"]} */ + const tokens = { base }; + tokens.open = tokeniser.consume("(") || tokeniser.error("No argument list in constructor"); + const args = argument_list(tokeniser); + tokens.close = tokeniser.consume(")") || tokeniser.error("Unterminated constructor"); + tokens.termination = tokeniser.consume(";") || tokeniser.error("No semicolon after constructor"); + const ret = new Constructor({ source: tokeniser.source, tokens }); + autoParenter(ret).arguments = args; + return ret; + } + + get type() { + return "constructor"; + } + + *validate(defs) { + if (this.idlType) { + yield* this.idlType.validate(defs); + } + for (const argument of this.arguments) { + yield* argument.validate(defs); + } + } +} + +/** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ +function static_member(tokeniser) { + const special = tokeniser.consume("static"); + if (!special) return; + const member = Attribute.parse(tokeniser, { special }) || + Operation.parse(tokeniser, { special }) || + tokeniser.error("No body in static member"); + return member; +} + +class Interface extends Container { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser, base, { partial = null } = {}) { + const tokens = { partial, base }; + return Container.parse(tokeniser, new Interface({ source: tokeniser.source, tokens }), { + type: "interface", + inheritable: !partial, + allowedMembers: [ + [Constant.parse], + [Constructor.parse], + [static_member], + [stringifier], + [IterableLike.parse], + [Attribute.parse], + [Operation.parse] + ] + }); + } + + get type() { + return "interface"; + } + + *validate(defs) { + yield* this.extAttrs.validate(defs); + if ( + !this.partial && + this.extAttrs.every(extAttr => extAttr.name !== "Exposed") && + this.extAttrs.every(extAttr => extAttr.name !== "NoInterfaceObject") + ) { + const message = `Interfaces must have \`[Exposed]\` extended attribute. \ +To fix, add, for example, \`[Exposed=Window]\`. Please also consider carefully \ +if your interface should also be exposed in a Worker scope. Refer to the \ +[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \ +for more information.`; + yield validationError(this.tokens.name, this, "require-exposed", message, { + autofix: autofixAddExposedWindow(this) + }); + } + const oldConstructors = this.extAttrs.filter(extAttr => extAttr.name === "Constructor"); + for (const constructor of oldConstructors) { + const message = `Constructors should now be represented as a \`constructor()\` operation on the interface \ +instead of \`[Constructor]\` extended attribute. Refer to the \ +[WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) \ +for more information.`; + yield validationError(constructor.tokens.name, this, "constructor-member", message, { + autofix: autofixConstructor(this, constructor) + }); + } + + const isGlobal = this.extAttrs.some(extAttr => extAttr.name === "Global"); + if (isGlobal) { + const namedConstructors = this.extAttrs.filter(extAttr => extAttr.name === "NamedConstructor"); + for (const named of namedConstructors) { + const message = `Interfaces marked as \`[Global]\` cannot have named constructors.`; + yield validationError(named.tokens.name, this, "no-constructible-global", message); + } + + const constructors = this.members.filter(member => member.type === "constructor"); + for (const named of constructors) { + const message = `Interfaces marked as \`[Global]\` cannot have constructors.`; + yield validationError(named.tokens.base, this, "no-constructible-global", message); + } + } + + yield* super.validate(defs); + if (!this.partial) { + yield* checkInterfaceMemberDuplication(defs, this); + } + } +} + +function autofixConstructor(interfaceDef, constructorExtAttr) { + interfaceDef = autoParenter(interfaceDef); + return () => { + const indentation = getLastIndentation(interfaceDef.extAttrs.tokens.open.trivia); + const memberIndent = interfaceDef.members.length ? + getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia) : + getMemberIndentation(indentation); + const constructorOp = Constructor.parse(new Tokeniser(`\n${memberIndent}constructor();`)); + constructorOp.extAttrs = []; + autoParenter(constructorOp).arguments = constructorExtAttr.arguments; + + const existingIndex = findLastIndex(interfaceDef.members, m => m.type === "constructor"); + interfaceDef.members.splice(existingIndex + 1, 0, constructorOp); + + const { close } = interfaceDef.tokens; + if (!close.trivia.includes("\n")) { + close.trivia += `\n${indentation}`; + } + + const { extAttrs } = interfaceDef; + const index = extAttrs.indexOf(constructorExtAttr); + const removed = extAttrs.splice(index, 1); + if (!extAttrs.length) { + extAttrs.tokens.open = extAttrs.tokens.close = undefined; + } else if (extAttrs.length === index) { + extAttrs[index - 1].tokens.separator = undefined; + } else if (!extAttrs[index].tokens.name.trivia.trim()) { + extAttrs[index].tokens.name.trivia = removed[0].tokens.name.trivia; + } + }; +} + +class Mixin extends Container { + /** + * @typedef {import("../tokeniser.js").Token} Token + * + * @param {import("../tokeniser.js").Tokeniser} tokeniser + * @param {Token} base + * @param {object} [options] + * @param {Token} [options.partial] + */ + static parse(tokeniser, base, { partial } = {}) { + const tokens = { partial, base }; + tokens.mixin = tokeniser.consume("mixin"); + if (!tokens.mixin) { + return; + } + return Container.parse(tokeniser, new Mixin({ source: tokeniser.source, tokens }), { + type: "interface mixin", + allowedMembers: [ + [Constant.parse], + [stringifier], + [Attribute.parse, { noInherit: true }], + [Operation.parse, { regular: true }] + ] + }); + } + + get type() { + return "interface mixin"; + } +} + +class Field extends Base { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser) { + /** @type {Base["tokens"]} */ + const tokens = {}; + const ret = autoParenter(new Field({ source: tokeniser.source, tokens })); + ret.extAttrs = ExtendedAttributes.parse(tokeniser); + tokens.required = tokeniser.consume("required"); + ret.idlType = type_with_extended_attributes(tokeniser, "dictionary-type") || tokeniser.error("Dictionary member lacks a type"); + tokens.name = tokeniser.consume("identifier") || tokeniser.error("Dictionary member lacks a name"); + ret.default = Default.parse(tokeniser); + if (tokens.required && ret.default) tokeniser.error("Required member must not have a default"); + tokens.termination = tokeniser.consume(";") || tokeniser.error("Unterminated dictionary member, expected `;`"); + return ret.this; + } + + get type() { + return "field"; + } + get name() { + return unescape(this.tokens.name.value); + } + get required() { + return !!this.tokens.required; + } + + *validate(defs) { + yield* this.idlType.validate(defs); + } +} + +// @ts-check + +class Dictionary extends Container { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {object} [options] + * @param {import("../tokeniser.js").Token} [options.partial] + */ + static parse(tokeniser, { partial } = {}) { + const tokens = { partial }; + tokens.base = tokeniser.consume("dictionary"); + if (!tokens.base) { + return; + } + return Container.parse(tokeniser, new Dictionary({ source: tokeniser.source, tokens }), { + type: "dictionary", + inheritable: !partial, + allowedMembers: [ + [Field.parse], + ] + }); + } + + get type() { + return "dictionary"; + } +} + +class Namespace extends Container { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + * @param {object} [options] + * @param {import("../tokeniser.js").Token} [options.partial] + */ + static parse(tokeniser, { partial } = {}) { + const tokens = { partial }; + tokens.base = tokeniser.consume("namespace"); + if (!tokens.base) { + return; + } + return Container.parse(tokeniser, new Namespace({ source: tokeniser.source, tokens }), { + type: "namespace", + allowedMembers: [ + [Attribute.parse, { noInherit: true, readonly: true }], + [Operation.parse, { regular: true }] + ] + }); + } + + get type() { + return "namespace"; + } + + *validate(defs) { + if (!this.partial && this.extAttrs.every(extAttr => extAttr.name !== "Exposed")) { + const message = `Namespaces must have [Exposed] extended attribute. \ +To fix, add, for example, [Exposed=Window]. Please also consider carefully \ +if your namespace should also be exposed in a Worker scope. Refer to the \ +[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \ +for more information.`; + yield validationError(this.tokens.name, this, "require-exposed", message, { + autofix: autofixAddExposedWindow(this) + }); + } + yield* super.validate(defs); + } +} + +// @ts-check + +class CallbackInterface extends Container { + /** + * @param {import("../tokeniser").Tokeniser} tokeniser + */ + static parse(tokeniser, callback, { partial = null } = {}) { + const tokens = { callback }; + tokens.base = tokeniser.consume("interface"); + if (!tokens.base) { + return; + } + return Container.parse(tokeniser, new CallbackInterface({ source: tokeniser.source, tokens }), { + type: "callback interface", + inheritable: !partial, + allowedMembers: [ + [Constant.parse], + [Operation.parse, { regular: true }] + ] + }); + } + + get type() { + return "callback interface"; + } +} + +/** + * @param {Tokeniser} tokeniser + * @param {object} options + * @param {boolean} [options.concrete] + */ +function parseByTokens(tokeniser, options) { + const source = tokeniser.source; + + function error(str) { + tokeniser.error(str); + } + + function consume(...candidates) { + return tokeniser.consume(...candidates); + } + + function callback() { + const callback = consume("callback"); + if (!callback) return; + if (tokeniser.probe("interface")) { + return CallbackInterface.parse(tokeniser, callback); + } + return CallbackFunction.parse(tokeniser, callback); + } + + function interface_(opts) { + const base = consume("interface"); + if (!base) return; + const ret = Mixin.parse(tokeniser, base, opts) || + Interface.parse(tokeniser, base, opts) || + error("Interface has no proper body"); + return ret; + } + + function partial() { + const partial = consume("partial"); + if (!partial) return; + return Dictionary.parse(tokeniser, { partial }) || + interface_({ partial }) || + Namespace.parse(tokeniser, { partial }) || + error("Partial doesn't apply to anything"); + } + + function definition() { + return callback() || + interface_() || + partial() || + Dictionary.parse(tokeniser) || + Enum.parse(tokeniser) || + Typedef.parse(tokeniser) || + Includes.parse(tokeniser) || + Namespace.parse(tokeniser); + } + + function definitions() { + if (!source.length) return []; + const defs = []; + while (true) { + const ea = ExtendedAttributes.parse(tokeniser); + const def = definition(); + if (!def) { + if (ea.length) error("Stray extended attributes"); + break; + } + autoParenter(def).extAttrs = ea; + defs.push(def); + } + const eof = consume("eof"); + if (options.concrete) { + defs.push(eof); + } + return defs; + } + const res = definitions(); + if (tokeniser.position < source.length) error("Unrecognised tokens"); + return res; +} + +/** + * @param {string} str + * @param {object} [options] + * @param {*} [options.sourceName] + * @param {boolean} [options.concrete] + */ +function parse(str, options = {}) { + const tokeniser = new Tokeniser(str); + if (typeof options.sourceName !== "undefined") { + tokeniser.source.name = options.sourceName; + } + return parseByTokens(tokeniser, options); +} + +function noop(arg) { + return arg; +} + +const templates = { + wrap: items => items.join(""), + trivia: noop, + name: noop, + reference: noop, + type: noop, + generic: noop, + nameless: noop, + inheritance: noop, + definition: noop, + extendedAttribute: noop, + extendedAttributeReference: noop +}; + +function write(ast, { templates: ts = templates } = {}) { + ts = Object.assign({}, templates, ts); + + function reference(raw, { unescaped, context }) { + if (!unescaped) { + unescaped = raw.startsWith("_") ? raw.slice(1) : raw; + } + return ts.reference(raw, unescaped, context); + } + + function token(t, wrapper = noop, ...args) { + if (!t) { + return ""; + } + const value = wrapper(t.value, ...args); + return ts.wrap([ts.trivia(t.trivia), value]); + } + + function reference_token(t, context) { + return token(t, reference, { context }); + } + + function name_token(t, arg) { + return token(t, ts.name, arg); + } + + function type_body(it) { + if (it.union || it.generic) { + return ts.wrap([ + token(it.tokens.base, ts.generic), + token(it.tokens.open), + ...it.subtype.map(type), + token(it.tokens.close) + ]); + } + const firstToken = it.tokens.prefix || it.tokens.base; + const prefix = it.tokens.prefix ? [ + it.tokens.prefix.value, + ts.trivia(it.tokens.base.trivia) + ] : []; + const ref = reference(ts.wrap([ + ...prefix, + it.tokens.base.value, + token(it.tokens.postfix) + ]), { unescaped: it.idlType, context: it }); + return ts.wrap([ts.trivia(firstToken.trivia), ref]); + } + function type(it) { + return ts.wrap([ + extended_attributes(it.extAttrs), + type_body(it), + token(it.tokens.nullable), + token(it.tokens.separator) + ]); + } + function default_(def) { + if (!def) { + return ""; + } + return ts.wrap([ + token(def.tokens.assign), + ...def.expression.map(t => token(t)) + ]); + } + function argument(arg) { + return ts.wrap([ + extended_attributes(arg.extAttrs), + token(arg.tokens.optional), + ts.type(type(arg.idlType)), + token(arg.tokens.variadic), + name_token(arg.tokens.name, { data: arg }), + default_(arg.default), + token(arg.tokens.separator) + ]); + } + function string(str) { + return ts.wrap([ + token(str.tokens.value), + token(str.tokens.separator) + ]); + } + function identifier(id, context) { + return ts.wrap([ + reference_token(id.tokens.value, context), + token(id.tokens.separator) + ]); + } + function make_ext_at(it) { + const { rhsType } = it.params; + return ts.wrap([ + ts.trivia(it.tokens.name.trivia), + ts.extendedAttribute(ts.wrap([ + ts.extendedAttributeReference(it.name), + token(it.params.tokens.assign), + reference_token(it.params.tokens.secondaryName, it), + token(it.params.tokens.open), + ...!it.params.list ? [] : + it.params.list.map( + rhsType === "identifier-list" ? id => identifier(id, it) : + rhsType === "string-list" ? string : + argument + ), + token(it.params.tokens.close) + ])), + token(it.tokens.separator) + ]); + } + function extended_attributes(eats) { + if (!eats.length) return ""; + return ts.wrap([ + token(eats.tokens.open), + ...eats.map(make_ext_at), + token(eats.tokens.close) + ]); + } + + function operation(it, parent) { + const body = it.idlType ? [ + ts.type(type(it.idlType)), + name_token(it.tokens.name, { data: it, parent }), + token(it.tokens.open), + ts.wrap(it.arguments.map(argument)), + token(it.tokens.close), + ] : []; + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + it.tokens.name ? token(it.tokens.special) : token(it.tokens.special, ts.nameless, { data: it, parent }), + ...body, + token(it.tokens.termination) + ]), { data: it, parent }); + } + + function attribute(it, parent) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.special), + token(it.tokens.readonly), + token(it.tokens.base), + ts.type(type(it.idlType)), + name_token(it.tokens.name, { data: it, parent }), + token(it.tokens.termination) + ]), { data: it, parent }); + } + + function constructor(it, parent) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.base, ts.nameless, { data: it, parent }), + token(it.tokens.open), + ts.wrap(it.arguments.map(argument)), + token(it.tokens.close), + token(it.tokens.termination) + ]), { data: it, parent }); + } + + function inheritance(inh) { + if (!inh.tokens.inheritance) { + return ""; + } + return ts.wrap([ + token(inh.tokens.colon), + ts.trivia(inh.tokens.inheritance.trivia), + ts.inheritance(reference(inh.tokens.inheritance.value, { context: inh })) + ]); + } + + function container(it) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.callback), + token(it.tokens.partial), + token(it.tokens.base), + token(it.tokens.mixin), + name_token(it.tokens.name, { data: it }), + inheritance(it), + token(it.tokens.open), + iterate(it.members, it), + token(it.tokens.close), + token(it.tokens.termination) + ]), { data: it }); + } + + function field(it, parent) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.required), + ts.type(type(it.idlType)), + name_token(it.tokens.name, { data: it, parent }), + default_(it.default), + token(it.tokens.termination) + ]), { data: it, parent }); + } + function const_(it, parent) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.base), + ts.type(type(it.idlType)), + name_token(it.tokens.name, { data: it, parent }), + token(it.tokens.assign), + token(it.tokens.value), + token(it.tokens.termination) + ]), { data: it, parent }); + } + function typedef(it) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.base), + ts.type(type(it.idlType)), + name_token(it.tokens.name, { data: it }), + token(it.tokens.termination) + ]), { data: it }); + } + function includes(it) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + reference_token(it.tokens.target, it), + token(it.tokens.includes), + reference_token(it.tokens.mixin, it), + token(it.tokens.termination) + ]), { data: it }); + } + function callback(it) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.base), + name_token(it.tokens.name, { data: it }), + token(it.tokens.assign), + ts.type(type(it.idlType)), + token(it.tokens.open), + ...it.arguments.map(argument), + token(it.tokens.close), + token(it.tokens.termination), + ]), { data: it }); + } + function enum_(it) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.base), + name_token(it.tokens.name, { data: it }), + token(it.tokens.open), + iterate(it.values, it), + token(it.tokens.close), + token(it.tokens.termination) + ]), { data: it }); + } + function enum_value(v, parent) { + return ts.wrap([ + ts.trivia(v.tokens.value.trivia), + ts.definition( + ts.wrap(['"', ts.name(v.value, { data: v, parent }), '"']), + { data: v, parent } + ), + token(v.tokens.separator) + ]); + } + function iterable_like(it, parent) { + return ts.definition(ts.wrap([ + extended_attributes(it.extAttrs), + token(it.tokens.readonly), + token(it.tokens.async), + token(it.tokens.base, ts.generic), + token(it.tokens.open), + ts.wrap(it.idlType.map(type)), + token(it.tokens.close), + token(it.tokens.termination) + ]), { data: it, parent }); + } + function eof(it) { + return ts.trivia(it.trivia); + } + + const table = { + interface: container, + "interface mixin": container, + namespace: container, + operation, + attribute, + constructor, + dictionary: container, + field, + const: const_, + typedef, + includes, + callback, + enum: enum_, + "enum-value": enum_value, + iterable: iterable_like, + maplike: iterable_like, + setlike: iterable_like, + "callback interface": container, + eof + }; + function dispatch(it, parent) { + const dispatcher = table[it.type]; + if (!dispatcher) { + throw new Error(`Type "${it.type}" is unsupported`); + } + return table[it.type](it, parent); + } + function iterate(things, parent) { + if (!things) return; + const results = things.map(thing => dispatch(thing, parent)); + return ts.wrap(results); + } + return iterate(ast); +} + +function getMixinMap(all, unique) { + const map = new Map(); + const includes = all.filter(def => def.type === "includes"); + for (const include of includes) { + const mixin = unique.get(include.includes); + if (!mixin) { + continue; + } + const array = map.get(include.target); + if (array) { + array.push(mixin); + } else { + map.set(include.target, [mixin]); + } + } + return map; +} + +/** + * @typedef {ReturnType} Definitions + */ +function groupDefinitions(all) { + const unique = new Map(); + const duplicates = new Set(); + const partials = new Map(); + for (const def of all) { + if (def.partial) { + const array = partials.get(def.name); + if (array) { + array.push(def); + } else { + partials.set(def.name, [def]); + } + continue; + } + if (!def.name) { + continue; + } + if (!unique.has(def.name)) { + unique.set(def.name, def); + } else { + duplicates.add(def); + } + } + return { + all, + unique, + partials, + duplicates, + mixinMap: getMixinMap(all, unique), + cache: { + typedefIncludesDictionary: new WeakMap(), + dictionaryIncludesRequiredField: new WeakMap() + }, + }; +} + +function* checkDuplicatedNames({ unique, duplicates }) { + for (const dup of duplicates) { + const { name } = dup; + const message = `The name "${name}" of type "${unique.get(name).type}" was already seen`; + yield validationError(dup.tokens.name, dup, "no-duplicate", message); + } +} + +function* validateIterable(ast) { + const defs = groupDefinitions(ast); + for (const def of defs.all) { + if (def.validate) { + yield* def.validate(defs); + } + } + yield* checkDuplicatedNames(defs); +} + +// Remove this once all of our support targets expose `.flat()` by default +function flatten$1(array) { + if (array.flat) { + return array.flat(); + } + return [].concat(...array); +} + +/** + * @param {*} ast AST or array of ASTs + */ +function validate(ast) { + return [...validateIterable(flatten$1(ast))]; +} + + + +var _webidl2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + parse: parse, + write: write, + validate: validate, + WebIDLParseError: WebIDLParseError +}); + +var hyperscriptAttributeToProperty = attributeToProperty; + +var transform = { + 'class': 'className', + 'for': 'htmlFor', + 'http-equiv': 'httpEquiv' +}; + +function attributeToProperty (h) { + return function (tagName, attrs, children) { + for (var attr in attrs) { + if (attr in transform) { + attrs[transform[attr]] = attrs[attr]; + delete attrs[attr]; + } + } + return h(tagName, attrs, children) + } +} + +var VAR = 0, TEXT = 1, OPEN = 2, CLOSE = 3, ATTR = 4; +var ATTR_KEY = 5, ATTR_KEY_W = 6; +var ATTR_VALUE_W = 7, ATTR_VALUE = 8; +var ATTR_VALUE_SQ = 9, ATTR_VALUE_DQ = 10; +var ATTR_EQ = 11, ATTR_BREAK = 12; +var COMMENT = 13; + +var hyperx = function (h, opts) { + if (!opts) opts = {}; + var concat = opts.concat || function (a, b) { + return String(a) + String(b) + }; + if (opts.attrToProp !== false) { + h = hyperscriptAttributeToProperty(h); + } + + return function (strings) { + var state = TEXT, reg = ''; + var arglen = arguments.length; + var parts = []; + + for (var i = 0; i < strings.length; i++) { + if (i < arglen - 1) { + var arg = arguments[i+1]; + var p = parse(strings[i]); + var xstate = state; + if (xstate === ATTR_VALUE_DQ) xstate = ATTR_VALUE; + if (xstate === ATTR_VALUE_SQ) xstate = ATTR_VALUE; + if (xstate === ATTR_VALUE_W) xstate = ATTR_VALUE; + if (xstate === ATTR) xstate = ATTR_KEY; + if (xstate === OPEN) { + if (reg === '/') { + p.push([ OPEN, '/', arg ]); + reg = ''; + } else { + p.push([ OPEN, arg ]); + } + } else if (xstate === COMMENT && opts.comments) { + reg += String(arg); + } else if (xstate !== COMMENT) { + p.push([ VAR, xstate, arg ]); + } + parts.push.apply(parts, p); + } else parts.push.apply(parts, parse(strings[i])); + } + + var tree = [null,{},[]]; + var stack = [[tree,-1]]; + for (var i = 0; i < parts.length; i++) { + var cur = stack[stack.length-1][0]; + var p = parts[i], s = p[0]; + if (s === OPEN && /^\//.test(p[1])) { + var ix = stack[stack.length-1][1]; + if (stack.length > 1) { + stack.pop(); + stack[stack.length-1][0][2][ix] = h( + cur[0], cur[1], cur[2].length ? cur[2] : undefined + ); + } + } else if (s === OPEN) { + var c = [p[1],{},[]]; + cur[2].push(c); + stack.push([c,cur[2].length-1]); + } else if (s === ATTR_KEY || (s === VAR && p[1] === ATTR_KEY)) { + var key = ''; + var copyKey; + for (; i < parts.length; i++) { + if (parts[i][0] === ATTR_KEY) { + key = concat(key, parts[i][1]); + } else if (parts[i][0] === VAR && parts[i][1] === ATTR_KEY) { + if (typeof parts[i][2] === 'object' && !key) { + for (copyKey in parts[i][2]) { + if (parts[i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) { + cur[1][copyKey] = parts[i][2][copyKey]; + } + } + } else { + key = concat(key, parts[i][2]); + } + } else break + } + if (parts[i][0] === ATTR_EQ) i++; + var j = i; + for (; i < parts.length; i++) { + if (parts[i][0] === ATTR_VALUE || parts[i][0] === ATTR_KEY) { + if (!cur[1][key]) cur[1][key] = strfn(parts[i][1]); + else parts[i][1]==="" || (cur[1][key] = concat(cur[1][key], parts[i][1])); + } else if (parts[i][0] === VAR + && (parts[i][1] === ATTR_VALUE || parts[i][1] === ATTR_KEY)) { + if (!cur[1][key]) cur[1][key] = strfn(parts[i][2]); + else parts[i][2]==="" || (cur[1][key] = concat(cur[1][key], parts[i][2])); + } else { + if (key.length && !cur[1][key] && i === j + && (parts[i][0] === CLOSE || parts[i][0] === ATTR_BREAK)) { + // https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes + // empty string is falsy, not well behaved value in browser + cur[1][key] = key.toLowerCase(); + } + if (parts[i][0] === CLOSE) { + i--; + } + break + } + } + } else if (s === ATTR_KEY) { + cur[1][p[1]] = true; + } else if (s === VAR && p[1] === ATTR_KEY) { + cur[1][p[2]] = true; + } else if (s === CLOSE) { + if (selfClosing(cur[0]) && stack.length) { + var ix = stack[stack.length-1][1]; + stack.pop(); + stack[stack.length-1][0][2][ix] = h( + cur[0], cur[1], cur[2].length ? cur[2] : undefined + ); + } + } else if (s === VAR && p[1] === TEXT) { + if (p[2] === undefined || p[2] === null) p[2] = ''; + else if (!p[2]) p[2] = concat('', p[2]); + if (Array.isArray(p[2][0])) { + cur[2].push.apply(cur[2], p[2]); + } else { + cur[2].push(p[2]); + } + } else if (s === TEXT) { + cur[2].push(p[1]); + } else if (s === ATTR_EQ || s === ATTR_BREAK) ; else { + throw new Error('unhandled: ' + s) + } + } + + if (tree[2].length > 1 && /^\s*$/.test(tree[2][0])) { + tree[2].shift(); + } + + if (tree[2].length > 2 + || (tree[2].length === 2 && /\S/.test(tree[2][1]))) { + if (opts.createFragment) return opts.createFragment(tree[2]) + throw new Error( + 'multiple root elements must be wrapped in an enclosing tag' + ) + } + if (Array.isArray(tree[2][0]) && typeof tree[2][0][0] === 'string' + && Array.isArray(tree[2][0][2])) { + tree[2][0] = h(tree[2][0][0], tree[2][0][1], tree[2][0][2]); + } + return tree[2][0] + + function parse (str) { + var res = []; + if (state === ATTR_VALUE_W) state = ATTR; + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i); + if (state === TEXT && c === '<') { + if (reg.length) res.push([TEXT, reg]); + reg = ''; + state = OPEN; + } else if (c === '>' && !quot(state) && state !== COMMENT) { + if (state === OPEN && reg.length) { + res.push([OPEN,reg]); + } else if (state === ATTR_KEY) { + res.push([ATTR_KEY,reg]); + } else if (state === ATTR_VALUE && reg.length) { + res.push([ATTR_VALUE,reg]); + } + res.push([CLOSE]); + reg = ''; + state = TEXT; + } else if (state === COMMENT && /-$/.test(reg) && c === '-') { + if (opts.comments) { + res.push([ATTR_VALUE,reg.substr(0, reg.length - 1)]); + } + reg = ''; + state = TEXT; + } else if (state === OPEN && /^!--$/.test(reg)) { + if (opts.comments) { + res.push([OPEN, reg],[ATTR_KEY,'comment'],[ATTR_EQ]); + } + reg = c; + state = COMMENT; + } else if (state === TEXT || state === COMMENT) { + reg += c; + } else if (state === OPEN && c === '/' && reg.length) ; else if (state === OPEN && /\s/.test(c)) { + if (reg.length) { + res.push([OPEN, reg]); + } + reg = ''; + state = ATTR; + } else if (state === OPEN) { + reg += c; + } else if (state === ATTR && /[^\s"'=/]/.test(c)) { + state = ATTR_KEY; + reg = c; + } else if (state === ATTR && /\s/.test(c)) { + if (reg.length) res.push([ATTR_KEY,reg]); + res.push([ATTR_BREAK]); + } else if (state === ATTR_KEY && /\s/.test(c)) { + res.push([ATTR_KEY,reg]); + reg = ''; + state = ATTR_KEY_W; + } else if (state === ATTR_KEY && c === '=') { + res.push([ATTR_KEY,reg],[ATTR_EQ]); + reg = ''; + state = ATTR_VALUE_W; + } else if (state === ATTR_KEY) { + reg += c; + } else if ((state === ATTR_KEY_W || state === ATTR) && c === '=') { + res.push([ATTR_EQ]); + state = ATTR_VALUE_W; + } else if ((state === ATTR_KEY_W || state === ATTR) && !/\s/.test(c)) { + res.push([ATTR_BREAK]); + if (/[\w-]/.test(c)) { + reg += c; + state = ATTR_KEY; + } else state = ATTR; + } else if (state === ATTR_VALUE_W && c === '"') { + state = ATTR_VALUE_DQ; + } else if (state === ATTR_VALUE_W && c === "'") { + state = ATTR_VALUE_SQ; + } else if (state === ATTR_VALUE_DQ && c === '"') { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]); + reg = ''; + state = ATTR; + } else if (state === ATTR_VALUE_SQ && c === "'") { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]); + reg = ''; + state = ATTR; + } else if (state === ATTR_VALUE_W && !/\s/.test(c)) { + state = ATTR_VALUE; + i--; + } else if (state === ATTR_VALUE && /\s/.test(c)) { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]); + reg = ''; + state = ATTR; + } else if (state === ATTR_VALUE || state === ATTR_VALUE_SQ + || state === ATTR_VALUE_DQ) { + reg += c; + } + } + if (state === TEXT && reg.length) { + res.push([TEXT,reg]); + reg = ''; + } else if (state === ATTR_VALUE && reg.length) { + res.push([ATTR_VALUE,reg]); + reg = ''; + } else if (state === ATTR_VALUE_DQ && reg.length) { + res.push([ATTR_VALUE,reg]); + reg = ''; + } else if (state === ATTR_VALUE_SQ && reg.length) { + res.push([ATTR_VALUE,reg]); + reg = ''; + } else if (state === ATTR_KEY) { + res.push([ATTR_KEY,reg]); + reg = ''; + } + return res + } + } + + function strfn (x) { + if (typeof x === 'function') return x + else if (typeof x === 'string') return x + else if (x && typeof x === 'object') return x + else if (x === null || x === undefined) return x + else return concat('', x) + } +}; + +function quot (state) { + return state === ATTR_VALUE_SQ || state === ATTR_VALUE_DQ +} + +var closeRE = RegExp('^(' + [ + 'area', 'base', 'basefont', 'bgsound', 'br', 'col', 'command', 'embed', + 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', + 'source', 'track', 'wbr', '!--', + // SVG TAGS + 'animate', 'animateTransform', 'circle', 'cursor', 'desc', 'ellipse', + 'feBlend', 'feColorMatrix', 'feComposite', + 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', + 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', + 'feGaussianBlur', 'feImage', 'feMergeNode', 'feMorphology', + 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', + 'feTurbulence', 'font-face-format', 'font-face-name', 'font-face-uri', + 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'missing-glyph', 'mpath', + 'path', 'polygon', 'polyline', 'rect', 'set', 'stop', 'tref', 'use', 'view', + 'vkern' +].join('|') + ')(?:[\.#][a-zA-Z0-9\u007F-\uFFFF_:-]+)*$'); +function selfClosing (tag) { return closeRE.test(tag) } + +var trailingNewlineRegex = /\n[\s]+$/; +var leadingNewlineRegex = /^\n[\s]+/; +var trailingSpaceRegex = /[\s]+$/; +var leadingSpaceRegex = /^[\s]+/; +var multiSpaceRegex = /[\n\s]+/g; + +var TEXT_TAGS = [ + 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'data', 'dfn', 'em', 'i', + 'kbd', 'mark', 'q', 'rp', 'rt', 'rtc', 'ruby', 's', 'amp', 'small', 'span', + 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr' +]; + +var VERBATIM_TAGS = [ + 'code', 'pre', 'textarea' +]; + +var appendChild = function appendChild (el, childs) { + if (!Array.isArray(childs)) return + + var nodeName = el.nodeName.toLowerCase(); + + var hadText = false; + var value, leader; + + for (var i = 0, len = childs.length; i < len; i++) { + var node = childs[i]; + if (Array.isArray(node)) { + appendChild(el, node); + continue + } + + if (typeof node === 'number' || + typeof node === 'boolean' || + typeof node === 'function' || + node instanceof Date || + node instanceof RegExp) { + node = node.toString(); + } + + var lastChild = el.childNodes[el.childNodes.length - 1]; + + // Iterate over text nodes + if (typeof node === 'string') { + hadText = true; + + // If we already had text, append to the existing text + if (lastChild && lastChild.nodeName === '#text') { + lastChild.nodeValue += node; + + // We didn't have a text node yet, create one + } else { + node = el.ownerDocument.createTextNode(node); + el.appendChild(node); + lastChild = node; + } + + // If this is the last of the child nodes, make sure we close it out + // right + if (i === len - 1) { + hadText = false; + // Trim the child text nodes if the current node isn't a + // node where whitespace matters. + if (TEXT_TAGS.indexOf(nodeName) === -1 && + VERBATIM_TAGS.indexOf(nodeName) === -1) { + value = lastChild.nodeValue + .replace(leadingNewlineRegex, '') + .replace(trailingSpaceRegex, '') + .replace(trailingNewlineRegex, '') + .replace(multiSpaceRegex, ' '); + if (value === '') { + el.removeChild(lastChild); + } else { + lastChild.nodeValue = value; + } + } else if (VERBATIM_TAGS.indexOf(nodeName) === -1) { + // The very first node in the list should not have leading + // whitespace. Sibling text nodes should have whitespace if there + // was any. + leader = i === 0 ? '' : ' '; + value = lastChild.nodeValue + .replace(leadingNewlineRegex, leader) + .replace(leadingSpaceRegex, ' ') + .replace(trailingSpaceRegex, '') + .replace(trailingNewlineRegex, '') + .replace(multiSpaceRegex, ' '); + lastChild.nodeValue = value; + } + } + + // Iterate over DOM nodes + } else if (node && node.nodeType) { + // If the last node was a text node, make sure it is properly closed out + if (hadText) { + hadText = false; + + // Trim the child text nodes if the current node isn't a + // text node or a code node + if (TEXT_TAGS.indexOf(nodeName) === -1 && + VERBATIM_TAGS.indexOf(nodeName) === -1) { + value = lastChild.nodeValue + .replace(leadingNewlineRegex, '') + .replace(trailingNewlineRegex, ' ') + .replace(multiSpaceRegex, ' '); + + // Remove empty text nodes, append otherwise + if (value === '') { + el.removeChild(lastChild); + } else { + lastChild.nodeValue = value; + } + // Trim the child nodes but preserve the appropriate whitespace + } else if (VERBATIM_TAGS.indexOf(nodeName) === -1) { + value = lastChild.nodeValue + .replace(leadingSpaceRegex, ' ') + .replace(leadingNewlineRegex, '') + .replace(trailingNewlineRegex, ' ') + .replace(multiSpaceRegex, ' '); + lastChild.nodeValue = value; + } + } + + // Store the last nodename + var _nodeName = node.nodeName; + if (_nodeName) nodeName = _nodeName.toLowerCase(); + + // Append the node to the DOM + el.appendChild(node); + } + } +}; + +var svgTags = [ + 'svg', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', + 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'color-profile', + 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', + 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', + 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', + 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', + 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', + 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', + 'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', + 'font-face-uri', 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image', + 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'missing-glyph', + 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', + 'set', 'stop', 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', + 'tspan', 'use', 'view', 'vkern' +]; + +var boolProps = [ + 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', + 'defaultchecked', 'defer', 'disabled', 'formnovalidate', 'hidden', + 'ismap', 'loop', 'multiple', 'muted', 'novalidate', 'open', 'playsinline', + 'readonly', 'required', 'reversed', 'selected' +]; + +var directProps = [ + 'indeterminate' +]; + +// Props that need to be set directly rather than with el.setAttribute() + + +var SVGNS = 'http://www.w3.org/2000/svg'; +var XLINKNS = 'http://www.w3.org/1999/xlink'; + +var COMMENT_TAG = '!--'; + +var dom = function (document) { + function nanoHtmlCreateElement (tag, props, children) { + var el; + + // If an svg tag, it needs a namespace + if (svgTags.indexOf(tag) !== -1) { + props.namespace = SVGNS; + } + + // If we are using a namespace + var ns = false; + if (props.namespace) { + ns = props.namespace; + delete props.namespace; + } + + // If we are extending a builtin element + var isCustomElement = false; + if (props.is) { + isCustomElement = props.is; + delete props.is; + } + + // Create the element + if (ns) { + if (isCustomElement) { + el = document.createElementNS(ns, tag, { is: isCustomElement }); + } else { + el = document.createElementNS(ns, tag); + } + } else if (tag === COMMENT_TAG) { + return document.createComment(props.comment) + } else if (isCustomElement) { + el = document.createElement(tag, { is: isCustomElement }); + } else { + el = document.createElement(tag); + } + + // Create the properties + for (var p in props) { + if (props.hasOwnProperty(p)) { + var key = p.toLowerCase(); + var val = props[p]; + // Normalize className + if (key === 'classname') { + key = 'class'; + p = 'class'; + } + // The for attribute gets transformed to htmlFor, but we just set as for + if (p === 'htmlFor') { + p = 'for'; + } + // If a property is boolean, set itself to the key + if (boolProps.indexOf(key) !== -1) { + if (String(val) === 'true') val = key; + else if (String(val) === 'false') continue + } + // If a property prefers being set directly vs setAttribute + if (key.slice(0, 2) === 'on' || directProps.indexOf(key) !== -1) { + el[p] = val; + } else { + if (ns) { + if (p === 'xlink:href') { + el.setAttributeNS(XLINKNS, p, val); + } else if (/^xmlns($|:)/i.test(p)) ; else { + el.setAttributeNS(null, p, val); + } + } else { + el.setAttribute(p, val); + } + } + } + } + + appendChild(el, children); + return el + } + + function createFragment (nodes) { + var fragment = document.createDocumentFragment(); + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] == null) continue + if (Array.isArray(nodes[i])) { + fragment.appendChild(createFragment(nodes[i])); + } else { + if (typeof nodes[i] === 'string') nodes[i] = document.createTextNode(nodes[i]); + fragment.appendChild(nodes[i]); + } + } + return fragment + } + + var exports = hyperx(nanoHtmlCreateElement, { + comments: true, + createFragment: createFragment + }); + exports.default = exports; + exports.createComment = nanoHtmlCreateElement; + return exports +}; + +var dom$1 = dom; + +function nanohtmlRawBrowser (tag) { + var el = document.createElement('div'); + el.innerHTML = tag; + return toArray(el.childNodes) +} + +function toArray (arr) { + return Array.isArray(arr) ? arr : [].slice.call(arr) +} + +var rawBrowser = nanohtmlRawBrowser; + +const html$1 = dom$1(document); + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var marked = createCommonjsModule(function (module, exports) { +(function(root) { + +/** + * Block-Level Grammar + */ + +var block = { + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, + fences: /^ {0,3}(`{3,}|~{3,})([^`~\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, + hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, + heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/, + blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, + list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: '^ {0,3}(?:' // optional indentation + + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) + + '|comment[^\\n]*(\\n+|$)' // (2) + + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) + + '|\\n*' // (4) + + '|\\n*' // (5) + + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + ')', + def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, + nptable: noop, + table: noop, + lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/, + // regex template, placeholders will be replaced according to different paragraph + // interruption rules of commonmark and the original markdown spec: + _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/, + text: /^[^\n]+/ +}; + +block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; +block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; +block.def = edit(block.def) + .replace('label', block._label) + .replace('title', block._title) + .getRegex(); + +block.bullet = /(?:[*+-]|\d{1,9}\.)/; +block.item = /^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/; +block.item = edit(block.item, 'gm') + .replace(/bull/g, block.bullet) + .getRegex(); + +block.list = edit(block.list) + .replace(/bull/g, block.bullet) + .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') + .replace('def', '\\n+(?=' + block.def.source + ')') + .getRegex(); + +block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + + '|track|ul'; +block._comment = //; +block.html = edit(block.html, 'i') + .replace('comment', block._comment) + .replace('tag', block._tag) + .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) + .getRegex(); + +block.paragraph = edit(block._paragraph) + .replace('hr', block.hr) + .replace('heading', ' {0,3}#{1,6} +') + .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs + .replace('blockquote', ' {0,3}>') + .replace('fences', ' {0,3}(?:`{3,}|~{3,})[^`\\n]*\\n') + .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt + .replace('html', ')|<(?:script|pre|style|!--)') + .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks + .getRegex(); + +block.blockquote = edit(block.blockquote) + .replace('paragraph', block.paragraph) + .getRegex(); + +/** + * Normal Block Grammar + */ + +block.normal = merge({}, block); + +/** + * GFM Block Grammar + */ + +block.gfm = merge({}, block.normal, { + nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, + table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ +}); + +/** + * Pedantic grammar (original John Gruber's loose markdown specification) + */ + +block.pedantic = merge({}, block.normal, { + html: edit( + '^ *(?:comment *(?:\\n|\\s*$)' + + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag + + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') + .replace('comment', block._comment) + .replace(/tag/g, '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') + .getRegex(), + def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/, + fences: noop, // fences not supported + paragraph: edit(block.normal._paragraph) + .replace('hr', block.hr) + .replace('heading', ' *#{1,6} *[^\n]') + .replace('lheading', block.lheading) + .replace('blockquote', ' {0,3}>') + .replace('|fences', '') + .replace('|list', '') + .replace('|html', '') + .getRegex() +}); + +/** + * Block Lexer + */ + +function Lexer(options) { + this.tokens = []; + this.tokens.links = Object.create(null); + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.pedantic) { + this.rules = block.pedantic; + } else if (this.options.gfm) { + this.rules = block.gfm; + } +} + +/** + * Expose Block Rules + */ + +Lexer.rules = block; + +/** + * Static Lex Method + */ + +Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); +}; + +/** + * Preprocessing + */ + +Lexer.prototype.lex = function(src) { + src = src + .replace(/\r\n|\r/g, '\n') + .replace(/\t/g, ' ') + .replace(/\u00a0/g, ' ') + .replace(/\u2424/g, '\n'); + + return this.token(src, true); +}; + +/** + * Lexing + */ + +Lexer.prototype.token = function(src, top) { + src = src.replace(/^ +$/gm, ''); + var next, + loose, + cap, + bull, + b, + item, + listStart, + listItems, + t, + space, + i, + tag, + l, + isordered, + istask, + ischecked; + + while (src) { + // newline + if (cap = this.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { + this.tokens.push({ + type: 'space' + }); + } + } + + // code + if (cap = this.rules.code.exec(src)) { + var lastToken = this.tokens[this.tokens.length - 1]; + src = src.substring(cap[0].length); + // An indented code block cannot interrupt a paragraph. + if (lastToken && lastToken.type === 'paragraph') { + lastToken.text += '\n' + cap[0].trimRight(); + } else { + cap = cap[0].replace(/^ {4}/gm, ''); + this.tokens.push({ + type: 'code', + codeBlockStyle: 'indented', + text: !this.options.pedantic + ? rtrim(cap, '\n') + : cap + }); + } + continue; + } + + // fences + if (cap = this.rules.fences.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'code', + lang: cap[2] ? cap[2].trim() : cap[2], + text: cap[3] || '' + }); + continue; + } + + // heading + if (cap = this.rules.heading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[1].length, + text: cap[2] + }); + continue; + } + + // table no leading pipe (gfm) + if (cap = this.rules.nptable.exec(src)) { + item = { + type: 'table', + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells(item.cells[i], item.header.length); + } + + this.tokens.push(item); + + continue; + } + } + + // hr + if (cap = this.rules.hr.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'hr' + }); + continue; + } + + // blockquote + if (cap = this.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this.token(cap, top); + + this.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this.rules.list.exec(src)) { + src = src.substring(cap[0].length); + bull = cap[2]; + isordered = bull.length > 1; + + listStart = { + type: 'list_start', + ordered: isordered, + start: isordered ? +bull : '', + loose: false + }; + + this.tokens.push(listStart); + + // Get each top-level item. + cap = cap[0].match(this.rules.item); + + listItems = []; + next = false; + l = cap.length; + i = 0; + + for (; i < l; i++) { + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) */, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull.length > 1 ? b.length === 1 + : (b.length > 1 || (this.options.smartLists && b !== bull))) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item.charAt(item.length - 1) === '\n'; + if (!loose) loose = next; + } + + if (loose) { + listStart.loose = true; + } + + // Check for task list items + istask = /^\[[ xX]\] /.test(item); + ischecked = undefined; + if (istask) { + ischecked = item[1] !== ' '; + item = item.replace(/^\[[ xX]\] +/, ''); + } + + t = { + type: 'list_item_start', + task: istask, + checked: ischecked, + loose: loose + }; + + listItems.push(t); + this.tokens.push(t); + + // Recurse. + this.token(item, false); + + this.tokens.push({ + type: 'list_item_end' + }); + } + + if (listStart.loose) { + l = listItems.length; + i = 0; + for (; i < l; i++) { + listItems[i].loose = true; + } + } + + this.tokens.push({ + type: 'list_end' + }); + + continue; + } + + // html + if (cap = this.rules.html.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: this.options.sanitize + ? 'paragraph' + : 'html', + pre: !this.options.sanitizer + && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), + text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0] + }); + continue; + } + + // def + if (top && (cap = this.rules.def.exec(src))) { + src = src.substring(cap[0].length); + if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1); + tag = cap[1].toLowerCase().replace(/\s+/g, ' '); + if (!this.tokens.links[tag]) { + this.tokens.links[tag] = { + href: cap[2], + title: cap[3] + }; + } + continue; + } + + // table (gfm) + if (cap = this.rules.table.exec(src)) { + item = { + type: 'table', + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells( + item.cells[i].replace(/^ *\| *| *\| *$/g, ''), + item.header.length); + } + + this.tokens.push(item); + + continue; + } + } + + // lheading + if (cap = this.rules.lheading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[2].charAt(0) === '=' ? 1 : 2, + text: cap[1] + }); + continue; + } + + // top-level paragraph + if (top && (cap = this.rules.paragraph.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'paragraph', + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] + }); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return this.tokens; +}; + +/** + * Inline-Level Grammar + */ + +var inline = { + escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, + autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, + url: noop, + tag: '^comment' + + '|^' // self-closing tag + + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag + + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + + '|^' // declaration, e.g. + + '|^', // CDATA section + link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, + reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, + nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, + strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, + br: /^( {2,}|\\)\n(?!\s*$)/, + del: noop, + text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~'; +inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex(); + +inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; + +inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; +inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; +inline.autolink = edit(inline.autolink) + .replace('scheme', inline._scheme) + .replace('email', inline._email) + .getRegex(); + +inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; + +inline.tag = edit(inline.tag) + .replace('comment', block._comment) + .replace('attribute', inline._attribute) + .getRegex(); + +inline._label = /(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; +inline._href = /<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/; +inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; + +inline.link = edit(inline.link) + .replace('label', inline._label) + .replace('href', inline._href) + .replace('title', inline._title) + .getRegex(); + +inline.reflink = edit(inline.reflink) + .replace('label', inline._label) + .getRegex(); + +/** + * Normal Inline Grammar + */ + +inline.normal = merge({}, inline); + +/** + * Pedantic Inline Grammar + */ + +inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, + link: edit(/^!?\[(label)\]\((.*?)\)/) + .replace('label', inline._label) + .getRegex(), + reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) + .replace('label', inline._label) + .getRegex() +}); + +/** + * GFM Inline Grammar + */ + +inline.gfm = merge({}, inline.normal, { + escape: edit(inline.escape).replace('])', '~|])').getRegex(), + _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, + url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, + _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, + del: /^~+(?=\S)([\s\S]*?\S)~+/, + text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\/i.test(cap[0])) { + this.inLink = false; + } + if (!this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.inRawBlock = true; + } else if (this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.inRawBlock = false; + } + + src = src.substring(cap[0].length); + out += this.options.sanitize + ? this.options.sanitizer + ? this.options.sanitizer(cap[0]) + : escape(cap[0]) + : cap[0]; + continue; + } + + // link + if (cap = this.rules.link.exec(src)) { + var lastParenIndex = findClosingBracket(cap[2], '()'); + if (lastParenIndex > -1) { + var linkLen = 4 + cap[1].length + lastParenIndex; + cap[2] = cap[2].substring(0, lastParenIndex); + cap[0] = cap[0].substring(0, linkLen).trim(); + cap[3] = ''; + } + src = src.substring(cap[0].length); + this.inLink = true; + href = cap[2]; + if (this.options.pedantic) { + link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); + + if (link) { + href = link[1]; + title = link[3]; + } else { + title = ''; + } + } else { + title = cap[3] ? cap[3].slice(1, -1) : ''; + } + href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); + out += this.outputLink(cap, { + href: InlineLexer.escapes(href), + title: InlineLexer.escapes(title) + }); + this.inLink = false; + continue; + } + + // reflink, nolink + if ((cap = this.rules.reflink.exec(src)) + || (cap = this.rules.nolink.exec(src))) { + src = src.substring(cap[0].length); + link = (cap[2] || cap[1]).replace(/\s+/g, ' '); + link = this.links[link.toLowerCase()]; + if (!link || !link.href) { + out += cap[0].charAt(0); + src = cap[0].substring(1) + src; + continue; + } + this.inLink = true; + out += this.outputLink(cap, link); + this.inLink = false; + continue; + } + + // strong + if (cap = this.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1])); + continue; + } + + // em + if (cap = this.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); + continue; + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.codespan(escape(cap[2].trim(), true)); + continue; + } + + // br + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.del(this.output(cap[1])); + continue; + } + + // autolink + if (cap = this.rules.autolink.exec(src)) { + src = src.substring(cap[0].length); + if (cap[2] === '@') { + text = escape(this.mangle(cap[1])); + href = 'mailto:' + text; + } else { + text = escape(cap[1]); + href = text; + } + out += this.renderer.link(href, null, text); + continue; + } + + // url (gfm) + if (!this.inLink && (cap = this.rules.url.exec(src))) { + if (cap[2] === '@') { + text = escape(cap[0]); + href = 'mailto:' + text; + } else { + // do extended autolink path validation + do { + prevCapZero = cap[0]; + cap[0] = this.rules._backpedal.exec(cap[0])[0]; + } while (prevCapZero !== cap[0]); + text = escape(cap[0]); + if (cap[1] === 'www.') { + href = 'http://' + text; + } else { + href = text; + } + } + src = src.substring(cap[0].length); + out += this.renderer.link(href, null, text); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + src = src.substring(cap[0].length); + if (this.inRawBlock) { + out += this.renderer.text(this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]); + } else { + out += this.renderer.text(escape(this.smartypants(cap[0]))); + } + continue; + } + + if (src) { + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; +}; + +InlineLexer.escapes = function(text) { + return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; +}; + +/** + * Compile Link + */ + +InlineLexer.prototype.outputLink = function(cap, link) { + var href = link.href, + title = link.title ? escape(link.title) : null; + + return cap[0].charAt(0) !== '!' + ? this.renderer.link(href, title, this.output(cap[1])) + : this.renderer.image(href, title, escape(cap[1])); +}; + +/** + * Smartypants Transformations + */ + +InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/---/g, '\u2014') + // en-dashes + .replace(/--/g, '\u2013') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); +}; + +/** + * Mangle Links + */ + +InlineLexer.prototype.mangle = function(text) { + if (!this.options.mangle) return text; + var out = '', + l = text.length, + i = 0, + ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; +}; + +/** + * Renderer + */ + +function Renderer(options) { + this.options = options || marked.defaults; +} + +Renderer.prototype.code = function(code, infostring, escaped) { + var lang = (infostring || '').match(/\S*/)[0]; + if (this.options.highlight) { + var out = this.options.highlight(code, lang); + if (out != null && out !== code) { + escaped = true; + code = out; + } + } + + if (!lang) { + return '
    '
    +      + (escaped ? code : escape(code, true))
    +      + '
    '; + } + + return '
    '
    +    + (escaped ? code : escape(code, true))
    +    + '
    \n'; +}; + +Renderer.prototype.blockquote = function(quote) { + return '
    \n' + quote + '
    \n'; +}; + +Renderer.prototype.html = function(html) { + return html; +}; + +Renderer.prototype.heading = function(text, level, raw, slugger) { + if (this.options.headerIds) { + return '' + + text + + '\n'; + } + // ignore IDs + return '' + text + '\n'; +}; + +Renderer.prototype.hr = function() { + return this.options.xhtml ? '
    \n' : '
    \n'; +}; + +Renderer.prototype.list = function(body, ordered, start) { + var type = ordered ? 'ol' : 'ul', + startatt = (ordered && start !== 1) ? (' start="' + start + '"') : ''; + return '<' + type + startatt + '>\n' + body + '\n'; +}; + +Renderer.prototype.listitem = function(text) { + return '
  • ' + text + '
  • \n'; +}; + +Renderer.prototype.checkbox = function(checked) { + return ' '; +}; + +Renderer.prototype.paragraph = function(text) { + return '

    ' + text + '

    \n'; +}; + +Renderer.prototype.table = function(header, body) { + if (body) body = '' + body + ''; + + return '\n' + + '\n' + + header + + '\n' + + body + + '
    \n'; +}; + +Renderer.prototype.tablerow = function(content) { + return '\n' + content + '\n'; +}; + +Renderer.prototype.tablecell = function(content, flags) { + var type = flags.header ? 'th' : 'td'; + var tag = flags.align + ? '<' + type + ' align="' + flags.align + '">' + : '<' + type + '>'; + return tag + content + '\n'; +}; + +// span level renderer +Renderer.prototype.strong = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.em = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.codespan = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.br = function() { + return this.options.xhtml ? '
    ' : '
    '; +}; + +Renderer.prototype.del = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.link = function(href, title, text) { + href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); + if (href === null) { + return text; + } + var out = ''; + return out; +}; + +Renderer.prototype.image = function(href, title, text) { + href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); + if (href === null) { + return text; + } + + var out = '' + text + '' : '>'; + return out; +}; + +Renderer.prototype.text = function(text) { + return text; +}; + +/** + * TextRenderer + * returns only the textual part of the token + */ + +function TextRenderer() {} + +// no need for block level renderers + +TextRenderer.prototype.strong = +TextRenderer.prototype.em = +TextRenderer.prototype.codespan = +TextRenderer.prototype.del = +TextRenderer.prototype.text = function(text) { + return text; +}; + +TextRenderer.prototype.link = +TextRenderer.prototype.image = function(href, title, text) { + return '' + text; +}; + +TextRenderer.prototype.br = function() { + return ''; +}; + +/** + * Parsing & Compiling + */ + +function Parser(options) { + this.tokens = []; + this.token = null; + this.options = options || marked.defaults; + this.options.renderer = this.options.renderer || new Renderer(); + this.renderer = this.options.renderer; + this.renderer.options = this.options; + this.slugger = new Slugger(); +} + +/** + * Static Parse Method + */ + +Parser.parse = function(src, options) { + var parser = new Parser(options); + return parser.parse(src); +}; + +/** + * Parse Loop + */ + +Parser.prototype.parse = function(src) { + this.inline = new InlineLexer(src.links, this.options); + // use an InlineLexer with a TextRenderer to extract pure text + this.inlineText = new InlineLexer( + src.links, + merge({}, this.options, { renderer: new TextRenderer() }) + ); + this.tokens = src.reverse(); + + var out = ''; + while (this.next()) { + out += this.tok(); + } + + return out; +}; + +/** + * Next Token + */ + +Parser.prototype.next = function() { + this.token = this.tokens.pop(); + return this.token; +}; + +/** + * Preview Next Token + */ + +Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; +}; + +/** + * Parse Text Tokens + */ + +Parser.prototype.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); +}; + +/** + * Parse Current Token + */ + +Parser.prototype.tok = function() { + switch (this.token.type) { + case 'space': { + return ''; + } + case 'hr': { + return this.renderer.hr(); + } + case 'heading': { + return this.renderer.heading( + this.inline.output(this.token.text), + this.token.depth, + unescape(this.inlineText.output(this.token.text)), + this.slugger); + } + case 'code': { + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '', + body = '', + i, + row, + cell, + j; + + // header + cell = ''; + for (i = 0; i < this.token.header.length; i++) { + cell += this.renderer.tablecell( + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } + ); + } + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this.renderer.tablecell( + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } + ); + } + + body += this.renderer.tablerow(cell); + } + return this.renderer.table(header, body); + } + case 'blockquote_start': { + body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this.tok(); + } + + return this.renderer.blockquote(body); + } + case 'list_start': { + body = ''; + var ordered = this.token.ordered, + start = this.token.start; + + while (this.next().type !== 'list_end') { + body += this.tok(); + } + + return this.renderer.list(body, ordered, start); + } + case 'list_item_start': { + body = ''; + var loose = this.token.loose; + var checked = this.token.checked; + var task = this.token.task; + + if (this.token.task) { + body += this.renderer.checkbox(checked); + } + + while (this.next().type !== 'list_item_end') { + body += !loose && this.token.type === 'text' + ? this.parseText() + : this.tok(); + } + return this.renderer.listitem(body, task, checked); + } + case 'html': { + // TODO parse inline content if parameter markdown=1 + return this.renderer.html(this.token.text); + } + case 'paragraph': { + return this.renderer.paragraph(this.inline.output(this.token.text)); + } + case 'text': { + return this.renderer.paragraph(this.parseText()); + } + default: { + var errMsg = 'Token with "' + this.token.type + '" type was not found.'; + if (this.options.silent) { + console.log(errMsg); + } else { + throw new Error(errMsg); + } + } + } +}; + +/** + * Slugger generates header id + */ + +function Slugger() { + this.seen = {}; +} + +/** + * Convert string to unique id + */ + +Slugger.prototype.slug = function(value) { + var slug = value + .toLowerCase() + .trim() + .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '') + .replace(/\s/g, '-'); + + if (this.seen.hasOwnProperty(slug)) { + var originalSlug = slug; + do { + this.seen[originalSlug]++; + slug = originalSlug + '-' + this.seen[originalSlug]; + } while (this.seen.hasOwnProperty(slug)); + } + this.seen[slug] = 0; + + return slug; +}; + +/** + * Helpers + */ + +function escape(html, encode) { + if (encode) { + if (escape.escapeTest.test(html)) { + return html.replace(escape.escapeReplace, function(ch) { return escape.replacements[ch]; }); + } + } else { + if (escape.escapeTestNoEncode.test(html)) { + return html.replace(escape.escapeReplaceNoEncode, function(ch) { return escape.replacements[ch]; }); + } + } + + return html; +} + +escape.escapeTest = /[&<>"']/; +escape.escapeReplace = /[&<>"']/g; +escape.replacements = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; + +escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; +escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; + +function unescape(html) { + // explicitly match decimal, hex, and named HTML entities + return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) { + n = n.toLowerCase(); + if (n === 'colon') return ':'; + if (n.charAt(0) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); + } + return ''; + }); +} + +function edit(regex, opt) { + regex = regex.source || regex; + opt = opt || ''; + return { + replace: function(name, val) { + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return this; + }, + getRegex: function() { + return new RegExp(regex, opt); + } + }; +} + +function cleanUrl(sanitize, base, href) { + if (sanitize) { + try { + var prot = decodeURIComponent(unescape(href)) + .replace(/[^\w:]/g, '') + .toLowerCase(); + } catch (e) { + return null; + } + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { + return null; + } + } + if (base && !originIndependentUrl.test(href)) { + href = resolveUrl(base, href); + } + try { + href = encodeURI(href).replace(/%25/g, '%'); + } catch (e) { + return null; + } + return href; +} + +function resolveUrl(base, href) { + if (!baseUrls[' ' + base]) { + // we can ignore everything in base after the last slash of its path component, + // but we might need to add _that_ + // https://tools.ietf.org/html/rfc3986#section-3 + if (/^[^:]+:\/*[^/]*$/.test(base)) { + baseUrls[' ' + base] = base + '/'; + } else { + baseUrls[' ' + base] = rtrim(base, '/', true); + } + } + base = baseUrls[' ' + base]; + + if (href.slice(0, 2) === '//') { + return base.replace(/:[\s\S]*/, ':') + href; + } else if (href.charAt(0) === '/') { + return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href; + } else { + return base + href; + } +} +var baseUrls = {}; +var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; + +function noop() {} +noop.exec = noop; + +function merge(obj) { + var i = 1, + target, + key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } + } + } + + return obj; +} + +function splitCells(tableRow, count) { + // ensure that every cell-delimiting pipe has a space + // before it to distinguish it from an escaped pipe + var row = tableRow.replace(/\|/g, function(match, offset, str) { + var escaped = false, + curr = offset; + while (--curr >= 0 && str[curr] === '\\') escaped = !escaped; + if (escaped) { + // odd number of slashes means | is escaped + // so we leave it alone + return '|'; + } else { + // add space before unescaped | + return ' |'; + } + }), + cells = row.split(/ \|/), + i = 0; + + if (cells.length > count) { + cells.splice(count); + } else { + while (cells.length < count) cells.push(''); + } + + for (; i < cells.length; i++) { + // leading or trailing whitespace is ignored per the gfm spec + cells[i] = cells[i].trim().replace(/\\\|/g, '|'); + } + return cells; +} + +// Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). +// /c*$/ is vulnerable to REDOS. +// invert: Remove suffix of non-c chars instead. Default falsey. +function rtrim(str, c, invert) { + if (str.length === 0) { + return ''; + } + + // Length of suffix matching the invert condition. + var suffLen = 0; + + // Step left until we fail to match the invert condition. + while (suffLen < str.length) { + var currChar = str.charAt(str.length - suffLen - 1); + if (currChar === c && !invert) { + suffLen++; + } else if (currChar !== c && invert) { + suffLen++; + } else { + break; + } + } + + return str.substr(0, str.length - suffLen); +} + +function findClosingBracket(str, b) { + if (str.indexOf(b[1]) === -1) { + return -1; + } + var level = 0; + for (var i = 0; i < str.length; i++) { + if (str[i] === '\\') { + i++; + } else if (str[i] === b[0]) { + level++; + } else if (str[i] === b[1]) { + level--; + if (level < 0) { + return i; + } + } + } + return -1; +} + +function checkSanitizeDeprecation(opt) { + if (opt && opt.sanitize && !opt.silent) { + console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); + } +} + +/** + * Marked + */ + +function marked(src, opt, callback) { + // throw error in case of non string input + if (typeof src === 'undefined' || src === null) { + throw new Error('marked(): input parameter is undefined or null'); + } + if (typeof src !== 'string') { + throw new Error('marked(): input parameter is of type ' + + Object.prototype.toString.call(src) + ', string expected'); + } + + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; + } + + opt = merge({}, marked.defaults, opt || {}); + checkSanitizeDeprecation(opt); + + var highlight = opt.highlight, + tokens, + pending, + i = 0; + + try { + tokens = Lexer.lex(src, opt); + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; + } + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); + } + return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; + } + try { + if (opt) opt = merge({}, marked.defaults, opt); + checkSanitizeDeprecation(opt); + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/markedjs/marked.'; + if ((opt || marked.defaults).silent) { + return '

    An error occurred:

    '
    +        + escape(e.message + '', true)
    +        + '
    '; + } + throw e; + } +} + +/** + * Options + */ + +marked.options = +marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; +}; + +marked.getDefaults = function() { + return { + baseUrl: null, + breaks: false, + gfm: true, + headerIds: true, + headerPrefix: '', + highlight: null, + langPrefix: 'language-', + mangle: true, + pedantic: false, + renderer: new Renderer(), + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + xhtml: false + }; +}; + +marked.defaults = marked.getDefaults(); + +/** + * Expose + */ + +marked.Parser = Parser; +marked.parser = Parser.parse; + +marked.Renderer = Renderer; +marked.TextRenderer = TextRenderer; + +marked.Lexer = Lexer; +marked.lexer = Lexer.lex; + +marked.InlineLexer = InlineLexer; +marked.inlineLexer = InlineLexer.output; + +marked.Slugger = Slugger; + +marked.parse = marked; + +{ + module.exports = marked; +} +})(); +}); + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function commonjsRequire () { + throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); +} + +function createCommonjsModule$1(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var pluralize = createCommonjsModule$1(function (module, exports) { +/* global define */ + +(function (root, pluralize) { + /* istanbul ignore else */ + if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') { + // Node. + module.exports = pluralize(); + } else { + // Browser global. + root.pluralize = pluralize(); + } +})(commonjsGlobal, function () { + // Rule storage - pluralize and singularize need to be run sequentially, + // while other rules can be optimized using an object for instant lookups. + var pluralRules = []; + var singularRules = []; + var uncountables = {}; + var irregularPlurals = {}; + var irregularSingles = {}; + + /** + * Sanitize a pluralization rule to a usable regular expression. + * + * @param {(RegExp|string)} rule + * @return {RegExp} + */ + function sanitizeRule (rule) { + if (typeof rule === 'string') { + return new RegExp('^' + rule + '$', 'i'); + } + + return rule; + } + + /** + * Pass in a word token to produce a function that can replicate the case on + * another word. + * + * @param {string} word + * @param {string} token + * @return {Function} + */ + function restoreCase (word, token) { + // Tokens are an exact match. + if (word === token) return token; + + // Lower cased words. E.g. "hello". + if (word === word.toLowerCase()) return token.toLowerCase(); + + // Upper cased words. E.g. "WHISKY". + if (word === word.toUpperCase()) return token.toUpperCase(); + + // Title cased words. E.g. "Title". + if (word[0] === word[0].toUpperCase()) { + return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase(); + } + + // Lower cased words. E.g. "test". + return token.toLowerCase(); + } + + /** + * Interpolate a regexp string. + * + * @param {string} str + * @param {Array} args + * @return {string} + */ + function interpolate (str, args) { + return str.replace(/\$(\d{1,2})/g, function (match, index) { + return args[index] || ''; + }); + } + + /** + * Replace a word using a rule. + * + * @param {string} word + * @param {Array} rule + * @return {string} + */ + function replace (word, rule) { + return word.replace(rule[0], function (match, index) { + var result = interpolate(rule[1], arguments); + + if (match === '') { + return restoreCase(word[index - 1], result); + } + + return restoreCase(match, result); + }); + } + + /** + * Sanitize a word by passing in the word and sanitization rules. + * + * @param {string} token + * @param {string} word + * @param {Array} rules + * @return {string} + */ + function sanitizeWord (token, word, rules) { + // Empty string or doesn't need fixing. + if (!token.length || uncountables.hasOwnProperty(token)) { + return word; + } + + var len = rules.length; + + // Iterate over the sanitization rules and use the first one to match. + while (len--) { + var rule = rules[len]; + + if (rule[0].test(word)) return replace(word, rule); + } + + return word; + } + + /** + * Replace a word with the updated word. + * + * @param {Object} replaceMap + * @param {Object} keepMap + * @param {Array} rules + * @return {Function} + */ + function replaceWord (replaceMap, keepMap, rules) { + return function (word) { + // Get the correct token and case restoration functions. + var token = word.toLowerCase(); + + // Check against the keep object map. + if (keepMap.hasOwnProperty(token)) { + return restoreCase(word, token); + } + + // Check against the replacement map for a direct word replacement. + if (replaceMap.hasOwnProperty(token)) { + return restoreCase(word, replaceMap[token]); + } + + // Run all the rules against the word. + return sanitizeWord(token, word, rules); + }; + } + + /** + * Check if a word is part of the map. + */ + function checkWord (replaceMap, keepMap, rules, bool) { + return function (word) { + var token = word.toLowerCase(); + + if (keepMap.hasOwnProperty(token)) return true; + if (replaceMap.hasOwnProperty(token)) return false; + + return sanitizeWord(token, token, rules) === token; + }; + } + + /** + * Pluralize or singularize a word based on the passed in count. + * + * @param {string} word The word to pluralize + * @param {number} count How many of the word exist + * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks) + * @return {string} + */ + function pluralize (word, count, inclusive) { + var pluralized = count === 1 + ? pluralize.singular(word) : pluralize.plural(word); + + return (inclusive ? count + ' ' : '') + pluralized; + } + + /** + * Pluralize a word. + * + * @type {Function} + */ + pluralize.plural = replaceWord( + irregularSingles, irregularPlurals, pluralRules + ); + + /** + * Check if a word is plural. + * + * @type {Function} + */ + pluralize.isPlural = checkWord( + irregularSingles, irregularPlurals, pluralRules + ); + + /** + * Singularize a word. + * + * @type {Function} + */ + pluralize.singular = replaceWord( + irregularPlurals, irregularSingles, singularRules + ); + + /** + * Check if a word is singular. + * + * @type {Function} + */ + pluralize.isSingular = checkWord( + irregularPlurals, irregularSingles, singularRules + ); + + /** + * Add a pluralization rule to the collection. + * + * @param {(string|RegExp)} rule + * @param {string} replacement + */ + pluralize.addPluralRule = function (rule, replacement) { + pluralRules.push([sanitizeRule(rule), replacement]); + }; + + /** + * Add a singularization rule to the collection. + * + * @param {(string|RegExp)} rule + * @param {string} replacement + */ + pluralize.addSingularRule = function (rule, replacement) { + singularRules.push([sanitizeRule(rule), replacement]); + }; + + /** + * Add an uncountable word rule. + * + * @param {(string|RegExp)} word + */ + pluralize.addUncountableRule = function (word) { + if (typeof word === 'string') { + uncountables[word.toLowerCase()] = true; + return; + } + + // Set singular and plural references for the word. + pluralize.addPluralRule(word, '$0'); + pluralize.addSingularRule(word, '$0'); + }; + + /** + * Add an irregular word definition. + * + * @param {string} single + * @param {string} plural + */ + pluralize.addIrregularRule = function (single, plural) { + plural = plural.toLowerCase(); + single = single.toLowerCase(); + + irregularSingles[single] = plural; + irregularPlurals[plural] = single; + }; + + /** + * Irregular rules. + */ + [ + // Pronouns. + ['I', 'we'], + ['me', 'us'], + ['he', 'they'], + ['she', 'they'], + ['them', 'them'], + ['myself', 'ourselves'], + ['yourself', 'yourselves'], + ['itself', 'themselves'], + ['herself', 'themselves'], + ['himself', 'themselves'], + ['themself', 'themselves'], + ['is', 'are'], + ['was', 'were'], + ['has', 'have'], + ['this', 'these'], + ['that', 'those'], + // Words ending in with a consonant and `o`. + ['echo', 'echoes'], + ['dingo', 'dingoes'], + ['volcano', 'volcanoes'], + ['tornado', 'tornadoes'], + ['torpedo', 'torpedoes'], + // Ends with `us`. + ['genus', 'genera'], + ['viscus', 'viscera'], + // Ends with `ma`. + ['stigma', 'stigmata'], + ['stoma', 'stomata'], + ['dogma', 'dogmata'], + ['lemma', 'lemmata'], + ['schema', 'schemata'], + ['anathema', 'anathemata'], + // Other irregular rules. + ['ox', 'oxen'], + ['axe', 'axes'], + ['die', 'dice'], + ['yes', 'yeses'], + ['foot', 'feet'], + ['eave', 'eaves'], + ['goose', 'geese'], + ['tooth', 'teeth'], + ['quiz', 'quizzes'], + ['human', 'humans'], + ['proof', 'proofs'], + ['carve', 'carves'], + ['valve', 'valves'], + ['looey', 'looies'], + ['thief', 'thieves'], + ['groove', 'grooves'], + ['pickaxe', 'pickaxes'], + ['passerby', 'passersby'] + ].forEach(function (rule) { + return pluralize.addIrregularRule(rule[0], rule[1]); + }); + + /** + * Pluralization rules. + */ + [ + [/s?$/i, 's'], + [/[^\u0000-\u007F]$/i, '$0'], + [/([^aeiou]ese)$/i, '$1'], + [/(ax|test)is$/i, '$1es'], + [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'], + [/(e[mn]u)s?$/i, '$1s'], + [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'], + [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'], + [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'], + [/(seraph|cherub)(?:im)?$/i, '$1im'], + [/(her|at|gr)o$/i, '$1oes'], + [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'], + [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'], + [/sis$/i, 'ses'], + [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'], + [/([^aeiouy]|qu)y$/i, '$1ies'], + [/([^ch][ieo][ln])ey$/i, '$1ies'], + [/(x|ch|ss|sh|zz)$/i, '$1es'], + [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'], + [/\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'], + [/(pe)(?:rson|ople)$/i, '$1ople'], + [/(child)(?:ren)?$/i, '$1ren'], + [/eaux$/i, '$0'], + [/m[ae]n$/i, 'men'], + ['thou', 'you'] + ].forEach(function (rule) { + return pluralize.addPluralRule(rule[0], rule[1]); + }); + + /** + * Singularization rules. + */ + [ + [/s$/i, ''], + [/(ss)$/i, '$1'], + [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'], + [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'], + [/ies$/i, 'y'], + [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'], + [/\b(mon|smil)ies$/i, '$1ey'], + [/\b((?:tit)?m|l)ice$/i, '$1ouse'], + [/(seraph|cherub)im$/i, '$1'], + [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'], + [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'], + [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'], + [/(test)(?:is|es)$/i, '$1is'], + [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'], + [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'], + [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'], + [/(alumn|alg|vertebr)ae$/i, '$1a'], + [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'], + [/(matr|append)ices$/i, '$1ix'], + [/(pe)(rson|ople)$/i, '$1rson'], + [/(child)ren$/i, '$1'], + [/(eau)x?$/i, '$1'], + [/men$/i, 'man'] + ].forEach(function (rule) { + return pluralize.addSingularRule(rule[0], rule[1]); + }); + + /** + * Uncountable rules. + */ + [ + // Singular words with no plurals. + 'adulthood', + 'advice', + 'agenda', + 'aid', + 'aircraft', + 'alcohol', + 'ammo', + 'analytics', + 'anime', + 'athletics', + 'audio', + 'bison', + 'blood', + 'bream', + 'buffalo', + 'butter', + 'carp', + 'cash', + 'chassis', + 'chess', + 'clothing', + 'cod', + 'commerce', + 'cooperation', + 'corps', + 'debris', + 'diabetes', + 'digestion', + 'elk', + 'energy', + 'equipment', + 'excretion', + 'expertise', + 'firmware', + 'flounder', + 'fun', + 'gallows', + 'garbage', + 'graffiti', + 'hardware', + 'headquarters', + 'health', + 'herpes', + 'highjinks', + 'homework', + 'housework', + 'information', + 'jeans', + 'justice', + 'kudos', + 'labour', + 'literature', + 'machinery', + 'mackerel', + 'mail', + 'media', + 'mews', + 'moose', + 'music', + 'mud', + 'manga', + 'news', + 'only', + 'personnel', + 'pike', + 'plankton', + 'pliers', + 'police', + 'pollution', + 'premises', + 'rain', + 'research', + 'rice', + 'salmon', + 'scissors', + 'series', + 'sewage', + 'shambles', + 'shrimp', + 'software', + 'species', + 'staff', + 'swine', + 'tennis', + 'traffic', + 'transportation', + 'trout', + 'tuna', + 'wealth', + 'welfare', + 'whiting', + 'wildebeest', + 'wildlife', + 'you', + /pok[eé]mon$/i, + // Regexes. + /[^aeiou]ese$/i, // "chinese", "japanese" + /deer$/i, // "deer", "reindeer" + /fish$/i, // "fish", "blowfish", "angelfish" + /measles$/i, + /o[iu]s$/i, // "carnivorous" + /pox$/i, // "chickpox", "smallpox" + /sheep$/i + ].forEach(pluralize.addUncountableRule); + + return pluralize; +}); +}); + +// @ts-check + +/** @type {import("idb")} */ +// @ts-ignore +const idb = _idb; +const webidl2 = _webidl2; +/** @type {import("nanohtml").default} */ +// @ts-ignore +const hyperHTML = html$1; +/** @type {import("nanohtml/raw")} */ +// @ts-ignore +const raw = rawBrowser; +/** @type {import("marked")} */ +// @ts-ignore +const marked$1 = marked; +/** @type {import("pluralize")} */ +// @ts-ignore +const pluralize$1 = pluralize; + +// @ts-check +const name$3 = "core/markdown"; + +const gtEntity = />/gm; +const ampEntity = /&/gm; +const endsWithSpace = /\s+$/gm; + +const inlineElems = new Set([ + "a", + "abbr", + "acronym", + "b", + "bdo", + "big", + "br", + "button", + "cite", + "code", + "dfn", + "em", + "i", + "img", + "input", + "kbd", + "label", + "map", + "object", + "q", + "samp", + "script", + "select", + "small", + "span", + "strong", + "sub", + "sup", + "textarea", + "time", + "tt", + "var", +]); + +class Renderer extends marked$1.Renderer { + code(code, language, isEscaped) { + if (language === "webidl") { + return `
    ${code}
    `; + } + return super.code(code, language, isEscaped); + } +} + +/** + * @param {string} text + */ +function normalizePadding(text) { + if (!text) { + return ""; + } + if (typeof text !== "string") { + throw TypeError("Invalid input"); + } + if (text === "\n") { + return "\n"; + } + + /** + * @param {Node} node + * @return {node is Text} + */ + function isTextNode(node) { + return node !== null && node.nodeType === Node.TEXT_NODE; + } + /** + * @param {Node} node + * @return {node is Element} + */ + function isElementNode(node) { + return node !== null && node.nodeType === Node.ELEMENT_NODE; + } + const doc = document.createRange().createContextualFragment(text); + // Normalize block level elements children first + Array.from(doc.children) + .filter(elem => !inlineElems.has(elem.localName)) + .filter(elem => elem.localName !== "pre") + .filter(elem => elem.localName !== "table") + .forEach(elem => { + elem.innerHTML = normalizePadding(elem.innerHTML); + }); + // Normalize root level now + Array.from(doc.childNodes) + .filter(node => isTextNode(node) && node.textContent.trim() === "") + .forEach(node => node.replaceWith("\n")); + // Normalize text node + if (isElementNode(doc.firstChild)) { + Array.from(doc.firstChild.children) + .filter(child => child.localName !== "table") + .forEach(child => { + child.innerHTML = normalizePadding(child.innerHTML); + }); + } + doc.normalize(); + // use the first space as an indicator of how much to chop off the front + const firstSpace = doc.textContent + .replace(/^ *\n/, "") + .split("\n") + .filter(item => item && item.startsWith(" "))[0]; + const chop = firstSpace ? firstSpace.match(/ +/)[0].length : 0; + if (chop) { + // Chop chop from start, but leave pre elem alone + Array.from(doc.childNodes) + .filter(node => node.nodeName !== "PRE") + .filter(isTextNode) + .filter(node => { + // we care about text next to a block level element + const prevSib = node.previousElementSibling; + const nextTo = prevSib && prevSib.localName; + // and we care about text elements that finish on a new line + return ( + !inlineElems.has(nextTo) || node.textContent.trim().includes("\n") + ); + }) + .reduce((replacer, node) => { + // We need to retain white space if the text Node is next to an in-line element + let padding = ""; + const prevSib = node.previousElementSibling; + const nextTo = prevSib && prevSib.localName; + if (/^[\t ]/.test(node.textContent) && inlineElems.has(nextTo)) { + padding = node.textContent.match(/^\s+/)[0]; + } + node.textContent = padding + node.textContent.replace(replacer, ""); + return replacer; + }, new RegExp(`^ {1,${chop}}`, "gm")); + // deal with pre elements... we can chop whitespace from their siblings + const endsWithSpace = new RegExp(`\\ {${chop}}$`, "gm"); + Array.from(doc.querySelectorAll("pre")) + .map(elem => elem.previousSibling) + .filter(isTextNode) + .reduce((chop, node) => { + if (endsWithSpace.test(node.textContent)) { + node.textContent = node.textContent.substr( + 0, + node.textContent.length - chop + ); + } + return chop; + }, chop); + } + const wrap = document.createElement("body"); + wrap.append(doc); + const result = endsWithSpace.test(wrap.innerHTML) + ? `${wrap.innerHTML.trimRight()}\n` + : wrap.innerHTML; + return result; +} + +/** + * @param {string} text + */ +function markdownToHtml(text) { + const normalizedLeftPad = normalizePadding(text); + // As markdown is pulled from HTML, > and & are already escaped and + // so blockquotes aren't picked up by the parser. This fixes it. + const potentialMarkdown = normalizedLeftPad + .replace(gtEntity, ">") + .replace(ampEntity, "&"); + // @ts-ignore + const result = marked$1(potentialMarkdown, { + sanitize: false, + gfm: true, + headerIds: false, + renderer: new Renderer(), + }); + return result; +} + +function processElements(selector) { + return element => { + const elements = Array.from(element.querySelectorAll(selector)); + elements.reverse().forEach(element => { + element.innerHTML = markdownToHtml(element.innerHTML); + }); + return elements; + }; +} + +class Builder { + constructor(doc) { + this.doc = doc; + this.root = doc.createDocumentFragment(); + this.stack = [this.root]; + this.current = this.root; + } + findPosition(header) { + return parseInt(header.tagName.charAt(1), 10); + } + findParent(position) { + let parent; + while (position > 0) { + position--; + parent = this.stack[position]; + if (parent) return parent; + } + } + findHeader({ firstChild: node }) { + while (node) { + if (/H[1-6]/.test(node.tagName)) { + return node; + } + node = node.nextSibling; + } + return null; + } + + addHeader(header) { + const section = this.doc.createElement("section"); + const position = this.findPosition(header); + + section.appendChild(header); + this.findParent(position).appendChild(section); + this.stack[position] = section; + this.stack.length = position + 1; + this.current = section; + } + + addSection(node, process) { + const header = this.findHeader(node); + const position = header ? this.findPosition(header) : 1; + const parent = this.findParent(position); + + if (header) { + node.removeChild(header); + } + + node.appendChild(process(node)); + + if (header) { + node.prepend(header); + } + + parent.appendChild(node); + this.current = parent; + } + + addElement(node) { + this.current.appendChild(node); + } +} + +function structure(fragment, doc) { + function process(root) { + const stack = new Builder(doc); + while (root.firstChild) { + const node = root.firstChild; + if (node.nodeType !== Node.ELEMENT_NODE) { + root.removeChild(node); + continue; + } + switch (node.localName) { + case "h1": + case "h2": + case "h3": + case "h4": + case "h5": + case "h6": + stack.addHeader(node); + break; + case "section": + stack.addSection(node, process); + break; + default: + stack.addElement(node); + } + } + return stack.root; + } + return process(fragment); +} + +/** + * @param {Iterable} elements + */ +function substituteWithTextNodes(elements) { + Array.from(elements).forEach(element => { + element.replaceWith(element.textContent); + }); +} + +const processMDSections = processElements("[data-format='markdown']:not(body)"); +const processBlockLevelElements = processElements( + "[data-format=markdown]:not(body), section, div, address, article, aside, figure, header, main, body" +); + +function run$1(conf) { + const hasMDSections = !!document.querySelector( + "[data-format=markdown]:not(body)" + ); + const isMDFormat = conf.format === "markdown"; + if (!isMDFormat && !hasMDSections) { + return; // Nothing to be done + } + // Only has markdown-format sections + if (!isMDFormat) { + processMDSections(document.body) + .map(elem => { + const structuredInternals = structure(elem, elem.ownerDocument); + return { + structuredInternals, + elem, + }; + }) + .forEach(({ elem, structuredInternals }) => { + elem.setAttribute("aria-busy", "true"); + if ( + structuredInternals.firstElementChild.localName === "section" && + elem.localName === "section" + ) { + const section = structuredInternals.firstElementChild; + section.remove(); + elem.append(...section.childNodes); + } else { + elem.textContent = ""; + } + elem.appendChild(structuredInternals); + elem.setAttribute("aria-busy", "false"); + }); + return; + } + // We transplant the UI to do the markdown processing + const rsUI = document.getElementById("respec-ui"); + rsUI.remove(); + // The new body will replace the old body + const newHTML = document.createElement("html"); + const newBody = document.createElement("body"); + newBody.innerHTML = document.body.innerHTML; + // Marked expects markdown be flush against the left margin + // so we need to normalize the inner text of some block + // elements. + newHTML.appendChild(newBody); + processBlockLevelElements(newHTML); + // Process root level text nodes + const cleanHTML = newBody.innerHTML + // Markdown parsing sometimes inserts empty p tags + .replace(/

    \s*<\/p>/gm, ""); + newBody.innerHTML = cleanHTML; + // Remove links where class .nolinks + substituteWithTextNodes(newBody.querySelectorAll(".nolinks a[href]")); + // Restructure the document properly + const fragment = structure(newBody, document); + // Frankenstein the whole thing back together + newBody.appendChild(fragment); + newBody.prepend(rsUI); + document.body.replaceWith(newBody); +} + +var markdown = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$3, + markdownToHtml: markdownToHtml, + run: run$1 +}); + +/** + * www.openjs.com/scripts/events/keyboard_shortcuts/ + * Version : 2.01.B + * By Binny V A + * License : BSD + */ +var shortcut = { + all_shortcuts: {}, //All the shortcuts are stored in this array + add: function(shortcut_combination, callback, opt) { + //Provide a set of default options + var default_options = { + type: "keydown", + propagate: false, + disable_in_input: false, + target: document, + keycode: false, + }; + if (!opt) { + opt = default_options; + } else { + for (var dfo in default_options) { + if (typeof opt[dfo] == "undefined") opt[dfo] = default_options[dfo]; + } + } + + var ele = opt.target; + if (typeof opt.target == "string") + ele = document.getElementById(opt.target); + shortcut_combination = shortcut_combination.toLowerCase(); + + //The function to be called at keypress + var func = function(e) { + var code; + e = e || window.event; + + if (opt["disable_in_input"]) { + //Don't enable shortcut keys in Input, Textarea fields + var element; + if (e.target) element = e.target; + else if (e.srcElement) element = e.srcElement; + if (element.nodeType == 3) element = element.parentNode; + + if (element.tagName == "INPUT" || element.tagName == "TEXTAREA") return; + } + + //Find Which key is pressed + if (e.keyCode) code = e.keyCode; + else if (e.which) code = e.which; + var character = String.fromCharCode(code).toLowerCase(); + + if (code == 188) character = ","; //If the user presses , when the type is onkeydown + if (code == 190) character = "."; //If the user presses , when the type is onkeydown + + var keys = shortcut_combination.split("+"); + //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked + var kp = 0; + + //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken + var shift_nums = { + "`": "~", + "1": "!", + "2": "@", + "3": "#", + "4": "$", + "5": "%", + "6": "^", + "7": "&", + "8": "*", + "9": "(", + "0": ")", + "-": "_", + "=": "+", + ";": ":", + "'": '"', + ",": "<", + ".": ">", + "/": "?", + "\\": "|", + }; + //Special Keys - and their codes + var special_keys = { + esc: 27, + escape: 27, + tab: 9, + space: 32, + return: 13, + enter: 13, + backspace: 8, + + scrolllock: 145, + scroll_lock: 145, + scroll: 145, + capslock: 20, + caps_lock: 20, + caps: 20, + numlock: 144, + num_lock: 144, + num: 144, + + pause: 19, + break: 19, + + insert: 45, + home: 36, + delete: 46, + end: 35, + + pageup: 33, + page_up: 33, + pu: 33, + + pagedown: 34, + page_down: 34, + pd: 34, + + left: 37, + up: 38, + right: 39, + down: 40, + + f1: 112, + f2: 113, + f3: 114, + f4: 115, + f5: 116, + f6: 117, + f7: 118, + f8: 119, + f9: 120, + f10: 121, + f11: 122, + f12: 123, + }; + + var modifiers = { + shift: { wanted: false, pressed: false }, + ctrl: { wanted: false, pressed: false }, + alt: { wanted: false, pressed: false }, + meta: { wanted: false, pressed: false }, //Meta is Mac specific + }; + + if (e.ctrlKey) modifiers.ctrl.pressed = true; + if (e.shiftKey) modifiers.shift.pressed = true; + if (e.altKey) modifiers.alt.pressed = true; + if (e.metaKey) modifiers.meta.pressed = true; + + for (var i = 0, k; (k = keys[i]), i < keys.length; i++) { + //Modifiers + if (k == "ctrl" || k == "control") { + kp++; + modifiers.ctrl.wanted = true; + } else if (k == "shift") { + kp++; + modifiers.shift.wanted = true; + } else if (k == "alt") { + kp++; + modifiers.alt.wanted = true; + } else if (k == "meta") { + kp++; + modifiers.meta.wanted = true; + } else if (k.length > 1) { + //If it is a special key + if (special_keys[k] == code) kp++; + } else if (opt["keycode"]) { + if (opt["keycode"] == code) kp++; + } else { + //The special keys did not match + if (character == k) kp++; + else { + if (shift_nums[character] && e.shiftKey) { + //Stupid Shift key bug created by using lowercase + character = shift_nums[character]; + if (character == k) kp++; + } + } + } + } + + if ( + kp == keys.length && + modifiers.ctrl.pressed == modifiers.ctrl.wanted && + modifiers.shift.pressed == modifiers.shift.wanted && + modifiers.alt.pressed == modifiers.alt.wanted && + modifiers.meta.pressed == modifiers.meta.wanted + ) { + callback(e); + + if (!opt["propagate"]) { + //Stop the event + //e.cancelBubble is supported by IE - this will kill the bubbling process. + e.cancelBubble = true; + e.returnValue = false; + + //e.stopPropagation works in Firefox. + if (e.stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + } + return false; + } + } + }; + this.all_shortcuts[shortcut_combination] = { + callback: func, + target: ele, + event: opt["type"], + }; + //Attach the function with the event + if (ele.addEventListener) ele.addEventListener(opt["type"], func, false); + else if (ele.attachEvent) ele.attachEvent("on" + opt["type"], func); + else ele["on" + opt["type"]] = func; + }, + + //Remove the shortcut - just specify the shortcut and I will remove the binding + // 'remove':function(shortcut_combination) { + // shortcut_combination = shortcut_combination.toLowerCase(); + // var binding = this.all_shortcuts[shortcut_combination]; + // delete(this.all_shortcuts[shortcut_combination]) + // if(!binding) return; + // var type = binding['event']; + // var ele = binding['target']; + // var callback = binding['callback']; + // + // if(ele.detachEvent) ele.detachEvent('on'+type, callback); + // else if(ele.removeEventListener) ele.removeEventListener(type, callback, false); + // else ele['on'+type] = false; + // } +}; + +// @ts-check +const name$4 = "core/ui"; + +// Opportunistically inserts the style, with the chance to reduce some FOUC +insertStyle(); + +async function loadStyle() { + try { + return (await Promise.resolve().then(function () { return ui$3; })).default; + } catch { + return fetchAsset("ui.css"); + } +} + +async function insertStyle() { + const styleElement = document.createElement("style"); + styleElement.id = "respec-ui-styles"; + styleElement.textContent = await loadStyle(); + styleElement.classList.add("removeOnSave"); + document.head.appendChild(styleElement); + return styleElement; +} + +function ariaDecorate(elem, ariaMap) { + if (!elem) { + return; + } + Array.from(ariaMap).forEach(([name, value]) => { + elem.setAttribute(`aria-${name}`, value); + }); +} + +const respecUI = hyperHTML`

    `; +const menu = hyperHTML``; +let modal; +let overlay; +const errors = []; +const warnings = []; +const buttons = {}; + +sub("start-all", () => document.body.prepend(respecUI), { once: true }); +sub("end-all", () => document.body.prepend(respecUI), { once: true }); + +const respecPill = hyperHTML``; +respecUI.appendChild(respecPill); +respecPill.addEventListener("click", e => { + e.stopPropagation(); + if (menu.hidden) { + menu.classList.remove("respec-hidden"); + menu.classList.add("respec-visible"); + } else { + menu.classList.add("respec-hidden"); + menu.classList.remove("respec-visible"); + } + respecPill.setAttribute("aria-expanded", String(menu.hidden)); + menu.hidden = !menu.hidden; +}); +document.documentElement.addEventListener("click", () => { + if (!menu.hidden) { + menu.classList.remove("respec-visible"); + menu.classList.add("respec-hidden"); + menu.hidden = true; + } +}); +respecUI.appendChild(menu); + +const ariaMap = new Map([ + ["controls", "respec-menu"], + ["expanded", "false"], + ["haspopup", "true"], + ["label", "ReSpec Menu"], +]); +ariaDecorate(respecPill, ariaMap); + +function errWarn(msg, arr, butName, title) { + arr.push(msg); + if (!buttons.hasOwnProperty(butName)) { + buttons[butName] = createWarnButton(butName, arr, title); + respecUI.appendChild(buttons[butName]); + } + buttons[butName].textContent = arr.length; +} + +function createWarnButton(butName, arr, title) { + const buttonId = `respec-pill-${butName}`; + const button = hyperHTML``; + const menuItem = hyperHTML`
  • ${button}
  • `; + menuItem.addEventListener("click", handler); + menu.appendChild(menuItem); + if (keyShort) shortcut.add(keyShort, handler); + return button; + }, + error(msg) { + errWarn(msg, errors, "error", "Errors"); + }, + warning(msg) { + errWarn(msg, warnings, "warning", "Warnings"); + }, + closeModal(owner) { + if (overlay) { + overlay.classList.remove("respec-show-overlay"); + overlay.classList.add("respec-hide-overlay"); + overlay.addEventListener("transitionend", () => { + overlay.remove(); + overlay = null; + }); + } + if (owner) { + owner.setAttribute("aria-expanded", "false"); + } + if (!modal) return; + modal.remove(); + modal = null; + }, + freshModal(title, content, currentOwner) { + if (modal) modal.remove(); + if (overlay) overlay.remove(); + overlay = hyperHTML`
    `; + const id = `${currentOwner.id}-modal`; + const headingId = `${id}-heading`; + modal = hyperHTML``; + const ariaMap = new Map([["labelledby", headingId]]); + ariaDecorate(modal, ariaMap); + document.body.append(overlay, modal); + overlay.addEventListener("click", () => this.closeModal(currentOwner)); + overlay.classList.toggle("respec-show-overlay"); + modal.hidden = false; + }, +}; +shortcut.add("Esc", () => ui.closeModal()); +shortcut.add("Ctrl+Alt+Shift+E", () => { + if (buttons.error) buttons.error.click(); +}); +shortcut.add("Ctrl+Alt+Shift+W", () => { + if (buttons.warning) buttons.warning.click(); +}); +window.respecUI = ui; +sub("error", details => ui.error(details)); +sub("warn", details => ui.warning(details)); + +var ui$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$4, + ui: ui +}); + +// @ts-check +/** + * Removes common indents across the IDL texts, + * so that indentation inside
     won't affect the rendered result.
    + * @param {string} text IDL text
    + */
    +
    +const name$5 = "core/reindent";
    +
    +/**
    + * @param {string} text
    + */
    +function reindent(text) {
    +  if (!text) {
    +    return text;
    +  }
    +  // TODO: use trimEnd when Edge supports it
    +  const lines = text.trimRight().split("\n");
    +  while (lines.length && !lines[0].trim()) {
    +    lines.shift();
    +  }
    +  const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\s]/));
    +  const leastIndent = Math.min(...indents);
    +  return lines.map(s => s.slice(leastIndent)).join("\n");
    +}
    +
    +function run$2() {
    +  for (const pre of document.getElementsByTagName("pre")) {
    +    pre.innerHTML = reindent(pre.innerHTML);
    +  }
    +}
    +
    +var reindent$1 = /*#__PURE__*/Object.freeze({
    +  __proto__: null,
    +  name: name$5,
    +  run: run$2
    +});
    +
    +// @ts-check
    +const name$6 = "core/location-hash";
    +
    +function run$3() {
    +  // Added message for legacy compat with Aria specs
    +  // See https://github.com/w3c/respec/issues/793
    +  pub("start", "core/location-hash");
    +  if (!location.hash) {
    +    return;
    +  }
    +  document.respecIsReady.then(() => {
    +    let hash = decodeURIComponent(location.hash).substr(1);
    +    const hasLink = document.getElementById(hash);
    +    const isLegacyFrag = /\W/.test(hash);
    +    // Allow some degree of recovery for legacy fragments format.
    +    // See https://github.com/w3c/respec/issues/1353
    +    if (!hasLink && isLegacyFrag) {
    +      const id = hash
    +        .replace(/[\W]+/gim, "-")
    +        .replace(/^-+/, "")
    +        .replace(/-+$/, "");
    +      if (document.getElementById(id)) {
    +        hash = id;
    +      }
    +    }
    +    location.hash = `#${hash}`;
    +  });
    +}
    +
    +var locationHash = /*#__PURE__*/Object.freeze({
    +  __proto__: null,
    +  name: name$6,
    +  run: run$3
    +});
    +
    +// @ts-check
    +/**
    + * @typedef {object} LinterResult
    + * @property {string} description
    + * @property {string} help
    + * @property {string} howToFix
    + * @property {string} name
    + * @property {number} occurrences
    + * @property {HTMLElement[]} offendingElements
    + *
    + * @typedef {(conf: any, doc: Document) => (LinterResult | Promise)} LintingFunction
    + */
    +
    +/** @type {WeakMap} */
    +const privs = new WeakMap();
    +
    +/**
    + * Checks if the linter rule is enabled.
    + *
    + * @param {Object} conf ReSpec config object.
    + * @param {string} name linter rule name
    + */
    +function canLint(conf, name) {
    +  return !(
    +    conf.hasOwnProperty("lint") === false ||
    +    conf.lint === false ||
    +    !conf.lint[name]
    +  );
    +}
    +
    +class LinterRule {
    +  /**
    +   *
    +   * @param {String} name the name of the rule
    +   * @param {LintingFunction} lintingFunction
    +   */
    +  constructor(name, lintingFunction) {
    +    privs.set(this, { name, lintingFunction });
    +  }
    +  get name() {
    +    return privs.get(this).name;
    +  }
    +  /**
    +   * Runs linter rule.
    +   *
    +   * @param {Object} conf The ReSpec config.
    +   * @param {Document} doc The document to be checked.
    +   */
    +  lint(conf = { lint: { [this.name]: false } }, doc = document) {
    +    if (canLint(conf, this.name)) {
    +      return privs.get(this).lintingFunction(conf, doc);
    +    }
    +  }
    +}
    +
    +// @ts-check
    +
    +const name$7 = "check-charset";
    +const meta = {
    +  en: {
    +    description: `Document must only contain one \`\` tag with charset set to 'utf-8'`,
    +    howToFix: `Add this line in your document \`\` section - \`\` or set charset to "utf-8" if not set already.`,
    +  },
    +};
    +
    +// Fall back to english, if language is missing
    +const lang$1 = lang in meta ? lang : "en";
    +
    +/**
    + * Runs linter rule.
    + *
    + * @param {Object} _ The ReSpec config.
    + * @param {Document} doc The document to be checked.
    + */
    +function linterFunction(_, doc) {
    +  const metas = doc.querySelectorAll("meta[charset]");
    +  const val = [];
    +  for (const meta of metas) {
    +    val.push(
    +      meta
    +        .getAttribute("charset")
    +        .trim()
    +        .toLowerCase()
    +    );
    +  }
    +  const utfExists = val.includes("utf-8");
    +
    +  // only a single meta[charset] and is set to utf-8, correct case
    +  if (utfExists && metas.length === 1) {
    +    return [];
    +  }
    +  // if more than one meta[charset] tag defined along with utf-8
    +  // or
    +  // no meta[charset] present in the document
    +  return {
    +    name: name$7,
    +    occurrences: metas.length,
    +    ...meta[lang$1],
    +  };
    +}
    +const rule = new LinterRule(name$7, linterFunction);
    +
    +// @ts-check
    +
    +const name$8 = "check-internal-slots";
    +
    +const meta$1 = {
    +  en: {
    +    description: "Internal slots should be preceded by a '.'",
    +    howToFix: "Add a '.' between the elements mentioned.",
    +    help: "See developer console.",
    +  },
    +};
    +
    +// Fall back to english, if language is missing
    +const lang$2 = lang in meta$1 ? lang : "en";
    +
    +/**
    + * Runs linter rule.
    + * @param {Object} _ The ReSpec config.
    + * @param {Document} doc The document to be checked.
    + * @return {import("../../core/LinterRule").LinterResult}
    + */
    +function linterFunction$1(_, doc) {
    +  const offendingElements = [...doc.querySelectorAll("var+a")].filter(
    +    ({ previousSibling: { nodeName } }) => {
    +      const isPrevVar = nodeName && nodeName === "VAR";
    +      return isPrevVar;
    +    }
    +  );
    +
    +  if (!offendingElements.length) {
    +    return;
    +  }
    +
    +  return {
    +    name: name$8,
    +    offendingElements,
    +    occurrences: offendingElements.length,
    +    ...meta$1[lang$2],
    +  };
    +}
    +
    +const rule$1 = new LinterRule(name$8, linterFunction$1);
    +
    +// @ts-check
    +
    +const name$9 = "check-punctuation";
    +const punctuationMarks = [".", ":", "!", "?"];
    +const humanMarks = punctuationMarks.map(mark => `"${mark}"`).join(", ");
    +const meta$2 = {
    +  en: {
    +    description: "`p` elements should end with a punctuation mark.",
    +    howToFix: `Please make sure \`p\` elements end with one of: ${humanMarks}.`,
    +  },
    +};
    +// Fall back to english, if language is missing
    +const lang$3 = lang in meta$2 ? lang : "en";
    +
    +/**
    + * Runs linter rule.
    + *
    + * @param {Object} _ The ReSpec config.
    + * @param  {Document} doc The document to be checked.
    + * @return {import("../../core/LinterRule").LinterResult}
    + */
    +function lintingFunction(_, doc) {
    +  // Check string ends with one of ., !, ?, :, ], or is empty.
    +  const punctuatingRegExp = new RegExp(
    +    `[${punctuationMarks.join("")}\\]]$|^ *$`,
    +    "m"
    +  );
    +  const offendingElements = [
    +    ...doc.querySelectorAll("p:not(#back-to-top)"),
    +  ].filter(elem => !punctuatingRegExp.test(elem.textContent.trim()));
    +  if (!offendingElements.length) {
    +    return;
    +  }
    +  return {
    +    name: name$9,
    +    offendingElements,
    +    occurrences: offendingElements.length,
    +    ...meta$2[lang$3],
    +  };
    +}
    +const rule$2 = new LinterRule(name$9, lintingFunction);
    +
    +// @ts-check
    +const name$a = "core/linter";
    +
    +/** @type {WeakMap }>} */
    +const privates = new WeakMap();
    +
    +class Linter {
    +  constructor() {
    +    privates.set(this, {
    +      rules: new Set(),
    +    });
    +  }
    +  get rules() {
    +    return privates.get(this).rules;
    +  }
    +  /**
    +   * @param  {...import("./LinterRule").default} newRules
    +   */
    +  register(...newRules) {
    +    newRules.forEach(newRule => this.rules.add(newRule));
    +  }
    +  async lint(conf, doc = window.document) {
    +    const promisesToLint = [...privates.get(this).rules].map(rule =>
    +      toLinterWarning(rule.lint(conf, doc))
    +    );
    +    await promisesToLint;
    +  }
    +}
    +
    +const linter = new Linter();
    +
    +const baseResult = {
    +  name: "unknown",
    +  description: "",
    +  occurrences: 0,
    +  howToFix: "",
    +  offendingElements: [], // DOM Nodes
    +  help: "", // where to get help
    +};
    +
    +/**
    + * @typedef {import("./LinterRule").LinterResult} LinterResult
    + * @param {LinterResult | Promise} [resultPromise]
    + */
    +async function toLinterWarning(resultPromise) {
    +  const result = await resultPromise;
    +  if (!result) {
    +    return;
    +  }
    +  const output = { ...baseResult, ...result };
    +  const {
    +    description,
    +    help,
    +    howToFix,
    +    name,
    +    occurrences,
    +    offendingElements,
    +  } = output;
    +  const message = `Linter (${name}): ${description} ${howToFix} ${help}`;
    +  if (offendingElements.length) {
    +    showInlineWarning(offendingElements, `${message} Occured`);
    +  } else {
    +    pub("warn", `${message} (Count: ${occurrences})`);
    +  }
    +}
    +
    +function run$4(conf) {
    +  if (conf.lint === false) {
    +    return; // nothing to do
    +  }
    +  // return early, continue processing other things
    +  (async () => {
    +    await document.respecIsReady;
    +    try {
    +      await linter.lint(conf, document);
    +    } catch (err) {
    +      console.error("Error ocurred while running the linter", err);
    +    }
    +  })();
    +}
    +
    +var linter$1 = /*#__PURE__*/Object.freeze({
    +  __proto__: null,
    +  name: name$a,
    +  'default': linter,
    +  run: run$4
    +});
    +
    +// @ts-check
    +
    +const name$b = "local-refs-exist";
    +
    +const meta$3 = {
    +  en: {
    +    description: "Broken local reference found in document.",
    +    howToFix: "Please fix the links mentioned.",
    +    help: "See developer console.",
    +  },
    +};
    +
    +// Fall back to english, if language is missing
    +const lang$4 = lang in meta$3 ? lang : "en";
    +
    +/**
    + * Runs linter rule.
    + * @param {Object} _ The ReSpec config.
    + * @param  {Document} doc The document to be checked.
    + * @return {import("../../core/LinterRule").LinterResult}
    + */
    +function linterFunction$2(_, doc) {
    +  const offendingElements = [...doc.querySelectorAll("a[href^='#']")].filter(
    +    isBrokenHyperlink
    +  );
    +  if (!offendingElements.length) {
    +    return;
    +  }
    +  return {
    +    name: name$b,
    +    offendingElements,
    +    occurrences: offendingElements.length,
    +    ...meta$3[lang$4],
    +  };
    +}
    +
    +const rule$3 = new LinterRule(name$b, linterFunction$2);
    +
    +function isBrokenHyperlink(elem) {
    +  const id = elem.getAttribute("href").substring(1);
    +  return !elem.ownerDocument.getElementById(id);
    +}
    +
    +// @ts-check
    +const name$c = "no-headingless-sections";
    +const meta$4 = {
    +  en: {
    +    description: "All sections must start with a `h2-6` element.",
    +    howToFix: "Add a `h2-6` to the offending section or use a `
    `.", + help: "See developer console.", + }, + nl: { + description: "Alle secties moeten beginnen met een `h2-6` element.", + howToFix: + "Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `
    `.", + help: "Zie de developer console.", + }, +}; + +// Fall back to english, if language is missing +const lang$5 = lang in meta$4 ? lang : "en"; +const hasNoHeading = ({ firstElementChild: elem }) => { + return elem === null || /^h[1-6]$/.test(elem.localName) === false; +}; + +/** + * @param {*} _ + * @param {Document} doc + * @return {import("../../core/LinterRule").LinterResult} + */ +function linterFunction$3(_, doc) { + const offendingElements = [...doc.querySelectorAll("section")].filter( + hasNoHeading + ); + if (!offendingElements.length) { + return; + } + return { + name: name$c, + offendingElements, + occurrences: offendingElements.length, + ...meta$4[lang$5], + }; +} +const rule$4 = new LinterRule(name$c, linterFunction$3); + +// @ts-check + +const name$d = "no-http-props"; + +const meta$5 = { + en: { + description: "Insecure URLs are not allowed in `respecConfig`.", + howToFix: "Please change the following properties to 'https://': ", + }, +}; + +// Fall back to english, if language is missing +const lang$6 = lang in meta$5 ? lang : "en"; + +/** + * Runs linter rule. + * + * @param {Object} conf The ReSpec config. + * @param {Document} doc The document to be checked. + */ +function lintingFunction$1(conf, doc) { + // We can only really perform this check over http/https + if (!doc.location.href.startsWith("http")) { + return; + } + const offendingMembers = Object.getOwnPropertyNames(conf) + // this check is cheap, "prevED" is w3c exception. + .filter(key => key.endsWith("URI") || key === "prevED") + // this check is expensive, so separate step + .filter(key => + new URL(conf[key], doc.location.href).href.startsWith("http://") + ); + if (!offendingMembers.length) { + return; + } + /** @type {import("../../core/LinterRule").LinterResult} */ + const result = { + name: name$d, + occurrences: offendingMembers.length, + ...meta$5[lang$6], + }; + result.howToFix += `${offendingMembers + .map(item => `\`${item}\``) + .join(", ")}.`; + return result; +} + +const rule$5 = new LinterRule(name$d, lintingFunction$1); + +// @ts-check +const name$e = "privsec-section"; +const meta$6 = { + en: { + description: + "Document must a 'Privacy and/or Security' Considerations section.", + howToFix: "Add a privacy and/or security considerations section.", + help: + "See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).", + }, +}; + +// Fall back to english, if language is missing +const lang$7 = lang in meta$6 ? lang : "en"; + +function hasPriSecConsiderations(doc) { + return Array.from(doc.querySelectorAll("h2, h3, h4, h5, h6")).some( + ({ textContent: text }) => { + const saysPrivOrSec = /(privacy|security)/im.test(text); + const saysConsiderations = /(considerations)/im.test(text); + return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec; + } + ); +} + +/** + * @param {*} conf + * @param {Document} doc + * @return {import("../LinterRule").LinterResult} + */ +function lintingFunction$2(conf, doc) { + if (conf.isRecTrack && !hasPriSecConsiderations(doc)) { + return { name: name$e, occurrences: 1, ...meta$6[lang$7] }; + } +} + +const rule$6 = new LinterRule(name$e, lintingFunction$2); + +// @ts-check + +linter.register( + rule$5, + rule$4, + rule$2, + rule$3, + rule$1, + rule, + rule$6 +); + +const coreDefaults = { + lint: { + "no-headingless-sections": true, + "no-http-props": true, + "check-punctuation": false, + "local-refs-exist": true, + "check-internal-slots": false, + "check-charset": false, + "privsec-section": false, + }, + pluralize: false, + specStatus: "base", + highlightVars: true, + addSectionLinks: true, +}; + +// @ts-check + +/** @type {Record} */ +const definitionMap = Object.create(null); + +/** + * @param {HTMLElement} dfn A definition element to register + * @param {string[]} names Names to register the element by + */ +function registerDefinition(dfn, names) { + for (const name of names.map(name => name.toLowerCase())) { + if (name in definitionMap === false) { + definitionMap[name] = [dfn]; + } else if (!definitionMap[name].includes(dfn)) { + definitionMap[name].push(dfn); + } + } +} + +// @ts-check +/** + * Sets the defaults for W3C specs + */ +const name$f = "w3c/defaults"; + +linter.register(rule$6); + +const w3cDefaults = { + lint: { + "privsec-section": true, + }, + pluralize: true, + doJsonLd: false, + license: "w3c-software-doc", + logos: [ + { + src: "https://www.w3.org/StyleSheets/TR/2016/logos/W3C", + alt: "W3C", + height: 48, + width: 72, + url: "https://www.w3.org/", + }, + ], + xref: true, +}; + +function run$5(conf) { + if (conf.specStatus === "unofficial") return; + // assign the defaults + const lint = + conf.lint === false + ? false + : { + ...coreDefaults.lint, + ...w3cDefaults.lint, + ...conf.lint, + }; + Object.assign(conf, { + ...coreDefaults, + ...w3cDefaults, + ...conf, + lint, + }); + + // TODO: eventually, we want to remove this. + // It's here for legacy support of json-ld specs + // see https://github.com/w3c/respec/issues/2019 + Object.assign(conf, { definitionMap }); +} + +var defaults = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$f, + run: run$5 +}); + +// @ts-check +const name$g = "core/style"; + +// Opportunistically inserts the style, with the chance to reduce some FOUC +const styleElement = insertStyle$1(); + +async function loadStyle$1() { + try { + return (await Promise.resolve().then(function () { return respec2$1; })).default; + } catch { + return fetchAsset("respec2.css"); + } +} + +async function insertStyle$1() { + const styleElement = document.createElement("style"); + styleElement.id = "respec-mainstyle"; + styleElement.textContent = await loadStyle$1(); + document.head.appendChild(styleElement); + return styleElement; +} + +async function run$6(conf) { + if (conf.noReSpecCSS) { + (await styleElement).remove(); + } +} + +var style = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$g, + run: run$6 +}); + +// @ts-check +const name$h = "w3c/style"; +function attachFixupScript(doc, version) { + const script = doc.createElement("script"); + if (location.hash) { + script.addEventListener( + "load", + () => { + window.location.href = location.hash; + }, + { once: true } + ); + } + script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`; + doc.body.appendChild(script); +} + +/** + * Make a best effort to attach meta viewport at the top of the head. + * Other plugins might subsequently push it down, but at least we start + * at the right place. When ReSpec exports the HTML, it again moves the + * meta viewport to the top of the head - so to make sure it's the first + * thing the browser sees. See js/ui/save-html.js. + */ +function createMetaViewport() { + const meta = document.createElement("meta"); + meta.name = "viewport"; + const contentProps = { + width: "device-width", + "initial-scale": "1", + "shrink-to-fit": "no", + }; + meta.content = toKeyValuePairs(contentProps).replace(/"/g, ""); + return meta; +} + +function createBaseStyle() { + const link = document.createElement("link"); + link.rel = "stylesheet"; + link.href = "https://www.w3.org/StyleSheets/TR/2016/base.css"; + link.classList.add("removeOnSave"); + return link; +} + +function selectStyleVersion(styleVersion) { + let version = ""; + switch (styleVersion) { + case null: + case true: + version = "2016"; + break; + default: + if (styleVersion && !isNaN(styleVersion)) { + version = styleVersion.toString().trim(); + } + } + return version; +} + +function createResourceHints() { + const resourceHints = [ + { + hint: "preconnect", // for W3C styles and scripts. + href: "https://www.w3.org", + }, + { + hint: "preload", // all specs need it, and we attach it on end-all. + href: "https://www.w3.org/scripts/TR/2016/fixup.js", + as: "script", + }, + { + hint: "preload", // all specs include on base.css. + href: "https://www.w3.org/StyleSheets/TR/2016/base.css", + as: "style", + }, + { + hint: "preload", // all specs show the logo. + href: "https://www.w3.org/StyleSheets/TR/2016/logos/W3C", + as: "image", + }, + ] + .map(createResourceHint) + .reduce((frag, link) => { + frag.appendChild(link); + return frag; + }, document.createDocumentFragment()); + return resourceHints; +} +// Collect elements for insertion (document fragment) +const elements = createResourceHints(); + +// Opportunistically apply base style +elements.appendChild(createBaseStyle()); +if (!document.head.querySelector("meta[name=viewport]")) { + // Make meta viewport the first element in the head. + elements.prepend(createMetaViewport()); +} + +document.head.prepend(elements); + +function styleMover(linkURL) { + return exportDoc => { + const w3cStyle = exportDoc.querySelector(`head link[href="${linkURL}"]`); + exportDoc.querySelector("head").append(w3cStyle); + }; +} + +function run$7(conf) { + if (!conf.specStatus) { + const warn = "`respecConfig.specStatus` missing. Defaulting to 'base'."; + conf.specStatus = "base"; + pub("warn", warn); + } + + let styleFile = "W3C-"; + + // Figure out which style file to use. + switch (conf.specStatus.toUpperCase()) { + case "CG-DRAFT": + case "CG-FINAL": + case "BG-DRAFT": + case "BG-FINAL": + styleFile = conf.specStatus.toLowerCase(); + break; + case "FPWD": + case "LC": + case "WD-NOTE": + case "LC-NOTE": + styleFile += "WD"; + break; + case "WG-NOTE": + case "FPWD-NOTE": + styleFile += "WG-NOTE.css"; + break; + case "UNOFFICIAL": + styleFile += "UD"; + break; + case "FINDING": + case "FINDING-DRAFT": + case "BASE": + styleFile = "base.css"; + break; + default: + styleFile += conf.specStatus; + } + + // Select between released styles and experimental style. + const version = selectStyleVersion(conf.useExperimentalStyles || "2016"); + // Attach W3C fixup script after we are done. + if (version && !conf.noToc) { + sub( + "end-all", + () => { + attachFixupScript(document, version); + }, + { once: true } + ); + } + const finalVersionPath = version ? `${version}/` : ""; + const finalStyleURL = `https://www.w3.org/StyleSheets/TR/${finalVersionPath}${styleFile}`; + linkCSS(document, finalStyleURL); + // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules. + const moveStyle = styleMover(finalStyleURL); + sub("beforesave", moveStyle); +} + +var style$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$h, + run: run$7 +}); + +// @ts-check +const name$i = "w3c/l10n"; +const additions = { + en: { + status_at_publication: + "This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.", + }, + ko: { + status_at_publication: + "This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.", + }, + zh: { + status_at_publication: + "本章节描述了本文档的发布状态。其它更新版本可能会覆盖本文档。W3C的文档列 表和最新版本可通过W3C技术报告索引访问。", + }, + ja: { + status_at_publication: + "この節には、公開時点でのこの文書の位置づけが記されている。他の文書によって置き換えられる可能性がある。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 W3C technical reports index (https://www.w3.org/TR/)", + }, + nl: { + status_at_publication: + "This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.", + }, + es: { + status_at_publication: + "Esta sección describe el estado del presente documento al momento de su publicación. El presente documento puede ser remplazado por otros. Una lista de las publicaciones actuales del W3C y la última revisión del presente informe técnico puede hallarse en http://www.w3.org/TR/ el índice de informes técnicos del W3C.", + }, +}; + +Object.keys(additions).forEach(key => { + Object.assign(l10n[key], additions[key]); +}); + +var l10n$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$i +}); + +// @ts-check +const name$j = "core/github"; + +let resolveGithubPromise; +let rejectGithubPromise; +/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */ +const github = new Promise((resolve, reject) => { + resolveGithubPromise = resolve; + rejectGithubPromise = message => { + pub("error", message); + reject(new Error(message)); + }; +}); + +const localizationStrings = { + en: { + file_a_bug: "File a bug", + participate: "Participate", + commit_history: "Commit history", + }, + nl: { + commit_history: "Revisiehistorie", + file_a_bug: "Dien een melding in", + participate: "Doe mee", + }, + es: { + commit_history: "Historia de cambios", + file_a_bug: "Nota un bug", + participate: "Participe", + }, +}; +const lang$8 = lang in localizationStrings ? lang : "en"; +const l10n$3 = localizationStrings[lang$8]; + +async function run$8(conf) { + if (!conf.hasOwnProperty("github") || !conf.github) { + // nothing to do, bail out. + resolveGithubPromise(null); + return; + } + if ( + typeof conf.github === "object" && + !conf.github.hasOwnProperty("repoURL") + ) { + const msg = + "Config option `[github](https://github.com/w3c/respec/wiki/github)` " + + "is missing property `repoURL`."; + rejectGithubPromise(msg); + return; + } + let tempURL = conf.github.repoURL || conf.github; + if (!tempURL.endsWith("/")) tempURL += "/"; + let ghURL; + try { + ghURL = new URL(tempURL, "https://github.com"); + } catch { + const msg = `\`respecConf.github\` is not a valid URL? (${ghURL})`; + rejectGithubPromise(msg); + return; + } + if (ghURL.origin !== "https://github.com") { + const msg = `\`respecConf.github\` must be HTTPS and pointing to GitHub. (${ghURL})`; + rejectGithubPromise(msg); + return; + } + const [org, repo] = ghURL.pathname.split("/").filter(item => item); + if (!org || !repo) { + const msg = + "`respecConf.github` URL needs a path with, for example, w3c/my-spec"; + rejectGithubPromise(msg); + return; + } + const branch = conf.github.branch || "gh-pages"; + const issueBase = new URL("./issues/", ghURL).href; + const newProps = { + edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`, + githubToken: undefined, + githubUser: undefined, + issueBase, + atRiskBase: issueBase, + otherLinks: [], + pullBase: new URL("./pulls/", ghURL).href, + shortName: repo, + }; + const otherLink = { + key: l10n$3.participate, + data: [ + { + value: `GitHub ${org}/${repo}`, + href: ghURL, + }, + { + value: l10n$3.file_a_bug, + href: newProps.issueBase, + }, + { + value: l10n$3.commit_history, + href: new URL(`./commits/${branch}`, ghURL.href).href, + }, + { + value: "Pull requests", + href: newProps.pullBase, + }, + ], + }; + // Assign new properties, but retain existing ones + let githubAPI = "https://respec.org/github"; + if (conf.githubAPI) { + if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) { + // for testing + githubAPI = conf.githubAPI; + } else { + const msg = "`respecConfig.githubAPI` should not be added manually."; + pub("warn", msg); + } + } + const normalizedGHObj = { + branch, + repoURL: ghURL.href, + apiBase: githubAPI, + fullName: `${org}/${repo}`, + }; + resolveGithubPromise(normalizedGHObj); + + const normalizedConfig = { + ...newProps, + ...conf, + github: normalizedGHObj, + githubAPI, + }; + Object.assign(conf, normalizedConfig); + conf.otherLinks.unshift(otherLink); +} + +var github$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$j, + github: github, + run: run$8 +}); + +// @ts-check + +const name$k = "core/data-include"; + +function processResponse(rawData, id, url) { + /** @type {HTMLElement} */ + const el = document.querySelector(`[data-include-id=${id}]`); + const doc = el.ownerDocument; + const data = runTransforms(rawData, el.dataset.oninclude, url); + const replace = typeof el.dataset.includeReplace === "string"; + let replacementNode; + switch (el.dataset.includeFormat) { + case "text": + if (replace) { + replacementNode = doc.createTextNode(data); + el.replaceWith(replacementNode); + } else { + el.textContent = data; + } + break; + default: + // html, which is just using "innerHTML" + el.innerHTML = data; + if (replace) { + replacementNode = doc.createDocumentFragment(); + while (el.hasChildNodes()) { + replacementNode.append(el.removeChild(el.firstChild)); + } + el.replaceWith(replacementNode); + } + } + // If still in the dom tree, clean up + if (doc.contains(el)) { + cleanUp(el); + } +} +/** + * Removes attributes after they are used for inclusion, if present. + * + * @param {Element} el The element to clean up. + */ +function cleanUp(el) { + [ + "data-include", + "data-include-format", + "data-include-replace", + "data-include-id", + "oninclude", + ].forEach(attr => el.removeAttribute(attr)); +} + +async function run$9() { + /** @type {NodeListOf} */ + const includables = document.querySelectorAll("[data-include]"); + + const promisesToInclude = Array.from(includables).map(async el => { + const url = el.dataset.include; + if (!url) { + return; // just skip it + } + const id = `include-${String(Math.random()).substr(2)}`; + el.dataset.includeId = id; + try { + const response = await fetch(url); + const text = await response.text(); + processResponse(text, id, url); + } catch (err) { + const msg = `\`data-include\` failed: \`${url}\` (${err.message}). See console for details.`; + console.error("data-include failed for element: ", el, err); + pub("error", msg); + } + }); + await Promise.all(promisesToInclude); +} + +var dataInclude = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$k, + run: run$9 +}); + +// @ts-check + +var showLink = link => { + if (!link.key) { + const msg = + "Found a link without `key` attribute in the configuration. See dev console."; + pub("warn", msg); + console.warn("warn", msg, link); + return; + } + const fragment = hyperHTML` +
    ${link.key}:
    + ${link.data ? link.data.map(showLinkData) : showLinkData(link)} + `; + if (link.class) { + fragment.classList.add(link.class); + } + return fragment; +}; + +function showLinkData(data) { + const fragment = hyperHTML` +
    + ${data.href + ? hyperHTML` + ${data.value || data.href} + ` + : ""}
    - `}var showLogo=e=>{const t=hyperHTML$1` - - `;e.alt||showInlineWarning(t,"Found spec logo without an `alt` attribute");const n=hyperHTML$1` + `; + if (data.class) { + fragment.classList.add(data.class); + } + return fragment; +} + +// @ts-check + +var showLogo = obj => { + /** @type {HTMLAnchorElement} */ + // @ts-ignore force type assertion + const a = hyperHTML` + + `; + if (!obj.alt) { + showInlineWarning(a, "Found spec logo without an `alt` attribute"); + } + /** @type {HTMLImageElement} */ + // @ts-ignore force type assertion + const img = hyperHTML` ${e.alt} - `;return n.src=e.src,t.append(n),t};const localizationStrings$1={en:{until:"Until"},es:{until:"Hasta"}},lang$9=lang in localizationStrings$1?lang:"en";var showPeople=(e=[])=>{const t=localizationStrings$1[lang$9];return e.map((function(e){const r=[e.name],o=[e.company],i=e.w3cid?parseInt(e.w3cid,10):null,a=hyperHTML$1` -
    - `,s=document.createDocumentFragment(),c=[];e.mailto?c.push(hyperHTML$1` - { + const l10n = localizationStrings$1[lang$9]; + return items.map(getItem); + + function getItem(p) { + const personName = raw(p.name); + const company = raw(p.company); + /** @type {HTMLElement} */ + const dd = hyperHTML` +
    + `; + if (p.w3cid) { + dd.dataset.editorId = String(parseInt(p.w3cid, 10)); + } + const contents = []; + if (p.mailto) { + contents.push(hyperHTML` + - `):e.url?c.push(hyperHTML$1` - ${r} - `):c.push(hyperHTML$1` - ${r} - `);e.orcid&&c.push(hyperHTML$1` - ${personName} + `); + } else { + contents.push( + hyperHTML` + ${personName} + ` + ); + } + if (p.orcid) { + contents.push( + hyperHTML` + - `);e.company&&(e.companyURL?c.push(hyperHTML$1` - (${o}${company}) - `):c.push(hyperHTML$1` - (${o}) - `));e.note&&c.push(document.createTextNode(` (${e.note})`));if(e.extras){const t=e.extras.filter(e=>e.name&&e.name.trim()).map(n);for(const e of t)c.push(document.createTextNode(", "),e)}if(e.retiredDate){const n=new Date(e.retiredDate),r="Invalid Date"!==n.toString(),o=document.createElement("time");o.textContent=r?humanDate(n):"Invalid Date",r||showInlineError(o,"The date is invalid. The expected format is YYYY-MM-DD.","Invalid date"),o.dateTime=toShortIsoDate(n),c.push(hyperHTML$1` - - ${t.until.concat(" ")}${[o]} - `)}return hyperHTML$1.bind(s)`${c}`,a.appendChild(s),a}));function n(e){const t=hyperHTML$1` - - `;let n=t;return e.href&&(n=hyperHTML$1` - - `,t.appendChild(n)),n.textContent=e.name,t}},cgbgHeadersTmpl=e=>hyperHTML$1` + ` + ); + } else { + contents.push( + hyperHTML` + (${company}) + ` + ); + } + } + if (p.note) contents.push(document.createTextNode(` (${p.note})`)); + if (p.extras) { + const results = p.extras + // Remove empty names + .filter(extra => extra.name && extra.name.trim()) + // Convert to HTML + .map(getExtra); + for (const result of results) { + contents.push(document.createTextNode(", "), result); + } + } + if (p.retiredDate) { + const retiredDate = new Date(p.retiredDate); + const isValidDate = retiredDate.toString() !== "Invalid Date"; + const timeElem = document.createElement("time"); + timeElem.textContent = isValidDate + ? humanDate(retiredDate) + : "Invalid Date"; // todo: Localise invalid date + if (!isValidDate) { + showInlineError( + timeElem, + "The date is invalid. The expected format is YYYY-MM-DD.", + "Invalid date" + ); + } + timeElem.dateTime = toShortIsoDate(retiredDate); + contents.push( + hyperHTML` + - ${l10n.until.concat(" ")}${timeElem} + ` + ); + } + + dd.append(...contents); + return dd; + } + + function getExtra(extra) { + const span = document.createElement("span"); + if (extra.class) { + span.classList.add(extra.class); + } + let textContainer = span; + if (extra.href) { + textContainer = hyperHTML` + + `; + span.appendChild(textContainer); + } + textContainer.textContent = extra.name; + return span; + } +}; + +// @ts-check + +var cgbgHeadersTmpl = conf => { + return hyperHTML`
    - ${e.logos.map(showLogo)} -

    ${e.title}

    - ${e.subtitle?hyperHTML$1` -

    ${e.subtitle}

    - `:""} + ${conf.logos.map(showLogo)} +

    ${conf.title}

    + ${conf.subtitle + ? hyperHTML` +

    ${conf.subtitle}

    + ` + : ""}

    - ${e.longStatus} - ${conf.publishHumanDate}

    - ${e.thisVersion?hyperHTML$1` -
    ${e.l10n.this_version}
    + ${conf.thisVersion + ? hyperHTML` +
    ${conf.l10n.this_version}
    - ${e.thisVersion}${conf.thisVersion}
    - `:""} - ${e.latestVersion?hyperHTML$1` -
    ${e.l10n.latest_published_version}
    + ` + : ""} + ${conf.latestVersion + ? hyperHTML` +
    ${conf.l10n.latest_published_version}
    - ${e.latestVersion} + ${conf.latestVersion}
    - `:""} - ${e.edDraftURI?hyperHTML$1` -
    ${e.l10n.latest_editors_draft}
    -
    ${e.edDraftURI}
    - `:""} - ${e.testSuiteURI?hyperHTML$1` + ` + : ""} + ${conf.edDraftURI + ? hyperHTML` +
    ${conf.l10n.latest_editors_draft}
    +
    ${conf.edDraftURI}
    + ` + : ""} + ${conf.testSuiteURI + ? hyperHTML`
    Test suite:
    -
    ${e.testSuiteURI}
    - `:""} - ${e.implementationReportURI?hyperHTML$1` +
    ${conf.testSuiteURI}
    + ` + : ""} + ${conf.implementationReportURI + ? hyperHTML`
    Implementation report:
    - ${e.implementationReportURI}${conf.implementationReportURI}
    - `:""} - ${e.bugTrackerHTML?hyperHTML$1` -
    ${e.l10n.bug_tracker}
    -
    ${[e.bugTrackerHTML]}
    - `:""} - ${e.prevVersion?hyperHTML$1` + ` + : ""} + ${conf.bugTrackerHTML + ? hyperHTML` +
    ${conf.l10n.bug_tracker}
    +
    ${raw(conf.bugTrackerHTML)}
    + ` + : ""} + ${conf.prevVersion + ? hyperHTML`
    Previous version:
    -
    ${e.prevVersion}
    - `:""} - ${e.isCGFinal?"":hyperHTML$1` - ${e.prevED?hyperHTML$1` +
    ${conf.prevVersion}
    + ` + : ""} + ${!conf.isCGFinal + ? hyperHTML` + ${conf.prevED + ? hyperHTML`
    Previous editor's draft:
    -
    ${e.prevED}
    - `:""} - `} -
    ${e.multipleEditors?e.l10n.editors:e.l10n.editor}
    - ${showPeople(e.editors)} - ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?hyperHTML$1` +
    ${conf.prevED}
    + ` + : ""} + ` + : ""} +
    ${conf.multipleEditors ? conf.l10n.editors : conf.l10n.editor}
    + ${showPeople(conf.editors)} + ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0 + ? hyperHTML`
    - ${e.multipleFormerEditors?e.l10n.former_editors:e.l10n.former_editor} + ${conf.multipleFormerEditors + ? conf.l10n.former_editors + : conf.l10n.former_editor}
    - ${showPeople(e.formerEditors)} - `:""} - ${e.authors?hyperHTML$1` + ${showPeople(conf.formerEditors)} + ` + : ""} + ${conf.authors + ? hyperHTML`
    - ${e.multipleAuthors?e.l10n.authors:e.l10n.author} + ${conf.multipleAuthors ? conf.l10n.authors : conf.l10n.author}
    - ${showPeople(e.authors)} - `:""} - ${e.otherLinks?e.otherLinks.map(showLink):""} + ${showPeople(conf.authors)} + ` + : ""} + ${conf.otherLinks ? conf.otherLinks.map(showLink) : ""}
    - ${e.alternateFormats?hyperHTML$1` + ${conf.alternateFormats + ? hyperHTML`

    - ${e.multipleAlternates?"This document is also available in these non-normative formats:":"This document is also available in this non-normative format:"} - ${[e.alternatesHTML]} + ${conf.multipleAlternates + ? "This document is also available in these non-normative formats:" + : "This document is also available in this non-normative format:"} + ${raw(conf.alternatesHTML)}

    - `:""} + ` + : ""}
    - `,cgbgSotdTmpl=(e,t)=>hyperHTML$1` -

    ${e.l10n.sotd}

    - ${e.isPreview?hyperHTML$1` + `; +}; + +// @ts-check + +var cgbgSotdTmpl = (conf, opts) => { + return hyperHTML` +

    ${conf.l10n.sotd}

    + ${conf.isPreview + ? hyperHTML`
    This is a - preview${e.prUrl&&e.prNumber?hyperHTML$1` + preview${conf.prUrl && conf.prNumber + ? hyperHTML` of pull request - #${e.prNumber} - `:""}#${conf.prNumber} + ` + : ""}

    Do not attempt to implement this version of the specification. Do not reference this version as authoritative in any way. - ${e.edDraftURI?hyperHTML$1` + ${conf.edDraftURI + ? hyperHTML` Instead, see - ${e.edDraftURI} for the + ${conf.edDraftURI} for the Editor's draft. - `:""} + ` + : ""}

    - `:""} + ` + : ""}

    This specification was published by the - ${e.wg}. It is not a W3C Standard nor is it + ${conf.wg}. It is not a W3C Standard nor is it on the W3C Standards Track. - ${e.isCGFinal?hyperHTML$1` + ${conf.isCGFinal + ? hyperHTML` Please note that under the W3C Community Final Specification Agreement (FSA) other conditions apply. - `:hyperHTML$1` + ` + : hyperHTML` Please note that under the W3C Community Contributor License Agreement (CLA)W3C Community and Business Groups.

    - ${e.sotdAfterWGinfo?"":t.additionalContent} - ${e.wgPublicList?hyperHTML$1` + ${!conf.sotdAfterWGinfo ? opts.additionalContent : ""} + ${conf.wgPublicList + ? hyperHTML`

    If you wish to make comments regarding this document, please send them to - ${e.wgPublicList}@w3.org${conf.wgPublicList}@w3.org - (subscribe, + (subscribe, archives)${e.subjectPrefix?hyperHTML$1` - with ${e.subjectPrefix} at the start of your + >)${conf.subjectPrefix + ? hyperHTML` + with ${conf.subjectPrefix} at the start of your email's subject - `:""}. + ` + : ""}.

    - `:""} - ${e.sotdAfterWGinfo?t.additionalContent:""} - ${t.additionalSections} - `;const ccLicense="https://creativecommons.org/licenses/by/4.0/",w3cLicense="https://www.w3.org/Consortium/Legal/copyright-documents",legalDisclaimer="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer",w3cTrademark="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks";function getSpecTitleElem(e){const t=document.querySelector("h1#title")||document.createElement("h1");if(t.parentElement?t.remove():(t.textContent=e.title,t.id="title"),e.isPreview&&e.prNumber){const{childNodes:n}=hyperHTML$1` - Preview of PR #${e.prNumber}: - `;t.prepend(...n)}return e.title=norm(t.textContent),t.classList.add("title","p-name"),null===document.querySelector("title")?document.title=e.title:document.title!==e.title&&pub("warn","The document's title and the `` element differ."),t}function getSpecSubTitleElem(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&((t=document.createElement("h2")).textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}var headersTmpl=e=>hyperHTML$1` + ` + : ""} + ${conf.sotdAfterWGinfo ? opts.additionalContent : ""} + ${[...opts.additionalSections]} + `; +}; + +// @ts-check + +const ccLicense = "https://creativecommons.org/licenses/by/4.0/"; +const w3cLicense = "https://www.w3.org/Consortium/Legal/copyright-documents"; +const legalDisclaimer = + "https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer"; +const w3cTrademark = + "https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks"; + +function getSpecTitleElem(conf) { + const specTitleElem = + document.querySelector("h1#title") || document.createElement("h1"); + if (specTitleElem.parentElement) { + specTitleElem.remove(); + } else { + specTitleElem.textContent = conf.title; + specTitleElem.id = "title"; + } + if (conf.isPreview && conf.prNumber) { + const { childNodes } = hyperHTML` + Preview of PR <a href="${conf.prUrl}">#${conf.prNumber}</a>: + `; + specTitleElem.prepend(...childNodes); + } + conf.title = norm(specTitleElem.textContent); + specTitleElem.classList.add("title", "p-name"); + if (document.querySelector("title") === null) { + document.title = conf.title; + } else if (document.title !== conf.title) { + pub("warn", "The document's title and the `<title>` element differ."); + } + return specTitleElem; +} + +function getSpecSubTitleElem(conf) { + let specSubTitleElem = document.querySelector("h2#subtitle"); + + if (specSubTitleElem && specSubTitleElem.parentElement) { + specSubTitleElem.remove(); + conf.subtitle = specSubTitleElem.textContent.trim(); + } else if (conf.subtitle) { + specSubTitleElem = document.createElement("h2"); + specSubTitleElem.textContent = conf.subtitle; + specSubTitleElem.id = "subtitle"; + } + if (specSubTitleElem) { + specSubTitleElem.classList.add("subtitle"); + } + return specSubTitleElem; +} + +var headersTmpl = conf => { + return hyperHTML` <div class="head"> - ${e.logos.map(showLogo)} ${getSpecTitleElem(e)} - ${getSpecSubTitleElem(e)} + ${conf.logos.map(showLogo)} ${getSpecTitleElem(conf)} + ${getSpecSubTitleElem(conf)} <h2> - ${e.prependW3C?"W3C ":""}${e.textStatus} - <time class="dt-published" datetime="${e.dashDate}" - >${e.publishHumanDate}</time + ${conf.prependW3C ? "W3C " : ""}${conf.textStatus} + <time class="dt-published" datetime="${conf.dashDate}" + >${conf.publishHumanDate}</time > </h2> <dl> - ${e.isNoTrack?"":hyperHTML$1` - <dt>${e.l10n.this_version}</dt> + ${!conf.isNoTrack + ? hyperHTML` + <dt>${conf.l10n.this_version}</dt> <dd> - <a class="u-url" href="${e.thisVersion}" - >${e.thisVersion}</a + <a class="u-url" href="${conf.thisVersion}" + >${conf.thisVersion}</a > </dd> - <dt>${e.l10n.latest_published_version}</dt> + <dt>${conf.l10n.latest_published_version}</dt> <dd> - ${e.latestVersion?hyperHTML$1` - <a href="${e.latestVersion}">${e.latestVersion}</a> - `:"none"} + ${conf.latestVersion + ? hyperHTML` + <a href="${conf.latestVersion}">${conf.latestVersion}</a> + ` + : "none"} </dd> - `} - ${e.edDraftURI?hyperHTML$1` - <dt>${e.l10n.latest_editors_draft}</dt> - <dd><a href="${e.edDraftURI}">${e.edDraftURI}</a></dd> - `:""} - ${e.testSuiteURI?hyperHTML$1` + ` + : ""} + ${conf.edDraftURI + ? hyperHTML` + <dt>${conf.l10n.latest_editors_draft}</dt> + <dd><a href="${conf.edDraftURI}">${conf.edDraftURI}</a></dd> + ` + : ""} + ${conf.testSuiteURI + ? hyperHTML` <dt>Test suite:</dt> - <dd><a href="${e.testSuiteURI}">${e.testSuiteURI}</a></dd> - `:""} - ${e.implementationReportURI?hyperHTML$1` + <dd><a href="${conf.testSuiteURI}">${conf.testSuiteURI}</a></dd> + ` + : ""} + ${conf.implementationReportURI + ? hyperHTML` <dt>Implementation report:</dt> <dd> - <a href="${e.implementationReportURI}" - >${e.implementationReportURI}</a + <a href="${conf.implementationReportURI}" + >${conf.implementationReportURI}</a > </dd> - `:""} - ${e.bugTrackerHTML?hyperHTML$1` - <dt>${e.l10n.bug_tracker}</dt> - <dd>${[e.bugTrackerHTML]}</dd> - `:""} - ${e.isED&&e.prevED?hyperHTML$1` + ` + : ""} + ${conf.bugTrackerHTML + ? hyperHTML` + <dt>${conf.l10n.bug_tracker}</dt> + <dd>${raw(conf.bugTrackerHTML)}</dd> + ` + : ""} + ${conf.isED && conf.prevED + ? hyperHTML` <dt>Previous editor's draft:</dt> - <dd><a href="${e.prevED}">${e.prevED}</a></dd> - `:""} - ${e.showPreviousVersion?hyperHTML$1` + <dd><a href="${conf.prevED}">${conf.prevED}</a></dd> + ` + : ""} + ${conf.showPreviousVersion + ? hyperHTML` <dt>Previous version:</dt> - <dd><a href="${e.prevVersion}">${e.prevVersion}</a></dd> - `:""} - ${e.prevRecURI?e.isRec?hyperHTML$1` + <dd><a href="${conf.prevVersion}">${conf.prevVersion}</a></dd> + ` + : ""} + ${!conf.prevRecURI + ? "" + : conf.isRec + ? hyperHTML` <dt>Previous Recommendation:</dt> - <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd> - `:hyperHTML$1` + <dd><a href="${conf.prevRecURI}">${conf.prevRecURI}</a></dd> + ` + : hyperHTML` <dt>Latest Recommendation:</dt> - <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd> - `:""} - <dt>${e.multipleEditors?e.l10n.editors:e.l10n.editor}</dt> - ${showPeople(e.editors)} - ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?hyperHTML$1` + <dd><a href="${conf.prevRecURI}">${conf.prevRecURI}</a></dd> + `} + <dt>${conf.multipleEditors ? conf.l10n.editors : conf.l10n.editor}</dt> + ${showPeople(conf.editors)} + ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0 + ? hyperHTML` <dt> - ${e.multipleFormerEditors?e.l10n.former_editors:e.l10n.former_editor} + ${conf.multipleFormerEditors + ? conf.l10n.former_editors + : conf.l10n.former_editor} </dt> - ${showPeople(e.formerEditors)} - `:""} - ${e.authors?hyperHTML$1` + ${showPeople(conf.formerEditors)} + ` + : ""} + ${conf.authors + ? hyperHTML` <dt> - ${e.multipleAuthors?e.l10n.authors:e.l10n.author} + ${conf.multipleAuthors ? conf.l10n.authors : conf.l10n.author} </dt> - ${showPeople(e.authors)} - `:""} - ${e.otherLinks?e.otherLinks.map(showLink):""} + ${showPeople(conf.authors)} + ` + : ""} + ${conf.otherLinks ? conf.otherLinks.map(showLink) : ""} </dl> - ${e.errata?hyperHTML$1` + ${conf.errata + ? hyperHTML` <p> Please check the - <a href="${e.errata}"><strong>errata</strong></a> for any + <a href="${conf.errata}"><strong>errata</strong></a> for any errors or issues reported since publication. </p> - `:""} - ${e.isRec?hyperHTML$1` + ` + : ""} + ${conf.isRec + ? hyperHTML` <p> See also <a - href="${`http://www.w3.org/2003/03/Translations/byTechnology?technology=${e.shortName}`}" + href="${`http://www.w3.org/2003/03/Translations/byTechnology?technology=${conf.shortName}`}" > <strong>translations</strong></a >. </p> - `:""} - ${e.alternateFormats?hyperHTML$1` + ` + : ""} + ${conf.alternateFormats + ? hyperHTML` <p> - ${e.multipleAlternates?"This document is also available in these non-normative formats:":"This document is also available in this non-normative format:"} - ${[e.alternatesHTML]} + ${conf.multipleAlternates + ? "This document is also available in these non-normative formats:" + : "This document is also available in this non-normative format:"} + ${raw(conf.alternatesHTML)} </p> - `:""} - ${renderCopyright(e)} + ` + : ""} + ${renderCopyright(conf)} <hr title="Separator for header" /> </div> - `;function linkLicense(e,t,n){return hyperHTML$1` - <a rel="license" href="${t}" class="${n}">${e}</a> - `}function renderCopyright(e){return e.isUnofficial?e.additionalCopyrightHolders?hyperHTML$1` - <p class="copyright">${[e.additionalCopyrightHolders]}</p> - `:e.overrideCopyright?[e.overrideCopyright]:hyperHTML$1` + `; +}; + +/** + * @param {string} text + * @param {string} url + * @param {string=} cssClass + */ +function linkLicense(text, url, cssClass) { + return hyperHTML` + <a rel="license" href="${url}" class="${cssClass}">${text}</a> + `; +} + +function renderCopyright(conf) { + return conf.isUnofficial + ? conf.additionalCopyrightHolders + ? hyperHTML` + <p class="copyright">${raw(conf.additionalCopyrightHolders)}</p> + ` + : conf.overrideCopyright + ? raw(conf.overrideCopyright) + : hyperHTML` <p class="copyright"> This document is licensed under a - ${linkLicense("Creative Commons Attribution 4.0 License",ccLicense,"subfoot")}. + ${linkLicense( + "Creative Commons Attribution 4.0 License", + ccLicense, + "subfoot" + )}. </p> - `:e.overrideCopyright?[e.overrideCopyright]:renderOfficialCopyright(e)}function renderOfficialCopyright(e){return hyperHTML$1` + ` + : conf.overrideCopyright + ? raw(conf.overrideCopyright) + : renderOfficialCopyright(conf); +} + +function renderOfficialCopyright(conf) { + return hyperHTML` <p class="copyright"> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright" >Copyright</a > - © - ${e.copyrightStart?`${e.copyrightStart}-`:""}${e.publishYear} - ${e.additionalCopyrightHolders?hyperHTML$1` - ${[e.additionalCopyrightHolders]} & - `:""} + © + ${conf.copyrightStart ? `${conf.copyrightStart}-` : ""}${conf.publishYear} + ${conf.additionalCopyrightHolders + ? raw(`${conf.additionalCopyrightHolders} &`) + : ""} <a href="https://www.w3.org/" ><abbr title="World Wide Web Consortium">W3C</abbr></a - ><sup>®</sup> (<a href="https://www.csail.mit.edu/" + ><sup>®</sup> (<a href="https://www.csail.mit.edu/" ><abbr title="Massachusetts Institute of Technology">MIT</abbr></a >, <a href="https://www.ercim.eu/" @@ -388,32 +9624,79 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& >ERCIM</abbr ></a >, <a href="https://www.keio.ac.jp/">Keio</a>, - <a href="https://ev.buaa.edu.cn/">Beihang</a>). ${noteIfDualLicense(e)} + <a href="https://ev.buaa.edu.cn/">Beihang</a>). ${noteIfDualLicense(conf)} W3C <a href="${legalDisclaimer}">liability</a>, - <a href="${w3cTrademark}">trademark</a> and ${linkDocumentUse(e)} rules + <a href="${w3cTrademark}">trademark</a> and ${linkDocumentUse(conf)} rules apply. </p> - `}function noteIfDualLicense(e){if(e.isCCBY)return hyperHTML$1` + `; +} + +function noteIfDualLicense(conf) { + if (!conf.isCCBY) { + return; + } + return hyperHTML` Some Rights Reserved: this document is dual-licensed, - ${linkLicense("CC-BY",ccLicense)} and - ${linkLicense("W3C Document License",w3cLicense)}. - `}function linkDocumentUse(e){return e.isCCBY?linkLicense("document use","https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"):e.isW3CSoftAndDocLicense?linkLicense("permissive document license","https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document"):linkLicense("document use",w3cLicense)}var sotdTmpl=(e,t)=>hyperHTML$1` - <h2>${e.l10n.sotd}</h2> - ${e.isPreview?renderPreview(e):""} - ${e.isUnofficial?renderIsUnofficial(t):e.isTagFinding?t.additionalContent:e.isNoTrack?renderIsNoTrack(e,t):hyperHTML$1` - <p><em>${[e.l10n.status_at_publication]}</em></p> - ${e.isSubmission?noteForSubmission(e,t):hyperHTML$1` - ${e.sotdAfterWGinfo?"":t.additionalContent} - ${e.overrideStatus?"":hyperHTML$1` - ${linkToWorkingGroup(e)} ${linkToCommunity(e,t)} - ${e.isCR||e.isPER||e.isPR?hyperHTML$1` + ${linkLicense("CC-BY", ccLicense)} and + ${linkLicense("W3C Document License", w3cLicense)}. + `; +} + +function linkDocumentUse(conf) { + if (conf.isCCBY) { + return linkLicense( + "document use", + "https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html" + ); + } + if (conf.isW3CSoftAndDocLicense) { + return linkLicense( + "permissive document license", + "https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document" + ); + } + return linkLicense("document use", w3cLicense); +} + +// @ts-check + +var sotdTmpl = (conf, opts) => { + return hyperHTML` + <h2>${conf.l10n.sotd}</h2> + ${conf.isPreview ? renderPreview(conf) : ""} + ${conf.isUnofficial + ? renderIsUnofficial(opts) + : conf.isTagFinding + ? opts.additionalContent + : conf.isNoTrack + ? renderIsNoTrack(conf, opts) + : hyperHTML` + <p><em>${raw(conf.l10n.status_at_publication)}</em></p> + ${conf.isSubmission + ? noteForSubmission(conf, opts) + : hyperHTML` + ${!conf.sotdAfterWGinfo ? opts.additionalContent : ""} + ${!conf.overrideStatus + ? hyperHTML` + ${linkToWorkingGroup(conf)} ${linkToCommunity(conf, opts)} + ${conf.isCR || conf.isPER || conf.isPR + ? hyperHTML` <p> - ${e.isCR?`\n W3C publishes a Candidate Recommendation to indicate that the document is believed to be\n stable and to encourage implementation by the developer community. This Candidate\n Recommendation is expected to advance to Proposed Recommendation no earlier than\n ${e.humanCREnd}.\n `:""} - ${e.isPER?hyperHTML$1` + ${conf.isCR + ? ` + W3C publishes a Candidate Recommendation to indicate that the document is believed to be + stable and to encourage implementation by the developer community. This Candidate + Recommendation is expected to advance to Proposed Recommendation no earlier than + ${conf.humanCREnd}. + ` + : ""} + ${conf.isPER + ? hyperHTML` W3C Advisory Committee Members are invited to send formal review comments on this Proposed Edited Recommendation to the W3C - Team until ${e.humanPEREnd}. Members of + Team until ${conf.humanPEREnd}. Members of the Advisory Committee will find the appropriate review form for this document by consulting their list of current @@ -421,24 +9704,26 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& href="https://www.w3.org/2002/09/wbs/myQuestionnaires" >WBS questionnaires</a >. - `:""} - ${e.isPR?hyperHTML$1` + ` + : ""} + ${conf.isPR + ? hyperHTML` The W3C Membership and other interested parties are invited to review the document and send comments to <a rel="discussion" - href="${t.mailToWGPublicList}" - >${e.wgPublicList}@w3.org</a + href="${opts.mailToWGPublicList}" + >${conf.wgPublicList}@w3.org</a > (<a - href="${t.mailToWGPublicListSubscription}" + href="${opts.mailToWGPublicListSubscription}" >subscribe</a >, <a - href="${`https://lists.w3.org/Archives/Public/${e.wgPublicList}/`}" + href="${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}" >archives</a - >) through ${e.humanPREnd}. Advisory + >) through ${conf.humanPREnd}. Advisory Committee Representatives should consult their <a @@ -447,15 +9732,20 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& >. Note that substantive technical comments were expected during the Candidate Recommendation review period that ended - ${e.humanCREnd}. - `:""} + ${conf.humanCREnd}. + ` + : ""} </p> - `:""} - `} - ${e.implementationReportURI?renderImplementationReportURI(e):""} - ${e.sotdAfterWGinfo?t.additionalContent:""} - ${e.notRec?renderNotRec(e):""} - ${e.isRec?renderIsRec():""} ${renderDeliverer(e)} + ` + : ""} + ` + : ""} + ${conf.implementationReportURI + ? renderImplementationReportURI(conf) + : ""} + ${conf.sotdAfterWGinfo ? opts.additionalContent : ""} + ${conf.notRec ? renderNotRec(conf) : ""} + ${conf.isRec ? renderIsRec() : ""} ${renderDeliverer(conf)} <p> This document is governed by the <a @@ -464,57 +9754,93 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& >1 March 2019 W3C Process Document</a >. </p> - ${e.addPatentNote?hyperHTML$1` - <p>${[e.addPatentNote]}</p> - `:""} + ${conf.addPatentNote + ? hyperHTML` + <p>${raw(conf.addPatentNote)}</p> + ` + : ""} `} `} - ${t.additionalSections} - `;function renderPreview(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return hyperHTML$1` + ${[...opts.additionalSections]} + `; +}; + +function renderPreview(conf) { + const { prUrl, prNumber, edDraftURI } = conf; + return hyperHTML` <details class="annoying-warning" open=""> <summary >This is a - preview${t&&n?hyperHTML$1` + preview${prUrl && prNumber + ? hyperHTML` of pull request - <a href="${t}">#${n}</a> - `:""}</summary + <a href="${prUrl}">#${prNumber}</a> + ` + : ""}</summary > <p> Do not attempt to implement this version of the specification. Do not reference this version as authoritative in any way. - ${r?hyperHTML$1` + ${edDraftURI + ? hyperHTML` Instead, see - <a href="${r}">${r}</a> for the Editor's draft. - `:""} + <a href="${edDraftURI}">${edDraftURI}</a> for the Editor's draft. + ` + : ""} </p> </details> - `}function renderIsUnofficial(e){const{additionalContent:t}=e;return hyperHTML$1` + `; +} + +function renderIsUnofficial(opts) { + const { additionalContent } = opts; + return hyperHTML` <p> This document is draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organization. </p> - ${t} - `}function renderIsNoTrack(e,t){const{isMO:n}=e,{additionalContent:r}=t;return hyperHTML$1` + ${additionalContent} + `; +} + +function renderIsNoTrack(conf, opts) { + const { isMO } = conf; + const { additionalContent } = opts; + return hyperHTML` <p> This document is merely a W3C-internal - ${n?"member-confidential":""} document. It has no official standing + ${isMO ? "member-confidential" : ""} document. It has no official standing of any kind and does not represent consensus of the W3C Membership. </p> - ${r} - `}function renderImplementationReportURI(e){const{implementationReportURI:t}=e;return hyperHTML$1` + ${additionalContent} + `; +} + +function renderImplementationReportURI(conf) { + const { implementationReportURI } = conf; + return hyperHTML` <p> Please see the Working Group's - <a href="${t}">implementation report</a>. + <a href="${implementationReportURI}">implementation report</a>. </p> - `}function renderNotRec(e){const{anOrA:t,textStatus:n}=e;return hyperHTML$1` + `; +} + +function renderNotRec(conf) { + const { anOrA, textStatus } = conf; + return hyperHTML` <p> - Publication as ${t} ${n} does not imply endorsement by the + Publication as ${anOrA} ${textStatus} does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress. </p> - `}function renderIsRec(){hyperHTML$1` + `; +} + +function renderIsRec() { + hyperHTML` <p> This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the @@ -524,26 +9850,52 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& promote its widespread deployment. This enhances the functionality and interoperability of the Web. </p> - `}function renderDeliverer(e){const{isNote:t,wgId:n,isIGNote:r,multipleWGs:o,recNotExpected:i,wgPatentHTML:a,wgPatentURI:s,charterDisclosureURI:c}=e,l=r?"":hyperHTML$1` - This document was produced by ${o?"groups":"a group"} + `; +} + +function renderDeliverer(conf) { + const { + isNote, + wgId, + isIGNote, + multipleWGs, + recNotExpected, + wgPatentHTML, + wgPatentURI, + charterDisclosureURI, + } = conf; + + const producers = !isIGNote + ? hyperHTML` + This document was produced by ${multipleWGs ? "groups" : "a group"} operating under the <a href="https://www.w3.org/Consortium/Patent-Policy/" >W3C Patent Policy</a >. - `;return hyperHTML$1` - <p data-deliverer="${t?n:null}"> - ${l} ${i?"The group does not expect this document to become a W3C Recommendation.":""} - ${t||r?"":hyperHTML$1` - ${o?hyperHTML$1` - W3C maintains ${[a]} - `:hyperHTML$1` + ` + : ""; + const wontBeRec = recNotExpected + ? "The group does not expect this document to become a W3C Recommendation." + : ""; + const paragraph = hyperHTML` + <p> + ${producers} ${wontBeRec} + ${!isNote && !isIGNote + ? hyperHTML` + ${multipleWGs + ? hyperHTML` + W3C maintains ${raw(wgPatentHTML)} + ` + : hyperHTML` W3C maintains a - <a href="${[s]}" rel="disclosure" + <a href="${wgPatentURI}" rel="disclosure" >public list of any patent disclosures</a > `} made in connection with the deliverables of - ${o?"each group; these pages also include":"the group; that page also includes"} + ${multipleWGs + ? "each group; these pages also include" + : "the group; that page also includes"} instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential" @@ -554,27 +9906,49 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure" >section 6 of the W3C Patent Policy</a >. - `} - ${r?hyperHTML$1` + ` + : ""} + ${isIGNote + ? hyperHTML` The disclosure obligations of the Participants of this group are described in the - <a href="${c}">charter</a>. - `:""} + <a href="${charterDisclosureURI}">charter</a>. + ` + : ""} </p> - `}function noteForSubmission(e,t){return hyperHTML$1` - ${t.additionalContent} - ${e.isMemberSubmission?noteForMemberSubmission(e):e.isTeamSubmission?noteForTeamSubmission(e,t):""} - `}function noteForMemberSubmission(e){const t=`https://www.w3.org/Submission/${e.publishDate.getUTCFullYear()}/${e.submissionCommentNumber}/Comment/`;return hyperHTML$1` + `; + if (isNote) { + paragraph.dataset.deliverer = wgId; + } + return paragraph; +} + +function noteForSubmission(conf, opts) { + return hyperHTML` + ${opts.additionalContent} + ${conf.isMemberSubmission + ? noteForMemberSubmission(conf) + : conf.isTeamSubmission + ? noteForTeamSubmission(conf, opts) + : ""} + `; +} + +function noteForMemberSubmission(conf) { + const teamComment = `https://www.w3.org/Submission/${conf.publishDate.getUTCFullYear()}/${ + conf.submissionCommentNumber + }/Comment/`; + return hyperHTML` <p> By publishing this document, W3C acknowledges that the - <a href="${e.thisVersion}">Submitting Members</a> have made a formal + <a href="${conf.thisVersion}">Submitting Members</a> have made a formal Submission request to W3C for discussion. Publication of this document by W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or will be allocating any resources to the issues addressed by it. This document is not the product of a chartered W3C group, but is published as potential input to the <a href="https://www.w3.org/Consortium/Process">W3C Process</a>. A - <a href="${t}">W3C Team Comment</a> has been published in + <a href="${teamComment}">W3C Team Comment</a> has been published in conjunction with this Member Submission. Publication of acknowledged Member Submissions at the W3C site is one of the benefits of <a href="https://www.w3.org/Consortium/Prospectus/Joining"> @@ -587,259 +9961,5837 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& >list of acknowledged W3C Member Submissions</a >. </p> - `}function noteForTeamSubmission(e,t){return hyperHTML$1` + `; +} + +function noteForTeamSubmission(conf, opts) { + return hyperHTML` <p> If you wish to make comments regarding this document, please send them to - <a href="${t.mailToWGPublicListWithSubject}" - >${e.wgPublicList}@w3.org</a + <a href="${opts.mailToWGPublicListWithSubject}" + >${conf.wgPublicList}@w3.org</a > - (<a href="${t.mailToWGPublicListSubscription}">subscribe</a>, - <a href="${`https://lists.w3.org/Archives/Public/${e.wgPublicList}/`}" + (<a href="${opts.mailToWGPublicListSubscription}">subscribe</a>, + <a href="${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}" >archives</a - >)${e.subjectPrefix?hyperHTML$1` - with <code>${e.subjectPrefix}</code> at the start of your email's + >)${conf.subjectPrefix + ? hyperHTML` + with <code>${conf.subjectPrefix}</code> at the start of your email's subject - `:""}. + ` + : ""}. </p> <p> Please consult the complete <a href="https://www.w3.org/TeamSubmission/">list of Team Submissions</a>. </p> - `}function linkToWorkingGroup(e){if(e.wg)return hyperHTML$1` + `; +} + +function linkToWorkingGroup(conf) { + if (!conf.wg) { + return; + } + return hyperHTML` <p> - This document was published by ${[e.wgHTML]} as ${e.anOrA} - ${e.longStatus}. - ${e.notYetRec?"This document is intended to become a W3C Recommendation.":""} + This document was published by ${raw(conf.wgHTML)} as ${conf.anOrA} + ${conf.longStatus}. + ${conf.notYetRec + ? "This document is intended to become a W3C Recommendation." + : ""} </p> - `}function linkToCommunity(e,t){if(e.github||e.wgPublicList)return hyperHTML$1` + `; +} + +function linkToCommunity(conf, opts) { + if (!conf.github && !conf.wgPublicList) { + return; + } + return hyperHTML` <p> - ${e.github?hyperHTML$1` - <a href="${e.issueBase}">GitHub Issues</a> are preferred for + ${conf.github + ? hyperHTML` + <a href="${conf.issueBase}">GitHub Issues</a> are preferred for discussion of this specification. - `:""} - ${e.wgPublicList?hyperHTML$1` - ${e.github&&e.wgPublicList?"Alternatively, you can send comments to our mailing list.":"Comments regarding this document are welcome."} + ` + : ""} + ${conf.wgPublicList + ? hyperHTML` + ${conf.github && conf.wgPublicList + ? "Alternatively, you can send comments to our mailing list." + : "Comments regarding this document are welcome."} Please send them to - <a href="${t.mailToWGPublicListWithSubject}" - >${e.wgPublicList}@w3.org</a + <a href="${opts.mailToWGPublicListWithSubject}" + >${conf.wgPublicList}@w3.org</a > (<a - href="${`https://lists.w3.org/Archives/Public/${e.wgPublicList}/`}" + href="${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}" >archives</a - >)${e.subjectPrefix?hyperHTML$1` - with <code>${e.subjectPrefix}</code> at the start of your + >)${conf.subjectPrefix + ? hyperHTML` + with <code>${conf.subjectPrefix}</code> at the start of your email's subject - `:""}. - `:""} + ` + : ""}. + ` + : ""} </p> - `}const name$l="w3c/headers",W3CDate=new Intl.DateTimeFormat(["en-AU"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"}),status2maturity={LS:"WD",LD:"WD",FPWD:"WD",LC:"WD",FPLC:"WD","FPWD-NOTE":"NOTE","WD-NOTE":"WD","LC-NOTE":"LC","IG-NOTE":"NOTE","WG-NOTE":"NOTE"},status2rdf={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",PR:"w3p:PR",REC:"w3p:REC",PER:"w3p:PER",RSCND:"w3p:RSCND"},status2text={NOTE:"Working Group Note","WG-NOTE":"Working Group Note","CG-NOTE":"Co-ordination Group Note","IG-NOTE":"Interest Group Note","Member-SUBM":"Member Submission","Team-SUBM":"Team Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft","FPWD-NOTE":"Working Group Note","WD-NOTE":"Working Draft","LC-NOTE":"Working Draft",FPLC:"First Public and Last Call Working Draft",LC:"Last Call Working Draft",CR:"Candidate Recommendation",PR:"Proposed Recommendation",PER:"Proposed Edited Recommendation",REC:"Recommendation",RSCND:"Rescinded Recommendation",unofficial:"Unofficial Draft",base:"Document",finding:"TAG Finding","draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},status2long={...status2text,"FPWD-NOTE":"First Public Working Group Note","LC-NOTE":"Last Call Working Draft"},maybeRecTrack=["FPWD","WD"],recTrackStatus=["FPLC","LC","CR","PR","PER","REC"],noTrackStatus=["base","BG-DRAFT","BG-FINAL","CG-DRAFT","CG-FINAL","draft-finding","finding","MO","unofficial"],cgbg=["CG-DRAFT","CG-FINAL","BG-DRAFT","BG-FINAL"],precededByAn=["ED","IG-NOTE"],licenses={cc0:{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"},"w3c-software":{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231"},"w3c-software-doc":{name:"W3C Software and Document Notice and License",short:"W3C Software and Document",url:"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document"},"cc-by":{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}},baseLogo=Object.freeze({id:"",alt:"",href:"",src:"",height:"48",width:"72"});function validateDateAndRecover(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=ISODate.format(r);return new Date(e)}return pub("error",`[\`${t}\`](https://github.com/w3c/respec/wiki/${t}) `+`is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`),new Date(ISODate.format(new Date))}function run$a(e){if(e.isUnofficial="unofficial"===e.specStatus,e.isUnofficial&&!Array.isArray(e.logos)&&(e.logos=[]),e.isCCBY="cc-by"===e.license,e.isW3CSoftAndDocLicense="w3c-software-doc"===e.license,["cc-by"].includes(e.license)){let t=`You cannot use license "\`${e.license}\`" with W3C Specs. `;pub("error",t+='Please set `respecConfig.license: "w3c-software-doc"` instead.')}if(e.licenseInfo=licenses[e.license],e.isCGBG=cgbg.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isBasic="base"===e.specStatus,e.isRegular=!e.isCGBG&&!e.isBasic,e.specStatus||pub("error","Missing required configuration: `specStatus`"),e.isRegular&&!e.shortName&&pub("error","Missing required configuration: `shortName`"),e.testSuiteURI){const t=new URL(e.testSuiteURI,location.href),{host:n,pathname:r}=t;if("github.com"===n&&r.startsWith("/w3c/web-platform-tests/")){pub("warn","Web Platform Tests have moved to a new Github Organization at https://github.com/web-platform-tests. Please update your [`testSuiteURI`](https://github.com/w3c/respec/wiki/testSuiteURI) to point to the "+`new tests repository (e.g., https://github.com/web-platform-tests/wpt/${e.shortName} ).`)}}if(e.title=document.title||"No Title",document.title&&e.isPreview&&e.prNumber&&(document.title=`Preview of PR #${e.prNumber}: ${document.title}`),e.subtitle||(e.subtitle=""),e.publishDate=validateDateAndRecover(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=W3CDate.format(e.publishDate),e.isNoTrack=noTrackStatus.includes(e.specStatus),e.isRecTrack=!e.noRecTrack&&recTrackStatus.concat(maybeRecTrack).includes(e.specStatus),e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMemberSubmission){const t={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211"};e.logos.push({...baseLogo,...t})}if(e.isTeamSubmission="Team-SUBM"===e.specStatus,e.isTeamSubmission){const t={alt:"W3C Team Submission",href:"https://www.w3.org/TeamSubmission/",src:"https://www.w3.org/Icons/team_subm-v.svg",width:"211"};e.logos.push({...baseLogo,...t})}e.isSubmission=e.isMemberSubmission||e.isTeamSubmission,e.anOrA=precededByAn.includes(e.specStatus)?"an":"a",e.isTagFinding="finding"===e.specStatus||"draft-finding"===e.specStatus,e.edDraftURI||(e.edDraftURI="","ED"===e.specStatus&&pub("warn","Editor's Drafts should set edDraftURI.")),e.maturity=status2maturity[e.specStatus]?status2maturity[e.specStatus]:e.specStatus;let t="TR";if("Member-SUBM"===e.specStatus?t="Submission":"Team-SUBM"===e.specStatus&&(t="TeamSubmission"),e.isRegular&&(e.thisVersion=`https://www.w3.org/${t}/${e.publishDate.getUTCFullYear()}/${e.maturity}-${e.shortName}-${concatDate(e.publishDate)}/`),"ED"===e.specStatus&&(e.thisVersion=e.edDraftURI),e.isRegular&&(e.latestVersion=`https://www.w3.org/${t}/${e.shortName}/`),e.isTagFinding&&(e.latestVersion=`https://www.w3.org/2001/tag/doc/${e.shortName}`,e.thisVersion=`${e.latestVersion}-${ISODate.format(e.publishDate)}`),e.previousPublishDate){e.previousMaturity||e.isTagFinding||pub("error","`previousPublishDate` is set, but not `previousMaturity`."),e.previousPublishDate=validateDateAndRecover(e,"previousPublishDate");const t=status2maturity[e.previousMaturity]?status2maturity[e.previousMaturity]:e.previousMaturity;e.isTagFinding?e.prevVersion=`${e.latestVersion}-${ISODate.format(e.previousPublishDate)}`:e.isCGBG?e.prevVersion=e.prevVersion||"":e.isBasic?e.prevVersion="":e.prevVersion=`https://www.w3.org/TR/${e.previousPublishDate.getUTCFullYear()}/${t}-${e.shortName}-${concatDate(e.previousPublishDate)}/`}else e.specStatus.endsWith("NOTE")||"FPWD"===e.specStatus||"FPLC"===e.specStatus||"ED"===e.specStatus||e.noRecTrack||e.isNoTrack||e.isSubmission||pub("error","Document on track but no previous version: Add `previousMaturity`, and `previousPublishDate` to ReSpec's config."),e.prevVersion||(e.prevVersion="");e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=`https://www.w3.org/TR/${e.prevRecShortname}`);const n=function(e){if(e.name||pub("error","All authors and editors must have a name."),e.orcid)try{e.orcid=normalizeOrcid(e.orcid)}catch(t){pub("error",`"${e.orcid}" is not an ORCID. ${t.message}`),delete e.orcid}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(n);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}e.editors&&0!==e.editors.length||pub("error","At least one editor is required"),e.formerEditors.length&&e.formerEditors.forEach(n),e.authors&&e.authors.forEach(n),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,(e.alternateFormats||[]).forEach(e=>{e.uri&&e.label||pub("error","All alternate formats must have a uri and a label.")}),e.multipleAlternates=e.alternateFormats&&e.alternateFormats.length>1,e.alternatesHTML=e.alternateFormats&&joinAnd(e.alternateFormats,e=>{let t=e.hasOwnProperty("lang")&&e.lang?` hreflang='${e.lang}'`:"";return t+=e.hasOwnProperty("type")&&e.type?` type='${e.type}'`:"",`<a rel='alternate' href='${e.uri}'${t}>${e.label}</a>`}),e.bugTracker&&(e.bugTracker.new&&e.bugTracker.open?e.bugTrackerHTML=`<a href='${e.bugTracker.new}'>${e.l10n.file_a_bug}</a> ${e.l10n.open_parens}<a href='${e.bugTracker.open}'>${e.l10n.open_bugs}</a>${e.l10n.close_parens}`:e.bugTracker.open?e.bugTrackerHTML=`<a href='${e.bugTracker.open}'>open bugs</a>`:e.bugTracker.new&&(e.bugTrackerHTML=`<a href='${e.bugTracker.new}'>file a bug</a>`)),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.longStatus=status2long[e.specStatus],e.textStatus=status2text[e.specStatus],status2rdf[e.specStatus]&&(e.rdfStatus=status2rdf[e.specStatus]),e.showThisVersion=!e.isNoTrack||e.isTagFinding,e.showPreviousVersion="FPWD"!==e.specStatus&&"FPLC"!==e.specStatus&&"ED"!==e.specStatus&&!e.isNoTrack&&!e.isSubmission,e.specStatus.endsWith("NOTE")&&!e.prevVersion&&(e.showPreviousVersion=!1),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate),e.notYetRec=e.isRecTrack&&"REC"!==e.specStatus,e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRec&&!e.errata&&pub("error","Recommendations must have an errata link."),e.notRec="REC"!==e.specStatus,e.prependW3C=!e.isUnofficial,e.isED="ED"===e.specStatus,e.isCR="CR"===e.specStatus,e.isPR="PR"===e.specStatus,e.isPER="PER"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=["FPWD-NOTE","WG-NOTE"].includes(e.specStatus),e.isIGNote="IG-NOTE"===e.specStatus,e.dashDate=ISODate.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=ISODate.format(e.publishDate),e.hasOwnProperty("wgPatentURI")&&!Array.isArray(e.wgPatentURI)?Object.defineProperty(e,"wgId",{get(){const e=this.wgPatentURI.split("/"),t=e.findIndex(e=>"pp-impl"===e)+1;return e[t]||""}}):e.wgId=e.wgId?e.wgId:"";const r=(e.isCGBG?cgbgHeadersTmpl:headersTmpl)(e);document.body.prepend(r),document.body.classList.add("h-entry");const o=document.getElementById("sotd")||document.createElement("section");!e.isCGBG&&e.isNoTrack&&!e.isTagFinding||o.id||pub("error","A custom SotD paragraph is required for your type of document."),o.id=o.id||"sotd",o.classList.add("introductory");const i=[e.wg,e.wgURI,e.wgPatentURI];if(i.some(e=>Array.isArray(e))&&!i.every(e=>Array.isArray(e))&&pub("error","If one of '`wg`', '`wgURI`', or '`wgPatentURI`' is an array, they all have to be."),e.isCGBG&&!e.wg&&pub("error","[`wg`](https://github.com/w3c/respec/wiki/wg) configuration option is required for this kind of document."),Array.isArray(e.wg)){e.multipleWGs=e.wg.length>1,e.wgHTML=joinAnd(e.wg,(t,n)=>`the <a href='${e.wgURI[n]}'>${t}</a>`);const t=[];for(let n=0,r=e.wg.length;n<r;n++)t.push(`a <a href='${e.wgPatentURI[n]}' rel='disclosure'>`+`public list of any patent disclosures (${e.wg[n]})</a>`);e.wgPatentHTML=joinAnd(t)}else e.multipleWGs=!1,e.wg&&(e.wgHTML=`the <a href='${e.wgURI}'>${e.wg}</a>`);"PR"!==e.specStatus||e.crEnd||pub("error",'`specStatus` is "PR" but no `crEnd` is specified (needed to indicate end of previous CR).'),"CR"!==e.specStatus||e.crEnd||pub("error",'`specStatus` is "CR", but no `crEnd` is specified in Respec config.'),e.crEnd=validateDateAndRecover(e,"crEnd"),e.humanCREnd=W3CDate.format(e.crEnd),"PR"!==e.specStatus||e.prEnd||pub("error",'`specStatus` is "PR" but no `prEnd` is specified.'),e.prEnd=validateDateAndRecover(e,"prEnd"),e.humanPREnd=W3CDate.format(e.prEnd),"PER"!==e.specStatus||e.perEnd||pub("error","Status is PER but no perEnd is specified"),e.perEnd=validateDateAndRecover(e,"perEnd"),e.humanPEREnd=W3CDate.format(e.perEnd),e.recNotExpected=!(!e.noRecTrack&&!e.recNotExpected)||!e.isRecTrack&&"WD"==e.maturity&&"FPWD-NOTE"!==e.specStatus,e.noRecTrack&&recTrackStatus.includes(e.specStatus)&&pub("error",`Document configured as [\`noRecTrack\`](https://github.com/w3c/respec/wiki/noRecTrack), but its status ("${e.specStatus}") puts it on the W3C Rec Track. Status cannot be any of: ${recTrackStatus.join(", ")}. [More info](https://github.com/w3c/respec/wiki/noRecTrack).`),e.isIGNote&&!e.charterDisclosureURI&&pub("error","IG-NOTEs must link to charter's disclosure section using `charterDisclosureURI`."),hyperHTML$1.bind(o)`${populateSoTD(e,o)}`,!e.implementationReportURI&&e.isCR&&pub("error","CR documents must have an [`implementationReportURI`](https://github.com/w3c/respec/wiki/implementationReportURI) that describes [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience)."),!e.implementationReportURI&&e.isPR&&pub("warn","PR documents should include an [`implementationReportURI`](https://github.com/w3c/respec/wiki/implementationReportURI) that describes [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience)."),pub("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}function populateSoTD(e,t){const n={...collectSotdContent(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?`?subject=${encodeURIComponent(e.subjectPrefix)}`:"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}};return(e.isCGBG?cgbgSotdTmpl:sotdTmpl)(e,n)}function collectSotdContent(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(!isElement(n.firstChild)||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);return t&&!r.hasChildNodes()&&pub("warn","ReSpec does not support automated SotD generation for TAG findings, please add the prerequisite content in the 'sotd' section"),{additionalContent:r,additionalSections:n.childNodes}}function normalizeOrcid(e){const t=new URL(e,"https://orcid.org/");if("https://orcid.org"!==t.origin)throw new Error(`The origin should be "https://orcid.org", not "${t.origin}".`);const n=t.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(n))throw new Error(`ORCIDs have the format "1234-1234-1234-1234", not "${n}"`);const r=n[n.length-1],o=(12-n.split("").slice(0,-1).filter(e=>/\d/.test(e)).map(Number).reduce((e,t)=>2*(e+t),0)%11)%11;if(r!==(10===o?"X":String(o)))throw new Error(`"${n}" has an invalid checksum.`);return t.href}function isElement(e){return e.nodeType===Node.ELEMENT_NODE}var headers=Object.freeze({__proto__:null,name:name$l,run:run$a});const name$m="w3c/abstract";async function run$b(){const e=document.getElementById("abstract");if(!e)return void pub("error",'Document must have one element with `id="abstract"');e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||((t=document.createElement("h2")).textContent=l10n[lang].abstract,e.prepend(t))}var abstract=Object.freeze({__proto__:null,name:name$m,run:run$b});const name$n="core/data-transform";function run$c(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=runTransforms(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}var dataTransform=Object.freeze({__proto__:null,name:name$n,run:run$c});const name$o="core/dfn-abbr";function run$d(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;switch(e){case"dfn":processDfnElement(t);break;default:showInlineWarning(t,"[`data-abbr`](https://github.com/w3c/respec/wiki/data-abbr)"+` attribute not supported on \`${e}\` elements.`,"Error: unsupported.")}}}function processDfnElement(e){const t=generateAbbreviation(e),n=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${n}">${t}</abbr>)`);const r=e.dataset.lt||"";e.dataset.lt=r.split("|").filter(e=>e.trim()).concat(t).join("|")}function generateAbbreviation(e){return e.dataset.abbr?e.dataset.abbr:e.textContent.match(/\b([a-z])/gi).join("").toUpperCase()}var dataAbbr=Object.freeze({__proto__:null,name:name$o,run:run$d});const idlPrimitiveRegex=/^[a-z]+(\s+[a-z]+)+$/,exceptionRegex=/\B"([^"]*)"\B/,methodRegex=/(\w+)\((.*)\)$/,slotRegex=/^\[\[(\w+)\]\]$/,attributeRegex=/^((?:\[\[)?(?:\w+)(?:\]\])?)$/,enumRegex=/^(\w+)\["([\w- ]*)"\]$/,methodSplitRegex=/\.?(\w+\(.*\)$)/;function parseInlineIDL(e){const[t,n]=e.split(methodSplitRegex),r=t.split(/[./]/).concat(n).filter(e=>e&&e.trim()).map(e=>e.trim()),o=!e.includes("/"),i=[];for(;r.length;){const t=r.pop();if(methodRegex.test(t)){const[,e,n]=t.match(methodRegex),r=n.split(/,\s*/).filter(e=>e);i.push({type:"method",identifier:e,args:r,renderParent:o})}else if(enumRegex.test(t)){const[,e,n]=t.match(enumRegex);i.push({type:"enum",identifier:e,enumValue:n,renderParent:o})}else if(exceptionRegex.test(t)){const[,e]=t.match(exceptionRegex);o?i.push({type:"exception",identifier:e}):i.push({type:"enum",enumValue:e,renderParent:o})}else if(slotRegex.test(t)){const[,e]=t.match(slotRegex);i.push({type:"internal-slot",identifier:e,renderParent:o})}else if(attributeRegex.test(t)&&r.length){const[,e]=t.match(attributeRegex);i.push({type:"attribute",identifier:e,renderParent:o})}else if(idlPrimitiveRegex.test(t))i.push({type:"idl-primitive",identifier:t,renderParent:o});else{if(!attributeRegex.test(t)||0!==r.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);i.push({type:"base",identifier:t,renderParent:o})}}return i.forEach((e,t,n)=>{e.parent=n[t+1]||null}),i.reverse()}function renderBase(e){const{identifier:t,renderParent:n}=e;if(n)return hyperHTML$1`<a data-xref-type="_IDL_"><code>${t}</code></a>`}function renderInternalSlot(e){const{identifier:t,parent:n,renderParent:r}=e,{identifier:o}=n||{};return hyperHTML$1`${n&&r?".":""}<a + `; +} + +// @ts-check + +const name$l = "w3c/headers"; + +const W3CDate = new Intl.DateTimeFormat(["en-AU"], { + timeZone: "UTC", + year: "numeric", + month: "long", + day: "2-digit", +}); + +const status2maturity = { + LS: "WD", + LD: "WD", + FPWD: "WD", + LC: "WD", + FPLC: "WD", + "FPWD-NOTE": "NOTE", + "WD-NOTE": "WD", + "LC-NOTE": "LC", + "IG-NOTE": "NOTE", + "WG-NOTE": "NOTE", +}; + +const status2rdf = { + NOTE: "w3p:NOTE", + WD: "w3p:WD", + LC: "w3p:LastCall", + CR: "w3p:CR", + PR: "w3p:PR", + REC: "w3p:REC", + PER: "w3p:PER", + RSCND: "w3p:RSCND", +}; +const status2text = { + NOTE: "Working Group Note", + "WG-NOTE": "Working Group Note", + "CG-NOTE": "Co-ordination Group Note", + "IG-NOTE": "Interest Group Note", + "Member-SUBM": "Member Submission", + "Team-SUBM": "Team Submission", + MO: "Member-Only Document", + ED: "Editor's Draft", + LS: "Living Standard", + LD: "Living Document", + FPWD: "First Public Working Draft", + WD: "Working Draft", + "FPWD-NOTE": "Working Group Note", + "WD-NOTE": "Working Draft", + "LC-NOTE": "Working Draft", + FPLC: "First Public and Last Call Working Draft", + LC: "Last Call Working Draft", + CR: "Candidate Recommendation", + PR: "Proposed Recommendation", + PER: "Proposed Edited Recommendation", + REC: "Recommendation", + RSCND: "Rescinded Recommendation", + unofficial: "Unofficial Draft", + base: "Document", + finding: "TAG Finding", + "draft-finding": "Draft TAG Finding", + "CG-DRAFT": "Draft Community Group Report", + "CG-FINAL": "Final Community Group Report", + "BG-DRAFT": "Draft Business Group Report", + "BG-FINAL": "Final Business Group Report", +}; +const status2long = { + ...status2text, + "FPWD-NOTE": "First Public Working Group Note", + "LC-NOTE": "Last Call Working Draft", +}; +const maybeRecTrack = ["FPWD", "WD"]; +const recTrackStatus = ["FPLC", "LC", "CR", "PR", "PER", "REC"]; +const noTrackStatus = [ + "base", + "BG-DRAFT", + "BG-FINAL", + "CG-DRAFT", + "CG-FINAL", + "draft-finding", + "finding", + "MO", + "unofficial", +]; +const cgbg = ["CG-DRAFT", "CG-FINAL", "BG-DRAFT", "BG-FINAL"]; +const precededByAn = ["ED", "IG-NOTE"]; +const licenses = { + cc0: { + name: "Creative Commons 0 Public Domain Dedication", + short: "CC0", + url: "https://creativecommons.org/publicdomain/zero/1.0/", + }, + "w3c-software": { + name: "W3C Software Notice and License", + short: "W3C Software", + url: "https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231", + }, + "w3c-software-doc": { + name: "W3C Software and Document Notice and License", + short: "W3C Software and Document", + url: + "https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document", + }, + "cc-by": { + name: "Creative Commons Attribution 4.0 International Public License", + short: "CC-BY", + url: "https://creativecommons.org/licenses/by/4.0/legalcode", + }, +}; + +const baseLogo = Object.freeze({ + id: "", + alt: "", + href: "", + src: "", + height: "48", + width: "72", +}); + +/** + * @param {*} conf + * @param {string} prop + * @param {string | number | Date} fallbackDate + */ +function validateDateAndRecover(conf, prop, fallbackDate = new Date()) { + const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate); + // if date is valid + if (Number.isFinite(date.valueOf())) { + const formattedDate = ISODate.format(date); + return new Date(formattedDate); + } + const msg = + `[\`${prop}\`](https://github.com/w3c/respec/wiki/${prop}) ` + + `is not a valid date: "${conf[prop]}". Expected format 'YYYY-MM-DD'.`; + pub("error", msg); + return new Date(ISODate.format(new Date())); +} + +function run$a(conf) { + conf.isUnofficial = conf.specStatus === "unofficial"; + if (conf.isUnofficial && !Array.isArray(conf.logos)) { + conf.logos = []; + } + conf.isCCBY = conf.license === "cc-by"; + conf.isW3CSoftAndDocLicense = conf.license === "w3c-software-doc"; + if (["cc-by"].includes(conf.license)) { + let msg = `You cannot use license "\`${conf.license}\`" with W3C Specs. `; + msg += `Please set \`respecConfig.license: "w3c-software-doc"\` instead.`; + pub("error", msg); + } + conf.licenseInfo = licenses[conf.license]; + conf.isCGBG = cgbg.includes(conf.specStatus); + conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith("G-FINAL"); + conf.isBasic = conf.specStatus === "base"; + conf.isRegular = !conf.isCGBG && !conf.isBasic; + if (!conf.specStatus) { + pub("error", "Missing required configuration: `specStatus`"); + } + if (conf.isRegular && !conf.shortName) { + pub("error", "Missing required configuration: `shortName`"); + } + if (conf.testSuiteURI) { + const url = new URL(conf.testSuiteURI, location.href); + const { host, pathname } = url; + if ( + host === "github.com" && + pathname.startsWith("/w3c/web-platform-tests/") + ) { + const msg = + "Web Platform Tests have moved to a new Github Organization at https://github.com/web-platform-tests. " + + "Please update your [`testSuiteURI`](https://github.com/w3c/respec/wiki/testSuiteURI) to point to the " + + `new tests repository (e.g., https://github.com/web-platform-tests/wpt/${conf.shortName} ).`; + pub("warn", msg); + } + } + conf.title = document.title || "No Title"; + if (document.title && conf.isPreview && conf.prNumber) { + document.title = `Preview of PR #${conf.prNumber}: ${document.title}`; + } + if (!conf.subtitle) conf.subtitle = ""; + conf.publishDate = validateDateAndRecover( + conf, + "publishDate", + document.lastModified + ); + conf.publishYear = conf.publishDate.getUTCFullYear(); + conf.publishHumanDate = W3CDate.format(conf.publishDate); + conf.isNoTrack = noTrackStatus.includes(conf.specStatus); + conf.isRecTrack = conf.noRecTrack + ? false + : recTrackStatus.concat(maybeRecTrack).includes(conf.specStatus); + conf.isMemberSubmission = conf.specStatus === "Member-SUBM"; + if (conf.isMemberSubmission) { + const memSubmissionLogo = { + alt: "W3C Member Submission", + href: "https://www.w3.org/Submission/", + src: "https://www.w3.org/Icons/member_subm-v.svg", + width: "211", + }; + conf.logos.push({ ...baseLogo, ...memSubmissionLogo }); + } + conf.isTeamSubmission = conf.specStatus === "Team-SUBM"; + if (conf.isTeamSubmission) { + const teamSubmissionLogo = { + alt: "W3C Team Submission", + href: "https://www.w3.org/TeamSubmission/", + src: "https://www.w3.org/Icons/team_subm-v.svg", + width: "211", + }; + conf.logos.push({ ...baseLogo, ...teamSubmissionLogo }); + } + conf.isSubmission = conf.isMemberSubmission || conf.isTeamSubmission; + conf.anOrA = precededByAn.includes(conf.specStatus) ? "an" : "a"; + conf.isTagFinding = + conf.specStatus === "finding" || conf.specStatus === "draft-finding"; + if (!conf.edDraftURI) { + conf.edDraftURI = ""; + if (conf.specStatus === "ED") + pub("warn", "Editor's Drafts should set edDraftURI."); + } + conf.maturity = status2maturity[conf.specStatus] + ? status2maturity[conf.specStatus] + : conf.specStatus; + let publishSpace = "TR"; + if (conf.specStatus === "Member-SUBM") publishSpace = "Submission"; + else if (conf.specStatus === "Team-SUBM") publishSpace = "TeamSubmission"; + if (conf.isRegular) + conf.thisVersion = `https://www.w3.org/${publishSpace}/${conf.publishDate.getUTCFullYear()}/${ + conf.maturity + }-${conf.shortName}-${concatDate(conf.publishDate)}/`; + if (conf.specStatus === "ED") conf.thisVersion = conf.edDraftURI; + if (conf.isRegular) + conf.latestVersion = `https://www.w3.org/${publishSpace}/${conf.shortName}/`; + if (conf.isTagFinding) { + conf.latestVersion = `https://www.w3.org/2001/tag/doc/${conf.shortName}`; + conf.thisVersion = `${conf.latestVersion}-${ISODate.format( + conf.publishDate + )}`; + } + if (conf.previousPublishDate) { + if (!conf.previousMaturity && !conf.isTagFinding) { + pub("error", "`previousPublishDate` is set, but not `previousMaturity`."); + } + + conf.previousPublishDate = validateDateAndRecover( + conf, + "previousPublishDate" + ); + + const pmat = status2maturity[conf.previousMaturity] + ? status2maturity[conf.previousMaturity] + : conf.previousMaturity; + if (conf.isTagFinding) { + conf.prevVersion = `${conf.latestVersion}-${ISODate.format( + conf.previousPublishDate + )}`; + } else if (conf.isCGBG) { + conf.prevVersion = conf.prevVersion || ""; + } else if (conf.isBasic) { + conf.prevVersion = ""; + } else { + conf.prevVersion = `https://www.w3.org/TR/${conf.previousPublishDate.getUTCFullYear()}/${pmat}-${ + conf.shortName + }-${concatDate(conf.previousPublishDate)}/`; + } + } else { + if ( + !conf.specStatus.endsWith("NOTE") && + conf.specStatus !== "FPWD" && + conf.specStatus !== "FPLC" && + conf.specStatus !== "ED" && + !conf.noRecTrack && + !conf.isNoTrack && + !conf.isSubmission + ) + pub( + "error", + "Document on track but no previous version:" + + " Add `previousMaturity`, and `previousPublishDate` to ReSpec's config." + ); + if (!conf.prevVersion) conf.prevVersion = ""; + } + if (conf.prevRecShortname && !conf.prevRecURI) + conf.prevRecURI = `https://www.w3.org/TR/${conf.prevRecShortname}`; + const peopCheck = function(it) { + if (!it.name) pub("error", "All authors and editors must have a name."); + if (it.orcid) { + try { + it.orcid = normalizeOrcid(it.orcid); + } catch (e) { + pub("error", `"${it.orcid}" is not an ORCID. ${e.message}`); + // A failed orcid link could link to something outside of orcid, + // which would be misleading. + delete it.orcid; + } + } + }; + if (!conf.formerEditors) conf.formerEditors = []; + if (conf.editors) { + conf.editors.forEach(peopCheck); + // Move any editors with retiredDate to formerEditors. + for (let i = 0; i < conf.editors.length; i++) { + const editor = conf.editors[i]; + if ("retiredDate" in editor) { + conf.formerEditors.push(editor); + conf.editors.splice(i--, 1); + } + } + } + if (!conf.editors || conf.editors.length === 0) + pub("error", "At least one editor is required"); + if (conf.formerEditors.length) { + conf.formerEditors.forEach(peopCheck); + } + if (conf.authors) { + conf.authors.forEach(peopCheck); + } + conf.multipleEditors = conf.editors && conf.editors.length > 1; + conf.multipleFormerEditors = conf.formerEditors.length > 1; + conf.multipleAuthors = conf.authors && conf.authors.length > 1; + (conf.alternateFormats || []).forEach(it => { + if (!it.uri || !it.label) { + pub("error", "All alternate formats must have a uri and a label."); + } + }); + conf.multipleAlternates = + conf.alternateFormats && conf.alternateFormats.length > 1; + conf.alternatesHTML = + conf.alternateFormats && + joinAnd(conf.alternateFormats, alt => { + let optional = + alt.hasOwnProperty("lang") && alt.lang ? ` hreflang='${alt.lang}'` : ""; + optional += + alt.hasOwnProperty("type") && alt.type ? ` type='${alt.type}'` : ""; + return `<a rel='alternate' href='${alt.uri}'${optional}>${alt.label}</a>`; + }); + if (conf.bugTracker) { + if (conf.bugTracker.new && conf.bugTracker.open) { + conf.bugTrackerHTML = `<a href='${conf.bugTracker.new}'>${conf.l10n.file_a_bug}</a> ${conf.l10n.open_parens}<a href='${conf.bugTracker.open}'>${conf.l10n.open_bugs}</a>${conf.l10n.close_parens}`; + } else if (conf.bugTracker.open) { + conf.bugTrackerHTML = `<a href='${conf.bugTracker.open}'>open bugs</a>`; + } else if (conf.bugTracker.new) { + conf.bugTrackerHTML = `<a href='${conf.bugTracker.new}'>file a bug</a>`; + } + } + if (conf.copyrightStart && conf.copyrightStart == conf.publishYear) + conf.copyrightStart = ""; + conf.longStatus = status2long[conf.specStatus]; + conf.textStatus = status2text[conf.specStatus]; + if (status2rdf[conf.specStatus]) { + conf.rdfStatus = status2rdf[conf.specStatus]; + } + conf.showThisVersion = !conf.isNoTrack || conf.isTagFinding; + conf.showPreviousVersion = + conf.specStatus !== "FPWD" && + conf.specStatus !== "FPLC" && + conf.specStatus !== "ED" && + !conf.isNoTrack && + !conf.isSubmission; + if (conf.specStatus.endsWith("NOTE") && !conf.prevVersion) + conf.showPreviousVersion = false; + if (conf.isTagFinding) + conf.showPreviousVersion = conf.previousPublishDate ? true : false; + conf.notYetRec = conf.isRecTrack && conf.specStatus !== "REC"; + conf.isRec = conf.isRecTrack && conf.specStatus === "REC"; + if (conf.isRec && !conf.errata) + pub("error", "Recommendations must have an errata link."); + conf.notRec = conf.specStatus !== "REC"; + conf.prependW3C = !conf.isUnofficial; + conf.isED = conf.specStatus === "ED"; + conf.isCR = conf.specStatus === "CR"; + conf.isPR = conf.specStatus === "PR"; + conf.isPER = conf.specStatus === "PER"; + conf.isMO = conf.specStatus === "MO"; + conf.isNote = ["FPWD-NOTE", "WG-NOTE"].includes(conf.specStatus); + conf.isIGNote = conf.specStatus === "IG-NOTE"; + conf.dashDate = ISODate.format(conf.publishDate); + conf.publishISODate = conf.publishDate.toISOString(); + conf.shortISODate = ISODate.format(conf.publishDate); + if (conf.hasOwnProperty("wgPatentURI") && !Array.isArray(conf.wgPatentURI)) { + Object.defineProperty(conf, "wgId", { + get() { + // it's always at "pp-impl" + 1 + const urlParts = this.wgPatentURI.split("/"); + const pos = urlParts.findIndex(item => item === "pp-impl") + 1; + return urlParts[pos] || ""; + }, + }); + } else { + conf.wgId = conf.wgId ? conf.wgId : ""; + } + // configuration done - yay! + + // insert into document + const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf); + document.body.prepend(header); + document.body.classList.add("h-entry"); + + // handle SotD + const sotd = + document.getElementById("sotd") || document.createElement("section"); + if ((conf.isCGBG || !conf.isNoTrack || conf.isTagFinding) && !sotd.id) { + pub( + "error", + "A custom SotD paragraph is required for your type of document." + ); + } + sotd.id = sotd.id || "sotd"; + sotd.classList.add("introductory"); + // NOTE: + // When arrays, wg and wgURI have to be the same length (and in the same order). + // Technically wgURI could be longer but the rest is ignored. + // However wgPatentURI can be shorter. This covers the case where multiple groups + // publish together but some aren't used for patent policy purposes (typically this + // happens when one is foolish enough to do joint work with the TAG). In such cases, + // the groups whose patent policy applies need to be listed first, and wgPatentURI + // can be shorter — but it still needs to be an array. + const wgPotentialArray = [conf.wg, conf.wgURI, conf.wgPatentURI]; + if ( + wgPotentialArray.some(item => Array.isArray(item)) && + !wgPotentialArray.every(item => Array.isArray(item)) + ) { + pub( + "error", + "If one of '`wg`', '`wgURI`', or '`wgPatentURI`' is an array, they all have to be." + ); + } + if (conf.isCGBG && !conf.wg) { + pub( + "error", + "[`wg`](https://github.com/w3c/respec/wiki/wg)" + + " configuration option is required for this kind of document." + ); + } + if (Array.isArray(conf.wg)) { + conf.multipleWGs = conf.wg.length > 1; + conf.wgHTML = joinAnd(conf.wg, (wg, idx) => { + return `the <a href='${conf.wgURI[idx]}'>${wg}</a>`; + }); + const pats = []; + for (let i = 0, n = conf.wg.length; i < n; i++) { + pats.push( + `a <a href='${conf.wgPatentURI[i]}' rel='disclosure'>` + + `public list of any patent disclosures (${conf.wg[i]})</a>` + ); + } + conf.wgPatentHTML = joinAnd(pats); + } else { + conf.multipleWGs = false; + if (conf.wg) { + conf.wgHTML = `the <a href='${conf.wgURI}'>${conf.wg}</a>`; + } + } + if (conf.specStatus === "PR" && !conf.crEnd) { + pub( + "error", + `\`specStatus\` is "PR" but no \`crEnd\` is specified (needed to indicate end of previous CR).` + ); + } + + if (conf.specStatus === "CR" && !conf.crEnd) { + pub( + "error", + `\`specStatus\` is "CR", but no \`crEnd\` is specified in Respec config.` + ); + } + conf.crEnd = validateDateAndRecover(conf, "crEnd"); + conf.humanCREnd = W3CDate.format(conf.crEnd); + + if (conf.specStatus === "PR" && !conf.prEnd) { + pub("error", `\`specStatus\` is "PR" but no \`prEnd\` is specified.`); + } + conf.prEnd = validateDateAndRecover(conf, "prEnd"); + conf.humanPREnd = W3CDate.format(conf.prEnd); + + if (conf.specStatus === "PER" && !conf.perEnd) { + pub("error", "Status is PER but no perEnd is specified"); + } + conf.perEnd = validateDateAndRecover(conf, "perEnd"); + conf.humanPEREnd = W3CDate.format(conf.perEnd); + conf.recNotExpected = + conf.noRecTrack || conf.recNotExpected + ? true + : !conf.isRecTrack && + conf.maturity == "WD" && + conf.specStatus !== "FPWD-NOTE"; + if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) { + pub( + "error", + `Document configured as [\`noRecTrack\`](https://github.com/w3c/respec/wiki/noRecTrack), but its status ("${ + conf.specStatus + }") puts it on the W3C Rec Track. Status cannot be any of: ${recTrackStatus.join( + ", " + )}. [More info](https://github.com/w3c/respec/wiki/noRecTrack).` + ); + } + if (conf.isIGNote && !conf.charterDisclosureURI) { + pub( + "error", + "IG-NOTEs must link to charter's disclosure section using `charterDisclosureURI`." + ); + } + + const populated = populateSoTD(conf, sotd); + sotd.textContent = ""; + sotd.append(...populated.childNodes); + + if (!conf.implementationReportURI && conf.isCR) { + pub( + "error", + "CR documents must have an [`implementationReportURI`](https://github.com/w3c/respec/wiki/implementationReportURI) " + + "that describes [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience)." + ); + } + if (!conf.implementationReportURI && conf.isPR) { + pub( + "warn", + "PR documents should include an " + + " [`implementationReportURI`](https://github.com/w3c/respec/wiki/implementationReportURI)" + + " that describes [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience)." + ); + } + + // Requested by https://github.com/w3c/respec/issues/504 + // Makes a record of a few auto-generated things. + pub("amend-user-config", { + publishISODate: conf.publishISODate, + generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`, + }); +} + +/** + * @param {*} conf + * @param {HTMLElement} sotd + */ +function populateSoTD(conf, sotd) { + const options = { + ...collectSotdContent(sotd, conf), + + get mailToWGPublicList() { + return `mailto:${conf.wgPublicList}@w3.org`; + }, + get mailToWGPublicListWithSubject() { + const fragment = conf.subjectPrefix + ? `?subject=${encodeURIComponent(conf.subjectPrefix)}` + : ""; + return this.mailToWGPublicList + fragment; + }, + get mailToWGPublicListSubscription() { + return `mailto:${conf.wgPublicList}-request@w3.org?subject=subscribe`; + }, + }; + const template = conf.isCGBG ? cgbgSotdTmpl : sotdTmpl; + return template(conf, options); +} + +/** + * @param {HTMLElement} sotd + */ +function collectSotdContent(sotd, { isTagFinding = false }) { + const sotdClone = sotd.cloneNode(true); + const additionalContent = document.createDocumentFragment(); + // we collect everything until we hit a section, + // that becomes the custom content. + while (sotdClone.hasChildNodes()) { + if ( + isElement(sotdClone.firstChild) && + sotdClone.firstChild.localName === "section" + ) { + break; + } + additionalContent.appendChild(sotdClone.firstChild); + } + if (isTagFinding && !additionalContent.hasChildNodes()) { + pub( + "warn", + "ReSpec does not support automated SotD generation for TAG findings, " + + "please add the prerequisite content in the 'sotd' section" + ); + } + return { + additionalContent, + // Whatever sections are left, we throw at the end. + additionalSections: sotdClone.childNodes, + }; +} + +/** + * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the / + * @return {string} the full ORCID URL. Throws an error if the ID is invalid. + */ +function normalizeOrcid(orcid) { + const orcidUrl = new URL(orcid, "https://orcid.org/"); + if (orcidUrl.origin !== "https://orcid.org") { + throw new Error( + `The origin should be "https://orcid.org", not "${orcidUrl.origin}".` + ); + } + + // trailing slash would mess up checksum + const orcidId = orcidUrl.pathname.slice(1).replace(/\/$/, ""); + if (!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(orcidId)) { + throw new Error( + `ORCIDs have the format "1234-1234-1234-1234", not "${orcidId}"` + ); + } + + // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier + const lastDigit = orcidId[orcidId.length - 1]; + const remainder = orcidId + .split("") + .slice(0, -1) + .filter(c => /\d/.test(c)) + .map(Number) + .reduce((acc, c) => (acc + c) * 2, 0); + const lastDigitInt = (12 - (remainder % 11)) % 11; + const lastDigitShould = lastDigitInt === 10 ? "X" : String(lastDigitInt); + if (lastDigit !== lastDigitShould) { + throw new Error(`"${orcidId}" has an invalid checksum.`); + } + + return orcidUrl.href; +} + +/** + * @param {Node} node + * @return {node is Element} + */ +function isElement(node) { + return node.nodeType === Node.ELEMENT_NODE; +} + +var headers = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$l, + run: run$a +}); + +// @ts-check +const name$m = "w3c/abstract"; + +async function run$b() { + const abs = document.getElementById("abstract"); + if (!abs) { + pub("error", `Document must have one element with \`id="abstract"`); + return; + } + abs.classList.add("introductory"); + let abstractHeading = document.querySelector("#abstract>h2"); + if (abstractHeading) { + return; + } + abstractHeading = document.createElement("h2"); + abstractHeading.textContent = l10n[lang].abstract; + abs.prepend(abstractHeading); +} + +var abstract = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$m, + run: run$b +}); + +// @ts-check + +const name$n = "core/data-transform"; + +function run$c() { + /** @type {NodeListOf<HTMLElement>} */ + const transformables = document.querySelectorAll("[data-transform]"); + transformables.forEach(el => { + el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform); + el.removeAttribute("data-transform"); + }); +} + +var dataTransform = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$n, + run: run$c +}); + +// @ts-check +const name$o = "core/dfn-abbr"; + +function run$d() { + /** @type {NodeListOf<HTMLElement>} */ + const elements = document.querySelectorAll("[data-abbr]"); + for (const elem of elements) { + const { localName } = elem; + switch (localName) { + case "dfn": + processDfnElement(elem); + break; + default: { + const msg = + `[\`data-abbr\`](https://github.com/w3c/respec/wiki/data-abbr)` + + ` attribute not supported on \`${localName}\` elements.`; + showInlineWarning(elem, msg, "Error: unsupported."); + } + } + } +} +/** + * @param {HTMLElement} dfn + */ +function processDfnElement(dfn) { + const abbr = generateAbbreviation(dfn); + // get normalized <dfn> textContent to remove spaces, tabs, new lines. + const fullForm = dfn.textContent.replace(/\s\s+/g, " ").trim(); + dfn.insertAdjacentHTML( + "afterend", + ` (<abbr title="${fullForm}">${abbr}</abbr>)` + ); + const lt = dfn.dataset.lt || ""; + dfn.dataset.lt = lt + .split("|") + .filter(i => i.trim()) + .concat(abbr) + .join("|"); +} + +function generateAbbreviation(elem) { + if (elem.dataset.abbr) return elem.dataset.abbr; + // Generates abbreviation from textContent + // e.g., "Permanent Account Number" -> "PAN" + return elem.textContent + .match(/\b([a-z])/gi) + .join("") + .toUpperCase(); +} + +var dataAbbr = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$o, + run: run$d +}); + +// @ts-check +const idlPrimitiveRegex = /^[a-z]+(\s+[a-z]+)+$/; // {{unrestricted double}} {{ double }} +const exceptionRegex = /\B"([^"]*)"\B/; // {{ "SomeException" }} +const methodRegex = /(\w+)\((.*)\)$/; +const slotRegex = /^\[\[(\w+)\]\]$/; +// matches: `value` or `[[value]]` +// NOTE: [[value]] is actually a slot, but database has this as type="attribute" +const attributeRegex = /^((?:\[\[)?(?:\w+)(?:\]\])?)$/; +const enumRegex = /^(\w+)\["([\w- ]*)"\]$/; +// TODO: const splitRegex = /(?<=\]\]|\b)\./ +// https://github.com/w3c/respec/pull/1848/files#r225087385 +const methodSplitRegex = /\.?(\w+\(.*\)$)/; + +/** + * @typedef {object} IdlBase + * @property {"base"} type + * @property {string} identifier + * @property {boolean} renderParent + * @property {InlineIdl | null} [parent] + * + * @typedef {object} IdlAttribute + * @property {"attribute"} type + * @property {string} identifier + * @property {boolean} renderParent + * @property {InlineIdl | null} [parent] + * + * @typedef {object} IdlInternalSlot + * @property {"internal-slot"} type + * @property {string} identifier + * @property {boolean} renderParent + * @property {InlineIdl | null} [parent] + * + * @typedef {object} IdlMethod + * @property {"method"} type + * @property {string} identifier + * @property {string[]} args + * @property {boolean} renderParent + * @property {InlineIdl | null} [parent] + * + * @typedef {object} IdlEnum + * @property {"enum"} type + * @property {string} [identifier] + * @property {string} enumValue + * @property {boolean} renderParent + * @property {InlineIdl | null} [parent] + * + * @typedef {object} IdlException + * @property {"exception"} type + * @property {string} identifier + * @property {InlineIdl | null} [parent] + * + * @typedef {object} IdlPrimitive + * @property {"idl-primitive"} type + * @property {string} identifier + * @property {boolean} renderParent + * @property {InlineIdl | null} [parent] + * + * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl + */ + +/** + * @param {string} str + * @returns {InlineIdl[]} + */ +function parseInlineIDL(str) { + const [nonMethodPart, methodPart] = str.split(methodSplitRegex); + const tokens = nonMethodPart + .split(/[./]/) + .concat(methodPart) + .filter(s => s && s.trim()) + .map(s => s.trim()); + const renderParent = !str.includes("/"); + /** @type {InlineIdl[]} */ + const results = []; + while (tokens.length) { + const value = tokens.pop(); + // Method + if (methodRegex.test(value)) { + const [, identifier, allArgs] = value.match(methodRegex); + const args = allArgs.split(/,\s*/).filter(arg => arg); + results.push({ type: "method", identifier, args, renderParent }); + continue; + } + // Enum["enum value"] + if (enumRegex.test(value)) { + const [, identifier, enumValue] = value.match(enumRegex); + results.push({ type: "enum", identifier, enumValue, renderParent }); + continue; + } + // Exception - "NotAllowedError" + // Or alternate enum syntax: {{ EnumContainer / "some enum value" }} + if (exceptionRegex.test(value)) { + const [, identifier] = value.match(exceptionRegex); + if (renderParent) { + results.push({ type: "exception", identifier }); + } else { + results.push({ type: "enum", enumValue: identifier, renderParent }); + } + continue; + } + // internal slot + if (slotRegex.test(value)) { + const [, identifier] = value.match(slotRegex); + results.push({ type: "internal-slot", identifier, renderParent }); + continue; + } + // attribute + if (attributeRegex.test(value) && tokens.length) { + const [, identifier] = value.match(attributeRegex); + results.push({ type: "attribute", identifier, renderParent }); + continue; + } + if (idlPrimitiveRegex.test(value)) { + results.push({ type: "idl-primitive", identifier: value, renderParent }); + continue; + } + // base, always final token + if (attributeRegex.test(value) && tokens.length === 0) { + results.push({ type: "base", identifier: value, renderParent }); + continue; + } + throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${str} }}\``); + } + // link the list + results.forEach((item, i, list) => { + item.parent = list[i + 1] || null; + }); + // return them in the order we found them... + return results.reverse(); +} + +/** + * @param {IdlBase} details + */ +function renderBase(details) { + // Check if base is a local variable in a section + const { identifier, renderParent } = details; + if (renderParent) { + return hyperHTML`<a data-xref-type="_IDL_"><code>${identifier}</code></a>`; + } +} + +/** + * Internal slot: .[[identifier]] or [[identifier]] + * @param {IdlInternalSlot} details + */ +function renderInternalSlot(details) { + const { identifier, parent, renderParent } = details; + const { identifier: linkFor } = parent || {}; + const lt = `[[${identifier}]]`; + const dot = parent && renderParent ? "." : ""; + const anchor = hyperHTML`<a data-xref-type="attribute" - data-link-for=${o} - data-xref-for=${o} - data-lt="${`[[${t}]]`}"><code>[[${t}]]</code></a>`}function renderAttribute(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return hyperHTML$1`${r?".":""}<a + data-lt="${lt}"><code>[[${identifier}]]</code></a>`; + if (linkFor) { + anchor.dataset.linkFor = linkFor; + anchor.dataset.xrefFor = linkFor; + } + return hyperHTML`${dot}${anchor}${""}`; // TODO: remove dangling empty string +} + +/** + * Attribute: .identifier + * @param {IdlAttribute} details + */ +function renderAttribute(details) { + const { parent, identifier, renderParent } = details; + const { identifier: linkFor } = parent || {}; + const html = hyperHTML`${renderParent ? "." : ""}<a data-xref-type="attribute|dict-member" - data-link-for="${o}" - data-xref-for="${o}" - ><code>${n}</code></a>`}function renderMethod(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{identifier:a}=o||{},s=t.map(e=>`<var>${e}</var>`).join(", "),c=`${n}(${t.join(", ")})`;return hyperHTML$1`${o&&i?".":""}<a - data-xref-type="${r}" - data-link-for="${a}" - data-xref-for="${a}" - data-lt="${c}" - ><code>${n}</code></a><code>(${[s]})</code>`}function renderEnum(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return hyperHTML$1`"<a + data-link-for="${linkFor}" + data-xref-for="${linkFor}" + ><code>${identifier}</code></a>${""}`; // TODO: remove dangling empty string + return html; +} + +/** + * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...) + * @param {IdlMethod} details + */ +function renderMethod(details) { + const { args, identifier, type, parent, renderParent } = details; + const { identifier: linkFor } = parent || {}; + const argsText = args.map(arg => `<var>${arg}</var>`).join(", "); + const searchText = `${identifier}(${args.join(", ")})`; + const html = hyperHTML`${parent && renderParent ? "." : ""}<a + data-xref-type="${type}" + data-link-for="${linkFor}" + data-xref-for="${linkFor}" + data-lt="${searchText}" + ><code>${identifier}</code></a><code>(${raw(argsText)})</code>`; + return html; +} + +/** + * Enum: + * Identifier["enum value"] + * Identifier / "enum value" + * @param {IdlEnum} details + */ +function renderEnum(details) { + const { identifier, enumValue, parent } = details; + const forContext = parent ? parent.identifier : identifier; + const anchor = hyperHTML`<a data-xref-type="enum-value" - data-link-for="${o}" - data-xref-for="${o}" - data-lt="${n?null:"the-empty-string"}" - ><code>${n}</code></a>"`}function renderException(e){const{identifier:t}=e;return hyperHTML$1`"<a + data-link-for="${forContext}" + data-xref-for="${forContext}" + ><code>${enumValue}</code></a>`; + if (!enumValue) { + anchor.dataset.lt = "the-empty-string"; + } + return hyperHTML`"${anchor}"`; +} + +/** + * Exception value: "NotAllowedError" + * Only the WebIDL spec can define exceptions + * @param {IdlException} details + */ +function renderException(details) { + const { identifier } = details; + const html = hyperHTML`"<a data-cite="WebIDL" data-xref-type="exception" - ><code>${t}</code></a>"`}function renderIdlPrimitiveType(e){const{identifier:t}=e;return hyperHTML$1`<a + ><code>${identifier}</code></a>"`; + return html; +} + +/** + * Interface types: {{ unrestricted double }} {{long long}} + * Only the WebIDL spec defines these types. + * @param {IdlPrimitive} details + */ +function renderIdlPrimitiveType(details) { + const { identifier } = details; + const html = hyperHTML`<a data-cite="WebIDL" data-xref-type="interface" - ><code>${t}</code></a>`}function idlStringToHtml(e){let t;try{t=parseInlineIDL(e)}catch(t){const n=hyperHTML$1`<span>{{ ${e} }}</span>`;return showInlineError(n,t.message,"Error: Invalid inline IDL string"),n}const n=hyperHTML$1(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=renderBase(e);t&&r.push(t);break}case"attribute":r.push(renderAttribute(e));break;case"internal-slot":r.push(renderInternalSlot(e));break;case"method":r.push(renderMethod(e));break;case"enum":r.push(renderEnum(e));break;case"exception":r.push(renderException(e));break;case"idl-primitive":r.push(renderIdlPrimitiveType(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const ALLOWED_TYPES=new Set(["alias","reference"]),readyPromise=openIdb();async function openIdb(){return await idb.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map(t=>e.deleteObjectStore(t)),e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}})}const biblioDB={get ready(){return readyPromise},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!ALLOWED_TYPES.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!ALLOWED_TYPES.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e){if(!e)return;const t={alias:new Set,reference:new Set};Object.keys(e).filter(t=>{if("string"==typeof e[t]){let e=`Legacy SpecRef entries are not supported: \`[[${t}]]\`. `;return pub("error",e+="Please update it to the new format at [specref repo](https://github.com/tobie/specref/)"),!1}return!0}).map(t=>Object.assign({id:t},e[t])).forEach(e=>{e.aliasOf?t.alias.add(e):t.reference.add(e)});const n=[...ALLOWED_TYPES].map(e=>Array.from(t[e]).map(t=>this.add(e,t))).reduce(flatten,[]);await Promise.all(n)},async add(e,t){if(!ALLOWED_TYPES.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready,r=await this.has(e,t.id),o=n.transaction(e,"readwrite").store;return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...ALLOWED_TYPES],n=e.transaction(t,"readwrite"),r=t.map(e=>n.objectStore(e).clear());await Promise.all(r)}},biblio={},name$p="core/biblio",bibrefsURL=new URL("https://specref.herokuapp.com/bibrefs?refs=");function normalizeReferences(e){const t=new Set([...e.normativeReferences].map(e=>e.toLowerCase()));Array.from(e.informativeReferences).filter(e=>t.has(e.toLowerCase())).forEach(t=>e.informativeReferences.delete(t))}function getRefKeys(e){return{informativeReferences:Array.from(e.informativeReferences),normativeReferences:Array.from(e.normativeReferences)}}const link=createResourceHint({hint:"dns-prefetch",href:bibrefsURL.origin});let doneResolver$2;document.head.appendChild(link);const done$2=new Promise(e=>{doneResolver$2=e});async function updateFromNetwork(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter(e=>e.trim());if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(bibrefsURL.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json();try{await biblioDB.addAll(o)}catch(e){console.error(e)}return o}async function resolveRef(e){const t=await done$2;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await resolveRef(n.aliasOf):n}async function run$e(e){if(e.localBiblio||(e.localBiblio={}),e.biblio){let e="Overriding `.biblio` in config. Please use ";pub("warn",e+="`.localBiblio` for custom biblio entries.")}e.biblio=biblio;const t=Array.from(Object.keys(e.localBiblio)).filter(t=>e.localBiblio[t].hasOwnProperty("aliasOf")).map(t=>e.localBiblio[t].aliasOf).filter(t=>!e.localBiblio.hasOwnProperty(t));normalizeReferences(e);const n=getRefKeys(e),r=n.normativeReferences.concat(n.informativeReferences).filter(t=>!e.localBiblio.hasOwnProperty(t)).concat(t).reduce((e,t)=>(-1===e.indexOf(t)&&e.push(t),e),[]).sort(),o=[];try{await biblioDB.ready;const e=r.map(async e=>({id:e,data:await biblioDB.find(e)}));o.push(...await Promise.all(e))}catch(e){o.push(...r.map(e=>({id:e,data:null}))),console.warn(e)}const i={hasData:[],noData:[]};o.forEach(e=>{(e.data?i.hasData:i.noData).push(e)}),i.hasData.forEach(e=>{biblio[e.id]=e.data});const a=i.noData.map(e=>e.id);if(a.length){const e=await updateFromNetwork(a,{forceUpdate:!0});Object.assign(biblio,e)}Object.assign(biblio,e.localBiblio),doneResolver$2(e.biblio)}var biblio$1=Object.freeze({__proto__:null,biblio:biblio,name:name$p,updateFromNetwork:updateFromNetwork,resolveRef:resolveRef,run:run$e,wireReference:wireReference,stringifyReference:stringifyReference});const name$q="core/render-biblio",localizationStrings$2={en:{info_references:"Informative references",norm_references:"Normative references",references:"References"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias"}},lang$a=lang in localizationStrings$2?lang:"en",l10n$4=localizationStrings$2[lang$a],REF_STATUSES=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["FPWD","W3C First Public Working Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Note"],["PER","W3C Proposed Edited Recommendation"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"],["WG-NOTE","W3C Working Group Note"]]),defaultsReference=Object.freeze({authors:[],date:"",href:"",publisher:"",status:"",title:"",etAl:!1}),endWithDot=endNormalizer(".");function run$f(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length&&!e.refNote)return;const r=hyperHTML$1` + ><code>${identifier}</code></a>`; + return html; +} + +/** + * Generates HTML by parsing an IDL string + * @param {String} str IDL string + * @return {Node} html output + */ +function idlStringToHtml(str) { + let results; + try { + results = parseInlineIDL(str); + } catch (error) { + const el = hyperHTML`<span>{{ ${str} }}</span>`; + showInlineError(el, error.message, "Error: Invalid inline IDL string"); + return el; + } + const output = []; + for (const details of results) { + switch (details.type) { + case "base": { + const base = renderBase(details); + if (base) output.push(base); + break; + } + case "attribute": + output.push(renderAttribute(details)); + break; + case "internal-slot": + output.push(renderInternalSlot(details)); + break; + case "method": + output.push(renderMethod(details)); + break; + case "enum": + output.push(renderEnum(details)); + break; + case "exception": + output.push(renderException(details)); + break; + case "idl-primitive": + output.push(renderIdlPrimitiveType(details)); + break; + default: + throw new Error("Unknown type."); + } + } + const result = hyperHTML`${output}`; + return result; +} + +// @ts-check + +/** + * @typedef {keyof BiblioDb} AllowedType + * @type {Set<AllowedType>} + */ +const ALLOWED_TYPES = new Set(["alias", "reference"]); +/* Database initialization tracker */ +const readyPromise = openIdb(); + +/** + * @typedef {object} BiblioDb + * + * @property {object} alias Object store for alias objects + * @property {string} alias.key + * @property {object} alias.value + * @property {object} alias.indexes + * @property {string} alias.aliasOf + * + * @property {object} reference Object store for reference objects + * @property {string} reference.key + * @property {object} reference.value + * + * @returns {Promise<import("idb").IDBPDatabase<BiblioDb>>} + */ +async function openIdb() { + return await idb.openDB("respec-biblio2", 12, { + upgrade(db) { + Array.from(db.objectStoreNames).map(storeName => + db.deleteObjectStore(storeName) + ); + const store = db.createObjectStore("alias", { keyPath: "id" }); + store.createIndex("aliasOf", "aliasOf", { unique: false }); + db.createObjectStore("reference", { keyPath: "id" }); + }, + }); +} + +const biblioDB = { + get ready() { + return readyPromise; + }, + /** + * Finds either a reference or an alias. + * If it's an alias, it resolves it. + * + * @param {String} id The reference or alias to look for. + * @return {Promise<Object?>} The reference or null. + */ + async find(id) { + if (await this.isAlias(id)) { + id = await this.resolveAlias(id); + } + return await this.get("reference", id); + }, + /** + * Checks if the database has an id for a given type. + * + * @param {AllowedType} type One of the ALLOWED_TYPES. + * @param {String} id The reference to find. + * @return {Promise<Boolean>} True if it has it, false otherwise. + */ + async has(type, id) { + if (!ALLOWED_TYPES.has(type)) { + throw new TypeError(`Invalid type: ${type}`); + } + if (!id) { + throw new TypeError("id is required"); + } + const db = await this.ready; + const objectStore = db.transaction(type, "readonly").store; + const range = IDBKeyRange.only(id); + const result = await objectStore.openCursor(range); + return !!result; + }, + /** + * Checks if a given id is an alias. + * + * @param {String} id The reference to check. + * @return {Promise<Boolean>} Resolves with true if found. + */ + async isAlias(id) { + return await this.has("alias", id); + }, + /** + * Resolves an alias to its corresponding reference id. + * + * @param {String} id The id of the alias to look up. + * @return {Promise<String>} The id of the resolved reference. + */ + async resolveAlias(id) { + if (!id) { + throw new TypeError("id is required"); + } + const db = await this.ready; + + const objectStore = db.transaction("alias", "readonly").store; + const range = IDBKeyRange.only(id); + const result = await objectStore.openCursor(range); + return result ? result.value.aliasOf : result; + }, + /** + * Get a reference or alias out of the database. + * + * @param {AllowedType} type The type as per ALLOWED_TYPES. + * @param {string} id The id for what to look up. + * @return {Promise<Object?>} Resolves with the retrieved object, or null. + */ + async get(type, id) { + if (!ALLOWED_TYPES.has(type)) { + throw new TypeError(`Invalid type: ${type}`); + } + if (!id) { + throw new TypeError("id is required"); + } + const db = await this.ready; + const objectStore = db.transaction(type, "readonly").store; + const range = IDBKeyRange.only(id); + const result = await objectStore.openCursor(range); + return result ? result.value : result; + }, + /** + * Adds references and aliases to database. This is usually the data from + * Specref's output (parsed JSON). + * + * @param {Object} data An object that contains references and aliases. + */ + async addAll(data) { + if (!data) { + return; + } + const aliasesAndRefs = { + alias: new Set(), + reference: new Set(), + }; + Object.keys(data) + .filter(key => { + if (typeof data[key] === "string") { + let msg = `Legacy SpecRef entries are not supported: \`[[${key}]]\`. `; + msg += + "Please update it to the new format at [specref repo](https://github.com/tobie/specref/)"; + pub("error", msg); + return false; + } + return true; + }) + .map(id => Object.assign({ id }, data[id])) + .forEach(obj => { + if (obj.aliasOf) { + aliasesAndRefs.alias.add(obj); + } else { + aliasesAndRefs.reference.add(obj); + } + }); + const promisesToAdd = [...ALLOWED_TYPES] + .map(type => { + return Array.from(aliasesAndRefs[type]).map(details => + this.add(type, details) + ); + }) + .reduce(flatten, []); + await Promise.all(promisesToAdd); + }, + /** + * Adds a reference or alias to the database. + * + * @param {AllowedType} type The type as per ALLOWED_TYPES. + * @param {Object} details The object to store. + */ + async add(type, details) { + if (!ALLOWED_TYPES.has(type)) { + throw new TypeError(`Invalid type: ${type}`); + } + if (typeof details !== "object") { + throw new TypeError("details should be an object"); + } + if (type === "alias" && !details.hasOwnProperty("aliasOf")) { + throw new TypeError("Invalid alias object."); + } + const db = await this.ready; + const isInDB = await this.has(type, details.id); + const store = db.transaction(type, "readwrite").store; + // update or add, depending of already having it in db + return isInDB ? await store.put(details) : await store.add(details); + }, + /** + * Closes the underlying database. + * + * @return {Promise<void>} Resolves after database closes. + */ + async close() { + const db = await this.ready; + db.close(); + }, + + /** + * Clears the underlying database + */ + async clear() { + const db = await this.ready; + const storeNames = [...ALLOWED_TYPES]; + const stores = db.transaction(storeNames, "readwrite"); + const clearStorePromises = storeNames.map(name => { + return stores.objectStore(name).clear(); + }); + await Promise.all(clearStorePromises); + }, +}; + +// @ts-check +const biblio = {}; + +const name$p = "core/biblio"; + +const bibrefsURL = new URL("https://specref.herokuapp.com/bibrefs?refs="); + +/** + * Normative references take precedence over informative ones, + * so any duplicates ones are removed from the informative set. + */ +function normalizeReferences(conf) { + const normalizedNormativeRefs = new Set( + [...conf.normativeReferences].map(key => key.toLowerCase()) + ); + Array.from(conf.informativeReferences) + .filter(key => normalizedNormativeRefs.has(key.toLowerCase())) + .forEach(redundantKey => conf.informativeReferences.delete(redundantKey)); +} + +function getRefKeys(conf) { + return { + informativeReferences: Array.from(conf.informativeReferences), + normativeReferences: Array.from(conf.normativeReferences), + }; +} + +// Opportunistically dns-prefetch to bibref server, as we don't know yet +// if we will actually need to download references yet. +const link = createResourceHint({ + hint: "dns-prefetch", + href: bibrefsURL.origin, +}); +document.head.appendChild(link); +let doneResolver$2; +const done$2 = new Promise(resolve => { + doneResolver$2 = resolve; +}); + +async function updateFromNetwork( + refs, + options = { forceUpdate: false } +) { + const refsToFetch = [...new Set(refs)].filter(ref => ref.trim()); + // Update database if needed, if we are online + if (!refsToFetch.length || navigator.onLine === false) { + return null; + } + let response; + try { + response = await fetch(bibrefsURL.href + refsToFetch.join(",")); + } catch (err) { + console.error(err); + return null; + } + if ((!options.forceUpdate && !response.ok) || response.status !== 200) { + return null; + } + const data = await response.json(); + try { + await biblioDB.addAll(data); + } catch (err) { + console.error(err); + } + return data; +} + +/** + * @param {string} key + */ +async function resolveRef(key) { + const biblio = await done$2; + if (!biblio.hasOwnProperty(key)) { + return null; + } + const entry = biblio[key]; + if (entry.aliasOf) { + return await resolveRef(entry.aliasOf); + } + return entry; +} + +async function run$e(conf) { + const finish = () => { + doneResolver$2(conf.biblio); + }; + if (!conf.localBiblio) { + conf.localBiblio = {}; + } + if (conf.biblio) { + let msg = "Overriding `.biblio` in config. Please use "; + msg += "`.localBiblio` for custom biblio entries."; + pub("warn", msg); + } + conf.biblio = biblio; + const localAliases = Array.from(Object.keys(conf.localBiblio)) + .filter(key => conf.localBiblio[key].hasOwnProperty("aliasOf")) + .map(key => conf.localBiblio[key].aliasOf) + .filter(key => !conf.localBiblio.hasOwnProperty(key)); + normalizeReferences(conf); + const allRefs = getRefKeys(conf); + const neededRefs = allRefs.normativeReferences + .concat(allRefs.informativeReferences) + // Filter, as to not go to network for local refs + .filter(key => !conf.localBiblio.hasOwnProperty(key)) + // but include local aliases which refer to external specs + .concat(localAliases) + // remove duplicates + .reduce((collector, item) => { + if (collector.indexOf(item) === -1) { + collector.push(item); + } + return collector; + }, []) + .sort(); + const idbRefs = []; + + // See if we have them in IDB + try { + await biblioDB.ready; // can throw + const promisesToFind = neededRefs.map(async id => ({ + id, + data: await biblioDB.find(id), + })); + idbRefs.push(...(await Promise.all(promisesToFind))); + } catch (err) { + // IndexedDB died, so we need to go to the network for all + // references + idbRefs.push(...neededRefs.map(id => ({ id, data: null }))); + console.warn(err); + } + const split = { hasData: [], noData: [] }; + idbRefs.forEach(ref => { + (ref.data ? split.hasData : split.noData).push(ref); + }); + split.hasData.forEach(ref => { + biblio[ref.id] = ref.data; + }); + const externalRefs = split.noData.map(item => item.id); + if (externalRefs.length) { + // Going to the network for refs we don't have + const data = await updateFromNetwork(externalRefs, { forceUpdate: true }); + Object.assign(biblio, data); + } + Object.assign(biblio, conf.localBiblio); + finish(); +} + +var biblio$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + biblio: biblio, + name: name$p, + updateFromNetwork: updateFromNetwork, + resolveRef: resolveRef, + run: run$e, + wireReference: wireReference, + stringifyReference: stringifyReference +}); + +// @ts-check + +const name$q = "core/render-biblio"; + +const localizationStrings$2 = { + en: { + info_references: "Informative references", + norm_references: "Normative references", + references: "References", + }, + nl: { + info_references: "Informatieve referenties", + norm_references: "Normatieve referenties", + references: "Referenties", + }, + es: { + info_references: "Referencias informativas", + norm_references: "Referencias normativas", + references: "Referencias", + }, +}; + +const lang$a = lang in localizationStrings$2 ? lang : "en"; + +const l10n$4 = localizationStrings$2[lang$a]; + +const REF_STATUSES = new Map([ + ["CR", "W3C Candidate Recommendation"], + ["ED", "W3C Editor's Draft"], + ["FPWD", "W3C First Public Working Draft"], + ["LCWD", "W3C Last Call Working Draft"], + ["NOTE", "W3C Note"], + ["PER", "W3C Proposed Edited Recommendation"], + ["PR", "W3C Proposed Recommendation"], + ["REC", "W3C Recommendation"], + ["WD", "W3C Working Draft"], + ["WG-NOTE", "W3C Working Group Note"], +]); + +const defaultsReference = Object.freeze({ + authors: [], + date: "", + href: "", + publisher: "", + status: "", + title: "", + etAl: false, +}); + +const endWithDot = endNormalizer("."); + +function run$f(conf) { + const informs = Array.from(conf.informativeReferences); + const norms = Array.from(conf.normativeReferences); + + if (!informs.length && !norms.length && !conf.refNote) return; + + const refsec = hyperHTML` <section id='references' class='appendix'> <h2>${l10n$4.references}</h2> - ${e.refNote?hyperHTML$1`<p>${e.refNote}</p>`:""} - </section>`;for(const e of["Normative","Informative"]){const o="Normative"===e?n:t;if(!o.length)continue;const i=hyperHTML$1` + ${conf.refNote ? hyperHTML`<p>${conf.refNote}</p>` : ""} + </section>`; + + for (const type of ["Normative", "Informative"]) { + const refs = type === "Normative" ? norms : informs; + if (!refs.length) continue; + + const sec = hyperHTML` <section> - <h3>${"Normative"===e?l10n$4.norm_references:l10n$4.info_references}</h3> - </section>`;addId(i);const{goodRefs:a,badRefs:s}=o.map(toRefContent).reduce((e,t)=>{return e[t.refcontent?"goodRefs":"badRefs"].push(t),e},{goodRefs:[],badRefs:[]}),c=[...a.reduce((e,t)=>(e.has(t.refcontent.id)||e.set(t.refcontent.id,t),e),new Map).values()],l=c.concat(s).sort((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()));i.appendChild(hyperHTML$1` + <h3>${ + type === "Normative" ? l10n$4.norm_references : l10n$4.info_references + }</h3> + </section>`; + addId(sec); + + const { goodRefs, badRefs } = refs.map(toRefContent).reduce( + (refObjects, ref) => { + const refType = ref.refcontent ? "goodRefs" : "badRefs"; + refObjects[refType].push(ref); + return refObjects; + }, + { goodRefs: [], badRefs: [] } + ); + + const uniqueRefs = [ + ...goodRefs + .reduce((uniqueRefs, ref) => { + if (!uniqueRefs.has(ref.refcontent.id)) { + // the condition ensures that only the first used [[TERM]] + // shows up in #references section + uniqueRefs.set(ref.refcontent.id, ref); + } + return uniqueRefs; + }, new Map()) + .values(), + ]; + + const refsToShow = uniqueRefs + .concat(badRefs) + .sort((a, b) => + a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase()) + ); + + sec.appendChild(hyperHTML` <dl class='bibliography'> - ${l.map(showRef)} - </dl>`),r.appendChild(i),decorateInlineReference(c,getAliases(a)),warnBadRefs(s)}document.body.appendChild(r)}function toRefContent(e){let t=biblio[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null,pub("error",`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`)}else n=t.aliasOf,t=biblio[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function renderInlineCitation(e){const t=e.replace(/^(!|\?)/,""),n=`#bib-${t.toLowerCase()}`;return hyperHTML$1`[<cite><a class="bibref" href="${n}">${t}</a></cite>]`}function showRef({ref:e,refcontent:t}){const n=`bib-${e.toLowerCase()}`;return t?hyperHTML$1` - <dt id="${n}">[${e}]</dt> - <dd>${{html:stringifyReference(t)}}</dd> - `:hyperHTML$1` - <dt id="${n}">[${e}]</dt> + ${refsToShow.map(showRef)} + </dl>`); + refsec.appendChild(sec); + + const aliases = getAliases(goodRefs); + decorateInlineReference(uniqueRefs, aliases); + warnBadRefs(badRefs); + } + + document.body.appendChild(refsec); +} + +/** + * returns refcontent and unique key for a reference among its aliases + * and warns about circular references + * @param {String} ref + */ +function toRefContent(ref) { + let refcontent = biblio[ref]; + let key = ref; + const circular = new Set([key]); + while (refcontent && refcontent.aliasOf) { + if (circular.has(refcontent.aliasOf)) { + refcontent = null; + const msg = `Circular reference in biblio DB between [\`${ref}\`] and [\`${key}\`].`; + pub("error", msg); + } else { + key = refcontent.aliasOf; + refcontent = biblio[key]; + circular.add(key); + } + } + if (refcontent && !refcontent.id) { + refcontent.id = ref.toLowerCase(); + } + return { ref, refcontent }; +} + +/** + * Render an inline citation + * + * @param {String} ref the inline reference. + * @returns HTMLElement + */ +function renderInlineCitation(ref) { + const key = ref.replace(/^(!|\?)/, ""); + const href = `#bib-${key.toLowerCase()}`; + return hyperHTML`[<cite><a class="bibref" href="${href}">${key}</a></cite>]`; +} + +/** + * renders a reference + */ +function showRef({ ref, refcontent }) { + const refId = `bib-${ref.toLowerCase()}`; + if (refcontent) { + return hyperHTML` + <dt id="${refId}">[${ref}]</dt> + <dd>${raw(stringifyReference(refcontent))}</dd> + `; + } else { + return hyperHTML` + <dt id="${refId}">[${ref}]</dt> <dd><em class="respec-offending-element">Reference not found.</em></dd> - `}function endNormalizer(e){return t=>{const n=t.trim();return!n||n.endsWith(e)?n:n+e}}function wireReference(e,t="_blank"){if("object"!=typeof e)throw new TypeError("Only modern object references are allowed");const n=Object.assign({},defaultsReference,e),r=n.authors.join("; ")+(n.etAl?" et al":""),o=REF_STATUSES.get(n.status)||n.status;return hyperHTML$1.wire(n)` + `; + } +} + +function endNormalizer(endStr) { + return str => { + const trimmed = str.trim(); + const result = + !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr; + return result; + }; +} + +function wireReference(rawRef, target = "_blank") { + if (typeof rawRef !== "object") { + throw new TypeError("Only modern object references are allowed"); + } + const ref = Object.assign({}, defaultsReference, rawRef); + const authors = ref.authors.join("; ") + (ref.etAl ? " et al" : ""); + const status = REF_STATUSES.get(ref.status) || ref.status; + return hyperHTML` <cite> <a - href="${n.href}" - target="${t}" + href="${ref.href}" + target="${target}" rel="noopener noreferrer"> - ${n.title.trim()}</a>. + ${ref.title.trim()}</a>. </cite> <span class="authors"> - ${endWithDot(r)} + ${endWithDot(authors)} </span> <span class="publisher"> - ${endWithDot(n.publisher)} + ${endWithDot(ref.publisher)} </span> <span class="pubDate"> - ${endWithDot(n.date)} + ${endWithDot(ref.date)} </span> <span class="pubStatus"> - ${endWithDot(o)} + ${endWithDot(status)} </span> - `}function stringifyReference(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${endWithDot(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${REF_STATUSES.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}function getAliases(e){return e.reduce((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e},new Map)}function decorateInlineReference(e,t){e.map(({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map(e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}}).forEach(({refUrl:e,elems:t,refcontent:n})=>{t.forEach(t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"})})}function warnBadRefs(e){e.forEach(({ref:e})=>{const t=[...document.querySelectorAll(`a.bibref[href="#bib-${e.toLowerCase()}"]`)].filter(({textContent:t})=>t.toLowerCase()===e.toLowerCase());pub("error",`Bad reference: [\`${e}\`] (appears ${t.length} times)`),console.warn("Bad references: ",t)})}var renderBiblio=Object.freeze({__proto__:null,name:name$q,run:run$f,renderInlineCitation:renderInlineCitation,wireReference:wireReference,stringifyReference:stringifyReference});const name$r="core/inlines",rfc2119Usage={},inlineCodeRegExp=/(?:`[^`]+`)(?!`)/,inlineIdlReference=/(?:{{[^}]+}})/,inlineVariable=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+)?\|\B/,inlineCitation=/(?:\[\[(?:!|\\|\?)?[A-Za-z0-9.-]+\]\])/,inlineExpansion=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,inlineAnchor=/(?:\[=[^=]+=\])/,inlineElement=/(?:\[\^[A-Za-z]+(?:-[A-Za-z]+)?\^\])/;function inlineElementMatches(e){const t=e.slice(2,-2).trim();return hyperHTML$1`<code><a data-xref-type="element">${t}</a></code>`}function inlineRFC2119Matches(e){const t=norm(e),n=hyperHTML$1`<em class="rfc2119" title="${t}">${t}</em>`;return rfc2119Usage[t]=!0,n}function inlineRefMatches(e){const t=e.slice(3,-3).trim();if(!t.startsWith("#"))return hyperHTML$1`<a data-cite="${t}"></a>`;if(document.querySelector(t))return hyperHTML$1`<a href="${t}"></a>`;const n=hyperHTML$1`<span>${e}</span>`;return showInlineError(n,`Wasn't able to expand ${e} as it didn't match any id in the document.`,`Please make sure there is element with id ${t} in the document.`),n}function inlineXrefMatches(e){const t=e.slice(2,-2).trim();return t.startsWith("\\")?e.replace("\\",""):idlStringToHtml(norm(t))}function inlineBibrefMatches(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const{type:o,illegal:i}=refTypeFromContext(r,t.parentNode),a=renderInlineCitation(r),s=r.replace(/^(!|\?)/,"");return i&&!n.normativeReferences.has(s)&&showInlineWarning(a.childNodes[1],"Normative references in informative sections are not allowed. "+`Remove '!' from the start of the reference \`[[${r}]]\``),"informative"!==o||i?n.normativeReferences.add(s):n.informativeReferences.add(s),a.childNodes}function inlineAbbrMatches(e,t,n){return"ABBR"===t.parentElement.tagName?e:hyperHTML$1`<abbr title="${n.get(e)}">${e}</abbr>`}function inlineVariableMatches(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return hyperHTML$1`<var data-type="${r}">${n}</var>`}function inlineAnchorMatches(e){const t=(e=e.slice(2,-2)).split("/",2).map(e=>e.trim()),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],a=processInlineContent(i),s=n?norm(n):null;return hyperHTML$1`<a data-link-for="${s}" data-xref-for="${s}" data-lt="${o}">${a}</a>`}function inlineCodeMatches(e){const t=e.slice(1,-1);return hyperHTML$1`<code>${t}</code>`}function processInlineContent(e){return inlineCodeRegExp.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?inlineCodeMatches(e):processInlineContent(e)):document.createTextNode(e)}function run$g(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new InsensitiveStringSet,e.informativeReferences=new InsensitiveStringSet,e.respecRFC2119||(e.respecRFC2119=rfc2119Usage);const n=document.querySelectorAll("abbr[title]");for(const e of n)t.set(e.textContent,e.title);const r=[...t.keys()],o=r.length?`(?:\\b${r.join("\\b)|(?:\\b")}\\b)`:null,i=getTextNodes(document.body,["#respec-ui",".head","pre"],{wsNodes:!1}),a=new RegExp(["\\bMUST(?:\\s+NOT)?\\b","\\bSHOULD(?:\\s+NOT)?\\b","\\bSHALL(?:\\s+NOT)?\\b","\\bMAY\\b","\\b(?:NOT\\s+)?REQUIRED\\b","\\b(?:NOT\\s+)?RECOMMENDED\\b","\\bOPTIONAL\\b"].join("|")),s=new RegExp(`(${[a.source,inlineIdlReference.source,inlineVariable.source,inlineCitation.source,inlineExpansion.source,inlineAnchor.source,inlineCodeRegExp.source,inlineElement.source,...o?[o]:[]].join("|")})`);for(const n of i){const r=n.data.split(s);if(1===r.length)continue;const o=document.createDocumentFragment();let i=!0;for(const s of r)if(i=!i)if(s.startsWith("{{")){const e=inlineXrefMatches(s);o.append(e)}else if(s.startsWith("[[[")){const e=inlineRefMatches(s);o.append(e)}else if(s.startsWith("[[")){const t=inlineBibrefMatches(s,n,e);o.append(...t)}else if(s.startsWith("|")){const e=inlineVariableMatches(s);o.append(e)}else if(s.startsWith("[=")){const e=inlineAnchorMatches(s);o.append(e)}else if(s.startsWith("`")){const e=inlineCodeMatches(s);o.append(e)}else if(s.startsWith("[^")){const e=inlineElementMatches(s);o.append(e)}else if(t.has(s)){const e=inlineAbbrMatches(s,n,t);o.append(e)}else{if(!a.test(s))throw new Error(`Found token '${s}' but it does not correspond to anything`);{const e=inlineRFC2119Matches(s);o.append(e)}}else o.append(s);n.replaceWith(o)}}var inlines=Object.freeze({__proto__:null,name:name$r,rfc2119Usage:rfc2119Usage,run:run$g});const name$s="w3c/conformance";function processConformance(e,t){const n=[...Object.keys(rfc2119Usage)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=joinAnd(n.sort(),e=>`<em class="rfc2119">${e}</em>`),o=n.length>1,i=hyperHTML$1` + `; +} + +function stringifyReference(ref) { + if (typeof ref === "string") return ref; + let output = `<cite>${ref.title}</cite>`; + + output = ref.href ? `<a href="${ref.href}">${output}</a>. ` : `${output}. `; + + if (ref.authors && ref.authors.length) { + output += ref.authors.join("; "); + if (ref.etAl) output += " et al"; + output += ". "; + } + if (ref.publisher) { + output = `${output} ${endWithDot(ref.publisher)} `; + } + if (ref.date) output += `${ref.date}. `; + if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `; + if (ref.href) output += `URL: <a href="${ref.href}">${ref.href}</a>`; + return output; +} + +/** + * get aliases for a reference "key" + */ +function getAliases(refs) { + return refs.reduce((aliases, ref) => { + const key = ref.refcontent.id; + const keys = !aliases.has(key) + ? aliases.set(key, []).get(key) + : aliases.get(key); + keys.push(ref.ref); + return aliases; + }, new Map()); +} + +/** + * fix biblio reference URLs + * Add title attribute to references + */ +function decorateInlineReference(refs, aliases) { + refs + .map(({ ref, refcontent }) => { + const refUrl = `#bib-${ref.toLowerCase()}`; + const selectors = aliases + .get(refcontent.id) + .map(alias => `a.bibref[href="#bib-${alias.toLowerCase()}"]`) + .join(","); + const elems = document.querySelectorAll(selectors); + return { refUrl, elems, refcontent }; + }) + .forEach(({ refUrl, elems, refcontent }) => { + elems.forEach(a => { + a.setAttribute("href", refUrl); + a.setAttribute("title", refcontent.title); + a.dataset.linkType = "biblio"; + }); + }); +} + +/** + * warn about bad references + */ +function warnBadRefs(badRefs) { + badRefs.forEach(({ ref }) => { + const badrefs = [ + ...document.querySelectorAll( + `a.bibref[href="#bib-${ref.toLowerCase()}"]` + ), + ].filter(({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()); + const msg = `Bad reference: [\`${ref}\`] (appears ${badrefs.length} times)`; + pub("error", msg); + console.warn("Bad references: ", badrefs); + }); +} + +var renderBiblio = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$q, + run: run$f, + renderInlineCitation: renderInlineCitation, + wireReference: wireReference, + stringifyReference: stringifyReference +}); + +// @ts-check + +const name$r = "core/inlines"; +const rfc2119Usage = {}; + +// Inline `code` +// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari +// add support. +const inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code` +const inlineIdlReference = /(?:{{[^}]+}})/; // {{ WebIDLThing }} +const inlineVariable = /\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+)?\|\B/; // |var : Type| +const inlineCitation = /(?:\[\[(?:!|\\|\?)?[A-Za-z0-9.-]+\]\])/; // [[citation]] +const inlineExpansion = /(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/; // [[[expand]]] +const inlineAnchor = /(?:\[=[^=]+=\])/; // Inline [= For/link =] +const inlineElement = /(?:\[\^[A-Za-z]+(?:-[A-Za-z]+)?\^\])/; // Inline [^element^] + +/** + * @param {string} matched + * @return {HTMLElement} + */ +function inlineElementMatches(matched) { + const value = matched.slice(2, -2).trim(); + const html = hyperHTML`<code><a data-xref-type="element">${value}</a></code>`; + return html; +} + +/** + * @param {string} matched + * @return {HTMLElement} + */ +function inlineRFC2119Matches(matched) { + const value = norm(matched); + const nodeElement = hyperHTML`<em class="rfc2119" title="${value}">${value}</em>`; + // remember which ones were used + rfc2119Usage[value] = true; + return nodeElement; +} + +/** + * @param {string} matched + * @return {HTMLElement} + */ +function inlineRefMatches(matched) { + // slices "[[[" at the beginning and "]]]" at the end + const ref = matched.slice(3, -3).trim(); + if (!ref.startsWith("#")) { + return hyperHTML`<a data-cite="${ref}"></a>`; + } + if (document.querySelector(ref)) { + return hyperHTML`<a href="${ref}"></a>`; + } + const badReference = hyperHTML`<span>${matched}</span>`; + showInlineError( + badReference, // cite element + `Wasn't able to expand ${matched} as it didn't match any id in the document.`, + `Please make sure there is element with id ${ref} in the document.` + ); + return badReference; +} + +/** + * @param {string} matched + */ +function inlineXrefMatches(matched) { + // slices "{{" at the beginning and "}}" at the end + const ref = matched.slice(2, -2).trim(); + return ref.startsWith("\\") + ? matched.replace("\\", "") + : idlStringToHtml(norm(ref)); +} + +/** + * @param {string} matched + * @param {Text} txt + * @param {Object} conf + * @return {Iterable<string | Node>} + */ +function inlineBibrefMatches(matched, txt, conf) { + // slices "[[" at the start and "]]" at the end + const ref = matched.slice(2, -2); + if (ref.startsWith("\\")) { + return [`[[${ref.slice(1)}]]`]; + } + const { type, illegal } = refTypeFromContext(ref, txt.parentNode); + const cite = renderInlineCitation(ref); + const cleanRef = ref.replace(/^(!|\?)/, ""); + if (illegal && !conf.normativeReferences.has(cleanRef)) { + showInlineWarning( + /** @type {HTMLElement} */ (cite.childNodes[1]), // cite element + "Normative references in informative sections are not allowed. " + + `Remove '!' from the start of the reference \`[[${ref}]]\`` + ); + } + + if (type === "informative" && !illegal) { + conf.informativeReferences.add(cleanRef); + } else { + conf.normativeReferences.add(cleanRef); + } + return cite.childNodes; +} + +/** + * @param {string} matched + * @param {Text} txt + * @param {Map<string, string>} abbrMap + */ +function inlineAbbrMatches(matched, txt, abbrMap) { + return txt.parentElement.tagName === "ABBR" + ? matched + : hyperHTML`<abbr title="${abbrMap.get(matched)}">${matched}</abbr>`; +} + +/** + * @example |varName: type| => <var data-type="type">varName</var> + * @example |varName| => <var>varName</var> + * @param {string} matched + */ +function inlineVariableMatches(matched) { + // remove "|" at the beginning and at the end, then split at an optional `:` + const matches = matched.slice(1, -1).split(":", 2); + const [varName, type] = matches.map(s => s.trim()); + const element = hyperHTML`<var>${varName}</var>`; + if (type) { + element.dataset.type = type; + } + return element; +} + +/** + * @example [= foo =] => <a>foo</a> + * @example [= bar/foo =] => <a data-link-for="bar" data-xref-for="bar">foo</a> + * @example [= `foo` =] => <a><code>foo</code></a> + * @example [= foo|bar =] => <a data-lt="foo">bar</a> + * @param {string} matched + */ +function inlineAnchorMatches(matched) { + matched = matched.slice(2, -2); // Chop [= =] + const parts = matched.split("/", 2).map(s => s.trim()); + const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]]; + const [linkingText, text] = content.includes("|") + ? content.split("|", 2).map(s => s.trim()) + : [null, content]; + const processedContent = processInlineContent(text); + const forContext = isFor ? norm(isFor) : null; + const anchor = hyperHTML`<a>${processedContent}</a>`; + if (forContext) { + anchor.dataset.linkFor = forContext; + anchor.dataset.xrefFor = forContext; + } + if (linkingText) { + anchor.dataset.lt = linkingText; + } + return anchor; +} + +function inlineCodeMatches(matched) { + const clean = matched.slice(1, -1); // Chop ` and ` + return hyperHTML`<code>${clean}</code>`; +} + +function processInlineContent(text) { + if (inlineCodeRegExp.test(text)) { + // We use a capture group to split, so we can process all the parts. + return text.split(/(`[^`]+`)(?!`)/).map(part => { + return part.startsWith("`") + ? inlineCodeMatches(part) + : processInlineContent(part); + }); + } + return document.createTextNode(text); +} + +function run$g(conf) { + const abbrMap = new Map(); + document.normalize(); + if (!document.querySelector("section#conformance")) { + // make the document informative + document.body.classList.add("informative"); + } + conf.normativeReferences = new InsensitiveStringSet(); + conf.informativeReferences = new InsensitiveStringSet(); + + if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage; + + // PRE-PROCESSING + /** @type {NodeListOf<HTMLElement>} */ + const abbrs = document.querySelectorAll("abbr[title]"); + for (const abbr of abbrs) { + abbrMap.set(abbr.textContent, abbr.title); + } + const aKeys = [...abbrMap.keys()]; + const abbrRx = aKeys.length ? `(?:\\b${aKeys.join("\\b)|(?:\\b")}\\b)` : null; + + // PROCESSING + // Don't gather text nodes for these: + const exclusions = ["#respec-ui", ".head", "pre"]; + const txts = getTextNodes(document.body, exclusions, { + wsNodes: false, // we don't want nodes with just whitespace + }); + const keywords = new RegExp( + [ + "\\bMUST(?:\\s+NOT)?\\b", + "\\bSHOULD(?:\\s+NOT)?\\b", + "\\bSHALL(?:\\s+NOT)?\\b", + "\\bMAY\\b", + "\\b(?:NOT\\s+)?REQUIRED\\b", + "\\b(?:NOT\\s+)?RECOMMENDED\\b", + "\\bOPTIONAL\\b", + ].join("|") + ); + const rx = new RegExp( + `(${[ + keywords.source, + inlineIdlReference.source, + inlineVariable.source, + inlineCitation.source, + inlineExpansion.source, + inlineAnchor.source, + inlineCodeRegExp.source, + inlineElement.source, + ...(abbrRx ? [abbrRx] : []), + ].join("|")})` + ); + for (const txt of txts) { + const subtxt = txt.data.split(rx); + if (subtxt.length === 1) continue; + const df = document.createDocumentFragment(); + let matched = true; + for (const t of subtxt) { + matched = !matched; + if (!matched) { + df.append(t); + } else if (t.startsWith("{{")) { + const node = inlineXrefMatches(t); + df.append(node); + } else if (t.startsWith("[[[")) { + const node = inlineRefMatches(t); + df.append(node); + } else if (t.startsWith("[[")) { + const nodes = inlineBibrefMatches(t, txt, conf); + df.append(...nodes); + } else if (t.startsWith("|")) { + const node = inlineVariableMatches(t); + df.append(node); + } else if (t.startsWith("[=")) { + const node = inlineAnchorMatches(t); + df.append(node); + } else if (t.startsWith("`")) { + const node = inlineCodeMatches(t); + df.append(node); + } else if (t.startsWith("[^")) { + const node = inlineElementMatches(t); + df.append(node); + } else if (abbrMap.has(t)) { + const node = inlineAbbrMatches(t, txt, abbrMap); + df.append(node); + } else if (keywords.test(t)) { + const node = inlineRFC2119Matches(t); + df.append(node); + } else { + // FAIL -- not sure that this can really happen + throw new Error( + `Found token '${t}' but it does not correspond to anything` + ); + } + } + txt.replaceWith(df); + } +} + +var inlines = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$r, + rfc2119Usage: rfc2119Usage, + run: run$g +}); + +// @ts-check +const name$s = "w3c/conformance"; + +/** + * @param {Element} conformance + * @param {*} conf + */ +function processConformance(conformance, conf) { + const terms = Object.keys(rfc2119Usage); + // Add RFC2119 to blibliography + if (terms.length) { + conf.normativeReferences.add("RFC2119"); + conf.normativeReferences.add("RFC8174"); + } + // Put in the 2119 clause and reference + const keywords = joinAnd( + terms.sort(), + item => `<em class="rfc2119">${item}</em>` + ); + const plural = terms.length > 1; + const content = hyperHTML` <h2>Conformance</h2> <p> As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative. </p> - ${n.length?hyperHTML$1` + ${terms.length + ? hyperHTML` <p> - The key word${o?"s":""} ${[r]} in this document - ${o?"are":"is"} to be interpreted as described in + The key word${plural ? "s" : ""} ${raw(keywords)} in this document + ${plural ? "are" : "is"} to be interpreted as described in <a href="https://tools.ietf.org/html/bcp14">BCP 14</a> ${renderInlineCitation("RFC2119")} ${renderInlineCitation("RFC8174")} when, and only when, they appear in all capitals, as shown here. </p> - `:null} - `;e.prepend(...i.childNodes)}function run$h(e){const t=document.querySelector("section#conformance");t&&processConformance(t,e),pub("end",name$s)}var conformance=Object.freeze({__proto__:null,name:name$s,run:run$h});const name$t="core/dfn";function run$i(){document.querySelectorAll("dfn").forEach(e=>{const t=getDfnTitles(e);registerDefinition(e,t),e.dataset.dfnType||(e.dataset.dfnType="dfn"),1===t.length&&t[0]===norm(e.textContent)||(e.dataset.lt=t.join("|"))})}var dfn=Object.freeze({__proto__:null,name:name$t,run:run$i});const name$u="core/pluralize";function run$j(e){if(!e.pluralize)return;const t=getPluralizer();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach(e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|"));const r=new Set(n.map(t).filter(e=>e));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),registerDefinition(e,n)}})}function getPluralizer(){const e=new Set;document.querySelectorAll("a:not([href])").forEach(t=>{const n=norm(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)});const t=new Set;return document.querySelectorAll("dfn:not([data-lt-noDefault])").forEach(e=>{const n=norm(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach(e=>t.add(e))}),function(n){const r=norm(n).toLowerCase(),o=pluralize$1.isSingular(r)?pluralize$1.plural(r):pluralize$1.singular(r);return e.has(o)&&!t.has(o)?o:""}}var pluralize$2=Object.freeze({__proto__:null,name:name$u,run:run$j});const name$v="core/examples",localizationStrings$3={en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"}},lang$b=lang in localizationStrings$3?lang:"en",l10n$5=localizationStrings$3[lang$b],cssPromise=loadStyle$2();async function loadStyle$2(){try{return(await Promise.resolve().then((function(){return examples$2}))).default}catch{return fetchAsset("examples.css")}}function makeTitle(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?hyperHTML$1` - <span class="example-title">: ${n.title}</span> - `:"";return hyperHTML$1` + ` + : null} + `; + conformance.prepend(...content.childNodes); +} + +function run$h(conf) { + const conformance = document.querySelector("section#conformance"); + if (conformance) { + processConformance(conformance, conf); + } + // Added message for legacy compat with Aria specs + // See https://github.com/w3c/respec/issues/793 + pub("end", name$s); +} + +var conformance = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$s, + run: run$h +}); + +// @ts-check + +const name$t = "core/dfn"; + +function run$i() { + document.querySelectorAll("dfn").forEach(dfn => { + const titles = getDfnTitles(dfn); + registerDefinition(dfn, titles); + + // Default to `dfn` as the type... other modules may override + if (!dfn.dataset.dfnType) dfn.dataset.dfnType = "dfn"; + + // Only add `lt`s that are different from the text content + if (titles.length === 1 && titles[0] === norm(dfn.textContent)) { + return; + } + dfn.dataset.lt = titles.join("|"); + }); +} + +var dfn = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$t, + run: run$i +}); + +// @ts-check + +const name$u = "core/pluralize"; + +function run$j(conf) { + if (!conf.pluralize) return; + + const pluralizeDfn = getPluralizer(); + + /** @type {NodeListOf<HTMLElement>} */ + const dfns = document.querySelectorAll( + "dfn:not([data-lt-no-plural]):not([data-lt-noDefault])" + ); + dfns.forEach(dfn => { + const terms = [dfn.textContent]; + if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split("|")); + + const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural)); + + if (plurals.size) { + const userDefinedPlurals = dfn.dataset.plurals + ? dfn.dataset.plurals.split("|") + : []; + const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])]; + dfn.dataset.plurals = uniquePlurals.join("|"); + registerDefinition(dfn, uniquePlurals); + } + }); +} + +function getPluralizer() { + /** @type {Set<string>} */ + const links = new Set(); + /** @type {NodeListOf<HTMLAnchorElement>} */ + const reflessAnchors = document.querySelectorAll("a:not([href])"); + reflessAnchors.forEach(el => { + const normText = norm(el.textContent).toLowerCase(); + links.add(normText); + if (el.dataset.lt) { + links.add(el.dataset.lt); + } + }); + + /** @type {Set<string>} */ + const dfnTexts = new Set(); + /** @type {NodeListOf<HTMLElement>} */ + const dfns = document.querySelectorAll("dfn:not([data-lt-noDefault])"); + dfns.forEach(dfn => { + const normText = norm(dfn.textContent).toLowerCase(); + dfnTexts.add(normText); + if (dfn.dataset.lt) { + dfn.dataset.lt.split("|").forEach(lt => dfnTexts.add(lt)); + } + }); + + // returns pluralized/singularized term if `text` needs pluralization/singularization, "" otherwise + return function pluralizeDfn(/** @type {string} */ text) { + const normText = norm(text).toLowerCase(); + const plural = pluralize$1.isSingular(normText) + ? pluralize$1.plural(normText) + : pluralize$1.singular(normText); + return links.has(plural) && !dfnTexts.has(plural) ? plural : ""; + }; +} + +var pluralize$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$u, + run: run$j +}); + +// @ts-check + +const name$v = "core/examples"; + +const localizationStrings$3 = { + en: { + example: "Example", + }, + nl: { + example: "Voorbeeld", + }, + es: { + example: "Ejemplo", + }, +}; + +const lang$b = lang in localizationStrings$3 ? lang : "en"; + +const l10n$5 = localizationStrings$3[lang$b]; + +const cssPromise = loadStyle$2(); + +async function loadStyle$2() { + try { + return (await Promise.resolve().then(function () { return examples$2; })).default; + } catch { + return fetchAsset("examples.css"); + } +} + +/** + * @typedef {object} Report + * @property {number} number + * @property {boolean} illegal + * @property {string} [title] + * @property {string} [content] + * + * @param {HTMLElement} elem + * @param {number} num + * @param {Report} report + */ +function makeTitle(elem, num, report) { + report.title = elem.title; + if (report.title) elem.removeAttribute("title"); + const number = num > 0 ? ` ${num}` : ""; + const title = report.title + ? hyperHTML` + <span class="example-title">: ${report.title}</span> + ` + : ""; + return hyperHTML` <div class="marker"> - <a class="self-link">${l10n$5.example}<bdi>${r}</bdi></a - >${o} + <a class="self-link">${l10n$5.example}<bdi>${number}</bdi></a + >${title} </div> - `}async function run$k(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;const t=await cssPromise;document.head.insertBefore(hyperHTML$1` + `; +} + +async function run$k() { + /** @type {NodeListOf<HTMLElement>} */ + const examples = document.querySelectorAll( + "pre.example, pre.illegal-example, aside.example" + ); + if (!examples.length) return; + + const css = await cssPromise; + document.head.insertBefore( + hyperHTML` <style> - ${t} + ${css} </style> - `,document.querySelector("link"));let n=0;e.forEach(e=>{const t=e.classList.contains("illegal-example"),r={number:n,illegal:t},{title:o}=e;if("aside"===e.localName){const t=makeTitle(e,++n,r);e.prepend(t),o?addId(e,`example-${n}`,o):addId(e,"example",String(n));const{id:i}=e;t.querySelector("a.self-link").href=`#${i}`,pub("example",r)}else{const t=!!e.closest("aside");t||++n,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const i=e.id?e.id:null;i&&e.removeAttribute("id");const a=makeTitle(e,t?0:n,r),s=hyperHTML$1` - <div class="example" id="${i}"> - ${a} ${e.cloneNode(!0)} + `, + document.querySelector("link") + ); + + let number = 0; + examples.forEach(example => { + const illegal = example.classList.contains("illegal-example"); + /** @type {Report} */ + const report = { + number, + illegal, + }; + const { title } = example; + if (example.localName === "aside") { + ++number; + const div = makeTitle(example, number, report); + example.prepend(div); + if (title) { + addId(example, `example-${number}`, title); // title gets used + } else { + // use the number as the title... so, e.g., "example-5" + addId(example, `example`, String(number)); + } + const { id } = example; + /** @type {HTMLAnchorElement} */ + const selfLink = div.querySelector("a.self-link"); + selfLink.href = `#${id}`; + pub("example", report); + } else { + const inAside = !!example.closest("aside"); + if (!inAside) ++number; + + report.content = example.innerHTML; + + // wrap + example.classList.remove("example", "illegal-example"); + // relocate the id to the div + const id = example.id ? example.id : null; + if (id) example.removeAttribute("id"); + const exampleTitle = makeTitle(example, inAside ? 0 : number, report); + const div = hyperHTML` + <div class="example" id="${id}"> + ${exampleTitle} ${example.cloneNode(true)} </div> - `;o&&addId(s,`example-${n}`,o),addId(s,"example",String(n)),s.querySelector("a.self-link").href=`#${s.id}`,e.replaceWith(s),t||pub("example",r)}})}var examples=Object.freeze({__proto__:null,name:name$v,run:run$k});const name$w="core/issues-notes",localizationStrings$4={en:{issue_summary:"Issue Summary",no_issues_in_spec:"There are no issues listed in this specification."},nl:{issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie."},es:{issue_summary:"Resumen de la cuestión",no_issues_in_spec:"No hay problemas enumerados en esta especificación."}},cssPromise$1=loadStyle$3();async function loadStyle$3(){try{return(await Promise.resolve().then((function(){return issuesNotes$2}))).default}catch{return fetchAsset("issues-notes.css")}}const lang$c=lang in localizationStrings$4?lang:"en",l10n$6=localizationStrings$4[lang$c];function handleIssues(e,t,n){const r=!!document.querySelector(".issue[data-number]");let o=0;const i=document.createElement("ul");e.forEach(e=>{const{type:a,displayType:s,isFeatureAtRisk:c}=getIssueType(e,n),l="issue"===a,u="span"===e.localName,{number:d}=e.dataset,p={type:a,inline:u,title:e.title};if(!l||u||r?d&&(p.number=Number(d)):(o++,p.number=o),!u){const u=hyperHTML$1`<div class="${c?`${a} atrisk`:a}" role="${"note"===a?"note":null}"></div>`,h=document.createElement("span"),f=hyperHTML$1` - <div role='heading' class='${`${a}-title marker`}'>${h}</div>`;addId(f,"h",a);let m,g=s;if(e.id?(u.id=e.id,e.removeAttribute("id")):addId(u,"issue-container",p.number?`number-${p.number}`:""),l){if(r){if(d){g+=` ${d}`;const e=linkToIssueTracker(d,n,{isFeatureAtRisk:c});e&&(h.before(e),e.append(h)),h.classList.add("issue-number"),(m=t.get(d))||pub("warning",`Failed to fetch issue number ${d}`),m&&!p.title&&(p.title=m.title)}}else g+=` ${o}`;void 0!==p.number&&i.append(createIssueSummaryEntry(n.l10n.issue,p,u.id))}if(h.textContent=g,p.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},r=m?m.labels:[];m&&"CLOSED"===m.state&&u.classList.add("closed"),f.append(createLabelsGroup(r,p.title,t))}let b=e;e.replaceWith(u),b.classList.remove(a),b.removeAttribute("data-number"),m&&!b.innerHTML.trim()&&(b=document.createRange().createContextualFragment(m.bodyHTML)),u.append(f,b);const y=parents(f,"section").length+2;f.setAttribute("aria-level",y)}pub(p.type,p)}),makeIssueSectionSummary(i)}function getIssueType(e,t){const n=e.classList.contains("issue"),r=e.classList.contains("warning"),o=e.classList.contains("ednote"),i=e.classList.contains("atrisk");return{type:n?"issue":r?"warning":o?"ednote":"note",displayType:n?i?t.l10n.feature_at_risk:t.l10n.issue:r?t.l10n.warning:o?t.l10n.editors_note:t.l10n.note,isFeatureAtRisk:i}}function linkToIssueTracker(e,t,{isFeatureAtRisk:n=!1}={}){return!n&&t.issueBase?hyperHTML$1`<a href='${t.issueBase+e}'/>`:n&&t.atRiskBase?hyperHTML$1`<a href='${t.atRiskBase+e}'/>`:void 0}function createIssueSummaryEntry(e,t,n){const r=`${e} ${t.number}`,o=t.title?hyperHTML$1`<span style="text-transform: none">: ${t.title}</span>`:"";return hyperHTML$1` - <li><a href="${`#${n}`}">${r}</a>${o}</li> - `}function makeIssueSectionSummary(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(hyperHTML$1`<p>${l10n$6.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h2>${l10n$6.issue_summary}</h2>`)}function isLight(e){return.2126*(e>>16&255)+.7152*(e>>8&255)+.0722*(e>>0&255)>140}function createLabelsGroup(e,t,n){const r=e.map(e=>createLabel(e,n)),o=e.map(e=>e.name),i=joinAnd(o);if(r.length&&r.unshift(document.createTextNode(" ")),o.length){return hyperHTML$1`<span + `; + if (title) { + addId(div, `example-${number}`, title); + } + addId(div, `example`, String(number)); + /** @type {HTMLAnchorElement} */ + const selfLink = div.querySelector("a.self-link"); + selfLink.href = `#${div.id}`; + example.replaceWith(div); + if (!inAside) pub("example", report); + } + }); +} + +var examples = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$v, + run: run$k +}); + +// @ts-check + +const name$w = "core/issues-notes"; + +const localizationStrings$4 = { + en: { + issue_summary: "Issue Summary", + no_issues_in_spec: "There are no issues listed in this specification.", + }, + nl: { + issue_summary: "Lijst met issues", + no_issues_in_spec: "Er zijn geen problemen vermeld in deze specificatie.", + }, + es: { + issue_summary: "Resumen de la cuestión", + no_issues_in_spec: "No hay problemas enumerados en esta especificación.", + }, +}; + +const cssPromise$1 = loadStyle$3(); + +async function loadStyle$3() { + try { + return (await Promise.resolve().then(function () { return issuesNotes$2; })).default; + } catch { + return fetchAsset("issues-notes.css"); + } +} + +const lang$c = lang in localizationStrings$4 ? lang : "en"; + +const l10n$6 = localizationStrings$4[lang$c]; + +/** + * @typedef {object} Report + * @property {string} type + * @property {boolean} inline + * @property {number} number + * @property {string} title + + * @typedef {object} GitHubLabel + * @property {string} color + * @property {string} name + * + * @typedef {object} GitHubIssue + * @property {string} title + * @property {string} state + * @property {string} bodyHTML + * @property {GitHubLabel[]} labels + + * @param {NodeListOf<HTMLElement>} ins + * @param {Map<string, GitHubIssue>} ghIssues + * @param {*} conf + */ +function handleIssues(ins, ghIssues, conf) { + const hasDataNum = !!document.querySelector(".issue[data-number]"); + let issueNum = 0; + const issueList = document.createElement("ul"); + ins.forEach(inno => { + const { type, displayType, isFeatureAtRisk } = getIssueType(inno, conf); + const isIssue = type === "issue"; + const isInline = inno.localName === "span"; + const { number: dataNum } = inno.dataset; + /** @type {Partial<Report>} */ + const report = { + type, + inline: isInline, + title: inno.title, + }; + if (isIssue && !isInline && !hasDataNum) { + issueNum++; + report.number = issueNum; + } else if (dataNum) { + report.number = Number(dataNum); + } + // wrap + if (!isInline) { + const cssClass = isFeatureAtRisk ? `${type} atrisk` : type; + const div = hyperHTML`<div class="${cssClass}"></div>`; + if (type === "note") { + div.setAttribute("role", "note"); + } + const title = document.createElement("span"); + const titleParent = hyperHTML` + <div role='heading' class='${`${type}-title marker`}'>${title}</div>`; + addId(titleParent, "h", type); + let text = displayType; + if (inno.id) { + div.id = inno.id; + inno.removeAttribute("id"); + } else { + addId( + div, + "issue-container", + report.number ? `number-${report.number}` : "" + ); + } + /** @type {GitHubIssue} */ + let ghIssue; + if (isIssue) { + if (!hasDataNum) { + text += ` ${issueNum}`; + } else if (dataNum) { + text += ` ${dataNum}`; + const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk }); + if (link) { + title.before(link); + link.append(title); + } + title.classList.add("issue-number"); + ghIssue = ghIssues.get(dataNum); + if (!ghIssue) { + pub("warning", `Failed to fetch issue number ${dataNum}`); + } + if (ghIssue && !report.title) { + report.title = ghIssue.title; + } + } + if (report.number !== undefined) { + // Add entry to #issue-summary. + issueList.append( + createIssueSummaryEntry(conf.l10n.issue, report, div.id) + ); + } + } + title.textContent = text; + if (report.title) { + inno.removeAttribute("title"); + const { repoURL = "" } = conf.github || {}; + const labels = ghIssue ? ghIssue.labels : []; + if (ghIssue && ghIssue.state === "CLOSED") { + div.classList.add("closed"); + } + titleParent.append(createLabelsGroup(labels, report.title, repoURL)); + } + /** @type {HTMLElement | DocumentFragment} */ + let body = inno; + inno.replaceWith(div); + body.classList.remove(type); + body.removeAttribute("data-number"); + if (ghIssue && !body.innerHTML.trim()) { + body = document + .createRange() + .createContextualFragment(ghIssue.bodyHTML); + } + div.append(titleParent, body); + const level = parents(titleParent, "section").length + 2; + titleParent.setAttribute("aria-level", String(level)); + } + pub(report.type, report); + }); + makeIssueSectionSummary(issueList); +} + +/** + * @typedef {object} IssueType + * @property {string} type + * @property {string} displayType + * @property {boolean} isFeatureAtRisk + * + * @param {HTMLElement} inno + * @return {IssueType} + */ +function getIssueType(inno, conf) { + const isIssue = inno.classList.contains("issue"); + const isWarning = inno.classList.contains("warning"); + const isEdNote = inno.classList.contains("ednote"); + const isFeatureAtRisk = inno.classList.contains("atrisk"); + const type = isIssue + ? "issue" + : isWarning + ? "warning" + : isEdNote + ? "ednote" + : "note"; + const displayType = isIssue + ? isFeatureAtRisk + ? conf.l10n.feature_at_risk + : conf.l10n.issue + : isWarning + ? conf.l10n.warning + : isEdNote + ? conf.l10n.editors_note + : conf.l10n.note; + return { type, displayType, isFeatureAtRisk }; +} + +/** + * @param {string} dataNum + * @param {*} conf + */ +function linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) { + // Set issueBase to cause issue to be linked to the external issue tracker + if (!isFeatureAtRisk && conf.issueBase) { + return hyperHTML`<a href='${conf.issueBase + dataNum}'/>`; + } else if (isFeatureAtRisk && conf.atRiskBase) { + return hyperHTML`<a href='${conf.atRiskBase + dataNum}'/>`; + } +} + +/** + * @param {string} l10nIssue + * @param {Partial<Report>} report + */ +function createIssueSummaryEntry(l10nIssue, report, id) { + const issueNumberText = `${l10nIssue} ${report.number}`; + const title = report.title + ? hyperHTML`<span style="text-transform: none">: ${report.title}</span>` + : ""; + return hyperHTML` + <li><a href="${`#${id}`}">${issueNumberText}</a>${title}</li> + `; +} + +/** + * + * @param {HTMLUListElement} issueList + */ +function makeIssueSectionSummary(issueList) { + const issueSummaryElement = document.getElementById("issue-summary"); + if (!issueSummaryElement) return; + const heading = issueSummaryElement.querySelector("h2, h3, h4, h5, h6"); + + issueList.hasChildNodes() + ? issueSummaryElement.append(issueList) + : issueSummaryElement.append(hyperHTML`<p>${l10n$6.no_issues_in_spec}</p>`); + if ( + !heading || + (heading && heading !== issueSummaryElement.firstElementChild) + ) { + issueSummaryElement.insertAdjacentHTML( + "afterbegin", + `<h2>${l10n$6.issue_summary}</h2>` + ); + } +} + +function isLight(rgb) { + const red = (rgb >> 16) & 0xff; + const green = (rgb >> 8) & 0xff; + const blue = (rgb >> 0) & 0xff; + const illumination = 0.2126 * red + 0.7152 * green + 0.0722 * blue; + return illumination > 140; +} + +/** + * @param {GitHubLabel[]} labels + * @param {string} title + * @param {string} repoURL + */ +function createLabelsGroup(labels, title, repoURL) { + /** @type {Node[]} */ + const labelsGroup = labels.map(label => createLabel(label, repoURL)); + const labelNames = labels.map(label => label.name); + const joinedNames = joinAnd(labelNames); + if (labelsGroup.length) { + labelsGroup.unshift(document.createTextNode(" ")); + } + if (labelNames.length) { + const ariaLabel = `This issue is labelled as ${joinedNames}.`; + return hyperHTML`<span class="issue-label" - aria-label="${`This issue is labelled as ${i}.`}">: ${t}${r}</span>`}return hyperHTML$1`<span class="issue-label">: ${t}${r}</span>`}function createLabel(e,t){const{color:n,name:r}=e,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const i=parseInt(n,16),a=isNaN(i)||isLight(i)?"light":"dark";return hyperHTML$1`<a - class="${`respec-gh-label respec-label-${a}`}" - style="${`background-color: #${n}`}" - href="${o.href}">${r}</a>`}async function fetchAndStoreGithubIssues(e){if(!e)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map(e=>Number.parseInt(e.dataset.number,10)).filter(e=>e);if(!t.length)return new Map;const n=new URL("issues",e);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok){return pub("error",`Error fetching issues from GitHub. (HTTP Status ${r.status}).`),new Map}const o=await r.json();return new Map(Object.entries(o))}async function run$l(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote");if(!t.length)return;const n=await fetchAndStoreGithubIssues(e.githubAPI),r=await cssPromise$1,{head:o}=document;o.insertBefore(hyperHTML$1`<style>${[r]}</style>`,o.querySelector("link")),handleIssues(t,n,e),document.querySelectorAll(".ednote").forEach(e=>{e.classList.remove("ednote"),e.classList.add("note")})}var issuesNotes=Object.freeze({__proto__:null,name:name$w,run:run$l});const name$x="core/requirements";function run$m(){document.querySelectorAll(".req").forEach((e,t)=>{const n=`#${e.getAttribute("id")}`,r=hyperHTML$1`<a href="${n}">Req. ${t+1}</a>`;e.prepend(r,": ")}),document.querySelectorAll("a.reqRef[href]").forEach(e=>{const t=e.getAttribute("href").substring(1),n=document.getElementById(t);let r;if(n)r=n.querySelector("a:first-child").textContent;else{r=`Req. not found '${t}'`;const n=`Requirement not found in element \`a.reqRef\`: ${t}`;pub("error",n),console.warn(n,e)}e.textContent=r})}var requirements=Object.freeze({__proto__:null,name:name$x,run:run$m});const name$y="core/best-practices",localizationStrings$5={en:{best_practice:"Best Practice "}},lang$d=lang in localizationStrings$5?lang:"en";function run$n(){const e=document.querySelectorAll(".practicelab"),t=localizationStrings$5[lang$d],n=document.getElementById("bp-summary"),r=n?document.createElement("ul"):null;[...e].forEach((e,n)=>{const o=addId(e,"bp"),i=hyperHTML$1` - <a class="marker self-link" href="${`#${o}`}"><bdi lang="${lang$d}">${t.best_practice}${n+1}</bdi></a>`;if(r){const t=hyperHTML$1` + aria-label="${ariaLabel}">: ${title}${labelsGroup}</span>`; + } + return hyperHTML`<span class="issue-label">: ${title}${labelsGroup}</span>`; +} + +/** + * @param {GitHubLabel} label + * @param {string} repoURL + */ +function createLabel(label, repoURL) { + const { color, name } = label; + const issuesURL = new URL("./issues/", repoURL); + issuesURL.searchParams.set("q", `is:issue is:open label:"${label.name}"`); + const rgb = parseInt(color, 16); + const textColorClass = isNaN(rgb) || isLight(rgb) ? "light" : "dark"; + const cssClasses = `respec-gh-label respec-label-${textColorClass}`; + const style = `background-color: #${color}`; + return hyperHTML`<a + class="${cssClasses}" + style="${style}" + href="${issuesURL.href}">${name}</a>`; +} + +/** + * @returns {Promise<Map<string, GitHubIssue>>} + */ +async function fetchAndStoreGithubIssues(github) { + if (!github || !github.apiBase) { + return new Map(); + } + + /** @type {NodeListOf<HTMLElement>} */ + const specIssues = document.querySelectorAll(".issue[data-number]"); + const issueNumbers = [...specIssues] + .map(elem => Number.parseInt(elem.dataset.number, 10)) + .filter(issueNumber => issueNumber); + + if (!issueNumbers.length) { + return new Map(); + } + + const url = new URL("issues", `${github.apiBase}/${github.fullName}/`); + url.searchParams.set("issues", issueNumbers.join(",")); + + const response = await fetch(url.href); + if (!response.ok) { + const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`; + pub("error", msg); + return new Map(); + } + + /** @type {{ [issueNumber: string]: GitHubIssue }} */ + const issues = await response.json(); + return new Map(Object.entries(issues)); +} + +async function run$l(conf) { + const query = ".issue, .note, .warning, .ednote"; + /** @type {NodeListOf<HTMLElement>} */ + const issuesAndNotes = document.querySelectorAll(query); + if (!issuesAndNotes.length) { + return; // nothing to do. + } + const ghIssues = await fetchAndStoreGithubIssues(conf.github); + const css = await cssPromise$1; + const { head: headElem } = document; + headElem.insertBefore( + hyperHTML`<style>${raw(css)}</style>`, + headElem.querySelector("link") + ); + handleIssues(issuesAndNotes, ghIssues, conf); + const ednotes = document.querySelectorAll(".ednote"); + ednotes.forEach(ednote => { + ednote.classList.remove("ednote"); + ednote.classList.add("note"); + }); +} + +var issuesNotes = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$w, + run: run$l +}); + +// @ts-check + +const name$x = "core/requirements"; + +function run$m() { + document.querySelectorAll(".req").forEach((req, i) => { + const frag = `#${req.getAttribute("id")}`; + const el = hyperHTML`<a href="${frag}">Req. ${i + 1}</a>`; + req.prepend(el, ": "); + }); + + document.querySelectorAll("a.reqRef[href]").forEach(ref => { + const href = ref.getAttribute("href"); + const id = href.substring(1); // href looks like `#id` + const req = document.getElementById(id); + let txt; + if (req) { + txt = req.querySelector("a:first-child").textContent; + } else { + txt = `Req. not found '${id}'`; + const msg = `Requirement not found in element \`a.reqRef\`: ${id}`; + pub("error", msg); + console.warn(msg, ref); + } + ref.textContent = txt; + }); +} + +var requirements = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$x, + run: run$m +}); + +// @ts-check + +const name$y = "core/best-practices"; + +const localizationStrings$5 = { + en: { + best_practice: "Best Practice ", + }, +}; +const lang$d = lang in localizationStrings$5 ? lang : "en"; + +function run$n() { + /** @type {NodeListOf<HTMLElement>} */ + const bps = document.querySelectorAll(".practicelab"); + const l10n = localizationStrings$5[lang$d]; + const bpSummary = document.getElementById("bp-summary"); + const summaryItems = bpSummary ? document.createElement("ul") : null; + [...bps].forEach((bp, num) => { + const id = addId(bp, "bp"); + const localizedBpName = hyperHTML` + <a class="marker self-link" href="${`#${id}`}"><bdi lang="${lang$d}">${ + l10n.best_practice + }${num + 1}</bdi></a>`; + + // Make the summary items, if we have a summary + if (summaryItems) { + const li = hyperHTML` <li> - ${i}: ${makeSafeCopy(e)} + ${localizedBpName}: ${makeSafeCopy(bp)} </li> - `;r.appendChild(t)}const a=e.closest("div");if(!a)return void e.classList.add("advisement");a.classList.add("advisement");const s=hyperHTML$1`${i.cloneNode(!0)}: ${e}`;a.prepend(...s.childNodes)}),e.length?n&&(n.appendChild(hyperHTML$1`<h2>Best Practices Summary</h2>`),n.appendChild(r)):n&&(pub("warn","Using best practices summary (#bp-summary) but no best practices found."),n.remove())}var bestPractices=Object.freeze({__proto__:null,name:name$y,run:run$n});const name$z="core/figures",localizationStrings$6={en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"圖 ",list_of_figures:"List of Figures"}},lang$e=lang in localizationStrings$6?lang:"en",l10n$7=localizationStrings$6[lang$e];function run$o(){normalizeImages(document);const e=collectFigures(),t=document.getElementById("tof");e.length&&t&&(decorateTableOfFigures(t),t.append(hyperHTML$1`<h2>${l10n$7.list_of_figures}</h2>`,hyperHTML$1`<ul class='tof'>${e}</ul>`))}function collectFigures(){const e=[];return document.querySelectorAll("figure").forEach((t,n)=>{const r=t.querySelector("figcaption");r?(decorateFigure(t,r,n),e.push(getTableOfFiguresListItem(t.id,r))):showInlineWarning(t,"Found a `<figure>` without a `<figcaption>`")}),e}function decorateFigure(e,t,n){addId(e,"fig",t.textContent),wrapInner(t,hyperHTML$1`<span class='fig-title'>`),t.prepend(l10n$7.fig,hyperHTML$1`<bdi class='figno'>${n+1}</bdi>`," ")}function getTableOfFiguresListItem(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach(e=>{renameElement(e,"span").removeAttribute("href")}),hyperHTML$1`<li class='tofline'> - <a class='tocxref' href='${`#${e}`}'>${n.childNodes}</a> - </li>`}function normalizeImages(e){e.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach(e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)})}function decorateTableOfFigures(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=getPreviousSections(e);t.every(e=>e.classList.contains("introductory"))?e.classList.add("introductory"):t.some(e=>e.classList.contains("appendix"))&&e.classList.add("appendix")}function getPreviousSections(e){const t=[];for(const n of iteratePreviousElements(e))"section"===n.localName&&t.push(n);return t}function*iteratePreviousElements(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}var figures=Object.freeze({__proto__:null,name:name$z,run:run$o});const topLevelEntities=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function findDfn(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return findOperationDfn(e,n,t);default:return findNormalDfn(e,n,t)}}function getAlternativeNames(e,t,n){const r=`${t}.${n}`;switch(e){case"constructor":case"operation":return[`${r}()`,r,`${n}()`,n];case"attribute":return[r,n]}}function findOperationDfn(e,t,n){if(n.includes("!overload"))return findNormalDfn(e,t,n);return findNormalDfn(e,t,`${n}()`,n)}function addAlternativeNames(e,t){const n=e.dataset.lt?e.dataset.lt.split("|"):[];n.push(...t),e.dataset.lt=[...new Set(n)].join("|"),registerDefinition(e,t)}function findNormalDfn(e,t,...n){for(const r of n){let n="enum-value"===e.type&&""===r?"the-empty-string":r.toLowerCase(),o=definitionMap[n],i=getDfns(o,t,r,e.type);if(0===i.length&&""!==t?void 0!==(o=definitionMap[(n=`${t}.${n}`).toLowerCase()])&&1===o.length&&(i=o,delete definitionMap[n],registerDefinition(i[0],[n])):n=r,i.length>1){showInlineError(i,`WebIDL identifier \`${r}\` ${t?`for \`${t}\``:""} is defined multiple times`,"Duplicate definition.")}if(i.length)return r!==n&&(i[0].dataset.lt=n),i[0]}}function decorateDfn(e,t,n,r){if(!e.id){const t=n.toLowerCase(),o=t?`${t}-`:"";let i=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===i&&(i="the-empty-string"),e.id=`dom-${o}${i}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=getDataType(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||wrapInner(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":addAlternativeNames(e,getAlternativeNames(t.type,n,r))}return e}function getDfns(e,t,n,r){if(!e)return[];const o=e.filter(e=>{const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t});if(0===o.length&&""===t&&1===e.length)return e[0].textContent===n?e:[];if(topLevelEntities.has(r)&&e.length){const t=e.find(e=>e.textContent.trim()===n);if(t)return[t]}return o}function getDataType(e){const{idlType:t,generic:n,union:r}=e;return"string"==typeof t?t:n||(r?t.map(getDataType).join("|"):getDataType(t))}const name$A="core/webidl",operationNames={},idlPartials={},templates$1={wrap:e=>e.reduce(flatten,[]).filter(e=>""!==e).map(e=>"string"==typeof e?new Text(e):e),trivia:e=>e.trim()?hyperHTML$1`<span class='idlSectionComment'>${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?hyperHTML$1`<a data-xref-type="interface" data-cite="WebIDL">${e}</a>`:hyperHTML$1`<a data-xref-type="dfn" data-cite="WebIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type&&"Exposed"!==n.name)return e;let r,o="_IDL_",i=null;switch(t){case"Window":o="interface",i="HTML";break;case"object":o="interface",i="WebIDL";break;default:t.includes("Worker")&&"extended-attribute"===n.type&&(r=`${t}GlobalScope`,o="interface",i=["Worker","DedicatedWorker","SharedWorker"].includes(t)?"HTML":null)}return hyperHTML$1`<a - data-xref-type="${o}" data-cite="${i}" data-lt="${r}">${e}</a>`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return hyperHTML$1`<span class="idlParamName">${e}</span>`;const r=defineIdlName(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"constructor":return defineIdlName(e,t,n);default:return e}},type:e=>hyperHTML$1`<span class="idlType">${e}</span>`,inheritance:e=>hyperHTML$1`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=getIdlDefinitionClassName(t);switch(t.type){case"includes":case"enum-value":return hyperHTML$1`<span class='${r}'>${e}</span>`}const o=n?n.name:"",{name:i,idlId:a}=getNameAndId(t,o);return hyperHTML$1`<span class='${r}' id='${a}' data-idl data-title='${i}'>${e}</span>`},extendedAttribute:e=>hyperHTML$1`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>hyperHTML$1`<a data-xref-type="extended-attribute">${e}</a>`};function defineIdlName(e,t,n){const r=n?n.name:"",{name:o}=getNameAndId(t,r),i=findDfn(t,o,{parent:r}),a=getDfnType(t.type);if(i){t.partial||(i.dataset.export="",i.dataset.dfnType=a),decorateDfn(i,t,r,o);const n=`#${i.id}`;return hyperHTML$1`<a - data-link-for="${r}" - data-link-type="${a}" - href="${n}" + `; + summaryItems.appendChild(li); + } + + const container = bp.closest("div"); + if (!container) { + // This is just an inline best practice... + bp.classList.add("advisement"); + return; + } + + // Make the advisement box + container.classList.add("advisement"); + const title = hyperHTML`${localizedBpName.cloneNode(true)}: ${bp}`; + container.prepend(...title.childNodes); + }); + if (bps.length) { + if (bpSummary) { + bpSummary.appendChild(hyperHTML`<h2>Best Practices Summary</h2>`); + bpSummary.appendChild(summaryItems); + } + } else if (bpSummary) { + pub( + "warn", + "Using best practices summary (#bp-summary) but no best practices found." + ); + bpSummary.remove(); + } +} + +var bestPractices = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$y, + run: run$n +}); + +// @ts-check + +const name$z = "core/figures"; + +const localizationStrings$6 = { + en: { + list_of_figures: "List of Figures", + fig: "Figure ", + }, + ja: { + fig: "図", + list_of_figures: "図のリスト", + }, + ko: { + fig: "그림 ", + list_of_figures: "그림 목록", + }, + nl: { + fig: "Figuur ", + list_of_figures: "Lijst met figuren", + }, + es: { + fig: "Figura ", + list_of_figures: "Lista de Figuras", + }, + zh: { + fig: "圖 ", + list_of_figures: "List of Figures", + }, +}; + +const lang$e = lang in localizationStrings$6 ? lang : "en"; + +const l10n$7 = localizationStrings$6[lang$e]; + +function run$o() { + normalizeImages(document); + + const tof = collectFigures(); + + // Create a Table of Figures if a section with id 'tof' exists. + const tofElement = document.getElementById("tof"); + if (tof.length && tofElement) { + decorateTableOfFigures(tofElement); + tofElement.append( + hyperHTML`<h2>${l10n$7.list_of_figures}</h2>`, + hyperHTML`<ul class='tof'>${tof}</ul>` + ); + } +} + +/** + * process all figures + */ +function collectFigures() { + /** @type {HTMLElement[]} */ + const tof = []; + document.querySelectorAll("figure").forEach((fig, i) => { + const caption = fig.querySelector("figcaption"); + + if (caption) { + decorateFigure(fig, caption, i); + tof.push(getTableOfFiguresListItem(fig.id, caption)); + } else { + showInlineWarning(fig, "Found a `<figure>` without a `<figcaption>`"); + } + }); + return tof; +} + +/** + * @param {HTMLElement} figure + * @param {HTMLElement} caption + * @param {number} i + */ +function decorateFigure(figure, caption, i) { + const title = caption.textContent; + addId(figure, "fig", title); + // set proper caption title + wrapInner(caption, hyperHTML`<span class='fig-title'>`); + caption.prepend(l10n$7.fig, hyperHTML`<bdi class='figno'>${i + 1}</bdi>`, " "); +} + +/** + * @param {string} figureId + * @param {HTMLElement} caption + * @return {HTMLElement} + */ +function getTableOfFiguresListItem(figureId, caption) { + const tofCaption = caption.cloneNode(true); + tofCaption.querySelectorAll("a").forEach(anchor => { + renameElement(anchor, "span").removeAttribute("href"); + }); + return hyperHTML`<li class='tofline'> + <a class='tocxref' href='${`#${figureId}`}'>${[ + ...tofCaption.childNodes, + ]}</a> + </li>`; +} + +function normalizeImages(doc) { + doc + .querySelectorAll( + ":not(picture)>img:not([width]):not([height]):not([srcset])" + ) + .forEach(img => { + if (img.naturalHeight === 0 || img.naturalWidth === 0) return; + img.height = img.naturalHeight; + img.width = img.naturalWidth; + }); +} + +/** + * if it has a parent section, don't touch it + * if it has a class of appendix or introductory, don't touch it + * if all the preceding section siblings are introductory, make it introductory + * if there is a preceding section sibling which is an appendix, make it appendix + * @param {Element} tofElement + */ +function decorateTableOfFigures(tofElement) { + if ( + tofElement.classList.contains("appendix") || + tofElement.classList.contains("introductory") || + tofElement.closest("section") + ) { + return; + } + + const previousSections = getPreviousSections(tofElement); + if (previousSections.every(sec => sec.classList.contains("introductory"))) { + tofElement.classList.add("introductory"); + } else if (previousSections.some(sec => sec.classList.contains("appendix"))) { + tofElement.classList.add("appendix"); + } +} + +/** + * @param {Element} element + */ +function getPreviousSections(element) { + /** @type {Element[]} */ + const sections = []; + for (const previous of iteratePreviousElements(element)) { + if (previous.localName === "section") { + sections.push(previous); + } + } + return sections; +} + +/** + * @param {Element} element + */ +function* iteratePreviousElements(element) { + let previous = element; + while (previous.previousElementSibling) { + previous = previous.previousElementSibling; + yield previous; + } +} + +var figures = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$z, + run: run$o +}); + +// @ts-check + +const topLevelEntities = new Set([ + "callback interface", + "callback", + "dictionary", + "enum", + "interface mixin", + "interface", + "typedef", +]); + +/** + * This function looks for a <dfn> element whose title is 'name' and + * that is "for" 'parent', which is the empty string when 'name' + * refers to a top-level entity. For top-level entities, <dfn> + * elements that inherit a non-empty [dfn-for] attribute are also + * counted as matching. + * + * When a matching <dfn> is found, it's given <code> formatting, + * marked as an IDL definition, and returned. If no <dfn> is found, + * the function returns 'undefined'. + * @param {*} defn + * @param {string} name + */ +function findDfn(defn, name, { parent = "" } = {}) { + switch (defn.type) { + case "constructor": + case "operation": + return findOperationDfn(defn, parent, name); + default: + return findNormalDfn(defn, parent, name); + } +} + +/** + * @param {string} type + * @param {string} parent + * @param {string} name + */ +function getAlternativeNames(type, parent, name) { + const asQualifiedName = `${parent}.${name}`; + switch (type) { + case "constructor": + case "operation": { + // Allow linking to both "method()" and "method" name. + const asMethodName = `${name}()`; + const asFullyQualifiedName = `${asQualifiedName}()`; + return [asFullyQualifiedName, asQualifiedName, asMethodName, name]; + } + case "attribute": + return [asQualifiedName, name]; + } +} + +/** + * @param {*} defn + * @param {string} parent + * @param {string} name + */ +function findOperationDfn(defn, parent, name) { + // Overloads all have unique names + if (name.includes("!overload")) { + return findNormalDfn(defn, parent, name); + } + const asMethodName = `${name}()`; + return findNormalDfn(defn, parent, asMethodName, name); +} + +/** + * @param {HTMLElement} dfn + * @param {string[]} names + */ +function addAlternativeNames(dfn, names) { + const lt = dfn.dataset.lt ? dfn.dataset.lt.split("|") : []; + lt.push(...names); + dfn.dataset.lt = [...new Set(lt)].join("|"); + registerDefinition(dfn, names); +} + +/** + * @param {*} defn + * @param {string} parent + * @param {...string} names + */ +function findNormalDfn(defn, parent, ...names) { + for (const name of names) { + let resolvedName = + defn.type === "enum-value" && name === "" + ? "the-empty-string" + : name.toLowerCase(); + let dfnForArray = definitionMap[resolvedName]; + let dfns = getDfns(dfnForArray, parent, name, defn.type); + // If we haven't found any definitions with explicit [for] + // and [title], look for a dotted definition, "parent.name". + if (dfns.length === 0 && parent !== "") { + resolvedName = `${parent}.${resolvedName}`; + dfnForArray = definitionMap[resolvedName.toLowerCase()]; + if (dfnForArray !== undefined && dfnForArray.length === 1) { + dfns = dfnForArray; + // Found it: register with its local name + delete definitionMap[resolvedName]; + registerDefinition(dfns[0], [resolvedName]); + } + } else { + resolvedName = name; + } + if (dfns.length > 1) { + const msg = `WebIDL identifier \`${name}\` ${ + parent ? `for \`${parent}\`` : "" + } is defined multiple times`; + showInlineError(dfns, msg, "Duplicate definition."); + } + if (dfns.length) { + if (name !== resolvedName) { + dfns[0].dataset.lt = resolvedName; + } + return dfns[0]; + } + } +} + +/** + * @param {HTMLElement} dfn + * @param {*} defn + * @param {string} parent + * @param {string} name + */ +function decorateDfn(dfn, defn, parent, name) { + if (!dfn.id) { + const lCaseParent = parent.toLowerCase(); + const middle = lCaseParent ? `${lCaseParent}-` : ""; + let last = name + .toLowerCase() + .replace(/[()]/g, "") + .replace(/\s/g, "-"); + if (last === "") last = "the-empty-string"; + dfn.id = `dom-${middle}${last}`; + } + dfn.dataset.idl = defn.type; + dfn.dataset.title = dfn.textContent; + dfn.dataset.dfnFor = parent; + // Derive the data-type for dictionary members, interface attributes, + // and methods + switch (defn.type) { + case "operation": + case "attribute": + case "field": + dfn.dataset.type = getDataType(defn); + break; + } + + // Mark the definition as code. + if (!dfn.querySelector("code") && !dfn.closest("code") && dfn.children) { + wrapInner(dfn, dfn.ownerDocument.createElement("code")); + } + + // Add data-lt values and register them + switch (defn.type) { + case "attribute": + case "constructor": + case "operation": + addAlternativeNames(dfn, getAlternativeNames(defn.type, parent, name)); + break; + } + + return dfn; +} + +/** + * @param {HTMLElement[]} dfnForArray + * @param {string} parent data-dfn-for + * @param {string} originalName + * @param {string} type + */ +function getDfns(dfnForArray, parent, originalName, type) { + if (!dfnForArray) { + return []; + } + // Definitions that have a name and [data-dfn-for] that exactly match the + // IDL entity: + const dfns = dfnForArray.filter(dfn => { + /** @type {HTMLElement} */ + const closestDfnFor = dfn.closest(`[data-dfn-for]`); + return closestDfnFor && closestDfnFor.dataset.dfnFor === parent; + }); + + if (dfns.length === 0 && parent === "" && dfnForArray.length === 1) { + // Make sure the name exactly matches + return dfnForArray[0].textContent === originalName ? dfnForArray : []; + } else if (topLevelEntities.has(type) && dfnForArray.length) { + const dfn = dfnForArray.find( + dfn => dfn.textContent.trim() === originalName + ); + if (dfn) return [dfn]; + } + return dfns; +} + +/** + * @return {string} + */ +function getDataType(idlStruct) { + const { idlType, generic, union } = idlStruct; + if (typeof idlType === "string") return idlType; + if (generic) return generic; + // join on "|" handles for "unsigned short" etc. + if (union) return idlType.map(getDataType).join("|"); + return getDataType(idlType); +} + +// Module core/webidl + +const name$A = "core/webidl"; + +const operationNames = {}; +const idlPartials = {}; + +const templates$1 = { + wrap(items) { + return items + .reduce(flatten, []) + .filter(x => x !== "") + .map(x => (typeof x === "string" ? new Text(x) : x)); + }, + trivia(t) { + if (!t.trim()) { + return t; + } + return hyperHTML`<span class='idlSectionComment'>${new Text(t)}</span>`; + }, + generic(keyword) { + // Shepherd classifies "interfaces" as starting with capital letters, + // like Promise, FrozenArray, etc. + return /^[A-Z]/.test(keyword) + ? hyperHTML`<a data-xref-type="interface" data-cite="WebIDL">${keyword}</a>` + : // Other keywords like sequence, maplike, etc... + hyperHTML`<a data-xref-type="dfn" data-cite="WebIDL">${keyword}</a>`; + }, + reference(wrapped, unescaped, context) { + if (context.type === "extended-attribute" && context.name !== "Exposed") { + return wrapped; + } + let type = "_IDL_"; + let cite = null; + let lt; + switch (unescaped) { + case "Window": + type = "interface"; + cite = "HTML"; + break; + case "object": + type = "interface"; + cite = "WebIDL"; + break; + default: { + const isWorkerType = unescaped.includes("Worker"); + if (isWorkerType && context.type === "extended-attribute") { + lt = `${unescaped}GlobalScope`; + type = "interface"; + cite = ["Worker", "DedicatedWorker", "SharedWorker"].includes( + unescaped + ) + ? "HTML" + : null; + } + } + } + const anchor = hyperHTML`<a data-xref-type="${type}">${wrapped}</a>`; + if (cite) { + anchor.dataset.cite = cite; + } + if (lt) { + anchor.dataset.lt = lt; + } + return anchor; + }, + name(escaped, { data, parent }) { + if (data.idlType && data.idlType.type === "argument-type") { + return hyperHTML`<span class="idlParamName">${escaped}</span>`; + } + const idlLink = defineIdlName(escaped, data, parent); + if (data.type !== "enum-value") { + const className = parent ? "idlName" : "idlID"; + idlLink.classList.add(className); + } + return idlLink; + }, + nameless(escaped, { data, parent }) { + switch (data.type) { + case "constructor": + return defineIdlName(escaped, data, parent); + default: + return escaped; + } + }, + type(contents) { + return hyperHTML`<span class="idlType">${contents}</span>`; + }, + inheritance(contents) { + return hyperHTML`<span class="idlSuperclass">${contents}</span>`; + }, + definition(contents, { data, parent }) { + const className = getIdlDefinitionClassName(data); + switch (data.type) { + case "includes": + case "enum-value": + return hyperHTML`<span class='${className}'>${contents}</span>`; + } + const parentName = parent ? parent.name : ""; + const { name, idlId } = getNameAndId(data, parentName); + return hyperHTML`<span class='${className}' id='${idlId}' data-idl="" data-title='${name}'>${contents}</span>`; + }, + extendedAttribute(contents) { + const result = hyperHTML`<span class="extAttr">${contents}</span>`; + return result; + }, + extendedAttributeReference(name) { + return hyperHTML`<a data-xref-type="extended-attribute">${name}</a>`; + }, +}; + +/** + * Returns a link to existing <dfn> or creates one if doesn’t exists. + */ +function defineIdlName(escaped, data, parent) { + const parentName = parent ? parent.name : ""; + const { name } = getNameAndId(data, parentName); + const dfn = findDfn(data, name, { + parent: parentName, + }); + const linkType = getDfnType(data.type); + if (dfn) { + if (!data.partial) { + dfn.dataset.export = ""; + dfn.dataset.dfnType = linkType; + } + decorateDfn(dfn, data, parentName, name); + const href = `#${dfn.id}`; + return hyperHTML`<a + data-link-for="${parentName}" + data-link-type="${linkType}" + href="${href}" class="internalDFN" - ><code>${e}</code></a>`}if("operation"===t.type&&"toJSON"===t.name&&t.extAttrs.some(({name:e})=>"Default"===e))return hyperHTML$1`<a + ><code>${escaped}</code></a>`; + } + + const isDefaultJSON = + data.type === "operation" && + data.name === "toJSON" && + data.extAttrs.some(({ name }) => name === "Default"); + if (isDefaultJSON) { + return hyperHTML`<a data-link-type="dfn" - data-lt="default toJSON operation">${e}</a>`;if(!t.partial){const n=hyperHTML$1`<dfn data-export data-dfn-type="${a}">${e}</dfn>`;return registerDefinition(n,[o]),decorateDfn(n,t,r,o),n}const s=hyperHTML$1`<a - data-idl="${t.partial?"partial":null}" - data-link-type="${a}" - data-title="${t.name}" - data-xref-type="${a}" - >${e}</a>`;if(o&&"typedef"!==t.type&&!(t.partial&&!i)){showInlineWarning(s,`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${o}()`:o}\` ${t.type}. [More info](https://github.com/w3c/respec/wiki/WebIDL-thing-is-not-defined).`,"")}return s}function getDfnType(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}function getIdlDefinitionClassName(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}const nameResolverMap=new WeakMap;function getNameAndId(e,t=""){if(nameResolverMap.has(e))return nameResolverMap.get(e);const n=resolveNameAndId(e,t);return nameResolverMap.set(e,n),n}function resolveNameAndId(e,t){let n=getDefnName(e),r=getIdlId(n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":r+=resolvePartial(e);break;case"constructor":case"operation":{const o=resolveOverload(n,t);o?(n+=o,r+=o):e.arguments.length&&(r+=e.arguments.map(e=>`-${e.name.toLowerCase()}`).join(""));break}}return{name:n,idlId:r}}function resolvePartial(e){return e.partial?(idlPartials[e.name]||(idlPartials[e.name]=0),idlPartials[e.name]+=1,`-partial-${idlPartials[e.name]}`):""}function resolveOverload(e,t){const n=`${t}.${e}`,r=`${n}()`;let o;return operationNames[r]||(operationNames[r]=0),operationNames[n]?o=`!overload-${operationNames[n]}`:operationNames[n]=0,operationNames[r]+=1,operationNames[n]+=1,o||""}function getIdlId(e,t){return t?`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`:`idl-def-${e.toLowerCase()}`}function getDefnName(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name;default:return e.name||e.type}}function renderWebIDL(e,t){let n;try{n=webidl2.parse(e.textContent,{sourceName:String(t)})}catch(t){return showInlineError(e,`Failed to parse WebIDL: ${t.bareMessage}.`,t.bareMessage,{details:`<pre>${t.context}</pre>`}),[]}e.classList.add("def","idl");const r=webidl2.write(n,{templates:templates$1});hyperHTML$1.bind(e)`${r}`,e.querySelectorAll("[data-idl]").forEach(e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.parentElement.closest("[data-idl][data-title]");n&&(e.dataset.dfnFor=n.dataset.title),registerDefinition(e,[t])});const o=e.closest("[data-cite], body"),{dataset:i}=o;if(i.cite||(i.cite="WebIDL"),!/\bwebidl\b/i.test(i.cite)){const e=i.cite.trim().split(/\s+/);i.cite=["WebIDL",...e].join(" ")}return n}const cssPromise$2=loadStyle$4();async function loadStyle$4(){try{return(await Promise.resolve().then((function(){return webidl$2}))).default}catch{return fetchAsset("webidl.css")}}async function run$p(){const e=document.querySelectorAll("pre.idl");if(!e.length)return;if(!document.querySelector(".idl:not(pre)")){const e=document.querySelector("head link");if(e){const t=document.createElement("style");t.textContent=await cssPromise$2,e.before(t)}}const t=[...e].map(renderWebIDL),n=webidl2.validate(t);for(const r of n){let n=`<pre>${r.context}</pre>`;if(r.autofix){r.autofix(),n+=`Try fixing as:\n <pre>${xmlEscape(webidl2.write(t[r.sourceName]))}</pre>`}showInlineError(e[r.sourceName],`WebIDL validation error: ${r.bareMessage}`,r.bareMessage,{details:n})}document.normalize()}var webidl=Object.freeze({__proto__:null,name:name$A,run:run$p});const name$B="core/data-cite";function requestLookup(e){const t=citeDetailsConverter(e);return async n=>{const r=n.dataset.cite,{key:o,frag:i,path:a}=t(n);let s="",c="";if(o.toLowerCase()===e.shortName.toLowerCase())console.log(n,`The reference "${o}" is resolved into the current document per \`conf.shortName\`.`),s=document.location.href;else{const e=await resolveRef(o);if(cleanElement(n),!e)return void showInlineWarning(n,`Couldn't find a match for "${r}"`);s=e.href,c=e.title}if(a){const e=a.startsWith("/")?`.${a}`:a;s=new URL(e,s).href}switch(i&&(s=new URL(i,s).href),n.localName){case"a":if(""===n.textContent&&"the-empty-string"!==n.dataset.lt&&(n.textContent=c),n.href=s,!a&&!i){const e=document.createElement("cite");n.replaceWith(e),e.append(n)}break;case"dfn":{const e=document.createElement("a");if(e.href=s,n.textContent?wrapInner(n,e):(e.textContent=c,n.append(e)),!a&&!i){const t=document.createElement("cite");t.append(e),n.append(t)}"export"in n.dataset&&(showInlineError(n,"Exporting an linked external definition is not allowed. Please remove the `data-export` attribute","Please remove the `data-export` attribute."),delete n.dataset.export),n.dataset.noExport="";break}}}}function cleanElement(e){["data-cite","data-cite-frag"].filter(t=>e.hasAttribute(t)).forEach(t=>e.removeAttribute(t))}function makeComponentFinder(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}function citeDetailsConverter(e){const t=makeComponentFinder("#"),n=makeComponentFinder("/");return function r(o){const{dataset:i}=o,{cite:a,citeFrag:s,citePath:c}=i;if(a.startsWith("#")&&!s){const t=o.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:n,isNormative:s}=t?r(t):{key:e.shortName||"",isNormative:!1};return i.cite=s?n:`?${n}`,i.citeFrag=a.replace("#",""),r(o)}const l=s?`#${s}`:t(a),u=c||n(a).split("#")[0],{type:d}=refTypeFromContext(a,o),p="normative"===d,h=/^[?|!]/.test(a);return{key:a.split(/[/|#]/)[0].substring(Number(h)),isNormative:p,frag:l,path:u}}}async function run$q(e){const t=citeDetailsConverter(e),n=document.querySelectorAll("dfn[data-cite], a[data-cite]");Array.from(n).filter(e=>e.dataset.cite).map(t).filter(({key:t})=>t.toLowerCase()!==(e.shortName||"").toLowerCase()).forEach(({isNormative:t,key:n})=>{t||e.normativeReferences.has(n)?(e.normativeReferences.add(n),e.informativeReferences.delete(n)):e.informativeReferences.add(n)})}async function linkInlineCitations(e,t=respecConfig){const n=requestLookup(t),r=[...e.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])")],o=citeDetailsConverter(t),i=r.map(o).map(async e=>{return{entry:e,result:await resolveRef(e.key)}}),a=(await Promise.all(i)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),s=await updateFromNetwork(a);s&&Object.assign(biblio,s);const c=[...new Set(r)].map(n);return await Promise.all(c)}var dataCite=Object.freeze({__proto__:null,name:name$B,run:run$q,linkInlineCitations:linkInlineCitations});const name$C="core/webidl-index";function run$r(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map(e=>`h${e}:first-child`).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.def.idl:not(.exclude)")).filter(e=>!e.closest(nonNormativeSelector));if(0===n.length){const t="This specification doesn't declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map(e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t}).forEach(e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)}),r.querySelectorAll("*[id]").forEach(e=>e.removeAttribute("id")),e.appendChild(r)}var webidlIndex=Object.freeze({__proto__:null,name:name$C,run:run$r});const VERSION_CHECK_WAIT=18e6;async function getIdbCache(){const e=await idb.openDB("xref",1,{upgrade(e){e.createObjectStore("xrefs")}});return new IDBKeyVal(e,"xrefs")}async function resolveXrefCache(e){try{const t=await getIdbCache();return await resolveFromCache(e,t)}catch(e){return console.error(e),new Map}}async function resolveFromCache(e,t){return await shouldBustCache(t)?(await t.clear(),new Map):await t.getMany(e.map(e=>e.id))}async function shouldBustCache(e){const t=await e.get("__LAST_VERSION_CHECK__"),n=Date.now();if(!t)return await e.set("__LAST_VERSION_CHECK__",n),!1;if(n-t<VERSION_CHECK_WAIT)return!1;const r=new URL("meta/version",API_URL).href,o=await fetch(r);if(!o.ok)return!1;const i=await o.text();return await e.set("__LAST_VERSION_CHECK__",n),parseInt(i,10)>t}async function cacheXrefData(e){try{const t=await getIdbCache();await t.addMany(e)}catch(e){console.error(e)}}const profiles={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},API_URL="https://respec.org/xref/";if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=createResourceHint({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}async function run$s(e,t){const n=normalizeConfig(e.xref);if(n.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(n.specs).join(" ")}if(!t.length)return;const r=[];for(const e of t){const t=getRequestEntry(e),n=await objectHash(t);r.push({...t,id:n})}addDataCiteToTerms(t,r,await getData(r,n.url),e)}function normalizeConfig(e){const t={url:API_URL,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in profiles?Object.assign(n,{specs:profiles[e.toLowerCase()]}):r(e);break;case"array":Object.assign(n,{specs:e});break;case"object":if(Object.assign(n,e),e.profile){const t=e.profile.toLowerCase();if(t in profiles){const r=(e.specs||[]).concat(profiles[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:pub("error",`Invalid value for \`xref\` configuration option. Received: "${e}".`)}return n;function r(e){pub("error",`Invalid profile "${e}" in \`respecConfig.xref\`. `+`Please use one of the supported profiles: ${Object.keys(profiles).map(e=>`"${e}"`).join(", ")}.`)}}function getRequestEntry(e){const t="xrefType"in e.dataset;let n=getTermFromElement(e);t||(n=n.toLowerCase());const r=[];let o=e.closest("[data-cite]");for(;o;){const t=o.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter(e=>e);if(t.length&&r.push(t.sort()),o===e)break;o=o.parentElement.closest("[data-cite]")}if(e.closest("[data-cite]")!==e){const t=e.closest("section"),n=[...t?t.querySelectorAll("a.bibref"):[]].map(e=>e.textContent.toLowerCase()),o=[...new Set(n)].sort();o.length&&r.unshift(o)}const i=[];t?e.dataset.xrefType?i.push(...e.dataset.xrefType.split("|")):i.push("_IDL_"):i.push("_CONCEPT_");let{xrefFor:a}=e.dataset;if(!a&&t){const t=e.closest("[data-xref-for]");t&&(a=norm(t.dataset.xrefFor))}else a&&"string"==typeof a&&(a=norm(a));return{term:n,types:i,...r.length&&{specs:r},..."string"==typeof a&&{for:a}}}function getTermFromElement(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return"the-empty-string"===(n=norm(n))?"":n}async function getData(e,t){const n=new Set,r=e.filter(e=>!n.has(e.id)&&(n.add(e.id)&&!0)),o=await resolveXrefCache(r),i=r.filter(e=>!o.get(e.id)),a=await fetchFromNetwork(i,t);return a.size&&await cacheXrefData(a),new Map([...o,...a])}async function fetchFromNetwork(e,t){if(!e.length)return new Map;const n={keys:e},r={method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}},o=await fetch(t,r),i=await o.json();return new Map(i.result)}function isNormative(e){const t=e.closest(".normative"),n=e.closest(nonNormativeSelector);return!n||e===t||t&&n&&n.contains(t)}function addDataCiteToTerms(e,t,n,r){const o={ambiguous:new Map,notFound:new Map};for(let i=0,a=e.length;i<a;i++){if(e[i].closest("[data-no-xref]"))continue;const a=e[i],s=t[i],{id:c}=s,l=n.get(c);if(1===l.length)addDataCite(a,s,l[0],r);else{const e=o[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:s}),e.get(c).elems.push(a)}}showErrors(o)}function addDataCite(e,t,n,r){const{term:o}=t,{uri:i,shortname:a,normative:s,type:c}=n,l=i.includes("/")?i.split("/",1)[1]:i,[u,d]=l.split("#"),p={cite:a,citePath:u,citeFrag:d,type:c};Object.assign(e.dataset,p),document.querySelectorAll(`[data-dfn-type="xref"][data-xref="${o.toLowerCase()}"]`).forEach(e=>{e.removeAttribute("data-xref"),Object.assign(e.dataset,p)}),addToReferences(e,a,s,o,r)}function addToReferences(e,t,n,r,o){if(!isNormative(e))return void(o.normativeReferences.has(t)||o.informativeReferences.add(t));if(n){const e=o.informativeReferences.has(t)?o.informativeReferences.getCanonicalKey(t):t;return o.normativeReferences.add(e),void o.informativeReferences.delete(e)}showInlineWarning(e,`Adding an informative reference to "${r}" from "${t}" `+"in a normative section","Error: Informative reference in normative section")}function showErrors({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(API_URL);return r.searchParams.set("term",e),t.for&&r.searchParams.set("for",t.for),r.searchParams.set("types",t.types.join(",")),n.length&&r.searchParams.set("cite",n.join(",")),r};for(const{query:e,elems:r}of t.values()){const t=[...new Set(flatten([],e.specs))].sort(),o=getTermFromElement(r[0]),i=n(o,e,t);showInlineError(r,`Couldn't match "**${o}**" to anything in the document or in any other document cited in this specification: ${t.map(e=>`\`${e}\``).join(", ")}. `+`See [how to cite to resolve the error](${i})`,"Error: No matching dfn found.")}for(const{query:t,elems:r,results:o}of e.values()){const e=[...new Set(o.map(e=>e.shortname))].sort(),i=e.map(e=>`**${e}**`).join(", "),a=getTermFromElement(r[0]);showInlineError(r,`The term "**${a}**" is defined in ${i} in multiple ways, so it's ambiguous. `+`See [how to cite to resolve the error](${n(a,t,e)})`,"Error: Linking an ambiguous dfn.")}}function objectHash(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(bufferToHexString)}function bufferToHexString(e){return[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,"0")).join("")}const name$D="core/link-to-dfn",l10n$8={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."}},lang$f=lang in l10n$8?lang:"en";class CaseInsensitiveMap extends Map{constructor(e=[]){return super(),e.forEach(([e,t])=>{this.set(e,t)}),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}async function run$t(e){const t=mapTitleToDfns(),n=[],r=[];if(document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)").forEach(e=>{const o=getLinkTargets(e);o.some(r=>findLinkTarget(r,e,t,n))||0===o.length||(""===e.dataset.cite?r.push(e):n.push(e))}),showLinkingError(r),e.xref){n.push(...findExplicitExternalLinks());try{await run$s(e,n)}catch(e){console.error(e),showLinkingError(n)}}else showLinkingError(n);await linkInlineCitations(document,e),pub("end","core/link-to-dfn")}function mapTitleToDfns(){const e=new CaseInsensitiveMap;return Object.keys(definitionMap).forEach(t=>{const{result:n,duplicates:r}=collectDfns(t);e.set(t,n),r.length>0&&showInlineError(r,l10n$8[lang$f].duplicateMsg(t),l10n$8[lang$f].duplicateTitle)}),e}function collectDfns(e){const t=new Map,n=[];return definitionMap[e].forEach(r=>{const{dfnFor:o=""}=r.dataset;if(t.has(o)){const e="dfn"===t.get(o).localName,i="dfn"===r.localName;if(e){if(!i)return;n.push(r)}}t.set(o,r),addId(r,"dfn",e)}),{result:t,duplicates:n}}function findLinkTarget(e,t,n,r){const{linkFor:o}=t.dataset;if(!n.has(e.title)||!n.get(e.title).get(e.for))return!1;const i=n.get(e.title).get(e.for);if(i.dataset.cite)t.dataset.cite=i.dataset.cite;else if(o&&!n.get(o))r.push(t);else if(i.classList.contains("externalDFN")){const e=i.dataset.lt?i.dataset.lt.split("|"):[];t.dataset.lt=e[0]||i.textContent,r.push(t)}else"partial"===t.dataset.idl?r.push(t):(t.href=`#${i.id}`,t.classList.add("internalDFN"));return t.hasAttribute("data-link-type")||(t.dataset.linkType="idl"in i.dataset?"idl":"dfn"),isCode(i)&&wrapAsCode(t,i),!0}function isCode(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}function wrapAsCode(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),o=shouldWrapByCode(e)||shouldWrapByCode(t,n);r&&!o||wrapInner(e,document.createElement("code"))}function shouldWrapByCode(e,t=""){switch(e.localName){case"a":if(e.querySelector("code"))return!0;break;default:{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt)return n.lt.split("|").includes(t)}}return!1}function findExplicitExternalLinks(){const e=document.querySelectorAll("a[data-cite]:not([data-cite='']):not([data-cite*='#']), dfn[data-cite]:not([data-cite='']):not([data-cite*='#'])"),t=document.querySelectorAll("dfn.externalDFN");return[...e].filter(e=>{if(""===e.textContent.trim())return!1;const t=e.closest("[data-cite]");return!t||""!==t.dataset.cite}).concat(...t)}function showLinkingError(e){e.forEach(e=>{showInlineWarning(e,`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,"Linking error: not matching `<dfn>`")})}var linkToDfn=Object.freeze({__proto__:null,name:name$D,run:run$t});const name$E="core/contrib";async function run$u(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void pub("error","Requested list of contributors from GitHub, but [`github`](https://github.com/w3c/respec/wiki/github) configuration option is not set.")}const t=e.editors.map(e=>e.name);await showContributors(t,e.githubAPI)}async function showContributors(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await async function(){const{href:n}=new URL("contributors",t);try{const t=await fetchAndCache(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter(t=>!e.includes(t.name||t.login))}catch(e){return pub("error","Error loading contributors from GitHub."),console.error(e),null}}();null!==r?toHTML(r,n):n.textContent="Failed to fetch contributors."}function toHTML(e,t){const n=e.sort((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())});if("UL"===t.tagName)return void hyperHTML$1(t)`${n.map(({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`)}`;const r=n.map(e=>e.name||e.login);t.textContent=joinAnd(r)}var contrib=Object.freeze({__proto__:null,name:name$E,run:run$u});const name$F="core/fix-headers";function run$v(){[...document.querySelectorAll("section:not(.introductory)")].map(e=>e.querySelector("h1, h2, h3, h4, h5, h6")).filter(e=>e).forEach(e=>{renameElement(e,`h${Math.min(getParents(e,"section").length+1,6)}`)})}function getParents(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}var fixHeaders=Object.freeze({__proto__:null,name:name$F,run:run$v});const lowerHeaderTags=["h2","h3","h4","h5","h6"],headerTags=["h1",...lowerHeaderTags],alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ",name$G="core/structure",localizationStrings$7={en:{toc:"Table of Contents"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"}},lang$g=lang in localizationStrings$7?lang:"en",l10n$9=localizationStrings$7[lang$g];function scanSections(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const a=hyperHTML$1`<ol class='toc'>`;for(const s of e){!s.isAppendix||n||r||(o=i,r=!0);let e=s.isIntro?"":r?alphabet.charAt(i-o):n+i;const c=Math.ceil(e.length/2);if(1===c&&(e+=".",s.header.before(document.createComment("OddPage"))),s.isIntro||(i+=1,s.header.prepend(hyperHTML$1`<bdi class='secno'>${e} </bdi>`)),c<=t){const n=createTocListItem(s.header,s.element.id),r=scanSections(s.subsections,t,{prefix:e});r&&n.append(r),a.append(n)}}return a}function getSectionTree(e,{tocIntroductory:t=!1}={}){const n=children(e,t?"section":"section:not(.introductory)"),r=[];for(const e of n){const n=e.classList.contains("notoc");if(!e.children.length||n)continue;const o=e.children[0];if(!lowerHeaderTags.includes(o.localName))continue;const i=o.textContent;addId(e,null,i),r.push({element:e,header:o,title:i,isIntro:e.classList.contains("introductory"),isAppendix:e.classList.contains("appendix"),subsections:getSectionTree(e,{tocIntroductory:t})})}return r}function createTocListItem(e,t){const n=hyperHTML$1`<a href="${`#${t}`}" class="tocxref"/>`;return n.append(...e.cloneNode(!0).childNodes),filterHeader(n),hyperHTML$1`<li class='tocline'>${n}</li>`}function filterHeader(e){e.querySelectorAll("a").forEach(e=>{const t=renameElement(e,"span");t.className="formerLink",t.removeAttribute("href")}),e.querySelectorAll("dfn").forEach(e=>{renameElement(e,"span").removeAttribute("id")})}function run$w(e){if("tocIntroductory"in e==!1&&(e.tocIntroductory=!1),"maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),renameSectionHeaders(),!e.noTOC){const t=scanSections(getSectionTree(document.body,{tocIntroductory:e.tocIntroductory}),e.maxTocLevel);t&&createTableOfContents(t)}}function renameSectionHeaders(){const e=getNonintroductorySectionHeaders();e.length&&e.forEach(e=>{const t=`h${Math.min(parents(e,"section").length+1,6)}`;e.localName!==t&&renameElement(e,t)})}function getNonintroductorySectionHeaders(){const e=headerTags.map(e=>`section:not(.introductory) ${e}:first-child`).join(",");return[...document.querySelectorAll(e)].filter(e=>!e.closest("section.introductory"))}function createTableOfContents(e){if(!e)return;const t=hyperHTML$1`<nav id="toc">`,n=hyperHTML$1`<h2 class="introductory">${l10n$9.toc}</h2>`;addId(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const o=hyperHTML$1`<p role='navigation' id='back-to-top'><a href='#title'><abbr title='Back to Top'>↑</abbr></a></p>`;document.body.append(o)}var structure$1=Object.freeze({__proto__:null,name:name$G,run:run$w});const name$H="core/informative",localizationStrings$8={en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."}},lang$h=lang in localizationStrings$8?lang:"en",l10n$a=localizationStrings$8[lang$h];function run$x(){Array.from(document.querySelectorAll("section.informative")).map(e=>e.querySelector("h2, h3, h4, h5, h6")).filter(e=>e).forEach(e=>{e.after(hyperHTML$1`<p><em>${l10n$a.informative}</em></p>`)})}var informative=Object.freeze({__proto__:null,name:name$H,run:run$x});const name$I="core/id-headers";function run$y(e){const t=document.querySelectorAll("section:not(.head):not(.introductory) h2, h3, h4, h5, h6");for(const n of t){if(addId(n),!e.addSectionLinks)continue;const t=n.parentElement.id||n.id;n.appendChild(hyperHTML$1` - <a href="${`#${t}`}" class="self-link" aria-label="§"></a> - `)}}var idHeaders=Object.freeze({__proto__:null,name:name$I,run:run$y});const name$J="core/caniuse",API_URL$1="https://respec.org/caniuse/",BROWSERS=new Map([["and_chr","Chrome (Android)"],["and_ff","Firefox (Android)"],["and_uc","UC Browser (Android)"],["android","Android"],["bb","Blackberry"],["chrome","Chrome"],["edge","Edge"],["firefox","Firefox"],["ie","IE"],["ios_saf","Safari (iOS)"],["op_mini","Opera Mini"],["op_mob","Opera Mobile"],["opera","Opera"],["safari","Safari"],["samsung","Samsung Internet"]]),supportTitles=new Map([["y","Supported."],["a","Almost supported (aka Partial support)."],["n","No support, or disabled by default."],["p","No support, but has Polyfill."],["u","Support unknown."],["x","Requires prefix to work."],["d","Disabled by default (needs to enabled)."]]);if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=createResourceHint({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}const caniuseCssPromise=loadStyle$5();async function loadStyle$5(){try{return(await Promise.resolve().then((function(){return caniuse$2}))).default}catch{return fetchAsset("caniuse.css")}}async function run$z(e){if(!e.caniuse)return;const t=getNormalizedConf(e);if(e.caniuse=t,!t.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,r=await caniuseCssPromise;document.head.appendChild(hyperHTML$1` - <style class="removeOnSave">${r}</style>`);const o=document.querySelector(".head dl"),i=(async()=>{try{const e=t.apiURL||API_URL$1,r=await fetchStats(e,t);return createTableHTML(n,r)}catch(e){return console.error(e),pub("error",`Couldn't find feature "${t.feature}" on caniuse.com? `+"Please check the feature key on [caniuse.com](https://caniuse.com)"),hyperHTML$1`<a href="${n}">caniuse.com</a>`}})(),a=hyperHTML$1` + data-lt="default toJSON operation">${escaped}</a>`; + } + if (!data.partial) { + const dfn = hyperHTML`<dfn data-export="" data-dfn-type="${linkType}">${escaped}</dfn>`; + registerDefinition(dfn, [name]); + decorateDfn(dfn, data, parentName, name); + return dfn; + } + + const unlinkedAnchor = hyperHTML`<a + data-link-type="${linkType}" + data-title="${data.name}" + data-xref-type="${linkType}" + >${escaped}</a>`; + if (data.partial) { + unlinkedAnchor.dataset.idl = "partial"; + } + + const showWarnings = + name && data.type !== "typedef" && !(data.partial && !dfn); + if (showWarnings) { + const styledName = data.type === "operation" ? `${name}()` : name; + const ofParent = parentName ? ` \`${parentName}\`'s` : ""; + const msg = `Missing \`<dfn>\` for${ofParent} \`${styledName}\` ${data.type}. [More info](https://github.com/w3c/respec/wiki/WebIDL-thing-is-not-defined).`; + showInlineWarning(unlinkedAnchor, msg, ""); + } + return unlinkedAnchor; +} + +/** + * Map to Shepherd types, for export. + * @see https://tabatkins.github.io/bikeshed/#dfn-types + */ +function getDfnType(idlType) { + switch (idlType) { + case "operation": + return "method"; + case "field": + return "dict-member"; + case "callback interface": + case "interface mixin": + return "interface"; + default: + return idlType; + } +} + +function getIdlDefinitionClassName(defn) { + switch (defn.type) { + case "callback interface": + return "idlInterface"; + case "operation": + return "idlMethod"; + case "field": + return "idlMember"; + case "enum-value": + return "idlEnumItem"; + case "callback function": + return "idlCallback"; + } + return `idl${defn.type[0].toUpperCase()}${defn.type.slice(1)}`; +} + +const nameResolverMap = new WeakMap(); +function getNameAndId(defn, parent = "") { + if (nameResolverMap.has(defn)) { + return nameResolverMap.get(defn); + } + const result = resolveNameAndId(defn, parent); + nameResolverMap.set(defn, result); + return result; +} + +function resolveNameAndId(defn, parent) { + let name = getDefnName(defn); + let idlId = getIdlId(name, parent); + switch (defn.type) { + // Top-level entities with linkable members. + case "callback interface": + case "dictionary": + case "interface": + case "interface mixin": { + idlId += resolvePartial(defn); + break; + } + case "constructor": + case "operation": { + const overload = resolveOverload(name, parent); + if (overload) { + name += overload; + idlId += overload; + } else if (defn.arguments.length) { + idlId += defn.arguments + .map(arg => `-${arg.name.toLowerCase()}`) + .join(""); + } + break; + } + } + return { name, idlId }; +} + +function resolvePartial(defn) { + if (!defn.partial) { + return ""; + } + if (!idlPartials[defn.name]) { + idlPartials[defn.name] = 0; + } + idlPartials[defn.name] += 1; + return `-partial-${idlPartials[defn.name]}`; +} + +function resolveOverload(name, parentName) { + const qualifiedName = `${parentName}.${name}`; + const fullyQualifiedName = `${qualifiedName}()`; + let overload; + if (!operationNames[fullyQualifiedName]) { + operationNames[fullyQualifiedName] = 0; + } + if (!operationNames[qualifiedName]) { + operationNames[qualifiedName] = 0; + } else { + overload = `!overload-${operationNames[qualifiedName]}`; + } + operationNames[fullyQualifiedName] += 1; + operationNames[qualifiedName] += 1; + return overload || ""; +} + +function getIdlId(name, parentName) { + if (!parentName) { + return `idl-def-${name.toLowerCase()}`; + } + return `idl-def-${parentName.toLowerCase()}-${name.toLowerCase()}`; +} + +function getDefnName(defn) { + switch (defn.type) { + case "enum-value": + return defn.value; + case "operation": + return defn.name; + default: + return defn.name || defn.type; + } +} + +function renderWebIDL(idlElement, index) { + let parse; + try { + parse = webidl2.parse(idlElement.textContent, { + sourceName: String(index), + }); + } catch (e) { + showInlineError( + idlElement, + `Failed to parse WebIDL: ${e.bareMessage}.`, + e.bareMessage, + { details: `<pre>${e.context}</pre>` } + ); + // Skip this <pre> and move on to the next one. + return []; + } + idlElement.classList.add("def", "idl"); + const html = webidl2.write(parse, { templates: templates$1 }); + idlElement.textContent = ""; + idlElement.append(...html); + idlElement.querySelectorAll("[data-idl]").forEach(elem => { + if (elem.dataset.dfnFor) { + return; + } + const title = elem.dataset.title; + // Select the nearest ancestor element that can contain members. + const parent = elem.parentElement.closest("[data-idl][data-title]"); + if (parent) { + elem.dataset.dfnFor = parent.dataset.title; + } + registerDefinition(elem, [title]); + }); + // cross reference + const closestCite = idlElement.closest("[data-cite], body"); + const { dataset } = closestCite; + if (!dataset.cite) dataset.cite = "WebIDL"; + // includes webidl in some form + if (!/\bwebidl\b/i.test(dataset.cite)) { + const cites = dataset.cite.trim().split(/\s+/); + dataset.cite = ["WebIDL", ...cites].join(" "); + } + return parse; +} + +const cssPromise$2 = loadStyle$4(); + +async function loadStyle$4() { + try { + return (await Promise.resolve().then(function () { return webidl$2; })).default; + } catch { + return fetchAsset("webidl.css"); + } +} + +async function run$p() { + const idls = document.querySelectorAll("pre.idl"); + if (!idls.length) { + return; + } + if (!document.querySelector(".idl:not(pre)")) { + const link = document.querySelector("head link"); + if (link) { + const style = document.createElement("style"); + style.textContent = await cssPromise$2; + link.before(style); + } + } + const astArray = [...idls].map(renderWebIDL); + + const validations = webidl2.validate(astArray); + for (const validation of validations) { + let details = `<pre>${validation.context}</pre>`; + if (validation.autofix) { + validation.autofix(); + const idlToFix = webidl2.write(astArray[validation.sourceName]); + const escaped = xmlEscape(idlToFix); + details += `Try fixing as: + <pre>${escaped}</pre>`; + } + showInlineError( + idls[validation.sourceName], + `WebIDL validation error: ${validation.bareMessage}`, + validation.bareMessage, + { details } + ); + } + document.normalize(); +} + +var webidl = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$A, + run: run$p +}); + +// @ts-check +const name$B = "core/data-cite"; + +function requestLookup(conf) { + const toCiteDetails = citeDetailsConverter(conf); + return async elem => { + const originalKey = elem.dataset.cite; + const { key, frag, path } = toCiteDetails(elem); + let href = ""; + let title = ""; + // This is just referring to this document + if (key.toLowerCase() === conf.shortName.toLowerCase()) { + console.log( + elem, + `The reference "${key}" is resolved into the current document per \`conf.shortName\`.` + ); + href = document.location.href; + } else { + // Let's go look it up in spec ref... + const entry = await resolveRef(key); + cleanElement(elem); + if (!entry) { + showInlineWarning(elem, `Couldn't find a match for "${originalKey}"`); + return; + } + href = entry.href; + title = entry.title; + } + if (path) { + // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475 + const relPath = path.startsWith("/") ? `.${path}` : path; + href = new URL(relPath, href).href; + } + if (frag) { + href = new URL(frag, href).href; + } + switch (elem.localName) { + case "a": { + if (elem.textContent === "" && elem.dataset.lt !== "the-empty-string") { + elem.textContent = title; + } + elem.href = href; + if (!path && !frag) { + const cite = document.createElement("cite"); + elem.replaceWith(cite); + cite.append(elem); + } + break; + } + case "dfn": { + const anchor = document.createElement("a"); + anchor.href = href; + if (!elem.textContent) { + anchor.textContent = title; + elem.append(anchor); + } else { + wrapInner(elem, anchor); + } + if (!path && !frag) { + const cite = document.createElement("cite"); + cite.append(anchor); + elem.append(cite); + } + if ("export" in elem.dataset) { + showInlineError( + elem, + "Exporting an linked external definition is not allowed. Please remove the `data-export` attribute", + "Please remove the `data-export` attribute." + ); + delete elem.dataset.export; + } + elem.dataset.noExport = ""; + break; + } + } + }; +} + +function cleanElement(elem) { + ["data-cite", "data-cite-frag"] + .filter(attrName => elem.hasAttribute(attrName)) + .forEach(attrName => elem.removeAttribute(attrName)); +} + +/** + * @param {string} component + * @return {(key: string) => string} + */ +function makeComponentFinder(component) { + return key => { + const position = key.search(component); + return position !== -1 ? key.substring(position) : ""; + }; +} + +/** + * @typedef {object} CiteDetails + * @property {string} key + * @property {boolean} isNormative + * @property {string} frag + * @property {string} path + * + * @return {(elem: HTMLElement) => CiteDetails}; + */ +function citeDetailsConverter(conf) { + const findFrag = makeComponentFinder("#"); + const findPath = makeComponentFinder("/"); + return function toCiteDetails(elem) { + const { dataset } = elem; + const { cite: rawKey, citeFrag, citePath } = dataset; + // The key is a fragment, resolve using the shortName as key + if (rawKey.startsWith("#") && !citeFrag) { + // Closes data-cite not starting with "#" + /** @type {HTMLElement} */ + const closest = elem.parentElement.closest( + `[data-cite]:not([data-cite^="#"])` + ); + const { key: parentKey, isNormative: closestIsNormative } = closest + ? toCiteDetails(closest) + : { key: conf.shortName || "", isNormative: false }; + dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`; + dataset.citeFrag = rawKey.replace("#", ""); // the key is acting as fragment + return toCiteDetails(elem); + } + const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey); + const path = citePath || findPath(rawKey).split("#")[0]; // path is always before "#" + const { type } = refTypeFromContext(rawKey, elem); + const isNormative = type === "normative"; + // key is before "/" and "#" but after "!" or "?" (e.g., ?key/path#frag) + const hasPrecedingMark = /^[?|!]/.test(rawKey); + const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark)); + const details = { key, isNormative, frag, path }; + return details; + }; +} + +async function run$q(conf) { + const toCiteDetails = citeDetailsConverter(conf); + /** @type {NodeListOf<HTMLElement>} */ + const cites = document.querySelectorAll("dfn[data-cite], a[data-cite]"); + Array.from(cites) + .filter(el => el.dataset.cite) + .map(toCiteDetails) + // it's not the same spec + .filter(({ key }) => { + return key.toLowerCase() !== (conf.shortName || "").toLowerCase(); + }) + .forEach(({ isNormative, key }) => { + if (!isNormative && !conf.normativeReferences.has(key)) { + conf.informativeReferences.add(key); + return; + } + conf.normativeReferences.add(key); + conf.informativeReferences.delete(key); + }); +} + +/** + * @param {Document} doc + * @param {*} conf + */ +async function linkInlineCitations(doc, conf = respecConfig) { + const toLookupRequest = requestLookup(conf); + const elems = [ + ...doc.querySelectorAll( + "dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])" + ), + ]; + const citeConverter = citeDetailsConverter(conf); + + const promisesForMissingEntries = elems + .map(citeConverter) + .map(async entry => { + const result = await resolveRef(entry.key); + return { entry, result }; + }); + const bibEntries = await Promise.all(promisesForMissingEntries); + + const missingBibEntries = bibEntries + .filter(({ result }) => result === null) + .map(({ entry: { key } }) => key); + + // we now go to network to fetch missing entries + const newEntries = await updateFromNetwork(missingBibEntries); + if (newEntries) Object.assign(biblio, newEntries); + + const lookupRequests = [...new Set(elems)].map(toLookupRequest); + return await Promise.all(lookupRequests); +} + +var dataCite = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$B, + run: run$q, + linkInlineCitations: linkInlineCitations +}); + +// @ts-check +/** + * Module: core/webidl-index + * constructs a summary of WebIDL in the document by + * cloning all the generated WebIDL nodes and + * appending them to pre element. + * + * Usage + * Add a <section id="idl-index"> to the document. + * It also supports title elements to generate a header. + * Or if a header element is an immediate child, then + * that is preferred. + */ +const name$C = "core/webidl-index"; + +function run$r() { + /** @type {HTMLElement | null} */ + const idlIndexSec = document.querySelector("section#idl-index"); + if (!idlIndexSec) { + return; + } + // Query for decedents headings, e.g., "h2:first-child, etc.." + const query = [2, 3, 4, 5, 6].map(level => `h${level}:first-child`).join(","); + if (!idlIndexSec.querySelector(query)) { + const header = document.createElement("h2"); + if (idlIndexSec.title) { + header.textContent = idlIndexSec.title; + idlIndexSec.removeAttribute("title"); + } else { + header.textContent = "IDL Index"; + } + idlIndexSec.prepend(header); + } + + // filter out the IDL marked with class="exclude" and the IDL in non-normative sections + const idlIndex = Array.from( + document.querySelectorAll("pre.def.idl:not(.exclude)") + ).filter(idl => !idl.closest(nonNormativeSelector)); + + if (idlIndex.length === 0) { + const text = "This specification doesn't declare any Web IDL."; + idlIndexSec.append(text); + return; + } + + const pre = document.createElement("pre"); + pre.classList.add("idl", "def"); + pre.id = "actual-idl-index"; + idlIndex + .map(elem => { + const fragment = document.createDocumentFragment(); + for (const child of elem.children) { + fragment.appendChild(child.cloneNode(true)); + } + return fragment; + }) + .forEach(elem => { + if (pre.lastChild) { + pre.append("\n\n"); + } + pre.appendChild(elem); + }); + // Remove duplicate IDs + pre.querySelectorAll("*[id]").forEach(elem => elem.removeAttribute("id")); + idlIndexSec.appendChild(pre); +} + +var webidlIndex = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$C, + run: run$r +}); + +// @ts-check + +/** + * @typedef {import('core/xref').RequestEntry} RequestEntry + * @typedef {import('core/xref').Response} Response + * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry + */ + +const VERSION_CHECK_WAIT = 5 * 60 * 60 * 1000; // 5 min + +async function getIdbCache() { + const db = await idb.openDB("xref", 1, { + upgrade(db) { + db.createObjectStore("xrefs"); + }, + }); + return new IDBKeyVal(db, "xrefs"); +} + +/** + * @param {RequestEntry[]} uniqueQueryKeys + * @returns {Promise<Map<string, SearchResultEntry[]>>} + */ +async function resolveXrefCache(uniqueQueryKeys) { + try { + const cache = await getIdbCache(); + return await resolveFromCache(uniqueQueryKeys, cache); + } catch (err) { + console.error(err); + return new Map(); + } +} + +/** + * @param {RequestEntry[]} keys + * @param {IDBKeyVal} cache + * @returns {Promise<Map<string, SearchResultEntry[]>>} + */ +async function resolveFromCache(keys, cache) { + const bustCache = await shouldBustCache(cache); + if (bustCache) { + await cache.clear(); + return new Map(); + } + + const cachedData = await cache.getMany(keys.map(key => key.id)); + return cachedData; +} + +/** + * Get last updated timestamp from server and bust cache based on that. This + * way, we prevent dirty/erroneous/stale data being kept on a client (which is + * possible if we use a `MAX_AGE` based caching strategy). + * @param {IDBKeyVal} cache + */ +async function shouldBustCache(cache) { + const lastChecked = await cache.get("__LAST_VERSION_CHECK__"); + const now = Date.now(); + + if (!lastChecked) { + await cache.set("__LAST_VERSION_CHECK__", now); + return false; + } + if (now - lastChecked < VERSION_CHECK_WAIT) { + // avoid checking network for any data update if old cache "fresh" + return false; + } + + const url = new URL("meta/version", API_URL).href; + const res = await fetch(url); + if (!res.ok) return false; + const lastUpdated = await res.text(); + await cache.set("__LAST_VERSION_CHECK__", now); + return parseInt(lastUpdated, 10) > lastChecked; +} + +/** + * @param {Map<string, SearchResultEntry[]>} data + */ +async function cacheXrefData(data) { + try { + const cache = await getIdbCache(); + // add data to cache + await cache.addMany(data); + } catch (e) { + console.error(e); + } +} + +// @ts-check + +const profiles = { + "web-platform": ["HTML", "INFRA", "URL", "WEBIDL", "DOM", "FETCH"], +}; + +const API_URL = "https://respec.org/xref/"; + +if ( + !document.querySelector("link[rel='preconnect'][href='https://respec.org']") +) { + const link = createResourceHint({ + hint: "preconnect", + href: "https://respec.org", + }); + document.head.appendChild(link); +} + +/** + * main external reference driver + * @param {Object} conf respecConfig + * @param {HTMLElement[]} elems possibleExternalLinks + */ +async function run$s(conf, elems) { + const xref = normalizeConfig(conf.xref); + if (xref.specs) { + const bodyCite = document.body.dataset.cite + ? document.body.dataset.cite.split(/\s+/) + : []; + document.body.dataset.cite = bodyCite.concat(xref.specs).join(" "); + } + + if (!elems.length) return; + + /** @type {RequestEntry[]} */ + const queryKeys = []; + for (const elem of elems) { + const entry = getRequestEntry(elem); + const id = await objectHash(entry); + queryKeys.push({ ...entry, id }); + } + + const data = await getData(queryKeys, xref.url); + addDataCiteToTerms(elems, queryKeys, data, conf); +} + +/** + * converts conf.xref to object with url and spec properties + */ +function normalizeConfig(xref) { + const defaults = { + url: API_URL, + specs: null, + }; + + const config = Object.assign({}, defaults); + + const type = Array.isArray(xref) ? "array" : typeof xref; + switch (type) { + case "boolean": + // using defaults already, as above + break; + case "string": + if (xref.toLowerCase() in profiles) { + Object.assign(config, { specs: profiles[xref.toLowerCase()] }); + } else { + invalidProfileError(xref); + } + break; + case "array": + Object.assign(config, { specs: xref }); + break; + case "object": + Object.assign(config, xref); + if (xref.profile) { + const profile = xref.profile.toLowerCase(); + if (profile in profiles) { + const specs = (xref.specs || []).concat(profiles[profile]); + Object.assign(config, { specs }); + } else { + invalidProfileError(xref.profile); + } + } + break; + default: + pub( + "error", + `Invalid value for \`xref\` configuration option. Received: "${xref}".` + ); + } + return config; + + function invalidProfileError(profile) { + const supportedProfiles = Object.keys(profiles) + .map(p => `"${p}"`) + .join(", "); + const msg = + `Invalid profile "${profile}" in \`respecConfig.xref\`. ` + + `Please use one of the supported profiles: ${supportedProfiles}.`; + pub("error", msg); + } +} + +/** + * get xref API request entry (term and context) for given xref element + * @param {HTMLElement} elem + */ +function getRequestEntry(elem) { + const isIDL = "xrefType" in elem.dataset; + + let term = getTermFromElement(elem); + if (!isIDL) term = term.toLowerCase(); + + /** @type {string[][]} */ + const specs = []; + /** @type {HTMLElement} */ + let dataciteElem = elem.closest("[data-cite]"); + while (dataciteElem) { + const cite = dataciteElem.dataset.cite.toLowerCase().replace(/[!?]/g, ""); + const cites = cite.split(/\s+/).filter(s => s); + if (cites.length) { + specs.push(cites.sort()); + } + if (dataciteElem === elem) break; + dataciteElem = dataciteElem.parentElement.closest("[data-cite]"); + } + // if element itself contains data-cite, we don't take inline context into account + if (elem.closest("[data-cite]") !== elem) { + const closestSection = elem.closest("section"); + /** @type {Iterable<HTMLElement>} */ + const bibrefs = closestSection + ? closestSection.querySelectorAll("a.bibref") + : []; + const inlineRefs = [...bibrefs].map(el => el.textContent.toLowerCase()); + const uniqueInlineRefs = [...new Set(inlineRefs)].sort(); + if (uniqueInlineRefs.length) { + specs.unshift(uniqueInlineRefs); + } + } + + const types = []; + if (isIDL) { + if (elem.dataset.xrefType) { + types.push(...elem.dataset.xrefType.split("|")); + } else { + types.push("_IDL_"); + } + } else { + types.push("_CONCEPT_"); + } + + let { xrefFor: forContext } = elem.dataset; + if (!forContext && isIDL) { + /** @type {HTMLElement} */ + const dataXrefForElem = elem.closest("[data-xref-for]"); + if (dataXrefForElem) { + forContext = norm(dataXrefForElem.dataset.xrefFor); + } + } else if (forContext && typeof forContext === "string") { + forContext = norm(forContext); + } + return { + term, + types, + ...(specs.length && { specs }), + ...(typeof forContext === "string" && { for: forContext }), + }; +} + +/** @param {HTMLElement} elem */ +function getTermFromElement(elem) { + const { lt: linkingText } = elem.dataset; + let term = linkingText ? linkingText.split("|", 1)[0] : elem.textContent; + term = norm(term); + return term === "the-empty-string" ? "" : term; +} + +/** + * @param {RequestEntry[]} queryKeys + * @param {string} apiUrl + * @returns {Promise<Map<string, SearchResultEntry[]>>} + */ +async function getData(queryKeys, apiUrl) { + const uniqueIds = new Set(); + const uniqueQueryKeys = queryKeys.filter(key => { + return uniqueIds.has(key.id) ? false : uniqueIds.add(key.id) && true; + }); + + const resultsFromCache = await resolveXrefCache(uniqueQueryKeys); + + const termsToLook = uniqueQueryKeys.filter( + key => !resultsFromCache.get(key.id) + ); + const fetchedResults = await fetchFromNetwork(termsToLook, apiUrl); + if (fetchedResults.size) { + // add data to cache + await cacheXrefData(fetchedResults); + } + + return new Map([...resultsFromCache, ...fetchedResults]); +} + +/** + * @param {RequestEntry[]} keys + * @param {string} url + * @returns {Promise<Map<string, SearchResultEntry[]>>} + */ +async function fetchFromNetwork(keys, url) { + if (!keys.length) return new Map(); + + const query = { keys }; + const options = { + method: "POST", + body: JSON.stringify(query), + headers: { + "Content-Type": "application/json", + }, + }; + const response = await fetch(url, options); + const json = await response.json(); + return new Map(json.result); +} + +/** + * Figures out from the tree structure if the reference is + * normative (true) or informative (false). + * @param {HTMLElement} elem + */ +function isNormative(elem) { + const closestNormative = elem.closest(".normative"); + const closestInform = elem.closest(nonNormativeSelector); + if (!closestInform || elem === closestNormative) { + return true; + } + return ( + closestNormative && + closestInform && + closestInform.contains(closestNormative) + ); +} + +/** + * adds data-cite attributes to elems for each term for which results are found. + * adds citations to references section. + * collects and shows linking errors if any. + * @param {HTMLElement[]} elems + * @param {RequestEntry[]} queryKeys + * @param {Map<string, SearchResultEntry[]>} data + * @param {any} conf + */ +function addDataCiteToTerms(elems, queryKeys, data, conf) { + /** @type {Errors} */ + const errors = { ambiguous: new Map(), notFound: new Map() }; + + for (let i = 0, l = elems.length; i < l; i++) { + if (elems[i].closest("[data-no-xref]")) continue; + + const elem = elems[i]; + const query = queryKeys[i]; + + const { id } = query; + const results = data.get(id); + if (results.length === 1) { + addDataCite(elem, query, results[0], conf); + } else { + const collector = errors[results.length === 0 ? "notFound" : "ambiguous"]; + if (!collector.has(id)) { + collector.set(id, { elems: [], results, query }); + } + collector.get(id).elems.push(elem); + } + } + + showErrors(errors); +} + +/** + * @param {HTMLElement} elem + * @param {RequestEntry} query + * @param {SearchResultEntry} result + * @param {any} conf + */ +function addDataCite(elem, query, result, conf) { + const { term } = query; + const { uri, shortname: cite, normative, type } = result; + + const path = uri.includes("/") ? uri.split("/", 1)[1] : uri; + const [citePath, citeFrag] = path.split("#"); + const dataset = { cite, citePath, citeFrag, type }; + Object.assign(elem.dataset, dataset); + + // update indirect links (data-lt, data-plurals) + /** @type {NodeListOf<HTMLElement>} */ + const indirectLinks = document.querySelectorAll( + `[data-dfn-type="xref"][data-xref="${term.toLowerCase()}"]` + ); + indirectLinks.forEach(el => { + el.removeAttribute("data-xref"); + Object.assign(el.dataset, dataset); + }); + + addToReferences(elem, cite, normative, term, conf); +} + +/** + * add specs for citation (references section) + * @param {HTMLElement} elem + * @param {string} cite + * @param {boolean} normative + * @param {string} term + * @param {any} conf + */ +function addToReferences(elem, cite, normative, term, conf) { + const isNormRef = isNormative(elem); + if (!isNormRef) { + // Only add it if not already normative... + if (!conf.normativeReferences.has(cite)) { + conf.informativeReferences.add(cite); + } + return; + } + if (normative) { + // If it was originally informative, we move the existing + // key to be normative. + const existingKey = conf.informativeReferences.has(cite) + ? conf.informativeReferences.getCanonicalKey(cite) + : cite; + conf.normativeReferences.add(existingKey); + conf.informativeReferences.delete(existingKey); + return; + } + + const msg = + `Adding an informative reference to "${term}" from "${cite}" ` + + "in a normative section"; + const title = "Error: Informative reference in normative section"; + showInlineWarning(elem, msg, title); +} + +/** @param {Errors} errors */ +function showErrors({ ambiguous, notFound }) { + const getPrefilledFormURL = (term, query, specs = []) => { + const url = new URL(API_URL); + url.searchParams.set("term", term); + if (query.for) url.searchParams.set("for", query.for); + url.searchParams.set("types", query.types.join(",")); + if (specs.length) url.searchParams.set("cite", specs.join(",")); + return url; + }; + + for (const { query, elems } of notFound.values()) { + const specs = [...new Set(flatten([], query.specs))].sort(); + const originalTerm = getTermFromElement(elems[0]); + const formUrl = getPrefilledFormURL(originalTerm, query, specs); + const specsString = specs.map(spec => `\`${spec}\``).join(", "); + const msg = + `Couldn't match "**${originalTerm}**" to anything in the document or in any other document cited in this specification: ${specsString}. ` + + `See [how to cite to resolve the error](${formUrl})`; + showInlineError(elems, msg, "Error: No matching dfn found."); + } + + for (const { query, elems, results } of ambiguous.values()) { + const specs = [...new Set(results.map(entry => entry.shortname))].sort(); + const specsString = specs.map(s => `**${s}**`).join(", "); + const originalTerm = getTermFromElement(elems[0]); + const formUrl = getPrefilledFormURL(originalTerm, query, specs); + const msg = + `The term "**${originalTerm}**" is defined in ${specsString} in multiple ways, so it's ambiguous. ` + + `See [how to cite to resolve the error](${formUrl})`; + showInlineError(elems, msg, "Error: Linking an ambiguous dfn."); + } +} + +function objectHash(obj) { + const str = JSON.stringify(obj, Object.keys(obj).sort()); + const buffer = new TextEncoder().encode(str); + return crypto.subtle.digest("SHA-1", buffer).then(bufferToHexString); +} + +/** @param {ArrayBuffer} buffer */ +function bufferToHexString(buffer) { + const byteArray = new Uint8Array(buffer); + return [...byteArray].map(v => v.toString(16).padStart(2, "0")).join(""); +} + +// @ts-check +const name$D = "core/link-to-dfn"; +const l10n$8 = { + en: { + /** + * @param {string} title + */ + duplicateMsg(title) { + return `Duplicate definition(s) of '${title}'`; + }, + duplicateTitle: "This is defined more than once in the document.", + }, +}; +const lang$f = lang in l10n$8 ? lang : "en"; + +class CaseInsensitiveMap extends Map { + /** + * @param {Array<[String, HTMLElement]>} [entries] + */ + constructor(entries = []) { + super(); + entries.forEach(([key, elem]) => { + this.set(key, elem); + }); + return this; + } + set(key, elem) { + super.set(key.toLowerCase(), elem); + return this; + } + get(key) { + return super.get(key.toLowerCase()); + } + has(key) { + return super.has(key.toLowerCase()); + } + delete(key) { + return super.delete(key.toLowerCase()); + } +} + +async function run$t(conf) { + const titleToDfns = mapTitleToDfns(); + /** @type {HTMLElement[]} */ + const possibleExternalLinks = []; + /** @type {HTMLAnchorElement[]} */ + const badLinks = []; + + const localLinkSelector = + "a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)"; + document.querySelectorAll(localLinkSelector).forEach(( + /** @type {HTMLAnchorElement} */ anchor + ) => { + const linkTargets = getLinkTargets(anchor); + const foundDfn = linkTargets.some(target => { + return findLinkTarget(target, anchor, titleToDfns, possibleExternalLinks); + }); + if (!foundDfn && linkTargets.length !== 0) { + if (anchor.dataset.cite === "") { + badLinks.push(anchor); + } else { + possibleExternalLinks.push(anchor); + } + } + }); + + showLinkingError(badLinks); + + if (conf.xref) { + possibleExternalLinks.push(...findExplicitExternalLinks()); + try { + await run$s(conf, possibleExternalLinks); + } catch (error) { + console.error(error); + showLinkingError(possibleExternalLinks); + } + } else { + showLinkingError(possibleExternalLinks); + } + + await linkInlineCitations(document, conf); + // Added message for legacy compat with Aria specs + // See https://github.com/w3c/respec/issues/793 + pub("end", "core/link-to-dfn"); +} + +function mapTitleToDfns() { + const titleToDfns = new CaseInsensitiveMap(); + Object.keys(definitionMap).forEach(title => { + const { result, duplicates } = collectDfns(title); + titleToDfns.set(title, result); + if (duplicates.length > 0) { + showInlineError( + duplicates, + l10n$8[lang$f].duplicateMsg(title), + l10n$8[lang$f].duplicateTitle + ); + } + }); + return titleToDfns; +} + +/** + * @param {string} title + */ +function collectDfns(title) { + /** @type {Map<string, HTMLElement>} */ + const result = new Map(); + const duplicates = []; + definitionMap[title].forEach(dfn => { + const { dfnFor = "" } = dfn.dataset; + if (result.has(dfnFor)) { + // We want <dfn> definitions to take precedence over + // definitions from WebIDL. WebIDL definitions wind + // up as <span>s instead of <dfn>. + const oldIsDfn = result.get(dfnFor).localName === "dfn"; + const newIsDfn = dfn.localName === "dfn"; + if (oldIsDfn) { + if (!newIsDfn) { + // Don't overwrite <dfn> definitions. + return; + } + duplicates.push(dfn); + } + } + result.set(dfnFor, dfn); + addId(dfn, "dfn", title); + }); + return { result, duplicates }; +} + +/** + * @param {import("./utils.js").LinkTarget} target + * @param {HTMLAnchorElement} anchor + * @param {CaseInsensitiveMap} titleToDfns + * @param {HTMLElement[]} possibleExternalLinks + */ +function findLinkTarget(target, anchor, titleToDfns, possibleExternalLinks) { + const { linkFor } = anchor.dataset; + if ( + !titleToDfns.has(target.title) || + !titleToDfns.get(target.title).get(target.for) + ) { + return false; + } + const dfn = titleToDfns.get(target.title).get(target.for); + if (dfn.dataset.cite) { + anchor.dataset.cite = dfn.dataset.cite; + } else if (linkFor && !titleToDfns.get(linkFor)) { + possibleExternalLinks.push(anchor); + } else if (dfn.classList.contains("externalDFN")) { + // data-lt[0] serves as unique id for the dfn which this element references + const lt = dfn.dataset.lt ? dfn.dataset.lt.split("|") : []; + anchor.dataset.lt = lt[0] || dfn.textContent; + possibleExternalLinks.push(anchor); + } else { + if (anchor.dataset.idl === "partial") { + possibleExternalLinks.push(anchor); + } else { + anchor.href = `#${dfn.id}`; + anchor.classList.add("internalDFN"); + } + } + if (!anchor.hasAttribute("data-link-type")) { + anchor.dataset.linkType = "idl" in dfn.dataset ? "idl" : "dfn"; + } + if (isCode(dfn)) { + wrapAsCode(anchor, dfn); + } + return true; +} + +/** + * Check if a definition is a code + * @param {HTMLElement} dfn a definition + */ +function isCode(dfn) { + if (dfn.closest("code,pre")) { + return true; + } + // Note that childNodes.length === 1 excludes + // definitions that have either other text, or other + // whitespace, inside the <dfn>. + if (dfn.childNodes.length !== 1) { + return false; + } + const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes); + return first.localName === "code"; +} + +/** + * Wrap links by <code>. + * @param {HTMLAnchorElement} anchor a link + * @param {HTMLElement} dfn a definition + */ +function wrapAsCode(anchor, dfn) { + // only add code to IDL when the definition matches + const term = anchor.textContent.trim(); + const isIDL = dfn.dataset.hasOwnProperty("idl"); + const needsCode = shouldWrapByCode(anchor) || shouldWrapByCode(dfn, term); + if (!isIDL || needsCode) { + wrapInner(anchor, document.createElement("code")); + } +} + +/** + * @param {HTMLElement} elem + * @param {string} term + */ +function shouldWrapByCode(elem, term = "") { + switch (elem.localName) { + case "a": + if (elem.querySelector("code")) { + return true; + } + break; + default: { + const { dataset } = elem; + if (elem.textContent.trim() === term) { + return true; + } else if (dataset.title === term) { + return true; + } else if (dataset.lt) { + return dataset.lt.split("|").includes(term); + } + } + } + return false; +} + +/** + * Find additional references that need to be looked up externally. + * Examples: a[data-cite="spec"], dfn[data-cite="spec"], dfn.externalDFN + */ +function findExplicitExternalLinks() { + /** @type {NodeListOf<HTMLElement>} */ + const links = document.querySelectorAll( + "a[data-cite]:not([data-cite='']):not([data-cite*='#']), " + + "dfn[data-cite]:not([data-cite='']):not([data-cite*='#'])" + ); + /** @type {NodeListOf<HTMLElement>} */ + const externalDFNs = document.querySelectorAll("dfn.externalDFN"); + return [...links] + .filter(el => { + // ignore empties + if (el.textContent.trim() === "") return false; + /** @type {HTMLElement} */ + const closest = el.closest("[data-cite]"); + return !closest || closest.dataset.cite !== ""; + }) + .concat(...externalDFNs); +} + +function showLinkingError(elems) { + elems.forEach(elem => { + showInlineWarning( + elem, + `Found linkless \`<a>\` element with text "${elem.textContent}" but no matching \`<dfn>\``, + "Linking error: not matching `<dfn>`" + ); + }); +} + +var linkToDfn = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$D, + run: run$t +}); + +// @ts-check +const name$E = "core/contrib"; + +async function run$u(conf) { + const ghContributors = document.getElementById("gh-contributors"); + if (!ghContributors) { + return; + } + + if (!conf.github) { + const msg = + "Requested list of contributors from GitHub, but " + + "[`github`](https://github.com/w3c/respec/wiki/github) configuration option is not set."; + pub("error", msg); + return; + } + + const editors = conf.editors.map(editor => editor.name); + const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`; + await showContributors(editors, apiURL); +} + +/** + * Show list of contributors in #gh-contributors + * @param {string[]} editors + * @param {string} apiURL + */ +async function showContributors(editors, apiURL) { + const elem = document.getElementById("gh-contributors"); + if (!elem) return; + + elem.textContent = "Fetching list of contributors..."; + const contributors = await getContributors(); + if (contributors !== null) { + toHTML(contributors, elem); + } else { + elem.textContent = "Failed to fetch contributors."; + } + + async function getContributors() { + const { href: url } = new URL("contributors", apiURL); + try { + const res = await fetchAndCache(url); + if (!res.ok) { + throw new Error( + `Request to ${url} failed with status code ${res.status}` + ); + } + /** @type {Contributor[]} */ + const contributors = await res.json(); + return contributors.filter( + user => !editors.includes(user.name || user.login) + ); + } catch (error) { + pub("error", "Error loading contributors from GitHub."); + console.error(error); + return null; + } + } +} + +/** + * @typedef {{ name?: string, login: string }} Contributor + * @param {Contributor[]} contributors + * @param {HTMLElement} element + */ +function toHTML(contributors, element) { + const sortedContributors = contributors.sort((a, b) => { + const nameA = a.name || a.login; + const nameB = b.name || b.login; + return nameA.toLowerCase().localeCompare(nameB.toLowerCase()); + }); + + if (element.tagName === "UL") { + const children = sortedContributors.map( + ({ name, login }) => + hyperHTML`<li><a href=${`https://github.com/${login}`}>${name || + login}</a></li>` + ); + element.textContent = ""; + element.append(...children); + return; + } + + const names = sortedContributors.map(user => user.name || user.login); + element.textContent = joinAnd(names); +} + +var contrib = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$E, + run: run$u +}); + +// @ts-check + +const name$F = "core/fix-headers"; + +function run$v() { + [...document.querySelectorAll("section:not(.introductory)")] + .map(sec => sec.querySelector("h1, h2, h3, h4, h5, h6")) + .filter(h => h) + .forEach(heading => { + const depth = Math.min(getParents(heading, "section").length + 1, 6); + renameElement(heading, `h${depth}`); + }); +} + +function getParents(el, selector) { + const parents = []; + while (el != el.ownerDocument.body) { + if (el.matches(selector)) parents.push(el); + el = el.parentElement; + } + return parents; +} + +var fixHeaders = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$F, + run: run$v +}); + +// @ts-check + +const lowerHeaderTags = ["h2", "h3", "h4", "h5", "h6"]; +const headerTags = ["h1", ...lowerHeaderTags]; + +const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +const name$G = "core/structure"; + +const localizationStrings$7 = { + en: { + toc: "Table of Contents", + }, + nl: { + toc: "Inhoudsopgave", + }, + es: { + toc: "Tabla de Contenidos", + }, +}; + +const lang$g = lang in localizationStrings$7 ? lang : "en"; + +const l10n$9 = localizationStrings$7[lang$g]; + +/** + * @typedef {object} SectionInfo + * @property {string} secno + * @property {string} title + * + * Scans sections and generate ordered list element + ID-to-anchor-content dictionary. + * @param {Section[]} sections the target element to find child sections + * @param {number} maxTocLevel + */ +function scanSections(sections, maxTocLevel, { prefix = "" } = {}) { + let appendixMode = false; + let lastNonAppendix = 0; + let index = 1; + if (prefix.length && !prefix.endsWith(".")) { + prefix += "."; + } + if (sections.length === 0) { + return null; + } + /** @type {HTMLElement} */ + const ol = hyperHTML`<ol class='toc'>`; + for (const section of sections) { + if (section.isAppendix && !prefix && !appendixMode) { + lastNonAppendix = index; + appendixMode = true; + } + let secno = section.isIntro + ? "" + : appendixMode + ? alphabet.charAt(index - lastNonAppendix) + : prefix + index; + const level = Math.ceil(secno.length / 2); + if (level === 1) { + secno += "."; + // if this is a top level item, insert + // an OddPage comment so html2ps will correctly + // paginate the output + section.header.before(document.createComment("OddPage")); + } + + if (!section.isIntro) { + index += 1; + section.header.prepend(hyperHTML`<bdi class='secno'>${secno}</bdi>`, " "); + } + + if (level <= maxTocLevel) { + const item = createTocListItem(section.header, section.element.id); + const sub = scanSections(section.subsections, maxTocLevel, { + prefix: secno, + }); + if (sub) { + item.append(sub); + } + ol.append(item); + } + } + return ol; +} + +/** + * @typedef {object} Section + * @property {Element} element + * @property {Element} header + * @property {string} title + * @property {boolean} isIntro + * @property {boolean} isAppendix + * @property {Section[]} subsections + * + * @param {Element} parent + */ +function getSectionTree(parent, { tocIntroductory = false } = {}) { + const sectionElements = children( + parent, + tocIntroductory ? "section" : "section:not(.introductory)" + ); + /** @type {Section[]} */ + const sections = []; + + for (const section of sectionElements) { + const noToc = section.classList.contains("notoc"); + if (!section.children.length || noToc) { + continue; + } + const header = section.children[0]; + if (!lowerHeaderTags.includes(header.localName)) { + continue; + } + const title = header.textContent; + addId(section, null, title); + sections.push({ + element: section, + header, + title, + isIntro: section.classList.contains("introductory"), + isAppendix: section.classList.contains("appendix"), + subsections: getSectionTree(section, { tocIntroductory }), + }); + } + return sections; +} + +/** + * @param {Element} header + * @param {string} id + */ +function createTocListItem(header, id) { + const anchor = hyperHTML`<a href="${`#${id}`}" class="tocxref"/>`; + anchor.append(...header.cloneNode(true).childNodes); + filterHeader(anchor); + return hyperHTML`<li class='tocline'>${anchor}</li>`; +} + +/** + * Replaces any child <a> and <dfn> with <span>. + * @param {HTMLElement} h + */ +function filterHeader(h) { + h.querySelectorAll("a").forEach(anchor => { + const span = renameElement(anchor, "span"); + span.className = "formerLink"; + span.removeAttribute("href"); + }); + h.querySelectorAll("dfn").forEach(dfn => { + const span = renameElement(dfn, "span"); + span.removeAttribute("id"); + }); +} + +function run$w(conf) { + if ("tocIntroductory" in conf === false) { + conf.tocIntroductory = false; + } + if ("maxTocLevel" in conf === false) { + conf.maxTocLevel = Infinity; + } + + renameSectionHeaders(); + + // makeTOC + if (!conf.noTOC) { + const sectionTree = getSectionTree(document.body, { + tocIntroductory: conf.tocIntroductory, + }); + const result = scanSections(sectionTree, conf.maxTocLevel); + if (result) { + createTableOfContents(result); + } + } +} + +function renameSectionHeaders() { + const headers = getNonintroductorySectionHeaders(); + if (!headers.length) { + return; + } + headers.forEach(header => { + const depth = Math.min(parents(header, "section").length + 1, 6); + const h = `h${depth}`; + if (header.localName !== h) { + renameElement(header, h); + } + }); +} + +function getNonintroductorySectionHeaders() { + const headerSelector = headerTags + .map(h => `section:not(.introductory) ${h}:first-child`) + .join(","); + return [...document.querySelectorAll(headerSelector)].filter( + elem => !elem.closest("section.introductory") + ); +} + +/** + * @param {HTMLElement} ol + */ +function createTableOfContents(ol) { + if (!ol) { + return; + } + const nav = hyperHTML`<nav id="toc">`; + const h2 = hyperHTML`<h2 class="introductory">${l10n$9.toc}</h2>`; + addId(h2); + nav.append(h2, ol); + const ref = + document.getElementById("toc") || + document.getElementById("sotd") || + document.getElementById("abstract"); + if (ref) { + if (ref.id === "toc") { + ref.replaceWith(nav); + } else { + ref.after(nav); + } + } + + const link = hyperHTML`<p role='navigation' id='back-to-top'><a href='#title'><abbr title='Back to Top'>\u2191;</abbr></a></p>`; + document.body.append(link); +} + +var structure$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$G, + run: run$w +}); + +// @ts-check + +const name$H = "core/informative"; + +const localizationStrings$8 = { + en: { + informative: "This section is non-normative.", + }, + nl: { + informative: "Dit onderdeel is niet normatief.", + }, +}; + +const lang$h = lang in localizationStrings$8 ? lang : "en"; + +const l10n$a = localizationStrings$8[lang$h]; + +function run$x() { + Array.from(document.querySelectorAll("section.informative")) + .map(informative => informative.querySelector("h2, h3, h4, h5, h6")) + .filter(heading => heading) + .forEach(heading => { + heading.after(hyperHTML`<p><em>${l10n$a.informative}</em></p>`); + }); +} + +var informative = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$H, + run: run$x +}); + +// @ts-check +// Module core/id-headers +// All headings are expected to have an ID, unless their immediate container has one. +// This is currently in core though it comes from a W3C rule. It may move in the future. + +const name$I = "core/id-headers"; + +function run$y(conf) { + /** @type {NodeListOf<HTMLElement>} */ + const headings = document.querySelectorAll( + `section:not(.head):not(.introductory) h2, h3, h4, h5, h6` + ); + for (const h of headings) { + addId(h); + if (!conf.addSectionLinks) continue; + const id = h.parentElement.id || h.id; + h.appendChild(hyperHTML` + <a href="${`#${id}`}" class="self-link" aria-label="§"></a> + `); + } +} + +var idHeaders = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$I, + run: run$y +}); + +// @ts-check + +const name$J = "core/caniuse"; + +const API_URL$1 = "https://respec.org/caniuse/"; + +// browser name dictionary +const BROWSERS = new Map([ + ["and_chr", "Chrome (Android)"], + ["and_ff", "Firefox (Android)"], + ["and_uc", "UC Browser (Android)"], + ["android", "Android"], + ["bb", "Blackberry"], + ["chrome", "Chrome"], + ["edge", "Edge"], + ["firefox", "Firefox"], + ["ie", "IE"], + ["ios_saf", "Safari (iOS)"], + ["op_mini", "Opera Mini"], + ["op_mob", "Opera Mobile"], + ["opera", "Opera"], + ["safari", "Safari"], + ["samsung", "Samsung Internet"], +]); + +// Keys from https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md +const supportTitles = new Map([ + ["y", "Supported."], + ["a", "Almost supported (aka Partial support)."], + ["n", "No support, or disabled by default."], + ["p", "No support, but has Polyfill."], + ["u", "Support unknown."], + ["x", "Requires prefix to work."], + ["d", "Disabled by default (needs to enabled)."], +]); + +if ( + !document.querySelector("link[rel='preconnect'][href='https://respec.org']") +) { + const link = createResourceHint({ + hint: "preconnect", + href: "https://respec.org", + }); + document.head.appendChild(link); +} + +const caniuseCssPromise = loadStyle$5(); + +async function loadStyle$5() { + try { + return (await Promise.resolve().then(function () { return caniuse$2; })).default; + } catch { + return fetchAsset("caniuse.css"); + } +} + +async function run$z(conf) { + if (!conf.caniuse) { + return; // nothing to do. + } + const options = getNormalizedConf(conf); + conf.caniuse = options; // for tests + if (!options.feature) { + return; // no feature to show + } + const featureURL = new URL(options.feature, "https://caniuse.com/").href; + + const caniuseCss = await caniuseCssPromise; + document.head.appendChild(hyperHTML` + <style class="removeOnSave">${caniuseCss}</style>`); + + const headDlElem = document.querySelector(".head dl"); + const contentPromise = (async () => { + try { + const apiUrl = options.apiURL || API_URL$1; + const stats = await fetchStats(apiUrl, options); + return createTableHTML(featureURL, stats); + } catch (err) { + console.error(err); + const msg = + `Couldn't find feature "${options.feature}" on caniuse.com? ` + + "Please check the feature key on [caniuse.com](https://caniuse.com)"; + pub("error", msg); + return hyperHTML`<a href="${featureURL}">caniuse.com</a>`; + } + })(); + const stats = hyperHTML`<dd class="caniuse-stats"> + Fetching data from caniuse.com... + </dd>`; + const definitionPair = hyperHTML` <dt class="caniuse-title">Browser support:</dt> - <dd class="caniuse-stats">${{any:i,placeholder:"Fetching data from caniuse.com..."}}</dd>`;o.append(...a.childNodes),await i,pub("amend-user-config",{caniuse:t.feature}),sub("beforesave",e=>{hyperHTML$1.bind(e.querySelector(".caniuse-stats"))` - <a href="${n}">caniuse.com</a>`})}function getNormalizedConf(e){const t={versions:4};if("string"==typeof e.caniuse)return{feature:e.caniuse,...t};const n={...t,...e.caniuse},{browsers:r}=n;if(Array.isArray(r)){const e=r.filter(e=>!BROWSERS.has(e));if(e.length){pub("warn",`Ignoring invalid browser(s): ${e.map(e=>`"\`${e}\`"`).join(", ")} in `+"[`respecConfig.caniuse.browsers`](https://github.com/w3c/respec/wiki/caniuse)")}}return n}async function fetchStats(e,t){const{feature:n,versions:r,browsers:o}=t,i=new URLSearchParams;i.set("feature",n),i.set("versions",r),Array.isArray(o)&&i.set("browsers",o.join(","));const a=`${e}?${i.toString()}`,s=await fetch(a);return await s.json()}function createTableHTML(e,t){return hyperHTML$1` - ${Object.entries(t).map(addBrowser)} - <a href="${e}" + ${stats}`; + headDlElem.append(...definitionPair.childNodes); + const result = await contentPromise; + stats.textContent = ""; + stats.append(result); + + // remove from export + pub("amend-user-config", { caniuse: options.feature }); + sub("beforesave", outputDoc => { + const stats = outputDoc.querySelector(".caniuse-stats"); + stats.textContent = ""; + stats.append(hyperHTML`<a href="${featureURL}">caniuse.com</a>`); + }); +} + +/** + * returns normalized `conf.caniuse` configuration + * @param {Object} conf configuration settings + */ +function getNormalizedConf(conf) { + const DEFAULTS = { versions: 4 }; + if (typeof conf.caniuse === "string") { + return { feature: conf.caniuse, ...DEFAULTS }; + } + const caniuseConf = { ...DEFAULTS, ...conf.caniuse }; + const { browsers } = caniuseConf; + if (Array.isArray(browsers)) { + const invalidBrowsers = browsers.filter(browser => !BROWSERS.has(browser)); + if (invalidBrowsers.length) { + const names = invalidBrowsers.map(b => `"\`${b}\`"`).join(", "); + pub( + "warn", + `Ignoring invalid browser(s): ${names} in ` + + "[`respecConfig.caniuse.browsers`](https://github.com/w3c/respec/wiki/caniuse)" + ); + } + } + return caniuseConf; +} + +/** + * @param {string} apiURL + * @typedef {Record<string, [string, string[]][]>} ApiResponse + * @return {Promise<ApiResponse>} + * @throws {Error} on failure + */ +async function fetchStats(apiURL, options) { + const { feature, versions, browsers } = options; + const searchParams = new URLSearchParams(); + searchParams.set("feature", feature); + searchParams.set("versions", versions); + if (Array.isArray(browsers)) { + searchParams.set("browsers", browsers.join(",")); + } + const url = `${apiURL}?${searchParams.toString()}`; + const response = await fetch(url); + const stats = await response.json(); + return stats; +} + +/** + * Get HTML element for the canIUse support table. + * @param {string} featureURL + * @param {ApiResponse} stats + */ +function createTableHTML(featureURL, stats) { + // render the support table + return hyperHTML` + ${Object.entries(stats).map(addBrowser)} + <a href="${featureURL}" title="Get details at caniuse.com">More info - </a>`}function addBrowser([e,t]){const n=e=>{const t=e.filter(e=>supportTitles.has(e)).map(e=>supportTitles.get(e));return{className:`caniuse-cell ${e.join(" ")}`,title:t.join(" ")}},[r,...o]=t;return hyperHTML$1` + </a>`; +} + +/** + * Add a browser and it's support to table. + * @param {[ string, ApiResponse["browserName"] ]} args + */ +function addBrowser([browserName, browserData]) { + /** @param {string[]} supportKeys */ + const getSupport = supportKeys => { + const titles = supportKeys + .filter(key => supportTitles.has(key)) + .map(key => supportTitles.get(key)); + return { + className: `caniuse-cell ${supportKeys.join(" ")}`, + title: titles.join(" "), + }; + }; + + /** @param {[string, string[]]} args */ + const addLatestVersion = ([version, supportKeys]) => { + const { className, title } = getSupport(supportKeys); + const buttonText = `${BROWSERS.get(browserName) || browserName} ${version}`; + return hyperHTML` + <button class="${className}" title="${title}">${buttonText}</button>`; + }; + + /** @param {[string, string[]]} args */ + const addBrowserVersion = ([version, supportKeys]) => { + const { className, title } = getSupport(supportKeys); + return hyperHTML`<li class="${className}" title="${title}">${version}</li>`; + }; + + const [latestVersion, ...olderVersions] = browserData; + return hyperHTML` <div class="caniuse-browser"> - ${(([t,r])=>{const{className:o,title:i}=n(r),a=`${BROWSERS.get(e)||e} ${t}`;return hyperHTML$1` - <button class="${o}" title="${i}">${a}</button>`})(r)} + ${addLatestVersion(latestVersion)} <ul> - ${o.map(([e,t])=>{const{className:r,title:o}=n(t);return`<li class="${r}" title="${o}">${e}</li>`})} + ${olderVersions.map(addBrowserVersion)} </ul> - </div>`}var caniuse=Object.freeze({__proto__:null,name:name$J,run:run$z});const name$K="core/mdn-annoatation",SPEC_MAP_URL="https://raw.githubusercontent.com/w3c/mdn-spec-links/master/SPECMAP.json",BASE_JSON_PATH="https://w3c.github.io/mdn-spec-links/",MDN_URL_BASE="https://developer.mozilla.org/en-US/docs/Web/",MDN_BROWSERS={chrome:"Chrome",chrome_android:"Chrome Android",edge:"Edge",edge_mobile:"Edge Mobile",firefox:"Firefox",firefox_android:"Firefox Android",ie:"Internet Explorer",opera:"Opera",opera_android:"Opera Android",safari:"Safari",safari_ios:"Safari iOS",samsunginternet_android:"Samsung Internet",webview_android:"WebView Android"},mdnCssPromise=loadStyle$6();async function loadStyle$6(){try{return(await Promise.resolve().then((function(){return mdnAnnotation$2}))).default}catch{return fetchAsset("mdn-annotation.css")}}function fetchAndCacheJson(e,t){return e?fetchAndCache(e,t).then(e=>e.json()):{}}function insertMDNBox(e){const t=e.closest("section"),{previousElementSibling:n,parentNode:r}=t;if(n&&n.classList.contains("mdn"))return n;const o=hyperHTML$1`<aside class="mdn before wrapped"></aside>`;return r.insertBefore(o,t),o}function attachMDNDetail(e,t){const{slug:n,summary:r}=t;e.innerHTML+='<button onclick="toggleMDNStatus(this.parentNode)" aria-label="Expand MDN details"><b>MDN</b></button>';const o=n.slice(n.indexOf("/")+1),i=document.createElement("div"),a=`${MDN_URL_BASE}${n}`;hyperHTML$1(i)` - <a title="${r}" href="${a}">${o}</a> - `,attachMDNBrowserSupport(i,t),e.appendChild(i)}function attachMDNBrowserSupport(e,t){if(!t.support)return void(e.innerHTML+='<p class="nosupportdata">No support data.</p>');const n=hyperHTML$1`<p class="mdnsupport"> - ${[buildBrowserSupportTable(t.support)]} - </p>`;e.appendChild(n)}function buildBrowserSupportTable(e){let t="";function n(e,n,r){const o="Unknown"===n?"?":n,i=`\n <span class="${`${e} ${n.toLowerCase()}`}">\n <span class="browser-name">${MDN_BROWSERS[e]}</span>\n <span class="version">${r||o}</span>\n </span>`;t+=i}function r(e,t){if(t.version_removed)return void n(e,"No","");const r=t.version_added;r?"boolean"==typeof r?n(e,r?"Yes":"No",""):n(e,"Yes",`${r}+`):n(e,"Unknown","")}return Object.keys(MDN_BROWSERS).forEach(t=>{e[t]?Array.isArray(e[t])?e[t].forEach(e=>{r(t,e)}):r(t,e[t]):n(t,"Unknown","")}),t}async function run$A(e){const{shortName:t,mdn:n}=e;if(!t||!n)return;const r=n.maxAge||864e5,o=n.specMapUrl||SPEC_MAP_URL,i=n.baseJsonPath||BASE_JSON_PATH,a=await fetchAndCacheJson(o,r);if(!Object.values(a).some(e=>e===`${t}.json`))return;const s=await fetchAndCacheJson(`${i}/${t}.json`,r),c=await mdnCssPromise;document.head.appendChild(hyperHTML$1`<style>${[c]}</style>`),document.head.appendChild(hyperHTML$1`<script> + </div>`; +} + +var caniuse = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$J, + run: run$z +}); + +// @ts-check + +const name$K = "core/mdn-annoatation"; + +const SPEC_MAP_URL = + "https://raw.githubusercontent.com/w3c/mdn-spec-links/master/SPECMAP.json"; +const BASE_JSON_PATH = "https://w3c.github.io/mdn-spec-links/"; +const MDN_URL_BASE = "https://developer.mozilla.org/en-US/docs/Web/"; +const MDN_BROWSERS = { + // The browser IDs here must match the ones in the imported JSON data. + // See the list of browser IDs at https://goo.gl/iDacWP. + chrome: "Chrome", + chrome_android: "Chrome Android", + edge: "Edge", + edge_mobile: "Edge Mobile", + firefox: "Firefox", + firefox_android: "Firefox Android", + ie: "Internet Explorer", + // nodejs: "Node.js", // no data for features in HTML + opera: "Opera", + opera_android: "Opera Android", + // qq_android: "QQ Browser", // not enough data for features in HTML + safari: "Safari", + safari_ios: "Safari iOS", + samsunginternet_android: "Samsung Internet", + // uc_android: "UC browser", // not enough data for features in HTML + // uc_chinese_android: "Chinese UC Browser", // not enough data for features in HTML + webview_android: "WebView Android", +}; + +const mdnCssPromise = loadStyle$6(); + +async function loadStyle$6() { + try { + return (await Promise.resolve().then(function () { return mdnAnnotation$2; })).default; + } catch { + return fetchAsset("mdn-annotation.css"); + } +} + +function fetchAndCacheJson(url, maxAge) { + if (!url) return {}; + return fetchAndCache(url, maxAge).then(r => r.json()); +} + +function insertMDNBox(node) { + const targetAncestor = node.closest("section"); + const { previousElementSibling: targetSibling, parentNode } = targetAncestor; + if (targetSibling && targetSibling.classList.contains("mdn")) { + // If the target ancestor already has a mdnBox inserted, we just use it + return targetSibling; + } + const mdnBox = hyperHTML`<aside class="mdn before wrapped"></aside>`; + parentNode.insertBefore(mdnBox, targetAncestor); + return mdnBox; +} + +function attachMDNDetail(container, mdnSpec) { + const { slug, summary } = mdnSpec; + container.innerHTML += `<button onclick="toggleMDNStatus(this.parentNode)" aria-label="Expand MDN details"><b>MDN</b></button>`; + const mdnSubPath = slug.slice(slug.indexOf("/") + 1); + const href = `${MDN_URL_BASE}${slug}`; + const mdnDetail = hyperHTML` + <div> + <a title="${summary}" href="${href}">${mdnSubPath}</a> + </div> + `; + attachMDNBrowserSupport(mdnDetail, mdnSpec); + container.appendChild(mdnDetail); +} + +function attachMDNBrowserSupport(container, mdnSpec) { + if (!mdnSpec.support) { + container.innerHTML += `<p class="nosupportdata">No support data.</p>`; + return; + } + const supportTable = hyperHTML`<p class="mdnsupport"> + ${raw(buildBrowserSupportTable(mdnSpec.support))} + </p>`; + container.appendChild(supportTable); +} + +function buildBrowserSupportTable(support) { + let innerHTML = ""; + function addMDNBrowserRow(browserId, yesNoUnknown, version) { + const displayStatus = yesNoUnknown === "Unknown" ? "?" : yesNoUnknown; + const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`; + const browserRow = ` + <span class="${classList}"> + <span class="browser-name">${MDN_BROWSERS[browserId]}</span> + <span class="version">${version ? version : displayStatus}</span> + </span>`; + innerHTML += browserRow; + } + + function processBrowserData(browserId, versionData) { + if (versionData.version_removed) { + addMDNBrowserRow(browserId, "No", ""); + return; + } + const versionAdded = versionData.version_added; + if (!versionAdded) { + addMDNBrowserRow(browserId, "Unknown", ""); + return; + } + if (typeof versionAdded === "boolean") { + addMDNBrowserRow(browserId, versionAdded ? "Yes" : "No", ""); + } else { + addMDNBrowserRow(browserId, "Yes", `${versionAdded}+`); + } + } + + Object.keys(MDN_BROWSERS).forEach(browserId => { + if (!support[browserId]) { + addMDNBrowserRow(browserId, "Unknown", ""); + } else { + if (Array.isArray(support[browserId])) { + support[browserId].forEach(b => { + processBrowserData(browserId, b); + }); + } else { + processBrowserData(browserId, support[browserId]); + } + } + }); + return innerHTML; +} + +async function run$A(conf) { + const { shortName, mdn } = conf; + if (!shortName || !mdn) { + // Nothing to do if shortName is not provided + return; + } + const maxAge = mdn.maxAge || 60 * 60 * 24 * 1000; + const specMapUrl = mdn.specMapUrl || SPEC_MAP_URL; + const baseJsonPath = mdn.baseJsonPath || BASE_JSON_PATH; + const specMap = await fetchAndCacheJson(specMapUrl, maxAge); + const hasSpecJson = Object.values(specMap).some( + jsonName => jsonName === `${shortName}.json` + ); + if (!hasSpecJson) { + return; + } + const mdnSpecJson = await fetchAndCacheJson( + `${baseJsonPath}/${shortName}.json`, + maxAge + ); + const mdnCss = await mdnCssPromise; + document.head.appendChild(hyperHTML`<style>${raw(mdnCss)}</style>`); + document.head.appendChild(hyperHTML`<script> function toggleMDNStatus(div) { div.parentNode.classList.toggle('wrapped'); } - </script>`),[...document.querySelectorAll("[id]")].filter(e=>{return-1===["STYLE","SCRIPT","BODY"].indexOf(e.tagName)&&s[e.id]&&Array.isArray(s[e.id])}).forEach(e=>{const t=s[e.id],n=insertMDNBox(e);t.map(e=>{const t=document.createElement("div");return attachMDNDetail(t,e),t}).forEach(e=>n.appendChild(e))})}var mdnAnnotation=Object.freeze({__proto__:null,name:name$K,run:run$A});const mimeTypes=new Map([["text/html","html"],["application/xml","xml"]]);function rsDocToDataURL(e,t=document){const n=mimeTypes.get(e);if(!n){const t=[...mimeTypes.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=serialize(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function serialize(e,t){const n=t.cloneNode(!0);cleanup(n);let r="";switch(e){case"xml":r=(new XMLSerializer).serializeToString(n);break;default:n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML}return r}function cleanup(e){const{head:t,body:n,documentElement:r}=e;removeCommentNodes(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar"),removeReSpec(r);const o=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&o.appendChild(i);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=hyperHTML$1`<meta charset="utf-8">`),o.appendChild(a);const s=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=hyperHTML$1` - <meta name="generator" content="${s}"> - `;o.appendChild(c),t.prepend(o),pub("beforesave",r)}expose("core/exporter",{rsDocToDataURL:rsDocToDataURL});const name$L="ui/save-html",epubURL=new URL("https://labs.w3.org/epub-generator/cgi-bin/epub-generator.py");epubURL.searchParams.append("type","respec"),epubURL.searchParams.append("url",document.location.href);const downloadLinks=[{id:"respec-save-as-html",fileName:"index.html",title:"HTML",type:"text/html",get href(){return rsDocToDataURL(this.type)}},{id:"respec-save-as-xml",fileName:"index.xhtml",title:"XML",type:"application/xml",get href(){return rsDocToDataURL(this.type)}},{id:"respec-save-as-epub",fileName:"spec.epub",title:"EPUB 3",type:"application/epub+zip",href:epubURL.href}];function toDownloadLink(e){const{id:t,href:n,fileName:r,title:o,type:i}=e;return hyperHTML$1` + </script>`); + const nodesWithId = document.querySelectorAll("[id]"); + [...nodesWithId] + .filter(node => { + const unlikelyTagNames = ["STYLE", "SCRIPT", "BODY"]; + return ( + unlikelyTagNames.indexOf(node.tagName) === -1 && + mdnSpecJson[node.id] && + Array.isArray(mdnSpecJson[node.id]) + ); + }) + .forEach(node => { + const mdnSpecArray = mdnSpecJson[node.id]; + const mdnBox = insertMDNBox(node); + mdnSpecArray + .map(spec => { + const mdnDiv = document.createElement("div"); + attachMDNDetail(mdnDiv, spec); + return mdnDiv; + }) + .forEach(mdnDiv => mdnBox.appendChild(mdnDiv)); + }); +} + +var mdnAnnotation = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$K, + run: run$A +}); + +// @ts-check + +const mimeTypes = new Map([ + ["text/html", "html"], + ["application/xml", "xml"], +]); + +/** + * Creates a dataURI from a ReSpec document. It also cleans up the document + * removing various things. + * + * @param {String} mimeType mimetype. one of `mimeTypes` above + * @param {Document} doc document to export. useful for testing purposes + * @returns a stringified data-uri of document that can be saved. + */ +function rsDocToDataURL(mimeType, doc = document) { + const format = mimeTypes.get(mimeType); + if (!format) { + const validTypes = [...mimeTypes.values()].join(", "); + const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`; + throw new TypeError(msg); + } + const data = serialize(format, doc); + const encodedString = encodeURIComponent(data); + return `data:${mimeType};charset=utf-8,${encodedString}`; +} + +function serialize(format, doc) { + const cloneDoc = doc.cloneNode(true); + cleanup(cloneDoc); + let result = ""; + switch (format) { + case "xml": + result = new XMLSerializer().serializeToString(cloneDoc); + break; + default: { + if (cloneDoc.doctype) { + result += new XMLSerializer().serializeToString(cloneDoc.doctype); + } + result += cloneDoc.documentElement.outerHTML; + } + } + return result; +} + +function cleanup(cloneDoc) { + const { head, body, documentElement } = cloneDoc; + removeCommentNodes(cloneDoc); + + cloneDoc + .querySelectorAll(".removeOnSave, #toc-nav") + .forEach(elem => elem.remove()); + body.classList.remove("toc-sidebar"); + removeReSpec(documentElement); + + const insertions = cloneDoc.createDocumentFragment(); + + // Move meta viewport, as it controls the rendering on mobile. + const metaViewport = cloneDoc.querySelector("meta[name='viewport']"); + if (metaViewport && head.firstChild !== metaViewport) { + insertions.appendChild(metaViewport); + } + + // Move charset to near top, as it needs to be in the first 512 bytes. + let metaCharset = cloneDoc.querySelector( + "meta[charset], meta[content*='charset=']" + ); + if (!metaCharset) { + metaCharset = hyperHTML`<meta charset="utf-8">`; + } + insertions.appendChild(metaCharset); + + // Add meta generator + const respecVersion = `ReSpec ${window.respecVersion || "Developer Channel"}`; + const metaGenerator = hyperHTML` + <meta name="generator" content="${respecVersion}"> + `; + + insertions.appendChild(metaGenerator); + head.prepend(insertions); + pub("beforesave", documentElement); +} + +expose("core/exporter", { rsDocToDataURL }); + +// @ts-check + +const name$L = "ui/save-html"; + +// Create and download an EPUB 3 version of the content +// Using (by default) the EPUB 3 conversion service set up at labs.w3.org/epub-generator +// For more details on that service, see https://github.com/iherman/respec2epub +const epubURL = new URL( + "https://labs.w3.org/epub-generator/cgi-bin/epub-generator.py" +); +epubURL.searchParams.append("type", "respec"); +epubURL.searchParams.append("url", document.location.href); + +const downloadLinks = [ + { + id: "respec-save-as-html", + fileName: "index.html", + title: "HTML", + type: "text/html", + get href() { + return rsDocToDataURL(this.type); + }, + }, + { + id: "respec-save-as-xml", + fileName: "index.xhtml", + title: "XML", + type: "application/xml", + get href() { + return rsDocToDataURL(this.type); + }, + }, + { + id: "respec-save-as-epub", + fileName: "spec.epub", + title: "EPUB 3", + type: "application/epub+zip", + href: epubURL.href, + }, +]; + +function toDownloadLink(details) { + const { id, href, fileName, title, type } = details; + return hyperHTML` <a - href="${n}" - id="${t}" - download="${r}" - type="${i}" + href="${href}" + id="${id}" + download="${fileName}" + type="${type}" class="respec-save-button" - onclick=${()=>ui.closeModal()} - >${o}</a>`}const saveDialog={async show(e){await document.respecIsReady;const t=hyperHTML$1` + onclick=${() => ui.closeModal()} + >${title}</a>`; +} + +const saveDialog = { + async show(button) { + await document.respecIsReady; + const div = hyperHTML` <div class="respec-save-buttons"> ${downloadLinks.map(toDownloadLink)} - </div>`;ui.freshModal(l10n[lang].save_snapshot,t,e)}},supportsDownload="download"in HTMLAnchorElement.prototype;let button;function show(){supportsDownload&&saveDialog.show(button)}function exportDocument(e,t){const n="Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed. Use core/exporter `rsDocToDataURL()` instead.";return pub("warn",n),console.warn(n),rsDocToDataURL(t)}supportsDownload&&(button=ui.addCommand(l10n[lang].save_snapshot,show,"Ctrl+Shift+Alt+S","💾"));var saveHtml=Object.freeze({__proto__:null,name:name$L,exportDocument:exportDocument});const button$1=ui.addCommand(l10n[lang].search_specref,show$1,"Ctrl+Shift+Alt+space","🔎"),specrefURL="https://specref.herokuapp.com/",refSearchURL=`${specrefURL}search-refs`,reveseLookupURL=`${specrefURL}reverse-lookup`,form=document.createElement("form"),renderer=hyperHTML$1.bind(form),resultList=hyperHTML$1.bind(document.createElement("div"));function renderResults(e,t,n){if(!e.size)return resultList` + </div>`; + ui.freshModal(l10n[lang].save_snapshot, div, button); + }, +}; + +const supportsDownload = "download" in HTMLAnchorElement.prototype; +let button; +if (supportsDownload) { + button = ui.addCommand( + l10n[lang].save_snapshot, + show, + "Ctrl+Shift+Alt+S", + "💾" + ); +} + +function show() { + if (!supportsDownload) return; + saveDialog.show(button); +} + +/** + * @param {*} _ + * @param {string} mimeType + */ +function exportDocument(_, mimeType) { + const msg = + "Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed. " + + "Use core/exporter `rsDocToDataURL()` instead."; + pub("warn", msg); + console.warn(msg); + return rsDocToDataURL(mimeType); +} + +var saveHtml = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$L, + exportDocument: exportDocument +}); + +// @ts-check + +const button$1 = ui.addCommand( + l10n[lang].search_specref, + show$1, + "Ctrl+Shift+Alt+space", + "🔎" +); +const specrefURL = "https://specref.herokuapp.com/"; +const refSearchURL = `${specrefURL}search-refs`; +const reveseLookupURL = `${specrefURL}reverse-lookup`; +const form = document.createElement("form"); + +form.id = "specref-ui"; + +/** + * @param {Map<string, string>} resultMap + * @param {string} query + * @param {number} timeTaken + */ +function renderResults(resultMap, query, timeTaken) { + if (!resultMap.size) { + return hyperHTML` <p class="state"> - Your search - <strong> ${t} </strong> - + Your search - <strong> ${query} </strong> - did not match any references. </p> - `;const r=Array.from(e).slice(0,99).map(toDefinitionPair).reduce((e,t)=>e.concat(t),[]);return resultList` + `; + } + const wires = Array.from(resultMap) + .slice(0, 99) + .map(toDefinitionPair) + .reduce((collector, pair) => collector.concat(pair), []); + return hyperHTML` <p class="result-stats"> - ${e.size} results (${n} seconds). - ${e.size>99?"First 100 results.":""} + ${resultMap.size} results (${timeTaken} seconds). + ${resultMap.size > 99 ? "First 100 results." : ""} </p> - <dl class="specref-results">${r}</dl> - `}function toDefinitionPair([e,t]){return hyperHTML$1.wire(t)` + <dl class="specref-results">${wires}</dl> + `; +} + +function toDefinitionPair([key, entry]) { + return hyperHTML` <dt> - [${e}] + [${key}] </dt> - <dd>${wireReference(t)}</dd> - `}function resultProcessor({includeVersions:e=!1}={}){return(...t)=>{const n=Object.assign({},...t),r=new Map(Object.entries(n));return Array.from(r).filter(([,e])=>e.aliasOf).map(([e])=>e).reduce((e,t)=>e.delete(t)&&e,r),e||Array.from(r.values()).filter(e=>"object"==typeof e&&"versions"in e).reduce(flatten,[]).forEach(e=>{r.delete(e)}),Array.from(r).filter(([,e])=>"object"!=typeof e).forEach(([e])=>r.delete(e)),r}}function show$1(){render(),ui.freshModal(l10n[lang].search_specref,form,button$1),form.querySelector("input[type=search]").focus()}form.id="specref-ui",form.addEventListener("submit",async e=>{e.preventDefault();const{searchBox:t}=form,n=t.value;if(!n)return void t.focus();render({state:"Searching Specref…"});const r=new URL(refSearchURL);r.searchParams.set("q",n);const o=new URL(reveseLookupURL);o.searchParams.set("urls",n);try{const e=performance.now(),i=await Promise.all([fetch(r).then(e=>e.json()),fetch(o).then(e=>e.json())]),{checked:a}=form.includeVersions;render({query:n,results:resultProcessor({includeVersions:a})(...i),state:"",timeTaken:Math.round(performance.now()-e)/1e3})}catch(e){console.error(e),render({state:"Error! Couldn't do search."})}finally{t.focus()}});const mast=hyperHTML$1.wire()` - <header> - <p> - An Open-Source, Community-Maintained Database of - Web Standards & Related References. - </p> - </header> - <div class="searchcomponent"> - <input - name="searchBox" - type="search" - autocomplete="off" - placeholder="Keywords, titles, authors, urls…"> - <button - type="submit"> - Search - </button> - <label> - <input type="checkbox" name="includeVersions"> Include all versions. - </label> + <dd>${wireReference(entry)}</dd> + `; +} + +function resultProcessor({ includeVersions = false } = {}) { + return (...fetchedData) => { + /** @type {{ [key: string]: any }} */ + const combinedResults = Object.assign({}, ...fetchedData); + const results = new Map(Object.entries(combinedResults)); + // remove aliases + Array.from(results) + .filter(([, entry]) => entry.aliasOf) + .map(([key]) => key) + .reduce((results, key) => results.delete(key) && results, results); + // Remove versions, if asked to + if (!includeVersions) { + Array.from(results.values()) + .filter(entry => typeof entry === "object" && "versions" in entry) + .reduce(flatten, []) + .forEach(version => { + results.delete(version); + }); + } + // Remove legacy string entries + Array.from(results) + .filter(([, value]) => typeof value !== "object") + .forEach(([key]) => results.delete(key)); + return results; + }; +} + +form.addEventListener("submit", async ev => { + ev.preventDefault(); + const { searchBox } = form; + const query = searchBox.value; + if (!query) { + searchBox.focus(); + return; + } + render({ state: "Searching Specref…" }); + const refSearch = new URL(refSearchURL); + refSearch.searchParams.set("q", query); + const reverseLookup = new URL(reveseLookupURL); + reverseLookup.searchParams.set("urls", query); + try { + const startTime = performance.now(); + const jsonData = await Promise.all([ + fetch(refSearch).then(response => response.json()), + fetch(reverseLookup).then(response => response.json()), + ]); + const { checked: includeVersions } = form.includeVersions; + const processResults = resultProcessor({ includeVersions }); + const results = processResults(...jsonData); + render({ + query, + results, + state: "", + timeTaken: Math.round(performance.now() - startTime) / 1000, + }); + } catch (err) { + console.error(err); + render({ state: "Error! Couldn't do search." }); + } finally { + searchBox.focus(); + } +}); + +function show$1() { + render(); + ui.freshModal(l10n[lang].search_specref, form, button$1); + /** @type {HTMLElement} */ + const input = form.querySelector("input[type=search]"); + input.focus(); +} + +const mast = hyperHTML` + <div> + <header> + <p> + An Open-Source, Community-Maintained Database of + Web Standards & Related References. + </p> + </header> + <div class="searchcomponent"> + <input + name="searchBox" + type="search" + autocomplete="off" + placeholder="Keywords, titles, authors, urls…"> + <button + type="submit"> + Search + </button> + <label> + <input type="checkbox" name="includeVersions"> Include all versions. + </label> + </div> </div> -`;function render({state:e="",results:t,timeTaken:n,query:r}={}){t?renderer` - <div>${mast}</div> - <p class="state" hidden="${!e}"> - ${e} +`; + +/** + * @param {object} options + * @param {string} [options.state] + * @param {Map<string, string>} [options.results] + * @param {number} [options.timeTaken] + * @param {string} [options.query] + */ +function render({ state = "", results, timeTaken, query } = {}) { + if (!results) { + form.textContent = ""; + form.append(mast); + return; + } + const content = hyperHTML` + ${mast} + <p class="state" hidden="${!state}"> + ${state} </p> - <section hidden="${!t}">${t?renderResults(t,r,n):[]}</section> - `:renderer`<div>${mast}</div>`}var searchSpecref=Object.freeze({__proto__:null});const XREF_URL="https://respec.org/xref/",localizationStrings$9={en:{title:"Search definitions"}},lang$i=lang in localizationStrings$9?lang:"en",l10n$b=localizationStrings$9[lang$i],button$2=ui.addCommand(l10n$b.title,show$2,"Ctrl+Shift+Alt+x","📚");function show$2(){const e=document.createElement("iframe");e.id="xref-ui",e.src=XREF_URL,e.onload=()=>e.classList.add("ready"),ui.freshModal(l10n$b.title,e,button$2)}var searchXref=Object.freeze({__proto__:null});const button$3=ui.addCommand(l10n[lang].definition_list,show$3,"Ctrl+Shift+Alt+D","📔"),ul=document.createElement("ul");ul.classList.add("respec-dfn-list");const render$1=hyperHTML$1.bind(ul);function show$3(){const e=Object.entries(definitionMap).sort(([e],[t])=>e.localeCompare(t)).map(([,[e]])=>hyperHTML$1.wire(e,":li>a")` + <section hidden="${!results}">${ + results ? renderResults(results, query, timeTaken) : [] + }</section> + `; + form.textContent = ""; + form.append(content); +} + +var searchSpecref = /*#__PURE__*/Object.freeze({ + __proto__: null +}); + +// @ts-check + +const XREF_URL = "https://respec.org/xref/"; + +const localizationStrings$9 = { + en: { + title: "Search definitions", + }, +}; +const lang$i = lang in localizationStrings$9 ? lang : "en"; +const l10n$b = localizationStrings$9[lang$i]; + +const button$2 = ui.addCommand(l10n$b.title, show$2, "Ctrl+Shift+Alt+x", "📚"); + +function show$2() { + const iframe = document.createElement("iframe"); + iframe.id = "xref-ui"; + iframe.src = XREF_URL; + iframe.onload = () => iframe.classList.add("ready"); + ui.freshModal(l10n$b.title, iframe, button$2); +} + +var searchXref = /*#__PURE__*/Object.freeze({ + __proto__: null +}); + +// @ts-check + +const button$3 = ui.addCommand( + l10n[lang].definition_list, + show$3, + "Ctrl+Shift+Alt+D", + "📔" +); + +const ul = document.createElement("ul"); +ul.classList.add("respec-dfn-list"); + +ul.addEventListener("click", ev => { + ui.closeModal(); + ev.stopPropagation(); +}); + +function show$3() { + const definitionLinks = Object.entries(definitionMap) + .sort(([keyA], [keyB]) => keyA.localeCompare(keyB)) + .map(([, [dfn]]) => { + return hyperHTML` <li> - <a href="${`#${e.id}`}"> - ${e.textContent} + <a href="${`#${dfn.id}`}"> + ${dfn.textContent} </a> </li> - `);render$1`${e}`,ui.freshModal(l10n[lang].list_of_definitions,ul,button$3)}ul.addEventListener("click",e=>{ui.closeModal(),e.stopPropagation()});var dfnList=Object.freeze({__proto__:null});window.respecVersion=window.respecVersion||"Developer Edition";const div=document.createElement("div"),render$2=hyperHTML$1.bind(div),button$4=ui.addCommand(`About ${window.respecVersion}`,show$4,"Ctrl+Shift+Alt+A","ℹ️");function show$4(){ui.freshModal(`${l10n[lang].about_respec} - ${window.respecVersion}`,div,button$4);const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort((e,t)=>t.duration-e.duration).map(({name:e,duration:t})=>{return{name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}}).map(perfEntryToTR).forEach(t=>{e.push(t)}),render$2` + `; + }); + ul.textContent = ""; + ul.append(...definitionLinks); + ui.freshModal(l10n[lang].list_of_definitions, ul, button$3); +} + +var dfnList = /*#__PURE__*/Object.freeze({ + __proto__: null +}); + +// @ts-check + +// window.respecVersion is added at build time (see tools/builder.js) +window.respecVersion = window.respecVersion || "Developer Edition"; +const div = document.createElement("div"); +const button$4 = ui.addCommand( + `About ${window.respecVersion}`, + show$4, + "Ctrl+Shift+Alt+A", + "ℹ️" +); + +function show$4() { + ui.freshModal( + `${l10n[lang].about_respec} - ${window.respecVersion}`, + div, + button$4 + ); + const entries = []; + if ("getEntriesByType" in performance) { + performance + .getEntriesByType("measure") + .sort((a, b) => b.duration - a.duration) + .map(({ name, duration }) => { + const humanDuration = + duration > 1000 + ? `${Math.round(duration / 1000.0)} second(s)` + : `${duration.toFixed(2)} milliseconds`; + return { name, duration: humanDuration }; + }) + .map(perfEntryToTR) + .forEach(entry => { + entries.push(entry); + }); + } + const fragment = hyperHTML` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -847,7 +15799,7 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& <a href='https://github.com/w3c/respec/wiki'>Documentation</a>, <a href='https://github.com/w3c/respec/issues'>Bugs</a>. </p> - <table border="1" width="100%" hidden="${!e.length}"> + <table border="1" width="100%" hidden="${entries.length ? false : true}"> <caption> Loaded plugins </caption> @@ -861,33 +15813,1229 @@ function(e){return e.join(X).replace(ue,fe).replace(le,pe)})(t),r=e.transform;r& </th> </tr> </thead> - <tbody>${e}</tbody> + <tbody>${entries}</tbody> </table> -`}function perfEntryToTR({name:e,duration:t}){return hyperHTML$1.bind(document.createElement("tr"))` - <td> - <a href="${`https://github.com/w3c/respec/tree/develop/src/${e}.js`}"> - ${e} - </a> - </td> - <td> - ${t} - </td> - `}var aboutRespec=Object.freeze({__proto__:null});const name$M="core/seo";function run$B(){const e=document.querySelector("#abstract p:first-of-type");if(!e)return;const t=e.textContent.replace(/\s+/," ").trim(),n=document.createElement("meta");n.name="description",n.content=t,document.head.appendChild(n)}var seo=Object.freeze({__proto__:null,name:name$M,run:run$B});const name$N="w3c/seo";async function run$C(e){if(!e.canonicalURI)switch(e.specStatus){case"CG-DRAFT":case"BG-DRAFT":case"unofficial":return}const t=e.shortName?`https://www.w3.org/TR/${e.shortName}/`:null;switch(e.canonicalURI){case"edDraft":e.edDraftURI?e.canonicalURI=new URL(e.edDraftURI,document.location.href).href:(pub("warn","Canonical URI set to edDraft, but no edDraftURI is set in configuration"),e.canonicalURI=null);break;case"TR":t?e.canonicalURI=t:(pub("warn","Canonical URI set to TR, but no shortName is set in configuration"),e.canonicalURI=null);break;default:if(e.canonicalURI)try{e.canonicalURI=new URL(e.canonicalURI,document.location.href).href}catch(t){pub("warn",`CanonicalURI is an invalid URL: ${t.message}`),e.canonicalURI=null}else t&&(e.canonicalURI=t)}if(e.canonicalURI){const t=document.createElement("link");t.setAttribute("rel","canonical"),t.setAttribute("href",e.canonicalURI),document.head.appendChild(t)}e.doJsonLd&&await addJSONLDInfo(e,document)}async function addJSONLDInfo(e,t){const n=["TechArticle"];e.rdfStatus&&n.push(e.rdfStatus);const r={"@context":["http://schema.org",{"@vocab":"http://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:n,name:e.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];r.copyrightHolder=[r.copyrightHolder,...t.map(e=>({name:e}))]}const o=t.head.querySelector("meta[name=description]");o&&(r.description=o.content),e.editors&&(r.editor=e.editors.map(addPerson)),e.authors&&(r.contributor=e.authors.map(addPerson));const i=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(i.map(e=>resolveRef(e)));r.citation=a.filter(e=>"object"==typeof e).map(addRef);const s=t.createElement("script");s.type="application/ld+json",s.textContent=JSON.stringify(r,null,2),t.head.appendChild(s)}function addPerson({name:e,url:t,mailto:n,company:r,companyURL:o}){const i={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||o)&&(i.worksFor={name:r,url:o}),i}function addRef(e){const{href:t,title:n,href:r}=e,o={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(o.creator=e.authors.map(e=>({name:e}))),e.rawDate&&(o.publishedDate=e.rawDate),e.isbn&&(o.identifier=e.isbn),e.publisher&&(o.publisher={name:e.publisher}),o}var seo$1=Object.freeze({__proto__:null,name:name$N,run:run$C});const name$O="core/worker",hint={hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight.js",as:"script"},link$1=createResourceHint(hint);async function loadWorkerScript(){try{return(await Promise.resolve().then((function(){return respecWorker$1}))).default}catch{return fetchBase("worker/respec-worker.js")}}async function createWorker(){const e=await loadWorkerScript(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}document.head.appendChild(link$1);const workerPromise=createWorker();expose(name$O,workerPromise.then(e=>({worker:e})));const name$P="core/highlight",nextMsgId=msgIdGenerator("highlight"),ghCssPromise=loadStyle$7();async function loadStyle$7(){try{return(await Promise.resolve().then((function(){return github$3}))).default}catch{return fetchAsset("github.css")}}function getLanguageHint(e){return Array.from(e).filter(e=>"highlight"!==e&&"nolinks"!==e).map(e=>e.toLowerCase())}async function highlightElement(e){e.setAttribute("aria-busy","true");const t=getLanguageHint(e.classList);let n;try{n=await sendHighlightRequest(e.innerText,t)}catch(e){return void console.error(e)}const{language:r,value:o}=n;switch(e.localName){case"pre":e.classList.remove(r),e.innerHTML=`<code class="hljs${r?` ${r}`:""}">${o}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=o,e.classList.add("hljs"),r&&e.classList.add(r)}e.setAttribute("aria-busy","false")}async function sendHighlightRequest(e,t){const n={action:"highlight",code:e,id:nextMsgId(),languages:t},r=await workerPromise;return r.postMessage(n),new Promise((e,t)=>{const o=setTimeout(()=>{t(new Error("Timed out waiting for highlight."))},4e3);r.addEventListener("message",(function t(i){const{data:{id:a,language:s,value:c}}=i;a===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:s,value:c}))}))})}async function run$D(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n ")].filter(e=>"pre"!==e.localName||!e.querySelector("code"));if(!t.length)return;const n=t.filter(e=>e.textContent.trim()).map(highlightElement),r=await ghCssPromise;document.head.appendChild(hyperHTML$1` +`; + div.textContent = ""; + div.append(fragment); +} + +function perfEntryToTR({ name, duration }) { + const moduleURL = `https://github.com/w3c/respec/tree/develop/src/${name}.js`; + return hyperHTML` + <tr> + <td><a href="${moduleURL}">${name}</a></td> + <td>${duration}</td> + </tr> + `; +} + +var aboutRespec = /*#__PURE__*/Object.freeze({ + __proto__: null +}); + +// @ts-check +/** + * This Module adds a metatag description to the document, based on the + * first paragraph of the abstract. + */ + +const name$M = "core/seo"; + +function run$B() { + const firstParagraph = document.querySelector("#abstract p:first-of-type"); + if (!firstParagraph) { + return; // no abstract, so nothing to do + } + // Normalize whitespace: trim, remove new lines, tabs, etc. + const content = firstParagraph.textContent.replace(/\s+/, " ").trim(); + const metaElem = document.createElement("meta"); + metaElem.name = "description"; + metaElem.content = content; + document.head.appendChild(metaElem); +} + +var seo = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$M, + run: run$B +}); + +// @ts-check +const name$N = "w3c/seo"; +async function run$C(conf) { + // Don't include a canonical URL for documents + // that haven't been published. + if (!conf.canonicalURI) { + switch (conf.specStatus) { + case "CG-DRAFT": + case "BG-DRAFT": + case "unofficial": + return; + } + } + const trLatestUri = conf.shortName + ? `https://www.w3.org/TR/${conf.shortName}/` + : null; + switch (conf.canonicalURI) { + case "edDraft": + if (conf.edDraftURI) { + conf.canonicalURI = new URL( + conf.edDraftURI, + document.location.href + ).href; + } else { + pub( + "warn", + "Canonical URI set to edDraft, " + + "but no edDraftURI is set in configuration" + ); + conf.canonicalURI = null; + } + break; + case "TR": + if (trLatestUri) { + conf.canonicalURI = trLatestUri; + } else { + pub( + "warn", + "Canonical URI set to TR, but " + + "no shortName is set in configuration" + ); + conf.canonicalURI = null; + } + break; + default: + if (conf.canonicalURI) { + try { + conf.canonicalURI = new URL( + conf.canonicalURI, + document.location.href + ).href; + } catch (err) { + pub("warn", `CanonicalURI is an invalid URL: ${err.message}`); + conf.canonicalURI = null; + } + } else if (trLatestUri) { + conf.canonicalURI = trLatestUri; + } + } + if (conf.canonicalURI) { + const linkElem = document.createElement("link"); + linkElem.setAttribute("rel", "canonical"); + linkElem.setAttribute("href", conf.canonicalURI); + document.head.appendChild(linkElem); + } + if (conf.doJsonLd) { + await addJSONLDInfo(conf, document); + } +} + +async function addJSONLDInfo(conf, doc) { + // Content for JSON + const type = ["TechArticle"]; + if (conf.rdfStatus) type.push(conf.rdfStatus); + + const jsonld = { + "@context": [ + "http://schema.org", + { + "@vocab": "http://schema.org/", + "@language": doc.documentElement.lang || "en", + w3p: "http://www.w3.org/2001/02pd/rec54#", + foaf: "http://xmlns.com/foaf/0.1/", + datePublished: { "@type": "http://www.w3.org/2001/XMLSchema#date" }, + inLanguage: { "@language": null }, + isBasedOn: { "@type": "@id" }, + license: { "@type": "@id" }, + }, + ], + id: conf.canonicalURI || conf.thisVersion, + type, + name: conf.title, + inLanguage: doc.documentElement.lang || "en", + license: conf.licenseInfo.url, + datePublished: conf.dashDate, + /** @type {{ name: string, url?: string } | { name: string, url?: string }[]} */ + copyrightHolder: { + name: "World Wide Web Consortium", + url: "https://www.w3.org/", + }, + discussionUrl: conf.issueBase, + alternativeHeadline: conf.subtitle, + isBasedOn: conf.prevVersion, + }; + + // add any additional copyright holders + if (conf.additionalCopyrightHolders) { + const addl = Array.isArray(conf.additionalCopyrightHolders) + ? conf.additionalCopyrightHolders + : [conf.additionalCopyrightHolders]; + jsonld.copyrightHolder = [ + jsonld.copyrightHolder, + ...addl.map(h => ({ name: h })), + ]; + } + + // description from meta description + const description = doc.head.querySelector("meta[name=description]"); + if (description) { + jsonld.description = description.content; + } + + // Editors + if (conf.editors) { + jsonld.editor = conf.editors.map(addPerson); + } + if (conf.authors) { + jsonld.contributor = conf.authors.map(addPerson); + } + + // normative and informative references + const citationIds = [ + ...conf.normativeReferences, + ...conf.informativeReferences, + ]; + const citationContents = await Promise.all( + citationIds.map(ref => resolveRef(ref)) + ); + jsonld.citation = citationContents + .filter(ref => typeof ref === "object") + .map(addRef); + + const script = doc.createElement("script"); + script.type = "application/ld+json"; + script.textContent = JSON.stringify(jsonld, null, 2); + doc.head.appendChild(script); +} + +/** + * Turn editors and authors into a list of JSON-LD relationships + */ +function addPerson({ name, url, mailto, company, companyURL }) { + const ed = { + type: "Person", + name, + url, + "foaf:mbox": mailto, + }; + if (company || companyURL) { + ed.worksFor = { + name: company, + url: companyURL, + }; + } + return ed; +} + +/** + * Create a reference URL from the ref + */ +function addRef(ref) { + const { href: id, title: name, href: url } = ref; + const jsonld = { + id, + type: "TechArticle", + name, + url, + }; + if (ref.authors) { + jsonld.creator = ref.authors.map(a => ({ name: a })); + } + if (ref.rawDate) { + jsonld.publishedDate = ref.rawDate; + } + if (ref.isbn) { + jsonld.identifier = ref.isbn; + } + if (ref.publisher) { + jsonld.publisher = { name: ref.publisher }; + } + return jsonld; +} + +var seo$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$N, + run: run$C +}); + +// @ts-check +/** + * Module core/worker + * + * Exports a Web Worker for ReSpec, allowing for + * multi-threaded processing of things. + */ +const name$O = "core/worker"; +// Opportunistically preload syntax highlighter +const hint = { + hint: "preload", + href: "https://www.w3.org/Tools/respec/respec-highlight.js", + as: "script", +}; +const link$1 = createResourceHint(hint); +document.head.appendChild(link$1); + +async function loadWorkerScript() { + try { + return (await Promise.resolve().then(function () { return respecWorker$1; })).default; + } catch { + return fetchBase("worker/respec-worker.js"); + } +} + +async function createWorker() { + const workerScript = await loadWorkerScript(); + const workerURL = URL.createObjectURL( + new Blob([workerScript], { type: "application/javascript" }) + ); + return new Worker(workerURL); +} + +const workerPromise = createWorker(); + +expose( + name$O, + workerPromise.then(worker => ({ worker })) +); + +// @ts-check +const name$P = "core/highlight"; + +const nextMsgId = msgIdGenerator("highlight"); + +const ghCssPromise = loadStyle$7(); + +async function loadStyle$7() { + try { + return (await Promise.resolve().then(function () { return github$3; })).default; + } catch { + return fetchAsset("github.css"); + } +} + +function getLanguageHint(classList) { + return Array.from(classList) + .filter(item => item !== "highlight" && item !== "nolinks") + .map(item => item.toLowerCase()); +} + +async function highlightElement(elem) { + elem.setAttribute("aria-busy", "true"); + const languages = getLanguageHint(elem.classList); + let response; + try { + response = await sendHighlightRequest(elem.innerText, languages); + } catch (err) { + console.error(err); + return; + } + const { language, value } = response; + switch (elem.localName) { + case "pre": + elem.classList.remove(language); + elem.innerHTML = `<code class="hljs${ + language ? ` ${language}` : "" + }">${value}</code>`; + if (!elem.classList.length) elem.removeAttribute("class"); + break; + case "code": + elem.innerHTML = value; + elem.classList.add("hljs"); + if (language) elem.classList.add(language); + break; + } + elem.setAttribute("aria-busy", "false"); +} + +async function sendHighlightRequest(code, languages) { + const msg = { + action: "highlight", + code, + id: nextMsgId(), + languages, + }; + const worker = await workerPromise; + worker.postMessage(msg); + return new Promise((resolve, reject) => { + const timeoutId = setTimeout(() => { + reject(new Error("Timed out waiting for highlight.")); + }, 4000); + worker.addEventListener("message", function listener(ev) { + const { + data: { id, language, value }, + } = ev; + if (id !== msg.id) return; // not for us! + worker.removeEventListener("message", listener); + clearTimeout(timeoutId); + resolve({ language, value }); + }); + }); +} + +async function run$D(conf) { + // Nothing to highlight + if (conf.noHighlightCSS) return; + const highlightables = [ + ...document.querySelectorAll(` + pre:not(.idl):not(.nohighlight) > code:not(.nohighlight), + pre:not(.idl):not(.nohighlight), + code.highlight + `), + ].filter( + // Filter pre's that contain code + elem => elem.localName !== "pre" || !elem.querySelector("code") + ); + // Nothing to highlight + if (!highlightables.length) { + return; + } + const promisesToHighlight = highlightables + .filter(elem => elem.textContent.trim()) + .map(highlightElement); + const ghCss = await ghCssPromise; + document.head.appendChild( + hyperHTML` <style> - ${r} + ${ghCss} </style> - `),await Promise.all(n)}var highlight=Object.freeze({__proto__:null,name:name$P,run:run$D});const name$Q="core/webidl-clipboard",copyButtonPromise=createButton();async function loadSVG(){try{return(await Promise.resolve().then((function(){return clipboard$1}))).default}catch{return fetchAsset("clipboard.svg")}}async function createButton(){const e=document.createElement("button");return e.innerHTML=await loadSVG(),e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}async function run$E(){const e=await copyButtonPromise;for(const t of document.querySelectorAll("pre.idl")){const n=e.cloneNode(!0);n.addEventListener("click",()=>{clipboardWriteText(t.textContent)}),t.prepend(n)}}function clipboardWriteText(e){return navigator.clipboard?navigator.clipboard.writeText(e):new Promise(t=>{document.addEventListener("copy",n=>{n.clipboardData.setData("text/plain",e),t()},{once:!0}),document.execCommand("copy")})}var webidlClipboard=Object.freeze({__proto__:null,name:name$Q,run:run$E});const l10n$c={en:{missing_test_suite_uri:"Found tests in your spec, but missing '[`testSuiteURI`](https://github.com/w3c/respec/wiki/testSuiteURI)' in your ReSpec config.",tests:"tests",test:"test"}},name$R="core/data-tests",lang$j=lang in l10n$c?lang:"en";function toListItem(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[o]=r;if(r.find(e=>"https"===e)){const e=document.createElement("span");e.textContent="🔒",e.setAttribute("aria-label","requires a secure connection"),e.setAttribute("title","Test requires HTTPS"),o=o.replace(".https",""),t.push(e)}if(o.split(".").join("-").split("-").find(e=>"manual"===e)){const e=document.createElement("span");e.textContent="💪",e.setAttribute("aria-label","the test must be run manually"),e.setAttribute("title","Manual test"),o=o.replace("-manual",""),t.push(e)}return hyperHTML$1.bind(document.createElement("li"))` - <a href="${e}"> - ${o} - </a> ${t} - `}function run$F(e){const t=[...document.querySelectorAll("[data-tests]")].filter(e=>e.dataset.tests);if(t.length)if(e.testSuiteURI)for(const n of t){const t=toTestURLs(n.dataset.tests.split(/,/gm).map(e=>e.trim()),e.testSuiteURI);handleDuplicates(t,n);const r=toHTML$1(t);n.append(r),delete n.dataset.tests}else pub("error",l10n$c[lang$j].missing_test_suite_uri)}function toTestURLs(e,t){return e.map(e=>{try{return new URL(e,t).href}catch{pub("warn",`${l10n$c[lang$j].bad_uri}: ${e}`)}}).filter(e=>e)}function handleDuplicates(e,t){const n=e.filter((e,t,n)=>n.indexOf(e)!==t);n.length&&showInlineWarning(t,"Duplicate tests found",`To fix, remove duplicates from "data-tests": ${n.map(e=>new URL(e).pathname).join(", ")}`)}function toHTML$1(e){const t=document.createElement("details"),n=hyperHTML$1.bind(t);t.classList.add("respec-tests-details","removeOnSave");const r=[...new Set(e)];return n` - <summary> - tests: ${r.length} - </summary> - <ul>${r.map(toListItem)}</ul> - `,t}var dataTests=Object.freeze({__proto__:null,name:name$R,run:run$F});const name$S="core/list-sorter";function makeSorter(e){return({textContent:t},{textContent:n})=>"ascending"===e?t.localeCompare(n):n.localeCompare(t)}function sortListItems(e,t){return[...children(e,"li")].sort(makeSorter(t)).reduce((e,t)=>(e.appendChild(t),e),document.createDocumentFragment())}function sortDefinitionTerms(e,t){return[...children(e,"dt")].sort(makeSorter(t)).reduce((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:i}=t;for(;i&&i.nextSibling;){o.appendChild(i.cloneNode(!0));const{nodeType:e,nodeName:t}=i.nextSibling;if(e===n&&t===r)break;i=i.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e},document.createDocumentFragment())}function run$G(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=sortDefinitionTerms(t,n);break;case"ol":case"ul":e=sortListItems(t,n);break;default:pub("warning",`ReSpec can't sort ${t.localName} elements.`)}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}}var listSorter=Object.freeze({__proto__:null,name:name$S,sortListItems:sortListItems,sortDefinitionTerms:sortDefinitionTerms,run:run$G});const name$T="core/highlight-vars",hlVarsPromise=loadStyle$8();async function loadStyle$8(){try{return(await Promise.resolve().then((function(){return _var$1}))).default}catch{return fetchAsset("var.css")}}async function run$H(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=await hlVarsPromise,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach(e=>e.addEventListener("click",highlightListener)),sub("beforesave",e=>{e.querySelectorAll("var.respec-hl").forEach(removeHighlight)})}function highlightListener(e){e.stopPropagation();const{target:t}=e,n=highlightVars(t),r=()=>{const e=getHighlightColor(t);n.forEach(t=>removeHighlight(t,e)),[...HL_COLORS.keys()].forEach(e=>HL_COLORS.set(e,!0))};n.length&&document.body.addEventListener("click",r,{once:!0})}const HL_COLORS=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function getHighlightColor(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===HL_COLORS.get("respec-hl-c1")?"respec-hl-c1":[...HL_COLORS.keys()].find(e=>HL_COLORS.get(e))||"respec-hl-c1"}function highlightVars(e){const t=e.textContent.trim(),n=e.closest("section"),r=getHighlightColor(e),o=[...n.querySelectorAll("var")].filter(e=>e.textContent.trim()===t&&e.closest("section")===n),i=o[0].classList.contains("respec-hl");return HL_COLORS.set(r,i),i?(o.forEach(e=>removeHighlight(e,r)),[]):(o.forEach(e=>addHighlight(e,r)),o)}function removeHighlight(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}function addHighlight(e,t){e.classList.add("respec-hl",t)}var highlightVars$1=Object.freeze({__proto__:null,name:name$T,run:run$H});const name$U="core/data-type",tooltipStylePromise=loadStyle$9();async function loadStyle$9(){try{return(await Promise.resolve().then((function(){return datatype$1}))).default}catch{return fetchAsset("datatype.css")}}async function run$I(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=await tooltipStylePromise,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}var dataType=Object.freeze({__proto__:null,name:name$U,run:run$I});const name$V="core/algorithms",cssPromise$3=loadStyle$a();async function loadStyle$a(){try{return(await Promise.resolve().then((function(){return algorithms$2}))).default}catch{return fetchAsset("algorithms.css")}}async function run$J(){if(Array.from(document.querySelectorAll("ol.algorithm li")).filter(e=>e.textContent.trim().startsWith("Assert: ")).forEach(e=>e.classList.add("assert")),document.querySelector(".assert")){const e=document.createElement("style");e.textContent=await cssPromise$3,document.head.appendChild(e)}}var algorithms=Object.freeze({__proto__:null,name:name$V,run:run$J});const name$W="core/anchor-expander";function run$K(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter(e=>""===e.textContent.trim());for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":processHeading(n,t);break;case"section":processSection(n,e,t);break;case"figure":processFigure(n,e,t);break;case"aside":case"div":processBox(n,e,t);break;default:t.textContent=t.getAttribute("href"),showInlineError(t,"ReSpec doesn't support expanding this kind of reference.",`Can't expand "#${e}".`)}localize(n,t),t.normalize()}else{t.textContent=t.getAttribute("href"),showInlineError(t,`Couldn't expand inline reference. The id "${e}" is not in the document.`,`No matching id in document: ${e}.`)}}}function processBox(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){return n.textContent=n.getAttribute("href"),void showInlineError(n,`Found matching element "${t}", but it has no title or marker.`,"Missing title.")}const o=makeSafeCopy(r);n.append(...o.childNodes),n.classList.add("box-ref")}function processFigure(e,t,n){const r=e.querySelector("figcaption");if(!r){return n.textContent=n.getAttribute("href"),void showInlineError(n,`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,"Missing figcaption in referenced figure.")}const o=[...makeSafeCopy(r).childNodes].filter(e=>!e.classList||!e.classList.contains("fig-title"));o.pop(),n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=norm(i.textContent))}function processSection(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(!r){return n.textContent=n.getAttribute("href"),void showInlineError(n,"Found matching section, but the section was lacking a heading element.",`No matching id in document: "${t}".`)}processHeading(r,n),localize(r,n)}function processHeading(e,t){const n=e.querySelector(".self-link"),r=[...makeSafeCopy(e).childNodes].filter(e=>!e.classList||!e.classList.contains("self-link"));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref")}function localize(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var anchorExpander=Object.freeze({__proto__:null,name:name$W,run:run$K});const name$X="rs-changelog",element=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;hyperHTML$1.bind(this)` + ` + ); + await Promise.all(promisesToHighlight); +} + +var highlight = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$P, + run: run$D +}); + +// @ts-check +const name$Q = "core/webidl-clipboard"; + +const copyButtonPromise = createButton(); + +async function loadSVG() { + try { + return (await Promise.resolve().then(function () { return clipboard$1; })).default; + } catch { + return fetchAsset("clipboard.svg"); + } +} + +async function createButton() { + const copyButton = document.createElement("button"); + copyButton.innerHTML = await loadSVG(); + copyButton.title = "Copy IDL to clipboard"; + copyButton.classList.add("respec-button-copy-paste", "removeOnSave"); + return copyButton; +} + +async function run$E() { + // This button serves a prototype that we clone as needed. + const copyButton = await copyButtonPromise; + for (const pre of document.querySelectorAll("pre.idl")) { + const button = copyButton.cloneNode(true); + button.addEventListener("click", () => { + clipboardWriteText(pre.textContent); + }); + pre.prepend(button); + } +} + +/** + * Mocks navigator.clipboard.writeText() + * @param {string} text + */ +function clipboardWriteText(text) { + if (navigator.clipboard) { + return navigator.clipboard.writeText(text); + } + return new Promise(resolve => { + document.addEventListener( + "copy", + ev => { + ev.clipboardData.setData("text/plain", text); + resolve(); + }, + { once: true } + ); + document.execCommand("copy"); + }); +} + +var webidlClipboard = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$Q, + run: run$E +}); + +// @ts-check +const l10n$c = { + en: { + missing_test_suite_uri: + "Found tests in your spec, but missing '" + + "[`testSuiteURI`](https://github.com/w3c/respec/wiki/testSuiteURI)' in your ReSpec config.", + tests: "tests", + test: "test", + }, +}; + +const name$R = "core/data-tests"; + +const lang$j = lang in l10n$c ? lang : "en"; + +function toListItem(href) { + const emojiList = []; + const [testFile] = new URL(href).pathname.split("/").reverse(); + const testParts = testFile.split("."); + let [testFileName] = testParts; + + const isSecureTest = testParts.find(part => part === "https"); + if (isSecureTest) { + const requiresConnectionEmoji = document.createElement("span"); + requiresConnectionEmoji.textContent = "🔒"; + requiresConnectionEmoji.setAttribute( + "aria-label", + "requires a secure connection" + ); + requiresConnectionEmoji.setAttribute("title", "Test requires HTTPS"); + testFileName = testFileName.replace(".https", ""); + emojiList.push(requiresConnectionEmoji); + } + + const isManualTest = testFileName + .split(".") + .join("-") + .split("-") + .find(part => part === "manual"); + if (isManualTest) { + const manualPerformEmoji = document.createElement("span"); + manualPerformEmoji.textContent = "💪"; + manualPerformEmoji.setAttribute( + "aria-label", + "the test must be run manually" + ); + manualPerformEmoji.setAttribute("title", "Manual test"); + testFileName = testFileName.replace("-manual", ""); + emojiList.push(manualPerformEmoji); + } + + const testList = hyperHTML` + <li> + <a href="${href}"> + ${testFileName} + </a> ${emojiList} + </li> + `; + return testList; +} + +function run$F(conf) { + /** @type {NodeListOf<HTMLElement>} */ + const elems = document.querySelectorAll("[data-tests]"); + const testables = [...elems].filter(elem => elem.dataset.tests); + + if (!testables.length) { + return; + } + if (!conf.testSuiteURI) { + pub("error", l10n$c[lang$j].missing_test_suite_uri); + return; + } + + for (const elem of testables) { + const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim()); + const testURLs = toTestURLs(tests, conf.testSuiteURI); + handleDuplicates(testURLs, elem); + const details = toHTML$1(testURLs); + elem.append(details); + delete elem.dataset.tests; + } +} + +/** + * @param {string[]} tests + * @param {string} testSuiteURI + */ +function toTestURLs(tests, testSuiteURI) { + return tests + .map(test => { + try { + return new URL(test, testSuiteURI).href; + } catch { + pub("warn", `${l10n$c[lang$j].bad_uri}: ${test}`); + } + }) + .filter(href => href); +} + +/** + * @param {string[]} testURLs + * @param {HTMLElement} elem + */ +function handleDuplicates(testURLs, elem) { + const duplicates = testURLs.filter( + (link, i, self) => self.indexOf(link) !== i + ); + if (duplicates.length) { + showInlineWarning( + elem, + `Duplicate tests found`, + `To fix, remove duplicates from "data-tests": ${duplicates + .map(url => new URL(url).pathname) + .join(", ")}` + ); + } +} + +/** + * @param {string[]} testURLs + */ +function toHTML$1(testURLs) { + const uniqueList = [...new Set(testURLs)]; + const details = hyperHTML` + <details class="respec-tests-details removeOnSave"> + <summary> + tests: ${uniqueList.length} + </summary> + <ul>${uniqueList.map(toListItem)}</ul> + </details> + `; + return details; +} + +var dataTests = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$R, + run: run$F +}); + +// @ts-check +const name$S = "core/list-sorter"; + +function makeSorter(direction) { + return ({ textContent: a }, { textContent: b }) => { + return direction === "ascending" ? a.localeCompare(b) : b.localeCompare(a); + }; +} +/** + * Shallow sort list items in OL, and UL elements. + * + * @param {HTMLUListElement} elem + * @returns {DocumentFragment} + */ +function sortListItems(elem, dir) { + const elements = [...children(elem, "li")]; + const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => { + frag.appendChild(elem); + return frag; + }, document.createDocumentFragment()); + return sortedElements; +} + +/** + * Shallow sort a definition list based on its definition terms (dt) elements. + * + * @param {HTMLDListElement} dl + * @returns {DocumentFragment} + */ +function sortDefinitionTerms(dl, dir) { + const elements = [...children(dl, "dt")]; + const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => { + const { nodeType, nodeName } = elem; + const children = document.createDocumentFragment(); + let { nextSibling: next } = elem; + while (next) { + if (!next.nextSibling) { + break; + } + children.appendChild(next.cloneNode(true)); + const { nodeType: nextType, nodeName: nextName } = next.nextSibling; + const isSameType = nextType === nodeType && nextName === nodeName; + if (isSameType) { + break; + } + next = next.nextSibling; + } + children.prepend(elem.cloneNode(true)); + frag.appendChild(children); + return frag; + }, document.createDocumentFragment()); + return sortedElements; +} + +function run$G() { + /** @type {NodeListOf<HTMLElement>} */ + const sortables = document.querySelectorAll("[data-sort]"); + for (const elem of sortables) { + let sortedElems; + const dir = elem.dataset.sort || "ascending"; + switch (elem.localName) { + case "dl": { + const definition = /** @type {HTMLDListElement} */ (elem); + sortedElems = sortDefinitionTerms(definition, dir); + break; + } + case "ol": + case "ul": { + const list = /** @type {HTMLUListElement} */ (elem); + sortedElems = sortListItems(list, dir); + break; + } + default: + pub("warning", `ReSpec can't sort ${elem.localName} elements.`); + } + if (sortedElems) { + const range = document.createRange(); + range.selectNodeContents(elem); + range.deleteContents(); + elem.appendChild(sortedElems); + } + } +} + +var listSorter = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$S, + sortListItems: sortListItems, + sortDefinitionTerms: sortDefinitionTerms, + run: run$G +}); + +// @ts-check + +const name$T = "core/highlight-vars"; + +const hlVarsPromise = loadStyle$8(); + +async function loadStyle$8() { + try { + return (await Promise.resolve().then(function () { return _var$1; })).default; + } catch { + return fetchAsset("var.css"); + } +} + +async function run$H(conf) { + if (!conf.highlightVars) { + return; + } + const styleElement = document.createElement("style"); + styleElement.textContent = await hlVarsPromise; + styleElement.classList.add("removeOnSave"); + document.head.appendChild(styleElement); + + document + .querySelectorAll("var") + .forEach(varElem => varElem.addEventListener("click", highlightListener)); + + // remove highlights, cleanup empty class/style attributes + sub("beforesave", outputDoc => { + outputDoc.querySelectorAll("var.respec-hl").forEach(removeHighlight); + }); +} + +function highlightListener(ev) { + ev.stopPropagation(); + const { target: varElem } = ev; + const hightligtedElems = highlightVars(varElem); + const resetListener = () => { + const hlColor = getHighlightColor(varElem); + hightligtedElems.forEach(el => removeHighlight(el, hlColor)); + [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true)); + }; + if (hightligtedElems.length) { + document.body.addEventListener("click", resetListener, { once: true }); + } +} + +// availability of highlight colors. colors from var.css +const HL_COLORS = new Map([ + ["respec-hl-c1", true], + ["respec-hl-c2", true], + ["respec-hl-c3", true], + ["respec-hl-c4", true], + ["respec-hl-c5", true], + ["respec-hl-c6", true], + ["respec-hl-c7", true], +]); + +function getHighlightColor(target) { + // return current colors if applicable + const { value } = target.classList; + const re = /respec-hl-\w+/; + const activeClass = re.test(value) && value.match(re); + if (activeClass) return activeClass[0]; + + // first color preference + if (HL_COLORS.get("respec-hl-c1") === true) return "respec-hl-c1"; + + // otherwise get some other available color + return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || "respec-hl-c1"; +} + +function highlightVars(varElem) { + const textContent = varElem.textContent.trim(); + const parent = varElem.closest("section"); + const highlightColor = getHighlightColor(varElem); + + const varsToHighlight = [...parent.querySelectorAll("var")].filter( + el => + el.textContent.trim() === textContent && el.closest("section") === parent + ); + + // update availability of highlight color + const colorStatus = varsToHighlight[0].classList.contains("respec-hl"); + HL_COLORS.set(highlightColor, colorStatus); + + // highlight vars + if (colorStatus) { + varsToHighlight.forEach(el => removeHighlight(el, highlightColor)); + return []; + } else { + varsToHighlight.forEach(el => addHighlight(el, highlightColor)); + } + return varsToHighlight; +} + +function removeHighlight(el, highlightColor) { + el.classList.remove("respec-hl", highlightColor); + // clean up empty class attributes so they don't come in export + if (!el.classList.length) el.removeAttribute("class"); +} + +function addHighlight(elem, highlightColor) { + elem.classList.add("respec-hl", highlightColor); +} + +var highlightVars$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$T, + run: run$H +}); + +// @ts-check + +const name$U = "core/data-type"; + +const tooltipStylePromise = loadStyle$9(); + +async function loadStyle$9() { + try { + return (await Promise.resolve().then(function () { return datatype$1; })).default; + } catch { + return fetchAsset("datatype.css"); + } +} + +async function run$I(conf) { + if (!conf.highlightVars) { + return; + } + + const style = document.createElement("style"); + style.textContent = await tooltipStylePromise; + document.head.appendChild(style); + + let section = null; + const varMap = new Map(); + /** @type {NodeListOf<HTMLElement>} */ + const variables = document.querySelectorAll("section var"); + for (const varElem of variables) { + const currentSection = varElem.closest("section"); + if (section !== currentSection) { + section = currentSection; + varMap.clear(); + } + if (varElem.dataset.type) { + varMap.set(varElem.textContent.trim(), varElem.dataset.type); + continue; + } + const type = varMap.get(varElem.textContent.trim()); + if (type) varElem.dataset.type = type; + } +} + +var dataType = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$U, + run: run$I +}); + +// @ts-check + +const name$V = "core/algorithms"; + +const cssPromise$3 = loadStyle$a(); + +async function loadStyle$a() { + try { + return (await Promise.resolve().then(function () { return algorithms$2; })).default; + } catch { + return fetchAsset("algorithms.css"); + } +} + +async function run$J() { + const elements = Array.from(document.querySelectorAll("ol.algorithm li")); + elements + .filter(li => li.textContent.trim().startsWith("Assert: ")) + .forEach(li => li.classList.add("assert")); + if (document.querySelector(".assert")) { + const style = document.createElement("style"); + style.textContent = await cssPromise$3; + document.head.appendChild(style); + } +} + +var algorithms = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$V, + run: run$J +}); + +// @ts-check + +const name$W = "core/anchor-expander"; + +function run$K() { + /** @type {NodeListOf<HTMLElement>} */ + const anchorElements = document.querySelectorAll( + "a[href^='#']:not(.self-link):not([href$='the-empty-string'])" + ); + const anchors = [...anchorElements].filter(a => a.textContent.trim() === ""); + for (const a of anchors) { + const id = a.getAttribute("href").slice(1); + const matchingElement = document.getElementById(id); + if (!matchingElement) { + a.textContent = a.getAttribute("href"); + const msg = `Couldn't expand inline reference. The id "${id}" is not in the document.`; + showInlineError(a, msg, `No matching id in document: ${id}.`); + continue; + } + switch (matchingElement.localName) { + case "h6": + case "h5": + case "h4": + case "h3": + case "h2": { + processHeading(matchingElement, a); + break; + } + case "section": { + // find first heading in the section + processSection(matchingElement, id, a); + break; + } + case "figure": { + processFigure(matchingElement, id, a); + break; + } + case "aside": + case "div": { + processBox(matchingElement, id, a); + break; + } + default: { + a.textContent = a.getAttribute("href"); + const msg = "ReSpec doesn't support expanding this kind of reference."; + showInlineError(a, msg, `Can't expand "#${id}".`); + } + } + localize(matchingElement, a); + a.normalize(); + } +} + +function processBox(matchingElement, id, a) { + const selfLink = matchingElement.querySelector(".marker .self-link"); + if (!selfLink) { + a.textContent = a.getAttribute("href"); + const msg = `Found matching element "${id}", but it has no title or marker.`; + showInlineError(a, msg, "Missing title."); + return; + } + const copy = makeSafeCopy(selfLink); + a.append(...copy.childNodes); + a.classList.add("box-ref"); +} + +function processFigure(matchingElement, id, a) { + const figcaption = matchingElement.querySelector("figcaption"); + if (!figcaption) { + a.textContent = a.getAttribute("href"); + const msg = `Found matching figure "${id}", but figure is lacking a \`<figcaption>\`.`; + showInlineError(a, msg, "Missing figcaption in referenced figure."); + return; + } + // remove the figure's title + const children = [...makeSafeCopy(figcaption).childNodes].filter( + node => !node.classList || !node.classList.contains("fig-title") + ); + // drop an empty space at the end. + children.pop(); + a.append(...children); + a.classList.add("fig-ref"); + const figTitle = figcaption.querySelector(".fig-title"); + if (!a.hasAttribute("title") && figTitle) { + a.title = norm(figTitle.textContent); + } +} + +function processSection(matchingElement, id, a) { + const heading = matchingElement.querySelector("h6, h5, h4, h3, h2"); + if (!heading) { + a.textContent = a.getAttribute("href"); + const msg = + "Found matching section, but the section was lacking a heading element."; + showInlineError(a, msg, `No matching id in document: "${id}".`); + return; + } + processHeading(heading, a); + localize(heading, a); +} + +function processHeading(heading, a) { + const hadSelfLink = heading.querySelector(".self-link"); + const children = [...makeSafeCopy(heading).childNodes].filter( + node => !node.classList || !node.classList.contains("self-link") + ); + a.append(...children); + if (hadSelfLink) a.prepend("§\u00A0"); + a.classList.add("sec-ref"); +} + +function localize(matchingElement, newElement) { + for (const attrName of ["dir", "lang"]) { + // Already set on element, don't override. + if (newElement.hasAttribute(attrName)) continue; + + // Closest in tree setting the attribute + const matchingClosest = matchingElement.closest(`[${attrName}]`); + if (!matchingClosest) continue; + + // Closest to reference setting the attribute + const newClosest = newElement.closest(`[${attrName}]`); + + // It's the same, so already inherited from closest (probably HTML element or body). + if ( + newClosest && + newClosest.getAttribute(attrName) === + matchingClosest.getAttribute(attrName) + ) + continue; + // Otherwise, set it. + newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName)); + } +} + +var anchorExpander = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$W, + run: run$K +}); + +// @ts-check + +const name$X = "rs-changelog"; + +const element = class ChangelogElement extends HTMLElement { + constructor() { + super(); + this.props = { + from: this.getAttribute("from"), + to: this.getAttribute("to") || "HEAD", + /** @type {(commit: Commit) => boolean} */ + filter: + typeof window[this.getAttribute("filter")] === "function" + ? window[this.getAttribute("filter")] + : () => true, + }; + } + + connectedCallback() { + const { from, to, filter } = this.props; + hyperHTML.bind(this)` <ul> - ${{any:fetchCommits(e,t,n).then(e=>toHTML$2(e)).catch(e=>showInlineError(this,e.message,e.message)).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}} + ${{ + any: fetchCommits(from, to, filter) + .then(commits => toHTML$2(commits)) + .catch(error => showInlineError(this, error.message, error.message)) + .finally(() => { + this.dispatchEvent(new CustomEvent("done")); + }), + placeholder: "Loading list of commits...", + }} </ul> - `}};async function fetchCommits(e,t,n){let r;try{const o=await github;if(!o)throw new Error("`respecConfig.github` is not set");const{api:i}=o,a=new URL("commits",i);a.searchParams.set("from",e),a.searchParams.set("to",t);const s=await fetch(a.href);if(!s.ok)throw new Error(`Request to ${a} failed with status code ${s.status}`);if(!(r=await s.json()).length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw console.error(e),new Error(t)}return r}async function toHTML$2(e){const{repoURL:t}=await github;return e.map(e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,i=r&&hyperHTML$1` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return hyperHTML$1`<li><a href="${o}">${n.trim()}</a>${i}</li>`})}var changelog=Object.freeze({__proto__:null,name:name$X,element:element});const CUSTOM_ELEMENTS=[changelog],name$Y="core/custom-elements";async function run$L(){CUSTOM_ELEMENTS.forEach(e=>{customElements.define(e.name,e.element)});const e=CUSTOM_ELEMENTS.map(e=>e.name).join(", "),t=[...document.querySelectorAll(e)].map(e=>new Promise(t=>e.addEventListener("done",t,{once:!0})));await Promise.all(t)}var index=Object.freeze({__proto__:null,name:name$Y,run:run$L}),ui$2='#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n#respec-pill,\n.respec-info-button {\n background: #fff;\n height: 2.5em;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill:disabled {\n font-size: 2.8px;\n text-indent: -9999em;\n border-top: 1.1em solid rgba(40, 40, 40, 0.2);\n border-right: 1.1em solid rgba(40, 40, 40, 0.2);\n border-bottom: 1.1em solid rgba(40, 40, 40, 0.2);\n border-left: 1.1em solid #ffffff;\n transform: translateZ(0);\n animation: respec-spin 0.5s infinite linear;\n box-shadow: none;\n}\n\n#respec-pill:disabled,\n#respec-pill:disabled:after {\n border-radius: 50%;\n width: 10em;\n height: 10em;\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n list-style: none;\n font-family: sans-serif;\n background-color: rgb(255, 251, 230);\n font-size: 0.85em;\n}\n\n.respec-warning-list > li,\n.respec-error-list > li {\n padding: 0.4em 0.7em;\n}\n\n.respec-warning-list > li::before {\n content: "⚠️";\n padding-right: 0.5em;\n}\n.respec-warning-list p,\n.respec-error-list p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-error-list li::before {\n content: "💥";\n padding-right: 0.5em;\n}\n\n.respec-error-list li {\n padding: 0.4em 0.7em;\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n.respec-error-list li > p {\n margin: 0;\n padding: 0;\n display: inline-block;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n margin: auto;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n width: 79%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n}\n\n@media screen and (min-width: 78em) {\n .respec-modal {\n width: 62%;\n }\n}\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n.respec-modal .inside div p {\n padding-left: 1cm;\n}\n\n#respec-menu button.respec-option {\n background: white;\n padding: 0 0.2cm;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover,\n#respec-menu button:focus {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n#specref-ui {\n margin: 0 2%;\n margin-bottom: 0.5cm;\n}\n\n#specref-ui header {\n font-size: 0.7em;\n background-color: #eee;\n text-align: center;\n padding: 0.2cm;\n margin-bottom: 0.5cm;\n border-radius: 0 0 0.2cm 0.2cm;\n}\n\n#specref-ui header h1 {\n padding: 0;\n margin: 0;\n color: black;\n}\n\n#specref-ui p {\n padding: 0;\n margin: 0;\n font-size: 0.8em;\n text-align: center;\n}\n\n#specref-ui p.state {\n margin: 1cm;\n}\n\n#specref-ui .searchcomponent {\n font-size: 16px;\n display: grid;\n grid-template-columns: auto 2cm;\n}\n#specref-ui .searchcomponent:focus {\n}\n\n#specref-ui input,\n#specref-ui button {\n border: 0;\n padding: 6px 12px;\n}\n\n#specref-ui label {\n font-size: 0.6em;\n grid-column-end: 3;\n text-align: right;\n grid-column-start: 1;\n}\n\n#specref-ui input[type="search"] {\n -webkit-appearance: none;\n font-size: 16px;\n border-radius: 0.1cm 0 0 0.1cm;\n border: 1px solid rgb(204, 204, 204);\n}\n\n#specref-ui button[type="submit"] {\n color: white;\n border-radius: 0 0.1cm 0.1cm 0;\n background-color: rgb(51, 122, 183);\n}\n\n#specref-ui button[type="submit"]:hover {\n background-color: #286090;\n border-color: #204d74;\n}\n\n#specref-ui .result-stats {\n margin: 0;\n padding: 0;\n color: rgb(128, 128, 128);\n font-size: 0.7em;\n font-weight: bold;\n}\n\n#specref-ui .specref-results {\n font-size: 0.8em;\n}\n\n#specref-ui .specref-results dd + dt {\n margin-top: 0.51cm;\n}\n\n#specref-ui .specref-results a {\n text-transform: capitalize;\n}\n#specref-ui .specref-results .authors {\n display: block;\n color: #006621;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n#xref-ui {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n#xref-ui:not(.ready) {\n background: url("https://respec.org/xref/loader.gif") no-repeat center;\n}\n',ui$3=Object.freeze({__proto__:null,default:ui$2}),respec2='/*****************************************************************\n * ReSpec 3 CSS\n * Robin Berjon - http://berjon.com/\n *****************************************************************/\n\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* Override code highlighter background */\n.hljs {\n background: transparent !important;\n}\n\n/* --- INLINES --- */\nh1 abbr,\nh2 abbr,\nh3 abbr,\nh4 abbr,\nh5 abbr,\nh6 abbr,\na abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\ncode {\n color: #c83500;\n}\n\nth code {\n color: inherit;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope="row"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul,\n.respec-dfn-list {\n column-count: 2;\n}\n\n#issue-summary li,\n.respec-dfn-list li {\n list-style: none;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\na[href].self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\nh2,\nh3,\nh4,\nh5,\nh6 {\n position: relative;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\nh2 > a.self-link,\nh3 > a.self-link,\nh4 > a.self-link,\nh5 > a.self-link,\nh6 > a.self-link {\n border: none;\n color: inherit;\n font-size: 83%;\n height: 2em;\n left: -1.6em;\n opacity: 0.5;\n position: absolute;\n text-align: center;\n text-decoration: none;\n top: 0;\n transition: opacity 0.2s;\n width: 2em;\n}\n\nh2 > a.self-link::before,\nh3 > a.self-link::before,\nh4 > a.self-link::before,\nh5 > a.self-link::before,\nh6 > a.self-link::before {\n content: "§";\n display: block;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n\n /* Don\'t position self-link in headings off-screen */\n h2 > a.self-link,\n h3 > a.self-link,\n h4 > a.self-link,\n h5 > a.self-link,\n h6 > a.self-link {\n left: auto;\n top: auto;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n',respec2$1=Object.freeze({__proto__:null,default:respec2}),examples$1="/* --- EXAMPLES --- */\nspan.example-title {\n text-transform: none;\n}\naside.example, div.example, div.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\ndiv.illegal-example { color: red }\ndiv.illegal-example p { color: black }\naside.example, div.example {\n padding: .5em;\n border-left-width: .5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: .1em;\n border-color: #999;\n background: #fff;\n}\naside.example div.example span.example-title {\n color: #999;\n}\n",examples$2=Object.freeze({__proto__:null,default:examples$1}),issuesNotes$1='/* --- ISSUES/NOTES --- */\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child { margin-top: 0 }\n.warning {\n padding: .5em;\n border-left-width: .5em;\n border-left-style: solid;\n}\nspan.warning { padding: .1em .5em .15em; }\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.warning {\n border-color: #f11;\n border-width: .2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before{\n content: "⚠"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: .3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n}\n\n.issue a.respec-label-dark {\n color: #fff;\n background-color: #000;\n}\n\n.issue a.respec-label-light {\n color: #000;\n background-color: #fff;\n}\n',issuesNotes$2=Object.freeze({__proto__:null,default:issuesNotes$1}),webidl$1='/* --- WEB IDL --- */\n\npre.idl {\n padding: 1em;\n position: relative;\n}\n\n@media print {\n pre.idl {\n white-space: pre-wrap;\n }\n}\n\npre.idl::before {\n content: "WebIDL";\n display: block;\n width: 150px;\n background: #90b8de;\n color: #fff;\n font-family: sans-serif;\n font-weight: bold;\n margin: -1em 0 1em -1em;\n height: 28px;\n line-height: 28px; \n}\n\n.idlID {\n font-weight: bold;\n color: #005a9c;\n}\n\n.idlType {\n color: #005a9c;\n}\n\n.idlName {\n color: #ff4500;\n}\n\n.idlName a {\n color: #ff4500;\n border-bottom: 1px dotted #ff4500;\n text-decoration: none;\n}\n\na.idlEnumItem {\n color: #000;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\n.idlSuperclass {\n font-style: italic;\n color: #005a9c;\n}\n\n\n/*.idlParam*/\n\n.idlParamName,\n.idlDefaultValue {\n font-style: italic;\n}\n\n.extAttr {\n color: #666;\n}\n\n\n/*.idlSectionComment*/\n\n.idlSectionComment {\n color: gray;\n}\n\n.idlIncludes a {\n font-weight: bold;\n}\n\n.respec-button-copy-paste:focus {\n text-decoration: none;\n border-color: #51a7e8;\n outline: none;\n box-shadow: 0 0 5px rgba(81, 167, 232, 0.5);\n}\n\n.respec-button-copy-paste:focus:hover,\n.respec-button-copy-paste.selected:focus {\n border-color: #51a7e8;\n}\n\n.respec-button-copy-paste:hover,\n.respec-button-copy-paste:active,\n.respec-button-copy-paste.zeroclipboard-is-hover,\n.respec-button-copy-paste.zeroclipboard-is-active {\n text-decoration: none;\n background-color: #ddd;\n background-image: linear-gradient(#eee, #ddd);\n border-color: #ccc;\n}\n\n.respec-button-copy-paste:active,\n.respec-button-copy-paste.selected,\n.respec-button-copy-paste.zeroclipboard-is-active {\n background-color: #dcdcdc;\n background-image: none;\n border-color: #b5b5b5;\n box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15)\n}\n\n.respec-button-copy-paste.selected:hover {\n background-color: #cfcfcf;\n}\n\n.respec-button-copy-paste:disabled,\n.respec-button-copy-paste:disabled:hover,\n.respec-button-copy-paste.disabled,\n.respec-button-copy-paste.disabled:hover {\n color: rgba(102, 102, 102, 0.5);\n cursor: default;\n background-color: rgba(229, 229, 229, 0.5);\n background-image: none;\n border-color: rgba(197, 197, 197, 0.5);\n box-shadow: none;\n}\n\n@media print {\n .respec-button-copy-paste {\n visibility: hidden;\n }\n}\n',webidl$2=Object.freeze({__proto__:null,default:webidl$1}),caniuse$1='/* container for stats */\n.caniuse-stats {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: baseline;\n cursor: pointer;\n}\n\nbutton.caniuse-cell {\n margin: 1px 1px 0 0;\n border: none;\n}\n\n.caniuse-browser {\n position: relative;\n}\n\n/* handle case when printing */\n@media print {\n .caniuse-cell.y::before {\n content: "✔️";\n padding: 0.5em;\n }\n\n .caniuse-cell.n::before{\n content: "❌";\n padding: 0.5em;\n }\n\n .caniuse-cell.d::before,\n .caniuse-cell.a::before,\n .caniuse-cell.x::before,\n .caniuse-cell.p::before {\n content: "⚠️";\n padding: 0.5em;\n }\n}\n\n/* reset styles, hide old versions by default */\n.caniuse-browser ul {\n display: none;\n margin: 0;\n padding: 0;\n list-style: none;\n position: absolute;\n left: 0;\n z-index: 2;\n background: #fff;\n margin-top: 1px;\n}\n\n.caniuse-stats a {\n white-space: nowrap;\n align-self: center;\n margin-left: .5em;\n}\n\n/* a browser version */\n.caniuse-cell {\n display: flex;\n color: rgba(0, 0, 0, 0.8);\n font-size: 90%;\n height: 0.8cm;\n margin-right: 1px;\n margin-top: 0;\n min-width: 3cm;\n overflow: visible;\n justify-content: center;\n align-items: center;\n}\n\nli.caniuse-cell {\n margin-bottom: 1px;\n}\n\n.caniuse-cell:focus {\n outline: none;\n}\n\n.caniuse-cell:hover {\n color: rgba(0, 0, 0, 1);\n}\n\n/* supports */\n.caniuse-cell.y {\n background: #8bc34a;\n}\n\n/* no support */\n.caniuse-cell.n {\n background: #e53935;\n}\n\n/* not supported by default / partial support etc\nsee https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md for stats */\n.caniuse-cell.d,\n.caniuse-cell.a,\n.caniuse-cell.x,\n.caniuse-cell.p {\n background: #ffc107;\n}\n\n/* show rest of the browser versions */\n.caniuse-stats button:focus + ul,\n.caniuse-stats .caniuse-browser:hover > ul {\n display: block;\n}\n',caniuse$2=Object.freeze({__proto__:null,default:caniuse$1}),mdnAnnotation$1='.mdn {\n display: block;\n font: 12px sans-serif;\n position: absolute;\n z-index: 9;\n right: 0.3em;\n background-color: #eee;\n margin: -26px 0 0 0;\n padding: 7px 5px 5px 6px;\n min-width: 140px;\n box-shadow: 0 0 3px #999;\n}\n\n.mdn button {\n cursor: pointer;\n border: none;\n color: #000;\n background: transparent;\n margin: -8px;\n outline: none;\n}\n\n.mdn b {\n color: #fff;\n background-color: #000;\n font-weight: normal;\n font-family: zillaslab, Palatino, "Palatino Linotype", serif;\n padding: 2px 3px 0px 3px;\n line-height: 1.3em;\n vertical-align: top;\n}\n\n.mdn > div > div {\n display: inline-block;\n margin-left: 5px;\n}\n\n\n.nosupportdata {\n font-style: italic;\n margin-top: 4px;\n margin-left: 8px;\n padding-bottom: 8px;\n}\n\n.mdnsupport {\n display: table;\n margin-top: 4px;\n}\n\n.mdnsupport > span {\n display: table-row;\n padding: 0.2em 0;\n padding-top: 0.2em;\n font-size: 9.6px;\n}\n\n.mdnsupport > span > span {\n display: table-cell;\n padding: 0 0.5em;\n vertical-align: top;\n line-height: 1.5em;\n}\n\n.mdnsupport > span > span:last-child {\n text-align: right;\n padding: 0;\n}\n\n.mdnsupport > span.no {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdnsupport > span.unknown {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdnsupport > span.no::before {\n opacity: 0.5;\n}\n\n.mdnsupport > span.unknown::before {\n opacity: 0.5;\n}\n\n.mdnsupport > span::before {\n content: "";\n display: table-cell;\n min-width: 1.5em;\n height: 1.5em;\n background: no-repeat center center / contain;\n text-align: right;\n font-size: 0.75em;\n font-weight: bold;\n}\n\n.mdnsupport > .chrome::before,\n.mdnsupport > .chrome_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg);\n}\n\n.mdnsupport > .edge::before,\n.mdnsupport > .edge_mobile::before {\n background-image: url(https://resources.whatwg.org/browser-logos/edge.svg);\n}\n\n.mdnsupport > .firefox::before,\n.mdnsupport > .firefox_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/firefox.png);\n}\n\n.mdnsupport > .ie::before {\n background-image: url(https://resources.whatwg.org/browser-logos/ie.png);\n}\n\n.mdnsupport > .opera::before,\n.mdnsupport > .opera_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/opera.svg);\n}\n\n.mdnsupport > .safari::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari.png);\n}\n\n.mdnsupport > .safari_ios::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg);\n}\n\n.mdnsupport > .samsunginternet_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg);\n}\n\n.mdnsupport > .webview_android::before {\n background-image: url(https://cdnjs.loli.net/ajax/libs/browser-logos/41.0.0/android-webview-beta/android-webview-beta_32x32.png);\n}\n\n.mdn.wrapped div:nth-child(n + 3) {\n display: none;\n}\n\n.mdn div:nth-child(n + 3) > b {\n color: #eee;\n background-color: #eee;\n}\n\np + .mdn {\n margin-top: -45px;\n}\n\n.mdn.before {\n margin-top: 3em;\n}\n\nh2 + .mdn {\n margin: -48px 0 0 0;\n}\n\nh3 + .mdn {\n margin: -46px 0 0 0;\n}\n\nh4 + .mdn {\n margin: -42px 0 0 0;\n}\n\nh5 + .mdn {\n margin: -40px 0 0 0;\n}\n\nh6 + .mdn {\n margin: -40px 0 0 0;\n}\n\n.mdn div {\n margin: 0;\n}\n\n.mdn :link {\n color: #0000ee;\n}\n\n.mdn :visited {\n color: #551a8b;\n}\n\n.mdn :link:active,\n:visited:active {\n color: #ff0000;\n}\n\n.mdn :link,\n:visited {\n text-decoration: underline;\n cursor: pointer;\n}\n\n.mdn.wrapped {\n min-width: 0px;\n}\n\n.mdn.wrapped > div > div {\n display: none;\n}\n\n.mdn:hover {\n z-index: 11;\n}\n\n.mdn:focus-within {\n z-index: 11;\n}\n',mdnAnnotation$2=Object.freeze({__proto__:null,default:mdnAnnotation$1}),respecWorker='// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight.js");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n',respecWorker$1=Object.freeze({__proto__:null,default:respecWorker}),github$2="/*\n\ngithub.com style (c) Vasily Polovnyov <vast@whiteants.net>\n\n*/\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #333;\n background: #f8f8f8;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #998;\n font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-subst {\n color: #333;\n font-weight: bold;\n}\n\n.hljs-number,\n.hljs-literal,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag .hljs-attr {\n color: #008080;\n}\n\n.hljs-string,\n.hljs-doctag {\n color: #d14;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-selector-id {\n color: #900;\n font-weight: bold;\n}\n\n.hljs-subst {\n font-weight: normal;\n}\n\n.hljs-type,\n.hljs-class .hljs-title {\n color: #458;\n font-weight: bold;\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-attribute {\n color: #000080;\n font-weight: normal;\n}\n\n.hljs-regexp,\n.hljs-link {\n color: #009926;\n}\n\n.hljs-symbol,\n.hljs-bullet {\n color: #990073;\n}\n\n.hljs-built_in,\n.hljs-builtin-name {\n color: #0086b3;\n}\n\n.hljs-meta {\n color: #999;\n font-weight: bold;\n}\n\n.hljs-deletion {\n background: #fdd;\n}\n\n.hljs-addition {\n background: #dfd;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n",github$3=Object.freeze({__proto__:null,default:github$2}),clipboard='<svg height="16" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg>',clipboard$1=Object.freeze({__proto__:null,default:clipboard}),_var="var:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n",_var$1=Object.freeze({__proto__:null,default:_var}),datatype='var {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: "";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\n text-align: center;\n /* additional styling */\n font-family: "Dank Mono", "Fira Code", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n',datatype$1=Object.freeze({__proto__:null,default:datatype}),algorithms$1="/* For assertions in lists containing algorithms */\n\n.assert {\n background: #EEE;\n border-left: 0.5em solid #AAA;\n padding: 0.3em;\n}\n",algorithms$2=Object.freeze({__proto__:null,default:algorithms$1}); + `; + } +}; + +async function fetchCommits(from, to, filter) { + /** @type {Commit[]} */ + let commits; + try { + const gh = await github; + if (!gh) { + throw new Error("`respecConfig.github` is not set"); + } + const url = new URL("commits", `${gh.apiBase}/${gh.fullName}/`); + url.searchParams.set("from", from); + url.searchParams.set("to", to); + + const res = await fetch(url.href); + if (!res.ok) { + throw new Error( + `Request to ${url} failed with status code ${res.status}` + ); + } + commits = await res.json(); + if (!commits.length) { + throw new Error(`No commits between ${from}..${to}.`); + } + commits = commits.filter(filter); + } catch (error) { + const msg = `Error loading commits from GitHub. ${error.message}`; + console.error(error); + throw new Error(msg); + } + return commits; +} + +async function toHTML$2(commits) { + const { repoURL } = await github; + return commits.map(commit => { + const [message, prNumber = null] = commit.message.split(/\(#(\d+)\)/, 2); + const commitURL = `${repoURL}commit/${commit.hash}`; + const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null; + const pr = prNumber && hyperHTML` (<a href="${prURL}">#${prNumber}</a>)`; + return hyperHTML`<li><a href="${commitURL}">${message.trim()}</a>${pr}</li>`; + }); +} + +var changelog = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$X, + element: element +}); + +// @ts-check +/** @type {CustomElementDfn[]} */ +const CUSTOM_ELEMENTS = [changelog]; + +const name$Y = "core/custom-elements"; + +async function run$L() { + // prepare and register elements + CUSTOM_ELEMENTS.forEach(el => { + customElements.define(el.name, el.element); + }); + + // wait for each element to be ready + const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(", "); + const elems = document.querySelectorAll(selectors); + const readyPromises = [...elems].map( + el => new Promise(res => el.addEventListener("done", res, { once: true })) + ); + await Promise.all(readyPromises); +} + +var index = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$Y, + run: run$L +}); + +var ui$2 = "#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n#respec-pill,\n.respec-info-button {\n background: #fff;\n height: 2.5em;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill:disabled {\n font-size: 2.8px;\n text-indent: -9999em;\n border-top: 1.1em solid rgba(40, 40, 40, 0.2);\n border-right: 1.1em solid rgba(40, 40, 40, 0.2);\n border-bottom: 1.1em solid rgba(40, 40, 40, 0.2);\n border-left: 1.1em solid #ffffff;\n transform: translateZ(0);\n animation: respec-spin 0.5s infinite linear;\n box-shadow: none;\n}\n\n#respec-pill:disabled,\n#respec-pill:disabled:after {\n border-radius: 50%;\n width: 10em;\n height: 10em;\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n list-style: none;\n font-family: sans-serif;\n background-color: rgb(255, 251, 230);\n font-size: 0.85em;\n}\n\n.respec-warning-list > li,\n.respec-error-list > li {\n padding: 0.4em 0.7em;\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n padding-right: 0.5em;\n}\n.respec-warning-list p,\n.respec-error-list p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-error-list li::before {\n content: \"💥\";\n padding-right: 0.5em;\n}\n\n.respec-error-list li {\n padding: 0.4em 0.7em;\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n.respec-error-list li > p {\n margin: 0;\n padding: 0;\n display: inline-block;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n margin: auto;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n width: 79%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n}\n\n@media screen and (min-width: 78em) {\n .respec-modal {\n width: 62%;\n }\n}\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n.respec-modal .inside div p {\n padding-left: 1cm;\n}\n\n#respec-menu button.respec-option {\n background: white;\n padding: 0 0.2cm;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover,\n#respec-menu button:focus {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n#specref-ui {\n margin: 0 2%;\n margin-bottom: 0.5cm;\n}\n\n#specref-ui header {\n font-size: 0.7em;\n background-color: #eee;\n text-align: center;\n padding: 0.2cm;\n margin-bottom: 0.5cm;\n border-radius: 0 0 0.2cm 0.2cm;\n}\n\n#specref-ui header h1 {\n padding: 0;\n margin: 0;\n color: black;\n}\n\n#specref-ui p {\n padding: 0;\n margin: 0;\n font-size: 0.8em;\n text-align: center;\n}\n\n#specref-ui p.state {\n margin: 1cm;\n}\n\n#specref-ui .searchcomponent {\n font-size: 16px;\n display: grid;\n grid-template-columns: auto 2cm;\n}\n#specref-ui .searchcomponent:focus {\n}\n\n#specref-ui input,\n#specref-ui button {\n border: 0;\n padding: 6px 12px;\n}\n\n#specref-ui label {\n font-size: 0.6em;\n grid-column-end: 3;\n text-align: right;\n grid-column-start: 1;\n}\n\n#specref-ui input[type=\"search\"] {\n -webkit-appearance: none;\n font-size: 16px;\n border-radius: 0.1cm 0 0 0.1cm;\n border: 1px solid rgb(204, 204, 204);\n}\n\n#specref-ui button[type=\"submit\"] {\n color: white;\n border-radius: 0 0.1cm 0.1cm 0;\n background-color: rgb(51, 122, 183);\n}\n\n#specref-ui button[type=\"submit\"]:hover {\n background-color: #286090;\n border-color: #204d74;\n}\n\n#specref-ui .result-stats {\n margin: 0;\n padding: 0;\n color: rgb(128, 128, 128);\n font-size: 0.7em;\n font-weight: bold;\n}\n\n#specref-ui .specref-results {\n font-size: 0.8em;\n}\n\n#specref-ui .specref-results dd + dt {\n margin-top: 0.51cm;\n}\n\n#specref-ui .specref-results a {\n text-transform: capitalize;\n}\n#specref-ui .specref-results .authors {\n display: block;\n color: #006621;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n#xref-ui {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n#xref-ui:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n"; + +var ui$3 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': ui$2 +}); + +var respec2 = "/*****************************************************************\n * ReSpec 3 CSS\n * Robin Berjon - http://berjon.com/\n *****************************************************************/\n\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* Override code highlighter background */\n.hljs {\n background: transparent !important;\n}\n\n/* --- INLINES --- */\nh1 abbr,\nh2 abbr,\nh3 abbr,\nh4 abbr,\nh5 abbr,\nh6 abbr,\na abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\ncode {\n color: #c83500;\n}\n\nth code {\n color: inherit;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul,\n.respec-dfn-list {\n column-count: 2;\n}\n\n#issue-summary li,\n.respec-dfn-list li {\n list-style: none;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\na[href].self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\nh2,\nh3,\nh4,\nh5,\nh6 {\n position: relative;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\nh2 > a.self-link,\nh3 > a.self-link,\nh4 > a.self-link,\nh5 > a.self-link,\nh6 > a.self-link {\n border: none;\n color: inherit;\n font-size: 83%;\n height: 2em;\n left: -1.6em;\n opacity: 0.5;\n position: absolute;\n text-align: center;\n text-decoration: none;\n top: 0;\n transition: opacity 0.2s;\n width: 2em;\n}\n\nh2 > a.self-link::before,\nh3 > a.self-link::before,\nh4 > a.self-link::before,\nh5 > a.self-link::before,\nh6 > a.self-link::before {\n content: \"§\";\n display: block;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n\n /* Don't position self-link in headings off-screen */\n h2 > a.self-link,\n h3 > a.self-link,\n h4 > a.self-link,\n h5 > a.self-link,\n h6 > a.self-link {\n left: auto;\n top: auto;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n"; + +var respec2$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': respec2 +}); + +var examples$1 = "/* --- EXAMPLES --- */\r\nspan.example-title {\r\n text-transform: none;\r\n}\r\naside.example, div.example, div.illegal-example {\r\n padding: 0.5em;\r\n margin: 1em 0;\r\n position: relative;\r\n clear: both;\r\n}\r\ndiv.illegal-example { color: red }\r\ndiv.illegal-example p { color: black }\r\naside.example, div.example {\r\n padding: .5em;\r\n border-left-width: .5em;\r\n border-left-style: solid;\r\n border-color: #e0cb52;\r\n background: #fcfaee;\r\n}\r\n\r\naside.example div.example {\r\n border-left-width: .1em;\r\n border-color: #999;\r\n background: #fff;\r\n}\r\naside.example div.example span.example-title {\r\n color: #999;\r\n}\r\n"; + +var examples$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': examples$1 +}); + +var issuesNotes$1 = "/* --- ISSUES/NOTES --- */\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child { margin-top: 0 }\n.warning {\n padding: .5em;\n border-left-width: .5em;\n border-left-style: solid;\n}\nspan.warning { padding: .1em .5em .15em; }\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.warning {\n border-color: #f11;\n border-width: .2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before{\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: .3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n}\n\n.issue a.respec-label-dark {\n color: #fff;\n background-color: #000;\n}\n\n.issue a.respec-label-light {\n color: #000;\n background-color: #fff;\n}\n"; + +var issuesNotes$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': issuesNotes$1 +}); + +var webidl$1 = "/* --- WEB IDL --- */\n\npre.idl {\n padding: 1em;\n position: relative;\n}\n\n@media print {\n pre.idl {\n white-space: pre-wrap;\n }\n}\n\npre.idl::before {\n content: \"WebIDL\";\n display: block;\n width: 150px;\n background: #90b8de;\n color: #fff;\n font-family: sans-serif;\n font-weight: bold;\n margin: -1em 0 1em -1em;\n height: 28px;\n line-height: 28px; \n}\n\n.idlID {\n font-weight: bold;\n color: #005a9c;\n}\n\n.idlType {\n color: #005a9c;\n}\n\n.idlName {\n color: #ff4500;\n}\n\n.idlName a {\n color: #ff4500;\n border-bottom: 1px dotted #ff4500;\n text-decoration: none;\n}\n\na.idlEnumItem {\n color: #000;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\n.idlSuperclass {\n font-style: italic;\n color: #005a9c;\n}\n\n\n/*.idlParam*/\n\n.idlParamName,\n.idlDefaultValue {\n font-style: italic;\n}\n\n.extAttr {\n color: #666;\n}\n\n\n/*.idlSectionComment*/\n\n.idlSectionComment {\n color: gray;\n}\n\n.idlIncludes a {\n font-weight: bold;\n}\n\n.respec-button-copy-paste:focus {\n text-decoration: none;\n border-color: #51a7e8;\n outline: none;\n box-shadow: 0 0 5px rgba(81, 167, 232, 0.5);\n}\n\n.respec-button-copy-paste:focus:hover,\n.respec-button-copy-paste.selected:focus {\n border-color: #51a7e8;\n}\n\n.respec-button-copy-paste:hover,\n.respec-button-copy-paste:active,\n.respec-button-copy-paste.zeroclipboard-is-hover,\n.respec-button-copy-paste.zeroclipboard-is-active {\n text-decoration: none;\n background-color: #ddd;\n background-image: linear-gradient(#eee, #ddd);\n border-color: #ccc;\n}\n\n.respec-button-copy-paste:active,\n.respec-button-copy-paste.selected,\n.respec-button-copy-paste.zeroclipboard-is-active {\n background-color: #dcdcdc;\n background-image: none;\n border-color: #b5b5b5;\n box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15)\n}\n\n.respec-button-copy-paste.selected:hover {\n background-color: #cfcfcf;\n}\n\n.respec-button-copy-paste:disabled,\n.respec-button-copy-paste:disabled:hover,\n.respec-button-copy-paste.disabled,\n.respec-button-copy-paste.disabled:hover {\n color: rgba(102, 102, 102, 0.5);\n cursor: default;\n background-color: rgba(229, 229, 229, 0.5);\n background-image: none;\n border-color: rgba(197, 197, 197, 0.5);\n box-shadow: none;\n}\n\n@media print {\n .respec-button-copy-paste {\n visibility: hidden;\n }\n}\n"; + +var webidl$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': webidl$1 +}); + +var caniuse$1 = "/* container for stats */\r\n.caniuse-stats {\r\n display: flex;\r\n flex-wrap: wrap;\r\n justify-content: flex-start;\r\n align-items: baseline;\r\n cursor: pointer;\r\n}\r\n\r\nbutton.caniuse-cell {\r\n margin: 1px 1px 0 0;\r\n border: none;\r\n}\r\n\r\n.caniuse-browser {\r\n position: relative;\r\n}\r\n\r\n/* handle case when printing */\r\n@media print {\r\n .caniuse-cell.y::before {\r\n content: \"✔️\";\r\n padding: 0.5em;\r\n }\r\n\r\n .caniuse-cell.n::before{\r\n content: \"❌\";\r\n padding: 0.5em;\r\n }\r\n\r\n .caniuse-cell.d::before,\r\n .caniuse-cell.a::before,\r\n .caniuse-cell.x::before,\r\n .caniuse-cell.p::before {\r\n content: \"⚠️\";\r\n padding: 0.5em;\r\n }\r\n}\r\n\r\n/* reset styles, hide old versions by default */\r\n.caniuse-browser ul {\r\n display: none;\r\n margin: 0;\r\n padding: 0;\r\n list-style: none;\r\n position: absolute;\r\n left: 0;\r\n z-index: 2;\r\n background: #fff;\r\n margin-top: 1px;\r\n}\r\n\r\n.caniuse-stats a {\r\n white-space: nowrap;\r\n align-self: center;\r\n margin-left: .5em;\r\n}\r\n\r\n/* a browser version */\r\n.caniuse-cell {\r\n display: flex;\r\n color: rgba(0, 0, 0, 0.8);\r\n font-size: 90%;\r\n height: 0.8cm;\r\n margin-right: 1px;\r\n margin-top: 0;\r\n min-width: 3cm;\r\n overflow: visible;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\nli.caniuse-cell {\r\n margin-bottom: 1px;\r\n}\r\n\r\n.caniuse-cell:focus {\r\n outline: none;\r\n}\r\n\r\n.caniuse-cell:hover {\r\n color: rgba(0, 0, 0, 1);\r\n}\r\n\r\n/* supports */\r\n.caniuse-cell.y {\r\n background: #8bc34a;\r\n}\r\n\r\n/* no support */\r\n.caniuse-cell.n {\r\n background: #e53935;\r\n}\r\n\r\n/* not supported by default / partial support etc\r\nsee https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md for stats */\r\n.caniuse-cell.d,\r\n.caniuse-cell.a,\r\n.caniuse-cell.x,\r\n.caniuse-cell.p {\r\n background: #ffc107;\r\n}\r\n\r\n/* show rest of the browser versions */\r\n.caniuse-stats button:focus + ul,\r\n.caniuse-stats .caniuse-browser:hover > ul {\r\n display: block;\r\n}\r\n"; + +var caniuse$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': caniuse$1 +}); + +var mdnAnnotation$1 = ".mdn {\n display: block;\n font: 12px sans-serif;\n position: absolute;\n z-index: 9;\n right: 0.3em;\n background-color: #eee;\n margin: -26px 0 0 0;\n padding: 7px 5px 5px 6px;\n min-width: 140px;\n box-shadow: 0 0 3px #999;\n}\n\n.mdn button {\n cursor: pointer;\n border: none;\n color: #000;\n background: transparent;\n margin: -8px;\n outline: none;\n}\n\n.mdn b {\n color: #fff;\n background-color: #000;\n font-weight: normal;\n font-family: zillaslab, Palatino, \"Palatino Linotype\", serif;\n padding: 2px 3px 0px 3px;\n line-height: 1.3em;\n vertical-align: top;\n}\n\n.mdn > div > div {\n display: inline-block;\n margin-left: 5px;\n}\n\n\n.nosupportdata {\n font-style: italic;\n margin-top: 4px;\n margin-left: 8px;\n padding-bottom: 8px;\n}\n\n.mdnsupport {\n display: table;\n margin-top: 4px;\n}\n\n.mdnsupport > span {\n display: table-row;\n padding: 0.2em 0;\n padding-top: 0.2em;\n font-size: 9.6px;\n}\n\n.mdnsupport > span > span {\n display: table-cell;\n padding: 0 0.5em;\n vertical-align: top;\n line-height: 1.5em;\n}\n\n.mdnsupport > span > span:last-child {\n text-align: right;\n padding: 0;\n}\n\n.mdnsupport > span.no {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdnsupport > span.unknown {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdnsupport > span.no::before {\n opacity: 0.5;\n}\n\n.mdnsupport > span.unknown::before {\n opacity: 0.5;\n}\n\n.mdnsupport > span::before {\n content: \"\";\n display: table-cell;\n min-width: 1.5em;\n height: 1.5em;\n background: no-repeat center center / contain;\n text-align: right;\n font-size: 0.75em;\n font-weight: bold;\n}\n\n.mdnsupport > .chrome::before,\n.mdnsupport > .chrome_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg);\n}\n\n.mdnsupport > .edge::before,\n.mdnsupport > .edge_mobile::before {\n background-image: url(https://resources.whatwg.org/browser-logos/edge.svg);\n}\n\n.mdnsupport > .firefox::before,\n.mdnsupport > .firefox_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/firefox.png);\n}\n\n.mdnsupport > .ie::before {\n background-image: url(https://resources.whatwg.org/browser-logos/ie.png);\n}\n\n.mdnsupport > .opera::before,\n.mdnsupport > .opera_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/opera.svg);\n}\n\n.mdnsupport > .safari::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari.png);\n}\n\n.mdnsupport > .safari_ios::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg);\n}\n\n.mdnsupport > .samsunginternet_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg);\n}\n\n.mdnsupport > .webview_android::before {\n background-image: url(https://cdnjs.loli.net/ajax/libs/browser-logos/41.0.0/android-webview-beta/android-webview-beta_32x32.png);\n}\n\n.mdn.wrapped div:nth-child(n + 3) {\n display: none;\n}\n\n.mdn div:nth-child(n + 3) > b {\n color: #eee;\n background-color: #eee;\n}\n\np + .mdn {\n margin-top: -45px;\n}\n\n.mdn.before {\n margin-top: 3em;\n}\n\nh2 + .mdn {\n margin: -48px 0 0 0;\n}\n\nh3 + .mdn {\n margin: -46px 0 0 0;\n}\n\nh4 + .mdn {\n margin: -42px 0 0 0;\n}\n\nh5 + .mdn {\n margin: -40px 0 0 0;\n}\n\nh6 + .mdn {\n margin: -40px 0 0 0;\n}\n\n.mdn div {\n margin: 0;\n}\n\n.mdn :link {\n color: #0000ee;\n}\n\n.mdn :visited {\n color: #551a8b;\n}\n\n.mdn :link:active,\n:visited:active {\n color: #ff0000;\n}\n\n.mdn :link,\n:visited {\n text-decoration: underline;\n cursor: pointer;\n}\n\n.mdn.wrapped {\n min-width: 0px;\n}\n\n.mdn.wrapped > div > div {\n display: none;\n}\n\n.mdn:hover {\n z-index: 11;\n}\n\n.mdn:focus-within {\n z-index: 11;\n}\n"; + +var mdnAnnotation$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': mdnAnnotation$1 +}); + +var respecWorker = "// ReSpec Worker v1.0.0\r\n\"use strict\";\r\ntry {\r\n importScripts(\"https://www.w3.org/Tools/respec/respec-highlight.js\");\r\n} catch (err) {\r\n console.error(\"Network error loading highlighter\", err);\r\n}\r\n\r\nself.addEventListener(\"message\", ({ data: originalData }) => {\r\n const data = Object.assign({}, originalData);\r\n switch (data.action) {\r\n case \"highlight-load-lang\": {\r\n const { langURL, propName, lang } = data;\r\n importScripts(langURL);\r\n self.hljs.registerLanguage(lang, self[propName]);\r\n break;\r\n }\r\n case \"highlight\": {\r\n const { code } = data;\r\n const langs = data.languages.length ? data.languages : undefined;\r\n try {\r\n const { value, language } = self.hljs.highlightAuto(code, langs);\r\n Object.assign(data, { value, language });\r\n } catch (err) {\r\n console.error(\"Could not transform some code?\", err);\r\n // Post back the original code\r\n Object.assign(data, { value: code, language: \"\" });\r\n }\r\n break;\r\n }\r\n }\r\n self.postMessage(data);\r\n});\r\n"; + +var respecWorker$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': respecWorker +}); + +var github$2 = "/*\n\ngithub.com style (c) Vasily Polovnyov <vast@whiteants.net>\n\n*/\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #333;\n background: #f8f8f8;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #998;\n font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-subst {\n color: #333;\n font-weight: bold;\n}\n\n.hljs-number,\n.hljs-literal,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag .hljs-attr {\n color: #008080;\n}\n\n.hljs-string,\n.hljs-doctag {\n color: #d14;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-selector-id {\n color: #900;\n font-weight: bold;\n}\n\n.hljs-subst {\n font-weight: normal;\n}\n\n.hljs-type,\n.hljs-class .hljs-title {\n color: #458;\n font-weight: bold;\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-attribute {\n color: #000080;\n font-weight: normal;\n}\n\n.hljs-regexp,\n.hljs-link {\n color: #009926;\n}\n\n.hljs-symbol,\n.hljs-bullet {\n color: #990073;\n}\n\n.hljs-built_in,\n.hljs-builtin-name {\n color: #0086b3;\n}\n\n.hljs-meta {\n color: #999;\n font-weight: bold;\n}\n\n.hljs-deletion {\n background: #fdd;\n}\n\n.hljs-addition {\n background: #dfd;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n"; + +var github$3 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': github$2 +}); + +var clipboard = "<svg height=\"16\" viewBox=\"0 0 14 16\" width=\"14\"><path fill-rule=\"evenodd\" d=\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"/></svg>"; + +var clipboard$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': clipboard +}); + +var _var = "var:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n"; + +var _var$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': _var +}); + +var datatype = "var {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n"; + +var datatype$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': datatype +}); + +var algorithms$1 = "/* For assertions in lists containing algorithms */\n\n.assert {\n background: #EEE;\n border-left: 0.5em solid #AAA;\n padding: 0.3em;\n}\n"; + +var algorithms$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': algorithms$1 +}); //# sourceMappingURL=respec-w3c.js.map diff --git a/builds/respec-w3c.js.map b/builds/respec-w3c.js.map index 95b44df584..1ff3a3152c 100644 --- a/builds/respec-w3c.js.map +++ b/builds/respec-w3c.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-w3c.js","sources":["../profiles/w3c.js","../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/override-configuration.js","../src/core/respec-ready.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/l10n.js","../src/core/utils.js","../src/core/base-runner.js","../src/core/text-loader.js","../node_modules/idb/build/esm/chunk.js","../node_modules/idb/build/esm/index.js","../node_modules/webidl2/lib/error.js","../node_modules/webidl2/lib/productions/base.js","../node_modules/webidl2/lib/validators/helpers.js","../node_modules/webidl2/lib/productions/type.js","../node_modules/webidl2/lib/productions/default.js","../node_modules/webidl2/lib/productions/array-base.js","../node_modules/webidl2/lib/productions/token.js","../node_modules/webidl2/lib/productions/extended-attributes.js","../node_modules/webidl2/lib/productions/argument.js","../node_modules/webidl2/lib/productions/operation.js","../node_modules/webidl2/lib/productions/attribute.js","../node_modules/webidl2/lib/productions/helpers.js","../node_modules/webidl2/lib/tokeniser.js","../node_modules/webidl2/lib/productions/enum.js","../node_modules/webidl2/lib/productions/includes.js","../node_modules/webidl2/lib/productions/typedef.js","../node_modules/webidl2/lib/productions/callback.js","../node_modules/webidl2/lib/productions/container.js","../node_modules/webidl2/lib/productions/constant.js","../node_modules/webidl2/lib/productions/iterable.js","../node_modules/webidl2/lib/validators/interface.js","../node_modules/webidl2/lib/productions/constructor.js","../node_modules/webidl2/lib/productions/interface.js","../node_modules/webidl2/lib/productions/mixin.js","../node_modules/webidl2/lib/productions/field.js","../node_modules/webidl2/lib/productions/dictionary.js","../node_modules/webidl2/lib/productions/namespace.js","../node_modules/webidl2/lib/productions/callback-interface.js","../node_modules/webidl2/lib/webidl2.js","../node_modules/webidl2/lib/writer.js","../node_modules/webidl2/lib/validator.js","../node_modules/hyperhtml/esm.js","../js/deps/builds/marked.js","../js/deps/builds/pluralize.js","../src/core/import-maps.js","../src/core/markdown.js","../js/shortcut.js","../src/core/ui.js","../src/core/reindent.js","../src/core/location-hash.js","../src/core/LinterRule.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-internal-slots.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/privsec-section.js","../src/core/defaults.js","../src/core/dfn-map.js","../src/w3c/defaults.js","../src/core/style.js","../src/w3c/style.js","../src/w3c/l10n.js","../src/core/github.js","../src/core/data-include.js","../src/w3c/templates/show-link.js","../src/w3c/templates/show-logo.js","../src/w3c/templates/show-people.js","../src/w3c/templates/cgbg-headers.js","../src/w3c/templates/cgbg-sotd.js","../src/w3c/templates/headers.js","../src/w3c/templates/sotd.js","../src/w3c/headers.js","../src/w3c/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/w3c/conformance.js","../src/core/dfn.js","../src/core/pluralize.js","../src/core/examples.js","../src/core/issues-notes.js","../src/core/requirements.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/dfn-finder.js","../src/core/webidl.js","../src/core/data-cite.js","../src/core/webidl-index.js","../src/core/xref-db.js","../src/core/xref.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/core/caniuse.js","../src/core/mdn-annotation.js","../src/core/exporter.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/search-xref.js","../src/ui/dfn-list.js","../src/ui/about-respec.js","../src/core/seo.js","../src/w3c/seo.js","../src/core/worker.js","../src/core/highlight.js","../src/core/webidl-clipboard.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/core/highlight-vars.js","../src/core/data-type.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js"],"sourcesContent":["\"use strict\";\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nconst modules = [\n // order is significant\n import(\"../src/core/base-runner.js\"),\n import(\"../src/core/ui.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/w3c/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/w3c/style.js\"),\n import(\"../src/w3c/l10n.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/w3c/headers.js\"),\n import(\"../src/w3c/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/w3c/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/requirements.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/webidl.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/webidl-index.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/core/caniuse.js\"),\n import(\"../src/core/mdn-annotation.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/search-xref.js\"),\n import(\"../src/ui/dfn-list.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/w3c/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/webidl-clipboard.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter.js\"),\n];\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n\n(async () => {\n const [runner, { ui }, ...plugins] = await Promise.all(modules);\n try {\n ui.show();\n await domReady();\n await runner.runAll(plugins);\n } finally {\n ui.enable();\n }\n})().catch(err => {\n console.error(err);\n});\n","// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function(deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\nimport { expose } from \"./expose-modules.js\";\n\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nconst subscriptions = new Map();\n\nexport function pub(topic, ...data) {\n if (!subscriptions.has(topic)) {\n return; // Nothing to do...\n }\n Array.from(subscriptions.get(topic)).forEach(cb => {\n try {\n cb(...data);\n } catch (err) {\n pub(\n \"error\",\n `Error when calling function ${cb.name}. See developer console.`\n );\n console.error(err);\n }\n });\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = data\n // to structured clonable\n .map(arg => String(JSON.stringify(arg.stack || arg)));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n/**\n * Subscribes to a message type.\n *\n * @param {string} topic The topic to subscribe to (e.g., \"start-all\")\n * @param {Function} cb Callback function\n * @param {Object} [opts]\n * @param {Boolean} [opts.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, opts = { once: false }) {\n if (opts.once) {\n return sub(topic, function wrapper(...args) {\n unsub({ topic, cb: wrapper });\n cb(...args);\n });\n }\n if (subscriptions.has(topic)) {\n subscriptions.get(topic).add(cb);\n } else {\n subscriptions.set(topic, new Set([cb]));\n }\n return { topic, cb };\n}\n/**\n * Unsubscribe from messages.\n *\n * @param {Object} opaque The object that was returned from calling sub()\n */\nexport function unsub({ topic, cb }) {\n // opaque is whatever is returned by sub()\n const callbacks = subscriptions.get(topic);\n if (!callbacks || !callbacks.has(cb)) {\n console.warn(\"Already unsubscribed:\", topic, cb);\n return false;\n }\n return callbacks.delete(cb);\n}\n\nsub(\"error\", err => {\n console.error(err, err.stack);\n});\n\nsub(\"warn\", str => {\n console.warn(str);\n});\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst userConfig = {};\nconst amendConfig = newValues => Object.assign(userConfig, newValues);\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nsub(\"start-all\", amendConfig);\nsub(\"amend-user-config\", amendConfig);\nsub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n});\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub, sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nfunction overrideConfig(config) {\n // For legacy reasons, we still support both \";\" and \"&\"\n const searchQuery = document.location.search.replace(/;/g, \"&\");\n const params = new URLSearchParams(searchQuery);\n const overrideProps = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return { key, value };\n })\n .reduce((collector, { key, value }) => {\n collector[key] = value;\n return collector;\n }, {});\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\nsub(\"start-all\", overrideConfig, { once: true });\n","// @ts-check\n/**\n * This Module adds a `respecIsReady` property to the document object.\n * The property returns a promise that settles when ReSpec finishes\n * processing the document.\n */\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/respec-ready\";\n\n/** @type {Promise<void>} */\nconst respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", resolve, { once: true });\n});\n\nObject.defineProperty(document, \"respecIsReady\", {\n get() {\n return respecDonePromise;\n },\n});\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { pub, sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/post-process\";\n\nlet doneResolver;\nexport const done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nsub(\n \"plugins-done\",\n async config => {\n const result = [];\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n pub(\"error\", \"Every item in `postProcess` must be a JS function.\");\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n pub(\n \"error\",\n `Function ${f.name} threw an error during \\`postProcess\\`. See developer console.`\n );\n console.error(err);\n }\n });\n const values = await Promise.all(promises);\n result.push(...values);\n }\n if (typeof config.afterEnd === \"function\") {\n result.push(await config.afterEnd(config, document));\n }\n doneResolver(result);\n },\n { once: true }\n);\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { pub, sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/pre-process\";\n\nlet doneResolver;\nexport const done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nsub(\n \"start-all\",\n async config => {\n const result = [];\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n pub(\"error\", \"Every item in `preProcess` must be a JS function.\");\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n pub(\n \"error\",\n `Function ${f.name} threw an error during \\`preProcess\\`. See developer console.`\n );\n console.error(err);\n }\n });\n const values = await Promise.all(promises);\n result.push(...values);\n }\n doneResolver(result);\n },\n { once: true }\n);\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\n// We use en-US as the base\nconst base = {\n about_respec: \"About\",\n abstract: \"Abstract\",\n author: \"Author:\",\n authors: \"Authors:\",\n bug_tracker: \"Bug tracker:\",\n close_parens: \")\",\n definition_list: \"Definitions\",\n editor: \"Editor:\",\n editors_note: \"Editor's note\",\n editors: \"Editors:\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n info_references: \"Informative references\",\n issue_summary: \"Issue Summary\",\n issue: \"Issue\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n list_of_definitions: \"List of Definitions\",\n norm_references: \"Normative references\",\n note: \"Note\",\n open_bugs: \"open bugs\",\n open_parens: \"(\",\n participate: \"Participate\",\n references: \"References\",\n save_as: \"Save as\",\n save_snapshot: \"Export\",\n search_specref: \"Search Specref\",\n sotd: \"Status of This Document\",\n this_version: \"This version:\",\n toc: \"Table of Contents\",\n warning: \"Warning\",\n};\n\nconst ko = {\n abstract: \"요약\",\n author: \"저자:\",\n authors: \"저자:\",\n latest_published_version: \"최신 버전:\",\n sotd: \"현재 문서의 상태\",\n this_version: \"현재 버전:\",\n};\n\nconst zh = {\n about_respec: \"关于\",\n abstract: \"摘要\",\n bug_tracker: \"错误跟踪:\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n file_a_bug: \"反馈错误\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n note: \"注\",\n open_bugs: \"修正中的错误\",\n participate: \"参与:\",\n sotd: \"关于本文档\",\n this_version: \"本版本:\",\n toc: \"内容大纲\",\n};\n\nconst ja = {\n abstract: \"要約\",\n author: \"著者:\",\n authors: \"著者:\",\n bug_tracker: \"バグの追跡履歴:\",\n editor: \"編者:\",\n editors: \"編者:\",\n file_a_bug: \"問題報告\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n note: \"注\",\n open_bugs: \"改修されていないバグ\",\n participate: \"参加方法:\",\n sotd: \"この文書の位置付け\",\n this_version: \"このバージョン:\",\n toc: \"目次\",\n};\n\nconst nl = {\n about_respec: \"Over\",\n abstract: \"Samenvatting\",\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n bug_tracker: \"Meldingensysteem:\",\n definition_list: \"Lijst van Definities\",\n editor: \"Redacteur:\",\n editors_note: \"Redactionele noot\",\n editors: \"Redacteurs:\",\n file_a_bug: \"Dien een melding in\",\n info_references: \"Informatieve referenties\",\n issue_summary: \"Lijst met issues\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n list_of_definitions: \"Lijst van Definities\",\n norm_references: \"Normatieve referenties\",\n note: \"Noot\",\n open_bugs: \"open meldingen\",\n participate: \"Doe mee\",\n references: \"Referenties\",\n save_as: \"Bewaar als\",\n save_snapshot: \"Bewaar Snapshot\",\n search_specref: \"Doorzoek Specref\",\n sotd: \"Status van dit document\",\n this_version: \"Deze versie:\",\n toc: \"Inhoudsopgave\",\n warning: \"Waarschuwing\",\n};\n\nconst es = {\n abstract: \"Resumen\",\n author: \"Autor:\",\n authors: \"Autores:\",\n bug_tracker: \"Repositorio de bugs:\",\n close_parens: \")\",\n editor: \"Editor:\",\n editors_note: \"Nota de editor\",\n editors: \"Editores:\",\n file_a_bug: \"Nota un bug\",\n info_references: \"Referencias informativas\",\n issue_summary: \"Resumen de la cuestión\",\n issue: \"Cuestión\",\n latest_editors_draft: \"Borrador de editor mas reciente:\",\n latest_published_version: \"Versión publicada mas reciente:\",\n norm_references: \"Referencias normativas\",\n note: \"Nota\",\n open_bugs: \"Bugs abiertos\",\n open_parens: \"(\",\n participate: \"Participad\",\n references: \"Referencias\",\n sotd: \"Estado de este Document\",\n this_version: \"Ésta versión:\",\n toc: \"Tabla de Contenidos\",\n warning: \"Aviso\",\n};\n\nexport const l10n = {\n en: { ...base },\n ko: { ...base, ...ko },\n zh: { ...base, ...zh },\n ja: { ...base, ...ja },\n nl: { ...base, ...nl },\n es: { ...base, ...es },\n};\n\nl10n[\"zh-hans\"] = l10n.zh;\nl10n[\"zh-cn\"] = l10n.zh;\n\nexport const lang = html && html.lang in l10n ? html.lang : \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst spaceOrTab = /^[ |\\t]*/;\nconst dashes = /-/g;\n\nexport const ISODate = new Intl.DateTimeFormat([\"en-ca-iso8601\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\nconst resourceHints = new Set([\n \"dns-prefetch\",\n \"preconnect\",\n \"preload\",\n \"prerender\",\n]);\n\nconst fetchDestinations = new Set([\n \"document\",\n \"embed\",\n \"font\",\n \"image\",\n \"manifest\",\n \"media\",\n \"object\",\n \"report\",\n \"script\",\n \"serviceworker\",\n \"sharedworker\",\n \"style\",\n \"worker\",\n \"xslt\",\n \"\",\n]);\n\n// CSS selector for matching elements that are non-normative\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\nexport function calculateLeftPad(text) {\n if (typeof text !== \"string\") {\n throw new TypeError(\"Invalid input\");\n }\n // Find smallest padding value\n const leftPad = text\n .split(\"\\n\")\n .filter(item => item)\n .reduce((smallest, item) => {\n // can't go smaller than 0\n if (smallest === 0) {\n return smallest;\n }\n const match = item.match(spaceOrTab)[0] || \"\";\n return Math.min(match.length, smallest);\n }, +Infinity);\n return leftPad === +Infinity ? 0 : leftPad;\n}\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {Object} opts Configure the resource hint.\n * @param {String} opts.hint The type of hint (see resourceHints).\n * @param {String} opts.href The URL for the resource or origin.\n * @param {String} [opts.corsMode] Optional, the CORS mode to use (see HTML spec).\n * @param {String} [opts.as] Optional, fetch destination type (see fetchDestinations).\n * @param {boolean} [opts.dontRemove] If the hint should remain in the spec after processing.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n if (!opts || typeof opts !== \"object\") {\n throw new TypeError(\"Missing options\");\n }\n if (!resourceHints.has(opts.hint)) {\n throw new TypeError(\"Invalid resources hint\");\n }\n const url = new URL(opts.href, location.href);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts && typeof opts.as === \"string\") {\n if (!fetchDestinations.has(opts.as)) {\n console.warn(`Unknown request destination: ${opts.as}`);\n }\n linkElem.setAttribute(\"as\", opts.as);\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement|HTMLElement[]} elems\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nexport function showInlineWarning(elems, msg, title) {\n if (!Array.isArray(elems)) elems = [elems];\n const links = elems\n .map((element, i) => {\n markAsOffending(element, msg, title);\n return generateMarkdownLink(element, i);\n })\n .join(\", \");\n pub(\"warn\", `${msg} at: ${links}.`);\n console.warn(msg, elems);\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement|HTMLElement[]} elems\n * @param {String} msg message to show in warning\n * @param {String} title error message to add on each element\n * @param {object} [options]\n * @param {string} [options.details]\n */\nexport function showInlineError(elems, msg, title, { details } = {}) {\n if (!Array.isArray(elems)) elems = [elems];\n const links = elems\n .map((element, i) => {\n markAsOffending(element, msg, title);\n return generateMarkdownLink(element, i);\n })\n .join(\", \");\n let message = `${msg} at: ${links}.`;\n if (details) {\n message += `\\n\\n<details>${details}</details>`;\n }\n pub(\"error\", message);\n console.error(msg, elems);\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n/**\n * @param {Element} element\n * @param {number} i\n */\nfunction generateMarkdownLink(element, i) {\n return `[${i + 1}](#${element.id})`;\n}\n\nexport class IDBKeyVal {\n /**\n * @param {import(\"idb\").IDBPDatabase} idb\n * @param {string} storeName\n */\n constructor(idb, storeName) {\n this.idb = idb;\n this.storeName = storeName;\n }\n\n /** @param {string} key */\n async get(key) {\n return await this.idb\n .transaction(this.storeName)\n .objectStore(this.storeName)\n .get(key);\n }\n\n /**\n * @param {string[]} keys\n */\n async getMany(keys) {\n const keySet = new Set(keys);\n /** @type {Map<string, any>} */\n const results = new Map();\n let cursor = await this.idb.transaction(this.storeName).store.openCursor();\n while (cursor) {\n if (keySet.has(cursor.key)) {\n results.set(cursor.key, cursor.value);\n }\n cursor = await cursor.continue();\n }\n return results;\n }\n\n /**\n * @param {string} key\n * @param {any} value\n */\n async set(key, value) {\n const tx = this.idb.transaction(this.storeName, \"readwrite\");\n tx.objectStore(this.storeName).put(value, key);\n return await tx.done;\n }\n\n async addMany(entries) {\n const tx = this.idb.transaction(this.storeName, \"readwrite\");\n for (const [key, value] of entries) {\n tx.objectStore(this.storeName).put(value, key);\n }\n return await tx.done;\n }\n\n async clear() {\n const tx = this.idb.transaction(this.storeName, \"readwrite\");\n tx.objectStore(this.storeName).clear();\n return await tx.done;\n }\n\n async keys() {\n const tx = this.idb.transaction(this.storeName);\n /** @type {Promise<string[]>} */\n const keys = tx.objectStore(this.storeName).getAllKeys();\n await tx.done;\n return keys;\n }\n}\n\n// STRING HELPERS\n// Takes an array and returns a string that separates each of its items with the proper commas and\n// \"and\". The second argument is a mapping function that can convert the items before they are\n// joined\nexport function joinAnd(array = [], mapper = item => item, lang = docLang) {\n const items = array.map(mapper);\n if (Intl.ListFormat && typeof Intl.ListFormat === \"function\") {\n const formatter = new Intl.ListFormat(lang, {\n style: \"long\",\n type: \"conjunction\",\n });\n return formatter.format(items);\n }\n switch (items.length) {\n case 0:\n case 1: // \"x\"\n return items.toString();\n case 2: // x and y\n return items.join(\" and \");\n default: {\n // x, y, and z\n const str = items.join(\", \");\n const lastComma = str.lastIndexOf(\",\");\n return `${str.substr(0, lastComma + 1)} and ${str.slice(lastComma + 2)}`;\n }\n }\n}\n\n// Takes a string, applies some XML escapes, and returns the escaped string.\n// Note that overall using either Handlebars' escaped output or jQuery is much\n// preferred to operating on strings directly.\nexport function xmlEscape(s) {\n return s\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single space\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n// Takes a Date object and an optional separator and returns the year,month,day representation with\n// the custom separator (defaulting to none) and proper 0-padding\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n// formats a date to \"yyyy-mm-dd\"\nexport function toShortIsoDate(date) {\n return ISODate.format(date);\n}\n\n// takes a string, prepends a \"0\" if it is of length 1, does nothing otherwise\nexport function lead0(str) {\n return String(str).length === 1 ? `0${str}` : str;\n}\n\n// takes a YYYY-MM-DD date and returns a Date object for it\nexport function parseSimpleDate(str) {\n return new Date(str);\n}\n\n// takes what document.lastModified returns and produces a Date object for it\nexport function parseLastModified(str) {\n if (!str) return new Date();\n return new Date(Date.parse(str));\n}\n\n// given either a Date object or a date in YYYY-MM-DD format,\n// return a human-formatted date suitable for use in a W3C specification\nexport function humanDate(\n date = new Date(),\n lang = document.documentElement.lang || \"en\"\n) {\n if (!(date instanceof Date)) date = new Date(date);\n const langs = [lang, \"en\"];\n const day = date.toLocaleString(langs, {\n day: \"2-digit\",\n timeZone: \"UTC\",\n });\n const month = date.toLocaleString(langs, {\n month: \"long\",\n timeZone: \"UTC\",\n });\n const year = date.toLocaleString(langs, {\n year: \"numeric\",\n timeZone: \"UTC\",\n });\n // date month year\n return `${day} ${month} ${year}`;\n}\n// given either a Date object or a date in YYYY-MM-DD format,\n// return an ISO formatted date suitable for use in a xsd:datetime item\nexport function isoDate(date) {\n return (date instanceof Date ? date : new Date(date)).toISOString();\n}\n\n// Given an object, it converts it to a key value pair separated by\n// (\"=\", configurable) and a delimiter (\" ,\" configurable).\n// for example, {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n// take a document and either a link or an array of links to CSS and appends\n// a <link/> element to the head pointing to each\nexport function linkCSS(doc, styles) {\n const stylesArray = [].concat(styles);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n// Run list of transforms over content and return result.\n// Please note that this is a legacy method that is only kept in order\n// to maintain compatibility\n// with RSv1. It is therefore not tested and not actively supported.\n/**\n * @this {any}\n * @param {string} [flist]\n */\nexport function runTransforms(content, flist) {\n let args = [this, content];\n const funcArgs = Array.from(arguments);\n funcArgs.shift();\n funcArgs.shift();\n args = args.concat(funcArgs);\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (let j = 0; j < methods.length; j++) {\n const meth = methods[j];\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n pub(\n \"warn\",\n `call to \\`${meth}()\\` failed with: ${e}. See error console for stack trace.`\n );\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours (86400000 ms)\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 86400000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- COLLECTION/ITERABLE HELPERS ---------------\n/**\n * Spreads one iterable into another.\n *\n * @param {Array} collector\n * @param {any|Array} item\n * @returns {Array}\n */\nexport function flatten(collector, item) {\n const items = !Array.isArray(item)\n ? [item]\n : item.slice().reduce(flatten, []);\n collector.push(...items);\n return collector;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Creates and sets an ID to an element (elem)\n * using a specific prefix if provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (pfx === \"example\") {\n id = txt;\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes if nodes that only have whitespace are returned.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies\n * the algorithm used for determining the actual title of a\n * <dfn> element (but can apply to other as well).\n * if args.isDefinition is true, then the element is a definition, not a\n * reference to a definition. Any @title will be replaced with\n * @data-lt to be consistent with Bikeshed / Shepherd.\n * This method now *prefers* the data-lt attribute for the list of\n * titles. That attribute is added by this method to dfn elements, so\n * subsequent calls to this method will return the data-lt based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that\n * element might refer to, of the form\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @returns {Element} new renamed element\n */\nexport function renameElement(elem, newName) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Applies the selector for direct descendants.\n * This is a helper function for browsers without :scope support.\n * Note that this doesn't support comma separated selectors.\n * @param {Element} element\n * @param {string} selector\n * @returns {NodeListOf<HTMLElement>}\n */\nexport function children(element, selector) {\n try {\n return element.querySelectorAll(`:scope > ${selector}`);\n } catch {\n let tempId = \"\";\n // We give a temporary id, to overcome lack of \":scope\" support in Edge.\n if (!element.id) {\n tempId = `temp-${String(Math.random()).substr(2)}`;\n element.id = tempId;\n }\n const query = `#${element.id} > ${selector}`;\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.parentElement.querySelectorAll(query);\n if (tempId) {\n element.id = \"\";\n }\n return elements;\n }\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => renameElement(dfn, \"span\"));\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport \"./include-config.js\";\nimport \"./override-configuration.js\";\nimport \"./respec-ready.js\";\nimport { done as postProcessDone } from \"./post-process.js\";\nimport { done as preProcessDone } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\nconst canMeasure = performance.mark && performance.measure;\n\nfunction toRunnable(plug) {\n const name = plug.name || \"\";\n if (!name) {\n console.warn(\"Plugin lacks name:\", plug);\n }\n return config => {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n if (canMeasure) {\n performance.mark(`${name}-start`);\n }\n try {\n if (plug.run.length <= 1) {\n await plug.run(config);\n resolve();\n } else {\n console.warn(\n `Plugin ${name} uses a deprecated callback signature. Return a Promise instead. Read more at: https://github.com/w3c/respec/wiki/Developers-Guide#plugins`\n );\n plug.run(config, document, resolve);\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n }\n if (canMeasure) {\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n };\n}\n\nexport async function runAll(plugs) {\n pub(\"start-all\", respecConfig);\n if (canMeasure) {\n performance.mark(`${name}-start`);\n }\n await preProcessDone;\n const runnables = plugs.filter(plug => plug && plug.run).map(toRunnable);\n for (const task of runnables) {\n try {\n await task(respecConfig);\n } catch (err) {\n console.error(err);\n }\n }\n pub(\"plugins-done\", respecConfig);\n await postProcessDone;\n pub(\"end-all\", respecConfig);\n removeReSpec(document);\n if (canMeasure) {\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n}\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n\n/**\n * @param {string} fileName\n */\nexport async function fetchAsset(fileName) {\n return fetchBase(`assets/${fileName}`);\n}\n","const instanceOfAny = (object, constructors) => constructors.some(c => object instanceof c);\n\nlet idbProxyableTypes;\r\nlet cursorAdvanceMethods;\r\n// This is a function to prevent it throwing up in node environments.\r\nfunction getIdbProxyableTypes() {\r\n return (idbProxyableTypes ||\r\n (idbProxyableTypes = [\r\n IDBDatabase,\r\n IDBObjectStore,\r\n IDBIndex,\r\n IDBCursor,\r\n IDBTransaction,\r\n ]));\r\n}\r\n// This is a function to prevent it throwing up in node environments.\r\nfunction getCursorAdvanceMethods() {\r\n return (cursorAdvanceMethods ||\r\n (cursorAdvanceMethods = [\r\n IDBCursor.prototype.advance,\r\n IDBCursor.prototype.continue,\r\n IDBCursor.prototype.continuePrimaryKey,\r\n ]));\r\n}\r\nconst cursorRequestMap = new WeakMap();\r\nconst transactionDoneMap = new WeakMap();\r\nconst transactionStoreNamesMap = new WeakMap();\r\nconst transformCache = new WeakMap();\r\nconst reverseTransformCache = new WeakMap();\r\nfunction promisifyRequest(request) {\r\n const promise = new Promise((resolve, reject) => {\r\n const unlisten = () => {\r\n request.removeEventListener('success', success);\r\n request.removeEventListener('error', error);\r\n };\r\n const success = () => {\r\n resolve(wrap(request.result));\r\n unlisten();\r\n };\r\n const error = () => {\r\n reject(request.error);\r\n unlisten();\r\n };\r\n request.addEventListener('success', success);\r\n request.addEventListener('error', error);\r\n });\r\n promise\r\n .then(value => {\r\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\r\n // (see wrapFunction).\r\n if (value instanceof IDBCursor) {\r\n cursorRequestMap.set(value, request);\r\n }\r\n // Catching to avoid \"Uncaught Promise exceptions\"\r\n })\r\n .catch(() => { });\r\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\r\n // is because we create many promises from a single IDBRequest.\r\n reverseTransformCache.set(promise, request);\r\n return promise;\r\n}\r\nfunction cacheDonePromiseForTransaction(tx) {\r\n // Early bail if we've already created a done promise for this transaction.\r\n if (transactionDoneMap.has(tx))\r\n return;\r\n const done = new Promise((resolve, reject) => {\r\n const unlisten = () => {\r\n tx.removeEventListener('complete', complete);\r\n tx.removeEventListener('error', error);\r\n tx.removeEventListener('abort', error);\r\n };\r\n const complete = () => {\r\n resolve();\r\n unlisten();\r\n };\r\n const error = () => {\r\n reject(tx.error);\r\n unlisten();\r\n };\r\n tx.addEventListener('complete', complete);\r\n tx.addEventListener('error', error);\r\n tx.addEventListener('abort', error);\r\n });\r\n // Cache it for later retrieval.\r\n transactionDoneMap.set(tx, done);\r\n}\r\nlet idbProxyTraps = {\r\n get(target, prop, receiver) {\r\n if (target instanceof IDBTransaction) {\r\n // Special handling for transaction.done.\r\n if (prop === 'done')\r\n return transactionDoneMap.get(target);\r\n // Polyfill for objectStoreNames because of Edge.\r\n if (prop === 'objectStoreNames') {\r\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\r\n }\r\n // Make tx.store return the only store in the transaction, or undefined if there are many.\r\n if (prop === 'store') {\r\n return receiver.objectStoreNames[1]\r\n ? undefined\r\n : receiver.objectStore(receiver.objectStoreNames[0]);\r\n }\r\n }\r\n // Else transform whatever we get back.\r\n return wrap(target[prop]);\r\n },\r\n has(target, prop) {\r\n if (target instanceof IDBTransaction &&\r\n (prop === 'done' || prop === 'store')) {\r\n return true;\r\n }\r\n return prop in target;\r\n },\r\n};\r\nfunction addTraps(callback) {\r\n idbProxyTraps = callback(idbProxyTraps);\r\n}\r\nfunction wrapFunction(func) {\r\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\r\n // only create one new func per func.\r\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\r\n if (func === IDBDatabase.prototype.transaction &&\r\n !('objectStoreNames' in IDBTransaction.prototype)) {\r\n return function (storeNames, ...args) {\r\n const tx = func.call(unwrap(this), storeNames, ...args);\r\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\r\n return wrap(tx);\r\n };\r\n }\r\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\r\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\r\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\r\n // with real promises, so each advance methods returns a new promise for the cursor object, or\r\n // undefined if the end of the cursor has been reached.\r\n if (getCursorAdvanceMethods().includes(func)) {\r\n return function (...args) {\r\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\r\n // the original object.\r\n func.apply(unwrap(this), args);\r\n return wrap(cursorRequestMap.get(this));\r\n };\r\n }\r\n return function (...args) {\r\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\r\n // the original object.\r\n return wrap(func.apply(unwrap(this), args));\r\n };\r\n}\r\nfunction transformCachableValue(value) {\r\n if (typeof value === 'function')\r\n return wrapFunction(value);\r\n // This doesn't return, it just creates a 'done' promise for the transaction,\r\n // which is later returned for transaction.done (see idbObjectHandler).\r\n if (value instanceof IDBTransaction)\r\n cacheDonePromiseForTransaction(value);\r\n if (instanceOfAny(value, getIdbProxyableTypes()))\r\n return new Proxy(value, idbProxyTraps);\r\n // Return the same value back if we're not going to transform it.\r\n return value;\r\n}\r\nfunction wrap(value) {\r\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\r\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\r\n if (value instanceof IDBRequest)\r\n return promisifyRequest(value);\r\n // If we've already transformed this value before, reuse the transformed value.\r\n // This is faster, but it also provides object equality.\r\n if (transformCache.has(value))\r\n return transformCache.get(value);\r\n const newValue = transformCachableValue(value);\r\n // Not all types are transformed.\r\n // These may be primitive types, so they can't be WeakMap keys.\r\n if (newValue !== value) {\r\n transformCache.set(value, newValue);\r\n reverseTransformCache.set(newValue, value);\r\n }\r\n return newValue;\r\n}\r\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { wrap as a, addTraps as b, instanceOfAny as c, reverseTransformCache as d, unwrap as e };\n","import { a as wrap, b as addTraps } from './chunk.js';\nexport { e as unwrap, a as wrap } from './chunk.js';\n\n/**\r\n * Open a database.\r\n *\r\n * @param name Name of the database.\r\n * @param version Schema version.\r\n * @param callbacks Additional callbacks.\r\n */\r\nfunction openDB(name, version, { blocked, upgrade, blocking } = {}) {\r\n const request = indexedDB.open(name, version);\r\n const openPromise = wrap(request);\r\n if (upgrade) {\r\n request.addEventListener('upgradeneeded', event => {\r\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));\r\n });\r\n }\r\n if (blocked)\r\n request.addEventListener('blocked', () => blocked());\r\n if (blocking) {\r\n openPromise.then(db => db.addEventListener('versionchange', blocking)).catch(() => { });\r\n }\r\n return openPromise;\r\n}\r\n/**\r\n * Delete a database.\r\n *\r\n * @param name Name of the database.\r\n */\r\nfunction deleteDB(name, { blocked } = {}) {\r\n const request = indexedDB.deleteDatabase(name);\r\n if (blocked)\r\n request.addEventListener('blocked', () => blocked());\r\n return wrap(request).then(() => undefined);\r\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\r\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\r\nconst cachedMethods = new Map();\r\nfunction getMethod(target, prop) {\r\n if (!(target instanceof IDBDatabase &&\r\n !(prop in target) &&\r\n typeof prop === 'string')) {\r\n return;\r\n }\r\n if (cachedMethods.get(prop))\r\n return cachedMethods.get(prop);\r\n const targetFuncName = prop.replace(/FromIndex$/, '');\r\n const useIndex = prop !== targetFuncName;\r\n const isWrite = writeMethods.includes(targetFuncName);\r\n if (\r\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\r\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\r\n !(isWrite || readMethods.includes(targetFuncName))) {\r\n return;\r\n }\r\n const method = async function (storeName, ...args) {\r\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\r\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\r\n let target = tx.store;\r\n if (useIndex)\r\n target = target.index(args.shift());\r\n const returnVal = target[targetFuncName](...args);\r\n if (isWrite)\r\n await tx.done;\r\n return returnVal;\r\n };\r\n cachedMethods.set(prop, method);\r\n return method;\r\n}\r\naddTraps(oldTraps => ({\r\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\r\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\r\n}));\n\nexport { openDB, deleteDB };\n","/**\n * @param {string} text\n */\nfunction lastLine(text) {\n const splitted = text.split(\"\\n\");\n return splitted[splitted.length - 1];\n}\n\n/**\n * @typedef {object} WebIDL2ErrorOptions\n * @property {\"error\" | \"warning\"} [level]\n * @property {Function} [autofix]\n *\n * @param {string} message error message\n * @param {\"Syntax\" | \"Validation\"} kind error type\n * @param {WebIDL2ErrorOptions} [options]\n */\nfunction error(source, position, current, message, kind, { level = \"error\", autofix, ruleName } = {}) {\n /**\n * @param {number} count\n */\n function sliceTokens(count) {\n return count > 0 ?\n source.slice(position, position + count) :\n source.slice(Math.max(position + count, 0), position);\n }\n\n function tokensToText(inputs, { precedes } = {}) {\n const text = inputs.map(t => t.trivia + t.value).join(\"\");\n const nextToken = source[position];\n if (nextToken.type === \"eof\") {\n return text;\n }\n if (precedes) {\n return text + nextToken.trivia;\n }\n return text.slice(nextToken.trivia.length);\n }\n\n const maxTokens = 5; // arbitrary but works well enough\n const line =\n source[position].type !== \"eof\" ? source[position].line :\n source.length > 1 ? source[position - 1].line :\n 1;\n\n const precedingLastLine = lastLine(\n tokensToText(sliceTokens(-maxTokens), { precedes: true })\n );\n\n const subsequentTokens = sliceTokens(maxTokens);\n const subsequentText = tokensToText(subsequentTokens);\n const subsequentFirstLine = subsequentText.split(\"\\n\")[0];\n\n const spaced = \" \".repeat(precedingLastLine.length) + \"^\";\n const sourceContext = precedingLastLine + subsequentFirstLine + \"\\n\" + spaced;\n\n const contextType = kind === \"Syntax\" ? \"since\" : \"inside\";\n const inSourceName = source.name ? ` in ${source.name}` : \"\";\n const grammaticalContext = (current && current.name) ? `, ${contextType} \\`${current.partial ? \"partial \" : \"\"}${current.type} ${current.name}\\`` : \"\";\n const context = `${kind} error at line ${line}${inSourceName}${grammaticalContext}:\\n${sourceContext}`;\n return {\n message: `${context} ${message}`,\n bareMessage: message,\n context,\n line,\n sourceName: source.name,\n level,\n ruleName,\n autofix,\n input: subsequentText,\n tokens: subsequentTokens\n };\n}\n\n/**\n * @param {string} message error message\n */\nexport function syntaxError(source, position, current, message) {\n return error(source, position, current, message, \"Syntax\");\n}\n\n/**\n * @param {string} message error message\n * @param {WebIDL2ErrorOptions} [options]\n */\nexport function validationError(token, current, ruleName, message, options = {}) {\n options.ruleName = ruleName;\n return error(current.source, token.index, current, message, \"Validation\", options);\n}\n","// @ts-check\n\nexport class Base {\n /**\n * @param {object} initializer\n * @param {Base[\"source\"]} initializer.source\n * @param {Base[\"tokens\"]} initializer.tokens\n */\n constructor({ source, tokens }) {\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens },\n parent: { value: null, writable: true },\n this: { value: this } // useful when escaping from proxy\n });\n }\n\n toJSON() {\n const json = { type: undefined, name: undefined, inheritance: undefined };\n let proto = this;\n while (proto !== Object.prototype) {\n const descMap = Object.getOwnPropertyDescriptors(proto);\n for (const [key, value] of Object.entries(descMap)) {\n if (value.enumerable || value.get) {\n // @ts-ignore - allow indexing here\n json[key] = this[key];\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return json;\n }\n}\n","// @ts-check\n\n/**\n * @typedef {import(\"../productions/dictionary.js\").Dictionary} Dictionary\n *\n * @param {*} idlType\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {object} [options]\n * @param {boolean} [options.useNullableInner] use when the input idlType is nullable and you want to use its inner type\n * @return {{ reference: *, dictionary: Dictionary }} the type reference that ultimately includes dictionary.\n */\nexport function idlTypeIncludesDictionary(idlType, defs, { useNullableInner } = {}) {\n if (!idlType.union) {\n const def = defs.unique.get(idlType.idlType);\n if (!def) {\n return;\n }\n if (def.type === \"typedef\") {\n const { typedefIncludesDictionary } = defs.cache;\n if (typedefIncludesDictionary.has(def)) {\n // Note that this also halts when it met indeterminate state\n // to prevent infinite recursion\n return typedefIncludesDictionary.get(def);\n }\n defs.cache.typedefIncludesDictionary.set(def, undefined); // indeterminate state\n const result = idlTypeIncludesDictionary(def.idlType, defs);\n defs.cache.typedefIncludesDictionary.set(def, result);\n if (result) {\n return {\n reference: idlType,\n dictionary: result.dictionary\n };\n }\n }\n if (def.type === \"dictionary\" && (useNullableInner || !idlType.nullable)) {\n return {\n reference: idlType,\n dictionary: def\n };\n }\n }\n for (const subtype of idlType.subtype) {\n const result = idlTypeIncludesDictionary(subtype, defs);\n if (result) {\n if (subtype.union) {\n return result;\n }\n return {\n reference: subtype,\n dictionary: result.dictionary\n };\n }\n }\n}\n\n/**\n * @param {*} dict dictionary type\n * @param {import(\"../validator.js\").Definitions} defs\n * @return {boolean}\n */\nexport function dictionaryIncludesRequiredField(dict, defs) {\n if (defs.cache.dictionaryIncludesRequiredField.has(dict)) {\n return defs.cache.dictionaryIncludesRequiredField.get(dict);\n }\n defs.cache.dictionaryIncludesRequiredField.set(dict, undefined); // indeterminate\n if (dict.inheritance) {\n const superdict = defs.unique.get(dict.inheritance);\n if (!superdict) {\n return true;\n }\n if (dictionaryIncludesRequiredField(superdict, defs)) {\n return true;\n }\n }\n const result = dict.members.some(field => field.required);\n defs.cache.dictionaryIncludesRequiredField.set(dict, result);\n return result;\n}\n","import { Base } from \"./base.js\";\nimport { unescape, type_with_extended_attributes, return_type, primitive_type, autoParenter } from \"./helpers.js\";\nimport { stringTypes, typeNameKeywords } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction generic_type(tokeniser, typeName) {\n const base = tokeniser.consume(\"FrozenArray\", \"Promise\", \"sequence\", \"record\");\n if (!base) {\n return;\n }\n const ret = autoParenter(new Type({ source: tokeniser.source, tokens: { base } }));\n ret.tokens.open = tokeniser.consume(\"<\") || tokeniser.error(`No opening bracket after ${base.type}`);\n switch (base.type) {\n case \"Promise\": {\n if (tokeniser.probe(\"[\")) tokeniser.error(\"Promise type cannot have extended attribute\");\n const subtype = return_type(tokeniser, typeName) || tokeniser.error(\"Missing Promise subtype\");\n ret.subtype.push(subtype);\n break;\n }\n case \"sequence\":\n case \"FrozenArray\": {\n const subtype = type_with_extended_attributes(tokeniser, typeName) || tokeniser.error(`Missing ${base.type} subtype`);\n ret.subtype.push(subtype);\n break;\n }\n case \"record\": {\n if (tokeniser.probe(\"[\")) tokeniser.error(\"Record key cannot have extended attribute\");\n const keyType = tokeniser.consume(...stringTypes) || tokeniser.error(`Record key must be one of: ${stringTypes.join(\", \")}`);\n const keyIdlType = new Type({ source: tokeniser.source, tokens: { base: keyType }});\n keyIdlType.tokens.separator = tokeniser.consume(\",\") || tokeniser.error(\"Missing comma after record key type\");\n keyIdlType.type = typeName;\n const valueType = type_with_extended_attributes(tokeniser, typeName) || tokeniser.error(\"Error parsing generic type record\");\n ret.subtype.push(keyIdlType, valueType);\n break;\n }\n }\n if (!ret.idlType) tokeniser.error(`Error parsing generic type ${base.type}`);\n ret.tokens.close = tokeniser.consume(\">\") || tokeniser.error(`Missing closing bracket after ${base.type}`);\n return ret.this;\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nfunction type_suffix(tokeniser, obj) {\n const nullable = tokeniser.consume(\"?\");\n if (nullable) {\n obj.tokens.nullable = nullable;\n }\n if (tokeniser.probe(\"?\")) tokeniser.error(\"Can't nullable more than once\");\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction single_type(tokeniser, typeName) {\n let ret = generic_type(tokeniser, typeName) || primitive_type(tokeniser);\n if (!ret) {\n const base = tokeniser.consume(\"identifier\", ...stringTypes, ...typeNameKeywords);\n if (!base) {\n return;\n }\n ret = new Type({ source: tokeniser.source, tokens: { base } });\n if (tokeniser.probe(\"<\")) tokeniser.error(`Unsupported generic type ${base.value}`);\n }\n if (ret.generic === \"Promise\" && tokeniser.probe(\"?\")) {\n tokeniser.error(\"Promise type cannot be nullable\");\n }\n ret.type = typeName || null;\n type_suffix(tokeniser, ret);\n if (ret.nullable && ret.idlType === \"any\") tokeniser.error(\"Type `any` cannot be made nullable\");\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} type\n */\nfunction union_type(tokeniser, type) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"(\");\n if (!tokens.open) return;\n const ret = autoParenter(new Type({ source: tokeniser.source, tokens }));\n ret.type = type || null;\n while (true) {\n const typ = type_with_extended_attributes(tokeniser) || tokeniser.error(\"No type after open parenthesis or 'or' in union type\");\n if (typ.idlType === \"any\") tokeniser.error(\"Type `any` cannot be included in a union type\");\n if (typ.generic === \"Promise\") tokeniser.error(\"Type `Promise` cannot be included in a union type\");\n ret.subtype.push(typ);\n const or = tokeniser.consume(\"or\");\n if (or) {\n typ.tokens.separator = or;\n }\n else break;\n }\n if (ret.idlType.length < 2) {\n tokeniser.error(\"At least two types are expected in a union type but found less\");\n }\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unterminated union type\");\n type_suffix(tokeniser, ret);\n return ret.this;\n}\n\nexport class Type extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\n static parse(tokeniser, typeName) {\n return single_type(tokeniser, typeName) || union_type(tokeniser, typeName);\n }\n\n constructor({ source, tokens }) {\n super({ source, tokens });\n Object.defineProperty(this, \"subtype\", { value: [], writable: true });\n this.extAttrs = [];\n }\n\n get generic() {\n if (this.subtype.length && this.tokens.base) {\n return this.tokens.base.value;\n }\n return \"\";\n }\n get nullable() {\n return Boolean(this.tokens.nullable);\n }\n get union() {\n return Boolean(this.subtype.length) && !this.tokens.base;\n }\n get idlType() {\n if (this.subtype.length) {\n return this.subtype;\n }\n // Adding prefixes/postfixes for \"unrestricted float\", etc.\n const name = [\n this.tokens.prefix,\n this.tokens.base,\n this.tokens.postfix\n ].filter(t => t).map(t => t.value).join(\" \");\n return unescape(name);\n }\n\n *validate(defs) {\n /*\n * If a union is nullable, its subunions cannot include a dictionary\n * If not, subunions may include dictionaries if each union is not nullable\n */\n const typedef = !this.union && defs.unique.get(this.idlType);\n const target =\n this.union ? this :\n (typedef && typedef.type === \"typedef\") ? typedef.idlType :\n undefined;\n if (target && this.nullable) {\n // do not allow any dictionary\n const { reference } = idlTypeIncludesDictionary(target, defs) || {};\n if (reference) {\n const targetToken = (this.union ? reference : this).tokens.base;\n const message = `Nullable union cannot include a dictionary type`;\n yield validationError(targetToken, this, \"no-nullable-union-dict\", message);\n }\n } else {\n // allow some dictionary\n for (const subtype of this.subtype) {\n yield* subtype.validate(defs);\n }\n }\n }\n}\n","import { Base } from \"./base.js\";\nimport { const_data, const_value } from \"./helpers.js\";\n\nexport class Default extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const assign = tokeniser.consume(\"=\");\n if (!assign) {\n return null;\n }\n const def = const_value(tokeniser) || tokeniser.consume(\"string\", \"null\", \"[\", \"{\") || tokeniser.error(\"No value for default\");\n const expression = [def];\n if (def.type === \"[\") {\n const close = tokeniser.consume(\"]\") || tokeniser.error(\"Default sequence value must be empty\");\n expression.push(close);\n } else if (def.type === \"{\") {\n const close = tokeniser.consume(\"}\") || tokeniser.error(\"Default dictionary value must be empty\");\n expression.push(close);\n }\n return new Default({ source: tokeniser.source, tokens: { assign }, expression });\n }\n\n constructor({ source, tokens, expression }) {\n super({ source, tokens });\n expression.parent = this;\n Object.defineProperty(this, \"expression\", { value: expression });\n }\n\n get type() {\n return const_data(this.expression[0]).type;\n }\n get value() {\n return const_data(this.expression[0]).value;\n }\n get negative() {\n return const_data(this.expression[0]).negative;\n }\n}\n","// @ts-check\n\nexport class ArrayBase extends Array {\n constructor({ source, tokens }) {\n super();\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens },\n parent: { value: null, writable: true }\n });\n }\n}\n","// @ts-check\n\nimport { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Token extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} type\n */\n static parser(tokeniser, type) {\n return () => {\n const value = tokeniser.consume(type);\n if (value) {\n return new Token({ source: tokeniser.source, tokens: { value } });\n }\n };\n }\n\n get value() {\n return unescape(this.tokens.value.value);\n }\n}\n","import { Base } from \"./base.js\";\nimport { ArrayBase } from \"./array-base.js\";\nimport { Token } from \"./token.js\";\nimport { list, argument_list, autoParenter, unescape } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} tokenName\n */\nfunction tokens(tokeniser, tokenName) {\n const toks = list(tokeniser, {\n parser: Token.parser(tokeniser, tokenName),\n listName: tokenName + \" list\"\n });\n return toks;\n}\n\n/**\n * This will allow a set of identifiers or strings to be parsed.\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nfunction identifiersOrStrings(tokeniser) {\n let toks = tokens(tokeniser, \"identifier\");\n if (toks.length) {\n return toks;\n }\n toks = tokens(tokeniser, \"string\");\n if (toks.length) {\n return toks;\n }\n tokeniser.error(`Expected identifiers or strings but none found`);\n}\n\n\nclass ExtendedAttributeParameters extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = { assign: tokeniser.consume(\"=\") };\n const ret = autoParenter(new ExtendedAttributeParameters({ source: tokeniser.source, tokens }));\n if (tokens.assign) {\n tokens.secondaryName = tokeniser.consume(\"identifier\", \"decimal\", \"integer\", \"string\");\n }\n tokens.open = tokeniser.consume(\"(\");\n if (tokens.open) {\n ret.list = ret.rhsIsList ?\n // [Exposed=(Window,Worker)]\n identifiersOrStrings(tokeniser) :\n // [NamedConstructor=Audio(DOMString src)] or [Constructor(DOMString str)]\n argument_list(tokeniser);\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unexpected token in extended attribute argument list\");\n } else if (ret.hasRhs && !tokens.secondaryName) {\n tokeniser.error(\"No right hand side to extended attribute assignment\");\n }\n return ret.this;\n }\n\n get rhsIsList() {\n return this.tokens.assign && !this.tokens.secondaryName;\n }\n\n get rhsType() {\n if (this.rhsIsList) {\n return this.list[0].tokens.value.type + \"-list\";\n }\n if (this.tokens.secondaryName) {\n return this.tokens.secondaryName.type;\n }\n return null;\n }\n}\n\nexport class SimpleExtendedAttribute extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consume(\"identifier\");\n if (name) {\n return new SimpleExtendedAttribute({\n source: tokeniser.source,\n tokens: { name },\n params: ExtendedAttributeParameters.parse(tokeniser)\n });\n }\n }\n\n constructor({ source, tokens, params }) {\n super({ source, tokens });\n params.parent = this;\n Object.defineProperty(this, \"params\", { value: params });\n }\n\n get type() {\n return \"extended-attribute\";\n }\n get name() {\n return this.tokens.name.value;\n }\n get rhs() {\n const { rhsType: type, tokens, list } = this.params;\n if (!type) {\n return null;\n }\n const value = this.params.rhsIsList ? list : unescape(tokens.secondaryName.value);\n return { type, value };\n }\n get arguments() {\n const { rhsIsList, list } = this.params;\n if (!list || rhsIsList) {\n return [];\n }\n return list;\n }\n\n *validate(defs) {\n if (this.name === \"NoInterfaceObject\") {\n const message = `\\`[NoInterfaceObject]\\` extended attribute is an \\\nundesirable feature that may be removed from Web IDL in the future. Refer to the \\\n[relevant upstream PR](https://github.com/heycam/webidl/pull/609) for more \\\ninformation.`;\n yield validationError(this.tokens.name, this, \"no-nointerfaceobject\", message, { level: \"warning\" });\n }\n for (const arg of this.arguments) {\n yield* arg.validate(defs);\n }\n }\n}\n\n// Note: we parse something simpler than the official syntax. It's all that ever\n// seems to be used\nexport class ExtendedAttributes extends ArrayBase {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"[\");\n if (!tokens.open) return new ExtendedAttributes({});\n const ret = new ExtendedAttributes({ source: tokeniser.source, tokens });\n ret.push(...list(tokeniser, {\n parser: SimpleExtendedAttribute.parse,\n listName: \"extended attribute\"\n }));\n tokens.close = tokeniser.consume(\"]\") || tokeniser.error(\"Unexpected closing token of extended attribute\");\n if (!ret.length) {\n tokeniser.error(\"Found an empty extended attribute\");\n }\n if (tokeniser.probe(\"[\")) {\n tokeniser.error(\"Illegal double extended attribute lists, consider merging them\");\n }\n return ret;\n }\n\n *validate(defs) {\n for (const extAttr of this) {\n yield* extAttr.validate(defs);\n }\n }\n}\n","// @ts-check\n\nimport { Base } from \"./base.js\";\nimport { Default } from \"./default.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { unescape, type_with_extended_attributes, autoParenter, getFirstToken } from \"./helpers.js\";\nimport { argumentNameKeywords, Tokeniser } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary, dictionaryIncludesRequiredField } from \"../validators/helpers.js\";\n\nexport class Argument extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Argument({ source: tokeniser.source, tokens }));\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.optional = tokeniser.consume(\"optional\");\n ret.idlType = type_with_extended_attributes(tokeniser, \"argument-type\");\n if (!ret.idlType) {\n return tokeniser.unconsume(start_position);\n }\n if (!tokens.optional) {\n tokens.variadic = tokeniser.consume(\"...\");\n }\n tokens.name = tokeniser.consume(\"identifier\", ...argumentNameKeywords);\n if (!tokens.name) {\n return tokeniser.unconsume(start_position);\n }\n ret.default = tokens.optional ? Default.parse(tokeniser) : null;\n return ret.this;\n }\n\n get type() {\n return \"argument\";\n }\n get optional() {\n return !!this.tokens.optional;\n }\n get variadic() {\n return !!this.tokens.variadic;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /**\n * @param {import(\"../validator.js\").Definitions} defs\n */\n *validate(defs) {\n yield* this.idlType.validate(defs);\n const result = idlTypeIncludesDictionary(this.idlType, defs, { useNullableInner: true });\n if (result) {\n if (this.idlType.nullable) {\n const message = `Dictionary arguments cannot be nullable.`;\n yield validationError(this.tokens.name, this, \"no-nullable-dict-arg\", message);\n } else if (!this.optional) {\n if (this.parent && !dictionaryIncludesRequiredField(result.dictionary, defs) && isLastRequiredArgument(this)) {\n const message = `Dictionary argument must be optional if it has no required fields`;\n yield validationError(this.tokens.name, this, \"dict-arg-optional\", message, {\n autofix: autofixDictionaryArgumentOptionality(this)\n });\n }\n } else if (!this.default) {\n const message = `Optional dictionary arguments must have a default value of \\`{}\\`.`;\n yield validationError(this.tokens.name, this, \"dict-arg-default\", message, {\n autofix: autofixOptionalDictionaryDefaultValue(this)\n });\n }\n }\n }\n}\n\n/**\n * @param {Argument} arg\n */\nfunction isLastRequiredArgument(arg) {\n const list = arg.parent.arguments || arg.parent.list;\n const index = list.indexOf(arg);\n const requiredExists = list.slice(index + 1).some(a => !a.optional);\n return !requiredExists;\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixDictionaryArgumentOptionality(arg) {\n return () => {\n const firstToken = getFirstToken(arg.idlType);\n arg.tokens.optional = { type: \"optional\", value: \"optional\", trivia: firstToken.trivia };\n firstToken.trivia = \" \";\n autofixOptionalDictionaryDefaultValue(arg)();\n };\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixOptionalDictionaryDefaultValue(arg) {\n return () => {\n arg.default = Default.parse(new Tokeniser(\" = {}\"));\n };\n}\n","import { Base } from \"./base.js\";\nimport { return_type, argument_list, unescape, autoParenter } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\nexport class Operation extends Base {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {Token} [options.special]\n * @param {Token} [options.regular]\n */\n static parse(tokeniser, { special, regular } = {}) {\n const tokens = { special };\n const ret = autoParenter(new Operation({ source: tokeniser.source, tokens }));\n if (special && special.value === \"stringifier\") {\n tokens.termination = tokeniser.consume(\";\");\n if (tokens.termination) {\n ret.arguments = [];\n return ret;\n }\n }\n if (!special && !regular) {\n tokens.special = tokeniser.consume(\"getter\", \"setter\", \"deleter\");\n }\n ret.idlType = return_type(tokeniser) || tokeniser.error(\"Missing return type\");\n tokens.name = tokeniser.consume(\"identifier\", \"includes\");\n tokens.open = tokeniser.consume(\"(\") || tokeniser.error(\"Invalid operation\");\n ret.arguments = argument_list(tokeniser);\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unterminated operation\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated operation, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"operation\";\n }\n get name() {\n const { name } = this.tokens;\n if (!name) {\n return \"\";\n }\n return unescape(name.value);\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n\n *validate(defs) {\n if (!this.name && [\"\", \"static\"].includes(this.special)) {\n const message = `Regular or static operations must have both a return type and an identifier.`;\n yield validationError(this.tokens.open, this, \"incomplete-op\", message);\n }\n if (this.idlType) {\n yield* this.idlType.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n}\n","import { Base } from \"./base.js\";\nimport { type_with_extended_attributes, unescape, autoParenter } from \"./helpers.js\";\n\nexport class Attribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, { special, noInherit = false, readonly = false } = {}) {\n const start_position = tokeniser.position;\n const tokens = { special };\n const ret = autoParenter(new Attribute({ source: tokeniser.source, tokens }));\n if (!special && !noInherit) {\n tokens.special = tokeniser.consume(\"inherit\");\n }\n if (ret.special === \"inherit\" && tokeniser.probe(\"readonly\")) {\n tokeniser.error(\"Inherited attributes cannot be read-only\");\n }\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (readonly && !tokens.readonly && tokeniser.probe(\"attribute\")) {\n tokeniser.error(\"Attributes must be readonly in this context\");\n }\n tokens.base = tokeniser.consume(\"attribute\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n ret.idlType = type_with_extended_attributes(tokeniser, \"attribute-type\") || tokeniser.error(\"Attribute lacks a type\");\n switch (ret.idlType.generic) {\n case \"sequence\":\n case \"record\": tokeniser.error(`Attributes cannot accept ${ret.idlType.generic} types`);\n }\n tokens.name = tokeniser.consume(\"identifier\", \"async\", \"required\") || tokeniser.error(\"Attribute lacks a name\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated attribute, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"attribute\";\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n}\n","import { Type } from \"./type.js\";\nimport { Argument } from \"./argument.js\";\nimport { ExtendedAttributes, SimpleExtendedAttribute } from \"./extended-attributes.js\";\nimport { Operation } from \"./operation.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\n\n/**\n * @param {string} identifier\n */\nexport function unescape(identifier) {\n return identifier.startsWith('_') ? identifier.slice(1) : identifier;\n}\n\n/**\n * Parses comma-separated list\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {object} args\n * @param {Function} args.parser parser function for each item\n * @param {boolean} [args.allowDangler] whether to allow dangling comma\n * @param {string} [args.listName] the name to be shown on error messages\n */\nexport function list(tokeniser, { parser, allowDangler, listName = \"list\" }) {\n const first = parser(tokeniser);\n if (!first) {\n return [];\n }\n first.tokens.separator = tokeniser.consume(\",\");\n const items = [first];\n while (first.tokens.separator) {\n const item = parser(tokeniser);\n if (!item) {\n if (!allowDangler) {\n tokeniser.error(`Trailing comma in ${listName}`);\n }\n break;\n }\n item.tokens.separator = tokeniser.consume(\",\");\n items.push(item);\n if (!item.tokens.separator) break;\n }\n return items;\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nexport function const_value(tokeniser) {\n return tokeniser.consume(\"true\", \"false\", \"Infinity\", \"-Infinity\", \"NaN\", \"decimal\", \"integer\");\n}\n\n/**\n * @param {object} token\n * @param {string} token.type\n * @param {string} token.value\n */\nexport function const_data({ type, value }) {\n switch (type) {\n case \"true\":\n case \"false\":\n return { type: \"boolean\", value: type === \"true\" };\n case \"Infinity\":\n case \"-Infinity\":\n return { type: \"Infinity\", negative: type.startsWith(\"-\") };\n case \"[\":\n return { type: \"sequence\", value: [] };\n case \"{\":\n return { type: \"dictionary\" };\n case \"decimal\":\n case \"integer\":\n return { type: \"number\", value };\n case \"string\":\n return { type: \"string\", value: value.slice(1, -1) };\n default:\n return { type };\n }\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nexport function primitive_type(tokeniser) {\n function integer_type() {\n const prefix = tokeniser.consume(\"unsigned\");\n const base = tokeniser.consume(\"short\", \"long\");\n if (base) {\n const postfix = tokeniser.consume(\"long\");\n return new Type({ source, tokens: { prefix, base, postfix } });\n }\n if (prefix) tokeniser.error(\"Failed to parse integer type\");\n }\n\n function decimal_type() {\n const prefix = tokeniser.consume(\"unrestricted\");\n const base = tokeniser.consume(\"float\", \"double\");\n if (base) {\n return new Type({ source, tokens: { prefix, base } });\n }\n if (prefix) tokeniser.error(\"Failed to parse float type\");\n }\n\n const { source } = tokeniser;\n const num_type = integer_type(tokeniser) || decimal_type(tokeniser);\n if (num_type) return num_type;\n const base = tokeniser.consume(\"boolean\", \"byte\", \"octet\");\n if (base) {\n return new Type({ source, tokens: { base } });\n }\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nexport function argument_list(tokeniser) {\n return list(tokeniser, { parser: Argument.parse, listName: \"arguments list\" });\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nexport function type_with_extended_attributes(tokeniser, typeName) {\n const extAttrs = ExtendedAttributes.parse(tokeniser);\n const ret = Type.parse(tokeniser, typeName);\n if (ret) autoParenter(ret).extAttrs = extAttrs;\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nexport function return_type(tokeniser, typeName) {\n const typ = Type.parse(tokeniser, typeName || \"return-type\");\n if (typ) {\n return typ;\n }\n const voidToken = tokeniser.consume(\"void\");\n if (voidToken) {\n const ret = new Type({ source: tokeniser.source, tokens: { base: voidToken } });\n ret.type = \"return-type\";\n return ret;\n }\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nexport function stringifier(tokeniser) {\n const special = tokeniser.consume(\"stringifier\");\n if (!special) return;\n const member = Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"Unterminated stringifier\");\n return member;\n}\n\n/**\n * @param {string} str\n */\nexport function getLastIndentation(str) {\n const lines = str.split(\"\\n\");\n // the first line visually binds to the preceding token\n if (lines.length) {\n const match = lines[lines.length - 1].match(/^\\s+/);\n if (match) {\n return match[0];\n }\n }\n return \"\";\n}\n\n/**\n * @param {string} parentTrivia\n */\nexport function getMemberIndentation(parentTrivia) {\n const indentation = getLastIndentation(parentTrivia);\n const indentCh = indentation.includes(\"\\t\") ? \"\\t\" : \" \";\n return indentation + indentCh;\n}\n\n/**\n * @param {object} def\n * @param {import(\"./extended-attributes.js\").ExtendedAttributes} def.extAttrs\n */\nexport function autofixAddExposedWindow(def) {\n return () => {\n if (def.extAttrs.length){\n const tokeniser = new Tokeniser(\"Exposed=Window,\");\n const exposed = SimpleExtendedAttribute.parse(tokeniser);\n exposed.tokens.separator = tokeniser.consume(\",\");\n const existing = def.extAttrs[0];\n if (!/^\\s/.test(existing.tokens.name.trivia)) {\n existing.tokens.name.trivia = ` ${existing.tokens.name.trivia}`;\n }\n def.extAttrs.unshift(exposed);\n } else {\n autoParenter(def).extAttrs = ExtendedAttributes.parse(new Tokeniser(\"[Exposed=Window]\"));\n const trivia = def.tokens.base.trivia;\n def.extAttrs.tokens.open.trivia = trivia;\n def.tokens.base.trivia = `\\n${getLastIndentation(trivia)}`;\n }\n };\n}\n\n/**\n * Get the first syntax token for the given IDL object.\n * @param {*} data\n */\nexport function getFirstToken(data) {\n if (data.extAttrs.length) {\n return data.extAttrs.tokens.open;\n }\n if (data.type === \"operation\" && !data.special) {\n return getFirstToken(data.idlType);\n }\n const tokens = Object.values(data.tokens).sort((x, y) => x.index - y.index);\n return tokens[0];\n}\n\n/**\n * @template T\n * @param {T[]} array\n * @param {(item: T) => boolean} predicate\n */\nexport function findLastIndex(array, predicate) {\n const index = array.slice().reverse().findIndex(predicate);\n if (index === -1) {\n return index;\n }\n return array.length - index - 1;\n}\n\n/**\n * Returns a proxy that auto-assign `parent` field.\n * @template T\n * @param {T} data\n * @param {*} [parent] The object that will be assigned to `parent`.\n * If absent, it will be `data` by default.\n * @return {T}\n */\nexport function autoParenter(data, parent) {\n if (!parent) {\n // Defaults to `data` unless specified otherwise.\n parent = data;\n }\n if (!data) {\n // This allows `autoParenter(undefined)` which again allows\n // `autoParenter(parse())` where the function may return nothing.\n return data;\n }\n return new Proxy(data, {\n get(target, p) {\n const value = target[p];\n if (Array.isArray(value)) {\n // Wraps the array so that any added items will also automatically\n // get their `parent` values.\n return autoParenter(value, target);\n }\n return value;\n },\n set(target, p, value) {\n target[p] = value;\n if (!value) {\n return true;\n } else if (Array.isArray(value)) {\n // Assigning an array will add `parent` to its items.\n for (const item of value) {\n if (typeof item.parent !== \"undefined\") {\n item.parent = parent;\n }\n }\n } else if (typeof value.parent !== \"undefined\") {\n value.parent = parent;\n }\n return true;\n }\n });\n}\n","import { syntaxError } from \"./error.js\";\nimport { unescape } from \"./productions/helpers.js\";\n\n// These regular expressions use the sticky flag so they will only match at\n// the current location (ie. the offset of lastIndex).\nconst tokenRe = {\n // This expression uses a lookahead assertion to catch false matches\n // against integers early.\n \"decimal\": /-?(?=[0-9]*\\.|[0-9]+[eE])(([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,\n \"integer\": /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,\n \"identifier\": /[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,\n \"string\": /\"[^\"]*\"/y,\n \"whitespace\": /[\\t\\n\\r ]+/y,\n \"comment\": /((\\/(\\/.*|\\*([^*]|\\*[^/])*\\*\\/)[\\t\\n\\r ]*)+)/y,\n \"other\": /[^\\t\\n\\r 0-9A-Za-z]/y\n};\n\nexport const typeNameKeywords = [\n \"ArrayBuffer\",\n \"DataView\",\n \"Int8Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Uint8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8ClampedArray\",\n \"Float32Array\",\n \"Float64Array\",\n \"any\",\n \"object\",\n \"symbol\"\n];\n\nexport const stringTypes = [\n \"ByteString\",\n \"DOMString\",\n \"USVString\"\n];\n\nexport const argumentNameKeywords = [\n \"async\",\n \"attribute\",\n \"callback\",\n \"const\",\n \"constructor\",\n \"deleter\",\n \"dictionary\",\n \"enum\",\n \"getter\",\n \"includes\",\n \"inherit\",\n \"interface\",\n \"iterable\",\n \"maplike\",\n \"namespace\",\n \"partial\",\n \"required\",\n \"setlike\",\n \"setter\",\n \"static\",\n \"stringifier\",\n \"typedef\",\n \"unrestricted\"\n];\n\nconst nonRegexTerminals = [\n \"-Infinity\",\n \"FrozenArray\",\n \"Infinity\",\n \"NaN\",\n \"Promise\",\n \"boolean\",\n \"byte\",\n \"double\",\n \"false\",\n \"float\",\n \"long\",\n \"mixin\",\n \"null\",\n \"octet\",\n \"optional\",\n \"or\",\n \"readonly\",\n \"record\",\n \"sequence\",\n \"short\",\n \"true\",\n \"unsigned\",\n \"void\"\n].concat(argumentNameKeywords, stringTypes, typeNameKeywords);\n\nconst punctuations = [\n \"(\",\n \")\",\n \",\",\n \"...\",\n \":\",\n \";\",\n \"<\",\n \"=\",\n \">\",\n \"?\",\n \"[\",\n \"]\",\n \"{\",\n \"}\"\n];\n\nconst reserved = [\n // \"constructor\" is now a keyword\n \"_constructor\",\n \"toString\",\n \"_toString\",\n];\n\n/**\n * @typedef {ArrayItemType<ReturnType<typeof tokenise>>} Token\n * @param {string} str\n */\nfunction tokenise(str) {\n const tokens = [];\n let lastCharIndex = 0;\n let trivia = \"\";\n let line = 1;\n let index = 0;\n while (lastCharIndex < str.length) {\n const nextChar = str.charAt(lastCharIndex);\n let result = -1;\n\n if (/[\\t\\n\\r ]/.test(nextChar)) {\n result = attemptTokenMatch(\"whitespace\", { noFlushTrivia: true });\n } else if (nextChar === '/') {\n result = attemptTokenMatch(\"comment\", { noFlushTrivia: true });\n }\n\n if (result !== -1) {\n const currentTrivia = tokens.pop().value;\n line += (currentTrivia.match(/\\n/g) || []).length;\n trivia += currentTrivia;\n index -= 1;\n } else if (/[-0-9.A-Z_a-z]/.test(nextChar)) {\n result = attemptTokenMatch(\"decimal\");\n if (result === -1) {\n result = attemptTokenMatch(\"integer\");\n }\n if (result === -1) {\n result = attemptTokenMatch(\"identifier\");\n const lastIndex = tokens.length - 1;\n const token = tokens[lastIndex];\n if (result !== -1) {\n if (reserved.includes(token.value)) {\n const message = `${unescape(token.value)} is a reserved identifier and must not be used.`;\n throw new WebIDLParseError(syntaxError(tokens, lastIndex, null, message));\n } else if (nonRegexTerminals.includes(token.value)) {\n token.type = token.value;\n }\n }\n }\n } else if (nextChar === '\"') {\n result = attemptTokenMatch(\"string\");\n }\n\n for (const punctuation of punctuations) {\n if (str.startsWith(punctuation, lastCharIndex)) {\n tokens.push({ type: punctuation, value: punctuation, trivia, line, index });\n trivia = \"\";\n lastCharIndex += punctuation.length;\n result = lastCharIndex;\n break;\n }\n }\n\n // other as the last try\n if (result === -1) {\n result = attemptTokenMatch(\"other\");\n }\n if (result === -1) {\n throw new Error(\"Token stream not progressing\");\n }\n lastCharIndex = result;\n index += 1;\n }\n\n // remaining trivia as eof\n tokens.push({\n type: \"eof\",\n value: \"\",\n trivia\n });\n\n return tokens;\n\n /**\n * @param {keyof typeof tokenRe} type\n * @param {object} options\n * @param {boolean} [options.noFlushTrivia]\n */\n function attemptTokenMatch(type, { noFlushTrivia } = {}) {\n const re = tokenRe[type];\n re.lastIndex = lastCharIndex;\n const result = re.exec(str);\n if (result) {\n tokens.push({ type, value: result[0], trivia, line, index });\n if (!noFlushTrivia) {\n trivia = \"\";\n }\n return re.lastIndex;\n }\n return -1;\n }\n}\n\nexport class Tokeniser {\n /**\n * @param {string} idl\n */\n constructor(idl) {\n this.source = tokenise(idl);\n this.position = 0;\n }\n\n /**\n * @param {string} message\n * @return {never}\n */\n error(message) {\n throw new WebIDLParseError(syntaxError(this.source, this.position, this.current, message));\n }\n\n /**\n * @param {string} type\n */\n probe(type) {\n return this.source.length > this.position && this.source[this.position].type === type;\n }\n\n /**\n * @param {...string} candidates\n */\n consume(...candidates) {\n for (const type of candidates) {\n if (!this.probe(type)) continue;\n const token = this.source[this.position];\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {number} position\n */\n unconsume(position) {\n this.position = position;\n }\n}\n\nexport class WebIDLParseError extends Error {\n /**\n * @param {object} options\n * @param {string} options.message\n * @param {string} options.bareMessage\n * @param {string} options.context\n * @param {number} options.line\n * @param {*} options.sourceName\n * @param {string} options.input\n * @param {*[]} options.tokens\n */\n constructor({ message, bareMessage, context, line, sourceName, input, tokens }) {\n super(message);\n\n this.name = \"WebIDLParseError\"; // not to be mangled\n this.bareMessage = bareMessage;\n this.context = context;\n this.line = line;\n this.sourceName = sourceName;\n this.input = input;\n this.tokens = tokens;\n }\n}\n","import { list, unescape, autoParenter } from \"./helpers.js\";\nimport { Token } from \"./token.js\";\nimport { Base } from \"./base.js\";\n\nclass EnumValue extends Token {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consume(\"string\");\n if (value) {\n return new EnumValue({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"enum-value\";\n }\n get value() {\n return super.value.slice(1, -1);\n }\n}\n\nexport class Enum extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"enum\");\n if (!tokens.base) {\n return;\n }\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"No name for enum\");\n const ret = autoParenter(new Enum({ source: tokeniser.source, tokens }));\n tokeniser.current = ret.this;\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(\"Bodyless enum\");\n ret.values = list(tokeniser, {\n parser: EnumValue.parse,\n allowDangler: true,\n listName: \"enumeration\"\n });\n if (tokeniser.probe(\"string\")) {\n tokeniser.error(\"No comma between enum values\");\n }\n tokens.close = tokeniser.consume(\"}\") || tokeniser.error(\"Unexpected value in enum\");\n if (!ret.values.length) {\n tokeniser.error(\"No value in enum\");\n }\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"No semicolon after enum\");\n return ret.this;\n }\n\n get type() {\n return \"enum\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n}\n","// @ts-check\n\nimport { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Includes extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const target = tokeniser.consume(\"identifier\");\n if (!target) {\n return;\n }\n const tokens = { target };\n tokens.includes = tokeniser.consume(\"includes\");\n if (!tokens.includes) {\n tokeniser.unconsume(target.index);\n return;\n }\n tokens.mixin = tokeniser.consume(\"identifier\") || tokeniser.error(\"Incomplete includes statement\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"No terminating ; for includes statement\");\n return new Includes({ source: tokeniser.source, tokens });\n }\n\n get type() {\n return \"includes\";\n }\n get target() {\n return unescape(this.tokens.target.value);\n }\n get includes() {\n return unescape(this.tokens.mixin.value);\n }\n}\n","import { Base } from \"./base.js\";\nimport { type_with_extended_attributes, unescape, autoParenter } from \"./helpers.js\";\n\nexport class Typedef extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Typedef({ source: tokeniser.source, tokens }));\n tokens.base = tokeniser.consume(\"typedef\");\n if (!tokens.base) {\n return;\n }\n ret.idlType = type_with_extended_attributes(tokeniser, \"typedef-type\") || tokeniser.error(\"Typedef lacks a type\");\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"Typedef lacks a name\");\n tokeniser.current = ret.this;\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated typedef, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"typedef\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n}\n","import { Base } from \"./base.js\";\nimport { return_type, argument_list, unescape, autoParenter } from \"./helpers.js\";\n\nexport class CallbackFunction extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base) {\n const tokens = { base };\n const ret = autoParenter(new CallbackFunction({ source: tokeniser.source, tokens }));\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"Callback lacks a name\");\n tokeniser.current = ret.this;\n tokens.assign = tokeniser.consume(\"=\") || tokeniser.error(\"Callback lacks an assignment\");\n ret.idlType = return_type(tokeniser) || tokeniser.error(\"Callback lacks a return type\");\n tokens.open = tokeniser.consume(\"(\") || tokeniser.error(\"Callback lacks parentheses for arguments\");\n ret.arguments = argument_list(tokeniser);\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unterminated callback\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated callback, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"callback\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n}\n","import { Base } from \"./base.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { unescape, autoParenter } from \"./helpers.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction inheritance(tokeniser) {\n const colon = tokeniser.consume(\":\");\n if (!colon) {\n return {};\n }\n const inheritance = tokeniser.consume(\"identifier\") || tokeniser.error(\"Inheritance lacks a type\");\n return { colon, inheritance };\n}\n\nexport class Container extends Base {\n /**\n * @template T\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {T} instance\n * @param {*} args\n */\n static parse(tokeniser, instance, { type, inheritable, allowedMembers }) {\n const { tokens } = instance;\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(`Missing name in ${instance.type}`);\n tokeniser.current = instance;\n instance = autoParenter(instance);\n if (inheritable) {\n Object.assign(tokens, inheritance(tokeniser));\n }\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(`Bodyless ${type}`);\n instance.members = [];\n while (true) {\n tokens.close = tokeniser.consume(\"}\");\n if (tokens.close) {\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(`Missing semicolon after ${type}`);\n return instance.this;\n }\n const ea = ExtendedAttributes.parse(tokeniser);\n let mem;\n for (const [parser, ...args] of allowedMembers) {\n mem = autoParenter(parser(tokeniser, ...args));\n if (mem) {\n break;\n }\n }\n if (!mem) {\n tokeniser.error(\"Unknown member\");\n }\n mem.extAttrs = ea;\n instance.members.push(mem.this);\n }\n }\n\n get partial() {\n return !!this.tokens.partial;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get inheritance() {\n if (!this.tokens.inheritance) {\n return null;\n }\n return unescape(this.tokens.inheritance.value);\n }\n\n *validate(defs) {\n for (const member of this.members) {\n if (member.validate) {\n yield* member.validate(defs);\n }\n }\n }\n }\n","import { Base } from \"./base.js\";\nimport { Type } from \"./type.js\";\nimport { const_data, const_value, primitive_type, autoParenter, unescape } from \"./helpers.js\";\n\nexport class Constant extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"const\");\n if (!tokens.base) {\n return;\n }\n let idlType = primitive_type(tokeniser);\n if (!idlType) {\n const base = tokeniser.consume(\"identifier\") || tokeniser.error(\"Const lacks a type\");\n idlType = new Type({ source: tokeniser.source, tokens: { base } });\n }\n if (tokeniser.probe(\"?\")) {\n tokeniser.error(\"Unexpected nullable constant type\");\n }\n idlType.type = \"const-type\";\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"Const lacks a name\");\n tokens.assign = tokeniser.consume(\"=\") || tokeniser.error(\"Const lacks value assignment\");\n tokens.value = const_value(tokeniser) || tokeniser.error(\"Const lacks a value\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated const, expected `;`\");\n const ret = new Constant({ source: tokeniser.source, tokens });\n autoParenter(ret).idlType = idlType;\n return ret;\n }\n\n get type() {\n return \"const\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get value() {\n return const_data(this.tokens.value);\n }\n}\n","import { Base } from \"./base.js\";\nimport { type_with_extended_attributes, autoParenter } from \"./helpers.js\";\n\nexport class IterableLike extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n const tokens = {};\n const ret = autoParenter(new IterableLike({ source: tokeniser.source, tokens }));\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (!tokens.readonly) {\n tokens.async = tokeniser.consume(\"async\");\n }\n tokens.base =\n tokens.readonly ? tokeniser.consume(\"maplike\", \"setlike\") :\n tokens.async ? tokeniser.consume(\"iterable\") :\n tokeniser.consume(\"iterable\", \"maplike\", \"setlike\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n\n const { type } = ret;\n const secondTypeRequired = type === \"maplike\" || ret.async;\n const secondTypeAllowed = secondTypeRequired || type === \"iterable\";\n\n tokens.open = tokeniser.consume(\"<\") || tokeniser.error(`Missing less-than sign \\`<\\` in ${type} declaration`);\n const first = type_with_extended_attributes(tokeniser) || tokeniser.error(`Missing a type argument in ${type} declaration`);\n ret.idlType = [first];\n if (secondTypeAllowed) {\n first.tokens.separator = tokeniser.consume(\",\");\n if (first.tokens.separator) {\n ret.idlType.push(type_with_extended_attributes(tokeniser));\n }\n else if (secondTypeRequired) {\n tokeniser.error(`Missing second type argument in ${type} declaration`);\n }\n }\n tokens.close = tokeniser.consume(\">\") || tokeniser.error(`Missing greater-than sign \\`>\\` in ${type} declaration`);\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(`Missing semicolon after ${type} declaration`);\n\n return ret.this;\n }\n\n get type() {\n return this.tokens.base.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get async() {\n return !!this.tokens.async;\n }\n}\n","// @ts-check\n\nimport { validationError } from \"../error.js\";\n\nexport function* checkInterfaceMemberDuplication(defs, i) {\n const opNames = new Set(getOperations(i).map(op => op.name));\n const partials = defs.partials.get(i.name) || [];\n const mixins = defs.mixinMap.get(i.name) || [];\n for (const ext of [...partials, ...mixins]) {\n const additions = getOperations(ext);\n yield* forEachExtension(additions, opNames, ext, i);\n for (const addition of additions) {\n opNames.add(addition.name);\n }\n }\n\n function* forEachExtension(additions, existings, ext, base) {\n for (const addition of additions) {\n const { name } = addition;\n if (name && existings.has(name)) {\n const message = `The operation \"${name}\" has already been defined for the base interface \"${base.name}\" either in itself or in a mixin`;\n yield validationError(addition.tokens.name, ext, \"no-cross-overload\", message);\n }\n }\n }\n\n function getOperations(i) {\n return i.members\n .filter(({type}) => type === \"operation\");\n }\n}\n","import { Base } from \"./base.js\";\nimport { argument_list, autoParenter } from \"./helpers.js\";\n\nexport class Constructor extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const base = tokeniser.consume(\"constructor\");\n if (!base) {\n return;\n }\n /** @type {Base[\"tokens\"]} */\n const tokens = { base };\n tokens.open = tokeniser.consume(\"(\") || tokeniser.error(\"No argument list in constructor\");\n const args = argument_list(tokeniser);\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unterminated constructor\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"No semicolon after constructor\");\n const ret = new Constructor({ source: tokeniser.source, tokens });\n autoParenter(ret).arguments = args;\n return ret;\n }\n\n get type() {\n return \"constructor\";\n }\n\n *validate(defs) {\n if (this.idlType) {\n yield* this.idlType.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\nimport { IterableLike } from \"./iterable.js\";\nimport { stringifier, autofixAddExposedWindow, getMemberIndentation, getLastIndentation, getFirstToken, findLastIndex, autoParenter } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\nimport { checkInterfaceMemberDuplication } from \"../validators/interface.js\";\nimport { Constructor } from \"./constructor.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nfunction static_member(tokeniser) {\n const special = tokeniser.consume(\"static\");\n if (!special) return;\n const member = Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"No body in static member\");\n return member;\n}\n\nexport class Interface extends Container {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base, { partial = null } = {}) {\n const tokens = { partial, base };\n return Container.parse(tokeniser, new Interface({ source: tokeniser.source, tokens }), {\n type: \"interface\",\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Constructor.parse],\n [static_member],\n [stringifier],\n [IterableLike.parse],\n [Attribute.parse],\n [Operation.parse]\n ]\n });\n }\n\n get type() {\n return \"interface\";\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (\n !this.partial &&\n this.extAttrs.every(extAttr => extAttr.name !== \"Exposed\") &&\n this.extAttrs.every(extAttr => extAttr.name !== \"NoInterfaceObject\")\n ) {\n const message = `Interfaces must have \\`[Exposed]\\` extended attribute. \\\nTo fix, add, for example, \\`[Exposed=Window]\\`. Please also consider carefully \\\nif your interface should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(this.tokens.name, this, \"require-exposed\", message, {\n autofix: autofixAddExposedWindow(this)\n });\n }\n const oldConstructors = this.extAttrs.filter(extAttr => extAttr.name === \"Constructor\");\n for (const constructor of oldConstructors) {\n const message = `Constructors should now be represented as a \\`constructor()\\` operation on the interface \\\ninstead of \\`[Constructor]\\` extended attribute. Refer to the \\\n[WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) \\\nfor more information.`;\n yield validationError(constructor.tokens.name, this, \"constructor-member\", message, {\n autofix: autofixConstructor(this, constructor)\n });\n }\n\n const isGlobal = this.extAttrs.some(extAttr => extAttr.name === \"Global\");\n if (isGlobal) {\n const namedConstructors = this.extAttrs.filter(extAttr => extAttr.name === \"NamedConstructor\");\n for (const named of namedConstructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have named constructors.`;\n yield validationError(named.tokens.name, this, \"no-constructible-global\", message);\n }\n\n const constructors = this.members.filter(member => member.type === \"constructor\");\n for (const named of constructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have constructors.`;\n yield validationError(named.tokens.base, this, \"no-constructible-global\", message);\n }\n }\n\n yield* super.validate(defs);\n if (!this.partial) {\n yield* checkInterfaceMemberDuplication(defs, this);\n }\n }\n}\n\nfunction autofixConstructor(interfaceDef, constructorExtAttr) {\n interfaceDef = autoParenter(interfaceDef);\n return () => {\n const indentation = getLastIndentation(interfaceDef.extAttrs.tokens.open.trivia);\n const memberIndent = interfaceDef.members.length ?\n getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia) :\n getMemberIndentation(indentation);\n const constructorOp = Constructor.parse(new Tokeniser(`\\n${memberIndent}constructor();`));\n constructorOp.extAttrs = [];\n autoParenter(constructorOp).arguments = constructorExtAttr.arguments;\n\n const existingIndex = findLastIndex(interfaceDef.members, m => m.type === \"constructor\");\n interfaceDef.members.splice(existingIndex + 1, 0, constructorOp);\n\n const { close } = interfaceDef.tokens;\n if (!close.trivia.includes(\"\\n\")) {\n close.trivia += `\\n${indentation}`;\n }\n\n const { extAttrs } = interfaceDef;\n const index = extAttrs.indexOf(constructorExtAttr);\n const removed = extAttrs.splice(index, 1);\n if (!extAttrs.length) {\n extAttrs.tokens.open = extAttrs.tokens.close = undefined;\n } else if (extAttrs.length === index) {\n extAttrs[index - 1].tokens.separator = undefined;\n } else if (!extAttrs[index].tokens.name.trivia.trim()) {\n extAttrs[index].tokens.name.trivia = removed[0].tokens.name.trivia;\n }\n };\n}\n","import { Container } from \"./container.js\";\nimport { Constant } from \"./constant.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { stringifier } from \"./helpers.js\";\n\nexport class Mixin extends Container {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {Token} base\n * @param {object} [options]\n * @param {Token} [options.partial]\n */\n static parse(tokeniser, base, { partial } = {}) {\n const tokens = { partial, base };\n tokens.mixin = tokeniser.consume(\"mixin\");\n if (!tokens.mixin) {\n return;\n }\n return Container.parse(tokeniser, new Mixin({ source: tokeniser.source, tokens }), {\n type: \"interface mixin\",\n allowedMembers: [\n [Constant.parse],\n [stringifier],\n [Attribute.parse, { noInherit: true }],\n [Operation.parse, { regular: true }]\n ]\n });\n }\n\n get type() {\n return \"interface mixin\";\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape, type_with_extended_attributes, autoParenter } from \"./helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { Default } from \"./default.js\";\n\nexport class Field extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Field({ source: tokeniser.source, tokens }));\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.required = tokeniser.consume(\"required\");\n ret.idlType = type_with_extended_attributes(tokeniser, \"dictionary-type\") || tokeniser.error(\"Dictionary member lacks a type\");\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"Dictionary member lacks a name\");\n ret.default = Default.parse(tokeniser);\n if (tokens.required && ret.default) tokeniser.error(\"Required member must not have a default\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated dictionary member, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"field\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get required() {\n return !!this.tokens.required;\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n}\n","// @ts-check\n\nimport { Container } from \"./container.js\";\nimport { Field } from \"./field.js\";\n\nexport class Dictionary extends Container {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"dictionary\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(tokeniser, new Dictionary({ source: tokeniser.source, tokens }), {\n type: \"dictionary\",\n inheritable: !partial,\n allowedMembers: [\n [Field.parse],\n ]\n });\n }\n\n get type() {\n return \"dictionary\";\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { validationError } from \"../error.js\";\nimport { autofixAddExposedWindow } from \"./helpers.js\";\n\nexport class Namespace extends Container {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"namespace\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(tokeniser, new Namespace({ source: tokeniser.source, tokens }), {\n type: \"namespace\",\n allowedMembers: [\n [Attribute.parse, { noInherit: true, readonly: true }],\n [Operation.parse, { regular: true }]\n ]\n });\n }\n\n get type() {\n return \"namespace\";\n }\n\n *validate(defs) {\n if (!this.partial && this.extAttrs.every(extAttr => extAttr.name !== \"Exposed\")) {\n const message = `Namespaces must have [Exposed] extended attribute. \\\nTo fix, add, for example, [Exposed=Window]. Please also consider carefully \\\nif your namespace should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(this.tokens.name, this, \"require-exposed\", message, {\n autofix: autofixAddExposedWindow(this)\n });\n }\n yield* super.validate(defs);\n }\n}\n","// @ts-check\n\nimport { Container } from \"./container.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class CallbackInterface extends Container {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser, callback, { partial = null } = {}) {\n const tokens = { callback };\n tokens.base = tokeniser.consume(\"interface\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(tokeniser, new CallbackInterface({ source: tokeniser.source, tokens }), {\n type: \"callback interface\",\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Operation.parse, { regular: true }]\n ]\n });\n }\n\n get type() {\n return \"callback interface\";\n }\n}\n","\"use strict\";\n\nimport { Tokeniser } from \"./tokeniser.js\";\nimport { Enum } from \"./productions/enum.js\";\nimport { Includes } from \"./productions/includes.js\";\nimport { ExtendedAttributes } from \"./productions/extended-attributes.js\";\nimport { Typedef } from \"./productions/typedef.js\";\nimport { CallbackFunction } from \"./productions/callback.js\";\nimport { Interface } from \"./productions/interface.js\";\nimport { Mixin } from \"./productions/mixin.js\";\nimport { Dictionary } from \"./productions/dictionary.js\";\nimport { Namespace } from \"./productions/namespace.js\";\nimport { CallbackInterface } from \"./productions/callback-interface.js\";\nimport { autoParenter } from \"./productions/helpers.js\";\n\n/**\n * @param {Tokeniser} tokeniser\n * @param {object} options\n * @param {boolean} [options.concrete]\n */\nfunction parseByTokens(tokeniser, options) {\n const source = tokeniser.source;\n\n function error(str) {\n tokeniser.error(str);\n }\n\n function consume(...candidates) {\n return tokeniser.consume(...candidates);\n }\n\n function callback() {\n const callback = consume(\"callback\");\n if (!callback) return;\n if (tokeniser.probe(\"interface\")) {\n return CallbackInterface.parse(tokeniser, callback);\n }\n return CallbackFunction.parse(tokeniser, callback);\n }\n\n function interface_(opts) {\n const base = consume(\"interface\");\n if (!base) return;\n const ret = Mixin.parse(tokeniser, base, opts) ||\n Interface.parse(tokeniser, base, opts) ||\n error(\"Interface has no proper body\");\n return ret;\n }\n\n function partial() {\n const partial = consume(\"partial\");\n if (!partial) return;\n return Dictionary.parse(tokeniser, { partial }) ||\n interface_({ partial }) ||\n Namespace.parse(tokeniser, { partial }) ||\n error(\"Partial doesn't apply to anything\");\n }\n\n function definition() {\n return callback() ||\n interface_() ||\n partial() ||\n Dictionary.parse(tokeniser) ||\n Enum.parse(tokeniser) ||\n Typedef.parse(tokeniser) ||\n Includes.parse(tokeniser) ||\n Namespace.parse(tokeniser);\n }\n\n function definitions() {\n if (!source.length) return [];\n const defs = [];\n while (true) {\n const ea = ExtendedAttributes.parse(tokeniser);\n const def = definition();\n if (!def) {\n if (ea.length) error(\"Stray extended attributes\");\n break;\n }\n autoParenter(def).extAttrs = ea;\n defs.push(def);\n }\n const eof = consume(\"eof\");\n if (options.concrete) {\n defs.push(eof);\n }\n return defs;\n }\n const res = definitions();\n if (tokeniser.position < source.length) error(\"Unrecognised tokens\");\n return res;\n}\n\n/**\n * @param {string} str\n * @param {object} [options]\n * @param {*} [options.sourceName]\n * @param {boolean} [options.concrete]\n */\nexport function parse(str, options = {}) {\n const tokeniser = new Tokeniser(str);\n if (typeof options.sourceName !== \"undefined\") {\n tokeniser.source.name = options.sourceName;\n }\n return parseByTokens(tokeniser, options);\n}\n","\"use strict\";\n\nfunction noop(arg) {\n return arg;\n}\n\nconst templates = {\n wrap: items => items.join(\"\"),\n trivia: noop,\n name: noop,\n reference: noop,\n type: noop,\n generic: noop,\n nameless: noop,\n inheritance: noop,\n definition: noop,\n extendedAttribute: noop,\n extendedAttributeReference: noop\n};\n\nexport function write(ast, { templates: ts = templates } = {}) {\n ts = Object.assign({}, templates, ts);\n\n function reference(raw, { unescaped, context }) {\n if (!unescaped) {\n unescaped = raw.startsWith(\"_\") ? raw.slice(1) : raw;\n }\n return ts.reference(raw, unescaped, context);\n }\n\n function token(t, wrapper = noop, ...args) {\n if (!t) {\n return \"\";\n }\n const value = wrapper(t.value, ...args);\n return ts.wrap([ts.trivia(t.trivia), value]);\n }\n\n function reference_token(t, context) {\n return token(t, reference, { context });\n }\n\n function name_token(t, arg) {\n return token(t, ts.name, arg);\n }\n\n function type_body(it) {\n if (it.union || it.generic) {\n return ts.wrap([\n token(it.tokens.base, ts.generic),\n token(it.tokens.open),\n ...it.subtype.map(type),\n token(it.tokens.close)\n ]);\n }\n const firstToken = it.tokens.prefix || it.tokens.base;\n const prefix = it.tokens.prefix ? [\n it.tokens.prefix.value,\n ts.trivia(it.tokens.base.trivia)\n ] : [];\n const ref = reference(ts.wrap([\n ...prefix,\n it.tokens.base.value,\n token(it.tokens.postfix)\n ]), { unescaped: it.idlType, context: it });\n return ts.wrap([ts.trivia(firstToken.trivia), ref]);\n }\n function type(it) {\n return ts.wrap([\n extended_attributes(it.extAttrs),\n type_body(it),\n token(it.tokens.nullable),\n token(it.tokens.separator)\n ]);\n }\n function default_(def) {\n if (!def) {\n return \"\";\n }\n return ts.wrap([\n token(def.tokens.assign),\n ...def.expression.map(t => token(t))\n ]);\n }\n function argument(arg) {\n return ts.wrap([\n extended_attributes(arg.extAttrs),\n token(arg.tokens.optional),\n ts.type(type(arg.idlType)),\n token(arg.tokens.variadic),\n name_token(arg.tokens.name, { data: arg }),\n default_(arg.default),\n token(arg.tokens.separator)\n ]);\n }\n function string(str) {\n return ts.wrap([\n token(str.tokens.value),\n token(str.tokens.separator)\n ]);\n }\n function identifier(id, context) {\n return ts.wrap([\n reference_token(id.tokens.value, context),\n token(id.tokens.separator)\n ]);\n }\n function make_ext_at(it) {\n const { rhsType } = it.params;\n return ts.wrap([\n ts.trivia(it.tokens.name.trivia),\n ts.extendedAttribute(ts.wrap([\n ts.extendedAttributeReference(it.name),\n token(it.params.tokens.assign),\n reference_token(it.params.tokens.secondaryName, it),\n token(it.params.tokens.open),\n ...!it.params.list ? [] :\n it.params.list.map(\n rhsType === \"identifier-list\" ? id => identifier(id, it) :\n rhsType === \"string-list\" ? string :\n argument\n ),\n token(it.params.tokens.close)\n ])),\n token(it.tokens.separator)\n ]);\n }\n function extended_attributes(eats) {\n if (!eats.length) return \"\";\n return ts.wrap([\n token(eats.tokens.open),\n ...eats.map(make_ext_at),\n token(eats.tokens.close)\n ]);\n }\n\n function operation(it, parent) {\n const body = it.idlType ? [\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it, parent }),\n token(it.tokens.open),\n ts.wrap(it.arguments.map(argument)),\n token(it.tokens.close),\n ] : [];\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n it.tokens.name ? token(it.tokens.special) : token(it.tokens.special, ts.nameless, { data: it, parent }),\n ...body,\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n\n function attribute(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.special),\n token(it.tokens.readonly),\n token(it.tokens.base),\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it, parent }),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n\n function constructor(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base, ts.nameless, { data: it, parent }),\n token(it.tokens.open),\n ts.wrap(it.arguments.map(argument)),\n token(it.tokens.close),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n\n function inheritance(inh) {\n if (!inh.tokens.inheritance) {\n return \"\";\n }\n return ts.wrap([\n token(inh.tokens.colon),\n ts.trivia(inh.tokens.inheritance.trivia),\n ts.inheritance(reference(inh.tokens.inheritance.value, { context: inh }))\n ]);\n }\n\n function container(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.callback),\n token(it.tokens.partial),\n token(it.tokens.base),\n token(it.tokens.mixin),\n name_token(it.tokens.name, { data: it }),\n inheritance(it),\n token(it.tokens.open),\n iterate(it.members, it),\n token(it.tokens.close),\n token(it.tokens.termination)\n ]), { data: it });\n }\n\n function field(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.required),\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it, parent }),\n default_(it.default),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n function const_(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base),\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it, parent }),\n token(it.tokens.assign),\n token(it.tokens.value),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n function typedef(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base),\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it }),\n token(it.tokens.termination)\n ]), { data: it });\n }\n function includes(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n reference_token(it.tokens.target, it),\n token(it.tokens.includes),\n reference_token(it.tokens.mixin, it),\n token(it.tokens.termination)\n ]), { data: it });\n }\n function callback(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base),\n name_token(it.tokens.name, { data: it }),\n token(it.tokens.assign),\n ts.type(type(it.idlType)),\n token(it.tokens.open),\n ...it.arguments.map(argument),\n token(it.tokens.close),\n token(it.tokens.termination),\n ]), { data: it });\n }\n function enum_(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base),\n name_token(it.tokens.name, { data: it }),\n token(it.tokens.open),\n iterate(it.values, it),\n token(it.tokens.close),\n token(it.tokens.termination)\n ]), { data: it });\n }\n function enum_value(v, parent) {\n return ts.wrap([\n ts.trivia(v.tokens.value.trivia),\n ts.definition(\n ts.wrap(['\"', ts.name(v.value, { data: v, parent }), '\"']),\n { data: v, parent }\n ),\n token(v.tokens.separator)\n ]);\n }\n function iterable_like(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.readonly),\n token(it.tokens.async),\n token(it.tokens.base, ts.generic),\n token(it.tokens.open),\n ts.wrap(it.idlType.map(type)),\n token(it.tokens.close),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n function eof(it) {\n return ts.trivia(it.trivia);\n }\n\n const table = {\n interface: container,\n \"interface mixin\": container,\n namespace: container,\n operation,\n attribute,\n constructor,\n dictionary: container,\n field,\n const: const_,\n typedef,\n includes,\n callback,\n enum: enum_,\n \"enum-value\": enum_value,\n iterable: iterable_like,\n maplike: iterable_like,\n setlike: iterable_like,\n \"callback interface\": container,\n eof\n };\n function dispatch(it, parent) {\n const dispatcher = table[it.type];\n if (!dispatcher) {\n throw new Error(`Type \"${it.type}\" is unsupported`);\n }\n return table[it.type](it, parent);\n }\n function iterate(things, parent) {\n if (!things) return;\n const results = things.map(thing => dispatch(thing, parent));\n return ts.wrap(results);\n }\n return iterate(ast);\n}\n","\"use strict\";\n\nimport { validationError as error } from \"./error.js\";\n\nfunction getMixinMap(all, unique) {\n const map = new Map();\n const includes = all.filter(def => def.type === \"includes\");\n for (const include of includes) {\n const mixin = unique.get(include.includes);\n if (!mixin) {\n continue;\n }\n const array = map.get(include.target);\n if (array) {\n array.push(mixin);\n } else {\n map.set(include.target, [mixin]);\n }\n }\n return map;\n}\n\n/**\n * @typedef {ReturnType<typeof groupDefinitions>} Definitions\n */\nfunction groupDefinitions(all) {\n const unique = new Map();\n const duplicates = new Set();\n const partials = new Map();\n for (const def of all) {\n if (def.partial) {\n const array = partials.get(def.name);\n if (array) {\n array.push(def);\n } else {\n partials.set(def.name, [def]);\n }\n continue;\n }\n if (!def.name) {\n continue;\n }\n if (!unique.has(def.name)) {\n unique.set(def.name, def);\n } else {\n duplicates.add(def);\n }\n }\n return {\n all,\n unique,\n partials,\n duplicates,\n mixinMap: getMixinMap(all, unique),\n cache: {\n typedefIncludesDictionary: new WeakMap(),\n dictionaryIncludesRequiredField: new WeakMap()\n },\n };\n}\n\nfunction* checkDuplicatedNames({ unique, duplicates }) {\n for (const dup of duplicates) {\n const { name } = dup;\n const message = `The name \"${name}\" of type \"${unique.get(name).type}\" was already seen`;\n yield error(dup.tokens.name, dup, \"no-duplicate\", message);\n }\n}\n\nfunction* validateIterable(ast) {\n const defs = groupDefinitions(ast);\n for (const def of defs.all) {\n if (def.validate) {\n yield* def.validate(defs);\n }\n }\n yield* checkDuplicatedNames(defs);\n}\n\n// Remove this once all of our support targets expose `.flat()` by default\nfunction flatten(array) {\n if (array.flat) {\n return array.flat();\n }\n return [].concat(...array);\n}\n\n/**\n * @param {*} ast AST or array of ASTs\n */\nexport function validate(ast) {\n return [...validateIterable(flatten(ast))];\n}\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";\n/*! (c) Andrea Giammarchi - ISC */var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var u=t.WeakMap,i={};\n/*! (c) Andrea Giammarchi - ISC */try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}var e=i.WeakSet,n={};\n/*! (c) Andrea Giammarchi - ISC */try{n.Map=Map}catch(e){n.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:function(e){return r(e)},set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var l=e(n[r],1);if(t.insertBefore(l,a),o&&u&&l.selected){u=!u;var c=t.selectedIndex;t.selectedIndex=c<0?r:s.call(t.querySelectorAll(\"option\"),l)}r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var l=t,c=i;l<n&&c<a&&o(e[l],r[c]);)l++,c++;if(c===a)return t;t=l+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,l,c,s,f,h){!function(e,t,n,r,i,a,o,u,l){for(var c=new k,s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:c.set(r[i],1),m(t,n,r,i++,i,f<u?t(a[f],0):l);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:c.has(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,l,c,s,f,h,d,v=n+a,p=[];e:for(u=0;u<=v;u++){if(50<u)return null;for(d=u-1,f=u?p[u-1]:[0,0],h=p[u]=[],l=-u;l<=u;l+=2){for(c=(s=l===-u||l!==u&&f[d+l-1]<f[d+l+1]?f[d+l+1]:f[d+l-1]+1)-l;s<a&&c<n&&o(r[i+s],e[t+c]);)s++,c++;if(s===a&&c===n)break e;h[u+l]=s}}var g=Array(u/2+v/2),m=g.length-1;for(u=p.length-1;0<=u;u--){for(;0<s&&0<c&&o(r[i+s-1],e[t+c-1]);)g[m--]=0,s--,c--;if(!u)break;d=u-1,f=u?p[u-1]:[0,0],(l=s-c)===-u||l!==u&&f[d+l-1]<f[d+l+1]?(c--,g[m--]=1):(s--,g[m--]=-1)}return g}(n,r,a,o,u,c,f)||function(e,t,n,r,i,a,o,u){var l=0,c=r<u?r:u,s=Array(c++),f=Array(c);f[0]=-1;for(var h=1;h<c;h++)f[h]=o;for(var d=new k,v=a;v<o;v++)d.set(i[v],v);for(var p=t;p<n;p++){var g=d.get(e[p]);null!=g&&-1<(l=S(f,c,g))&&(f[l]=g,s[l]={newi:p,oldi:g,prev:s[l-1]})}for(l=--c,--o;f[l]>o;)--l;c=u+r-l;var m=Array(c),y=s[l];for(--n;y;){for(var b=y,w=b.newi,N=b.oldi;w<n;)m[--c]=1,--n;for(;N<o;)m[--c]=-1,--o;m[--c]=0,--n,--o,y=y.prev}for(;t<=n;)m[--c]=1,--n;for(;a<=o;)m[--c]=-1,--o;return m}(n,r,i,a,o,u,l,c),e,t,n,r,o,u,s,h)}var k=n.Map,s=[].indexOf,S=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}\n/*! (c) 2018 Andrea Giammarchi (ISC) */).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,l=u,c=0,s=n.length,f=0;c<l&&f<s&&i(t[c],n[f]);)c++,f++;for(;c<l&&f<s&&i(t[l-1],n[s-1]);)l--,s--;var h=c===l,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,c,u,o)),n;if(d&&c<l)return E(a,t,c,l),n;var v=l-c,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,c,l,i)))return m(a,e,n,f,g,a(t[c],0)),m(a,e,n,g+v,s,x(a,t,l,u,o)),n}else if(p<v&&-1<(g=w(t,c,l,n,f,s,i)))return E(a,t,c,g),E(a,t,g+p,l),n;return v<2||p<2?(m(a,e,n,f,s,a(t[c],0)),E(a,t,c,l)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,c,l,i)?m(a,e,n,f,s,x(a,t,l,u,o)):C(a,e,n,f,s,p,t,c,l,v,u,i,o),n}var r,o={};\n/*! (c) Andrea Giammarchi - ISC */function c(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}o.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(c[r=\"prototype\"]=new c(\"\").constructor[r],c);var f=o.CustomEvent;function h(){return this}function d(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||v(this,n,t.call(this,e))},set:function(e){v(this,n,e)}}}var v=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(h.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var p,g,A,T,M,_,O={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:O,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):O[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(g=(p={}.toString).call([]),function(e){return p.call(e)===g}),R=(A=N,T=\"fragment\",_=\"content\"in H(M=\"template\")?function(e){var t=H(M);return t.innerHTML=e,t.content}:function(e){var t=H(T),n=H(M),r=null;if(/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var i=RegExp.$1;n.innerHTML=\"<table>\"+e+\"</table>\",r=n.querySelectorAll(i)}else n.innerHTML=e,r=n.childNodes;return F(t,r),t},function(e,t){return(\"svg\"===t?function(e){var t=H(T),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:_)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===T?A.createDocumentFragment():A.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}\n/*! (c) Andrea Giammarchi - ISC */\nvar I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",le=\"[^\"+ue+\"\\\\/>\\\"'=]+\",ce=\"[\"+ue+\"]+\"+le,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+le.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+ce+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+ce+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+ce+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}function ye(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}function be(e,t,n,r){for(var i=new k,a=e.attributes,o=[],u=o.slice.call(a,0),l=u.length,c=0;c<l;){var s,f=u[c++],h=f.value===Y;if(h||1<(s=f.value.split(te)).length){var d=f.name;if(!i.has(d)){var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(i.set(d,p),h)t.push(we(p,r,v,null));else{for(var g=s.length-2;g--;)n.shift();t.push(we(p,r,v,s))}}o.push(f)}}for(var m=((c=0)<(l=o.length)&&ee&&!(\"ownerSVGElement\"in e));c<l;){var y=o[c++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,c=0;c<l;)w.setAttributeNode(a[c++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe=new u,Ee=new u;function Ce(o,f){var e=(o.convert||\n/*! (c) Andrea Giammarchi - ISC */\nfunction(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);!function(e){var t=e.childNodes,n=t.length;for(;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}\n/*! (c) Andrea Giammarchi - ISC */(n);var u=[];!function e(t,n,r,i){for(var a,o,u=t.childNodes,l=u.length,c=0;c<l;){var s=u[c];switch(s.nodeType){case re:var f=i.concat(c);be(s,n,r,f),e(s,n,r,f);break;case ne:var h=s.textContent;if(h===Y)r.shift(),n.push(ae.test(t.nodeName)?Ne(t,i):(a=s,o=i.concat(c),{type:\"any\",node:a,path:o}));else switch(h.slice(0,2)){case\"/*\":if(\"*/\"!==h.slice(-2))break;case\"👻\":t.removeChild(s),c--,l--}break;case ie:ae.test(t.nodeName)&&X.call(s.textContent)===te&&(r.shift(),n.push(Ne(t,i)))}c++}}(n,u,f.slice(0),[]);var r={content:n,updates:function(l){for(var c=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=ye(l,n.path);switch(n.type){case\"any\":c.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?c.push({fn:a,sparse:!1}):(t+=i.length-2,c.push({fn:a,sparse:!0,values:i}));break;case\"text\":c.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=c[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return l}}};return xe.set(f,r),r}function ke(n){return function(e){var t=Ee.get(n);return null!=t&&t.template===e||(t=function(e,t){var n=xe.get(t)||Ce(e,t),r=U.call(N,n.content,!0),i={content:r,template:t,updates:n.updates(r)};return Ee.set(e,i),i}(n,e)),t.updates.apply(null,arguments),t.content}}var Se,Ae,Te=(Se=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Ae=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),_e(n,!0)}(e,t):_e(e.style,!1)});\n/*! (c) Andrea Giammarchi - ISC */function Me(e,t,n){return t+\"-\"+n.toLowerCase()}function _e(a,o){var u,l;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&l!==e)for(n in l)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Se.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ae,Me),\":\",e[t],\";\");return n.join(\"\")}(l=t):l=e;break}default:l!=e&&(u=\"string\",l=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Oe,je,Le=(Oe=[].slice,(je=Pe.prototype).ELEMENT_NODE=1,je.nodeType=111,je.remove=function(e){var t=this.childNodes,n=this.firstChild,r=this.lastChild;if(this._=null,e&&2===t.length)r.parentNode.removeChild(r);else{var i=this.ownerDocument.createRange();i.setStartBefore(e?t[1]:n),i.setEndAfter(r),i.deleteContents()}return n},je.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},Pe);function Pe(e){var t=this.childNodes=Oe.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function De(e){return{html:e}}function We(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return We(e.render(),t);default:return e}}function $e(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then(De).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function Re(e){return null!=e&&\"then\"in e}var Fe,He,Ie,ze,Ve,Ze=\"ownerSVGElement\",Ge=\"connected\",qe=h.prototype.nodeType,Be=Le.prototype.nodeType,Je=(He=(Fe={Event:f,WeakSet:e}).Event,Ie=Fe.WeakSet,ze=!0,Ve=null,function(e){return ze&&(ze=!ze,Ve=new Ie,function(t){var i=new Ie,a=new Ie;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)l((t=e[r]).removedNodes,\"disconnected\",a,i),l(t.addedNodes,\"connected\",i,a)}function l(e,t,n,r){for(var i,a=new He(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&c(i,a,t,n,r));}function c(e,t,n,r,i){Ve.has(e)&&!r.has(e)&&(i.delete(e),r.add(e),e.dispatchEvent(t));for(var a=e.children||[],o=a.length,u=0;u<o;c(a[u++],t,n,r,i));}}(e.ownerDocument)),Ve.add(e),e}),Ke=/^(?:form|list)$/i,Qe=[].slice;function Ue(e){return this.type=e,ke(this)}var Xe=!(Ue.prototype={attribute:function(n,r,e){var i,t=Ze in n;if(\"style\"===r)return Te(n,e,t);if(/^on/.test(r)){var a=r.slice(2);return a===Ge||\"disconnected\"===a?Je(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ke.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o=!1,u=e.cloneNode(!0);return function(e){i!==e&&(i=e,u.value!==e&&(null==e?(o&&(o=!1,n.removeAttributeNode(u)),u.value=e):(u.value=e,o||(o=!0,n.setAttributeNode(u)))))}},any:function(n,r){var i,a={node:We,before:n},o=Ze in n?\"svg\":\"html\",u=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":u?i!==t&&(i=t,r[0].textContent=t):(u=!0,i=t,r=l(n.parentNode,r,[function(e,t){return e.ownerDocument.createTextNode(t)}(n,t)],a));break;case\"function\":e(t(n));break;case\"object\":case\"undefined\":if(null==t){u=!1,r=l(n.parentNode,r,[],a);break}default:if(u=!1,$(i=t))if(0===t.length)r.length&&(r=l(n.parentNode,r,[],a));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),Re(t[0])){Promise.all(t).then(e);break}default:r=l(n.parentNode,r,t,a)}else!function(e){return\"ELEMENT_NODE\"in e}(t)?Re(t)?t.then(e):\"placeholder\"in t?$e(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?r=l(n.parentNode,r,Qe.call(R([].concat(t.html).join(\"\"),o).childNodes),a):e(\"length\"in t?Qe.call(t):W.invoke(t,e)):r=l(n.parentNode,r,11===t.nodeType?Qe.call(t.childNodes):[t],a)}}},text:function(r){var i;return function e(t){if(i!==t){var n=typeof(i=t);\"object\"==n&&t?Re(t)?t.then(e):\"placeholder\"in t?$e(t,e):e(\"text\"in t?String(t.text):\"any\"in t?t.any:\"html\"in t?[].concat(t.html).join(\"\"):\"length\"in t?Qe.call(t).join(\"\"):W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t}}}}),Ye=function(e){var t,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),r=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);if(n||r){var i={},a=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return i[t]||(i[t]=e)};if(r)Ye=a;else{var o=new u;Ye=function(e){return o.get(e)||function(e,t){return o.set(e,t),t}(e,a(e))}}}else Xe=!0;return et(e)};function et(e){return Xe?e:Ye(e)}function tt(e){for(var t=arguments.length,n=[et(e)],r=1;r<t;)n.push(arguments[r++]);return n}var nt=new u,rt=function(t){var n,r,i;return function(){var e=tt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ue(t),n=at(r.apply(r,e))):r.apply(r,e),n}},it=function(e,t){var n=t.indexOf(\":\"),r=nt.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||nt.set(e,r={}),r[i]||(r[i]=rt(t))},at=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Le(t):e},ot=new u;function ut(){var e=ot.get(this),t=tt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ue(Ze in this?\"svg\":\"html\");ot.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}\n/*! (c) Andrea Giammarchi (ISC) */.apply(this,t),this}var lt,ct,st,ft,ht=W.define,dt=Ue.prototype;function vt(e){return arguments.length<2?null==e?rt(\"html\"):\"string\"==typeof e?vt.wire(null,e):\"raw\"in e?rt(\"html\")(e):\"nodeType\"in e?vt.bind(e):it(e,\"html\"):(\"raw\"in e?rt(\"html\"):vt.wire).apply(null,arguments)}return vt.Component=h,vt.bind=function(e){return ut.bind(e)},vt.define=ht,vt.diff=l,(vt.hyper=vt).observe=Je,vt.tagger=dt,vt.wire=function(e,t){return null==e?rt(t||\"html\"):it(e,t||\"html\")},vt._={WeakMap:u,WeakSet:e},lt=rt,ct=new u,st=Object.create,ft=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(h,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i=t.get(e)||ft(e,t);switch(typeof r){case\"object\":case\"function\":var a=i.w||(i.w=new u);return a.get(r)||function(e,t,n){return e.set(t,n),n}(a,r,new e(n));default:var o=i.p||(i.p=st(null));return o[r]||(o[r]=new e(n))}}(this,ct.get(e)||function(e){var t=new k;return ct.set(e,t),t}(e),e,null==t?\"default\":t)}}}),Object.defineProperties(h.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:d(\"html\",lt),svg:d(\"svg\",lt),state:d(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new f(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),vt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar marked = createCommonjsModule(function (module, exports) {\n(function(root) {\n\n/**\n * Block-Level Grammar\n */\n\nvar block = {\n newline: /^\\n+/,\n code: /^( {4}[^\\n]+\\n*)+/,\n fences: /^ {0,3}(`{3,}|~{3,})([^`~\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?:\\n+|$)|$)/,\n hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6}) +([^\\n]*?)(?: +#+)? *(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3})(bull) [\\s\\S]+?(?:hr|def|\\n{2,}(?! )(?!\\1bull )\\n*|\\s*$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?\\\\?>\\\\n*' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?>\\\\n*' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>\\\\n*' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:\\\\n{2,}|$)' // (6)\n + '|<(?!script|pre|style)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:\\\\n{2,}|$)' // (7) open tag\n + '|</(?!script|pre|style)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:\\\\n{2,}|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *\\n? *<?([^\\s>]+)>?(?:(?: +\\n? *| *\\n *)(title))? *(?:\\n+|$)/,\n nptable: noop,\n table: noop,\n lheading: /^([^\\n]+)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\[\\[\\]]|[^\\[\\]])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}\\.)/;\nblock.item = /^( *)(bull) ?[^\\n]*(?:\\n(?!\\1bull ?)[^\\n]*)*/;\nblock.item = edit(block.item, 'gm')\n .replace(/bull/g, block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?-->/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} +')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}|~{3,})[^`\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = merge({}, block);\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = merge({}, block.normal, {\n nptable: /^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:.*[^>\\n ].*(?:\\n|$))*)\\n*|$)/,\n table: /^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n((?: *[^>\\n ].*(?:\\n|$))*)\\n*|$)/\n});\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = merge({}, block.normal, {\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^ *(#{1,6}) *([^\\n]+?) *(?:#+ *)?(?:\\n+|$)/,\n fences: noop, // fences not supported\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Block Lexer\n */\n\nfunction Lexer(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || marked.defaults;\n this.rules = block.normal;\n\n if (this.options.pedantic) {\n this.rules = block.pedantic;\n } else if (this.options.gfm) {\n this.rules = block.gfm;\n }\n}\n\n/**\n * Expose Block Rules\n */\n\nLexer.rules = block;\n\n/**\n * Static Lex Method\n */\n\nLexer.lex = function(src, options) {\n var lexer = new Lexer(options);\n return lexer.lex(src);\n};\n\n/**\n * Preprocessing\n */\n\nLexer.prototype.lex = function(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n')\n .replace(/\\t/g, ' ')\n .replace(/\\u00a0/g, ' ')\n .replace(/\\u2424/g, '\\n');\n\n return this.token(src, true);\n};\n\n/**\n * Lexing\n */\n\nLexer.prototype.token = function(src, top) {\n src = src.replace(/^ +$/gm, '');\n var next,\n loose,\n cap,\n bull,\n b,\n item,\n listStart,\n listItems,\n t,\n space,\n i,\n tag,\n l,\n isordered,\n istask,\n ischecked;\n\n while (src) {\n // newline\n if (cap = this.rules.newline.exec(src)) {\n src = src.substring(cap[0].length);\n if (cap[0].length > 1) {\n this.tokens.push({\n type: 'space'\n });\n }\n }\n\n // code\n if (cap = this.rules.code.exec(src)) {\n var lastToken = this.tokens[this.tokens.length - 1];\n src = src.substring(cap[0].length);\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && lastToken.type === 'paragraph') {\n lastToken.text += '\\n' + cap[0].trimRight();\n } else {\n cap = cap[0].replace(/^ {4}/gm, '');\n this.tokens.push({\n type: 'code',\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(cap, '\\n')\n : cap\n });\n }\n continue;\n }\n\n // fences\n if (cap = this.rules.fences.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'code',\n lang: cap[2] ? cap[2].trim() : cap[2],\n text: cap[3] || ''\n });\n continue;\n }\n\n // heading\n if (cap = this.rules.heading.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'heading',\n depth: cap[1].length,\n text: cap[2]\n });\n continue;\n }\n\n // table no leading pipe (gfm)\n if (cap = this.rules.nptable.exec(src)) {\n item = {\n type: 'table',\n header: splitCells(cap[1].replace(/^ *| *\\| *$/g, '')),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n cells: cap[3] ? cap[3].replace(/\\n$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n src = src.substring(cap[0].length);\n\n for (i = 0; i < item.align.length; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n for (i = 0; i < item.cells.length; i++) {\n item.cells[i] = splitCells(item.cells[i], item.header.length);\n }\n\n this.tokens.push(item);\n\n continue;\n }\n }\n\n // hr\n if (cap = this.rules.hr.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'hr'\n });\n continue;\n }\n\n // blockquote\n if (cap = this.rules.blockquote.exec(src)) {\n src = src.substring(cap[0].length);\n\n this.tokens.push({\n type: 'blockquote_start'\n });\n\n cap = cap[0].replace(/^ *> ?/gm, '');\n\n // Pass `top` to keep the current\n // \"toplevel\" state. This is exactly\n // how markdown.pl works.\n this.token(cap, top);\n\n this.tokens.push({\n type: 'blockquote_end'\n });\n\n continue;\n }\n\n // list\n if (cap = this.rules.list.exec(src)) {\n src = src.substring(cap[0].length);\n bull = cap[2];\n isordered = bull.length > 1;\n\n listStart = {\n type: 'list_start',\n ordered: isordered,\n start: isordered ? +bull : '',\n loose: false\n };\n\n this.tokens.push(listStart);\n\n // Get each top-level item.\n cap = cap[0].match(this.rules.item);\n\n listItems = [];\n next = false;\n l = cap.length;\n i = 0;\n\n for (; i < l; i++) {\n item = cap[i];\n\n // Remove the list item's bullet\n // so it is seen as the next token.\n space = item.length;\n item = item.replace(/^ *([*+-]|\\d+\\.) */, '');\n\n // Outdent whatever the\n // list item contains. Hacky.\n if (~item.indexOf('\\n ')) {\n space -= item.length;\n item = !this.options.pedantic\n ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')\n : item.replace(/^ {1,4}/gm, '');\n }\n\n // Determine whether the next list item belongs here.\n // Backpedal if it does not belong in this list.\n if (i !== l - 1) {\n b = block.bullet.exec(cap[i + 1])[0];\n if (bull.length > 1 ? b.length === 1\n : (b.length > 1 || (this.options.smartLists && b !== bull))) {\n src = cap.slice(i + 1).join('\\n') + src;\n i = l - 1;\n }\n }\n\n // Determine whether item is loose or not.\n // Use: /(^|\\n)(?! )[^\\n]+\\n\\n(?!\\s*$)/\n // for discount behavior.\n loose = next || /\\n\\n(?!\\s*$)/.test(item);\n if (i !== l - 1) {\n next = item.charAt(item.length - 1) === '\\n';\n if (!loose) loose = next;\n }\n\n if (loose) {\n listStart.loose = true;\n }\n\n // Check for task list items\n istask = /^\\[[ xX]\\] /.test(item);\n ischecked = undefined;\n if (istask) {\n ischecked = item[1] !== ' ';\n item = item.replace(/^\\[[ xX]\\] +/, '');\n }\n\n t = {\n type: 'list_item_start',\n task: istask,\n checked: ischecked,\n loose: loose\n };\n\n listItems.push(t);\n this.tokens.push(t);\n\n // Recurse.\n this.token(item, false);\n\n this.tokens.push({\n type: 'list_item_end'\n });\n }\n\n if (listStart.loose) {\n l = listItems.length;\n i = 0;\n for (; i < l; i++) {\n listItems[i].loose = true;\n }\n }\n\n this.tokens.push({\n type: 'list_end'\n });\n\n continue;\n }\n\n // html\n if (cap = this.rules.html.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: this.options.sanitize\n ? 'paragraph'\n : 'html',\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]\n });\n continue;\n }\n\n // def\n if (top && (cap = this.rules.def.exec(src))) {\n src = src.substring(cap[0].length);\n if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);\n tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n if (!this.tokens.links[tag]) {\n this.tokens.links[tag] = {\n href: cap[2],\n title: cap[3]\n };\n }\n continue;\n }\n\n // table (gfm)\n if (cap = this.rules.table.exec(src)) {\n item = {\n type: 'table',\n header: splitCells(cap[1].replace(/^ *| *\\| *$/g, '')),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n cells: cap[3] ? cap[3].replace(/\\n$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n src = src.substring(cap[0].length);\n\n for (i = 0; i < item.align.length; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n for (i = 0; i < item.cells.length; i++) {\n item.cells[i] = splitCells(\n item.cells[i].replace(/^ *\\| *| *\\| *$/g, ''),\n item.header.length);\n }\n\n this.tokens.push(item);\n\n continue;\n }\n }\n\n // lheading\n if (cap = this.rules.lheading.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'heading',\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1]\n });\n continue;\n }\n\n // top-level paragraph\n if (top && (cap = this.rules.paragraph.exec(src))) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'paragraph',\n text: cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1]\n });\n continue;\n }\n\n // text\n if (cap = this.rules.text.exec(src)) {\n // Top-level should never reach here.\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'text',\n text: cap[0]\n });\n continue;\n }\n\n if (src) {\n throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));\n }\n }\n\n return this.tokens;\n};\n\n/**\n * Inline-Level Grammar\n */\n\nvar inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noop,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(?!\\s*\\])((?:\\\\[\\[\\]]?|[^\\[\\]\\\\])+)\\]/,\n nolink: /^!?\\[(?!\\s*\\])((?:\\[[^\\[\\]]*\\]|\\\\[\\[\\]]|[^\\[\\]])*)\\](?:\\[\\])?/,\n strong: /^__([^\\s_])__(?!_)|^\\*\\*([^\\s*])\\*\\*(?!\\*)|^__([^\\s][\\s\\S]*?[^\\s])__(?!_)|^\\*\\*([^\\s][\\s\\S]*?[^\\s])\\*\\*(?!\\*)/,\n em: /^_([^\\s_])_(?!_)|^\\*([^\\s*<\\[])\\*(?!\\*)|^_([^\\s<][\\s\\S]*?[^\\s_])_(?!_|[^\\spunctuation])|^_([^\\s_<][\\s\\S]*?[^\\s])_(?!_|[^\\spunctuation])|^\\*([^\\s<\"][\\s\\S]*?[^\\s\\*])\\*(?!\\*|[^\\spunctuation])|^\\*([^\\s*\"<\\[][\\s\\S]*?[^\\s])\\*(?!\\*)/,\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noop,\n text: /^(`+|[^`])(?:[\\s\\S]*?(?:(?=[\\\\<!\\[`*]|\\b_|$)|[^ ](?= {2,}\\n))|(?= {2,}\\n))/\n};\n\n// list of punctuation marks from common mark spec\n// without ` and ] to workaround Rule 17 (inline code blocks/links)\ninline._punctuation = '!\"#$%&\\'()*+,\\\\-./:;<=>?@\\\\[^_{|}~';\ninline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', block._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[[^\\[\\]]*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\[<>]?|[^\\s<>\\\\])*>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = merge({}, inline);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = merge({}, inline.normal, {\n strong: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n em: /^_(?=\\S)([\\s\\S]*?\\S)_(?!_)|^\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)/,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = merge({}, inline.normal, {\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,\n del: /^~+(?=\\S)([\\s\\S]*?\\S)~+/,\n text: /^(`+|[^`])(?:[\\s\\S]*?(?:(?=[\\\\<!\\[`*~]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))|(?= {2,}\\n|[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))/\n});\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n});\n\n/**\n * Inline Lexer & Compiler\n */\n\nfunction InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}\n\n/**\n * Expose Inline Rules\n */\n\nInlineLexer.rules = inline;\n\n/**\n * Static Lexing/Compiling Method\n */\n\nInlineLexer.output = function(src, links, options) {\n var inline = new InlineLexer(links, options);\n return inline.output(src);\n};\n\n/**\n * Lexing/Compiling\n */\n\nInlineLexer.prototype.output = function(src) {\n var out = '',\n link,\n text,\n href,\n title,\n cap,\n prevCapZero;\n\n while (src) {\n // escape\n if (cap = this.rules.escape.exec(src)) {\n src = src.substring(cap[0].length);\n out += escape(cap[1]);\n continue;\n }\n\n // tag\n if (cap = this.rules.tag.exec(src)) {\n if (!this.inLink && /^<a /i.test(cap[0])) {\n this.inLink = true;\n } else if (this.inLink && /^<\\/a>/i.test(cap[0])) {\n this.inLink = false;\n }\n if (!this.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.inRawBlock = true;\n } else if (this.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.inRawBlock = false;\n }\n\n src = src.substring(cap[0].length);\n out += this.options.sanitize\n ? this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0])\n : cap[0];\n continue;\n }\n\n // link\n if (cap = this.rules.link.exec(src)) {\n var lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n var linkLen = 4 + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n src = src.substring(cap[0].length);\n this.inLink = true;\n href = cap[2];\n if (this.options.pedantic) {\n link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n } else {\n title = '';\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim().replace(/^<([\\s\\S]*)>$/, '$1');\n out += this.outputLink(cap, {\n href: InlineLexer.escapes(href),\n title: InlineLexer.escapes(title)\n });\n this.inLink = false;\n continue;\n }\n\n // reflink, nolink\n if ((cap = this.rules.reflink.exec(src))\n || (cap = this.rules.nolink.exec(src))) {\n src = src.substring(cap[0].length);\n link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = this.links[link.toLowerCase()];\n if (!link || !link.href) {\n out += cap[0].charAt(0);\n src = cap[0].substring(1) + src;\n continue;\n }\n this.inLink = true;\n out += this.outputLink(cap, link);\n this.inLink = false;\n continue;\n }\n\n // strong\n if (cap = this.rules.strong.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1]));\n continue;\n }\n\n // em\n if (cap = this.rules.em.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1]));\n continue;\n }\n\n // code\n if (cap = this.rules.code.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.codespan(escape(cap[2].trim(), true));\n continue;\n }\n\n // br\n if (cap = this.rules.br.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.br();\n continue;\n }\n\n // del (gfm)\n if (cap = this.rules.del.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.del(this.output(cap[1]));\n continue;\n }\n\n // autolink\n if (cap = this.rules.autolink.exec(src)) {\n src = src.substring(cap[0].length);\n if (cap[2] === '@') {\n text = escape(this.mangle(cap[1]));\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n out += this.renderer.link(href, null, text);\n continue;\n }\n\n // url (gfm)\n if (!this.inLink && (cap = this.rules.url.exec(src))) {\n if (cap[2] === '@') {\n text = escape(cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + text;\n } else {\n href = text;\n }\n }\n src = src.substring(cap[0].length);\n out += this.renderer.link(href, null, text);\n continue;\n }\n\n // text\n if (cap = this.rules.text.exec(src)) {\n src = src.substring(cap[0].length);\n if (this.inRawBlock) {\n out += this.renderer.text(this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]);\n } else {\n out += this.renderer.text(escape(this.smartypants(cap[0])));\n }\n continue;\n }\n\n if (src) {\n throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));\n }\n }\n\n return out;\n};\n\nInlineLexer.escapes = function(text) {\n return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;\n};\n\n/**\n * Compile Link\n */\n\nInlineLexer.prototype.outputLink = function(cap, link) {\n var href = link.href,\n title = link.title ? escape(link.title) : null;\n\n return cap[0].charAt(0) !== '!'\n ? this.renderer.link(href, title, this.output(cap[1]))\n : this.renderer.image(href, title, escape(cap[1]));\n};\n\n/**\n * Smartypants Transformations\n */\n\nInlineLexer.prototype.smartypants = function(text) {\n if (!this.options.smartypants) return text;\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n};\n\n/**\n * Mangle Links\n */\n\nInlineLexer.prototype.mangle = function(text) {\n if (!this.options.mangle) return text;\n var out = '',\n l = text.length,\n i = 0,\n ch;\n\n for (; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n};\n\n/**\n * Renderer\n */\n\nfunction Renderer(options) {\n this.options = options || marked.defaults;\n}\n\nRenderer.prototype.code = function(code, infostring, escaped) {\n var lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n var out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang, true)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n};\n\nRenderer.prototype.blockquote = function(quote) {\n return '<blockquote>\\n' + quote + '</blockquote>\\n';\n};\n\nRenderer.prototype.html = function(html) {\n return html;\n};\n\nRenderer.prototype.heading = function(text, level, raw, slugger) {\n if (this.options.headerIds) {\n return '<h'\n + level\n + ' id=\"'\n + this.options.headerPrefix\n + slugger.slug(raw)\n + '\">'\n + text\n + '</h'\n + level\n + '>\\n';\n }\n // ignore IDs\n return '<h' + level + '>' + text + '</h' + level + '>\\n';\n};\n\nRenderer.prototype.hr = function() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n};\n\nRenderer.prototype.list = function(body, ordered, start) {\n var type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n};\n\nRenderer.prototype.listitem = function(text) {\n return '<li>' + text + '</li>\\n';\n};\n\nRenderer.prototype.checkbox = function(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n};\n\nRenderer.prototype.paragraph = function(text) {\n return '<p>' + text + '</p>\\n';\n};\n\nRenderer.prototype.table = function(header, body) {\n if (body) body = '<tbody>' + body + '</tbody>';\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n};\n\nRenderer.prototype.tablerow = function(content) {\n return '<tr>\\n' + content + '</tr>\\n';\n};\n\nRenderer.prototype.tablecell = function(content, flags) {\n var type = flags.header ? 'th' : 'td';\n var tag = flags.align\n ? '<' + type + ' align=\"' + flags.align + '\">'\n : '<' + type + '>';\n return tag + content + '</' + type + '>\\n';\n};\n\n// span level renderer\nRenderer.prototype.strong = function(text) {\n return '<strong>' + text + '</strong>';\n};\n\nRenderer.prototype.em = function(text) {\n return '<em>' + text + '</em>';\n};\n\nRenderer.prototype.codespan = function(text) {\n return '<code>' + text + '</code>';\n};\n\nRenderer.prototype.br = function() {\n return this.options.xhtml ? '<br/>' : '<br>';\n};\n\nRenderer.prototype.del = function(text) {\n return '<del>' + text + '</del>';\n};\n\nRenderer.prototype.link = function(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n var out = '<a href=\"' + escape(href) + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n};\n\nRenderer.prototype.image = function(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n var out = '<img src=\"' + href + '\" alt=\"' + text + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n};\n\nRenderer.prototype.text = function(text) {\n return text;\n};\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\n\nfunction TextRenderer() {}\n\n// no need for block level renderers\n\nTextRenderer.prototype.strong =\nTextRenderer.prototype.em =\nTextRenderer.prototype.codespan =\nTextRenderer.prototype.del =\nTextRenderer.prototype.text = function(text) {\n return text;\n};\n\nTextRenderer.prototype.link =\nTextRenderer.prototype.image = function(href, title, text) {\n return '' + text;\n};\n\nTextRenderer.prototype.br = function() {\n return '';\n};\n\n/**\n * Parsing & Compiling\n */\n\nfunction Parser(options) {\n this.tokens = [];\n this.token = null;\n this.options = options || marked.defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.slugger = new Slugger();\n}\n\n/**\n * Static Parse Method\n */\n\nParser.parse = function(src, options) {\n var parser = new Parser(options);\n return parser.parse(src);\n};\n\n/**\n * Parse Loop\n */\n\nParser.prototype.parse = function(src) {\n this.inline = new InlineLexer(src.links, this.options);\n // use an InlineLexer with a TextRenderer to extract pure text\n this.inlineText = new InlineLexer(\n src.links,\n merge({}, this.options, { renderer: new TextRenderer() })\n );\n this.tokens = src.reverse();\n\n var out = '';\n while (this.next()) {\n out += this.tok();\n }\n\n return out;\n};\n\n/**\n * Next Token\n */\n\nParser.prototype.next = function() {\n this.token = this.tokens.pop();\n return this.token;\n};\n\n/**\n * Preview Next Token\n */\n\nParser.prototype.peek = function() {\n return this.tokens[this.tokens.length - 1] || 0;\n};\n\n/**\n * Parse Text Tokens\n */\n\nParser.prototype.parseText = function() {\n var body = this.token.text;\n\n while (this.peek().type === 'text') {\n body += '\\n' + this.next().text;\n }\n\n return this.inline.output(body);\n};\n\n/**\n * Parse Current Token\n */\n\nParser.prototype.tok = function() {\n switch (this.token.type) {\n case 'space': {\n return '';\n }\n case 'hr': {\n return this.renderer.hr();\n }\n case 'heading': {\n return this.renderer.heading(\n this.inline.output(this.token.text),\n this.token.depth,\n unescape(this.inlineText.output(this.token.text)),\n this.slugger);\n }\n case 'code': {\n return this.renderer.code(this.token.text,\n this.token.lang,\n this.token.escaped);\n }\n case 'table': {\n var header = '',\n body = '',\n i,\n row,\n cell,\n j;\n\n // header\n cell = '';\n for (i = 0; i < this.token.header.length; i++) {\n cell += this.renderer.tablecell(\n this.inline.output(this.token.header[i]),\n { header: true, align: this.token.align[i] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n for (i = 0; i < this.token.cells.length; i++) {\n row = this.token.cells[i];\n\n cell = '';\n for (j = 0; j < row.length; j++) {\n cell += this.renderer.tablecell(\n this.inline.output(row[j]),\n { header: false, align: this.token.align[j] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n return this.renderer.table(header, body);\n }\n case 'blockquote_start': {\n body = '';\n\n while (this.next().type !== 'blockquote_end') {\n body += this.tok();\n }\n\n return this.renderer.blockquote(body);\n }\n case 'list_start': {\n body = '';\n var ordered = this.token.ordered,\n start = this.token.start;\n\n while (this.next().type !== 'list_end') {\n body += this.tok();\n }\n\n return this.renderer.list(body, ordered, start);\n }\n case 'list_item_start': {\n body = '';\n var loose = this.token.loose;\n var checked = this.token.checked;\n var task = this.token.task;\n\n if (this.token.task) {\n body += this.renderer.checkbox(checked);\n }\n\n while (this.next().type !== 'list_item_end') {\n body += !loose && this.token.type === 'text'\n ? this.parseText()\n : this.tok();\n }\n return this.renderer.listitem(body, task, checked);\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n return this.renderer.html(this.token.text);\n }\n case 'paragraph': {\n return this.renderer.paragraph(this.inline.output(this.token.text));\n }\n case 'text': {\n return this.renderer.paragraph(this.parseText());\n }\n default: {\n var errMsg = 'Token with \"' + this.token.type + '\" type was not found.';\n if (this.options.silent) {\n console.log(errMsg);\n } else {\n throw new Error(errMsg);\n }\n }\n }\n};\n\n/**\n * Slugger generates header id\n */\n\nfunction Slugger() {\n this.seen = {};\n}\n\n/**\n * Convert string to unique id\n */\n\nSlugger.prototype.slug = function(value) {\n var slug = value\n .toLowerCase()\n .trim()\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n\n if (this.seen.hasOwnProperty(slug)) {\n var originalSlug = slug;\n do {\n this.seen[originalSlug]++;\n slug = originalSlug + '-' + this.seen[originalSlug];\n } while (this.seen.hasOwnProperty(slug));\n }\n this.seen[slug] = 0;\n\n return slug;\n};\n\n/**\n * Helpers\n */\n\nfunction escape(html, encode) {\n if (encode) {\n if (escape.escapeTest.test(html)) {\n return html.replace(escape.escapeReplace, function(ch) { return escape.replacements[ch]; });\n }\n } else {\n if (escape.escapeTestNoEncode.test(html)) {\n return html.replace(escape.escapeReplaceNoEncode, function(ch) { return escape.replacements[ch]; });\n }\n }\n\n return html;\n}\n\nescape.escapeTest = /[&<>\"']/;\nescape.escapeReplace = /[&<>\"']/g;\nescape.replacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n\nescape.escapeTestNoEncode = /[<>\"']|&(?!#?\\w+;)/;\nescape.escapeReplaceNoEncode = /[<>\"']|&(?!#?\\w+;)/g;\n\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(/&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig, function(_, n) {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nfunction edit(regex, opt) {\n regex = regex.source || regex;\n opt = opt || '';\n return {\n replace: function(name, val) {\n val = val.source || val;\n val = val.replace(/(^|[^\\[])\\^/g, '$1');\n regex = regex.replace(name, val);\n return this;\n },\n getRegex: function() {\n return new RegExp(regex, opt);\n }\n };\n}\n\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n try {\n var prot = decodeURIComponent(unescape(href))\n .replace(/[^\\w:]/g, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (/^[^:]+:\\/*[^/]*$/.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n\n if (href.slice(0, 2) === '//') {\n return base.replace(/:[\\s\\S]*/, ':') + href;\n } else if (href.charAt(0) === '/') {\n return base.replace(/(:\\/*[^/]*)[\\s\\S]*/, '$1') + href;\n } else {\n return base + href;\n }\n}\nvar baseUrls = {};\nvar originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\nfunction noop() {}\nnoop.exec = noop;\n\nfunction merge(obj) {\n var i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n}\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n var row = tableRow.replace(/\\|/g, function(match, offset, str) {\n var escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/),\n i = 0;\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n// Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n// /c*$/ is vulnerable to REDOS.\n// invert: Remove suffix of non-c chars instead. Default falsey.\nfunction rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n var level = 0;\n for (var i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n/**\n * Marked\n */\n\nfunction marked(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (callback || typeof opt === 'function') {\n if (!callback) {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n var highlight = opt.highlight,\n tokens,\n pending,\n i = 0;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n pending = tokens.length;\n\n var done = function(err) {\n if (err) {\n opt.highlight = highlight;\n return callback(err);\n }\n\n var out;\n\n try {\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!pending) return done();\n\n for (; i < tokens.length; i++) {\n (function(token) {\n if (token.type !== 'code') {\n return --pending || done();\n }\n return highlight(token.text, token.lang, function(err, code) {\n if (err) return done(err);\n if (code == null || code === token.text) {\n return --pending || done();\n }\n token.text = code;\n token.escaped = true;\n --pending || done();\n });\n })(tokens[i]);\n }\n\n return;\n }\n try {\n if (opt) opt = merge({}, marked.defaults, opt);\n checkSanitizeDeprecation(opt);\n return Parser.parse(Lexer.lex(src, opt), opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if ((opt || marked.defaults).silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n merge(marked.defaults, opt);\n return marked;\n};\n\nmarked.getDefaults = function() {\n return {\n baseUrl: null,\n breaks: false,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: new Renderer(),\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartLists: false,\n smartypants: false,\n xhtml: false\n };\n};\n\nmarked.defaults = marked.getDefaults();\n\n/**\n * Expose\n */\n\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\n\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\n\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\n\nmarked.InlineLexer = InlineLexer;\nmarked.inlineLexer = InlineLexer.output;\n\nmarked.Slugger = Slugger;\n\nmarked.parse = marked;\n\n{\n module.exports = marked;\n}\n})();\n});\n\nexport default marked;\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar pluralize = createCommonjsModule(function (module, exports) {\n/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n // Node.\n module.exports = pluralize();\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(commonjsGlobal, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Lower cased words. E.g. \"hello\".\n if (word === word.toLowerCase()) return token.toLowerCase();\n\n // Upper cased words. E.g. \"WHISKY\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word The word to pluralize\n * @param {number} count How many of the word exist\n * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['passerby', 'passersby']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'aircraft',\n 'alcohol',\n 'ammo',\n 'analytics',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'firmware',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'hardware',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'mud',\n 'manga',\n 'news',\n 'only',\n 'personnel',\n 'pike',\n 'plankton',\n 'pliers',\n 'police',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'software',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transportation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n /pok[eé]mon$/i,\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n});\n\nexport default pluralize;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/esm/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport _hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\nimport _marked from \"../../js/deps/builds/marked.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\n\n/** @type {import(\"idb\")} */\n// @ts-ignore\nexport const idb = _idb;\nexport const webidl2 = _webidl2;\n/** @type {import(\"hyperhtml\").default} */\n// @ts-ignore\nexport const hyperHTML = _hyperHTML;\n/** @type {import(\"marked\")} */\n// @ts-ignore\nexport const marked = _marked;\n/** @type {import(\"pluralize\")} */\n// @ts-ignore\nexport const pluralize = _pluralize;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n * Note that the content of SECTION elements, and elements with a\n * class name of \"note\", \"issue\" or \"req\" are also parsed.\n *\n * The HTML created by the Markdown parser is turned into a nested\n * structure of SECTION elements, following the structure given by\n * the headings. For example, the following markup:\n *\n * Title\n * -----\n *\n * ### Subtitle ###\n *\n * Here's some text.\n *\n * ### Another subtitle ###\n *\n * More text.\n *\n * will be transformed into:\n *\n * <section>\n * <h2>Title</h2>\n * <section>\n * <h3>Subtitle</h3>\n * <p>Here's some text.</p>\n * </section>\n * <section>\n * <h3>Another subtitle</h3>\n * <p>More text.</p>\n * </section>\n * </section>\n *\n * The whitespace of pre elements are left alone.\n */\n\nimport { marked } from \"./import-maps.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nconst endsWithSpace = /\\s+$/gm;\n\nconst inlineElems = new Set([\n \"a\",\n \"abbr\",\n \"acronym\",\n \"b\",\n \"bdo\",\n \"big\",\n \"br\",\n \"button\",\n \"cite\",\n \"code\",\n \"dfn\",\n \"em\",\n \"i\",\n \"img\",\n \"input\",\n \"kbd\",\n \"label\",\n \"map\",\n \"object\",\n \"q\",\n \"samp\",\n \"script\",\n \"select\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"textarea\",\n \"time\",\n \"tt\",\n \"var\",\n]);\n\nclass Renderer extends marked.Renderer {\n code(code, language, isEscaped) {\n if (language === \"webidl\") {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n return super.code(code, language, isEscaped);\n }\n}\n\n/**\n * @param {string} text\n */\nfunction normalizePadding(text) {\n if (!text) {\n return \"\";\n }\n if (typeof text !== \"string\") {\n throw TypeError(\"Invalid input\");\n }\n if (text === \"\\n\") {\n return \"\\n\";\n }\n\n /**\n * @param {Node} node\n * @return {node is Text}\n */\n function isTextNode(node) {\n return node !== null && node.nodeType === Node.TEXT_NODE;\n }\n /**\n * @param {Node} node\n * @return {node is Element}\n */\n function isElementNode(node) {\n return node !== null && node.nodeType === Node.ELEMENT_NODE;\n }\n const doc = document.createRange().createContextualFragment(text);\n // Normalize block level elements children first\n Array.from(doc.children)\n .filter(elem => !inlineElems.has(elem.localName))\n .filter(elem => elem.localName !== \"pre\")\n .filter(elem => elem.localName !== \"table\")\n .forEach(elem => {\n elem.innerHTML = normalizePadding(elem.innerHTML);\n });\n // Normalize root level now\n Array.from(doc.childNodes)\n .filter(node => isTextNode(node) && node.textContent.trim() === \"\")\n .forEach(node => node.replaceWith(\"\\n\"));\n // Normalize text node\n if (isElementNode(doc.firstChild)) {\n Array.from(doc.firstChild.children)\n .filter(child => child.localName !== \"table\")\n .forEach(child => {\n child.innerHTML = normalizePadding(child.innerHTML);\n });\n }\n doc.normalize();\n // use the first space as an indicator of how much to chop off the front\n const firstSpace = doc.textContent\n .replace(/^ *\\n/, \"\")\n .split(\"\\n\")\n .filter(item => item && item.startsWith(\" \"))[0];\n const chop = firstSpace ? firstSpace.match(/ +/)[0].length : 0;\n if (chop) {\n // Chop chop from start, but leave pre elem alone\n Array.from(doc.childNodes)\n .filter(node => node.nodeName !== \"PRE\")\n .filter(isTextNode)\n .filter(node => {\n // we care about text next to a block level element\n const prevSib = node.previousElementSibling;\n const nextTo = prevSib && prevSib.localName;\n // and we care about text elements that finish on a new line\n return (\n !inlineElems.has(nextTo) || node.textContent.trim().includes(\"\\n\")\n );\n })\n .reduce((replacer, node) => {\n // We need to retain white space if the text Node is next to an in-line element\n let padding = \"\";\n const prevSib = node.previousElementSibling;\n const nextTo = prevSib && prevSib.localName;\n if (/^[\\t ]/.test(node.textContent) && inlineElems.has(nextTo)) {\n padding = node.textContent.match(/^\\s+/)[0];\n }\n node.textContent = padding + node.textContent.replace(replacer, \"\");\n return replacer;\n }, new RegExp(`^ {1,${chop}}`, \"gm\"));\n // deal with pre elements... we can chop whitespace from their siblings\n const endsWithSpace = new RegExp(`\\\\ {${chop}}$`, \"gm\");\n Array.from(doc.querySelectorAll(\"pre\"))\n .map(elem => elem.previousSibling)\n .filter(isTextNode)\n .reduce((chop, node) => {\n if (endsWithSpace.test(node.textContent)) {\n node.textContent = node.textContent.substr(\n 0,\n node.textContent.length - chop\n );\n }\n return chop;\n }, chop);\n }\n const wrap = document.createElement(\"body\");\n wrap.append(doc);\n const result = endsWithSpace.test(wrap.innerHTML)\n ? `${wrap.innerHTML.trimRight()}\\n`\n : wrap.innerHTML;\n return result;\n}\n\n/**\n * @param {string} text\n */\nexport function markdownToHtml(text) {\n const normalizedLeftPad = normalizePadding(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n // @ts-ignore\n const result = marked(potentialMarkdown, {\n sanitize: false,\n gfm: true,\n headerIds: false,\n renderer: new Renderer(),\n });\n return result;\n}\n\nfunction processElements(selector) {\n return element => {\n const elements = Array.from(element.querySelectorAll(selector));\n elements.reverse().forEach(element => {\n element.innerHTML = markdownToHtml(element.innerHTML);\n });\n return elements;\n };\n}\n\nclass Builder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node, process) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(process(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n\nfunction structure(fragment, doc) {\n function process(root) {\n const stack = new Builder(doc);\n while (root.firstChild) {\n const node = root.firstChild;\n if (node.nodeType !== Node.ELEMENT_NODE) {\n root.removeChild(node);\n continue;\n }\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n stack.addHeader(node);\n break;\n case \"section\":\n stack.addSection(node, process);\n break;\n default:\n stack.addElement(node);\n }\n }\n return stack.root;\n }\n return process(fragment);\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = processElements(\"[data-format='markdown']:not(body)\");\nconst processBlockLevelElements = processElements(\n \"[data-format=markdown]:not(body), section, div, address, article, aside, figure, header, main, body\"\n);\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body)\n .map(elem => {\n const structuredInternals = structure(elem, elem.ownerDocument);\n return {\n structuredInternals,\n elem,\n };\n })\n .forEach(({ elem, structuredInternals }) => {\n elem.setAttribute(\"aria-busy\", \"true\");\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n elem.setAttribute(\"aria-busy\", \"false\");\n });\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newHTML = document.createElement(\"html\");\n const newBody = document.createElement(\"body\");\n newBody.innerHTML = document.body.innerHTML;\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n newHTML.appendChild(newBody);\n processBlockLevelElements(newHTML);\n // Process root level text nodes\n const cleanHTML = newBody.innerHTML\n // Markdown parsing sometimes inserts empty p tags\n .replace(/<p>\\s*<\\/p>/gm, \"\");\n newBody.innerHTML = cleanHTML;\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Restructure the document properly\n const fragment = structure(newBody, document);\n // Frankenstein the whole thing back together\n newBody.appendChild(fragment);\n newBody.prepend(rsUI);\n document.body.replaceWith(newBody);\n}\n","/**\n * www.openjs.com/scripts/events/keyboard_shortcuts/\n * Version : 2.01.B\n * By Binny V A\n * License : BSD\n */\n\"use strict\";\nexport default {\n all_shortcuts: {}, //All the shortcuts are stored in this array\n add: function(shortcut_combination, callback, opt) {\n //Provide a set of default options\n var default_options = {\n type: \"keydown\",\n propagate: false,\n disable_in_input: false,\n target: document,\n keycode: false,\n };\n if (!opt) {\n opt = default_options;\n } else {\n for (var dfo in default_options) {\n if (typeof opt[dfo] == \"undefined\") opt[dfo] = default_options[dfo];\n }\n }\n\n var ele = opt.target;\n if (typeof opt.target == \"string\")\n ele = document.getElementById(opt.target);\n var ths = this;\n shortcut_combination = shortcut_combination.toLowerCase();\n\n //The function to be called at keypress\n var func = function(e) {\n var code;\n e = e || window.event;\n\n if (opt[\"disable_in_input\"]) {\n //Don't enable shortcut keys in Input, Textarea fields\n var element;\n if (e.target) element = e.target;\n else if (e.srcElement) element = e.srcElement;\n if (element.nodeType == 3) element = element.parentNode;\n\n if (element.tagName == \"INPUT\" || element.tagName == \"TEXTAREA\") return;\n }\n\n //Find Which key is pressed\n if (e.keyCode) code = e.keyCode;\n else if (e.which) code = e.which;\n var character = String.fromCharCode(code).toLowerCase();\n\n if (code == 188) character = \",\"; //If the user presses , when the type is onkeydown\n if (code == 190) character = \".\"; //If the user presses , when the type is onkeydown\n\n var keys = shortcut_combination.split(\"+\");\n //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked\n var kp = 0;\n\n //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken\n var shift_nums = {\n \"`\": \"~\",\n \"1\": \"!\",\n \"2\": \"@\",\n \"3\": \"#\",\n \"4\": \"$\",\n \"5\": \"%\",\n \"6\": \"^\",\n \"7\": \"&\",\n \"8\": \"*\",\n \"9\": \"(\",\n \"0\": \")\",\n \"-\": \"_\",\n \"=\": \"+\",\n \";\": \":\",\n \"'\": '\"',\n \",\": \"<\",\n \".\": \">\",\n \"/\": \"?\",\n \"\\\\\": \"|\",\n };\n //Special Keys - and their codes\n var special_keys = {\n esc: 27,\n escape: 27,\n tab: 9,\n space: 32,\n return: 13,\n enter: 13,\n backspace: 8,\n\n scrolllock: 145,\n scroll_lock: 145,\n scroll: 145,\n capslock: 20,\n caps_lock: 20,\n caps: 20,\n numlock: 144,\n num_lock: 144,\n num: 144,\n\n pause: 19,\n break: 19,\n\n insert: 45,\n home: 36,\n delete: 46,\n end: 35,\n\n pageup: 33,\n page_up: 33,\n pu: 33,\n\n pagedown: 34,\n page_down: 34,\n pd: 34,\n\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n\n f1: 112,\n f2: 113,\n f3: 114,\n f4: 115,\n f5: 116,\n f6: 117,\n f7: 118,\n f8: 119,\n f9: 120,\n f10: 121,\n f11: 122,\n f12: 123,\n };\n\n var modifiers = {\n shift: { wanted: false, pressed: false },\n ctrl: { wanted: false, pressed: false },\n alt: { wanted: false, pressed: false },\n meta: { wanted: false, pressed: false }, //Meta is Mac specific\n };\n\n if (e.ctrlKey) modifiers.ctrl.pressed = true;\n if (e.shiftKey) modifiers.shift.pressed = true;\n if (e.altKey) modifiers.alt.pressed = true;\n if (e.metaKey) modifiers.meta.pressed = true;\n\n for (var i = 0, k; (k = keys[i]), i < keys.length; i++) {\n //Modifiers\n if (k == \"ctrl\" || k == \"control\") {\n kp++;\n modifiers.ctrl.wanted = true;\n } else if (k == \"shift\") {\n kp++;\n modifiers.shift.wanted = true;\n } else if (k == \"alt\") {\n kp++;\n modifiers.alt.wanted = true;\n } else if (k == \"meta\") {\n kp++;\n modifiers.meta.wanted = true;\n } else if (k.length > 1) {\n //If it is a special key\n if (special_keys[k] == code) kp++;\n } else if (opt[\"keycode\"]) {\n if (opt[\"keycode\"] == code) kp++;\n } else {\n //The special keys did not match\n if (character == k) kp++;\n else {\n if (shift_nums[character] && e.shiftKey) {\n //Stupid Shift key bug created by using lowercase\n character = shift_nums[character];\n if (character == k) kp++;\n }\n }\n }\n }\n\n if (\n kp == keys.length &&\n modifiers.ctrl.pressed == modifiers.ctrl.wanted &&\n modifiers.shift.pressed == modifiers.shift.wanted &&\n modifiers.alt.pressed == modifiers.alt.wanted &&\n modifiers.meta.pressed == modifiers.meta.wanted\n ) {\n callback(e);\n\n if (!opt[\"propagate\"]) {\n //Stop the event\n //e.cancelBubble is supported by IE - this will kill the bubbling process.\n e.cancelBubble = true;\n e.returnValue = false;\n\n //e.stopPropagation works in Firefox.\n if (e.stopPropagation) {\n e.stopPropagation();\n e.preventDefault();\n }\n return false;\n }\n }\n };\n this.all_shortcuts[shortcut_combination] = {\n callback: func,\n target: ele,\n event: opt[\"type\"],\n };\n //Attach the function with the event\n if (ele.addEventListener) ele.addEventListener(opt[\"type\"], func, false);\n else if (ele.attachEvent) ele.attachEvent(\"on\" + opt[\"type\"], func);\n else ele[\"on\" + opt[\"type\"]] = func;\n },\n\n //Remove the shortcut - just specify the shortcut and I will remove the binding\n // 'remove':function(shortcut_combination) {\n // shortcut_combination = shortcut_combination.toLowerCase();\n // var binding = this.all_shortcuts[shortcut_combination];\n // delete(this.all_shortcuts[shortcut_combination])\n // if(!binding) return;\n // var type = binding['event'];\n // var ele = binding['target'];\n // var callback = binding['callback'];\n //\n // if(ele.detachEvent) ele.detachEvent('on'+type, callback);\n // else if(ele.removeEventListener) ele.removeEventListener(type, callback, false);\n // else ele['on'+type] = false;\n // }\n};\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n/* jshint laxcomma:true */\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\n\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport shortcut from \"../../js/shortcut.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/ui.css\")).default;\n } catch {\n return fetchAsset(\"ui.css\");\n }\n}\n\nasync function insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = await loadStyle();\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = hyperHTML`<div id='respec-ui' class='removeOnSave' hidden></div>`;\nconst menu = hyperHTML`<ul id=respec-menu role=menu aria-labelledby='respec-pill' hidden></ul>`;\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = hyperHTML`<button id='respec-pill' disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n if (menu.hidden) {\n menu.classList.remove(\"respec-hidden\");\n menu.classList.add(\"respec-visible\");\n } else {\n menu.classList.add(\"respec-hidden\");\n menu.classList.remove(\"respec-visible\");\n }\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n menu.hidden = !menu.hidden;\n});\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n menu.classList.remove(\"respec-visible\");\n menu.classList.add(\"respec-hidden\");\n menu.hidden = true;\n }\n});\nrespecUI.appendChild(menu);\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(msg, arr, butName, title) {\n arr.push(msg);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n buttons[butName].textContent = arr.length;\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = hyperHTML`<button id='${buttonId}' class='respec-info-button'>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = hyperHTML`<ol class='${`respec-${butName}-list`}'></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(markdownToHtml(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n [\"label\", `Document ${title.toLowerCase()}`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n addCommand(label, handler, keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = hyperHTML`<button id=\"${id}\" class=\"respec-option\" title=\"${keyShort}\">\n <span class=\"respec-cmd-icon\">${icon}</span> ${label}…\n </button>`;\n const menuItem = hyperHTML`<li role=menuitem>${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n if (keyShort) shortcut.add(keyShort, handler);\n return button;\n },\n error(msg) {\n errWarn(msg, errors, \"error\", \"Errors\");\n },\n warning(msg) {\n errWarn(msg, warnings, \"warning\", \"Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = hyperHTML`<div id='respec-overlay' class='removeOnSave'></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = hyperHTML`<div id='${id}' class='respec-modal removeOnSave' role='dialog'>\n <h3 id=\"${headingId}\">${title}</h3>\n <div class='inside'>${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n },\n};\nshortcut.add(\"Esc\", () => ui.closeModal());\nshortcut.add(\"Ctrl+Alt+Shift+E\", () => {\n if (buttons.error) buttons.error.click();\n});\nshortcut.add(\"Ctrl+Alt+Shift+W\", () => {\n if (buttons.warning) buttons.warning.click();\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n","// @ts-check\n/**\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n * @param {string} text IDL text\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nfunction reindent(text) {\n if (!text) {\n return text;\n }\n // TODO: use trimEnd when Edge supports it\n const lines = text.trimRight().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/location-hash\";\n\nexport function run() {\n // Added message for legacy compat with Aria specs\n // See https://github.com/w3c/respec/issues/793\n pub(\"start\", \"core/location-hash\");\n if (!location.hash) {\n return;\n }\n document.respecIsReady.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * @typedef {object} LinterResult\n * @property {string} description\n * @property {string} help\n * @property {string} howToFix\n * @property {string} name\n * @property {number} occurrences\n * @property {HTMLElement[]} offendingElements\n *\n * @typedef {(conf: any, doc: Document) => (LinterResult | Promise<LinterResult>)} LintingFunction\n */\n\n/** @type {WeakMap<LinterRule, { name: string, lintingFunction: LintingFunction }>} */\nconst privs = new WeakMap();\n\n/**\n * Checks if the linter rule is enabled.\n *\n * @param {Object} conf ReSpec config object.\n * @param {string} name linter rule name\n */\nfunction canLint(conf, name) {\n return !(\n conf.hasOwnProperty(\"lint\") === false ||\n conf.lint === false ||\n !conf.lint[name]\n );\n}\n\nexport default class LinterRule {\n /**\n *\n * @param {String} name the name of the rule\n * @param {LintingFunction} lintingFunction\n */\n constructor(name, lintingFunction) {\n privs.set(this, { name, lintingFunction });\n }\n get name() {\n return privs.get(this).name;\n }\n /**\n * Runs linter rule.\n *\n * @param {Object} conf The ReSpec config.\n * @param {Document} doc The document to be checked.\n */\n lint(conf = { lint: { [this.name]: false } }, doc = document) {\n if (canLint(conf, this.name)) {\n return privs.get(this).lintingFunction(conf, doc);\n }\n }\n}\n","// @ts-check\n/**\n * Linter rule \"check-charset\".\n *\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"check-charset\";\nconst meta = {\n en: {\n description: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n howToFix: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n *\n * @param {Object} _ The ReSpec config.\n * @param {Document} doc The document to be checked.\n */\nfunction linterFunction(_, doc) {\n const metas = doc.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(\n meta\n .getAttribute(\"charset\")\n .trim()\n .toLowerCase()\n );\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return [];\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n return {\n name,\n occurrences: metas.length,\n ...meta[lang],\n };\n}\nexport const rule = new LinterRule(name, linterFunction);\n","// @ts-check\n/**\n * Linter rule \"check-internal-slots\".\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"check-internal-slots\";\n\nconst meta = {\n en: {\n description: \"Internal slots should be preceded by a '.'\",\n howToFix: \"Add a '.' between the elements mentioned.\",\n help: \"See developer console.\",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n * @param {Object} _ The ReSpec config.\n * @param {Document} doc The document to be checked.\n * @return {import(\"../../core/LinterRule\").LinterResult}\n */\nfunction linterFunction(_, doc) {\n const offendingElements = [...doc.querySelectorAll(\"var+a\")].filter(\n ({ previousSibling: { nodeName } }) => {\n const isPrevVar = nodeName && nodeName === \"VAR\";\n return isPrevVar;\n }\n );\n\n if (!offendingElements.length) {\n return;\n }\n\n return {\n name,\n offendingElements,\n occurrences: offendingElements.length,\n ...meta[lang],\n };\n}\n\nexport const rule = new LinterRule(name, linterFunction);\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>\n * in the ReSpec config.\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"check-punctuation\";\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\nconst meta = {\n en: {\n description: \"`p` elements should end with a punctuation mark.\",\n howToFix: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n *\n * @param {Object} _ The ReSpec config.\n * @param {Document} doc The document to be checked.\n * @return {import(\"../../core/LinterRule\").LinterResult}\n */\nfunction lintingFunction(_, doc) {\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n const offendingElements = [\n ...doc.querySelectorAll(\"p:not(#back-to-top)\"),\n ].filter(elem => !punctuatingRegExp.test(elem.textContent.trim()));\n if (!offendingElements.length) {\n return;\n }\n return {\n name,\n offendingElements,\n occurrences: offendingElements.length,\n ...meta[lang],\n };\n}\nexport const rule = new LinterRule(name, lintingFunction);\n","// @ts-check\n/**\n * Module core/linter\n *\n * Core linter module. Exports a linter object.\n */\nimport { pub } from \"./pubsubhub.js\";\nimport { showInlineWarning } from \"./utils.js\";\nexport const name = \"core/linter\";\n\n/** @type {WeakMap<Linter, { rules: Set<import(\"./LinterRule\").default> }>} */\nconst privates = new WeakMap();\n\nclass Linter {\n constructor() {\n privates.set(this, {\n rules: new Set(),\n });\n }\n get rules() {\n return privates.get(this).rules;\n }\n /**\n * @param {...import(\"./LinterRule\").default} newRules\n */\n register(...newRules) {\n newRules.forEach(newRule => this.rules.add(newRule));\n }\n async lint(conf, doc = window.document) {\n const promisesToLint = [...privates.get(this).rules].map(rule =>\n toLinterWarning(rule.lint(conf, doc))\n );\n await promisesToLint;\n }\n}\n\nconst linter = new Linter();\nexport default linter;\n\nconst baseResult = {\n name: \"unknown\",\n description: \"\",\n occurrences: 0,\n howToFix: \"\",\n offendingElements: [], // DOM Nodes\n help: \"\", // where to get help\n};\n\n/**\n * @typedef {import(\"./LinterRule\").LinterResult} LinterResult\n * @param {LinterResult | Promise<LinterResult>} [resultPromise]\n */\nasync function toLinterWarning(resultPromise) {\n const result = await resultPromise;\n if (!result) {\n return;\n }\n const output = { ...baseResult, ...result };\n const {\n description,\n help,\n howToFix,\n name,\n occurrences,\n offendingElements,\n } = output;\n const message = `Linter (${name}): ${description} ${howToFix} ${help}`;\n if (offendingElements.length) {\n showInlineWarning(offendingElements, `${message} Occured`);\n } else {\n pub(\"warn\", `${message} (Count: ${occurrences})`);\n }\n}\n\nexport function run(conf) {\n if (conf.lint === false) {\n return; // nothing to do\n }\n // return early, continue processing other things\n (async () => {\n await document.respecIsReady;\n try {\n await linter.lint(conf, document);\n } catch (err) {\n console.error(\"Error ocurred while running the linter\", err);\n }\n })();\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"local-refs-exist\";\n\nconst meta = {\n en: {\n description: \"Broken local reference found in document.\",\n howToFix: \"Please fix the links mentioned.\",\n help: \"See developer console.\",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n * @param {Object} _ The ReSpec config.\n * @param {Document} doc The document to be checked.\n * @return {import(\"../../core/LinterRule\").LinterResult}\n */\nfunction linterFunction(_, doc) {\n const offendingElements = [...doc.querySelectorAll(\"a[href^='#']\")].filter(\n isBrokenHyperlink\n );\n if (!offendingElements.length) {\n return;\n }\n return {\n name,\n offendingElements,\n occurrences: offendingElements.length,\n ...meta[lang],\n };\n}\n\nexport const rule = new LinterRule(name, linterFunction);\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n return !elem.ownerDocument.getElementById(id);\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\nconst name = \"no-headingless-sections\";\nconst meta = {\n en: {\n description: \"All sections must start with a `h2-6` element.\",\n howToFix: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n help: \"See developer console.\",\n },\n nl: {\n description: \"Alle secties moeten beginnen met een `h2-6` element.\",\n howToFix:\n \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n help: \"Zie de developer console.\",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\nconst hasNoHeading = ({ firstElementChild: elem }) => {\n return elem === null || /^h[1-6]$/.test(elem.localName) === false;\n};\n\n/**\n * @param {*} _\n * @param {Document} doc\n * @return {import(\"../../core/LinterRule\").LinterResult}\n */\nfunction linterFunction(_, doc) {\n const offendingElements = [...doc.querySelectorAll(\"section\")].filter(\n hasNoHeading\n );\n if (!offendingElements.length) {\n return;\n }\n return {\n name,\n offendingElements,\n occurrences: offendingElements.length,\n ...meta[lang],\n };\n}\nexport const rule = new LinterRule(name, linterFunction);\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"no-http-props\";\n\nconst meta = {\n en: {\n description: \"Insecure URLs are not allowed in `respecConfig`.\",\n howToFix: \"Please change the following properties to 'https://': \",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n *\n * @param {Object} conf The ReSpec config.\n * @param {Document} doc The document to be checked.\n */\nfunction lintingFunction(conf, doc) {\n // We can only really perform this check over http/https\n if (!doc.location.href.startsWith(\"http\")) {\n return;\n }\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => key.endsWith(\"URI\") || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], doc.location.href).href.startsWith(\"http://\")\n );\n if (!offendingMembers.length) {\n return;\n }\n /** @type {import(\"../../core/LinterRule\").LinterResult} */\n const result = {\n name,\n occurrences: offendingMembers.length,\n ...meta[lang],\n };\n result.howToFix += `${offendingMembers\n .map(item => `\\`${item}\\``)\n .join(\", \")}.`;\n return result;\n}\n\nexport const rule = new LinterRule(name, lintingFunction);\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport LinterRule from \"../../core/LinterRule.js\";\nimport { lang as defaultLang } from \"../../core/l10n.js\";\nconst name = \"privsec-section\";\nconst meta = {\n en: {\n description:\n \"Document must a 'Privacy and/or Security' Considerations section.\",\n howToFix: \"Add a privacy and/or security considerations section.\",\n help:\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\n/**\n * @param {*} conf\n * @param {Document} doc\n * @return {import(\"../LinterRule\").LinterResult}\n */\nfunction lintingFunction(conf, doc) {\n if (conf.isRecTrack && !hasPriSecConsiderations(doc)) {\n return { name, occurrences: 1, ...meta[lang] };\n }\n}\n\nexport const rule = new LinterRule(name, lintingFunction);\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\nimport { rule as checkCharset } from \"./linter-rules/check-charset.js\";\nimport { rule as checkInternalSlots } from \"./linter-rules/check-internal-slots.js\";\nimport { rule as checkPunctuation } from \"./linter-rules/check-punctuation.js\";\nimport linter from \"./linter.js\";\nimport { rule as localRefsExist } from \"./linter-rules/local-refs-exist.js\";\nimport { rule as noHeadinglessSectionsRule } from \"./linter-rules/no-headingless-sections.js\";\nimport { rule as noHttpPropsRule } from \"./linter-rules/no-http-props.js\";\nimport { rule as privsecSection } from \"./linter-rules/privsec-section.js\";\n\nlinter.register(\n noHttpPropsRule,\n noHeadinglessSectionsRule,\n checkPunctuation,\n localRefsExist,\n checkInternalSlots,\n checkCharset,\n privsecSection\n);\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: false,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n\n/** @type {Record<string, HTMLElement[]>} */\nexport const definitionMap = Object.create(null);\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names.map(name => name.toLowerCase())) {\n if (name in definitionMap === false) {\n definitionMap[name] = [dfn];\n } else if (!definitionMap[name].includes(dfn)) {\n definitionMap[name].push(dfn);\n }\n }\n}\n","// @ts-check\n/**\n * Sets the defaults for W3C specs\n */\nexport const name = \"w3c/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\nimport { definitionMap } from \"../core/dfn-map.js\";\nimport linter from \"../core/linter.js\";\nimport { rule as privsecSectionRule } from \"../core/linter-rules/privsec-section.js\";\n\nlinter.register(privsecSectionRule);\n\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": true,\n },\n pluralize: true,\n doJsonLd: false,\n license: \"w3c-software-doc\",\n logos: [\n {\n src: \"https://www.w3.org/StyleSheets/TR/2016/logos/W3C\",\n alt: \"W3C\",\n height: 48,\n width: 72,\n url: \"https://www.w3.org/\",\n },\n ],\n xref: true,\n};\n\nexport function run(conf) {\n if (conf.specStatus === \"unofficial\") return;\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...w3cDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...w3cDefaults,\n ...conf,\n lint,\n });\n\n // TODO: eventually, we want to remove this.\n // It's here for legacy support of json-ld specs\n // see https://github.com/w3c/respec/issues/2019\n Object.assign(conf, { definitionMap });\n}\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport { fetchAsset } from \"./text-loader.js\";\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/respec2.css\")).default;\n } catch {\n return fetchAsset(\"respec2.css\");\n }\n}\n\nasync function insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = await loadStyle();\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport async function run(conf) {\n if (conf.noReSpecCSS) {\n (await styleElement).remove();\n }\n}\n","// @ts-check\n/* jshint strict: true, browser:true, jquery: true */\n// Module w3c/style\n// Inserts a link to the appropriate W3C style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport { createResourceHint, linkCSS, toKeyValuePairs } from \"../core/utils.js\";\nimport { pub, sub } from \"../core/pubsubhub.js\";\nexport const name = \"w3c/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction selectStyleVersion(styleVersion) {\n let version = \"\";\n switch (styleVersion) {\n case null:\n case true:\n version = \"2016\";\n break;\n default:\n if (styleVersion && !isNaN(styleVersion)) {\n version = styleVersion.toString().trim();\n }\n }\n return version;\n}\n\nfunction createResourceHints() {\n const resourceHints = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all specs show the logo.\n href: \"https://www.w3.org/StyleSheets/TR/2016/logos/W3C\",\n as: \"image\",\n },\n ]\n .map(createResourceHint)\n .reduce((frag, link) => {\n frag.appendChild(link);\n return frag;\n }, document.createDocumentFragment());\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const warn = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n pub(\"warn\", warn);\n }\n\n let styleFile = \"W3C-\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"CG-DRAFT\":\n case \"CG-FINAL\":\n case \"BG-DRAFT\":\n case \"BG-FINAL\":\n styleFile = conf.specStatus.toLowerCase();\n break;\n case \"FPWD\":\n case \"LC\":\n case \"WD-NOTE\":\n case \"LC-NOTE\":\n styleFile += \"WD\";\n break;\n case \"WG-NOTE\":\n case \"FPWD-NOTE\":\n styleFile += \"WG-NOTE.css\";\n break;\n case \"UNOFFICIAL\":\n styleFile += \"UD\";\n break;\n case \"FINDING\":\n case \"FINDING-DRAFT\":\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n default:\n styleFile += conf.specStatus;\n }\n\n // Select between released styles and experimental style.\n const version = selectStyleVersion(conf.useExperimentalStyles || \"2016\");\n // Attach W3C fixup script after we are done.\n if (version && !conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, version);\n },\n { once: true }\n );\n }\n const finalVersionPath = version ? `${version}/` : \"\";\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/${finalVersionPath}${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","// @ts-check\n// Module w3c/l10n\n// Looks at the lang attribute on the root element and uses it to manage the config.l10n object so\n// that other parts of the system can localise their text\nimport { l10n } from \"../core/l10n.js\";\nexport const name = \"w3c/l10n\";\nconst additions = {\n en: {\n status_at_publication:\n \"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href='https://www.w3.org/TR/'>W3C technical reports index</a> at https://www.w3.org/TR/.\",\n },\n ko: {\n status_at_publication:\n \"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href='https://www.w3.org/TR/'>W3C technical reports index</a> at https://www.w3.org/TR/.\",\n },\n zh: {\n status_at_publication:\n \"本章节描述了本文档的发布状态。其它更新版本可能会覆盖本文档。W3C的文档列 表和最新版本可通过<a href='https://www.w3.org/TR/'>W3C技术报告</a>索引访问。\",\n },\n ja: {\n status_at_publication:\n \"この節には、公開時点でのこの文書の位置づけが記されている。他の文書によって置き換えられる可能性がある。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 <a href='https://www.w3.org/TR/'>W3C technical reports index</a> (https://www.w3.org/TR/)\",\n },\n nl: {\n status_at_publication:\n \"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href='https://www.w3.org/TR/'>W3C technical reports index</a> at https://www.w3.org/TR/.\",\n },\n es: {\n status_at_publication:\n \"Esta sección describe el estado del presente documento al momento de su publicación. El presente documento puede ser remplazado por otros. Una lista de las publicaciones actuales del W3C y la última revisión del presente informe técnico puede hallarse en http://www.w3.org/TR/ <a href='https://www.w3.org/TR/'>el índice de informes técnicos</a> del W3C.\",\n },\n};\n\nObject.keys(additions).forEach(key => {\n Object.assign(l10n[key], additions[key]);\n});\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ api: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n pub(\"error\", message);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File a bug\",\n participate: \"Participate\",\n commit_history: \"Commit history\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe\",\n },\n};\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\nconst l10n = localizationStrings[lang];\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg =\n \"Config option `[github](https://github.com/w3c/respec/wiki/github)` \" +\n \"is missing property `repoURL`.\";\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = `\\`respecConf.github\\` is not a valid URL? (${ghURL})`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = `\\`respecConf.github\\` must be HTTPS and pointing to GitHub. (${ghURL})`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg =\n \"`respecConf.github` URL needs a path with, for example, w3c/my-spec\";\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: new URL(`./commits/${branch}`, ghURL.href).href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n // Assign new properties, but retain existing ones\n let githubAPI = `https://respec.org/github/${org}/${repo}/`;\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg = \"`respecConfig.githubAPI` should not be added manually.\";\n pub(\"warn\", msg);\n }\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n };\n resolveGithubPromise({ api: githubAPI, ...normalizedGHObj });\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n conf.otherLinks.unshift(otherLink);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { pub } from \"./pubsubhub.js\";\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-include\";\n\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const doc = el.ownerDocument;\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n let replacementNode;\n switch (el.dataset.includeFormat) {\n case \"text\":\n if (replace) {\n replacementNode = doc.createTextNode(data);\n el.replaceWith(replacementNode);\n } else {\n el.textContent = data;\n }\n break;\n default:\n // html, which is just using \"innerHTML\"\n el.innerHTML = data;\n if (replace) {\n replacementNode = doc.createDocumentFragment();\n while (el.hasChildNodes()) {\n replacementNode.append(el.removeChild(el.firstChild));\n }\n el.replaceWith(replacementNode);\n }\n }\n // If still in the dom tree, clean up\n if (doc.contains(el)) {\n cleanUp(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction cleanUp(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = document.querySelectorAll(\"[data-include]\");\n\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).substr(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}). See console for details.`;\n console.error(\"data-include failed for element: \", el, err);\n pub(\"error\", msg);\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\nimport { hyperHTML } from \"../../core/import-maps.js\";\nimport { pub } from \"../../core/pubsubhub.js\";\nconst html = hyperHTML;\n\nexport default link => {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n pub(\"warn\", msg);\n console.warn(\"warn\", msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}:</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n};\n\nfunction showLinkData(data) {\n return html`\n <dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`\n <a href=\"${data.href}\">${data.value || data.href}</a>\n `\n : \"\"}\n </dd>\n `;\n}\n","// @ts-check\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\nimport { showInlineWarning } from \"../../core/utils.js\";\n\nexport default obj => {\n /** @type {HTMLAnchorElement} */\n const a = html`\n <a href=\"${obj.url || \"\"}\" class=\"logo\"></a>\n `;\n if (!obj.alt) {\n showInlineWarning(a, \"Found spec logo without an `alt` attribute\");\n }\n /** @type {HTMLImageElement} */\n const img = html`\n <img\n id=\"${obj.id}\"\n alt=\"${obj.alt}\"\n width=\"${obj.width}\"\n height=\"${obj.height}\"\n />\n `;\n // avoid triggering 404 requests from dynamically generated\n // hyperHTML attribute values\n img.src = obj.src;\n a.append(img);\n return a;\n};\n","// @ts-check\nimport {\n humanDate,\n showInlineError,\n toShortIsoDate,\n} from \"../../core/utils.js\";\nimport { lang as defaultLang } from \"../../core/l10n.js\";\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until: \"Until\",\n },\n es: {\n until: \"Hasta\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport default (items = []) => {\n const l10n = localizationStrings[lang];\n return items.map(getItem);\n\n function getItem(p) {\n const personName = [p.name]; // treated as opt-in HTML by hyperHTML\n const company = [p.company];\n const editorid = p.w3cid ? parseInt(p.w3cid, 10) : null;\n /** @type {HTMLElement} */\n const dd = html`\n <dd class=\"p-author h-card vcard\" data-editor-id=\"${editorid}\"></dd>\n `;\n const span = document.createDocumentFragment();\n const contents = [];\n if (p.mailto) {\n contents.push(html`\n <a class=\"ed_mailto u-email email p-name\" href=\"${`mailto:${p.mailto}`}\"\n >${personName}</a\n >\n `);\n } else if (p.url) {\n contents.push(html`\n <a class=\"u-url url p-name fn\" href=\"${p.url}\">${personName}</a>\n `);\n } else {\n contents.push(\n html`\n <span class=\"p-name fn\">${personName}</span>\n `\n );\n }\n if (p.orcid) {\n contents.push(\n html`\n <a class=\"p-name orcid\" href=\"${p.orcid}\"\n ><svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n >\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n </svg>\n </a>\n `\n );\n }\n if (p.company) {\n if (p.companyURL) {\n contents.push(\n html`\n (<a class=\"p-org org h-org h-card\" href=\"${p.companyURL}\"\n >${company}</a\n >)\n `\n );\n } else {\n contents.push(\n html`\n (${company})\n `\n );\n }\n }\n if (p.note) contents.push(document.createTextNode(` (${p.note})`));\n if (p.extras) {\n const results = p.extras\n // Remove empty names\n .filter(extra => extra.name && extra.name.trim())\n // Convert to HTML\n .map(getExtra);\n for (const result of results) {\n contents.push(document.createTextNode(\", \"), result);\n }\n }\n if (p.retiredDate) {\n const retiredDate = new Date(p.retiredDate);\n const isValidDate = retiredDate.toString() !== \"Invalid Date\";\n const timeElem = document.createElement(\"time\");\n timeElem.textContent = isValidDate\n ? humanDate(retiredDate)\n : \"Invalid Date\"; // todo: Localise invalid date\n if (!isValidDate) {\n showInlineError(\n timeElem,\n \"The date is invalid. The expected format is YYYY-MM-DD.\",\n \"Invalid date\"\n );\n }\n timeElem.dateTime = toShortIsoDate(retiredDate);\n contents.push(\n html`\n - ${l10n.until.concat(\" \")}${[timeElem]}\n `\n );\n }\n\n // @ts-ignore: hyperhtml types only support Element but we use a DocumentFragment here\n html.bind(span)`${contents}`;\n dd.appendChild(span);\n return dd;\n }\n\n function getExtra(extra) {\n const span = html`\n <span class=\"${extra.class || null}\"></span>\n `;\n let textContainer = span;\n if (extra.href) {\n textContainer = html`\n <a href=\"${extra.href}\"></a>\n `;\n span.appendChild(textContainer);\n }\n textContainer.textContent = extra.name;\n return span;\n }\n};\n","// @ts-check\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\nimport showLink from \"./show-link.js\";\nimport showLogo from \"./show-logo.js\";\nimport showPeople from \"./show-people.js\";\n\nexport default conf => {\n return html`\n <div class=\"head\">\n ${conf.logos.map(showLogo)}\n <h1 class=\"title p-name\" id=\"title\">${conf.title}</h1>\n ${conf.subtitle\n ? html`\n <h2 id=\"subtitle\">${conf.subtitle}</h2>\n `\n : \"\"}\n <h2>\n ${conf.longStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n ${conf.thisVersion\n ? html`\n <dt>${conf.l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.latestVersion\n ? html`\n <dt>${conf.l10n.latest_published_version}</dt>\n <dd>\n <a href=\"${conf.latestVersion}\">${conf.latestVersion}</a>\n </dd>\n `\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${conf.l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>Test suite:</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>Implementation report:</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.bugTrackerHTML\n ? html`\n <dt>${conf.l10n.bug_tracker}</dt>\n <dd>${[conf.bugTrackerHTML]}</dd>\n `\n : \"\"}\n ${conf.prevVersion\n ? html`\n <dt>Previous version:</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.isCGFinal\n ? html`\n ${conf.prevED\n ? html`\n <dt>Previous editor's draft:</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n `\n : \"\"}\n <dt>${conf.multipleEditors ? conf.l10n.editors : conf.l10n.editor}</dt>\n ${showPeople(conf.editors)}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? conf.l10n.former_editors\n : conf.l10n.former_editor}\n </dt>\n ${showPeople(conf.formerEditors)}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>\n ${conf.multipleAuthors ? conf.l10n.authors : conf.l10n.author}\n </dt>\n ${showPeople(conf.authors)}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.alternateFormats\n ? html`\n <p>\n ${conf.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${[conf.alternatesHTML]}\n </p>\n `\n : \"\"}\n <p class=\"copyright\">\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\"\n >Copyright</a\n >\n ©\n ${conf.copyrightStart\n ? `${conf.copyrightStart}-`\n : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html`\n ${[conf.additionalCopyrightHolders]} &\n `\n : \"\"}\n the Contributors to the ${conf.title} Specification, published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a> under the\n ${conf.isCGFinal\n ? html`\n <a href=\"https://www.w3.org/community/about/agreements/fsa/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >. A human-readable\n <a href=\"https://www.w3.org/community/about/agreements/fsa-deed/\"\n >summary</a\n >\n is available.\n `\n : html`\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >. A human-readable\n <a href=\"https://www.w3.org/community/about/agreements/cla-deed/\"\n >summary</a\n >\n is available.\n `}\n </p>\n <hr title=\"Separator for header\" />\n </div>\n `;\n};\n","// @ts-check\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${conf.l10n.sotd}</h2>\n ${conf.isPreview\n ? html`\n <details class=\"annoying-warning\" open=\"\">\n <summary\n >This is a\n preview${conf.prUrl && conf.prNumber\n ? html`\n of pull request\n <a href=\"${conf.prUrl}\">#${conf.prNumber}</a>\n `\n : \"\"}</summary\n >\n <p>\n Do not attempt to implement this version of the specification. Do\n not reference this version as authoritative in any way.\n ${conf.edDraftURI\n ? html`\n Instead, see\n <a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a> for the\n Editor's draft.\n `\n : \"\"}\n </p>\n </details>\n `\n : \"\"}\n <p>\n This specification was published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a>. It is not a W3C Standard nor is it\n on the W3C Standards Track.\n ${conf.isCGFinal\n ? html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/final/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >\n other conditions apply.\n `\n : html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >\n there is a limited opt-out and other conditions apply.\n `}\n Learn more about\n <a href=\"https://www.w3.org/community/\"\n >W3C Community and Business Groups</a\n >.\n </p>\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.wgPublicList\n ? html`\n <p>\n If you wish to make comments regarding this document, please send\n them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a href=\"${opts.mailToWGPublicListSubscription}\">subscribe</a>,\n <a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html`\n with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject\n `\n : \"\"}.\n </p>\n `\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${opts.additionalSections}\n `;\n};\n","// @ts-check\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\nimport { norm } from \"../../core/utils.js\";\nimport { pub } from \"../../core/pubsubhub.js\";\nimport showLink from \"./show-link.js\";\nimport showLogo from \"./show-logo.js\";\nimport showPeople from \"./show-people.js\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/\";\nconst w3cLicense = \"https://www.w3.org/Consortium/Legal/copyright-documents\";\nconst legalDisclaimer =\n \"https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\";\nconst w3cTrademark =\n \"https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\";\n\nfunction getSpecTitleElem(conf) {\n const specTitleElem =\n document.querySelector(\"h1#title\") || document.createElement(\"h1\");\n if (specTitleElem.parentElement) {\n specTitleElem.remove();\n } else {\n specTitleElem.textContent = conf.title;\n specTitleElem.id = \"title\";\n }\n if (conf.isPreview && conf.prNumber) {\n const { childNodes } = html`\n Preview of PR <a href=\"${conf.prUrl}\">#${conf.prNumber}</a>:\n `;\n specTitleElem.prepend(...childNodes);\n }\n conf.title = norm(specTitleElem.textContent);\n specTitleElem.classList.add(\"title\", \"p-name\");\n if (document.querySelector(\"title\") === null) {\n document.title = conf.title;\n } else if (document.title !== conf.title) {\n pub(\"warn\", \"The document's title and the `<title>` element differ.\");\n }\n return specTitleElem;\n}\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`\n <div class=\"head\">\n ${conf.logos.map(showLogo)} ${getSpecTitleElem(conf)}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.prependW3C ? \"W3C \" : \"\"}${conf.textStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n ${!conf.isNoTrack\n ? html`\n <dt>${conf.l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>\n <dt>${conf.l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`\n <a href=\"${conf.latestVersion}\">${conf.latestVersion}</a>\n `\n : \"none\"}\n </dd>\n `\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${conf.l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>Test suite:</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>Implementation report:</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.bugTrackerHTML\n ? html`\n <dt>${conf.l10n.bug_tracker}</dt>\n <dd>${[conf.bugTrackerHTML]}</dd>\n `\n : \"\"}\n ${conf.isED && conf.prevED\n ? html`\n <dt>Previous editor's draft:</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n ${conf.showPreviousVersion\n ? html`\n <dt>Previous version:</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.prevRecURI\n ? \"\"\n : conf.isRec\n ? html`\n <dt>Previous Recommendation:</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `\n : html`\n <dt>Latest Recommendation:</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `}\n <dt>${conf.multipleEditors ? conf.l10n.editors : conf.l10n.editor}</dt>\n ${showPeople(conf.editors)}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? conf.l10n.former_editors\n : conf.l10n.former_editor}\n </dt>\n ${showPeople(conf.formerEditors)}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>\n ${conf.multipleAuthors ? conf.l10n.authors : conf.l10n.author}\n </dt>\n ${showPeople(conf.authors)}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.errata\n ? html`\n <p>\n Please check the\n <a href=\"${conf.errata}\"><strong>errata</strong></a> for any\n errors or issues reported since publication.\n </p>\n `\n : \"\"}\n ${conf.isRec\n ? html`\n <p>\n See also\n <a\n href=\"${`http://www.w3.org/2003/03/Translations/byTechnology?technology=${conf.shortName}`}\"\n >\n <strong>translations</strong></a\n >.\n </p>\n `\n : \"\"}\n ${conf.alternateFormats\n ? html`\n <p>\n ${conf.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${[conf.alternatesHTML]}\n </p>\n `\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>\n `;\n};\n\n/**\n * @param {string} text\n * @param {string} url\n * @param {string=} cssClass\n */\nfunction linkLicense(text, url, cssClass) {\n return html`\n <a rel=\"license\" href=\"${url}\" class=\"${cssClass}\">${text}</a>\n `;\n}\n\nfunction renderCopyright(conf) {\n return conf.isUnofficial\n ? conf.additionalCopyrightHolders\n ? html`\n <p class=\"copyright\">${[conf.additionalCopyrightHolders]}</p>\n `\n : conf.overrideCopyright\n ? [conf.overrideCopyright]\n : html`\n <p class=\"copyright\">\n This document is licensed under a\n ${linkLicense(\n \"Creative Commons Attribution 4.0 License\",\n ccLicense,\n \"subfoot\"\n )}.\n </p>\n `\n : conf.overrideCopyright\n ? [conf.overrideCopyright]\n : renderOfficialCopyright(conf);\n}\n\nfunction renderOfficialCopyright(conf) {\n return html`\n <p class=\"copyright\">\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\"\n >Copyright</a\n >\n ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html`\n ${[conf.additionalCopyrightHolders]} &\n `\n : \"\"}\n <a href=\"https://www.w3.org/\"\n ><abbr title=\"World Wide Web Consortium\">W3C</abbr></a\n ><sup>®</sup> (<a href=\"https://www.csail.mit.edu/\"\n ><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a\n >,\n <a href=\"https://www.ercim.eu/\"\n ><abbr\n title=\"European Research Consortium for Informatics and Mathematics\"\n >ERCIM</abbr\n ></a\n >, <a href=\"https://www.keio.ac.jp/\">Keio</a>,\n <a href=\"https://ev.buaa.edu.cn/\">Beihang</a>). ${noteIfDualLicense(conf)}\n W3C <a href=\"${legalDisclaimer}\">liability</a>,\n <a href=\"${w3cTrademark}\">trademark</a> and ${linkDocumentUse(conf)} rules\n apply.\n </p>\n `;\n}\n\nfunction noteIfDualLicense(conf) {\n if (!conf.isCCBY) {\n return;\n }\n return html`\n Some Rights Reserved: this document is dual-licensed,\n ${linkLicense(\"CC-BY\", ccLicense)} and\n ${linkLicense(\"W3C Document License\", w3cLicense)}.\n `;\n}\n\nfunction linkDocumentUse(conf) {\n if (conf.isCCBY) {\n return linkLicense(\n \"document use\",\n \"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html\"\n );\n }\n if (conf.isW3CSoftAndDocLicense) {\n return linkLicense(\n \"permissive document license\",\n \"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\"\n );\n }\n return linkLicense(\"document use\", w3cLicense);\n}\n","// @ts-check\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${conf.l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n ${conf.isUnofficial\n ? renderIsUnofficial(opts)\n : conf.isTagFinding\n ? opts.additionalContent\n : conf.isNoTrack\n ? renderIsNoTrack(conf, opts)\n : html`\n <p><em>${[conf.l10n.status_at_publication]}</em></p>\n ${conf.isSubmission\n ? noteForSubmission(conf, opts)\n : html`\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.overrideStatus\n ? html`\n ${linkToWorkingGroup(conf)} ${linkToCommunity(conf, opts)}\n ${conf.isCR || conf.isPER || conf.isPR\n ? html`\n <p>\n ${conf.isCR\n ? `\n W3C publishes a Candidate Recommendation to indicate that the document is believed to be\n stable and to encourage implementation by the developer community. This Candidate\n Recommendation is expected to advance to Proposed Recommendation no earlier than\n ${conf.humanCREnd}.\n `\n : \"\"}\n ${conf.isPER\n ? html`\n W3C Advisory Committee Members are invited\n to send formal review comments on this\n Proposed Edited Recommendation to the W3C\n Team until ${conf.humanPEREnd}. Members of\n the Advisory Committee will find the\n appropriate review form for this document by\n consulting their list of current\n <a\n href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\n `\n : \"\"}\n ${conf.isPR\n ? html`\n The W3C Membership and other interested\n parties are invited to review the document\n and send comments to\n <a\n rel=\"discussion\"\n href=\"${opts.mailToWGPublicList}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a\n href=\"${opts.mailToWGPublicListSubscription}\"\n >subscribe</a\n >,\n <a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >) through ${conf.humanPREnd}. Advisory\n Committee Representatives should consult\n their\n <a\n href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments\n were expected during the Candidate\n Recommendation review period that ended\n ${conf.humanCREnd}.\n `\n : \"\"}\n </p>\n `\n : \"\"}\n `\n : \"\"}\n ${conf.implementationReportURI\n ? renderImplementationReportURI(conf)\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.notRec ? renderNotRec(conf) : \"\"}\n ${conf.isRec ? renderIsRec() : \"\"} ${renderDeliverer(conf)}\n <p>\n This document is governed by the\n <a\n id=\"w3c_process_revision\"\n href=\"https://www.w3.org/2019/Process-20190301/\"\n >1 March 2019 W3C Process Document</a\n >.\n </p>\n ${conf.addPatentNote\n ? html`\n <p>${[conf.addPatentNote]}</p>\n `\n : \"\"}\n `}\n `}\n ${opts.additionalSections}\n `;\n};\n\nfunction renderPreview(conf) {\n const { prUrl, prNumber, edDraftURI } = conf;\n return html`\n <details class=\"annoying-warning\" open=\"\">\n <summary\n >This is a\n preview${prUrl && prNumber\n ? html`\n of pull request\n <a href=\"${prUrl}\">#${prNumber}</a>\n `\n : \"\"}</summary\n >\n <p>\n Do not attempt to implement this version of the specification. Do not\n reference this version as authoritative in any way.\n ${edDraftURI\n ? html`\n Instead, see\n <a href=\"${edDraftURI}\">${edDraftURI}</a> for the Editor's draft.\n `\n : \"\"}\n </p>\n </details>\n `;\n}\n\nfunction renderIsUnofficial(opts) {\n const { additionalContent } = opts;\n return html`\n <p>\n This document is draft of a potential specification. It has no official\n standing of any kind and does not represent the support or consensus of\n any standards organization.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderIsNoTrack(conf, opts) {\n const { isMO } = conf;\n const { additionalContent } = opts;\n return html`\n <p>\n This document is merely a W3C-internal\n ${isMO ? \"member-confidential\" : \"\"} document. It has no official standing\n of any kind and does not represent consensus of the W3C Membership.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderImplementationReportURI(conf) {\n const { implementationReportURI } = conf;\n return html`\n <p>\n Please see the Working Group's\n <a href=\"${implementationReportURI}\">implementation report</a>.\n </p>\n `;\n}\n\nfunction renderNotRec(conf) {\n const { anOrA, textStatus } = conf;\n return html`\n <p>\n Publication as ${anOrA} ${textStatus} does not imply endorsement by the\n W3C Membership. This is a draft document and may be updated, replaced or\n obsoleted by other documents at any time. It is inappropriate to cite this\n document as other than work in progress.\n </p>\n `;\n}\n\nfunction renderIsRec() {\n html`\n <p>\n This document has been reviewed by W3C Members, by software developers,\n and by other W3C groups and interested parties, and is endorsed by the\n Director as a W3C Recommendation. It is a stable document and may be used\n as reference material or cited from another document. W3C's role in making\n the Recommendation is to draw attention to the specification and to\n promote its widespread deployment. This enhances the functionality and\n interoperability of the Web.\n </p>\n `;\n}\n\nfunction renderDeliverer(conf) {\n const {\n isNote,\n wgId,\n isIGNote,\n multipleWGs,\n recNotExpected,\n wgPatentHTML,\n wgPatentURI,\n charterDisclosureURI,\n } = conf;\n\n const producers = !isIGNote\n ? html`\n This document was produced by ${multipleWGs ? \"groups\" : \"a group\"}\n operating under the\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/\"\n >W3C Patent Policy</a\n >.\n `\n : \"\";\n const wontBeRec = recNotExpected\n ? \"The group does not expect this document to become a W3C Recommendation.\"\n : \"\";\n return html`\n <p data-deliverer=\"${isNote ? wgId : null}\">\n ${producers} ${wontBeRec}\n ${!isNote && !isIGNote\n ? html`\n ${multipleWGs\n ? html`\n W3C maintains ${[wgPatentHTML]}\n `\n : html`\n W3C maintains a\n <a href=\"${[wgPatentURI]}\" rel=\"disclosure\"\n >public list of any patent disclosures</a\n >\n `}\n made in connection with the deliverables of\n ${multipleWGs\n ? \"each group; these pages also include\"\n : \"the group; that page also includes\"}\n instructions for disclosing a patent. An individual who has actual\n knowledge of a patent which the individual believes contains\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#def-essential\"\n >Essential Claim(s)</a\n >\n must disclose the information in accordance with\n <a\n href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure\"\n >section 6 of the W3C Patent Policy</a\n >.\n `\n : \"\"}\n ${isIGNote\n ? html`\n The disclosure obligations of the Participants of this group are\n described in the\n <a href=\"${charterDisclosureURI}\">charter</a>.\n `\n : \"\"}\n </p>\n `;\n}\n\nfunction noteForSubmission(conf, opts) {\n return html`\n ${opts.additionalContent}\n ${conf.isMemberSubmission\n ? noteForMemberSubmission(conf)\n : conf.isTeamSubmission\n ? noteForTeamSubmission(conf, opts)\n : \"\"}\n `;\n}\n\nfunction noteForMemberSubmission(conf) {\n const teamComment = `https://www.w3.org/Submission/${conf.publishDate.getUTCFullYear()}/${\n conf.submissionCommentNumber\n }/Comment/`;\n return html`\n <p>\n By publishing this document, W3C acknowledges that the\n <a href=\"${conf.thisVersion}\">Submitting Members</a> have made a formal\n Submission request to W3C for discussion. Publication of this document by\n W3C indicates no endorsement of its content by W3C, nor that W3C has, is,\n or will be allocating any resources to the issues addressed by it. This\n document is not the product of a chartered W3C group, but is published as\n potential input to the\n <a href=\"https://www.w3.org/Consortium/Process\">W3C Process</a>. A\n <a href=\"${teamComment}\">W3C Team Comment</a> has been published in\n conjunction with this Member Submission. Publication of acknowledged\n Member Submissions at the W3C site is one of the benefits of\n <a href=\"https://www.w3.org/Consortium/Prospectus/Joining\">\n W3C Membership</a\n >. Please consult the requirements associated with Member Submissions of\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-submissions\"\n >section 3.3 of the W3C Patent Policy</a\n >. Please consult the complete\n <a href=\"https://www.w3.org/Submission\"\n >list of acknowledged W3C Member Submissions</a\n >.\n </p>\n `;\n}\n\nfunction noteForTeamSubmission(conf, opts) {\n return html`\n <p>\n If you wish to make comments regarding this document, please send them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a href=\"${opts.mailToWGPublicListSubscription}\">subscribe</a>,\n <a href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html`\n with <code>${conf.subjectPrefix}</code> at the start of your email's\n subject\n `\n : \"\"}.\n </p>\n <p>\n Please consult the complete\n <a href=\"https://www.w3.org/TeamSubmission/\">list of Team Submissions</a>.\n </p>\n `;\n}\n\nfunction linkToWorkingGroup(conf) {\n if (!conf.wg) {\n return;\n }\n return html`\n <p>\n This document was published by ${[conf.wgHTML]} as ${conf.anOrA}\n ${conf.longStatus}.\n ${conf.notYetRec\n ? \"This document is intended to become a W3C Recommendation.\"\n : \"\"}\n </p>\n `;\n}\n\nfunction linkToCommunity(conf, opts) {\n if (!conf.github && !conf.wgPublicList) {\n return;\n }\n return html`\n <p>\n ${conf.github\n ? html`\n <a href=\"${conf.issueBase}\">GitHub Issues</a> are preferred for\n discussion of this specification.\n `\n : \"\"}\n ${conf.wgPublicList\n ? html`\n ${conf.github && conf.wgPublicList\n ? \"Alternatively, you can send comments to our mailing list.\"\n : \"Comments regarding this document are welcome.\"}\n Please send them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html`\n with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject\n `\n : \"\"}.\n `\n : \"\"}\n </p>\n `;\n}\n","// @ts-check\n/* jshint forin: false */\n\n// Module w3c/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - shortName: the small name that is used after /TR/ in published reports (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - previousPublishDate: the date on which the previous version was published.\n// - previousMaturity: the specStatus of the previous version\n// - errata: the URI of the errata document, if any\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specifiy either src or alt\n// - testSuiteURI: the URI to the test suite, if any\n// - implementationReportURI: the URI to the implementation report, if any\n// - bugTracker: and object with the following details\n// - open: pointer to the list of open bugs\n// - new: pointer to where to raise new bugs\n// - noRecTrack: set to true if this document is not intended to be on the Recommendation track\n// - edDraftURI: the URI of the Editor's Draft for this document, if any. Required if\n// specStatus is set to \"ED\".\n// - additionalCopyrightHolders: a copyright owner in addition to W3C (or the only one if specStatus\n// is unofficial)\n// - overrideCopyright: provides markup to completely override the copyright\n// - copyrightStart: the year from which the copyright starts running\n// - prevED: the URI of the previous Editor's Draft if it has moved\n// - prevRecShortname: the short name of the previous Recommendation, if the name has changed\n// - prevRecURI: the URI of the previous Recommendation if not directly generated from\n// prevRecShortname.\n// - wg: the name of the WG in charge of the document. This may be an array in which case wgURI\n// and wgPatentURI need to be arrays as well, of the same length and in the same order\n// - wgURI: the URI to the group's page, or an array of such\n// - wgPatentURI: the URI to the group's patent information page, or an array of such. NOTE: this\n// is VERY IMPORTANT information to provide and get right, do not just paste this without checking\n// that you're doing it right\n// - wgPublicList: the name of the mailing list where discussion takes place. Note that this cannot\n// be an array as it is assumed that there is a single list to discuss the document, even if it\n// is handled by multiple groups\n// - charterDisclosureURI: used for IGs (when publishing IG-NOTEs) to provide a link to the IPR commitment\n// defined in their charter.\n// - addPatentNote: used to add patent-related information to the SotD, for instance if there's an open\n// PAG on the document.\n// - thisVersion: the URI to the dated current version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - latestVersion: the URI to the latest (undated) version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - prevVersion: the URI to the previous (dated) version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - subjectPrefix: the string that is expected to be used as a subject prefix when posting to the mailing\n// list of the group.\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by\", which is experimentally available in some groups (but likely to be phased out).\n// Note that this is a dual licensing regime.\n// - \"cc0\", an extremely permissive license. It is only recommended if you are working on a document that is\n// intended to be pushed to the WHATWG.\n// - \"w3c-software\", a permissive and attributions license (but GPL-compatible).\n// - \"w3c-software-doc\", (default) the W3C Software and Document License\n// https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\nimport { ISODate, concatDate, joinAnd } from \"../core/utils.js\";\nimport cgbgHeadersTmpl from \"./templates/cgbg-headers.js\";\nimport cgbgSotdTmpl from \"./templates/cgbg-sotd.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport sotdTmpl from \"./templates/sotd.js\";\n\nexport const name = \"w3c/headers\";\n\nconst W3CDate = new Intl.DateTimeFormat([\"en-AU\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\nconst status2maturity = {\n LS: \"WD\",\n LD: \"WD\",\n FPWD: \"WD\",\n LC: \"WD\",\n FPLC: \"WD\",\n \"FPWD-NOTE\": \"NOTE\",\n \"WD-NOTE\": \"WD\",\n \"LC-NOTE\": \"LC\",\n \"IG-NOTE\": \"NOTE\",\n \"WG-NOTE\": \"NOTE\",\n};\n\nconst status2rdf = {\n NOTE: \"w3p:NOTE\",\n WD: \"w3p:WD\",\n LC: \"w3p:LastCall\",\n CR: \"w3p:CR\",\n PR: \"w3p:PR\",\n REC: \"w3p:REC\",\n PER: \"w3p:PER\",\n RSCND: \"w3p:RSCND\",\n};\nconst status2text = {\n NOTE: \"Working Group Note\",\n \"WG-NOTE\": \"Working Group Note\",\n \"CG-NOTE\": \"Co-ordination Group Note\",\n \"IG-NOTE\": \"Interest Group Note\",\n \"Member-SUBM\": \"Member Submission\",\n \"Team-SUBM\": \"Team Submission\",\n MO: \"Member-Only Document\",\n ED: \"Editor's Draft\",\n LS: \"Living Standard\",\n LD: \"Living Document\",\n FPWD: \"First Public Working Draft\",\n WD: \"Working Draft\",\n \"FPWD-NOTE\": \"Working Group Note\",\n \"WD-NOTE\": \"Working Draft\",\n \"LC-NOTE\": \"Working Draft\",\n FPLC: \"First Public and Last Call Working Draft\",\n LC: \"Last Call Working Draft\",\n CR: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n PER: \"Proposed Edited Recommendation\",\n REC: \"Recommendation\",\n RSCND: \"Rescinded Recommendation\",\n unofficial: \"Unofficial Draft\",\n base: \"Document\",\n finding: \"TAG Finding\",\n \"draft-finding\": \"Draft TAG Finding\",\n \"CG-DRAFT\": \"Draft Community Group Report\",\n \"CG-FINAL\": \"Final Community Group Report\",\n \"BG-DRAFT\": \"Draft Business Group Report\",\n \"BG-FINAL\": \"Final Business Group Report\",\n};\nconst status2long = {\n ...status2text,\n \"FPWD-NOTE\": \"First Public Working Group Note\",\n \"LC-NOTE\": \"Last Call Working Draft\",\n};\nconst maybeRecTrack = [\"FPWD\", \"WD\"];\nconst recTrackStatus = [\"FPLC\", \"LC\", \"CR\", \"PR\", \"PER\", \"REC\"];\nconst noTrackStatus = [\n \"base\",\n \"BG-DRAFT\",\n \"BG-FINAL\",\n \"CG-DRAFT\",\n \"CG-FINAL\",\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\nconst cgbg = [\"CG-DRAFT\", \"CG-FINAL\", \"BG-DRAFT\", \"BG-FINAL\"];\nconst precededByAn = [\"ED\", \"IG-NOTE\"];\nconst licenses = {\n cc0: {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n \"w3c-software\": {\n name: \"W3C Software Notice and License\",\n short: \"W3C Software\",\n url: \"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231\",\n },\n \"w3c-software-doc\": {\n name: \"W3C Software and Document Notice and License\",\n short: \"W3C Software and Document\",\n url:\n \"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\",\n },\n \"cc-by\": {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n};\n\nconst baseLogo = Object.freeze({\n id: \"\",\n alt: \"\",\n href: \"\",\n src: \"\",\n height: \"48\",\n width: \"72\",\n});\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n pub(\"error\", msg);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n if (conf.isUnofficial && !Array.isArray(conf.logos)) {\n conf.logos = [];\n }\n conf.isCCBY = conf.license === \"cc-by\";\n conf.isW3CSoftAndDocLicense = conf.license === \"w3c-software-doc\";\n if ([\"cc-by\"].includes(conf.license)) {\n let msg = `You cannot use license \"\\`${conf.license}\\`\" with W3C Specs. `;\n msg += `Please set \\`respecConfig.license: \"w3c-software-doc\"\\` instead.`;\n pub(\"error\", msg);\n }\n conf.licenseInfo = licenses[conf.license];\n conf.isCGBG = cgbg.includes(conf.specStatus);\n conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith(\"G-FINAL\");\n conf.isBasic = conf.specStatus === \"base\";\n conf.isRegular = !conf.isCGBG && !conf.isBasic;\n if (!conf.specStatus) {\n pub(\"error\", \"Missing required configuration: `specStatus`\");\n }\n if (conf.isRegular && !conf.shortName) {\n pub(\"error\", \"Missing required configuration: `shortName`\");\n }\n if (conf.testSuiteURI) {\n const url = new URL(conf.testSuiteURI, location.href);\n const { host, pathname } = url;\n if (\n host === \"github.com\" &&\n pathname.startsWith(\"/w3c/web-platform-tests/\")\n ) {\n const msg =\n \"Web Platform Tests have moved to a new Github Organization at https://github.com/web-platform-tests. \" +\n \"Please update your [`testSuiteURI`](https://github.com/w3c/respec/wiki/testSuiteURI) to point to the \" +\n `new tests repository (e.g., https://github.com/web-platform-tests/wpt/${conf.shortName} ).`;\n pub(\"warn\", msg);\n }\n }\n conf.title = document.title || \"No Title\";\n if (document.title && conf.isPreview && conf.prNumber) {\n document.title = `Preview of PR #${conf.prNumber}: ${document.title}`;\n }\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = W3CDate.format(conf.publishDate);\n conf.isNoTrack = noTrackStatus.includes(conf.specStatus);\n conf.isRecTrack = conf.noRecTrack\n ? false\n : recTrackStatus.concat(maybeRecTrack).includes(conf.specStatus);\n conf.isMemberSubmission = conf.specStatus === \"Member-SUBM\";\n if (conf.isMemberSubmission) {\n const memSubmissionLogo = {\n alt: \"W3C Member Submission\",\n href: \"https://www.w3.org/Submission/\",\n src: \"https://www.w3.org/Icons/member_subm-v.svg\",\n width: \"211\",\n };\n conf.logos.push({ ...baseLogo, ...memSubmissionLogo });\n }\n conf.isTeamSubmission = conf.specStatus === \"Team-SUBM\";\n if (conf.isTeamSubmission) {\n const teamSubmissionLogo = {\n alt: \"W3C Team Submission\",\n href: \"https://www.w3.org/TeamSubmission/\",\n src: \"https://www.w3.org/Icons/team_subm-v.svg\",\n width: \"211\",\n };\n conf.logos.push({ ...baseLogo, ...teamSubmissionLogo });\n }\n conf.isSubmission = conf.isMemberSubmission || conf.isTeamSubmission;\n conf.anOrA = precededByAn.includes(conf.specStatus) ? \"an\" : \"a\";\n conf.isTagFinding =\n conf.specStatus === \"finding\" || conf.specStatus === \"draft-finding\";\n if (!conf.edDraftURI) {\n conf.edDraftURI = \"\";\n if (conf.specStatus === \"ED\")\n pub(\"warn\", \"Editor's Drafts should set edDraftURI.\");\n }\n conf.maturity = status2maturity[conf.specStatus]\n ? status2maturity[conf.specStatus]\n : conf.specStatus;\n let publishSpace = \"TR\";\n if (conf.specStatus === \"Member-SUBM\") publishSpace = \"Submission\";\n else if (conf.specStatus === \"Team-SUBM\") publishSpace = \"TeamSubmission\";\n if (conf.isRegular)\n conf.thisVersion = `https://www.w3.org/${publishSpace}/${conf.publishDate.getUTCFullYear()}/${\n conf.maturity\n }-${conf.shortName}-${concatDate(conf.publishDate)}/`;\n if (conf.specStatus === \"ED\") conf.thisVersion = conf.edDraftURI;\n if (conf.isRegular)\n conf.latestVersion = `https://www.w3.org/${publishSpace}/${conf.shortName}/`;\n if (conf.isTagFinding) {\n conf.latestVersion = `https://www.w3.org/2001/tag/doc/${conf.shortName}`;\n conf.thisVersion = `${conf.latestVersion}-${ISODate.format(\n conf.publishDate\n )}`;\n }\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n pub(\"error\", \"`previousPublishDate` is set, but not `previousMaturity`.\");\n }\n\n conf.previousPublishDate = validateDateAndRecover(\n conf,\n \"previousPublishDate\"\n );\n\n const pmat = status2maturity[conf.previousMaturity]\n ? status2maturity[conf.previousMaturity]\n : conf.previousMaturity;\n if (conf.isTagFinding) {\n conf.prevVersion = `${conf.latestVersion}-${ISODate.format(\n conf.previousPublishDate\n )}`;\n } else if (conf.isCGBG) {\n conf.prevVersion = conf.prevVersion || \"\";\n } else if (conf.isBasic) {\n conf.prevVersion = \"\";\n } else {\n conf.prevVersion = `https://www.w3.org/TR/${conf.previousPublishDate.getUTCFullYear()}/${pmat}-${\n conf.shortName\n }-${concatDate(conf.previousPublishDate)}/`;\n }\n } else {\n if (\n !conf.specStatus.endsWith(\"NOTE\") &&\n conf.specStatus !== \"FPWD\" &&\n conf.specStatus !== \"FPLC\" &&\n conf.specStatus !== \"ED\" &&\n !conf.noRecTrack &&\n !conf.isNoTrack &&\n !conf.isSubmission\n )\n pub(\n \"error\",\n \"Document on track but no previous version:\" +\n \" Add `previousMaturity`, and `previousPublishDate` to ReSpec's config.\"\n );\n if (!conf.prevVersion) conf.prevVersion = \"\";\n }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = `https://www.w3.org/TR/${conf.prevRecShortname}`;\n const peopCheck = function(it) {\n if (!it.name) pub(\"error\", \"All authors and editors must have a name.\");\n if (it.orcid) {\n try {\n it.orcid = normalizeOrcid(it.orcid);\n } catch (e) {\n pub(\"error\", `\"${it.orcid}\" is not an ORCID. ${e.message}`);\n // A failed orcid link could link to something outside of orcid,\n // which would be misleading.\n delete it.orcid;\n }\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0)\n pub(\"error\", \"At least one editor is required\");\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n (conf.alternateFormats || []).forEach(it => {\n if (!it.uri || !it.label) {\n pub(\"error\", \"All alternate formats must have a uri and a label.\");\n }\n });\n conf.multipleAlternates =\n conf.alternateFormats && conf.alternateFormats.length > 1;\n conf.alternatesHTML =\n conf.alternateFormats &&\n joinAnd(conf.alternateFormats, alt => {\n let optional =\n alt.hasOwnProperty(\"lang\") && alt.lang ? ` hreflang='${alt.lang}'` : \"\";\n optional +=\n alt.hasOwnProperty(\"type\") && alt.type ? ` type='${alt.type}'` : \"\";\n return `<a rel='alternate' href='${alt.uri}'${optional}>${alt.label}</a>`;\n });\n if (conf.bugTracker) {\n if (conf.bugTracker.new && conf.bugTracker.open) {\n conf.bugTrackerHTML = `<a href='${conf.bugTracker.new}'>${conf.l10n.file_a_bug}</a> ${conf.l10n.open_parens}<a href='${conf.bugTracker.open}'>${conf.l10n.open_bugs}</a>${conf.l10n.close_parens}`;\n } else if (conf.bugTracker.open) {\n conf.bugTrackerHTML = `<a href='${conf.bugTracker.open}'>open bugs</a>`;\n } else if (conf.bugTracker.new) {\n conf.bugTrackerHTML = `<a href='${conf.bugTracker.new}'>file a bug</a>`;\n }\n }\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.longStatus = status2long[conf.specStatus];\n conf.textStatus = status2text[conf.specStatus];\n if (status2rdf[conf.specStatus]) {\n conf.rdfStatus = status2rdf[conf.specStatus];\n }\n conf.showThisVersion = !conf.isNoTrack || conf.isTagFinding;\n conf.showPreviousVersion =\n conf.specStatus !== \"FPWD\" &&\n conf.specStatus !== \"FPLC\" &&\n conf.specStatus !== \"ED\" &&\n !conf.isNoTrack &&\n !conf.isSubmission;\n if (conf.specStatus.endsWith(\"NOTE\") && !conf.prevVersion)\n conf.showPreviousVersion = false;\n if (conf.isTagFinding)\n conf.showPreviousVersion = conf.previousPublishDate ? true : false;\n conf.notYetRec = conf.isRecTrack && conf.specStatus !== \"REC\";\n conf.isRec = conf.isRecTrack && conf.specStatus === \"REC\";\n if (conf.isRec && !conf.errata)\n pub(\"error\", \"Recommendations must have an errata link.\");\n conf.notRec = conf.specStatus !== \"REC\";\n conf.prependW3C = !conf.isUnofficial;\n conf.isED = conf.specStatus === \"ED\";\n conf.isCR = conf.specStatus === \"CR\";\n conf.isPR = conf.specStatus === \"PR\";\n conf.isPER = conf.specStatus === \"PER\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = [\"FPWD-NOTE\", \"WG-NOTE\"].includes(conf.specStatus);\n conf.isIGNote = conf.specStatus === \"IG-NOTE\";\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n conf.shortISODate = ISODate.format(conf.publishDate);\n if (conf.hasOwnProperty(\"wgPatentURI\") && !Array.isArray(conf.wgPatentURI)) {\n Object.defineProperty(conf, \"wgId\", {\n get() {\n // it's always at \"pp-impl\" + 1\n const urlParts = this.wgPatentURI.split(\"/\");\n const pos = urlParts.findIndex(item => item === \"pp-impl\") + 1;\n return urlParts[pos] || \"\";\n },\n });\n } else {\n conf.wgId = conf.wgId ? conf.wgId : \"\";\n }\n // configuration done - yay!\n\n // insert into document\n const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // handle SotD\n const sotd =\n document.getElementById(\"sotd\") || document.createElement(\"section\");\n if ((conf.isCGBG || !conf.isNoTrack || conf.isTagFinding) && !sotd.id) {\n pub(\n \"error\",\n \"A custom SotD paragraph is required for your type of document.\"\n );\n }\n sotd.id = sotd.id || \"sotd\";\n sotd.classList.add(\"introductory\");\n // NOTE:\n // When arrays, wg and wgURI have to be the same length (and in the same order).\n // Technically wgURI could be longer but the rest is ignored.\n // However wgPatentURI can be shorter. This covers the case where multiple groups\n // publish together but some aren't used for patent policy purposes (typically this\n // happens when one is foolish enough to do joint work with the TAG). In such cases,\n // the groups whose patent policy applies need to be listed first, and wgPatentURI\n // can be shorter — but it still needs to be an array.\n const wgPotentialArray = [conf.wg, conf.wgURI, conf.wgPatentURI];\n if (\n wgPotentialArray.some(item => Array.isArray(item)) &&\n !wgPotentialArray.every(item => Array.isArray(item))\n ) {\n pub(\n \"error\",\n \"If one of '`wg`', '`wgURI`', or '`wgPatentURI`' is an array, they all have to be.\"\n );\n }\n if (conf.isCGBG && !conf.wg) {\n pub(\n \"error\",\n \"[`wg`](https://github.com/w3c/respec/wiki/wg)\" +\n \" configuration option is required for this kind of document.\"\n );\n }\n if (Array.isArray(conf.wg)) {\n conf.multipleWGs = conf.wg.length > 1;\n conf.wgHTML = joinAnd(conf.wg, (wg, idx) => {\n return `the <a href='${conf.wgURI[idx]}'>${wg}</a>`;\n });\n const pats = [];\n for (let i = 0, n = conf.wg.length; i < n; i++) {\n pats.push(\n `a <a href='${conf.wgPatentURI[i]}' rel='disclosure'>` +\n `public list of any patent disclosures (${conf.wg[i]})</a>`\n );\n }\n conf.wgPatentHTML = joinAnd(pats);\n } else {\n conf.multipleWGs = false;\n if (conf.wg) {\n conf.wgHTML = `the <a href='${conf.wgURI}'>${conf.wg}</a>`;\n }\n }\n if (conf.specStatus === \"PR\" && !conf.crEnd) {\n pub(\n \"error\",\n `\\`specStatus\\` is \"PR\" but no \\`crEnd\\` is specified (needed to indicate end of previous CR).`\n );\n }\n\n if (conf.specStatus === \"CR\" && !conf.crEnd) {\n pub(\n \"error\",\n `\\`specStatus\\` is \"CR\", but no \\`crEnd\\` is specified in Respec config.`\n );\n }\n conf.crEnd = validateDateAndRecover(conf, \"crEnd\");\n conf.humanCREnd = W3CDate.format(conf.crEnd);\n\n if (conf.specStatus === \"PR\" && !conf.prEnd) {\n pub(\"error\", `\\`specStatus\\` is \"PR\" but no \\`prEnd\\` is specified.`);\n }\n conf.prEnd = validateDateAndRecover(conf, \"prEnd\");\n conf.humanPREnd = W3CDate.format(conf.prEnd);\n\n if (conf.specStatus === \"PER\" && !conf.perEnd) {\n pub(\"error\", \"Status is PER but no perEnd is specified\");\n }\n conf.perEnd = validateDateAndRecover(conf, \"perEnd\");\n conf.humanPEREnd = W3CDate.format(conf.perEnd);\n conf.recNotExpected =\n conf.noRecTrack || conf.recNotExpected\n ? true\n : !conf.isRecTrack &&\n conf.maturity == \"WD\" &&\n conf.specStatus !== \"FPWD-NOTE\";\n if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) {\n pub(\n \"error\",\n `Document configured as [\\`noRecTrack\\`](https://github.com/w3c/respec/wiki/noRecTrack), but its status (\"${\n conf.specStatus\n }\") puts it on the W3C Rec Track. Status cannot be any of: ${recTrackStatus.join(\n \", \"\n )}. [More info](https://github.com/w3c/respec/wiki/noRecTrack).`\n );\n }\n if (conf.isIGNote && !conf.charterDisclosureURI) {\n pub(\n \"error\",\n \"IG-NOTEs must link to charter's disclosure section using `charterDisclosureURI`.\"\n );\n }\n\n hyperHTML.bind(sotd)`${populateSoTD(conf, sotd)}`;\n\n if (!conf.implementationReportURI && conf.isCR) {\n pub(\n \"error\",\n \"CR documents must have an [`implementationReportURI`](https://github.com/w3c/respec/wiki/implementationReportURI) \" +\n \"that describes [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).\"\n );\n }\n if (!conf.implementationReportURI && conf.isPR) {\n pub(\n \"warn\",\n \"PR documents should include an \" +\n \" [`implementationReportURI`](https://github.com/w3c/respec/wiki/implementationReportURI)\" +\n \" that describes [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).\"\n );\n }\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n\n/**\n * @param {*} conf\n * @param {HTMLElement} sotd\n */\nfunction populateSoTD(conf, sotd) {\n const options = {\n ...collectSotdContent(sotd, conf),\n\n get mailToWGPublicList() {\n return `mailto:${conf.wgPublicList}@w3.org`;\n },\n get mailToWGPublicListWithSubject() {\n const fragment = conf.subjectPrefix\n ? `?subject=${encodeURIComponent(conf.subjectPrefix)}`\n : \"\";\n return this.mailToWGPublicList + fragment;\n },\n get mailToWGPublicListSubscription() {\n return `mailto:${conf.wgPublicList}-request@w3.org?subject=subscribe`;\n },\n };\n const template = conf.isCGBG ? cgbgSotdTmpl : sotdTmpl;\n return template(conf, options);\n}\n\n/**\n * @param {HTMLElement} sotd\n */\nfunction collectSotdContent(sotd, { isTagFinding = false }) {\n const sotdClone = sotd.cloneNode(true);\n const additionalContent = document.createDocumentFragment();\n // we collect everything until we hit a section,\n // that becomes the custom content.\n while (sotdClone.hasChildNodes()) {\n if (\n isElement(sotdClone.firstChild) &&\n sotdClone.firstChild.localName === \"section\"\n ) {\n break;\n }\n additionalContent.appendChild(sotdClone.firstChild);\n }\n if (isTagFinding && !additionalContent.hasChildNodes()) {\n pub(\n \"warn\",\n \"ReSpec does not support automated SotD generation for TAG findings, \" +\n \"please add the prerequisite content in the 'sotd' section\"\n );\n }\n return {\n additionalContent,\n // Whatever sections are left, we throw at the end.\n additionalSections: sotdClone.childNodes,\n };\n}\n\n/**\n * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the /\n * @return {string} the full ORCID URL. Throws an error if the ID is invalid.\n */\nfunction normalizeOrcid(orcid) {\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n if (orcidUrl.origin !== \"https://orcid.org\") {\n throw new Error(\n `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`\n );\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n throw new Error(\n `ORCIDs have the format \"1234-1234-1234-1234\", not \"${orcidId}\"`\n );\n }\n\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcidId[orcidId.length - 1];\n const remainder = orcidId\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n if (lastDigit !== lastDigitShould) {\n throw new Error(`\"${orcidId}\" has an invalid checksum.`);\n }\n\n return orcidUrl.href;\n}\n\n/**\n * @param {Node} node\n * @return {node is Element}\n */\nfunction isElement(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n","// @ts-check\n// Module w3c/abstract\n// Handle the abstract section properly.\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nexport const name = \"w3c/abstract\";\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n pub(\"error\", `Document must have one element with \\`id=\"abstract\"`);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n[lang].abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showInlineWarning } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg =\n `[\\`data-abbr\\`](https://github.com/w3c/respec/wiki/data-abbr)` +\n ` attribute not supported on \\`${localName}\\` elements.`;\n showInlineWarning(elem, msg, \"Error: unsupported.\");\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { hyperHTML } from \"./import-maps.js\";\nimport { showInlineError } from \"./utils.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+$/; // {{unrestricted double}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\nconst methodRegex = /(\\w+)\\((.*)\\)$/;\nconst slotRegex = /^\\[\\[(\\w+)\\]\\]$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+)(?:\\]\\])?)$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\n\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n const [nonMethodPart, methodPart] = str.split(methodSplitRegex);\n const tokens = nonMethodPart\n .split(/[./]/)\n .concat(methodPart)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs] = value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n results.push({ type: \"method\", identifier, args, renderParent });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier] = value.match(slotRegex);\n results.push({ type: \"internal-slot\", identifier, renderParent });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n results.push({ type: \"idl-primitive\", identifier: value, renderParent });\n continue;\n }\n // base, always final token\n if (attributeRegex.test(value) && tokens.length === 0) {\n results.push({ type: \"base\", identifier: value, renderParent });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent } = details;\n if (renderParent) {\n return hyperHTML`<a data-xref-type=\"_IDL_\"><code>${identifier}</code></a>`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const lt = `[[${identifier}]]`;\n const html = hyperHTML`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"attribute\"\n data-link-for=${linkFor}\n data-xref-for=${linkFor}\n data-lt=\"${lt}\"><code>[[${identifier}]]</code></a>`;\n return html;\n}\n\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const html = hyperHTML`${renderParent ? \".\" : \"\"}<a\n data-xref-type=\"attribute|dict-member\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a>`;\n return html;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = args.map(arg => `<var>${arg}</var>`).join(\", \");\n const searchText = `${identifier}(${args.join(\", \")})`;\n const html = hyperHTML`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${identifier}</code></a><code>(${[argsText]})</code>`;\n return html;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const html = hyperHTML`\"<a\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a>\"`;\n return html;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const html = hyperHTML`\"<a\n data-cite=\"WebIDL\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a>\"`;\n return html;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier } = details;\n const html = hyperHTML`<a\n data-cite=\"WebIDL\"\n data-xref-type=\"interface\"\n ><code>${identifier}</code></a>`;\n return html;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = hyperHTML`<span>{{ ${str} }}</span>`;\n showInlineError(el, error.message, \"Error: Invalid inline IDL string\");\n return el;\n }\n const render = hyperHTML(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { flatten } from \"./utils.js\";\nimport { idb } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n return await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<Object?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<Object?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {Object} data An object that contains references and aliases.\n */\n async addAll(data) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = {\n alias: new Set(),\n reference: new Set(),\n };\n Object.keys(data)\n .filter(key => {\n if (typeof data[key] === \"string\") {\n let msg = `Legacy SpecRef entries are not supported: \\`[[${key}]]\\`. `;\n msg +=\n \"Please update it to the new format at [specref repo](https://github.com/tobie/specref/)\";\n pub(\"error\", msg);\n return false;\n }\n return true;\n })\n .map(id => Object.assign({ id }, data[id]))\n .forEach(obj => {\n if (obj.aliasOf) {\n aliasesAndRefs.alias.add(obj);\n } else {\n aliasesAndRefs.reference.add(obj);\n }\n });\n const promisesToAdd = [...ALLOWED_TYPES]\n .map(type => {\n return Array.from(aliasesAndRefs[type]).map(details =>\n this.add(type, details)\n );\n })\n .reduce(flatten, []);\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {Object} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n const isInDB = await this.has(type, details.id);\n const store = db.transaction(type, \"readwrite\").store;\n // update or add, depending of already having it in db\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\n/* jshint jquery: true */\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const biblio = {};\n\n// for backward compatibity\nexport { wireReference, stringifyReference } from \"./render-biblio.js\";\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://specref.herokuapp.com/bibrefs?refs=\");\n\n/**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\nfunction normalizeReferences(conf) {\n const normalizedNormativeRefs = new Set(\n [...conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey => conf.informativeReferences.delete(redundantKey));\n}\n\nfunction getRefKeys(conf) {\n return {\n informativeReferences: Array.from(conf.informativeReferences),\n normativeReferences: Array.from(conf.normativeReferences),\n };\n}\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n const data = await response.json();\n try {\n await biblioDB.addAll(data);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\nexport async function run(conf) {\n const finish = () => {\n doneResolver(conf.biblio);\n };\n if (!conf.localBiblio) {\n conf.localBiblio = {};\n }\n if (conf.biblio) {\n let msg = \"Overriding `.biblio` in config. Please use \";\n msg += \"`.localBiblio` for custom biblio entries.\";\n pub(\"warn\", msg);\n }\n conf.biblio = biblio;\n const localAliases = Array.from(Object.keys(conf.localBiblio))\n .filter(key => conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => conf.localBiblio[key].aliasOf)\n .filter(key => !conf.localBiblio.hasOwnProperty(key));\n normalizeReferences(conf);\n const allRefs = getRefKeys(conf);\n const neededRefs = allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n // remove duplicates\n .reduce((collector, item) => {\n if (collector.indexOf(item) === -1) {\n collector.push(item);\n }\n return collector;\n }, [])\n .sort();\n const idbRefs = [];\n\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, conf.localBiblio);\n finish();\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"FPWD\", \"W3C First Public Working Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n [\"WG-NOTE\", \"W3C Working Group Note\"],\n]);\n\nconst defaultsReference = Object.freeze({\n authors: [],\n date: \"\",\n href: \"\",\n publisher: \"\",\n status: \"\",\n title: \"\",\n etAl: false,\n});\n\nconst endWithDot = endNormalizer(\".\");\n\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length && !conf.refNote) return;\n\n const refsec = hyperHTML`\n <section id='references' class='appendix'>\n <h2>${l10n.references}</h2>\n ${conf.refNote ? hyperHTML`<p>${conf.refNote}</p>` : \"\"}\n </section>`;\n\n for (const type of [\"Normative\", \"Informative\"]) {\n const refs = type === \"Normative\" ? norms : informs;\n if (!refs.length) continue;\n\n const sec = hyperHTML`\n <section>\n <h3>${\n type === \"Normative\" ? l10n.norm_references : l10n.info_references\n }</h3>\n </section>`;\n addId(sec);\n\n const { goodRefs, badRefs } = refs.map(toRefContent).reduce(\n (refObjects, ref) => {\n const refType = ref.refcontent ? \"goodRefs\" : \"badRefs\";\n refObjects[refType].push(ref);\n return refObjects;\n },\n { goodRefs: [], badRefs: [] }\n );\n\n const uniqueRefs = [\n ...goodRefs\n .reduce((uniqueRefs, ref) => {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n return uniqueRefs;\n }, new Map())\n .values(),\n ];\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n sec.appendChild(hyperHTML`\n <dl class='bibliography'>\n ${refsToShow.map(showRef)}\n </dl>`);\n refsec.appendChild(sec);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n }\n\n document.body.appendChild(refsec);\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n pub(\"error\", msg);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n return hyperHTML`[<cite><a class=\"bibref\" href=\"${href}\">${key}</a></cite>]`;\n}\n\n/**\n * renders a reference\n */\nfunction showRef({ ref, refcontent }) {\n const refId = `bib-${ref.toLowerCase()}`;\n if (refcontent) {\n return hyperHTML`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>${{ html: stringifyReference(refcontent) }}</dd>\n `;\n } else {\n return hyperHTML`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd><em class=\"respec-offending-element\">Reference not found.</em></dd>\n `;\n }\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\nexport function wireReference(rawRef, target = \"_blank\") {\n if (typeof rawRef !== \"object\") {\n throw new TypeError(\"Only modern object references are allowed\");\n }\n const ref = Object.assign({}, defaultsReference, rawRef);\n const authors = ref.authors.join(\"; \") + (ref.etAl ? \" et al\" : \"\");\n const status = REF_STATUSES.get(ref.status) || ref.status;\n return hyperHTML.wire(ref)`\n <cite>\n <a\n href=\"${ref.href}\"\n target=\"${target}\"\n rel=\"noopener noreferrer\">\n ${ref.title.trim()}</a>.\n </cite>\n <span class=\"authors\">\n ${endWithDot(authors)}\n </span>\n <span class=\"publisher\">\n ${endWithDot(ref.publisher)}\n </span>\n <span class=\"pubDate\">\n ${endWithDot(ref.date)}\n </span>\n <span class=\"pubStatus\">\n ${endWithDot(status)}\n </span>\n `;\n}\n\nexport function stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(badRefs) {\n badRefs.forEach(({ ref }) => {\n const badrefs = [\n ...document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n ),\n ].filter(({ textContent: t }) => t.toLowerCase() === ref.toLowerCase());\n const msg = `Bad reference: [\\`${ref}\\`] (appears ${badrefs.length} times)`;\n pub(\"error\", msg);\n console.warn(\"Bad references: \", badrefs);\n });\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getTextNodes,\n norm,\n refTypeFromContext,\n showInlineError,\n showInlineWarning,\n} from \"./utils.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+}})/; // {{ WebIDLThing }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+)?\\|\\B/; // |var : Type|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[A-Za-z0-9.-]+\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[A-Za-z]+(?:-[A-Za-z]+)?\\^\\])/; // Inline [^element^]\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const html = hyperHTML`<code><a data-xref-type=\"element\">${value}</a></code>`;\n return html;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = hyperHTML`<em class=\"rfc2119\" title=\"${value}\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return hyperHTML`<a data-cite=\"${ref}\"></a>`;\n }\n if (document.querySelector(ref)) {\n return hyperHTML`<a href=\"${ref}\"></a>`;\n }\n const badReference = hyperHTML`<span>${matched}</span>`;\n showInlineError(\n badReference, // cite element\n `Wasn't able to expand ${matched} as it didn't match any id in the document.`,\n `Please make sure there is element with id ${ref} in the document.`\n );\n return badReference;\n}\n\n/**\n * @param {string} matched\n */\nfunction inlineXrefMatches(matched) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = matched.slice(2, -2).trim();\n return ref.startsWith(\"\\\\\")\n ? matched.replace(\"\\\\\", \"\")\n : idlStringToHtml(norm(ref));\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n const { type, illegal } = refTypeFromContext(ref, txt.parentNode);\n const cite = renderInlineCitation(ref);\n const cleanRef = ref.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n showInlineWarning(\n cite.childNodes[1], // cite element\n \"Normative references in informative sections are not allowed. \" +\n `Remove '!' from the start of the reference \\`[[${ref}]]\\``\n );\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : hyperHTML`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return hyperHTML`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = matched.split(\"/\", 2).map(s => s.trim());\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return hyperHTML`<a data-link-for=\"${forContext}\" data-xref-for=\"${forContext}\" data-lt=\"${linkingText}\">${processedContent}</a>`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return hyperHTML`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrs = document.querySelectorAll(\"abbr[title]\");\n for (const abbr of abbrs) {\n abbrMap.set(abbr.textContent, abbr.title);\n }\n const aKeys = [...abbrMap.keys()];\n const abbrRx = aKeys.length ? `(?:\\\\b${aKeys.join(\"\\\\b)|(?:\\\\b\")}\\\\b)` : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = new RegExp(\n [\n \"\\\\bMUST(?:\\\\s+NOT)?\\\\b\",\n \"\\\\bSHOULD(?:\\\\s+NOT)?\\\\b\",\n \"\\\\bSHALL(?:\\\\s+NOT)?\\\\b\",\n \"\\\\bMAY\\\\b\",\n \"\\\\b(?:NOT\\\\s+)?REQUIRED\\\\b\",\n \"\\\\b(?:NOT\\\\s+)?RECOMMENDED\\\\b\",\n \"\\\\bOPTIONAL\\\\b\",\n ].join(\"|\")\n );\n const rx = new RegExp(\n `(${[\n keywords.source,\n inlineIdlReference.source,\n inlineVariable.source,\n inlineCitation.source,\n inlineExpansion.source,\n inlineAnchor.source,\n inlineCodeRegExp.source,\n inlineElement.source,\n ...(abbrRx ? [abbrRx] : []),\n ].join(\"|\")})`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(rx);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n } else if (t.startsWith(\"{{\")) {\n const node = inlineXrefMatches(t);\n df.append(node);\n } else if (t.startsWith(\"[[[\")) {\n const node = inlineRefMatches(t);\n df.append(node);\n } else if (t.startsWith(\"[[\")) {\n const nodes = inlineBibrefMatches(t, txt, conf);\n df.append(...nodes);\n } else if (t.startsWith(\"|\")) {\n const node = inlineVariableMatches(t);\n df.append(node);\n } else if (t.startsWith(\"[=\")) {\n const node = inlineAnchorMatches(t);\n df.append(node);\n } else if (t.startsWith(\"`\")) {\n const node = inlineCodeMatches(t);\n df.append(node);\n } else if (t.startsWith(\"[^\")) {\n const node = inlineElementMatches(t);\n df.append(node);\n } else if (abbrMap.has(t)) {\n const node = inlineAbbrMatches(t, txt, abbrMap);\n df.append(node);\n } else if (keywords.test(t)) {\n const node = inlineRFC2119Matches(t);\n df.append(node);\n } else {\n // FAIL -- not sure that this can really happen\n throw new Error(\n `Found token '${t}' but it does not correspond to anything`\n );\n }\n }\n txt.replaceWith(df);\n }\n}\n","// @ts-check\n// Module w3c/conformance\n// Handle the conformance section properly.\nimport { hyperHTML as html } from \"../core/import-maps.js\";\nimport { joinAnd } from \"../core/utils.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"w3c/conformance\";\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to blibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = joinAnd(\n terms.sort(),\n item => `<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h2>Conformance</h2>\n <p>\n As well as sections marked as non-normative, all authoring guidelines,\n diagrams, examples, and notes in this specification are non-normative.\n Everything else in this specification is normative.\n </p>\n ${terms.length\n ? html`\n <p>\n The key word${plural ? \"s\" : \"\"} ${[keywords]} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://tools.ietf.org/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")}\n ${renderInlineCitation(\"RFC8174\")} when, and only when, they appear\n in all capitals, as shown here.\n </p>\n `\n : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance) {\n processConformance(conformance, conf);\n }\n // Added message for legacy compat with Aria specs\n // See https://github.com/w3c/respec/issues/793\n pub(\"end\", name);\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates conf.definitionMap to identify them.\n\nimport { getDfnTitles, norm } from \"./utils.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/dfn\";\n\nexport function run() {\n document.querySelectorAll(\"dfn\").forEach(dfn => {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // Default to `dfn` as the type... other modules may override\n if (!dfn.dataset.dfnType) dfn.dataset.dfnType = \"dfn\";\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && titles[0] === norm(dfn.textContent)) {\n return;\n }\n dfn.dataset.lt = titles.join(\"|\");\n });\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML as html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\nconst cssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/examples.css\")).default;\n } catch {\n return fetchAsset(\"examples.css\");\n }\n}\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`\n <span class=\"example-title\">: ${report.title}</span>\n `\n : \"\";\n return html`\n <div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>\n `;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n const css = await cssPromise;\n document.head.insertBefore(\n html`\n <style>\n ${css}\n </style>\n `,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n if (title) {\n addId(example, `example-${number}`, title); // title gets used\n } else {\n // use the number as the title... so, e.g., \"example-5\"\n addId(example, `example`, String(number));\n }\n const { id } = example;\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n pub(\"example\", report);\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`\n <div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>\n `;\n if (title) {\n addId(div, `example-${number}`, title);\n }\n addId(div, `example`, String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n if (!inAside) pub(\"example\", report);\n }\n });\n}\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport { addId, joinAnd, parents } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n issue_summary: \"Issue Summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n },\n nl: {\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n },\n es: {\n issue_summary: \"Resumen de la cuestión\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n },\n};\n\nconst cssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/issues-notes.css\")).default;\n } catch {\n return fetchAsset(\"issues-notes.css\");\n }\n}\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {NodeListOf<HTMLElement>} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const hasDataNum = !!document.querySelector(\".issue[data-number]\");\n let issueNum = 0;\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno, conf);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n /** @type {Partial<Report>} */\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n };\n if (isIssue && !isInline && !hasDataNum) {\n issueNum++;\n report.number = issueNum;\n } else if (dataNum) {\n report.number = Number(dataNum);\n }\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = hyperHTML`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const titleParent = hyperHTML`\n <div role='heading' class='${`${type}-title marker`}'>${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (!hasDataNum) {\n text += ` ${issueNum}`;\n } else if (dataNum) {\n text += ` ${dataNum}`;\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n pub(\"warning\", `Failed to fetch issue number ${dataNum}`);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n if (report.number !== undefined) {\n // Add entry to #issue-summary.\n issueList.append(\n createIssueSummaryEntry(conf.l10n.issue, report, div.id)\n );\n }\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n pub(report.type, report);\n });\n makeIssueSectionSummary(issueList);\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno, conf) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? conf.l10n.feature_at_risk\n : conf.l10n.issue\n : isWarning\n ? conf.l10n.warning\n : isEdNote\n ? conf.l10n.editors_note\n : conf.l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return hyperHTML`<a href='${conf.issueBase + dataNum}'/>`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return hyperHTML`<a href='${conf.atRiskBase + dataNum}'/>`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Partial<Report>} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue} ${report.number}`;\n const title = report.title\n ? hyperHTML`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return hyperHTML`\n <li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>\n `;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(hyperHTML`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h2>${l10n.issue_summary}</h2>`\n );\n }\n}\n\nfunction isLight(rgb) {\n const red = (rgb >> 16) & 0xff;\n const green = (rgb >> 8) & 0xff;\n const blue = (rgb >> 0) & 0xff;\n const illumination = 0.2126 * red + 0.7152 * green + 0.0722 * blue;\n return illumination > 140;\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n const labelNames = labels.map(label => label.name);\n const joinedNames = joinAnd(labelNames);\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n if (labelNames.length) {\n const ariaLabel = `This issue is labelled as ${joinedNames}.`;\n return hyperHTML`<span\n class=\"issue-label\"\n aria-label=\"${ariaLabel}\">: ${title}${labelsGroup}</span>`;\n }\n return hyperHTML`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const rgb = parseInt(color, 16);\n const textColorClass = isNaN(rgb) || isLight(rgb) ? \"light\" : \"dark\";\n const cssClasses = `respec-gh-label respec-label-${textColorClass}`;\n const style = `background-color: #${color}`;\n return hyperHTML`<a\n class=\"${cssClasses}\"\n style=\"${style}\"\n href=\"${issuesURL.href}\">${name}</a>`;\n}\n\n/**\n * @param {string} githubAPI\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(githubAPI) {\n if (!githubAPI) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", githubAPI);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n pub(\"error\", msg);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const issuesAndNotes = document.querySelectorAll(query);\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.githubAPI);\n const css = await cssPromise;\n const { head: headElem } = document;\n headElem.insertBefore(\n hyperHTML`<style>${[css]}</style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/requirements\n// This module does two things:\n//\n// 1. It finds and marks all requirements. These are elements with class \"req\".\n// When a requirement is found, it is reported using the \"req\" event. This\n// can be used by a containing shell to extract them.\n// Requirements are automatically numbered.\n//\n// 2. It allows referencing requirements by their ID simply using an empty <a>\n// element with its href pointing to the requirement it should be referencing\n// and a class of \"reqRef\".\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/requirements\";\n\nexport function run() {\n document.querySelectorAll(\".req\").forEach((req, i) => {\n const frag = `#${req.getAttribute(\"id\")}`;\n const el = hyperHTML`<a href=\"${frag}\">Req. ${i + 1}</a>`;\n req.prepend(el, \": \");\n });\n\n document.querySelectorAll(\"a.reqRef[href]\").forEach(ref => {\n const href = ref.getAttribute(\"href\");\n const id = href.substring(1); // href looks like `#id`\n const req = document.getElementById(id);\n let txt;\n if (req) {\n txt = req.querySelector(\"a:first-child\").textContent;\n } else {\n txt = `Req. not found '${id}'`;\n const msg = `Requirement not found in element \\`a.reqRef\\`: ${id}`;\n pub(\"error\", msg);\n console.warn(msg, ref);\n }\n ref.textContent = txt;\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, makeSafeCopy } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n};\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const l10n = localizationStrings[lang];\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = hyperHTML`\n <a class=\"marker self-link\" href=\"${`#${id}`}\"><bdi lang=\"${lang}\">${\n l10n.best_practice\n }${num + 1}</bdi></a>`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = hyperHTML`\n <li>\n ${localizedBpName}: ${makeSafeCopy(bp)}\n </li>\n `;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = hyperHTML`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(hyperHTML`<h2>Best Practices Summary</h2>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n pub(\n \"warn\",\n \"Using best practices summary (#bp-summary) but no best practices found.\"\n );\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport { addId, renameElement, showInlineWarning, wrapInner } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図\",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"圖 \",\n list_of_figures: \"List of Figures\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n hyperHTML`<h2>${l10n.list_of_figures}</h2>`,\n hyperHTML`<ul class='tof'>${tof}</ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n showInlineWarning(fig, \"Found a `<figure>` without a `<figcaption>`\");\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, hyperHTML`<span class='fig-title'>`);\n caption.prepend(l10n.fig, hyperHTML`<bdi class='figno'>${i + 1}</bdi>`, \" \");\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return hyperHTML`<li class='tofline'>\n <a class='tocxref' href='${`#${figureId}`}'>${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n\n/**\n * @param {Element} element\n */\nfunction getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n","// @ts-check\nimport { definitionMap, registerDefinition } from \"./dfn-map.js\";\nimport { showInlineError, wrapInner } from \"./utils.js\";\n\nconst topLevelEntities = new Set([\n \"callback interface\",\n \"callback\",\n \"dictionary\",\n \"enum\",\n \"interface mixin\",\n \"interface\",\n \"typedef\",\n]);\n\n/**\n * This function looks for a <dfn> element whose title is 'name' and\n * that is \"for\" 'parent', which is the empty string when 'name'\n * refers to a top-level entity. For top-level entities, <dfn>\n * elements that inherit a non-empty [dfn-for] attribute are also\n * counted as matching.\n *\n * When a matching <dfn> is found, it's given <code> formatting,\n * marked as an IDL definition, and returned. If no <dfn> is found,\n * the function returns 'undefined'.\n * @param {*} defn\n * @param {string} name\n */\nexport function findDfn(defn, name, { parent = \"\" } = {}) {\n switch (defn.type) {\n case \"constructor\":\n case \"operation\":\n return findOperationDfn(defn, parent, name);\n default:\n return findNormalDfn(defn, parent, name);\n }\n}\n\n/**\n * @param {string} type\n * @param {string} parent\n * @param {string} name\n */\nfunction getAlternativeNames(type, parent, name) {\n const asQualifiedName = `${parent}.${name}`;\n switch (type) {\n case \"constructor\":\n case \"operation\": {\n // Allow linking to both \"method()\" and \"method\" name.\n const asMethodName = `${name}()`;\n const asFullyQualifiedName = `${asQualifiedName}()`;\n return [asFullyQualifiedName, asQualifiedName, asMethodName, name];\n }\n case \"attribute\":\n return [asQualifiedName, name];\n }\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {string} name\n */\nfunction findOperationDfn(defn, parent, name) {\n // Overloads all have unique names\n if (name.includes(\"!overload\")) {\n return findNormalDfn(defn, parent, name);\n }\n const asMethodName = `${name}()`;\n return findNormalDfn(defn, parent, asMethodName, name);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string[]} names\n */\nfunction addAlternativeNames(dfn, names) {\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n lt.push(...names);\n dfn.dataset.lt = [...new Set(lt)].join(\"|\");\n registerDefinition(dfn, names);\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {...string} names\n */\nfunction findNormalDfn(defn, parent, ...names) {\n for (const name of names) {\n let resolvedName =\n defn.type === \"enum-value\" && name === \"\"\n ? \"the-empty-string\"\n : name.toLowerCase();\n let dfnForArray = definitionMap[resolvedName];\n let dfns = getDfns(dfnForArray, parent, name, defn.type);\n // If we haven't found any definitions with explicit [for]\n // and [title], look for a dotted definition, \"parent.name\".\n if (dfns.length === 0 && parent !== \"\") {\n resolvedName = `${parent}.${resolvedName}`;\n dfnForArray = definitionMap[resolvedName.toLowerCase()];\n if (dfnForArray !== undefined && dfnForArray.length === 1) {\n dfns = dfnForArray;\n // Found it: register with its local name\n delete definitionMap[resolvedName];\n registerDefinition(dfns[0], [resolvedName]);\n }\n } else {\n resolvedName = name;\n }\n if (dfns.length > 1) {\n const msg = `WebIDL identifier \\`${name}\\` ${\n parent ? `for \\`${parent}\\`` : \"\"\n } is defined multiple times`;\n showInlineError(dfns, msg, \"Duplicate definition.\");\n }\n if (dfns.length) {\n if (name !== resolvedName) {\n dfns[0].dataset.lt = resolvedName;\n }\n return dfns[0];\n }\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {*} defn\n * @param {string} parent\n * @param {string} name\n */\nexport function decorateDfn(dfn, defn, parent, name) {\n if (!dfn.id) {\n const lCaseParent = parent.toLowerCase();\n const middle = lCaseParent ? `${lCaseParent}-` : \"\";\n let last = name\n .toLowerCase()\n .replace(/[()]/g, \"\")\n .replace(/\\s/g, \"-\");\n if (last === \"\") last = \"the-empty-string\";\n dfn.id = `dom-${middle}${last}`;\n }\n dfn.dataset.idl = defn.type;\n dfn.dataset.title = dfn.textContent;\n dfn.dataset.dfnFor = parent;\n // Derive the data-type for dictionary members, interface attributes,\n // and methods\n switch (defn.type) {\n case \"operation\":\n case \"attribute\":\n case \"field\":\n dfn.dataset.type = getDataType(defn);\n break;\n }\n\n // Mark the definition as code.\n if (!dfn.querySelector(\"code\") && !dfn.closest(\"code\") && dfn.children) {\n wrapInner(dfn, dfn.ownerDocument.createElement(\"code\"));\n }\n\n // Add data-lt values and register them\n switch (defn.type) {\n case \"attribute\":\n case \"constructor\":\n case \"operation\":\n addAlternativeNames(dfn, getAlternativeNames(defn.type, parent, name));\n break;\n }\n\n return dfn;\n}\n\n/**\n * @param {HTMLElement[]} dfnForArray\n * @param {string} parent data-dfn-for\n * @param {string} originalName\n * @param {string} type\n */\nfunction getDfns(dfnForArray, parent, originalName, type) {\n if (!dfnForArray) {\n return [];\n }\n // Definitions that have a name and [data-dfn-for] that exactly match the\n // IDL entity:\n const dfns = dfnForArray.filter(dfn => {\n /** @type {HTMLElement} */\n const closestDfnFor = dfn.closest(`[data-dfn-for]`);\n return closestDfnFor && closestDfnFor.dataset.dfnFor === parent;\n });\n\n if (dfns.length === 0 && parent === \"\" && dfnForArray.length === 1) {\n // Make sure the name exactly matches\n return dfnForArray[0].textContent === originalName ? dfnForArray : [];\n } else if (topLevelEntities.has(type) && dfnForArray.length) {\n const dfn = dfnForArray.find(\n dfn => dfn.textContent.trim() === originalName\n );\n if (dfn) return [dfn];\n }\n return dfns;\n}\n\n/**\n * @return {string}\n */\nfunction getDataType(idlStruct) {\n const { idlType, generic, union } = idlStruct;\n if (typeof idlType === \"string\") return idlType;\n if (generic) return generic;\n // join on \"|\" handles for \"unsigned short\" etc.\n if (union) return idlType.map(getDataType).join(\"|\");\n return getDataType(idlType);\n}\n","// Module core/webidl\n// Highlights and links WebIDL marked up inside <pre class=\"idl\">.\n\n// TODO:\n// - It could be useful to report parsed IDL items as events\n// - don't use generated content in the CSS!\nimport { decorateDfn, findDfn } from \"./dfn-finder.js\";\nimport {\n flatten,\n showInlineError,\n showInlineWarning,\n xmlEscape,\n} from \"./utils.js\";\nimport { hyperHTML, webidl2 } from \"./import-maps.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/webidl\";\n\nconst operationNames = {};\nconst idlPartials = {};\n\nconst templates = {\n wrap(items) {\n return items\n .reduce(flatten, [])\n .filter(x => x !== \"\")\n .map(x => (typeof x === \"string\" ? new Text(x) : x));\n },\n trivia(t) {\n if (!t.trim()) {\n return t;\n }\n return hyperHTML`<span class='idlSectionComment'>${t}</span>`;\n },\n generic(keyword) {\n // Shepherd classifies \"interfaces\" as starting with capital letters,\n // like Promise, FrozenArray, etc.\n return /^[A-Z]/.test(keyword)\n ? hyperHTML`<a data-xref-type=\"interface\" data-cite=\"WebIDL\">${keyword}</a>`\n : // Other keywords like sequence, maplike, etc...\n hyperHTML`<a data-xref-type=\"dfn\" data-cite=\"WebIDL\">${keyword}</a>`;\n },\n reference(wrapped, unescaped, context) {\n if (context.type === \"extended-attribute\" && context.name !== \"Exposed\") {\n return wrapped;\n }\n let type = \"_IDL_\";\n let cite = null;\n let lt;\n switch (unescaped) {\n case \"Window\":\n type = \"interface\";\n cite = \"HTML\";\n break;\n case \"object\":\n type = \"interface\";\n cite = \"WebIDL\";\n break;\n default: {\n const isWorkerType = unescaped.includes(\"Worker\");\n if (isWorkerType && context.type === \"extended-attribute\") {\n lt = `${unescaped}GlobalScope`;\n type = \"interface\";\n cite = [\"Worker\", \"DedicatedWorker\", \"SharedWorker\"].includes(\n unescaped\n )\n ? \"HTML\"\n : null;\n }\n }\n }\n return hyperHTML`<a\n data-xref-type=\"${type}\" data-cite=\"${cite}\" data-lt=\"${lt}\">${wrapped}</a>`;\n },\n name(escaped, { data, parent }) {\n if (data.idlType && data.idlType.type === \"argument-type\") {\n return hyperHTML`<span class=\"idlParamName\">${escaped}</span>`;\n }\n const idlLink = defineIdlName(escaped, data, parent);\n if (data.type !== \"enum-value\") {\n const className = parent ? \"idlName\" : \"idlID\";\n idlLink.classList.add(className);\n }\n return idlLink;\n },\n nameless(escaped, { data, parent }) {\n switch (data.type) {\n case \"constructor\":\n return defineIdlName(escaped, data, parent);\n default:\n return escaped;\n }\n },\n type(contents) {\n return hyperHTML`<span class=\"idlType\">${contents}</span>`;\n },\n inheritance(contents) {\n return hyperHTML`<span class=\"idlSuperclass\">${contents}</span>`;\n },\n definition(contents, { data, parent }) {\n const className = getIdlDefinitionClassName(data);\n switch (data.type) {\n case \"includes\":\n case \"enum-value\":\n return hyperHTML`<span class='${className}'>${contents}</span>`;\n }\n const parentName = parent ? parent.name : \"\";\n const { name, idlId } = getNameAndId(data, parentName);\n return hyperHTML`<span class='${className}' id='${idlId}' data-idl data-title='${name}'>${contents}</span>`;\n },\n extendedAttribute(contents) {\n const result = hyperHTML`<span class=\"extAttr\">${contents}</span>`;\n return result;\n },\n extendedAttributeReference(name) {\n return hyperHTML`<a data-xref-type=\"extended-attribute\">${name}</a>`;\n },\n};\n\n/**\n * Returns a link to existing <dfn> or creates one if doesn’t exists.\n */\nfunction defineIdlName(escaped, data, parent) {\n const parentName = parent ? parent.name : \"\";\n const { name } = getNameAndId(data, parentName);\n const dfn = findDfn(data, name, {\n parent: parentName,\n });\n const linkType = getDfnType(data.type);\n if (dfn) {\n if (!data.partial) {\n dfn.dataset.export = \"\";\n dfn.dataset.dfnType = linkType;\n }\n decorateDfn(dfn, data, parentName, name);\n const href = `#${dfn.id}`;\n return hyperHTML`<a\n data-link-for=\"${parentName}\"\n data-link-type=\"${linkType}\"\n href=\"${href}\"\n class=\"internalDFN\"\n ><code>${escaped}</code></a>`;\n }\n\n const isDefaultJSON =\n data.type === \"operation\" &&\n data.name === \"toJSON\" &&\n data.extAttrs.some(({ name }) => name === \"Default\");\n if (isDefaultJSON) {\n return hyperHTML`<a\n data-link-type=\"dfn\"\n data-lt=\"default toJSON operation\">${escaped}</a>`;\n }\n if (!data.partial) {\n const dfn = hyperHTML`<dfn data-export data-dfn-type=\"${linkType}\">${escaped}</dfn>`;\n registerDefinition(dfn, [name]);\n decorateDfn(dfn, data, parentName, name);\n return dfn;\n }\n\n const unlinkedAnchor = hyperHTML`<a\n data-idl=\"${data.partial ? \"partial\" : null}\"\n data-link-type=\"${linkType}\"\n data-title=\"${data.name}\"\n data-xref-type=\"${linkType}\"\n >${escaped}</a>`;\n\n const showWarnings =\n name && data.type !== \"typedef\" && !(data.partial && !dfn);\n if (showWarnings) {\n const styledName = data.type === \"operation\" ? `${name}()` : name;\n const ofParent = parentName ? ` \\`${parentName}\\`'s` : \"\";\n const msg = `Missing \\`<dfn>\\` for${ofParent} \\`${styledName}\\` ${data.type}. [More info](https://github.com/w3c/respec/wiki/WebIDL-thing-is-not-defined).`;\n showInlineWarning(unlinkedAnchor, msg, \"\");\n }\n return unlinkedAnchor;\n}\n\n/**\n * Map to Shepherd types, for export.\n * @see https://tabatkins.github.io/bikeshed/#dfn-types\n */\nfunction getDfnType(idlType) {\n switch (idlType) {\n case \"operation\":\n return \"method\";\n case \"field\":\n return \"dict-member\";\n case \"callback interface\":\n case \"interface mixin\":\n return \"interface\";\n default:\n return idlType;\n }\n}\n\nfunction getIdlDefinitionClassName(defn) {\n switch (defn.type) {\n case \"callback interface\":\n return \"idlInterface\";\n case \"operation\":\n return \"idlMethod\";\n case \"field\":\n return \"idlMember\";\n case \"enum-value\":\n return \"idlEnumItem\";\n case \"callback function\":\n return \"idlCallback\";\n }\n return `idl${defn.type[0].toUpperCase()}${defn.type.slice(1)}`;\n}\n\nconst nameResolverMap = new WeakMap();\nfunction getNameAndId(defn, parent = \"\") {\n if (nameResolverMap.has(defn)) {\n return nameResolverMap.get(defn);\n }\n const result = resolveNameAndId(defn, parent);\n nameResolverMap.set(defn, result);\n return result;\n}\n\nfunction resolveNameAndId(defn, parent) {\n let name = getDefnName(defn);\n let idlId = getIdlId(name, parent);\n switch (defn.type) {\n // Top-level entities with linkable members.\n case \"callback interface\":\n case \"dictionary\":\n case \"interface\":\n case \"interface mixin\": {\n idlId += resolvePartial(defn);\n break;\n }\n case \"constructor\":\n case \"operation\": {\n const overload = resolveOverload(name, parent);\n if (overload) {\n name += overload;\n idlId += overload;\n } else if (defn.arguments.length) {\n idlId += defn.arguments\n .map(arg => `-${arg.name.toLowerCase()}`)\n .join(\"\");\n }\n break;\n }\n }\n return { name, idlId };\n}\n\nfunction resolvePartial(defn) {\n if (!defn.partial) {\n return \"\";\n }\n if (!idlPartials[defn.name]) {\n idlPartials[defn.name] = 0;\n }\n idlPartials[defn.name] += 1;\n return `-partial-${idlPartials[defn.name]}`;\n}\n\nfunction resolveOverload(name, parentName) {\n const qualifiedName = `${parentName}.${name}`;\n const fullyQualifiedName = `${qualifiedName}()`;\n let overload;\n if (!operationNames[fullyQualifiedName]) {\n operationNames[fullyQualifiedName] = 0;\n }\n if (!operationNames[qualifiedName]) {\n operationNames[qualifiedName] = 0;\n } else {\n overload = `!overload-${operationNames[qualifiedName]}`;\n }\n operationNames[fullyQualifiedName] += 1;\n operationNames[qualifiedName] += 1;\n return overload || \"\";\n}\n\nfunction getIdlId(name, parentName) {\n if (!parentName) {\n return `idl-def-${name.toLowerCase()}`;\n }\n return `idl-def-${parentName.toLowerCase()}-${name.toLowerCase()}`;\n}\n\nfunction getDefnName(defn) {\n switch (defn.type) {\n case \"enum-value\":\n return defn.value;\n case \"operation\":\n return defn.name;\n default:\n return defn.name || defn.type;\n }\n}\n\nfunction renderWebIDL(idlElement, index) {\n let parse;\n try {\n parse = webidl2.parse(idlElement.textContent, {\n sourceName: String(index),\n });\n } catch (e) {\n showInlineError(\n idlElement,\n `Failed to parse WebIDL: ${e.bareMessage}.`,\n e.bareMessage,\n { details: `<pre>${e.context}</pre>` }\n );\n // Skip this <pre> and move on to the next one.\n return [];\n }\n idlElement.classList.add(\"def\", \"idl\");\n const html = webidl2.write(parse, { templates });\n const render = hyperHTML.bind(idlElement);\n render`${html}`;\n idlElement.querySelectorAll(\"[data-idl]\").forEach(elem => {\n if (elem.dataset.dfnFor) {\n return;\n }\n const title = elem.dataset.title;\n // Select the nearest ancestor element that can contain members.\n const parent = elem.parentElement.closest(\"[data-idl][data-title]\");\n if (parent) {\n elem.dataset.dfnFor = parent.dataset.title;\n }\n registerDefinition(elem, [title]);\n });\n // cross reference\n const closestCite = idlElement.closest(\"[data-cite], body\");\n const { dataset } = closestCite;\n if (!dataset.cite) dataset.cite = \"WebIDL\";\n // includes webidl in some form\n if (!/\\bwebidl\\b/i.test(dataset.cite)) {\n const cites = dataset.cite.trim().split(/\\s+/);\n dataset.cite = [\"WebIDL\", ...cites].join(\" \");\n }\n return parse;\n}\n\nconst cssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/webidl.css\")).default;\n } catch {\n return fetchAsset(\"webidl.css\");\n }\n}\n\nexport async function run() {\n const idls = document.querySelectorAll(\"pre.idl\");\n if (!idls.length) {\n return;\n }\n if (!document.querySelector(\".idl:not(pre)\")) {\n const link = document.querySelector(\"head link\");\n if (link) {\n const style = document.createElement(\"style\");\n style.textContent = await cssPromise;\n link.before(style);\n }\n }\n const astArray = [...idls].map(renderWebIDL);\n\n const validations = webidl2.validate(astArray);\n for (const validation of validations) {\n let details = `<pre>${validation.context}</pre>`;\n if (validation.autofix) {\n validation.autofix();\n const idlToFix = webidl2.write(astArray[validation.sourceName]);\n const escaped = xmlEscape(idlToFix);\n details += `Try fixing as:\n <pre>${escaped}</pre>`;\n }\n showInlineError(\n idls[validation.sourceName],\n `WebIDL validation error: ${validation.bareMessage}`,\n validation.bareMessage,\n { details }\n );\n }\n document.normalize();\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using\n * anchor elements. Simply add \"data-cite\"\n * and key of specification.\n *\n * This module simply adds the found key\n * to either conf.normativeReferences\n * or to conf.informativeReferences depending on\n * if it starts with a ! or not.\n *\n * Usage:\n * https://github.com/w3c/respec/wiki/data--cite\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showInlineError,\n showInlineWarning,\n wrapInner,\n} from \"./utils.js\";\nexport const name = \"core/data-cite\";\n\nfunction requestLookup(conf) {\n const toCiteDetails = citeDetailsConverter(conf);\n return async elem => {\n const originalKey = elem.dataset.cite;\n const { key, frag, path } = toCiteDetails(elem);\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key.toLowerCase() === conf.shortName.toLowerCase()) {\n console.log(\n elem,\n `The reference \"${key}\" is resolved into the current document per \\`conf.shortName\\`.`\n );\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n cleanElement(elem);\n if (!entry) {\n showInlineWarning(elem, `Couldn't find a match for \"${originalKey}\"`);\n return;\n }\n href = entry.href;\n title = entry.title;\n }\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n switch (elem.localName) {\n case \"a\": {\n if (elem.textContent === \"\" && elem.dataset.lt !== \"the-empty-string\") {\n elem.textContent = title;\n }\n elem.href = href;\n if (!path && !frag) {\n const cite = document.createElement(\"cite\");\n elem.replaceWith(cite);\n cite.append(elem);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (!path && !frag) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n showInlineError(\n elem,\n \"Exporting an linked external definition is not allowed. Please remove the `data-export` attribute\",\n \"Please remove the `data-export` attribute.\"\n );\n delete elem.dataset.export;\n }\n elem.dataset.noExport = \"\";\n break;\n }\n }\n };\n}\n\nfunction cleanElement(elem) {\n [\"data-cite\", \"data-cite-frag\"]\n .filter(attrName => elem.hasAttribute(attrName))\n .forEach(attrName => elem.removeAttribute(attrName));\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n *\n * @return {(elem: HTMLElement) => CiteDetails};\n */\nfunction citeDetailsConverter(conf) {\n const findFrag = makeComponentFinder(\"#\");\n const findPath = makeComponentFinder(\"/\");\n return function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath } = dataset;\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: conf.shortName || \"\", isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path };\n return details;\n };\n}\n\nexport async function run(conf) {\n const toCiteDetails = citeDetailsConverter(conf);\n /** @type {NodeListOf<HTMLElement>} */\n const cites = document.querySelectorAll(\"dfn[data-cite], a[data-cite]\");\n Array.from(cites)\n .filter(el => el.dataset.cite)\n .map(toCiteDetails)\n // it's not the same spec\n .filter(({ key }) => {\n return key.toLowerCase() !== (conf.shortName || \"\").toLowerCase();\n })\n .forEach(({ isNormative, key }) => {\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n return;\n }\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n });\n}\n\n/**\n * @param {Document} doc\n * @param {*} conf\n */\nexport async function linkInlineCitations(doc, conf = respecConfig) {\n const toLookupRequest = requestLookup(conf);\n const elems = [\n ...doc.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n ),\n ];\n const citeConverter = citeDetailsConverter(conf);\n\n const promisesForMissingEntries = elems\n .map(citeConverter)\n .map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForMissingEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n // we now go to network to fetch missing entries\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) Object.assign(biblio, newEntries);\n\n const lookupRequests = [...new Set(elems)].map(toLookupRequest);\n return await Promise.all(lookupRequests);\n}\n","// @ts-check\n/**\n * Module: core/webidl-index\n * constructs a summary of WebIDL in the document by\n * cloning all the generated WebIDL nodes and\n * appending them to pre element.\n *\n * Usage\n * Add a <section id=\"idl-index\"> to the document.\n * It also supports title elements to generate a header.\n * Or if a header element is an immediate child, then\n * that is preferred.\n */\nexport const name = \"core/webidl-index\";\nimport { nonNormativeSelector } from \"./utils.js\";\n\nexport function run() {\n /** @type {HTMLElement | null} */\n const idlIndexSec = document.querySelector(\"section#idl-index\");\n if (!idlIndexSec) {\n return;\n }\n // Query for decedents headings, e.g., \"h2:first-child, etc..\"\n const query = [2, 3, 4, 5, 6].map(level => `h${level}:first-child`).join(\",\");\n if (!idlIndexSec.querySelector(query)) {\n const header = document.createElement(\"h2\");\n if (idlIndexSec.title) {\n header.textContent = idlIndexSec.title;\n idlIndexSec.removeAttribute(\"title\");\n } else {\n header.textContent = \"IDL Index\";\n }\n idlIndexSec.prepend(header);\n }\n\n // filter out the IDL marked with class=\"exclude\" and the IDL in non-normative sections\n const idlIndex = Array.from(\n document.querySelectorAll(\"pre.def.idl:not(.exclude)\")\n ).filter(idl => !idl.closest(nonNormativeSelector));\n\n if (idlIndex.length === 0) {\n const text = \"This specification doesn't declare any Web IDL.\";\n idlIndexSec.append(text);\n return;\n }\n\n const pre = document.createElement(\"pre\");\n pre.classList.add(\"idl\", \"def\");\n pre.id = \"actual-idl-index\";\n idlIndex\n .map(elem => {\n const fragment = document.createDocumentFragment();\n for (const child of elem.children) {\n fragment.appendChild(child.cloneNode(true));\n }\n return fragment;\n })\n .forEach(elem => {\n if (pre.lastChild) {\n pre.append(\"\\n\\n\");\n }\n pre.appendChild(elem);\n });\n // Remove duplicate IDs\n pre.querySelectorAll(\"*[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n idlIndexSec.appendChild(pre);\n}\n","// @ts-check\nimport { API_URL } from \"./xref.js\";\nimport { IDBKeyVal } from \"./utils.js\";\nimport { idb } from \"./import-maps.js\";\n\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n */\n\nconst VERSION_CHECK_WAIT = 5 * 60 * 60 * 1000; // 5 min\n\nasync function getIdbCache() {\n const db = await idb.openDB(\"xref\", 1, {\n upgrade(db) {\n db.createObjectStore(\"xrefs\");\n },\n });\n return new IDBKeyVal(db, \"xrefs\");\n}\n\n/**\n * @param {RequestEntry[]} uniqueQueryKeys\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nexport async function resolveXrefCache(uniqueQueryKeys) {\n try {\n const cache = await getIdbCache();\n return await resolveFromCache(uniqueQueryKeys, cache);\n } catch (err) {\n console.error(err);\n return new Map();\n }\n}\n\n/**\n * @param {RequestEntry[]} keys\n * @param {IDBKeyVal} cache\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function resolveFromCache(keys, cache) {\n const bustCache = await shouldBustCache(cache);\n if (bustCache) {\n await cache.clear();\n return new Map();\n }\n\n const cachedData = await cache.getMany(keys.map(key => key.id));\n return cachedData;\n}\n\n/**\n * Get last updated timestamp from server and bust cache based on that. This\n * way, we prevent dirty/erroneous/stale data being kept on a client (which is\n * possible if we use a `MAX_AGE` based caching strategy).\n * @param {IDBKeyVal} cache\n */\nasync function shouldBustCache(cache) {\n const lastChecked = await cache.get(\"__LAST_VERSION_CHECK__\");\n const now = Date.now();\n\n if (!lastChecked) {\n await cache.set(\"__LAST_VERSION_CHECK__\", now);\n return false;\n }\n if (now - lastChecked < VERSION_CHECK_WAIT) {\n // avoid checking network for any data update if old cache \"fresh\"\n return false;\n }\n\n const url = new URL(\"meta/version\", API_URL).href;\n const res = await fetch(url);\n if (!res.ok) return false;\n const lastUpdated = await res.text();\n await cache.set(\"__LAST_VERSION_CHECK__\", now);\n return parseInt(lastUpdated, 10) > lastChecked;\n}\n\n/**\n * @param {Map<string, SearchResultEntry[]>} data\n */\nexport async function cacheXrefData(data) {\n try {\n const cache = await getIdbCache();\n // add data to cache\n await cache.addMany(data);\n } catch (e) {\n console.error(e);\n }\n}\n\nexport async function clearXrefData() {\n try {\n const cache = await getIdbCache();\n await cache.clear();\n } catch (e) {\n console.error(e);\n }\n}\n","// @ts-check\n// Automatically adds external references.\n// Looks for the terms which do not have a definition locally on Shepherd API\n// For each returend result, adds `data-cite` attributes to respective elements,\n// so later they can be handled by core/link-to-dfn.\n// https://github.com/w3c/respec/issues/1662\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {Map<string, { elems: HTMLElement[], results: SearchResultEntry[], query: RequestEntry }>} ErrorCollection\n * @typedef {{ ambiguous: ErrorCollection, notFound: ErrorCollection }} Errors\n */\nimport { cacheXrefData, resolveXrefCache } from \"./xref-db.js\";\nimport {\n createResourceHint,\n flatten,\n nonNormativeSelector,\n norm as normalize,\n showInlineError,\n showInlineWarning,\n} from \"./utils.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst profiles = {\n \"web-platform\": [\"HTML\", \"INFRA\", \"URL\", \"WEBIDL\", \"DOM\", \"FETCH\"],\n};\n\nexport const API_URL = \"https://respec.org/xref/\";\n\nif (\n !document.querySelector(\"link[rel='preconnect'][href='https://respec.org']\")\n) {\n const link = createResourceHint({\n hint: \"preconnect\",\n href: \"https://respec.org\",\n });\n document.head.appendChild(link);\n}\n\n/**\n * main external reference driver\n * @param {Object} conf respecConfig\n * @param {HTMLElement[]} elems possibleExternalLinks\n */\nexport async function run(conf, elems) {\n const xref = normalizeConfig(conf.xref);\n if (xref.specs) {\n const bodyCite = document.body.dataset.cite\n ? document.body.dataset.cite.split(/\\s+/)\n : [];\n document.body.dataset.cite = bodyCite.concat(xref.specs).join(\" \");\n }\n\n if (!elems.length) return;\n\n /** @type {RequestEntry[]} */\n const queryKeys = [];\n for (const elem of elems) {\n const entry = getRequestEntry(elem);\n const id = await objectHash(entry);\n queryKeys.push({ ...entry, id });\n }\n\n const data = await getData(queryKeys, xref.url);\n addDataCiteToTerms(elems, queryKeys, data, conf);\n}\n\n/**\n * converts conf.xref to object with url and spec properties\n */\nfunction normalizeConfig(xref) {\n const defaults = {\n url: API_URL,\n specs: null,\n };\n\n const config = Object.assign({}, defaults);\n\n const type = Array.isArray(xref) ? \"array\" : typeof xref;\n switch (type) {\n case \"boolean\":\n // using defaults already, as above\n break;\n case \"string\":\n if (xref.toLowerCase() in profiles) {\n Object.assign(config, { specs: profiles[xref.toLowerCase()] });\n } else {\n invalidProfileError(xref);\n }\n break;\n case \"array\":\n Object.assign(config, { specs: xref });\n break;\n case \"object\":\n Object.assign(config, xref);\n if (xref.profile) {\n const profile = xref.profile.toLowerCase();\n if (profile in profiles) {\n const specs = (xref.specs || []).concat(profiles[profile]);\n Object.assign(config, { specs });\n } else {\n invalidProfileError(xref.profile);\n }\n }\n break;\n default:\n pub(\n \"error\",\n `Invalid value for \\`xref\\` configuration option. Received: \"${xref}\".`\n );\n }\n return config;\n\n function invalidProfileError(profile) {\n const supportedProfiles = Object.keys(profiles)\n .map(p => `\"${p}\"`)\n .join(\", \");\n const msg =\n `Invalid profile \"${profile}\" in \\`respecConfig.xref\\`. ` +\n `Please use one of the supported profiles: ${supportedProfiles}.`;\n pub(\"error\", msg);\n }\n}\n\n/**\n * get xref API request entry (term and context) for given xref element\n * @param {HTMLElement} elem\n */\nfunction getRequestEntry(elem) {\n const isIDL = \"xrefType\" in elem.dataset;\n\n let term = getTermFromElement(elem);\n if (!isIDL) term = term.toLowerCase();\n\n /** @type {string[][]} */\n const specs = [];\n /** @type {HTMLElement} */\n let dataciteElem = elem.closest(\"[data-cite]\");\n while (dataciteElem) {\n const cite = dataciteElem.dataset.cite.toLowerCase().replace(/[!?]/g, \"\");\n const cites = cite.split(/\\s+/).filter(s => s);\n if (cites.length) {\n specs.push(cites.sort());\n }\n if (dataciteElem === elem) break;\n dataciteElem = dataciteElem.parentElement.closest(\"[data-cite]\");\n }\n // if element itself contains data-cite, we don't take inline context into account\n if (elem.closest(\"[data-cite]\") !== elem) {\n const closestSection = elem.closest(\"section\");\n /** @type {Iterable<HTMLElement>} */\n const bibrefs = closestSection\n ? closestSection.querySelectorAll(\"a.bibref\")\n : [];\n const inlineRefs = [...bibrefs].map(el => el.textContent.toLowerCase());\n const uniqueInlineRefs = [...new Set(inlineRefs)].sort();\n if (uniqueInlineRefs.length) {\n specs.unshift(uniqueInlineRefs);\n }\n }\n\n const types = [];\n if (isIDL) {\n if (elem.dataset.xrefType) {\n types.push(...elem.dataset.xrefType.split(\"|\"));\n } else {\n types.push(\"_IDL_\");\n }\n } else {\n types.push(\"_CONCEPT_\");\n }\n\n let { xrefFor: forContext } = elem.dataset;\n if (!forContext && isIDL) {\n /** @type {HTMLElement} */\n const dataXrefForElem = elem.closest(\"[data-xref-for]\");\n if (dataXrefForElem) {\n forContext = normalize(dataXrefForElem.dataset.xrefFor);\n }\n } else if (forContext && typeof forContext === \"string\") {\n forContext = normalize(forContext);\n }\n return {\n term,\n types,\n ...(specs.length && { specs }),\n ...(typeof forContext === \"string\" && { for: forContext }),\n };\n}\n\n/** @param {HTMLElement} elem */\nfunction getTermFromElement(elem) {\n const { lt: linkingText } = elem.dataset;\n let term = linkingText ? linkingText.split(\"|\", 1)[0] : elem.textContent;\n term = normalize(term);\n return term === \"the-empty-string\" ? \"\" : term;\n}\n\n/**\n * @param {RequestEntry[]} queryKeys\n * @param {string} apiUrl\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function getData(queryKeys, apiUrl) {\n const uniqueIds = new Set();\n const uniqueQueryKeys = queryKeys.filter(key => {\n return uniqueIds.has(key.id) ? false : uniqueIds.add(key.id) && true;\n });\n\n const resultsFromCache = await resolveXrefCache(uniqueQueryKeys);\n\n const termsToLook = uniqueQueryKeys.filter(\n key => !resultsFromCache.get(key.id)\n );\n const fetchedResults = await fetchFromNetwork(termsToLook, apiUrl);\n if (fetchedResults.size) {\n // add data to cache\n await cacheXrefData(fetchedResults);\n }\n\n return new Map([...resultsFromCache, ...fetchedResults]);\n}\n\n/**\n * @param {RequestEntry[]} keys\n * @param {string} url\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function fetchFromNetwork(keys, url) {\n if (!keys.length) return new Map();\n\n const query = { keys };\n const options = {\n method: \"POST\",\n body: JSON.stringify(query),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n const response = await fetch(url, options);\n const json = await response.json();\n return new Map(json.result);\n}\n\n/**\n * Figures out from the tree structure if the reference is\n * normative (true) or informative (false).\n * @param {HTMLElement} elem\n */\nfunction isNormative(elem) {\n const closestNormative = elem.closest(\".normative\");\n const closestInform = elem.closest(nonNormativeSelector);\n if (!closestInform || elem === closestNormative) {\n return true;\n }\n return (\n closestNormative &&\n closestInform &&\n closestInform.contains(closestNormative)\n );\n}\n\n/**\n * adds data-cite attributes to elems for each term for which results are found.\n * adds citations to references section.\n * collects and shows linking errors if any.\n * @param {HTMLElement[]} elems\n * @param {RequestEntry[]} queryKeys\n * @param {Map<string, SearchResultEntry[]>} data\n * @param {any} conf\n */\nfunction addDataCiteToTerms(elems, queryKeys, data, conf) {\n /** @type {Errors} */\n const errors = { ambiguous: new Map(), notFound: new Map() };\n\n for (let i = 0, l = elems.length; i < l; i++) {\n if (elems[i].closest(\"[data-no-xref]\")) continue;\n\n const elem = elems[i];\n const query = queryKeys[i];\n\n const { id } = query;\n const results = data.get(id);\n if (results.length === 1) {\n addDataCite(elem, query, results[0], conf);\n } else {\n const collector = errors[results.length === 0 ? \"notFound\" : \"ambiguous\"];\n if (!collector.has(id)) {\n collector.set(id, { elems: [], results, query });\n }\n collector.get(id).elems.push(elem);\n }\n }\n\n showErrors(errors);\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {RequestEntry} query\n * @param {SearchResultEntry} result\n * @param {any} conf\n */\nfunction addDataCite(elem, query, result, conf) {\n const { term } = query;\n const { uri, shortname: cite, normative, type } = result;\n\n const path = uri.includes(\"/\") ? uri.split(\"/\", 1)[1] : uri;\n const [citePath, citeFrag] = path.split(\"#\");\n const dataset = { cite, citePath, citeFrag, type };\n Object.assign(elem.dataset, dataset);\n\n // update indirect links (data-lt, data-plurals)\n /** @type {NodeListOf<HTMLElement>} */\n const indirectLinks = document.querySelectorAll(\n `[data-dfn-type=\"xref\"][data-xref=\"${term.toLowerCase()}\"]`\n );\n indirectLinks.forEach(el => {\n el.removeAttribute(\"data-xref\");\n Object.assign(el.dataset, dataset);\n });\n\n addToReferences(elem, cite, normative, term, conf);\n}\n\n/**\n * add specs for citation (references section)\n * @param {HTMLElement} elem\n * @param {string} cite\n * @param {boolean} normative\n * @param {string} term\n * @param {any} conf\n */\nfunction addToReferences(elem, cite, normative, term, conf) {\n const isNormRef = isNormative(elem);\n if (!isNormRef) {\n // Only add it if not already normative...\n if (!conf.normativeReferences.has(cite)) {\n conf.informativeReferences.add(cite);\n }\n return;\n }\n if (normative) {\n // If it was originally informative, we move the existing\n // key to be normative.\n const existingKey = conf.informativeReferences.has(cite)\n ? conf.informativeReferences.getCanonicalKey(cite)\n : cite;\n conf.normativeReferences.add(existingKey);\n conf.informativeReferences.delete(existingKey);\n return;\n }\n\n const msg =\n `Adding an informative reference to \"${term}\" from \"${cite}\" ` +\n \"in a normative section\";\n const title = \"Error: Informative reference in normative section\";\n showInlineWarning(elem, msg, title);\n}\n\n/** @param {Errors} errors */\nfunction showErrors({ ambiguous, notFound }) {\n const getPrefilledFormURL = (term, query, specs = []) => {\n const url = new URL(API_URL);\n url.searchParams.set(\"term\", term);\n if (query.for) url.searchParams.set(\"for\", query.for);\n url.searchParams.set(\"types\", query.types.join(\",\"));\n if (specs.length) url.searchParams.set(\"cite\", specs.join(\",\"));\n return url;\n };\n\n for (const { query, elems } of notFound.values()) {\n const specs = [...new Set(flatten([], query.specs))].sort();\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const specsString = specs.map(spec => `\\`${spec}\\``).join(\", \");\n const msg =\n `Couldn't match \"**${originalTerm}**\" to anything in the document or in any other document cited in this specification: ${specsString}. ` +\n `See [how to cite to resolve the error](${formUrl})`;\n showInlineError(elems, msg, \"Error: No matching dfn found.\");\n }\n\n for (const { query, elems, results } of ambiguous.values()) {\n const specs = [...new Set(results.map(entry => entry.shortname))].sort();\n const specsString = specs.map(s => `**${s}**`).join(\", \");\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const msg =\n `The term \"**${originalTerm}**\" is defined in ${specsString} in multiple ways, so it's ambiguous. ` +\n `See [how to cite to resolve the error](${formUrl})`;\n showInlineError(elems, msg, \"Error: Linking an ambiguous dfn.\");\n }\n}\n\nfunction objectHash(obj) {\n const str = JSON.stringify(obj, Object.keys(obj).sort());\n const buffer = new TextEncoder().encode(str);\n return crypto.subtle.digest(\"SHA-1\", buffer).then(bufferToHexString);\n}\n\n/** @param {ArrayBuffer} buffer */\nfunction bufferToHexString(buffer) {\n const byteArray = new Uint8Array(buffer);\n return [...byteArray].map(v => v.toString(16).padStart(2, \"0\")).join(\"\");\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in conf.definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n addId,\n getLinkTargets,\n showInlineError,\n showInlineWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { run as addExternalReferences } from \"./xref.js\";\nimport { lang as defaultLang } from \"./l10n.js\";\nimport { definitionMap } from \"./dfn-map.js\";\nimport { linkInlineCitations } from \"./data-cite.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/link-to-dfn\";\nconst l10n = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n};\nconst lang = defaultLang in l10n ? defaultLang : \"en\";\n\nclass CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[String, HTMLElement]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n set(key, elem) {\n super.set(key.toLowerCase(), elem);\n return this;\n }\n get(key) {\n return super.get(key.toLowerCase());\n }\n has(key) {\n return super.has(key.toLowerCase());\n }\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLElement[]} */\n const possibleExternalLinks = [];\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n const localLinkSelector =\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\";\n document.querySelectorAll(localLinkSelector).forEach((\n /** @type {HTMLAnchorElement} */ anchor\n ) => {\n const linkTargets = getLinkTargets(anchor);\n const foundDfn = linkTargets.some(target => {\n return findLinkTarget(target, anchor, titleToDfns, possibleExternalLinks);\n });\n if (!foundDfn && linkTargets.length !== 0) {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n });\n\n showLinkingError(badLinks);\n\n if (conf.xref) {\n possibleExternalLinks.push(...findExplicitExternalLinks());\n try {\n await addExternalReferences(conf, possibleExternalLinks);\n } catch (error) {\n console.error(error);\n showLinkingError(possibleExternalLinks);\n }\n } else {\n showLinkingError(possibleExternalLinks);\n }\n\n await linkInlineCitations(document, conf);\n // Added message for legacy compat with Aria specs\n // See https://github.com/w3c/respec/issues/793\n pub(\"end\", \"core/link-to-dfn\");\n}\n\nfunction mapTitleToDfns() {\n const titleToDfns = new CaseInsensitiveMap();\n Object.keys(definitionMap).forEach(title => {\n const { result, duplicates } = collectDfns(title);\n titleToDfns.set(title, result);\n if (duplicates.length > 0) {\n showInlineError(\n duplicates,\n l10n[lang].duplicateMsg(title),\n l10n[lang].duplicateTitle\n );\n }\n });\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, HTMLElement>} */\n const result = new Map();\n const duplicates = [];\n definitionMap[title].forEach(dfn => {\n const { dfnFor = \"\" } = dfn.dataset;\n if (result.has(dfnFor)) {\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = result.get(dfnFor).localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n if (oldIsDfn) {\n if (!newIsDfn) {\n // Don't overwrite <dfn> definitions.\n return;\n }\n duplicates.push(dfn);\n }\n }\n result.set(dfnFor, dfn);\n addId(dfn, \"dfn\", title);\n });\n return { result, duplicates };\n}\n\n/**\n * @param {import(\"./utils.js\").LinkTarget} target\n * @param {HTMLAnchorElement} anchor\n * @param {CaseInsensitiveMap} titleToDfns\n * @param {HTMLElement[]} possibleExternalLinks\n */\nfunction findLinkTarget(target, anchor, titleToDfns, possibleExternalLinks) {\n const { linkFor } = anchor.dataset;\n if (\n !titleToDfns.has(target.title) ||\n !titleToDfns.get(target.title).get(target.for)\n ) {\n return false;\n }\n const dfn = titleToDfns.get(target.title).get(target.for);\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (linkFor && !titleToDfns.get(linkFor)) {\n possibleExternalLinks.push(anchor);\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n possibleExternalLinks.push(anchor);\n } else {\n if (anchor.dataset.idl === \"partial\") {\n possibleExternalLinks.push(anchor);\n } else {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n }\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return true;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) || shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt) {\n return dataset.lt.split(\"|\").includes(term);\n }\n }\n }\n return false;\n}\n\n/**\n * Find additional references that need to be looked up externally.\n * Examples: a[data-cite=\"spec\"], dfn[data-cite=\"spec\"], dfn.externalDFN\n */\nfunction findExplicitExternalLinks() {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n \"a[data-cite]:not([data-cite='']):not([data-cite*='#']), \" +\n \"dfn[data-cite]:not([data-cite='']):not([data-cite*='#'])\"\n );\n /** @type {NodeListOf<HTMLElement>} */\n const externalDFNs = document.querySelectorAll(\"dfn.externalDFN\");\n return [...links]\n .filter(el => {\n // ignore empties\n if (el.textContent.trim() === \"\") return false;\n /** @type {HTMLElement} */\n const closest = el.closest(\"[data-cite]\");\n return !closest || closest.dataset.cite !== \"\";\n })\n .concat(...externalDFNs);\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n showInlineWarning(\n elem,\n `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``,\n \"Linking error: not matching `<dfn>`\"\n );\n });\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { fetchAndCache, joinAnd } from \"./utils.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg =\n \"Requested list of contributors from GitHub, but \" +\n \"[`github`](https://github.com/w3c/respec/wiki/github) configuration option is not set.\";\n pub(\"error\", msg);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n await showContributors(editors, conf.githubAPI);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user => !editors.includes(user.name || user.login)\n );\n } catch (error) {\n pub(\"error\", \"Error loading contributors from GitHub.\");\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n hyperHTML(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// LIMITATION:\n// At this point we don't support having more than 26 appendices.\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - tocIntroductory: if set to true, the introductory material is listed in the TOC\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport { addId, children, parents, renameElement } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\nconst headerTags = [\"h1\", ...lowerHeaderTags];\n\nconst alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = hyperHTML`<ol class='toc'>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? alphabet.charAt(index - lastNonAppendix)\n : prefix + index;\n const level = Math.ceil(secno.length / 2);\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(hyperHTML`<bdi class='secno'>${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const item = createTocListItem(section.header, section.element.id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent, { tocIntroductory = false } = {}) {\n const sectionElements = children(\n parent,\n tocIntroductory ? \"section\" : \"section:not(.introductory)\"\n );\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: section.classList.contains(\"introductory\"),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section, { tocIntroductory }),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = hyperHTML`<a href=\"${`#${id}`}\" class=\"tocxref\"/>`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return hyperHTML`<li class='tocline'>${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"tocIntroductory\" in conf === false) {\n conf.tocIntroductory = false;\n }\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n const sectionTree = getSectionTree(document.body, {\n tocIntroductory: conf.tocIntroductory,\n });\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n const headerSelector = headerTags\n .map(h => `section:not(.introductory) ${h}:first-child`)\n .join(\",\");\n return [...document.querySelectorAll(headerSelector)].filter(\n elem => !elem.closest(\"section.introductory\")\n );\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = hyperHTML`<nav id=\"toc\">`;\n const h2 = hyperHTML`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = hyperHTML`<p role='navigation' id='back-to-top'><a href='#title'><abbr title='Back to Top'>↑</abbr></a></p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(hyperHTML`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId } from \"./utils.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head):not(.introductory) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n addId(h);\n if (!conf.addSectionLinks) continue;\n const id = h.parentElement.id || h.id;\n h.appendChild(hyperHTML`\n <a href=\"${`#${id}`}\" class=\"self-link\" aria-label=\"§\"></a>\n `);\n }\n}\n","// @ts-check\n/**\n * Module: \"core/caniuse\"\n * Adds a caniuse support table for a \"feature\" #1238\n * Usage options: https://github.com/w3c/respec/wiki/caniuse\n */\nimport { pub, sub } from \"./pubsubhub.js\";\nimport { createResourceHint } from \"./utils.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport const name = \"core/caniuse\";\n\nconst API_URL = \"https://respec.org/caniuse/\";\n\n// browser name dictionary\nconst BROWSERS = new Map([\n [\"and_chr\", \"Chrome (Android)\"],\n [\"and_ff\", \"Firefox (Android)\"],\n [\"and_uc\", \"UC Browser (Android)\"],\n [\"android\", \"Android\"],\n [\"bb\", \"Blackberry\"],\n [\"chrome\", \"Chrome\"],\n [\"edge\", \"Edge\"],\n [\"firefox\", \"Firefox\"],\n [\"ie\", \"IE\"],\n [\"ios_saf\", \"Safari (iOS)\"],\n [\"op_mini\", \"Opera Mini\"],\n [\"op_mob\", \"Opera Mobile\"],\n [\"opera\", \"Opera\"],\n [\"safari\", \"Safari\"],\n [\"samsung\", \"Samsung Internet\"],\n]);\n\n// Keys from https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md\nconst supportTitles = new Map([\n [\"y\", \"Supported.\"],\n [\"a\", \"Almost supported (aka Partial support).\"],\n [\"n\", \"No support, or disabled by default.\"],\n [\"p\", \"No support, but has Polyfill.\"],\n [\"u\", \"Support unknown.\"],\n [\"x\", \"Requires prefix to work.\"],\n [\"d\", \"Disabled by default (needs to enabled).\"],\n]);\n\nif (\n !document.querySelector(\"link[rel='preconnect'][href='https://respec.org']\")\n) {\n const link = createResourceHint({\n hint: \"preconnect\",\n href: \"https://respec.org\",\n });\n document.head.appendChild(link);\n}\n\nconst caniuseCssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/caniuse.css\")).default;\n } catch {\n return fetchAsset(\"caniuse.css\");\n }\n}\n\nexport async function run(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n const options = getNormalizedConf(conf);\n conf.caniuse = options; // for tests\n if (!options.feature) {\n return; // no feature to show\n }\n const featureURL = new URL(options.feature, \"https://caniuse.com/\").href;\n\n const caniuseCss = await caniuseCssPromise;\n document.head.appendChild(hyperHTML`\n <style class=\"removeOnSave\">${caniuseCss}</style>`);\n\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = (async () => {\n try {\n const apiUrl = options.apiURL || API_URL;\n const stats = await fetchStats(apiUrl, options);\n return createTableHTML(featureURL, stats);\n } catch (err) {\n console.error(err);\n const msg =\n `Couldn't find feature \"${options.feature}\" on caniuse.com? ` +\n \"Please check the feature key on [caniuse.com](https://caniuse.com)\";\n pub(\"error\", msg);\n return hyperHTML`<a href=\"${featureURL}\">caniuse.com</a>`;\n }\n })();\n const definitionPair = hyperHTML`\n <dt class=\"caniuse-title\">Browser support:</dt>\n <dd class=\"caniuse-stats\">${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}</dd>`;\n headDlElem.append(...definitionPair.childNodes);\n await contentPromise;\n\n // remove from export\n pub(\"amend-user-config\", { caniuse: options.feature });\n sub(\"beforesave\", outputDoc => {\n hyperHTML.bind(outputDoc.querySelector(\".caniuse-stats\"))`\n <a href=\"${featureURL}\">caniuse.com</a>`;\n });\n}\n\n/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction getNormalizedConf(conf) {\n const DEFAULTS = { versions: 4 };\n if (typeof conf.caniuse === \"string\") {\n return { feature: conf.caniuse, ...DEFAULTS };\n }\n const caniuseConf = { ...DEFAULTS, ...conf.caniuse };\n const { browsers } = caniuseConf;\n if (Array.isArray(browsers)) {\n const invalidBrowsers = browsers.filter(browser => !BROWSERS.has(browser));\n if (invalidBrowsers.length) {\n const names = invalidBrowsers.map(b => `\"\\`${b}\\`\"`).join(\", \");\n pub(\n \"warn\",\n `Ignoring invalid browser(s): ${names} in ` +\n \"[`respecConfig.caniuse.browsers`](https://github.com/w3c/respec/wiki/caniuse)\"\n );\n }\n }\n return caniuseConf;\n}\n\n/**\n * @param {string} apiURL\n * @typedef {Record<string, [string, string[]][]>} ApiResponse\n * @return {Promise<ApiResponse>}\n * @throws {Error} on failure\n */\nasync function fetchStats(apiURL, options) {\n const { feature, versions, browsers } = options;\n const searchParams = new URLSearchParams();\n searchParams.set(\"feature\", feature);\n searchParams.set(\"versions\", versions);\n if (Array.isArray(browsers)) {\n searchParams.set(\"browsers\", browsers.join(\",\"));\n }\n const url = `${apiURL}?${searchParams.toString()}`;\n const response = await fetch(url);\n const stats = await response.json();\n return stats;\n}\n\n/**\n * Get HTML element for the canIUse support table.\n * @param {string} featureURL\n * @param {ApiResponse} stats\n */\nfunction createTableHTML(featureURL, stats) {\n // render the support table\n return hyperHTML`\n ${Object.entries(stats).map(addBrowser)}\n <a href=\"${featureURL}\"\n title=\"Get details at caniuse.com\">More info\n </a>`;\n}\n\n/**\n * Add a browser and it's support to table.\n * @param {[ string, ApiResponse[\"browserName\"] ]} args\n */\nfunction addBrowser([browserName, browserData]) {\n /** @param {string[]} supportKeys */\n const getSupport = supportKeys => {\n const titles = supportKeys\n .filter(key => supportTitles.has(key))\n .map(key => supportTitles.get(key));\n return {\n className: `caniuse-cell ${supportKeys.join(\" \")}`,\n title: titles.join(\" \"),\n };\n };\n\n /** @param {[string, string[]]} args */\n const addLatestVersion = ([version, supportKeys]) => {\n const { className, title } = getSupport(supportKeys);\n const buttonText = `${BROWSERS.get(browserName) || browserName} ${version}`;\n return hyperHTML`\n <button class=\"${className}\" title=\"${title}\">${buttonText}</button>`;\n };\n\n /** @param {[string, string[]]} args */\n const addBrowserVersion = ([version, supportKeys]) => {\n const { className, title } = getSupport(supportKeys);\n return `<li class=\"${className}\" title=\"${title}\">${version}</li>`;\n };\n\n const [latestVersion, ...olderVersions] = browserData;\n return hyperHTML`\n <div class=\"caniuse-browser\">\n ${addLatestVersion(latestVersion)}\n <ul>\n ${olderVersions.map(addBrowserVersion)}\n </ul>\n </div>`;\n}\n","// @ts-check\nimport { fetchAndCache } from \"./utils.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport const name = \"core/mdn-annoatation\";\n\nconst SPEC_MAP_URL =\n \"https://raw.githubusercontent.com/w3c/mdn-spec-links/master/SPECMAP.json\";\nconst BASE_JSON_PATH = \"https://w3c.github.io/mdn-spec-links/\";\nconst MDN_URL_BASE = \"https://developer.mozilla.org/en-US/docs/Web/\";\nconst MDN_BROWSERS = {\n // The browser IDs here must match the ones in the imported JSON data.\n // See the list of browser IDs at https://goo.gl/iDacWP.\n chrome: \"Chrome\",\n chrome_android: \"Chrome Android\",\n edge: \"Edge\",\n edge_mobile: \"Edge Mobile\",\n firefox: \"Firefox\",\n firefox_android: \"Firefox Android\",\n ie: \"Internet Explorer\",\n // nodejs: \"Node.js\", // no data for features in HTML\n opera: \"Opera\",\n opera_android: \"Opera Android\",\n // qq_android: \"QQ Browser\", // not enough data for features in HTML\n safari: \"Safari\",\n safari_ios: \"Safari iOS\",\n samsunginternet_android: \"Samsung Internet\",\n // uc_android: \"UC browser\", // not enough data for features in HTML\n // uc_chinese_android: \"Chinese UC Browser\", // not enough data for features in HTML\n webview_android: \"WebView Android\",\n};\n\nconst mdnCssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/mdn-annotation.css\")).default;\n } catch {\n return fetchAsset(\"mdn-annotation.css\");\n }\n}\n\nfunction fetchAndCacheJson(url, maxAge) {\n if (!url) return {};\n return fetchAndCache(url, maxAge).then(r => r.json());\n}\n\nfunction insertMDNBox(node) {\n const targetAncestor = node.closest(\"section\");\n const { previousElementSibling: targetSibling, parentNode } = targetAncestor;\n if (targetSibling && targetSibling.classList.contains(\"mdn\")) {\n // If the target ancestor already has a mdnBox inserted, we just use it\n return targetSibling;\n }\n const mdnBox = hyperHTML`<aside class=\"mdn before wrapped\"></aside>`;\n parentNode.insertBefore(mdnBox, targetAncestor);\n return mdnBox;\n}\n\nfunction attachMDNDetail(container, mdnSpec) {\n const { slug, summary } = mdnSpec;\n container.innerHTML += `<button onclick=\"toggleMDNStatus(this.parentNode)\" aria-label=\"Expand MDN details\"><b>MDN</b></button>`;\n const mdnSubPath = slug.slice(slug.indexOf(\"/\") + 1);\n const mdnDetail = document.createElement(\"div\");\n const href = `${MDN_URL_BASE}${slug}`;\n hyperHTML(mdnDetail)`\n <a title=\"${summary}\" href=\"${href}\">${mdnSubPath}</a>\n `;\n attachMDNBrowserSupport(mdnDetail, mdnSpec);\n container.appendChild(mdnDetail);\n}\n\nfunction attachMDNBrowserSupport(container, mdnSpec) {\n if (!mdnSpec.support) {\n container.innerHTML += `<p class=\"nosupportdata\">No support data.</p>`;\n return;\n }\n const supportTable = hyperHTML`<p class=\"mdnsupport\">\n ${[buildBrowserSupportTable(mdnSpec.support)]}\n </p>`;\n container.appendChild(supportTable);\n}\n\nfunction buildBrowserSupportTable(support) {\n let innerHTML = \"\";\n function addMDNBrowserRow(browserId, yesNoUnknown, version) {\n const displayStatus = yesNoUnknown === \"Unknown\" ? \"?\" : yesNoUnknown;\n const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`;\n const browserRow = `\n <span class=\"${classList}\">\n <span class=\"browser-name\">${MDN_BROWSERS[browserId]}</span>\n <span class=\"version\">${version ? version : displayStatus}</span>\n </span>`;\n innerHTML += browserRow;\n }\n\n function processBrowserData(browserId, versionData) {\n if (versionData.version_removed) {\n addMDNBrowserRow(browserId, \"No\", \"\");\n return;\n }\n const versionAdded = versionData.version_added;\n if (!versionAdded) {\n addMDNBrowserRow(browserId, \"Unknown\", \"\");\n return;\n }\n if (typeof versionAdded === \"boolean\") {\n addMDNBrowserRow(browserId, versionAdded ? \"Yes\" : \"No\", \"\");\n } else {\n addMDNBrowserRow(browserId, \"Yes\", `${versionAdded}+`);\n }\n }\n\n Object.keys(MDN_BROWSERS).forEach(browserId => {\n if (!support[browserId]) {\n addMDNBrowserRow(browserId, \"Unknown\", \"\");\n } else {\n if (Array.isArray(support[browserId])) {\n support[browserId].forEach(b => {\n processBrowserData(browserId, b);\n });\n } else {\n processBrowserData(browserId, support[browserId]);\n }\n }\n });\n return innerHTML;\n}\n\nexport async function run(conf) {\n const { shortName, mdn } = conf;\n if (!shortName || !mdn) {\n // Nothing to do if shortName is not provided\n return;\n }\n const maxAge = mdn.maxAge || 60 * 60 * 24 * 1000;\n const specMapUrl = mdn.specMapUrl || SPEC_MAP_URL;\n const baseJsonPath = mdn.baseJsonPath || BASE_JSON_PATH;\n const specMap = await fetchAndCacheJson(specMapUrl, maxAge);\n const hasSpecJson = Object.values(specMap).some(\n jsonName => jsonName === `${shortName}.json`\n );\n if (!hasSpecJson) {\n return;\n }\n const mdnSpecJson = await fetchAndCacheJson(\n `${baseJsonPath}/${shortName}.json`,\n maxAge\n );\n const mdnCss = await mdnCssPromise;\n document.head.appendChild(hyperHTML`<style>${[mdnCss]}</style>`);\n document.head.appendChild(hyperHTML`<script>\n function toggleMDNStatus(div) {\n div.parentNode.classList.toggle('wrapped');\n }\n </script>`);\n const nodesWithId = document.querySelectorAll(\"[id]\");\n [...nodesWithId]\n .filter(node => {\n const unlikelyTagNames = [\"STYLE\", \"SCRIPT\", \"BODY\"];\n return (\n unlikelyTagNames.indexOf(node.tagName) === -1 &&\n mdnSpecJson[node.id] &&\n Array.isArray(mdnSpecJson[node.id])\n );\n })\n .forEach(node => {\n const mdnSpecArray = mdnSpecJson[node.id];\n const mdnBox = insertMDNBox(node);\n mdnSpecArray\n .map(spec => {\n const mdnDiv = document.createElement(\"div\");\n attachMDNDetail(mdnDiv, spec);\n return mdnDiv;\n })\n .forEach(mdnDiv => mdnBox.appendChild(mdnDiv));\n });\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nfunction serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = hyperHTML`<meta charset=\"utf-8\">`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = hyperHTML`\n <meta name=\"generator\" content=\"${respecVersion}\">\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\n// Create and download an EPUB 3 version of the content\n// Using (by default) the EPUB 3 conversion service set up at labs.w3.org/epub-generator\n// For more details on that service, see https://github.com/iherman/respec2epub\nconst epubURL = new URL(\n \"https://labs.w3.org/epub-generator/cgi-bin/epub-generator.py\"\n);\nepubURL.searchParams.append(\"type\", \"respec\");\nepubURL.searchParams.append(\"url\", document.location.href);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n fileName: \"index.html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n fileName: \"index.xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n fileName: \"spec.epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n href: epubURL.href,\n },\n];\n\nfunction toDownloadLink(details) {\n const { id, href, fileName, title, type } = details;\n return hyperHTML`\n <a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${fileName}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a>`;\n}\n\nconst saveDialog = {\n async show(button) {\n await document.respecIsReady;\n const div = hyperHTML`\n <div class=\"respec-save-buttons\">\n ${downloadLinks.map(toDownloadLink)}\n </div>`;\n ui.freshModal(l10n[lang].save_snapshot, div, button);\n },\n};\n\nconst supportsDownload = \"download\" in HTMLAnchorElement.prototype;\nlet button;\nif (supportsDownload) {\n button = ui.addCommand(\n l10n[lang].save_snapshot,\n show,\n \"Ctrl+Shift+Alt+S\",\n \"💾\"\n );\n}\n\nfunction show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed. \" +\n \"Use core/exporter `rsDocToDataURL()` instead.\";\n pub(\"warn\", msg);\n console.warn(msg);\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { flatten } from \"../core/utils.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\nimport { wireReference } from \"../core/biblio.js\";\n\nconst button = ui.addCommand(\n l10n[lang].search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"🔎\"\n);\nconst specrefURL = \"https://specref.herokuapp.com/\";\nconst refSearchURL = `${specrefURL}search-refs`;\nconst reveseLookupURL = `${specrefURL}reverse-lookup`;\nconst form = document.createElement(\"form\");\nconst renderer = hyperHTML.bind(form);\nconst resultList = hyperHTML.bind(document.createElement(\"div\"));\n\nform.id = \"specref-ui\";\n\n/**\n * @param {Map<string, string>} resultMap\n * @param {string} query\n * @param {number} timeTaken\n */\nfunction renderResults(resultMap, query, timeTaken) {\n if (!resultMap.size) {\n return resultList`\n <p class=\"state\">\n Your search - <strong> ${query} </strong> -\n did not match any references.\n </p>\n `;\n }\n const wires = Array.from(resultMap)\n .slice(0, 99)\n .map(toDefinitionPair)\n .reduce((collector, pair) => collector.concat(pair), []);\n return resultList`\n <p class=\"result-stats\">\n ${resultMap.size} results (${timeTaken} seconds).\n ${resultMap.size > 99 ? \"First 100 results.\" : \"\"}\n </p>\n <dl class=\"specref-results\">${wires}</dl>\n `;\n}\n\nfunction toDefinitionPair([key, entry]) {\n return hyperHTML.wire(entry)`\n <dt>\n [${key}]\n </dt>\n <dd>${wireReference(entry)}</dd>\n `;\n}\n\nfunction resultProcessor({ includeVersions = false } = {}) {\n return (...fetchedData) => {\n /** @type {{ [key: string]: any }} */\n const combinedResults = Object.assign({}, ...fetchedData);\n const results = new Map(Object.entries(combinedResults));\n // remove aliases\n Array.from(results)\n .filter(([, entry]) => entry.aliasOf)\n .map(([key]) => key)\n .reduce((results, key) => results.delete(key) && results, results);\n // Remove versions, if asked to\n if (!includeVersions) {\n Array.from(results.values())\n .filter(entry => typeof entry === \"object\" && \"versions\" in entry)\n .reduce(flatten, [])\n .forEach(version => {\n results.delete(version);\n });\n }\n // Remove legacy string entries\n Array.from(results)\n .filter(([, value]) => typeof value !== \"object\")\n .forEach(([key]) => results.delete(key));\n return results;\n };\n}\n\nform.addEventListener(\"submit\", async ev => {\n ev.preventDefault();\n const { searchBox } = form;\n const query = searchBox.value;\n if (!query) {\n searchBox.focus();\n return;\n }\n render({ state: \"Searching Specref…\" });\n const refSearch = new URL(refSearchURL);\n refSearch.searchParams.set(\"q\", query);\n const reverseLookup = new URL(reveseLookupURL);\n reverseLookup.searchParams.set(\"urls\", query);\n try {\n const startTime = performance.now();\n const jsonData = await Promise.all([\n fetch(refSearch).then(response => response.json()),\n fetch(reverseLookup).then(response => response.json()),\n ]);\n const { checked: includeVersions } = form.includeVersions;\n const processResults = resultProcessor({ includeVersions });\n const results = processResults(...jsonData);\n render({\n query,\n results,\n state: \"\",\n timeTaken: Math.round(performance.now() - startTime) / 1000,\n });\n } catch (err) {\n console.error(err);\n render({ state: \"Error! Couldn't do search.\" });\n } finally {\n searchBox.focus();\n }\n});\n\nfunction show() {\n render();\n ui.freshModal(l10n[lang].search_specref, form, button);\n /** @type {HTMLElement} */\n const input = form.querySelector(\"input[type=search]\");\n input.focus();\n}\n\nconst mast = hyperHTML.wire()`\n <header>\n <p>\n An Open-Source, Community-Maintained Database of\n Web Standards & Related References.\n </p>\n </header>\n <div class=\"searchcomponent\">\n <input\n name=\"searchBox\"\n type=\"search\"\n autocomplete=\"off\"\n placeholder=\"Keywords, titles, authors, urls…\">\n <button\n type=\"submit\">\n Search\n </button>\n <label>\n <input type=\"checkbox\" name=\"includeVersions\"> Include all versions.\n </label>\n </div>\n`;\n\n/**\n * @param {object} options\n * @param {string} [options.state]\n * @param {Map<string, string>} [options.results]\n * @param {number} [options.timeTaken]\n * @param {string} [options.query]\n */\nfunction render({ state = \"\", results, timeTaken, query } = {}) {\n if (!results) {\n renderer`<div>${mast}</div>`;\n return;\n }\n renderer`\n <div>${mast}</div>\n <p class=\"state\" hidden=\"${!state}\">\n ${state}\n </p>\n <section hidden=\"${!results}\">${\n results ? renderResults(results, query, timeTaken) : []\n }</section>\n `;\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst XREF_URL = \"https://respec.org/xref/\";\n\nconst localizationStrings = {\n en: {\n title: \"Search definitions\",\n },\n};\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\nconst l10n = localizationStrings[lang];\n\nconst button = ui.addCommand(l10n.title, show, \"Ctrl+Shift+Alt+x\", \"📚\");\n\nfunction show() {\n const iframe = document.createElement(\"iframe\");\n iframe.id = \"xref-ui\";\n iframe.src = XREF_URL;\n iframe.onload = () => iframe.classList.add(\"ready\");\n ui.freshModal(l10n.title, iframe, button);\n}\n","// @ts-check\n// Module ui/dfn-list\n// Displays all definitions with links to the defining element.\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { definitionMap } from \"../core/dfn-map.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst button = ui.addCommand(\n l10n[lang].definition_list,\n show,\n \"Ctrl+Shift+Alt+D\",\n \"📔\"\n);\n\nconst ul = document.createElement(\"ul\");\nul.classList.add(\"respec-dfn-list\");\nconst render = hyperHTML.bind(ul);\n\nul.addEventListener(\"click\", ev => {\n ui.closeModal();\n ev.stopPropagation();\n});\n\nfunction show() {\n const definitionLinks = Object.entries(definitionMap)\n .sort(([keyA], [keyB]) => keyA.localeCompare(keyB))\n .map(([, [dfn]]) => {\n return hyperHTML.wire(dfn, \":li>a\")`\n <li>\n <a href=\"${`#${dfn.id}`}\">\n ${dfn.textContent}\n </a>\n </li>\n `;\n });\n render`${definitionLinks}`;\n ui.freshModal(l10n[lang].list_of_definitions, ul, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = hyperHTML.bind(div);\nconst button = ui.addCommand(\n `About ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n ui.freshModal(\n `${l10n[lang].about_respec} - ${window.respecVersion}`,\n div,\n button\n );\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://github.com/w3c/respec/wiki'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const render = hyperHTML.bind(document.createElement(\"tr\"));\n const moduleURL = `https://github.com/w3c/respec/tree/develop/src/${name}.js`;\n return render`\n <td>\n <a href=\"${moduleURL}\">\n ${name}\n </a>\n </td>\n <td>\n ${duration}\n </td>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","// @ts-check\n// Module w3c/seo\n// Manages SEO information for documents\n// e.g. set the canonical URL for the document if configured\nimport { pub } from \"../core/pubsubhub.js\";\nimport { resolveRef } from \"../core/biblio.js\";\nexport const name = \"w3c/seo\";\nexport async function run(conf) {\n // Don't include a canonical URL for documents\n // that haven't been published.\n if (!conf.canonicalURI) {\n switch (conf.specStatus) {\n case \"CG-DRAFT\":\n case \"BG-DRAFT\":\n case \"unofficial\":\n return;\n }\n }\n const trLatestUri = conf.shortName\n ? `https://www.w3.org/TR/${conf.shortName}/`\n : null;\n switch (conf.canonicalURI) {\n case \"edDraft\":\n if (conf.edDraftURI) {\n conf.canonicalURI = new URL(\n conf.edDraftURI,\n document.location.href\n ).href;\n } else {\n pub(\n \"warn\",\n \"Canonical URI set to edDraft, \" +\n \"but no edDraftURI is set in configuration\"\n );\n conf.canonicalURI = null;\n }\n break;\n case \"TR\":\n if (trLatestUri) {\n conf.canonicalURI = trLatestUri;\n } else {\n pub(\n \"warn\",\n \"Canonical URI set to TR, but \" +\n \"no shortName is set in configuration\"\n );\n conf.canonicalURI = null;\n }\n break;\n default:\n if (conf.canonicalURI) {\n try {\n conf.canonicalURI = new URL(\n conf.canonicalURI,\n document.location.href\n ).href;\n } catch (err) {\n pub(\"warn\", `CanonicalURI is an invalid URL: ${err.message}`);\n conf.canonicalURI = null;\n }\n } else if (trLatestUri) {\n conf.canonicalURI = trLatestUri;\n }\n }\n if (conf.canonicalURI) {\n const linkElem = document.createElement(\"link\");\n linkElem.setAttribute(\"rel\", \"canonical\");\n linkElem.setAttribute(\"href\", conf.canonicalURI);\n document.head.appendChild(linkElem);\n }\n if (conf.doJsonLd) {\n await addJSONLDInfo(conf, document);\n }\n}\n\nasync function addJSONLDInfo(conf, doc) {\n // Content for JSON\n const type = [\"TechArticle\"];\n if (conf.rdfStatus) type.push(conf.rdfStatus);\n\n const jsonld = {\n \"@context\": [\n \"http://schema.org\",\n {\n \"@vocab\": \"http://schema.org/\",\n \"@language\": doc.documentElement.lang || \"en\",\n w3p: \"http://www.w3.org/2001/02pd/rec54#\",\n foaf: \"http://xmlns.com/foaf/0.1/\",\n datePublished: { \"@type\": \"http://www.w3.org/2001/XMLSchema#date\" },\n inLanguage: { \"@language\": null },\n isBasedOn: { \"@type\": \"@id\" },\n license: { \"@type\": \"@id\" },\n },\n ],\n id: conf.canonicalURI || conf.thisVersion,\n type,\n name: conf.title,\n inLanguage: doc.documentElement.lang || \"en\",\n license: conf.licenseInfo.url,\n datePublished: conf.dashDate,\n /** @type {{ name: string, url?: string } | { name: string, url?: string }[]} */\n copyrightHolder: {\n name: \"World Wide Web Consortium\",\n url: \"https://www.w3.org/\",\n },\n discussionUrl: conf.issueBase,\n alternativeHeadline: conf.subtitle,\n isBasedOn: conf.prevVersion,\n };\n\n // add any additional copyright holders\n if (conf.additionalCopyrightHolders) {\n const addl = Array.isArray(conf.additionalCopyrightHolders)\n ? conf.additionalCopyrightHolders\n : [conf.additionalCopyrightHolders];\n jsonld.copyrightHolder = [\n jsonld.copyrightHolder,\n ...addl.map(h => ({ name: h })),\n ];\n }\n\n // description from meta description\n const description = doc.head.querySelector(\"meta[name=description]\");\n if (description) {\n jsonld.description = description.content;\n }\n\n // Editors\n if (conf.editors) {\n jsonld.editor = conf.editors.map(addPerson);\n }\n if (conf.authors) {\n jsonld.contributor = conf.authors.map(addPerson);\n }\n\n // normative and informative references\n const citationIds = [\n ...conf.normativeReferences,\n ...conf.informativeReferences,\n ];\n const citationContents = await Promise.all(\n citationIds.map(ref => resolveRef(ref))\n );\n jsonld.citation = citationContents\n .filter(ref => typeof ref === \"object\")\n .map(addRef);\n\n const script = doc.createElement(\"script\");\n script.type = \"application/ld+json\";\n script.textContent = JSON.stringify(jsonld, null, 2);\n doc.head.appendChild(script);\n}\n\n/**\n * Turn editors and authors into a list of JSON-LD relationships\n */\nfunction addPerson({ name, url, mailto, company, companyURL }) {\n const ed = {\n type: \"Person\",\n name,\n url,\n \"foaf:mbox\": mailto,\n };\n if (company || companyURL) {\n ed.worksFor = {\n name: company,\n url: companyURL,\n };\n }\n return ed;\n}\n\n/**\n * Create a reference URL from the ref\n */\nfunction addRef(ref) {\n const { href: id, title: name, href: url } = ref;\n const jsonld = {\n id,\n type: \"TechArticle\",\n name,\n url,\n };\n if (ref.authors) {\n jsonld.creator = ref.authors.map(a => ({ name: a }));\n }\n if (ref.rawDate) {\n jsonld.publishedDate = ref.rawDate;\n }\n if (ref.isbn) {\n jsonld.identifier = ref.isbn;\n }\n if (ref.publisher) {\n jsonld.publisher = { name: ref.publisher };\n }\n return jsonld;\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight.js\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML as html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nconst ghCssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/github.css\")).default;\n } catch {\n return fetchAsset(\"github.css\");\n }\n}\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n const ghCss = await ghCssPromise;\n document.head.appendChild(\n html`\n <style>\n ${ghCss}\n </style>\n `\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/webidl-clipboard\n *\n * This module adds a button to each IDL pre making it possible to copy\n * well-formatted IDL to the clipboard.\n *\n */\nimport { fetchAsset } from \"./text-loader.js\";\nexport const name = \"core/webidl-clipboard\";\n\nconst copyButtonPromise = createButton();\n\nasync function loadSVG() {\n try {\n return (await import(\"text!../../assets/clipboard.svg\")).default;\n } catch {\n return fetchAsset(\"clipboard.svg\");\n }\n}\n\nasync function createButton() {\n const copyButton = document.createElement(\"button\");\n copyButton.innerHTML = await loadSVG();\n copyButton.title = \"Copy IDL to clipboard\";\n copyButton.classList.add(\"respec-button-copy-paste\", \"removeOnSave\");\n return copyButton;\n}\n\nexport async function run() {\n // This button serves a prototype that we clone as needed.\n const copyButton = await copyButtonPromise;\n for (const pre of document.querySelectorAll(\"pre.idl\")) {\n const button = copyButton.cloneNode(true);\n button.addEventListener(\"click\", () => {\n clipboardWriteText(pre.textContent);\n });\n pre.prepend(button);\n }\n}\n\n/**\n * Mocks navigator.clipboard.writeText()\n * @param {string} text\n */\nfunction clipboardWriteText(text) {\n if (navigator.clipboard) {\n return navigator.clipboard.writeText(text);\n }\n return new Promise(resolve => {\n document.addEventListener(\n \"copy\",\n ev => {\n ev.clipboardData.setData(\"text/plain\", text);\n resolve();\n },\n { once: true }\n );\n document.execCommand(\"copy\");\n });\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://github.com/w3c/respec/wiki/data-tests\n */\nimport { lang as defaultLang } from \"./l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { showInlineWarning } from \"./utils.js\";\nconst l10n = {\n en: {\n missing_test_suite_uri:\n \"Found tests in your spec, but missing '\" +\n \"[`testSuiteURI`](https://github.com/w3c/respec/wiki/testSuiteURI)' in your ReSpec config.\",\n tests: \"tests\",\n test: \"test\",\n },\n};\n\nexport const name = \"core/data-tests\";\n\nconst lang = defaultLang in l10n ? defaultLang : \"en\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"🔒\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"💪\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = hyperHTML.bind(document.createElement(\"li\"))`\n <a href=\"${href}\">\n ${testFileName}\n </a> ${emojiList}\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n pub(\"error\", l10n[lang].missing_test_suite_uri);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n delete elem.dataset.tests;\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n */\nfunction toTestURLs(tests, testSuiteURI) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n pub(\"warn\", `${l10n[lang].bad_uri}: ${test}`);\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n showInlineWarning(\n elem,\n `Duplicate tests found`,\n `To fix, remove duplicates from \"data-tests\": ${duplicates\n .map(url => new URL(url).pathname)\n .join(\", \")}`\n );\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const details = document.createElement(\"details\");\n const renderer = hyperHTML.bind(details);\n details.classList.add(\"respec-tests-details\", \"removeOnSave\");\n const uniqueList = [...new Set(testURLs)];\n renderer`\n <summary>\n tests: ${uniqueList.length}\n </summary>\n <ul>${uniqueList.map(toListItem)}</ul>\n `;\n return details;\n}\n","// @ts-check\nimport { children } from \"./utils.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n return ({ textContent: a }, { textContent: b }) => {\n return direction === \"ascending\" ? a.localeCompare(b) : b.localeCompare(a);\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...children(elem, \"li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...children(dl, \"dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default:\n pub(\"warning\", `ReSpec can't sort ${elem.localName} elements.`);\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport { fetchAsset } from \"./text-loader.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nconst hlVarsPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/var.css\")).default;\n } catch {\n return fetchAsset(\"var.css\");\n }\n}\n\nexport async function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = await hlVarsPromise;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = varElem.textContent.trim();\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n el.textContent.trim() === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport { fetchAsset } from \"./text-loader.js\";\n\nexport const name = \"core/data-type\";\n\nconst tooltipStylePromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/datatype.css\")).default;\n } catch {\n return fetchAsset(\"datatype.css\");\n }\n}\n\nexport async function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = await tooltipStylePromise;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\n\nimport { fetchAsset } from \"./text-loader.js\";\n\nexport const name = \"core/algorithms\";\n\nconst cssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/algorithms.css\")).default;\n } catch {\n return fetchAsset(\"algorithms.css\");\n }\n}\n\nexport async function run() {\n const elements = Array.from(document.querySelectorAll(\"ol.algorithm li\"));\n elements\n .filter(li => li.textContent.trim().startsWith(\"Assert: \"))\n .forEach(li => li.classList.add(\"assert\"));\n if (document.querySelector(\".assert\")) {\n const style = document.createElement(\"style\");\n style.textContent = await cssPromise;\n document.head.appendChild(style);\n }\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, showInlineError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n showInlineError(a, msg, `No matching id in document: ${id}.`);\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n showInlineError(a, msg, `Can't expand \"#${id}\".`);\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n showInlineError(a, msg, \"Missing title.\");\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n showInlineError(a, msg, \"Missing figcaption in referenced figure.\");\n return;\n }\n // remove the figure's title\n const children = [...makeSafeCopy(figcaption).childNodes].filter(\n node => !node.classList || !node.classList.contains(\"fig-title\")\n );\n // drop an empty space at the end.\n children.pop();\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n showInlineError(a, msg, `No matching id in document: \"${id}\".`);\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { hyperHTML } from \"../import-maps.js\";\nimport { showInlineError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n hyperHTML.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showInlineError(this, error.message, error.message))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const githubObject = await github;\n if (!githubObject) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const { api: githubAPI } = githubObject;\n const url = new URL(\"commits\", githubAPI);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && hyperHTML` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return hyperHTML`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: Function }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n"],"names":["window","addEventListener","ev","console","error","message","modules","Promise","async","domReady","document","readyState","resolve","runner","ui","plugins","all","show","runAll","enable","catch","err","inAmd","require","deps","callback","map","dep","Error","then","results","expose","name","object","subscriptions","Map","pub","topic","data","has","Array","from","get","forEach","cb","parent","self","args","arg","String","JSON","stringify","stack","postMessage","location","origin","sub","opts","once","wrapper","unsub","add","set","Set","callbacks","delete","warn","str","userConfig","amendConfig","newValues","Object","assign","removeList","overrideConfig","config","searchQuery","search","replace","params","URLSearchParams","overrideProps","filter","key","value","codedKey","codedValue","decodeURIComponent","decodedValue","parse","reduce","collector","script","createElement","id","type","prop","innerHTML","head","appendChild","respecDonePromise","doneResolver","defineProperty","done","result","isArray","postProcess","promises","f","isFunction","values","push","afterEnd","preProcess","html","documentElement","hasAttribute","lang","dir","base","about_respec","abstract","author","authors","bug_tracker","close_parens","definition_list","editor","editors_note","editors","feature_at_risk","former_editor","former_editors","info_references","issue_summary","issue","latest_editors_draft","latest_published_version","list_of_definitions","norm_references","note","open_bugs","open_parens","participate","references","save_as","save_snapshot","search_specref","sotd","this_version","toc","warning","ko","zh","file_a_bug","ja","nl","es","l10n","en","run","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","resourceHints","fetchDestinations","nonNormativeSelector","createResourceHint","TypeError","hint","url","URL","href","linkElem","rel","corsMode","crossOrigin","as","setAttribute","dontRemove","classList","removeReSpec","doc","querySelectorAll","elem","remove","showInlineWarning","elems","msg","title","links","element","i","markAsOffending","generateMarkdownLink","join","showInlineError","details","addId","IDBKeyVal","[object Object]","idb","storeName","this","transaction","objectStore","keys","keySet","cursor","store","openCursor","continue","tx","put","entries","clear","getAllKeys","joinAnd","array","mapper","item","docLang","items","ListFormat","style","format","length","toString","lastComma","lastIndexOf","substr","slice","xmlEscape","s","norm","trim","concatDate","date","sep","toShortIsoDate","humanDate","Date","langs","toLocaleString","toKeyValuePairs","obj","delimiter","separator","linkCSS","styles","frag","concat","link","nextLink","createDocumentFragment","runTransforms","content","flist","funcArgs","arguments","shift","methods","split","j","meth","method","apply","e","fetchAndCache","input","maxAge","request","Request","cache","cachedResponse","caches","open","match","headers","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","cacheResponse","Response","blob","flatten","pfx","txt","noLC","textContent","toLowerCase","normalize","test","ownerDocument","getElementById","nextId","getTextNodes","el","exclusions","options","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","NodeFilter","SHOW_TEXT","node","parentElement","closest","FILTER_REJECT","FILTER_ACCEPT","textNodes","nextNode","getDfnTitles","titleSet","normText","dataset","child","children","lt","childNodes","getElementsByTagName","getLinkTargets","linkForElem","linkFor","for","renameElement","newName","localName","newElement","attributes","append","replaceWith","refTypeFromContext","ref","closestInformative","isInformative","querySelector","startsWith","illegal","wrapInner","outer","parents","selector","list","tempId","Math","random","query","elements","msgIdGenerator","namespace","counter","gen","idGenerator","next","InsensitiveStringSet","super","getCanonicalKey","some","existingKey","find","makeSafeCopy","cloneNode","removeAttribute","dfn","removeCommentNodes","walker","createTreeWalker","SHOW_COMMENT","comment","walkTree","canMeasure","performance","mark","measure","toRunnable","plug","reject","timerId","setTimeout","clearTimeout","plugs","respecConfig","preProcessDone","runnables","task","postProcessDone","fetchBase","path","text","fetchAsset","fileName","instanceOfAny","constructors","c","idbProxyableTypes","cursorAdvanceMethods","getIdbProxyableTypes","IDBDatabase","IDBObjectStore","IDBIndex","IDBCursor","IDBTransaction","getCursorAdvanceMethods","prototype","advance","continuePrimaryKey","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","promisifyRequest","promise","unlisten","removeEventListener","success","wrap","cacheDonePromiseForTransaction","complete","idbProxyTraps","target","receiver","objectStoreNames","undefined","addTraps","wrapFunction","func","includes","unwrap","storeNames","call","sort","transformCachableValue","Proxy","IDBRequest","newValue","openDB","version","blocked","upgrade","blocking","indexedDB","openPromise","event","oldVersion","newVersion","db","deleteDB","deleteDatabase","readMethods","writeMethods","cachedMethods","getMethod","targetFuncName","useIndex","isWrite","index","returnVal","oldTraps","lastLine","splitted","source","position","current","kind","level","autofix","ruleName","sliceTokens","count","max","tokensToText","inputs","precedes","t","trivia","nextToken","line","precedingLastLine","subsequentTokens","subsequentText","sourceContext","repeat","contextType","context","partial","bareMessage","sourceName","tokens","syntaxError","validationError","token","Base","defineProperties","writable","json","inheritance","proto","descMap","getOwnPropertyDescriptors","enumerable","getPrototypeOf","idlTypeIncludesDictionary","idlType","defs","useNullableInner","union","def","unique","typedefIncludesDictionary","reference","dictionary","nullable","subtype","dictionaryIncludesRequiredField","dict","superdict","members","field","required","generic_type","tokeniser","typeName","consume","ret","autoParenter","Type","probe","return_type","type_with_extended_attributes","keyType","stringTypes","keyIdlType","valueType","close","type_suffix","single_type","primitive_type","typeNameKeywords","generic","union_type","typ","or","extAttrs","Boolean","unescape","prefix","postfix","typedef","targetToken","validate","Default","const_value","expression","const_data","negative","ArrayBase","Token","tokenName","parser","listName","identifiersOrStrings","toks","ExtendedAttributeParameters","secondaryName","rhsIsList","argument_list","hasRhs","rhsType","SimpleExtendedAttribute","rhs","ExtendedAttributes","extAttr","Argument","start_position","optional","variadic","argumentNameKeywords","default","unconsume","autofixOptionalDictionaryDefaultValue","isLastRequiredArgument","autofixDictionaryArgumentOptionality","indexOf","a","firstToken","getFirstToken","Tokeniser","Operation","special","regular","termination","argument","Attribute","noInherit","readonly","identifier","allowDangler","first","num_type","integer_type","decimal_type","voidToken","stringifier","getLastIndentation","lines","getMemberIndentation","parentTrivia","indentation","indentCh","autofixAddExposedWindow","exposed","existing","unshift","x","y","findLastIndex","predicate","reverse","findIndex","p","tokenRe","decimal","integer","string","whitespace","other","nonRegexTerminals","punctuations","reserved","tokenise","lastCharIndex","nextChar","charAt","attemptTokenMatch","noFlushTrivia","currentTrivia","pop","lastIndex","WebIDLParseError","punctuation","re","exec","idl","candidates","EnumValue","Enum","Includes","mixin","Typedef","CallbackFunction","colon","Container","instance","inheritable","allowedMembers","ea","mem","member","Constant","IterableLike","secondTypeRequired","secondTypeAllowed","checkInterfaceMemberDuplication","opNames","getOperations","op","partials","mixins","mixinMap","ext","additions","forEachExtension","addition","existings","Constructor","static_member","Interface","every","oldConstructors","constructor","autofixConstructor","namedConstructors","named","interfaceDef","constructorExtAttr","memberIndent","constructorOp","existingIndex","m","splice","removed","Mixin","Field","Dictionary","Namespace","CallbackInterface","parseByTokens","interface_","definition","res","eof","concrete","definitions","noop","templates","nameless","extendedAttribute","extendedAttributeReference","write","ast","ts","raw","unescaped","reference_token","name_token","type_body","it","extended_attributes","default_","make_ext_at","eats","container","inh","iterate","iterable_like","table","interface","interface mixin","operation","body","attribute","const","enum","enum-value","v","iterable","maplike","setlike","callback interface","things","thing","dispatch","getMixinMap","include","groupDefinitions","duplicates","checkDuplicatedNames","dup","validateIterable","flat","hyperHTML","N","n","r","hasOwnProperty","_","configurable","o","u","WeakSet","l","insertBefore","selected","selectedIndex","b","w","nextSibling","E","k","S","parentNode","removeChild","compare","before","h","d","g","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","detail","CustomEvent","_wire$","ELEMENT_NODE","nodeType","A","T","M","O","L","P","D","W","define","invoke","$","R","H","RegExp","$1","F","firstChild","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","getAttribute","te","ne","ie","ae","oe","ue","le","ce","se","fe","he","de","ve","pe","ge","me","ye","be","we","nodeName","setAttributeNode","replaceChild","sparse","Ne","xe","Ee","Ce","convert","transform","updates","fn","any","Se","Ae","Te","getAttributeNode","_e","Me","cssText","setProperty","Oe","je","Le","Pe","lastChild","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","De","We","Be","qe","render","$e","placeholder","Re","Fe","He","Ie","ze","Ve","Ze","Je","Event","MutationObserver","observe","subtree","childList","addedNodes","removedNodes","dispatchEvent","Ke","Qe","Ue","template","ke","Xe","removeAttributeNode","createTextNode","Ye","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","et","tt","nt","rt","at","ot","ut","tagger","ct","st","ft","ht","dt","vt","wire","bind","Component","diff","hyper","create","handleEvent","currentTarget","svg","state","defaultState","component","setState","createCommonjsModule","module","exports","marked","root","block","newline","code","fences","hr","heading","blockquote","nptable","lheading","_paragraph","Lexer","defaults","rules","normal","pedantic","gfm","_label","_title","edit","getRegex","bullet","_tag","_comment","paragraph","merge","lex","src","top","loose","cap","bull","listStart","listItems","space","tag","isordered","istask","ischecked","substring","lastToken","trimRight","codeBlockStyle","rtrim","depth","header","splitCells","align","cells","ordered","start","smartLists","checked","sanitize","pre","sanitizer","escape","charCodeAt","inline","autolink","reflink","nolink","strong","em","br","del","InlineLexer","renderer","Renderer","breaks","TextRenderer","Parser","slugger","Slugger","seen","encode","escapeTest","escapeReplace","ch","replacements","escapeTestNoEncode","escapeReplaceNoEncode","fromCharCode","parseInt","regex","opt","val","cleanUrl","prot","originIndependentUrl","baseUrls","resolveUrl","encodeURI","_punctuation","_escapes","_scheme","_email","_attribute","_href","_extended_email","_backpedal","output","prevCapZero","out","inLink","inRawBlock","lastParenIndex","findClosingBracket","linkLen","outputLink","escapes","codespan","mangle","smartypants","image","infostring","escaped","highlight","langPrefix","quote","headerIds","headerPrefix","slug","xhtml","listitem","checkbox","tablerow","tablecell","flags","baseUrl","inlineText","tok","peek","parseText","row","cell","errMsg","silent","log","originalSlug","&","<",">","\"","'","tableRow","offset","curr","invert","suffLen","currChar","checkSanitizeDeprecation","pending","setOptions","getDefaults","lexer","inlineLexer","commonjsGlobal","globalThis","global","commonjsRequire","pluralize","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","interpolate","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","_idb","webidl2","_webidl2","_hyperHTML","_marked","_pluralize","gtEntity","ampEntity","endsWithSpace","inlineElems","language","isEscaped","normalizePadding","isTextNode","Node","TEXT_NODE","createContextualFragment","firstSpace","chop","prevSib","previousElementSibling","nextTo","replacer","padding","previousSibling","markdownToHtml","potentialMarkdown","processElements","Builder","tagName","section","findPosition","findParent","process","findHeader","prepend","structure","fragment","addHeader","addSection","addElement","substituteWithTextNodes","processMDSections","processBlockLevelElements","conf","hasMDSections","isMDFormat","structuredInternals","firstElementChild","rsUI","newHTML","newBody","cleanHTML","all_shortcuts","shortcut_combination","default_options","propagate","disable_in_input","keycode","dfo","ele","srcElement","keyCode","which","character","kp","shift_nums","`","1","2","3","4","5","6","7","8","9","0","-","=",";",",",".","/","\\","special_keys","esc","tab","return","enter","backspace","scrolllock","scroll_lock","scroll","capslock","caps_lock","caps","numlock","num_lock","num","pause","break","insert","home","end","pageup","page_up","pu","pagedown","page_down","pd","left","up","right","down","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","modifiers","wanted","pressed","ctrl","alt","meta","ctrlKey","shiftKey","altKey","metaKey","cancelBubble","returnValue","stopPropagation","preventDefault","attachEvent","loadStyle","insertStyle","styleElement","ariaDecorate","ariaMap","respecUI","menu","modal","overlay","errors","warnings","buttons","respecPill","hidden","errWarn","arr","butName","createWarnButton","button","ol","li","lastElementChild","freshModal","label","handler","keyShort","icon","menuItem","shortcut","owner","currentOwner","headingId","closeModal","toggle","click","reindent","indents","leastIndent","min","hash","respecIsReady","hasLink","isLegacyFrag","privs","canLint","lint","LinterRule","lintingFunction","description","howToFix","defaultLang","linterFunction","metas","occurrences","help","offendingElements","punctuationMarks","humanMarks","punctuatingRegExp","privates","Linter","newRules","newRule","promisesToLint","toLinterWarning","linter","baseResult","resultPromise","isBrokenHyperlink","hasNoHeading","offendingMembers","getOwnPropertyNames","endsWith","hasPriSecConsiderations","saysPrivOrSec","saysConsiderations","isRecTrack","register","noHttpPropsRule","noHeadinglessSectionsRule","checkPunctuation","localRefsExist","checkInternalSlots","checkCharset","privsecSection","coreDefaults","no-headingless-sections","no-http-props","check-punctuation","local-refs-exist","check-internal-slots","check-charset","privsec-section","specStatus","highlightVars","addSectionLinks","definitionMap","registerDefinition","names","privsecSectionRule","w3cDefaults","doJsonLd","license","logos","height","width","xref","noReSpecCSS","attachFixupScript","createMetaViewport","initial-scale","shrink-to-fit","createBaseStyle","selectStyleVersion","styleVersion","isNaN","createResourceHints","styleMover","linkURL","exportDoc","w3cStyle","styleFile","useExperimentalStyles","noToc","finalStyleURL","status_at_publication","resolveGithubPromise","rejectGithubPromise","github","localizationStrings","commit_history","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","shortName","otherLink","githubAPI","hostname","normalizedGHObj","api","normalizedConfig","processResponse","rawData","oninclude","includeReplace","replacementNode","includeFormat","hasChildNodes","contains","cleanUp","attr","includables","promisesToInclude","includeId","class","showLinkData","img","until","personName","company","editorid","w3cid","dd","span","contents","mailto","orcid","companyURL","extras","extra","getExtra","retiredDate","isValidDate","timeElem","dateTime","textContainer","showLogo","subtitle","longStatus","dashDate","publishHumanDate","thisVersion","latestVersion","testSuiteURI","implementationReportURI","bugTrackerHTML","prevVersion","isCGFinal","prevED","multipleEditors","showPeople","formerEditors","multipleFormerEditors","multipleAuthors","showLink","alternateFormats","multipleAlternates","alternatesHTML","copyrightStart","publishYear","additionalCopyrightHolders","wgURI","wg","isPreview","prUrl","prNumber","sotdAfterWGinfo","additionalContent","wgPublicList","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","subjectPrefix","additionalSections","ccLicense","w3cLicense","legalDisclaimer","w3cTrademark","getSpecTitleElem","specTitleElem","getSpecSubTitleElem","specSubTitleElem","prependW3C","textStatus","isNoTrack","isED","showPreviousVersion","prevRecURI","isRec","errata","renderCopyright","linkLicense","cssClass","isUnofficial","overrideCopyright","renderOfficialCopyright","noteIfDualLicense","linkDocumentUse","isCCBY","isW3CSoftAndDocLicense","renderPreview","renderIsUnofficial","isTagFinding","renderIsNoTrack","isSubmission","noteForSubmission","overrideStatus","linkToWorkingGroup","linkToCommunity","isCR","isPER","isPR","humanCREnd","humanPEREnd","mailToWGPublicList","humanPREnd","renderImplementationReportURI","notRec","renderNotRec","renderIsRec","renderDeliverer","addPatentNote","isMO","anOrA","isNote","wgId","isIGNote","multipleWGs","recNotExpected","wgPatentHTML","wgPatentURI","charterDisclosureURI","producers","isMemberSubmission","noteForMemberSubmission","isTeamSubmission","noteForTeamSubmission","teamComment","publishDate","getUTCFullYear","submissionCommentNumber","wgHTML","notYetRec","W3CDate","status2maturity","LS","LD","FPWD","LC","FPLC","FPWD-NOTE","WD-NOTE","LC-NOTE","IG-NOTE","WG-NOTE","status2rdf","NOTE","WD","CR","PR","REC","PER","RSCND","status2text","CG-NOTE","Member-SUBM","Team-SUBM","MO","ED","unofficial","finding","draft-finding","CG-DRAFT","CG-FINAL","BG-DRAFT","BG-FINAL","status2long","maybeRecTrack","recTrackStatus","noTrackStatus","cgbg","precededByAn","licenses","cc0","short","w3c-software","w3c-software-doc","cc-by","baseLogo","freeze","validateDateAndRecover","fallbackDate","Number","isFinite","formattedDate","licenseInfo","isCGBG","isBasic","isRegular","host","lastModified","noRecTrack","memSubmissionLogo","teamSubmissionLogo","maturity","publishSpace","previousPublishDate","previousMaturity","pmat","prevRecShortname","peopCheck","normalizeOrcid","uri","bugTracker","new","rdfStatus","showThisVersion","publishISODate","toISOString","shortISODate","urlParts","pos","cgbgHeadersTmpl","headersTmpl","wgPotentialArray","idx","pats","crEnd","prEnd","perEnd","populateSoTD","generatedSubtitle","collectSotdContent","encodeURIComponent","cgbgSotdTmpl","sotdTmpl","sotdClone","isElement","orcidUrl","orcidId","lastDigit","lastDigitInt","acc","abs","abstractHeading","processDfnElement","abbr","generateAbbreviation","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","enumRegex","methodSplitRegex","parseInlineIDL","nonMethodPart","methodPart","renderParent","allArgs","enumValue","SyntaxError","renderBase","renderInternalSlot","renderAttribute","renderMethod","argsText","searchText","renderEnum","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","ALLOWED_TYPES","readyPromise","openIdb","deleteObjectStore","createObjectStore","keyPath","createIndex","biblioDB","ready","isAlias","resolveAlias","range","IDBKeyRange","only","aliasOf","aliasesAndRefs","alias","promisesToAdd","isInDB","stores","clearStorePromises","biblio","bibrefsURL","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","status","addAll","resolveRef","entry","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","hasData","noData","externalRefs","REF_STATUSES","defaultsReference","publisher","etAl","endWithDot","endNormalizer","informs","norms","refNote","refsec","sec","goodRefs","badRefs","toRefContent","refObjects","refcontent","uniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","showRef","decorateInlineReference","getAliases","warnBadRefs","circular","renderInlineCitation","refId","stringifyReference","endStr","trimmed","wireReference","rawRef","aliases","refUrl","selectors","linkType","badrefs","rfc2119Usage","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","inlineRFC2119Matches","nodeElement","inlineRefMatches","badReference","inlineXrefMatches","inlineBibrefMatches","cite","cleanRef","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","parts","isFor","linkingText","processedContent","processInlineContent","inlineCodeMatches","clean","part","respecRFC2119","abbrs","aKeys","abbrRx","txts","keywords","rx","subtxt","df","nodes","processConformance","conformance","terms","titles","dfnType","pluralizeDfn","getPluralizer","plurals","size","userDefinedPlurals","uniquePlurals","dfnTexts","example","cssPromise","makeTitle","report","number","examples","css","div","inAside","exampleTitle","no_issues_in_spec","handleIssues","ins","ghIssues","hasDataNum","issueNum","issueList","inno","displayType","isFeatureAtRisk","getIssueType","isIssue","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","createIssueSummaryEntry","labels","createLabelsGroup","bodyHTML","makeIssueSectionSummary","isWarning","isEdNote","l10nIssue","issueNumberText","issueSummaryElement","isLight","rgb","labelsGroup","createLabel","labelNames","joinedNames","color","issuesURL","searchParams","textColorClass","fetchAndStoreGithubIssues","issueNumbers","issueNumber","issues","issuesAndNotes","headElem","ednote","req","best_practice","bps","bpSummary","summaryItems","bp","localizedBpName","list_of_figures","fig","normalizeImages","tof","collectFigures","tofElement","decorateTableOfFigures","caption","decorateFigure","getTableOfFiguresListItem","figure","figureId","tofCaption","anchor","naturalHeight","naturalWidth","previousSections","getPreviousSections","sections","previous","iteratePreviousElements","topLevelEntities","findDfn","defn","findOperationDfn","findNormalDfn","getAlternativeNames","asQualifiedName","addAlternativeNames","resolvedName","dfnForArray","dfns","getDfns","decorateDfn","lCaseParent","middle","last","dfnFor","getDataType","originalName","closestDfnFor","idlStruct","operationNames","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","className","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","export","unlinkedAnchor","nameResolverMap","resolveNameAndId","getDefnName","getIdlId","resolvePartial","overload","resolveOverload","qualifiedName","fullyQualifiedName","renderWebIDL","idlElement","closestCite","cites","idls","astArray","validations","validation","requestLookup","toCiteDetails","citeDetailsConverter","originalKey","cleanElement","relPath","noExport","attrName","makeComponentFinder","findFrag","findPath","rawKey","citeFrag","citePath","parentKey","isNormative","closestIsNormative","hasPrecedingMark","linkInlineCitations","toLookupRequest","citeConverter","promisesForMissingEntries","missingBibEntries","newEntries","lookupRequests","idlIndexSec","idlIndex","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","uniqueQueryKeys","resolveFromCache","shouldBustCache","getMany","lastChecked","API_URL","lastUpdated","cacheXrefData","addMany","profiles","web-platform","normalizeConfig","specs","bodyCite","queryKeys","getRequestEntry","objectHash","addDataCiteToTerms","getData","invalidProfileError","profile","isIDL","term","getTermFromElement","dataciteElem","closestSection","inlineRefs","uniqueInlineRefs","types","xrefType","xrefFor","dataXrefForElem","apiUrl","uniqueIds","resultsFromCache","termsToLook","fetchedResults","fetchFromNetwork","Content-Type","closestNormative","closestInform","ambiguous","notFound","addDataCite","showErrors","shortname","normative","addToReferences","getPrefilledFormURL","originalTerm","formUrl","spec","specsString","buffer","TextEncoder","crypto","subtle","digest","bufferToHexString","Uint8Array","padStart","duplicateMsg","duplicateTitle","CaseInsensitiveMap","titleToDfns","mapTitleToDfns","possibleExternalLinks","badLinks","linkTargets","findLinkTarget","showLinkingError","findExplicitExternalLinks","addExternalReferences","collectDfns","oldIsDfn","newIsDfn","isCode","wrapAsCode","needsCode","shouldWrapByCode","externalDFNs","showContributors","apiURL","contributors","user","login","getContributors","toHTML","sortedContributors","nameA","nameB","getParents","lowerHeaderTags","headerTags","alphabet","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","ceil","createComment","createTocListItem","subsections","getSectionTree","tocIntroductory","sectionElements","filterHeader","Infinity","renameSectionHeaders","noTOC","createTableOfContents","getNonintroductorySectionHeaders","headerSelector","nav","h2","after","informative","headings","BROWSERS","supportTitles","caniuseCssPromise","caniuse","getNormalizedConf","feature","featureURL","caniuseCss","headDlElem","contentPromise","stats","fetchStats","createTableHTML","definitionPair","outputDoc","DEFAULTS","versions","caniuseConf","browsers","invalidBrowsers","browser","addBrowser","browserName","browserData","getSupport","supportKeys","olderVersions","buttonText","addLatestVersion","SPEC_MAP_URL","BASE_JSON_PATH","MDN_URL_BASE","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","opera","opera_android","safari","safari_ios","samsunginternet_android","webview_android","mdnCssPromise","fetchAndCacheJson","insertMDNBox","targetAncestor","targetSibling","mdnBox","attachMDNDetail","mdnSpec","summary","mdnSubPath","mdnDetail","attachMDNBrowserSupport","support","supportTable","buildBrowserSupportTable","addMDNBrowserRow","browserId","yesNoUnknown","displayStatus","browserRow","processBrowserData","versionData","version_removed","versionAdded","version_added","mdn","specMapUrl","baseJsonPath","specMap","jsonName","mdnSpecJson","mdnCss","mdnSpecArray","mdnDiv","mimeTypes","rsDocToDataURL","mimeType","validTypes","serialize","cloneDoc","cleanup","XMLSerializer","serializeToString","doctype","outerHTML","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","epubURL","downloadLinks","toDownloadLink","saveDialog","supportsDownload","HTMLAnchorElement","exportDocument","addCommand","specrefURL","refSearchURL","reveseLookupURL","form","resultList","renderResults","resultMap","timeTaken","wires","toDefinitionPair","pair","resultProcessor","includeVersions","fetchedData","combinedResults","focus","searchBox","refSearch","reverseLookup","startTime","jsonData","processResults","round","mast","XREF_URL","iframe","onload","ul","definitionLinks","keyA","keyB","getEntriesByType","duration","perfEntryToTR","firstParagraph","metaElem","canonicalURI","trLatestUri","addJSONLDInfo","jsonld","@context","@vocab","@language","w3p","foaf","datePublished","@type","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","addPerson","contributor","citationIds","citationContents","citation","addRef","ed","foaf:mbox","worksFor","creator","rawDate","publishedDate","isbn","loadWorkerScript","createWorker","workerScript","workerURL","createObjectURL","Blob","Worker","workerPromise","worker","nextMsgId","ghCssPromise","getLanguageHint","highlightElement","languages","sendHighlightRequest","innerText","action","timeoutId","listener","noHighlightCSS","highlightables","promisesToHighlight","ghCss","copyButtonPromise","createButton","loadSVG","copyButton","clipboardWriteText","clipboard","writeText","clipboardData","setData","execCommand","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","testables","testURLs","toTestURLs","handleDuplicates","bad_uri","uniqueList","makeSorter","direction","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","hlVarsPromise","varElem","highlightListener","removeHighlight","hightligtedElems","resetListener","hlColor","getHighlightColor","HL_COLORS","activeClass","highlightColor","varsToHighlight","colorStatus","addHighlight","tooltipStylePromise","varMap","variables","currentSection","anchors","matchingElement","processHeading","processSection","processFigure","processBox","localize","selfLink","copy","figcaption","figTitle","hadSelfLink","matchingClosest","newClosest","HTMLElement","props","to","fetchCommits","commits","finally","githubObject","commit","commitURL","pr","CUSTOM_ELEMENTS","changelog","customElements","readyPromises"],"mappings":";;aAEAA,OAAOC,iBAAiB,QAASC,IAC/BC,QAAQC,MAAMF,EAAGE,MAAOF,EAAGG,QAASH,KAGtC,MAAMI,QAAU,CAEdC,wDACAA,kDACAA,wDACAA,0DACAA,oDACAA,sDACAA,mDACAA,qDACAA,oDACAA,sDACAA,yDACAA,sDACAA,qDACAA,sDACAA,2DACAA,sDACAA,qDACAA,yDACAA,iDACAA,yDACAA,sDACAA,yDACAA,0DACAA,2DACAA,qDACAA,oDACAA,sDACAA,sDACAA,yDACAA,uDACAA,0DACAA,qDACAA,wDACAA,yDACAA,yDACAA,uDACAA,q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B,OAAIllB,MAAMiE,QAAQrB,GAGTuc,aAAavc,EAAO8V,GAEtB9V,GAETyH,IAAIqO,EAAQwM,EAAGtiB,GAEb,GADA8V,EAAOwM,GAAKtiB,GACPA,EACH,OAAO,EACF,GAAI5C,MAAMiE,QAAQrB,GAEvB,IAAK,MAAM6I,KAAQ7I,OACU,IAAhB6I,EAAKpL,SACdoL,EAAKpL,OAASA,aAGe,IAAjBuC,EAAMvC,SACtBuC,EAAMvC,OAASA,GAEjB,OAAO,KA1BFP,ECpPX,MAAMqlB,QAAU,CAGdC,QAAW,sGACXC,QAAW,8CACX3B,WAAc,+BACd4B,OAAU,WACVC,WAAc,cACdlQ,QAAW,gDACXmQ,MAAS,wBAGExF,iBAAmB,CAC9B,cACA,WACA,YACA,aACA,aACA,aACA,cACA,cACA,oBACA,eACA,eACA,MACA,SACA,UAGWP,YAAc,CACzB,aACA,YACA,aAGW8C,qBAAuB,CAClC,QACA,YACA,WACA,QACA,cACA,UACA,aACA,OACA,SACA,WACA,UACA,YACA,WACA,UACA,YACA,UACA,WACA,UACA,SACA,SACA,cACA,UACA,gBAGIkD,kBAAoB,CACxB,YACA,cACA,WACA,MACA,UACA,UACA,OACA,SACA,QACA,QACA,OACA,QACA,OACA,QACA,WACA,KACA,WACA,SACA,WACA,QACA,OACA,WACA,QACAjY,OAAO+U,qBAAsB9C,YAAaO,kBAEtC0F,aAAe,CACnB,IACA,IACA,IACA,MACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGIC,SAAW,CAEf,eACA,WACA,aAOF,SAASC,SAASjkB,GAChB,MAAMmb,EAAS,GACf,IAAI+I,EAAgB,EAChB5J,EAAS,GACTE,EAAO,EACPrB,EAAQ,EACZ,KAAO+K,EAAgBlkB,EAAIoK,QAAQ,CACjC,MAAM+Z,EAAWnkB,EAAIokB,OAAOF,GAC5B,IAAI7hB,GAAU,EAQd,GANI,YAAYuM,KAAKuV,GACnB9hB,EAASgiB,EAAkB,aAAc,CAAE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A,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACAzjC,QAAQkjC,EAAU2B,oBAEb3B,QChfF,MAAM/4B,IAAM66B,KACNC,QAAUC,SAGVhY,YAAYiY,UAGZnM,SAASoM,OAGTlC,YAAYmC,UC0BZhmC,OAAO,gBAEdimC,SAAW,SACXC,UAAY,UACZC,cAAgB,SAEhBC,YAAc,IAAIrkC,IAAI,CAC1B,IACA,OACA,UACA,IACA,MACA,MACA,KACA,SACA,OACA,OACA,MACA,KACA,IACA,MACA,QACA,MACA,QACA,MACA,SACA,IACA,OACA,SACA,SACA,QACA,OACA,SACA,MACA,MACA,WACA,OACA,KACA,QAGF,MAAMi8B,iBAAiBrE,SAAOqE,SAC5BnzB,KAAKkvB,EAAMsM,EAAUC,GACnB,MAAiB,WAAbD,EACK,oBAAoBtM,UAEtB/kB,MAAM+kB,KAAKA,EAAMsM,EAAUC,IAOtC,SAASC,iBAAiBtvB,GACxB,IAAKA,EACH,MAAO,GAET,GAAoB,iBAATA,EACT,MAAMpO,UAAU,iBAElB,GAAa,OAAToO,EACF,MAAO,KAOT,SAASuvB,EAAW30B,GAClB,OAAgB,OAATA,GAAiBA,EAAKue,WAAaqW,KAAKC,UASjD,MAAM/8B,EAAMjL,SAASy2B,cAAcwR,yBAAyB1vB,GAH5D,IAAuBpF,EAKvBrR,MAAMC,KAAKkJ,EAAI8I,UACZvP,OAAO2G,IAASu8B,YAAY7lC,IAAIsJ,EA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AEZz0E,OAAO,uBAEpBxB,eAAsBwJ,QAEpBwsE,gBAAgB7zE,QAAQyQ,IACtBsjE,eAAe7jD,OAAOzf,EAAGpR,KAAMoR,EAAGhH,WAIpC,MAAMgkD,EAAYomB,gBAAgB90E,IAAI0R,GAAMA,EAAGpR,MAAMwK,KAAK,MAEpDmqE,EAAgB,IADRj2E,SAASkL,iBAAiBwkD,IACP1uD,IAC/B0R,GAAM,IAAI7S,QAAQmsB,GAAOtZ,EAAGnT,iBAAiB,OAAQysB,EAAK,CAAEhpB,MAAM,YAE9DnD,QAAQS,IAAI21E"} \ No newline at end of file +{"version":3,"file":"respec-w3c.js","sources":["../profiles/w3c.js","../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/override-configuration.js","../src/core/respec-ready.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/l10n.js","../src/core/utils.js","../src/core/base-runner.js","../src/core/text-loader.js","../node_modules/idb/build/esm/chunk.js","../node_modules/idb/build/esm/index.js","../node_modules/webidl2/lib/error.js","../node_modules/webidl2/lib/productions/base.js","../node_modules/webidl2/lib/validators/helpers.js","../node_modules/webidl2/lib/productions/type.js","../node_modules/webidl2/lib/productions/default.js","../node_modules/webidl2/lib/productions/array-base.js","../node_modules/webidl2/lib/productions/token.js","../node_modules/webidl2/lib/productions/extended-attributes.js","../node_modules/webidl2/lib/productions/argument.js","../node_modules/webidl2/lib/productions/operation.js","../node_modules/webidl2/lib/productions/attribute.js","../node_modules/webidl2/lib/productions/helpers.js","../node_modules/webidl2/lib/tokeniser.js","../node_modules/webidl2/lib/productions/enum.js","../node_modules/webidl2/lib/productions/includes.js","../node_modules/webidl2/lib/productions/typedef.js","../node_modules/webidl2/lib/productions/callback.js","../node_modules/webidl2/lib/productions/container.js","../node_modules/webidl2/lib/productions/constant.js","../node_modules/webidl2/lib/productions/iterable.js","../node_modules/webidl2/lib/validators/interface.js","../node_modules/webidl2/lib/productions/constructor.js","../node_modules/webidl2/lib/productions/interface.js","../node_modules/webidl2/lib/productions/mixin.js","../node_modules/webidl2/lib/productions/field.js","../node_modules/webidl2/lib/productions/dictionary.js","../node_modules/webidl2/lib/productions/namespace.js","../node_modules/webidl2/lib/productions/callback-interface.js","../node_modules/webidl2/lib/webidl2.js","../node_modules/webidl2/lib/writer.js","../node_modules/webidl2/lib/validator.js","../js/deps/builds/nanohtml.js","../js/deps/builds/marked.js","../js/deps/builds/pluralize.js","../src/core/import-maps.js","../src/core/markdown.js","../js/shortcut.js","../src/core/ui.js","../src/core/reindent.js","../src/core/location-hash.js","../src/core/LinterRule.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-internal-slots.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/privsec-section.js","../src/core/defaults.js","../src/core/dfn-map.js","../src/w3c/defaults.js","../src/core/style.js","../src/w3c/style.js","../src/w3c/l10n.js","../src/core/github.js","../src/core/data-include.js","../src/w3c/templates/show-link.js","../src/w3c/templates/show-logo.js","../src/w3c/templates/show-people.js","../src/w3c/templates/cgbg-headers.js","../src/w3c/templates/cgbg-sotd.js","../src/w3c/templates/headers.js","../src/w3c/templates/sotd.js","../src/w3c/headers.js","../src/w3c/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/w3c/conformance.js","../src/core/dfn.js","../src/core/pluralize.js","../src/core/examples.js","../src/core/issues-notes.js","../src/core/requirements.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/dfn-finder.js","../src/core/webidl.js","../src/core/data-cite.js","../src/core/webidl-index.js","../src/core/xref-db.js","../src/core/xref.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/core/caniuse.js","../src/core/mdn-annotation.js","../src/core/exporter.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/search-xref.js","../src/ui/dfn-list.js","../src/ui/about-respec.js","../src/core/seo.js","../src/w3c/seo.js","../src/core/worker.js","../src/core/highlight.js","../src/core/webidl-clipboard.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/core/highlight-vars.js","../src/core/data-type.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js"],"sourcesContent":["\"use strict\";\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nconst modules = [\n // order is significant\n import(\"../src/core/base-runner.js\"),\n import(\"../src/core/ui.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/w3c/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/w3c/style.js\"),\n import(\"../src/w3c/l10n.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/w3c/headers.js\"),\n import(\"../src/w3c/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/w3c/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/requirements.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/webidl.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/webidl-index.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/core/caniuse.js\"),\n import(\"../src/core/mdn-annotation.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/search-xref.js\"),\n import(\"../src/ui/dfn-list.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/w3c/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/webidl-clipboard.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter.js\"),\n];\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n\n(async () => {\n const [runner, { ui }, ...plugins] = await Promise.all(modules);\n try {\n ui.show();\n await domReady();\n await runner.runAll(plugins);\n } finally {\n ui.enable();\n }\n})().catch(err => {\n console.error(err);\n});\n","// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function(deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\nimport { expose } from \"./expose-modules.js\";\n\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nconst subscriptions = new Map();\n\nexport function pub(topic, ...data) {\n if (!subscriptions.has(topic)) {\n return; // Nothing to do...\n }\n Array.from(subscriptions.get(topic)).forEach(cb => {\n try {\n cb(...data);\n } catch (err) {\n pub(\n \"error\",\n `Error when calling function ${cb.name}. See developer console.`\n );\n console.error(err);\n }\n });\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = data\n // to structured clonable\n .map(arg => String(JSON.stringify(arg.stack || arg)));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n/**\n * Subscribes to a message type.\n *\n * @param {string} topic The topic to subscribe to (e.g., \"start-all\")\n * @param {Function} cb Callback function\n * @param {Object} [opts]\n * @param {Boolean} [opts.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, opts = { once: false }) {\n if (opts.once) {\n return sub(topic, function wrapper(...args) {\n unsub({ topic, cb: wrapper });\n cb(...args);\n });\n }\n if (subscriptions.has(topic)) {\n subscriptions.get(topic).add(cb);\n } else {\n subscriptions.set(topic, new Set([cb]));\n }\n return { topic, cb };\n}\n/**\n * Unsubscribe from messages.\n *\n * @param {Object} opaque The object that was returned from calling sub()\n */\nexport function unsub({ topic, cb }) {\n // opaque is whatever is returned by sub()\n const callbacks = subscriptions.get(topic);\n if (!callbacks || !callbacks.has(cb)) {\n console.warn(\"Already unsubscribed:\", topic, cb);\n return false;\n }\n return callbacks.delete(cb);\n}\n\nsub(\"error\", err => {\n console.error(err, err.stack);\n});\n\nsub(\"warn\", str => {\n console.warn(str);\n});\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst userConfig = {};\nconst amendConfig = newValues => Object.assign(userConfig, newValues);\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nsub(\"start-all\", amendConfig);\nsub(\"amend-user-config\", amendConfig);\nsub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n});\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub, sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nfunction overrideConfig(config) {\n // For legacy reasons, we still support both \";\" and \"&\"\n const searchQuery = document.location.search.replace(/;/g, \"&\");\n const params = new URLSearchParams(searchQuery);\n const overrideProps = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return { key, value };\n })\n .reduce((collector, { key, value }) => {\n collector[key] = value;\n return collector;\n }, {});\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\nsub(\"start-all\", overrideConfig, { once: true });\n","// @ts-check\n/**\n * This Module adds a `respecIsReady` property to the document object.\n * The property returns a promise that settles when ReSpec finishes\n * processing the document.\n */\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/respec-ready\";\n\n/** @type {Promise<void>} */\nconst respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", resolve, { once: true });\n});\n\nObject.defineProperty(document, \"respecIsReady\", {\n get() {\n return respecDonePromise;\n },\n});\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { pub, sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/post-process\";\n\nlet doneResolver;\nexport const done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nsub(\n \"plugins-done\",\n async config => {\n const result = [];\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n pub(\"error\", \"Every item in `postProcess` must be a JS function.\");\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n pub(\n \"error\",\n `Function ${f.name} threw an error during \\`postProcess\\`. See developer console.`\n );\n console.error(err);\n }\n });\n const values = await Promise.all(promises);\n result.push(...values);\n }\n if (typeof config.afterEnd === \"function\") {\n result.push(await config.afterEnd(config, document));\n }\n doneResolver(result);\n },\n { once: true }\n);\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { pub, sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/pre-process\";\n\nlet doneResolver;\nexport const done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nsub(\n \"start-all\",\n async config => {\n const result = [];\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n pub(\"error\", \"Every item in `preProcess` must be a JS function.\");\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n pub(\n \"error\",\n `Function ${f.name} threw an error during \\`preProcess\\`. See developer console.`\n );\n console.error(err);\n }\n });\n const values = await Promise.all(promises);\n result.push(...values);\n }\n doneResolver(result);\n },\n { once: true }\n);\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\n// We use en-US as the base\nconst base = {\n about_respec: \"About\",\n abstract: \"Abstract\",\n author: \"Author:\",\n authors: \"Authors:\",\n bug_tracker: \"Bug tracker:\",\n close_parens: \")\",\n definition_list: \"Definitions\",\n editor: \"Editor:\",\n editors_note: \"Editor's note\",\n editors: \"Editors:\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n info_references: \"Informative references\",\n issue_summary: \"Issue Summary\",\n issue: \"Issue\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n list_of_definitions: \"List of Definitions\",\n norm_references: \"Normative references\",\n note: \"Note\",\n open_bugs: \"open bugs\",\n open_parens: \"(\",\n participate: \"Participate\",\n references: \"References\",\n save_as: \"Save as\",\n save_snapshot: \"Export\",\n search_specref: \"Search Specref\",\n sotd: \"Status of This Document\",\n this_version: \"This version:\",\n toc: \"Table of Contents\",\n warning: \"Warning\",\n};\n\nconst ko = {\n abstract: \"요약\",\n author: \"저자:\",\n authors: \"저자:\",\n latest_published_version: \"최신 버전:\",\n sotd: \"현재 문서의 상태\",\n this_version: \"현재 버전:\",\n};\n\nconst zh = {\n about_respec: \"关于\",\n abstract: \"摘要\",\n bug_tracker: \"错误跟踪:\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n file_a_bug: \"反馈错误\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n note: \"注\",\n open_bugs: \"修正中的错误\",\n participate: \"参与:\",\n sotd: \"关于本文档\",\n this_version: \"本版本:\",\n toc: \"内容大纲\",\n};\n\nconst ja = {\n abstract: \"要約\",\n author: \"著者:\",\n authors: \"著者:\",\n bug_tracker: \"バグの追跡履歴:\",\n editor: \"編者:\",\n editors: \"編者:\",\n file_a_bug: \"問題報告\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n note: \"注\",\n open_bugs: \"改修されていないバグ\",\n participate: \"参加方法:\",\n sotd: \"この文書の位置付け\",\n this_version: \"このバージョン:\",\n toc: \"目次\",\n};\n\nconst nl = {\n about_respec: \"Over\",\n abstract: \"Samenvatting\",\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n bug_tracker: \"Meldingensysteem:\",\n definition_list: \"Lijst van Definities\",\n editor: \"Redacteur:\",\n editors_note: \"Redactionele noot\",\n editors: \"Redacteurs:\",\n file_a_bug: \"Dien een melding in\",\n info_references: \"Informatieve referenties\",\n issue_summary: \"Lijst met issues\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n list_of_definitions: \"Lijst van Definities\",\n norm_references: \"Normatieve referenties\",\n note: \"Noot\",\n open_bugs: \"open meldingen\",\n participate: \"Doe mee\",\n references: \"Referenties\",\n save_as: \"Bewaar als\",\n save_snapshot: \"Bewaar Snapshot\",\n search_specref: \"Doorzoek Specref\",\n sotd: \"Status van dit document\",\n this_version: \"Deze versie:\",\n toc: \"Inhoudsopgave\",\n warning: \"Waarschuwing\",\n};\n\nconst es = {\n abstract: \"Resumen\",\n author: \"Autor:\",\n authors: \"Autores:\",\n bug_tracker: \"Repositorio de bugs:\",\n close_parens: \")\",\n editor: \"Editor:\",\n editors_note: \"Nota de editor\",\n editors: \"Editores:\",\n file_a_bug: \"Nota un bug\",\n info_references: \"Referencias informativas\",\n issue_summary: \"Resumen de la cuestión\",\n issue: \"Cuestión\",\n latest_editors_draft: \"Borrador de editor mas reciente:\",\n latest_published_version: \"Versión publicada mas reciente:\",\n norm_references: \"Referencias normativas\",\n note: \"Nota\",\n open_bugs: \"Bugs abiertos\",\n open_parens: \"(\",\n participate: \"Participad\",\n references: \"Referencias\",\n sotd: \"Estado de este Document\",\n this_version: \"Ésta versión:\",\n toc: \"Tabla de Contenidos\",\n warning: \"Aviso\",\n};\n\nexport const l10n = {\n en: { ...base },\n ko: { ...base, ...ko },\n zh: { ...base, ...zh },\n ja: { ...base, ...ja },\n nl: { ...base, ...nl },\n es: { ...base, ...es },\n};\n\nl10n[\"zh-hans\"] = l10n.zh;\nl10n[\"zh-cn\"] = l10n.zh;\n\nexport const lang = html && html.lang in l10n ? html.lang : \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst spaceOrTab = /^[ |\\t]*/;\nconst dashes = /-/g;\n\nexport const ISODate = new Intl.DateTimeFormat([\"en-ca-iso8601\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\nconst resourceHints = new Set([\n \"dns-prefetch\",\n \"preconnect\",\n \"preload\",\n \"prerender\",\n]);\n\nconst fetchDestinations = new Set([\n \"document\",\n \"embed\",\n \"font\",\n \"image\",\n \"manifest\",\n \"media\",\n \"object\",\n \"report\",\n \"script\",\n \"serviceworker\",\n \"sharedworker\",\n \"style\",\n \"worker\",\n \"xslt\",\n \"\",\n]);\n\n// CSS selector for matching elements that are non-normative\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\nexport function calculateLeftPad(text) {\n if (typeof text !== \"string\") {\n throw new TypeError(\"Invalid input\");\n }\n // Find smallest padding value\n const leftPad = text\n .split(\"\\n\")\n .filter(item => item)\n .reduce((smallest, item) => {\n // can't go smaller than 0\n if (smallest === 0) {\n return smallest;\n }\n const match = item.match(spaceOrTab)[0] || \"\";\n return Math.min(match.length, smallest);\n }, +Infinity);\n return leftPad === +Infinity ? 0 : leftPad;\n}\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {Object} opts Configure the resource hint.\n * @param {String} opts.hint The type of hint (see resourceHints).\n * @param {String} opts.href The URL for the resource or origin.\n * @param {String} [opts.corsMode] Optional, the CORS mode to use (see HTML spec).\n * @param {String} [opts.as] Optional, fetch destination type (see fetchDestinations).\n * @param {boolean} [opts.dontRemove] If the hint should remain in the spec after processing.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n if (!opts || typeof opts !== \"object\") {\n throw new TypeError(\"Missing options\");\n }\n if (!resourceHints.has(opts.hint)) {\n throw new TypeError(\"Invalid resources hint\");\n }\n const url = new URL(opts.href, location.href);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts && typeof opts.as === \"string\") {\n if (!fetchDestinations.has(opts.as)) {\n console.warn(`Unknown request destination: ${opts.as}`);\n }\n linkElem.setAttribute(\"as\", opts.as);\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement|HTMLElement[]} elems\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nexport function showInlineWarning(elems, msg, title) {\n if (!Array.isArray(elems)) elems = [elems];\n const links = elems\n .map((element, i) => {\n markAsOffending(element, msg, title);\n return generateMarkdownLink(element, i);\n })\n .join(\", \");\n pub(\"warn\", `${msg} at: ${links}.`);\n console.warn(msg, elems);\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement|HTMLElement[]} elems\n * @param {String} msg message to show in warning\n * @param {String} title error message to add on each element\n * @param {object} [options]\n * @param {string} [options.details]\n */\nexport function showInlineError(elems, msg, title, { details } = {}) {\n if (!Array.isArray(elems)) elems = [elems];\n const links = elems\n .map((element, i) => {\n markAsOffending(element, msg, title);\n return generateMarkdownLink(element, i);\n })\n .join(\", \");\n let message = `${msg} at: ${links}.`;\n if (details) {\n message += `\\n\\n<details>${details}</details>`;\n }\n pub(\"error\", message);\n console.error(msg, elems);\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n/**\n * @param {Element} element\n * @param {number} i\n */\nfunction generateMarkdownLink(element, i) {\n return `[${i + 1}](#${element.id})`;\n}\n\nexport class IDBKeyVal {\n /**\n * @param {import(\"idb\").IDBPDatabase} idb\n * @param {string} storeName\n */\n constructor(idb, storeName) {\n this.idb = idb;\n this.storeName = storeName;\n }\n\n /** @param {string} key */\n async get(key) {\n return await this.idb\n .transaction(this.storeName)\n .objectStore(this.storeName)\n .get(key);\n }\n\n /**\n * @param {string[]} keys\n */\n async getMany(keys) {\n const keySet = new Set(keys);\n /** @type {Map<string, any>} */\n const results = new Map();\n let cursor = await this.idb.transaction(this.storeName).store.openCursor();\n while (cursor) {\n if (keySet.has(cursor.key)) {\n results.set(cursor.key, cursor.value);\n }\n cursor = await cursor.continue();\n }\n return results;\n }\n\n /**\n * @param {string} key\n * @param {any} value\n */\n async set(key, value) {\n const tx = this.idb.transaction(this.storeName, \"readwrite\");\n tx.objectStore(this.storeName).put(value, key);\n return await tx.done;\n }\n\n async addMany(entries) {\n const tx = this.idb.transaction(this.storeName, \"readwrite\");\n for (const [key, value] of entries) {\n tx.objectStore(this.storeName).put(value, key);\n }\n return await tx.done;\n }\n\n async clear() {\n const tx = this.idb.transaction(this.storeName, \"readwrite\");\n tx.objectStore(this.storeName).clear();\n return await tx.done;\n }\n\n async keys() {\n const tx = this.idb.transaction(this.storeName);\n /** @type {Promise<string[]>} */\n const keys = tx.objectStore(this.storeName).getAllKeys();\n await tx.done;\n return keys;\n }\n}\n\n// STRING HELPERS\n// Takes an array and returns a string that separates each of its items with the proper commas and\n// \"and\". The second argument is a mapping function that can convert the items before they are\n// joined\nexport function joinAnd(array = [], mapper = item => item, lang = docLang) {\n const items = array.map(mapper);\n if (Intl.ListFormat && typeof Intl.ListFormat === \"function\") {\n const formatter = new Intl.ListFormat(lang, {\n style: \"long\",\n type: \"conjunction\",\n });\n return formatter.format(items);\n }\n switch (items.length) {\n case 0:\n case 1: // \"x\"\n return items.toString();\n case 2: // x and y\n return items.join(\" and \");\n default: {\n // x, y, and z\n const str = items.join(\", \");\n const lastComma = str.lastIndexOf(\",\");\n return `${str.substr(0, lastComma + 1)} and ${str.slice(lastComma + 2)}`;\n }\n }\n}\n\n// Takes a string, applies some XML escapes, and returns the escaped string.\n// Note that overall using either Handlebars' escaped output or jQuery is much\n// preferred to operating on strings directly.\nexport function xmlEscape(s) {\n return s\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single space\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n// Takes a Date object and an optional separator and returns the year,month,day representation with\n// the custom separator (defaulting to none) and proper 0-padding\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n// formats a date to \"yyyy-mm-dd\"\nexport function toShortIsoDate(date) {\n return ISODate.format(date);\n}\n\n// takes a string, prepends a \"0\" if it is of length 1, does nothing otherwise\nexport function lead0(str) {\n return String(str).length === 1 ? `0${str}` : str;\n}\n\n// takes a YYYY-MM-DD date and returns a Date object for it\nexport function parseSimpleDate(str) {\n return new Date(str);\n}\n\n// takes what document.lastModified returns and produces a Date object for it\nexport function parseLastModified(str) {\n if (!str) return new Date();\n return new Date(Date.parse(str));\n}\n\n// given either a Date object or a date in YYYY-MM-DD format,\n// return a human-formatted date suitable for use in a W3C specification\nexport function humanDate(\n date = new Date(),\n lang = document.documentElement.lang || \"en\"\n) {\n if (!(date instanceof Date)) date = new Date(date);\n const langs = [lang, \"en\"];\n const day = date.toLocaleString(langs, {\n day: \"2-digit\",\n timeZone: \"UTC\",\n });\n const month = date.toLocaleString(langs, {\n month: \"long\",\n timeZone: \"UTC\",\n });\n const year = date.toLocaleString(langs, {\n year: \"numeric\",\n timeZone: \"UTC\",\n });\n // date month year\n return `${day} ${month} ${year}`;\n}\n// given either a Date object or a date in YYYY-MM-DD format,\n// return an ISO formatted date suitable for use in a xsd:datetime item\nexport function isoDate(date) {\n return (date instanceof Date ? date : new Date(date)).toISOString();\n}\n\n// Given an object, it converts it to a key value pair separated by\n// (\"=\", configurable) and a delimiter (\" ,\" configurable).\n// for example, {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n// take a document and either a link or an array of links to CSS and appends\n// a <link/> element to the head pointing to each\nexport function linkCSS(doc, styles) {\n const stylesArray = [].concat(styles);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n// Run list of transforms over content and return result.\n// Please note that this is a legacy method that is only kept in order\n// to maintain compatibility\n// with RSv1. It is therefore not tested and not actively supported.\n/**\n * @this {any}\n * @param {string} [flist]\n */\nexport function runTransforms(content, flist) {\n let args = [this, content];\n const funcArgs = Array.from(arguments);\n funcArgs.shift();\n funcArgs.shift();\n args = args.concat(funcArgs);\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (let j = 0; j < methods.length; j++) {\n const meth = methods[j];\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n pub(\n \"warn\",\n `call to \\`${meth}()\\` failed with: ${e}. See error console for stack trace.`\n );\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours (86400000 ms)\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 86400000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- COLLECTION/ITERABLE HELPERS ---------------\n/**\n * Spreads one iterable into another.\n *\n * @param {Array} collector\n * @param {any|Array} item\n * @returns {Array}\n */\nexport function flatten(collector, item) {\n const items = !Array.isArray(item)\n ? [item]\n : item.slice().reduce(flatten, []);\n collector.push(...items);\n return collector;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Creates and sets an ID to an element (elem)\n * using a specific prefix if provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (pfx === \"example\") {\n id = txt;\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes if nodes that only have whitespace are returned.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies\n * the algorithm used for determining the actual title of a\n * <dfn> element (but can apply to other as well).\n * if args.isDefinition is true, then the element is a definition, not a\n * reference to a definition. Any @title will be replaced with\n * @data-lt to be consistent with Bikeshed / Shepherd.\n * This method now *prefers* the data-lt attribute for the list of\n * titles. That attribute is added by this method to dfn elements, so\n * subsequent calls to this method will return the data-lt based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that\n * element might refer to, of the form\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @returns {Element} new renamed element\n */\nexport function renameElement(elem, newName) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Applies the selector for direct descendants.\n * This is a helper function for browsers without :scope support.\n * Note that this doesn't support comma separated selectors.\n * @param {Element} element\n * @param {string} selector\n * @returns {NodeListOf<HTMLElement>}\n */\nexport function children(element, selector) {\n try {\n return element.querySelectorAll(`:scope > ${selector}`);\n } catch {\n let tempId = \"\";\n // We give a temporary id, to overcome lack of \":scope\" support in Edge.\n if (!element.id) {\n tempId = `temp-${String(Math.random()).substr(2)}`;\n element.id = tempId;\n }\n const query = `#${element.id} > ${selector}`;\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.parentElement.querySelectorAll(query);\n if (tempId) {\n element.id = \"\";\n }\n return elements;\n }\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => renameElement(dfn, \"span\"));\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport \"./include-config.js\";\nimport \"./override-configuration.js\";\nimport \"./respec-ready.js\";\nimport { done as postProcessDone } from \"./post-process.js\";\nimport { done as preProcessDone } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\nconst canMeasure = performance.mark && performance.measure;\n\nfunction toRunnable(plug) {\n const name = plug.name || \"\";\n if (!name) {\n console.warn(\"Plugin lacks name:\", plug);\n }\n return config => {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n if (canMeasure) {\n performance.mark(`${name}-start`);\n }\n try {\n if (plug.run.length <= 1) {\n await plug.run(config);\n resolve();\n } else {\n console.warn(\n `Plugin ${name} uses a deprecated callback signature. Return a Promise instead. Read more at: https://github.com/w3c/respec/wiki/Developers-Guide#plugins`\n );\n plug.run(config, document, resolve);\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n }\n if (canMeasure) {\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n };\n}\n\nexport async function runAll(plugs) {\n pub(\"start-all\", respecConfig);\n if (canMeasure) {\n performance.mark(`${name}-start`);\n }\n await preProcessDone;\n const runnables = plugs.filter(plug => plug && plug.run).map(toRunnable);\n for (const task of runnables) {\n try {\n await task(respecConfig);\n } catch (err) {\n console.error(err);\n }\n }\n pub(\"plugins-done\", respecConfig);\n await postProcessDone;\n pub(\"end-all\", respecConfig);\n removeReSpec(document);\n if (canMeasure) {\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n}\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n\n/**\n * @param {string} fileName\n */\nexport async function fetchAsset(fileName) {\n return fetchBase(`assets/${fileName}`);\n}\n","const instanceOfAny = (object, constructors) => constructors.some(c => object instanceof c);\n\nlet idbProxyableTypes;\r\nlet cursorAdvanceMethods;\r\n// This is a function to prevent it throwing up in node environments.\r\nfunction getIdbProxyableTypes() {\r\n return (idbProxyableTypes ||\r\n (idbProxyableTypes = [\r\n IDBDatabase,\r\n IDBObjectStore,\r\n IDBIndex,\r\n IDBCursor,\r\n IDBTransaction,\r\n ]));\r\n}\r\n// This is a function to prevent it throwing up in node environments.\r\nfunction getCursorAdvanceMethods() {\r\n return (cursorAdvanceMethods ||\r\n (cursorAdvanceMethods = [\r\n IDBCursor.prototype.advance,\r\n IDBCursor.prototype.continue,\r\n IDBCursor.prototype.continuePrimaryKey,\r\n ]));\r\n}\r\nconst cursorRequestMap = new WeakMap();\r\nconst transactionDoneMap = new WeakMap();\r\nconst transactionStoreNamesMap = new WeakMap();\r\nconst transformCache = new WeakMap();\r\nconst reverseTransformCache = new WeakMap();\r\nfunction promisifyRequest(request) {\r\n const promise = new Promise((resolve, reject) => {\r\n const unlisten = () => {\r\n request.removeEventListener('success', success);\r\n request.removeEventListener('error', error);\r\n };\r\n const success = () => {\r\n resolve(wrap(request.result));\r\n unlisten();\r\n };\r\n const error = () => {\r\n reject(request.error);\r\n unlisten();\r\n };\r\n request.addEventListener('success', success);\r\n request.addEventListener('error', error);\r\n });\r\n promise\r\n .then(value => {\r\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\r\n // (see wrapFunction).\r\n if (value instanceof IDBCursor) {\r\n cursorRequestMap.set(value, request);\r\n }\r\n // Catching to avoid \"Uncaught Promise exceptions\"\r\n })\r\n .catch(() => { });\r\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\r\n // is because we create many promises from a single IDBRequest.\r\n reverseTransformCache.set(promise, request);\r\n return promise;\r\n}\r\nfunction cacheDonePromiseForTransaction(tx) {\r\n // Early bail if we've already created a done promise for this transaction.\r\n if (transactionDoneMap.has(tx))\r\n return;\r\n const done = new Promise((resolve, reject) => {\r\n const unlisten = () => {\r\n tx.removeEventListener('complete', complete);\r\n tx.removeEventListener('error', error);\r\n tx.removeEventListener('abort', error);\r\n };\r\n const complete = () => {\r\n resolve();\r\n unlisten();\r\n };\r\n const error = () => {\r\n reject(tx.error);\r\n unlisten();\r\n };\r\n tx.addEventListener('complete', complete);\r\n tx.addEventListener('error', error);\r\n tx.addEventListener('abort', error);\r\n });\r\n // Cache it for later retrieval.\r\n transactionDoneMap.set(tx, done);\r\n}\r\nlet idbProxyTraps = {\r\n get(target, prop, receiver) {\r\n if (target instanceof IDBTransaction) {\r\n // Special handling for transaction.done.\r\n if (prop === 'done')\r\n return transactionDoneMap.get(target);\r\n // Polyfill for objectStoreNames because of Edge.\r\n if (prop === 'objectStoreNames') {\r\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\r\n }\r\n // Make tx.store return the only store in the transaction, or undefined if there are many.\r\n if (prop === 'store') {\r\n return receiver.objectStoreNames[1]\r\n ? undefined\r\n : receiver.objectStore(receiver.objectStoreNames[0]);\r\n }\r\n }\r\n // Else transform whatever we get back.\r\n return wrap(target[prop]);\r\n },\r\n has(target, prop) {\r\n if (target instanceof IDBTransaction &&\r\n (prop === 'done' || prop === 'store')) {\r\n return true;\r\n }\r\n return prop in target;\r\n },\r\n};\r\nfunction addTraps(callback) {\r\n idbProxyTraps = callback(idbProxyTraps);\r\n}\r\nfunction wrapFunction(func) {\r\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\r\n // only create one new func per func.\r\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\r\n if (func === IDBDatabase.prototype.transaction &&\r\n !('objectStoreNames' in IDBTransaction.prototype)) {\r\n return function (storeNames, ...args) {\r\n const tx = func.call(unwrap(this), storeNames, ...args);\r\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\r\n return wrap(tx);\r\n };\r\n }\r\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\r\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\r\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\r\n // with real promises, so each advance methods returns a new promise for the cursor object, or\r\n // undefined if the end of the cursor has been reached.\r\n if (getCursorAdvanceMethods().includes(func)) {\r\n return function (...args) {\r\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\r\n // the original object.\r\n func.apply(unwrap(this), args);\r\n return wrap(cursorRequestMap.get(this));\r\n };\r\n }\r\n return function (...args) {\r\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\r\n // the original object.\r\n return wrap(func.apply(unwrap(this), args));\r\n };\r\n}\r\nfunction transformCachableValue(value) {\r\n if (typeof value === 'function')\r\n return wrapFunction(value);\r\n // This doesn't return, it just creates a 'done' promise for the transaction,\r\n // which is later returned for transaction.done (see idbObjectHandler).\r\n if (value instanceof IDBTransaction)\r\n cacheDonePromiseForTransaction(value);\r\n if (instanceOfAny(value, getIdbProxyableTypes()))\r\n return new Proxy(value, idbProxyTraps);\r\n // Return the same value back if we're not going to transform it.\r\n return value;\r\n}\r\nfunction wrap(value) {\r\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\r\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\r\n if (value instanceof IDBRequest)\r\n return promisifyRequest(value);\r\n // If we've already transformed this value before, reuse the transformed value.\r\n // This is faster, but it also provides object equality.\r\n if (transformCache.has(value))\r\n return transformCache.get(value);\r\n const newValue = transformCachableValue(value);\r\n // Not all types are transformed.\r\n // These may be primitive types, so they can't be WeakMap keys.\r\n if (newValue !== value) {\r\n transformCache.set(value, newValue);\r\n reverseTransformCache.set(newValue, value);\r\n }\r\n return newValue;\r\n}\r\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { wrap as a, addTraps as b, instanceOfAny as c, reverseTransformCache as d, unwrap as e };\n","import { a as wrap, b as addTraps } from './chunk.js';\nexport { e as unwrap, a as wrap } from './chunk.js';\n\n/**\r\n * Open a database.\r\n *\r\n * @param name Name of the database.\r\n * @param version Schema version.\r\n * @param callbacks Additional callbacks.\r\n */\r\nfunction openDB(name, version, { blocked, upgrade, blocking } = {}) {\r\n const request = indexedDB.open(name, version);\r\n const openPromise = wrap(request);\r\n if (upgrade) {\r\n request.addEventListener('upgradeneeded', event => {\r\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));\r\n });\r\n }\r\n if (blocked)\r\n request.addEventListener('blocked', () => blocked());\r\n if (blocking) {\r\n openPromise.then(db => db.addEventListener('versionchange', blocking)).catch(() => { });\r\n }\r\n return openPromise;\r\n}\r\n/**\r\n * Delete a database.\r\n *\r\n * @param name Name of the database.\r\n */\r\nfunction deleteDB(name, { blocked } = {}) {\r\n const request = indexedDB.deleteDatabase(name);\r\n if (blocked)\r\n request.addEventListener('blocked', () => blocked());\r\n return wrap(request).then(() => undefined);\r\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\r\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\r\nconst cachedMethods = new Map();\r\nfunction getMethod(target, prop) {\r\n if (!(target instanceof IDBDatabase &&\r\n !(prop in target) &&\r\n typeof prop === 'string')) {\r\n return;\r\n }\r\n if (cachedMethods.get(prop))\r\n return cachedMethods.get(prop);\r\n const targetFuncName = prop.replace(/FromIndex$/, '');\r\n const useIndex = prop !== targetFuncName;\r\n const isWrite = writeMethods.includes(targetFuncName);\r\n if (\r\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\r\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\r\n !(isWrite || readMethods.includes(targetFuncName))) {\r\n return;\r\n }\r\n const method = async function (storeName, ...args) {\r\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\r\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\r\n let target = tx.store;\r\n if (useIndex)\r\n target = target.index(args.shift());\r\n const returnVal = target[targetFuncName](...args);\r\n if (isWrite)\r\n await tx.done;\r\n return returnVal;\r\n };\r\n cachedMethods.set(prop, method);\r\n return method;\r\n}\r\naddTraps(oldTraps => ({\r\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\r\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\r\n}));\n\nexport { openDB, deleteDB };\n","/**\n * @param {string} text\n */\nfunction lastLine(text) {\n const splitted = text.split(\"\\n\");\n return splitted[splitted.length - 1];\n}\n\n/**\n * @typedef {object} WebIDL2ErrorOptions\n * @property {\"error\" | \"warning\"} [level]\n * @property {Function} [autofix]\n *\n * @param {string} message error message\n * @param {\"Syntax\" | \"Validation\"} kind error type\n * @param {WebIDL2ErrorOptions} [options]\n */\nfunction error(source, position, current, message, kind, { level = \"error\", autofix, ruleName } = {}) {\n /**\n * @param {number} count\n */\n function sliceTokens(count) {\n return count > 0 ?\n source.slice(position, position + count) :\n source.slice(Math.max(position + count, 0), position);\n }\n\n function tokensToText(inputs, { precedes } = {}) {\n const text = inputs.map(t => t.trivia + t.value).join(\"\");\n const nextToken = source[position];\n if (nextToken.type === \"eof\") {\n return text;\n }\n if (precedes) {\n return text + nextToken.trivia;\n }\n return text.slice(nextToken.trivia.length);\n }\n\n const maxTokens = 5; // arbitrary but works well enough\n const line =\n source[position].type !== \"eof\" ? source[position].line :\n source.length > 1 ? source[position - 1].line :\n 1;\n\n const precedingLastLine = lastLine(\n tokensToText(sliceTokens(-maxTokens), { precedes: true })\n );\n\n const subsequentTokens = sliceTokens(maxTokens);\n const subsequentText = tokensToText(subsequentTokens);\n const subsequentFirstLine = subsequentText.split(\"\\n\")[0];\n\n const spaced = \" \".repeat(precedingLastLine.length) + \"^\";\n const sourceContext = precedingLastLine + subsequentFirstLine + \"\\n\" + spaced;\n\n const contextType = kind === \"Syntax\" ? \"since\" : \"inside\";\n const inSourceName = source.name ? ` in ${source.name}` : \"\";\n const grammaticalContext = (current && current.name) ? `, ${contextType} \\`${current.partial ? \"partial \" : \"\"}${current.type} ${current.name}\\`` : \"\";\n const context = `${kind} error at line ${line}${inSourceName}${grammaticalContext}:\\n${sourceContext}`;\n return {\n message: `${context} ${message}`,\n bareMessage: message,\n context,\n line,\n sourceName: source.name,\n level,\n ruleName,\n autofix,\n input: subsequentText,\n tokens: subsequentTokens\n };\n}\n\n/**\n * @param {string} message error message\n */\nexport function syntaxError(source, position, current, message) {\n return error(source, position, current, message, \"Syntax\");\n}\n\n/**\n * @param {string} message error message\n * @param {WebIDL2ErrorOptions} [options]\n */\nexport function validationError(token, current, ruleName, message, options = {}) {\n options.ruleName = ruleName;\n return error(current.source, token.index, current, message, \"Validation\", options);\n}\n","// @ts-check\n\nexport class Base {\n /**\n * @param {object} initializer\n * @param {Base[\"source\"]} initializer.source\n * @param {Base[\"tokens\"]} initializer.tokens\n */\n constructor({ source, tokens }) {\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens },\n parent: { value: null, writable: true },\n this: { value: this } // useful when escaping from proxy\n });\n }\n\n toJSON() {\n const json = { type: undefined, name: undefined, inheritance: undefined };\n let proto = this;\n while (proto !== Object.prototype) {\n const descMap = Object.getOwnPropertyDescriptors(proto);\n for (const [key, value] of Object.entries(descMap)) {\n if (value.enumerable || value.get) {\n // @ts-ignore - allow indexing here\n json[key] = this[key];\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return json;\n }\n}\n","// @ts-check\n\n/**\n * @typedef {import(\"../productions/dictionary.js\").Dictionary} Dictionary\n *\n * @param {*} idlType\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {object} [options]\n * @param {boolean} [options.useNullableInner] use when the input idlType is nullable and you want to use its inner type\n * @return {{ reference: *, dictionary: Dictionary }} the type reference that ultimately includes dictionary.\n */\nexport function idlTypeIncludesDictionary(idlType, defs, { useNullableInner } = {}) {\n if (!idlType.union) {\n const def = defs.unique.get(idlType.idlType);\n if (!def) {\n return;\n }\n if (def.type === \"typedef\") {\n const { typedefIncludesDictionary } = defs.cache;\n if (typedefIncludesDictionary.has(def)) {\n // Note that this also halts when it met indeterminate state\n // to prevent infinite recursion\n return typedefIncludesDictionary.get(def);\n }\n defs.cache.typedefIncludesDictionary.set(def, undefined); // indeterminate state\n const result = idlTypeIncludesDictionary(def.idlType, defs);\n defs.cache.typedefIncludesDictionary.set(def, result);\n if (result) {\n return {\n reference: idlType,\n dictionary: result.dictionary\n };\n }\n }\n if (def.type === \"dictionary\" && (useNullableInner || !idlType.nullable)) {\n return {\n reference: idlType,\n dictionary: def\n };\n }\n }\n for (const subtype of idlType.subtype) {\n const result = idlTypeIncludesDictionary(subtype, defs);\n if (result) {\n if (subtype.union) {\n return result;\n }\n return {\n reference: subtype,\n dictionary: result.dictionary\n };\n }\n }\n}\n\n/**\n * @param {*} dict dictionary type\n * @param {import(\"../validator.js\").Definitions} defs\n * @return {boolean}\n */\nexport function dictionaryIncludesRequiredField(dict, defs) {\n if (defs.cache.dictionaryIncludesRequiredField.has(dict)) {\n return defs.cache.dictionaryIncludesRequiredField.get(dict);\n }\n defs.cache.dictionaryIncludesRequiredField.set(dict, undefined); // indeterminate\n if (dict.inheritance) {\n const superdict = defs.unique.get(dict.inheritance);\n if (!superdict) {\n return true;\n }\n if (dictionaryIncludesRequiredField(superdict, defs)) {\n return true;\n }\n }\n const result = dict.members.some(field => field.required);\n defs.cache.dictionaryIncludesRequiredField.set(dict, result);\n return result;\n}\n","import { Base } from \"./base.js\";\nimport { unescape, type_with_extended_attributes, return_type, primitive_type, autoParenter } from \"./helpers.js\";\nimport { stringTypes, typeNameKeywords } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction generic_type(tokeniser, typeName) {\n const base = tokeniser.consume(\"FrozenArray\", \"Promise\", \"sequence\", \"record\");\n if (!base) {\n return;\n }\n const ret = autoParenter(new Type({ source: tokeniser.source, tokens: { base } }));\n ret.tokens.open = tokeniser.consume(\"<\") || tokeniser.error(`No opening bracket after ${base.type}`);\n switch (base.type) {\n case \"Promise\": {\n if (tokeniser.probe(\"[\")) tokeniser.error(\"Promise type cannot have extended attribute\");\n const subtype = return_type(tokeniser, typeName) || tokeniser.error(\"Missing Promise subtype\");\n ret.subtype.push(subtype);\n break;\n }\n case \"sequence\":\n case \"FrozenArray\": {\n const subtype = type_with_extended_attributes(tokeniser, typeName) || tokeniser.error(`Missing ${base.type} subtype`);\n ret.subtype.push(subtype);\n break;\n }\n case \"record\": {\n if (tokeniser.probe(\"[\")) tokeniser.error(\"Record key cannot have extended attribute\");\n const keyType = tokeniser.consume(...stringTypes) || tokeniser.error(`Record key must be one of: ${stringTypes.join(\", \")}`);\n const keyIdlType = new Type({ source: tokeniser.source, tokens: { base: keyType }});\n keyIdlType.tokens.separator = tokeniser.consume(\",\") || tokeniser.error(\"Missing comma after record key type\");\n keyIdlType.type = typeName;\n const valueType = type_with_extended_attributes(tokeniser, typeName) || tokeniser.error(\"Error parsing generic type record\");\n ret.subtype.push(keyIdlType, valueType);\n break;\n }\n }\n if (!ret.idlType) tokeniser.error(`Error parsing generic type ${base.type}`);\n ret.tokens.close = tokeniser.consume(\">\") || tokeniser.error(`Missing closing bracket after ${base.type}`);\n return ret.this;\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nfunction type_suffix(tokeniser, obj) {\n const nullable = tokeniser.consume(\"?\");\n if (nullable) {\n obj.tokens.nullable = nullable;\n }\n if (tokeniser.probe(\"?\")) tokeniser.error(\"Can't nullable more than once\");\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction single_type(tokeniser, typeName) {\n let ret = generic_type(tokeniser, typeName) || primitive_type(tokeniser);\n if (!ret) {\n const base = tokeniser.consume(\"identifier\", ...stringTypes, ...typeNameKeywords);\n if (!base) {\n return;\n }\n ret = new Type({ source: tokeniser.source, tokens: { base } });\n if (tokeniser.probe(\"<\")) tokeniser.error(`Unsupported generic type ${base.value}`);\n }\n if (ret.generic === \"Promise\" && tokeniser.probe(\"?\")) {\n tokeniser.error(\"Promise type cannot be nullable\");\n }\n ret.type = typeName || null;\n type_suffix(tokeniser, ret);\n if (ret.nullable && ret.idlType === \"any\") tokeniser.error(\"Type `any` cannot be made nullable\");\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} type\n */\nfunction union_type(tokeniser, type) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"(\");\n if (!tokens.open) return;\n const ret = autoParenter(new Type({ source: tokeniser.source, tokens }));\n ret.type = type || null;\n while (true) {\n const typ = type_with_extended_attributes(tokeniser) || tokeniser.error(\"No type after open parenthesis or 'or' in union type\");\n if (typ.idlType === \"any\") tokeniser.error(\"Type `any` cannot be included in a union type\");\n if (typ.generic === \"Promise\") tokeniser.error(\"Type `Promise` cannot be included in a union type\");\n ret.subtype.push(typ);\n const or = tokeniser.consume(\"or\");\n if (or) {\n typ.tokens.separator = or;\n }\n else break;\n }\n if (ret.idlType.length < 2) {\n tokeniser.error(\"At least two types are expected in a union type but found less\");\n }\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unterminated union type\");\n type_suffix(tokeniser, ret);\n return ret.this;\n}\n\nexport class Type extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\n static parse(tokeniser, typeName) {\n return single_type(tokeniser, typeName) || union_type(tokeniser, typeName);\n }\n\n constructor({ source, tokens }) {\n super({ source, tokens });\n Object.defineProperty(this, \"subtype\", { value: [], writable: true });\n this.extAttrs = [];\n }\n\n get generic() {\n if (this.subtype.length && this.tokens.base) {\n return this.tokens.base.value;\n }\n return \"\";\n }\n get nullable() {\n return Boolean(this.tokens.nullable);\n }\n get union() {\n return Boolean(this.subtype.length) && !this.tokens.base;\n }\n get idlType() {\n if (this.subtype.length) {\n return this.subtype;\n }\n // Adding prefixes/postfixes for \"unrestricted float\", etc.\n const name = [\n this.tokens.prefix,\n this.tokens.base,\n this.tokens.postfix\n ].filter(t => t).map(t => t.value).join(\" \");\n return unescape(name);\n }\n\n *validate(defs) {\n /*\n * If a union is nullable, its subunions cannot include a dictionary\n * If not, subunions may include dictionaries if each union is not nullable\n */\n const typedef = !this.union && defs.unique.get(this.idlType);\n const target =\n this.union ? this :\n (typedef && typedef.type === \"typedef\") ? typedef.idlType :\n undefined;\n if (target && this.nullable) {\n // do not allow any dictionary\n const { reference } = idlTypeIncludesDictionary(target, defs) || {};\n if (reference) {\n const targetToken = (this.union ? reference : this).tokens.base;\n const message = `Nullable union cannot include a dictionary type`;\n yield validationError(targetToken, this, \"no-nullable-union-dict\", message);\n }\n } else {\n // allow some dictionary\n for (const subtype of this.subtype) {\n yield* subtype.validate(defs);\n }\n }\n }\n}\n","import { Base } from \"./base.js\";\nimport { const_data, const_value } from \"./helpers.js\";\n\nexport class Default extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const assign = tokeniser.consume(\"=\");\n if (!assign) {\n return null;\n }\n const def = const_value(tokeniser) || tokeniser.consume(\"string\", \"null\", \"[\", \"{\") || tokeniser.error(\"No value for default\");\n const expression = [def];\n if (def.type === \"[\") {\n const close = tokeniser.consume(\"]\") || tokeniser.error(\"Default sequence value must be empty\");\n expression.push(close);\n } else if (def.type === \"{\") {\n const close = tokeniser.consume(\"}\") || tokeniser.error(\"Default dictionary value must be empty\");\n expression.push(close);\n }\n return new Default({ source: tokeniser.source, tokens: { assign }, expression });\n }\n\n constructor({ source, tokens, expression }) {\n super({ source, tokens });\n expression.parent = this;\n Object.defineProperty(this, \"expression\", { value: expression });\n }\n\n get type() {\n return const_data(this.expression[0]).type;\n }\n get value() {\n return const_data(this.expression[0]).value;\n }\n get negative() {\n return const_data(this.expression[0]).negative;\n }\n}\n","// @ts-check\n\nexport class ArrayBase extends Array {\n constructor({ source, tokens }) {\n super();\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens },\n parent: { value: null, writable: true }\n });\n }\n}\n","// @ts-check\n\nimport { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Token extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} type\n */\n static parser(tokeniser, type) {\n return () => {\n const value = tokeniser.consume(type);\n if (value) {\n return new Token({ source: tokeniser.source, tokens: { value } });\n }\n };\n }\n\n get value() {\n return unescape(this.tokens.value.value);\n }\n}\n","import { Base } from \"./base.js\";\nimport { ArrayBase } from \"./array-base.js\";\nimport { Token } from \"./token.js\";\nimport { list, argument_list, autoParenter, unescape } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} tokenName\n */\nfunction tokens(tokeniser, tokenName) {\n const toks = list(tokeniser, {\n parser: Token.parser(tokeniser, tokenName),\n listName: tokenName + \" list\"\n });\n return toks;\n}\n\n/**\n * This will allow a set of identifiers or strings to be parsed.\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nfunction identifiersOrStrings(tokeniser) {\n let toks = tokens(tokeniser, \"identifier\");\n if (toks.length) {\n return toks;\n }\n toks = tokens(tokeniser, \"string\");\n if (toks.length) {\n return toks;\n }\n tokeniser.error(`Expected identifiers or strings but none found`);\n}\n\n\nclass ExtendedAttributeParameters extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = { assign: tokeniser.consume(\"=\") };\n const ret = autoParenter(new ExtendedAttributeParameters({ source: tokeniser.source, tokens }));\n if (tokens.assign) {\n tokens.secondaryName = tokeniser.consume(\"identifier\", \"decimal\", \"integer\", \"string\");\n }\n tokens.open = tokeniser.consume(\"(\");\n if (tokens.open) {\n ret.list = ret.rhsIsList ?\n // [Exposed=(Window,Worker)]\n identifiersOrStrings(tokeniser) :\n // [NamedConstructor=Audio(DOMString src)] or [Constructor(DOMString str)]\n argument_list(tokeniser);\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unexpected token in extended attribute argument list\");\n } else if (ret.hasRhs && !tokens.secondaryName) {\n tokeniser.error(\"No right hand side to extended attribute assignment\");\n }\n return ret.this;\n }\n\n get rhsIsList() {\n return this.tokens.assign && !this.tokens.secondaryName;\n }\n\n get rhsType() {\n if (this.rhsIsList) {\n return this.list[0].tokens.value.type + \"-list\";\n }\n if (this.tokens.secondaryName) {\n return this.tokens.secondaryName.type;\n }\n return null;\n }\n}\n\nexport class SimpleExtendedAttribute extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consume(\"identifier\");\n if (name) {\n return new SimpleExtendedAttribute({\n source: tokeniser.source,\n tokens: { name },\n params: ExtendedAttributeParameters.parse(tokeniser)\n });\n }\n }\n\n constructor({ source, tokens, params }) {\n super({ source, tokens });\n params.parent = this;\n Object.defineProperty(this, \"params\", { value: params });\n }\n\n get type() {\n return \"extended-attribute\";\n }\n get name() {\n return this.tokens.name.value;\n }\n get rhs() {\n const { rhsType: type, tokens, list } = this.params;\n if (!type) {\n return null;\n }\n const value = this.params.rhsIsList ? list : unescape(tokens.secondaryName.value);\n return { type, value };\n }\n get arguments() {\n const { rhsIsList, list } = this.params;\n if (!list || rhsIsList) {\n return [];\n }\n return list;\n }\n\n *validate(defs) {\n if (this.name === \"NoInterfaceObject\") {\n const message = `\\`[NoInterfaceObject]\\` extended attribute is an \\\nundesirable feature that may be removed from Web IDL in the future. Refer to the \\\n[relevant upstream PR](https://github.com/heycam/webidl/pull/609) for more \\\ninformation.`;\n yield validationError(this.tokens.name, this, \"no-nointerfaceobject\", message, { level: \"warning\" });\n }\n for (const arg of this.arguments) {\n yield* arg.validate(defs);\n }\n }\n}\n\n// Note: we parse something simpler than the official syntax. It's all that ever\n// seems to be used\nexport class ExtendedAttributes extends ArrayBase {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"[\");\n if (!tokens.open) return new ExtendedAttributes({});\n const ret = new ExtendedAttributes({ source: tokeniser.source, tokens });\n ret.push(...list(tokeniser, {\n parser: SimpleExtendedAttribute.parse,\n listName: \"extended attribute\"\n }));\n tokens.close = tokeniser.consume(\"]\") || tokeniser.error(\"Unexpected closing token of extended attribute\");\n if (!ret.length) {\n tokeniser.error(\"Found an empty extended attribute\");\n }\n if (tokeniser.probe(\"[\")) {\n tokeniser.error(\"Illegal double extended attribute lists, consider merging them\");\n }\n return ret;\n }\n\n *validate(defs) {\n for (const extAttr of this) {\n yield* extAttr.validate(defs);\n }\n }\n}\n","// @ts-check\n\nimport { Base } from \"./base.js\";\nimport { Default } from \"./default.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { unescape, type_with_extended_attributes, autoParenter, getFirstToken } from \"./helpers.js\";\nimport { argumentNameKeywords, Tokeniser } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary, dictionaryIncludesRequiredField } from \"../validators/helpers.js\";\n\nexport class Argument extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Argument({ source: tokeniser.source, tokens }));\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.optional = tokeniser.consume(\"optional\");\n ret.idlType = type_with_extended_attributes(tokeniser, \"argument-type\");\n if (!ret.idlType) {\n return tokeniser.unconsume(start_position);\n }\n if (!tokens.optional) {\n tokens.variadic = tokeniser.consume(\"...\");\n }\n tokens.name = tokeniser.consume(\"identifier\", ...argumentNameKeywords);\n if (!tokens.name) {\n return tokeniser.unconsume(start_position);\n }\n ret.default = tokens.optional ? Default.parse(tokeniser) : null;\n return ret.this;\n }\n\n get type() {\n return \"argument\";\n }\n get optional() {\n return !!this.tokens.optional;\n }\n get variadic() {\n return !!this.tokens.variadic;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /**\n * @param {import(\"../validator.js\").Definitions} defs\n */\n *validate(defs) {\n yield* this.idlType.validate(defs);\n const result = idlTypeIncludesDictionary(this.idlType, defs, { useNullableInner: true });\n if (result) {\n if (this.idlType.nullable) {\n const message = `Dictionary arguments cannot be nullable.`;\n yield validationError(this.tokens.name, this, \"no-nullable-dict-arg\", message);\n } else if (!this.optional) {\n if (this.parent && !dictionaryIncludesRequiredField(result.dictionary, defs) && isLastRequiredArgument(this)) {\n const message = `Dictionary argument must be optional if it has no required fields`;\n yield validationError(this.tokens.name, this, \"dict-arg-optional\", message, {\n autofix: autofixDictionaryArgumentOptionality(this)\n });\n }\n } else if (!this.default) {\n const message = `Optional dictionary arguments must have a default value of \\`{}\\`.`;\n yield validationError(this.tokens.name, this, \"dict-arg-default\", message, {\n autofix: autofixOptionalDictionaryDefaultValue(this)\n });\n }\n }\n }\n}\n\n/**\n * @param {Argument} arg\n */\nfunction isLastRequiredArgument(arg) {\n const list = arg.parent.arguments || arg.parent.list;\n const index = list.indexOf(arg);\n const requiredExists = list.slice(index + 1).some(a => !a.optional);\n return !requiredExists;\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixDictionaryArgumentOptionality(arg) {\n return () => {\n const firstToken = getFirstToken(arg.idlType);\n arg.tokens.optional = { type: \"optional\", value: \"optional\", trivia: firstToken.trivia };\n firstToken.trivia = \" \";\n autofixOptionalDictionaryDefaultValue(arg)();\n };\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixOptionalDictionaryDefaultValue(arg) {\n return () => {\n arg.default = Default.parse(new Tokeniser(\" = {}\"));\n };\n}\n","import { Base } from \"./base.js\";\nimport { return_type, argument_list, unescape, autoParenter } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\nexport class Operation extends Base {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {Token} [options.special]\n * @param {Token} [options.regular]\n */\n static parse(tokeniser, { special, regular } = {}) {\n const tokens = { special };\n const ret = autoParenter(new Operation({ source: tokeniser.source, tokens }));\n if (special && special.value === \"stringifier\") {\n tokens.termination = tokeniser.consume(\";\");\n if (tokens.termination) {\n ret.arguments = [];\n return ret;\n }\n }\n if (!special && !regular) {\n tokens.special = tokeniser.consume(\"getter\", \"setter\", \"deleter\");\n }\n ret.idlType = return_type(tokeniser) || tokeniser.error(\"Missing return type\");\n tokens.name = tokeniser.consume(\"identifier\", \"includes\");\n tokens.open = tokeniser.consume(\"(\") || tokeniser.error(\"Invalid operation\");\n ret.arguments = argument_list(tokeniser);\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unterminated operation\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated operation, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"operation\";\n }\n get name() {\n const { name } = this.tokens;\n if (!name) {\n return \"\";\n }\n return unescape(name.value);\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n\n *validate(defs) {\n if (!this.name && [\"\", \"static\"].includes(this.special)) {\n const message = `Regular or static operations must have both a return type and an identifier.`;\n yield validationError(this.tokens.open, this, \"incomplete-op\", message);\n }\n if (this.idlType) {\n yield* this.idlType.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n}\n","import { Base } from \"./base.js\";\nimport { type_with_extended_attributes, unescape, autoParenter } from \"./helpers.js\";\n\nexport class Attribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, { special, noInherit = false, readonly = false } = {}) {\n const start_position = tokeniser.position;\n const tokens = { special };\n const ret = autoParenter(new Attribute({ source: tokeniser.source, tokens }));\n if (!special && !noInherit) {\n tokens.special = tokeniser.consume(\"inherit\");\n }\n if (ret.special === \"inherit\" && tokeniser.probe(\"readonly\")) {\n tokeniser.error(\"Inherited attributes cannot be read-only\");\n }\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (readonly && !tokens.readonly && tokeniser.probe(\"attribute\")) {\n tokeniser.error(\"Attributes must be readonly in this context\");\n }\n tokens.base = tokeniser.consume(\"attribute\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n ret.idlType = type_with_extended_attributes(tokeniser, \"attribute-type\") || tokeniser.error(\"Attribute lacks a type\");\n switch (ret.idlType.generic) {\n case \"sequence\":\n case \"record\": tokeniser.error(`Attributes cannot accept ${ret.idlType.generic} types`);\n }\n tokens.name = tokeniser.consume(\"identifier\", \"async\", \"required\") || tokeniser.error(\"Attribute lacks a name\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated attribute, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"attribute\";\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n}\n","import { Type } from \"./type.js\";\nimport { Argument } from \"./argument.js\";\nimport { ExtendedAttributes, SimpleExtendedAttribute } from \"./extended-attributes.js\";\nimport { Operation } from \"./operation.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\n\n/**\n * @param {string} identifier\n */\nexport function unescape(identifier) {\n return identifier.startsWith('_') ? identifier.slice(1) : identifier;\n}\n\n/**\n * Parses comma-separated list\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {object} args\n * @param {Function} args.parser parser function for each item\n * @param {boolean} [args.allowDangler] whether to allow dangling comma\n * @param {string} [args.listName] the name to be shown on error messages\n */\nexport function list(tokeniser, { parser, allowDangler, listName = \"list\" }) {\n const first = parser(tokeniser);\n if (!first) {\n return [];\n }\n first.tokens.separator = tokeniser.consume(\",\");\n const items = [first];\n while (first.tokens.separator) {\n const item = parser(tokeniser);\n if (!item) {\n if (!allowDangler) {\n tokeniser.error(`Trailing comma in ${listName}`);\n }\n break;\n }\n item.tokens.separator = tokeniser.consume(\",\");\n items.push(item);\n if (!item.tokens.separator) break;\n }\n return items;\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nexport function const_value(tokeniser) {\n return tokeniser.consume(\"true\", \"false\", \"Infinity\", \"-Infinity\", \"NaN\", \"decimal\", \"integer\");\n}\n\n/**\n * @param {object} token\n * @param {string} token.type\n * @param {string} token.value\n */\nexport function const_data({ type, value }) {\n switch (type) {\n case \"true\":\n case \"false\":\n return { type: \"boolean\", value: type === \"true\" };\n case \"Infinity\":\n case \"-Infinity\":\n return { type: \"Infinity\", negative: type.startsWith(\"-\") };\n case \"[\":\n return { type: \"sequence\", value: [] };\n case \"{\":\n return { type: \"dictionary\" };\n case \"decimal\":\n case \"integer\":\n return { type: \"number\", value };\n case \"string\":\n return { type: \"string\", value: value.slice(1, -1) };\n default:\n return { type };\n }\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nexport function primitive_type(tokeniser) {\n function integer_type() {\n const prefix = tokeniser.consume(\"unsigned\");\n const base = tokeniser.consume(\"short\", \"long\");\n if (base) {\n const postfix = tokeniser.consume(\"long\");\n return new Type({ source, tokens: { prefix, base, postfix } });\n }\n if (prefix) tokeniser.error(\"Failed to parse integer type\");\n }\n\n function decimal_type() {\n const prefix = tokeniser.consume(\"unrestricted\");\n const base = tokeniser.consume(\"float\", \"double\");\n if (base) {\n return new Type({ source, tokens: { prefix, base } });\n }\n if (prefix) tokeniser.error(\"Failed to parse float type\");\n }\n\n const { source } = tokeniser;\n const num_type = integer_type(tokeniser) || decimal_type(tokeniser);\n if (num_type) return num_type;\n const base = tokeniser.consume(\"boolean\", \"byte\", \"octet\");\n if (base) {\n return new Type({ source, tokens: { base } });\n }\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nexport function argument_list(tokeniser) {\n return list(tokeniser, { parser: Argument.parse, listName: \"arguments list\" });\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nexport function type_with_extended_attributes(tokeniser, typeName) {\n const extAttrs = ExtendedAttributes.parse(tokeniser);\n const ret = Type.parse(tokeniser, typeName);\n if (ret) autoParenter(ret).extAttrs = extAttrs;\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nexport function return_type(tokeniser, typeName) {\n const typ = Type.parse(tokeniser, typeName || \"return-type\");\n if (typ) {\n return typ;\n }\n const voidToken = tokeniser.consume(\"void\");\n if (voidToken) {\n const ret = new Type({ source: tokeniser.source, tokens: { base: voidToken } });\n ret.type = \"return-type\";\n return ret;\n }\n}\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nexport function stringifier(tokeniser) {\n const special = tokeniser.consume(\"stringifier\");\n if (!special) return;\n const member = Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"Unterminated stringifier\");\n return member;\n}\n\n/**\n * @param {string} str\n */\nexport function getLastIndentation(str) {\n const lines = str.split(\"\\n\");\n // the first line visually binds to the preceding token\n if (lines.length) {\n const match = lines[lines.length - 1].match(/^\\s+/);\n if (match) {\n return match[0];\n }\n }\n return \"\";\n}\n\n/**\n * @param {string} parentTrivia\n */\nexport function getMemberIndentation(parentTrivia) {\n const indentation = getLastIndentation(parentTrivia);\n const indentCh = indentation.includes(\"\\t\") ? \"\\t\" : \" \";\n return indentation + indentCh;\n}\n\n/**\n * @param {object} def\n * @param {import(\"./extended-attributes.js\").ExtendedAttributes} def.extAttrs\n */\nexport function autofixAddExposedWindow(def) {\n return () => {\n if (def.extAttrs.length){\n const tokeniser = new Tokeniser(\"Exposed=Window,\");\n const exposed = SimpleExtendedAttribute.parse(tokeniser);\n exposed.tokens.separator = tokeniser.consume(\",\");\n const existing = def.extAttrs[0];\n if (!/^\\s/.test(existing.tokens.name.trivia)) {\n existing.tokens.name.trivia = ` ${existing.tokens.name.trivia}`;\n }\n def.extAttrs.unshift(exposed);\n } else {\n autoParenter(def).extAttrs = ExtendedAttributes.parse(new Tokeniser(\"[Exposed=Window]\"));\n const trivia = def.tokens.base.trivia;\n def.extAttrs.tokens.open.trivia = trivia;\n def.tokens.base.trivia = `\\n${getLastIndentation(trivia)}`;\n }\n };\n}\n\n/**\n * Get the first syntax token for the given IDL object.\n * @param {*} data\n */\nexport function getFirstToken(data) {\n if (data.extAttrs.length) {\n return data.extAttrs.tokens.open;\n }\n if (data.type === \"operation\" && !data.special) {\n return getFirstToken(data.idlType);\n }\n const tokens = Object.values(data.tokens).sort((x, y) => x.index - y.index);\n return tokens[0];\n}\n\n/**\n * @template T\n * @param {T[]} array\n * @param {(item: T) => boolean} predicate\n */\nexport function findLastIndex(array, predicate) {\n const index = array.slice().reverse().findIndex(predicate);\n if (index === -1) {\n return index;\n }\n return array.length - index - 1;\n}\n\n/**\n * Returns a proxy that auto-assign `parent` field.\n * @template T\n * @param {T} data\n * @param {*} [parent] The object that will be assigned to `parent`.\n * If absent, it will be `data` by default.\n * @return {T}\n */\nexport function autoParenter(data, parent) {\n if (!parent) {\n // Defaults to `data` unless specified otherwise.\n parent = data;\n }\n if (!data) {\n // This allows `autoParenter(undefined)` which again allows\n // `autoParenter(parse())` where the function may return nothing.\n return data;\n }\n return new Proxy(data, {\n get(target, p) {\n const value = target[p];\n if (Array.isArray(value)) {\n // Wraps the array so that any added items will also automatically\n // get their `parent` values.\n return autoParenter(value, target);\n }\n return value;\n },\n set(target, p, value) {\n target[p] = value;\n if (!value) {\n return true;\n } else if (Array.isArray(value)) {\n // Assigning an array will add `parent` to its items.\n for (const item of value) {\n if (typeof item.parent !== \"undefined\") {\n item.parent = parent;\n }\n }\n } else if (typeof value.parent !== \"undefined\") {\n value.parent = parent;\n }\n return true;\n }\n });\n}\n","import { syntaxError } from \"./error.js\";\nimport { unescape } from \"./productions/helpers.js\";\n\n// These regular expressions use the sticky flag so they will only match at\n// the current location (ie. the offset of lastIndex).\nconst tokenRe = {\n // This expression uses a lookahead assertion to catch false matches\n // against integers early.\n \"decimal\": /-?(?=[0-9]*\\.|[0-9]+[eE])(([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,\n \"integer\": /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,\n \"identifier\": /[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,\n \"string\": /\"[^\"]*\"/y,\n \"whitespace\": /[\\t\\n\\r ]+/y,\n \"comment\": /((\\/(\\/.*|\\*([^*]|\\*[^/])*\\*\\/)[\\t\\n\\r ]*)+)/y,\n \"other\": /[^\\t\\n\\r 0-9A-Za-z]/y\n};\n\nexport const typeNameKeywords = [\n \"ArrayBuffer\",\n \"DataView\",\n \"Int8Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Uint8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8ClampedArray\",\n \"Float32Array\",\n \"Float64Array\",\n \"any\",\n \"object\",\n \"symbol\"\n];\n\nexport const stringTypes = [\n \"ByteString\",\n \"DOMString\",\n \"USVString\"\n];\n\nexport const argumentNameKeywords = [\n \"async\",\n \"attribute\",\n \"callback\",\n \"const\",\n \"constructor\",\n \"deleter\",\n \"dictionary\",\n \"enum\",\n \"getter\",\n \"includes\",\n \"inherit\",\n \"interface\",\n \"iterable\",\n \"maplike\",\n \"namespace\",\n \"partial\",\n \"required\",\n \"setlike\",\n \"setter\",\n \"static\",\n \"stringifier\",\n \"typedef\",\n \"unrestricted\"\n];\n\nconst nonRegexTerminals = [\n \"-Infinity\",\n \"FrozenArray\",\n \"Infinity\",\n \"NaN\",\n \"Promise\",\n \"boolean\",\n \"byte\",\n \"double\",\n \"false\",\n \"float\",\n \"long\",\n \"mixin\",\n \"null\",\n \"octet\",\n \"optional\",\n \"or\",\n \"readonly\",\n \"record\",\n \"sequence\",\n \"short\",\n \"true\",\n \"unsigned\",\n \"void\"\n].concat(argumentNameKeywords, stringTypes, typeNameKeywords);\n\nconst punctuations = [\n \"(\",\n \")\",\n \",\",\n \"...\",\n \":\",\n \";\",\n \"<\",\n \"=\",\n \">\",\n \"?\",\n \"[\",\n \"]\",\n \"{\",\n \"}\"\n];\n\nconst reserved = [\n // \"constructor\" is now a keyword\n \"_constructor\",\n \"toString\",\n \"_toString\",\n];\n\n/**\n * @typedef {ArrayItemType<ReturnType<typeof tokenise>>} Token\n * @param {string} str\n */\nfunction tokenise(str) {\n const tokens = [];\n let lastCharIndex = 0;\n let trivia = \"\";\n let line = 1;\n let index = 0;\n while (lastCharIndex < str.length) {\n const nextChar = str.charAt(lastCharIndex);\n let result = -1;\n\n if (/[\\t\\n\\r ]/.test(nextChar)) {\n result = attemptTokenMatch(\"whitespace\", { noFlushTrivia: true });\n } else if (nextChar === '/') {\n result = attemptTokenMatch(\"comment\", { noFlushTrivia: true });\n }\n\n if (result !== -1) {\n const currentTrivia = tokens.pop().value;\n line += (currentTrivia.match(/\\n/g) || []).length;\n trivia += currentTrivia;\n index -= 1;\n } else if (/[-0-9.A-Z_a-z]/.test(nextChar)) {\n result = attemptTokenMatch(\"decimal\");\n if (result === -1) {\n result = attemptTokenMatch(\"integer\");\n }\n if (result === -1) {\n result = attemptTokenMatch(\"identifier\");\n const lastIndex = tokens.length - 1;\n const token = tokens[lastIndex];\n if (result !== -1) {\n if (reserved.includes(token.value)) {\n const message = `${unescape(token.value)} is a reserved identifier and must not be used.`;\n throw new WebIDLParseError(syntaxError(tokens, lastIndex, null, message));\n } else if (nonRegexTerminals.includes(token.value)) {\n token.type = token.value;\n }\n }\n }\n } else if (nextChar === '\"') {\n result = attemptTokenMatch(\"string\");\n }\n\n for (const punctuation of punctuations) {\n if (str.startsWith(punctuation, lastCharIndex)) {\n tokens.push({ type: punctuation, value: punctuation, trivia, line, index });\n trivia = \"\";\n lastCharIndex += punctuation.length;\n result = lastCharIndex;\n break;\n }\n }\n\n // other as the last try\n if (result === -1) {\n result = attemptTokenMatch(\"other\");\n }\n if (result === -1) {\n throw new Error(\"Token stream not progressing\");\n }\n lastCharIndex = result;\n index += 1;\n }\n\n // remaining trivia as eof\n tokens.push({\n type: \"eof\",\n value: \"\",\n trivia\n });\n\n return tokens;\n\n /**\n * @param {keyof typeof tokenRe} type\n * @param {object} options\n * @param {boolean} [options.noFlushTrivia]\n */\n function attemptTokenMatch(type, { noFlushTrivia } = {}) {\n const re = tokenRe[type];\n re.lastIndex = lastCharIndex;\n const result = re.exec(str);\n if (result) {\n tokens.push({ type, value: result[0], trivia, line, index });\n if (!noFlushTrivia) {\n trivia = \"\";\n }\n return re.lastIndex;\n }\n return -1;\n }\n}\n\nexport class Tokeniser {\n /**\n * @param {string} idl\n */\n constructor(idl) {\n this.source = tokenise(idl);\n this.position = 0;\n }\n\n /**\n * @param {string} message\n * @return {never}\n */\n error(message) {\n throw new WebIDLParseError(syntaxError(this.source, this.position, this.current, message));\n }\n\n /**\n * @param {string} type\n */\n probe(type) {\n return this.source.length > this.position && this.source[this.position].type === type;\n }\n\n /**\n * @param {...string} candidates\n */\n consume(...candidates) {\n for (const type of candidates) {\n if (!this.probe(type)) continue;\n const token = this.source[this.position];\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {number} position\n */\n unconsume(position) {\n this.position = position;\n }\n}\n\nexport class WebIDLParseError extends Error {\n /**\n * @param {object} options\n * @param {string} options.message\n * @param {string} options.bareMessage\n * @param {string} options.context\n * @param {number} options.line\n * @param {*} options.sourceName\n * @param {string} options.input\n * @param {*[]} options.tokens\n */\n constructor({ message, bareMessage, context, line, sourceName, input, tokens }) {\n super(message);\n\n this.name = \"WebIDLParseError\"; // not to be mangled\n this.bareMessage = bareMessage;\n this.context = context;\n this.line = line;\n this.sourceName = sourceName;\n this.input = input;\n this.tokens = tokens;\n }\n}\n","import { list, unescape, autoParenter } from \"./helpers.js\";\nimport { Token } from \"./token.js\";\nimport { Base } from \"./base.js\";\n\nclass EnumValue extends Token {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consume(\"string\");\n if (value) {\n return new EnumValue({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"enum-value\";\n }\n get value() {\n return super.value.slice(1, -1);\n }\n}\n\nexport class Enum extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"enum\");\n if (!tokens.base) {\n return;\n }\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"No name for enum\");\n const ret = autoParenter(new Enum({ source: tokeniser.source, tokens }));\n tokeniser.current = ret.this;\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(\"Bodyless enum\");\n ret.values = list(tokeniser, {\n parser: EnumValue.parse,\n allowDangler: true,\n listName: \"enumeration\"\n });\n if (tokeniser.probe(\"string\")) {\n tokeniser.error(\"No comma between enum values\");\n }\n tokens.close = tokeniser.consume(\"}\") || tokeniser.error(\"Unexpected value in enum\");\n if (!ret.values.length) {\n tokeniser.error(\"No value in enum\");\n }\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"No semicolon after enum\");\n return ret.this;\n }\n\n get type() {\n return \"enum\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n}\n","// @ts-check\n\nimport { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Includes extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const target = tokeniser.consume(\"identifier\");\n if (!target) {\n return;\n }\n const tokens = { target };\n tokens.includes = tokeniser.consume(\"includes\");\n if (!tokens.includes) {\n tokeniser.unconsume(target.index);\n return;\n }\n tokens.mixin = tokeniser.consume(\"identifier\") || tokeniser.error(\"Incomplete includes statement\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"No terminating ; for includes statement\");\n return new Includes({ source: tokeniser.source, tokens });\n }\n\n get type() {\n return \"includes\";\n }\n get target() {\n return unescape(this.tokens.target.value);\n }\n get includes() {\n return unescape(this.tokens.mixin.value);\n }\n}\n","import { Base } from \"./base.js\";\nimport { type_with_extended_attributes, unescape, autoParenter } from \"./helpers.js\";\n\nexport class Typedef extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Typedef({ source: tokeniser.source, tokens }));\n tokens.base = tokeniser.consume(\"typedef\");\n if (!tokens.base) {\n return;\n }\n ret.idlType = type_with_extended_attributes(tokeniser, \"typedef-type\") || tokeniser.error(\"Typedef lacks a type\");\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"Typedef lacks a name\");\n tokeniser.current = ret.this;\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated typedef, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"typedef\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n}\n","import { Base } from \"./base.js\";\nimport { return_type, argument_list, unescape, autoParenter } from \"./helpers.js\";\n\nexport class CallbackFunction extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base) {\n const tokens = { base };\n const ret = autoParenter(new CallbackFunction({ source: tokeniser.source, tokens }));\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"Callback lacks a name\");\n tokeniser.current = ret.this;\n tokens.assign = tokeniser.consume(\"=\") || tokeniser.error(\"Callback lacks an assignment\");\n ret.idlType = return_type(tokeniser) || tokeniser.error(\"Callback lacks a return type\");\n tokens.open = tokeniser.consume(\"(\") || tokeniser.error(\"Callback lacks parentheses for arguments\");\n ret.arguments = argument_list(tokeniser);\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unterminated callback\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated callback, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"callback\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n}\n","import { Base } from \"./base.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { unescape, autoParenter } from \"./helpers.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction inheritance(tokeniser) {\n const colon = tokeniser.consume(\":\");\n if (!colon) {\n return {};\n }\n const inheritance = tokeniser.consume(\"identifier\") || tokeniser.error(\"Inheritance lacks a type\");\n return { colon, inheritance };\n}\n\nexport class Container extends Base {\n /**\n * @template T\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {T} instance\n * @param {*} args\n */\n static parse(tokeniser, instance, { type, inheritable, allowedMembers }) {\n const { tokens } = instance;\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(`Missing name in ${instance.type}`);\n tokeniser.current = instance;\n instance = autoParenter(instance);\n if (inheritable) {\n Object.assign(tokens, inheritance(tokeniser));\n }\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(`Bodyless ${type}`);\n instance.members = [];\n while (true) {\n tokens.close = tokeniser.consume(\"}\");\n if (tokens.close) {\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(`Missing semicolon after ${type}`);\n return instance.this;\n }\n const ea = ExtendedAttributes.parse(tokeniser);\n let mem;\n for (const [parser, ...args] of allowedMembers) {\n mem = autoParenter(parser(tokeniser, ...args));\n if (mem) {\n break;\n }\n }\n if (!mem) {\n tokeniser.error(\"Unknown member\");\n }\n mem.extAttrs = ea;\n instance.members.push(mem.this);\n }\n }\n\n get partial() {\n return !!this.tokens.partial;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get inheritance() {\n if (!this.tokens.inheritance) {\n return null;\n }\n return unescape(this.tokens.inheritance.value);\n }\n\n *validate(defs) {\n for (const member of this.members) {\n if (member.validate) {\n yield* member.validate(defs);\n }\n }\n }\n }\n","import { Base } from \"./base.js\";\nimport { Type } from \"./type.js\";\nimport { const_data, const_value, primitive_type, autoParenter, unescape } from \"./helpers.js\";\n\nexport class Constant extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"const\");\n if (!tokens.base) {\n return;\n }\n let idlType = primitive_type(tokeniser);\n if (!idlType) {\n const base = tokeniser.consume(\"identifier\") || tokeniser.error(\"Const lacks a type\");\n idlType = new Type({ source: tokeniser.source, tokens: { base } });\n }\n if (tokeniser.probe(\"?\")) {\n tokeniser.error(\"Unexpected nullable constant type\");\n }\n idlType.type = \"const-type\";\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"Const lacks a name\");\n tokens.assign = tokeniser.consume(\"=\") || tokeniser.error(\"Const lacks value assignment\");\n tokens.value = const_value(tokeniser) || tokeniser.error(\"Const lacks a value\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated const, expected `;`\");\n const ret = new Constant({ source: tokeniser.source, tokens });\n autoParenter(ret).idlType = idlType;\n return ret;\n }\n\n get type() {\n return \"const\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get value() {\n return const_data(this.tokens.value);\n }\n}\n","import { Base } from \"./base.js\";\nimport { type_with_extended_attributes, autoParenter } from \"./helpers.js\";\n\nexport class IterableLike extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n const tokens = {};\n const ret = autoParenter(new IterableLike({ source: tokeniser.source, tokens }));\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (!tokens.readonly) {\n tokens.async = tokeniser.consume(\"async\");\n }\n tokens.base =\n tokens.readonly ? tokeniser.consume(\"maplike\", \"setlike\") :\n tokens.async ? tokeniser.consume(\"iterable\") :\n tokeniser.consume(\"iterable\", \"maplike\", \"setlike\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n\n const { type } = ret;\n const secondTypeRequired = type === \"maplike\" || ret.async;\n const secondTypeAllowed = secondTypeRequired || type === \"iterable\";\n\n tokens.open = tokeniser.consume(\"<\") || tokeniser.error(`Missing less-than sign \\`<\\` in ${type} declaration`);\n const first = type_with_extended_attributes(tokeniser) || tokeniser.error(`Missing a type argument in ${type} declaration`);\n ret.idlType = [first];\n if (secondTypeAllowed) {\n first.tokens.separator = tokeniser.consume(\",\");\n if (first.tokens.separator) {\n ret.idlType.push(type_with_extended_attributes(tokeniser));\n }\n else if (secondTypeRequired) {\n tokeniser.error(`Missing second type argument in ${type} declaration`);\n }\n }\n tokens.close = tokeniser.consume(\">\") || tokeniser.error(`Missing greater-than sign \\`>\\` in ${type} declaration`);\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(`Missing semicolon after ${type} declaration`);\n\n return ret.this;\n }\n\n get type() {\n return this.tokens.base.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get async() {\n return !!this.tokens.async;\n }\n}\n","// @ts-check\n\nimport { validationError } from \"../error.js\";\n\nexport function* checkInterfaceMemberDuplication(defs, i) {\n const opNames = new Set(getOperations(i).map(op => op.name));\n const partials = defs.partials.get(i.name) || [];\n const mixins = defs.mixinMap.get(i.name) || [];\n for (const ext of [...partials, ...mixins]) {\n const additions = getOperations(ext);\n yield* forEachExtension(additions, opNames, ext, i);\n for (const addition of additions) {\n opNames.add(addition.name);\n }\n }\n\n function* forEachExtension(additions, existings, ext, base) {\n for (const addition of additions) {\n const { name } = addition;\n if (name && existings.has(name)) {\n const message = `The operation \"${name}\" has already been defined for the base interface \"${base.name}\" either in itself or in a mixin`;\n yield validationError(addition.tokens.name, ext, \"no-cross-overload\", message);\n }\n }\n }\n\n function getOperations(i) {\n return i.members\n .filter(({type}) => type === \"operation\");\n }\n}\n","import { Base } from \"./base.js\";\nimport { argument_list, autoParenter } from \"./helpers.js\";\n\nexport class Constructor extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const base = tokeniser.consume(\"constructor\");\n if (!base) {\n return;\n }\n /** @type {Base[\"tokens\"]} */\n const tokens = { base };\n tokens.open = tokeniser.consume(\"(\") || tokeniser.error(\"No argument list in constructor\");\n const args = argument_list(tokeniser);\n tokens.close = tokeniser.consume(\")\") || tokeniser.error(\"Unterminated constructor\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"No semicolon after constructor\");\n const ret = new Constructor({ source: tokeniser.source, tokens });\n autoParenter(ret).arguments = args;\n return ret;\n }\n\n get type() {\n return \"constructor\";\n }\n\n *validate(defs) {\n if (this.idlType) {\n yield* this.idlType.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\nimport { IterableLike } from \"./iterable.js\";\nimport { stringifier, autofixAddExposedWindow, getMemberIndentation, getLastIndentation, getFirstToken, findLastIndex, autoParenter } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\nimport { checkInterfaceMemberDuplication } from \"../validators/interface.js\";\nimport { Constructor } from \"./constructor.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nfunction static_member(tokeniser) {\n const special = tokeniser.consume(\"static\");\n if (!special) return;\n const member = Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"No body in static member\");\n return member;\n}\n\nexport class Interface extends Container {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base, { partial = null } = {}) {\n const tokens = { partial, base };\n return Container.parse(tokeniser, new Interface({ source: tokeniser.source, tokens }), {\n type: \"interface\",\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Constructor.parse],\n [static_member],\n [stringifier],\n [IterableLike.parse],\n [Attribute.parse],\n [Operation.parse]\n ]\n });\n }\n\n get type() {\n return \"interface\";\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (\n !this.partial &&\n this.extAttrs.every(extAttr => extAttr.name !== \"Exposed\") &&\n this.extAttrs.every(extAttr => extAttr.name !== \"NoInterfaceObject\")\n ) {\n const message = `Interfaces must have \\`[Exposed]\\` extended attribute. \\\nTo fix, add, for example, \\`[Exposed=Window]\\`. Please also consider carefully \\\nif your interface should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(this.tokens.name, this, \"require-exposed\", message, {\n autofix: autofixAddExposedWindow(this)\n });\n }\n const oldConstructors = this.extAttrs.filter(extAttr => extAttr.name === \"Constructor\");\n for (const constructor of oldConstructors) {\n const message = `Constructors should now be represented as a \\`constructor()\\` operation on the interface \\\ninstead of \\`[Constructor]\\` extended attribute. Refer to the \\\n[WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) \\\nfor more information.`;\n yield validationError(constructor.tokens.name, this, \"constructor-member\", message, {\n autofix: autofixConstructor(this, constructor)\n });\n }\n\n const isGlobal = this.extAttrs.some(extAttr => extAttr.name === \"Global\");\n if (isGlobal) {\n const namedConstructors = this.extAttrs.filter(extAttr => extAttr.name === \"NamedConstructor\");\n for (const named of namedConstructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have named constructors.`;\n yield validationError(named.tokens.name, this, \"no-constructible-global\", message);\n }\n\n const constructors = this.members.filter(member => member.type === \"constructor\");\n for (const named of constructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have constructors.`;\n yield validationError(named.tokens.base, this, \"no-constructible-global\", message);\n }\n }\n\n yield* super.validate(defs);\n if (!this.partial) {\n yield* checkInterfaceMemberDuplication(defs, this);\n }\n }\n}\n\nfunction autofixConstructor(interfaceDef, constructorExtAttr) {\n interfaceDef = autoParenter(interfaceDef);\n return () => {\n const indentation = getLastIndentation(interfaceDef.extAttrs.tokens.open.trivia);\n const memberIndent = interfaceDef.members.length ?\n getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia) :\n getMemberIndentation(indentation);\n const constructorOp = Constructor.parse(new Tokeniser(`\\n${memberIndent}constructor();`));\n constructorOp.extAttrs = [];\n autoParenter(constructorOp).arguments = constructorExtAttr.arguments;\n\n const existingIndex = findLastIndex(interfaceDef.members, m => m.type === \"constructor\");\n interfaceDef.members.splice(existingIndex + 1, 0, constructorOp);\n\n const { close } = interfaceDef.tokens;\n if (!close.trivia.includes(\"\\n\")) {\n close.trivia += `\\n${indentation}`;\n }\n\n const { extAttrs } = interfaceDef;\n const index = extAttrs.indexOf(constructorExtAttr);\n const removed = extAttrs.splice(index, 1);\n if (!extAttrs.length) {\n extAttrs.tokens.open = extAttrs.tokens.close = undefined;\n } else if (extAttrs.length === index) {\n extAttrs[index - 1].tokens.separator = undefined;\n } else if (!extAttrs[index].tokens.name.trivia.trim()) {\n extAttrs[index].tokens.name.trivia = removed[0].tokens.name.trivia;\n }\n };\n}\n","import { Container } from \"./container.js\";\nimport { Constant } from \"./constant.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { stringifier } from \"./helpers.js\";\n\nexport class Mixin extends Container {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {Token} base\n * @param {object} [options]\n * @param {Token} [options.partial]\n */\n static parse(tokeniser, base, { partial } = {}) {\n const tokens = { partial, base };\n tokens.mixin = tokeniser.consume(\"mixin\");\n if (!tokens.mixin) {\n return;\n }\n return Container.parse(tokeniser, new Mixin({ source: tokeniser.source, tokens }), {\n type: \"interface mixin\",\n allowedMembers: [\n [Constant.parse],\n [stringifier],\n [Attribute.parse, { noInherit: true }],\n [Operation.parse, { regular: true }]\n ]\n });\n }\n\n get type() {\n return \"interface mixin\";\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape, type_with_extended_attributes, autoParenter } from \"./helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { Default } from \"./default.js\";\n\nexport class Field extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Field({ source: tokeniser.source, tokens }));\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.required = tokeniser.consume(\"required\");\n ret.idlType = type_with_extended_attributes(tokeniser, \"dictionary-type\") || tokeniser.error(\"Dictionary member lacks a type\");\n tokens.name = tokeniser.consume(\"identifier\") || tokeniser.error(\"Dictionary member lacks a name\");\n ret.default = Default.parse(tokeniser);\n if (tokens.required && ret.default) tokeniser.error(\"Required member must not have a default\");\n tokens.termination = tokeniser.consume(\";\") || tokeniser.error(\"Unterminated dictionary member, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"field\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get required() {\n return !!this.tokens.required;\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n}\n","// @ts-check\n\nimport { Container } from \"./container.js\";\nimport { Field } from \"./field.js\";\n\nexport class Dictionary extends Container {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"dictionary\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(tokeniser, new Dictionary({ source: tokeniser.source, tokens }), {\n type: \"dictionary\",\n inheritable: !partial,\n allowedMembers: [\n [Field.parse],\n ]\n });\n }\n\n get type() {\n return \"dictionary\";\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { validationError } from \"../error.js\";\nimport { autofixAddExposedWindow } from \"./helpers.js\";\n\nexport class Namespace extends Container {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"namespace\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(tokeniser, new Namespace({ source: tokeniser.source, tokens }), {\n type: \"namespace\",\n allowedMembers: [\n [Attribute.parse, { noInherit: true, readonly: true }],\n [Operation.parse, { regular: true }]\n ]\n });\n }\n\n get type() {\n return \"namespace\";\n }\n\n *validate(defs) {\n if (!this.partial && this.extAttrs.every(extAttr => extAttr.name !== \"Exposed\")) {\n const message = `Namespaces must have [Exposed] extended attribute. \\\nTo fix, add, for example, [Exposed=Window]. Please also consider carefully \\\nif your namespace should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(this.tokens.name, this, \"require-exposed\", message, {\n autofix: autofixAddExposedWindow(this)\n });\n }\n yield* super.validate(defs);\n }\n}\n","// @ts-check\n\nimport { Container } from \"./container.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class CallbackInterface extends Container {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser, callback, { partial = null } = {}) {\n const tokens = { callback };\n tokens.base = tokeniser.consume(\"interface\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(tokeniser, new CallbackInterface({ source: tokeniser.source, tokens }), {\n type: \"callback interface\",\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Operation.parse, { regular: true }]\n ]\n });\n }\n\n get type() {\n return \"callback interface\";\n }\n}\n","\"use strict\";\n\nimport { Tokeniser } from \"./tokeniser.js\";\nimport { Enum } from \"./productions/enum.js\";\nimport { Includes } from \"./productions/includes.js\";\nimport { ExtendedAttributes } from \"./productions/extended-attributes.js\";\nimport { Typedef } from \"./productions/typedef.js\";\nimport { CallbackFunction } from \"./productions/callback.js\";\nimport { Interface } from \"./productions/interface.js\";\nimport { Mixin } from \"./productions/mixin.js\";\nimport { Dictionary } from \"./productions/dictionary.js\";\nimport { Namespace } from \"./productions/namespace.js\";\nimport { CallbackInterface } from \"./productions/callback-interface.js\";\nimport { autoParenter } from \"./productions/helpers.js\";\n\n/**\n * @param {Tokeniser} tokeniser\n * @param {object} options\n * @param {boolean} [options.concrete]\n */\nfunction parseByTokens(tokeniser, options) {\n const source = tokeniser.source;\n\n function error(str) {\n tokeniser.error(str);\n }\n\n function consume(...candidates) {\n return tokeniser.consume(...candidates);\n }\n\n function callback() {\n const callback = consume(\"callback\");\n if (!callback) return;\n if (tokeniser.probe(\"interface\")) {\n return CallbackInterface.parse(tokeniser, callback);\n }\n return CallbackFunction.parse(tokeniser, callback);\n }\n\n function interface_(opts) {\n const base = consume(\"interface\");\n if (!base) return;\n const ret = Mixin.parse(tokeniser, base, opts) ||\n Interface.parse(tokeniser, base, opts) ||\n error(\"Interface has no proper body\");\n return ret;\n }\n\n function partial() {\n const partial = consume(\"partial\");\n if (!partial) return;\n return Dictionary.parse(tokeniser, { partial }) ||\n interface_({ partial }) ||\n Namespace.parse(tokeniser, { partial }) ||\n error(\"Partial doesn't apply to anything\");\n }\n\n function definition() {\n return callback() ||\n interface_() ||\n partial() ||\n Dictionary.parse(tokeniser) ||\n Enum.parse(tokeniser) ||\n Typedef.parse(tokeniser) ||\n Includes.parse(tokeniser) ||\n Namespace.parse(tokeniser);\n }\n\n function definitions() {\n if (!source.length) return [];\n const defs = [];\n while (true) {\n const ea = ExtendedAttributes.parse(tokeniser);\n const def = definition();\n if (!def) {\n if (ea.length) error(\"Stray extended attributes\");\n break;\n }\n autoParenter(def).extAttrs = ea;\n defs.push(def);\n }\n const eof = consume(\"eof\");\n if (options.concrete) {\n defs.push(eof);\n }\n return defs;\n }\n const res = definitions();\n if (tokeniser.position < source.length) error(\"Unrecognised tokens\");\n return res;\n}\n\n/**\n * @param {string} str\n * @param {object} [options]\n * @param {*} [options.sourceName]\n * @param {boolean} [options.concrete]\n */\nexport function parse(str, options = {}) {\n const tokeniser = new Tokeniser(str);\n if (typeof options.sourceName !== \"undefined\") {\n tokeniser.source.name = options.sourceName;\n }\n return parseByTokens(tokeniser, options);\n}\n","\"use strict\";\n\nfunction noop(arg) {\n return arg;\n}\n\nconst templates = {\n wrap: items => items.join(\"\"),\n trivia: noop,\n name: noop,\n reference: noop,\n type: noop,\n generic: noop,\n nameless: noop,\n inheritance: noop,\n definition: noop,\n extendedAttribute: noop,\n extendedAttributeReference: noop\n};\n\nexport function write(ast, { templates: ts = templates } = {}) {\n ts = Object.assign({}, templates, ts);\n\n function reference(raw, { unescaped, context }) {\n if (!unescaped) {\n unescaped = raw.startsWith(\"_\") ? raw.slice(1) : raw;\n }\n return ts.reference(raw, unescaped, context);\n }\n\n function token(t, wrapper = noop, ...args) {\n if (!t) {\n return \"\";\n }\n const value = wrapper(t.value, ...args);\n return ts.wrap([ts.trivia(t.trivia), value]);\n }\n\n function reference_token(t, context) {\n return token(t, reference, { context });\n }\n\n function name_token(t, arg) {\n return token(t, ts.name, arg);\n }\n\n function type_body(it) {\n if (it.union || it.generic) {\n return ts.wrap([\n token(it.tokens.base, ts.generic),\n token(it.tokens.open),\n ...it.subtype.map(type),\n token(it.tokens.close)\n ]);\n }\n const firstToken = it.tokens.prefix || it.tokens.base;\n const prefix = it.tokens.prefix ? [\n it.tokens.prefix.value,\n ts.trivia(it.tokens.base.trivia)\n ] : [];\n const ref = reference(ts.wrap([\n ...prefix,\n it.tokens.base.value,\n token(it.tokens.postfix)\n ]), { unescaped: it.idlType, context: it });\n return ts.wrap([ts.trivia(firstToken.trivia), ref]);\n }\n function type(it) {\n return ts.wrap([\n extended_attributes(it.extAttrs),\n type_body(it),\n token(it.tokens.nullable),\n token(it.tokens.separator)\n ]);\n }\n function default_(def) {\n if (!def) {\n return \"\";\n }\n return ts.wrap([\n token(def.tokens.assign),\n ...def.expression.map(t => token(t))\n ]);\n }\n function argument(arg) {\n return ts.wrap([\n extended_attributes(arg.extAttrs),\n token(arg.tokens.optional),\n ts.type(type(arg.idlType)),\n token(arg.tokens.variadic),\n name_token(arg.tokens.name, { data: arg }),\n default_(arg.default),\n token(arg.tokens.separator)\n ]);\n }\n function string(str) {\n return ts.wrap([\n token(str.tokens.value),\n token(str.tokens.separator)\n ]);\n }\n function identifier(id, context) {\n return ts.wrap([\n reference_token(id.tokens.value, context),\n token(id.tokens.separator)\n ]);\n }\n function make_ext_at(it) {\n const { rhsType } = it.params;\n return ts.wrap([\n ts.trivia(it.tokens.name.trivia),\n ts.extendedAttribute(ts.wrap([\n ts.extendedAttributeReference(it.name),\n token(it.params.tokens.assign),\n reference_token(it.params.tokens.secondaryName, it),\n token(it.params.tokens.open),\n ...!it.params.list ? [] :\n it.params.list.map(\n rhsType === \"identifier-list\" ? id => identifier(id, it) :\n rhsType === \"string-list\" ? string :\n argument\n ),\n token(it.params.tokens.close)\n ])),\n token(it.tokens.separator)\n ]);\n }\n function extended_attributes(eats) {\n if (!eats.length) return \"\";\n return ts.wrap([\n token(eats.tokens.open),\n ...eats.map(make_ext_at),\n token(eats.tokens.close)\n ]);\n }\n\n function operation(it, parent) {\n const body = it.idlType ? [\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it, parent }),\n token(it.tokens.open),\n ts.wrap(it.arguments.map(argument)),\n token(it.tokens.close),\n ] : [];\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n it.tokens.name ? token(it.tokens.special) : token(it.tokens.special, ts.nameless, { data: it, parent }),\n ...body,\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n\n function attribute(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.special),\n token(it.tokens.readonly),\n token(it.tokens.base),\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it, parent }),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n\n function constructor(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base, ts.nameless, { data: it, parent }),\n token(it.tokens.open),\n ts.wrap(it.arguments.map(argument)),\n token(it.tokens.close),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n\n function inheritance(inh) {\n if (!inh.tokens.inheritance) {\n return \"\";\n }\n return ts.wrap([\n token(inh.tokens.colon),\n ts.trivia(inh.tokens.inheritance.trivia),\n ts.inheritance(reference(inh.tokens.inheritance.value, { context: inh }))\n ]);\n }\n\n function container(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.callback),\n token(it.tokens.partial),\n token(it.tokens.base),\n token(it.tokens.mixin),\n name_token(it.tokens.name, { data: it }),\n inheritance(it),\n token(it.tokens.open),\n iterate(it.members, it),\n token(it.tokens.close),\n token(it.tokens.termination)\n ]), { data: it });\n }\n\n function field(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.required),\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it, parent }),\n default_(it.default),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n function const_(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base),\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it, parent }),\n token(it.tokens.assign),\n token(it.tokens.value),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n function typedef(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base),\n ts.type(type(it.idlType)),\n name_token(it.tokens.name, { data: it }),\n token(it.tokens.termination)\n ]), { data: it });\n }\n function includes(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n reference_token(it.tokens.target, it),\n token(it.tokens.includes),\n reference_token(it.tokens.mixin, it),\n token(it.tokens.termination)\n ]), { data: it });\n }\n function callback(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base),\n name_token(it.tokens.name, { data: it }),\n token(it.tokens.assign),\n ts.type(type(it.idlType)),\n token(it.tokens.open),\n ...it.arguments.map(argument),\n token(it.tokens.close),\n token(it.tokens.termination),\n ]), { data: it });\n }\n function enum_(it) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.base),\n name_token(it.tokens.name, { data: it }),\n token(it.tokens.open),\n iterate(it.values, it),\n token(it.tokens.close),\n token(it.tokens.termination)\n ]), { data: it });\n }\n function enum_value(v, parent) {\n return ts.wrap([\n ts.trivia(v.tokens.value.trivia),\n ts.definition(\n ts.wrap(['\"', ts.name(v.value, { data: v, parent }), '\"']),\n { data: v, parent }\n ),\n token(v.tokens.separator)\n ]);\n }\n function iterable_like(it, parent) {\n return ts.definition(ts.wrap([\n extended_attributes(it.extAttrs),\n token(it.tokens.readonly),\n token(it.tokens.async),\n token(it.tokens.base, ts.generic),\n token(it.tokens.open),\n ts.wrap(it.idlType.map(type)),\n token(it.tokens.close),\n token(it.tokens.termination)\n ]), { data: it, parent });\n }\n function eof(it) {\n return ts.trivia(it.trivia);\n }\n\n const table = {\n interface: container,\n \"interface mixin\": container,\n namespace: container,\n operation,\n attribute,\n constructor,\n dictionary: container,\n field,\n const: const_,\n typedef,\n includes,\n callback,\n enum: enum_,\n \"enum-value\": enum_value,\n iterable: iterable_like,\n maplike: iterable_like,\n setlike: iterable_like,\n \"callback interface\": container,\n eof\n };\n function dispatch(it, parent) {\n const dispatcher = table[it.type];\n if (!dispatcher) {\n throw new Error(`Type \"${it.type}\" is unsupported`);\n }\n return table[it.type](it, parent);\n }\n function iterate(things, parent) {\n if (!things) return;\n const results = things.map(thing => dispatch(thing, parent));\n return ts.wrap(results);\n }\n return iterate(ast);\n}\n","\"use strict\";\n\nimport { validationError as error } from \"./error.js\";\n\nfunction getMixinMap(all, unique) {\n const map = new Map();\n const includes = all.filter(def => def.type === \"includes\");\n for (const include of includes) {\n const mixin = unique.get(include.includes);\n if (!mixin) {\n continue;\n }\n const array = map.get(include.target);\n if (array) {\n array.push(mixin);\n } else {\n map.set(include.target, [mixin]);\n }\n }\n return map;\n}\n\n/**\n * @typedef {ReturnType<typeof groupDefinitions>} Definitions\n */\nfunction groupDefinitions(all) {\n const unique = new Map();\n const duplicates = new Set();\n const partials = new Map();\n for (const def of all) {\n if (def.partial) {\n const array = partials.get(def.name);\n if (array) {\n array.push(def);\n } else {\n partials.set(def.name, [def]);\n }\n continue;\n }\n if (!def.name) {\n continue;\n }\n if (!unique.has(def.name)) {\n unique.set(def.name, def);\n } else {\n duplicates.add(def);\n }\n }\n return {\n all,\n unique,\n partials,\n duplicates,\n mixinMap: getMixinMap(all, unique),\n cache: {\n typedefIncludesDictionary: new WeakMap(),\n dictionaryIncludesRequiredField: new WeakMap()\n },\n };\n}\n\nfunction* checkDuplicatedNames({ unique, duplicates }) {\n for (const dup of duplicates) {\n const { name } = dup;\n const message = `The name \"${name}\" of type \"${unique.get(name).type}\" was already seen`;\n yield error(dup.tokens.name, dup, \"no-duplicate\", message);\n }\n}\n\nfunction* validateIterable(ast) {\n const defs = groupDefinitions(ast);\n for (const def of defs.all) {\n if (def.validate) {\n yield* def.validate(defs);\n }\n }\n yield* checkDuplicatedNames(defs);\n}\n\n// Remove this once all of our support targets expose `.flat()` by default\nfunction flatten(array) {\n if (array.flat) {\n return array.flat();\n }\n return [].concat(...array);\n}\n\n/**\n * @param {*} ast AST or array of ASTs\n */\nexport function validate(ast) {\n return [...validateIterable(flatten(ast))];\n}\n","var hyperscriptAttributeToProperty = attributeToProperty;\n\nvar transform = {\n 'class': 'className',\n 'for': 'htmlFor',\n 'http-equiv': 'httpEquiv'\n};\n\nfunction attributeToProperty (h) {\n return function (tagName, attrs, children) {\n for (var attr in attrs) {\n if (attr in transform) {\n attrs[transform[attr]] = attrs[attr];\n delete attrs[attr];\n }\n }\n return h(tagName, attrs, children)\n }\n}\n\nvar VAR = 0, TEXT = 1, OPEN = 2, CLOSE = 3, ATTR = 4;\nvar ATTR_KEY = 5, ATTR_KEY_W = 6;\nvar ATTR_VALUE_W = 7, ATTR_VALUE = 8;\nvar ATTR_VALUE_SQ = 9, ATTR_VALUE_DQ = 10;\nvar ATTR_EQ = 11, ATTR_BREAK = 12;\nvar COMMENT = 13;\n\nvar hyperx = function (h, opts) {\n if (!opts) opts = {};\n var concat = opts.concat || function (a, b) {\n return String(a) + String(b)\n };\n if (opts.attrToProp !== false) {\n h = hyperscriptAttributeToProperty(h);\n }\n\n return function (strings) {\n var state = TEXT, reg = '';\n var arglen = arguments.length;\n var parts = [];\n\n for (var i = 0; i < strings.length; i++) {\n if (i < arglen - 1) {\n var arg = arguments[i+1];\n var p = parse(strings[i]);\n var xstate = state;\n if (xstate === ATTR_VALUE_DQ) xstate = ATTR_VALUE;\n if (xstate === ATTR_VALUE_SQ) xstate = ATTR_VALUE;\n if (xstate === ATTR_VALUE_W) xstate = ATTR_VALUE;\n if (xstate === ATTR) xstate = ATTR_KEY;\n if (xstate === OPEN) {\n if (reg === '/') {\n p.push([ OPEN, '/', arg ]);\n reg = '';\n } else {\n p.push([ OPEN, arg ]);\n }\n } else if (xstate === COMMENT && opts.comments) {\n reg += String(arg);\n } else if (xstate !== COMMENT) {\n p.push([ VAR, xstate, arg ]);\n }\n parts.push.apply(parts, p);\n } else parts.push.apply(parts, parse(strings[i]));\n }\n\n var tree = [null,{},[]];\n var stack = [[tree,-1]];\n for (var i = 0; i < parts.length; i++) {\n var cur = stack[stack.length-1][0];\n var p = parts[i], s = p[0];\n if (s === OPEN && /^\\//.test(p[1])) {\n var ix = stack[stack.length-1][1];\n if (stack.length > 1) {\n stack.pop();\n stack[stack.length-1][0][2][ix] = h(\n cur[0], cur[1], cur[2].length ? cur[2] : undefined\n );\n }\n } else if (s === OPEN) {\n var c = [p[1],{},[]];\n cur[2].push(c);\n stack.push([c,cur[2].length-1]);\n } else if (s === ATTR_KEY || (s === VAR && p[1] === ATTR_KEY)) {\n var key = '';\n var copyKey;\n for (; i < parts.length; i++) {\n if (parts[i][0] === ATTR_KEY) {\n key = concat(key, parts[i][1]);\n } else if (parts[i][0] === VAR && parts[i][1] === ATTR_KEY) {\n if (typeof parts[i][2] === 'object' && !key) {\n for (copyKey in parts[i][2]) {\n if (parts[i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) {\n cur[1][copyKey] = parts[i][2][copyKey];\n }\n }\n } else {\n key = concat(key, parts[i][2]);\n }\n } else break\n }\n if (parts[i][0] === ATTR_EQ) i++;\n var j = i;\n for (; i < parts.length; i++) {\n if (parts[i][0] === ATTR_VALUE || parts[i][0] === ATTR_KEY) {\n if (!cur[1][key]) cur[1][key] = strfn(parts[i][1]);\n else parts[i][1]===\"\" || (cur[1][key] = concat(cur[1][key], parts[i][1]));\n } else if (parts[i][0] === VAR\n && (parts[i][1] === ATTR_VALUE || parts[i][1] === ATTR_KEY)) {\n if (!cur[1][key]) cur[1][key] = strfn(parts[i][2]);\n else parts[i][2]===\"\" || (cur[1][key] = concat(cur[1][key], parts[i][2]));\n } else {\n if (key.length && !cur[1][key] && i === j\n && (parts[i][0] === CLOSE || parts[i][0] === ATTR_BREAK)) {\n // https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes\n // empty string is falsy, not well behaved value in browser\n cur[1][key] = key.toLowerCase();\n }\n if (parts[i][0] === CLOSE) {\n i--;\n }\n break\n }\n }\n } else if (s === ATTR_KEY) {\n cur[1][p[1]] = true;\n } else if (s === VAR && p[1] === ATTR_KEY) {\n cur[1][p[2]] = true;\n } else if (s === CLOSE) {\n if (selfClosing(cur[0]) && stack.length) {\n var ix = stack[stack.length-1][1];\n stack.pop();\n stack[stack.length-1][0][2][ix] = h(\n cur[0], cur[1], cur[2].length ? cur[2] : undefined\n );\n }\n } else if (s === VAR && p[1] === TEXT) {\n if (p[2] === undefined || p[2] === null) p[2] = '';\n else if (!p[2]) p[2] = concat('', p[2]);\n if (Array.isArray(p[2][0])) {\n cur[2].push.apply(cur[2], p[2]);\n } else {\n cur[2].push(p[2]);\n }\n } else if (s === TEXT) {\n cur[2].push(p[1]);\n } else if (s === ATTR_EQ || s === ATTR_BREAK) ; else {\n throw new Error('unhandled: ' + s)\n }\n }\n\n if (tree[2].length > 1 && /^\\s*$/.test(tree[2][0])) {\n tree[2].shift();\n }\n\n if (tree[2].length > 2\n || (tree[2].length === 2 && /\\S/.test(tree[2][1]))) {\n if (opts.createFragment) return opts.createFragment(tree[2])\n throw new Error(\n 'multiple root elements must be wrapped in an enclosing tag'\n )\n }\n if (Array.isArray(tree[2][0]) && typeof tree[2][0][0] === 'string'\n && Array.isArray(tree[2][0][2])) {\n tree[2][0] = h(tree[2][0][0], tree[2][0][1], tree[2][0][2]);\n }\n return tree[2][0]\n\n function parse (str) {\n var res = [];\n if (state === ATTR_VALUE_W) state = ATTR;\n for (var i = 0; i < str.length; i++) {\n var c = str.charAt(i);\n if (state === TEXT && c === '<') {\n if (reg.length) res.push([TEXT, reg]);\n reg = '';\n state = OPEN;\n } else if (c === '>' && !quot(state) && state !== COMMENT) {\n if (state === OPEN && reg.length) {\n res.push([OPEN,reg]);\n } else if (state === ATTR_KEY) {\n res.push([ATTR_KEY,reg]);\n } else if (state === ATTR_VALUE && reg.length) {\n res.push([ATTR_VALUE,reg]);\n }\n res.push([CLOSE]);\n reg = '';\n state = TEXT;\n } else if (state === COMMENT && /-$/.test(reg) && c === '-') {\n if (opts.comments) {\n res.push([ATTR_VALUE,reg.substr(0, reg.length - 1)]);\n }\n reg = '';\n state = TEXT;\n } else if (state === OPEN && /^!--$/.test(reg)) {\n if (opts.comments) {\n res.push([OPEN, reg],[ATTR_KEY,'comment'],[ATTR_EQ]);\n }\n reg = c;\n state = COMMENT;\n } else if (state === TEXT || state === COMMENT) {\n reg += c;\n } else if (state === OPEN && c === '/' && reg.length) ; else if (state === OPEN && /\\s/.test(c)) {\n if (reg.length) {\n res.push([OPEN, reg]);\n }\n reg = '';\n state = ATTR;\n } else if (state === OPEN) {\n reg += c;\n } else if (state === ATTR && /[^\\s\"'=/]/.test(c)) {\n state = ATTR_KEY;\n reg = c;\n } else if (state === ATTR && /\\s/.test(c)) {\n if (reg.length) res.push([ATTR_KEY,reg]);\n res.push([ATTR_BREAK]);\n } else if (state === ATTR_KEY && /\\s/.test(c)) {\n res.push([ATTR_KEY,reg]);\n reg = '';\n state = ATTR_KEY_W;\n } else if (state === ATTR_KEY && c === '=') {\n res.push([ATTR_KEY,reg],[ATTR_EQ]);\n reg = '';\n state = ATTR_VALUE_W;\n } else if (state === ATTR_KEY) {\n reg += c;\n } else if ((state === ATTR_KEY_W || state === ATTR) && c === '=') {\n res.push([ATTR_EQ]);\n state = ATTR_VALUE_W;\n } else if ((state === ATTR_KEY_W || state === ATTR) && !/\\s/.test(c)) {\n res.push([ATTR_BREAK]);\n if (/[\\w-]/.test(c)) {\n reg += c;\n state = ATTR_KEY;\n } else state = ATTR;\n } else if (state === ATTR_VALUE_W && c === '\"') {\n state = ATTR_VALUE_DQ;\n } else if (state === ATTR_VALUE_W && c === \"'\") {\n state = ATTR_VALUE_SQ;\n } else if (state === ATTR_VALUE_DQ && c === '\"') {\n res.push([ATTR_VALUE,reg],[ATTR_BREAK]);\n reg = '';\n state = ATTR;\n } else if (state === ATTR_VALUE_SQ && c === \"'\") {\n res.push([ATTR_VALUE,reg],[ATTR_BREAK]);\n reg = '';\n state = ATTR;\n } else if (state === ATTR_VALUE_W && !/\\s/.test(c)) {\n state = ATTR_VALUE;\n i--;\n } else if (state === ATTR_VALUE && /\\s/.test(c)) {\n res.push([ATTR_VALUE,reg],[ATTR_BREAK]);\n reg = '';\n state = ATTR;\n } else if (state === ATTR_VALUE || state === ATTR_VALUE_SQ\n || state === ATTR_VALUE_DQ) {\n reg += c;\n }\n }\n if (state === TEXT && reg.length) {\n res.push([TEXT,reg]);\n reg = '';\n } else if (state === ATTR_VALUE && reg.length) {\n res.push([ATTR_VALUE,reg]);\n reg = '';\n } else if (state === ATTR_VALUE_DQ && reg.length) {\n res.push([ATTR_VALUE,reg]);\n reg = '';\n } else if (state === ATTR_VALUE_SQ && reg.length) {\n res.push([ATTR_VALUE,reg]);\n reg = '';\n } else if (state === ATTR_KEY) {\n res.push([ATTR_KEY,reg]);\n reg = '';\n }\n return res\n }\n }\n\n function strfn (x) {\n if (typeof x === 'function') return x\n else if (typeof x === 'string') return x\n else if (x && typeof x === 'object') return x\n else if (x === null || x === undefined) return x\n else return concat('', x)\n }\n};\n\nfunction quot (state) {\n return state === ATTR_VALUE_SQ || state === ATTR_VALUE_DQ\n}\n\nvar closeRE = RegExp('^(' + [\n 'area', 'base', 'basefont', 'bgsound', 'br', 'col', 'command', 'embed',\n 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param',\n 'source', 'track', 'wbr', '!--',\n // SVG TAGS\n 'animate', 'animateTransform', 'circle', 'cursor', 'desc', 'ellipse',\n 'feBlend', 'feColorMatrix', 'feComposite',\n 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap',\n 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR',\n 'feGaussianBlur', 'feImage', 'feMergeNode', 'feMorphology',\n 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile',\n 'feTurbulence', 'font-face-format', 'font-face-name', 'font-face-uri',\n 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'missing-glyph', 'mpath',\n 'path', 'polygon', 'polyline', 'rect', 'set', 'stop', 'tref', 'use', 'view',\n 'vkern'\n].join('|') + ')(?:[\\.#][a-zA-Z0-9\\u007F-\\uFFFF_:-]+)*$');\nfunction selfClosing (tag) { return closeRE.test(tag) }\n\nvar trailingNewlineRegex = /\\n[\\s]+$/;\nvar leadingNewlineRegex = /^\\n[\\s]+/;\nvar trailingSpaceRegex = /[\\s]+$/;\nvar leadingSpaceRegex = /^[\\s]+/;\nvar multiSpaceRegex = /[\\n\\s]+/g;\n\nvar TEXT_TAGS = [\n 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'data', 'dfn', 'em', 'i',\n 'kbd', 'mark', 'q', 'rp', 'rt', 'rtc', 'ruby', 's', 'amp', 'small', 'span',\n 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr'\n];\n\nvar VERBATIM_TAGS = [\n 'code', 'pre', 'textarea'\n];\n\nvar appendChild = function appendChild (el, childs) {\n if (!Array.isArray(childs)) return\n\n var nodeName = el.nodeName.toLowerCase();\n\n var hadText = false;\n var value, leader;\n\n for (var i = 0, len = childs.length; i < len; i++) {\n var node = childs[i];\n if (Array.isArray(node)) {\n appendChild(el, node);\n continue\n }\n\n if (typeof node === 'number' ||\n typeof node === 'boolean' ||\n typeof node === 'function' ||\n node instanceof Date ||\n node instanceof RegExp) {\n node = node.toString();\n }\n\n var lastChild = el.childNodes[el.childNodes.length - 1];\n\n // Iterate over text nodes\n if (typeof node === 'string') {\n hadText = true;\n\n // If we already had text, append to the existing text\n if (lastChild && lastChild.nodeName === '#text') {\n lastChild.nodeValue += node;\n\n // We didn't have a text node yet, create one\n } else {\n node = el.ownerDocument.createTextNode(node);\n el.appendChild(node);\n lastChild = node;\n }\n\n // If this is the last of the child nodes, make sure we close it out\n // right\n if (i === len - 1) {\n hadText = false;\n // Trim the child text nodes if the current node isn't a\n // node where whitespace matters.\n if (TEXT_TAGS.indexOf(nodeName) === -1 &&\n VERBATIM_TAGS.indexOf(nodeName) === -1) {\n value = lastChild.nodeValue\n .replace(leadingNewlineRegex, '')\n .replace(trailingSpaceRegex, '')\n .replace(trailingNewlineRegex, '')\n .replace(multiSpaceRegex, ' ');\n if (value === '') {\n el.removeChild(lastChild);\n } else {\n lastChild.nodeValue = value;\n }\n } else if (VERBATIM_TAGS.indexOf(nodeName) === -1) {\n // The very first node in the list should not have leading\n // whitespace. Sibling text nodes should have whitespace if there\n // was any.\n leader = i === 0 ? '' : ' ';\n value = lastChild.nodeValue\n .replace(leadingNewlineRegex, leader)\n .replace(leadingSpaceRegex, ' ')\n .replace(trailingSpaceRegex, '')\n .replace(trailingNewlineRegex, '')\n .replace(multiSpaceRegex, ' ');\n lastChild.nodeValue = value;\n }\n }\n\n // Iterate over DOM nodes\n } else if (node && node.nodeType) {\n // If the last node was a text node, make sure it is properly closed out\n if (hadText) {\n hadText = false;\n\n // Trim the child text nodes if the current node isn't a\n // text node or a code node\n if (TEXT_TAGS.indexOf(nodeName) === -1 &&\n VERBATIM_TAGS.indexOf(nodeName) === -1) {\n value = lastChild.nodeValue\n .replace(leadingNewlineRegex, '')\n .replace(trailingNewlineRegex, ' ')\n .replace(multiSpaceRegex, ' ');\n\n // Remove empty text nodes, append otherwise\n if (value === '') {\n el.removeChild(lastChild);\n } else {\n lastChild.nodeValue = value;\n }\n // Trim the child nodes but preserve the appropriate whitespace\n } else if (VERBATIM_TAGS.indexOf(nodeName) === -1) {\n value = lastChild.nodeValue\n .replace(leadingSpaceRegex, ' ')\n .replace(leadingNewlineRegex, '')\n .replace(trailingNewlineRegex, ' ')\n .replace(multiSpaceRegex, ' ');\n lastChild.nodeValue = value;\n }\n }\n\n // Store the last nodename\n var _nodeName = node.nodeName;\n if (_nodeName) nodeName = _nodeName.toLowerCase();\n\n // Append the node to the DOM\n el.appendChild(node);\n }\n }\n};\n\nvar svgTags = [\n 'svg', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor',\n 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'color-profile',\n 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix',\n 'feComponentTransfer', 'feComposite', 'feConvolveMatrix',\n 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood',\n 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage',\n 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight',\n 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter',\n 'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src',\n 'font-face-uri', 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image',\n 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'missing-glyph',\n 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect',\n 'set', 'stop', 'switch', 'symbol', 'text', 'textPath', 'title', 'tref',\n 'tspan', 'use', 'view', 'vkern'\n];\n\nvar boolProps = [\n 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default',\n 'defaultchecked', 'defer', 'disabled', 'formnovalidate', 'hidden',\n 'ismap', 'loop', 'multiple', 'muted', 'novalidate', 'open', 'playsinline',\n 'readonly', 'required', 'reversed', 'selected'\n];\n\nvar directProps = [\n 'indeterminate'\n];\n\n// Props that need to be set directly rather than with el.setAttribute()\n\n\nvar SVGNS = 'http://www.w3.org/2000/svg';\nvar XLINKNS = 'http://www.w3.org/1999/xlink';\n\nvar COMMENT_TAG = '!--';\n\nvar dom = function (document) {\n function nanoHtmlCreateElement (tag, props, children) {\n var el;\n\n // If an svg tag, it needs a namespace\n if (svgTags.indexOf(tag) !== -1) {\n props.namespace = SVGNS;\n }\n\n // If we are using a namespace\n var ns = false;\n if (props.namespace) {\n ns = props.namespace;\n delete props.namespace;\n }\n\n // If we are extending a builtin element\n var isCustomElement = false;\n if (props.is) {\n isCustomElement = props.is;\n delete props.is;\n }\n\n // Create the element\n if (ns) {\n if (isCustomElement) {\n el = document.createElementNS(ns, tag, { is: isCustomElement });\n } else {\n el = document.createElementNS(ns, tag);\n }\n } else if (tag === COMMENT_TAG) {\n return document.createComment(props.comment)\n } else if (isCustomElement) {\n el = document.createElement(tag, { is: isCustomElement });\n } else {\n el = document.createElement(tag);\n }\n\n // Create the properties\n for (var p in props) {\n if (props.hasOwnProperty(p)) {\n var key = p.toLowerCase();\n var val = props[p];\n // Normalize className\n if (key === 'classname') {\n key = 'class';\n p = 'class';\n }\n // The for attribute gets transformed to htmlFor, but we just set as for\n if (p === 'htmlFor') {\n p = 'for';\n }\n // If a property is boolean, set itself to the key\n if (boolProps.indexOf(key) !== -1) {\n if (String(val) === 'true') val = key;\n else if (String(val) === 'false') continue\n }\n // If a property prefers being set directly vs setAttribute\n if (key.slice(0, 2) === 'on' || directProps.indexOf(key) !== -1) {\n el[p] = val;\n } else {\n if (ns) {\n if (p === 'xlink:href') {\n el.setAttributeNS(XLINKNS, p, val);\n } else if (/^xmlns($|:)/i.test(p)) ; else {\n el.setAttributeNS(null, p, val);\n }\n } else {\n el.setAttribute(p, val);\n }\n }\n }\n }\n\n appendChild(el, children);\n return el\n }\n\n function createFragment (nodes) {\n var fragment = document.createDocumentFragment();\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i] == null) continue\n if (Array.isArray(nodes[i])) {\n fragment.appendChild(createFragment(nodes[i]));\n } else {\n if (typeof nodes[i] === 'string') nodes[i] = document.createTextNode(nodes[i]);\n fragment.appendChild(nodes[i]);\n }\n }\n return fragment\n }\n\n var exports = hyperx(nanoHtmlCreateElement, {\n comments: true,\n createFragment: createFragment\n });\n exports.default = exports;\n exports.createComment = nanoHtmlCreateElement;\n return exports\n};\n\nvar dom$1 = dom;\n\nfunction nanohtmlRawBrowser (tag) {\n var el = document.createElement('div');\n el.innerHTML = tag;\n return toArray(el.childNodes)\n}\n\nfunction toArray (arr) {\n return Array.isArray(arr) ? arr : [].slice.call(arr)\n}\n\nvar rawBrowser = nanohtmlRawBrowser;\n\nconst html = dom$1(document);\n\nexport { html, rawBrowser as raw };\n","function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar marked = createCommonjsModule(function (module, exports) {\n(function(root) {\n\n/**\n * Block-Level Grammar\n */\n\nvar block = {\n newline: /^\\n+/,\n code: /^( {4}[^\\n]+\\n*)+/,\n fences: /^ {0,3}(`{3,}|~{3,})([^`~\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?:\\n+|$)|$)/,\n hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6}) +([^\\n]*?)(?: +#+)? *(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3})(bull) [\\s\\S]+?(?:hr|def|\\n{2,}(?! )(?!\\1bull )\\n*|\\s*$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?\\\\?>\\\\n*' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?>\\\\n*' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>\\\\n*' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:\\\\n{2,}|$)' // (6)\n + '|<(?!script|pre|style)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:\\\\n{2,}|$)' // (7) open tag\n + '|</(?!script|pre|style)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:\\\\n{2,}|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *\\n? *<?([^\\s>]+)>?(?:(?: +\\n? *| *\\n *)(title))? *(?:\\n+|$)/,\n nptable: noop,\n table: noop,\n lheading: /^([^\\n]+)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\[\\[\\]]|[^\\[\\]])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}\\.)/;\nblock.item = /^( *)(bull) ?[^\\n]*(?:\\n(?!\\1bull ?)[^\\n]*)*/;\nblock.item = edit(block.item, 'gm')\n .replace(/bull/g, block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?-->/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} +')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}|~{3,})[^`\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = merge({}, block);\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = merge({}, block.normal, {\n nptable: /^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:.*[^>\\n ].*(?:\\n|$))*)\\n*|$)/,\n table: /^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n((?: *[^>\\n ].*(?:\\n|$))*)\\n*|$)/\n});\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = merge({}, block.normal, {\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^ *(#{1,6}) *([^\\n]+?) *(?:#+ *)?(?:\\n+|$)/,\n fences: noop, // fences not supported\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Block Lexer\n */\n\nfunction Lexer(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || marked.defaults;\n this.rules = block.normal;\n\n if (this.options.pedantic) {\n this.rules = block.pedantic;\n } else if (this.options.gfm) {\n this.rules = block.gfm;\n }\n}\n\n/**\n * Expose Block Rules\n */\n\nLexer.rules = block;\n\n/**\n * Static Lex Method\n */\n\nLexer.lex = function(src, options) {\n var lexer = new Lexer(options);\n return lexer.lex(src);\n};\n\n/**\n * Preprocessing\n */\n\nLexer.prototype.lex = function(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n')\n .replace(/\\t/g, ' ')\n .replace(/\\u00a0/g, ' ')\n .replace(/\\u2424/g, '\\n');\n\n return this.token(src, true);\n};\n\n/**\n * Lexing\n */\n\nLexer.prototype.token = function(src, top) {\n src = src.replace(/^ +$/gm, '');\n var next,\n loose,\n cap,\n bull,\n b,\n item,\n listStart,\n listItems,\n t,\n space,\n i,\n tag,\n l,\n isordered,\n istask,\n ischecked;\n\n while (src) {\n // newline\n if (cap = this.rules.newline.exec(src)) {\n src = src.substring(cap[0].length);\n if (cap[0].length > 1) {\n this.tokens.push({\n type: 'space'\n });\n }\n }\n\n // code\n if (cap = this.rules.code.exec(src)) {\n var lastToken = this.tokens[this.tokens.length - 1];\n src = src.substring(cap[0].length);\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && lastToken.type === 'paragraph') {\n lastToken.text += '\\n' + cap[0].trimRight();\n } else {\n cap = cap[0].replace(/^ {4}/gm, '');\n this.tokens.push({\n type: 'code',\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(cap, '\\n')\n : cap\n });\n }\n continue;\n }\n\n // fences\n if (cap = this.rules.fences.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'code',\n lang: cap[2] ? cap[2].trim() : cap[2],\n text: cap[3] || ''\n });\n continue;\n }\n\n // heading\n if (cap = this.rules.heading.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'heading',\n depth: cap[1].length,\n text: cap[2]\n });\n continue;\n }\n\n // table no leading pipe (gfm)\n if (cap = this.rules.nptable.exec(src)) {\n item = {\n type: 'table',\n header: splitCells(cap[1].replace(/^ *| *\\| *$/g, '')),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n cells: cap[3] ? cap[3].replace(/\\n$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n src = src.substring(cap[0].length);\n\n for (i = 0; i < item.align.length; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n for (i = 0; i < item.cells.length; i++) {\n item.cells[i] = splitCells(item.cells[i], item.header.length);\n }\n\n this.tokens.push(item);\n\n continue;\n }\n }\n\n // hr\n if (cap = this.rules.hr.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'hr'\n });\n continue;\n }\n\n // blockquote\n if (cap = this.rules.blockquote.exec(src)) {\n src = src.substring(cap[0].length);\n\n this.tokens.push({\n type: 'blockquote_start'\n });\n\n cap = cap[0].replace(/^ *> ?/gm, '');\n\n // Pass `top` to keep the current\n // \"toplevel\" state. This is exactly\n // how markdown.pl works.\n this.token(cap, top);\n\n this.tokens.push({\n type: 'blockquote_end'\n });\n\n continue;\n }\n\n // list\n if (cap = this.rules.list.exec(src)) {\n src = src.substring(cap[0].length);\n bull = cap[2];\n isordered = bull.length > 1;\n\n listStart = {\n type: 'list_start',\n ordered: isordered,\n start: isordered ? +bull : '',\n loose: false\n };\n\n this.tokens.push(listStart);\n\n // Get each top-level item.\n cap = cap[0].match(this.rules.item);\n\n listItems = [];\n next = false;\n l = cap.length;\n i = 0;\n\n for (; i < l; i++) {\n item = cap[i];\n\n // Remove the list item's bullet\n // so it is seen as the next token.\n space = item.length;\n item = item.replace(/^ *([*+-]|\\d+\\.) */, '');\n\n // Outdent whatever the\n // list item contains. Hacky.\n if (~item.indexOf('\\n ')) {\n space -= item.length;\n item = !this.options.pedantic\n ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')\n : item.replace(/^ {1,4}/gm, '');\n }\n\n // Determine whether the next list item belongs here.\n // Backpedal if it does not belong in this list.\n if (i !== l - 1) {\n b = block.bullet.exec(cap[i + 1])[0];\n if (bull.length > 1 ? b.length === 1\n : (b.length > 1 || (this.options.smartLists && b !== bull))) {\n src = cap.slice(i + 1).join('\\n') + src;\n i = l - 1;\n }\n }\n\n // Determine whether item is loose or not.\n // Use: /(^|\\n)(?! )[^\\n]+\\n\\n(?!\\s*$)/\n // for discount behavior.\n loose = next || /\\n\\n(?!\\s*$)/.test(item);\n if (i !== l - 1) {\n next = item.charAt(item.length - 1) === '\\n';\n if (!loose) loose = next;\n }\n\n if (loose) {\n listStart.loose = true;\n }\n\n // Check for task list items\n istask = /^\\[[ xX]\\] /.test(item);\n ischecked = undefined;\n if (istask) {\n ischecked = item[1] !== ' ';\n item = item.replace(/^\\[[ xX]\\] +/, '');\n }\n\n t = {\n type: 'list_item_start',\n task: istask,\n checked: ischecked,\n loose: loose\n };\n\n listItems.push(t);\n this.tokens.push(t);\n\n // Recurse.\n this.token(item, false);\n\n this.tokens.push({\n type: 'list_item_end'\n });\n }\n\n if (listStart.loose) {\n l = listItems.length;\n i = 0;\n for (; i < l; i++) {\n listItems[i].loose = true;\n }\n }\n\n this.tokens.push({\n type: 'list_end'\n });\n\n continue;\n }\n\n // html\n if (cap = this.rules.html.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: this.options.sanitize\n ? 'paragraph'\n : 'html',\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]\n });\n continue;\n }\n\n // def\n if (top && (cap = this.rules.def.exec(src))) {\n src = src.substring(cap[0].length);\n if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);\n tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n if (!this.tokens.links[tag]) {\n this.tokens.links[tag] = {\n href: cap[2],\n title: cap[3]\n };\n }\n continue;\n }\n\n // table (gfm)\n if (cap = this.rules.table.exec(src)) {\n item = {\n type: 'table',\n header: splitCells(cap[1].replace(/^ *| *\\| *$/g, '')),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n cells: cap[3] ? cap[3].replace(/\\n$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n src = src.substring(cap[0].length);\n\n for (i = 0; i < item.align.length; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n for (i = 0; i < item.cells.length; i++) {\n item.cells[i] = splitCells(\n item.cells[i].replace(/^ *\\| *| *\\| *$/g, ''),\n item.header.length);\n }\n\n this.tokens.push(item);\n\n continue;\n }\n }\n\n // lheading\n if (cap = this.rules.lheading.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'heading',\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1]\n });\n continue;\n }\n\n // top-level paragraph\n if (top && (cap = this.rules.paragraph.exec(src))) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'paragraph',\n text: cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1]\n });\n continue;\n }\n\n // text\n if (cap = this.rules.text.exec(src)) {\n // Top-level should never reach here.\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'text',\n text: cap[0]\n });\n continue;\n }\n\n if (src) {\n throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));\n }\n }\n\n return this.tokens;\n};\n\n/**\n * Inline-Level Grammar\n */\n\nvar inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noop,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(?!\\s*\\])((?:\\\\[\\[\\]]?|[^\\[\\]\\\\])+)\\]/,\n nolink: /^!?\\[(?!\\s*\\])((?:\\[[^\\[\\]]*\\]|\\\\[\\[\\]]|[^\\[\\]])*)\\](?:\\[\\])?/,\n strong: /^__([^\\s_])__(?!_)|^\\*\\*([^\\s*])\\*\\*(?!\\*)|^__([^\\s][\\s\\S]*?[^\\s])__(?!_)|^\\*\\*([^\\s][\\s\\S]*?[^\\s])\\*\\*(?!\\*)/,\n em: /^_([^\\s_])_(?!_)|^\\*([^\\s*<\\[])\\*(?!\\*)|^_([^\\s<][\\s\\S]*?[^\\s_])_(?!_|[^\\spunctuation])|^_([^\\s_<][\\s\\S]*?[^\\s])_(?!_|[^\\spunctuation])|^\\*([^\\s<\"][\\s\\S]*?[^\\s\\*])\\*(?!\\*|[^\\spunctuation])|^\\*([^\\s*\"<\\[][\\s\\S]*?[^\\s])\\*(?!\\*)/,\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noop,\n text: /^(`+|[^`])(?:[\\s\\S]*?(?:(?=[\\\\<!\\[`*]|\\b_|$)|[^ ](?= {2,}\\n))|(?= {2,}\\n))/\n};\n\n// list of punctuation marks from common mark spec\n// without ` and ] to workaround Rule 17 (inline code blocks/links)\ninline._punctuation = '!\"#$%&\\'()*+,\\\\-./:;<=>?@\\\\[^_{|}~';\ninline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', block._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[[^\\[\\]]*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\[<>]?|[^\\s<>\\\\])*>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = merge({}, inline);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = merge({}, inline.normal, {\n strong: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n em: /^_(?=\\S)([\\s\\S]*?\\S)_(?!_)|^\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)/,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = merge({}, inline.normal, {\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,\n del: /^~+(?=\\S)([\\s\\S]*?\\S)~+/,\n text: /^(`+|[^`])(?:[\\s\\S]*?(?:(?=[\\\\<!\\[`*~]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))|(?= {2,}\\n|[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))/\n});\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n});\n\n/**\n * Inline Lexer & Compiler\n */\n\nfunction InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}\n\n/**\n * Expose Inline Rules\n */\n\nInlineLexer.rules = inline;\n\n/**\n * Static Lexing/Compiling Method\n */\n\nInlineLexer.output = function(src, links, options) {\n var inline = new InlineLexer(links, options);\n return inline.output(src);\n};\n\n/**\n * Lexing/Compiling\n */\n\nInlineLexer.prototype.output = function(src) {\n var out = '',\n link,\n text,\n href,\n title,\n cap,\n prevCapZero;\n\n while (src) {\n // escape\n if (cap = this.rules.escape.exec(src)) {\n src = src.substring(cap[0].length);\n out += escape(cap[1]);\n continue;\n }\n\n // tag\n if (cap = this.rules.tag.exec(src)) {\n if (!this.inLink && /^<a /i.test(cap[0])) {\n this.inLink = true;\n } else if (this.inLink && /^<\\/a>/i.test(cap[0])) {\n this.inLink = false;\n }\n if (!this.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.inRawBlock = true;\n } else if (this.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.inRawBlock = false;\n }\n\n src = src.substring(cap[0].length);\n out += this.options.sanitize\n ? this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0])\n : cap[0];\n continue;\n }\n\n // link\n if (cap = this.rules.link.exec(src)) {\n var lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n var linkLen = 4 + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n src = src.substring(cap[0].length);\n this.inLink = true;\n href = cap[2];\n if (this.options.pedantic) {\n link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n } else {\n title = '';\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim().replace(/^<([\\s\\S]*)>$/, '$1');\n out += this.outputLink(cap, {\n href: InlineLexer.escapes(href),\n title: InlineLexer.escapes(title)\n });\n this.inLink = false;\n continue;\n }\n\n // reflink, nolink\n if ((cap = this.rules.reflink.exec(src))\n || (cap = this.rules.nolink.exec(src))) {\n src = src.substring(cap[0].length);\n link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = this.links[link.toLowerCase()];\n if (!link || !link.href) {\n out += cap[0].charAt(0);\n src = cap[0].substring(1) + src;\n continue;\n }\n this.inLink = true;\n out += this.outputLink(cap, link);\n this.inLink = false;\n continue;\n }\n\n // strong\n if (cap = this.rules.strong.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1]));\n continue;\n }\n\n // em\n if (cap = this.rules.em.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1]));\n continue;\n }\n\n // code\n if (cap = this.rules.code.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.codespan(escape(cap[2].trim(), true));\n continue;\n }\n\n // br\n if (cap = this.rules.br.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.br();\n continue;\n }\n\n // del (gfm)\n if (cap = this.rules.del.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.del(this.output(cap[1]));\n continue;\n }\n\n // autolink\n if (cap = this.rules.autolink.exec(src)) {\n src = src.substring(cap[0].length);\n if (cap[2] === '@') {\n text = escape(this.mangle(cap[1]));\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n out += this.renderer.link(href, null, text);\n continue;\n }\n\n // url (gfm)\n if (!this.inLink && (cap = this.rules.url.exec(src))) {\n if (cap[2] === '@') {\n text = escape(cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + text;\n } else {\n href = text;\n }\n }\n src = src.substring(cap[0].length);\n out += this.renderer.link(href, null, text);\n continue;\n }\n\n // text\n if (cap = this.rules.text.exec(src)) {\n src = src.substring(cap[0].length);\n if (this.inRawBlock) {\n out += this.renderer.text(this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]);\n } else {\n out += this.renderer.text(escape(this.smartypants(cap[0])));\n }\n continue;\n }\n\n if (src) {\n throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));\n }\n }\n\n return out;\n};\n\nInlineLexer.escapes = function(text) {\n return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;\n};\n\n/**\n * Compile Link\n */\n\nInlineLexer.prototype.outputLink = function(cap, link) {\n var href = link.href,\n title = link.title ? escape(link.title) : null;\n\n return cap[0].charAt(0) !== '!'\n ? this.renderer.link(href, title, this.output(cap[1]))\n : this.renderer.image(href, title, escape(cap[1]));\n};\n\n/**\n * Smartypants Transformations\n */\n\nInlineLexer.prototype.smartypants = function(text) {\n if (!this.options.smartypants) return text;\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n};\n\n/**\n * Mangle Links\n */\n\nInlineLexer.prototype.mangle = function(text) {\n if (!this.options.mangle) return text;\n var out = '',\n l = text.length,\n i = 0,\n ch;\n\n for (; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n};\n\n/**\n * Renderer\n */\n\nfunction Renderer(options) {\n this.options = options || marked.defaults;\n}\n\nRenderer.prototype.code = function(code, infostring, escaped) {\n var lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n var out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang, true)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n};\n\nRenderer.prototype.blockquote = function(quote) {\n return '<blockquote>\\n' + quote + '</blockquote>\\n';\n};\n\nRenderer.prototype.html = function(html) {\n return html;\n};\n\nRenderer.prototype.heading = function(text, level, raw, slugger) {\n if (this.options.headerIds) {\n return '<h'\n + level\n + ' id=\"'\n + this.options.headerPrefix\n + slugger.slug(raw)\n + '\">'\n + text\n + '</h'\n + level\n + '>\\n';\n }\n // ignore IDs\n return '<h' + level + '>' + text + '</h' + level + '>\\n';\n};\n\nRenderer.prototype.hr = function() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n};\n\nRenderer.prototype.list = function(body, ordered, start) {\n var type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n};\n\nRenderer.prototype.listitem = function(text) {\n return '<li>' + text + '</li>\\n';\n};\n\nRenderer.prototype.checkbox = function(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n};\n\nRenderer.prototype.paragraph = function(text) {\n return '<p>' + text + '</p>\\n';\n};\n\nRenderer.prototype.table = function(header, body) {\n if (body) body = '<tbody>' + body + '</tbody>';\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n};\n\nRenderer.prototype.tablerow = function(content) {\n return '<tr>\\n' + content + '</tr>\\n';\n};\n\nRenderer.prototype.tablecell = function(content, flags) {\n var type = flags.header ? 'th' : 'td';\n var tag = flags.align\n ? '<' + type + ' align=\"' + flags.align + '\">'\n : '<' + type + '>';\n return tag + content + '</' + type + '>\\n';\n};\n\n// span level renderer\nRenderer.prototype.strong = function(text) {\n return '<strong>' + text + '</strong>';\n};\n\nRenderer.prototype.em = function(text) {\n return '<em>' + text + '</em>';\n};\n\nRenderer.prototype.codespan = function(text) {\n return '<code>' + text + '</code>';\n};\n\nRenderer.prototype.br = function() {\n return this.options.xhtml ? '<br/>' : '<br>';\n};\n\nRenderer.prototype.del = function(text) {\n return '<del>' + text + '</del>';\n};\n\nRenderer.prototype.link = function(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n var out = '<a href=\"' + escape(href) + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n};\n\nRenderer.prototype.image = function(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n var out = '<img src=\"' + href + '\" alt=\"' + text + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n};\n\nRenderer.prototype.text = function(text) {\n return text;\n};\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\n\nfunction TextRenderer() {}\n\n// no need for block level renderers\n\nTextRenderer.prototype.strong =\nTextRenderer.prototype.em =\nTextRenderer.prototype.codespan =\nTextRenderer.prototype.del =\nTextRenderer.prototype.text = function(text) {\n return text;\n};\n\nTextRenderer.prototype.link =\nTextRenderer.prototype.image = function(href, title, text) {\n return '' + text;\n};\n\nTextRenderer.prototype.br = function() {\n return '';\n};\n\n/**\n * Parsing & Compiling\n */\n\nfunction Parser(options) {\n this.tokens = [];\n this.token = null;\n this.options = options || marked.defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.slugger = new Slugger();\n}\n\n/**\n * Static Parse Method\n */\n\nParser.parse = function(src, options) {\n var parser = new Parser(options);\n return parser.parse(src);\n};\n\n/**\n * Parse Loop\n */\n\nParser.prototype.parse = function(src) {\n this.inline = new InlineLexer(src.links, this.options);\n // use an InlineLexer with a TextRenderer to extract pure text\n this.inlineText = new InlineLexer(\n src.links,\n merge({}, this.options, { renderer: new TextRenderer() })\n );\n this.tokens = src.reverse();\n\n var out = '';\n while (this.next()) {\n out += this.tok();\n }\n\n return out;\n};\n\n/**\n * Next Token\n */\n\nParser.prototype.next = function() {\n this.token = this.tokens.pop();\n return this.token;\n};\n\n/**\n * Preview Next Token\n */\n\nParser.prototype.peek = function() {\n return this.tokens[this.tokens.length - 1] || 0;\n};\n\n/**\n * Parse Text Tokens\n */\n\nParser.prototype.parseText = function() {\n var body = this.token.text;\n\n while (this.peek().type === 'text') {\n body += '\\n' + this.next().text;\n }\n\n return this.inline.output(body);\n};\n\n/**\n * Parse Current Token\n */\n\nParser.prototype.tok = function() {\n switch (this.token.type) {\n case 'space': {\n return '';\n }\n case 'hr': {\n return this.renderer.hr();\n }\n case 'heading': {\n return this.renderer.heading(\n this.inline.output(this.token.text),\n this.token.depth,\n unescape(this.inlineText.output(this.token.text)),\n this.slugger);\n }\n case 'code': {\n return this.renderer.code(this.token.text,\n this.token.lang,\n this.token.escaped);\n }\n case 'table': {\n var header = '',\n body = '',\n i,\n row,\n cell,\n j;\n\n // header\n cell = '';\n for (i = 0; i < this.token.header.length; i++) {\n cell += this.renderer.tablecell(\n this.inline.output(this.token.header[i]),\n { header: true, align: this.token.align[i] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n for (i = 0; i < this.token.cells.length; i++) {\n row = this.token.cells[i];\n\n cell = '';\n for (j = 0; j < row.length; j++) {\n cell += this.renderer.tablecell(\n this.inline.output(row[j]),\n { header: false, align: this.token.align[j] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n return this.renderer.table(header, body);\n }\n case 'blockquote_start': {\n body = '';\n\n while (this.next().type !== 'blockquote_end') {\n body += this.tok();\n }\n\n return this.renderer.blockquote(body);\n }\n case 'list_start': {\n body = '';\n var ordered = this.token.ordered,\n start = this.token.start;\n\n while (this.next().type !== 'list_end') {\n body += this.tok();\n }\n\n return this.renderer.list(body, ordered, start);\n }\n case 'list_item_start': {\n body = '';\n var loose = this.token.loose;\n var checked = this.token.checked;\n var task = this.token.task;\n\n if (this.token.task) {\n body += this.renderer.checkbox(checked);\n }\n\n while (this.next().type !== 'list_item_end') {\n body += !loose && this.token.type === 'text'\n ? this.parseText()\n : this.tok();\n }\n return this.renderer.listitem(body, task, checked);\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n return this.renderer.html(this.token.text);\n }\n case 'paragraph': {\n return this.renderer.paragraph(this.inline.output(this.token.text));\n }\n case 'text': {\n return this.renderer.paragraph(this.parseText());\n }\n default: {\n var errMsg = 'Token with \"' + this.token.type + '\" type was not found.';\n if (this.options.silent) {\n console.log(errMsg);\n } else {\n throw new Error(errMsg);\n }\n }\n }\n};\n\n/**\n * Slugger generates header id\n */\n\nfunction Slugger() {\n this.seen = {};\n}\n\n/**\n * Convert string to unique id\n */\n\nSlugger.prototype.slug = function(value) {\n var slug = value\n .toLowerCase()\n .trim()\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n\n if (this.seen.hasOwnProperty(slug)) {\n var originalSlug = slug;\n do {\n this.seen[originalSlug]++;\n slug = originalSlug + '-' + this.seen[originalSlug];\n } while (this.seen.hasOwnProperty(slug));\n }\n this.seen[slug] = 0;\n\n return slug;\n};\n\n/**\n * Helpers\n */\n\nfunction escape(html, encode) {\n if (encode) {\n if (escape.escapeTest.test(html)) {\n return html.replace(escape.escapeReplace, function(ch) { return escape.replacements[ch]; });\n }\n } else {\n if (escape.escapeTestNoEncode.test(html)) {\n return html.replace(escape.escapeReplaceNoEncode, function(ch) { return escape.replacements[ch]; });\n }\n }\n\n return html;\n}\n\nescape.escapeTest = /[&<>\"']/;\nescape.escapeReplace = /[&<>\"']/g;\nescape.replacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n\nescape.escapeTestNoEncode = /[<>\"']|&(?!#?\\w+;)/;\nescape.escapeReplaceNoEncode = /[<>\"']|&(?!#?\\w+;)/g;\n\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(/&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig, function(_, n) {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nfunction edit(regex, opt) {\n regex = regex.source || regex;\n opt = opt || '';\n return {\n replace: function(name, val) {\n val = val.source || val;\n val = val.replace(/(^|[^\\[])\\^/g, '$1');\n regex = regex.replace(name, val);\n return this;\n },\n getRegex: function() {\n return new RegExp(regex, opt);\n }\n };\n}\n\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n try {\n var prot = decodeURIComponent(unescape(href))\n .replace(/[^\\w:]/g, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (/^[^:]+:\\/*[^/]*$/.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n\n if (href.slice(0, 2) === '//') {\n return base.replace(/:[\\s\\S]*/, ':') + href;\n } else if (href.charAt(0) === '/') {\n return base.replace(/(:\\/*[^/]*)[\\s\\S]*/, '$1') + href;\n } else {\n return base + href;\n }\n}\nvar baseUrls = {};\nvar originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\nfunction noop() {}\nnoop.exec = noop;\n\nfunction merge(obj) {\n var i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n}\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n var row = tableRow.replace(/\\|/g, function(match, offset, str) {\n var escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/),\n i = 0;\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n// Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n// /c*$/ is vulnerable to REDOS.\n// invert: Remove suffix of non-c chars instead. Default falsey.\nfunction rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n var level = 0;\n for (var i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n/**\n * Marked\n */\n\nfunction marked(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (callback || typeof opt === 'function') {\n if (!callback) {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n var highlight = opt.highlight,\n tokens,\n pending,\n i = 0;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n pending = tokens.length;\n\n var done = function(err) {\n if (err) {\n opt.highlight = highlight;\n return callback(err);\n }\n\n var out;\n\n try {\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!pending) return done();\n\n for (; i < tokens.length; i++) {\n (function(token) {\n if (token.type !== 'code') {\n return --pending || done();\n }\n return highlight(token.text, token.lang, function(err, code) {\n if (err) return done(err);\n if (code == null || code === token.text) {\n return --pending || done();\n }\n token.text = code;\n token.escaped = true;\n --pending || done();\n });\n })(tokens[i]);\n }\n\n return;\n }\n try {\n if (opt) opt = merge({}, marked.defaults, opt);\n checkSanitizeDeprecation(opt);\n return Parser.parse(Lexer.lex(src, opt), opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if ((opt || marked.defaults).silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n merge(marked.defaults, opt);\n return marked;\n};\n\nmarked.getDefaults = function() {\n return {\n baseUrl: null,\n breaks: false,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: new Renderer(),\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartLists: false,\n smartypants: false,\n xhtml: false\n };\n};\n\nmarked.defaults = marked.getDefaults();\n\n/**\n * Expose\n */\n\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\n\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\n\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\n\nmarked.InlineLexer = InlineLexer;\nmarked.inlineLexer = InlineLexer.output;\n\nmarked.Slugger = Slugger;\n\nmarked.parse = marked;\n\n{\n module.exports = marked;\n}\n})();\n});\n\nexport default marked;\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar pluralize = createCommonjsModule(function (module, exports) {\n/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n // Node.\n module.exports = pluralize();\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(commonjsGlobal, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Lower cased words. E.g. \"hello\".\n if (word === word.toLowerCase()) return token.toLowerCase();\n\n // Upper cased words. E.g. \"WHISKY\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word The word to pluralize\n * @param {number} count How many of the word exist\n * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['passerby', 'passersby']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'aircraft',\n 'alcohol',\n 'ammo',\n 'analytics',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'firmware',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'hardware',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'mud',\n 'manga',\n 'news',\n 'only',\n 'personnel',\n 'pike',\n 'plankton',\n 'pliers',\n 'police',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'software',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transportation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n /pok[eé]mon$/i,\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n});\n\nexport default pluralize;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/esm/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { html as _html, raw as _raw } from \"../../js/deps/builds/nanohtml.js\";\nimport _marked from \"../../js/deps/builds/marked.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\n\n/** @type {import(\"idb\")} */\n// @ts-ignore\nexport const idb = _idb;\nexport const webidl2 = _webidl2;\n/** @type {import(\"nanohtml\").default} */\n// @ts-ignore\nexport const hyperHTML = _html;\n/** @type {import(\"nanohtml/raw\")} */\n// @ts-ignore\nexport const raw = _raw;\n/** @type {import(\"marked\")} */\n// @ts-ignore\nexport const marked = _marked;\n/** @type {import(\"pluralize\")} */\n// @ts-ignore\nexport const pluralize = _pluralize;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n * Note that the content of SECTION elements, and elements with a\n * class name of \"note\", \"issue\" or \"req\" are also parsed.\n *\n * The HTML created by the Markdown parser is turned into a nested\n * structure of SECTION elements, following the structure given by\n * the headings. For example, the following markup:\n *\n * Title\n * -----\n *\n * ### Subtitle ###\n *\n * Here's some text.\n *\n * ### Another subtitle ###\n *\n * More text.\n *\n * will be transformed into:\n *\n * <section>\n * <h2>Title</h2>\n * <section>\n * <h3>Subtitle</h3>\n * <p>Here's some text.</p>\n * </section>\n * <section>\n * <h3>Another subtitle</h3>\n * <p>More text.</p>\n * </section>\n * </section>\n *\n * The whitespace of pre elements are left alone.\n */\n\nimport { marked } from \"./import-maps.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nconst endsWithSpace = /\\s+$/gm;\n\nconst inlineElems = new Set([\n \"a\",\n \"abbr\",\n \"acronym\",\n \"b\",\n \"bdo\",\n \"big\",\n \"br\",\n \"button\",\n \"cite\",\n \"code\",\n \"dfn\",\n \"em\",\n \"i\",\n \"img\",\n \"input\",\n \"kbd\",\n \"label\",\n \"map\",\n \"object\",\n \"q\",\n \"samp\",\n \"script\",\n \"select\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"textarea\",\n \"time\",\n \"tt\",\n \"var\",\n]);\n\nclass Renderer extends marked.Renderer {\n code(code, language, isEscaped) {\n if (language === \"webidl\") {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n return super.code(code, language, isEscaped);\n }\n}\n\n/**\n * @param {string} text\n */\nfunction normalizePadding(text) {\n if (!text) {\n return \"\";\n }\n if (typeof text !== \"string\") {\n throw TypeError(\"Invalid input\");\n }\n if (text === \"\\n\") {\n return \"\\n\";\n }\n\n /**\n * @param {Node} node\n * @return {node is Text}\n */\n function isTextNode(node) {\n return node !== null && node.nodeType === Node.TEXT_NODE;\n }\n /**\n * @param {Node} node\n * @return {node is Element}\n */\n function isElementNode(node) {\n return node !== null && node.nodeType === Node.ELEMENT_NODE;\n }\n const doc = document.createRange().createContextualFragment(text);\n // Normalize block level elements children first\n Array.from(doc.children)\n .filter(elem => !inlineElems.has(elem.localName))\n .filter(elem => elem.localName !== \"pre\")\n .filter(elem => elem.localName !== \"table\")\n .forEach(elem => {\n elem.innerHTML = normalizePadding(elem.innerHTML);\n });\n // Normalize root level now\n Array.from(doc.childNodes)\n .filter(node => isTextNode(node) && node.textContent.trim() === \"\")\n .forEach(node => node.replaceWith(\"\\n\"));\n // Normalize text node\n if (isElementNode(doc.firstChild)) {\n Array.from(doc.firstChild.children)\n .filter(child => child.localName !== \"table\")\n .forEach(child => {\n child.innerHTML = normalizePadding(child.innerHTML);\n });\n }\n doc.normalize();\n // use the first space as an indicator of how much to chop off the front\n const firstSpace = doc.textContent\n .replace(/^ *\\n/, \"\")\n .split(\"\\n\")\n .filter(item => item && item.startsWith(\" \"))[0];\n const chop = firstSpace ? firstSpace.match(/ +/)[0].length : 0;\n if (chop) {\n // Chop chop from start, but leave pre elem alone\n Array.from(doc.childNodes)\n .filter(node => node.nodeName !== \"PRE\")\n .filter(isTextNode)\n .filter(node => {\n // we care about text next to a block level element\n const prevSib = node.previousElementSibling;\n const nextTo = prevSib && prevSib.localName;\n // and we care about text elements that finish on a new line\n return (\n !inlineElems.has(nextTo) || node.textContent.trim().includes(\"\\n\")\n );\n })\n .reduce((replacer, node) => {\n // We need to retain white space if the text Node is next to an in-line element\n let padding = \"\";\n const prevSib = node.previousElementSibling;\n const nextTo = prevSib && prevSib.localName;\n if (/^[\\t ]/.test(node.textContent) && inlineElems.has(nextTo)) {\n padding = node.textContent.match(/^\\s+/)[0];\n }\n node.textContent = padding + node.textContent.replace(replacer, \"\");\n return replacer;\n }, new RegExp(`^ {1,${chop}}`, \"gm\"));\n // deal with pre elements... we can chop whitespace from their siblings\n const endsWithSpace = new RegExp(`\\\\ {${chop}}$`, \"gm\");\n Array.from(doc.querySelectorAll(\"pre\"))\n .map(elem => elem.previousSibling)\n .filter(isTextNode)\n .reduce((chop, node) => {\n if (endsWithSpace.test(node.textContent)) {\n node.textContent = node.textContent.substr(\n 0,\n node.textContent.length - chop\n );\n }\n return chop;\n }, chop);\n }\n const wrap = document.createElement(\"body\");\n wrap.append(doc);\n const result = endsWithSpace.test(wrap.innerHTML)\n ? `${wrap.innerHTML.trimRight()}\\n`\n : wrap.innerHTML;\n return result;\n}\n\n/**\n * @param {string} text\n */\nexport function markdownToHtml(text) {\n const normalizedLeftPad = normalizePadding(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n // @ts-ignore\n const result = marked(potentialMarkdown, {\n sanitize: false,\n gfm: true,\n headerIds: false,\n renderer: new Renderer(),\n });\n return result;\n}\n\nfunction processElements(selector) {\n return element => {\n const elements = Array.from(element.querySelectorAll(selector));\n elements.reverse().forEach(element => {\n element.innerHTML = markdownToHtml(element.innerHTML);\n });\n return elements;\n };\n}\n\nclass Builder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node, process) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(process(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n\nfunction structure(fragment, doc) {\n function process(root) {\n const stack = new Builder(doc);\n while (root.firstChild) {\n const node = root.firstChild;\n if (node.nodeType !== Node.ELEMENT_NODE) {\n root.removeChild(node);\n continue;\n }\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n stack.addHeader(node);\n break;\n case \"section\":\n stack.addSection(node, process);\n break;\n default:\n stack.addElement(node);\n }\n }\n return stack.root;\n }\n return process(fragment);\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = processElements(\"[data-format='markdown']:not(body)\");\nconst processBlockLevelElements = processElements(\n \"[data-format=markdown]:not(body), section, div, address, article, aside, figure, header, main, body\"\n);\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body)\n .map(elem => {\n const structuredInternals = structure(elem, elem.ownerDocument);\n return {\n structuredInternals,\n elem,\n };\n })\n .forEach(({ elem, structuredInternals }) => {\n elem.setAttribute(\"aria-busy\", \"true\");\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n elem.setAttribute(\"aria-busy\", \"false\");\n });\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newHTML = document.createElement(\"html\");\n const newBody = document.createElement(\"body\");\n newBody.innerHTML = document.body.innerHTML;\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n newHTML.appendChild(newBody);\n processBlockLevelElements(newHTML);\n // Process root level text nodes\n const cleanHTML = newBody.innerHTML\n // Markdown parsing sometimes inserts empty p tags\n .replace(/<p>\\s*<\\/p>/gm, \"\");\n newBody.innerHTML = cleanHTML;\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Restructure the document properly\n const fragment = structure(newBody, document);\n // Frankenstein the whole thing back together\n newBody.appendChild(fragment);\n newBody.prepend(rsUI);\n document.body.replaceWith(newBody);\n}\n","/**\n * www.openjs.com/scripts/events/keyboard_shortcuts/\n * Version : 2.01.B\n * By Binny V A\n * License : BSD\n */\n\"use strict\";\nexport default {\n all_shortcuts: {}, //All the shortcuts are stored in this array\n add: function(shortcut_combination, callback, opt) {\n //Provide a set of default options\n var default_options = {\n type: \"keydown\",\n propagate: false,\n disable_in_input: false,\n target: document,\n keycode: false,\n };\n if (!opt) {\n opt = default_options;\n } else {\n for (var dfo in default_options) {\n if (typeof opt[dfo] == \"undefined\") opt[dfo] = default_options[dfo];\n }\n }\n\n var ele = opt.target;\n if (typeof opt.target == \"string\")\n ele = document.getElementById(opt.target);\n var ths = this;\n shortcut_combination = shortcut_combination.toLowerCase();\n\n //The function to be called at keypress\n var func = function(e) {\n var code;\n e = e || window.event;\n\n if (opt[\"disable_in_input\"]) {\n //Don't enable shortcut keys in Input, Textarea fields\n var element;\n if (e.target) element = e.target;\n else if (e.srcElement) element = e.srcElement;\n if (element.nodeType == 3) element = element.parentNode;\n\n if (element.tagName == \"INPUT\" || element.tagName == \"TEXTAREA\") return;\n }\n\n //Find Which key is pressed\n if (e.keyCode) code = e.keyCode;\n else if (e.which) code = e.which;\n var character = String.fromCharCode(code).toLowerCase();\n\n if (code == 188) character = \",\"; //If the user presses , when the type is onkeydown\n if (code == 190) character = \".\"; //If the user presses , when the type is onkeydown\n\n var keys = shortcut_combination.split(\"+\");\n //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked\n var kp = 0;\n\n //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken\n var shift_nums = {\n \"`\": \"~\",\n \"1\": \"!\",\n \"2\": \"@\",\n \"3\": \"#\",\n \"4\": \"$\",\n \"5\": \"%\",\n \"6\": \"^\",\n \"7\": \"&\",\n \"8\": \"*\",\n \"9\": \"(\",\n \"0\": \")\",\n \"-\": \"_\",\n \"=\": \"+\",\n \";\": \":\",\n \"'\": '\"',\n \",\": \"<\",\n \".\": \">\",\n \"/\": \"?\",\n \"\\\\\": \"|\",\n };\n //Special Keys - and their codes\n var special_keys = {\n esc: 27,\n escape: 27,\n tab: 9,\n space: 32,\n return: 13,\n enter: 13,\n backspace: 8,\n\n scrolllock: 145,\n scroll_lock: 145,\n scroll: 145,\n capslock: 20,\n caps_lock: 20,\n caps: 20,\n numlock: 144,\n num_lock: 144,\n num: 144,\n\n pause: 19,\n break: 19,\n\n insert: 45,\n home: 36,\n delete: 46,\n end: 35,\n\n pageup: 33,\n page_up: 33,\n pu: 33,\n\n pagedown: 34,\n page_down: 34,\n pd: 34,\n\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n\n f1: 112,\n f2: 113,\n f3: 114,\n f4: 115,\n f5: 116,\n f6: 117,\n f7: 118,\n f8: 119,\n f9: 120,\n f10: 121,\n f11: 122,\n f12: 123,\n };\n\n var modifiers = {\n shift: { wanted: false, pressed: false },\n ctrl: { wanted: false, pressed: false },\n alt: { wanted: false, pressed: false },\n meta: { wanted: false, pressed: false }, //Meta is Mac specific\n };\n\n if (e.ctrlKey) modifiers.ctrl.pressed = true;\n if (e.shiftKey) modifiers.shift.pressed = true;\n if (e.altKey) modifiers.alt.pressed = true;\n if (e.metaKey) modifiers.meta.pressed = true;\n\n for (var i = 0, k; (k = keys[i]), i < keys.length; i++) {\n //Modifiers\n if (k == \"ctrl\" || k == \"control\") {\n kp++;\n modifiers.ctrl.wanted = true;\n } else if (k == \"shift\") {\n kp++;\n modifiers.shift.wanted = true;\n } else if (k == \"alt\") {\n kp++;\n modifiers.alt.wanted = true;\n } else if (k == \"meta\") {\n kp++;\n modifiers.meta.wanted = true;\n } else if (k.length > 1) {\n //If it is a special key\n if (special_keys[k] == code) kp++;\n } else if (opt[\"keycode\"]) {\n if (opt[\"keycode\"] == code) kp++;\n } else {\n //The special keys did not match\n if (character == k) kp++;\n else {\n if (shift_nums[character] && e.shiftKey) {\n //Stupid Shift key bug created by using lowercase\n character = shift_nums[character];\n if (character == k) kp++;\n }\n }\n }\n }\n\n if (\n kp == keys.length &&\n modifiers.ctrl.pressed == modifiers.ctrl.wanted &&\n modifiers.shift.pressed == modifiers.shift.wanted &&\n modifiers.alt.pressed == modifiers.alt.wanted &&\n modifiers.meta.pressed == modifiers.meta.wanted\n ) {\n callback(e);\n\n if (!opt[\"propagate\"]) {\n //Stop the event\n //e.cancelBubble is supported by IE - this will kill the bubbling process.\n e.cancelBubble = true;\n e.returnValue = false;\n\n //e.stopPropagation works in Firefox.\n if (e.stopPropagation) {\n e.stopPropagation();\n e.preventDefault();\n }\n return false;\n }\n }\n };\n this.all_shortcuts[shortcut_combination] = {\n callback: func,\n target: ele,\n event: opt[\"type\"],\n };\n //Attach the function with the event\n if (ele.addEventListener) ele.addEventListener(opt[\"type\"], func, false);\n else if (ele.attachEvent) ele.attachEvent(\"on\" + opt[\"type\"], func);\n else ele[\"on\" + opt[\"type\"]] = func;\n },\n\n //Remove the shortcut - just specify the shortcut and I will remove the binding\n // 'remove':function(shortcut_combination) {\n // shortcut_combination = shortcut_combination.toLowerCase();\n // var binding = this.all_shortcuts[shortcut_combination];\n // delete(this.all_shortcuts[shortcut_combination])\n // if(!binding) return;\n // var type = binding['event'];\n // var ele = binding['target'];\n // var callback = binding['callback'];\n //\n // if(ele.detachEvent) ele.detachEvent('on'+type, callback);\n // else if(ele.removeEventListener) ele.removeEventListener(type, callback, false);\n // else ele['on'+type] = false;\n // }\n};\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n/* jshint laxcomma:true */\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\n\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport shortcut from \"../../js/shortcut.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/ui.css\")).default;\n } catch {\n return fetchAsset(\"ui.css\");\n }\n}\n\nasync function insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = await loadStyle();\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = hyperHTML`<div id='respec-ui' class='removeOnSave' hidden></div>`;\nconst menu = hyperHTML`<ul id=respec-menu role=menu aria-labelledby='respec-pill' hidden></ul>`;\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = hyperHTML`<button id='respec-pill' disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n if (menu.hidden) {\n menu.classList.remove(\"respec-hidden\");\n menu.classList.add(\"respec-visible\");\n } else {\n menu.classList.add(\"respec-hidden\");\n menu.classList.remove(\"respec-visible\");\n }\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n menu.hidden = !menu.hidden;\n});\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n menu.classList.remove(\"respec-visible\");\n menu.classList.add(\"respec-hidden\");\n menu.hidden = true;\n }\n});\nrespecUI.appendChild(menu);\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(msg, arr, butName, title) {\n arr.push(msg);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n buttons[butName].textContent = arr.length;\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = hyperHTML`<button id='${buttonId}' class='respec-info-button'>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = hyperHTML`<ol class='${`respec-${butName}-list`}'></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(markdownToHtml(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n [\"label\", `Document ${title.toLowerCase()}`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n addCommand(label, handler, keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = hyperHTML`<button id=\"${id}\" class=\"respec-option\" title=\"${keyShort}\">\n <span class=\"respec-cmd-icon\">${icon}</span> ${label}…\n </button>`;\n const menuItem = hyperHTML`<li role=menuitem>${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n if (keyShort) shortcut.add(keyShort, handler);\n return button;\n },\n error(msg) {\n errWarn(msg, errors, \"error\", \"Errors\");\n },\n warning(msg) {\n errWarn(msg, warnings, \"warning\", \"Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = hyperHTML`<div id='respec-overlay' class='removeOnSave'></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = hyperHTML`<div id='${id}' class='respec-modal removeOnSave' role='dialog'>\n <h3 id=\"${headingId}\">${title}</h3>\n <div class='inside'>${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n },\n};\nshortcut.add(\"Esc\", () => ui.closeModal());\nshortcut.add(\"Ctrl+Alt+Shift+E\", () => {\n if (buttons.error) buttons.error.click();\n});\nshortcut.add(\"Ctrl+Alt+Shift+W\", () => {\n if (buttons.warning) buttons.warning.click();\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n","// @ts-check\n/**\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n * @param {string} text IDL text\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nfunction reindent(text) {\n if (!text) {\n return text;\n }\n // TODO: use trimEnd when Edge supports it\n const lines = text.trimRight().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/location-hash\";\n\nexport function run() {\n // Added message for legacy compat with Aria specs\n // See https://github.com/w3c/respec/issues/793\n pub(\"start\", \"core/location-hash\");\n if (!location.hash) {\n return;\n }\n document.respecIsReady.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * @typedef {object} LinterResult\n * @property {string} description\n * @property {string} help\n * @property {string} howToFix\n * @property {string} name\n * @property {number} occurrences\n * @property {HTMLElement[]} offendingElements\n *\n * @typedef {(conf: any, doc: Document) => (LinterResult | Promise<LinterResult>)} LintingFunction\n */\n\n/** @type {WeakMap<LinterRule, { name: string, lintingFunction: LintingFunction }>} */\nconst privs = new WeakMap();\n\n/**\n * Checks if the linter rule is enabled.\n *\n * @param {Object} conf ReSpec config object.\n * @param {string} name linter rule name\n */\nfunction canLint(conf, name) {\n return !(\n conf.hasOwnProperty(\"lint\") === false ||\n conf.lint === false ||\n !conf.lint[name]\n );\n}\n\nexport default class LinterRule {\n /**\n *\n * @param {String} name the name of the rule\n * @param {LintingFunction} lintingFunction\n */\n constructor(name, lintingFunction) {\n privs.set(this, { name, lintingFunction });\n }\n get name() {\n return privs.get(this).name;\n }\n /**\n * Runs linter rule.\n *\n * @param {Object} conf The ReSpec config.\n * @param {Document} doc The document to be checked.\n */\n lint(conf = { lint: { [this.name]: false } }, doc = document) {\n if (canLint(conf, this.name)) {\n return privs.get(this).lintingFunction(conf, doc);\n }\n }\n}\n","// @ts-check\n/**\n * Linter rule \"check-charset\".\n *\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"check-charset\";\nconst meta = {\n en: {\n description: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n howToFix: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n *\n * @param {Object} _ The ReSpec config.\n * @param {Document} doc The document to be checked.\n */\nfunction linterFunction(_, doc) {\n const metas = doc.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(\n meta\n .getAttribute(\"charset\")\n .trim()\n .toLowerCase()\n );\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return [];\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n return {\n name,\n occurrences: metas.length,\n ...meta[lang],\n };\n}\nexport const rule = new LinterRule(name, linterFunction);\n","// @ts-check\n/**\n * Linter rule \"check-internal-slots\".\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"check-internal-slots\";\n\nconst meta = {\n en: {\n description: \"Internal slots should be preceded by a '.'\",\n howToFix: \"Add a '.' between the elements mentioned.\",\n help: \"See developer console.\",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n * @param {Object} _ The ReSpec config.\n * @param {Document} doc The document to be checked.\n * @return {import(\"../../core/LinterRule\").LinterResult}\n */\nfunction linterFunction(_, doc) {\n const offendingElements = [...doc.querySelectorAll(\"var+a\")].filter(\n ({ previousSibling: { nodeName } }) => {\n const isPrevVar = nodeName && nodeName === \"VAR\";\n return isPrevVar;\n }\n );\n\n if (!offendingElements.length) {\n return;\n }\n\n return {\n name,\n offendingElements,\n occurrences: offendingElements.length,\n ...meta[lang],\n };\n}\n\nexport const rule = new LinterRule(name, linterFunction);\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>\n * in the ReSpec config.\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"check-punctuation\";\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\nconst meta = {\n en: {\n description: \"`p` elements should end with a punctuation mark.\",\n howToFix: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n *\n * @param {Object} _ The ReSpec config.\n * @param {Document} doc The document to be checked.\n * @return {import(\"../../core/LinterRule\").LinterResult}\n */\nfunction lintingFunction(_, doc) {\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n const offendingElements = [\n ...doc.querySelectorAll(\"p:not(#back-to-top)\"),\n ].filter(elem => !punctuatingRegExp.test(elem.textContent.trim()));\n if (!offendingElements.length) {\n return;\n }\n return {\n name,\n offendingElements,\n occurrences: offendingElements.length,\n ...meta[lang],\n };\n}\nexport const rule = new LinterRule(name, lintingFunction);\n","// @ts-check\n/**\n * Module core/linter\n *\n * Core linter module. Exports a linter object.\n */\nimport { pub } from \"./pubsubhub.js\";\nimport { showInlineWarning } from \"./utils.js\";\nexport const name = \"core/linter\";\n\n/** @type {WeakMap<Linter, { rules: Set<import(\"./LinterRule\").default> }>} */\nconst privates = new WeakMap();\n\nclass Linter {\n constructor() {\n privates.set(this, {\n rules: new Set(),\n });\n }\n get rules() {\n return privates.get(this).rules;\n }\n /**\n * @param {...import(\"./LinterRule\").default} newRules\n */\n register(...newRules) {\n newRules.forEach(newRule => this.rules.add(newRule));\n }\n async lint(conf, doc = window.document) {\n const promisesToLint = [...privates.get(this).rules].map(rule =>\n toLinterWarning(rule.lint(conf, doc))\n );\n await promisesToLint;\n }\n}\n\nconst linter = new Linter();\nexport default linter;\n\nconst baseResult = {\n name: \"unknown\",\n description: \"\",\n occurrences: 0,\n howToFix: \"\",\n offendingElements: [], // DOM Nodes\n help: \"\", // where to get help\n};\n\n/**\n * @typedef {import(\"./LinterRule\").LinterResult} LinterResult\n * @param {LinterResult | Promise<LinterResult>} [resultPromise]\n */\nasync function toLinterWarning(resultPromise) {\n const result = await resultPromise;\n if (!result) {\n return;\n }\n const output = { ...baseResult, ...result };\n const {\n description,\n help,\n howToFix,\n name,\n occurrences,\n offendingElements,\n } = output;\n const message = `Linter (${name}): ${description} ${howToFix} ${help}`;\n if (offendingElements.length) {\n showInlineWarning(offendingElements, `${message} Occured`);\n } else {\n pub(\"warn\", `${message} (Count: ${occurrences})`);\n }\n}\n\nexport function run(conf) {\n if (conf.lint === false) {\n return; // nothing to do\n }\n // return early, continue processing other things\n (async () => {\n await document.respecIsReady;\n try {\n await linter.lint(conf, document);\n } catch (err) {\n console.error(\"Error ocurred while running the linter\", err);\n }\n })();\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"local-refs-exist\";\n\nconst meta = {\n en: {\n description: \"Broken local reference found in document.\",\n howToFix: \"Please fix the links mentioned.\",\n help: \"See developer console.\",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n * @param {Object} _ The ReSpec config.\n * @param {Document} doc The document to be checked.\n * @return {import(\"../../core/LinterRule\").LinterResult}\n */\nfunction linterFunction(_, doc) {\n const offendingElements = [...doc.querySelectorAll(\"a[href^='#']\")].filter(\n isBrokenHyperlink\n );\n if (!offendingElements.length) {\n return;\n }\n return {\n name,\n offendingElements,\n occurrences: offendingElements.length,\n ...meta[lang],\n };\n}\n\nexport const rule = new LinterRule(name, linterFunction);\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n return !elem.ownerDocument.getElementById(id);\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\nconst name = \"no-headingless-sections\";\nconst meta = {\n en: {\n description: \"All sections must start with a `h2-6` element.\",\n howToFix: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n help: \"See developer console.\",\n },\n nl: {\n description: \"Alle secties moeten beginnen met een `h2-6` element.\",\n howToFix:\n \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n help: \"Zie de developer console.\",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\nconst hasNoHeading = ({ firstElementChild: elem }) => {\n return elem === null || /^h[1-6]$/.test(elem.localName) === false;\n};\n\n/**\n * @param {*} _\n * @param {Document} doc\n * @return {import(\"../../core/LinterRule\").LinterResult}\n */\nfunction linterFunction(_, doc) {\n const offendingElements = [...doc.querySelectorAll(\"section\")].filter(\n hasNoHeading\n );\n if (!offendingElements.length) {\n return;\n }\n return {\n name,\n offendingElements,\n occurrences: offendingElements.length,\n ...meta[lang],\n };\n}\nexport const rule = new LinterRule(name, linterFunction);\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport LinterRule from \"../LinterRule.js\";\nimport { lang as defaultLang } from \"../l10n.js\";\n\nconst name = \"no-http-props\";\n\nconst meta = {\n en: {\n description: \"Insecure URLs are not allowed in `respecConfig`.\",\n howToFix: \"Please change the following properties to 'https://': \",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\n/**\n * Runs linter rule.\n *\n * @param {Object} conf The ReSpec config.\n * @param {Document} doc The document to be checked.\n */\nfunction lintingFunction(conf, doc) {\n // We can only really perform this check over http/https\n if (!doc.location.href.startsWith(\"http\")) {\n return;\n }\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => key.endsWith(\"URI\") || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], doc.location.href).href.startsWith(\"http://\")\n );\n if (!offendingMembers.length) {\n return;\n }\n /** @type {import(\"../../core/LinterRule\").LinterResult} */\n const result = {\n name,\n occurrences: offendingMembers.length,\n ...meta[lang],\n };\n result.howToFix += `${offendingMembers\n .map(item => `\\`${item}\\``)\n .join(\", \")}.`;\n return result;\n}\n\nexport const rule = new LinterRule(name, lintingFunction);\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport LinterRule from \"../../core/LinterRule.js\";\nimport { lang as defaultLang } from \"../../core/l10n.js\";\nconst name = \"privsec-section\";\nconst meta = {\n en: {\n description:\n \"Document must a 'Privacy and/or Security' Considerations section.\",\n howToFix: \"Add a privacy and/or security considerations section.\",\n help:\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\n\n// Fall back to english, if language is missing\nconst lang = defaultLang in meta ? defaultLang : \"en\";\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\n/**\n * @param {*} conf\n * @param {Document} doc\n * @return {import(\"../LinterRule\").LinterResult}\n */\nfunction lintingFunction(conf, doc) {\n if (conf.isRecTrack && !hasPriSecConsiderations(doc)) {\n return { name, occurrences: 1, ...meta[lang] };\n }\n}\n\nexport const rule = new LinterRule(name, lintingFunction);\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\nimport { rule as checkCharset } from \"./linter-rules/check-charset.js\";\nimport { rule as checkInternalSlots } from \"./linter-rules/check-internal-slots.js\";\nimport { rule as checkPunctuation } from \"./linter-rules/check-punctuation.js\";\nimport linter from \"./linter.js\";\nimport { rule as localRefsExist } from \"./linter-rules/local-refs-exist.js\";\nimport { rule as noHeadinglessSectionsRule } from \"./linter-rules/no-headingless-sections.js\";\nimport { rule as noHttpPropsRule } from \"./linter-rules/no-http-props.js\";\nimport { rule as privsecSection } from \"./linter-rules/privsec-section.js\";\n\nlinter.register(\n noHttpPropsRule,\n noHeadinglessSectionsRule,\n checkPunctuation,\n localRefsExist,\n checkInternalSlots,\n checkCharset,\n privsecSection\n);\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: false,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n\n/** @type {Record<string, HTMLElement[]>} */\nexport const definitionMap = Object.create(null);\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names.map(name => name.toLowerCase())) {\n if (name in definitionMap === false) {\n definitionMap[name] = [dfn];\n } else if (!definitionMap[name].includes(dfn)) {\n definitionMap[name].push(dfn);\n }\n }\n}\n","// @ts-check\n/**\n * Sets the defaults for W3C specs\n */\nexport const name = \"w3c/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\nimport { definitionMap } from \"../core/dfn-map.js\";\nimport linter from \"../core/linter.js\";\nimport { rule as privsecSectionRule } from \"../core/linter-rules/privsec-section.js\";\n\nlinter.register(privsecSectionRule);\n\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": true,\n },\n pluralize: true,\n doJsonLd: false,\n license: \"w3c-software-doc\",\n logos: [\n {\n src: \"https://www.w3.org/StyleSheets/TR/2016/logos/W3C\",\n alt: \"W3C\",\n height: 48,\n width: 72,\n url: \"https://www.w3.org/\",\n },\n ],\n xref: true,\n};\n\nexport function run(conf) {\n if (conf.specStatus === \"unofficial\") return;\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...w3cDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...w3cDefaults,\n ...conf,\n lint,\n });\n\n // TODO: eventually, we want to remove this.\n // It's here for legacy support of json-ld specs\n // see https://github.com/w3c/respec/issues/2019\n Object.assign(conf, { definitionMap });\n}\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport { fetchAsset } from \"./text-loader.js\";\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/respec2.css\")).default;\n } catch {\n return fetchAsset(\"respec2.css\");\n }\n}\n\nasync function insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = await loadStyle();\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport async function run(conf) {\n if (conf.noReSpecCSS) {\n (await styleElement).remove();\n }\n}\n","// @ts-check\n/* jshint strict: true, browser:true, jquery: true */\n// Module w3c/style\n// Inserts a link to the appropriate W3C style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport { createResourceHint, linkCSS, toKeyValuePairs } from \"../core/utils.js\";\nimport { pub, sub } from \"../core/pubsubhub.js\";\nexport const name = \"w3c/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction selectStyleVersion(styleVersion) {\n let version = \"\";\n switch (styleVersion) {\n case null:\n case true:\n version = \"2016\";\n break;\n default:\n if (styleVersion && !isNaN(styleVersion)) {\n version = styleVersion.toString().trim();\n }\n }\n return version;\n}\n\nfunction createResourceHints() {\n const resourceHints = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all specs show the logo.\n href: \"https://www.w3.org/StyleSheets/TR/2016/logos/W3C\",\n as: \"image\",\n },\n ]\n .map(createResourceHint)\n .reduce((frag, link) => {\n frag.appendChild(link);\n return frag;\n }, document.createDocumentFragment());\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const warn = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n pub(\"warn\", warn);\n }\n\n let styleFile = \"W3C-\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"CG-DRAFT\":\n case \"CG-FINAL\":\n case \"BG-DRAFT\":\n case \"BG-FINAL\":\n styleFile = conf.specStatus.toLowerCase();\n break;\n case \"FPWD\":\n case \"LC\":\n case \"WD-NOTE\":\n case \"LC-NOTE\":\n styleFile += \"WD\";\n break;\n case \"WG-NOTE\":\n case \"FPWD-NOTE\":\n styleFile += \"WG-NOTE.css\";\n break;\n case \"UNOFFICIAL\":\n styleFile += \"UD\";\n break;\n case \"FINDING\":\n case \"FINDING-DRAFT\":\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n default:\n styleFile += conf.specStatus;\n }\n\n // Select between released styles and experimental style.\n const version = selectStyleVersion(conf.useExperimentalStyles || \"2016\");\n // Attach W3C fixup script after we are done.\n if (version && !conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, version);\n },\n { once: true }\n );\n }\n const finalVersionPath = version ? `${version}/` : \"\";\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/${finalVersionPath}${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","// @ts-check\n// Module w3c/l10n\n// Looks at the lang attribute on the root element and uses it to manage the config.l10n object so\n// that other parts of the system can localise their text\nimport { l10n } from \"../core/l10n.js\";\nexport const name = \"w3c/l10n\";\nconst additions = {\n en: {\n status_at_publication:\n \"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href='https://www.w3.org/TR/'>W3C technical reports index</a> at https://www.w3.org/TR/.\",\n },\n ko: {\n status_at_publication:\n \"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href='https://www.w3.org/TR/'>W3C technical reports index</a> at https://www.w3.org/TR/.\",\n },\n zh: {\n status_at_publication:\n \"本章节描述了本文档的发布状态。其它更新版本可能会覆盖本文档。W3C的文档列 表和最新版本可通过<a href='https://www.w3.org/TR/'>W3C技术报告</a>索引访问。\",\n },\n ja: {\n status_at_publication:\n \"この節には、公開時点でのこの文書の位置づけが記されている。他の文書によって置き換えられる可能性がある。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 <a href='https://www.w3.org/TR/'>W3C technical reports index</a> (https://www.w3.org/TR/)\",\n },\n nl: {\n status_at_publication:\n \"This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href='https://www.w3.org/TR/'>W3C technical reports index</a> at https://www.w3.org/TR/.\",\n },\n es: {\n status_at_publication:\n \"Esta sección describe el estado del presente documento al momento de su publicación. El presente documento puede ser remplazado por otros. Una lista de las publicaciones actuales del W3C y la última revisión del presente informe técnico puede hallarse en http://www.w3.org/TR/ <a href='https://www.w3.org/TR/'>el índice de informes técnicos</a> del W3C.\",\n },\n};\n\nObject.keys(additions).forEach(key => {\n Object.assign(l10n[key], additions[key]);\n});\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n pub(\"error\", message);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File a bug\",\n participate: \"Participate\",\n commit_history: \"Commit history\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe\",\n },\n};\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\nconst l10n = localizationStrings[lang];\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg =\n \"Config option `[github](https://github.com/w3c/respec/wiki/github)` \" +\n \"is missing property `repoURL`.\";\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = `\\`respecConf.github\\` is not a valid URL? (${ghURL})`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = `\\`respecConf.github\\` must be HTTPS and pointing to GitHub. (${ghURL})`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg =\n \"`respecConf.github` URL needs a path with, for example, w3c/my-spec\";\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: new URL(`./commits/${branch}`, ghURL.href).href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg = \"`respecConfig.githubAPI` should not be added manually.\";\n pub(\"warn\", msg);\n }\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n conf.otherLinks.unshift(otherLink);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { pub } from \"./pubsubhub.js\";\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-include\";\n\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const doc = el.ownerDocument;\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n let replacementNode;\n switch (el.dataset.includeFormat) {\n case \"text\":\n if (replace) {\n replacementNode = doc.createTextNode(data);\n el.replaceWith(replacementNode);\n } else {\n el.textContent = data;\n }\n break;\n default:\n // html, which is just using \"innerHTML\"\n el.innerHTML = data;\n if (replace) {\n replacementNode = doc.createDocumentFragment();\n while (el.hasChildNodes()) {\n replacementNode.append(el.removeChild(el.firstChild));\n }\n el.replaceWith(replacementNode);\n }\n }\n // If still in the dom tree, clean up\n if (doc.contains(el)) {\n cleanUp(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction cleanUp(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = document.querySelectorAll(\"[data-include]\");\n\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).substr(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}). See console for details.`;\n console.error(\"data-include failed for element: \", el, err);\n pub(\"error\", msg);\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\nimport { pub } from \"../../core/pubsubhub.js\";\n\nexport default link => {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n pub(\"warn\", msg);\n console.warn(\"warn\", msg, link);\n return;\n }\n const fragment = html`\n <dt>${link.key}:</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n if (link.class) {\n fragment.classList.add(link.class);\n }\n return fragment;\n};\n\nfunction showLinkData(data) {\n const fragment = html`\n <dd>\n ${data.href\n ? html`\n <a href=\"${data.href}\">${data.value || data.href}</a>\n `\n : \"\"}\n </dd>\n `;\n if (data.class) {\n fragment.classList.add(data.class);\n }\n return fragment;\n}\n","// @ts-check\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\nimport { showInlineWarning } from \"../../core/utils.js\";\n\nexport default obj => {\n /** @type {HTMLAnchorElement} */\n // @ts-ignore force type assertion\n const a = html`\n <a href=\"${obj.url || \"\"}\" class=\"logo\"></a>\n `;\n if (!obj.alt) {\n showInlineWarning(a, \"Found spec logo without an `alt` attribute\");\n }\n /** @type {HTMLImageElement} */\n // @ts-ignore force type assertion\n const img = html`\n <img\n id=\"${obj.id}\"\n alt=\"${obj.alt}\"\n width=\"${obj.width}\"\n height=\"${obj.height}\"\n />\n `;\n // avoid triggering 404 requests from dynamically generated\n // hyperHTML attribute values\n img.src = obj.src;\n a.append(img);\n return a;\n};\n","// @ts-check\nimport { hyperHTML as html, raw } from \"../../core/import-maps.js\";\nimport {\n humanDate,\n showInlineError,\n toShortIsoDate,\n} from \"../../core/utils.js\";\nimport { lang as defaultLang } from \"../../core/l10n.js\";\n\nconst localizationStrings = {\n en: {\n until: \"Until\",\n },\n es: {\n until: \"Hasta\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport default (items = []) => {\n const l10n = localizationStrings[lang];\n return items.map(getItem);\n\n function getItem(p) {\n const personName = raw(p.name);\n const company = raw(p.company);\n /** @type {HTMLElement} */\n const dd = html`\n <dd class=\"p-author h-card vcard\"></dd>\n `;\n if (p.w3cid) {\n dd.dataset.editorId = String(parseInt(p.w3cid, 10));\n }\n const contents = [];\n if (p.mailto) {\n contents.push(html`\n <a class=\"ed_mailto u-email email p-name\" href=\"${`mailto:${p.mailto}`}\"\n >${personName}</a\n >\n `);\n } else if (p.url) {\n contents.push(html`\n <a class=\"u-url url p-name fn\" href=\"${p.url}\">${personName}</a>\n `);\n } else {\n contents.push(\n html`\n <span class=\"p-name fn\">${personName}</span>\n `\n );\n }\n if (p.orcid) {\n contents.push(\n html`\n <a class=\"p-name orcid\" href=\"${p.orcid}\"\n ><svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n >\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n </svg>\n </a>\n `\n );\n }\n if (p.company) {\n if (p.companyURL) {\n contents.push(\n html`\n (<a class=\"p-org org h-org h-card\" href=\"${p.companyURL}\"\n >${company}</a\n >)\n `\n );\n } else {\n contents.push(\n html`\n (${company})\n `\n );\n }\n }\n if (p.note) contents.push(document.createTextNode(` (${p.note})`));\n if (p.extras) {\n const results = p.extras\n // Remove empty names\n .filter(extra => extra.name && extra.name.trim())\n // Convert to HTML\n .map(getExtra);\n for (const result of results) {\n contents.push(document.createTextNode(\", \"), result);\n }\n }\n if (p.retiredDate) {\n const retiredDate = new Date(p.retiredDate);\n const isValidDate = retiredDate.toString() !== \"Invalid Date\";\n const timeElem = document.createElement(\"time\");\n timeElem.textContent = isValidDate\n ? humanDate(retiredDate)\n : \"Invalid Date\"; // todo: Localise invalid date\n if (!isValidDate) {\n showInlineError(\n timeElem,\n \"The date is invalid. The expected format is YYYY-MM-DD.\",\n \"Invalid date\"\n );\n }\n timeElem.dateTime = toShortIsoDate(retiredDate);\n contents.push(\n html`\n - ${l10n.until.concat(\" \")}${timeElem}\n `\n );\n }\n\n dd.append(...contents);\n return dd;\n }\n\n function getExtra(extra) {\n const span = document.createElement(\"span\");\n if (extra.class) {\n span.classList.add(extra.class);\n }\n let textContainer = span;\n if (extra.href) {\n textContainer = html`\n <a href=\"${extra.href}\"></a>\n `;\n span.appendChild(textContainer);\n }\n textContainer.textContent = extra.name;\n return span;\n }\n};\n","// @ts-check\nimport { hyperHTML as html, raw } from \"../../core/import-maps.js\";\nimport showLink from \"./show-link.js\";\nimport showLogo from \"./show-logo.js\";\nimport showPeople from \"./show-people.js\";\n\nexport default conf => {\n return html`\n <div class=\"head\">\n ${conf.logos.map(showLogo)}\n <h1 class=\"title p-name\" id=\"title\">${conf.title}</h1>\n ${conf.subtitle\n ? html`\n <h2 id=\"subtitle\">${conf.subtitle}</h2>\n `\n : \"\"}\n <h2>\n ${conf.longStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n ${conf.thisVersion\n ? html`\n <dt>${conf.l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.latestVersion\n ? html`\n <dt>${conf.l10n.latest_published_version}</dt>\n <dd>\n <a href=\"${conf.latestVersion}\">${conf.latestVersion}</a>\n </dd>\n `\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${conf.l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>Test suite:</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>Implementation report:</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.bugTrackerHTML\n ? html`\n <dt>${conf.l10n.bug_tracker}</dt>\n <dd>${raw(conf.bugTrackerHTML)}</dd>\n `\n : \"\"}\n ${conf.prevVersion\n ? html`\n <dt>Previous version:</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.isCGFinal\n ? html`\n ${conf.prevED\n ? html`\n <dt>Previous editor's draft:</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n `\n : \"\"}\n <dt>${conf.multipleEditors ? conf.l10n.editors : conf.l10n.editor}</dt>\n ${showPeople(conf.editors)}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? conf.l10n.former_editors\n : conf.l10n.former_editor}\n </dt>\n ${showPeople(conf.formerEditors)}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>\n ${conf.multipleAuthors ? conf.l10n.authors : conf.l10n.author}\n </dt>\n ${showPeople(conf.authors)}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.alternateFormats\n ? html`\n <p>\n ${conf.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${raw(conf.alternatesHTML)}\n </p>\n `\n : \"\"}\n <p class=\"copyright\">\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\"\n >Copyright</a\n >\n ©\n ${conf.copyrightStart\n ? `${conf.copyrightStart}-`\n : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html`\n ${raw(conf.additionalCopyrightHolders)} &\n `\n : \"\"}\n the Contributors to the ${conf.title} Specification, published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a> under the\n ${conf.isCGFinal\n ? html`\n <a href=\"https://www.w3.org/community/about/agreements/fsa/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >. A human-readable\n <a href=\"https://www.w3.org/community/about/agreements/fsa-deed/\"\n >summary</a\n >\n is available.\n `\n : html`\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >. A human-readable\n <a href=\"https://www.w3.org/community/about/agreements/cla-deed/\"\n >summary</a\n >\n is available.\n `}\n </p>\n <hr title=\"Separator for header\" />\n </div>\n `;\n};\n","// @ts-check\nimport { hyperHTML as html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${conf.l10n.sotd}</h2>\n ${conf.isPreview\n ? html`\n <details class=\"annoying-warning\" open=\"\">\n <summary\n >This is a\n preview${conf.prUrl && conf.prNumber\n ? html`\n of pull request\n <a href=\"${conf.prUrl}\">#${conf.prNumber}</a>\n `\n : \"\"}</summary\n >\n <p>\n Do not attempt to implement this version of the specification. Do\n not reference this version as authoritative in any way.\n ${conf.edDraftURI\n ? html`\n Instead, see\n <a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a> for the\n Editor's draft.\n `\n : \"\"}\n </p>\n </details>\n `\n : \"\"}\n <p>\n This specification was published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a>. It is not a W3C Standard nor is it\n on the W3C Standards Track.\n ${conf.isCGFinal\n ? html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/final/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >\n other conditions apply.\n `\n : html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >\n there is a limited opt-out and other conditions apply.\n `}\n Learn more about\n <a href=\"https://www.w3.org/community/\"\n >W3C Community and Business Groups</a\n >.\n </p>\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.wgPublicList\n ? html`\n <p>\n If you wish to make comments regarding this document, please send\n them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a href=\"${opts.mailToWGPublicListSubscription}\">subscribe</a>,\n <a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html`\n with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject\n `\n : \"\"}.\n </p>\n `\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${[...opts.additionalSections]}\n `;\n};\n","// @ts-check\nimport { hyperHTML as html, raw } from \"../../core/import-maps.js\";\nimport { norm } from \"../../core/utils.js\";\nimport { pub } from \"../../core/pubsubhub.js\";\nimport showLink from \"./show-link.js\";\nimport showLogo from \"./show-logo.js\";\nimport showPeople from \"./show-people.js\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/\";\nconst w3cLicense = \"https://www.w3.org/Consortium/Legal/copyright-documents\";\nconst legalDisclaimer =\n \"https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\";\nconst w3cTrademark =\n \"https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\";\n\nfunction getSpecTitleElem(conf) {\n const specTitleElem =\n document.querySelector(\"h1#title\") || document.createElement(\"h1\");\n if (specTitleElem.parentElement) {\n specTitleElem.remove();\n } else {\n specTitleElem.textContent = conf.title;\n specTitleElem.id = \"title\";\n }\n if (conf.isPreview && conf.prNumber) {\n const { childNodes } = html`\n Preview of PR <a href=\"${conf.prUrl}\">#${conf.prNumber}</a>:\n `;\n specTitleElem.prepend(...childNodes);\n }\n conf.title = norm(specTitleElem.textContent);\n specTitleElem.classList.add(\"title\", \"p-name\");\n if (document.querySelector(\"title\") === null) {\n document.title = conf.title;\n } else if (document.title !== conf.title) {\n pub(\"warn\", \"The document's title and the `<title>` element differ.\");\n }\n return specTitleElem;\n}\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`\n <div class=\"head\">\n ${conf.logos.map(showLogo)} ${getSpecTitleElem(conf)}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.prependW3C ? \"W3C \" : \"\"}${conf.textStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n ${!conf.isNoTrack\n ? html`\n <dt>${conf.l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>\n <dt>${conf.l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`\n <a href=\"${conf.latestVersion}\">${conf.latestVersion}</a>\n `\n : \"none\"}\n </dd>\n `\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${conf.l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>Test suite:</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>Implementation report:</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.bugTrackerHTML\n ? html`\n <dt>${conf.l10n.bug_tracker}</dt>\n <dd>${raw(conf.bugTrackerHTML)}</dd>\n `\n : \"\"}\n ${conf.isED && conf.prevED\n ? html`\n <dt>Previous editor's draft:</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n ${conf.showPreviousVersion\n ? html`\n <dt>Previous version:</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.prevRecURI\n ? \"\"\n : conf.isRec\n ? html`\n <dt>Previous Recommendation:</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `\n : html`\n <dt>Latest Recommendation:</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `}\n <dt>${conf.multipleEditors ? conf.l10n.editors : conf.l10n.editor}</dt>\n ${showPeople(conf.editors)}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? conf.l10n.former_editors\n : conf.l10n.former_editor}\n </dt>\n ${showPeople(conf.formerEditors)}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>\n ${conf.multipleAuthors ? conf.l10n.authors : conf.l10n.author}\n </dt>\n ${showPeople(conf.authors)}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.errata\n ? html`\n <p>\n Please check the\n <a href=\"${conf.errata}\"><strong>errata</strong></a> for any\n errors or issues reported since publication.\n </p>\n `\n : \"\"}\n ${conf.isRec\n ? html`\n <p>\n See also\n <a\n href=\"${`http://www.w3.org/2003/03/Translations/byTechnology?technology=${conf.shortName}`}\"\n >\n <strong>translations</strong></a\n >.\n </p>\n `\n : \"\"}\n ${conf.alternateFormats\n ? html`\n <p>\n ${conf.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${raw(conf.alternatesHTML)}\n </p>\n `\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>\n `;\n};\n\n/**\n * @param {string} text\n * @param {string} url\n * @param {string=} cssClass\n */\nfunction linkLicense(text, url, cssClass) {\n return html`\n <a rel=\"license\" href=\"${url}\" class=\"${cssClass}\">${text}</a>\n `;\n}\n\nfunction renderCopyright(conf) {\n return conf.isUnofficial\n ? conf.additionalCopyrightHolders\n ? html`\n <p class=\"copyright\">${raw(conf.additionalCopyrightHolders)}</p>\n `\n : conf.overrideCopyright\n ? raw(conf.overrideCopyright)\n : html`\n <p class=\"copyright\">\n This document is licensed under a\n ${linkLicense(\n \"Creative Commons Attribution 4.0 License\",\n ccLicense,\n \"subfoot\"\n )}.\n </p>\n `\n : conf.overrideCopyright\n ? raw(conf.overrideCopyright)\n : renderOfficialCopyright(conf);\n}\n\nfunction renderOfficialCopyright(conf) {\n return html`\n <p class=\"copyright\">\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\"\n >Copyright</a\n >\n ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? raw(`${conf.additionalCopyrightHolders} &`)\n : \"\"}\n <a href=\"https://www.w3.org/\"\n ><abbr title=\"World Wide Web Consortium\">W3C</abbr></a\n ><sup>®</sup> (<a href=\"https://www.csail.mit.edu/\"\n ><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a\n >,\n <a href=\"https://www.ercim.eu/\"\n ><abbr\n title=\"European Research Consortium for Informatics and Mathematics\"\n >ERCIM</abbr\n ></a\n >, <a href=\"https://www.keio.ac.jp/\">Keio</a>,\n <a href=\"https://ev.buaa.edu.cn/\">Beihang</a>). ${noteIfDualLicense(conf)}\n W3C <a href=\"${legalDisclaimer}\">liability</a>,\n <a href=\"${w3cTrademark}\">trademark</a> and ${linkDocumentUse(conf)} rules\n apply.\n </p>\n `;\n}\n\nfunction noteIfDualLicense(conf) {\n if (!conf.isCCBY) {\n return;\n }\n return html`\n Some Rights Reserved: this document is dual-licensed,\n ${linkLicense(\"CC-BY\", ccLicense)} and\n ${linkLicense(\"W3C Document License\", w3cLicense)}.\n `;\n}\n\nfunction linkDocumentUse(conf) {\n if (conf.isCCBY) {\n return linkLicense(\n \"document use\",\n \"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html\"\n );\n }\n if (conf.isW3CSoftAndDocLicense) {\n return linkLicense(\n \"permissive document license\",\n \"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\"\n );\n }\n return linkLicense(\"document use\", w3cLicense);\n}\n","// @ts-check\nimport { hyperHTML as html, raw } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${conf.l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n ${conf.isUnofficial\n ? renderIsUnofficial(opts)\n : conf.isTagFinding\n ? opts.additionalContent\n : conf.isNoTrack\n ? renderIsNoTrack(conf, opts)\n : html`\n <p><em>${raw(conf.l10n.status_at_publication)}</em></p>\n ${conf.isSubmission\n ? noteForSubmission(conf, opts)\n : html`\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.overrideStatus\n ? html`\n ${linkToWorkingGroup(conf)} ${linkToCommunity(conf, opts)}\n ${conf.isCR || conf.isPER || conf.isPR\n ? html`\n <p>\n ${conf.isCR\n ? `\n W3C publishes a Candidate Recommendation to indicate that the document is believed to be\n stable and to encourage implementation by the developer community. This Candidate\n Recommendation is expected to advance to Proposed Recommendation no earlier than\n ${conf.humanCREnd}.\n `\n : \"\"}\n ${conf.isPER\n ? html`\n W3C Advisory Committee Members are invited\n to send formal review comments on this\n Proposed Edited Recommendation to the W3C\n Team until ${conf.humanPEREnd}. Members of\n the Advisory Committee will find the\n appropriate review form for this document by\n consulting their list of current\n <a\n href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\n `\n : \"\"}\n ${conf.isPR\n ? html`\n The W3C Membership and other interested\n parties are invited to review the document\n and send comments to\n <a\n rel=\"discussion\"\n href=\"${opts.mailToWGPublicList}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a\n href=\"${opts.mailToWGPublicListSubscription}\"\n >subscribe</a\n >,\n <a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >) through ${conf.humanPREnd}. Advisory\n Committee Representatives should consult\n their\n <a\n href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments\n were expected during the Candidate\n Recommendation review period that ended\n ${conf.humanCREnd}.\n `\n : \"\"}\n </p>\n `\n : \"\"}\n `\n : \"\"}\n ${conf.implementationReportURI\n ? renderImplementationReportURI(conf)\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.notRec ? renderNotRec(conf) : \"\"}\n ${conf.isRec ? renderIsRec() : \"\"} ${renderDeliverer(conf)}\n <p>\n This document is governed by the\n <a\n id=\"w3c_process_revision\"\n href=\"https://www.w3.org/2019/Process-20190301/\"\n >1 March 2019 W3C Process Document</a\n >.\n </p>\n ${conf.addPatentNote\n ? html`\n <p>${raw(conf.addPatentNote)}</p>\n `\n : \"\"}\n `}\n `}\n ${[...opts.additionalSections]}\n `;\n};\n\nfunction renderPreview(conf) {\n const { prUrl, prNumber, edDraftURI } = conf;\n return html`\n <details class=\"annoying-warning\" open=\"\">\n <summary\n >This is a\n preview${prUrl && prNumber\n ? html`\n of pull request\n <a href=\"${prUrl}\">#${prNumber}</a>\n `\n : \"\"}</summary\n >\n <p>\n Do not attempt to implement this version of the specification. Do not\n reference this version as authoritative in any way.\n ${edDraftURI\n ? html`\n Instead, see\n <a href=\"${edDraftURI}\">${edDraftURI}</a> for the Editor's draft.\n `\n : \"\"}\n </p>\n </details>\n `;\n}\n\nfunction renderIsUnofficial(opts) {\n const { additionalContent } = opts;\n return html`\n <p>\n This document is draft of a potential specification. It has no official\n standing of any kind and does not represent the support or consensus of\n any standards organization.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderIsNoTrack(conf, opts) {\n const { isMO } = conf;\n const { additionalContent } = opts;\n return html`\n <p>\n This document is merely a W3C-internal\n ${isMO ? \"member-confidential\" : \"\"} document. It has no official standing\n of any kind and does not represent consensus of the W3C Membership.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderImplementationReportURI(conf) {\n const { implementationReportURI } = conf;\n return html`\n <p>\n Please see the Working Group's\n <a href=\"${implementationReportURI}\">implementation report</a>.\n </p>\n `;\n}\n\nfunction renderNotRec(conf) {\n const { anOrA, textStatus } = conf;\n return html`\n <p>\n Publication as ${anOrA} ${textStatus} does not imply endorsement by the\n W3C Membership. This is a draft document and may be updated, replaced or\n obsoleted by other documents at any time. It is inappropriate to cite this\n document as other than work in progress.\n </p>\n `;\n}\n\nfunction renderIsRec() {\n html`\n <p>\n This document has been reviewed by W3C Members, by software developers,\n and by other W3C groups and interested parties, and is endorsed by the\n Director as a W3C Recommendation. It is a stable document and may be used\n as reference material or cited from another document. W3C's role in making\n the Recommendation is to draw attention to the specification and to\n promote its widespread deployment. This enhances the functionality and\n interoperability of the Web.\n </p>\n `;\n}\n\nfunction renderDeliverer(conf) {\n const {\n isNote,\n wgId,\n isIGNote,\n multipleWGs,\n recNotExpected,\n wgPatentHTML,\n wgPatentURI,\n charterDisclosureURI,\n } = conf;\n\n const producers = !isIGNote\n ? html`\n This document was produced by ${multipleWGs ? \"groups\" : \"a group\"}\n operating under the\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/\"\n >W3C Patent Policy</a\n >.\n `\n : \"\";\n const wontBeRec = recNotExpected\n ? \"The group does not expect this document to become a W3C Recommendation.\"\n : \"\";\n const paragraph = html`\n <p>\n ${producers} ${wontBeRec}\n ${!isNote && !isIGNote\n ? html`\n ${multipleWGs\n ? html`\n W3C maintains ${raw(wgPatentHTML)}\n `\n : html`\n W3C maintains a\n <a href=\"${wgPatentURI}\" rel=\"disclosure\"\n >public list of any patent disclosures</a\n >\n `}\n made in connection with the deliverables of\n ${multipleWGs\n ? \"each group; these pages also include\"\n : \"the group; that page also includes\"}\n instructions for disclosing a patent. An individual who has actual\n knowledge of a patent which the individual believes contains\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#def-essential\"\n >Essential Claim(s)</a\n >\n must disclose the information in accordance with\n <a\n href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure\"\n >section 6 of the W3C Patent Policy</a\n >.\n `\n : \"\"}\n ${isIGNote\n ? html`\n The disclosure obligations of the Participants of this group are\n described in the\n <a href=\"${charterDisclosureURI}\">charter</a>.\n `\n : \"\"}\n </p>\n `;\n if (isNote) {\n paragraph.dataset.deliverer = wgId;\n }\n return paragraph;\n}\n\nfunction noteForSubmission(conf, opts) {\n return html`\n ${opts.additionalContent}\n ${conf.isMemberSubmission\n ? noteForMemberSubmission(conf)\n : conf.isTeamSubmission\n ? noteForTeamSubmission(conf, opts)\n : \"\"}\n `;\n}\n\nfunction noteForMemberSubmission(conf) {\n const teamComment = `https://www.w3.org/Submission/${conf.publishDate.getUTCFullYear()}/${\n conf.submissionCommentNumber\n }/Comment/`;\n return html`\n <p>\n By publishing this document, W3C acknowledges that the\n <a href=\"${conf.thisVersion}\">Submitting Members</a> have made a formal\n Submission request to W3C for discussion. Publication of this document by\n W3C indicates no endorsement of its content by W3C, nor that W3C has, is,\n or will be allocating any resources to the issues addressed by it. This\n document is not the product of a chartered W3C group, but is published as\n potential input to the\n <a href=\"https://www.w3.org/Consortium/Process\">W3C Process</a>. A\n <a href=\"${teamComment}\">W3C Team Comment</a> has been published in\n conjunction with this Member Submission. Publication of acknowledged\n Member Submissions at the W3C site is one of the benefits of\n <a href=\"https://www.w3.org/Consortium/Prospectus/Joining\">\n W3C Membership</a\n >. Please consult the requirements associated with Member Submissions of\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-submissions\"\n >section 3.3 of the W3C Patent Policy</a\n >. Please consult the complete\n <a href=\"https://www.w3.org/Submission\"\n >list of acknowledged W3C Member Submissions</a\n >.\n </p>\n `;\n}\n\nfunction noteForTeamSubmission(conf, opts) {\n return html`\n <p>\n If you wish to make comments regarding this document, please send them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a href=\"${opts.mailToWGPublicListSubscription}\">subscribe</a>,\n <a href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html`\n with <code>${conf.subjectPrefix}</code> at the start of your email's\n subject\n `\n : \"\"}.\n </p>\n <p>\n Please consult the complete\n <a href=\"https://www.w3.org/TeamSubmission/\">list of Team Submissions</a>.\n </p>\n `;\n}\n\nfunction linkToWorkingGroup(conf) {\n if (!conf.wg) {\n return;\n }\n return html`\n <p>\n This document was published by ${raw(conf.wgHTML)} as ${conf.anOrA}\n ${conf.longStatus}.\n ${conf.notYetRec\n ? \"This document is intended to become a W3C Recommendation.\"\n : \"\"}\n </p>\n `;\n}\n\nfunction linkToCommunity(conf, opts) {\n if (!conf.github && !conf.wgPublicList) {\n return;\n }\n return html`\n <p>\n ${conf.github\n ? html`\n <a href=\"${conf.issueBase}\">GitHub Issues</a> are preferred for\n discussion of this specification.\n `\n : \"\"}\n ${conf.wgPublicList\n ? html`\n ${conf.github && conf.wgPublicList\n ? \"Alternatively, you can send comments to our mailing list.\"\n : \"Comments regarding this document are welcome.\"}\n Please send them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html`\n with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject\n `\n : \"\"}.\n `\n : \"\"}\n </p>\n `;\n}\n","// @ts-check\n/* jshint forin: false */\n\n// Module w3c/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - shortName: the small name that is used after /TR/ in published reports (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - previousPublishDate: the date on which the previous version was published.\n// - previousMaturity: the specStatus of the previous version\n// - errata: the URI of the errata document, if any\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specifiy either src or alt\n// - testSuiteURI: the URI to the test suite, if any\n// - implementationReportURI: the URI to the implementation report, if any\n// - bugTracker: and object with the following details\n// - open: pointer to the list of open bugs\n// - new: pointer to where to raise new bugs\n// - noRecTrack: set to true if this document is not intended to be on the Recommendation track\n// - edDraftURI: the URI of the Editor's Draft for this document, if any. Required if\n// specStatus is set to \"ED\".\n// - additionalCopyrightHolders: a copyright owner in addition to W3C (or the only one if specStatus\n// is unofficial)\n// - overrideCopyright: provides markup to completely override the copyright\n// - copyrightStart: the year from which the copyright starts running\n// - prevED: the URI of the previous Editor's Draft if it has moved\n// - prevRecShortname: the short name of the previous Recommendation, if the name has changed\n// - prevRecURI: the URI of the previous Recommendation if not directly generated from\n// prevRecShortname.\n// - wg: the name of the WG in charge of the document. This may be an array in which case wgURI\n// and wgPatentURI need to be arrays as well, of the same length and in the same order\n// - wgURI: the URI to the group's page, or an array of such\n// - wgPatentURI: the URI to the group's patent information page, or an array of such. NOTE: this\n// is VERY IMPORTANT information to provide and get right, do not just paste this without checking\n// that you're doing it right\n// - wgPublicList: the name of the mailing list where discussion takes place. Note that this cannot\n// be an array as it is assumed that there is a single list to discuss the document, even if it\n// is handled by multiple groups\n// - charterDisclosureURI: used for IGs (when publishing IG-NOTEs) to provide a link to the IPR commitment\n// defined in their charter.\n// - addPatentNote: used to add patent-related information to the SotD, for instance if there's an open\n// PAG on the document.\n// - thisVersion: the URI to the dated current version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - latestVersion: the URI to the latest (undated) version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - prevVersion: the URI to the previous (dated) version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - subjectPrefix: the string that is expected to be used as a subject prefix when posting to the mailing\n// list of the group.\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by\", which is experimentally available in some groups (but likely to be phased out).\n// Note that this is a dual licensing regime.\n// - \"cc0\", an extremely permissive license. It is only recommended if you are working on a document that is\n// intended to be pushed to the WHATWG.\n// - \"w3c-software\", a permissive and attributions license (but GPL-compatible).\n// - \"w3c-software-doc\", (default) the W3C Software and Document License\n// https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\nimport { ISODate, concatDate, joinAnd } from \"../core/utils.js\";\nimport cgbgHeadersTmpl from \"./templates/cgbg-headers.js\";\nimport cgbgSotdTmpl from \"./templates/cgbg-sotd.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport sotdTmpl from \"./templates/sotd.js\";\n\nexport const name = \"w3c/headers\";\n\nconst W3CDate = new Intl.DateTimeFormat([\"en-AU\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\nconst status2maturity = {\n LS: \"WD\",\n LD: \"WD\",\n FPWD: \"WD\",\n LC: \"WD\",\n FPLC: \"WD\",\n \"FPWD-NOTE\": \"NOTE\",\n \"WD-NOTE\": \"WD\",\n \"LC-NOTE\": \"LC\",\n \"IG-NOTE\": \"NOTE\",\n \"WG-NOTE\": \"NOTE\",\n};\n\nconst status2rdf = {\n NOTE: \"w3p:NOTE\",\n WD: \"w3p:WD\",\n LC: \"w3p:LastCall\",\n CR: \"w3p:CR\",\n PR: \"w3p:PR\",\n REC: \"w3p:REC\",\n PER: \"w3p:PER\",\n RSCND: \"w3p:RSCND\",\n};\nconst status2text = {\n NOTE: \"Working Group Note\",\n \"WG-NOTE\": \"Working Group Note\",\n \"CG-NOTE\": \"Co-ordination Group Note\",\n \"IG-NOTE\": \"Interest Group Note\",\n \"Member-SUBM\": \"Member Submission\",\n \"Team-SUBM\": \"Team Submission\",\n MO: \"Member-Only Document\",\n ED: \"Editor's Draft\",\n LS: \"Living Standard\",\n LD: \"Living Document\",\n FPWD: \"First Public Working Draft\",\n WD: \"Working Draft\",\n \"FPWD-NOTE\": \"Working Group Note\",\n \"WD-NOTE\": \"Working Draft\",\n \"LC-NOTE\": \"Working Draft\",\n FPLC: \"First Public and Last Call Working Draft\",\n LC: \"Last Call Working Draft\",\n CR: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n PER: \"Proposed Edited Recommendation\",\n REC: \"Recommendation\",\n RSCND: \"Rescinded Recommendation\",\n unofficial: \"Unofficial Draft\",\n base: \"Document\",\n finding: \"TAG Finding\",\n \"draft-finding\": \"Draft TAG Finding\",\n \"CG-DRAFT\": \"Draft Community Group Report\",\n \"CG-FINAL\": \"Final Community Group Report\",\n \"BG-DRAFT\": \"Draft Business Group Report\",\n \"BG-FINAL\": \"Final Business Group Report\",\n};\nconst status2long = {\n ...status2text,\n \"FPWD-NOTE\": \"First Public Working Group Note\",\n \"LC-NOTE\": \"Last Call Working Draft\",\n};\nconst maybeRecTrack = [\"FPWD\", \"WD\"];\nconst recTrackStatus = [\"FPLC\", \"LC\", \"CR\", \"PR\", \"PER\", \"REC\"];\nconst noTrackStatus = [\n \"base\",\n \"BG-DRAFT\",\n \"BG-FINAL\",\n \"CG-DRAFT\",\n \"CG-FINAL\",\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\nconst cgbg = [\"CG-DRAFT\", \"CG-FINAL\", \"BG-DRAFT\", \"BG-FINAL\"];\nconst precededByAn = [\"ED\", \"IG-NOTE\"];\nconst licenses = {\n cc0: {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n \"w3c-software\": {\n name: \"W3C Software Notice and License\",\n short: \"W3C Software\",\n url: \"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231\",\n },\n \"w3c-software-doc\": {\n name: \"W3C Software and Document Notice and License\",\n short: \"W3C Software and Document\",\n url:\n \"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\",\n },\n \"cc-by\": {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n};\n\nconst baseLogo = Object.freeze({\n id: \"\",\n alt: \"\",\n href: \"\",\n src: \"\",\n height: \"48\",\n width: \"72\",\n});\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n pub(\"error\", msg);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n if (conf.isUnofficial && !Array.isArray(conf.logos)) {\n conf.logos = [];\n }\n conf.isCCBY = conf.license === \"cc-by\";\n conf.isW3CSoftAndDocLicense = conf.license === \"w3c-software-doc\";\n if ([\"cc-by\"].includes(conf.license)) {\n let msg = `You cannot use license \"\\`${conf.license}\\`\" with W3C Specs. `;\n msg += `Please set \\`respecConfig.license: \"w3c-software-doc\"\\` instead.`;\n pub(\"error\", msg);\n }\n conf.licenseInfo = licenses[conf.license];\n conf.isCGBG = cgbg.includes(conf.specStatus);\n conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith(\"G-FINAL\");\n conf.isBasic = conf.specStatus === \"base\";\n conf.isRegular = !conf.isCGBG && !conf.isBasic;\n if (!conf.specStatus) {\n pub(\"error\", \"Missing required configuration: `specStatus`\");\n }\n if (conf.isRegular && !conf.shortName) {\n pub(\"error\", \"Missing required configuration: `shortName`\");\n }\n if (conf.testSuiteURI) {\n const url = new URL(conf.testSuiteURI, location.href);\n const { host, pathname } = url;\n if (\n host === \"github.com\" &&\n pathname.startsWith(\"/w3c/web-platform-tests/\")\n ) {\n const msg =\n \"Web Platform Tests have moved to a new Github Organization at https://github.com/web-platform-tests. \" +\n \"Please update your [`testSuiteURI`](https://github.com/w3c/respec/wiki/testSuiteURI) to point to the \" +\n `new tests repository (e.g., https://github.com/web-platform-tests/wpt/${conf.shortName} ).`;\n pub(\"warn\", msg);\n }\n }\n conf.title = document.title || \"No Title\";\n if (document.title && conf.isPreview && conf.prNumber) {\n document.title = `Preview of PR #${conf.prNumber}: ${document.title}`;\n }\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = W3CDate.format(conf.publishDate);\n conf.isNoTrack = noTrackStatus.includes(conf.specStatus);\n conf.isRecTrack = conf.noRecTrack\n ? false\n : recTrackStatus.concat(maybeRecTrack).includes(conf.specStatus);\n conf.isMemberSubmission = conf.specStatus === \"Member-SUBM\";\n if (conf.isMemberSubmission) {\n const memSubmissionLogo = {\n alt: \"W3C Member Submission\",\n href: \"https://www.w3.org/Submission/\",\n src: \"https://www.w3.org/Icons/member_subm-v.svg\",\n width: \"211\",\n };\n conf.logos.push({ ...baseLogo, ...memSubmissionLogo });\n }\n conf.isTeamSubmission = conf.specStatus === \"Team-SUBM\";\n if (conf.isTeamSubmission) {\n const teamSubmissionLogo = {\n alt: \"W3C Team Submission\",\n href: \"https://www.w3.org/TeamSubmission/\",\n src: \"https://www.w3.org/Icons/team_subm-v.svg\",\n width: \"211\",\n };\n conf.logos.push({ ...baseLogo, ...teamSubmissionLogo });\n }\n conf.isSubmission = conf.isMemberSubmission || conf.isTeamSubmission;\n conf.anOrA = precededByAn.includes(conf.specStatus) ? \"an\" : \"a\";\n conf.isTagFinding =\n conf.specStatus === \"finding\" || conf.specStatus === \"draft-finding\";\n if (!conf.edDraftURI) {\n conf.edDraftURI = \"\";\n if (conf.specStatus === \"ED\")\n pub(\"warn\", \"Editor's Drafts should set edDraftURI.\");\n }\n conf.maturity = status2maturity[conf.specStatus]\n ? status2maturity[conf.specStatus]\n : conf.specStatus;\n let publishSpace = \"TR\";\n if (conf.specStatus === \"Member-SUBM\") publishSpace = \"Submission\";\n else if (conf.specStatus === \"Team-SUBM\") publishSpace = \"TeamSubmission\";\n if (conf.isRegular)\n conf.thisVersion = `https://www.w3.org/${publishSpace}/${conf.publishDate.getUTCFullYear()}/${\n conf.maturity\n }-${conf.shortName}-${concatDate(conf.publishDate)}/`;\n if (conf.specStatus === \"ED\") conf.thisVersion = conf.edDraftURI;\n if (conf.isRegular)\n conf.latestVersion = `https://www.w3.org/${publishSpace}/${conf.shortName}/`;\n if (conf.isTagFinding) {\n conf.latestVersion = `https://www.w3.org/2001/tag/doc/${conf.shortName}`;\n conf.thisVersion = `${conf.latestVersion}-${ISODate.format(\n conf.publishDate\n )}`;\n }\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n pub(\"error\", \"`previousPublishDate` is set, but not `previousMaturity`.\");\n }\n\n conf.previousPublishDate = validateDateAndRecover(\n conf,\n \"previousPublishDate\"\n );\n\n const pmat = status2maturity[conf.previousMaturity]\n ? status2maturity[conf.previousMaturity]\n : conf.previousMaturity;\n if (conf.isTagFinding) {\n conf.prevVersion = `${conf.latestVersion}-${ISODate.format(\n conf.previousPublishDate\n )}`;\n } else if (conf.isCGBG) {\n conf.prevVersion = conf.prevVersion || \"\";\n } else if (conf.isBasic) {\n conf.prevVersion = \"\";\n } else {\n conf.prevVersion = `https://www.w3.org/TR/${conf.previousPublishDate.getUTCFullYear()}/${pmat}-${\n conf.shortName\n }-${concatDate(conf.previousPublishDate)}/`;\n }\n } else {\n if (\n !conf.specStatus.endsWith(\"NOTE\") &&\n conf.specStatus !== \"FPWD\" &&\n conf.specStatus !== \"FPLC\" &&\n conf.specStatus !== \"ED\" &&\n !conf.noRecTrack &&\n !conf.isNoTrack &&\n !conf.isSubmission\n )\n pub(\n \"error\",\n \"Document on track but no previous version:\" +\n \" Add `previousMaturity`, and `previousPublishDate` to ReSpec's config.\"\n );\n if (!conf.prevVersion) conf.prevVersion = \"\";\n }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = `https://www.w3.org/TR/${conf.prevRecShortname}`;\n const peopCheck = function(it) {\n if (!it.name) pub(\"error\", \"All authors and editors must have a name.\");\n if (it.orcid) {\n try {\n it.orcid = normalizeOrcid(it.orcid);\n } catch (e) {\n pub(\"error\", `\"${it.orcid}\" is not an ORCID. ${e.message}`);\n // A failed orcid link could link to something outside of orcid,\n // which would be misleading.\n delete it.orcid;\n }\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0)\n pub(\"error\", \"At least one editor is required\");\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n (conf.alternateFormats || []).forEach(it => {\n if (!it.uri || !it.label) {\n pub(\"error\", \"All alternate formats must have a uri and a label.\");\n }\n });\n conf.multipleAlternates =\n conf.alternateFormats && conf.alternateFormats.length > 1;\n conf.alternatesHTML =\n conf.alternateFormats &&\n joinAnd(conf.alternateFormats, alt => {\n let optional =\n alt.hasOwnProperty(\"lang\") && alt.lang ? ` hreflang='${alt.lang}'` : \"\";\n optional +=\n alt.hasOwnProperty(\"type\") && alt.type ? ` type='${alt.type}'` : \"\";\n return `<a rel='alternate' href='${alt.uri}'${optional}>${alt.label}</a>`;\n });\n if (conf.bugTracker) {\n if (conf.bugTracker.new && conf.bugTracker.open) {\n conf.bugTrackerHTML = `<a href='${conf.bugTracker.new}'>${conf.l10n.file_a_bug}</a> ${conf.l10n.open_parens}<a href='${conf.bugTracker.open}'>${conf.l10n.open_bugs}</a>${conf.l10n.close_parens}`;\n } else if (conf.bugTracker.open) {\n conf.bugTrackerHTML = `<a href='${conf.bugTracker.open}'>open bugs</a>`;\n } else if (conf.bugTracker.new) {\n conf.bugTrackerHTML = `<a href='${conf.bugTracker.new}'>file a bug</a>`;\n }\n }\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.longStatus = status2long[conf.specStatus];\n conf.textStatus = status2text[conf.specStatus];\n if (status2rdf[conf.specStatus]) {\n conf.rdfStatus = status2rdf[conf.specStatus];\n }\n conf.showThisVersion = !conf.isNoTrack || conf.isTagFinding;\n conf.showPreviousVersion =\n conf.specStatus !== \"FPWD\" &&\n conf.specStatus !== \"FPLC\" &&\n conf.specStatus !== \"ED\" &&\n !conf.isNoTrack &&\n !conf.isSubmission;\n if (conf.specStatus.endsWith(\"NOTE\") && !conf.prevVersion)\n conf.showPreviousVersion = false;\n if (conf.isTagFinding)\n conf.showPreviousVersion = conf.previousPublishDate ? true : false;\n conf.notYetRec = conf.isRecTrack && conf.specStatus !== \"REC\";\n conf.isRec = conf.isRecTrack && conf.specStatus === \"REC\";\n if (conf.isRec && !conf.errata)\n pub(\"error\", \"Recommendations must have an errata link.\");\n conf.notRec = conf.specStatus !== \"REC\";\n conf.prependW3C = !conf.isUnofficial;\n conf.isED = conf.specStatus === \"ED\";\n conf.isCR = conf.specStatus === \"CR\";\n conf.isPR = conf.specStatus === \"PR\";\n conf.isPER = conf.specStatus === \"PER\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = [\"FPWD-NOTE\", \"WG-NOTE\"].includes(conf.specStatus);\n conf.isIGNote = conf.specStatus === \"IG-NOTE\";\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n conf.shortISODate = ISODate.format(conf.publishDate);\n if (conf.hasOwnProperty(\"wgPatentURI\") && !Array.isArray(conf.wgPatentURI)) {\n Object.defineProperty(conf, \"wgId\", {\n get() {\n // it's always at \"pp-impl\" + 1\n const urlParts = this.wgPatentURI.split(\"/\");\n const pos = urlParts.findIndex(item => item === \"pp-impl\") + 1;\n return urlParts[pos] || \"\";\n },\n });\n } else {\n conf.wgId = conf.wgId ? conf.wgId : \"\";\n }\n // configuration done - yay!\n\n // insert into document\n const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // handle SotD\n const sotd =\n document.getElementById(\"sotd\") || document.createElement(\"section\");\n if ((conf.isCGBG || !conf.isNoTrack || conf.isTagFinding) && !sotd.id) {\n pub(\n \"error\",\n \"A custom SotD paragraph is required for your type of document.\"\n );\n }\n sotd.id = sotd.id || \"sotd\";\n sotd.classList.add(\"introductory\");\n // NOTE:\n // When arrays, wg and wgURI have to be the same length (and in the same order).\n // Technically wgURI could be longer but the rest is ignored.\n // However wgPatentURI can be shorter. This covers the case where multiple groups\n // publish together but some aren't used for patent policy purposes (typically this\n // happens when one is foolish enough to do joint work with the TAG). In such cases,\n // the groups whose patent policy applies need to be listed first, and wgPatentURI\n // can be shorter — but it still needs to be an array.\n const wgPotentialArray = [conf.wg, conf.wgURI, conf.wgPatentURI];\n if (\n wgPotentialArray.some(item => Array.isArray(item)) &&\n !wgPotentialArray.every(item => Array.isArray(item))\n ) {\n pub(\n \"error\",\n \"If one of '`wg`', '`wgURI`', or '`wgPatentURI`' is an array, they all have to be.\"\n );\n }\n if (conf.isCGBG && !conf.wg) {\n pub(\n \"error\",\n \"[`wg`](https://github.com/w3c/respec/wiki/wg)\" +\n \" configuration option is required for this kind of document.\"\n );\n }\n if (Array.isArray(conf.wg)) {\n conf.multipleWGs = conf.wg.length > 1;\n conf.wgHTML = joinAnd(conf.wg, (wg, idx) => {\n return `the <a href='${conf.wgURI[idx]}'>${wg}</a>`;\n });\n const pats = [];\n for (let i = 0, n = conf.wg.length; i < n; i++) {\n pats.push(\n `a <a href='${conf.wgPatentURI[i]}' rel='disclosure'>` +\n `public list of any patent disclosures (${conf.wg[i]})</a>`\n );\n }\n conf.wgPatentHTML = joinAnd(pats);\n } else {\n conf.multipleWGs = false;\n if (conf.wg) {\n conf.wgHTML = `the <a href='${conf.wgURI}'>${conf.wg}</a>`;\n }\n }\n if (conf.specStatus === \"PR\" && !conf.crEnd) {\n pub(\n \"error\",\n `\\`specStatus\\` is \"PR\" but no \\`crEnd\\` is specified (needed to indicate end of previous CR).`\n );\n }\n\n if (conf.specStatus === \"CR\" && !conf.crEnd) {\n pub(\n \"error\",\n `\\`specStatus\\` is \"CR\", but no \\`crEnd\\` is specified in Respec config.`\n );\n }\n conf.crEnd = validateDateAndRecover(conf, \"crEnd\");\n conf.humanCREnd = W3CDate.format(conf.crEnd);\n\n if (conf.specStatus === \"PR\" && !conf.prEnd) {\n pub(\"error\", `\\`specStatus\\` is \"PR\" but no \\`prEnd\\` is specified.`);\n }\n conf.prEnd = validateDateAndRecover(conf, \"prEnd\");\n conf.humanPREnd = W3CDate.format(conf.prEnd);\n\n if (conf.specStatus === \"PER\" && !conf.perEnd) {\n pub(\"error\", \"Status is PER but no perEnd is specified\");\n }\n conf.perEnd = validateDateAndRecover(conf, \"perEnd\");\n conf.humanPEREnd = W3CDate.format(conf.perEnd);\n conf.recNotExpected =\n conf.noRecTrack || conf.recNotExpected\n ? true\n : !conf.isRecTrack &&\n conf.maturity == \"WD\" &&\n conf.specStatus !== \"FPWD-NOTE\";\n if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) {\n pub(\n \"error\",\n `Document configured as [\\`noRecTrack\\`](https://github.com/w3c/respec/wiki/noRecTrack), but its status (\"${\n conf.specStatus\n }\") puts it on the W3C Rec Track. Status cannot be any of: ${recTrackStatus.join(\n \", \"\n )}. [More info](https://github.com/w3c/respec/wiki/noRecTrack).`\n );\n }\n if (conf.isIGNote && !conf.charterDisclosureURI) {\n pub(\n \"error\",\n \"IG-NOTEs must link to charter's disclosure section using `charterDisclosureURI`.\"\n );\n }\n\n const populated = populateSoTD(conf, sotd);\n sotd.textContent = \"\";\n sotd.append(...populated.childNodes);\n\n if (!conf.implementationReportURI && conf.isCR) {\n pub(\n \"error\",\n \"CR documents must have an [`implementationReportURI`](https://github.com/w3c/respec/wiki/implementationReportURI) \" +\n \"that describes [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).\"\n );\n }\n if (!conf.implementationReportURI && conf.isPR) {\n pub(\n \"warn\",\n \"PR documents should include an \" +\n \" [`implementationReportURI`](https://github.com/w3c/respec/wiki/implementationReportURI)\" +\n \" that describes [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).\"\n );\n }\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n\n/**\n * @param {*} conf\n * @param {HTMLElement} sotd\n */\nfunction populateSoTD(conf, sotd) {\n const options = {\n ...collectSotdContent(sotd, conf),\n\n get mailToWGPublicList() {\n return `mailto:${conf.wgPublicList}@w3.org`;\n },\n get mailToWGPublicListWithSubject() {\n const fragment = conf.subjectPrefix\n ? `?subject=${encodeURIComponent(conf.subjectPrefix)}`\n : \"\";\n return this.mailToWGPublicList + fragment;\n },\n get mailToWGPublicListSubscription() {\n return `mailto:${conf.wgPublicList}-request@w3.org?subject=subscribe`;\n },\n };\n const template = conf.isCGBG ? cgbgSotdTmpl : sotdTmpl;\n return template(conf, options);\n}\n\n/**\n * @param {HTMLElement} sotd\n */\nfunction collectSotdContent(sotd, { isTagFinding = false }) {\n const sotdClone = sotd.cloneNode(true);\n const additionalContent = document.createDocumentFragment();\n // we collect everything until we hit a section,\n // that becomes the custom content.\n while (sotdClone.hasChildNodes()) {\n if (\n isElement(sotdClone.firstChild) &&\n sotdClone.firstChild.localName === \"section\"\n ) {\n break;\n }\n additionalContent.appendChild(sotdClone.firstChild);\n }\n if (isTagFinding && !additionalContent.hasChildNodes()) {\n pub(\n \"warn\",\n \"ReSpec does not support automated SotD generation for TAG findings, \" +\n \"please add the prerequisite content in the 'sotd' section\"\n );\n }\n return {\n additionalContent,\n // Whatever sections are left, we throw at the end.\n additionalSections: sotdClone.childNodes,\n };\n}\n\n/**\n * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the /\n * @return {string} the full ORCID URL. Throws an error if the ID is invalid.\n */\nfunction normalizeOrcid(orcid) {\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n if (orcidUrl.origin !== \"https://orcid.org\") {\n throw new Error(\n `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`\n );\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n throw new Error(\n `ORCIDs have the format \"1234-1234-1234-1234\", not \"${orcidId}\"`\n );\n }\n\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcidId[orcidId.length - 1];\n const remainder = orcidId\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n if (lastDigit !== lastDigitShould) {\n throw new Error(`\"${orcidId}\" has an invalid checksum.`);\n }\n\n return orcidUrl.href;\n}\n\n/**\n * @param {Node} node\n * @return {node is Element}\n */\nfunction isElement(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n","// @ts-check\n// Module w3c/abstract\n// Handle the abstract section properly.\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nexport const name = \"w3c/abstract\";\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n pub(\"error\", `Document must have one element with \\`id=\"abstract\"`);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n[lang].abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showInlineWarning } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg =\n `[\\`data-abbr\\`](https://github.com/w3c/respec/wiki/data-abbr)` +\n ` attribute not supported on \\`${localName}\\` elements.`;\n showInlineWarning(elem, msg, \"Error: unsupported.\");\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { hyperHTML, raw } from \"./import-maps.js\";\nimport { showInlineError } from \"./utils.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+$/; // {{unrestricted double}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\nconst methodRegex = /(\\w+)\\((.*)\\)$/;\nconst slotRegex = /^\\[\\[(\\w+)\\]\\]$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+)(?:\\]\\])?)$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\n\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n const [nonMethodPart, methodPart] = str.split(methodSplitRegex);\n const tokens = nonMethodPart\n .split(/[./]/)\n .concat(methodPart)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs] = value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n results.push({ type: \"method\", identifier, args, renderParent });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier] = value.match(slotRegex);\n results.push({ type: \"internal-slot\", identifier, renderParent });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n results.push({ type: \"idl-primitive\", identifier: value, renderParent });\n continue;\n }\n // base, always final token\n if (attributeRegex.test(value) && tokens.length === 0) {\n results.push({ type: \"base\", identifier: value, renderParent });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent } = details;\n if (renderParent) {\n return hyperHTML`<a data-xref-type=\"_IDL_\"><code>${identifier}</code></a>`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const lt = `[[${identifier}]]`;\n const dot = parent && renderParent ? \".\" : \"\";\n const anchor = hyperHTML`<a\n data-xref-type=\"attribute\"\n data-lt=\"${lt}\"><code>[[${identifier}]]</code></a>`;\n if (linkFor) {\n anchor.dataset.linkFor = linkFor;\n anchor.dataset.xrefFor = linkFor;\n }\n return hyperHTML`${dot}${anchor}${\"\"}`; // TODO: remove dangling empty string\n}\n\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const html = hyperHTML`${renderParent ? \".\" : \"\"}<a\n data-xref-type=\"attribute|dict-member\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a>${\"\"}`; // TODO: remove dangling empty string\n return html;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = args.map(arg => `<var>${arg}</var>`).join(\", \");\n const searchText = `${identifier}(${args.join(\", \")})`;\n const html = hyperHTML`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${identifier}</code></a><code>(${raw(argsText)})</code>`;\n return html;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifier / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const anchor = hyperHTML`<a\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n ><code>${enumValue}</code></a>`;\n if (!enumValue) {\n anchor.dataset.lt = \"the-empty-string\";\n }\n return hyperHTML`\"${anchor}\"`;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const html = hyperHTML`\"<a\n data-cite=\"WebIDL\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a>\"`;\n return html;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier } = details;\n const html = hyperHTML`<a\n data-cite=\"WebIDL\"\n data-xref-type=\"interface\"\n ><code>${identifier}</code></a>`;\n return html;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = hyperHTML`<span>{{ ${str} }}</span>`;\n showInlineError(el, error.message, \"Error: Invalid inline IDL string\");\n return el;\n }\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = hyperHTML`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { flatten } from \"./utils.js\";\nimport { idb } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n return await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<Object?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<Object?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {Object} data An object that contains references and aliases.\n */\n async addAll(data) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = {\n alias: new Set(),\n reference: new Set(),\n };\n Object.keys(data)\n .filter(key => {\n if (typeof data[key] === \"string\") {\n let msg = `Legacy SpecRef entries are not supported: \\`[[${key}]]\\`. `;\n msg +=\n \"Please update it to the new format at [specref repo](https://github.com/tobie/specref/)\";\n pub(\"error\", msg);\n return false;\n }\n return true;\n })\n .map(id => Object.assign({ id }, data[id]))\n .forEach(obj => {\n if (obj.aliasOf) {\n aliasesAndRefs.alias.add(obj);\n } else {\n aliasesAndRefs.reference.add(obj);\n }\n });\n const promisesToAdd = [...ALLOWED_TYPES]\n .map(type => {\n return Array.from(aliasesAndRefs[type]).map(details =>\n this.add(type, details)\n );\n })\n .reduce(flatten, []);\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {Object} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n const isInDB = await this.has(type, details.id);\n const store = db.transaction(type, \"readwrite\").store;\n // update or add, depending of already having it in db\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\n/* jshint jquery: true */\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const biblio = {};\n\n// for backward compatibity\nexport { wireReference, stringifyReference } from \"./render-biblio.js\";\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://specref.herokuapp.com/bibrefs?refs=\");\n\n/**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\nfunction normalizeReferences(conf) {\n const normalizedNormativeRefs = new Set(\n [...conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey => conf.informativeReferences.delete(redundantKey));\n}\n\nfunction getRefKeys(conf) {\n return {\n informativeReferences: Array.from(conf.informativeReferences),\n normativeReferences: Array.from(conf.normativeReferences),\n };\n}\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n const data = await response.json();\n try {\n await biblioDB.addAll(data);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\nexport async function run(conf) {\n const finish = () => {\n doneResolver(conf.biblio);\n };\n if (!conf.localBiblio) {\n conf.localBiblio = {};\n }\n if (conf.biblio) {\n let msg = \"Overriding `.biblio` in config. Please use \";\n msg += \"`.localBiblio` for custom biblio entries.\";\n pub(\"warn\", msg);\n }\n conf.biblio = biblio;\n const localAliases = Array.from(Object.keys(conf.localBiblio))\n .filter(key => conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => conf.localBiblio[key].aliasOf)\n .filter(key => !conf.localBiblio.hasOwnProperty(key));\n normalizeReferences(conf);\n const allRefs = getRefKeys(conf);\n const neededRefs = allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n // remove duplicates\n .reduce((collector, item) => {\n if (collector.indexOf(item) === -1) {\n collector.push(item);\n }\n return collector;\n }, [])\n .sort();\n const idbRefs = [];\n\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, conf.localBiblio);\n finish();\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { hyperHTML, raw } from \"./import-maps.js\";\nimport { addId } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"FPWD\", \"W3C First Public Working Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n [\"WG-NOTE\", \"W3C Working Group Note\"],\n]);\n\nconst defaultsReference = Object.freeze({\n authors: [],\n date: \"\",\n href: \"\",\n publisher: \"\",\n status: \"\",\n title: \"\",\n etAl: false,\n});\n\nconst endWithDot = endNormalizer(\".\");\n\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length && !conf.refNote) return;\n\n const refsec = hyperHTML`\n <section id='references' class='appendix'>\n <h2>${l10n.references}</h2>\n ${conf.refNote ? hyperHTML`<p>${conf.refNote}</p>` : \"\"}\n </section>`;\n\n for (const type of [\"Normative\", \"Informative\"]) {\n const refs = type === \"Normative\" ? norms : informs;\n if (!refs.length) continue;\n\n const sec = hyperHTML`\n <section>\n <h3>${\n type === \"Normative\" ? l10n.norm_references : l10n.info_references\n }</h3>\n </section>`;\n addId(sec);\n\n const { goodRefs, badRefs } = refs.map(toRefContent).reduce(\n (refObjects, ref) => {\n const refType = ref.refcontent ? \"goodRefs\" : \"badRefs\";\n refObjects[refType].push(ref);\n return refObjects;\n },\n { goodRefs: [], badRefs: [] }\n );\n\n const uniqueRefs = [\n ...goodRefs\n .reduce((uniqueRefs, ref) => {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n return uniqueRefs;\n }, new Map())\n .values(),\n ];\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n sec.appendChild(hyperHTML`\n <dl class='bibliography'>\n ${refsToShow.map(showRef)}\n </dl>`);\n refsec.appendChild(sec);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n }\n\n document.body.appendChild(refsec);\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n pub(\"error\", msg);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n return hyperHTML`[<cite><a class=\"bibref\" href=\"${href}\">${key}</a></cite>]`;\n}\n\n/**\n * renders a reference\n */\nfunction showRef({ ref, refcontent }) {\n const refId = `bib-${ref.toLowerCase()}`;\n if (refcontent) {\n return hyperHTML`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>${raw(stringifyReference(refcontent))}</dd>\n `;\n } else {\n return hyperHTML`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd><em class=\"respec-offending-element\">Reference not found.</em></dd>\n `;\n }\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\nexport function wireReference(rawRef, target = \"_blank\") {\n if (typeof rawRef !== \"object\") {\n throw new TypeError(\"Only modern object references are allowed\");\n }\n const ref = Object.assign({}, defaultsReference, rawRef);\n const authors = ref.authors.join(\"; \") + (ref.etAl ? \" et al\" : \"\");\n const status = REF_STATUSES.get(ref.status) || ref.status;\n return hyperHTML`\n <cite>\n <a\n href=\"${ref.href}\"\n target=\"${target}\"\n rel=\"noopener noreferrer\">\n ${ref.title.trim()}</a>.\n </cite>\n <span class=\"authors\">\n ${endWithDot(authors)}\n </span>\n <span class=\"publisher\">\n ${endWithDot(ref.publisher)}\n </span>\n <span class=\"pubDate\">\n ${endWithDot(ref.date)}\n </span>\n <span class=\"pubStatus\">\n ${endWithDot(status)}\n </span>\n `;\n}\n\nexport function stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(badRefs) {\n badRefs.forEach(({ ref }) => {\n const badrefs = [\n ...document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n ),\n ].filter(({ textContent: t }) => t.toLowerCase() === ref.toLowerCase());\n const msg = `Bad reference: [\\`${ref}\\`] (appears ${badrefs.length} times)`;\n pub(\"error\", msg);\n console.warn(\"Bad references: \", badrefs);\n });\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getTextNodes,\n norm,\n refTypeFromContext,\n showInlineError,\n showInlineWarning,\n} from \"./utils.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+}})/; // {{ WebIDLThing }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+)?\\|\\B/; // |var : Type|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[A-Za-z0-9.-]+\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[A-Za-z]+(?:-[A-Za-z]+)?\\^\\])/; // Inline [^element^]\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const html = hyperHTML`<code><a data-xref-type=\"element\">${value}</a></code>`;\n return html;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = hyperHTML`<em class=\"rfc2119\" title=\"${value}\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return hyperHTML`<a data-cite=\"${ref}\"></a>`;\n }\n if (document.querySelector(ref)) {\n return hyperHTML`<a href=\"${ref}\"></a>`;\n }\n const badReference = hyperHTML`<span>${matched}</span>`;\n showInlineError(\n badReference, // cite element\n `Wasn't able to expand ${matched} as it didn't match any id in the document.`,\n `Please make sure there is element with id ${ref} in the document.`\n );\n return badReference;\n}\n\n/**\n * @param {string} matched\n */\nfunction inlineXrefMatches(matched) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = matched.slice(2, -2).trim();\n return ref.startsWith(\"\\\\\")\n ? matched.replace(\"\\\\\", \"\")\n : idlStringToHtml(norm(ref));\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n const { type, illegal } = refTypeFromContext(ref, txt.parentNode);\n const cite = renderInlineCitation(ref);\n const cleanRef = ref.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n showInlineWarning(\n /** @type {HTMLElement} */ (cite.childNodes[1]), // cite element\n \"Normative references in informative sections are not allowed. \" +\n `Remove '!' from the start of the reference \\`[[${ref}]]\\``\n );\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : hyperHTML`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n const element = hyperHTML`<var>${varName}</var>`;\n if (type) {\n element.dataset.type = type;\n }\n return element;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = matched.split(\"/\", 2).map(s => s.trim());\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n const anchor = hyperHTML`<a>${processedContent}</a>`;\n if (forContext) {\n anchor.dataset.linkFor = forContext;\n anchor.dataset.xrefFor = forContext;\n }\n if (linkingText) {\n anchor.dataset.lt = linkingText;\n }\n return anchor;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return hyperHTML`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrs = document.querySelectorAll(\"abbr[title]\");\n for (const abbr of abbrs) {\n abbrMap.set(abbr.textContent, abbr.title);\n }\n const aKeys = [...abbrMap.keys()];\n const abbrRx = aKeys.length ? `(?:\\\\b${aKeys.join(\"\\\\b)|(?:\\\\b\")}\\\\b)` : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = new RegExp(\n [\n \"\\\\bMUST(?:\\\\s+NOT)?\\\\b\",\n \"\\\\bSHOULD(?:\\\\s+NOT)?\\\\b\",\n \"\\\\bSHALL(?:\\\\s+NOT)?\\\\b\",\n \"\\\\bMAY\\\\b\",\n \"\\\\b(?:NOT\\\\s+)?REQUIRED\\\\b\",\n \"\\\\b(?:NOT\\\\s+)?RECOMMENDED\\\\b\",\n \"\\\\bOPTIONAL\\\\b\",\n ].join(\"|\")\n );\n const rx = new RegExp(\n `(${[\n keywords.source,\n inlineIdlReference.source,\n inlineVariable.source,\n inlineCitation.source,\n inlineExpansion.source,\n inlineAnchor.source,\n inlineCodeRegExp.source,\n inlineElement.source,\n ...(abbrRx ? [abbrRx] : []),\n ].join(\"|\")})`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(rx);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n } else if (t.startsWith(\"{{\")) {\n const node = inlineXrefMatches(t);\n df.append(node);\n } else if (t.startsWith(\"[[[\")) {\n const node = inlineRefMatches(t);\n df.append(node);\n } else if (t.startsWith(\"[[\")) {\n const nodes = inlineBibrefMatches(t, txt, conf);\n df.append(...nodes);\n } else if (t.startsWith(\"|\")) {\n const node = inlineVariableMatches(t);\n df.append(node);\n } else if (t.startsWith(\"[=\")) {\n const node = inlineAnchorMatches(t);\n df.append(node);\n } else if (t.startsWith(\"`\")) {\n const node = inlineCodeMatches(t);\n df.append(node);\n } else if (t.startsWith(\"[^\")) {\n const node = inlineElementMatches(t);\n df.append(node);\n } else if (abbrMap.has(t)) {\n const node = inlineAbbrMatches(t, txt, abbrMap);\n df.append(node);\n } else if (keywords.test(t)) {\n const node = inlineRFC2119Matches(t);\n df.append(node);\n } else {\n // FAIL -- not sure that this can really happen\n throw new Error(\n `Found token '${t}' but it does not correspond to anything`\n );\n }\n }\n txt.replaceWith(df);\n }\n}\n","// @ts-check\n// Module w3c/conformance\n// Handle the conformance section properly.\nimport { hyperHTML as html, raw } from \"../core/import-maps.js\";\nimport { joinAnd } from \"../core/utils.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"w3c/conformance\";\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = Object.keys(rfc2119Usage);\n // Add RFC2119 to blibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = joinAnd(\n terms.sort(),\n item => `<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h2>Conformance</h2>\n <p>\n As well as sections marked as non-normative, all authoring guidelines,\n diagrams, examples, and notes in this specification are non-normative.\n Everything else in this specification is normative.\n </p>\n ${terms.length\n ? html`\n <p>\n The key word${plural ? \"s\" : \"\"} ${raw(keywords)} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://tools.ietf.org/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")}\n ${renderInlineCitation(\"RFC8174\")} when, and only when, they appear\n in all capitals, as shown here.\n </p>\n `\n : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance) {\n processConformance(conformance, conf);\n }\n // Added message for legacy compat with Aria specs\n // See https://github.com/w3c/respec/issues/793\n pub(\"end\", name);\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates conf.definitionMap to identify them.\n\nimport { getDfnTitles, norm } from \"./utils.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/dfn\";\n\nexport function run() {\n document.querySelectorAll(\"dfn\").forEach(dfn => {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // Default to `dfn` as the type... other modules may override\n if (!dfn.dataset.dfnType) dfn.dataset.dfnType = \"dfn\";\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && titles[0] === norm(dfn.textContent)) {\n return;\n }\n dfn.dataset.lt = titles.join(\"|\");\n });\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML as html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\nconst cssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/examples.css\")).default;\n } catch {\n return fetchAsset(\"examples.css\");\n }\n}\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`\n <span class=\"example-title\">: ${report.title}</span>\n `\n : \"\";\n return html`\n <div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>\n `;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n const css = await cssPromise;\n document.head.insertBefore(\n html`\n <style>\n ${css}\n </style>\n `,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n if (title) {\n addId(example, `example-${number}`, title); // title gets used\n } else {\n // use the number as the title... so, e.g., \"example-5\"\n addId(example, `example`, String(number));\n }\n const { id } = example;\n /** @type {HTMLAnchorElement} */\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n pub(\"example\", report);\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`\n <div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>\n `;\n if (title) {\n addId(div, `example-${number}`, title);\n }\n addId(div, `example`, String(number));\n /** @type {HTMLAnchorElement} */\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n if (!inAside) pub(\"example\", report);\n }\n });\n}\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport { addId, joinAnd, parents } from \"./utils.js\";\nimport { hyperHTML, raw } from \"./import-maps.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n issue_summary: \"Issue Summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n },\n nl: {\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n },\n es: {\n issue_summary: \"Resumen de la cuestión\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n },\n};\n\nconst cssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/issues-notes.css\")).default;\n } catch {\n return fetchAsset(\"issues-notes.css\");\n }\n}\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {NodeListOf<HTMLElement>} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const hasDataNum = !!document.querySelector(\".issue[data-number]\");\n let issueNum = 0;\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno, conf);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n /** @type {Partial<Report>} */\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n };\n if (isIssue && !isInline && !hasDataNum) {\n issueNum++;\n report.number = issueNum;\n } else if (dataNum) {\n report.number = Number(dataNum);\n }\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const div = hyperHTML`<div class=\"${cssClass}\"></div>`;\n if (type === \"note\") {\n div.setAttribute(\"role\", \"note\");\n }\n const title = document.createElement(\"span\");\n const titleParent = hyperHTML`\n <div role='heading' class='${`${type}-title marker`}'>${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (!hasDataNum) {\n text += ` ${issueNum}`;\n } else if (dataNum) {\n text += ` ${dataNum}`;\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n pub(\"warning\", `Failed to fetch issue number ${dataNum}`);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n if (report.number !== undefined) {\n // Add entry to #issue-summary.\n issueList.append(\n createIssueSummaryEntry(conf.l10n.issue, report, div.id)\n );\n }\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", String(level));\n }\n pub(report.type, report);\n });\n makeIssueSectionSummary(issueList);\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno, conf) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? conf.l10n.feature_at_risk\n : conf.l10n.issue\n : isWarning\n ? conf.l10n.warning\n : isEdNote\n ? conf.l10n.editors_note\n : conf.l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return hyperHTML`<a href='${conf.issueBase + dataNum}'/>`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return hyperHTML`<a href='${conf.atRiskBase + dataNum}'/>`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Partial<Report>} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue} ${report.number}`;\n const title = report.title\n ? hyperHTML`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return hyperHTML`\n <li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>\n `;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(hyperHTML`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h2>${l10n.issue_summary}</h2>`\n );\n }\n}\n\nfunction isLight(rgb) {\n const red = (rgb >> 16) & 0xff;\n const green = (rgb >> 8) & 0xff;\n const blue = (rgb >> 0) & 0xff;\n const illumination = 0.2126 * red + 0.7152 * green + 0.0722 * blue;\n return illumination > 140;\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n /** @type {Node[]} */\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n const labelNames = labels.map(label => label.name);\n const joinedNames = joinAnd(labelNames);\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n if (labelNames.length) {\n const ariaLabel = `This issue is labelled as ${joinedNames}.`;\n return hyperHTML`<span\n class=\"issue-label\"\n aria-label=\"${ariaLabel}\">: ${title}${labelsGroup}</span>`;\n }\n return hyperHTML`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const rgb = parseInt(color, 16);\n const textColorClass = isNaN(rgb) || isLight(rgb) ? \"light\" : \"dark\";\n const cssClasses = `respec-gh-label respec-label-${textColorClass}`;\n const style = `background-color: #${color}`;\n return hyperHTML`<a\n class=\"${cssClasses}\"\n style=\"${style}\"\n href=\"${issuesURL.href}\">${name}</a>`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n pub(\"error\", msg);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const issuesAndNotes = document.querySelectorAll(query);\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const css = await cssPromise;\n const { head: headElem } = document;\n headElem.insertBefore(\n hyperHTML`<style>${raw(css)}</style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/requirements\n// This module does two things:\n//\n// 1. It finds and marks all requirements. These are elements with class \"req\".\n// When a requirement is found, it is reported using the \"req\" event. This\n// can be used by a containing shell to extract them.\n// Requirements are automatically numbered.\n//\n// 2. It allows referencing requirements by their ID simply using an empty <a>\n// element with its href pointing to the requirement it should be referencing\n// and a class of \"reqRef\".\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/requirements\";\n\nexport function run() {\n document.querySelectorAll(\".req\").forEach((req, i) => {\n const frag = `#${req.getAttribute(\"id\")}`;\n const el = hyperHTML`<a href=\"${frag}\">Req. ${i + 1}</a>`;\n req.prepend(el, \": \");\n });\n\n document.querySelectorAll(\"a.reqRef[href]\").forEach(ref => {\n const href = ref.getAttribute(\"href\");\n const id = href.substring(1); // href looks like `#id`\n const req = document.getElementById(id);\n let txt;\n if (req) {\n txt = req.querySelector(\"a:first-child\").textContent;\n } else {\n txt = `Req. not found '${id}'`;\n const msg = `Requirement not found in element \\`a.reqRef\\`: ${id}`;\n pub(\"error\", msg);\n console.warn(msg, ref);\n }\n ref.textContent = txt;\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, makeSafeCopy } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n};\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const l10n = localizationStrings[lang];\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = hyperHTML`\n <a class=\"marker self-link\" href=\"${`#${id}`}\"><bdi lang=\"${lang}\">${\n l10n.best_practice\n }${num + 1}</bdi></a>`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = hyperHTML`\n <li>\n ${localizedBpName}: ${makeSafeCopy(bp)}\n </li>\n `;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = hyperHTML`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(hyperHTML`<h2>Best Practices Summary</h2>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n pub(\n \"warn\",\n \"Using best practices summary (#bp-summary) but no best practices found.\"\n );\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport { addId, renameElement, showInlineWarning, wrapInner } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図\",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"圖 \",\n list_of_figures: \"List of Figures\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n hyperHTML`<h2>${l10n.list_of_figures}</h2>`,\n hyperHTML`<ul class='tof'>${tof}</ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n showInlineWarning(fig, \"Found a `<figure>` without a `<figcaption>`\");\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, hyperHTML`<span class='fig-title'>`);\n caption.prepend(l10n.fig, hyperHTML`<bdi class='figno'>${i + 1}</bdi>`, \" \");\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return hyperHTML`<li class='tofline'>\n <a class='tocxref' href='${`#${figureId}`}'>${[\n ...tofCaption.childNodes,\n ]}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n\n/**\n * @param {Element} element\n */\nfunction getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n","// @ts-check\nimport { definitionMap, registerDefinition } from \"./dfn-map.js\";\nimport { showInlineError, wrapInner } from \"./utils.js\";\n\nconst topLevelEntities = new Set([\n \"callback interface\",\n \"callback\",\n \"dictionary\",\n \"enum\",\n \"interface mixin\",\n \"interface\",\n \"typedef\",\n]);\n\n/**\n * This function looks for a <dfn> element whose title is 'name' and\n * that is \"for\" 'parent', which is the empty string when 'name'\n * refers to a top-level entity. For top-level entities, <dfn>\n * elements that inherit a non-empty [dfn-for] attribute are also\n * counted as matching.\n *\n * When a matching <dfn> is found, it's given <code> formatting,\n * marked as an IDL definition, and returned. If no <dfn> is found,\n * the function returns 'undefined'.\n * @param {*} defn\n * @param {string} name\n */\nexport function findDfn(defn, name, { parent = \"\" } = {}) {\n switch (defn.type) {\n case \"constructor\":\n case \"operation\":\n return findOperationDfn(defn, parent, name);\n default:\n return findNormalDfn(defn, parent, name);\n }\n}\n\n/**\n * @param {string} type\n * @param {string} parent\n * @param {string} name\n */\nfunction getAlternativeNames(type, parent, name) {\n const asQualifiedName = `${parent}.${name}`;\n switch (type) {\n case \"constructor\":\n case \"operation\": {\n // Allow linking to both \"method()\" and \"method\" name.\n const asMethodName = `${name}()`;\n const asFullyQualifiedName = `${asQualifiedName}()`;\n return [asFullyQualifiedName, asQualifiedName, asMethodName, name];\n }\n case \"attribute\":\n return [asQualifiedName, name];\n }\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {string} name\n */\nfunction findOperationDfn(defn, parent, name) {\n // Overloads all have unique names\n if (name.includes(\"!overload\")) {\n return findNormalDfn(defn, parent, name);\n }\n const asMethodName = `${name}()`;\n return findNormalDfn(defn, parent, asMethodName, name);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string[]} names\n */\nfunction addAlternativeNames(dfn, names) {\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n lt.push(...names);\n dfn.dataset.lt = [...new Set(lt)].join(\"|\");\n registerDefinition(dfn, names);\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {...string} names\n */\nfunction findNormalDfn(defn, parent, ...names) {\n for (const name of names) {\n let resolvedName =\n defn.type === \"enum-value\" && name === \"\"\n ? \"the-empty-string\"\n : name.toLowerCase();\n let dfnForArray = definitionMap[resolvedName];\n let dfns = getDfns(dfnForArray, parent, name, defn.type);\n // If we haven't found any definitions with explicit [for]\n // and [title], look for a dotted definition, \"parent.name\".\n if (dfns.length === 0 && parent !== \"\") {\n resolvedName = `${parent}.${resolvedName}`;\n dfnForArray = definitionMap[resolvedName.toLowerCase()];\n if (dfnForArray !== undefined && dfnForArray.length === 1) {\n dfns = dfnForArray;\n // Found it: register with its local name\n delete definitionMap[resolvedName];\n registerDefinition(dfns[0], [resolvedName]);\n }\n } else {\n resolvedName = name;\n }\n if (dfns.length > 1) {\n const msg = `WebIDL identifier \\`${name}\\` ${\n parent ? `for \\`${parent}\\`` : \"\"\n } is defined multiple times`;\n showInlineError(dfns, msg, \"Duplicate definition.\");\n }\n if (dfns.length) {\n if (name !== resolvedName) {\n dfns[0].dataset.lt = resolvedName;\n }\n return dfns[0];\n }\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {*} defn\n * @param {string} parent\n * @param {string} name\n */\nexport function decorateDfn(dfn, defn, parent, name) {\n if (!dfn.id) {\n const lCaseParent = parent.toLowerCase();\n const middle = lCaseParent ? `${lCaseParent}-` : \"\";\n let last = name\n .toLowerCase()\n .replace(/[()]/g, \"\")\n .replace(/\\s/g, \"-\");\n if (last === \"\") last = \"the-empty-string\";\n dfn.id = `dom-${middle}${last}`;\n }\n dfn.dataset.idl = defn.type;\n dfn.dataset.title = dfn.textContent;\n dfn.dataset.dfnFor = parent;\n // Derive the data-type for dictionary members, interface attributes,\n // and methods\n switch (defn.type) {\n case \"operation\":\n case \"attribute\":\n case \"field\":\n dfn.dataset.type = getDataType(defn);\n break;\n }\n\n // Mark the definition as code.\n if (!dfn.querySelector(\"code\") && !dfn.closest(\"code\") && dfn.children) {\n wrapInner(dfn, dfn.ownerDocument.createElement(\"code\"));\n }\n\n // Add data-lt values and register them\n switch (defn.type) {\n case \"attribute\":\n case \"constructor\":\n case \"operation\":\n addAlternativeNames(dfn, getAlternativeNames(defn.type, parent, name));\n break;\n }\n\n return dfn;\n}\n\n/**\n * @param {HTMLElement[]} dfnForArray\n * @param {string} parent data-dfn-for\n * @param {string} originalName\n * @param {string} type\n */\nfunction getDfns(dfnForArray, parent, originalName, type) {\n if (!dfnForArray) {\n return [];\n }\n // Definitions that have a name and [data-dfn-for] that exactly match the\n // IDL entity:\n const dfns = dfnForArray.filter(dfn => {\n /** @type {HTMLElement} */\n const closestDfnFor = dfn.closest(`[data-dfn-for]`);\n return closestDfnFor && closestDfnFor.dataset.dfnFor === parent;\n });\n\n if (dfns.length === 0 && parent === \"\" && dfnForArray.length === 1) {\n // Make sure the name exactly matches\n return dfnForArray[0].textContent === originalName ? dfnForArray : [];\n } else if (topLevelEntities.has(type) && dfnForArray.length) {\n const dfn = dfnForArray.find(\n dfn => dfn.textContent.trim() === originalName\n );\n if (dfn) return [dfn];\n }\n return dfns;\n}\n\n/**\n * @return {string}\n */\nfunction getDataType(idlStruct) {\n const { idlType, generic, union } = idlStruct;\n if (typeof idlType === \"string\") return idlType;\n if (generic) return generic;\n // join on \"|\" handles for \"unsigned short\" etc.\n if (union) return idlType.map(getDataType).join(\"|\");\n return getDataType(idlType);\n}\n","// Module core/webidl\n// Highlights and links WebIDL marked up inside <pre class=\"idl\">.\n\n// TODO:\n// - It could be useful to report parsed IDL items as events\n// - don't use generated content in the CSS!\nimport { decorateDfn, findDfn } from \"./dfn-finder.js\";\nimport {\n flatten,\n showInlineError,\n showInlineWarning,\n xmlEscape,\n} from \"./utils.js\";\nimport { hyperHTML, webidl2 } from \"./import-maps.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/webidl\";\n\nconst operationNames = {};\nconst idlPartials = {};\n\nconst templates = {\n wrap(items) {\n return items\n .reduce(flatten, [])\n .filter(x => x !== \"\")\n .map(x => (typeof x === \"string\" ? new Text(x) : x));\n },\n trivia(t) {\n if (!t.trim()) {\n return t;\n }\n return hyperHTML`<span class='idlSectionComment'>${new Text(t)}</span>`;\n },\n generic(keyword) {\n // Shepherd classifies \"interfaces\" as starting with capital letters,\n // like Promise, FrozenArray, etc.\n return /^[A-Z]/.test(keyword)\n ? hyperHTML`<a data-xref-type=\"interface\" data-cite=\"WebIDL\">${keyword}</a>`\n : // Other keywords like sequence, maplike, etc...\n hyperHTML`<a data-xref-type=\"dfn\" data-cite=\"WebIDL\">${keyword}</a>`;\n },\n reference(wrapped, unescaped, context) {\n if (context.type === \"extended-attribute\" && context.name !== \"Exposed\") {\n return wrapped;\n }\n let type = \"_IDL_\";\n let cite = null;\n let lt;\n switch (unescaped) {\n case \"Window\":\n type = \"interface\";\n cite = \"HTML\";\n break;\n case \"object\":\n type = \"interface\";\n cite = \"WebIDL\";\n break;\n default: {\n const isWorkerType = unescaped.includes(\"Worker\");\n if (isWorkerType && context.type === \"extended-attribute\") {\n lt = `${unescaped}GlobalScope`;\n type = \"interface\";\n cite = [\"Worker\", \"DedicatedWorker\", \"SharedWorker\"].includes(\n unescaped\n )\n ? \"HTML\"\n : null;\n }\n }\n }\n const anchor = hyperHTML`<a data-xref-type=\"${type}\">${wrapped}</a>`;\n if (cite) {\n anchor.dataset.cite = cite;\n }\n if (lt) {\n anchor.dataset.lt = lt;\n }\n return anchor;\n },\n name(escaped, { data, parent }) {\n if (data.idlType && data.idlType.type === \"argument-type\") {\n return hyperHTML`<span class=\"idlParamName\">${escaped}</span>`;\n }\n const idlLink = defineIdlName(escaped, data, parent);\n if (data.type !== \"enum-value\") {\n const className = parent ? \"idlName\" : \"idlID\";\n idlLink.classList.add(className);\n }\n return idlLink;\n },\n nameless(escaped, { data, parent }) {\n switch (data.type) {\n case \"constructor\":\n return defineIdlName(escaped, data, parent);\n default:\n return escaped;\n }\n },\n type(contents) {\n return hyperHTML`<span class=\"idlType\">${contents}</span>`;\n },\n inheritance(contents) {\n return hyperHTML`<span class=\"idlSuperclass\">${contents}</span>`;\n },\n definition(contents, { data, parent }) {\n const className = getIdlDefinitionClassName(data);\n switch (data.type) {\n case \"includes\":\n case \"enum-value\":\n return hyperHTML`<span class='${className}'>${contents}</span>`;\n }\n const parentName = parent ? parent.name : \"\";\n const { name, idlId } = getNameAndId(data, parentName);\n return hyperHTML`<span class='${className}' id='${idlId}' data-idl=\"\" data-title='${name}'>${contents}</span>`;\n },\n extendedAttribute(contents) {\n const result = hyperHTML`<span class=\"extAttr\">${contents}</span>`;\n return result;\n },\n extendedAttributeReference(name) {\n return hyperHTML`<a data-xref-type=\"extended-attribute\">${name}</a>`;\n },\n};\n\n/**\n * Returns a link to existing <dfn> or creates one if doesn’t exists.\n */\nfunction defineIdlName(escaped, data, parent) {\n const parentName = parent ? parent.name : \"\";\n const { name } = getNameAndId(data, parentName);\n const dfn = findDfn(data, name, {\n parent: parentName,\n });\n const linkType = getDfnType(data.type);\n if (dfn) {\n if (!data.partial) {\n dfn.dataset.export = \"\";\n dfn.dataset.dfnType = linkType;\n }\n decorateDfn(dfn, data, parentName, name);\n const href = `#${dfn.id}`;\n return hyperHTML`<a\n data-link-for=\"${parentName}\"\n data-link-type=\"${linkType}\"\n href=\"${href}\"\n class=\"internalDFN\"\n ><code>${escaped}</code></a>`;\n }\n\n const isDefaultJSON =\n data.type === \"operation\" &&\n data.name === \"toJSON\" &&\n data.extAttrs.some(({ name }) => name === \"Default\");\n if (isDefaultJSON) {\n return hyperHTML`<a\n data-link-type=\"dfn\"\n data-lt=\"default toJSON operation\">${escaped}</a>`;\n }\n if (!data.partial) {\n const dfn = hyperHTML`<dfn data-export=\"\" data-dfn-type=\"${linkType}\">${escaped}</dfn>`;\n registerDefinition(dfn, [name]);\n decorateDfn(dfn, data, parentName, name);\n return dfn;\n }\n\n const unlinkedAnchor = hyperHTML`<a\n data-link-type=\"${linkType}\"\n data-title=\"${data.name}\"\n data-xref-type=\"${linkType}\"\n >${escaped}</a>`;\n if (data.partial) {\n unlinkedAnchor.dataset.idl = \"partial\";\n }\n\n const showWarnings =\n name && data.type !== \"typedef\" && !(data.partial && !dfn);\n if (showWarnings) {\n const styledName = data.type === \"operation\" ? `${name}()` : name;\n const ofParent = parentName ? ` \\`${parentName}\\`'s` : \"\";\n const msg = `Missing \\`<dfn>\\` for${ofParent} \\`${styledName}\\` ${data.type}. [More info](https://github.com/w3c/respec/wiki/WebIDL-thing-is-not-defined).`;\n showInlineWarning(unlinkedAnchor, msg, \"\");\n }\n return unlinkedAnchor;\n}\n\n/**\n * Map to Shepherd types, for export.\n * @see https://tabatkins.github.io/bikeshed/#dfn-types\n */\nfunction getDfnType(idlType) {\n switch (idlType) {\n case \"operation\":\n return \"method\";\n case \"field\":\n return \"dict-member\";\n case \"callback interface\":\n case \"interface mixin\":\n return \"interface\";\n default:\n return idlType;\n }\n}\n\nfunction getIdlDefinitionClassName(defn) {\n switch (defn.type) {\n case \"callback interface\":\n return \"idlInterface\";\n case \"operation\":\n return \"idlMethod\";\n case \"field\":\n return \"idlMember\";\n case \"enum-value\":\n return \"idlEnumItem\";\n case \"callback function\":\n return \"idlCallback\";\n }\n return `idl${defn.type[0].toUpperCase()}${defn.type.slice(1)}`;\n}\n\nconst nameResolverMap = new WeakMap();\nfunction getNameAndId(defn, parent = \"\") {\n if (nameResolverMap.has(defn)) {\n return nameResolverMap.get(defn);\n }\n const result = resolveNameAndId(defn, parent);\n nameResolverMap.set(defn, result);\n return result;\n}\n\nfunction resolveNameAndId(defn, parent) {\n let name = getDefnName(defn);\n let idlId = getIdlId(name, parent);\n switch (defn.type) {\n // Top-level entities with linkable members.\n case \"callback interface\":\n case \"dictionary\":\n case \"interface\":\n case \"interface mixin\": {\n idlId += resolvePartial(defn);\n break;\n }\n case \"constructor\":\n case \"operation\": {\n const overload = resolveOverload(name, parent);\n if (overload) {\n name += overload;\n idlId += overload;\n } else if (defn.arguments.length) {\n idlId += defn.arguments\n .map(arg => `-${arg.name.toLowerCase()}`)\n .join(\"\");\n }\n break;\n }\n }\n return { name, idlId };\n}\n\nfunction resolvePartial(defn) {\n if (!defn.partial) {\n return \"\";\n }\n if (!idlPartials[defn.name]) {\n idlPartials[defn.name] = 0;\n }\n idlPartials[defn.name] += 1;\n return `-partial-${idlPartials[defn.name]}`;\n}\n\nfunction resolveOverload(name, parentName) {\n const qualifiedName = `${parentName}.${name}`;\n const fullyQualifiedName = `${qualifiedName}()`;\n let overload;\n if (!operationNames[fullyQualifiedName]) {\n operationNames[fullyQualifiedName] = 0;\n }\n if (!operationNames[qualifiedName]) {\n operationNames[qualifiedName] = 0;\n } else {\n overload = `!overload-${operationNames[qualifiedName]}`;\n }\n operationNames[fullyQualifiedName] += 1;\n operationNames[qualifiedName] += 1;\n return overload || \"\";\n}\n\nfunction getIdlId(name, parentName) {\n if (!parentName) {\n return `idl-def-${name.toLowerCase()}`;\n }\n return `idl-def-${parentName.toLowerCase()}-${name.toLowerCase()}`;\n}\n\nfunction getDefnName(defn) {\n switch (defn.type) {\n case \"enum-value\":\n return defn.value;\n case \"operation\":\n return defn.name;\n default:\n return defn.name || defn.type;\n }\n}\n\nfunction renderWebIDL(idlElement, index) {\n let parse;\n try {\n parse = webidl2.parse(idlElement.textContent, {\n sourceName: String(index),\n });\n } catch (e) {\n showInlineError(\n idlElement,\n `Failed to parse WebIDL: ${e.bareMessage}.`,\n e.bareMessage,\n { details: `<pre>${e.context}</pre>` }\n );\n // Skip this <pre> and move on to the next one.\n return [];\n }\n idlElement.classList.add(\"def\", \"idl\");\n const html = webidl2.write(parse, { templates });\n idlElement.textContent = \"\";\n idlElement.append(...html);\n idlElement.querySelectorAll(\"[data-idl]\").forEach(elem => {\n if (elem.dataset.dfnFor) {\n return;\n }\n const title = elem.dataset.title;\n // Select the nearest ancestor element that can contain members.\n const parent = elem.parentElement.closest(\"[data-idl][data-title]\");\n if (parent) {\n elem.dataset.dfnFor = parent.dataset.title;\n }\n registerDefinition(elem, [title]);\n });\n // cross reference\n const closestCite = idlElement.closest(\"[data-cite], body\");\n const { dataset } = closestCite;\n if (!dataset.cite) dataset.cite = \"WebIDL\";\n // includes webidl in some form\n if (!/\\bwebidl\\b/i.test(dataset.cite)) {\n const cites = dataset.cite.trim().split(/\\s+/);\n dataset.cite = [\"WebIDL\", ...cites].join(\" \");\n }\n return parse;\n}\n\nconst cssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/webidl.css\")).default;\n } catch {\n return fetchAsset(\"webidl.css\");\n }\n}\n\nexport async function run() {\n const idls = document.querySelectorAll(\"pre.idl\");\n if (!idls.length) {\n return;\n }\n if (!document.querySelector(\".idl:not(pre)\")) {\n const link = document.querySelector(\"head link\");\n if (link) {\n const style = document.createElement(\"style\");\n style.textContent = await cssPromise;\n link.before(style);\n }\n }\n const astArray = [...idls].map(renderWebIDL);\n\n const validations = webidl2.validate(astArray);\n for (const validation of validations) {\n let details = `<pre>${validation.context}</pre>`;\n if (validation.autofix) {\n validation.autofix();\n const idlToFix = webidl2.write(astArray[validation.sourceName]);\n const escaped = xmlEscape(idlToFix);\n details += `Try fixing as:\n <pre>${escaped}</pre>`;\n }\n showInlineError(\n idls[validation.sourceName],\n `WebIDL validation error: ${validation.bareMessage}`,\n validation.bareMessage,\n { details }\n );\n }\n document.normalize();\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using\n * anchor elements. Simply add \"data-cite\"\n * and key of specification.\n *\n * This module simply adds the found key\n * to either conf.normativeReferences\n * or to conf.informativeReferences depending on\n * if it starts with a ! or not.\n *\n * Usage:\n * https://github.com/w3c/respec/wiki/data--cite\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showInlineError,\n showInlineWarning,\n wrapInner,\n} from \"./utils.js\";\nexport const name = \"core/data-cite\";\n\nfunction requestLookup(conf) {\n const toCiteDetails = citeDetailsConverter(conf);\n return async elem => {\n const originalKey = elem.dataset.cite;\n const { key, frag, path } = toCiteDetails(elem);\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key.toLowerCase() === conf.shortName.toLowerCase()) {\n console.log(\n elem,\n `The reference \"${key}\" is resolved into the current document per \\`conf.shortName\\`.`\n );\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n cleanElement(elem);\n if (!entry) {\n showInlineWarning(elem, `Couldn't find a match for \"${originalKey}\"`);\n return;\n }\n href = entry.href;\n title = entry.title;\n }\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n switch (elem.localName) {\n case \"a\": {\n if (elem.textContent === \"\" && elem.dataset.lt !== \"the-empty-string\") {\n elem.textContent = title;\n }\n elem.href = href;\n if (!path && !frag) {\n const cite = document.createElement(\"cite\");\n elem.replaceWith(cite);\n cite.append(elem);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (!path && !frag) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n showInlineError(\n elem,\n \"Exporting an linked external definition is not allowed. Please remove the `data-export` attribute\",\n \"Please remove the `data-export` attribute.\"\n );\n delete elem.dataset.export;\n }\n elem.dataset.noExport = \"\";\n break;\n }\n }\n };\n}\n\nfunction cleanElement(elem) {\n [\"data-cite\", \"data-cite-frag\"]\n .filter(attrName => elem.hasAttribute(attrName))\n .forEach(attrName => elem.removeAttribute(attrName));\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n *\n * @return {(elem: HTMLElement) => CiteDetails};\n */\nfunction citeDetailsConverter(conf) {\n const findFrag = makeComponentFinder(\"#\");\n const findPath = makeComponentFinder(\"/\");\n return function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath } = dataset;\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: conf.shortName || \"\", isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path };\n return details;\n };\n}\n\nexport async function run(conf) {\n const toCiteDetails = citeDetailsConverter(conf);\n /** @type {NodeListOf<HTMLElement>} */\n const cites = document.querySelectorAll(\"dfn[data-cite], a[data-cite]\");\n Array.from(cites)\n .filter(el => el.dataset.cite)\n .map(toCiteDetails)\n // it's not the same spec\n .filter(({ key }) => {\n return key.toLowerCase() !== (conf.shortName || \"\").toLowerCase();\n })\n .forEach(({ isNormative, key }) => {\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n return;\n }\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n });\n}\n\n/**\n * @param {Document} doc\n * @param {*} conf\n */\nexport async function linkInlineCitations(doc, conf = respecConfig) {\n const toLookupRequest = requestLookup(conf);\n const elems = [\n ...doc.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n ),\n ];\n const citeConverter = citeDetailsConverter(conf);\n\n const promisesForMissingEntries = elems\n .map(citeConverter)\n .map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForMissingEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n // we now go to network to fetch missing entries\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) Object.assign(biblio, newEntries);\n\n const lookupRequests = [...new Set(elems)].map(toLookupRequest);\n return await Promise.all(lookupRequests);\n}\n","// @ts-check\n/**\n * Module: core/webidl-index\n * constructs a summary of WebIDL in the document by\n * cloning all the generated WebIDL nodes and\n * appending them to pre element.\n *\n * Usage\n * Add a <section id=\"idl-index\"> to the document.\n * It also supports title elements to generate a header.\n * Or if a header element is an immediate child, then\n * that is preferred.\n */\nexport const name = \"core/webidl-index\";\nimport { nonNormativeSelector } from \"./utils.js\";\n\nexport function run() {\n /** @type {HTMLElement | null} */\n const idlIndexSec = document.querySelector(\"section#idl-index\");\n if (!idlIndexSec) {\n return;\n }\n // Query for decedents headings, e.g., \"h2:first-child, etc..\"\n const query = [2, 3, 4, 5, 6].map(level => `h${level}:first-child`).join(\",\");\n if (!idlIndexSec.querySelector(query)) {\n const header = document.createElement(\"h2\");\n if (idlIndexSec.title) {\n header.textContent = idlIndexSec.title;\n idlIndexSec.removeAttribute(\"title\");\n } else {\n header.textContent = \"IDL Index\";\n }\n idlIndexSec.prepend(header);\n }\n\n // filter out the IDL marked with class=\"exclude\" and the IDL in non-normative sections\n const idlIndex = Array.from(\n document.querySelectorAll(\"pre.def.idl:not(.exclude)\")\n ).filter(idl => !idl.closest(nonNormativeSelector));\n\n if (idlIndex.length === 0) {\n const text = \"This specification doesn't declare any Web IDL.\";\n idlIndexSec.append(text);\n return;\n }\n\n const pre = document.createElement(\"pre\");\n pre.classList.add(\"idl\", \"def\");\n pre.id = \"actual-idl-index\";\n idlIndex\n .map(elem => {\n const fragment = document.createDocumentFragment();\n for (const child of elem.children) {\n fragment.appendChild(child.cloneNode(true));\n }\n return fragment;\n })\n .forEach(elem => {\n if (pre.lastChild) {\n pre.append(\"\\n\\n\");\n }\n pre.appendChild(elem);\n });\n // Remove duplicate IDs\n pre.querySelectorAll(\"*[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n idlIndexSec.appendChild(pre);\n}\n","// @ts-check\nimport { API_URL } from \"./xref.js\";\nimport { IDBKeyVal } from \"./utils.js\";\nimport { idb } from \"./import-maps.js\";\n\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n */\n\nconst VERSION_CHECK_WAIT = 5 * 60 * 60 * 1000; // 5 min\n\nasync function getIdbCache() {\n const db = await idb.openDB(\"xref\", 1, {\n upgrade(db) {\n db.createObjectStore(\"xrefs\");\n },\n });\n return new IDBKeyVal(db, \"xrefs\");\n}\n\n/**\n * @param {RequestEntry[]} uniqueQueryKeys\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nexport async function resolveXrefCache(uniqueQueryKeys) {\n try {\n const cache = await getIdbCache();\n return await resolveFromCache(uniqueQueryKeys, cache);\n } catch (err) {\n console.error(err);\n return new Map();\n }\n}\n\n/**\n * @param {RequestEntry[]} keys\n * @param {IDBKeyVal} cache\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function resolveFromCache(keys, cache) {\n const bustCache = await shouldBustCache(cache);\n if (bustCache) {\n await cache.clear();\n return new Map();\n }\n\n const cachedData = await cache.getMany(keys.map(key => key.id));\n return cachedData;\n}\n\n/**\n * Get last updated timestamp from server and bust cache based on that. This\n * way, we prevent dirty/erroneous/stale data being kept on a client (which is\n * possible if we use a `MAX_AGE` based caching strategy).\n * @param {IDBKeyVal} cache\n */\nasync function shouldBustCache(cache) {\n const lastChecked = await cache.get(\"__LAST_VERSION_CHECK__\");\n const now = Date.now();\n\n if (!lastChecked) {\n await cache.set(\"__LAST_VERSION_CHECK__\", now);\n return false;\n }\n if (now - lastChecked < VERSION_CHECK_WAIT) {\n // avoid checking network for any data update if old cache \"fresh\"\n return false;\n }\n\n const url = new URL(\"meta/version\", API_URL).href;\n const res = await fetch(url);\n if (!res.ok) return false;\n const lastUpdated = await res.text();\n await cache.set(\"__LAST_VERSION_CHECK__\", now);\n return parseInt(lastUpdated, 10) > lastChecked;\n}\n\n/**\n * @param {Map<string, SearchResultEntry[]>} data\n */\nexport async function cacheXrefData(data) {\n try {\n const cache = await getIdbCache();\n // add data to cache\n await cache.addMany(data);\n } catch (e) {\n console.error(e);\n }\n}\n\nexport async function clearXrefData() {\n try {\n const cache = await getIdbCache();\n await cache.clear();\n } catch (e) {\n console.error(e);\n }\n}\n","// @ts-check\n// Automatically adds external references.\n// Looks for the terms which do not have a definition locally on Shepherd API\n// For each returend result, adds `data-cite` attributes to respective elements,\n// so later they can be handled by core/link-to-dfn.\n// https://github.com/w3c/respec/issues/1662\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {Map<string, { elems: HTMLElement[], results: SearchResultEntry[], query: RequestEntry }>} ErrorCollection\n * @typedef {{ ambiguous: ErrorCollection, notFound: ErrorCollection }} Errors\n */\nimport { cacheXrefData, resolveXrefCache } from \"./xref-db.js\";\nimport {\n createResourceHint,\n flatten,\n nonNormativeSelector,\n norm as normalize,\n showInlineError,\n showInlineWarning,\n} from \"./utils.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst profiles = {\n \"web-platform\": [\"HTML\", \"INFRA\", \"URL\", \"WEBIDL\", \"DOM\", \"FETCH\"],\n};\n\nexport const API_URL = \"https://respec.org/xref/\";\n\nif (\n !document.querySelector(\"link[rel='preconnect'][href='https://respec.org']\")\n) {\n const link = createResourceHint({\n hint: \"preconnect\",\n href: \"https://respec.org\",\n });\n document.head.appendChild(link);\n}\n\n/**\n * main external reference driver\n * @param {Object} conf respecConfig\n * @param {HTMLElement[]} elems possibleExternalLinks\n */\nexport async function run(conf, elems) {\n const xref = normalizeConfig(conf.xref);\n if (xref.specs) {\n const bodyCite = document.body.dataset.cite\n ? document.body.dataset.cite.split(/\\s+/)\n : [];\n document.body.dataset.cite = bodyCite.concat(xref.specs).join(\" \");\n }\n\n if (!elems.length) return;\n\n /** @type {RequestEntry[]} */\n const queryKeys = [];\n for (const elem of elems) {\n const entry = getRequestEntry(elem);\n const id = await objectHash(entry);\n queryKeys.push({ ...entry, id });\n }\n\n const data = await getData(queryKeys, xref.url);\n addDataCiteToTerms(elems, queryKeys, data, conf);\n}\n\n/**\n * converts conf.xref to object with url and spec properties\n */\nfunction normalizeConfig(xref) {\n const defaults = {\n url: API_URL,\n specs: null,\n };\n\n const config = Object.assign({}, defaults);\n\n const type = Array.isArray(xref) ? \"array\" : typeof xref;\n switch (type) {\n case \"boolean\":\n // using defaults already, as above\n break;\n case \"string\":\n if (xref.toLowerCase() in profiles) {\n Object.assign(config, { specs: profiles[xref.toLowerCase()] });\n } else {\n invalidProfileError(xref);\n }\n break;\n case \"array\":\n Object.assign(config, { specs: xref });\n break;\n case \"object\":\n Object.assign(config, xref);\n if (xref.profile) {\n const profile = xref.profile.toLowerCase();\n if (profile in profiles) {\n const specs = (xref.specs || []).concat(profiles[profile]);\n Object.assign(config, { specs });\n } else {\n invalidProfileError(xref.profile);\n }\n }\n break;\n default:\n pub(\n \"error\",\n `Invalid value for \\`xref\\` configuration option. Received: \"${xref}\".`\n );\n }\n return config;\n\n function invalidProfileError(profile) {\n const supportedProfiles = Object.keys(profiles)\n .map(p => `\"${p}\"`)\n .join(\", \");\n const msg =\n `Invalid profile \"${profile}\" in \\`respecConfig.xref\\`. ` +\n `Please use one of the supported profiles: ${supportedProfiles}.`;\n pub(\"error\", msg);\n }\n}\n\n/**\n * get xref API request entry (term and context) for given xref element\n * @param {HTMLElement} elem\n */\nfunction getRequestEntry(elem) {\n const isIDL = \"xrefType\" in elem.dataset;\n\n let term = getTermFromElement(elem);\n if (!isIDL) term = term.toLowerCase();\n\n /** @type {string[][]} */\n const specs = [];\n /** @type {HTMLElement} */\n let dataciteElem = elem.closest(\"[data-cite]\");\n while (dataciteElem) {\n const cite = dataciteElem.dataset.cite.toLowerCase().replace(/[!?]/g, \"\");\n const cites = cite.split(/\\s+/).filter(s => s);\n if (cites.length) {\n specs.push(cites.sort());\n }\n if (dataciteElem === elem) break;\n dataciteElem = dataciteElem.parentElement.closest(\"[data-cite]\");\n }\n // if element itself contains data-cite, we don't take inline context into account\n if (elem.closest(\"[data-cite]\") !== elem) {\n const closestSection = elem.closest(\"section\");\n /** @type {Iterable<HTMLElement>} */\n const bibrefs = closestSection\n ? closestSection.querySelectorAll(\"a.bibref\")\n : [];\n const inlineRefs = [...bibrefs].map(el => el.textContent.toLowerCase());\n const uniqueInlineRefs = [...new Set(inlineRefs)].sort();\n if (uniqueInlineRefs.length) {\n specs.unshift(uniqueInlineRefs);\n }\n }\n\n const types = [];\n if (isIDL) {\n if (elem.dataset.xrefType) {\n types.push(...elem.dataset.xrefType.split(\"|\"));\n } else {\n types.push(\"_IDL_\");\n }\n } else {\n types.push(\"_CONCEPT_\");\n }\n\n let { xrefFor: forContext } = elem.dataset;\n if (!forContext && isIDL) {\n /** @type {HTMLElement} */\n const dataXrefForElem = elem.closest(\"[data-xref-for]\");\n if (dataXrefForElem) {\n forContext = normalize(dataXrefForElem.dataset.xrefFor);\n }\n } else if (forContext && typeof forContext === \"string\") {\n forContext = normalize(forContext);\n }\n return {\n term,\n types,\n ...(specs.length && { specs }),\n ...(typeof forContext === \"string\" && { for: forContext }),\n };\n}\n\n/** @param {HTMLElement} elem */\nfunction getTermFromElement(elem) {\n const { lt: linkingText } = elem.dataset;\n let term = linkingText ? linkingText.split(\"|\", 1)[0] : elem.textContent;\n term = normalize(term);\n return term === \"the-empty-string\" ? \"\" : term;\n}\n\n/**\n * @param {RequestEntry[]} queryKeys\n * @param {string} apiUrl\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function getData(queryKeys, apiUrl) {\n const uniqueIds = new Set();\n const uniqueQueryKeys = queryKeys.filter(key => {\n return uniqueIds.has(key.id) ? false : uniqueIds.add(key.id) && true;\n });\n\n const resultsFromCache = await resolveXrefCache(uniqueQueryKeys);\n\n const termsToLook = uniqueQueryKeys.filter(\n key => !resultsFromCache.get(key.id)\n );\n const fetchedResults = await fetchFromNetwork(termsToLook, apiUrl);\n if (fetchedResults.size) {\n // add data to cache\n await cacheXrefData(fetchedResults);\n }\n\n return new Map([...resultsFromCache, ...fetchedResults]);\n}\n\n/**\n * @param {RequestEntry[]} keys\n * @param {string} url\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function fetchFromNetwork(keys, url) {\n if (!keys.length) return new Map();\n\n const query = { keys };\n const options = {\n method: \"POST\",\n body: JSON.stringify(query),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n const response = await fetch(url, options);\n const json = await response.json();\n return new Map(json.result);\n}\n\n/**\n * Figures out from the tree structure if the reference is\n * normative (true) or informative (false).\n * @param {HTMLElement} elem\n */\nfunction isNormative(elem) {\n const closestNormative = elem.closest(\".normative\");\n const closestInform = elem.closest(nonNormativeSelector);\n if (!closestInform || elem === closestNormative) {\n return true;\n }\n return (\n closestNormative &&\n closestInform &&\n closestInform.contains(closestNormative)\n );\n}\n\n/**\n * adds data-cite attributes to elems for each term for which results are found.\n * adds citations to references section.\n * collects and shows linking errors if any.\n * @param {HTMLElement[]} elems\n * @param {RequestEntry[]} queryKeys\n * @param {Map<string, SearchResultEntry[]>} data\n * @param {any} conf\n */\nfunction addDataCiteToTerms(elems, queryKeys, data, conf) {\n /** @type {Errors} */\n const errors = { ambiguous: new Map(), notFound: new Map() };\n\n for (let i = 0, l = elems.length; i < l; i++) {\n if (elems[i].closest(\"[data-no-xref]\")) continue;\n\n const elem = elems[i];\n const query = queryKeys[i];\n\n const { id } = query;\n const results = data.get(id);\n if (results.length === 1) {\n addDataCite(elem, query, results[0], conf);\n } else {\n const collector = errors[results.length === 0 ? \"notFound\" : \"ambiguous\"];\n if (!collector.has(id)) {\n collector.set(id, { elems: [], results, query });\n }\n collector.get(id).elems.push(elem);\n }\n }\n\n showErrors(errors);\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {RequestEntry} query\n * @param {SearchResultEntry} result\n * @param {any} conf\n */\nfunction addDataCite(elem, query, result, conf) {\n const { term } = query;\n const { uri, shortname: cite, normative, type } = result;\n\n const path = uri.includes(\"/\") ? uri.split(\"/\", 1)[1] : uri;\n const [citePath, citeFrag] = path.split(\"#\");\n const dataset = { cite, citePath, citeFrag, type };\n Object.assign(elem.dataset, dataset);\n\n // update indirect links (data-lt, data-plurals)\n /** @type {NodeListOf<HTMLElement>} */\n const indirectLinks = document.querySelectorAll(\n `[data-dfn-type=\"xref\"][data-xref=\"${term.toLowerCase()}\"]`\n );\n indirectLinks.forEach(el => {\n el.removeAttribute(\"data-xref\");\n Object.assign(el.dataset, dataset);\n });\n\n addToReferences(elem, cite, normative, term, conf);\n}\n\n/**\n * add specs for citation (references section)\n * @param {HTMLElement} elem\n * @param {string} cite\n * @param {boolean} normative\n * @param {string} term\n * @param {any} conf\n */\nfunction addToReferences(elem, cite, normative, term, conf) {\n const isNormRef = isNormative(elem);\n if (!isNormRef) {\n // Only add it if not already normative...\n if (!conf.normativeReferences.has(cite)) {\n conf.informativeReferences.add(cite);\n }\n return;\n }\n if (normative) {\n // If it was originally informative, we move the existing\n // key to be normative.\n const existingKey = conf.informativeReferences.has(cite)\n ? conf.informativeReferences.getCanonicalKey(cite)\n : cite;\n conf.normativeReferences.add(existingKey);\n conf.informativeReferences.delete(existingKey);\n return;\n }\n\n const msg =\n `Adding an informative reference to \"${term}\" from \"${cite}\" ` +\n \"in a normative section\";\n const title = \"Error: Informative reference in normative section\";\n showInlineWarning(elem, msg, title);\n}\n\n/** @param {Errors} errors */\nfunction showErrors({ ambiguous, notFound }) {\n const getPrefilledFormURL = (term, query, specs = []) => {\n const url = new URL(API_URL);\n url.searchParams.set(\"term\", term);\n if (query.for) url.searchParams.set(\"for\", query.for);\n url.searchParams.set(\"types\", query.types.join(\",\"));\n if (specs.length) url.searchParams.set(\"cite\", specs.join(\",\"));\n return url;\n };\n\n for (const { query, elems } of notFound.values()) {\n const specs = [...new Set(flatten([], query.specs))].sort();\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const specsString = specs.map(spec => `\\`${spec}\\``).join(\", \");\n const msg =\n `Couldn't match \"**${originalTerm}**\" to anything in the document or in any other document cited in this specification: ${specsString}. ` +\n `See [how to cite to resolve the error](${formUrl})`;\n showInlineError(elems, msg, \"Error: No matching dfn found.\");\n }\n\n for (const { query, elems, results } of ambiguous.values()) {\n const specs = [...new Set(results.map(entry => entry.shortname))].sort();\n const specsString = specs.map(s => `**${s}**`).join(\", \");\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const msg =\n `The term \"**${originalTerm}**\" is defined in ${specsString} in multiple ways, so it's ambiguous. ` +\n `See [how to cite to resolve the error](${formUrl})`;\n showInlineError(elems, msg, \"Error: Linking an ambiguous dfn.\");\n }\n}\n\nfunction objectHash(obj) {\n const str = JSON.stringify(obj, Object.keys(obj).sort());\n const buffer = new TextEncoder().encode(str);\n return crypto.subtle.digest(\"SHA-1\", buffer).then(bufferToHexString);\n}\n\n/** @param {ArrayBuffer} buffer */\nfunction bufferToHexString(buffer) {\n const byteArray = new Uint8Array(buffer);\n return [...byteArray].map(v => v.toString(16).padStart(2, \"0\")).join(\"\");\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in conf.definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n addId,\n getLinkTargets,\n showInlineError,\n showInlineWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { run as addExternalReferences } from \"./xref.js\";\nimport { lang as defaultLang } from \"./l10n.js\";\nimport { definitionMap } from \"./dfn-map.js\";\nimport { linkInlineCitations } from \"./data-cite.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/link-to-dfn\";\nconst l10n = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n};\nconst lang = defaultLang in l10n ? defaultLang : \"en\";\n\nclass CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[String, HTMLElement]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n set(key, elem) {\n super.set(key.toLowerCase(), elem);\n return this;\n }\n get(key) {\n return super.get(key.toLowerCase());\n }\n has(key) {\n return super.has(key.toLowerCase());\n }\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLElement[]} */\n const possibleExternalLinks = [];\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n const localLinkSelector =\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\";\n document.querySelectorAll(localLinkSelector).forEach((\n /** @type {HTMLAnchorElement} */ anchor\n ) => {\n const linkTargets = getLinkTargets(anchor);\n const foundDfn = linkTargets.some(target => {\n return findLinkTarget(target, anchor, titleToDfns, possibleExternalLinks);\n });\n if (!foundDfn && linkTargets.length !== 0) {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n });\n\n showLinkingError(badLinks);\n\n if (conf.xref) {\n possibleExternalLinks.push(...findExplicitExternalLinks());\n try {\n await addExternalReferences(conf, possibleExternalLinks);\n } catch (error) {\n console.error(error);\n showLinkingError(possibleExternalLinks);\n }\n } else {\n showLinkingError(possibleExternalLinks);\n }\n\n await linkInlineCitations(document, conf);\n // Added message for legacy compat with Aria specs\n // See https://github.com/w3c/respec/issues/793\n pub(\"end\", \"core/link-to-dfn\");\n}\n\nfunction mapTitleToDfns() {\n const titleToDfns = new CaseInsensitiveMap();\n Object.keys(definitionMap).forEach(title => {\n const { result, duplicates } = collectDfns(title);\n titleToDfns.set(title, result);\n if (duplicates.length > 0) {\n showInlineError(\n duplicates,\n l10n[lang].duplicateMsg(title),\n l10n[lang].duplicateTitle\n );\n }\n });\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, HTMLElement>} */\n const result = new Map();\n const duplicates = [];\n definitionMap[title].forEach(dfn => {\n const { dfnFor = \"\" } = dfn.dataset;\n if (result.has(dfnFor)) {\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = result.get(dfnFor).localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n if (oldIsDfn) {\n if (!newIsDfn) {\n // Don't overwrite <dfn> definitions.\n return;\n }\n duplicates.push(dfn);\n }\n }\n result.set(dfnFor, dfn);\n addId(dfn, \"dfn\", title);\n });\n return { result, duplicates };\n}\n\n/**\n * @param {import(\"./utils.js\").LinkTarget} target\n * @param {HTMLAnchorElement} anchor\n * @param {CaseInsensitiveMap} titleToDfns\n * @param {HTMLElement[]} possibleExternalLinks\n */\nfunction findLinkTarget(target, anchor, titleToDfns, possibleExternalLinks) {\n const { linkFor } = anchor.dataset;\n if (\n !titleToDfns.has(target.title) ||\n !titleToDfns.get(target.title).get(target.for)\n ) {\n return false;\n }\n const dfn = titleToDfns.get(target.title).get(target.for);\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (linkFor && !titleToDfns.get(linkFor)) {\n possibleExternalLinks.push(anchor);\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n possibleExternalLinks.push(anchor);\n } else {\n if (anchor.dataset.idl === \"partial\") {\n possibleExternalLinks.push(anchor);\n } else {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n }\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return true;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) || shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt) {\n return dataset.lt.split(\"|\").includes(term);\n }\n }\n }\n return false;\n}\n\n/**\n * Find additional references that need to be looked up externally.\n * Examples: a[data-cite=\"spec\"], dfn[data-cite=\"spec\"], dfn.externalDFN\n */\nfunction findExplicitExternalLinks() {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n \"a[data-cite]:not([data-cite='']):not([data-cite*='#']), \" +\n \"dfn[data-cite]:not([data-cite='']):not([data-cite*='#'])\"\n );\n /** @type {NodeListOf<HTMLElement>} */\n const externalDFNs = document.querySelectorAll(\"dfn.externalDFN\");\n return [...links]\n .filter(el => {\n // ignore empties\n if (el.textContent.trim() === \"\") return false;\n /** @type {HTMLElement} */\n const closest = el.closest(\"[data-cite]\");\n return !closest || closest.dataset.cite !== \"\";\n })\n .concat(...externalDFNs);\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n showInlineWarning(\n elem,\n `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``,\n \"Linking error: not matching `<dfn>`\"\n );\n });\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { fetchAndCache, joinAnd } from \"./utils.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg =\n \"Requested list of contributors from GitHub, but \" +\n \"[`github`](https://github.com/w3c/respec/wiki/github) configuration option is not set.\";\n pub(\"error\", msg);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user => !editors.includes(user.name || user.login)\n );\n } catch (error) {\n pub(\"error\", \"Error loading contributors from GitHub.\");\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n const children = sortedContributors.map(\n ({ name, login }) =>\n hyperHTML`<li><a href=${`https://github.com/${login}`}>${name ||\n login}</a></li>`\n );\n element.textContent = \"\";\n element.append(...children);\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// LIMITATION:\n// At this point we don't support having more than 26 appendices.\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - tocIntroductory: if set to true, the introductory material is listed in the TOC\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport { addId, children, parents, renameElement } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\nconst headerTags = [\"h1\", ...lowerHeaderTags];\n\nconst alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = hyperHTML`<ol class='toc'>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? alphabet.charAt(index - lastNonAppendix)\n : prefix + index;\n const level = Math.ceil(secno.length / 2);\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(hyperHTML`<bdi class='secno'>${secno}</bdi>`, \" \");\n }\n\n if (level <= maxTocLevel) {\n const item = createTocListItem(section.header, section.element.id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent, { tocIntroductory = false } = {}) {\n const sectionElements = children(\n parent,\n tocIntroductory ? \"section\" : \"section:not(.introductory)\"\n );\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: section.classList.contains(\"introductory\"),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section, { tocIntroductory }),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = hyperHTML`<a href=\"${`#${id}`}\" class=\"tocxref\"/>`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return hyperHTML`<li class='tocline'>${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"tocIntroductory\" in conf === false) {\n conf.tocIntroductory = false;\n }\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n const sectionTree = getSectionTree(document.body, {\n tocIntroductory: conf.tocIntroductory,\n });\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n const headerSelector = headerTags\n .map(h => `section:not(.introductory) ${h}:first-child`)\n .join(\",\");\n return [...document.querySelectorAll(headerSelector)].filter(\n elem => !elem.closest(\"section.introductory\")\n );\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = hyperHTML`<nav id=\"toc\">`;\n const h2 = hyperHTML`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = hyperHTML`<p role='navigation' id='back-to-top'><a href='#title'><abbr title='Back to Top'>\\u2191;</abbr></a></p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst l10n = localizationStrings[lang];\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(hyperHTML`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId } from \"./utils.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head):not(.introductory) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n addId(h);\n if (!conf.addSectionLinks) continue;\n const id = h.parentElement.id || h.id;\n h.appendChild(hyperHTML`\n <a href=\"${`#${id}`}\" class=\"self-link\" aria-label=\"§\"></a>\n `);\n }\n}\n","// @ts-check\n/**\n * Module: \"core/caniuse\"\n * Adds a caniuse support table for a \"feature\" #1238\n * Usage options: https://github.com/w3c/respec/wiki/caniuse\n */\nimport { pub, sub } from \"./pubsubhub.js\";\nimport { createResourceHint } from \"./utils.js\";\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML } from \"./import-maps.js\";\n\nexport const name = \"core/caniuse\";\n\nconst API_URL = \"https://respec.org/caniuse/\";\n\n// browser name dictionary\nconst BROWSERS = new Map([\n [\"and_chr\", \"Chrome (Android)\"],\n [\"and_ff\", \"Firefox (Android)\"],\n [\"and_uc\", \"UC Browser (Android)\"],\n [\"android\", \"Android\"],\n [\"bb\", \"Blackberry\"],\n [\"chrome\", \"Chrome\"],\n [\"edge\", \"Edge\"],\n [\"firefox\", \"Firefox\"],\n [\"ie\", \"IE\"],\n [\"ios_saf\", \"Safari (iOS)\"],\n [\"op_mini\", \"Opera Mini\"],\n [\"op_mob\", \"Opera Mobile\"],\n [\"opera\", \"Opera\"],\n [\"safari\", \"Safari\"],\n [\"samsung\", \"Samsung Internet\"],\n]);\n\n// Keys from https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md\nconst supportTitles = new Map([\n [\"y\", \"Supported.\"],\n [\"a\", \"Almost supported (aka Partial support).\"],\n [\"n\", \"No support, or disabled by default.\"],\n [\"p\", \"No support, but has Polyfill.\"],\n [\"u\", \"Support unknown.\"],\n [\"x\", \"Requires prefix to work.\"],\n [\"d\", \"Disabled by default (needs to enabled).\"],\n]);\n\nif (\n !document.querySelector(\"link[rel='preconnect'][href='https://respec.org']\")\n) {\n const link = createResourceHint({\n hint: \"preconnect\",\n href: \"https://respec.org\",\n });\n document.head.appendChild(link);\n}\n\nconst caniuseCssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/caniuse.css\")).default;\n } catch {\n return fetchAsset(\"caniuse.css\");\n }\n}\n\nexport async function run(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n const options = getNormalizedConf(conf);\n conf.caniuse = options; // for tests\n if (!options.feature) {\n return; // no feature to show\n }\n const featureURL = new URL(options.feature, \"https://caniuse.com/\").href;\n\n const caniuseCss = await caniuseCssPromise;\n document.head.appendChild(hyperHTML`\n <style class=\"removeOnSave\">${caniuseCss}</style>`);\n\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = (async () => {\n try {\n const apiUrl = options.apiURL || API_URL;\n const stats = await fetchStats(apiUrl, options);\n return createTableHTML(featureURL, stats);\n } catch (err) {\n console.error(err);\n const msg =\n `Couldn't find feature \"${options.feature}\" on caniuse.com? ` +\n \"Please check the feature key on [caniuse.com](https://caniuse.com)\";\n pub(\"error\", msg);\n return hyperHTML`<a href=\"${featureURL}\">caniuse.com</a>`;\n }\n })();\n const stats = hyperHTML`<dd class=\"caniuse-stats\">\n Fetching data from caniuse.com...\n </dd>`;\n const definitionPair = hyperHTML`\n <dt class=\"caniuse-title\">Browser support:</dt>\n ${stats}`;\n headDlElem.append(...definitionPair.childNodes);\n const result = await contentPromise;\n stats.textContent = \"\";\n stats.append(result);\n\n // remove from export\n pub(\"amend-user-config\", { caniuse: options.feature });\n sub(\"beforesave\", outputDoc => {\n const stats = outputDoc.querySelector(\".caniuse-stats\");\n stats.textContent = \"\";\n stats.append(hyperHTML`<a href=\"${featureURL}\">caniuse.com</a>`);\n });\n}\n\n/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction getNormalizedConf(conf) {\n const DEFAULTS = { versions: 4 };\n if (typeof conf.caniuse === \"string\") {\n return { feature: conf.caniuse, ...DEFAULTS };\n }\n const caniuseConf = { ...DEFAULTS, ...conf.caniuse };\n const { browsers } = caniuseConf;\n if (Array.isArray(browsers)) {\n const invalidBrowsers = browsers.filter(browser => !BROWSERS.has(browser));\n if (invalidBrowsers.length) {\n const names = invalidBrowsers.map(b => `\"\\`${b}\\`\"`).join(\", \");\n pub(\n \"warn\",\n `Ignoring invalid browser(s): ${names} in ` +\n \"[`respecConfig.caniuse.browsers`](https://github.com/w3c/respec/wiki/caniuse)\"\n );\n }\n }\n return caniuseConf;\n}\n\n/**\n * @param {string} apiURL\n * @typedef {Record<string, [string, string[]][]>} ApiResponse\n * @return {Promise<ApiResponse>}\n * @throws {Error} on failure\n */\nasync function fetchStats(apiURL, options) {\n const { feature, versions, browsers } = options;\n const searchParams = new URLSearchParams();\n searchParams.set(\"feature\", feature);\n searchParams.set(\"versions\", versions);\n if (Array.isArray(browsers)) {\n searchParams.set(\"browsers\", browsers.join(\",\"));\n }\n const url = `${apiURL}?${searchParams.toString()}`;\n const response = await fetch(url);\n const stats = await response.json();\n return stats;\n}\n\n/**\n * Get HTML element for the canIUse support table.\n * @param {string} featureURL\n * @param {ApiResponse} stats\n */\nfunction createTableHTML(featureURL, stats) {\n // render the support table\n return hyperHTML`\n ${Object.entries(stats).map(addBrowser)}\n <a href=\"${featureURL}\"\n title=\"Get details at caniuse.com\">More info\n </a>`;\n}\n\n/**\n * Add a browser and it's support to table.\n * @param {[ string, ApiResponse[\"browserName\"] ]} args\n */\nfunction addBrowser([browserName, browserData]) {\n /** @param {string[]} supportKeys */\n const getSupport = supportKeys => {\n const titles = supportKeys\n .filter(key => supportTitles.has(key))\n .map(key => supportTitles.get(key));\n return {\n className: `caniuse-cell ${supportKeys.join(\" \")}`,\n title: titles.join(\" \"),\n };\n };\n\n /** @param {[string, string[]]} args */\n const addLatestVersion = ([version, supportKeys]) => {\n const { className, title } = getSupport(supportKeys);\n const buttonText = `${BROWSERS.get(browserName) || browserName} ${version}`;\n return hyperHTML`\n <button class=\"${className}\" title=\"${title}\">${buttonText}</button>`;\n };\n\n /** @param {[string, string[]]} args */\n const addBrowserVersion = ([version, supportKeys]) => {\n const { className, title } = getSupport(supportKeys);\n return hyperHTML`<li class=\"${className}\" title=\"${title}\">${version}</li>`;\n };\n\n const [latestVersion, ...olderVersions] = browserData;\n return hyperHTML`\n <div class=\"caniuse-browser\">\n ${addLatestVersion(latestVersion)}\n <ul>\n ${olderVersions.map(addBrowserVersion)}\n </ul>\n </div>`;\n}\n","// @ts-check\nimport { hyperHTML, raw } from \"./import-maps.js\";\nimport { fetchAndCache } from \"./utils.js\";\nimport { fetchAsset } from \"./text-loader.js\";\n\nexport const name = \"core/mdn-annoatation\";\n\nconst SPEC_MAP_URL =\n \"https://raw.githubusercontent.com/w3c/mdn-spec-links/master/SPECMAP.json\";\nconst BASE_JSON_PATH = \"https://w3c.github.io/mdn-spec-links/\";\nconst MDN_URL_BASE = \"https://developer.mozilla.org/en-US/docs/Web/\";\nconst MDN_BROWSERS = {\n // The browser IDs here must match the ones in the imported JSON data.\n // See the list of browser IDs at https://goo.gl/iDacWP.\n chrome: \"Chrome\",\n chrome_android: \"Chrome Android\",\n edge: \"Edge\",\n edge_mobile: \"Edge Mobile\",\n firefox: \"Firefox\",\n firefox_android: \"Firefox Android\",\n ie: \"Internet Explorer\",\n // nodejs: \"Node.js\", // no data for features in HTML\n opera: \"Opera\",\n opera_android: \"Opera Android\",\n // qq_android: \"QQ Browser\", // not enough data for features in HTML\n safari: \"Safari\",\n safari_ios: \"Safari iOS\",\n samsunginternet_android: \"Samsung Internet\",\n // uc_android: \"UC browser\", // not enough data for features in HTML\n // uc_chinese_android: \"Chinese UC Browser\", // not enough data for features in HTML\n webview_android: \"WebView Android\",\n};\n\nconst mdnCssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/mdn-annotation.css\")).default;\n } catch {\n return fetchAsset(\"mdn-annotation.css\");\n }\n}\n\nfunction fetchAndCacheJson(url, maxAge) {\n if (!url) return {};\n return fetchAndCache(url, maxAge).then(r => r.json());\n}\n\nfunction insertMDNBox(node) {\n const targetAncestor = node.closest(\"section\");\n const { previousElementSibling: targetSibling, parentNode } = targetAncestor;\n if (targetSibling && targetSibling.classList.contains(\"mdn\")) {\n // If the target ancestor already has a mdnBox inserted, we just use it\n return targetSibling;\n }\n const mdnBox = hyperHTML`<aside class=\"mdn before wrapped\"></aside>`;\n parentNode.insertBefore(mdnBox, targetAncestor);\n return mdnBox;\n}\n\nfunction attachMDNDetail(container, mdnSpec) {\n const { slug, summary } = mdnSpec;\n container.innerHTML += `<button onclick=\"toggleMDNStatus(this.parentNode)\" aria-label=\"Expand MDN details\"><b>MDN</b></button>`;\n const mdnSubPath = slug.slice(slug.indexOf(\"/\") + 1);\n const href = `${MDN_URL_BASE}${slug}`;\n const mdnDetail = hyperHTML`\n <div>\n <a title=\"${summary}\" href=\"${href}\">${mdnSubPath}</a>\n </div>\n `;\n attachMDNBrowserSupport(mdnDetail, mdnSpec);\n container.appendChild(mdnDetail);\n}\n\nfunction attachMDNBrowserSupport(container, mdnSpec) {\n if (!mdnSpec.support) {\n container.innerHTML += `<p class=\"nosupportdata\">No support data.</p>`;\n return;\n }\n const supportTable = hyperHTML`<p class=\"mdnsupport\">\n ${raw(buildBrowserSupportTable(mdnSpec.support))}\n </p>`;\n container.appendChild(supportTable);\n}\n\nfunction buildBrowserSupportTable(support) {\n let innerHTML = \"\";\n function addMDNBrowserRow(browserId, yesNoUnknown, version) {\n const displayStatus = yesNoUnknown === \"Unknown\" ? \"?\" : yesNoUnknown;\n const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`;\n const browserRow = `\n <span class=\"${classList}\">\n <span class=\"browser-name\">${MDN_BROWSERS[browserId]}</span>\n <span class=\"version\">${version ? version : displayStatus}</span>\n </span>`;\n innerHTML += browserRow;\n }\n\n function processBrowserData(browserId, versionData) {\n if (versionData.version_removed) {\n addMDNBrowserRow(browserId, \"No\", \"\");\n return;\n }\n const versionAdded = versionData.version_added;\n if (!versionAdded) {\n addMDNBrowserRow(browserId, \"Unknown\", \"\");\n return;\n }\n if (typeof versionAdded === \"boolean\") {\n addMDNBrowserRow(browserId, versionAdded ? \"Yes\" : \"No\", \"\");\n } else {\n addMDNBrowserRow(browserId, \"Yes\", `${versionAdded}+`);\n }\n }\n\n Object.keys(MDN_BROWSERS).forEach(browserId => {\n if (!support[browserId]) {\n addMDNBrowserRow(browserId, \"Unknown\", \"\");\n } else {\n if (Array.isArray(support[browserId])) {\n support[browserId].forEach(b => {\n processBrowserData(browserId, b);\n });\n } else {\n processBrowserData(browserId, support[browserId]);\n }\n }\n });\n return innerHTML;\n}\n\nexport async function run(conf) {\n const { shortName, mdn } = conf;\n if (!shortName || !mdn) {\n // Nothing to do if shortName is not provided\n return;\n }\n const maxAge = mdn.maxAge || 60 * 60 * 24 * 1000;\n const specMapUrl = mdn.specMapUrl || SPEC_MAP_URL;\n const baseJsonPath = mdn.baseJsonPath || BASE_JSON_PATH;\n const specMap = await fetchAndCacheJson(specMapUrl, maxAge);\n const hasSpecJson = Object.values(specMap).some(\n jsonName => jsonName === `${shortName}.json`\n );\n if (!hasSpecJson) {\n return;\n }\n const mdnSpecJson = await fetchAndCacheJson(\n `${baseJsonPath}/${shortName}.json`,\n maxAge\n );\n const mdnCss = await mdnCssPromise;\n document.head.appendChild(hyperHTML`<style>${raw(mdnCss)}</style>`);\n document.head.appendChild(hyperHTML`<script>\n function toggleMDNStatus(div) {\n div.parentNode.classList.toggle('wrapped');\n }\n </script>`);\n const nodesWithId = document.querySelectorAll(\"[id]\");\n [...nodesWithId]\n .filter(node => {\n const unlikelyTagNames = [\"STYLE\", \"SCRIPT\", \"BODY\"];\n return (\n unlikelyTagNames.indexOf(node.tagName) === -1 &&\n mdnSpecJson[node.id] &&\n Array.isArray(mdnSpecJson[node.id])\n );\n })\n .forEach(node => {\n const mdnSpecArray = mdnSpecJson[node.id];\n const mdnBox = insertMDNBox(node);\n mdnSpecArray\n .map(spec => {\n const mdnDiv = document.createElement(\"div\");\n attachMDNDetail(mdnDiv, spec);\n return mdnDiv;\n })\n .forEach(mdnDiv => mdnBox.appendChild(mdnDiv));\n });\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nfunction serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = hyperHTML`<meta charset=\"utf-8\">`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = hyperHTML`\n <meta name=\"generator\" content=\"${respecVersion}\">\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\n// Create and download an EPUB 3 version of the content\n// Using (by default) the EPUB 3 conversion service set up at labs.w3.org/epub-generator\n// For more details on that service, see https://github.com/iherman/respec2epub\nconst epubURL = new URL(\n \"https://labs.w3.org/epub-generator/cgi-bin/epub-generator.py\"\n);\nepubURL.searchParams.append(\"type\", \"respec\");\nepubURL.searchParams.append(\"url\", document.location.href);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n fileName: \"index.html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n fileName: \"index.xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n fileName: \"spec.epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n href: epubURL.href,\n },\n];\n\nfunction toDownloadLink(details) {\n const { id, href, fileName, title, type } = details;\n return hyperHTML`\n <a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${fileName}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a>`;\n}\n\nconst saveDialog = {\n async show(button) {\n await document.respecIsReady;\n const div = hyperHTML`\n <div class=\"respec-save-buttons\">\n ${downloadLinks.map(toDownloadLink)}\n </div>`;\n ui.freshModal(l10n[lang].save_snapshot, div, button);\n },\n};\n\nconst supportsDownload = \"download\" in HTMLAnchorElement.prototype;\nlet button;\nif (supportsDownload) {\n button = ui.addCommand(\n l10n[lang].save_snapshot,\n show,\n \"Ctrl+Shift+Alt+S\",\n \"💾\"\n );\n}\n\nfunction show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed. \" +\n \"Use core/exporter `rsDocToDataURL()` instead.\";\n pub(\"warn\", msg);\n console.warn(msg);\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { flatten } from \"../core/utils.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\nimport { wireReference } from \"../core/biblio.js\";\n\nconst button = ui.addCommand(\n l10n[lang].search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"🔎\"\n);\nconst specrefURL = \"https://specref.herokuapp.com/\";\nconst refSearchURL = `${specrefURL}search-refs`;\nconst reveseLookupURL = `${specrefURL}reverse-lookup`;\nconst form = document.createElement(\"form\");\n\nform.id = \"specref-ui\";\n\n/**\n * @param {Map<string, string>} resultMap\n * @param {string} query\n * @param {number} timeTaken\n */\nfunction renderResults(resultMap, query, timeTaken) {\n if (!resultMap.size) {\n return hyperHTML`\n <p class=\"state\">\n Your search - <strong> ${query} </strong> -\n did not match any references.\n </p>\n `;\n }\n const wires = Array.from(resultMap)\n .slice(0, 99)\n .map(toDefinitionPair)\n .reduce((collector, pair) => collector.concat(pair), []);\n return hyperHTML`\n <p class=\"result-stats\">\n ${resultMap.size} results (${timeTaken} seconds).\n ${resultMap.size > 99 ? \"First 100 results.\" : \"\"}\n </p>\n <dl class=\"specref-results\">${wires}</dl>\n `;\n}\n\nfunction toDefinitionPair([key, entry]) {\n return hyperHTML`\n <dt>\n [${key}]\n </dt>\n <dd>${wireReference(entry)}</dd>\n `;\n}\n\nfunction resultProcessor({ includeVersions = false } = {}) {\n return (...fetchedData) => {\n /** @type {{ [key: string]: any }} */\n const combinedResults = Object.assign({}, ...fetchedData);\n const results = new Map(Object.entries(combinedResults));\n // remove aliases\n Array.from(results)\n .filter(([, entry]) => entry.aliasOf)\n .map(([key]) => key)\n .reduce((results, key) => results.delete(key) && results, results);\n // Remove versions, if asked to\n if (!includeVersions) {\n Array.from(results.values())\n .filter(entry => typeof entry === \"object\" && \"versions\" in entry)\n .reduce(flatten, [])\n .forEach(version => {\n results.delete(version);\n });\n }\n // Remove legacy string entries\n Array.from(results)\n .filter(([, value]) => typeof value !== \"object\")\n .forEach(([key]) => results.delete(key));\n return results;\n };\n}\n\nform.addEventListener(\"submit\", async ev => {\n ev.preventDefault();\n const { searchBox } = form;\n const query = searchBox.value;\n if (!query) {\n searchBox.focus();\n return;\n }\n render({ state: \"Searching Specref…\" });\n const refSearch = new URL(refSearchURL);\n refSearch.searchParams.set(\"q\", query);\n const reverseLookup = new URL(reveseLookupURL);\n reverseLookup.searchParams.set(\"urls\", query);\n try {\n const startTime = performance.now();\n const jsonData = await Promise.all([\n fetch(refSearch).then(response => response.json()),\n fetch(reverseLookup).then(response => response.json()),\n ]);\n const { checked: includeVersions } = form.includeVersions;\n const processResults = resultProcessor({ includeVersions });\n const results = processResults(...jsonData);\n render({\n query,\n results,\n state: \"\",\n timeTaken: Math.round(performance.now() - startTime) / 1000,\n });\n } catch (err) {\n console.error(err);\n render({ state: \"Error! Couldn't do search.\" });\n } finally {\n searchBox.focus();\n }\n});\n\nfunction show() {\n render();\n ui.freshModal(l10n[lang].search_specref, form, button);\n /** @type {HTMLElement} */\n const input = form.querySelector(\"input[type=search]\");\n input.focus();\n}\n\nconst mast = hyperHTML`\n <div>\n <header>\n <p>\n An Open-Source, Community-Maintained Database of\n Web Standards & Related References.\n </p>\n </header>\n <div class=\"searchcomponent\">\n <input\n name=\"searchBox\"\n type=\"search\"\n autocomplete=\"off\"\n placeholder=\"Keywords, titles, authors, urls…\">\n <button\n type=\"submit\">\n Search\n </button>\n <label>\n <input type=\"checkbox\" name=\"includeVersions\"> Include all versions.\n </label>\n </div>\n </div>\n`;\n\n/**\n * @param {object} options\n * @param {string} [options.state]\n * @param {Map<string, string>} [options.results]\n * @param {number} [options.timeTaken]\n * @param {string} [options.query]\n */\nfunction render({ state = \"\", results, timeTaken, query } = {}) {\n if (!results) {\n form.textContent = \"\";\n form.append(mast);\n return;\n }\n const content = hyperHTML`\n ${mast}\n <p class=\"state\" hidden=\"${!state}\">\n ${state}\n </p>\n <section hidden=\"${!results}\">${\n results ? renderResults(results, query, timeTaken) : []\n }</section>\n `;\n form.textContent = \"\";\n form.append(content);\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst XREF_URL = \"https://respec.org/xref/\";\n\nconst localizationStrings = {\n en: {\n title: \"Search definitions\",\n },\n};\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\nconst l10n = localizationStrings[lang];\n\nconst button = ui.addCommand(l10n.title, show, \"Ctrl+Shift+Alt+x\", \"📚\");\n\nfunction show() {\n const iframe = document.createElement(\"iframe\");\n iframe.id = \"xref-ui\";\n iframe.src = XREF_URL;\n iframe.onload = () => iframe.classList.add(\"ready\");\n ui.freshModal(l10n.title, iframe, button);\n}\n","// @ts-check\n// Module ui/dfn-list\n// Displays all definitions with links to the defining element.\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { definitionMap } from \"../core/dfn-map.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst button = ui.addCommand(\n l10n[lang].definition_list,\n show,\n \"Ctrl+Shift+Alt+D\",\n \"📔\"\n);\n\nconst ul = document.createElement(\"ul\");\nul.classList.add(\"respec-dfn-list\");\n\nul.addEventListener(\"click\", ev => {\n ui.closeModal();\n ev.stopPropagation();\n});\n\nfunction show() {\n const definitionLinks = Object.entries(definitionMap)\n .sort(([keyA], [keyB]) => keyA.localeCompare(keyB))\n .map(([, [dfn]]) => {\n return hyperHTML`\n <li>\n <a href=\"${`#${dfn.id}`}\">\n ${dfn.textContent}\n </a>\n </li>\n `;\n });\n ul.textContent = \"\";\n ul.append(...definitionLinks);\n ui.freshModal(l10n[lang].list_of_definitions, ul, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { l10n, lang } from \"../core/l10n.js\";\nimport { hyperHTML } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst button = ui.addCommand(\n `About ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n ui.freshModal(\n `${l10n[lang].about_respec} - ${window.respecVersion}`,\n div,\n button\n );\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n const fragment = hyperHTML`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://github.com/w3c/respec/wiki'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n div.textContent = \"\";\n div.append(fragment);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/tree/develop/src/${name}.js`;\n return hyperHTML`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","// @ts-check\n// Module w3c/seo\n// Manages SEO information for documents\n// e.g. set the canonical URL for the document if configured\nimport { pub } from \"../core/pubsubhub.js\";\nimport { resolveRef } from \"../core/biblio.js\";\nexport const name = \"w3c/seo\";\nexport async function run(conf) {\n // Don't include a canonical URL for documents\n // that haven't been published.\n if (!conf.canonicalURI) {\n switch (conf.specStatus) {\n case \"CG-DRAFT\":\n case \"BG-DRAFT\":\n case \"unofficial\":\n return;\n }\n }\n const trLatestUri = conf.shortName\n ? `https://www.w3.org/TR/${conf.shortName}/`\n : null;\n switch (conf.canonicalURI) {\n case \"edDraft\":\n if (conf.edDraftURI) {\n conf.canonicalURI = new URL(\n conf.edDraftURI,\n document.location.href\n ).href;\n } else {\n pub(\n \"warn\",\n \"Canonical URI set to edDraft, \" +\n \"but no edDraftURI is set in configuration\"\n );\n conf.canonicalURI = null;\n }\n break;\n case \"TR\":\n if (trLatestUri) {\n conf.canonicalURI = trLatestUri;\n } else {\n pub(\n \"warn\",\n \"Canonical URI set to TR, but \" +\n \"no shortName is set in configuration\"\n );\n conf.canonicalURI = null;\n }\n break;\n default:\n if (conf.canonicalURI) {\n try {\n conf.canonicalURI = new URL(\n conf.canonicalURI,\n document.location.href\n ).href;\n } catch (err) {\n pub(\"warn\", `CanonicalURI is an invalid URL: ${err.message}`);\n conf.canonicalURI = null;\n }\n } else if (trLatestUri) {\n conf.canonicalURI = trLatestUri;\n }\n }\n if (conf.canonicalURI) {\n const linkElem = document.createElement(\"link\");\n linkElem.setAttribute(\"rel\", \"canonical\");\n linkElem.setAttribute(\"href\", conf.canonicalURI);\n document.head.appendChild(linkElem);\n }\n if (conf.doJsonLd) {\n await addJSONLDInfo(conf, document);\n }\n}\n\nasync function addJSONLDInfo(conf, doc) {\n // Content for JSON\n const type = [\"TechArticle\"];\n if (conf.rdfStatus) type.push(conf.rdfStatus);\n\n const jsonld = {\n \"@context\": [\n \"http://schema.org\",\n {\n \"@vocab\": \"http://schema.org/\",\n \"@language\": doc.documentElement.lang || \"en\",\n w3p: \"http://www.w3.org/2001/02pd/rec54#\",\n foaf: \"http://xmlns.com/foaf/0.1/\",\n datePublished: { \"@type\": \"http://www.w3.org/2001/XMLSchema#date\" },\n inLanguage: { \"@language\": null },\n isBasedOn: { \"@type\": \"@id\" },\n license: { \"@type\": \"@id\" },\n },\n ],\n id: conf.canonicalURI || conf.thisVersion,\n type,\n name: conf.title,\n inLanguage: doc.documentElement.lang || \"en\",\n license: conf.licenseInfo.url,\n datePublished: conf.dashDate,\n /** @type {{ name: string, url?: string } | { name: string, url?: string }[]} */\n copyrightHolder: {\n name: \"World Wide Web Consortium\",\n url: \"https://www.w3.org/\",\n },\n discussionUrl: conf.issueBase,\n alternativeHeadline: conf.subtitle,\n isBasedOn: conf.prevVersion,\n };\n\n // add any additional copyright holders\n if (conf.additionalCopyrightHolders) {\n const addl = Array.isArray(conf.additionalCopyrightHolders)\n ? conf.additionalCopyrightHolders\n : [conf.additionalCopyrightHolders];\n jsonld.copyrightHolder = [\n jsonld.copyrightHolder,\n ...addl.map(h => ({ name: h })),\n ];\n }\n\n // description from meta description\n const description = doc.head.querySelector(\"meta[name=description]\");\n if (description) {\n jsonld.description = description.content;\n }\n\n // Editors\n if (conf.editors) {\n jsonld.editor = conf.editors.map(addPerson);\n }\n if (conf.authors) {\n jsonld.contributor = conf.authors.map(addPerson);\n }\n\n // normative and informative references\n const citationIds = [\n ...conf.normativeReferences,\n ...conf.informativeReferences,\n ];\n const citationContents = await Promise.all(\n citationIds.map(ref => resolveRef(ref))\n );\n jsonld.citation = citationContents\n .filter(ref => typeof ref === \"object\")\n .map(addRef);\n\n const script = doc.createElement(\"script\");\n script.type = \"application/ld+json\";\n script.textContent = JSON.stringify(jsonld, null, 2);\n doc.head.appendChild(script);\n}\n\n/**\n * Turn editors and authors into a list of JSON-LD relationships\n */\nfunction addPerson({ name, url, mailto, company, companyURL }) {\n const ed = {\n type: \"Person\",\n name,\n url,\n \"foaf:mbox\": mailto,\n };\n if (company || companyURL) {\n ed.worksFor = {\n name: company,\n url: companyURL,\n };\n }\n return ed;\n}\n\n/**\n * Create a reference URL from the ref\n */\nfunction addRef(ref) {\n const { href: id, title: name, href: url } = ref;\n const jsonld = {\n id,\n type: \"TechArticle\",\n name,\n url,\n };\n if (ref.authors) {\n jsonld.creator = ref.authors.map(a => ({ name: a }));\n }\n if (ref.rawDate) {\n jsonld.publishedDate = ref.rawDate;\n }\n if (ref.isbn) {\n jsonld.identifier = ref.isbn;\n }\n if (ref.publisher) {\n jsonld.publisher = { name: ref.publisher };\n }\n return jsonld;\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight.js\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport { fetchAsset } from \"./text-loader.js\";\nimport { hyperHTML as html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nconst ghCssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/github.css\")).default;\n } catch {\n return fetchAsset(\"github.css\");\n }\n}\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n const ghCss = await ghCssPromise;\n document.head.appendChild(\n html`\n <style>\n ${ghCss}\n </style>\n `\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/webidl-clipboard\n *\n * This module adds a button to each IDL pre making it possible to copy\n * well-formatted IDL to the clipboard.\n *\n */\nimport { fetchAsset } from \"./text-loader.js\";\nexport const name = \"core/webidl-clipboard\";\n\nconst copyButtonPromise = createButton();\n\nasync function loadSVG() {\n try {\n return (await import(\"text!../../assets/clipboard.svg\")).default;\n } catch {\n return fetchAsset(\"clipboard.svg\");\n }\n}\n\nasync function createButton() {\n const copyButton = document.createElement(\"button\");\n copyButton.innerHTML = await loadSVG();\n copyButton.title = \"Copy IDL to clipboard\";\n copyButton.classList.add(\"respec-button-copy-paste\", \"removeOnSave\");\n return copyButton;\n}\n\nexport async function run() {\n // This button serves a prototype that we clone as needed.\n const copyButton = await copyButtonPromise;\n for (const pre of document.querySelectorAll(\"pre.idl\")) {\n const button = copyButton.cloneNode(true);\n button.addEventListener(\"click\", () => {\n clipboardWriteText(pre.textContent);\n });\n pre.prepend(button);\n }\n}\n\n/**\n * Mocks navigator.clipboard.writeText()\n * @param {string} text\n */\nfunction clipboardWriteText(text) {\n if (navigator.clipboard) {\n return navigator.clipboard.writeText(text);\n }\n return new Promise(resolve => {\n document.addEventListener(\n \"copy\",\n ev => {\n ev.clipboardData.setData(\"text/plain\", text);\n resolve();\n },\n { once: true }\n );\n document.execCommand(\"copy\");\n });\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://github.com/w3c/respec/wiki/data-tests\n */\nimport { lang as defaultLang } from \"./l10n.js\";\nimport { hyperHTML } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { showInlineWarning } from \"./utils.js\";\nconst l10n = {\n en: {\n missing_test_suite_uri:\n \"Found tests in your spec, but missing '\" +\n \"[`testSuiteURI`](https://github.com/w3c/respec/wiki/testSuiteURI)' in your ReSpec config.\",\n tests: \"tests\",\n test: \"test\",\n },\n};\n\nexport const name = \"core/data-tests\";\n\nconst lang = defaultLang in l10n ? defaultLang : \"en\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"🔒\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"💪\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = hyperHTML`\n <li>\n <a href=\"${href}\">\n ${testFileName}\n </a> ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n pub(\"error\", l10n[lang].missing_test_suite_uri);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n delete elem.dataset.tests;\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n */\nfunction toTestURLs(tests, testSuiteURI) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n pub(\"warn\", `${l10n[lang].bad_uri}: ${test}`);\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n showInlineWarning(\n elem,\n `Duplicate tests found`,\n `To fix, remove duplicates from \"data-tests\": ${duplicates\n .map(url => new URL(url).pathname)\n .join(\", \")}`\n );\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = hyperHTML`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>\n tests: ${uniqueList.length}\n </summary>\n <ul>${uniqueList.map(toListItem)}</ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { children } from \"./utils.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n return ({ textContent: a }, { textContent: b }) => {\n return direction === \"ascending\" ? a.localeCompare(b) : b.localeCompare(a);\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...children(elem, \"li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...children(dl, \"dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default:\n pub(\"warning\", `ReSpec can't sort ${elem.localName} elements.`);\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport { fetchAsset } from \"./text-loader.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nconst hlVarsPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/var.css\")).default;\n } catch {\n return fetchAsset(\"var.css\");\n }\n}\n\nexport async function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = await hlVarsPromise;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = varElem.textContent.trim();\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n el.textContent.trim() === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport { fetchAsset } from \"./text-loader.js\";\n\nexport const name = \"core/data-type\";\n\nconst tooltipStylePromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/datatype.css\")).default;\n } catch {\n return fetchAsset(\"datatype.css\");\n }\n}\n\nexport async function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = await tooltipStylePromise;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\n\nimport { fetchAsset } from \"./text-loader.js\";\n\nexport const name = \"core/algorithms\";\n\nconst cssPromise = loadStyle();\n\nasync function loadStyle() {\n try {\n return (await import(\"text!../../assets/algorithms.css\")).default;\n } catch {\n return fetchAsset(\"algorithms.css\");\n }\n}\n\nexport async function run() {\n const elements = Array.from(document.querySelectorAll(\"ol.algorithm li\"));\n elements\n .filter(li => li.textContent.trim().startsWith(\"Assert: \"))\n .forEach(li => li.classList.add(\"assert\"));\n if (document.querySelector(\".assert\")) {\n const style = document.createElement(\"style\");\n style.textContent = await cssPromise;\n document.head.appendChild(style);\n }\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, showInlineError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n showInlineError(a, msg, `No matching id in document: ${id}.`);\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n showInlineError(a, msg, `Can't expand \"#${id}\".`);\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n showInlineError(a, msg, \"Missing title.\");\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n showInlineError(a, msg, \"Missing figcaption in referenced figure.\");\n return;\n }\n // remove the figure's title\n const children = [...makeSafeCopy(figcaption).childNodes].filter(\n node => !node.classList || !node.classList.contains(\"fig-title\")\n );\n // drop an empty space at the end.\n children.pop();\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n showInlineError(a, msg, `No matching id in document: \"${id}\".`);\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { hyperHTML } from \"../import-maps.js\";\nimport { showInlineError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n hyperHTML.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showInlineError(this, error.message, error.message))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && hyperHTML` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return hyperHTML`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: Function }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n"],"names":["doneResolver","done","name","lang","docLang","preProcessDone","postProcessDone","error","flatten","html","createCommonjsModule","_html","_raw","marked","_marked","pluralize","_pluralize","run","defaultLang","meta","linterFunction","rule","lintingFunction","noHttpPropsRule","noHeadinglessSectionsRule","checkPunctuation","localRefsExist","checkInternalSlots","checkCharset","privsecSection","privsecSectionRule","insertStyle","loadStyle","l10n","localizationStrings","normalize","cssPromise","templates","addExternalReferences","API_URL","button","show","link","toHTML"],"mappings":";;;;AACA;AACA,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,IAAI;EACrC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;CACzC,CAAC,CAAC;;AAEH,MAAM,OAAO,GAAG;;EAEd,0DAAoC;EACpC,oDAA2B;EAC3B,0DAAiC;EACjC,4DAAsC;EACtC,sDAA6B;EAC7B,wDAAgC;EAChC,qDAA8B;EAC9B,uDAA6B;EAC7B,sDAA4B;EAC5B,wDAA+B;EAC/B,2DAAqC;EACrC,wDAAiC;EACjC,uDAA+B;EAC/B,wDAAgC;EAChC,6DAAuC;EACvC,wDAAkC;EAClC,uDAAgC;EAChC,2DAAmC;EACnC,mDAA4B;EAC5B,2DAAkC;EAClC,wDAAiC;EACjC,2DAAqC;EACrC,4DAAqC;EACrC,6DAAuC;EACvC,uDAAgC;EAChC,sDAA+B;EAC/B,wDAAkC;EAClC,wDAA+B;EAC/B,2DAAqC;EACrC,yDAAoC;EACpC,4DAAsC;EACtC,uDAAgC;EAChC,0DAAoC;EACpC,2DAAkC;EAClC,2DAAoC;EACpC,yDAAmC;EACnC,uDAAgC;EAChC,6DAAuC;EACvC,wDAAgC;EAChC,6DAAqC;EACrC,0DAAkC;EAClC,uDAA+B;EAC/B,2DAAmC;EACnC,mDAA4B;EAC5B,qDAA2B;EAC3B,yDAAkC;EAClC,+DAAyC;EACzC,yDAAmC;EACnC,0DAAoC;EACpC,+DA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,MAAMzC,MAAI,GAAG,sBAAsB,CAAC;;AAE3C,AAAO,eAAee,KAAG,GAAG;;EAE1B,eAAe,CAAC,OAAO,CAAC,EAAE,IAAI;IAC5B,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;GAC5C,CAAC,CAAC;;;EAGH,MAAM,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAChE,MAAM,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;EACnD,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;IAClC,EAAE,IAAI,IAAI,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;GAC3E,CAAC;EACF,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/js/deps/nanohtml.js b/js/deps/nanohtml.js new file mode 100644 index 0000000000..13696ebf16 --- /dev/null +++ b/js/deps/nanohtml.js @@ -0,0 +1,4 @@ +import nanohtml from "nanohtml/dom"; +export { default as raw } from "nanohtml/lib/raw-browser"; + +export const html = nanohtml(document); diff --git a/js/deps/rollup.config.js b/js/deps/rollup.config.js index 0ddad9d458..e84e6265e4 100644 --- a/js/deps/rollup.config.js +++ b/js/deps/rollup.config.js @@ -22,6 +22,15 @@ export default [ input: "js/deps/marked.js", ...template }, + { + input: "js/deps/nanohtml.js", + onwarn(warning, warn) { + if (warning.code !== "CIRCULAR_DEPENDENCY") { + warn(warning); + } + }, + ...template + }, { input: "js/deps/pluralize.js", ...template diff --git a/karma.conf.js b/karma.conf.js index fefef39163..35c0555e46 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -49,10 +49,6 @@ module.exports = function(config) { pattern: "node_modules/idb/**/*.js", included: false, }, - { - pattern: "node_modules/hyperhtml/**/*.js", - included: false, - }, { pattern: "node_modules/webidl2/**/*.js", included: false, diff --git a/package-lock.json b/package-lock.json index 01785526ae..e429eee546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -130,6 +130,15 @@ "to-fast-properties": "^2.0.0" } }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -527,72 +536,6 @@ "@types/node": "*" } }, - "@ungap/create-content": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@ungap/create-content/-/create-content-0.1.4.tgz", - "integrity": "sha512-YM6YQkF5wUxJlw5yDzEAzJfPK/kXR/GxIARx4NNJCInfx/nirHmy3ujPjfi7CaXjcVCwyfpv3vKQm6h762lbRA==", - "dev": true - }, - "@ungap/custom-event": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@ungap/custom-event/-/custom-event-0.2.0.tgz", - "integrity": "sha512-jovJx+4IaAL8JAzepJXDBVlS9t9mR3vKbbjcHwHCF+sN0KKCYQ2pNVAlQYiRrPqeNBl5VXU7uUDOKBg9ODB+0Q==", - "dev": true - }, - "@ungap/essential-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@ungap/essential-map/-/essential-map-0.2.0.tgz", - "integrity": "sha512-PM7rUPhH2IAeDZXGjMi1KwNVW/4b/wxfzlPkZSXacHA5A98n+PdCou+HD2EaeXlO8pY5Tp81Ysg+J2xB7J/mjw==", - "dev": true - }, - "@ungap/essential-weakset": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@ungap/essential-weakset/-/essential-weakset-0.1.2.tgz", - "integrity": "sha512-Z7CBb/xr5V6wvdkdxKkDN0iUDz+EFfXW+O715VoWaDm1UiP+drx4U6S6aFhqYpKt0vTfbWHqrjdWj44B8q4A3A==", - "dev": true - }, - "@ungap/import-node": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@ungap/import-node/-/import-node-0.1.0.tgz", - "integrity": "sha512-FymNeJTWYNrZcnj7HFJwdaAZWrD1bUv8Na60RGIA142qtaRcOZs0KHGh+QSy7u7GNpW6wGnw9EdCQx4IYPE8cg==", - "dev": true - }, - "@ungap/is-array": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@ungap/is-array/-/is-array-0.1.1.tgz", - "integrity": "sha512-867tkp7LhJsOS3iULhhCluRV69bwyRQgBEwZSkm6VnZs8LFVD6VWFugiWc7Zgxwx4Psbrrou15u57n8YNIbKAQ==", - "dev": true - }, - "@ungap/template-literal": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@ungap/template-literal/-/template-literal-0.4.1.tgz", - "integrity": "sha512-+hoSovATXOiz+KaKP8qHSl1/4Pgvne1/1CjD17GeQv8AAIMU2JFTPidqYFowrpAFPvuzuSn3fUVQygePVNp/WQ==", - "dev": true, - "requires": { - "@ungap/weakmap": "^0.1.4" - } - }, - "@ungap/template-tag-arguments": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@ungap/template-tag-arguments/-/template-tag-arguments-0.3.1.tgz", - "integrity": "sha512-UGZGVfvEu1VenIPXQl/0IF/uTBoryMf0WZXWAgMC/HQECiUm0Cmy3DYB1sS3ybQf9XuXrYTUIECD3xTzQ0A9og==", - "dev": true, - "requires": { - "@ungap/template-literal": "^0.4.1" - } - }, - "@ungap/trim": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@ungap/trim/-/trim-0.1.1.tgz", - "integrity": "sha512-f2jiPMFD8qmoNV5kxZ6RwSwmnloxtGUcG3W5Fbe9rC3vwXlPxWT0g5J0mN3+rM9C/u1p24gIVTSxNBPOtyu7Sw==", - "dev": true - }, - "@ungap/weakmap": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@ungap/weakmap/-/weakmap-0.1.4.tgz", - "integrity": "sha512-TO4TTwlQXdjHKoWgKxsMqApnOV8JruaNilqOg0I04MTYb5+fj9taIVijS4ILwWg0ytQY5DwTKzPWj+0G+7bsXw==", - "dev": true - }, "@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", @@ -622,8 +565,7 @@ "acorn": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", - "dev": true + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" }, "acorn-jsx": { "version": "5.1.0", @@ -631,6 +573,21 @@ "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", "dev": true }, + "acorn-node": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", + "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", + "requires": { + "acorn": "^7.0.0", + "acorn-walk": "^7.0.0", + "xtend": "^4.0.2" + } + }, + "acorn-walk": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.0.0.tgz", + "integrity": "sha512-7Bv1We7ZGuU79zZbb6rRqcpxo3OY+zrdtloZWoyD8fmGX+FeXRjE+iuGkZjSXLVovLzrsvMGMy0EkwA0E0umxg==" + }, "after": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", @@ -1066,6 +1023,11 @@ "fill-range": "^7.0.1" } }, + "browser-process-hrtime": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==" + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -1122,6 +1084,15 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, + "camel-case": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", + "requires": { + "no-case": "^2.2.0", + "upper-case": "^1.1.1" + } + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -1524,7 +1495,6 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -1581,6 +1551,11 @@ "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" }, + "dash-ast": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", + "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==" + }, "data-uri-to-buffer": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz", @@ -1671,12 +1646,6 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "disconnected": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/disconnected/-/disconnected-0.2.1.tgz", - "integrity": "sha512-483TUpj4dA7Ye42xrErztbw3PKpkboPf1aB9mG4+S+RGGxFVv72hQBbS8MqN8LZLWHzfcmk2tMTRR5CoyxNglg==", - "dev": true - }, "dockerfile-ast": { "version": "0.0.16", "resolved": "https://registry.npmjs.org/dockerfile-ast/-/dockerfile-ast-0.0.16.tgz", @@ -1711,45 +1680,6 @@ "from": "github:requirejs/domReady#d85bdc38a6df868ead52ab3e80715aaf60e68765", "dev": true }, - "domconstants": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/domconstants/-/domconstants-0.1.1.tgz", - "integrity": "sha512-Pk4K6tLOzSh0cZDuh7TQivZtYLC6Z8dNissoDyy2tQoVNg8ewScxG3AVJO76kLcTta/u7bgEO6xbIR97MiInfA==", - "dev": true - }, - "domdiff": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/domdiff/-/domdiff-2.1.1.tgz", - "integrity": "sha512-LJBvV951bDH4FlvgN0Fj7Jlxge4xXWXH19raGHldmOnfiyTpdhoKGlEhyMvVPNwgHRFYmFJYhSNGTYZ4eyfJFA==", - "dev": true, - "requires": { - "@ungap/essential-map": "^0.2.0" - } - }, - "domsanitizer": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/domsanitizer/-/domsanitizer-0.2.2.tgz", - "integrity": "sha512-2nqCaLWi+tpT7oOa862BVrG7bHzYlWFZ5ltmvt4LXECxe5FnwF/zKGs/gWanZWGmv1pwdUTkO9TamoZMqI0Pmg==", - "dev": true, - "requires": { - "domconstants": "^0.1.1" - } - }, - "domtagger": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/domtagger/-/domtagger-0.5.10.tgz", - "integrity": "sha512-vxPtj98UgAoRNqJH2tYGej0hg+FtjhfUJ8KLDBo7NfNWAvTOIeaq8GEJvyAukWWC+I+nd07WV8N4+QYRX8CXAg==", - "dev": true, - "requires": { - "@ungap/create-content": "^0.1.4", - "@ungap/essential-map": "^0.2.0", - "@ungap/import-node": "^0.1.0", - "@ungap/trim": "^0.1.1", - "@ungap/weakmap": "^0.1.4", - "domconstants": "^0.1.1", - "domsanitizer": "^0.2.2" - } - }, "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", @@ -2577,6 +2507,11 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" }, + "estree-is-member-expression": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/estree-is-member-expression/-/estree-is-member-expression-1.0.0.tgz", + "integrity": "sha512-Ec+X44CapIGExvSZN+pGkmr5p7HwUVQoPQSd458Lqwvaf4/61k/invHSh4BYK8OXnCkfEhWuIoG5hayKLQStIg==" + }, "estree-walker": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", @@ -3227,39 +3162,19 @@ } } }, - "hyperhtml": { - "version": "2.31.2", - "resolved": "https://registry.npmjs.org/hyperhtml/-/hyperhtml-2.31.2.tgz", - "integrity": "sha512-4PFfYy8J7uE7DSgP54O8AcCyItk+gF+IPTFG7PPlzaw+jFIIcQS2rB5nriWTPbA9MfdCFzTSyJWw8MkFghXADA==", - "dev": true, + "hyperscript-attribute-to-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hyperscript-attribute-to-property/-/hyperscript-attribute-to-property-1.0.2.tgz", + "integrity": "sha512-oerMul16jZCmrbNsUw8QgrtDzF8lKgFri1bKQjReLw1IhiiNkI59CWuzZjJDGT79UQ1YiWqXhJMv/tRMVqgtkA==" + }, + "hyperx": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/hyperx/-/hyperx-2.5.4.tgz", + "integrity": "sha512-iOkSh7Yse7lsN/B9y7OsevLWjeXPqGuHQ5SbwaiJM5xAhWFqhoN6erpK1dQsS12OFU36lyai1pnx1mmzWLQqcA==", "requires": { - "@ungap/create-content": "^0.1.4", - "@ungap/custom-event": "^0.2.0", - "@ungap/essential-map": "^0.2.0", - "@ungap/essential-weakset": "^0.1.2", - "@ungap/is-array": "^0.1.1", - "@ungap/template-tag-arguments": "^0.3.1", - "@ungap/weakmap": "^0.1.4", - "disconnected": "^0.2.1", - "domdiff": "^2.1.1", - "domtagger": "^0.5.10", - "hyperhtml-style": "^0.1.2", - "hyperhtml-wire": "^2.1.0", - "lightercollective": "^0.3.0" + "hyperscript-attribute-to-property": "^1.0.0" } }, - "hyperhtml-style": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/hyperhtml-style/-/hyperhtml-style-0.1.2.tgz", - "integrity": "sha512-ZDRYNClEaqUS0a8RAED0nQRqWmZk7ctdyij3Iw/PqUUef6xhYO87nx9vJNuxg7Yc6J2FdJjXRKbB0iud2ZyzwQ==", - "dev": true - }, - "hyperhtml-wire": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hyperhtml-wire/-/hyperhtml-wire-2.1.0.tgz", - "integrity": "sha512-LqFs/MgvxyMVM8O3Fx7QcCDWWkga3JeMA7C1inHM71PIchupSyj2u/zG8Blw+KfJHIFmEsx09KxOrgykGqoopQ==", - "dev": true - }, "i": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", @@ -3429,6 +3344,11 @@ "binary-extensions": "^2.0.0" } }, + "is-boolean-attribute": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/is-boolean-attribute/-/is-boolean-attribute-0.0.1.tgz", + "integrity": "sha1-JKtZt9y52jYSx3PmDGVlZeWgmAw=" + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -4005,12 +3925,6 @@ "immediate": "~3.0.5" } }, - "lightercollective": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/lightercollective/-/lightercollective-0.3.0.tgz", - "integrity": "sha512-RFOLSUVvwdK3xA0P8o6G7QGXLIyy1L2qv5caEI7zXN5ciaEjbAriRF182kbsoJ1S1TgvpyGcN485fMky6qxOPw==", - "dev": true - }, "loading-indicator": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/loading-indicator/-/loading-indicator-2.0.0.tgz", @@ -4105,6 +4019,11 @@ "streamroller": "^1.0.6" } }, + "lower-case": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -4125,12 +4044,11 @@ "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==" }, "magic-string": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.4.tgz", - "integrity": "sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw==", - "dev": true, + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.23.2.tgz", + "integrity": "sha512-oIUZaAxbcxYIp4AyLafV6OVKoB3YouZs0UTCJ8mOKBHNyJgGDaMJ4TgA+VylJh6fx7EQCC52XkbURxxG9IoJXA==", "requires": { - "sourcemap-codec": "^1.4.4" + "sourcemap-codec": "^1.4.1" } }, "make-dir": { @@ -4153,6 +4071,21 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, + "merge-source-map": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", + "integrity": "sha1-pd5GU42uhNQRTMXqArR3KmNGcB8=", + "requires": { + "source-map": "^0.5.6" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -4321,6 +4254,69 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" }, + "mutexify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mutexify/-/mutexify-1.2.0.tgz", + "integrity": "sha512-oprzxd2zhfrJqEuB98qc1dRMMonClBQ57UPDjnbcrah4orEMTq1jq3+AcdFe5ePzdbJXI7zmdhfftIdMnhYFoQ==" + }, + "nanoassert": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-1.1.0.tgz", + "integrity": "sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40=" + }, + "nanobench": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nanobench/-/nanobench-2.1.1.tgz", + "integrity": "sha512-z+Vv7zElcjN+OpzAxAquUayFLGK3JI/ubCl0Oh64YQqsTGG09CGqieJVQw4ui8huDnnAgrvTv93qi5UaOoNj8A==", + "requires": { + "browser-process-hrtime": "^0.1.2", + "chalk": "^1.1.3", + "mutexify": "^1.1.0", + "pretty-hrtime": "^1.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "nanohtml": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/nanohtml/-/nanohtml-1.9.0.tgz", + "integrity": "sha512-gTWz/Sl+ENjAxvnBFG6R/WW5FXhYlezd6HXooTUBGygIHgWSoPDNHT3jjBjvhKpOkE9XdkY1/fALtPWB/pUg+Q==", + "requires": { + "acorn-node": "^1.8.2", + "camel-case": "^3.0.0", + "convert-source-map": "^1.5.1", + "estree-is-member-expression": "^1.0.0", + "hyperx": "^2.5.0", + "is-boolean-attribute": "0.0.1", + "nanoassert": "^1.1.0", + "nanobench": "^2.1.0", + "normalize-html-whitespace": "^0.2.0", + "through2": "^2.0.3", + "transform-ast": "^2.4.0" + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -4453,6 +4449,14 @@ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, + "no-case": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "requires": { + "lower-case": "^1.1.1" + } + }, "node-environment-flags": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", @@ -4472,6 +4476,11 @@ "is-stream": "^1.0.1" } }, + "normalize-html-whitespace": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/normalize-html-whitespace/-/normalize-html-whitespace-0.2.0.tgz", + "integrity": "sha1-EBci9kI1Ucdc24+dEE/4UNrx4Q4=" + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -4934,6 +4943,11 @@ "fast-diff": "^1.1.2" } }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" + }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", @@ -4970,36 +4984,6 @@ "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.7.tgz", "integrity": "sha512-Fx65lf9/YDn3hUX08XUc0J8rSux36rEsyiv21ZGUC1mOyeM3lTRpZLcrm8aAolzS4itwVfm7TAPyxC2E5zd6xg==" }, - "proxy-agent": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-3.1.1.tgz", - "integrity": "sha512-WudaR0eTsDx33O3EJE16PjBRZWcX8GqCEeERw1W3hZJgH/F2a46g7jty6UGty6NeJ4CKQy8ds2CJPMiyeqaTvw==", - "requires": { - "agent-base": "^4.2.0", - "debug": "4", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^3.0.0", - "lru-cache": "^5.1.1", - "pac-proxy-agent": "^3.0.1", - "proxy-from-env": "^1.0.0", - "socks-proxy-agent": "^4.0.1" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - } - } - }, "proxy-from-env": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", @@ -5251,6 +5235,17 @@ "magic-string": "^0.25.2", "resolve": "^1.11.0", "rollup-pluginutils": "^2.8.1" + }, + "dependencies": { + "magic-string": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.4.tgz", + "integrity": "sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + } } }, "rollup-plugin-node-resolve": { @@ -5762,6 +5757,43 @@ "is-wsl": "^1.1.0" } }, + "prelude-ls": { + "version": "1.1.2", + "bundled": true + }, + "proxy-agent": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-3.1.1.tgz", + "integrity": "sha512-WudaR0eTsDx33O3EJE16PjBRZWcX8GqCEeERw1W3hZJgH/F2a46g7jty6UGty6NeJ4CKQy8ds2CJPMiyeqaTvw==", + "requires": { + "agent-base": "^4.2.0", + "debug": "4", + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^3.0.0", + "lru-cache": "^5.1.1", + "pac-proxy-agent": "^3.0.1", + "proxy-from-env": "^1.0.0", + "socks-proxy-agent": "^4.0.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + } + } + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -5783,6 +5815,11 @@ "requires": { "ansi-regex": "^4.1.0" } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" } } }, @@ -6303,8 +6340,7 @@ "sourcemap-codec": { "version": "1.4.6", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz", - "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", - "dev": true + "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==" }, "spdx-correct": { "version": "3.1.0", @@ -6601,6 +6637,15 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, "thunkify": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/thunkify/-/thunkify-2.1.2.tgz", @@ -6650,6 +6695,27 @@ "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" }, + "transform-ast": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/transform-ast/-/transform-ast-2.4.4.tgz", + "integrity": "sha512-AxjeZAcIOUO2lev2GDe3/xZ1Q0cVGjIMk5IsriTy8zbWlsEnjeB025AhkhBJHoy997mXpLd4R+kRbvnnQVuQHQ==", + "requires": { + "acorn-node": "^1.3.0", + "convert-source-map": "^1.5.1", + "dash-ast": "^1.0.0", + "is-buffer": "^2.0.0", + "magic-string": "^0.23.2", + "merge-source-map": "1.0.4", + "nanobench": "^2.1.1" + }, + "dependencies": { + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" + } + } + }, "tree-kill": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.1.tgz", @@ -6859,6 +6925,11 @@ } } }, + "upper-case": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=" + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -7211,6 +7282,11 @@ "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", "integrity": "sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=" }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", diff --git a/package.json b/package.json index a3f7d8e164..284e5a7d08 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "eslint-plugin-prettier": "^3.1.1", "handlebars": "^4.5.3", "highlight.js": "^9.16.2", - "hyperhtml": "^2.31.2", "idb": "^4.0.5", "jasmine-core": "^3.5.0", "jasmine-reporters": "^2.3.2", @@ -96,6 +95,7 @@ "command-line-usage": "^6.1.0", "epipebomb": "^1.0.0", "loading-indicator": "^2.0.0", + "nanohtml": "^1.9.0", "opencollective": "^1.0.3", "opencollective-postinstall": "^2.0.2", "prompt": "^1.0.0", diff --git a/src/core/caniuse.js b/src/core/caniuse.js index db881911c0..d637eb6571 100644 --- a/src/core/caniuse.js +++ b/src/core/caniuse.js @@ -93,20 +93,23 @@ export async function run(conf) { return hyperHTML`<a href="${featureURL}">caniuse.com</a>`; } })(); + const stats = hyperHTML`<dd class="caniuse-stats"> + Fetching data from caniuse.com... + </dd>`; const definitionPair = hyperHTML` <dt class="caniuse-title">Browser support:</dt> - <dd class="caniuse-stats">${{ - any: contentPromise, - placeholder: "Fetching data from caniuse.com...", - }}</dd>`; + ${stats}`; headDlElem.append(...definitionPair.childNodes); - await contentPromise; + const result = await contentPromise; + stats.textContent = ""; + stats.append(result); // remove from export pub("amend-user-config", { caniuse: options.feature }); sub("beforesave", outputDoc => { - hyperHTML.bind(outputDoc.querySelector(".caniuse-stats"))` - <a href="${featureURL}">caniuse.com</a>`; + const stats = outputDoc.querySelector(".caniuse-stats"); + stats.textContent = ""; + stats.append(hyperHTML`<a href="${featureURL}">caniuse.com</a>`); }); } diff --git a/src/core/contrib.js b/src/core/contrib.js index b1663576f6..a5277a2aab 100644 --- a/src/core/contrib.js +++ b/src/core/contrib.js @@ -80,10 +80,13 @@ function toHTML(contributors, element) { }); if (element.tagName === "UL") { - hyperHTML(element)`${sortedContributors.map( + const children = sortedContributors.map( ({ name, login }) => - `<li><a href="https://github.com/${login}">${name || login}</a></li>` - )}`; + hyperHTML`<li><a href=${`https://github.com/${login}`}>${name || + login}</a></li>` + ); + element.textContent = ""; + element.append(...children); return; } diff --git a/src/core/examples.js b/src/core/examples.js index dff695f7f6..26a73ac885 100644 --- a/src/core/examples.js +++ b/src/core/examples.js @@ -105,6 +105,7 @@ export async function run() { addId(example, `example`, String(number)); } const { id } = example; + /** @type {HTMLAnchorElement} */ const selfLink = div.querySelector("a.self-link"); selfLink.href = `#${id}`; pub("example", report); @@ -129,6 +130,7 @@ export async function run() { addId(div, `example-${number}`, title); } addId(div, `example`, String(number)); + /** @type {HTMLAnchorElement} */ const selfLink = div.querySelector("a.self-link"); selfLink.href = `#${div.id}`; example.replaceWith(div); diff --git a/src/core/figures.js b/src/core/figures.js index 6767c85c96..11c5e5ef15 100644 --- a/src/core/figures.js +++ b/src/core/figures.js @@ -100,7 +100,9 @@ function getTableOfFiguresListItem(figureId, caption) { renameElement(anchor, "span").removeAttribute("href"); }); return hyperHTML`<li class='tofline'> - <a class='tocxref' href='${`#${figureId}`}'>${tofCaption.childNodes}</a> + <a class='tocxref' href='${`#${figureId}`}'>${[ + ...tofCaption.childNodes, + ]}</a> </li>`; } diff --git a/src/core/import-maps.js b/src/core/import-maps.js index 3abec82a4c..83a55710a1 100644 --- a/src/core/import-maps.js +++ b/src/core/import-maps.js @@ -3,7 +3,7 @@ import * as _idb from "../../node_modules/idb/build/esm/index.js"; import * as _webidl2 from "../../node_modules/webidl2/index.js"; -import _hyperHTML from "../../node_modules/hyperhtml/esm.js"; +import { html as _html, raw as _raw } from "../../js/deps/builds/nanohtml.js"; import _marked from "../../js/deps/builds/marked.js"; import _pluralize from "../../js/deps/builds/pluralize.js"; @@ -11,9 +11,12 @@ import _pluralize from "../../js/deps/builds/pluralize.js"; // @ts-ignore export const idb = _idb; export const webidl2 = _webidl2; -/** @type {import("hyperhtml").default} */ +/** @type {import("nanohtml").default} */ // @ts-ignore -export const hyperHTML = _hyperHTML; +export const hyperHTML = _html; +/** @type {import("nanohtml/raw").default} */ +// @ts-ignore +export const raw = _raw; /** @type {import("marked")} */ // @ts-ignore export const marked = _marked; diff --git a/src/core/inline-idl-parser.js b/src/core/inline-idl-parser.js index 3c559fcee0..2d9eb07c31 100644 --- a/src/core/inline-idl-parser.js +++ b/src/core/inline-idl-parser.js @@ -2,8 +2,8 @@ // Parses an inline IDL string (`{{ idl string }}`) // and renders its components as HTML -import { hyperHTML } from "./import-maps.js"; -import { showInlineError } from "./utils.js"; +import { hyperHTML, raw } from "./import-maps.js"; +import { optdata, showInlineError } from "./utils.js"; const idlPrimitiveRegex = /^[a-z]+(\s+[a-z]+)+$/; // {{unrestricted double}} {{ double }} const exceptionRegex = /\B"([^"]*)"\B/; // {{ "SomeException" }} const methodRegex = /(\w+)\((.*)\)$/; @@ -153,10 +153,10 @@ function renderInternalSlot(details) { const { identifier, parent, renderParent } = details; const { identifier: linkFor } = parent || {}; const lt = `[[${identifier}]]`; - const html = hyperHTML`${parent && renderParent ? "." : ""}<a + const html = hyperHTML`${parent && renderParent ? "." : ""}[[<a data-xref-type="attribute" - data-link-for=${linkFor} - data-xref-for=${linkFor} + ${optdata("link-for", linkFor)} + ${optdata("xref-for", linkFor)} data-lt="${lt}"><code>[[${identifier}]]</code></a>`; return html; } @@ -172,7 +172,7 @@ function renderAttribute(details) { data-xref-type="attribute|dict-member" data-link-for="${linkFor}" data-xref-for="${linkFor}" - ><code>${identifier}</code></a>`; + ><code>${identifier}</code></a>${""}`; // TODO: remove dangling empty string return html; } @@ -190,14 +190,14 @@ function renderMethod(details) { data-link-for="${linkFor}" data-xref-for="${linkFor}" data-lt="${searchText}" - ><code>${identifier}</code></a><code>(${[argsText]})</code>`; + ><code>${identifier}</code></a><code>(${raw(argsText)})</code>`; return html; } /** * Enum: * Identifier["enum value"] - * Identifer / "enum value" + * Identifier / "enum value" * @param {IdlEnum} details */ function renderEnum(details) { @@ -207,7 +207,7 @@ function renderEnum(details) { data-xref-type="enum-value" data-link-for="${forContext}" data-xref-for="${forContext}" - data-lt="${!enumValue ? "the-empty-string" : null}" + ${optdata("lt", !enumValue ? "the-empty-string" : null)} ><code>${enumValue}</code></a>"`; return html; } @@ -254,7 +254,6 @@ export function idlStringToHtml(str) { showInlineError(el, error.message, "Error: Invalid inline IDL string"); return el; } - const render = hyperHTML(document.createDocumentFragment()); const output = []; for (const details of results) { switch (details.type) { @@ -285,6 +284,6 @@ export function idlStringToHtml(str) { throw new Error("Unknown type."); } } - const result = render`${output}`; + const result = hyperHTML`${output}`; return result; } diff --git a/src/core/inlines.js b/src/core/inlines.js index 3158f54149..661ee45556 100644 --- a/src/core/inlines.js +++ b/src/core/inlines.js @@ -10,6 +10,7 @@ import { InsensitiveStringSet, getTextNodes, norm, + optdata, refTypeFromContext, showInlineError, showInlineWarning, @@ -104,7 +105,7 @@ function inlineBibrefMatches(matched, txt, conf) { const cleanRef = ref.replace(/^(!|\?)/, ""); if (illegal && !conf.normativeReferences.has(cleanRef)) { showInlineWarning( - cite.childNodes[1], // cite element + /** @type {HTMLElement} */ (cite.childNodes[1]), // cite element "Normative references in informative sections are not allowed. " + `Remove '!' from the start of the reference \`[[${ref}]]\`` ); @@ -138,7 +139,7 @@ function inlineVariableMatches(matched) { // remove "|" at the beginning and at the end, then split at an optional `:` const matches = matched.slice(1, -1).split(":", 2); const [varName, type] = matches.map(s => s.trim()); - return hyperHTML`<var data-type="${type}">${varName}</var>`; + return hyperHTML`<var ${optdata("type", type)}>${varName}</var>`; } /** @@ -157,7 +158,10 @@ function inlineAnchorMatches(matched) { : [null, content]; const processedContent = processInlineContent(text); const forContext = isFor ? norm(isFor) : null; - return hyperHTML`<a data-link-for="${forContext}" data-xref-for="${forContext}" data-lt="${linkingText}">${processedContent}</a>`; + return hyperHTML`<a + ${optdata("link-for", forContext)} + ${optdata("xref-for", forContext)} + ${optdata("lt", linkingText)}>${processedContent}</a>`; } function inlineCodeMatches(matched) { diff --git a/src/core/issues-notes.js b/src/core/issues-notes.js index be239f3f3a..7442309c8d 100644 --- a/src/core/issues-notes.js +++ b/src/core/issues-notes.js @@ -12,9 +12,9 @@ // If the configuration has issueBase set to a non-empty string, and issues are // manually numbered, a link to the issue is created using issueBase and the issue number import { addId, joinAnd, parents } from "./utils.js"; +import { hyperHTML, raw } from "./import-maps.js"; import { lang as defaultLang } from "../core/l10n.js"; import { fetchAsset } from "./text-loader.js"; -import { hyperHTML } from "./import-maps.js"; import { pub } from "./pubsubhub.js"; export const name = "core/issues-notes"; @@ -93,8 +93,10 @@ function handleIssues(ins, ghIssues, conf) { // wrap if (!isInline) { const cssClass = isFeatureAtRisk ? `${type} atrisk` : type; - const ariaRole = type === "note" ? "note" : null; - const div = hyperHTML`<div class="${cssClass}" role="${ariaRole}"></div>`; + const div = hyperHTML`<div class="${cssClass}"></div>`; + if (type === "note") { + div.setAttribute("role", "note"); + } const title = document.createElement("span"); const titleParent = hyperHTML` <div role='heading' class='${`${type}-title marker`}'>${title}</div>`; @@ -160,7 +162,7 @@ function handleIssues(ins, ghIssues, conf) { } div.append(titleParent, body); const level = parents(titleParent, "section").length + 2; - titleParent.setAttribute("aria-level", level); + titleParent.setAttribute("aria-level", String(level)); } pub(report.type, report); }); @@ -264,6 +266,7 @@ function isLight(rgb) { * @param {string} repoURL */ function createLabelsGroup(labels, title, repoURL) { + /** @type {Node[]} */ const labelsGroup = labels.map(label => createLabel(label, repoURL)); const labelNames = labels.map(label => label.name); const joinedNames = joinAnd(labelNames); @@ -341,7 +344,7 @@ export async function run(conf) { const css = await cssPromise; const { head: headElem } = document; headElem.insertBefore( - hyperHTML`<style>${[css]}</style>`, + hyperHTML`<style>${raw(css)}</style>`, headElem.querySelector("link") ); handleIssues(issuesAndNotes, ghIssues, conf); diff --git a/src/core/mdn-annotation.js b/src/core/mdn-annotation.js index 7218871a7a..40832d0a4e 100644 --- a/src/core/mdn-annotation.js +++ b/src/core/mdn-annotation.js @@ -1,7 +1,7 @@ // @ts-check +import { hyperHTML, raw } from "./import-maps.js"; import { fetchAndCache } from "./utils.js"; import { fetchAsset } from "./text-loader.js"; -import { hyperHTML } from "./import-maps.js"; export const name = "core/mdn-annoatation"; @@ -78,7 +78,7 @@ function attachMDNBrowserSupport(container, mdnSpec) { return; } const supportTable = hyperHTML`<p class="mdnsupport"> - ${[buildBrowserSupportTable(mdnSpec.support)]} + ${raw(buildBrowserSupportTable(mdnSpec.support))} </p>`; container.appendChild(supportTable); } @@ -150,7 +150,7 @@ export async function run(conf) { maxAge ); const mdnCss = await mdnCssPromise; - document.head.appendChild(hyperHTML`<style>${[mdnCss]}</style>`); + document.head.appendChild(hyperHTML`<style>${raw(mdnCss)}</style>`); document.head.appendChild(hyperHTML`<script> function toggleMDNStatus(div) { div.parentNode.classList.toggle('wrapped'); diff --git a/src/core/render-biblio.js b/src/core/render-biblio.js index 1345beba92..2443a5ca98 100644 --- a/src/core/render-biblio.js +++ b/src/core/render-biblio.js @@ -2,10 +2,10 @@ // Module core/render-biblio // renders the biblio data pre-processed in core/biblio +import { hyperHTML, raw } from "./import-maps.js"; import { addId } from "./utils.js"; import { biblio } from "./biblio.js"; import { lang as defaultLang } from "../core/l10n.js"; -import { hyperHTML } from "./import-maps.js"; import { pub } from "./pubsubhub.js"; export const name = "core/render-biblio"; @@ -169,7 +169,7 @@ function showRef({ ref, refcontent }) { if (refcontent) { return hyperHTML` <dt id="${refId}">[${ref}]</dt> - <dd>${{ html: stringifyReference(refcontent) }}</dd> + <dd>${raw(stringifyReference(refcontent))}</dd> `; } else { return hyperHTML` @@ -195,7 +195,7 @@ export function wireReference(rawRef, target = "_blank") { const ref = Object.assign({}, defaultsReference, rawRef); const authors = ref.authors.join("; ") + (ref.etAl ? " et al" : ""); const status = REF_STATUSES.get(ref.status) || ref.status; - return hyperHTML.wire(ref)` + return hyperHTML` <cite> <a href="${ref.href}" diff --git a/src/core/structure.js b/src/core/structure.js index abd54269ca..c2acb770a7 100644 --- a/src/core/structure.js +++ b/src/core/structure.js @@ -78,7 +78,7 @@ function scanSections(sections, maxTocLevel, { prefix = "" } = {}) { if (!section.isIntro) { index += 1; - section.header.prepend(hyperHTML`<bdi class='secno'>${secno} </bdi>`); + section.header.prepend(hyperHTML`<bdi class='secno'>${secno}</bdi>`, " "); } if (level <= maxTocLevel) { @@ -232,6 +232,6 @@ function createTableOfContents(ol) { } } - const link = hyperHTML`<p role='navigation' id='back-to-top'><a href='#title'><abbr title='Back to Top'>↑</abbr></a></p>`; + const link = hyperHTML`<p role='navigation' id='back-to-top'><a href='#title'><abbr title='Back to Top'>\u2191;</abbr></a></p>`; document.body.append(link); } diff --git a/src/core/utils.js b/src/core/utils.js index 074811923d..63d8ee077f 100644 --- a/src/core/utils.js +++ b/src/core/utils.js @@ -851,3 +851,16 @@ function* walkTree(walker) { yield /** @type {T} */ (walker.currentNode); } } + +/** + * Generates an object with data-${name} field, useful for templating libraries. + * @param {string} dataAttrName + * @param {*} value + */ +export function optdata(dataAttrName, value) { + if (value == null) { + // null or undefined + return {}; + } + return { [`data-${dataAttrName}`]: value }; +} diff --git a/src/core/webidl.js b/src/core/webidl.js index 619cb0aa46..686a6302e6 100644 --- a/src/core/webidl.js +++ b/src/core/webidl.js @@ -7,6 +7,7 @@ import { decorateDfn, findDfn } from "./dfn-finder.js"; import { flatten, + optdata, showInlineError, showInlineWarning, xmlEscape, @@ -31,7 +32,7 @@ const templates = { if (!t.trim()) { return t; } - return hyperHTML`<span class='idlSectionComment'>${t}</span>`; + return hyperHTML`<span class='idlSectionComment'>${new Text(t)}</span>`; }, generic(keyword) { // Shepherd classifies "interfaces" as starting with capital letters, @@ -71,7 +72,9 @@ const templates = { } } return hyperHTML`<a - data-xref-type="${type}" data-cite="${cite}" data-lt="${lt}">${wrapped}</a>`; + data-xref-type="${type}" + ${optdata("cite", cite)} + ${optdata("lt", lt)}>${wrapped}</a>`; }, name(escaped, { data, parent }) { if (data.idlType && data.idlType.type === "argument-type") { @@ -107,7 +110,7 @@ const templates = { } const parentName = parent ? parent.name : ""; const { name, idlId } = getNameAndId(data, parentName); - return hyperHTML`<span class='${className}' id='${idlId}' data-idl data-title='${name}'>${contents}</span>`; + return hyperHTML`<span class='${className}' id='${idlId}' data-idl="" data-title='${name}'>${contents}</span>`; }, extendedAttribute(contents) { const result = hyperHTML`<span class="extAttr">${contents}</span>`; @@ -153,14 +156,14 @@ function defineIdlName(escaped, data, parent) { data-lt="default toJSON operation">${escaped}</a>`; } if (!data.partial) { - const dfn = hyperHTML`<dfn data-export data-dfn-type="${linkType}">${escaped}</dfn>`; + const dfn = hyperHTML`<dfn data-export="" data-dfn-type="${linkType}">${escaped}</dfn>`; registerDefinition(dfn, [name]); decorateDfn(dfn, data, parentName, name); return dfn; } const unlinkedAnchor = hyperHTML`<a - data-idl="${data.partial ? "partial" : null}" + ${optdata("idl", data.partial ? "partial" : null)} data-link-type="${linkType}" data-title="${data.name}" data-xref-type="${linkType}" @@ -314,8 +317,8 @@ function renderWebIDL(idlElement, index) { } idlElement.classList.add("def", "idl"); const html = webidl2.write(parse, { templates }); - const render = hyperHTML.bind(idlElement); - render`${html}`; + idlElement.textContent = ""; + idlElement.append(...html); idlElement.querySelectorAll("[data-idl]").forEach(elem => { if (elem.dataset.dfnFor) { return; diff --git a/src/ui/about-respec.js b/src/ui/about-respec.js index fc1146fb1d..5b4279243f 100644 --- a/src/ui/about-respec.js +++ b/src/ui/about-respec.js @@ -8,7 +8,6 @@ import { ui } from "../core/ui.js"; // window.respecVersion is added at build time (see tools/builder.js) window.respecVersion = window.respecVersion || "Developer Edition"; const div = document.createElement("div"); -const render = hyperHTML.bind(div); const button = ui.addCommand( `About ${window.respecVersion}`, show, @@ -39,7 +38,7 @@ function show() { entries.push(entry); }); } - render` + const fragment = hyperHTML` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -64,6 +63,8 @@ function show() { <tbody>${entries}</tbody> </table> `; + div.textContent = ""; + div.append(fragment); } function perfEntryToTR({ name, duration }) { diff --git a/src/ui/dfn-list.js b/src/ui/dfn-list.js index e6e5a1fdff..d50c86efed 100644 --- a/src/ui/dfn-list.js +++ b/src/ui/dfn-list.js @@ -15,7 +15,6 @@ const button = ui.addCommand( const ul = document.createElement("ul"); ul.classList.add("respec-dfn-list"); -const render = hyperHTML.bind(ul); ul.addEventListener("click", ev => { ui.closeModal(); @@ -26,7 +25,7 @@ function show() { const definitionLinks = Object.entries(definitionMap) .sort(([keyA], [keyB]) => keyA.localeCompare(keyB)) .map(([, [dfn]]) => { - return hyperHTML.wire(dfn, ":li>a")` + return hyperHTML` <li> <a href="${`#${dfn.id}`}"> ${dfn.textContent} @@ -34,6 +33,7 @@ function show() { </li> `; }); - render`${definitionLinks}`; + ul.textContent = ""; + ul.append(...definitionLinks); ui.freshModal(l10n[lang].list_of_definitions, ul, button); } diff --git a/src/ui/search-specref.js b/src/ui/search-specref.js index ee595a7c99..304d52191a 100644 --- a/src/ui/search-specref.js +++ b/src/ui/search-specref.js @@ -17,8 +17,6 @@ const specrefURL = "https://specref.herokuapp.com/"; const refSearchURL = `${specrefURL}search-refs`; const reveseLookupURL = `${specrefURL}reverse-lookup`; const form = document.createElement("form"); -const renderer = hyperHTML.bind(form); -const resultList = hyperHTML.bind(document.createElement("div")); form.id = "specref-ui"; @@ -29,7 +27,7 @@ form.id = "specref-ui"; */ function renderResults(resultMap, query, timeTaken) { if (!resultMap.size) { - return resultList` + return hyperHTML` <p class="state"> Your search - <strong> ${query} </strong> - did not match any references. @@ -40,7 +38,7 @@ function renderResults(resultMap, query, timeTaken) { .slice(0, 99) .map(toDefinitionPair) .reduce((collector, pair) => collector.concat(pair), []); - return resultList` + return hyperHTML` <p class="result-stats"> ${resultMap.size} results (${timeTaken} seconds). ${resultMap.size > 99 ? "First 100 results." : ""} @@ -50,7 +48,7 @@ function renderResults(resultMap, query, timeTaken) { } function toDefinitionPair([key, entry]) { - return hyperHTML.wire(entry)` + return hyperHTML` <dt> [${key}] </dt> @@ -129,26 +127,28 @@ function show() { input.focus(); } -const mast = hyperHTML.wire()` - <header> - <p> - An Open-Source, Community-Maintained Database of - Web Standards & Related References. - </p> - </header> - <div class="searchcomponent"> - <input - name="searchBox" - type="search" - autocomplete="off" - placeholder="Keywords, titles, authors, urls…"> - <button - type="submit"> - Search - </button> - <label> - <input type="checkbox" name="includeVersions"> Include all versions. - </label> +const mast = hyperHTML` + <div> + <header> + <p> + An Open-Source, Community-Maintained Database of + Web Standards & Related References. + </p> + </header> + <div class="searchcomponent"> + <input + name="searchBox" + type="search" + autocomplete="off" + placeholder="Keywords, titles, authors, urls…"> + <button + type="submit"> + Search + </button> + <label> + <input type="checkbox" name="includeVersions"> Include all versions. + </label> + </div> </div> `; @@ -161,11 +161,12 @@ const mast = hyperHTML.wire()` */ function render({ state = "", results, timeTaken, query } = {}) { if (!results) { - renderer`<div>${mast}</div>`; + form.textContent = ""; + form.append(mast); return; } - renderer` - <div>${mast}</div> + const content = hyperHTML` + ${mast} <p class="state" hidden="${!state}"> ${state} </p> @@ -173,4 +174,6 @@ function render({ state = "", results, timeTaken, query } = {}) { results ? renderResults(results, query, timeTaken) : [] }</section> `; + form.textContent = ""; + form.append(content); } diff --git a/src/w3c/conformance.js b/src/w3c/conformance.js index eb18d59141..ba6e9a6640 100644 --- a/src/w3c/conformance.js +++ b/src/w3c/conformance.js @@ -1,7 +1,7 @@ // @ts-check // Module w3c/conformance // Handle the conformance section properly. -import { hyperHTML as html } from "../core/import-maps.js"; +import { hyperHTML as html, raw } from "../core/import-maps.js"; import { joinAnd } from "../core/utils.js"; import { pub } from "../core/pubsubhub.js"; import { renderInlineCitation } from "../core/render-biblio.js"; @@ -13,7 +13,7 @@ export const name = "w3c/conformance"; * @param {*} conf */ function processConformance(conformance, conf) { - const terms = [...Object.keys(rfc2119Usage)]; + const terms = Object.keys(rfc2119Usage); // Add RFC2119 to blibliography if (terms.length) { conf.normativeReferences.add("RFC2119"); @@ -35,7 +35,7 @@ function processConformance(conformance, conf) { ${terms.length ? html` <p> - The key word${plural ? "s" : ""} ${[keywords]} in this document + The key word${plural ? "s" : ""} ${raw(keywords)} in this document ${plural ? "are" : "is"} to be interpreted as described in <a href="https://tools.ietf.org/html/bcp14">BCP 14</a> ${renderInlineCitation("RFC2119")} diff --git a/src/w3c/headers.js b/src/w3c/headers.js index 6bb9ab293e..24d698681c 100644 --- a/src/w3c/headers.js +++ b/src/w3c/headers.js @@ -93,7 +93,6 @@ import { ISODate, concatDate, joinAnd } from "../core/utils.js"; import cgbgHeadersTmpl from "./templates/cgbg-headers.js"; import cgbgSotdTmpl from "./templates/cgbg-sotd.js"; import headersTmpl from "./templates/headers.js"; -import { hyperHTML } from "../core/import-maps.js"; import { pub } from "../core/pubsubhub.js"; import sotdTmpl from "./templates/sotd.js"; @@ -598,7 +597,9 @@ export function run(conf) { ); } - hyperHTML.bind(sotd)`${populateSoTD(conf, sotd)}`; + const populated = populateSoTD(conf, sotd); + sotd.textContent = ""; + sotd.append(...populated.childNodes); if (!conf.implementationReportURI && conf.isCR) { pub( diff --git a/src/w3c/templates/cgbg-headers.js b/src/w3c/templates/cgbg-headers.js index a39c63a0b1..6c59a2a93b 100644 --- a/src/w3c/templates/cgbg-headers.js +++ b/src/w3c/templates/cgbg-headers.js @@ -1,5 +1,5 @@ // @ts-check -import { hyperHTML as html } from "../../core/import-maps.js"; +import { hyperHTML as html, raw } from "../../core/import-maps.js"; import showLink from "./show-link.js"; import showLogo from "./show-logo.js"; import showPeople from "./show-people.js"; @@ -64,7 +64,7 @@ export default conf => { ${conf.bugTrackerHTML ? html` <dt>${conf.l10n.bug_tracker}</dt> - <dd>${[conf.bugTrackerHTML]}</dd> + <dd>${raw(conf.bugTrackerHTML)}</dd> ` : ""} ${conf.prevVersion @@ -111,7 +111,7 @@ export default conf => { ${conf.multipleAlternates ? "This document is also available in these non-normative formats:" : "This document is also available in this non-normative format:"} - ${[conf.alternatesHTML]} + ${raw(conf.alternatesHTML)} </p> ` : ""} @@ -119,13 +119,13 @@ export default conf => { <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright" >Copyright</a > - © + © ${conf.copyrightStart ? `${conf.copyrightStart}-` : ""}${conf.publishYear} ${conf.additionalCopyrightHolders ? html` - ${[conf.additionalCopyrightHolders]} & + ${raw(conf.additionalCopyrightHolders)} & ` : ""} the Contributors to the ${conf.title} Specification, published by the diff --git a/src/w3c/templates/cgbg-sotd.js b/src/w3c/templates/cgbg-sotd.js index 3acc8ee1ee..854c6ffa71 100644 --- a/src/w3c/templates/cgbg-sotd.js +++ b/src/w3c/templates/cgbg-sotd.js @@ -77,6 +77,6 @@ export default (conf, opts) => { ` : ""} ${conf.sotdAfterWGinfo ? opts.additionalContent : ""} - ${opts.additionalSections} + ${[...opts.additionalSections]} `; }; diff --git a/src/w3c/templates/headers.js b/src/w3c/templates/headers.js index 01456d2c91..318fe5a3e4 100644 --- a/src/w3c/templates/headers.js +++ b/src/w3c/templates/headers.js @@ -1,5 +1,5 @@ // @ts-check -import { hyperHTML as html } from "../../core/import-maps.js"; +import { hyperHTML as html, raw } from "../../core/import-maps.js"; import { norm } from "../../core/utils.js"; import { pub } from "../../core/pubsubhub.js"; import showLink from "./show-link.js"; @@ -110,7 +110,7 @@ export default conf => { ${conf.bugTrackerHTML ? html` <dt>${conf.l10n.bug_tracker}</dt> - <dd>${[conf.bugTrackerHTML]}</dd> + <dd>${raw(conf.bugTrackerHTML)}</dd> ` : ""} ${conf.isED && conf.prevED @@ -185,7 +185,7 @@ export default conf => { ${conf.multipleAlternates ? "This document is also available in these non-normative formats:" : "This document is also available in this non-normative format:"} - ${[conf.alternatesHTML]} + ${raw(conf.alternatesHTML)} </p> ` : ""} @@ -210,10 +210,10 @@ function renderCopyright(conf) { return conf.isUnofficial ? conf.additionalCopyrightHolders ? html` - <p class="copyright">${[conf.additionalCopyrightHolders]}</p> + <p class="copyright">${raw(conf.additionalCopyrightHolders)}</p> ` : conf.overrideCopyright - ? [conf.overrideCopyright] + ? raw(conf.overrideCopyright) : html` <p class="copyright"> This document is licensed under a @@ -225,7 +225,7 @@ function renderCopyright(conf) { </p> ` : conf.overrideCopyright - ? [conf.overrideCopyright] + ? raw(conf.overrideCopyright) : renderOfficialCopyright(conf); } @@ -235,16 +235,14 @@ function renderOfficialCopyright(conf) { <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright" >Copyright</a > - © + © ${conf.copyrightStart ? `${conf.copyrightStart}-` : ""}${conf.publishYear} ${conf.additionalCopyrightHolders - ? html` - ${[conf.additionalCopyrightHolders]} & - ` + ? raw(`${conf.additionalCopyrightHolders} &`) : ""} <a href="https://www.w3.org/" ><abbr title="World Wide Web Consortium">W3C</abbr></a - ><sup>®</sup> (<a href="https://www.csail.mit.edu/" + ><sup>®</sup> (<a href="https://www.csail.mit.edu/" ><abbr title="Massachusetts Institute of Technology">MIT</abbr></a >, <a href="https://www.ercim.eu/" diff --git a/src/w3c/templates/show-link.js b/src/w3c/templates/show-link.js index be61277cc1..e5e29cf9be 100644 --- a/src/w3c/templates/show-link.js +++ b/src/w3c/templates/show-link.js @@ -1,7 +1,6 @@ // @ts-check -import { hyperHTML } from "../../core/import-maps.js"; +import { hyperHTML as html } from "../../core/import-maps.js"; import { pub } from "../../core/pubsubhub.js"; -const html = hyperHTML; export default link => { if (!link.key) { @@ -11,15 +10,19 @@ export default link => { console.warn("warn", msg, link); return; } - return html` - <dt class="${link.class ? link.class : null}">${link.key}:</dt> + const fragment = html` + <dt>${link.key}:</dt> ${link.data ? link.data.map(showLinkData) : showLinkData(link)} `; + if (link.class) { + fragment.classList.add(link.class); + } + return fragment; }; function showLinkData(data) { - return html` - <dd class="${data.class ? data.class : null}"> + const fragment = html` + <dd> ${data.href ? html` <a href="${data.href}">${data.value || data.href}</a> @@ -27,4 +30,8 @@ function showLinkData(data) { : ""} </dd> `; + if (data.class) { + fragment.classList.add(data.class); + } + return fragment; } diff --git a/src/w3c/templates/show-logo.js b/src/w3c/templates/show-logo.js index 3de6a8dde5..2461cf2fb1 100644 --- a/src/w3c/templates/show-logo.js +++ b/src/w3c/templates/show-logo.js @@ -4,6 +4,7 @@ import { showInlineWarning } from "../../core/utils.js"; export default obj => { /** @type {HTMLAnchorElement} */ + // @ts-ignore force type assertion const a = html` <a href="${obj.url || ""}" class="logo"></a> `; @@ -11,6 +12,7 @@ export default obj => { showInlineWarning(a, "Found spec logo without an `alt` attribute"); } /** @type {HTMLImageElement} */ + // @ts-ignore force type assertion const img = html` <img id="${obj.id}" diff --git a/src/w3c/templates/show-people.js b/src/w3c/templates/show-people.js index c9225f6245..5c609cedc4 100644 --- a/src/w3c/templates/show-people.js +++ b/src/w3c/templates/show-people.js @@ -1,11 +1,11 @@ // @ts-check +import { hyperHTML as html, raw } from "../../core/import-maps.js"; import { humanDate, showInlineError, toShortIsoDate, } from "../../core/utils.js"; import { lang as defaultLang } from "../../core/l10n.js"; -import { hyperHTML as html } from "../../core/import-maps.js"; const localizationStrings = { en: { @@ -23,14 +23,15 @@ export default (items = []) => { return items.map(getItem); function getItem(p) { - const personName = [p.name]; // treated as opt-in HTML by hyperHTML - const company = [p.company]; - const editorid = p.w3cid ? parseInt(p.w3cid, 10) : null; + const personName = raw(p.name); + const company = raw(p.company); /** @type {HTMLElement} */ const dd = html` - <dd class="p-author h-card vcard" data-editor-id="${editorid}"></dd> + <dd class="p-author h-card vcard"></dd> `; - const span = document.createDocumentFragment(); + if (p.w3cid) { + dd.dataset.editorId = String(parseInt(p.w3cid, 10)); + } const contents = []; if (p.mailto) { contents.push(html` @@ -127,16 +128,15 @@ export default (items = []) => { ); } - // @ts-ignore: hyperhtml types only support Element but we use a DocumentFragment here - html.bind(span)`${contents}`; - dd.appendChild(span); + dd.append(...contents); return dd; } function getExtra(extra) { - const span = html` - <span class="${extra.class || null}"></span> - `; + const span = document.createElement("span"); + if (extra.class) { + span.classList.add(extra.class); + } let textContainer = span; if (extra.href) { textContainer = html` diff --git a/src/w3c/templates/sotd.js b/src/w3c/templates/sotd.js index 00132d9ecf..eda203c952 100644 --- a/src/w3c/templates/sotd.js +++ b/src/w3c/templates/sotd.js @@ -1,5 +1,6 @@ // @ts-check -import { hyperHTML as html } from "../../core/import-maps.js"; +import { hyperHTML as html, raw } from "../../core/import-maps.js"; +import { optdata } from "../../core/utils.js"; export default (conf, opts) => { return html` @@ -12,7 +13,7 @@ export default (conf, opts) => { : conf.isNoTrack ? renderIsNoTrack(conf, opts) : html` - <p><em>${[conf.l10n.status_at_publication]}</em></p> + <p><em>${raw(conf.l10n.status_at_publication)}</em></p> ${conf.isSubmission ? noteForSubmission(conf, opts) : html` @@ -96,12 +97,12 @@ export default (conf, opts) => { </p> ${conf.addPatentNote ? html` - <p>${[conf.addPatentNote]}</p> + <p>${raw(conf.addPatentNote)}</p> ` : ""} `} `} - ${opts.additionalSections} + ${[...opts.additionalSections]} `; }; @@ -218,17 +219,17 @@ function renderDeliverer(conf) { ? "The group does not expect this document to become a W3C Recommendation." : ""; return html` - <p data-deliverer="${isNote ? wgId : null}"> + <p ${optdata("deliverer", isNote ? wgId : null)}> ${producers} ${wontBeRec} ${!isNote && !isIGNote ? html` ${multipleWGs ? html` - W3C maintains ${[wgPatentHTML]} + W3C maintains ${raw(wgPatentHTML)} ` : html` W3C maintains a - <a href="${[wgPatentURI]}" rel="disclosure" + <a href="${wgPatentURI}" rel="disclosure" >public list of any patent disclosures</a > `} @@ -330,7 +331,7 @@ function linkToWorkingGroup(conf) { } return html` <p> - This document was published by ${[conf.wgHTML]} as ${conf.anOrA} + This document was published by ${raw(conf.wgHTML)} as ${conf.anOrA} ${conf.longStatus}. ${conf.notYetRec ? "This document is intended to become a W3C Recommendation." diff --git a/tests/spec/core/caniuse-spec.js b/tests/spec/core/caniuse-spec.js index 060e2313f9..318b78bec6 100644 --- a/tests/spec/core/caniuse-spec.js +++ b/tests/spec/core/caniuse-spec.js @@ -7,6 +7,7 @@ import { makeRSDoc, makeStandardOps, } from "../SpecHelper.js"; +import { getExportedDoc } from "./exporter-spec.js"; describe("Core — Can I Use", () => { afterAll(flushIframes); @@ -140,4 +141,20 @@ describe("Core — Can I Use", () => { const text = doc.getElementById("initialUserConfig").textContent; expect(JSON.parse(text)).toEqual(expectedObj); }); + + it("replaces caniuse table when exporting", async () => { + const ops = makeStandardOps({ + caniuse: { + feature: "FEATURE", + apiURL, + browsers: ["firefox", "chrome", "opera"], + versions: 5, + }, + }); + const doc = await getExportedDoc(ops); + + const statsAnchors = doc.querySelectorAll(".caniuse-stats a"); + expect(statsAnchors.length).toBe(1); + expect(statsAnchors[0].textContent).toBe("caniuse.com"); + }); }); diff --git a/tests/spec/core/examples-spec.js b/tests/spec/core/examples-spec.js index 14ef9660db..f958aff375 100644 --- a/tests/spec/core/examples-spec.js +++ b/tests/spec/core/examples-spec.js @@ -50,9 +50,7 @@ describe("Core — Examples", () => { expect(marker.textContent.trim()).toBe("Example 1: EX"); expect(marker.querySelector(".example-title").textContent).toBe(": EX"); expect(example.getAttribute("title")).toBeNull(); - expect(example.textContent.trim()).toBe( - "Example 1: EX\n \n{\n CONTENT\n}" - ); + expect(example.textContent.trim()).toBe("Example 1: EX\n{\n CONTENT\n}"); }); it("processes children of aside examples", async () => { const body = ` diff --git a/tests/spec/core/exporter-spec.js b/tests/spec/core/exporter-spec.js index 7b2342441c..d74380fb79 100644 --- a/tests/spec/core/exporter-spec.js +++ b/tests/spec/core/exporter-spec.js @@ -2,23 +2,23 @@ import { flushIframes, makeRSDoc, makeStandardOps } from "../SpecHelper.js"; +export async function getExportedDoc(ops) { + const doc = await makeRSDoc(ops); + const dataURL = await new Promise(resolve => { + doc.defaultView.require(["core/exporter"], ({ rsDocToDataURL }) => + resolve(rsDocToDataURL("text/html", doc)) + ); + }); + const docString = decodeURIComponent(dataURL).replace( + "data:text/html;charset=utf-8,", + "" + ); + return new DOMParser().parseFromString(docString, "text/html"); +} + describe("Core - exporter", () => { afterAll(flushIframes); - async function getExportedDoc(ops) { - const doc = await makeRSDoc(ops); - const dataURL = await new Promise(resolve => { - doc.defaultView.require(["core/exporter"], ({ rsDocToDataURL }) => - resolve(rsDocToDataURL("text/html", doc)) - ); - }); - const docString = decodeURIComponent(dataURL).replace( - "data:text/html;charset=utf-8,", - "" - ); - return new DOMParser().parseFromString(docString, "text/html"); - } - it("removes .removeOnSave elements", async () => { const ops = makeStandardOps(); ops.body = `<div class="removeOnSave" id="this-should-be-removed">this should be removed</div>`; diff --git a/tests/spec/w3c/headers-spec.js b/tests/spec/w3c/headers-spec.js index aeff5a5871..46f80d58f6 100644 --- a/tests/spec/w3c/headers-spec.js +++ b/tests/spec/w3c/headers-spec.js @@ -430,7 +430,7 @@ describe("W3C — Headers", () => { const formerEditorsLabel = dtElems.find(formerEditors); expect(formerEditorsLabel).toBeUndefined(); - const editor = formerEditorLabel.nextSibling; + const editor = formerEditorLabel.nextElementSibling; expect(editor.localName).toBe("dd"); expect(editor.textContent.replace(/\s+/gm, " ").trim()).toBe( "NAME (COMPANY)" @@ -474,11 +474,11 @@ describe("W3C — Headers", () => { const formerEditorsLabel = dtElems.find(formerEditors); expect(formerEditorsLabel).toBeDefined(); - const firstEditor = formerEditorsLabel.nextSibling; + const firstEditor = formerEditorsLabel.nextElementSibling; expect(firstEditor.localName).toBe("dd"); expect(firstEditor.textContent).toBe("NAME1"); - const secondEditor = firstEditor.nextSibling; + const secondEditor = firstEditor.nextElementSibling; expect(secondEditor.localName).toBe("dd"); expect(secondEditor.textContent).toBe("NAME2"); }); @@ -547,11 +547,12 @@ describe("W3C — Headers", () => { const doc = await makeRSDoc(ops); expect(contains(doc, "dt", "Authors:").length).toBe(1); expect(contains(doc, "dt", "Author:").length).toBe(0); - expect(contains(doc, "dt", "Authors:")[0].nextSibling.textContent).toBe( - "NAME1" - ); expect( - contains(doc, "dt", "Authors:")[0].nextSibling.nextSibling.textContent + contains(doc, "dt", "Authors:")[0].nextElementSibling.textContent + ).toBe("NAME1"); + expect( + contains(doc, "dt", "Authors:")[0].nextElementSibling.nextElementSibling + .textContent ).toBe("NAME2"); }); }); @@ -1399,8 +1400,8 @@ describe("W3C — Headers", () => { // There should only be one thing in the ToC expect(doc.querySelectorAll("#toc li").length).toBe(1); // and it should say "PASS" - expect(doc.querySelector("#toc li bdi").nextSibling.textContent).toBe( - "PASS" + expect(doc.querySelector("#toc li bdi").parentElement.textContent).toBe( + "1. PASS" ); }; theTest(await makeRSDoc(ops));