From 003f736c064387195128334e7adb35384c079d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Mon, 9 Aug 2021 11:28:46 +1000 Subject: [PATCH] v26.13.0 --- builds/respec-aom.js | 2 +- builds/respec-dini.js | 2 +- builds/respec-geonovum.js | 2 +- builds/respec-w3c.js | 54 +++++++++++++++++++-------------------- builds/respec-w3c.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/builds/respec-aom.js b/builds/respec-aom.js index e07388a35c..8c866593b0 100644 --- a/builds/respec-aom.js +++ b/builds/respec-aom.js @@ -1,4 +1,4 @@ -window.respecVersion="26.12.1",function(){"use strict";const e=!!window.require;if(!e){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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},o=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:o,run:function(e){e.l10n=r[o]||r.en}});let s,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(l.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(c.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||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});c.set(e,t)}(e),t=e,(s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&l.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function x(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>x(t,n)||e.get(t,n,r),has:(t,n)=>!!x(t,n)||e.has(t,n)}))(f);var k=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=g(s);return r&&s.addEventListener("upgradeneeded",e=>{r(g(s.result),e.oldVersion,e.newVersion,g(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),a.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",()=>o())}).catch(()=>{}),a},unwrap:b,wrap:g});const $=/^[!#$%&'*+-.^`|~\w]+$/,_=/[\u000A\u000D\u0009\u0020]/u,E=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function S(e,t,n){(t&&""!==t&&!e.has(t)&&E.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var C={exports:{}};function A(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}C.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:A,changeDefaults:function(e){C.exports.defaults=e}};const L=/[&<>"']/,T=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,O={"&":"&","<":"<",">":">",'"':""","'":"'"},D=e=>O[e];const I=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function P(e){return e.replace(I,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const z=/(^|[^\[])\^/g;const j=/[^\w:]/g,M=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const q={},F=/^[^:]+:\/*[^/]*$/,B=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function H(e,t){q[" "+e]||(F.test(e)?q[" "+e]=e+"/":q[" "+e]=U(e,"/",!0));const n=-1===(e=q[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(B,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(W,"$1")+t:e+t}function U(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o(r=(r=r.source||r).replace(z,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(P(n)).replace(j,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!M.test(n)&&(n=H(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:H,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:V}=C.exports,{rtrim:G,splitCells:Y,escape:K,findClosingBracket:X}=Z;function J(e,t,n){const r=t.href,o=t.title?K(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:o,text:i}:{type:"image",raw:n,href:r,title:o,text:K(i)}}var Q=class{constructor(e){this.options=e||V}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:G(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=G(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:Y(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],r=n.length>1,o={type:"list",raw:e,ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]},i=t[0].match(this.rules.block.item);let s,a,l,c,u,d,p,f,h,m=!1,g=i.length;l=this.rules.block.listItemStart.exec(i[0]);for(let t=0;tl[1].length:c[1].length>=l[0].length||c[1].length>3){i.splice(t,2,i[t]+(!this.options.pedantic&&c[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):K(r[0]):r[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=G(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=X(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),J(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return J(n,e,n[0])}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));)if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],o)if(i=o.length,r[3]||r[4])s+=i;else if(!((r[5]||r[6])&&n%3)||(n+i)%3){if(s-=i,!(s>0))return i=Math.min(i,i+s+a),Math.min(n,i)%2?{type:"em",raw:e.slice(0,n+r.index+i+1),text:e.slice(1,n+r.index+i)}:{type:"strong",raw:e.slice(0,n+r.index+i+1),text:e.slice(2,n+r.index+i-1)}}else a+=i}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=K(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=K(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=K(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=K(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=K(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const r=this.rules.inline.text.exec(e);if(r){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):K(r[0]):r[0]:K(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:e}}}};const{noopTest:ee,edit:te,merge:ne}=Z,re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ee,table:ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=te(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,re.item=te(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.listItemStart=te(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=te(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/|$)/,re.html=te(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=te(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=te(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=ne({},re),re.gfm=ne({},re.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),re.gfm.nptable=te(re.gfm.nptable).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.table=te(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic=ne({},re.normal,{html:te("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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+|$)/,fences:ee,paragraph:te(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};oe.punctuation=te(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/\\\*|\\_/g,oe._comment=te(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=te(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=te(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=te(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=te(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=te(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=te(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=te(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=te(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=ne({},oe),oe.pedantic=ne({},oe.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=ne({},oe.normal,{escape:te(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}const{defaults:fe}=C.exports,{cleanUrl:he,escape:me}=Z;var ge=class{constructor(e){this.options=e||fe}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
'+(n?e:me(e,!0))+"
\n":"
"+(n?e:me(e,!0))+"
\n"}blockquote(e){return"
\n"+e+"
\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r='",r}image(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},be=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},ye=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const we=ge,ve=be,xe=ye,{defaults:ke}=C.exports,{unescape:$e}=Z;const _e=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ae,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:le.normal,inline:ce.normal};this.options.pedantic?(t.block=le.pedantic,t.inline=ce.pedantic):this.options.gfm&&(t.block=le.gfm,this.options.breaks?t.inline=ce.breaks:t.inline=ce.gfm),this.tokenizer.rules=t}static get rules(){return{block:le,inline:ce}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let r,o,i,s,a,l;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"paragraph"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),i=r.items.length,o=0;o=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(r=this.tokenizer.paragraph(a)))s=t[t.length-1],l&&"paragraph"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r),l=a.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,r,o,i,s;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(o=n.call(this,e,t))&&(e=e.substring(o.raw.length),t.push(o),!0))))if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,r))e=e.substring(o.raw.length),n=o.inLink,r=o.inRawBlock,i=t[t.length-1],i&&"text"===o.type&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),i=t[t.length-1],"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,r),t.push(o)):i&&"text"===o.type&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(o=this.tokenizer.emStrong(e,u,c))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.autolink(e,pe))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,pe))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call(this,n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s,r,de))e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(c=o.raw.slice(-1)),l=!0,i=t[t.length-1],i&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(o.raw.length),t.push(o);return t}},Ee=class e{constructor(e){this.options=e||ke,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ve,this.slugger=new xe}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,b,y,w,v,x="";const k=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);x+=this.renderer.list(u,p,f);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&i()}))},0))})),void(0===s&&i())}try{const n=_e.lex(e,t);return t.walkTokens&&Pe.walkTokens(n,t.walkTokens),Ee.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Re(e.message+"",!0)+"
    ";throw e}}Pe.options=Pe.setOptions=function(e){return Te(Pe.defaults,e),De(Pe.defaults),Pe},Pe.getDefaults=Oe,Pe.defaults=Ie,Pe.use=function(...e){const t=Te({},...e),n=Pe.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=Pe.defaults.renderer||new Ce;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=Pe.defaults.tokenizer||new Se;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=Pe.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}r&&(t.extensions=n),Pe.setOptions(t)})},Pe.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)Pe.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)Pe.walkTokens(n,t);break;case"list":Pe.walkTokens(n.items,t);break;default:Pe.defaults.extensions&&Pe.defaults.extensions.childTokens&&Pe.defaults.extensions.childTokens[n.type]?Pe.defaults.extensions.childTokens[n.type].forEach((function(e){Pe.walkTokens(n[e],t)})):n.tokens&&Pe.walkTokens(n.tokens,t)}},Pe.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Te({},Pe.defaults,t||{}),Ne(t);try{const n=_e.lexInline(e,t);return t.walkTokens&&Pe.walkTokens(n,t.walkTokens),Ee.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Re(e.message+"",!0)+"
    ";throw e}},Pe.Parser=Ee,Pe.parser=Ee.parse,Pe.Renderer=Ce,Pe.TextRenderer=Ae,Pe.Lexer=_e,Pe.lexer=_e.lex,Pe.Tokenizer=Se,Pe.Slugger=Le,Pe.parse=Pe;var ze=Pe;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var je,Me={exports:{}};je=Me,function(e,t){je.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(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 a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return s(""===n?e[r-1]:n,o)}))}function c(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 l(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(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}));var qe=Me.exports,Fe=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){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(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!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)}function o(e,t,n,r,o,i){for(var s=("selectedIndex"in t),a=s;r>>0;ns;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,x=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=j(S),n=j("div");return n.innerHTML=''+e+"",z(t,n.firstChild.childNodes),t}:A)(e)});function z(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function j(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,F,B,W,H,U,Z,V,G=(q="appendChild",F="cloneNode",B="createTextNode",H=(W="importNode")in(M=e),(U=M.createDocumentFragment())[q](M[B]("g")),U[q](M[B]("")),(H?M[W](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,s=0;n&&s

    ',Z.content.childNodes[0].getAttribute(V)==K)||(K="_dt: "+K.slice(1,-1)+";",X=!0)}catch(u){}var J="\x3c!--"+K+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+J+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+K+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=X?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;a{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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},o=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:o,run:function(e){e.l10n=r[o]||r.en}});let s,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(l.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(c.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||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});c.set(e,t)}(e),t=e,(s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&l.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function x(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>x(t,n)||e.get(t,n,r),has:(t,n)=>!!x(t,n)||e.has(t,n)}))(f);var k=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=g(s);return r&&s.addEventListener("upgradeneeded",e=>{r(g(s.result),e.oldVersion,e.newVersion,g(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),a.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",()=>o())}).catch(()=>{}),a},unwrap:b,wrap:g});const $=/^[!#$%&'*+-.^`|~\w]+$/,_=/[\u000A\u000D\u0009\u0020]/u,E=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function S(e,t,n){(t&&""!==t&&!e.has(t)&&E.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var C={exports:{}};function A(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}C.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:A,changeDefaults:function(e){C.exports.defaults=e}};const L=/[&<>"']/,T=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,O={"&":"&","<":"<",">":">",'"':""","'":"'"},D=e=>O[e];const I=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function P(e){return e.replace(I,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const z=/(^|[^\[])\^/g;const j=/[^\w:]/g,M=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const q={},F=/^[^:]+:\/*[^/]*$/,B=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function H(e,t){q[" "+e]||(F.test(e)?q[" "+e]=e+"/":q[" "+e]=U(e,"/",!0));const n=-1===(e=q[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(B,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(W,"$1")+t:e+t}function U(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o(r=(r=r.source||r).replace(z,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(P(n)).replace(j,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!M.test(n)&&(n=H(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:H,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:V}=C.exports,{rtrim:G,splitCells:Y,escape:K,findClosingBracket:X}=Z;function J(e,t,n){const r=t.href,o=t.title?K(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:o,text:i}:{type:"image",raw:n,href:r,title:o,text:K(i)}}var Q=class{constructor(e){this.options=e||V}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:G(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=G(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:Y(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],r=n.length>1,o={type:"list",raw:e,ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]},i=t[0].match(this.rules.block.item);let s,a,l,c,u,d,p,f,h,m=!1,g=i.length;l=this.rules.block.listItemStart.exec(i[0]);for(let t=0;tl[1].length:c[1].length>=l[0].length||c[1].length>3){i.splice(t,2,i[t]+(!this.options.pedantic&&c[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):K(r[0]):r[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=G(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=X(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),J(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return J(n,e,n[0])}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));)if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],o)if(i=o.length,r[3]||r[4])s+=i;else if(!((r[5]||r[6])&&n%3)||(n+i)%3){if(s-=i,!(s>0))return i=Math.min(i,i+s+a),Math.min(n,i)%2?{type:"em",raw:e.slice(0,n+r.index+i+1),text:e.slice(1,n+r.index+i)}:{type:"strong",raw:e.slice(0,n+r.index+i+1),text:e.slice(2,n+r.index+i-1)}}else a+=i}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=K(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=K(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=K(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=K(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=K(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const r=this.rules.inline.text.exec(e);if(r){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):K(r[0]):r[0]:K(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:e}}}};const{noopTest:ee,edit:te,merge:ne}=Z,re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ee,table:ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=te(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,re.item=te(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.listItemStart=te(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=te(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/|$)/,re.html=te(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=te(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=te(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=ne({},re),re.gfm=ne({},re.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),re.gfm.nptable=te(re.gfm.nptable).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.table=te(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic=ne({},re.normal,{html:te("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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+|$)/,fences:ee,paragraph:te(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};oe.punctuation=te(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/\\\*|\\_/g,oe._comment=te(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=te(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=te(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=te(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=te(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=te(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=te(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=te(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=te(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=ne({},oe),oe.pedantic=ne({},oe.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=ne({},oe.normal,{escape:te(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}const{defaults:fe}=C.exports,{cleanUrl:he,escape:me}=Z;var ge=class{constructor(e){this.options=e||fe}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:me(e,!0))+"
    \n":"
    "+(n?e:me(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},be=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},ye=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const we=ge,ve=be,xe=ye,{defaults:ke}=C.exports,{unescape:$e}=Z;const _e=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ae,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:le.normal,inline:ce.normal};this.options.pedantic?(t.block=le.pedantic,t.inline=ce.pedantic):this.options.gfm&&(t.block=le.gfm,this.options.breaks?t.inline=ce.breaks:t.inline=ce.gfm),this.tokenizer.rules=t}static get rules(){return{block:le,inline:ce}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let r,o,i,s,a,l;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"paragraph"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),i=r.items.length,o=0;o=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(r=this.tokenizer.paragraph(a)))s=t[t.length-1],l&&"paragraph"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r),l=a.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,r,o,i,s;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(o=n.call(this,e,t))&&(e=e.substring(o.raw.length),t.push(o),!0))))if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,r))e=e.substring(o.raw.length),n=o.inLink,r=o.inRawBlock,i=t[t.length-1],i&&"text"===o.type&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),i=t[t.length-1],"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,r),t.push(o)):i&&"text"===o.type&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(o=this.tokenizer.emStrong(e,u,c))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.autolink(e,pe))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,pe))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call(this,n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s,r,de))e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(c=o.raw.slice(-1)),l=!0,i=t[t.length-1],i&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(o.raw.length),t.push(o);return t}},Ee=class e{constructor(e){this.options=e||ke,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ve,this.slugger=new xe}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,b,y,w,v,x="";const k=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);x+=this.renderer.list(u,p,f);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&i()}))},0))})),void(0===s&&i())}try{const n=_e.lex(e,t);return t.walkTokens&&Pe.walkTokens(n,t.walkTokens),Ee.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Re(e.message+"",!0)+"
    ";throw e}}Pe.options=Pe.setOptions=function(e){return Te(Pe.defaults,e),De(Pe.defaults),Pe},Pe.getDefaults=Oe,Pe.defaults=Ie,Pe.use=function(...e){const t=Te({},...e),n=Pe.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=Pe.defaults.renderer||new Ce;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=Pe.defaults.tokenizer||new Se;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=Pe.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}r&&(t.extensions=n),Pe.setOptions(t)})},Pe.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)Pe.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)Pe.walkTokens(n,t);break;case"list":Pe.walkTokens(n.items,t);break;default:Pe.defaults.extensions&&Pe.defaults.extensions.childTokens&&Pe.defaults.extensions.childTokens[n.type]?Pe.defaults.extensions.childTokens[n.type].forEach((function(e){Pe.walkTokens(n[e],t)})):n.tokens&&Pe.walkTokens(n.tokens,t)}},Pe.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Te({},Pe.defaults,t||{}),Ne(t);try{const n=_e.lexInline(e,t);return t.walkTokens&&Pe.walkTokens(n,t.walkTokens),Ee.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Re(e.message+"",!0)+"
    ";throw e}},Pe.Parser=Ee,Pe.parser=Ee.parse,Pe.Renderer=Ce,Pe.TextRenderer=Ae,Pe.Lexer=_e,Pe.lexer=_e.lex,Pe.Tokenizer=Se,Pe.Slugger=Le,Pe.parse=Pe;var ze=Pe;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var je,Me={exports:{}};je=Me,function(e,t){je.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(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 a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return s(""===n?e[r-1]:n,o)}))}function c(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 l(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(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}));var qe=Me.exports,Fe=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){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(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!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)}function o(e,t,n,r,o,i){for(var s=("selectedIndex"in t),a=s;r>>0;ns;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,x=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=j(S),n=j("div");return n.innerHTML=''+e+"",z(t,n.firstChild.childNodes),t}:A)(e)});function z(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function j(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,F,B,W,H,U,Z,V,G=(q="appendChild",F="cloneNode",B="createTextNode",H=(W="importNode")in(M=e),(U=M.createDocumentFragment())[q](M[B]("g")),U[q](M[B]("")),(H?M[W](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,s=0;n&&s

    ',Z.content.childNodes[0].getAttribute(V)==K)||(K="_dt: "+K.slice(1,-1)+";",X=!0)}catch(u){}var J="\x3c!--"+K+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+J+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+K+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=X?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;a{e.remove()})}function Ke(e,t="long"){const n=new Intl.ListFormat(o,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o)}}const Xe=Ke("conjunction"),Je=Ke("disjunction");function Qe(e,t){return Xe(e,t).join("")}function et(e){return e.trim().replace(/\s+/g," ")}function tt(e,t=o){return t=function(e){return{"zh-hans":"zh","zh-cn":"zh"}[e]||e}(t.toLowerCase()),new Proxy(e,{get(e,n){const r=e[t]&&e[t][n]||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function nt(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){yt(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function rt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map(e=>We`${e}, `);return We`${r}${n[n.length-1]}`}function ot(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(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||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);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function it(e){const t=new Set,n="ltNodefault"in e.dataset?"":et(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>et(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(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach(e=>t.add(et(e)))}return[...t]}function st(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function at(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");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 lt(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function ct(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 ut(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class dt 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 pt(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{st(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),ft(t),t}function ft(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...ht(t)])e.remove()}function*ht(e){for(;e.nextNode();)yield e.currentNode}class mt 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())}}class gt extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||ot(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:s,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:s,details:a,stack:n}}}function bt(e,t,n={}){const r={...n,isWarning:!1};_t("error",new gt(e,t,r))}function yt(e,t,n={}){const r={...n,isWarning:!0};_t("warn",new gt(e,t,r))}function wt(e){return e?`\`${e}\``:""}function vt(e,{quotes:t}={quotes:!1}){return Je(e,t?e=>{return wt((t=e,String(t)?`"${t}"`:""));var t}:wt).join("")}function xt(e,...t){return e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,i]=r.slice(1,-1).split("|");if(i){return`${e}[${o}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`}).join("")}const kt="core/pubsubhub",$t=new Map;function _t(e,...t){if(!$t.has(e))return;if(Array.from($t.get(e)).forEach(e=>{try{e(...t)}catch(t){bt(`Error when calling function ${e.name}.`,kt,{hint:"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 Et(e,t,n={once:!1}){return n.once?Et(e,(function n(...r){!function({topic:e,cb:t}){const n=$t.get(e);if(!n||!n.has(t))return console.warn("Already unsubscribed:",e,t),!1;n.delete(t)}({topic:e,cb:n}),t(...r)})):($t.has(e)?$t.get(e).add(t):$t.set(e,new Set([t])),{topic:e,cb:t})}t(kt,{sub:Et});const St=["githubToken","githubUser"];const Ct=new Map([["text/html","html"],["application/xml","xml"]]);function At(e,t=document){const n=Ct.get(e);if(!n){const t=[...Ct.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Lt(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Lt(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;ft(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar"),Ye(r);const o=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&o.appendChild(i);let s=e.querySelector("meta[charset], meta[content*='charset=']");s||(s=We``);o.appendChild(s);const a="ReSpec "+(window.respecVersion||"Developer Channel"),l=We` `;o.appendChild(l),t.prepend(o),_t("beforesave",r)}(n);let r="";switch(e){case"xml":r=(new XMLSerializer).serializeToString(n);break;default:!function(e){e.querySelectorAll("style").forEach(e=>{e.innerHTML=`\n${e.innerHTML}\n`}),e.querySelectorAll("head > *").forEach(e=>{e.outerHTML="\n"+e.outerHTML})}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML}return r}t("core/exporter",{rsDocToDataURL:At});class Tt{constructor(){this._respecDonePromise=new Promise(e=>{Et("end-all",e,{once:!0})}),this.errors=[],this.warnings=[],Et("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),Et("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Lt("html",document)}}const Nt="core/post-process";const Rt="core/pre-process";const Ot="core/base-runner";async function Dt(e){!function(){const e=new Tt;Object.defineProperty(document,"respec",{value:e});let t=!1;Object.defineProperty(document,"respecIsReady",{get:()=>(t||(yt("`document.respecIsReady` is deprecated and will be removed in a future release.","core/respec-global",{hint:"Use `document.respec.ready` instead."}),t=!0),document.respec.ready)})}(),_t("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Et("amend-user-config",n),Et("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of St)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)})}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).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[n,o]}),r=Object.fromEntries(n);Object.assign(e,r),_t("amend-user-config",r)}(respecConfig),performance.mark(Ot+"-start"),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||bt("Every item in `preProcess` must be a JS function.",Rt),t}).map(async t=>{try{return await t(e,document)}catch(e){bt(`Function ${t.name} threw an error during \`preProcess\`.`,Rt,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}}(respecConfig);const t=e.filter(e=>{return(t=e)&&(t.run||t.Plugin);var t});t.forEach(e=>!e.name&&console.warn("Plugin lacks name:",e)),respecConfig.state={},await async function(e,t){for(const n of e.filter(e=>e.prepare))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise(async(r,o)=>{const i=setTimeout(()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))},15e3);performance.mark(e+"-start");try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(i),performance.mark(e+"-end"),performance.measure(e,e+"-start",e+"-end")}})}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},_t("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter(e=>{const t="function"==typeof e;return t||bt("Every item in `postProcess` must be a JS function.",Nt),t}).map(async t=>{try{return await t(e,document)}catch(e){bt(`Function ${t.name} threw an error during \`postProcess\`.`,Nt,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),_t("end-all"),Ye(document),performance.mark(Ot+"-end"),performance.measure(Ot,Ot+"-start",Ot+"-end")}var It=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} diff --git a/builds/respec-dini.js b/builds/respec-dini.js index bc34cc4711..0791c76a93 100644 --- a/builds/respec-dini.js +++ b/builds/respec-dini.js @@ -1,4 +1,4 @@ -window.respecVersion="26.12.1",function(){"use strict";const e=!!window.require;if(!e){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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},o=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:o,run:function(e){e.l10n=r[o]||r.en}});let s,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(l.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(c.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||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});c.set(e,t)}(e),t=e,(s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&l.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}))(f);var x=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=g(s);return r&&s.addEventListener("upgradeneeded",e=>{r(g(s.result),e.oldVersion,e.newVersion,g(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),a.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",()=>o())}).catch(()=>{}),a},unwrap:b,wrap:g});const $=/^[!#$%&'*+-.^`|~\w]+$/,_=/[\u000A\u000D\u0009\u0020]/u,E=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function S(e,t,n){(t&&""!==t&&!e.has(t)&&E.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var C={exports:{}};function A(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}C.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:A,changeDefaults:function(e){C.exports.defaults=e}};const L=/[&<>"']/,T=/[&<>"']/g,R=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},D=e=>z[e];const P=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function j(e){return e.replace(P,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const O=/(^|[^\[])\^/g;const I=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const M={},F=/^[^:]+:\/*[^/]*$/,B=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function U(e,t){M[" "+e]||(F.test(e)?M[" "+e]=e+"/":M[" "+e]=H(e,"/",!0));const n=-1===(e=M[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(B,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(W,"$1")+t:e+t}function H(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o(r=(r=r.source||r).replace(O,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(j(n)).replace(I,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!q.test(n)&&(n=U(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:U,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:V}=C.exports,{rtrim:Y,splitCells:K,escape:X,findClosingBracket:G}=Z;function J(e,t,n){const r=t.href,o=t.title?X(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:o,text:i}:{type:"image",raw:n,href:r,title:o,text:X(i)}}var Q=class{constructor(e){this.options=e||V}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Y(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Y(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:K(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],r=n.length>1,o={type:"list",raw:e,ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]},i=t[0].match(this.rules.block.item);let s,a,l,c,u,d,p,f,h,m=!1,g=i.length;l=this.rules.block.listItemStart.exec(i[0]);for(let t=0;tl[1].length:c[1].length>=l[0].length||c[1].length>3){i.splice(t,2,i[t]+(!this.options.pedantic&&c[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):X(r[0]):r[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Y(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=G(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),J(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return J(n,e,n[0])}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));)if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],o)if(i=o.length,r[3]||r[4])s+=i;else if(!((r[5]||r[6])&&n%3)||(n+i)%3){if(s-=i,!(s>0))return i=Math.min(i,i+s+a),Math.min(n,i)%2?{type:"em",raw:e.slice(0,n+r.index+i+1),text:e.slice(1,n+r.index+i)}:{type:"strong",raw:e.slice(0,n+r.index+i+1),text:e.slice(2,n+r.index+i-1)}}else a+=i}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=X(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=X(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=X(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=X(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=X(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const r=this.rules.inline.text.exec(e);if(r){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):X(r[0]):r[0]:X(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:e}}}};const{noopTest:ee,edit:te,merge:ne}=Z,re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ee,table:ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=te(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,re.item=te(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.listItemStart=te(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=te(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/|$)/,re.html=te(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=te(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=te(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=ne({},re),re.gfm=ne({},re.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),re.gfm.nptable=te(re.gfm.nptable).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.table=te(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic=ne({},re.normal,{html:te("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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+|$)/,fences:ee,paragraph:te(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};oe.punctuation=te(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/\\\*|\\_/g,oe._comment=te(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=te(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=te(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=te(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=te(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=te(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=te(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=te(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=te(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=ne({},oe),oe.pedantic=ne({},oe.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=ne({},oe.normal,{escape:te(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}const{defaults:fe}=C.exports,{cleanUrl:he,escape:me}=Z;var ge=class{constructor(e){this.options=e||fe}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:me(e,!0))+"
    \n":"
    "+(n?e:me(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},be=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},ye=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const we=ge,ve=be,ke=ye,{defaults:xe}=C.exports,{unescape:$e}=Z;const _e=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ae,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:le.normal,inline:ce.normal};this.options.pedantic?(t.block=le.pedantic,t.inline=ce.pedantic):this.options.gfm&&(t.block=le.gfm,this.options.breaks?t.inline=ce.breaks:t.inline=ce.gfm),this.tokenizer.rules=t}static get rules(){return{block:le,inline:ce}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let r,o,i,s,a,l;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"paragraph"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),i=r.items.length,o=0;o=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(r=this.tokenizer.paragraph(a)))s=t[t.length-1],l&&"paragraph"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r),l=a.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,r,o,i,s;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(o=n.call(this,e,t))&&(e=e.substring(o.raw.length),t.push(o),!0))))if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,r))e=e.substring(o.raw.length),n=o.inLink,r=o.inRawBlock,i=t[t.length-1],i&&"text"===o.type&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),i=t[t.length-1],"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,r),t.push(o)):i&&"text"===o.type&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(o=this.tokenizer.emStrong(e,u,c))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.autolink(e,pe))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,pe))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call(this,n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s,r,de))e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(c=o.raw.slice(-1)),l=!0,i=t[t.length-1],i&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(o.raw.length),t.push(o);return t}},Ee=class e{constructor(e){this.options=e||xe,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ve,this.slugger=new ke}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,b,y,w,v,k="";const x=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);k+=this.renderer.list(u,p,f);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&i()}))},0))})),void(0===s&&i())}try{const n=_e.lex(e,t);return t.walkTokens&&je.walkTokens(n,t.walkTokens),Ee.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Ne(e.message+"",!0)+"
    ";throw e}}je.options=je.setOptions=function(e){return Te(je.defaults,e),De(je.defaults),je},je.getDefaults=ze,je.defaults=Pe,je.use=function(...e){const t=Te({},...e),n=je.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=je.defaults.renderer||new Ce;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=je.defaults.tokenizer||new Se;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=je.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}r&&(t.extensions=n),je.setOptions(t)})},je.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)je.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)je.walkTokens(n,t);break;case"list":je.walkTokens(n.items,t);break;default:je.defaults.extensions&&je.defaults.extensions.childTokens&&je.defaults.extensions.childTokens[n.type]?je.defaults.extensions.childTokens[n.type].forEach((function(e){je.walkTokens(n[e],t)})):n.tokens&&je.walkTokens(n.tokens,t)}},je.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Te({},je.defaults,t||{}),Re(t);try{const n=_e.lexInline(e,t);return t.walkTokens&&je.walkTokens(n,t.walkTokens),Ee.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Ne(e.message+"",!0)+"
    ";throw e}},je.Parser=Ee,je.parser=Ee.parse,je.Renderer=Ce,je.TextRenderer=Ae,je.Lexer=_e,je.lexer=_e.lex,je.Tokenizer=Se,je.Slugger=Le,je.parse=je;var Oe=je;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Ie,qe={exports:{}};Ie=qe,function(e,t){Ie.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(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 a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return s(""===n?e[r-1]:n,o)}))}function c(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 l(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(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}));var Me=qe.exports,Fe=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){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(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!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)}function o(e,t,n,r,o,i){for(var s=("selectedIndex"in t),a=s;r>>0;ns;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,k=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=I(S),n=I("div");return n.innerHTML=''+e+"",O(t,n.firstChild.childNodes),t}:A)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function I(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,F,B,W,U,H,Z,V,Y=(M="appendChild",F="cloneNode",B="createTextNode",U=(W="importNode")in(q=e),(H=q.createDocumentFragment())[M](q[B]("g")),H[M](q[B]("")),(U?q[W](H,!0):H[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,s=0;n&&s

    ',Z.content.childNodes[0].getAttribute(V)==X)||(X="_dt: "+X.slice(1,-1)+";",G=!0)}catch(u){}var J="\x3c!--"+X+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+J+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+X+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=G?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;a{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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},o=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:o,run:function(e){e.l10n=r[o]||r.en}});let s,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(l.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(c.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||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});c.set(e,t)}(e),t=e,(s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&l.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}))(f);var x=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=g(s);return r&&s.addEventListener("upgradeneeded",e=>{r(g(s.result),e.oldVersion,e.newVersion,g(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),a.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",()=>o())}).catch(()=>{}),a},unwrap:b,wrap:g});const $=/^[!#$%&'*+-.^`|~\w]+$/,_=/[\u000A\u000D\u0009\u0020]/u,E=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function S(e,t,n){(t&&""!==t&&!e.has(t)&&E.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var C={exports:{}};function A(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}C.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:A,changeDefaults:function(e){C.exports.defaults=e}};const L=/[&<>"']/,T=/[&<>"']/g,R=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},D=e=>z[e];const P=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function j(e){return e.replace(P,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const O=/(^|[^\[])\^/g;const I=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const M={},F=/^[^:]+:\/*[^/]*$/,B=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function U(e,t){M[" "+e]||(F.test(e)?M[" "+e]=e+"/":M[" "+e]=H(e,"/",!0));const n=-1===(e=M[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(B,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(W,"$1")+t:e+t}function H(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o(r=(r=r.source||r).replace(O,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(j(n)).replace(I,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!q.test(n)&&(n=U(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:U,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:V}=C.exports,{rtrim:Y,splitCells:K,escape:X,findClosingBracket:G}=Z;function J(e,t,n){const r=t.href,o=t.title?X(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:o,text:i}:{type:"image",raw:n,href:r,title:o,text:X(i)}}var Q=class{constructor(e){this.options=e||V}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Y(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Y(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:K(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],r=n.length>1,o={type:"list",raw:e,ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]},i=t[0].match(this.rules.block.item);let s,a,l,c,u,d,p,f,h,m=!1,g=i.length;l=this.rules.block.listItemStart.exec(i[0]);for(let t=0;tl[1].length:c[1].length>=l[0].length||c[1].length>3){i.splice(t,2,i[t]+(!this.options.pedantic&&c[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):X(r[0]):r[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Y(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=G(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),J(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return J(n,e,n[0])}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));)if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],o)if(i=o.length,r[3]||r[4])s+=i;else if(!((r[5]||r[6])&&n%3)||(n+i)%3){if(s-=i,!(s>0))return i=Math.min(i,i+s+a),Math.min(n,i)%2?{type:"em",raw:e.slice(0,n+r.index+i+1),text:e.slice(1,n+r.index+i)}:{type:"strong",raw:e.slice(0,n+r.index+i+1),text:e.slice(2,n+r.index+i-1)}}else a+=i}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=X(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=X(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=X(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=X(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=X(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const r=this.rules.inline.text.exec(e);if(r){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):X(r[0]):r[0]:X(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:e}}}};const{noopTest:ee,edit:te,merge:ne}=Z,re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ee,table:ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=te(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,re.item=te(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.listItemStart=te(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=te(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/|$)/,re.html=te(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=te(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=te(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=ne({},re),re.gfm=ne({},re.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),re.gfm.nptable=te(re.gfm.nptable).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.table=te(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic=ne({},re.normal,{html:te("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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+|$)/,fences:ee,paragraph:te(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};oe.punctuation=te(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/\\\*|\\_/g,oe._comment=te(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=te(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=te(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=te(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=te(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=te(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=te(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=te(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=te(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=ne({},oe),oe.pedantic=ne({},oe.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=ne({},oe.normal,{escape:te(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}const{defaults:fe}=C.exports,{cleanUrl:he,escape:me}=Z;var ge=class{constructor(e){this.options=e||fe}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:me(e,!0))+"
    \n":"
    "+(n?e:me(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},be=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},ye=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const we=ge,ve=be,ke=ye,{defaults:xe}=C.exports,{unescape:$e}=Z;const _e=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ae,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:le.normal,inline:ce.normal};this.options.pedantic?(t.block=le.pedantic,t.inline=ce.pedantic):this.options.gfm&&(t.block=le.gfm,this.options.breaks?t.inline=ce.breaks:t.inline=ce.gfm),this.tokenizer.rules=t}static get rules(){return{block:le,inline:ce}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let r,o,i,s,a,l;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"paragraph"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),i=r.items.length,o=0;o=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(r=this.tokenizer.paragraph(a)))s=t[t.length-1],l&&"paragraph"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r),l=a.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,r,o,i,s;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(o=n.call(this,e,t))&&(e=e.substring(o.raw.length),t.push(o),!0))))if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,r))e=e.substring(o.raw.length),n=o.inLink,r=o.inRawBlock,i=t[t.length-1],i&&"text"===o.type&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),i=t[t.length-1],"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,r),t.push(o)):i&&"text"===o.type&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(o=this.tokenizer.emStrong(e,u,c))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.autolink(e,pe))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,pe))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call(this,n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s,r,de))e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(c=o.raw.slice(-1)),l=!0,i=t[t.length-1],i&&"text"===i.type?(i.raw+=o.raw,i.text+=o.text):t.push(o);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(o.raw.length),t.push(o);return t}},Ee=class e{constructor(e){this.options=e||xe,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ve,this.slugger=new ke}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,b,y,w,v,k="";const x=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);k+=this.renderer.list(u,p,f);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&i()}))},0))})),void(0===s&&i())}try{const n=_e.lex(e,t);return t.walkTokens&&je.walkTokens(n,t.walkTokens),Ee.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Ne(e.message+"",!0)+"
    ";throw e}}je.options=je.setOptions=function(e){return Te(je.defaults,e),De(je.defaults),je},je.getDefaults=ze,je.defaults=Pe,je.use=function(...e){const t=Te({},...e),n=je.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=je.defaults.renderer||new Ce;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=je.defaults.tokenizer||new Se;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=je.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}r&&(t.extensions=n),je.setOptions(t)})},je.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)je.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)je.walkTokens(n,t);break;case"list":je.walkTokens(n.items,t);break;default:je.defaults.extensions&&je.defaults.extensions.childTokens&&je.defaults.extensions.childTokens[n.type]?je.defaults.extensions.childTokens[n.type].forEach((function(e){je.walkTokens(n[e],t)})):n.tokens&&je.walkTokens(n.tokens,t)}},je.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Te({},je.defaults,t||{}),Re(t);try{const n=_e.lexInline(e,t);return t.walkTokens&&je.walkTokens(n,t.walkTokens),Ee.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Ne(e.message+"",!0)+"
    ";throw e}},je.Parser=Ee,je.parser=Ee.parse,je.Renderer=Ce,je.TextRenderer=Ae,je.Lexer=_e,je.lexer=_e.lex,je.Tokenizer=Se,je.Slugger=Le,je.parse=je;var Oe=je;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Ie,qe={exports:{}};Ie=qe,function(e,t){Ie.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(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 a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return s(""===n?e[r-1]:n,o)}))}function c(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 l(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(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}));var Me=qe.exports,Fe=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){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(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!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)}function o(e,t,n,r,o,i){for(var s=("selectedIndex"in t),a=s;r>>0;ns;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,k=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=I(S),n=I("div");return n.innerHTML=''+e+"",O(t,n.firstChild.childNodes),t}:A)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function I(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,F,B,W,U,H,Z,V,Y=(M="appendChild",F="cloneNode",B="createTextNode",U=(W="importNode")in(q=e),(H=q.createDocumentFragment())[M](q[B]("g")),H[M](q[B]("")),(U?q[W](H,!0):H[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,s=0;n&&s

    ',Z.content.childNodes[0].getAttribute(V)==X)||(X="_dt: "+X.slice(1,-1)+";",G=!0)}catch(u){}var J="\x3c!--"+X+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+J+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+X+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=G?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;a{e.remove()})}function Xe(e,t="long"){const n=new Intl.ListFormat(o,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o)}}const Ge=Xe("conjunction"),Je=Xe("disjunction");function Qe(e,t){return Ge(e,t).join("")}function et(e){return e.trim().replace(/\s+/g," ")}function tt(e,t=o){return t=function(e){return{"zh-hans":"zh","zh-cn":"zh"}[e]||e}(t.toLowerCase()),new Proxy(e,{get(e,n){const r=e[t]&&e[t][n]||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function nt(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){yt(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function rt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map(e=>We`${e}, `);return We`${r}${n[n.length-1]}`}function ot(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(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||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);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function it(e){const t=new Set,n="ltNodefault"in e.dataset?"":et(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>et(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(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach(e=>t.add(et(e)))}return[...t]}function st(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function at(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");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 lt(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function ct(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 ut(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class dt 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 pt(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{st(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),ft(t),t}function ft(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...ht(t)])e.remove()}function*ht(e){for(;e.nextNode();)yield e.currentNode}class mt 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())}}class gt extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||ot(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:s,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:s,details:a,stack:n}}}function bt(e,t,n={}){const r={...n,isWarning:!1};_t("error",new gt(e,t,r))}function yt(e,t,n={}){const r={...n,isWarning:!0};_t("warn",new gt(e,t,r))}function wt(e){return e?`\`${e}\``:""}function vt(e,{quotes:t}={quotes:!1}){return Je(e,t?e=>{return wt((t=e,String(t)?`"${t}"`:""));var t}:wt).join("")}function kt(e,...t){return e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,i]=r.slice(1,-1).split("|");if(i){return`${e}[${o}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`}).join("")}const xt="core/pubsubhub",$t=new Map;function _t(e,...t){if(!$t.has(e))return;if(Array.from($t.get(e)).forEach(e=>{try{e(...t)}catch(t){bt(`Error when calling function ${e.name}.`,xt,{hint:"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 Et(e,t,n={once:!1}){return n.once?Et(e,(function n(...r){!function({topic:e,cb:t}){const n=$t.get(e);if(!n||!n.has(t))return console.warn("Already unsubscribed:",e,t),!1;n.delete(t)}({topic:e,cb:n}),t(...r)})):($t.has(e)?$t.get(e).add(t):$t.set(e,new Set([t])),{topic:e,cb:t})}t(xt,{sub:Et});const St=["githubToken","githubUser"];const Ct=new Map([["text/html","html"],["application/xml","xml"]]);function At(e,t=document){const n=Ct.get(e);if(!n){const t=[...Ct.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Lt(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Lt(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;ft(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar"),Ke(r);const o=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&o.appendChild(i);let s=e.querySelector("meta[charset], meta[content*='charset=']");s||(s=We``);o.appendChild(s);const a="ReSpec "+(window.respecVersion||"Developer Channel"),l=We` `;o.appendChild(l),t.prepend(o),_t("beforesave",r)}(n);let r="";switch(e){case"xml":r=(new XMLSerializer).serializeToString(n);break;default:!function(e){e.querySelectorAll("style").forEach(e=>{e.innerHTML=`\n${e.innerHTML}\n`}),e.querySelectorAll("head > *").forEach(e=>{e.outerHTML="\n"+e.outerHTML})}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML}return r}t("core/exporter",{rsDocToDataURL:At});class Tt{constructor(){this._respecDonePromise=new Promise(e=>{Et("end-all",e,{once:!0})}),this.errors=[],this.warnings=[],Et("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),Et("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Lt("html",document)}}const Rt="core/post-process";const Nt="core/pre-process";const zt="core/base-runner";async function Dt(e){!function(){const e=new Tt;Object.defineProperty(document,"respec",{value:e});let t=!1;Object.defineProperty(document,"respecIsReady",{get:()=>(t||(yt("`document.respecIsReady` is deprecated and will be removed in a future release.","core/respec-global",{hint:"Use `document.respec.ready` instead."}),t=!0),document.respec.ready)})}(),_t("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Et("amend-user-config",n),Et("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of St)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)})}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).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[n,o]}),r=Object.fromEntries(n);Object.assign(e,r),_t("amend-user-config",r)}(respecConfig),performance.mark(zt+"-start"),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||bt("Every item in `preProcess` must be a JS function.",Nt),t}).map(async t=>{try{return await t(e,document)}catch(e){bt(`Function ${t.name} threw an error during \`preProcess\`.`,Nt,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}}(respecConfig);const t=e.filter(e=>{return(t=e)&&(t.run||t.Plugin);var t});t.forEach(e=>!e.name&&console.warn("Plugin lacks name:",e)),respecConfig.state={},await async function(e,t){for(const n of e.filter(e=>e.prepare))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise(async(r,o)=>{const i=setTimeout(()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))},15e3);performance.mark(e+"-start");try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(i),performance.mark(e+"-end"),performance.measure(e,e+"-start",e+"-end")}})}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},_t("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter(e=>{const t="function"==typeof e;return t||bt("Every item in `postProcess` must be a JS function.",Rt),t}).map(async t=>{try{return await t(e,document)}catch(e){bt(`Function ${t.name} threw an error during \`postProcess\`.`,Rt,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),_t("end-all"),Ke(document),performance.mark(zt+"-end"),performance.measure(zt,zt+"-start",zt+"-end")}var Pt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} diff --git a/builds/respec-geonovum.js b/builds/respec-geonovum.js index 578eb61029..98c827f9c7 100644 --- a/builds/respec-geonovum.js +++ b/builds/respec-geonovum.js @@ -1,4 +1,4 @@ -window.respecVersion="26.12.1",function(){"use strict";const e=!!window.require;if(!e){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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},o=n.lang;var s=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:o,run:function(e){e.l10n=r[o]||r.en}});let i,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(l.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(c.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});c.set(e,t)}(e),t=e,(i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(g(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&l.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!y.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return v.set(t,s),s}f=(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}))(f);var x=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=g(i);return r&&i.addEventListener("upgradeneeded",e=>{r(g(i.result),e.oldVersion,e.newVersion,g(i.transaction))}),n&&i.addEventListener("blocked",()=>n()),a.then(e=>{s&&e.addEventListener("close",()=>s()),o&&e.addEventListener("versionchange",()=>o())}).catch(()=>{}),a},unwrap:b,wrap:g});const $=/^[!#$%&'*+-.^`|~\w]+$/,_=/[\u000A\u000D\u0009\u0020]/u,S=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function E(e,t,n){(t&&""!==t&&!e.has(t)&&S.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var C={exports:{}};function L(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}C.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:L,changeDefaults:function(e){C.exports.defaults=e}};const A=/[&<>"']/,T=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},j=e=>z[e];const I=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function P(e){return e.replace(I,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const O=/(^|[^\[])\^/g;const D=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const M={},B=/^[^:]+:\/*[^/]*$/,F=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function U(e,t){M[" "+e]||(B.test(e)?M[" "+e]=e+"/":M[" "+e]=H(e,"/",!0));const n=-1===(e=M[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(F,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(W,"$1")+t:e+t}function H(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o(r=(r=r.source||r).replace(O,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(P(n)).replace(D,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!q.test(n)&&(n=U(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:U,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:V}=C.exports,{rtrim:Z,splitCells:K,escape:J,findClosingBracket:X}=G;function Y(e,t,n){const r=t.href,o=t.title?J(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:o,text:s}:{type:"image",raw:n,href:r,title:o,text:J(s)}}var Q=class{constructor(e){this.options=e||V}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Z(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Z(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:K(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],r=n.length>1,o={type:"list",raw:e,ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]},s=t[0].match(this.rules.block.item);let i,a,l,c,u,d,p,f,h,m=!1,g=s.length;l=this.rules.block.listItemStart.exec(s[0]);for(let t=0;tl[1].length:c[1].length>=l[0].length||c[1].length>3){s.splice(t,2,s[t]+(!this.options.pedantic&&c[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):J(r[0]):r[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Z(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=X(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),Y(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Y(n,e,n[0])}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,s,i=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));)if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],o)if(s=o.length,r[3]||r[4])i+=s;else if(!((r[5]||r[6])&&n%3)||(n+s)%3){if(i-=s,!(i>0))return s=Math.min(s,s+i+a),Math.min(n,s)%2?{type:"em",raw:e.slice(0,n+r.index+s+1),text:e.slice(1,n+r.index+s)}:{type:"strong",raw:e.slice(0,n+r.index+s+1),text:e.slice(2,n+r.index+s-1)}}else a+=s}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=J(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=J(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=J(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=J(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=J(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const r=this.rules.inline.text.exec(e);if(r){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):J(r[0]):r[0]:J(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:e}}}};const{noopTest:ee,edit:te,merge:ne}=G,re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ee,table:ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=te(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,re.item=te(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.listItemStart=te(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=te(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/|$)/,re.html=te(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=te(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=te(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=ne({},re),re.gfm=ne({},re.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),re.gfm.nptable=te(re.gfm.nptable).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.table=te(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic=ne({},re.normal,{html:te("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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+|$)/,fences:ee,paragraph:te(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};oe.punctuation=te(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/\\\*|\\_/g,oe._comment=te(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=te(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=te(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=te(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=te(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=te(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=te(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=te(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=te(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=ne({},oe),oe.pedantic=ne({},oe.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=ne({},oe.normal,{escape:te(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}const{defaults:fe}=C.exports,{cleanUrl:he,escape:me}=G;var ge=class{constructor(e){this.options=e||fe}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:me(e,!0))+"
    \n":"
    "+(n?e:me(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},be=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},ye=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const we=ge,ve=be,ke=ye,{defaults:xe}=C.exports,{unescape:$e}=G;const _e=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ae,this.options.tokenizer=this.options.tokenizer||new ie,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:le.normal,inline:ce.normal};this.options.pedantic?(t.block=le.pedantic,t.inline=ce.pedantic):this.options.gfm&&(t.block=le.gfm,this.options.breaks?t.inline=ce.breaks:t.inline=ce.gfm),this.tokenizer.rules=t}static get rules(){return{block:le,inline:ce}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let r,o,s,i,a,l;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),i=t[t.length-1],i&&"paragraph"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),s=r.items.length,o=0;o=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(r=this.tokenizer.paragraph(a)))i=t[t.length-1],l&&"paragraph"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text):t.push(r),l=a.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),i=t[t.length-1],i&&"text"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,r,o,s,i;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(o=n.call(this,e,t))&&(e=e.substring(o.raw.length),t.push(o),!0))))if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,r))e=e.substring(o.raw.length),n=o.inLink,r=o.inRawBlock,s=t[t.length-1],s&&"text"===o.type&&"text"===s.type?(s.raw+=o.raw,s.text+=o.text):t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),s=t[t.length-1],"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,r),t.push(o)):s&&"text"===o.type&&"text"===s.type?(s.raw+=o.raw,s.text+=o.text):t.push(o);else if(o=this.tokenizer.emStrong(e,u,c))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.autolink(e,pe))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,pe))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call(this,n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(i,r,de))e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(c=o.raw.slice(-1)),l=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=o.raw,s.text+=o.text):t.push(o);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(o.raw.length),t.push(o);return t}},Se=class e{constructor(e){this.options=e||xe,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ve,this.slugger=new ke}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,o,s,i,a,l,c,u,d,p,f,h,m,g,b,y,w,v,k="";const x=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);k+=this.renderer.list(u,p,f);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1{r(e.text,e.lang,(function(t,n){if(t)return s(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),i--,0===i&&s()}))},0))})),void(0===i&&s())}try{const n=_e.lex(e,t);return t.walkTokens&&Pe.walkTokens(n,t.walkTokens),Se.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Re(e.message+"",!0)+"
    ";throw e}}Pe.options=Pe.setOptions=function(e){return Te(Pe.defaults,e),je(Pe.defaults),Pe},Pe.getDefaults=ze,Pe.defaults=Ie,Pe.use=function(...e){const t=Te({},...e),n=Pe.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=Pe.defaults.renderer||new Ce;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let s=e.renderer[t].apply(n,o);return!1===s&&(s=r.apply(n,o)),s}}t.renderer=n}if(e.tokenizer){const n=Pe.defaults.tokenizer||new Ee;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let s=e.tokenizer[t].apply(n,o);return!1===s&&(s=r.apply(n,o)),s}}t.tokenizer=n}if(e.walkTokens){const n=Pe.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}r&&(t.extensions=n),Pe.setOptions(t)})},Pe.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)Pe.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)Pe.walkTokens(n,t);break;case"list":Pe.walkTokens(n.items,t);break;default:Pe.defaults.extensions&&Pe.defaults.extensions.childTokens&&Pe.defaults.extensions.childTokens[n.type]?Pe.defaults.extensions.childTokens[n.type].forEach((function(e){Pe.walkTokens(n[e],t)})):n.tokens&&Pe.walkTokens(n.tokens,t)}},Pe.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Te({},Pe.defaults,t||{}),Ne(t);try{const n=_e.lexInline(e,t);return t.walkTokens&&Pe.walkTokens(n,t.walkTokens),Se.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Re(e.message+"",!0)+"
    ";throw e}},Pe.Parser=Se,Pe.parser=Se.parse,Pe.Renderer=Ce,Pe.TextRenderer=Le,Pe.Lexer=_e,Pe.lexer=_e.lex,Pe.Tokenizer=Ee,Pe.Slugger=Ae,Pe.parse=Pe;var Oe=Pe;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var De,qe={exports:{}};De=qe,function(e,t){De.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(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 a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return i(""===n?e[r-1]:n,o)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return l(t,s)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(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([s(t),n])},p.addSingularRule=function(e,n){t.push([s(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}));var Me=qe.exports,Be=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.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},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!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)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r>>0;ni;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,k=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=D(E),n=D("div");return n.innerHTML=''+e+"",O(t,n.firstChild.childNodes),t}:L)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function D(e){return e===E?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,B,F,W,U,H,G,V,Z=(M="appendChild",B="cloneNode",F="createTextNode",U=(W="importNode")in(q=e),(H=q.createDocumentFragment())[M](q[F]("g")),H[M](q[F]("")),(U?q[W](H,!0):H[B](!0)).childNodes.length<2?function e(t,n){for(var r=t[B](),o=t.childNodes||[],s=o.length,i=0;n&&i

    ',G.content.childNodes[0].getAttribute(V)==J)||(J="_dt: "+J.slice(1,-1)+";",X=!0)}catch(u){}var Y="\x3c!--"+J+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",se="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",ie=new RegExp(oe+re+se+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+se+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+Y+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+J+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=X?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a{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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},o=n.lang;var s=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:o,run:function(e){e.l10n=r[o]||r.en}});let i,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(l.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(c.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});c.set(e,t)}(e),t=e,(i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(g(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&l.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!y.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return v.set(t,s),s}f=(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}))(f);var x=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=g(i);return r&&i.addEventListener("upgradeneeded",e=>{r(g(i.result),e.oldVersion,e.newVersion,g(i.transaction))}),n&&i.addEventListener("blocked",()=>n()),a.then(e=>{s&&e.addEventListener("close",()=>s()),o&&e.addEventListener("versionchange",()=>o())}).catch(()=>{}),a},unwrap:b,wrap:g});const $=/^[!#$%&'*+-.^`|~\w]+$/,_=/[\u000A\u000D\u0009\u0020]/u,S=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function E(e,t,n){(t&&""!==t&&!e.has(t)&&S.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var C={exports:{}};function L(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}C.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:L,changeDefaults:function(e){C.exports.defaults=e}};const A=/[&<>"']/,T=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},j=e=>z[e];const I=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function P(e){return e.replace(I,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const O=/(^|[^\[])\^/g;const D=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const M={},B=/^[^:]+:\/*[^/]*$/,F=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function U(e,t){M[" "+e]||(B.test(e)?M[" "+e]=e+"/":M[" "+e]=H(e,"/",!0));const n=-1===(e=M[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(F,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(W,"$1")+t:e+t}function H(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o(r=(r=r.source||r).replace(O,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(P(n)).replace(D,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!q.test(n)&&(n=U(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:U,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:V}=C.exports,{rtrim:Z,splitCells:K,escape:J,findClosingBracket:X}=G;function Y(e,t,n){const r=t.href,o=t.title?J(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:o,text:s}:{type:"image",raw:n,href:r,title:o,text:J(s)}}var Q=class{constructor(e){this.options=e||V}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Z(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Z(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:K(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],r=n.length>1,o={type:"list",raw:e,ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]},s=t[0].match(this.rules.block.item);let i,a,l,c,u,d,p,f,h,m=!1,g=s.length;l=this.rules.block.listItemStart.exec(s[0]);for(let t=0;tl[1].length:c[1].length>=l[0].length||c[1].length>3){s.splice(t,2,s[t]+(!this.options.pedantic&&c[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):J(r[0]):r[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Z(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=X(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),Y(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Y(n,e,n[0])}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,s,i=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));)if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],o)if(s=o.length,r[3]||r[4])i+=s;else if(!((r[5]||r[6])&&n%3)||(n+s)%3){if(i-=s,!(i>0))return s=Math.min(s,s+i+a),Math.min(n,s)%2?{type:"em",raw:e.slice(0,n+r.index+s+1),text:e.slice(1,n+r.index+s)}:{type:"strong",raw:e.slice(0,n+r.index+s+1),text:e.slice(2,n+r.index+s-1)}}else a+=s}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=J(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=J(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=J(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=J(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=J(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const r=this.rules.inline.text.exec(e);if(r){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):J(r[0]):r[0]:J(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:e}}}};const{noopTest:ee,edit:te,merge:ne}=G,re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ee,table:ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=te(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,re.item=te(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.listItemStart=te(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=te(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/|$)/,re.html=te(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=te(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=te(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=ne({},re),re.gfm=ne({},re.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),re.gfm.nptable=te(re.gfm.nptable).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.table=te(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic=ne({},re.normal,{html:te("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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+|$)/,fences:ee,paragraph:te(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};oe.punctuation=te(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/\\\*|\\_/g,oe._comment=te(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=te(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=te(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=te(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=te(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=te(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=te(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=te(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=te(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=ne({},oe),oe.pedantic=ne({},oe.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=ne({},oe.normal,{escape:te(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}const{defaults:fe}=C.exports,{cleanUrl:he,escape:me}=G;var ge=class{constructor(e){this.options=e||fe}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:me(e,!0))+"
    \n":"
    "+(n?e:me(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=he(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},be=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},ye=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const we=ge,ve=be,ke=ye,{defaults:xe}=C.exports,{unescape:$e}=G;const _e=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ae,this.options.tokenizer=this.options.tokenizer||new ie,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:le.normal,inline:ce.normal};this.options.pedantic?(t.block=le.pedantic,t.inline=ce.pedantic):this.options.gfm&&(t.block=le.gfm,this.options.breaks?t.inline=ce.breaks:t.inline=ce.gfm),this.tokenizer.rules=t}static get rules(){return{block:le,inline:ce}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let r,o,s,i,a,l;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),i=t[t.length-1],i&&"paragraph"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),s=r.items.length,o=0;o=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(r=this.tokenizer.paragraph(a)))i=t[t.length-1],l&&"paragraph"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text):t.push(r),l=a.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),i=t[t.length-1],i&&"text"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,r,o,s,i;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+ue("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(o=n.call(this,e,t))&&(e=e.substring(o.raw.length),t.push(o),!0))))if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,r))e=e.substring(o.raw.length),n=o.inLink,r=o.inRawBlock,s=t[t.length-1],s&&"text"===o.type&&"text"===s.type?(s.raw+=o.raw,s.text+=o.text):t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),s=t[t.length-1],"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,r),t.push(o)):s&&"text"===o.type&&"text"===s.type?(s.raw+=o.raw,s.text+=o.text):t.push(o);else if(o=this.tokenizer.emStrong(e,u,c))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.autolink(e,pe))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,pe))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call(this,n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(i,r,de))e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(c=o.raw.slice(-1)),l=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=o.raw,s.text+=o.text):t.push(o);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(o.raw.length),t.push(o);return t}},Se=class e{constructor(e){this.options=e||xe,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ve,this.slugger=new ke}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,o,s,i,a,l,c,u,d,p,f,h,m,g,b,y,w,v,k="";const x=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);k+=this.renderer.list(u,p,f);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1{r(e.text,e.lang,(function(t,n){if(t)return s(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),i--,0===i&&s()}))},0))})),void(0===i&&s())}try{const n=_e.lex(e,t);return t.walkTokens&&Pe.walkTokens(n,t.walkTokens),Se.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Re(e.message+"",!0)+"
    ";throw e}}Pe.options=Pe.setOptions=function(e){return Te(Pe.defaults,e),je(Pe.defaults),Pe},Pe.getDefaults=ze,Pe.defaults=Ie,Pe.use=function(...e){const t=Te({},...e),n=Pe.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=Pe.defaults.renderer||new Ce;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let s=e.renderer[t].apply(n,o);return!1===s&&(s=r.apply(n,o)),s}}t.renderer=n}if(e.tokenizer){const n=Pe.defaults.tokenizer||new Ee;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let s=e.tokenizer[t].apply(n,o);return!1===s&&(s=r.apply(n,o)),s}}t.tokenizer=n}if(e.walkTokens){const n=Pe.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}r&&(t.extensions=n),Pe.setOptions(t)})},Pe.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)Pe.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)Pe.walkTokens(n,t);break;case"list":Pe.walkTokens(n.items,t);break;default:Pe.defaults.extensions&&Pe.defaults.extensions.childTokens&&Pe.defaults.extensions.childTokens[n.type]?Pe.defaults.extensions.childTokens[n.type].forEach((function(e){Pe.walkTokens(n[e],t)})):n.tokens&&Pe.walkTokens(n.tokens,t)}},Pe.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Te({},Pe.defaults,t||{}),Ne(t);try{const n=_e.lexInline(e,t);return t.walkTokens&&Pe.walkTokens(n,t.walkTokens),Se.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Re(e.message+"",!0)+"
    ";throw e}},Pe.Parser=Se,Pe.parser=Se.parse,Pe.Renderer=Ce,Pe.TextRenderer=Le,Pe.Lexer=_e,Pe.lexer=_e.lex,Pe.Tokenizer=Ee,Pe.Slugger=Ae,Pe.parse=Pe;var Oe=Pe;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var De,qe={exports:{}};De=qe,function(e,t){De.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(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 a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return i(""===n?e[r-1]:n,o)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return l(t,s)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(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([s(t),n])},p.addSingularRule=function(e,n){t.push([s(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}));var Me=qe.exports,Be=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.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},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!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)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r>>0;ni;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,k=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=D(E),n=D("div");return n.innerHTML=''+e+"",O(t,n.firstChild.childNodes),t}:L)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function D(e){return e===E?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,B,F,W,U,H,G,V,Z=(M="appendChild",B="cloneNode",F="createTextNode",U=(W="importNode")in(q=e),(H=q.createDocumentFragment())[M](q[F]("g")),H[M](q[F]("")),(U?q[W](H,!0):H[B](!0)).childNodes.length<2?function e(t,n){for(var r=t[B](),o=t.childNodes||[],s=o.length,i=0;n&&i

    ',G.content.childNodes[0].getAttribute(V)==J)||(J="_dt: "+J.slice(1,-1)+";",X=!0)}catch(u){}var Y="\x3c!--"+J+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",se="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",ie=new RegExp(oe+re+se+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+se+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+Y+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+J+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=X?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a{e.remove()})}function Ke(e,t="long"){const n=new Intl.ListFormat(o,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o)}}const Je=Ke("conjunction"),Xe=Ke("disjunction");function Ye(e,t){return Je(e,t).join("")}function Qe(e){return e.trim().replace(/\s+/g," ")}function et(e,t=o){return t=function(e){return{"zh-hans":"zh","zh-cn":"zh"}[e]||e}(t.toLowerCase()),new Proxy(e,{get(e,n){const r=e[t]&&e[t][n]||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function tt(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){bt(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function nt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map(e=>We`${e}, `);return We`${r}${n[n.length-1]}`}function rt(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(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||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);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function ot(e){const t=new Set,n="ltNodefault"in e.dataset?"":Qe(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>Qe(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(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach(e=>t.add(Qe(e)))}return[...t]}function st(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function it(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");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 at(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function lt(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 ct(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class ut 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 dt(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{st(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),pt(t),t}function pt(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...ft(t)])e.remove()}function*ft(e){for(;e.nextNode();)yield e.currentNode}class ht 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())}}class mt extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||rt(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n}}}function gt(e,t,n={}){const r={...n,isWarning:!1};_t("error",new mt(e,t,r))}function bt(e,t,n={}){const r={...n,isWarning:!0};_t("warn",new mt(e,t,r))}function yt(e){return e?`\`${e}\``:""}function wt(e,{quotes:t}={quotes:!1}){return Xe(e,t?e=>yt(vt(e)):yt).join("")}function vt(e){return String(e)?`"${e}"`:""}function kt(e,...t){return e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,s]=r.slice(1,-1).split("|");if(s){return`${e}[${o}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`}).join("")}const xt="core/pubsubhub",$t=new Map;function _t(e,...t){if(!$t.has(e))return;if(Array.from($t.get(e)).forEach(e=>{try{e(...t)}catch(t){gt(`Error when calling function ${e.name}.`,xt,{hint:"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 St(e,t,n={once:!1}){return n.once?St(e,(function n(...r){!function({topic:e,cb:t}){const n=$t.get(e);if(!n||!n.has(t))return console.warn("Already unsubscribed:",e,t),!1;n.delete(t)}({topic:e,cb:n}),t(...r)})):($t.has(e)?$t.get(e).add(t):$t.set(e,new Set([t])),{topic:e,cb:t})}t(xt,{sub:St});const Et=["githubToken","githubUser"];const Ct=new Map([["text/html","html"],["application/xml","xml"]]);function Lt(e,t=document){const n=Ct.get(e);if(!n){const t=[...Ct.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=At(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function At(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;pt(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar"),Ze(r);const o=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&o.appendChild(s);let i=e.querySelector("meta[charset], meta[content*='charset=']");i||(i=We``);o.appendChild(i);const a="ReSpec "+(window.respecVersion||"Developer Channel"),l=We` `;o.appendChild(l),t.prepend(o),_t("beforesave",r)}(n);let r="";switch(e){case"xml":r=(new XMLSerializer).serializeToString(n);break;default:!function(e){e.querySelectorAll("style").forEach(e=>{e.innerHTML=`\n${e.innerHTML}\n`}),e.querySelectorAll("head > *").forEach(e=>{e.outerHTML="\n"+e.outerHTML})}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML}return r}t("core/exporter",{rsDocToDataURL:Lt});class Tt{constructor(){this._respecDonePromise=new Promise(e=>{St("end-all",e,{once:!0})}),this.errors=[],this.warnings=[],St("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),St("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return At("html",document)}}const Nt="core/post-process";const Rt="core/pre-process";const zt="core/base-runner";async function jt(e){!function(){const e=new Tt;Object.defineProperty(document,"respec",{value:e});let t=!1;Object.defineProperty(document,"respecIsReady",{get:()=>(t||(bt("`document.respecIsReady` is deprecated and will be removed in a future release.","core/respec-global",{hint:"Use `document.respec.ready` instead."}),t=!0),document.respec.ready)})}(),_t("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),St("amend-user-config",n),St("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of Et)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)})}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).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[n,o]}),r=Object.fromEntries(n);Object.assign(e,r),_t("amend-user-config",r)}(respecConfig),performance.mark(zt+"-start"),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||gt("Every item in `preProcess` must be a JS function.",Rt),t}).map(async t=>{try{return await t(e,document)}catch(e){gt(`Function ${t.name} threw an error during \`preProcess\`.`,Rt,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}}(respecConfig);const t=e.filter(e=>{return(t=e)&&(t.run||t.Plugin);var t});t.forEach(e=>!e.name&&console.warn("Plugin lacks name:",e)),respecConfig.state={},await async function(e,t){for(const n of e.filter(e=>e.prepare))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise(async(r,o)=>{const s=setTimeout(()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))},15e3);performance.mark(e+"-start");try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(s),performance.mark(e+"-end"),performance.measure(e,e+"-start",e+"-end")}})}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},_t("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter(e=>{const t="function"==typeof e;return t||gt("Every item in `postProcess` must be a JS function.",Nt),t}).map(async t=>{try{return await t(e,document)}catch(e){gt(`Function ${t.name} threw an error during \`postProcess\`.`,Nt,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),_t("end-all"),Ze(document),performance.mark(zt+"-end"),performance.measure(zt,zt+"-start",zt+"-end")}var It=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} diff --git a/builds/respec-w3c.js b/builds/respec-w3c.js index 2f31e31288..dbb13db1e9 100644 --- a/builds/respec-w3c.js +++ b/builds/respec-w3c.js @@ -1,5 +1,5 @@ -window.respecVersion="26.12.1",function(){"use strict";const e=!!window.require;if(!e){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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},s=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:s,run:function(e){e.l10n=r[s]||r.en}});let o,a;const c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(c.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(l.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});l.set(e,t)}(e),t=e,(o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&c.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),s&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}))(f);var $=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=g(o);return r&&o.addEventListener("upgradeneeded",e=>{r(g(o.result),e.oldVersion,e.newVersion,g(o.transaction))}),n&&o.addEventListener("blocked",()=>n()),a.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",()=>s())}).catch(()=>{}),a},unwrap:b,wrap:g});function x(e,t,n,r,s,{level:i="error",autofix:o,ruleName:a}={}){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 s=n.map(e=>e.trivia+e.value).join(""),i=e[t];return"eof"===i.type?s:r?s+i.trivia:s.slice(i.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?" in "+e.name:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map(e=>function(e,t){let n=e;return t&&(n+=" "+t),n}(e.type,e.name)).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:i,ruleName:a,autofix:o,input:f,tokens:p}}function _(e,t,n,r){return x(e,t,n,r,"Syntax")}function C(e,t,n,r,s={}){return s.ruleName=n,x(t.source,e.index,t,r,"Validation",s)}class S{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},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 E(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 s=E(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=E(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function T(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some(e=>e.required);if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?T(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class R extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class A extends S{static parser(e,t){return()=>{const n=e.consumeType(t);if(n)return new A({source:e.source,tokens:{value:n}})}}get value(){return G(this.tokens.value.value)}}function L(e,t){return V(e,{parser:A.parser(e,t),listName:t+" list"})}const P=["identifier","decimal","integer","string"],I=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map(e=>[e,"Legacy"+e]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function D(e){for(const t of P){const n=L(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class N extends S{static parse(e){const t={assign:e.consume("=")},n=se(new N({source:e.source,tokens:t}));return t.assign&&(t.secondaryName=e.consumeType(...P)),t.open=e.consume("("),t.open?(n.list=n.rhsIsList?D(e):K(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}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list?this.list.map(n=>{return"identifier-list"===t?e.identifier(n,this.parent):t&&t.endsWith("-list")?(r=n,e.ts.wrap([e.token(r.tokens.value),e.token(r.tokens.separator)])):n.write(e);var r}):[],e.token(this.tokens.close)])}}class O extends S{static parse(e){const t=e.consumeType("identifier");if(t)return new O({source:e.source,tokens:{name:t},params:N.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;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:G(t.secondaryName.value)}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` 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 C(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(I.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${I.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/heycam/webidl/pull/870) for more information.`;yield C(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=I.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class j extends R{static parse(e){const t={};if(t.open=e.consume("["),!t.open)return new j({});const n=new j({source:e.source,tokens:t});return n.push(...V(e,{parser:O.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)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map(t=>t.write(e)),e.token(this.tokens.close)]):""}}function z(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function W(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=se(new M({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error("No opening bracket after "+n.value),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=Q(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=X(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...ae)||e.error("Record key must be one of: "+ae.join(", ")),s=new M({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const i=X(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,i);break}}return r.idlType||e.error("Error parsing generic type "+n.value),r.tokens.close=e.consume(">")||e.error("Missing closing bracket after "+n.value),r.this}(e,t)||J(e);if(!n){const t=e.consumeType("identifier")||e.consume(...ae,...oe);if(!t)return;n=new M({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,z(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class M extends S{static parse(e,t){return W(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=se(new M({source:e.source,tokens:n}));for(r.type=t||null;;){const t=X(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"),z(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new j({})}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 G([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter(e=>e).map(e=>e.value).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/heycam/webidl/issues/60) for more information.";yield C(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=E(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield C(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map(t=>t.write(e)),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}class q extends S{static parse(e){const t=e.consume("=");if(!t)return null;const n=Z(e)||e.consumeType("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new q({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 Y(this.expression[0]).type}get value(){return Y(this.expression[0]).value}get negative(){return Y(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map(t=>e.token(t))])}}class U extends S{static parse(e){const t=e.position,n={},r=se(new U({source:e.source,tokens:n}));return r.extAttrs=j.parse(e),n.optional=e.consume("optional"),r.idlType=X(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeType("identifier")||e.consume(...ce),n.name?(r.default=n.optional?q.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 G(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=E(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield C(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 C(this.tokens.name,this,"dict-arg-default",e,{autofix:F(this)})}}else if(this.parent&&!T(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e);return!t.slice(n+1).some(e=>!e.optional)}(this)){const e="Dictionary argument must be optional if it has no required fields";yield C(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=re(n.idlType);n.tokens.optional={type:"optional",value:"optional",trivia:e.trivia},e.trivia=" ",F(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function F(e){return()=>{e.default=q.parse(new pe(" = {}"))}}class B extends S{static parse(e,{special:t,regular:n}={}){const r={special:t},s=se(new B({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=Q(e)||e.error("Missing return type"),r.name=e.consumeType("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=K(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?G(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield C(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class H extends S{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,i={special:t},o=se(new H({source:e.source,tokens:i}));if(t||n||(i.special=e.consume("inherit")),"inherit"===o.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)return o.idlType=X(e,"attribute-type")||e.error("Attribute lacks a type"),i.name=e.consumeType("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),i.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),o.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return G(this.tokens.name.value)}*validate(e){switch(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),this.idlType.generic){case"sequence":case"record":{const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield C(this.tokens.name,this,"attr-invalid-type",e);break}default:{const{reference:t}=E(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield C(e,this,"attr-invalid-type",n)}}}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function G(e){return e.startsWith("_")?e.slice(1):e}function V(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const i=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error("Trailing comma in "+r);break}if(s.tokens.separator=e.consume(","),i.push(s),!s.tokens.separator)break}return i}function Z(e){return e.consumeType("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function Y({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function J(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new M({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new M({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new M({source:t,tokens:{base:r}}):void 0}function K(e){return V(e,{parser:U.parse,listName:"arguments list"})}function X(e,t){const n=j.parse(e),r=M.parse(e,t);return r&&(se(r).extAttrs=n),r}function Q(e,t){const n=M.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new M({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ee(e){const t=e.consume("stringifier");if(!t)return;return H.parse(e,{special:t})||B.parse(e,{special:t})||e.error("Unterminated stringifier")}function te(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function ne(e){return()=>{if(e.extAttrs.length){const t=new pe("Exposed=Window,"),n=O.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{se(e).extAttrs=j.parse(new pe("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia="\n"+te(t)}}}function re(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return re(e.idlType);return Object.values(e.tokens).sort((e,t)=>e.index-t.index)[0]}function se(e,t){return t||(t=e),e?new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)?se(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 ie={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:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},oe=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","Float32Array","Float64Array","any","object","symbol"],ae=["ByteString","DOMString","USVString"],ce=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],le=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(ce,ae,oe),ue=["(",")",",","...",":",";","<","=",">","?","[","]","{","}"],de=["_constructor","toString","_toString"];class pe{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,i=0;for(;nthis.position&&this.source[this.position].type===e}probe(e){return this.probeType("inline")&&this.source[this.position].value===e}consumeType(...e){for(const t of e){if(!this.probeType(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeType("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}unconsume(e){this.position=e}}class fe extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:i,tokens:o}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=i,this.tokens=o}}class he extends A{static parse(e){const t=e.consumeType("string");if(t)return new he({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class me extends S{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeType("identifier")||e.error("No name for enum");const n=se(new me({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=V(e,{parser:he.parse,allowDangler:!0,listName:"enumeration"}),e.probeType("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 G(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class ge extends S{static parse(e){const t=e.consumeType("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeType("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new ge({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return G(this.tokens.target.value)}get includes(){return G(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class be extends S{static parse(e){const t={},n=se(new be({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=X(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeType("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 G(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class ye extends S{static parse(e,t){const n={base:t},r=se(new ye({source:e.source,tokens:n}));return n.name=e.consumeType("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=Q(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=K(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 G(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map(t=>t.write(e)),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class we extends S{static parse(e,t,{type:n,inheritable:r,allowedMembers:s}){const{tokens:i}=t;for(i.name=e.consumeType("identifier")||e.error("Missing name in "+t.type),e.current=t,t=se(t),r&&Object.assign(i,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeType("identifier")||e.error("Inheritance lacks a type")}:{}}(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=j.parse(e);let o;for(const[t,...n]of s)if(o=se(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=r,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return G(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?G(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class ve extends S{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=J(e);if(!n){const t=e.consumeType("identifier")||e.error("Const lacks a type");n=new M({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeType("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=Z(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new ve({source:e.source,tokens:t});return se(r).idlType=n,r}get type(){return"const"}get name(){return G(this.tokens.name.value)}get value(){return Y(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class ke extends S{static parse(e){const t=e.position,n={},r=se(new ke({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:s}=r,i="maplike"===s,o=i||"iterable"===s,a=r.async&&"iterable"===s;n.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=X(e)||e.error(`Missing a type argument in ${s} declaration`);return r.idlType=[c],r.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?r.idlType.push(X(e)):i&&e.error(`Missing second type argument in ${s} declaration`)),n.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(n.argsOpen=e.consume("("),r.arguments.push(...K(e)),n.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),n.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),r.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class $e extends S{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=K(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new $e({source:e.source,tokens:n});return se(s).arguments=r,s}get type(){return"constructor"}*validate(e){this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function xe(e){const t=e.consume("static");if(!t)return;return H.parse(e,{special:t})||B.parse(e,{special:t})||e.error("No body in static member")}class _e extends we{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return we.parse(e,new _e({source:e.source,tokens:r}),{type:"interface",inheritable:!n,allowedMembers:[[ve.parse],[$e.parse],[xe],[ee],[ke.parse],[H.parse],[B.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every(e=>"Exposed"!==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 C(this.tokens.name,this,"require-exposed",e,{autofix:ne(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 C(e.tokens.name,this,"constructor-member",t,{autofix:Ce(this,e)})}if(this.extAttrs.some(e=>"Global"===e.name)){const e=this.extAttrs.filter(e=>"LegacyFactoryFunction"===e.name);for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield C(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 C(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=new Set(o(t).map(e=>e.name)),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=o(e);yield*i(r,n,e,t);for(const e of r)n.add(e.name)}function*i(e,t,n,r){for(const s of e){const{name:e}=s;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 C(s.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter(({type:e})=>"operation"===e)}}(e,this))}}function Ce(e,t){return e=se(e),()=>{const n=te(e.extAttrs.tokens.open.trivia),r=e.members.length?te(re(e.members[0]).trivia):function(e){const t=te(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=$e.parse(new pe(`\n${r}constructor();`));s.extAttrs=new j({}),se(s).arguments=t.arguments;const i=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,e=>"constructor"===e.type);e.members.splice(i+1,0,s);const{close:o}=e.tokens;o.trivia.includes("\n")||(o.trivia+="\n"+n);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class Se extends we{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return we.parse(e,new Se({source:e.source,tokens:r}),{type:"interface mixin",allowedMembers:[[ve.parse],[ee],[H.parse,{noInherit:!0}],[B.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Ee extends S{static parse(e){const t={},n=se(new Ee({source:e.source,tokens:t}));return n.extAttrs=j.parse(e),t.required=e.consume("required"),n.idlType=X(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeType("identifier")||e.error("Dictionary member lacks a name"),n.default=q.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 G(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class Te extends we{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return we.parse(e,new Te({source:e.source,tokens:n}),{type:"dictionary",inheritable:!t,allowedMembers:[[Ee.parse]]})}get type(){return"dictionary"}}class Re extends we{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return we.parse(e,new Re({source:e.source,tokens:n}),{type:"namespace",allowedMembers:[[H.parse,{noInherit:!0,readonly:!0}],[ve.parse],[B.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 C(this.tokens.name,this,"require-exposed",e,{autofix:ne(this)})}yield*super.validate(e)}}class Ae extends we{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return we.parse(e,new Ae({source:e.source,tokens:r}),{type:"callback interface",inheritable:!n,allowedMembers:[[ve.parse],[B.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Le(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function i(t){const n=s("interface");if(!n)return;return Se.parse(e,n,t)||_e.parse(e,n,t)||r("Interface has no proper body")}function o(){return function(){const t=s("callback");if(t)return e.probe("interface")?Ae.parse(e,t):ye.parse(e,t)}()||i()||function(){const t=s("partial");if(t)return Te.parse(e,{partial:t})||i({partial:t})||Re.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Te.parse(e)||me.parse(e)||be.parse(e)||ge.parse(e)||Re.parse(e)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=j.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}se(n).extAttrs=t,s.push(n)}const i=e.consumeType("eof");return t.concrete&&s.push(i),s}();return e.positione.join(""),trivia:Pe,name:Pe,reference:Pe,type:Pe,generic:Pe,nameless:Pe,inheritance:Pe,definition:Pe,extendedAttribute:Pe,extendedAttributeReference:Pe};class De{constructor(e){this.ts=Object.assign({},Ie,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=Pe,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function Ne(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 s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Oe(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:Ne(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({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 C(n.tokens.name,n,"no-duplicate",r)}}(t)}var je=Object.freeze({__proto__:null,parse:function(e,t={}){const n=new pe(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Le(n,t)},write:function(e,{templates:t=Ie}={}){t=Object.assign({},Ie,t);const n=new De(t);return t.wrap(e.map((function(e){return"eof"===e.type?t.trivia(e.trivia):e.write(n)})))},validate:function(e){return[...Oe((t=e,t.flat?t.flat():[].concat(...t)))];var t},WebIDLParseError:fe});const ze=/^[!#$%&'*+-.^`|~\w]+$/,We=/[\u000A\u000D\u0009\u0020]/u,Me=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function qe(e,t,n){(t&&""!==t&&!e.has(t)&&Me.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var Ue={exports:{}};function Fe(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Ue.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:Fe,changeDefaults:function(e){Ue.exports.defaults=e}};const Be=/[&<>"']/,He=/[&<>"']/g,Ge=/[<>"']|&(?!#?\w+;)/,Ve=/[<>"']|&(?!#?\w+;)/g,Ze={"&":"&","<":"<",">":">",'"':""","'":"'"},Ye=e=>Ze[e];const Je=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Ke(e){return e.replace(Je,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const Xe=/(^|[^\[])\^/g;const Qe=/[^\w:]/g,et=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const tt={},nt=/^[^:]+:\/*[^/]*$/,rt=/^([^:]+:)[\s\S]*$/,st=/^([^:]+:\/*[^/]*)[\s\S]*$/;function it(e,t){tt[" "+e]||(nt.test(e)?tt[" "+e]=e+"/":tt[" "+e]=ot(e,"/",!0));const n=-1===(e=tt[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(rt,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(st,"$1")+t:e+t}function ot(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s(r=(r=r.source||r).replace(Xe,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(Ke(n)).replace(Qe,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!et.test(n)&&(n=it(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:it,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:ct}=Ue.exports,{rtrim:lt,splitCells:ut,escape:dt,findClosingBracket:pt}=at;function ft(e,t,n){const r=t.href,s=t.title?dt(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:s,text:i}:{type:"image",raw:n,href:r,title:s,text:dt(i)}}var ht=class{constructor(e){this.options=e||ct}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:lt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=lt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:ut(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],r=n.length>1,s={type:"list",raw:e,ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]},i=t[0].match(this.rules.block.item);let o,a,c,l,u,d,p,f,h,m=!1,g=i.length;c=this.rules.block.listItemStart.exec(i[0]);for(let t=0;tc[1].length:l[1].length>=c[0].length||l[1].length>3){i.splice(t,2,i[t]+(!this.options.pedantic&&l[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):dt(r[0]):r[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=lt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=pt(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),ft(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ft(n,e,n[0])}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const s=r[1]||r[2]||"";if(!s||s&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let s,i,o=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));)if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],s)if(i=s.length,r[3]||r[4])o+=i;else if(!((r[5]||r[6])&&n%3)||(n+i)%3){if(o-=i,!(o>0))return i=Math.min(i,i+o+a),Math.min(n,i)%2?{type:"em",raw:e.slice(0,n+r.index+i+1),text:e.slice(1,n+r.index+i)}:{type:"strong",raw:e.slice(0,n+r.index+i+1),text:e.slice(2,n+r.index+i-1)}}else a+=i}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=dt(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=dt(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=dt(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=dt(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=dt(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const r=this.rules.inline.text.exec(e);if(r){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):dt(r[0]):r[0]:dt(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:e}}}};const{noopTest:mt,edit:gt,merge:bt}=at,yt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:mt,table:mt,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};yt.def=gt(yt.def).replace("label",yt._label).replace("title",yt._title).getRegex(),yt.bullet=/(?:[*+-]|\d{1,9}[.)])/,yt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,yt.item=gt(yt.item,"gm").replace(/bull/g,yt.bullet).getRegex(),yt.listItemStart=gt(/^( *)(bull) */).replace("bull",yt.bullet).getRegex(),yt.list=gt(yt.list).replace(/bull/g,yt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+yt.def.source+")").getRegex(),yt._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",yt._comment=/|$)/,yt.html=gt(yt.html,"i").replace("comment",yt._comment).replace("tag",yt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yt.paragraph=gt(yt._paragraph).replace("hr",yt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",yt._tag).getRegex(),yt.blockquote=gt(yt.blockquote).replace("paragraph",yt.paragraph).getRegex(),yt.normal=bt({},yt),yt.gfm=bt({},yt.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),yt.gfm.nptable=gt(yt.gfm.nptable).replace("hr",yt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",yt._tag).getRegex(),yt.gfm.table=gt(yt.gfm.table).replace("hr",yt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",yt._tag).getRegex(),yt.pedantic=bt({},yt.normal,{html:gt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",yt._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+|$)/,fences:mt,paragraph:gt(yt.normal._paragraph).replace("hr",yt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",yt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const wt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:mt,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:mt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};wt.punctuation=gt(wt.punctuation).replace(/punctuation/g,wt._punctuation).getRegex(),wt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,wt.escapedEmSt=/\\\*|\\_/g,wt._comment=gt(yt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),wt.emStrong.lDelim=gt(wt.emStrong.lDelim).replace(/punct/g,wt._punctuation).getRegex(),wt.emStrong.rDelimAst=gt(wt.emStrong.rDelimAst,"g").replace(/punct/g,wt._punctuation).getRegex(),wt.emStrong.rDelimUnd=gt(wt.emStrong.rDelimUnd,"g").replace(/punct/g,wt._punctuation).getRegex(),wt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,wt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,wt._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])?)+(?![-_])/,wt.autolink=gt(wt.autolink).replace("scheme",wt._scheme).replace("email",wt._email).getRegex(),wt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,wt.tag=gt(wt.tag).replace("comment",wt._comment).replace("attribute",wt._attribute).getRegex(),wt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,wt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,wt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,wt.link=gt(wt.link).replace("label",wt._label).replace("href",wt._href).replace("title",wt._title).getRegex(),wt.reflink=gt(wt.reflink).replace("label",wt._label).getRegex(),wt.reflinkSearch=gt(wt.reflinkSearch,"g").replace("reflink",wt.reflink).replace("nolink",wt.nolink).getRegex(),wt.normal=bt({},wt),wt.pedantic=bt({},wt.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:gt(/^!?\[(label)\]\((.*?)\)/).replace("label",wt._label).getRegex(),reflink:gt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wt._label).getRegex()}),wt.gfm=bt({},wt.normal,{escape:gt(wt.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}const{defaults:Tt}=Ue.exports,{cleanUrl:Rt,escape:At}=at;var Lt=class{constructor(e){this.options=e||Tt}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:At(e,!0))+"
    \n":"
    "+(n?e:At(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=Rt(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=Rt(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},Pt=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},It=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const Dt=Lt,Nt=Pt,Ot=It,{defaults:jt}=Ue.exports,{unescape:zt}=at;const Wt=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$t,this.options.tokenizer=this.options.tokenizer||new kt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:xt.normal,inline:_t.normal};this.options.pedantic?(t.block=xt.pedantic,t.inline=_t.pedantic):this.options.gfm&&(t.block=xt.gfm,this.options.breaks?t.inline=_t.breaks:t.inline=_t.gfm),this.tokenizer.rules=t}static get rules(){return{block:xt,inline:_t}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let r,s,i,o,a,c;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),o=t[t.length-1],o&&"paragraph"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),i=r.items.length,s=0;s=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(r=this.tokenizer.paragraph(a)))o=t[t.length-1],c&&"paragraph"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r),c=a.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),o=t[t.length-1],o&&"text"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,r,s,i,o;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+Ct("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+Ct("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(s=n.call(this,e,t))&&(e=e.substring(s.raw.length),t.push(s),!0))))if(s=this.tokenizer.escape(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.tag(e,n,r))e=e.substring(s.raw.length),n=s.inLink,r=s.inRawBlock,i=t[t.length-1],i&&"text"===s.type&&"text"===i.type?(i.raw+=s.raw,i.text+=s.text):t.push(s);else if(s=this.tokenizer.link(e))e=e.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,r)),t.push(s);else if(s=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(s.raw.length),i=t[t.length-1],"link"===s.type?(s.tokens=this.inlineTokens(s.text,[],!0,r),t.push(s)):i&&"text"===s.type&&"text"===i.type?(i.raw+=s.raw,i.text+=s.text):t.push(s);else if(s=this.tokenizer.emStrong(e,u,l))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,r),t.push(s);else if(s=this.tokenizer.codespan(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.br(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.del(e))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,r),t.push(s);else if(s=this.tokenizer.autolink(e,Et))e=e.substring(s.raw.length),t.push(s);else if(n||!(s=this.tokenizer.url(e,Et))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call(this,n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(s=this.tokenizer.inlineText(o,r,St))e=e.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(l=s.raw.slice(-1)),c=!0,i=t[t.length-1],i&&"text"===i.type?(i.raw+=s.raw,i.text+=s.text):t.push(s);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(s.raw.length),t.push(s);return t}},Mt=class e{constructor(e){this.options=e||jt,this.options.renderer=this.options.renderer||new Dt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Nt,this.slugger=new Ot}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,s,i,o,a,c,l,u,d,p,f,h,m,g,b,y,w,v,k="";const $=e.length;for(n=0;n<$;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call(this,d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))k+=v||"";else switch(d.type){case"space":continue;case"hr":k+=this.renderer.hr();continue;case"heading":k+=this.renderer.heading(this.parseInline(d.tokens),d.depth,zt(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":k+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(l="",c="",i=d.header.length,r=0;r0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);k+=this.renderer.list(u,p,f);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<$&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);k+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return k}parseInline(e,t){t=t||this.renderer;let n,r,s,i="";const o=e.length;for(n=0;n{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),o--,0===o&&i()}))},0))})),void(0===o&&i())}try{const n=Wt.lex(e,t);return t.walkTokens&&Kt.walkTokens(n,t.walkTokens),Mt.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Vt(e.message+"",!0)+"
    ";throw e}}Kt.options=Kt.setOptions=function(e){return Ht(Kt.defaults,e),Yt(Kt.defaults),Kt},Kt.getDefaults=Zt,Kt.defaults=Jt,Kt.use=function(...e){const t=Ht({},...e),n=Kt.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=Kt.defaults.renderer||new Ut;for(const t in e.renderer){const r=n[t];n[t]=(...s)=>{let i=e.renderer[t].apply(n,s);return!1===i&&(i=r.apply(n,s)),i}}t.renderer=n}if(e.tokenizer){const n=Kt.defaults.tokenizer||new qt;for(const t in e.tokenizer){const r=n[t];n[t]=(...s)=>{let i=e.tokenizer[t].apply(n,s);return!1===i&&(i=r.apply(n,s)),i}}t.tokenizer=n}if(e.walkTokens){const n=Kt.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}r&&(t.extensions=n),Kt.setOptions(t)})},Kt.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)Kt.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)Kt.walkTokens(n,t);break;case"list":Kt.walkTokens(n.items,t);break;default:Kt.defaults.extensions&&Kt.defaults.extensions.childTokens&&Kt.defaults.extensions.childTokens[n.type]?Kt.defaults.extensions.childTokens[n.type].forEach((function(e){Kt.walkTokens(n[e],t)})):n.tokens&&Kt.walkTokens(n.tokens,t)}},Kt.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Ht({},Kt.defaults,t||{}),Gt(t);try{const n=Wt.lexInline(e,t);return t.walkTokens&&Kt.walkTokens(n,t.walkTokens),Mt.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Vt(e.message+"",!0)+"
    ";throw e}},Kt.Parser=Mt,Kt.parser=Mt.parse,Kt.Renderer=Ut,Kt.TextRenderer=Ft,Kt.Lexer=Wt,Kt.lexer=Wt.lex,Kt.Tokenizer=qt,Kt.Slugger=Bt,Kt.parse=Kt;var Xt=Kt;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Qt,en={exports:{}};Qt=en,function(e,t){Qt.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function o(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 a(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 s=a(t[1],arguments);return o(""===n?e[r-1]:n,s)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var i=r[s];if(i[0].test(t))return c(t,i)}return t}function u(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?o(r,s):e.hasOwnProperty(s)?o(r,e[s]):l(s,r,n)}}function d(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&l(s,s,n)===s}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(s,r,e),p.isPlural=d(s,r,e),p.singular=u(r,s,t),p.isSingular=d(r,s,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(),s[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}));var tn=en.exports,nn=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=i.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.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(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){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=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,i){for(var o=("selectedIndex"in t),a=o;r>>0;no;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,k=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(S),n=z("div");return n.innerHTML=''+e+"",j(t,n.firstChild.childNodes),t}:T)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===S?C.createDocumentFragment():C.createElementNS("http://www.w3.org/1999/xhtml",e)}var W,M,q,U,F,B,H,G,V,Z=(M="appendChild",q="cloneNode",U="createTextNode",B=(F="importNode")in(W=e),(H=W.createDocumentFragment())[M](W[U]("g")),H[M](W[U]("")),(B?W[F](H,!0):H[q](!0)).childNodes.length<2?function e(t,n){for(var r=t[q](),s=t.childNodes||[],i=s.length,o=0;n&&o

    ',G.content.childNodes[0].getAttribute(V)==J)||(J="_dt: "+J.slice(1,-1)+";",K=!0)}catch(u){}var X="\x3c!--"+J+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,se="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",oe=new RegExp(se+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(se+re+ie+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,ue)+r}function ue(e,t,n){return t+(n||'"')+J+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=K?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,s){for(var i=t.childNodes,o=i.length,a=0;a{e.remove()})}function mn(e,t="long"){const n=new Intl.ListFormat(s,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s)}}const gn=mn("conjunction"),bn=mn("disjunction");function yn(e,t){return gn(e,t).join("")}function wn(e,t){return bn(e,t).join("")}function vn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const o=await fetch(n);if(!o.ok&&i)return console.warn("Returning a stale cached response for "+r),i;if(s&&o.ok){const e=o.clone(),r=new Headers(o.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return o}function En(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map(e=>on`${e}, `);return on`${r}${n[n.length-1]}`}function Tn(e,t){return[].concat(gn(e,t)).map(e=>"string"==typeof e?on`${e}`:e)}function Rn(e,t=""){return An(e,t,function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(kn(e.textContent)))}function An(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s="x"+s):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function Ln(e){const t=new Set,n="ltNodefault"in e.dataset?"":kn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>kn(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(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach(e=>t.add(kn(e)))}return[...t]}function Pn(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function In(e,t){const n=t.closest(pn);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 Dn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Nn(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 On(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class jn 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 zn(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{Pn(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),Wn(t),t}function Wn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Mn(t)])e.remove()}function*Mn(e){for(;e.nextNode();)yield e.currentNode}class qn 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())}}class Un extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||An(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:i,title:o,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:i,title:o,details:a,stack:n}}}function Fn(e,t,n={}){const r={...n,isWarning:!1};Xn("error",new Un(e,t,r))}function Bn(e,t,n={}){const r={...n,isWarning:!0};Xn("warn",new Un(e,t,r))}function Hn(e){return e?`\`${e}\``:""}function Gn(e,{quotes:t}={quotes:!1}){return wn(e,t?e=>Hn(Zn(e)):Hn)}function Vn(e,{quotes:t}={quotes:!1}){return yn(e,t?e=>Hn(Zn(e)):Hn)}function Zn(e){return String(e)?`"${e}"`:""}function Yn(e,...t){return e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,i]=r.slice(1,-1).split("|");if(i){return`${e}[${s}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`}).join("")}const Jn="core/pubsubhub",Kn=new Map;function Xn(e,...t){if(!Kn.has(e))return;if(Array.from(Kn.get(e)).forEach(e=>{try{e(...t)}catch(t){Fn(`Error when calling function ${e.name}.`,Jn,{hint:"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 Qn(e,t,n={once:!1}){return n.once?Qn(e,(function n(...r){!function({topic:e,cb:t}){const n=Kn.get(e);if(!n||!n.has(t))return console.warn("Already unsubscribed:",e,t),!1;n.delete(t)}({topic:e,cb:n}),t(...r)})):(Kn.has(e)?Kn.get(e).add(t):Kn.set(e,new Set([t])),{topic:e,cb:t})}t(Jn,{sub:Qn});const er=["githubToken","githubUser"];const tr=new Map([["text/html","html"],["application/xml","xml"]]);function nr(e,t=document){const n=tr.get(e);if(!n){const t=[...tr.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=rr(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function rr(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Wn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar"),hn(r);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let o=e.querySelector("meta[charset], meta[content*='charset=']");o||(o=on``);s.appendChild(o);const a="ReSpec "+(window.respecVersion||"Developer Channel"),c=on` +window.respecVersion="26.13.0",function(){"use strict";const e=!!window.require;if(!e){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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},s=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:s,run:function(e){e.l10n=r[s]||r.en}});let o,a;const c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(c.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(l.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});l.set(e,t)}(e),t=e,(o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&c.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),s&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}))(f);var $=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=g(o);return r&&o.addEventListener("upgradeneeded",e=>{r(g(o.result),e.oldVersion,e.newVersion,g(o.transaction))}),n&&o.addEventListener("blocked",()=>n()),a.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",()=>s())}).catch(()=>{}),a},unwrap:b,wrap:g});function x(e,t,n,r,s,{level:i="error",autofix:o,ruleName:a}={}){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 s=n.map(e=>e.trivia+e.value).join(""),i=e[t];return"eof"===i.type?s:r?s+i.trivia:s.slice(i.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?" in "+e.name:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map(e=>function(e,t){let n=e;return t&&(n+=" "+t),n}(e.type,e.name)).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:i,ruleName:a,autofix:o,input:f,tokens:p}}function _(e,t,n,r){return x(e,t,n,r,"Syntax")}function S(e,t,n,r,s={}){return s.ruleName=n,x(t.source,e.index,t,r,"Validation",s)}class C{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},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 E(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 s=E(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=E(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function T(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some(e=>e.required);if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?T(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class R extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class A extends C{static parser(e,t){return()=>{const n=e.consumeType(t);if(n)return new A({source:e.source,tokens:{value:n}})}}get value(){return G(this.tokens.value.value)}}function L(e,t){return V(e,{parser:A.parser(e,t),listName:t+" list"})}const P=["identifier","decimal","integer","string"],I=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map(e=>[e,"Legacy"+e]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function D(e){for(const t of P){const n=L(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class N extends C{static parse(e){const t={assign:e.consume("=")},n=se(new N({source:e.source,tokens:t}));return t.assign&&(t.secondaryName=e.consumeType(...P)),t.open=e.consume("("),t.open?(n.list=n.rhsIsList?D(e):K(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}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list?this.list.map(n=>{return"identifier-list"===t?e.identifier(n,this.parent):t&&t.endsWith("-list")?(r=n,e.ts.wrap([e.token(r.tokens.value),e.token(r.tokens.separator)])):n.write(e);var r}):[],e.token(this.tokens.close)])}}class O extends C{static parse(e){const t=e.consumeType("identifier");if(t)return new O({source:e.source,tokens:{name:t},params:N.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;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:G(t.secondaryName.value)}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` 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 S(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(I.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${I.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/heycam/webidl/pull/870) for more information.`;yield S(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=I.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class j extends R{static parse(e){const t={};if(t.open=e.consume("["),!t.open)return new j({});const n=new j({source:e.source,tokens:t});return n.push(...V(e,{parser:O.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)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map(t=>t.write(e)),e.token(this.tokens.close)]):""}}function z(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function W(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=se(new M({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error("No opening bracket after "+n.value),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=Q(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=X(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...ae)||e.error("Record key must be one of: "+ae.join(", ")),s=new M({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const i=X(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,i);break}}return r.idlType||e.error("Error parsing generic type "+n.value),r.tokens.close=e.consume(">")||e.error("Missing closing bracket after "+n.value),r.this}(e,t)||J(e);if(!n){const t=e.consumeType("identifier")||e.consume(...ae,...oe);if(!t)return;n=new M({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,z(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class M extends C{static parse(e,t){return W(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=se(new M({source:e.source,tokens:n}));for(r.type=t||null;;){const t=X(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"),z(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new j({})}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 G([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter(e=>e).map(e=>e.value).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/heycam/webidl/issues/60) for more information.";yield S(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=E(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield S(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map(t=>t.write(e)),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}class q extends C{static parse(e){const t=e.consume("=");if(!t)return null;const n=Z(e)||e.consumeType("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new q({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 Y(this.expression[0]).type}get value(){return Y(this.expression[0]).value}get negative(){return Y(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map(t=>e.token(t))])}}class U extends C{static parse(e){const t=e.position,n={},r=se(new U({source:e.source,tokens:n}));return r.extAttrs=j.parse(e),n.optional=e.consume("optional"),r.idlType=X(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeType("identifier")||e.consume(...ce),n.name?(r.default=n.optional?q.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 G(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=E(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield S(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 S(this.tokens.name,this,"dict-arg-default",e,{autofix:F(this)})}}else if(this.parent&&!T(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e);return!t.slice(n+1).some(e=>!e.optional)}(this)){const e="Dictionary argument must be optional if it has no required fields";yield S(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=re(n.idlType);n.tokens.optional={type:"optional",value:"optional",trivia:e.trivia},e.trivia=" ",F(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function F(e){return()=>{e.default=q.parse(new pe(" = {}"))}}class B extends C{static parse(e,{special:t,regular:n}={}){const r={special:t},s=se(new B({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=Q(e)||e.error("Missing return type"),r.name=e.consumeType("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=K(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?G(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield S(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class H extends C{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,i={special:t},o=se(new H({source:e.source,tokens:i}));if(t||n||(i.special=e.consume("inherit")),"inherit"===o.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)return o.idlType=X(e,"attribute-type")||e.error("Attribute lacks a type"),i.name=e.consumeType("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),i.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),o.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return G(this.tokens.name.value)}*validate(e){switch(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),this.idlType.generic){case"sequence":case"record":{const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield S(this.tokens.name,this,"attr-invalid-type",e);break}default:{const{reference:t}=E(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield S(e,this,"attr-invalid-type",n)}}}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function G(e){return e.startsWith("_")?e.slice(1):e}function V(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const i=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error("Trailing comma in "+r);break}if(s.tokens.separator=e.consume(","),i.push(s),!s.tokens.separator)break}return i}function Z(e){return e.consumeType("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function Y({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function J(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new M({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new M({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new M({source:t,tokens:{base:r}}):void 0}function K(e){return V(e,{parser:U.parse,listName:"arguments list"})}function X(e,t){const n=j.parse(e),r=M.parse(e,t);return r&&(se(r).extAttrs=n),r}function Q(e,t){const n=M.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new M({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ee(e){const t=e.consume("stringifier");if(!t)return;return H.parse(e,{special:t})||B.parse(e,{special:t})||e.error("Unterminated stringifier")}function te(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function ne(e){return()=>{if(e.extAttrs.length){const t=new pe("Exposed=Window,"),n=O.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{se(e).extAttrs=j.parse(new pe("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia="\n"+te(t)}}}function re(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return re(e.idlType);return Object.values(e.tokens).sort((e,t)=>e.index-t.index)[0]}function se(e,t){return t||(t=e),e?new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)?se(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 ie={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:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},oe=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","Float32Array","Float64Array","any","object","symbol"],ae=["ByteString","DOMString","USVString"],ce=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],le=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(ce,ae,oe),ue=["(",")",",","...",":",";","<","=",">","?","[","]","{","}"],de=["_constructor","toString","_toString"];class pe{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,i=0;for(;nthis.position&&this.source[this.position].type===e}probe(e){return this.probeType("inline")&&this.source[this.position].value===e}consumeType(...e){for(const t of e){if(!this.probeType(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeType("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}unconsume(e){this.position=e}}class fe extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:i,tokens:o}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=i,this.tokens=o}}class he extends A{static parse(e){const t=e.consumeType("string");if(t)return new he({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class me extends C{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeType("identifier")||e.error("No name for enum");const n=se(new me({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=V(e,{parser:he.parse,allowDangler:!0,listName:"enumeration"}),e.probeType("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 G(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class ge extends C{static parse(e){const t=e.consumeType("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeType("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new ge({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return G(this.tokens.target.value)}get includes(){return G(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class be extends C{static parse(e){const t={},n=se(new be({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=X(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeType("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 G(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class ye extends C{static parse(e,t){const n={base:t},r=se(new ye({source:e.source,tokens:n}));return n.name=e.consumeType("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=Q(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=K(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 G(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map(t=>t.write(e)),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class we extends C{static parse(e,t,{type:n,inheritable:r,allowedMembers:s}){const{tokens:i}=t;for(i.name=e.consumeType("identifier")||e.error("Missing name in "+t.type),e.current=t,t=se(t),r&&Object.assign(i,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeType("identifier")||e.error("Inheritance lacks a type")}:{}}(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=j.parse(e);let o;for(const[t,...n]of s)if(o=se(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=r,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return G(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?G(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class ve extends C{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=J(e);if(!n){const t=e.consumeType("identifier")||e.error("Const lacks a type");n=new M({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeType("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=Z(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new ve({source:e.source,tokens:t});return se(r).idlType=n,r}get type(){return"const"}get name(){return G(this.tokens.name.value)}get value(){return Y(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class ke extends C{static parse(e){const t=e.position,n={},r=se(new ke({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:s}=r,i="maplike"===s,o=i||"iterable"===s,a=r.async&&"iterable"===s;n.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=X(e)||e.error(`Missing a type argument in ${s} declaration`);return r.idlType=[c],r.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?r.idlType.push(X(e)):i&&e.error(`Missing second type argument in ${s} declaration`)),n.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(n.argsOpen=e.consume("("),r.arguments.push(...K(e)),n.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),n.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),r.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class $e extends C{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=K(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new $e({source:e.source,tokens:n});return se(s).arguments=r,s}get type(){return"constructor"}*validate(e){this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function xe(e){const t=e.consume("static");if(!t)return;return H.parse(e,{special:t})||B.parse(e,{special:t})||e.error("No body in static member")}class _e extends we{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return we.parse(e,new _e({source:e.source,tokens:r}),{type:"interface",inheritable:!n,allowedMembers:[[ve.parse],[$e.parse],[xe],[ee],[ke.parse],[H.parse],[B.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every(e=>"Exposed"!==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 S(this.tokens.name,this,"require-exposed",e,{autofix:ne(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 S(e.tokens.name,this,"constructor-member",t,{autofix:Se(this,e)})}if(this.extAttrs.some(e=>"Global"===e.name)){const e=this.extAttrs.filter(e=>"LegacyFactoryFunction"===e.name);for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield S(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 S(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=new Set(o(t).map(e=>e.name)),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=o(e);yield*i(r,n,e,t);for(const e of r)n.add(e.name)}function*i(e,t,n,r){for(const s of e){const{name:e}=s;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 S(s.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter(({type:e})=>"operation"===e)}}(e,this))}}function Se(e,t){return e=se(e),()=>{const n=te(e.extAttrs.tokens.open.trivia),r=e.members.length?te(re(e.members[0]).trivia):function(e){const t=te(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=$e.parse(new pe(`\n${r}constructor();`));s.extAttrs=new j({}),se(s).arguments=t.arguments;const i=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,e=>"constructor"===e.type);e.members.splice(i+1,0,s);const{close:o}=e.tokens;o.trivia.includes("\n")||(o.trivia+="\n"+n);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class Ce extends we{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return we.parse(e,new Ce({source:e.source,tokens:r}),{type:"interface mixin",allowedMembers:[[ve.parse],[ee],[H.parse,{noInherit:!0}],[B.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Ee extends C{static parse(e){const t={},n=se(new Ee({source:e.source,tokens:t}));return n.extAttrs=j.parse(e),t.required=e.consume("required"),n.idlType=X(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeType("identifier")||e.error("Dictionary member lacks a name"),n.default=q.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 G(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class Te extends we{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return we.parse(e,new Te({source:e.source,tokens:n}),{type:"dictionary",inheritable:!t,allowedMembers:[[Ee.parse]]})}get type(){return"dictionary"}}class Re extends we{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return we.parse(e,new Re({source:e.source,tokens:n}),{type:"namespace",allowedMembers:[[H.parse,{noInherit:!0,readonly:!0}],[ve.parse],[B.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 S(this.tokens.name,this,"require-exposed",e,{autofix:ne(this)})}yield*super.validate(e)}}class Ae extends we{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return we.parse(e,new Ae({source:e.source,tokens:r}),{type:"callback interface",inheritable:!n,allowedMembers:[[ve.parse],[B.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Le(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function i(t){const n=s("interface");if(!n)return;return Ce.parse(e,n,t)||_e.parse(e,n,t)||r("Interface has no proper body")}function o(){return function(){const t=s("callback");if(t)return e.probe("interface")?Ae.parse(e,t):ye.parse(e,t)}()||i()||function(){const t=s("partial");if(t)return Te.parse(e,{partial:t})||i({partial:t})||Re.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Te.parse(e)||me.parse(e)||be.parse(e)||ge.parse(e)||Re.parse(e)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=j.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}se(n).extAttrs=t,s.push(n)}const i=e.consumeType("eof");return t.concrete&&s.push(i),s}();return e.positione.join(""),trivia:Pe,name:Pe,reference:Pe,type:Pe,generic:Pe,nameless:Pe,inheritance:Pe,definition:Pe,extendedAttribute:Pe,extendedAttributeReference:Pe};class De{constructor(e){this.ts=Object.assign({},Ie,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=Pe,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function Ne(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 s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Oe(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:Ne(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({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 S(n.tokens.name,n,"no-duplicate",r)}}(t)}var je=Object.freeze({__proto__:null,parse:function(e,t={}){const n=new pe(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Le(n,t)},write:function(e,{templates:t=Ie}={}){t=Object.assign({},Ie,t);const n=new De(t);return t.wrap(e.map((function(e){return"eof"===e.type?t.trivia(e.trivia):e.write(n)})))},validate:function(e){return[...Oe((t=e,t.flat?t.flat():[].concat(...t)))];var t},WebIDLParseError:fe});const ze=/^[!#$%&'*+-.^`|~\w]+$/,We=/[\u000A\u000D\u0009\u0020]/u,Me=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function qe(e,t,n){(t&&""!==t&&!e.has(t)&&Me.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var Ue={exports:{}};function Fe(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Ue.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:Fe,changeDefaults:function(e){Ue.exports.defaults=e}};const Be=/[&<>"']/,He=/[&<>"']/g,Ge=/[<>"']|&(?!#?\w+;)/,Ve=/[<>"']|&(?!#?\w+;)/g,Ze={"&":"&","<":"<",">":">",'"':""","'":"'"},Ye=e=>Ze[e];const Je=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Ke(e){return e.replace(Je,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const Xe=/(^|[^\[])\^/g;const Qe=/[^\w:]/g,et=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const tt={},nt=/^[^:]+:\/*[^/]*$/,rt=/^([^:]+:)[\s\S]*$/,st=/^([^:]+:\/*[^/]*)[\s\S]*$/;function it(e,t){tt[" "+e]||(nt.test(e)?tt[" "+e]=e+"/":tt[" "+e]=ot(e,"/",!0));const n=-1===(e=tt[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(rt,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(st,"$1")+t:e+t}function ot(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s(r=(r=r.source||r).replace(Xe,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(Ke(n)).replace(Qe,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!et.test(n)&&(n=it(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:it,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:ct}=Ue.exports,{rtrim:lt,splitCells:ut,escape:dt,findClosingBracket:pt}=at;function ft(e,t,n){const r=t.href,s=t.title?dt(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:s,text:i}:{type:"image",raw:n,href:r,title:s,text:dt(i)}}var ht=class{constructor(e){this.options=e||ct}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:lt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=lt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:ut(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],r=n.length>1,s={type:"list",raw:e,ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]},i=t[0].match(this.rules.block.item);let o,a,c,l,u,d,p,f,h,m=!1,g=i.length;c=this.rules.block.listItemStart.exec(i[0]);for(let t=0;tc[1].length:l[1].length>=c[0].length||l[1].length>3){i.splice(t,2,i[t]+(!this.options.pedantic&&l[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):dt(r[0]):r[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=lt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=pt(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),ft(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ft(n,e,n[0])}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const s=r[1]||r[2]||"";if(!s||s&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let s,i,o=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));)if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],s)if(i=s.length,r[3]||r[4])o+=i;else if(!((r[5]||r[6])&&n%3)||(n+i)%3){if(o-=i,!(o>0))return i=Math.min(i,i+o+a),Math.min(n,i)%2?{type:"em",raw:e.slice(0,n+r.index+i+1),text:e.slice(1,n+r.index+i)}:{type:"strong",raw:e.slice(0,n+r.index+i+1),text:e.slice(2,n+r.index+i-1)}}else a+=i}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=dt(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=dt(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=dt(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=dt(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=dt(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const r=this.rules.inline.text.exec(e);if(r){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):dt(r[0]):r[0]:dt(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:e}}}};const{noopTest:mt,edit:gt,merge:bt}=at,yt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:mt,table:mt,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};yt.def=gt(yt.def).replace("label",yt._label).replace("title",yt._title).getRegex(),yt.bullet=/(?:[*+-]|\d{1,9}[.)])/,yt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,yt.item=gt(yt.item,"gm").replace(/bull/g,yt.bullet).getRegex(),yt.listItemStart=gt(/^( *)(bull) */).replace("bull",yt.bullet).getRegex(),yt.list=gt(yt.list).replace(/bull/g,yt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+yt.def.source+")").getRegex(),yt._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",yt._comment=/|$)/,yt.html=gt(yt.html,"i").replace("comment",yt._comment).replace("tag",yt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yt.paragraph=gt(yt._paragraph).replace("hr",yt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",yt._tag).getRegex(),yt.blockquote=gt(yt.blockquote).replace("paragraph",yt.paragraph).getRegex(),yt.normal=bt({},yt),yt.gfm=bt({},yt.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),yt.gfm.nptable=gt(yt.gfm.nptable).replace("hr",yt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",yt._tag).getRegex(),yt.gfm.table=gt(yt.gfm.table).replace("hr",yt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",yt._tag).getRegex(),yt.pedantic=bt({},yt.normal,{html:gt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",yt._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+|$)/,fences:mt,paragraph:gt(yt.normal._paragraph).replace("hr",yt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",yt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const wt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:mt,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:mt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};wt.punctuation=gt(wt.punctuation).replace(/punctuation/g,wt._punctuation).getRegex(),wt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,wt.escapedEmSt=/\\\*|\\_/g,wt._comment=gt(yt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),wt.emStrong.lDelim=gt(wt.emStrong.lDelim).replace(/punct/g,wt._punctuation).getRegex(),wt.emStrong.rDelimAst=gt(wt.emStrong.rDelimAst,"g").replace(/punct/g,wt._punctuation).getRegex(),wt.emStrong.rDelimUnd=gt(wt.emStrong.rDelimUnd,"g").replace(/punct/g,wt._punctuation).getRegex(),wt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,wt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,wt._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])?)+(?![-_])/,wt.autolink=gt(wt.autolink).replace("scheme",wt._scheme).replace("email",wt._email).getRegex(),wt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,wt.tag=gt(wt.tag).replace("comment",wt._comment).replace("attribute",wt._attribute).getRegex(),wt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,wt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,wt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,wt.link=gt(wt.link).replace("label",wt._label).replace("href",wt._href).replace("title",wt._title).getRegex(),wt.reflink=gt(wt.reflink).replace("label",wt._label).getRegex(),wt.reflinkSearch=gt(wt.reflinkSearch,"g").replace("reflink",wt.reflink).replace("nolink",wt.nolink).getRegex(),wt.normal=bt({},wt),wt.pedantic=bt({},wt.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:gt(/^!?\[(label)\]\((.*?)\)/).replace("label",wt._label).getRegex(),reflink:gt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wt._label).getRegex()}),wt.gfm=bt({},wt.normal,{escape:gt(wt.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}const{defaults:Tt}=Ue.exports,{cleanUrl:Rt,escape:At}=at;var Lt=class{constructor(e){this.options=e||Tt}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:At(e,!0))+"
    \n":"
    "+(n?e:At(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=Rt(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=Rt(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},Pt=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},It=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const Dt=Lt,Nt=Pt,Ot=It,{defaults:jt}=Ue.exports,{unescape:zt}=at;const Wt=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$t,this.options.tokenizer=this.options.tokenizer||new kt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:xt.normal,inline:_t.normal};this.options.pedantic?(t.block=xt.pedantic,t.inline=_t.pedantic):this.options.gfm&&(t.block=xt.gfm,this.options.breaks?t.inline=_t.breaks:t.inline=_t.gfm),this.tokenizer.rules=t}static get rules(){return{block:xt,inline:_t}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let r,s,i,o,a,c;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),o=t[t.length-1],o&&"paragraph"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),i=r.items.length,s=0;s=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(r=this.tokenizer.paragraph(a)))o=t[t.length-1],c&&"paragraph"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r),c=a.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),o=t[t.length-1],o&&"text"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,r,s,i,o;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+St("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+St("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(s=n.call(this,e,t))&&(e=e.substring(s.raw.length),t.push(s),!0))))if(s=this.tokenizer.escape(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.tag(e,n,r))e=e.substring(s.raw.length),n=s.inLink,r=s.inRawBlock,i=t[t.length-1],i&&"text"===s.type&&"text"===i.type?(i.raw+=s.raw,i.text+=s.text):t.push(s);else if(s=this.tokenizer.link(e))e=e.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,r)),t.push(s);else if(s=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(s.raw.length),i=t[t.length-1],"link"===s.type?(s.tokens=this.inlineTokens(s.text,[],!0,r),t.push(s)):i&&"text"===s.type&&"text"===i.type?(i.raw+=s.raw,i.text+=s.text):t.push(s);else if(s=this.tokenizer.emStrong(e,u,l))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,r),t.push(s);else if(s=this.tokenizer.codespan(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.br(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.del(e))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],n,r),t.push(s);else if(s=this.tokenizer.autolink(e,Et))e=e.substring(s.raw.length),t.push(s);else if(n||!(s=this.tokenizer.url(e,Et))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call(this,n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(s=this.tokenizer.inlineText(o,r,Ct))e=e.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(l=s.raw.slice(-1)),c=!0,i=t[t.length-1],i&&"text"===i.type?(i.raw+=s.raw,i.text+=s.text):t.push(s);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(s.raw.length),t.push(s);return t}},Mt=class e{constructor(e){this.options=e||jt,this.options.renderer=this.options.renderer||new Dt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Nt,this.slugger=new Ot}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,s,i,o,a,c,l,u,d,p,f,h,m,g,b,y,w,v,k="";const $=e.length;for(n=0;n<$;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call(this,d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))k+=v||"";else switch(d.type){case"space":continue;case"hr":k+=this.renderer.hr();continue;case"heading":k+=this.renderer.heading(this.parseInline(d.tokens),d.depth,zt(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":k+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(l="",c="",i=d.header.length,r=0;r0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);k+=this.renderer.list(u,p,f);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<$&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);k+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return k}parseInline(e,t){t=t||this.renderer;let n,r,s,i="";const o=e.length;for(n=0;n{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),o--,0===o&&i()}))},0))})),void(0===o&&i())}try{const n=Wt.lex(e,t);return t.walkTokens&&Kt.walkTokens(n,t.walkTokens),Mt.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Vt(e.message+"",!0)+"
    ";throw e}}Kt.options=Kt.setOptions=function(e){return Ht(Kt.defaults,e),Yt(Kt.defaults),Kt},Kt.getDefaults=Zt,Kt.defaults=Jt,Kt.use=function(...e){const t=Ht({},...e),n=Kt.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=Kt.defaults.renderer||new Ut;for(const t in e.renderer){const r=n[t];n[t]=(...s)=>{let i=e.renderer[t].apply(n,s);return!1===i&&(i=r.apply(n,s)),i}}t.renderer=n}if(e.tokenizer){const n=Kt.defaults.tokenizer||new qt;for(const t in e.tokenizer){const r=n[t];n[t]=(...s)=>{let i=e.tokenizer[t].apply(n,s);return!1===i&&(i=r.apply(n,s)),i}}t.tokenizer=n}if(e.walkTokens){const n=Kt.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}r&&(t.extensions=n),Kt.setOptions(t)})},Kt.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)Kt.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)Kt.walkTokens(n,t);break;case"list":Kt.walkTokens(n.items,t);break;default:Kt.defaults.extensions&&Kt.defaults.extensions.childTokens&&Kt.defaults.extensions.childTokens[n.type]?Kt.defaults.extensions.childTokens[n.type].forEach((function(e){Kt.walkTokens(n[e],t)})):n.tokens&&Kt.walkTokens(n.tokens,t)}},Kt.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Ht({},Kt.defaults,t||{}),Gt(t);try{const n=Wt.lexInline(e,t);return t.walkTokens&&Kt.walkTokens(n,t.walkTokens),Mt.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Vt(e.message+"",!0)+"
    ";throw e}},Kt.Parser=Mt,Kt.parser=Mt.parse,Kt.Renderer=Ut,Kt.TextRenderer=Ft,Kt.Lexer=Wt,Kt.lexer=Wt.lex,Kt.Tokenizer=qt,Kt.Slugger=Bt,Kt.parse=Kt;var Xt=Kt;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Qt,en={exports:{}};Qt=en,function(e,t){Qt.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function o(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 a(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 s=a(t[1],arguments);return o(""===n?e[r-1]:n,s)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var i=r[s];if(i[0].test(t))return c(t,i)}return t}function u(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?o(r,s):e.hasOwnProperty(s)?o(r,e[s]):l(s,r,n)}}function d(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&l(s,s,n)===s}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(s,r,e),p.isPlural=d(s,r,e),p.singular=u(r,s,t),p.isSingular=d(r,s,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(),s[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}));var tn=en.exports,nn=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=i.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.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(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){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=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,i){for(var o=("selectedIndex"in t),a=o;r>>0;no;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,k=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(C),n=z("div");return n.innerHTML=''+e+"",j(t,n.firstChild.childNodes),t}:T)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===C?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var W,M,q,U,F,B,H,G,V,Z=(M="appendChild",q="cloneNode",U="createTextNode",B=(F="importNode")in(W=e),(H=W.createDocumentFragment())[M](W[U]("g")),H[M](W[U]("")),(B?W[F](H,!0):H[q](!0)).childNodes.length<2?function e(t,n){for(var r=t[q](),s=t.childNodes||[],i=s.length,o=0;n&&o

    ',G.content.childNodes[0].getAttribute(V)==J)||(J="_dt: "+J.slice(1,-1)+";",K=!0)}catch(u){}var X="\x3c!--"+J+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,se="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",oe=new RegExp(se+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(se+re+ie+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,ue)+r}function ue(e,t,n){return t+(n||'"')+J+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=K?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,s){for(var i=t.childNodes,o=i.length,a=0;a{e.remove()})}function mn(e,t="long"){const n=new Intl.ListFormat(s,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s)}}const gn=mn("conjunction"),bn=mn("disjunction");function yn(e,t){return gn(e,t).join("")}function wn(e,t){return bn(e,t).join("")}function vn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const o=await fetch(n);if(!o.ok&&i)return console.warn("Returning a stale cached response for "+r),i;if(s&&o.ok){const e=o.clone(),r=new Headers(o.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return o}function En(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map(e=>on`${e}, `);return on`${r}${n[n.length-1]}`}function Tn(e,t){return[].concat(gn(e,t)).map(e=>"string"==typeof e?on`${e}`:e)}function Rn(e,t=""){return An(e,t,function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(kn(e.textContent)))}function An(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s="x"+s):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function Ln(e){const t=new Set,n="ltNodefault"in e.dataset?"":kn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>kn(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(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach(e=>t.add(kn(e)))}return[...t]}function Pn(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function In(e,t){const n=t.closest(pn);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 Dn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Nn(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 On(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class jn 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 zn(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{Pn(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),Wn(t),t}function Wn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Mn(t)])e.remove()}function*Mn(e){for(;e.nextNode();)yield e.currentNode}class qn 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())}}class Un extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||An(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:i,title:o,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:i,title:o,details:a,stack:n}}}function Fn(e,t,n={}){const r={...n,isWarning:!1};Xn("error",new Un(e,t,r))}function Bn(e,t,n={}){const r={...n,isWarning:!0};Xn("warn",new Un(e,t,r))}function Hn(e){return e?`\`${e}\``:""}function Gn(e,{quotes:t}={quotes:!1}){return wn(e,t?e=>Hn(Zn(e)):Hn)}function Vn(e,{quotes:t}={quotes:!1}){return yn(e,t?e=>Hn(Zn(e)):Hn)}function Zn(e){return String(e)?`"${e}"`:""}function Yn(e,...t){return e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,i]=r.slice(1,-1).split("|");if(i){return`${e}[${s}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`}).join("")}const Jn="core/pubsubhub",Kn=new Map;function Xn(e,...t){if(!Kn.has(e))return;if(Array.from(Kn.get(e)).forEach(e=>{try{e(...t)}catch(t){Fn(`Error when calling function ${e.name}.`,Jn,{hint:"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 Qn(e,t,n={once:!1}){return n.once?Qn(e,(function n(...r){!function({topic:e,cb:t}){const n=Kn.get(e);if(!n||!n.has(t))return console.warn("Already unsubscribed:",e,t),!1;n.delete(t)}({topic:e,cb:n}),t(...r)})):(Kn.has(e)?Kn.get(e).add(t):Kn.set(e,new Set([t])),{topic:e,cb:t})}t(Jn,{sub:Qn});const er=["githubToken","githubUser"];const tr=new Map([["text/html","html"],["application/xml","xml"]]);function nr(e,t=document){const n=tr.get(e);if(!n){const t=[...tr.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=rr(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function rr(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Wn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar"),hn(r);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let o=e.querySelector("meta[charset], meta[content*='charset=']");o||(o=on``);s.appendChild(o);const a="ReSpec "+(window.respecVersion||"Developer Channel"),c=on` `;s.appendChild(c),t.prepend(s),Xn("beforesave",r)}(n);let r="";switch(e){case"xml":r=(new XMLSerializer).serializeToString(n);break;default:!function(e){e.querySelectorAll("style").forEach(e=>{e.innerHTML=`\n${e.innerHTML}\n`}),e.querySelectorAll("head > *").forEach(e=>{e.outerHTML="\n"+e.outerHTML})}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML}return r}t("core/exporter",{rsDocToDataURL:nr});class sr{constructor(){this._respecDonePromise=new Promise(e=>{Qn("end-all",e,{once:!0})}),this.errors=[],this.warnings=[],Qn("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),Qn("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return rr("html",document)}}const ir="core/post-process";const or="core/pre-process";const ar="core/base-runner";async function cr(e){!function(){const e=new sr;Object.defineProperty(document,"respec",{value:e});let t=!1;Object.defineProperty(document,"respecIsReady",{get:()=>(t||(Bn("`document.respecIsReady` is deprecated and will be removed in a future release.","core/respec-global",{hint:"Use `document.respec.ready` instead."}),t=!0),document.respec.ready)})}(),Xn("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Qn("amend-user-config",n),Qn("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of er)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)})}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter(([e,t])=>!!e&&!!t).map(([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let s;try{s=JSON.parse(r)}catch{s=r}return[n,s]}),r=Object.fromEntries(n);Object.assign(e,r),Xn("amend-user-config",r)}(respecConfig),performance.mark(ar+"-start"),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||Fn("Every item in `preProcess` must be a JS function.",or),t}).map(async t=>{try{return await t(e,document)}catch(e){Fn(`Function ${t.name} threw an error during \`preProcess\`.`,or,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}}(respecConfig);const t=e.filter(e=>{return(t=e)&&(t.run||t.Plugin);var t});t.forEach(e=>!e.name&&console.warn("Plugin lacks name:",e)),respecConfig.state={},await async function(e,t){for(const n of e.filter(e=>e.prepare))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise(async(r,s)=>{const i=setTimeout(()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),s(new Error(t))},15e3);performance.mark(e+"-start");try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){s(e)}finally{clearTimeout(i),performance.mark(e+"-end"),performance.measure(e,e+"-start",e+"-end")}})}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},Xn("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter(e=>{const t="function"==typeof e;return t||Fn("Every item in `postProcess` must be a JS function.",ir),t}).map(async t=>{try{return await t(e,document)}catch(e){Fn(`Function ${t.name} threw an error during \`postProcess\`.`,ir,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),Xn("end-all"),hn(document),performance.mark(ar+"-end"),performance.measure(ar,ar+"-start",ar+"-end")}var lr=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} @@ -55,32 +55,32 @@ window.respecVersion="26.12.1",function(){"use strict";const e=!!window.require; } .respec-iframe{width:100%;min-height:550px;height:100%;overflow:hidden;padding:0;margin:0;border:0} .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center} -.respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px}`;function ur(e){if(!e)return e;const t=e.trimEnd().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")}var dr=Object.freeze({__proto__:null,name:"core/reindent",reindent:ur,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=ur(e.innerHTML)}});const pr=/>/gm,fr=/&/gm;class hr extends an.Renderer{code(e,t,n){const{language:r,...s}=hr.parseInfoString(t);if(/(^webidl$)/i.test(r))return`
    ${e}
    `;const i=super.code(e,r,n),{example:o,illegalExample:a}=s;if(!o&&!a)return i;const c=o||a,l=`${r} ${o?"example":"illegal-example"}`;return i.replace("
    ",`
    `)}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n,r){const s=/(.+)\s+{#([\w-]+)}$/;if(s.test(e)){const[,n,r]=e.match(s);return`${n}`}return super.heading(e,t,n,r)}}function mr(e){const t=ur(e).replace(pr,">").replace(fr,"&");return an(t,{sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new hr})}function gr(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=mr(e.innerHTML)}class br{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],t)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,s=this.findParent(r);n&&e.removeChild(n),e.appendChild(t(e)),n&&e.prepend(n),s.appendChild(e),this.current=s}addElement(e){this.current.appendChild(e)}}function yr(e,t){return function e(n){const r=new br(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 wr(e){const t=yr(e,e.ownerDocument);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}const vr=(kr="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(kr);return t.forEach(gr),Array.from(t)});var kr;var $r=Object.freeze({__proto__:null,name:"core/markdown",markdownToHtml:mr,restructure:wr,run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n){for(const e of vr(document.body))wr(e);return}const r=document.getElementById("respec-ui");r.remove();const s=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=On(e);e.append("\n\n"+t)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),gr(s),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(s.querySelectorAll(".nolinks a[href]"));const i=yr(s,document);s.append(r,i),document.body.replaceWith(s)}});function xr(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute("aria-"+t,n)})}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=lr,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const _r=on``,Cr=on`
      e.trim()).map(e=>e.search(/[^\s]/)),r=Math.min(...n);return t.map(e=>e.slice(r)).join("\n")}var dr=Object.freeze({__proto__:null,name:"core/reindent",reindent:ur,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=ur(e.innerHTML)}});const pr=/>/gm,fr=/&/gm;class hr extends an.Renderer{code(e,t,n){const{language:r,...s}=hr.parseInfoString(t);if(/(^webidl$)/i.test(r))return`
      ${e}
      `;const i=super.code(e,r,n),{example:o,illegalExample:a}=s;if(!o&&!a)return i;const c=o||a,l=`${r} ${o?"example":"illegal-example"}`;return i.replace("
      ",`
      `)}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n,r){const s=/(.+)\s+{#([\w-]+)}$/;if(s.test(e)){const[,n,r]=e.match(s);return`${n}`}return super.heading(e,t,n,r)}}function mr(e){const t=ur(e).replace(pr,">").replace(fr,"&");return an(t,{sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new hr})}function gr(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=mr(e.innerHTML)}class br{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],t)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,s=this.findParent(r);n&&e.removeChild(n),e.appendChild(t(e)),n&&e.prepend(n),s.appendChild(e),this.current=s}addElement(e){this.current.appendChild(e)}}function yr(e,t){return function e(n){const r=new br(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 wr(e){const t=yr(e,e.ownerDocument);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}const vr=(kr="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(kr);return t.forEach(gr),Array.from(t)});var kr;var $r=Object.freeze({__proto__:null,name:"core/markdown",markdownToHtml:mr,restructure:wr,run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n){for(const e of vr(document.body))wr(e);return}const r=document.getElementById("respec-ui");r.remove();const s=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=On(e);e.append("\n\n"+t)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),gr(s),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(s.querySelectorAll(".nolinks a[href]"));const i=yr(s,document);s.append(r,i),document.body.replaceWith(s)}});function xr(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute("aria-"+t,n)})}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=lr,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const _r=on``,Sr=on``,Sr=on`
    `,Cr=on``;let Er,Tr;window.addEventListener("load",()=>Dr(Cr));const Rr=[],Ar=[],Lr={};Qn("start-all",()=>document.body.prepend(_r),{once:!0}),Qn("end-all",()=>document.body.prepend(_r),{once:!0});const Pr=on``;function Ir(){Cr.classList.toggle("respec-hidden"),Cr.classList.toggle("respec-visible"),Cr.hidden=!Cr.hidden}function Dr(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))})}_r.appendChild(Pr),Pr.addEventListener("click",e=>{e.stopPropagation(),Pr.setAttribute("aria-expanded",String(Cr.hidden)),Ir(),Cr.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{Cr.hidden||Ir()}),_r.appendChild(Cr),Cr.addEventListener("keydown",e=>{"Escape"!==e.key||Cr.hidden||(Pr.setAttribute("aria-expanded",String(Cr.hidden)),Ir(),Pr.focus())});const Nr=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Or(e,t,n,r){t.push(e),Lr.hasOwnProperty(n)||(Lr[n]=function(e,t,n){const r=on``;function Ir(){Sr.classList.toggle("respec-hidden"),Sr.classList.toggle("respec-visible"),Sr.hidden=!Sr.hidden}function Dr(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))})}_r.appendChild(Pr),Pr.addEventListener("click",e=>{e.stopPropagation(),Pr.setAttribute("aria-expanded",String(Sr.hidden)),Ir(),Sr.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{Sr.hidden||Ir()}),_r.appendChild(Sr),Sr.addEventListener("keydown",e=>{"Escape"!==e.key||Sr.hidden||(Pr.setAttribute("aria-expanded",String(Sr.hidden)),Ir(),Pr.focus())});const Nr=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Or(e,t,n,r){t.push(e),Lr.hasOwnProperty(n)||(Lr[n]=function(e,t,n){const r=on``;r.addEventListener("click",()=>{r.setAttribute("aria-expanded","true");const s=on`
      `;for(const e of t){const t=document.createRange().createContextualFragment(zr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),s.appendChild(n)}jr.freshModal(n,s,r)});const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return xr(r,s),r}(n,t,r),_r.appendChild(Lr[n]));const s=Lr[n];s.textContent=t.length;const i=1===t.length?cn.singular(r):r;xr(s,new Map([["label",`${t.length} ${i}`]]))}xr(Pr,Nr);const jr={show(){try{_r.hidden=!1}catch(e){console.error(e)}},hide(){_r.hidden=!0},enable(){Pr.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s="respec-button-"+e.toLowerCase().replace(/\s+/,"-"),i=on``,o=on`
    1. ${i}
    2. `;return o.addEventListener("click",t),Cr.appendChild(o),i},error(e){Or(e,Rr,"error","ReSpec Errors")},warning(e){Or(e,Ar,"warning","ReSpec Warnings")},closeModal(e){Tr&&(Tr.classList.remove("respec-show-overlay"),Tr.classList.add("respec-hide-overlay"),Tr.addEventListener("transitionend",()=>{Tr.remove(),Tr=null})),e&&e.setAttribute("aria-expanded","false"),Er&&(Er.remove(),Er=null,Pr.focus())},freshModal(e,t,n){Er&&Er.remove(),Tr&&Tr.remove(),Tr=on`
      `;const r=n.id+"-modal",s=r+"-heading";Er=on`
      `,o=on`
    3. ${i}
    4. `;return o.addEventListener("click",t),Sr.appendChild(o),i},error(e){Or(e,Rr,"error","ReSpec Errors")},warning(e){Or(e,Ar,"warning","ReSpec Warnings")},closeModal(e){Tr&&(Tr.classList.remove("respec-show-overlay"),Tr.classList.add("respec-hide-overlay"),Tr.addEventListener("transitionend",()=>{Tr.remove(),Tr=null})),e&&e.setAttribute("aria-expanded","false"),Er&&(Er.remove(),Er=null,Pr.focus())},freshModal(e,t,n){Er&&Er.remove(),Tr&&Tr.remove(),Tr=on`
      `;const r=n.id+"-modal",s=r+"-heading";Er=on``;const i=new Map([["labelledby",s]]);xr(Er,i),document.body.append(Tr,Er),Tr.addEventListener("click",()=>this.closeModal(n)),Tr.classList.toggle("respec-show-overlay"),Er.hidden=!1,Dr(Er)}};function zr(e){if("string"==typeof e)return e;const t=e.plugin?` (Plugin: "${e.plugin}").`:"",n=e.hint?" "+e.hint:"",r=Array.isArray(e.elements)?` Occurred at: ${yn(e.elements.map(Wr))}.`:"",s=e.details?`\n\n
      \n${e.details}\n
      \n`:"";return mr(`${e.message}${n}${r}${t}${s}`)}function Wr(e,t){return`[${t+1}](#${e.id})`}async function Mr(e){try{jr.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await cr(e)}finally{jr.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&jr.closeModal()}),window.respecUI=jr,Qn("error",e=>jr.error(e)),Qn("warn",e=>jr.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const qr=[Promise.resolve().then((function(){return Ur})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return Gr})),Promise.resolve().then((function(){return Fs})),Promise.resolve().then((function(){return Gs})),Promise.resolve().then((function(){return Ys})),Promise.resolve().then((function(){return Ks})),Promise.resolve().then((function(){return ri})),Promise.resolve().then((function(){return oi})),Promise.resolve().then((function(){return $r})),Promise.resolve().then((function(){return dr})),Promise.resolve().then((function(){return li})),Promise.resolve().then((function(){return pi})),Promise.resolve().then((function(){return zs})),Promise.resolve().then((function(){return mi})),Promise.resolve().then((function(){return gi})),Promise.resolve().then((function(){return wi})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return Po})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return Zo})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return sa})),Promise.resolve().then((function(){return aa})),Promise.resolve().then((function(){return Ta})),Promise.resolve().then((function(){return Yi})),Promise.resolve().then((function(){return Va})),Promise.resolve().then((function(){return ac})),Promise.resolve().then((function(){return za})),Promise.resolve().then((function(){return cc})),Promise.resolve().then((function(){return oo})),Promise.resolve().then((function(){return kc})),Promise.resolve().then((function(){return xc})),Promise.resolve().then((function(){return _c})),Promise.resolve().then((function(){return Pc})),Promise.resolve().then((function(){return Dc})),Promise.resolve().then((function(){return Nc})),Promise.resolve().then((function(){return Mc})),Promise.resolve().then((function(){return Zc})),Promise.resolve().then((function(){return nl})),Promise.resolve().then((function(){return ol})),Promise.resolve().then((function(){return dl})),Promise.resolve().then((function(){return bl})),Promise.resolve().then((function(){return yl})),Promise.resolve().then((function(){return $l})),Promise.resolve().then((function(){return Rl})),Promise.resolve().then((function(){return ga})),Promise.resolve().then((function(){return Ol})),Promise.resolve().then((function(){return ql})),Promise.resolve().then((function(){return Vl})),Promise.resolve().then((function(){return Jl})),Promise.resolve().then((function(){return Xl})),Promise.resolve().then((function(){return eu})),Promise.resolve().then((function(){return au})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return hu})),Promise.resolve().then((function(){return yu})),Promise.resolve().then((function(){return xu})),Promise.resolve().then((function(){return Eu})),Promise.resolve().then((function(){return Pu})),Promise.resolve().then((function(){return ju})),Promise.resolve().then((function(){return qu})),Promise.resolve().then((function(){return Hu})),Promise.resolve().then((function(){return Yu})),Promise.resolve().then((function(){return Qu})),Promise.resolve().then((function(){return rd}))];Promise.all(qr).then(e=>Mr(e)).catch(e=>console.error(e));var Ur=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.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})}});const Fr="w3c/group",Br=["wg","wgURI","wgId","wgPatentURI","wgPatentPolicy"];async function Hr(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,"https://respec.org/w3c/groups/"),s=await Sn(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,URI:r,patentURI:i,patentPolicy:o,type:a}=e;return{wg:n,wgId:t,wgURI:r,wgPatentURI:i,wgPatentPolicy:o,groupType:a}}const i=await s.text(),o=`Failed to fetch group details (HTTP: ${s.status}). ${i}`,a=404===s.status?Yn`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`:void 0;Fn(o,Fr,{hint:a})}var Gr=Object.freeze({__proto__:null,name:Fr,run:async function(e){const t=Br.filter(t=>e[t]);if(!e.group){if(t.length){const e=Yn`Please use the ${"[group]"} configuration option instead.`;Bn(`Configuration options ${Vn(Br)} are deprecated.`,Fr,{hint:e})}return}if(t.length){const e=Yn`Remove them from the document's ${"[respecConfig]"} to silence this warning.`;Bn(Yn`Configuration options ${Vn(t)} are superseded by ${"[group]"} and will be overridden by ReSpec.`,Fr,{hint:e})}const{group:n}=e,r=Array.isArray(n)?await async function(e){const t=await Promise.all(e.map(Hr)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(e=>e))for(const t of Object.keys(n))n[t].push(e[t]);return n}(n):await Hr(n);Object.assign(e,r)}});function Vr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Bn(t,"core/templates/show-link"),void console.warn(t,e)}return on` +
      `;const i=new Map([["labelledby",s]]);xr(Er,i),document.body.append(Tr,Er),Tr.addEventListener("click",()=>this.closeModal(n)),Tr.classList.toggle("respec-show-overlay"),Er.hidden=!1,Dr(Er)}};function zr(e){if("string"==typeof e)return e;const t=e.plugin?` (Plugin: "${e.plugin}").`:"",n=e.hint?" "+e.hint:"",r=Array.isArray(e.elements)?` Occurred at: ${yn(e.elements.map(Wr))}.`:"",s=e.details?`\n\n
      \n${e.details}\n
      \n`:"";return mr(`${e.message}${n}${r}${t}${s}`)}function Wr(e,t){return`[${t+1}](#${e.id})`}async function Mr(e){try{jr.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await cr(e)}finally{jr.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&jr.closeModal()}),window.respecUI=jr,Qn("error",e=>jr.error(e)),Qn("warn",e=>jr.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const qr=[Promise.resolve().then((function(){return Ur})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return Gr})),Promise.resolve().then((function(){return Fs})),Promise.resolve().then((function(){return Gs})),Promise.resolve().then((function(){return Ys})),Promise.resolve().then((function(){return Ks})),Promise.resolve().then((function(){return ri})),Promise.resolve().then((function(){return oi})),Promise.resolve().then((function(){return $r})),Promise.resolve().then((function(){return dr})),Promise.resolve().then((function(){return li})),Promise.resolve().then((function(){return pi})),Promise.resolve().then((function(){return zs})),Promise.resolve().then((function(){return mi})),Promise.resolve().then((function(){return gi})),Promise.resolve().then((function(){return wi})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return Po})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return Zo})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return sa})),Promise.resolve().then((function(){return aa})),Promise.resolve().then((function(){return Ta})),Promise.resolve().then((function(){return Yi})),Promise.resolve().then((function(){return Va})),Promise.resolve().then((function(){return ac})),Promise.resolve().then((function(){return za})),Promise.resolve().then((function(){return cc})),Promise.resolve().then((function(){return oo})),Promise.resolve().then((function(){return kc})),Promise.resolve().then((function(){return xc})),Promise.resolve().then((function(){return _c})),Promise.resolve().then((function(){return Pc})),Promise.resolve().then((function(){return Dc})),Promise.resolve().then((function(){return Nc})),Promise.resolve().then((function(){return Mc})),Promise.resolve().then((function(){return Zc})),Promise.resolve().then((function(){return nl})),Promise.resolve().then((function(){return ol})),Promise.resolve().then((function(){return dl})),Promise.resolve().then((function(){return bl})),Promise.resolve().then((function(){return yl})),Promise.resolve().then((function(){return $l})),Promise.resolve().then((function(){return Rl})),Promise.resolve().then((function(){return ga})),Promise.resolve().then((function(){return Ol})),Promise.resolve().then((function(){return ql})),Promise.resolve().then((function(){return Vl})),Promise.resolve().then((function(){return Jl})),Promise.resolve().then((function(){return Xl})),Promise.resolve().then((function(){return eu})),Promise.resolve().then((function(){return au})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return fu})),Promise.resolve().then((function(){return bu})),Promise.resolve().then((function(){return $u})),Promise.resolve().then((function(){return Cu})),Promise.resolve().then((function(){return Lu})),Promise.resolve().then((function(){return Ou})),Promise.resolve().then((function(){return Mu})),Promise.resolve().then((function(){return Bu})),Promise.resolve().then((function(){return Zu})),Promise.resolve().then((function(){return Xu})),Promise.resolve().then((function(){return nd}))];Promise.all(qr).then(e=>Mr(e)).catch(e=>console.error(e));var Ur=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.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})}});const Fr="w3c/group",Br=["wg","wgURI","wgId","wgPatentURI","wgPatentPolicy"];async function Hr(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,"https://respec.org/w3c/groups/"),s=await Cn(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,URI:r,patentURI:i,patentPolicy:o,type:a}=e;return{wg:n,wgId:t,wgURI:r,wgPatentURI:i,wgPatentPolicy:o,groupType:a}}const i=await s.text(),o=`Failed to fetch group details (HTTP: ${s.status}). ${i}`,a=404===s.status?Yn`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`:void 0;Fn(o,Fr,{hint:a})}var Gr=Object.freeze({__proto__:null,name:Fr,run:async function(e){const t=Br.filter(t=>e[t]);if(!e.group){if(t.length){const e=Yn`Please use the ${"[group]"} configuration option instead.`;Bn(`Configuration options ${Vn(Br)} are deprecated.`,Fr,{hint:e})}return}if(t.length){const e=Yn`Remove them from the document's ${"[respecConfig]"} to silence this warning.`;Bn(Yn`Configuration options ${Vn(t)} are superseded by ${"[group]"} and will be overridden by ReSpec.`,Fr,{hint:e})}const{group:n}=e,r=Array.isArray(n)?await async function(e){const t=await Promise.all(e.map(Hr)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(e=>e))for(const t of Object.keys(n))n[t].push(e[t]);return n}(n):await Hr(n);Object.assign(e,r)}});function Vr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Bn(t,"core/templates/show-link"),void console.warn(t,e)}return on`
      ${e.key}
      ${e.data?e.data.map(Zr):Zr(e)} `}function Zr(e){return on`
      @@ -582,7 +582,7 @@ window.respecVersion="26.12.1",function(){"use strict";const e=!!window.require; ${e.github?ms(e,t):""} ${e.sotdAfterWGinfo?t.additionalContent:""} ${t.additionalSections} - `;const bs="w3c/headers",ys=new Intl.DateTimeFormat(["en-AU"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});function ws(e){return new URL(e,"https://www.w3.org/").href}const vs={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"},ks={"Member-SUBM":"/Submission","Team-SUBM":"/TeamSubmission/",finding:"/2001/tag/doc","draft-finding":"/2001/tag/doc"},$s={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",PER:"w3p:PER",RSCND:"w3p:RSCND"},xs={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",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",PER:"Proposed Edited Recommendation",REC:"Recommendation",RSCND:"Rescinded Recommendation",unofficial:"Unofficial Draft",base:"",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"},_s={...xs,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft","FPWD-NOTE":"First Public Working Group Note","LC-NOTE":"Last Call Working Draft"},Cs=["FPWD-NOTE","WG-NOTE"],Ss=["FPWD","WD"],Es=["FPLC","LC","CR","CRD","PR","PER","REC"],Ts=["CG-DRAFT","CG-FINAL"],Rs=["BG-DRAFT","BG-FINAL"],As=[...Ts,...Rs],Ls=["base",...Ts,...Rs,"draft-finding","finding","MO","unofficial"],Ps=["ED","IG-NOTE"],Is=new Map([["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"}]]),Ds=["PP2017","PP2020"],Ns=Object.freeze({id:"",alt:"",href:"",src:"",height:"48",width:"72"});function Os(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=dn.format(r);return new Date(e)}return Fn(Yn`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,bs),new Date(dn.format(new Date))}function js(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.firstChild.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){Bn(Yn`ReSpec does not support automated SotD generation for TAG findings.`,bs,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var zs=Object.freeze({__proto__:null,name:bs,W3CNotes:Cs,maybeRecTrack:Ss,recTrackStatus:Es,cgStatus:Ts,bgStatus:Rs,cgbgStatus:As,run:function(e){if(!e.specStatus){const e=Yn`Please select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;Fn(Yn`Missing required configuration: ${"[specStatus]"}.`,bs,{hint:e})}if(e.isUnofficial="unofficial"===e.specStatus,e.isUnofficial&&!Array.isArray(e.logos)&&(e.logos=[]),e.isUnofficial){if(e.license&&!Is.has(e.license)){const t=Yn`The ${"[license]"} configuration option has an invalid value: "\`${e.license}\`". Defaulting to "cc-by".`,n=Yn`Please explicitly set ${"[license]"} to one of: ${Gn([...Is.keys()])}.`;Fn(t,bs,{hint:n}),e.license="cc-by"}void 0===e.license&&(e.license="cc-by")}if(e.isCCBY="cc-by"===e.license,e.isW3CSoftAndDocLicense="w3c-software-doc"===e.license,!e.isUnofficial&&["cc-by"].includes(e.license)){const t=Yn`Please set ${"[license]"} to "w3c-software-doc" instead.`;Fn(Yn`License "\`${e.license}\`" is not allowed for W3C Specifications.`,bs,{hint:t})}if(e.licenseInfo=Is.get(e.license),e.isCGBG=As.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isBasic="base"===e.specStatus,e.isRegular=!e.isCGBG&&!e.isBasic,e.isRegular&&!e.shortName){Fn("Missing required configuration: `shortName`",bs)}if(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/")){const t="Web Platform Tests have moved to a new Github Organization at https://github.com/web-platform-tests. ",n=Yn`Please update your ${"[testSuiteURI]"} to point to the new tests repository (e.g., ${"https://wpt.live/"+e.shortName}).`;Bn(t,bs,{hint:n})}}if(e.subtitle||(e.subtitle=""),e.publishDate=Os(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=ys.format(e.publishDate),e.isNoTrack=Ls.includes(e.specStatus),e.isRecTrack=!e.noRecTrack&&Es.concat(Ss).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({...Ns,...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({...Ns,...t})}if(e.isSubmission=e.isMemberSubmission||e.isTeamSubmission,e.anOrA=Ps.includes(e.specStatus)?"an":"a",e.isTagFinding="finding"===e.specStatus||"draft-finding"===e.specStatus,e.isRecTrack&&!function(e){return e.github||e.otherLinks&&e.otherLinks.find(e=>e.data.find(e=>e.href&&e.href.toString().match(/^https:\/\/github\.com\/.*\/issues/)))}(e)){const e=Yn`Please add the ${"[github]"} configuration option to document's ${"[respecConfig]"}.`;Fn(Yn`Missing link to GitHub in head of document.`,bs,{hint:e})}if(!e.edDraftURI&&(e.edDraftURI="","ED"===e.specStatus)){Bn("Editor's Drafts should set edDraftURI.",bs)}const t=vs[e.specStatus]||e.specStatus,n=ks[e.specStatus]||"/TR";if(e.isRegular){const{shortName:r,publishDate:s}=e,i=e.publishDate.getUTCFullYear(),o=`${t}-${r}-${xn(s)}`;e.thisVersion=ws(`${n}/${i}/${o}/`)}"ED"===e.specStatus&&(e.thisVersion=e.edDraftURI);const r=`${n}/${e.shortName}`;if(null!==e.latestVersion&&(e.latestVersion=e.latestVersion?ws(""+e.latestVersion):ws(`${n}/${e.shortName}/`)),e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){Fn("`previousPublishDate` is set, but not `previousMaturity`.",bs)}e.previousPublishDate=Os(e,"previousPublishDate");const t=vs[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=dn.format(e.publishDate);e.thisVersion=ws(`${r}-${t}`);const n=dn.format(e.previousPublishDate);e.prevVersion=ws(`${r}-${n}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const r=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,i=xn(e.previousPublishDate);e.prevVersion=ws(`${n}/${r}/${t}-${s}-${i}/`)}}else{if(!(e.specStatus.endsWith("NOTE")||"FPWD"===e.specStatus||"FPLC"===e.specStatus||"ED"===e.specStatus||e.noRecTrack||e.isNoTrack||e.isSubmission)){const e=Yn`Add ${"[previousMaturity]"} and ${"[previousPublishDate]"} to the document's ${"[respecConfig]"}.`;Fn("This document is on the W3C Recommendation Track, but is missing the required 'Previous Version' link.",bs,{hint:e})}e.prevVersion||(e.prevVersion="")}if(e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=ws(`${n}/${e.prevRecShortname}`)),e.formerEditors||(e.formerEditors=[]),e.editors)for(let t=0;t1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.alternateFormats?.forEach(e=>{if(!e.uri||!e.label){Fn("All alternate formats must have a uri and a label.",bs)}}),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.longStatus=_s[e.specStatus],e.textStatus=xs[e.specStatus],$s[e.specStatus]&&(e.rdfStatus=$s[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){const e=Yn`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;Fn("Recommendations must have an errata link.",bs,{hint:e})}e.prependW3C=!e.isBasic&&!e.isUnofficial,e.isED="ED"===e.specStatus,e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isPR="PR"===e.specStatus,e.isPER="PER"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Cs.includes(e.specStatus),e.isIGNote="IG-NOTE"===e.specStatus,e.dashDate=dn.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=dn.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every(e=>Ds.includes(e))){const e=Yn`Invalid ${"[wgPatentPolicy]"} value(s): ${Vn([...t].filter(e=>!Ds.includes(e)))}.`,n=`Please use one of: ${Gn(Ds)}.`;Fn(e,bs,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=Yn`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;Fn(e,bs,{hint:n})}e.wgPatentPolicy=[...t][0]}(e);const s={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&Tn(e.alternateFormats.map(({label:e})=>e),(t,n)=>{const r=e.alternateFormats[n];return on`e.data.find(e=>e.href&&e.href.toString().match(/^https:\/\/github\.com\/.*\/issues/)))}(e)){const e=Yn`Please add the ${"[github]"} configuration option to document's ${"[respecConfig]"}.`;Fn(Yn`Missing link to GitHub in head of document.`,bs,{hint:e})}if(!e.edDraftURI&&(e.edDraftURI="","ED"===e.specStatus)){Bn("Editor's Drafts should set edDraftURI.",bs)}const t=vs[e.specStatus]||e.specStatus,n=ks[e.specStatus]||"/TR";if(e.isRegular){const{shortName:r,publishDate:s}=e,i=e.publishDate.getUTCFullYear(),o=`${t}-${r}-${xn(s)}`;e.thisVersion=ws(`${n}/${i}/${o}/`)}"ED"===e.specStatus&&(e.thisVersion=e.edDraftURI);const r=`${n}/${e.shortName}`;if(null!==e.latestVersion&&(e.latestVersion=e.latestVersion?ws(""+e.latestVersion):ws(`${n}/${e.shortName}/`)),e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){Fn("`previousPublishDate` is set, but not `previousMaturity`.",bs)}e.previousPublishDate=Os(e,"previousPublishDate");const t=vs[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=dn.format(e.publishDate);e.thisVersion=ws(`${r}-${t}`);const n=dn.format(e.previousPublishDate);e.prevVersion=ws(`${r}-${n}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const r=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,i=xn(e.previousPublishDate);e.prevVersion=ws(`${n}/${r}/${t}-${s}-${i}/`)}}else{if(!(e.specStatus.endsWith("NOTE")||"FPWD"===e.specStatus||"FPLC"===e.specStatus||"ED"===e.specStatus||e.noRecTrack||e.isNoTrack||e.isSubmission)){const e=Yn`Add ${"[previousMaturity]"} and ${"[previousPublishDate]"} to the document's ${"[respecConfig]"}.`;Fn("This document is on the W3C Recommendation Track, but is missing the required 'Previous Version' link.",bs,{hint:e})}e.prevVersion||(e.prevVersion="")}if(e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=ws(`${n}/${e.prevRecShortname}`)),e.formerEditors||(e.formerEditors=[]),e.editors)for(let t=0;t1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.alternateFormats?.forEach(e=>{if(!e.uri||!e.label){Fn("All alternate formats must have a uri and a label.",bs)}}),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.longStatus=_s[e.specStatus],e.textStatus=xs[e.specStatus],$s[e.specStatus]&&(e.rdfStatus=$s[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){const e=Yn`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;Fn("Recommendations must have an errata link.",bs,{hint:e})}e.prependW3C=!e.isBasic&&!e.isUnofficial,e.isED="ED"===e.specStatus,e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isPR="PR"===e.specStatus,e.isPER="PER"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Ss.includes(e.specStatus),e.isIGNote="IG-NOTE"===e.specStatus,e.dashDate=dn.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=dn.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every(e=>Ds.includes(e))){const e=Yn`Invalid ${"[wgPatentPolicy]"} value(s): ${Vn([...t].filter(e=>!Ds.includes(e)))}.`,n=`Please use one of: ${Gn(Ds)}.`;Fn(e,bs,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=Yn`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;Fn(e,bs,{hint:n})}e.wgPatentPolicy=[...t][0]}(e);const s={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&Tn(e.alternateFormats.map(({label:e})=>e),(t,n)=>{const r=e.alternateFormats[n];return on``})}},i=(e.isCGBG?us:cs)(e,s);document.body.prepend(i),document.body.classList.add("h-entry");const o=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!o.id){Fn("A Status of This Document must include at least on custom paragraph.",bs,{elements:[o],hint:"Add a `

      ` in the 'sotd' section that reflects the status of this specification."})}o.id=o.id||"sotd",o.classList.add("introductory");const a=[e.wg,e.wgURI,e.wgPatentURI];if(a.some(e=>Array.isArray(e))&&!a.every(e=>Array.isArray(e))){const e=Yn`Use the ${"[group]"} option with an array instead.`;Fn(Yn`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,bs,{hint:e})}if(e.isCGBG&&!e.wg){Fn(Yn`${"[wg]"} configuration option is required for this kind of document.`,bs)}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgHTML=Tn(e.wg,(t,n)=>on`the ${t}`),e.wgPatentHTML=Tn(e.wg,(t,n)=>on`a public list of any patent disclosures (${t})`)):(e.multipleWGs=!1,e.wg&&(e.wgHTML=on`the ${e.wg}`)),"PR"===e.specStatus&&!e.crEnd){Fn(Yn`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,bs)}if("CR"===e.specStatus&&!e.crEnd){Fn(Yn`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,bs)}if(e.crEnd=Os(e,"crEnd"),e.humanCREnd=ys.format(e.crEnd),"PR"===e.specStatus&&!e.prEnd){Fn(Yn`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,bs)}if(e.prEnd=Os(e,"prEnd"),e.humanPREnd=ys.format(e.prEnd),"PER"===e.specStatus&&!e.perEnd){Fn(Yn`${"[specStatus]"} is "PR", but no ${"[prEnd]"} is specified`,bs)}if(e.perEnd=Os(e,"perEnd"),e.humanPEREnd=ys.format(e.perEnd),e.hasOwnProperty("updateableRec")){const t=Yn`Add an ${"[`updateable-rec`|#updateable-rec-class]"} CSS class to the Status of This Document section instead.`;Bn("Configuration option `updateableRec` is deprecated.",bs,{hint:t}),e.updateableRec&&o.classList.add("updateable-rec")}e.updateableRec=o.classList.contains("updateable-rec");const c=["addition","correction"];if("REC"===e.specStatus&&e.revisionTypes?.length>0){if(e.revisionTypes.some(e=>!c.includes(e))){const t=Yn`${"[specStatus]"} is "REC" with unknown ${"[revisionTypes]"}: '${Gn(e.revisionTypes.filter(e=>!c.includes(e)))}'.`,n=Yn`The valid values for ${"[revisionTypes]"} are: ${Gn(c)}.`;Fn(t,bs,{hint:n})}if(e.revisionTypes.includes("addition")&&!e.updateableRec){Fn(Yn`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as a allowing new features.`,bs)}}if("REC"===e.specStatus&&e.updateableRec&&e.revisionTypes&&e.revisionTypes.length>0&&!e.revisedRecEnd){Fn(Yn`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,bs)}if(e.revisedRecEnd=Os(e,"revisedRecEnd"),e.humanRevisedRecEnd=ys.format(e.revisedRecEnd),e.recNotExpected=!(!e.noRecTrack&&!e.recNotExpected)||!e.isRecTrack&&"WD"==t&&"FPWD-NOTE"!==e.specStatus,e.noRecTrack&&Es.includes(e.specStatus)){const t=Yn`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=Gn(Es,{quotes:!0});Fn(t,bs,{hint:`Status **can't** be any of: ${n}.`})}if(e.isIGNote&&!e.charterDisclosureURI){Fn(Yn`IG-NOTEs must link to charter's disclosure section using ${"[charterDisclosureURI]"}.`,bs)}if(o.classList.contains("override")||on.bind(o)`${function(e,t){const n={...js(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?gs:ps)(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=Yn`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;Fn(Yn`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,bs,{hint:e})}if(!e.implementationReportURI&&e.isPR){Bn(Yn`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`,bs)}Xn("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const Ws={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Ms="w3c/defaults",qs={src:"https://www.w3.org/StyleSheets/TR/2016/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},Us={lint:{"privsec-section":!0,"wpt-tests-exist":!1,a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:""};var Fs=Object.freeze({__proto__:null,name:Ms,run:function(e){const t=!1!==e.lint&&{...Ws.lint,...Us.lint,...e.lint};Object.assign(e,{...Ws,...Us,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const t=e.specStatus??"";[...Ss,...Es,...Cs].includes(t)&&e.logos?.unshift(qs);"ED"===t&&0===e.logos?.length&&e.logos.push(qs)}(e),e.groupType&&e.specStatus&&function(e){const{specStatus:t,groupType:n}=e;switch(n){case"cg":if(![...As,"unofficial"].includes(t)){const n=Yn`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=Gn(Ts,{quotes:!0});Fn(n,Ms,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Rs,"unofficial"].includes(t)){const n=Yn`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=Gn(Rs,{quotes:!0});Fn(n,Ms,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(As.includes(t)){const e=Yn`Please see ${"[specStatus]"} for appropriate values for this type of group.`;Fn(Yn`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,Ms,{hint:e})}}}(e)}});var Bs=String.raw`@keyframes pop{ + >`)):(e.multipleWGs=!1,e.wg&&(e.wgHTML=on`the ${e.wg}`)),"PR"===e.specStatus&&!e.crEnd){Fn(Yn`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,bs)}if("CR"===e.specStatus&&!e.crEnd){Fn(Yn`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,bs)}if(e.crEnd=Os(e,"crEnd"),e.humanCREnd=ys.format(e.crEnd),"PR"===e.specStatus&&!e.prEnd){Fn(Yn`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,bs)}if(e.prEnd=Os(e,"prEnd"),e.humanPREnd=ys.format(e.prEnd),"PER"===e.specStatus&&!e.perEnd){Fn(Yn`${"[specStatus]"} is "PR", but no ${"[prEnd]"} is specified`,bs)}if(e.perEnd=Os(e,"perEnd"),e.humanPEREnd=ys.format(e.perEnd),e.hasOwnProperty("updateableRec")){const t=Yn`Add an ${"[`updateable-rec`|#updateable-rec-class]"} CSS class to the Status of This Document section instead.`;Bn("Configuration option `updateableRec` is deprecated.",bs,{hint:t}),e.updateableRec&&o.classList.add("updateable-rec")}e.updateableRec=o.classList.contains("updateable-rec");const c=["addition","correction"];if("REC"===e.specStatus&&e.revisionTypes?.length>0){if(e.revisionTypes.some(e=>!c.includes(e))){const t=Yn`${"[specStatus]"} is "REC" with unknown ${"[revisionTypes]"}: '${Gn(e.revisionTypes.filter(e=>!c.includes(e)))}'.`,n=Yn`The valid values for ${"[revisionTypes]"} are: ${Gn(c)}.`;Fn(t,bs,{hint:n})}if(e.revisionTypes.includes("addition")&&!e.updateableRec){Fn(Yn`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as a allowing new features.`,bs)}}if("REC"===e.specStatus&&e.updateableRec&&e.revisionTypes&&e.revisionTypes.length>0&&!e.revisedRecEnd){Fn(Yn`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,bs)}if(e.revisedRecEnd=Os(e,"revisedRecEnd"),e.humanRevisedRecEnd=ys.format(e.revisedRecEnd),e.recNotExpected=!(!e.noRecTrack&&!e.recNotExpected)||!e.isRecTrack&&"WD"==t&&"FPWD-NOTE"!==e.specStatus,e.noRecTrack&&Es.includes(e.specStatus)){const t=Yn`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=Gn(Es,{quotes:!0});Fn(t,bs,{hint:`Status **can't** be any of: ${n}.`})}if(e.isIGNote&&!e.charterDisclosureURI){Fn(Yn`IG-NOTEs must link to charter's disclosure section using ${"[charterDisclosureURI]"}.`,bs)}if(o.classList.contains("override")||on.bind(o)`${function(e,t){const n={...js(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?gs:ps)(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=Yn`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;Fn(Yn`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,bs,{hint:e})}if(!e.implementationReportURI&&e.isPR){Bn(Yn`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`,bs)}Xn("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const Ws={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Ms="w3c/defaults",qs={src:"https://www.w3.org/StyleSheets/TR/2016/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},Us={lint:{"privsec-section":!0,"wpt-tests-exist":!1,a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:""};var Fs=Object.freeze({__proto__:null,name:Ms,run:function(e){const t=!1!==e.lint&&{...Ws.lint,...Us.lint,...e.lint};Object.assign(e,{...Ws,...Us,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const t=e.specStatus??"";[...Cs,...Es,...Ss].includes(t)&&e.logos?.unshift(qs);"ED"===t&&0===e.logos?.length&&e.logos.push(qs)}(e),e.groupType&&e.specStatus&&function(e){const{specStatus:t,groupType:n}=e;switch(n){case"cg":if(![...As,"unofficial"].includes(t)){const n=Yn`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=Gn(Ts,{quotes:!0});Fn(n,Ms,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Rs,"unofficial"].includes(t)){const n=Yn`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=Gn(Rs,{quotes:!0});Fn(n,Ms,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(As.includes(t)){const e=Yn`Please see ${"[specStatus]"} for appropriate values for this type of group.`;Fn(Yn`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,Ms,{hint:e})}}}(e)}});var Bs=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -671,9 +671,9 @@ h2>a.self-link,h3>a.self-link,h4>a.self-link,h5>a.self-link,h6>a.self-link{left: Dokument obsolet machen. Eine Liste der aktuellen Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann im W3C technical reports index unter - https://www.w3.org/TR/ abgerufen werden.`}};Object.keys(Js).forEach(e=>{r[e]||(r[e]={}),Object.assign(r[e],Js[e])});var Ks=Object.freeze({__proto__:null,name:"w3c/l10n"});const Xs="core/github";let Qs,ei;const ti=new Promise((e,t)=>{Qs=e,ei=e=>{Fn(e,Xs),t(new Error(e))}}),ni=$n({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},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:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var ri=Object.freeze({__proto__:null,name:Xs,github:ti,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void Qs(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=Yn`Config option ${"[github]"} is missing property \`repoURL\`.`;return void ei(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=Yn`${"[github]"} configuration option is not a valid URL? (${n}).`;return void ei(e)}if("https://github.com"!==t.origin){const e=Yn`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void ei(e)}const[r,s]=t.pathname.split("/").filter(e=>e);if(!r||!s){const e=Yn`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void ei(e)}const i=e.github.branch||"gh-pages",o=new URL("./issues/",t).href,a={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:o,atRiskBase:o,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s},c={key:ni.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:ni.file_a_bug,href:a.issueBase},{value:ni.commit_history,href:new URL("./commits/"+i,t.href).href},{value:"Pull requests",href:a.pullBase}]};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{Bn("The `githubAPI` configuration option is private and should not be added manually.",Xs)}const u={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`};Qs(u);const d={...a,...e,github:u,githubAPI:l};Object.assign(e,d),e.otherLinks.unshift(c)}});const si="core/data-include";function ii(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=Cn(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=mr(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&wr(e),n&&e.replaceWith(...e.childNodes)}(r,s,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach(t=>e.removeAttribute(t))}(r)}var oi=Object.freeze({__proto__:null,name:si,run:async function(){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);ii(await e.text(),n,t)}catch(n){const r=`\`data-include\` failed: \`${t}\` (${n.message}).`;console.error(r,e,n),Fn(r,si,{elements:[e]})}});await Promise.all(t)}});const ai="core/title",ci=$n({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var li=Object.freeze({__proto__:null,name:ai,run:function(e){const t=document.querySelector("h1#title")||on`

      `;if(t.isConnected&&""===t.textContent.trim()){Fn('The document is missing a title, so using a default title. To fix this, please give your document a ``. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',ai,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||""+ci.default_title);let n=kn(t.textContent);if(e.isPreview&&e.prNumber){const r=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=on` + https://www.w3.org/TR/ abgerufen werden.`}};Object.keys(Js).forEach(e=>{r[e]||(r[e]={}),Object.assign(r[e],Js[e])});var Ks=Object.freeze({__proto__:null,name:"w3c/l10n"});const Xs="core/github";let Qs,ei;const ti=new Promise((e,t)=>{Qs=e,ei=e=>{Fn(e,Xs),t(new Error(e))}}),ni=$n({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},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:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var ri=Object.freeze({__proto__:null,name:Xs,github:ti,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void Qs(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=Yn`Config option ${"[github]"} is missing property \`repoURL\`.`;return void ei(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=Yn`${"[github]"} configuration option is not a valid URL? (${n}).`;return void ei(e)}if("https://github.com"!==t.origin){const e=Yn`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void ei(e)}const[r,s]=t.pathname.split("/").filter(e=>e);if(!r||!s){const e=Yn`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void ei(e)}const i=e.github.branch||"gh-pages",o=new URL("./issues/",t).href,a={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:o,atRiskBase:o,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s},c={key:ni.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:ni.file_a_bug,href:a.issueBase},{value:ni.commit_history,href:new URL("./commits/"+i,t.href).href},{value:"Pull requests",href:a.pullBase}]};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{Bn("The `githubAPI` configuration option is private and should not be added manually.",Xs)}const u={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`};Qs(u);const d={...a,...e,github:u,githubAPI:l};Object.assign(e,d),e.otherLinks.unshift(c)}});const si="core/data-include";function ii(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=Sn(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=mr(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&wr(e),n&&e.replaceWith(...e.childNodes)}(r,s,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach(t=>e.removeAttribute(t))}(r)}var oi=Object.freeze({__proto__:null,name:si,run:async function(){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);ii(await e.text(),n,t)}catch(n){const r=`\`data-include\` failed: \`${t}\` (${n.message}).`;console.error(r,e,n),Fn(r,si,{elements:[e]})}});await Promise.all(t)}});const ai="core/title",ci=$n({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var li=Object.freeze({__proto__:null,name:ai,run:function(e){const t=document.querySelector("h1#title")||on`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Fn('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',ai,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||""+ci.default_title);let n=kn(t.textContent);if(e.isPreview&&e.prNumber){const r=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=on` Preview of PR <a href="${r}">#${e.prNumber}</a>: - `;t.prepend(...s),n=`Preview of PR #${e.prNumber}: ${n}`}document.title=n,e.title=n}(e,t),document.body.prepend(t)}});const ui="w3c/level",di=$n({en:{level:"Level"}});var pi=Object.freeze({__proto__:null,name:ui,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){Fn(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,ui,{title:"Invalid level config.",elements:[t]})}else t.append(` ${di.level} ${n}`),document.title=`${document.title} ${di.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const fi="w3c/abstract",hi=$n({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var mi=Object.freeze({__proto__:null,name:fi,run:async function(){const e=document.getElementById("abstract");if(!e){return void Fn('Document must have one element with `id="abstract"`.',fi)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=hi.abstract,e.prepend(t))}});var gi=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=Cn(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const bi="core/dfn-abbr";function yi(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter(e=>e.trim()).concat(t).join("|")}var wi=Object.freeze({__proto__:null,name:bi,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;switch(e){case"dfn":yi(t);break;default:Fn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,bi,{elements:[t],title:"Error: unsupported."})}}}});const vi=/^[a-z]+(\s+[a-z]+)+\??$/,ki=/\B"([^"]*)"\B/,$i=/(\w+)\((.*)\)$/,xi=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,_i=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ci=/^(?:\w+)\??$/,Si=/^(\w+)\["([\w- ]*)"\]$/,Ei=/\.?(\w+\(.*\)$)/,Ti=/\/(.+)/,Ri=/\[\[.+\]\]/;function Ai(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return on`<a + `;t.prepend(...s),n=`Preview of PR #${e.prNumber}: ${n}`}document.title=n,e.title=n}(e,t),document.body.prepend(t)}});const ui="w3c/level",di=$n({en:{level:"Level"}});var pi=Object.freeze({__proto__:null,name:ui,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){Fn(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,ui,{title:"Invalid level config.",elements:[t]})}else t.append(` ${di.level} ${n}`),document.title=`${document.title} ${di.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const fi="w3c/abstract",hi=$n({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var mi=Object.freeze({__proto__:null,name:fi,run:async function(){const e=document.getElementById("abstract");if(!e){return void Fn('Document must have one element with `id="abstract"`.',fi)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=hi.abstract,e.prepend(t))}});var gi=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=Sn(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const bi="core/dfn-abbr";function yi(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter(e=>e.trim()).concat(t).join("|")}var wi=Object.freeze({__proto__:null,name:bi,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;switch(e){case"dfn":yi(t);break;default:Fn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,bi,{elements:[t],title:"Error: unsupported."})}}}});const vi=/^[a-z]+(\s+[a-z]+)+\??$/,ki=/\B"([^"]*)"\B/,$i=/(\w+)\((.*)\)$/,xi=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,_i=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Si=/^(?:\w+)\??$/,Ci=/^(\w+)\["([\w- ]*)"\]$/,Ei=/\.?(\w+\(.*\)$)/,Ti=/\/(.+)/,Ri=/\[\[.+\]\]/;function Ai(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return on`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" @@ -715,7 +715,7 @@ h2>a.self-link,h3>a.self-link,h4>a.self-link,h5>a.self-link,h6>a.self-link{left: data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function zi(e){let t;try{t=function(e){const t=Ri.test(e),n=t?Ti:Ei,[r,s]=e.split(n);if(t&&r&&!s)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(s).filter(e=>e&&e.trim()).map(e=>e.trim()),o=!e.includes("/"),a=[];for(;i.length;){const t=i.pop();if($i.test(t)){const[,e,n]=t.match($i),r=n.split(/,\s*/).filter(e=>e);a.push({type:"method",identifier:e,args:r,renderParent:o})}else if(Si.test(t)){const[,e,n]=t.match(Si);a.push({type:"enum",identifier:e,enumValue:n,renderParent:o})}else if(ki.test(t)){const[,e]=t.match(ki);o?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:o})}else if(xi.test(t)){const[,e,n]=t.match(xi),r=n?"method":"attribute",s=n?.slice(1,-1).split(/,\s*/).filter(e=>e);a.push({type:"internal-slot",slotType:r,identifier:e,args:s,renderParent:o})}else if(_i.test(t)&&i.length){const[,e]=t.match(_i);a.push({type:"attribute",identifier:e,renderParent:o})}else if(vi.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:o,nullable:e})}else{if(!Ci.test(t)||0!==i.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:o,nullable:e})}}}return a.forEach((e,t,n)=>{e.parent=n[t+1]||null}),a.reverse()}(e)}catch(t){const n=on`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Fn(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=on(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Ai(e);t&&r.push(t);break}case"attribute":r.push(Ii(e));break;case"internal-slot":r.push(Li(e));break;case"method":r.push(Di(e));break;case"enum":r.push(Ni(e));break;case"exception":r.push(Oi(e));break;case"idl-primitive":r.push(ji(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Wi=new Set(["alias","reference"]),Mi=async function(){return await rn.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 qi={get ready(){return Mi},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Wi.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(!Wi.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),s=await n.openCursor(r);return s?s.value:s},async addAll(e){if(!e)return;const t={alias:[],reference:[]};for(const n of Object.keys(e)){const r={id:n,...e[n]};r.aliasOf?t.alias.push(r):t.reference.push(r)}const n=[...Wi].flatMap(e=>t[e].map(t=>this.add(e,t)));await Promise.all(n)},async add(e,t){if(!Wi.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),s=n.transaction(e,"readwrite").store;return r?await s.put(t):await s.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Wi],n=e.transaction(t,"readwrite"),r=t.map(e=>n.objectStore(e).clear());await Promise.all(r)}},Ui={},Fi=new URL("https://api.specref.org/bibrefs?refs="),Bi=fn({hint:"dns-prefetch",href:Fi.origin});let Hi;document.head.appendChild(Bi);const Gi=new Promise(e=>{Hi=e});async function Vi(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(Fi.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const s=await r.json();try{await qi.addAll(s)}catch(e){console.error(e)}return s}async function Zi(e){const t=await Gi;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Zi(n.aliasOf):n}var Yi=Object.freeze({__proto__:null,biblio:Ui,name:"core/biblio",updateFromNetwork:Vi,resolveRef:Zi,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map(e=>e.toLowerCase()));Array.from(this.conf.informativeReferences).filter(t=>e.has(t.toLowerCase())).forEach(e=>this.conf.informativeReferences.delete(e))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Ui;const e=Object.keys(this.conf.localBiblio).filter(e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf")).map(e=>this.conf.localBiblio[e].aliasOf).filter(e=>!this.conf.localBiblio.hasOwnProperty(e));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter(e=>!this.conf.localBiblio.hasOwnProperty(e)).concat(e).sort())),r=await async function(e){const t=[];try{await qi.ready;const n=e.map(async e=>({id:e,data:await qi.find(e)}));t.push(...await Promise.all(n))}catch(n){t.push(...e.map(e=>({id:e,data:null}))),console.warn(n)}return t}(n),s={hasData:[],noData:[]};r.forEach(e=>{(e.data?s.hasData:s.noData).push(e)}),s.hasData.forEach(e=>{Ui[e.id]=e.data});const i=s.noData.map(e=>e.id);if(i.length){const e=await Vi(i,{forceUpdate:!0});Object.assign(Ui,e)}Object.assign(Ui,this.conf.localBiblio),(()=>{Hi(this.conf.biblio)})()}}});const Ji="core/render-biblio",Ki=$n({en:{info_references:"Informative references",norm_references:"Normative references",references:"References"},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias"},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"}}),Xi=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"]]),Qi=(eo=".",e=>{const t=e.trim();return!t||t.endsWith(eo)?t:t+eo});var eo;function to(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(no)),s=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),i=s.concat(r).sort((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase())),o=on`<section> + >`}function zi(e){let t;try{t=function(e){const t=Ri.test(e),n=t?Ti:Ei,[r,s]=e.split(n);if(t&&r&&!s)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(s).filter(e=>e&&e.trim()).map(e=>e.trim()),o=!e.includes("/"),a=[];for(;i.length;){const t=i.pop();if($i.test(t)){const[,e,n]=t.match($i),r=n.split(/,\s*/).filter(e=>e);a.push({type:"method",identifier:e,args:r,renderParent:o})}else if(Ci.test(t)){const[,e,n]=t.match(Ci);a.push({type:"enum",identifier:e,enumValue:n,renderParent:o})}else if(ki.test(t)){const[,e]=t.match(ki);o?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:o})}else if(xi.test(t)){const[,e,n]=t.match(xi),r=n?"method":"attribute",s=n?.slice(1,-1).split(/,\s*/).filter(e=>e);a.push({type:"internal-slot",slotType:r,identifier:e,args:s,renderParent:o})}else if(_i.test(t)&&i.length){const[,e]=t.match(_i);a.push({type:"attribute",identifier:e,renderParent:o})}else if(vi.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:o,nullable:e})}else{if(!Si.test(t)||0!==i.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:o,nullable:e})}}}return a.forEach((e,t,n)=>{e.parent=n[t+1]||null}),a.reverse()}(e)}catch(t){const n=on`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Fn(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=on(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Ai(e);t&&r.push(t);break}case"attribute":r.push(Ii(e));break;case"internal-slot":r.push(Li(e));break;case"method":r.push(Di(e));break;case"enum":r.push(Ni(e));break;case"exception":r.push(Oi(e));break;case"idl-primitive":r.push(ji(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Wi=new Set(["alias","reference"]),Mi=async function(){return await rn.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 qi={get ready(){return Mi},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Wi.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(!Wi.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),s=await n.openCursor(r);return s?s.value:s},async addAll(e){if(!e)return;const t={alias:[],reference:[]};for(const n of Object.keys(e)){const r={id:n,...e[n]};r.aliasOf?t.alias.push(r):t.reference.push(r)}const n=[...Wi].flatMap(e=>t[e].map(t=>this.add(e,t)));await Promise.all(n)},async add(e,t){if(!Wi.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),s=n.transaction(e,"readwrite").store;return r?await s.put(t):await s.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Wi],n=e.transaction(t,"readwrite"),r=t.map(e=>n.objectStore(e).clear());await Promise.all(r)}},Ui={},Fi=new URL("https://api.specref.org/bibrefs?refs="),Bi=fn({hint:"dns-prefetch",href:Fi.origin});let Hi;document.head.appendChild(Bi);const Gi=new Promise(e=>{Hi=e});async function Vi(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(Fi.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const s=await r.json();try{await qi.addAll(s)}catch(e){console.error(e)}return s}async function Zi(e){const t=await Gi;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Zi(n.aliasOf):n}var Yi=Object.freeze({__proto__:null,biblio:Ui,name:"core/biblio",updateFromNetwork:Vi,resolveRef:Zi,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map(e=>e.toLowerCase()));Array.from(this.conf.informativeReferences).filter(t=>e.has(t.toLowerCase())).forEach(e=>this.conf.informativeReferences.delete(e))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Ui;const e=Object.keys(this.conf.localBiblio).filter(e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf")).map(e=>this.conf.localBiblio[e].aliasOf).filter(e=>!this.conf.localBiblio.hasOwnProperty(e));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter(e=>!this.conf.localBiblio.hasOwnProperty(e)).concat(e).sort())),r=await async function(e){const t=[];try{await qi.ready;const n=e.map(async e=>({id:e,data:await qi.find(e)}));t.push(...await Promise.all(n))}catch(n){t.push(...e.map(e=>({id:e,data:null}))),console.warn(n)}return t}(n),s={hasData:[],noData:[]};r.forEach(e=>{(e.data?s.hasData:s.noData).push(e)}),s.hasData.forEach(e=>{Ui[e.id]=e.data});const i=s.noData.map(e=>e.id);if(i.length){const e=await Vi(i,{forceUpdate:!0});Object.assign(Ui,e)}Object.assign(Ui,this.conf.localBiblio),(()=>{Hi(this.conf.biblio)})()}}});const Ji="core/render-biblio",Ki=$n({en:{info_references:"Informative references",norm_references:"Normative references",references:"References"},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias"},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"}}),Xi=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"]]),Qi=(eo=".",e=>{const t=e.trim();return!t||t.endsWith(eo)?t:t+eo});var eo;function to(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(no)),s=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),i=s.concat(r).sort((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase())),o=on`<section> <h3>${t}</h3> <dl class="bibliography">${i.map(so)}</dl> </section>`;An(o,"",t);return function(e,t){e.map(({ref:e,refcontent:n})=>{const r="#bib-"+e.toLowerCase(),s=t.get(n.id).map(e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`).join(",");return{refUrl:r,elems:document.querySelectorAll(s),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"})})}(s,function(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)}(n)),function(e){e.forEach(({ref:e})=>{const t=[...document.querySelectorAll(`a.bibref[href="#bib-${e.toLowerCase()}"]`)].filter(({textContent:t})=>t.toLowerCase()===e.toLowerCase());Fn(`Bad reference: [\`${e}\`] (appears ${t.length} times)`,Ji),console.warn("Bad references: ",t)})}(r),o}function no(e){let t=Ui[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Fn(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Ji)}else n=t.aliasOf,t=Ui[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function ro(e,t){const n=e.replace(/^(!|\?)/,""),r="#bib-"+n.toLowerCase(),s=on`<cite @@ -730,13 +730,13 @@ h2>a.self-link,h3>a.self-link,h4>a.self-link,h5>a.self-link,h6>a.self-link{left: ><a data-xref-type="${i}" data-xref-for="${o}" >${a}</a ></code - >`}function vo(e){const t=kn(e),n=on`<em class="rfc2119">${t}</em>`;return co[t]=!0,n}function ko(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?on`<a href="${t}"></a>`:on`<a data-cite="${t}"></a>`}function $o(e,t){const n=kn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=zi(n);return!!t.parentElement.closest("dfn")?Eo(`\`${r.textContent}\``):r}function xo(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,i]=r.split("|").map(kn),{type:o,illegal:a}=In(s,t.parentElement),c=ro(s,i),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Bn("Normative references in informative sections are not allowed. ",ao,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==o||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function _o(e,t,n){return"ABBR"===t.parentElement.tagName?e:on`<abbr title="${n.get(e)}">${e}</abbr>`}function Co(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return on`<var data-type="${r}">${n}</var>`}function So(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(kn).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),i=n.substring(r+1,n.length);return[t(s),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,i]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],o=To(i),a=n?kn(n):null;let c="dfn";switch(!0){case/task\s+source$/i.test(e):c="task-source"}return on`<a + >`}function vo(e){const t=kn(e),n=on`<em class="rfc2119">${t}</em>`;return co[t]=!0,n}function ko(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?on`<a href="${t}"></a>`:on`<a data-cite="${t}"></a>`}function $o(e,t){const n=kn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=zi(n);return!!t.parentElement.closest("dfn")?Eo(`\`${r.textContent}\``):r}function xo(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,i]=r.split("|").map(kn),{type:o,illegal:a}=In(s,t.parentElement),c=ro(s,i),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Bn("Normative references in informative sections are not allowed. ",ao,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==o||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function _o(e,t,n){return"ABBR"===t.parentElement.tagName?e:on`<abbr title="${n.get(e)}">${e}</abbr>`}function So(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return on`<var data-type="${r}">${n}</var>`}function Co(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(kn).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),i=n.substring(r+1,n.length);return[t(s),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,i]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],o=To(i),a=n?kn(n):null;let c="dfn";switch(!0){case/task\s+source$/i.test(e):c="task-source"}return on`<a data-link-type="${c}" data-link-for="${a}" data-xref-for="${a}" data-lt="${s}" >${o}</a - >`}function Eo(e){const t=e.slice(1,-1);return on`<code>${t}</code>`}function To(e){return po.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?Eo(e):To(e)):document.createTextNode(e)}var Ro=Object.freeze({__proto__:null,name:ao,rfc2119Usage:co,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new jn,e.informativeReferences=new jn,e.respecRFC2119||(e.respecRFC2119=co);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=kn(e),s=kn(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=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 o;for(;o=s.nextNode();)i.push(o);return i}(document.body,["#respec-ui",".head","pre"],{wsNodes:!1}),i=uo.rfc2119Keywords(),o=new RegExp(`(${lo([i,fo,ho,mo,go,bo,po,yo,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(o);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const o of r)if(a=!a,a)switch(!0){case o.startsWith("{{"):s.append($o(o,n));break;case o.startsWith("[[["):s.append(ko(o));break;case o.startsWith("[["):s.append(...xo(o,n,e));break;case o.startsWith("|"):s.append(Co(o));break;case o.startsWith("[="):s.append(So(o));break;case o.startsWith("`"):s.append(Eo(o));break;case o.startsWith("[^"):s.append(wo(o));break;case t.has(o):s.append(_o(o,n,t));break;case i.test(o):s.append(vo(o))}else s.append(o);n.replaceWith(s)}}});const Ao="w3c/conformance",Lo=$n({en:{conformance:"Conformance",normativity:"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.",keywordInterpretation:(e,t)=>on`<p> + >`}function Eo(e){const t=e.slice(1,-1);return on`<code>${t}</code>`}function To(e){return po.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?Eo(e):To(e)):document.createTextNode(e)}var Ro=Object.freeze({__proto__:null,name:ao,rfc2119Usage:co,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new jn,e.informativeReferences=new jn,e.respecRFC2119||(e.respecRFC2119=co);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=kn(e),s=kn(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=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 o;for(;o=s.nextNode();)i.push(o);return i}(document.body,["#respec-ui",".head","pre"],{wsNodes:!1}),i=uo.rfc2119Keywords(),o=new RegExp(`(${lo([i,fo,ho,mo,go,bo,po,yo,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(o);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const o of r)if(a=!a,a)switch(!0){case o.startsWith("{{"):s.append($o(o,n));break;case o.startsWith("[[["):s.append(ko(o));break;case o.startsWith("[["):s.append(...xo(o,n,e));break;case o.startsWith("|"):s.append(So(o));break;case o.startsWith("[="):s.append(Co(o));break;case o.startsWith("`"):s.append(Eo(o));break;case o.startsWith("[^"):s.append(wo(o));break;case t.has(o):s.append(_o(o,n,t));break;case i.test(o):s.append(vo(o))}else s.append(o);n.replaceWith(s)}}});const Ao="w3c/conformance",Lo=$n({en:{conformance:"Conformance",normativity:"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.",keywordInterpretation:(e,t)=>on`<p> The key word${t?"s":""} ${e} in this document ${t?"are":"is"} to be interpreted as described in <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> @@ -821,13 +821,13 @@ a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none} .respec-button-copy-paste{visibility:hidden} }`;const ya="core/webidl",wa=ya,va={},ka={},$a={wrap:e=>e.flat().filter(e=>""!==e).map(e=>"string"==typeof e?new Text(e):e),trivia:e=>e.trim()?on`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?on`<a data-xref-type="interface" data-cite="WebIDL">${e}</a>`:on`<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,s="_IDL_",i=null;switch(t){case"Window":s="interface",i="HTML";break;case"object":s="interface",i="WebIDL";break;default:t.includes("Worker")&&"extended-attribute"===n.type&&(r=t+"GlobalScope",s="interface",i=["Worker","DedicatedWorker","SharedWorker"].includes(t)?"HTML":null)}return on`<a data-xref-type="${s}" data-cite="${i}" data-lt="${r}" >${e}</a - >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return on`<span class="idlParamName">${e}</span>`;const r=xa(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"operation":case"constructor":return xa(e,t,n);default:return e}},type:e=>on`<span class="idlType">${e}</span>`,inheritance:e=>on`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=function(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)}`}(t);switch(t.type){case"includes":case"enum-value":return on`<span class="${r}">${e}</span>`}const s=n?n.name:"",{name:i,idlId:o}=Ca(t,s);return on`<span + >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return on`<span class="idlParamName">${e}</span>`;const r=xa(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"operation":case"constructor":return xa(e,t,n);default:return e}},type:e=>on`<span class="idlType">${e}</span>`,inheritance:e=>on`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=function(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)}`}(t);switch(t.type){case"includes":case"enum-value":return on`<span class="${r}">${e}</span>`}const s=n?n.name:"",{name:i,idlId:o}=Sa(t,s);return on`<span class="${r}" id="${o}" data-idl data-title="${i}" >${e}</span - >`},extendedAttribute:e=>on`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>on`<a data-xref-type="extended-attribute">${e}</a>`};function xa(e,t,n){const r=n?n.name:"",{name:s}=Ca(t,r),i=la(t,s,{parent:r}),o=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(i){t.partial||(i.matches("[data-noexport]")||(i.dataset.export=""),i.dataset.dfnType=o),da(i,t,r,s);const n="#"+i.id;return on`<a + >`},extendedAttribute:e=>on`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>on`<a data-xref-type="extended-attribute">${e}</a>`};function xa(e,t,n){const r=n?n.name:"",{name:s}=Sa(t,r),i=la(t,s,{parent:r}),o=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(i){t.partial||(i.matches("[data-noexport]")||(i.dataset.export=""),i.dataset.dfnType=o),da(i,t,r,s);const n="#"+i.id;return on`<a data-link-for="${r}" data-link-type="${o}" href="${n}" @@ -843,9 +843,9 @@ a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none} data-title="${t.name}" data-xref-type="${o}" >${e}</a - >`;if(s&&"typedef"!==t.type&&!(t.partial&&!i)){const e=Yn`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;Bn(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?s+"()":s}\` ${t.type}.`,wa,{elements:[a],hint:e})}return a}const _a=new WeakMap;function Ca(e,t=""){if(_a.has(e))return _a.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);let r=function(e,t){if(!t)return"idl-def-"+e.toLowerCase();return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}((e.special&&""===e.name?"anonymous-":"")+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":r+=function(e){if(!e.partial)return"";ka[e.name]||(ka[e.name]=0);return ka[e.name]+=1,"-partial-"+ka[e.name]}(e);break;case"constructor":case"operation":{const s=function(e,t){const n=`${t}.${e}`,r=n+"()";let s;va[r]||(va[r]=0);va[n]?s="!overload-"+va[n]:va[n]=0;return va[r]+=1,va[n]+=1,s||""}(n,t);s?(n+=s,r+=s):e.arguments.length&&(r+=e.arguments.map(e=>"-"+e.name.toLowerCase()).join(""));break}}return{name:n,idlId:r}}(e,t);return _a.set(e,n),n}function Sa(e,t){let n;try{n=sn.parse(e.textContent,{sourceName:String(t)})}catch(t){return Fn(`Failed to parse WebIDL: ${t.bareMessage}.`,wa,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=sn.write(n,{templates:$a});on.bind(e)`${r}`,Dn(e,document.createElement("code")),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),"dfn"===e.localName&&Oo(e,[t])});const s=e.closest("[data-cite], body"),{dataset:i}=s;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 Ea(e),n}function Ea(e){Rn(e,"webidl");const t=on`<span class="idlHeader" + >`;if(s&&"typedef"!==t.type&&!(t.partial&&!i)){const e=Yn`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;Bn(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?s+"()":s}\` ${t.type}.`,wa,{elements:[a],hint:e})}return a}const _a=new WeakMap;function Sa(e,t=""){if(_a.has(e))return _a.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);let r=function(e,t){if(!t)return"idl-def-"+e.toLowerCase();return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}((e.special&&""===e.name?"anonymous-":"")+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":r+=function(e){if(!e.partial)return"";ka[e.name]||(ka[e.name]=0);return ka[e.name]+=1,"-partial-"+ka[e.name]}(e);break;case"constructor":case"operation":{const s=function(e,t){const n=`${t}.${e}`,r=n+"()";let s;va[r]||(va[r]=0);va[n]?s="!overload-"+va[n]:va[n]=0;return va[r]+=1,va[n]+=1,s||""}(n,t);s?(n+=s,r+=s):e.arguments.length&&(r+=e.arguments.map(e=>"-"+e.name.toLowerCase()).join(""));break}}return{name:n,idlId:r}}(e,t);return _a.set(e,n),n}function Ca(e,t){let n;try{n=sn.parse(e.textContent,{sourceName:String(t)})}catch(t){return Fn(`Failed to parse WebIDL: ${t.bareMessage}.`,wa,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=sn.write(n,{templates:$a});on.bind(e)`${r}`,Dn(e,document.createElement("code")),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),"dfn"===e.localName&&Oo(e,[t])});const s=e.closest("[data-cite], body"),{dataset:i}=s;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 Ea(e),n}function Ea(e){Rn(e,"webidl");const t=on`<span class="idlHeader" ><a class="self-link" href="${"#"+e.id}">WebIDL</a></span - >`;e.prepend(t),ma(t)}var Ta=Object.freeze({__proto__:null,name:ya,addIDLHeader:Ea,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=ba,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Sa),r=sn.validate(n);for(const t of r){let r=`<pre>${vn(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${vn(sn.write(n[t.sourceName]))}</pre>`}Fn("WebIDL validation error: "+t.bareMessage,wa,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Ra="core/data-cite",Aa="__SPEC__";async function La(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===Aa)i=document.location.href;else{const e=await Zi(t);if(!e)return null;i=e.href,o=e.title}if(s)i=s;else{if(r){const e=r.startsWith("/")?"."+r:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:o}}function Pa(e,t,n){const{href:r,title:s}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?Dn(e,t):(t.textContent=s,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Fn("Exporting an linked external definition is not allowed.",Ra,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function Ia(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Da=Ia("#"),Na=Ia("/");function Oa(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:i}=r?Oa(r):{key:Aa,isNormative:!1};return t.cite=i?s:"?"+s,t.citeFrag=n.replace("#",""),Oa(e)}const o=r?"#"+r:Da(n),a=s||Na(n).split("#")[0],{type:c}=In(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:o,path:a,href:i}}function ja(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach(e=>t.forEach(t=>e.removeAttribute(t)))}var za=Object.freeze({__proto__:null,name:Ra,THIS_SPEC:Aa,toCiteDetails:Oa,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(Oa).map(async e=>({entry:e,result:await Zi(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await Vi(n);r&&Object.assign(Ui,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Oa(t),r=await La(n);if(r)Pa(t,r,n);else{Bn(`Couldn't find a match for "${e}"`,Ra,{elements:[t]})}}Qn("beforesave",ja)}});const Wa="core/link-to-dfn",Ma=[],qa=$n({en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}});function Ua(e){const t=new Map,n=[];for(const r of No.get(e)){const{dfnFor:s="",dfnType:i="dfn"}=r.dataset;if(t.has(s)&&t.get(s).has(i)){const e=t.get(s).get(i),o="dfn"===e.localName,a="dfn"===r.localName,c=i===(e.dataset.dfnType||"dfn"),l=s===(e.dataset.dfnFor||"");if(o&&a&&c&&l){n.push(r);continue}}const o="idl"in r.dataset||"dfn"!==i?"idl":"dfn";t.has(s)||t.set(s,new Map),t.get(s).set(o,r),An(r,"dfn",e)}return{result:t,duplicates:n}}function Fa(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return Ln(e).reduce((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e},[])}(e).find(e=>t.has(e.title)&&t.get(e.title).has(e.for));if(!n)return;const r=t.get(n.title).get(n.for),{linkType:s}=e.dataset;if(s){const e="dfn"===s?"dfn":"idl";return r.get(e)||r.get("dfn")}{const e=n.for?"idl":"dfn";return r.get(e)||r.get("idl")}}function Ba(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&s!==i)r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href="#"+t.id,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=Ha(e)&&Ha(t,n);r&&!s||Dn(e,document.createElement("code"))}(e,t),!r}function Ha(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||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}}return!1}function Ga(e){e.forEach(e=>{Bn(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,Wa,{title:"Linking error: not matching `<dfn>`",elements:[e]})})}var Va=Object.freeze({__proto__:null,name:Wa,possibleExternalLinks:Ma,run:async function(e){const t=function(){const e=new qn;for(const t of No.keys()){const{result:n,duplicates:r}=Ua(t);e.set(t,n),r.length>0&&Fn(qa.duplicateMsg(t),Wa,{title:qa.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){const r=Fa(e,t);if(r){Ba(e,r,t)||Ma.push(e)}else""===e.dataset.cite?n.push(e):Ma.push(e)}Ga(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:s}=Oa(t);r!==Aa&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Ga(Ma)}});const Za="xrefs",Ya=3e5;async function Ja(){return await rn.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t));e.createObjectStore(Za,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Ka(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<Ya)return!1;const r=new URL("meta/version",ec).href,s=await fetch(r);if(!s.ok)return!1;const i=await s.text();return localStorage.setItem(e,n.toString()),parseInt(i,10)>t}())return await async function(){try{await Ja().then(e=>e.clear(Za))}catch(e){console.error(e)}}(),t;const n=new Set(e.map(e=>e.id));try{const e=await Ja();let r=await e.transaction(Za).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const Xa="core/xref",Qa={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},ec="https://respec.org/xref/";if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=fn({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function tc(e){const t="xrefType"in e.dataset;let n=nc(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter(e=>e);if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map(e=>e.textContent.toLowerCase());r.length&&t.push(r)}return function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter(t=>!e.includes(t));t.push(r.sort())}return t}(t)}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return kn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return kn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function nc(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=kn(n),"the-empty-string"===n?"":n}function rc(e,t,n,r){const{term:s,specs:i=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=i.flat().includes(c)?c:a,f=new URL(o,"https://partial"),{pathname:h}=f,m={cite:p,citePath:h,citeFrag:f.hash.slice(1),type:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){if(!function(e){const t=e.closest(".normative"),n=e.closest(pn);return!n||e===t||t&&n&&n.contains(t)}(e))return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}Bn(`Normative reference to "${r}" found but term is defined "informatively" in "${t}".`,Xa,{title:"Normative reference to non-normative term.",elements:[e]})}(e,p,l,s,r)}function sc(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(ic)}function ic(e){return[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,"0")).join("")}function oc(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach(e=>{n.forEach(t=>e.removeAttribute(t))})}var ac=Object.freeze({__proto__:null,name:Xa,API_URL:ec,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:ec,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in Qa?Object.assign(n,{specs:Qa[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 Qa){const r=(e.specs??[]).concat(Qa[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:Fn(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Xa)}return n;function r(e){Fn(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${wn(Object.keys(Qa),e=>`"${e}"`)}.`,Xa)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=Ma.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[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)}());if(!n.length)return;const r=[];for(const e of n){const t=tc(e);t.id=await sc(t),r.push(t)}const s=await async function(e,t){const n=new Set,r=e.filter(e=>!n.has(e.id)&&(n.add(e.id)&&!0)),s=await Ka(r),i=r.filter(e=>!s.get(e.id)),o=await async function(e,t){if(!e.length)return new Map;const n={keys:e},r={method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}},s=await fetch(t,r),i=await s.json();return new Map(i.result)}(i,t);o.size&&await async function(e,t){try{const n=(await Ja()).transaction(Za,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(Za).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...s,...o])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let i=0,o=e.length;i<o;i++){if(e[i].closest("[data-no-xref]"))continue;const o=e[i],a=t[i],{id:c}=a,l=n.get(c);if(1===l.length)rc(o,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(o)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(ec);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("specs",n.join(",")),r.href},r=(e,t)=>Yn` + >`;e.prepend(t),ma(t)}var Ta=Object.freeze({__proto__:null,name:ya,addIDLHeader:Ea,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=ba,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Ca),r=sn.validate(n);for(const t of r){let r=`<pre>${vn(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${vn(sn.write(n[t.sourceName]))}</pre>`}Fn("WebIDL validation error: "+t.bareMessage,wa,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Ra="core/data-cite",Aa="__SPEC__";async function La(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===Aa)i=document.location.href;else{const e=await Zi(t);if(!e)return null;i=e.href,o=e.title}if(s)i=s;else{if(r){const e=r.startsWith("/")?"."+r:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:o}}function Pa(e,t,n){const{href:r,title:s}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?Dn(e,t):(t.textContent=s,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Fn("Exporting an linked external definition is not allowed.",Ra,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function Ia(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Da=Ia("#"),Na=Ia("/");function Oa(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:i}=r?Oa(r):{key:Aa,isNormative:!1};return t.cite=i?s:"?"+s,t.citeFrag=n.replace("#",""),Oa(e)}const o=r?"#"+r:Da(n),a=s||Na(n).split("#")[0],{type:c}=In(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:o,path:a,href:i}}function ja(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach(e=>t.forEach(t=>e.removeAttribute(t)))}var za=Object.freeze({__proto__:null,name:Ra,THIS_SPEC:Aa,toCiteDetails:Oa,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(Oa).map(async e=>({entry:e,result:await Zi(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await Vi(n);r&&Object.assign(Ui,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Oa(t),r=await La(n);if(r)Pa(t,r,n);else{Bn(`Couldn't find a match for "${e}"`,Ra,{elements:[t]})}}Qn("beforesave",ja)}});const Wa="core/link-to-dfn",Ma=[],qa=$n({en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}});function Ua(e){const t=new Map,n=[];for(const r of No.get(e)){const{dfnFor:s="",dfnType:i="dfn"}=r.dataset;if(t.has(s)&&t.get(s).has(i)){const e=t.get(s).get(i),o="dfn"===e.localName,a="dfn"===r.localName,c=i===(e.dataset.dfnType||"dfn"),l=s===(e.dataset.dfnFor||"");if(o&&a&&c&&l){n.push(r);continue}}const o="idl"in r.dataset||"dfn"!==i?"idl":"dfn";t.has(s)||t.set(s,new Map),t.get(s).set(o,r),An(r,"dfn",e)}return{result:t,duplicates:n}}function Fa(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return Ln(e).reduce((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e},[])}(e).find(e=>t.has(e.title)&&t.get(e.title).has(e.for));if(!n)return;const r=t.get(n.title).get(n.for),{linkType:s}=e.dataset;if(s){const e="dfn"===s?"dfn":"idl";return r.get(e)||r.get("dfn")}{const e=n.for?"idl":"dfn";return r.get(e)||r.get("idl")}}function Ba(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&s!==i)r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href="#"+t.id,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=Ha(e)&&Ha(t,n);r&&!s||Dn(e,document.createElement("code"))}(e,t),!r}function Ha(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||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}}return!1}function Ga(e){e.forEach(e=>{Bn(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,Wa,{title:"Linking error: not matching `<dfn>`",elements:[e]})})}var Va=Object.freeze({__proto__:null,name:Wa,possibleExternalLinks:Ma,run:async function(e){const t=function(){const e=new qn;for(const t of No.keys()){const{result:n,duplicates:r}=Ua(t);e.set(t,n),r.length>0&&Fn(qa.duplicateMsg(t),Wa,{title:qa.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){const r=Fa(e,t);if(r){Ba(e,r,t)||Ma.push(e)}else""===e.dataset.cite?n.push(e):Ma.push(e)}Ga(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:s}=Oa(t);r!==Aa&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Ga(Ma)}});const Za="xrefs",Ya=3e5;async function Ja(){return await rn.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t));e.createObjectStore(Za,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Ka(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<Ya)return!1;const r=new URL("meta/version",ec).href,s=await fetch(r);if(!s.ok)return!1;const i=await s.text();return localStorage.setItem(e,n.toString()),parseInt(i,10)>t}())return await async function(){try{await Ja().then(e=>e.clear(Za))}catch(e){console.error(e)}}(),t;const n=new Set(e.map(e=>e.id));try{const e=await Ja();let r=await e.transaction(Za).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const Xa="core/xref",Qa={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},ec="https://respec.org/xref/";if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=fn({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function tc(e){const t="xrefType"in e.dataset;let n=nc(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter(e=>e);if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map(e=>e.textContent.toLowerCase());r.length&&t.push(r)}return function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter(t=>!e.includes(t));t.push(r.sort())}return t}(t)}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return kn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return kn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function nc(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=kn(n),"the-empty-string"===n?"":n}function rc(e,t,n,r){const{term:s,specs:i=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=i.flat().includes(c)?c:a,f=new URL(o,"https://partial"),{pathname:h}=f,m={cite:p,citePath:h,citeFrag:f.hash.slice(1),type:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){if(!function(e){const t=e.closest(".normative"),n=e.closest(pn);return!n||e===t||t&&n&&n.contains(t)}(e))return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}Bn(`Normative reference to "${r}" found but term is defined "informatively" in "${t}".`,Xa,{title:"Normative reference to non-normative term.",elements:[e]})}(e,p,l,s,r)}function sc(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(ic)}function ic(e){return[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,"0")).join("")}function oc(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach(e=>{n.forEach(t=>e.removeAttribute(t))})}var ac=Object.freeze({__proto__:null,name:Xa,API_URL:ec,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:ec,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in Qa?Object.assign(n,{specs:Qa[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 Qa){const r=(e.specs??[]).concat(Qa[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:Fn(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Xa)}return n;function r(e){Fn(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${wn(Object.keys(Qa),e=>`"${e}"`)}.`,Xa)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=Ma.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[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)}());if(!n.length)return;const r=[];for(const e of n){const t=tc(e);t.id=await sc(t),r.push(t)}const s=await async function(e,t){const n=new Set,r=e.filter(e=>!n.has(e.id)&&(n.add(e.id)&&!0)),s=await Ka(r),i=r.filter(e=>!s.get(e.id)),o=await async function(e,t){if(!e.length)return new Map;const n={keys:e},r={method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}},s=await fetch(t,r),i=await s.json();return new Map(i.result)}(i,t);o.size&&await async function(e,t){try{const n=(await Ja()).transaction(Za,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(Za).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...s,...o])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let i=0,o=e.length;i<o;i++){if(e[i].closest("[data-no-xref]"))continue;const o=e[i],a=t[i],{id:c}=a,l=n.get(c);if(1===l.length)rc(o,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(o)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(ec);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("specs",n.join(",")),r.href},r=(e,t)=>Yn` [See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:s}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],i=nc(s[0]),o=n(i,e),a=yn(t,e=>`**[${e}]**`),c=r(o,i);Fn(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,Xa,{title:"No matching definition found.",elements:s,hint:c})}for(const{query:t,elems:s,results:i}of e.values()){const e=[...new Set(i.map(e=>e.shortname))].sort(),o=yn(e,e=>`**[${e}]**`),a=nc(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=Yn`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification. ${r(c,a)}.`;Fn(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,Xa,{title:"Definition is ambiguous.",elements:s,hint:u})}}(s)}(n,r,s,e),Qn("beforesave",oc)},getTermFromElement:nc});var cc=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){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.idl:not(.exclude) > code")).filter(e=>!e.closest(pn));if(0===n.length){const t="This specification doesn't normatively 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),Dn(r,document.createElement("code")),Ea(r)}});var lc=String.raw`ul.index{columns:30ch;column-gap:1.5em} ul.index li{list-style:inherit} @@ -879,7 +879,7 @@ ul.index code{color:inherit} </ul> </li>`)} </ul>`}()} - </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))An(e,"index-term");Qn("toc",mc,{once:!0}),Qn("beforesave",vc)}});const $c="core/contrib";var xc=Object.freeze({__proto__:null,name:$c,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Fn(Yn`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,$c)}const t=e.editors.map(e=>e.name),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await s();null!==r?function(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 on(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=yn(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await Sn(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 Fn("Error loading contributors from GitHub.",$c),console.error(e),null}}}(t,n)}});var _c=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map(e=>e.querySelector("h1, h2, h3, h4, h5, h6")).filter(e=>e).forEach(e=>{Pn(e,"h"+Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6))})}});const Cc=["h2","h3","h4","h5","h6"],Sc="core/structure",Ec=$n({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Tc(e,t,{prefix:n=""}={}){let r=!1,s=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=on`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=i,r=!0);let e=a.isIntro?"":r?Rc(i-s+1):n+i;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(on`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Lc(a.header,n),s=Tc(a.subsections,t,{prefix:e});s&&r.append(s),o.append(r)}}return o}function Rc(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Ac(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Cc.includes(r.localName))continue;const s=r.textContent;An(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Ac(e)})}return n}function Lc(e,t){const n=on`<a href="${"#"+t}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=Pn(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{Pn(e,"span").removeAttribute("id")}),on`<li class="tocline">${n}</li>`}var Pc=Object.freeze({__proto__:null,name:Sc,run:function(e){if("tocIntroductory"in e&&!1===e.tocIntroductory){const e=Yn`Use the ${"[`notoc`|#notoc-class]"} CSS class to remove a section from the Table of Contents.`;Bn("Configuration option `tocIntroductory` is deprecated.",Sc,{hint:e})}if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter(e=>!e.closest("section.introductory"));if(!e.length)return;e.forEach(e=>{const t="h"+Math.min(Nn(e,"section").length+1,6);e.localName!==t&&Pn(e,t)})}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){Fn("`data-max-toc` must have a value between 0-6 (inclusive).",Sc,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(":scope > "+Array.from({length:e},()=>"section").join(" > "));for(const e of n)e.classList.add("notoc")}}();const t=Tc(Ac(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=on`<nav id="toc"></nav>`,n=on`<h2 class="introductory">${Ec.toc}</h2>`;An(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 s=on`<p role="navigation" id="back-to-top"> + </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))An(e,"index-term");Qn("toc",mc,{once:!0}),Qn("beforesave",vc)}});const $c="core/contrib";var xc=Object.freeze({__proto__:null,name:$c,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Fn(Yn`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,$c)}const t=e.editors.map(e=>e.name),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await s();null!==r?function(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 on(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=yn(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await Cn(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 Fn("Error loading contributors from GitHub.",$c),console.error(e),null}}}(t,n)}});var _c=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map(e=>e.querySelector("h1, h2, h3, h4, h5, h6")).filter(e=>e).forEach(e=>{Pn(e,"h"+Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6))})}});const Sc=["h2","h3","h4","h5","h6"],Cc="core/structure",Ec=$n({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Tc(e,t,{prefix:n=""}={}){let r=!1,s=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=on`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=i,r=!0);let e=a.isIntro?"":r?Rc(i-s+1):n+i;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(on`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Lc(a.header,n),s=Tc(a.subsections,t,{prefix:e});s&&r.append(s),o.append(r)}}return o}function Rc(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Ac(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Sc.includes(r.localName))continue;const s=r.textContent;An(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Ac(e)})}return n}function Lc(e,t){const n=on`<a href="${"#"+t}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=Pn(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{Pn(e,"span").removeAttribute("id")}),on`<li class="tocline">${n}</li>`}var Pc=Object.freeze({__proto__:null,name:Cc,run:function(e){if("tocIntroductory"in e&&!1===e.tocIntroductory){const e=Yn`Use the ${"[`notoc`|#notoc-class]"} CSS class to remove a section from the Table of Contents.`;Bn("Configuration option `tocIntroductory` is deprecated.",Cc,{hint:e})}if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter(e=>!e.closest("section.introductory"));if(!e.length)return;e.forEach(e=>{const t="h"+Math.min(Nn(e,"section").length+1,6);e.localName!==t&&Pn(e,t)})}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){Fn("`data-max-toc` must have a value between 0-6 (inclusive).",Cc,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(":scope > "+Array.from({length:e},()=>"section").join(" > "));for(const e of n)e.classList.add("notoc")}}();const t=Tc(Ac(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=on`<nav id="toc"></nav>`,n=on`<h2 class="introductory">${Ec.toc}</h2>`;An(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 s=on`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> </p>`;document.body.append(s)}(t)}Xn("toc")}});const Ic=$n({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"}});var Dc=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map(e=>e.querySelector("h2, h3, h4, h5, h6")).filter(e=>e).forEach(e=>{e.after(on`<p><em>${Ic.informative}</em></p>`)})}});var Nc=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head):not(.introductory) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;t||(An(n),t=n.parentElement.id||n.id),e.addSectionLinks&&n.appendChild(on` <a href="${"#"+t}" class="self-link" aria-label="§"></a> @@ -940,7 +940,7 @@ li.caniuse-cell{margin-bottom:1px} </tr>`}function n(e,n){if(n.version_removed)return t(e,"No","");const r=n.version_added;return"boolean"==typeof r?t(e,r?"Yes":"No",""):r?t(e,"Yes",r+"+"):t(e,"Unknown","")}return on`<table> ${Object.keys(Bc).map(r=>e[r]?n(r,e[r]):t(r,"Unknown",""))} </table>`}(s):on`<p class="nosupportdata">No support data.</p>`} - </details>`}var Zc=Object.freeze({__proto__:null,name:Uc,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return"string"==typeof n?n:n.key||t}(e);if(!t)return;const n=await async function(e,t){const{baseJsonPath:n=Fc,maxAge:r=864e5}=t,s=new URL(e+".json",n).href,i=await Sn(s,r);if(404===i.status){return void Fn(`Could not find MDN data associated with key "${e}".`,Uc,{hint:"Please add a valid key to `respecConfig.mdn`"})}return await i.json()}(t,e.mdn);if(!n)return;const r=document.createElement("style");r.textContent=qc,document.head.append(r);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter(({id:t})=>Array.isArray(e[t]))}(n)){const t=n[e.id],r=Gc(e);if(r)for(const e of t)r.append(Vc(e))}}});const Yc="ui/save-html",Jc=$n({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Kc=[{id:"respec-save-as-html",fileName:"index.html",title:"HTML",type:"text/html",get href(){return nr(this.type)}},{id:"respec-save-as-xml",fileName:"index.xhtml",title:"XML",type:"application/xml",get href(){return nr(this.type)}},{id:"respec-save-as-epub",fileName:"spec.epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function Xc(e){const{id:t,href:n,fileName:r,title:s,type:i}=e;return on`<a + </details>`}var Zc=Object.freeze({__proto__:null,name:Uc,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return"string"==typeof n?n:n.key||t}(e);if(!t)return;const n=await async function(e,t){const{baseJsonPath:n=Fc,maxAge:r=864e5}=t,s=new URL(e+".json",n).href,i=await Cn(s,r);if(404===i.status){return void Fn(`Could not find MDN data associated with key "${e}".`,Uc,{hint:"Please add a valid key to `respecConfig.mdn`"})}return await i.json()}(t,e.mdn);if(!n)return;const r=document.createElement("style");r.textContent=qc,document.head.append(r);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter(({id:t})=>Array.isArray(e[t]))}(n)){const t=n[e.id],r=Gc(e);if(r)for(const e of t)r.append(Vc(e))}}});const Yc="ui/save-html",Jc=$n({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Kc=[{id:"respec-save-as-html",fileName:"index.html",title:"HTML",type:"text/html",get href(){return nr(this.type)}},{id:"respec-save-as-xml",fileName:"index.xhtml",title:"XML",type:"application/xml",get href(){return nr(this.type)}},{id:"respec-save-as-epub",fileName:"spec.epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function Xc(e){const{id:t,href:n,fileName:r,title:s,type:i}=e;return on`<a href="${n}" id="${t}" download="${r}" @@ -996,7 +996,7 @@ li.caniuse-cell{margin-bottom:1px} .hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3} .hljs-emphasis{font-style:italic} .hljs-strong{font-weight:700} -.hljs-link{text-decoration:underline}`;async function _l(e){const t=await fetch(new URL("../../"+e,document.currentScript&&document.currentScript.src||new URL("respec-w3c.js",document.baseURI).href));return await t.text()}const Cl=fn({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Cl);const Sl=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return sd}))).default}catch{return _l("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",Sl.then(e=>({worker:e})));const El=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Tl(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter(e=>"highlight"!==e&&"nolinks"!==e).map(e=>e.toLowerCase()));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:El(),languages:t},r=await Sl;return r.postMessage(n),new Promise((e,t)=>{const s=setTimeout(()=>{t(new Error("Timed out waiting for highlight."))},4e3);r.addEventListener("message",(function t(i){const{data:{id:o,language:a,value:c}}=i;o===n.id&&(r.removeEventListener("message",t),clearTimeout(s),e({language:a,value:c}))}))})}(e.innerText,t)}catch(e){return void console.error(e)}const{language:s,value:i}=r;switch(e.localName){case"pre":e.classList.remove(s),e.innerHTML=`<code class="hljs${s?" "+s:""}">${i}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=i,e.classList.add("hljs"),s&&e.classList.add(s)}e.setAttribute("aria-busy","false")}var Rl=Object.freeze({__proto__:null,name:"core/highlight",run:async function(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(Tl);document.head.appendChild(on`<style> +.hljs-link{text-decoration:underline}`;async function _l(e){const t=await fetch(new URL("../../"+e,document.currentScript&&document.currentScript.src||new URL("respec-w3c.js",document.baseURI).href));return await t.text()}const Sl=fn({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Sl);const Cl=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return rd}))).default}catch{return _l("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",Cl.then(e=>({worker:e})));const El=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Tl(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter(e=>"highlight"!==e&&"nolinks"!==e).map(e=>e.toLowerCase()));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:El(),languages:t},r=await Cl;return r.postMessage(n),new Promise((e,t)=>{const s=setTimeout(()=>{t(new Error("Timed out waiting for highlight."))},4e3);r.addEventListener("message",(function t(i){const{data:{id:o,language:a,value:c}}=i;o===n.id&&(r.removeEventListener("message",t),clearTimeout(s),e({language:a,value:c}))}))})}(e.innerText,t)}catch(e){return void console.error(e)}const{language:s,value:i}=r;switch(e.localName){case"pre":e.classList.remove(s),e.innerHTML=`<code class="hljs${s?" "+s:""}">${i}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=i,e.classList.add("hljs"),s&&e.classList.add(s)}e.setAttribute("aria-busy","false")}var Rl=Object.freeze({__proto__:null,name:"core/highlight",run:async function(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(Tl);document.head.appendChild(on`<style> ${xl} </style>`),await Promise.all(n)}});const Al=$n({en:{missing_test_suite_uri:Yn`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:Yn`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:Yn`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:Yn`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),Ll="core/data-tests";function Pl(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[s]=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"),s=s.replace(".https",""),t.push(e)}if(s.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"),s=s.replace("-manual",""),t.push(e)}return on` <li> @@ -1077,7 +1077,7 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} </div> `}var Jl=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(on`<style> ${Zl} - </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Yl(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return id}))).default}catch{return _l("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});var Kl=String.raw`var{position:relative;cursor:pointer} + </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Yl(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return sd}))).default}catch{return _l("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});var Kl=String.raw`var{position:relative;cursor:pointer} var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none} var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#000} var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#000;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400} @@ -1085,9 +1085,9 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Xl=Obje <ul> ${{any:uu(e,t,n).then(e=>async function(e){const{repoURL:t}=await ti;return e.map(e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,i=r&&on` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return on`<li><a href="${s}">${n.trim()}</a>${i}</li>`})}(e)).catch(e=>Fn(e.message,cu,{elements:[this]})).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}} </ul> - `}};async function uu(e,t,n){let r;try{const s=await ti;if(!s)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${s.apiBase}/${s.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const o=await fetch(i.href);if(!o.ok)throw new Error(`Request to ${i} failed with status code ${o.status}`);if(r=await o.json(),!r.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}const du=[Object.freeze({__proto__:null,name:cu,element:lu})];var pu=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){du.forEach(e=>{customElements.define(e.name,e.element)});const e=du.map(e=>e.name).join(", "),t=[...document.querySelectorAll(e)].map(e=>new Promise(t=>e.addEventListener("done",t,{once:!0})));await Promise.all(t)}});const fu="$respec.org";var hu=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){const{monetization:t}=e;if(!1===t)return;const n="string"==typeof t?t:fu;n===fu&&document.head.append(on`<!-- Support ReSpec's development - https://opencollective.com/respec --> `),document.head.append(on`<meta + `}};async function uu(e,t,n){let r;try{const s=await ti;if(!s)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${s.apiBase}/${s.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const o=await fetch(i.href);if(!o.ok)throw new Error(`Request to ${i} failed with status code ${o.status}`);if(r=await o.json(),!r.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}const du=[Object.freeze({__proto__:null,name:cu,element:lu})];var pu=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){du.forEach(e=>{customElements.define(e.name,e.element)});const e=du.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 fu=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),s=n?"removeOnSave":null;document.head.append(on`<meta name="monetization" - content="${n}" - class="removeOnSave" - />`)}});const mu="check-charset",gu="core/linter-rules/check-charset",bu=$n({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var yu=Object.freeze({__proto__:null,name:gu,run:function(e){if(!e.lint?.[mu])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Bn(bu.msg,gu,{hint:bu.hint,elements:[...t]})}});const wu="check-punctuation",vu="core/linter-rules/check-punctuation",ku=[".",":","!","?"],$u=$n({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${ku.map(e=>`"${e}"`).join(", ")}.`}});var xu=Object.freeze({__proto__:null,name:vu,run:function(e){if(!e.lint?.[wu])return;const t=new RegExp(`[${ku.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top)")].filter(e=>!t.test(e.textContent.trim()));n.length&&Bn($u.msg,vu,{hint:$u.hint,elements:n})}});const _u="check-internal-slots",Cu="core/linter-rules/check-internal-slots",Su=$n({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var Eu=Object.freeze({__proto__:null,name:Cu,run:function(e){if(!e.lint?.[_u])return;const t=[...document.querySelectorAll("var+a")].filter(({previousSibling:{nodeName:e}})=>e&&"VAR"===e);t.length&&Bn(Su.msg,Cu,{hint:Su.hint,elements:t})}});const Tu="local-refs-exist",Ru="core/linter-rules/local-refs-exist",Au=$n({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Lu(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Pu=Object.freeze({__proto__:null,name:Ru,run:function(e){if(!e.lint?.[Tu])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Lu);t.length&&Bn(Au.msg,Ru,{hint:Au.hint,elements:t})}});const Iu="no-headingless-sections",Du="core/linter-rules/no-headingless-sections",Nu=$n({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"}}),Ou=({firstElementChild:e})=>null===e||!1===/^h[1-6]$/.test(e.localName);var ju=Object.freeze({__proto__:null,name:Du,run:function(e){if(!e.lint?.[Iu])return;const t=[...document.querySelectorAll("section")].filter(Ou);t.length&&Bn(Nu.msg,Du,{hint:Nu.hint,elements:t})}});const zu="no-unused-vars",Wu="core/linter-rules/no-unused-vars",Mu=$n({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var qu=Object.freeze({__proto__:null,name:Wu,run:function(e){if(!e.lint?.[zu])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const s=new Map;for(const e of r){const t=kn(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Bn(Mu.msg,Wu,{hint:Mu.hint,elements:t})}});const Uu="privsec-section",Fu="core/linter-rules/privsec-section",Bu=$n({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var Hu=Object.freeze({__proto__:null,name:Fu,run:function(e){var t;e.lint?.[Uu]&&e.isRecTrack&&(t=document,!Array.from(t.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}))&&Bn(Bu.msg,Fu,{hint:Bu.hint})}});const Gu="wpt-tests-exist",Vu="core/linter-rules/wpt-tests-exist",Zu=$n({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."}});var Yu=Object.freeze({__proto__:null,name:Vu,run:async function(e){if(!e.lint?.[Gu])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return Bn("Failed to parse WPT directory from testSuiteURI","linter/"+Vu),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",t+"/");r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return Bn(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,"linter/"+Vu),null}const{entries:i}=await s.json(),o=i.filter(e=>!e.endsWith("/"));return new Set(o)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter(e=>e.dataset.tests);for(const e of n)e.dataset.tests.split(/,/gm).map(e=>e.trim().split("#")[0]).filter(e=>e&&!t.has(e)).map(t=>{Bn(`${Zu.msg} \`${t}\`.`,Vu,{hint:Zu.hint,elements:[e]})})}});const Ju="no-http-props",Ku="core/linter-rules/no-http-props",Xu=$n({en:{msg:Yn`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Yn`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var Qu=Object.freeze({__proto__:null,name:Ku,run:function(e){if(!e.lint?.[Ju])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter(e=>e.endsWith("URI")||"prevED"===e).filter(t=>new URL(e[t],parent.location.href).href.startsWith("http://"));if(t.length){const e=yn(t,e=>Yn`${`[${e}]`}`);Bn(Xu.msg,Ku,{hint:Xu.hint+e})}}});const ed="core/linter-rules/a11y",td=["color-contrast","landmark-one-main","landmark-unique","region"];function nd(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map(e=>"- "+e.trimEnd()).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var rd=Object.freeze({__proto__:null,name:ed,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(td.map(e=>[e,{enabled:!1}])),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://unpkg.com/axe-core@3/axe.min.js",document.head.appendChild(e),new Promise((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n})}()}catch(e){return Fn("Failed to load a11y linter.",ed),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return Fn("Error while looking for a11y issues.",ed),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:i}=e,o=`a11y/${n}: ${r}`;for(const[e,n]of t){const t=nd(e);Bn(o,ed,{details:`\n\n${s}.\n\n${t}. ([Learn more](${i}))`,elements:n})}}}}),sd=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\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'}),id=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); + content="${r}" + class="${s}" + />`)}});const hu="check-charset",mu="core/linter-rules/check-charset",gu=$n({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var bu=Object.freeze({__proto__:null,name:mu,run:function(e){if(!e.lint?.[hu])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Bn(gu.msg,mu,{hint:gu.hint,elements:[...t]})}});const yu="check-punctuation",wu="core/linter-rules/check-punctuation",vu=[".",":","!","?"],ku=$n({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${vu.map(e=>`"${e}"`).join(", ")}.`}});var $u=Object.freeze({__proto__:null,name:wu,run:function(e){if(!e.lint?.[yu])return;const t=new RegExp(`[${vu.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top)")].filter(e=>!t.test(e.textContent.trim()));n.length&&Bn(ku.msg,wu,{hint:ku.hint,elements:n})}});const xu="check-internal-slots",_u="core/linter-rules/check-internal-slots",Su=$n({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var Cu=Object.freeze({__proto__:null,name:_u,run:function(e){if(!e.lint?.[xu])return;const t=[...document.querySelectorAll("var+a")].filter(({previousSibling:{nodeName:e}})=>e&&"VAR"===e);t.length&&Bn(Su.msg,_u,{hint:Su.hint,elements:t})}});const Eu="local-refs-exist",Tu="core/linter-rules/local-refs-exist",Ru=$n({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Au(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Lu=Object.freeze({__proto__:null,name:Tu,run:function(e){if(!e.lint?.[Eu])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Au);t.length&&Bn(Ru.msg,Tu,{hint:Ru.hint,elements:t})}});const Pu="no-headingless-sections",Iu="core/linter-rules/no-headingless-sections",Du=$n({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"}}),Nu=({firstElementChild:e})=>null===e||!1===/^h[1-6]$/.test(e.localName);var Ou=Object.freeze({__proto__:null,name:Iu,run:function(e){if(!e.lint?.[Pu])return;const t=[...document.querySelectorAll("section")].filter(Nu);t.length&&Bn(Du.msg,Iu,{hint:Du.hint,elements:t})}});const ju="no-unused-vars",zu="core/linter-rules/no-unused-vars",Wu=$n({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var Mu=Object.freeze({__proto__:null,name:zu,run:function(e){if(!e.lint?.[ju])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const s=new Map;for(const e of r){const t=kn(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Bn(Wu.msg,zu,{hint:Wu.hint,elements:t})}});const qu="privsec-section",Uu="core/linter-rules/privsec-section",Fu=$n({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var Bu=Object.freeze({__proto__:null,name:Uu,run:function(e){var t;e.lint?.[qu]&&e.isRecTrack&&(t=document,!Array.from(t.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}))&&Bn(Fu.msg,Uu,{hint:Fu.hint})}});const Hu="wpt-tests-exist",Gu="core/linter-rules/wpt-tests-exist",Vu=$n({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."}});var Zu=Object.freeze({__proto__:null,name:Gu,run:async function(e){if(!e.lint?.[Hu])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return Bn("Failed to parse WPT directory from testSuiteURI","linter/"+Gu),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",t+"/");r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return Bn(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,"linter/"+Gu),null}const{entries:i}=await s.json(),o=i.filter(e=>!e.endsWith("/"));return new Set(o)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter(e=>e.dataset.tests);for(const e of n)e.dataset.tests.split(/,/gm).map(e=>e.trim().split("#")[0]).filter(e=>e&&!t.has(e)).map(t=>{Bn(`${Vu.msg} \`${t}\`.`,Gu,{hint:Vu.hint,elements:[e]})})}});const Yu="no-http-props",Ju="core/linter-rules/no-http-props",Ku=$n({en:{msg:Yn`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Yn`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var Xu=Object.freeze({__proto__:null,name:Ju,run:function(e){if(!e.lint?.[Yu])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter(e=>e.endsWith("URI")||"prevED"===e).filter(t=>new URL(e[t],parent.location.href).href.startsWith("http://"));if(t.length){const e=yn(t,e=>Yn`${`[${e}]`}`);Bn(Ku.msg,Ju,{hint:Ku.hint+e})}}});const Qu="core/linter-rules/a11y",ed=["color-contrast","landmark-one-main","landmark-unique","region"];function td(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map(e=>"- "+e.trimEnd()).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var nd=Object.freeze({__proto__:null,name:Qu,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(ed.map(e=>[e,{enabled:!1}])),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://unpkg.com/axe-core@3/axe.min.js",document.head.appendChild(e),new Promise((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n})}()}catch(e){return Fn("Failed to load a11y linter.",Qu),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return Fn("Error while looking for a11y issues.",Qu),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:i}=e,o=`a11y/${n}: ${r}`;for(const[e,n]of t){const t=td(e);Bn(o,Qu,{details:`\n\n${s}.\n\n${t}. ([Learn more](${i}))`,elements:n})}}}}),rd=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\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'}),sd=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); //# sourceMappingURL=respec-w3c.js.map diff --git a/builds/respec-w3c.js.map b/builds/respec-w3c.js.map index 37d4fb591f..08c001e10a 100644 --- a/builds/respec-w3c.js.map +++ b/builds/respec-w3c.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-w3c.js","sources":["../src/core/expose-modules.js","../src/core/l10n.js","../node_modules/idb/build/esm/wrap-idb-value.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/array-base.js","../node_modules/webidl2/lib/productions/token.js","../node_modules/webidl2/lib/productions/extended-attributes.js","../node_modules/webidl2/lib/productions/type.js","../node_modules/webidl2/lib/productions/default.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/productions/constructor.js","../node_modules/webidl2/lib/productions/interface.js","../node_modules/webidl2/lib/validators/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/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/reindent.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/w3c.js","../src/core/location-hash.js","../src/w3c/group.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/w3c/templates/headers.js","../src/w3c/templates/cgbg-headers.js","../src/w3c/templates/sotd.js","../src/w3c/templates/cgbg-sotd.js","../src/w3c/headers.js","../src/core/defaults.js","../src/w3c/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/w3c/style.js","../src/w3c/l10n.js","../src/core/github.js","../src/core/data-include.js","../src/core/title.js","../src/w3c/level.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-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/dfn-finder.js","../src/core/webidl-clipboard.js","../src/styles/webidl.css.js","../src/core/webidl.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/xref-db.js","../src/core/xref.js","../src/core/webidl-index.js","../src/styles/dfn-index.css.js","../src/core/dfn-index.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/styles/caniuse.css.js","../src/core/caniuse.js","../src/styles/mdn-annotation.css.js","../src/core/mdn-annotation.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/search-xref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/w3c/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/web-monetization.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/check-internal-slots.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.js"],"sourcesContent":["// @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\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 */\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\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));\n });\n }\n if (blocked)\n request.addEventListener('blocked', () => blocked());\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking)\n db.addEventListener('versionchange', () => blocking());\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked)\n request.addEventListener('blocked', () => blocked());\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * @param {string} text\n */\nfunction lastLine(text) {\n const splitted = text.split(\"\\n\");\n return splitted[splitted.length - 1];\n}\n\nfunction appendIfExist(base, target) {\n let result = base;\n if (target) {\n result += ` ${target}`;\n }\n return result;\n}\n\nfunction contextAsText(node) {\n const hierarchy = [node];\n while (node && node.parent) {\n const { parent } = node;\n hierarchy.unshift(parent);\n node = parent;\n }\n return hierarchy.map((n) => appendIfExist(n.type, n.name)).join(\" -> \");\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(\n source,\n position,\n current,\n message,\n kind,\n { level = \"error\", autofix, ruleName } = {}\n) {\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\"\n ? source[position].line\n : source.length > 1\n ? 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 =\n current && current.name\n ? `, ${contextType} \\`${current.partial ? \"partial \" : \"\"}${contextAsText(\n current\n )}\\``\n : \"\";\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(\n token,\n current,\n ruleName,\n message,\n options = {}\n) {\n options.ruleName = ruleName;\n return error(\n current.source,\n token.index,\n current,\n message,\n \"Validation\",\n options\n );\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, writable: true },\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(\n idlType,\n defs,\n { useNullableInner } = {}\n) {\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 // Set cached result to indeterminate to short-circuit circular definitions.\n // The final result will be updated to true or false.\n defs.cache.dictionaryIncludesRequiredField.set(dict, undefined);\n let result = dict.members.some((field) => field.required);\n if (!result && dict.inheritance) {\n const superdict = defs.unique.get(dict.inheritance);\n if (!superdict) {\n // Assume required members in the supertype if it is unknown.\n result = true;\n } else if (dictionaryIncludesRequiredField(superdict, defs)) {\n result = true;\n }\n }\n defs.cache.dictionaryIncludesRequiredField.set(dict, result);\n return result;\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 WrappedToken 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.consumeType(type);\n if (value) {\n return new WrappedToken({\n source: tokeniser.source,\n tokens: { value },\n });\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 { WrappedToken } 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 return list(tokeniser, {\n parser: WrappedToken.parser(tokeniser, tokenName),\n listName: tokenName + \" list\",\n });\n}\n\nconst extAttrValueSyntax = [\"identifier\", \"decimal\", \"integer\", \"string\"];\n\nconst shouldBeLegacyPrefixed = [\n \"NoInterfaceObject\",\n \"LenientSetter\",\n \"LenientThis\",\n \"TreatNonObjectAsNull\",\n \"Unforgeable\",\n];\n\nconst renamedLegacies = new Map([\n ...shouldBeLegacyPrefixed.map((name) => [name, `Legacy${name}`]),\n [\"NamedConstructor\", \"LegacyFactoryFunction\"],\n [\"OverrideBuiltins\", \"LegacyOverrideBuiltIns\"],\n [\"TreatNullAs\", \"LegacyNullToEmptyString\"],\n]);\n\n/**\n * This will allow a set of extended attribute values to be parsed.\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nfunction extAttrListItems(tokeniser) {\n for (const syntax of extAttrValueSyntax) {\n const toks = tokens(tokeniser, syntax);\n if (toks.length) {\n return toks;\n }\n }\n tokeniser.error(\n `Expected identifiers, strings, decimals, or integers 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(\n new ExtendedAttributeParameters({ source: tokeniser.source, tokens })\n );\n if (tokens.assign) {\n tokens.secondaryName = tokeniser.consumeType(...extAttrValueSyntax);\n }\n tokens.open = tokeniser.consume(\"(\");\n if (tokens.open) {\n ret.list = ret.rhsIsList\n ? // [Exposed=(Window,Worker)]\n extAttrListItems(tokeniser)\n : // [LegacyFactoryFunction=Audio(DOMString src)] or [Constructor(DOMString str)]\n argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") ||\n 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 /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n function extended_attribute_listitem(item) {\n return w.ts.wrap([\n w.token(item.tokens.value),\n w.token(item.tokens.separator),\n ]);\n }\n const { rhsType } = this;\n return w.ts.wrap([\n w.token(this.tokens.assign),\n w.reference_token(this.tokens.secondaryName, this.parent),\n w.token(this.tokens.open),\n ...(!this.list\n ? []\n : this.list.map((p) => {\n return rhsType === \"identifier-list\"\n ? w.identifier(p, this.parent)\n : rhsType && rhsType.endsWith(\"-list\")\n ? extended_attribute_listitem(p)\n : p.write(w);\n })),\n w.token(this.tokens.close),\n ]);\n }\n}\n\nexport class SimpleExtendedAttribute extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consumeType(\"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\n ? list\n : 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 const { name } = this;\n if (name === \"LegacyNoInterfaceObject\") {\n const message = `\\`[LegacyNoInterfaceObject]\\` 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(\n this.tokens.name,\n this,\n \"no-nointerfaceobject\",\n message,\n { level: \"warning\" }\n );\n } else if (renamedLegacies.has(name)) {\n const message = `\\`[${name}]\\` extended attribute is a legacy feature \\\nthat is now renamed to \\`[${renamedLegacies.get(name)}]\\`. Refer to the \\\n[relevant upstream PR](https://github.com/heycam/webidl/pull/870) for more \\\ninformation.`;\n yield validationError(this.tokens.name, this, \"renamed-legacy\", message, {\n level: \"warning\",\n autofix: renameLegacyExtendedAttribute(this),\n });\n }\n for (const arg of this.arguments) {\n yield* arg.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n return w.ts.wrap([\n w.ts.trivia(this.tokens.name.trivia),\n w.ts.extendedAttribute(\n w.ts.wrap([\n w.ts.extendedAttributeReference(this.name),\n this.params.write(w),\n ])\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {SimpleExtendedAttribute} extAttr\n */\nfunction renameLegacyExtendedAttribute(extAttr) {\n return () => {\n const { name } = extAttr;\n extAttr.tokens.name.value = renamedLegacies.get(name);\n if (name === \"TreatNullAs\") {\n extAttr.params.tokens = {};\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(\n ...list(tokeniser, {\n parser: SimpleExtendedAttribute.parse,\n listName: \"extended attribute\",\n })\n );\n tokens.close =\n tokeniser.consume(\"]\") ||\n 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(\n \"Illegal double extended attribute lists, consider merging them\"\n );\n }\n return ret;\n }\n\n *validate(defs) {\n for (const extAttr of this) {\n yield* extAttr.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n if (!this.length) return \"\";\n return w.ts.wrap([\n w.token(this.tokens.open),\n ...this.map((ea) => ea.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n return_type,\n primitive_type,\n autoParenter,\n} from \"./helpers.js\";\nimport { stringTypes, typeNameKeywords } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction generic_type(tokeniser, typeName) {\n const base = tokeniser.consume(\n \"FrozenArray\",\n \"ObservableArray\",\n \"Promise\",\n \"sequence\",\n \"record\"\n );\n if (!base) {\n return;\n }\n const ret = autoParenter(\n new Type({ source: tokeniser.source, tokens: { base } })\n );\n ret.tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`No opening bracket after ${base.value}`);\n switch (base.value) {\n case \"Promise\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Promise type cannot have extended attribute\");\n const subtype =\n return_type(tokeniser, typeName) ||\n tokeniser.error(\"Missing Promise subtype\");\n ret.subtype.push(subtype);\n break;\n }\n case \"sequence\":\n case \"FrozenArray\":\n case \"ObservableArray\": {\n const subtype =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(`Missing ${base.value} subtype`);\n ret.subtype.push(subtype);\n break;\n }\n case \"record\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Record key cannot have extended attribute\");\n const keyType =\n tokeniser.consume(...stringTypes) ||\n tokeniser.error(`Record key must be one of: ${stringTypes.join(\", \")}`);\n const keyIdlType = new Type({\n source: tokeniser.source,\n tokens: { base: keyType },\n });\n keyIdlType.tokens.separator =\n tokeniser.consume(\",\") ||\n tokeniser.error(\"Missing comma after record key type\");\n keyIdlType.type = typeName;\n const valueType =\n type_with_extended_attributes(tokeniser, typeName) ||\n 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.value}`);\n ret.tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing closing bracket after ${base.value}`);\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 =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.consume(...stringTypes, ...typeNameKeywords);\n if (!base) {\n return;\n }\n ret = new Type({ source: tokeniser.source, tokens: { base } });\n if (tokeniser.probe(\"<\"))\n 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\")\n 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 =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(\"No type after open parenthesis or 'or' in union type\");\n if (typ.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be included in a union type\");\n if (typ.generic === \"Promise\")\n 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 } else break;\n }\n if (ret.idlType.length < 2) {\n tokeniser.error(\n \"At least two types are expected in a union type but found less\"\n );\n }\n tokens.close =\n 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 = new ExtendedAttributes({});\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 = [this.tokens.prefix, this.tokens.base, this.tokens.postfix]\n .filter((t) => t)\n .map((t) => t.value)\n .join(\" \");\n return unescape(name);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n\n if (this.idlType === \"void\") {\n const message = `\\`void\\` is now replaced by \\`undefined\\`. Refer to the \\\n[relevant GitHub issue](https://github.com/heycam/webidl/issues/60) \\\nfor more information.`;\n yield validationError(this.tokens.base, this, \"replace-void\", message, {\n autofix: replaceVoid(this),\n });\n }\n\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 = this.union\n ? this\n : typedef && typedef.type === \"typedef\"\n ? 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(\n targetToken,\n this,\n \"no-nullable-union-dict\",\n message\n );\n }\n } else {\n // allow some dictionary\n for (const subtype of this.subtype) {\n yield* subtype.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n const type_body = () => {\n if (this.union || this.generic) {\n return w.ts.wrap([\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n ...this.subtype.map((t) => t.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n const firstToken = this.tokens.prefix || this.tokens.base;\n const prefix = this.tokens.prefix\n ? [this.tokens.prefix.value, w.ts.trivia(this.tokens.base.trivia)]\n : [];\n const ref = w.reference(\n w.ts.wrap([\n ...prefix,\n this.tokens.base.value,\n w.token(this.tokens.postfix),\n ]),\n { unescaped: this.idlType, context: this }\n );\n return w.ts.wrap([w.ts.trivia(firstToken.trivia), ref]);\n };\n return w.ts.wrap([\n this.extAttrs.write(w),\n type_body(),\n w.token(this.tokens.nullable),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Type} type\n */\nfunction replaceVoid(type) {\n return () => {\n type.tokens.base.value = \"undefined\";\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 =\n const_value(tokeniser) ||\n tokeniser.consumeType(\"string\") ||\n tokeniser.consume(\"null\", \"[\", \"{\") ||\n tokeniser.error(\"No value for default\");\n const expression = [def];\n if (def.value === \"[\") {\n const close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\"Default sequence value must be empty\");\n expression.push(close);\n } else if (def.value === \"{\") {\n const close =\n tokeniser.consume(\"}\") ||\n tokeniser.error(\"Default dictionary value must be empty\");\n expression.push(close);\n }\n return new Default({\n source: tokeniser.source,\n tokens: { assign },\n expression,\n });\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 /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.assign),\n ...this.expression.map((t) => w.token(t)),\n ]);\n }\n}\n","// @ts-check\n\nimport { Base } from \"./base.js\";\nimport { Default } from \"./default.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n getFirstToken,\n} from \"./helpers.js\";\nimport { argumentNameKeywords, Tokeniser } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport {\n idlTypeIncludesDictionary,\n dictionaryIncludesRequiredField,\n} 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(\n new Argument({ source: tokeniser.source, tokens })\n );\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 =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.consume(...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.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n const result = idlTypeIncludesDictionary(this.idlType, defs, {\n useNullableInner: true,\n });\n if (result) {\n if (this.idlType.nullable) {\n const message = `Dictionary arguments cannot be nullable.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nullable-dict-arg\",\n message\n );\n } else if (!this.optional) {\n if (\n this.parent &&\n !dictionaryIncludesRequiredField(result.dictionary, defs) &&\n isLastRequiredArgument(this)\n ) {\n const message = `Dictionary argument must be optional if it has no required fields`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-optional\",\n message,\n {\n autofix: autofixDictionaryArgumentOptionality(this),\n }\n );\n }\n } else if (!this.default) {\n const message = `Optional dictionary arguments must have a default value of \\`{}\\`.`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-default\",\n message,\n {\n autofix: autofixOptionalDictionaryDefaultValue(this),\n }\n );\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.optional),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.variadic),\n w.name_token(this.tokens.name, { data: this }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.separator),\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 = {\n type: \"optional\",\n value: \"optional\",\n trivia: firstToken.trivia,\n };\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 {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} 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(\n new Operation({ source: tokeniser.source, tokens })\n );\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 =\n return_type(tokeniser) || tokeniser.error(\"Missing return type\");\n tokens.name =\n tokeniser.consumeType(\"identifier\") || tokeniser.consume(\"includes\");\n tokens.open =\n tokeniser.consume(\"(\") || tokeniser.error(\"Invalid operation\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated operation\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 yield* this.extAttrs.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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n const body = this.idlType\n ? [\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n ]\n : [];\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n this.tokens.name\n ? w.token(this.tokens.special)\n : w.token(this.tokens.special, w.ts.nameless, { data: this, parent }),\n ...body,\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","// @ts-check\n\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Attribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.special]\n * @param {boolean} [options.noInherit]\n * @param {boolean} [options.readonly]\n */\n static parse(\n tokeniser,\n { special, noInherit = false, readonly = false } = {}\n ) {\n const start_position = tokeniser.position;\n const tokens = { special };\n const ret = autoParenter(\n new Attribute({ source: tokeniser.source, tokens })\n );\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 =\n type_with_extended_attributes(tokeniser, \"attribute-type\") ||\n tokeniser.error(\"Attribute lacks a type\");\n tokens.name =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.consume(\"async\", \"required\") ||\n tokeniser.error(\"Attribute lacks a name\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n\n switch (this.idlType.generic) {\n case \"sequence\":\n case \"record\": {\n const message = `Attributes cannot accept ${this.idlType.generic} types.`;\n yield validationError(\n this.tokens.name,\n this,\n \"attr-invalid-type\",\n message\n );\n break;\n }\n default: {\n const { reference } =\n idlTypeIncludesDictionary(this.idlType, defs) || {};\n if (reference) {\n const targetToken = (this.idlType.union ? reference : this.idlType)\n .tokens.base;\n const message = \"Attributes cannot accept dictionary types.\";\n yield validationError(\n targetToken,\n this,\n \"attr-invalid-type\",\n message\n );\n }\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.special),\n w.token(this.tokens.readonly),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Type } from \"./type.js\";\nimport { Argument } from \"./argument.js\";\nimport {\n ExtendedAttributes,\n SimpleExtendedAttribute,\n} 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 (\n tokeniser.consumeType(\"decimal\", \"integer\") ||\n tokeniser.consume(\"true\", \"false\", \"Infinity\", \"-Infinity\", \"NaN\")\n );\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 \"decimal\":\n case \"integer\":\n return { type: \"number\", value };\n case \"string\":\n return { type: \"string\", value: value.slice(1, -1) };\n }\n\n switch (value) {\n case \"true\":\n case \"false\":\n return { type: \"boolean\", value: value === \"true\" };\n case \"Infinity\":\n case \"-Infinity\":\n return { type: \"Infinity\", negative: value.startsWith(\"-\") };\n case \"[\":\n return { type: \"sequence\", value: [] };\n case \"{\":\n return { type: \"dictionary\" };\n default:\n return { type: value };\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(\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"octet\",\n \"undefined\"\n );\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, {\n parser: Argument.parse,\n listName: \"arguments list\",\n });\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({\n source: tokeniser.source,\n tokens: { base: voidToken },\n });\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 =\n 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(\n new Tokeniser(\"[Exposed=Window]\")\n );\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:\n /-?(?=[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: /\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\//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 = [\"ByteString\", \"DOMString\", \"USVString\"];\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 \"ObservableArray\",\n \"Promise\",\n \"bigint\",\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 \"undefined\",\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(\n token.value\n )} is a reserved identifier and must not be used.`;\n throw new WebIDLParseError(\n syntaxError(tokens, lastIndex, null, message)\n );\n } else if (nonRegexTerminals.includes(token.value)) {\n token.type = \"inline\";\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({\n type: \"inline\",\n value: punctuation,\n trivia,\n line,\n index,\n });\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(\n syntaxError(this.source, this.position, this.current, message)\n );\n }\n\n /**\n * @param {string} type\n */\n probeType(type) {\n return (\n this.source.length > this.position &&\n this.source[this.position].type === type\n );\n }\n\n /**\n * @param {string} value\n */\n probe(value) {\n return (\n this.probeType(\"inline\") && this.source[this.position].value === value\n );\n }\n\n /**\n * @param {...string} candidates\n */\n consumeType(...candidates) {\n for (const type of candidates) {\n if (!this.probeType(type)) continue;\n const token = this.source[this.position];\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {...string} candidates\n */\n consume(...candidates) {\n if (!this.probeType(\"inline\")) return;\n const token = this.source[this.position];\n for (const value of candidates) {\n if (token.value !== value) continue;\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({\n message,\n bareMessage,\n context,\n line,\n sourceName,\n input,\n tokens,\n }) {\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 { WrappedToken } from \"./token.js\";\nimport { Base } from \"./base.js\";\n\nclass EnumValue extends WrappedToken {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeType(\"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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.wrap([\n w.ts.trivia(this.tokens.value.trivia),\n w.ts.definition(\n w.ts.wrap(['\"', w.ts.name(this.value, { data: this, parent }), '\"']),\n { data: this, parent }\n ),\n w.token(this.tokens.separator),\n ]);\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 =\n tokeniser.consumeType(\"identifier\") ||\n 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.probeType(\"string\")) {\n tokeniser.error(\"No comma between enum values\");\n }\n tokens.close =\n tokeniser.consume(\"}\") || tokeniser.error(\"Unexpected value in enum\");\n if (!ret.values.length) {\n tokeniser.error(\"No value in enum\");\n }\n tokens.termination =\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.open),\n w.ts.wrap(this.values.map((v) => v.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\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.consumeType(\"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 =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Incomplete includes statement\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.reference_token(this.tokens.target, this),\n w.token(this.tokens.includes),\n w.reference_token(this.tokens.mixin, this),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} 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 =\n type_with_extended_attributes(tokeniser, \"typedef-type\") ||\n tokeniser.error(\"Typedef lacks a type\");\n tokens.name =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Typedef lacks a name\");\n tokeniser.current = ret.this;\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} 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(\n new CallbackFunction({ source: tokeniser.source, tokens })\n );\n tokens.name =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Callback lacks a name\");\n tokeniser.current = ret.this;\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Callback lacks an assignment\");\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Callback lacks a return type\");\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"Callback lacks parentheses for arguments\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated callback\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.assign),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.open),\n ...this.arguments.map((arg) => arg.write(w)),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\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 =\n tokeniser.consumeType(\"identifier\") ||\n 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 =\n tokeniser.consumeType(\"identifier\") ||\n 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 =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const inheritance = () => {\n if (!this.tokens.inheritance) {\n return \"\";\n }\n return w.ts.wrap([\n w.token(this.tokens.colon),\n w.ts.trivia(this.tokens.inheritance.trivia),\n w.ts.inheritance(\n w.reference(this.tokens.inheritance.value, { context: this })\n ),\n ]);\n };\n\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.callback),\n w.token(this.tokens.partial),\n w.token(this.tokens.base),\n w.token(this.tokens.mixin),\n w.name_token(this.tokens.name, { data: this }),\n inheritance(),\n w.token(this.tokens.open),\n w.ts.wrap(this.members.map((m) => m.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { Type } from \"./type.js\";\nimport {\n const_data,\n const_value,\n primitive_type,\n autoParenter,\n unescape,\n} 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 =\n tokeniser.consumeType(\"identifier\") ||\n 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 =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Const lacks a name\");\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Const lacks value assignment\");\n tokens.value =\n const_value(tokeniser) || tokeniser.error(\"Const lacks a value\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.assign),\n w.token(this.tokens.value),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n autoParenter,\n argument_list,\n} 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(\n new IterableLike({ source: tokeniser.source, tokens })\n );\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (!tokens.readonly) {\n tokens.async = tokeniser.consume(\"async\");\n }\n tokens.base = tokens.readonly\n ? tokeniser.consume(\"maplike\", \"setlike\")\n : tokens.async\n ? 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\";\n const secondTypeAllowed = secondTypeRequired || type === \"iterable\";\n const argumentAllowed = ret.async && type === \"iterable\";\n\n tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`Missing less-than sign \\`<\\` in ${type} declaration`);\n const first =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(`Missing a type argument in ${type} declaration`);\n ret.idlType = [first];\n ret.arguments = [];\n\n if (secondTypeAllowed) {\n first.tokens.separator = tokeniser.consume(\",\");\n if (first.tokens.separator) {\n ret.idlType.push(type_with_extended_attributes(tokeniser));\n } else if (secondTypeRequired) {\n tokeniser.error(`Missing second type argument in ${type} declaration`);\n }\n }\n\n tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing greater-than sign \\`>\\` in ${type} declaration`);\n\n if (tokeniser.probe(\"(\")) {\n if (argumentAllowed) {\n tokens.argsOpen = tokeniser.consume(\"(\");\n ret.arguments.push(...argument_list(tokeniser));\n tokens.argsClose =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unterminated async iterable argument list\");\n } else {\n tokeniser.error(`Arguments are only allowed for \\`async iterable\\``);\n }\n }\n\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 *validate(defs) {\n for (const type of this.idlType) {\n yield* type.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.readonly),\n w.token(this.tokens.async),\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n w.ts.wrap(this.idlType.map((t) => t.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.argsOpen),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.argsClose),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent: this.parent }\n );\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 =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"No argument list in constructor\");\n const args = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated constructor\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base, w.ts.nameless, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\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 {\n stringifier,\n autofixAddExposedWindow,\n getMemberIndentation,\n getLastIndentation,\n getFirstToken,\n findLastIndex,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\nimport { checkInterfaceMemberDuplication } from \"../validators/interface.js\";\nimport { Constructor } from \"./constructor.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.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 =\n 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(\n tokeniser,\n new Interface({ source: tokeniser.source, tokens }),\n {\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\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 ) {\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(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n const oldConstructors = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"Constructor\"\n );\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(\n constructor.tokens.name,\n this,\n \"constructor-member\",\n message,\n {\n autofix: autofixConstructor(this, constructor),\n }\n );\n }\n\n const isGlobal = this.extAttrs.some((extAttr) => extAttr.name === \"Global\");\n if (isGlobal) {\n const factoryFunctions = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"LegacyFactoryFunction\"\n );\n for (const named of factoryFunctions) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have factory functions.`;\n yield validationError(\n named.tokens.name,\n this,\n \"no-constructible-global\",\n message\n );\n }\n\n const constructors = this.members.filter(\n (member) => member.type === \"constructor\"\n );\n for (const named of constructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have constructors.`;\n yield validationError(\n named.tokens.base,\n this,\n \"no-constructible-global\",\n message\n );\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(\n interfaceDef.extAttrs.tokens.open.trivia\n );\n const memberIndent = interfaceDef.members.length\n ? getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia)\n : getMemberIndentation(indentation);\n const constructorOp = Constructor.parse(\n new Tokeniser(`\\n${memberIndent}constructor();`)\n );\n constructorOp.extAttrs = new ExtendedAttributes({});\n autoParenter(constructorOp).arguments = constructorExtAttr.arguments;\n\n const existingIndex = findLastIndex(\n interfaceDef.members,\n (m) => m.type === \"constructor\"\n );\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","// @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(\n addition.tokens.name,\n ext,\n \"no-cross-overload\",\n message\n );\n }\n }\n }\n\n function getOperations(i) {\n return i.members.filter(({ type }) => type === \"operation\");\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(\n tokeniser,\n new Mixin({ source: tokeniser.source, tokens }),\n {\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\n get type() {\n return \"interface mixin\";\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n} 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 =\n type_with_extended_attributes(tokeniser, \"dictionary-type\") ||\n tokeniser.error(\"Dictionary member lacks a type\");\n tokens.name =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Dictionary member lacks a name\");\n ret.default = Default.parse(tokeniser);\n if (tokens.required && ret.default)\n tokeniser.error(\"Required member must not have a default\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.required),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\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(\n tokeniser,\n new Dictionary({ source: tokeniser.source, tokens }),\n {\n type: \"dictionary\",\n inheritable: !partial,\n allowedMembers: [[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\";\nimport { Constant } from \"./constant.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(\n tokeniser,\n new Namespace({ source: tokeniser.source, tokens }),\n {\n type: \"namespace\",\n allowedMembers: [\n [Attribute.parse, { noInherit: true, readonly: true }],\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"namespace\";\n }\n\n *validate(defs) {\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\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(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\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(\n tokeniser,\n new CallbackInterface({ source: tokeniser.source, tokens }),\n {\n type: \"callback interface\",\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"callback interface\";\n }\n}\n","import { 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 =\n 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 (\n Dictionary.parse(tokeniser, { partial }) ||\n interface_({ partial }) ||\n Namespace.parse(tokeniser, { partial }) ||\n error(\"Partial doesn't apply to anything\")\n );\n }\n\n function definition() {\n return (\n 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\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 = tokeniser.consumeType(\"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","function 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 class Writer {\n constructor(ts) {\n this.ts = Object.assign({}, templates, ts);\n }\n\n reference(raw, { unescaped, context }) {\n if (!unescaped) {\n unescaped = raw.startsWith(\"_\") ? raw.slice(1) : raw;\n }\n return this.ts.reference(raw, unescaped, context);\n }\n\n token(t, wrapper = noop, ...args) {\n if (!t) {\n return \"\";\n }\n const value = wrapper(t.value, ...args);\n return this.ts.wrap([this.ts.trivia(t.trivia), value]);\n }\n\n reference_token(t, context) {\n return this.token(t, this.reference.bind(this), { context });\n }\n\n name_token(t, arg) {\n return this.token(t, this.ts.name, arg);\n }\n\n identifier(id, context) {\n return this.ts.wrap([\n this.reference_token(id.tokens.value, context),\n this.token(id.tokens.separator),\n ]);\n }\n}\n\nexport function write(ast, { templates: ts = templates } = {}) {\n ts = Object.assign({}, templates, ts);\n\n const w = new Writer(ts);\n\n function dispatch(it) {\n if (it.type === \"eof\") {\n return ts.trivia(it.trivia);\n }\n return it.write(w);\n }\n return ts.wrap(ast.map(dispatch));\n}\n","import { 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 \"${\n unique.get(name).type\n }\" 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","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked - a markdown parser\n * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nvar defaults$5 = {exports: {}};\n\nfunction getDefaults$1() {\n return {\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartLists: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nfunction changeDefaults$1(newDefaults) {\n defaults$5.exports.defaults = newDefaults;\n}\n\ndefaults$5.exports = {\n defaults: getDefaults$1(),\n getDefaults: getDefaults$1,\n changeDefaults: changeDefaults$1\n};\n\n/**\n * Helpers\n */\n\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = /[&<>\"']/g;\nconst escapeTestNoEncode = /[<>\"']|&(?!#?\\w+;)/;\nconst escapeReplaceNoEncode = /[<>\"']|&(?!#?\\w+;)/g;\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$3(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\nfunction unescape$1(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, 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\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit$1(regex, opt) {\n regex = regex.source || regex;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\nfunction cleanUrl$1(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape$1(href))\n .replace(nonWordAndColonTest, '')\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\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\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 (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim$1(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest$1 = { exec: function noopTest() {} };\n\nfunction merge$2(obj) {\n let 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$1(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let 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 let 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$1(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - 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, l - suffLen);\n}\n\nfunction findClosingBracket$1(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; 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$1(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// copied from https://stackoverflow.com/a/5450113/806777\nfunction repeatString$1(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nvar helpers = {\n escape: escape$3,\n unescape: unescape$1,\n edit: edit$1,\n cleanUrl: cleanUrl$1,\n resolveUrl,\n noopTest: noopTest$1,\n merge: merge$2,\n splitCells: splitCells$1,\n rtrim: rtrim$1,\n findClosingBracket: findClosingBracket$1,\n checkSanitizeDeprecation: checkSanitizeDeprecation$1,\n repeatString: repeatString$1\n};\n\nconst { defaults: defaults$4 } = defaults$5.exports;\nconst {\n rtrim,\n splitCells,\n escape: escape$2,\n findClosingBracket\n} = helpers;\n\nfunction outputLink(cap, link, raw) {\n const href = link.href;\n const title = link.title ? escape$2(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n return {\n type: 'link',\n raw,\n href,\n title,\n text\n };\n } else {\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$2(text)\n };\n }\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nvar Tokenizer_1 = class Tokenizer {\n constructor(options) {\n this.options = options || defaults$4;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap) {\n if (cap[0].length > 1) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n return { raw: '\\n' };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim() : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text: text\n };\n }\n }\n\n nptable(src) {\n const cap = this.rules.block.nptable.exec(src);\n if (cap) {\n const 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 raw: cap[0]\n };\n\n if (item.header.length === item.align.length) {\n let l = item.align.length;\n let i;\n for (i = 0; i < l; 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 l = item.cells.length;\n for (i = 0; i < l; i++) {\n item.cells[i] = splitCells(item.cells[i], item.header.length);\n }\n\n return item;\n }\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *> ?/gm, '');\n\n return {\n type: 'blockquote',\n raw: cap[0],\n text\n };\n }\n }\n\n list(src) {\n const cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw = cap[0];\n const bull = cap[2];\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw,\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n // Get each top-level item.\n const itemMatch = cap[0].match(this.rules.block.item);\n\n let next = false,\n item,\n space,\n bcurr,\n bnext,\n addBack,\n loose,\n istask,\n ischecked,\n endMatch;\n\n let l = itemMatch.length;\n bcurr = this.rules.block.listItemStart.exec(itemMatch[0]);\n for (let i = 0; i < l; i++) {\n item = itemMatch[i];\n raw = item;\n\n if (!this.options.pedantic) {\n // Determine if current item contains the end of the list\n endMatch = item.match(new RegExp('\\\\n\\\\s*\\\\n {0,' + (bcurr[0].length - 1) + '}\\\\S'));\n if (endMatch) {\n addBack = item.length - endMatch.index + itemMatch.slice(i + 1).join('\\n').length;\n list.raw = list.raw.substring(0, list.raw.length - addBack);\n\n item = item.substring(0, endMatch.index);\n raw = item;\n l = i + 1;\n }\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 bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]);\n if (\n !this.options.pedantic\n ? bnext[1].length >= bcurr[0].length || bnext[1].length > 3\n : bnext[1].length > bcurr[1].length\n ) {\n // nested list or continuation\n itemMatch.splice(i, 2, itemMatch[i] + (!this.options.pedantic && bnext[1].length < bcurr[0].length && !itemMatch[i].match(/\\n$/) ? '' : '\\n') + itemMatch[i + 1]);\n i--;\n l--;\n continue;\n } else if (\n // different bullet style\n !this.options.pedantic || this.options.smartLists\n ? bnext[2][bnext[2].length - 1] !== bull[bull.length - 1]\n : isordered === (bnext[2].length === 1)\n ) {\n addBack = itemMatch.slice(i + 1).join('\\n').length;\n list.raw = list.raw.substring(0, list.raw.length - addBack);\n i = l - 1;\n }\n bcurr = bnext;\n }\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 // trim item newlines at end\n item = rtrim(item, '\\n');\n if (i !== l - 1) {\n raw = raw + '\\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(raw);\n if (i !== l - 1) {\n next = raw.slice(-2) === '\\n\\n';\n if (!loose) loose = next;\n }\n\n if (loose) {\n list.loose = true;\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.test(item);\n ischecked = undefined;\n if (istask) {\n ischecked = item[1] !== ' ';\n item = item.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: istask,\n checked: ischecked,\n loose: loose,\n text: item\n });\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n return {\n type: this.options.sanitize\n ? 'paragraph'\n : 'html',\n raw: cap[0],\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$2(cap[0])) : cap[0]\n };\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href: cap[2],\n title: cap[3]\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const 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 item.raw = cap[0];\n\n let l = item.align.length;\n let i;\n for (i = 0; i < l; 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 l = item.cells.length;\n for (i = 0; i < l; i++) {\n item.cells[i] = splitCells(\n item.cells[i].replace(/^ *\\| *| *\\| *$/g, ''),\n item.header.length);\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1]\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n return {\n type: 'paragraph',\n raw: cap[0],\n text: cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1]\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0]\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$2(cap[1])\n };\n }\n }\n\n tag(src, inLink, inRawBlock) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!inLink && /^<a /i.test(cap[0])) {\n inLink = true;\n } else if (inLink && /^<\\/a>/i.test(cap[0])) {\n inLink = false;\n }\n if (!inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n inRawBlock = true;\n } else if (inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink,\n inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape$2(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + 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 }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0]);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link || !link.href) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0]);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n return {\n type: 'em',\n raw: src.slice(0, lLength + match.index + rLength + 1),\n text: src.slice(1, lLength + match.index + rLength)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n return {\n type: 'strong',\n raw: src.slice(0, lLength + match.index + rLength + 1),\n text: src.slice(2, lLength + match.index + rLength - 1)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$2(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2]\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$2(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape$2(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$2(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape$2(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + text;\n } else {\n href = text;\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, inRawBlock, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$2(cap[0])) : cap[0];\n } else {\n text = escape$2(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n};\n\nconst {\n noopTest,\n edit,\n merge: merge$1\n} = helpers;\n\n/**\n * Block-Level Grammar\n */\nconst block$1 = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?:\\n+|$)|$)/,\n hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3})(bull) [\\s\\S]+?(?:hr|def|\\n{2,}(?! )(?! {0,3}bull )\\n*|\\s*$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\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 *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *\\n? *<?([^\\s>]+)>?(?:(?: +\\n? *| *\\n *)(title))? *(?:\\n+|$)/,\n nptable: noopTest,\n table: noopTest,\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]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock$1._label = /(?!\\s*\\])(?:\\\\[\\[\\]]|[^\\[\\]])+/;\nblock$1._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock$1.def = edit(block$1.def)\n .replace('label', block$1._label)\n .replace('title', block$1._title)\n .getRegex();\n\nblock$1.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock$1.item = /^( *)(bull) ?[^\\n]*(?:\\n(?! *bull ?)[^\\n]*)*/;\nblock$1.item = edit(block$1.item, 'gm')\n .replace(/bull/g, block$1.bullet)\n .getRegex();\n\nblock$1.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block$1.bullet)\n .getRegex();\n\nblock$1.list = edit(block$1.list)\n .replace(/bull/g, block$1.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block$1.def.source + ')')\n .getRegex();\n\nblock$1._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$1._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock$1.html = edit(block$1.html, 'i')\n .replace('comment', block$1._comment)\n .replace('tag', block$1._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock$1.paragraph = edit(block$1._paragraph)\n .replace('hr', block$1.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,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock$1.blockquote = edit(block$1.blockquote)\n .replace('paragraph', block$1.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock$1.normal = merge$1({}, block$1);\n\n/**\n * GFM Block Grammar\n */\n\nblock$1.gfm = merge$1({}, block$1.normal, {\n nptable: '^ *([^|\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}([-:]+ *\\\\|[-| :]*)' // Align\n + '(?:\\\\n((?:(?!\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)', // Cells\n table: '^ *\\\\|(.+)\\\\n' // Header\n + ' {0,3}\\\\|?( *[-:]+[-| :]*)' // Align\n + '(?:\\\\n *((?:(?!\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n});\n\nblock$1.gfm.nptable = edit(block$1.gfm.nptable)\n .replace('hr', block$1.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock$1.gfm.table = edit(block$1.gfm.table)\n .replace('hr', block$1.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock$1.pedantic = merge$1({}, block$1.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$1._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 fences: noopTest, // fences not supported\n paragraph: edit(block$1.normal._paragraph)\n .replace('hr', block$1.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block$1.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Inline-Level Grammar\n */\nconst inline$1 = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\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 reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip other delimiter (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /\\_\\_[^_*]*?\\*[^_*]*?\\_\\_|[punct_](\\*+)(?=[\\s]|$)|[^punct*_\\s](\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|[^punct*_\\s](\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /\\*\\*[^_*]*?\\_[^_*]*?\\*\\*|[punct*](\\_+)(?=[\\s]|$)|[^punct*_\\s](\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline$1._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline$1.punctuation = edit(inline$1.punctuation).replace(/punctuation/g, inline$1._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline$1.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\ninline$1.escapedEmSt = /\\\\\\*|\\\\_/g;\n\ninline$1._comment = edit(block$1._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline$1.emStrong.lDelim = edit(inline$1.emStrong.lDelim)\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1.emStrong.rDelimAst = edit(inline$1.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1.emStrong.rDelimUnd = edit(inline$1.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline$1._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline$1._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$1.autolink = edit(inline$1.autolink)\n .replace('scheme', inline$1._scheme)\n .replace('email', inline$1._email)\n .getRegex();\n\ninline$1._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline$1.tag = edit(inline$1.tag)\n .replace('comment', inline$1._comment)\n .replace('attribute', inline$1._attribute)\n .getRegex();\n\ninline$1._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline$1._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline$1._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline$1.link = edit(inline$1.link)\n .replace('label', inline$1._label)\n .replace('href', inline$1._href)\n .replace('title', inline$1._title)\n .getRegex();\n\ninline$1.reflink = edit(inline$1.reflink)\n .replace('label', inline$1._label)\n .getRegex();\n\ninline$1.reflinkSearch = edit(inline$1.reflinkSearch, 'g')\n .replace('reflink', inline$1.reflink)\n .replace('nolink', inline$1.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline$1.normal = merge$1({}, inline$1);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline$1.pedantic = merge$1({}, inline$1.normal, {\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline$1._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline$1._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline$1.gfm = merge$1({}, inline$1.normal, {\n escape: edit(inline$1.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~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n});\n\ninline$1.gfm.url = edit(inline$1.gfm.url, 'i')\n .replace('email', inline$1.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline$1.breaks = merge$1({}, inline$1.gfm, {\n br: edit(inline$1.br).replace('{2,}', '*').getRegex(),\n text: edit(inline$1.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n});\n\nvar rules = {\n block: block$1,\n inline: inline$1\n};\n\nconst Tokenizer$1 = Tokenizer_1;\nconst { defaults: defaults$3 } = defaults$5.exports;\nconst { block, inline } = rules;\nconst { repeatString } = helpers;\n\n/**\n * smartypants text replacement\n */\nfunction smartypants(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 email addresses\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; 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 * Block Lexer\n */\nvar Lexer_1 = class Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults$3;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer$1();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n')\n .replace(/\\t/g, ' ');\n\n this.blockTokens(src, this.tokens, true);\n\n this.inline(this.tokens);\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = [], top = true) {\n if (this.options.pedantic) {\n src = src.replace(/^ +$/gm, '');\n }\n let token, i, l, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call(this, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.type) {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // table no leading pipe (gfm)\n if (token = this.tokenizer.nptable(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n token.tokens = this.blockTokens(token.text, [], top);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n l = token.items.length;\n for (i = 0; i < l; i++) {\n token.items[i].tokens = this.blockTokens(token.items[i].text, [], false);\n }\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (top && (token = this.tokenizer.def(src))) {\n src = src.substring(token.raw.length);\n if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call(this, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n\n inline(tokens) {\n let i,\n j,\n k,\n l2,\n row,\n token;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n switch (token.type) {\n case 'paragraph':\n case 'text':\n case 'heading': {\n token.tokens = [];\n this.inlineTokens(token.text, token.tokens);\n break;\n }\n case 'table': {\n token.tokens = {\n header: [],\n cells: []\n };\n\n // header\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n token.tokens.header[j] = [];\n this.inlineTokens(token.header[j], token.tokens.header[j]);\n }\n\n // cells\n l2 = token.cells.length;\n for (j = 0; j < l2; j++) {\n row = token.cells[j];\n token.tokens.cells[j] = [];\n for (k = 0; k < row.length; k++) {\n token.tokens.cells[j][k] = [];\n this.inlineTokens(row[k], token.tokens.cells[j][k]);\n }\n }\n\n break;\n }\n case 'blockquote': {\n this.inline(token.tokens);\n break;\n }\n case 'list': {\n l2 = token.items.length;\n for (j = 0; j < l2; j++) {\n this.inline(token.items[j].tokens);\n }\n break;\n }\n }\n }\n\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = [], inLink = false, inRawBlock = false) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call(this, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src, inLink, inRawBlock)) {\n src = src.substring(token.raw.length);\n inLink = token.inLink;\n inRawBlock = token.inRawBlock;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n if (token.type === 'link') {\n token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);\n }\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (token.type === 'link') {\n token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);\n tokens.push(token);\n } else if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call(this, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, inRawBlock, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n};\n\nconst { defaults: defaults$2 } = defaults$5.exports;\nconst {\n cleanUrl,\n escape: escape$1\n} = helpers;\n\n/**\n * Renderer\n */\nvar Renderer_1 = class Renderer {\n constructor(options) {\n this.options = options || defaults$2;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape$1(lang, true)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n\n blockquote(quote) {\n return '<blockquote>\\n' + quote + '</blockquote>\\n';\n }\n\n html(html) {\n return html;\n }\n\n heading(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\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n listitem(text) {\n return '<li>' + text + '</li>\\n';\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n paragraph(text) {\n return '<p>' + text + '</p>\\n';\n }\n\n table(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\n tablerow(content) {\n return '<tr>\\n' + content + '</tr>\\n';\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? '<' + type + ' align=\"' + flags.align + '\">'\n : '<' + type + '>';\n return tag + content + '</' + type + '>\\n';\n }\n\n // span level renderer\n strong(text) {\n return '<strong>' + text + '</strong>';\n }\n\n em(text) {\n return '<em>' + text + '</em>';\n }\n\n codespan(text) {\n return '<code>' + text + '</code>';\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n del(text) {\n return '<del>' + text + '</del>';\n }\n\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + escape$1(href) + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = '<img src=\"' + href + '\" alt=\"' + text + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n};\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\n\nvar TextRenderer_1 = class TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n};\n\n/**\n * Slugger generates header id\n */\n\nvar Slugger_1 = class Slugger {\n constructor() {\n this.seen = {};\n }\n\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} options\n * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n};\n\nconst Renderer$1 = Renderer_1;\nconst TextRenderer$1 = TextRenderer_1;\nconst Slugger$1 = Slugger_1;\nconst { defaults: defaults$1 } = defaults$5.exports;\nconst {\n unescape\n} = helpers;\n\n/**\n * Parsing & Compiling\n */\nvar Parser_1 = class Parser {\n constructor(options) {\n this.options = options || defaults$1;\n this.options.renderer = this.options.renderer || new Renderer$1();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer$1();\n this.slugger = new Slugger$1();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call(this, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.tokens.header[j]),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.cells.length;\n for (j = 0; j < l2; j++) {\n row = token.tokens.cells[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k]),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'text') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call(this, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n};\n\nconst Lexer = Lexer_1;\nconst Parser = Parser_1;\nconst Tokenizer = Tokenizer_1;\nconst Renderer = Renderer_1;\nconst TextRenderer = TextRenderer_1;\nconst Slugger = Slugger_1;\nconst {\n merge,\n checkSanitizeDeprecation,\n escape\n} = helpers;\nconst {\n getDefaults,\n changeDefaults,\n defaults\n} = defaults$5.exports;\n\n/**\n * Marked\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 (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\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 (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n try {\n const tokens = Lexer.lex(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parse(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.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 changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const opts = merge({}, ...args);\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n let hasExtensions;\n\n args.forEach((pack) => {\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n hasExtensions = true;\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null;\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = (token) => {\n pack.walkTokens.call(this, token);\n if (walkTokens) {\n walkTokens(token);\n }\n };\n }\n\n if (hasExtensions) {\n opts.extensions = extensions;\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n for (const token of tokens) {\n callback(token);\n switch (token.type) {\n case 'table': {\n for (const cell of token.tokens.header) {\n marked.walkTokens(cell, callback);\n }\n for (const row of token.tokens.cells) {\n for (const cell of row) {\n marked.walkTokens(cell, callback);\n }\n }\n break;\n }\n case 'list': {\n marked.walkTokens(token.items, callback);\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n marked.walkTokens(token[childTokens], callback);\n });\n } else if (token.tokens) {\n marked.walkTokens(token.tokens, callback);\n }\n }\n }\n }\n};\n\n/**\n * Parse Inline\n */\nmarked.parseInline = function(src, opt) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked.parseInline(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked.parseInline(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n try {\n const tokens = Lexer.lexInline(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parseInline(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.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 * 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.Tokenizer = Tokenizer;\n\nmarked.Slugger = Slugger;\n\nmarked.parse = marked;\n\nvar marked_1 = marked;\n\nexport default marked_1;\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire (path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$1 = {exports: {}};\n\n/* global define */\n\n(function (module, exports) {\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}(pluralize$1));\n\nvar pluralize = pluralize$1.exports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";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 s=t.WeakMap,i={};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)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.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 c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+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,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=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)}).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,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):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,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.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:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=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(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[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||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var 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\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\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+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(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(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];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,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}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,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(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);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.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=l[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 c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^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),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.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(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.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},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(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($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;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++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(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&&!Ue.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,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));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)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(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}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\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 { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport _marked from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.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 html = hyperHTML;\n/** @type {import(\"marked\")} */\n// @ts-ignore\nexport const marked = _marked;\n/** @type {import(\"pluralize\")} */\n// @ts-ignore\nexport const pluralize = _pluralize;\n\n/** @type {import(\"sniffy-mimetype\")} */\n// @ts-ignore\nexport const MIMEType = _MIMEType;\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 { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\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\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\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) {\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\n/**\n * @param {Document} doc\n */\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} 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// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\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\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @param {string} lang\n */\nfunction resolveLanguageAlias(lang) {\n const aliases = {\n \"zh-hans\": \"zh\",\n \"zh-cn\": \"zh\",\n };\n return aliases[lang] || lang;\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = resolveLanguageAlias(lang.toLowerCase());\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-ignore\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = (data[lang] && data[lang][key]) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Formats a date to \"yyyy-mm-dd\".\n * @param {Date} date\n */\nexport function toShortIsoDate(date) {\n return ISODate.format(date);\n}\n\n/**\n * Given either a Date object or a date in `YYYY-MM-DD` format, return a\n * human-formatted date suitable for use in the specification.\n * @param {Date | string} [date]\n */\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\n/**\n * Given either a Date object or a date in `YYYY-MM-DD` format, return an ISO\n * formatted date suitable for use in a xsd:datetime item\n * @param {Date | string} date\n */\nexport function isoDate(date) {\n return (date instanceof Date ? date : new Date(date)).toISOString();\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\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/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\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\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\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 const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\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\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 = 24 * 60 * 60 * 1000) {\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.toISOString());\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// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * 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 (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || 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 return only whitespace-only nodes.\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 the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * 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\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\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 if (!linkForElem) result.push({ for: title, 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 * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\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 * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\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 /** @returns {Generator<string, never, never>} */\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\n/** @extends {Set<string>} */\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\n/**\n * @param {HTMLElement} node\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 => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\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\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n return strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n}\n","// @ts-check\nimport { expose } from \"./expose-modules.js\";\nimport { showError } from \"./utils.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 const msg = `Error when calling function ${cb.name}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\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\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 removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"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}\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 { html } 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\nexport function 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 prettify(cloneDoc);\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 = html`<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 = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n * This module also adds the legacy `document.respecIsReady` property for\n * backward compatibility. It is now an alias to `document.respec.ready`.\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { showWarning } from \"../core/utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", resolve, { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n\n let respecIsReadyWarningShown = false;\n Object.defineProperty(document, \"respecIsReady\", {\n get() {\n if (!respecIsReadyWarningShown) {\n const msg =\n \"`document.respecIsReady` is deprecated and will be removed in a future release.\";\n const hint = \"Use `document.respec.ready` instead.\";\n showWarning(msg, name, { hint });\n respecIsReadyWarningShown = true;\n }\n return document.respec.ready;\n },\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 { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\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 { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await 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\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\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 } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = 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 const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#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-save-button:link:focus {\n background: #193766;\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-error-list li > p:first-child,\n.respec-warning-list li > p:first-child {\n display: inline;\n}\n\n.respec-warning-list > li li,\n.respec-error-list > li li {\n margin: 0;\n list-style: disc;\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@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\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.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n`;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().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/**\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 { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\n/**\n * @param {string} text\n */\nexport function markdownToHtml(text) {\n const normalizedLeftPad = reindent(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 langPrefix: \"\",\n renderer: new Renderer(),\n });\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\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 * Re-structure DOM around elem whose markdown has been processed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem, elem.ownerDocument);\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}\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 = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\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 for (const processedElem of processMDSections(document.body)) {\n restructure(processedElem);\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 newBody = document.body.cloneNode(true);\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 workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\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.append(rsUI, fragment);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\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\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { joinAnd } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.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\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\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 = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\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 = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\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(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(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 ]);\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 /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec 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 respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\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 trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin ? ` <small>(Plugin: \"${err.plugin}\")</small>.` : \"\";\n const hint = err.hint ? ` ${err.hint}` : \"\";\n const elements = Array.isArray(err.elements)\n ? ` Occurred at: ${joinAnd(err.elements.map(generateMarkdownLink))}.`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n\n const text = `${err.message}${hint}${elements}${plugin}${details}`;\n return markdownToHtml(text);\n}\n\n/**\n * @param {Element} element\n * @param {number} i\n */\nfunction generateMarkdownLink(element, i) {\n return `[${i + 1}](#${element.id})`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/w3c/group.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/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/w3c/level.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/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/webidl.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/xref.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/webidl-index.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/dfn-index.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/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/dfn-panel.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 import(\"../src/core/web-monetization.js\"),\n /* Linters must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/check-internal-slots.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/wpt-tests-exist.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n import(\"../src/core/linter-rules/a11y.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.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 * @module w3c/group\n *\n * `group` is a shorthand configuration option for specifying `wg`, `wgId`,\n * `wgURI`, and `wgPatentURI` options.\n */\n\nimport {\n codedJoinAnd,\n docLink,\n fetchAndCache,\n showError,\n showWarning,\n} from \"../core/utils.js\";\n\nexport const name = \"w3c/group\";\n\nconst W3C_GROUPS_API = \"https://respec.org/w3c/groups/\";\nconst LEGACY_OPTIONS = [\"wg\", \"wgURI\", \"wgId\", \"wgPatentURI\", \"wgPatentPolicy\"];\n\nexport async function run(conf) {\n const usedLegacyOptions = LEGACY_OPTIONS.filter(opt => conf[opt]);\n\n if (!conf.group) {\n if (usedLegacyOptions.length) {\n const outdatedOptionsStr = codedJoinAnd(LEGACY_OPTIONS);\n const msg = `Configuration options ${outdatedOptionsStr} are deprecated.`;\n const hint = docLink`Please use the ${\"[group]\"} configuration option instead.`;\n showWarning(msg, name, { hint });\n }\n return;\n }\n\n if (usedLegacyOptions.length) {\n const outdatedOptionsStr = codedJoinAnd(usedLegacyOptions);\n const msg = docLink`Configuration options ${outdatedOptionsStr} are superseded by ${\"[group]\"} and will be overridden by ReSpec.`;\n const hint = docLink`Remove them from the document's ${\"[respecConfig]\"} to silence this warning.`;\n showWarning(msg, name, { hint });\n }\n\n const { group } = conf;\n const groupDetails = Array.isArray(group)\n ? await getMultipleGroupDetails(group)\n : await getGroupDetails(group);\n Object.assign(conf, groupDetails);\n}\n\n/** @param {string[]} groups */\nasync function getMultipleGroupDetails(groups) {\n const details = await Promise.all(groups.map(getGroupDetails));\n /** @type {{ [key in keyof GroupDetails]: GroupDetails[key][] }} */\n const result = {\n wg: [],\n wgId: [],\n wgURI: [],\n wgPatentURI: [],\n wgPatentPolicy: [],\n groupType: [],\n };\n for (const groupDetails of details.filter(o => o)) {\n for (const key of Object.keys(result)) {\n result[key].push(groupDetails[key]);\n }\n }\n return result;\n}\n\n/**\n * @param {string} group\n * @typedef {{ wgId: number, wg: string, wgURI: string, wgPatentURI: string, wgPatentPolicy: string, groupType: W3CGroupType }} GroupDetails\n * @returns {Promise<GroupDetails|undefined>}\n */\nasync function getGroupDetails(group) {\n let type = \"\";\n let shortname = group;\n if (group.includes(\"/\")) {\n [type, shortname] = group.split(\"/\", 2);\n }\n const url = new URL(`${shortname}/${type}`, W3C_GROUPS_API);\n const res = await fetchAndCache(url.href);\n if (res.ok) {\n const json = await res.json();\n const {\n id: wgId,\n name: wg,\n URI: wgURI,\n patentURI: wgPatentURI,\n patentPolicy: wgPatentPolicy,\n type: groupType,\n } = json;\n return { wg, wgId, wgURI, wgPatentURI, wgPatentPolicy, groupType };\n }\n\n const text = await res.text();\n const message = `Failed to fetch group details (HTTP: ${res.status}). ${text}`;\n const hint =\n res.status === 404\n ? docLink`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${\"[group]\"} configuration option.`\n : undefined;\n showError(message, name, { hint });\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.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\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n humanDate,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { lang as defaultLang } from \"../../core/l10n.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} 이전 `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 以前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` 直到 ${date} `;\n },\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst orcidIcon = () => html`<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\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n const l10n = localizationStrings[lang];\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n if (person.retiredDate) {\n const { retiredDate } = person;\n const time = html`<time datetime=\"${retiredDate}\"\n >${humanDate(retiredDate)}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\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 const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\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 return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData, humanDate, showWarning } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst name = \"w3c/templates/headers\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/legalcode\";\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\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n edited_in_place: \"edited in place\",\n this_version: \"This version:\",\n test_suite: \"Test suite:\",\n implementation_report: \"Implementation report:\",\n prev_editor_draft: \"Previous editor's draft:\",\n prev_version: \"Previous version:\",\n prev_recommendation: \"Previous Recommendation:\",\n latest_recommendation: \"Latest Recommendation:\",\n },\n ko: {\n author: \"저자:\",\n authors: \"저자:\",\n editor: \"편집자:\",\n editors: \"편집자:\",\n former_editor: \"이전 편집자:\",\n former_editors: \"이전 편집자:\",\n latest_editors_draft: \"최신 편집 초안:\",\n latest_published_version: \"최신 버전:\",\n this_version: \"현재 버전:\",\n },\n zh: {\n author: \"作者:\",\n authors: \"作者:\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n this_version: \"本版本:\",\n test_suite: \"测试套件:\",\n implementation_report: \"实现报告:\",\n prev_editor_draft: \"上一版编辑草稿:\",\n prev_version: \"上一版:\",\n prev_recommendation: \"上一版正式推荐标准:\",\n latest_recommendation: \"最新发布的正式推荐标准:\",\n },\n ja: {\n author: \"著者:\",\n authors: \"著者:\",\n editor: \"編者:\",\n editors: \"編者:\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n this_version: \"このバージョン:\",\n test_suite: \"テストスイート:\",\n implementation_report: \"実装レポート:\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n author: \"Autor:\",\n authors: \"Autores:\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n latest_editors_draft: \"Borrador de editor mas reciente:\",\n latest_published_version: \"Versión publicada mas reciente:\",\n this_version: \"Ésta versión:\",\n },\n de: {\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n former_editor: \"Frühere Mitwirkende:\",\n former_editors: \"Frühere Mitwirkende:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n this_version: \"Diese Fassung:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\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, options) => {\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${document.querySelector(\"h1#title\")}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.prependW3C ? \"W3C \" : \"\"}${conf.isCR\n ? `${conf.longStatus}`\n : `${conf.textStatus}`}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >${conf.modificationDate\n ? html`, ${l10n.edited_in_place}${\" \"}\n ${inPlaceModificationDate(conf.modificationDate)}`\n : \"\"}\n </h2>\n <dl>\n ${conf.isTagFinding || !conf.isNoTrack\n ? html`\n <dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>\n <dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>\n `\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>${l10n.test_suite}</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>${l10n.implementation_report}</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.isED && conf.prevED\n ? html`\n <dt>${l10n.prev_editor_draft}</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n ${conf.showPreviousVersion\n ? html`\n <dt>${l10n.prev_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>${l10n.prev_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `\n : html`\n <dt>${l10n.latest_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `}\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.errata\n ? html`<p>\n Please check the\n <a href=\"${conf.errata}\"><strong>errata</strong></a> for any errors or\n issues reported since publication.\n </p>`\n : \"\"}\n ${conf.isRec\n ? html`<p>\n See also\n <a\n href=\"${`https://www.w3.org/Translations/?technology=${conf.shortName}`}\"\n >\n <strong>translations</strong></a\n >.\n </p>`\n : \"\"}\n ${conf.alternateFormats\n ? html`<p>\n ${options.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n\n/**\n * @param {string} date document in-place edit date as YYYY-MM-DD\n * @returns {HTMLTimeElement}\n */\nfunction inPlaceModificationDate(date) {\n const modificationHumanDate = humanDate(new Date(date));\n return html`<time class=\"dt-modified\" datetime=\"${date}\"\n >${modificationHumanDate}</time\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`<a rel=\"license\" href=\"${url}\" class=\"${cssClass}\">${text}</a>`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.hasOwnProperty(\"overrideCopyright\")) {\n const msg = \"The `overrideCopyright` configuration option is deprecated.\";\n const hint =\n 'Please add a `<p class=\"copyright\">` element directly to your document instead';\n showWarning(msg, name, { hint });\n return html`${[conf.overrideCopyright]}`;\n }\n if (conf.isUnofficial && conf.licenseInfo) {\n return html`<p class=\"copyright\">\n This document is licensed under a\n ${linkLicense(conf.licenseInfo.name, conf.licenseInfo.url, \"subfoot\")}\n (${conf.licenseInfo.short}).\n </p>`;\n }\n return renderOfficialCopyright(conf);\n}\n\nfunction renderOfficialCopyright(conf) {\n return html`<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` ${[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\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 { html } from \"../../core/import-maps.js\";\nimport { l10n } from \"./headers.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nexport default (conf, options) => {\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n }\n\n const specTitleElem = document.querySelector(\"h1#title\");\n const specTitleElemClone = specTitleElem.cloneNode(true);\n\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${specTitleElem}\n ${conf.subtitle ? html`<h2 id=\"subtitle\">${conf.subtitle}</h2>` : \"\"}\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>${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>${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>${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.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 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.alternateFormats\n ? html`<p>\n ${options.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${existingCopyright\n ? existingCopyright\n : html`<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` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n the Contributors to the ${specTitleElemClone.childNodes}\n 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\n 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\n 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","// @ts-check\nimport { getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n sotd: \"Status of This Document\",\n },\n ko: {\n sotd: \"현재 문서의 상태\",\n },\n zh: {\n sotd: \"关于本文档\",\n },\n ja: {\n sotd: \"この文書の位置付け\",\n },\n nl: {\n sotd: \"Status van dit document\",\n },\n es: {\n sotd: \"Estado de este Document\",\n },\n de: {\n sotd: \"Status dieses Dokuments\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nexport default (conf, opts) => {\n return html`\n <h2>${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 `\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.isRec ? renderIsRec(conf) : renderNotRec(conf)}\n ${renderDeliverer(conf)}\n <p>\n This document is governed by the\n <a\n id=\"w3c_process_revision\"\n href=\"https://www.w3.org/2020/Process-20200915/\"\n >15 September 2020 W3C Process Document</a\n >.\n </p>\n ${conf.addPatentNote\n ? html`<p>${[conf.addPatentNote]}</p>`\n : \"\"}\n `}\n `}\n ${opts.additionalSections}\n `;\n};\n\nexport function renderPreview(conf) {\n const { prUrl, prNumber, edDraftURI } = conf;\n return html`<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 : \"\"}\n </summary>\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\nfunction renderIsUnofficial(opts) {\n const { additionalContent } = opts;\n return html`\n <p>\n This document is a 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 renderNotRec(conf) {\n let statusExplanation = \"\";\n let updatePolicy = html`This is a draft document and may be updated, replaced\n or obsoleted by other documents at any time. It is inappropriate to cite this\n document as other than work in progress.\n ${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"https://www.w3.org/2020/Process-20200915/#allow-new-features\"\n >new features</a\n >.`\n : \"\"}`;\n let reviewPolicy = \"\";\n if (conf.specStatus === \"CRD\") {\n statusExplanation =\n \"A Candidate Recommendation Draft integrates changes from the previous Candidate Recommendation that the Working Group intends to include in a subsequent Candidate Recommendation Snapshot.\";\n if (conf.pubMode === \"LS\") {\n updatePolicy =\n \"This document is maintained and updated at any time. Some parts of this document are work in progress. \";\n }\n } else if (conf.specStatus === \"CR\") {\n statusExplanation = html`A Candidate Recommendation Snapshot has received\n <a href=\"https://www.w3.org/2020/Process-20200915/#dfn-wide-review\"\n >wide review</a\n >\n and is intended to gather\n <a href=\"${conf.implementationReportURI}\">implementation experience</a>.`;\n updatePolicy = html`${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"https://www.w3.org/2020/Process-20200915/#allow-new-features\"\n >new features</a\n >.`\n : \"\"}`;\n if (conf.pubMode === \"LS\") {\n reviewPolicy = `Comments are welcome at any time but most especially before ${conf.humanCREnd}.`;\n } else {\n reviewPolicy = `This Candidate Recommendation is not expected to advance to Proposed Recommendation any earlier than ${conf.humanCREnd}.`;\n }\n } else if (conf.isPR) {\n reviewPolicy = html` The W3C Membership and other interested parties are\n invited to review the document and send comments through\n ${conf.humanPREnd}. Advisory Committee Representatives should consult\n their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended ${conf.humanCREnd}.`;\n } else if (conf.isPER) {\n reviewPolicy = html` W3C Advisory Committee Members are invited to send\n formal review comments on this Proposed Edited Recommendation to the W3C\n Team until ${conf.humanPEREnd}. Members of the Advisory Committee will\n find the appropriate review form for this document by consulting their\n list of current\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.`;\n }\n return html`<p>\n Publication as ${conf.anOrA} ${conf.textStatus} does not imply endorsement\n by the W3C Membership. ${statusExplanation}\n </p>\n ${updatePolicy ? html`<p>${updatePolicy}</p>` : \"\"}\n <p>${reviewPolicy}</p>`;\n}\n\nfunction renderIsRec({\n updateableRec,\n revisionTypes = [],\n humanRevisedRecEnd,\n}) {\n let reviewTarget = \"\";\n if (revisionTypes.includes(\"addition\")) {\n reviewTarget = \"additions\";\n }\n if (revisionTypes.includes(\"correction\") && !reviewTarget) {\n reviewTarget = \"corrections\";\n }\n return html`<p>\n A W3C Recommendation is a specification that, after extensive\n consensus-building, has received the endorsement of the W3C and its\n Members. W3C recommends the wide deployment of this specification as a\n standard for the Web.\n ${updateableRec\n ? html`Future updates to this Recommendation may incorporate\n <a\n href=\"https://www.w3.org/2020/Process-20200915/#allow-new-features\"\n >new features</a\n >.`\n : \"\"}\n </p>\n ${revisionTypes.includes(\"addition\")\n ? html`<p class=\"addition\">\n Proposed additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"correction\")\n ? html`<p class=\"correction\">\n Proposed corrections are marked in the document.\n </p>`\n : \"\"}\n ${reviewTarget\n ? html`<p>\n The W3C Membership and other interested parties are invited to review\n the proposed ${reviewTarget} and send comments through\n ${humanRevisedRecEnd}. Advisory Committee Representatives should\n consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\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 wgPatentPolicy,\n } = conf;\n\n const patentPolicyURL =\n wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/Consortium/Patent-Policy/\";\n\n const producers = !isIGNote\n ? html`\n This document was produced by ${multipleWGs ? \"groups\" : \"a group\"}\n operating under the\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >.\n `\n : \"\";\n const wontBeRec = recNotExpected\n ? `The ${\n multipleWGs ? \"groups do\" : \"group does\"\n } not expect this document to become a W3C Recommendation.`\n : \"\";\n return html`<p data-deliverer=\"${isNote || isIGNote ? wgId : null}\">\n ${producers} ${wontBeRec}\n ${!isNote && !isIGNote\n ? html`\n ${multipleWGs\n ? html` W3C maintains ${wgPatentHTML} `\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=\"${patentPolicyURL}#def-essential\">Essential Claim(s)</a>\n must disclose the information in accordance with\n <a href=\"${patentPolicyURL}#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\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\n const patentPolicyURL =\n conf.wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/Consortium/Patent-Policy/\";\n\n return html`<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, or\n 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 Member\n 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=\"${patentPolicyURL}#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\nfunction noteForTeamSubmission(conf, opts) {\n return html`\n ${renderPublicList(conf, opts)}\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\nexport function renderPublicList(conf, opts) {\n const { mailToWGPublicListWithSubject, mailToWGPublicListSubscription } =\n opts;\n const { wgPublicList, subjectPrefix } = conf;\n const archivesURL = `https://lists.w3.org/Archives/Public/${wgPublicList}/`;\n return html`<p>\n If you wish to make comments regarding this document, please send them to\n <a href=\"${mailToWGPublicListWithSubject}\">${wgPublicList}@w3.org</a>\n (<a href=\"${mailToWGPublicListSubscription}\">subscribe</a>,\n <a href=\"${archivesURL}\">archives</a>)${subjectPrefix\n ? html` with <code>${subjectPrefix}</code> at the start of your email's\n subject`\n : \"\"}.\n </p>`;\n}\n\nfunction linkToWorkingGroup(conf) {\n if (!conf.wg) {\n return;\n }\n let proposedChanges = null;\n if (conf.isRec && conf.revisionTypes && conf.revisionTypes.length) {\n if (conf.revisionTypes.includes(\"addition\")) {\n if (conf.revisionTypes.includes(\"correction\")) {\n proposedChanges = html`It includes\n <a href=\"https://www.w3.org/2020/Process-20200915/#proposed-changes\"\n >proposed changes</a\n >, introducing substantive changes and new features since the previous\n Recommentation.`;\n } else {\n proposedChanges = html`It includes\n <a href=\"https://www.w3.org/2020/Process-20200915/#proposed-addition\"\n >proposed additions</a\n >, introducing new features since the previous Recommentation.`;\n }\n } else if (conf.revisionTypes.includes(\"correction\")) {\n proposedChanges = html`It includes\n <a href=\"https://www.w3.org/2020/Process-20200915/#proposed-correction\"\n >proposed corrections</a\n >.`;\n }\n }\n return html`<p>\n This document was published by ${conf.wgHTML} as ${conf.anOrA}\n ${conf.longStatus}. ${proposedChanges}\n ${conf.notYetRec\n ? \"This document is intended to become a W3C Recommendation.\"\n : \"\"}\n </p>`;\n}\n\nexport function linkToCommunity(conf, opts) {\n if (!conf.github && !conf.wgPublicList) {\n return;\n }\n return html`<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 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` with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject`\n : \"\"}.\n `\n : \"\"}\n </p>`;\n}\n","// @ts-check\nimport {\n l10n,\n linkToCommunity,\n renderPreview,\n renderPublicList,\n} from \"./sotd.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\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.github && conf.wgPublicList ? renderPublicList(conf, opts) : \"\"}\n ${conf.github ? linkToCommunity(conf, opts) : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${opts.additionalSections}\n `;\n};\n","// @ts-check\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 specify 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// - 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 version of the specification.\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 {\n ISODate,\n codedJoinAnd,\n codedJoinOr,\n concatDate,\n docLink,\n htmlJoinAnd,\n showError,\n showWarning,\n} 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 { html } 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\n/**\n * Resolves against https://www.w3.org.\n * @param {string} href\n */\nfunction w3Url(href) {\n return new URL(href, \"https://www.w3.org/\").href;\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 publicationSpaces = {\n \"Member-SUBM\": \"/Submission\",\n \"Team-SUBM\": \"/TeamSubmission/\",\n finding: \"/2001/tag/doc\",\n \"draft-finding\": \"/2001/tag/doc\",\n};\n\nconst status2rdf = {\n NOTE: \"w3p:NOTE\",\n WD: \"w3p:WD\",\n LC: \"w3p:LastCall\",\n CR: \"w3p:CR\",\n CRD: \"w3p:CRD\",\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 CRD: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n PER: \"Proposed Edited Recommendation\",\n REC: \"Recommendation\",\n RSCND: \"Rescinded Recommendation\",\n unofficial: \"Unofficial Draft\",\n base: \"\",\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 CR: \"Candidate Recommendation Snapshot\",\n CRD: \"Candidate Recommendation Draft\",\n \"FPWD-NOTE\": \"First Public Working Group Note\",\n \"LC-NOTE\": \"Last Call Working Draft\",\n};\nexport const W3CNotes = [\"FPWD-NOTE\", \"WG-NOTE\"];\nexport const maybeRecTrack = [\"FPWD\", \"WD\"];\nexport const recTrackStatus = [\"FPLC\", \"LC\", \"CR\", \"CRD\", \"PR\", \"PER\", \"REC\"];\nexport const cgStatus = [\"CG-DRAFT\", \"CG-FINAL\"];\nexport const bgStatus = [\"BG-DRAFT\", \"BG-FINAL\"];\nexport const cgbgStatus = [...cgStatus, ...bgStatus];\nconst noTrackStatus = [\n \"base\",\n ...cgStatus,\n ...bgStatus,\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\nconst precededByAn = [\"ED\", \"IG-NOTE\"];\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"w3c-software\",\n {\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 ],\n [\n \"w3c-software-doc\",\n {\n name: \"W3C Software and Document Notice and License\",\n short: \"W3C Software and Document\",\n url: \"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\",\n },\n ],\n [\n \"cc-by\",\n {\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]);\n\nconst patentPolicies = [\"PP2017\", \"PP2020\"];\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 = docLink`${prop} is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = docLink`Missing required configuration: ${\"[specStatus]\"}.`;\n const hint = docLink`Please select an appropriate status from ${\"[specStatus]\"} based on your W3C group. If in doubt, use \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n }\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n if (conf.isUnofficial && !Array.isArray(conf.logos)) {\n conf.logos = [];\n }\n if (conf.isUnofficial) {\n if (conf.license && !licenses.has(conf.license)) {\n const msg = docLink`The ${\"[license]\"} configuration option has an invalid value: \"\\`${\n conf.license\n }\\`\". Defaulting to \"cc-by\".`;\n const hint = docLink`Please explicitly set ${\"[license]\"} to one of: ${codedJoinOr(\n [...licenses.keys()]\n )}.`;\n showError(msg, name, { hint });\n conf.license = \"cc-by\";\n }\n // default it to cc-by\n if (conf.license === undefined) {\n conf.license = \"cc-by\";\n }\n }\n\n conf.isCCBY = conf.license === \"cc-by\";\n conf.isW3CSoftAndDocLicense = conf.license === \"w3c-software-doc\";\n if (!conf.isUnofficial && [\"cc-by\"].includes(conf.license)) {\n const msg = docLink`License \"\\`${conf.license}\\`\" is not allowed for W3C Specifications.`;\n const hint = docLink`Please set ${\"[license]\"} to \"w3c-software-doc\" instead.`;\n showError(msg, name, { hint });\n }\n conf.licenseInfo = licenses.get(conf.license);\n conf.isCGBG = cgbgStatus.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\n if (conf.isRegular && !conf.shortName) {\n const msg = \"Missing required configuration: `shortName`\";\n showError(msg, name);\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 const wptLiveURL = `https://wpt.live/${conf.shortName}`;\n const hint = docLink`Please update your ${\"[testSuiteURI]\"} to point to the new tests repository (e.g., ${wptLiveURL}).`;\n showWarning(msg, name, { hint });\n }\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\n if (conf.isRecTrack && !hasGitHubIssuesLink(conf)) {\n const msg = docLink`Missing link to GitHub in head of document.`;\n const hint = docLink`Please add the ${\"[github]\"} configuration option to document's ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n if (!conf.edDraftURI) {\n conf.edDraftURI = \"\";\n if (conf.specStatus === \"ED\") {\n const msg = \"Editor's Drafts should set edDraftURI.\";\n showWarning(msg, name);\n }\n }\n const maturity = status2maturity[conf.specStatus] || conf.specStatus;\n const pubSpace = publicationSpaces[conf.specStatus] || \"/TR\";\n if (conf.isRegular) {\n const { shortName, publishDate } = conf;\n const year = conf.publishDate.getUTCFullYear();\n const date = concatDate(publishDate);\n const docVersion = `${maturity}-${shortName}-${date}`;\n conf.thisVersion = w3Url(`${pubSpace}/${year}/${docVersion}/`);\n }\n if (conf.specStatus === \"ED\") conf.thisVersion = conf.edDraftURI;\n\n const latestPath = `${pubSpace}/${conf.shortName}`;\n\n if (conf.latestVersion !== null) {\n conf.latestVersion = conf.latestVersion\n ? w3Url(`${conf.latestVersion}`)\n : w3Url(`${pubSpace}/${conf.shortName}/`);\n }\n\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n const msg = \"`previousPublishDate` is set, but not `previousMaturity`.\";\n showError(msg, name);\n }\n\n conf.previousPublishDate = validateDateAndRecover(\n conf,\n \"previousPublishDate\"\n );\n\n const prevMaturity =\n status2maturity[conf.previousMaturity] ?? conf.previousMaturity;\n if (conf.isTagFinding && conf.latestVersion) {\n const pubDate = ISODate.format(conf.publishDate);\n conf.thisVersion = w3Url(`${latestPath}-${pubDate}`);\n const prevPubDate = ISODate.format(conf.previousPublishDate);\n conf.prevVersion = w3Url(`${latestPath}-${prevPubDate}}`);\n } else if (conf.isCGBG || conf.isBasic) {\n conf.prevVersion = conf.prevVersion || \"\";\n } else {\n const year = conf.previousPublishDate.getUTCFullYear();\n const { shortName } = conf;\n const date = concatDate(conf.previousPublishDate);\n conf.prevVersion = w3Url(\n `${pubSpace}/${year}/${prevMaturity}-${shortName}-${date}/`\n );\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 const msg =\n \"This document is on the W3C Recommendation Track, but is missing the required 'Previous Version' link.\";\n const hint = docLink`Add ${\"[previousMaturity]\"} and ${\"[previousPublishDate]\"} to the document's ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n if (!conf.prevVersion) conf.prevVersion = \"\";\n }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = w3Url(`${pubSpace}/${conf.prevRecShortname}`);\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\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 const msg = \"At least one editor is required.\";\n showError(msg, name);\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 const msg = \"All alternate formats must have a uri and a label.\";\n showError(msg, name);\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 const msg = \"Recommendations must have an errata link.\";\n const hint = docLink`Add an ${\"[errata]\"} URL to your ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n conf.prependW3C = !conf.isBasic && !conf.isUnofficial;\n conf.isED = conf.specStatus === \"ED\";\n conf.isCR = conf.specStatus === \"CR\" || conf.specStatus === \"CRD\";\n conf.isCRDraft = conf.specStatus === \"CRD\";\n conf.isPR = conf.specStatus === \"PR\";\n conf.isPER = conf.specStatus === \"PER\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = W3CNotes.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 validatePatentPolicies(conf);\n\n // configuration done - yay!\n\n const options = {\n get multipleAlternates() {\n return conf.alternateFormats && conf.alternateFormats.length > 1;\n },\n get alternatesHTML() {\n return (\n conf.alternateFormats &&\n htmlJoinAnd(\n // We need to pass a string here...\n conf.alternateFormats.map(({ label }) => label),\n (_, i) => {\n const alt = conf.alternateFormats[i];\n return html`<a\n rel=\"alternate\"\n href=\"${alt.uri}\"\n hreflang=\"${alt?.lang ?? null}\"\n type=\"${alt?.type ?? null}\"\n >${alt.label}</a\n >`;\n }\n )\n );\n },\n };\n\n // insert into document\n const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf, options);\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 const msg =\n \"A Status of This Document must include at least on custom paragraph.\";\n const hint =\n \"Add a `<p>` in the 'sotd' section that reflects the status of this specification.\";\n showError(msg, name, { elements: [sotd], hint });\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 const msg = docLink`If one of ${\"[wg]\"}, ${\"[wgURI]\"}, or ${\"[wgPatentURI]\"} is an array, they all have to be.`;\n const hint = docLink`Use the ${\"[group]\"} option with an array instead.`;\n showError(msg, name, { hint });\n }\n if (conf.isCGBG && !conf.wg) {\n const msg = docLink`${\"[wg]\"} configuration option is required for this kind of document.`;\n showError(msg, name);\n }\n if (Array.isArray(conf.wg)) {\n conf.multipleWGs = conf.wg.length > 1;\n conf.wgHTML = htmlJoinAnd(conf.wg, (wg, idx) => {\n return html`the <a href=\"${conf.wgURI[idx]}\">${wg}</a>`;\n });\n\n conf.wgPatentHTML = htmlJoinAnd(conf.wg, (wg, i) => {\n return html`a\n <a href=\"${conf.wgPatentURI[i]}\" rel=\"disclosure\"\n >public list of any patent disclosures (${wg})</a\n >`;\n });\n } else {\n conf.multipleWGs = false;\n if (conf.wg) {\n conf.wgHTML = html`the <a href=\"${conf.wgURI}\">${conf.wg}</a>`;\n }\n }\n if (conf.specStatus === \"PR\" && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"} (needed to indicate end of previous CR).`;\n showError(msg, name);\n }\n\n if (conf.specStatus === \"CR\" && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"CR\", but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.crEnd = validateDateAndRecover(conf, \"crEnd\");\n conf.humanCREnd = W3CDate.format(conf.crEnd);\n\n if (conf.specStatus === \"PR\" && !conf.prEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[prEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.prEnd = validateDateAndRecover(conf, \"prEnd\");\n conf.humanPREnd = W3CDate.format(conf.prEnd);\n\n if (conf.specStatus === \"PER\" && !conf.perEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\", but no ${\"[prEnd]\"} is specified`;\n showError(msg, name);\n }\n conf.perEnd = validateDateAndRecover(conf, \"perEnd\");\n conf.humanPEREnd = W3CDate.format(conf.perEnd);\n\n if (conf.hasOwnProperty(\"updateableRec\")) {\n const msg = \"Configuration option `updateableRec` is deprecated.\";\n const hint = docLink`Add an ${\"[`updateable-rec`|#updateable-rec-class]\"} CSS class to the Status of This Document section instead.`;\n showWarning(msg, name, { hint });\n if (conf.updateableRec) {\n sotd.classList.add(\"updateable-rec\");\n }\n }\n\n conf.updateableRec = sotd.classList.contains(\"updateable-rec\");\n const revisionTypes = [\"addition\", \"correction\"];\n if (conf.specStatus === \"REC\" && conf.revisionTypes?.length > 0) {\n if (conf.revisionTypes.some(x => !revisionTypes.includes(x))) {\n const unknownRevisionTypes = conf.revisionTypes.filter(\n x => !revisionTypes.includes(x)\n );\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with unknown ${\"[revisionTypes]\"}: '${codedJoinOr(\n unknownRevisionTypes\n )}'.`;\n const hint = docLink`The valid values for ${\"[revisionTypes]\"} are: ${codedJoinOr(\n revisionTypes\n )}.`;\n showError(msg, name, { hint });\n }\n if (conf.revisionTypes.includes(\"addition\") && !conf.updateableRec) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed additions but the Recommendation is not marked as a allowing new features.`;\n showError(msg, name);\n }\n }\n\n if (\n conf.specStatus === \"REC\" &&\n conf.updateableRec &&\n conf.revisionTypes &&\n conf.revisionTypes.length > 0 &&\n !conf.revisedRecEnd\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed corrections or additions but no ${\"[revisedRecEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.revisedRecEnd = validateDateAndRecover(conf, \"revisedRecEnd\");\n conf.humanRevisedRecEnd = W3CDate.format(conf.revisedRecEnd);\n\n conf.recNotExpected =\n conf.noRecTrack || conf.recNotExpected\n ? true\n : !conf.isRecTrack && maturity == \"WD\" && conf.specStatus !== \"FPWD-NOTE\";\n if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) {\n const msg = docLink`Document configured as ${\"[noRecTrack]\"}, but its status (\"${\n conf.specStatus\n }\") puts it on the W3C Rec Track.`;\n const notAllowed = codedJoinOr(recTrackStatus, { quotes: true });\n const hint = `Status **can't** be any of: ${notAllowed}.`;\n showError(msg, name, { hint });\n }\n if (conf.isIGNote && !conf.charterDisclosureURI) {\n const msg = docLink`IG-NOTEs must link to charter's disclosure section using ${\"[charterDisclosureURI]\"}.`;\n showError(msg, name);\n }\n if (!sotd.classList.contains(\"override\")) {\n html.bind(sotd)`${populateSoTD(conf, sotd)}`;\n }\n\n if (!conf.implementationReportURI && conf.isCR) {\n const msg = docLink`Missing ${\"[implementationReportURI]\"} configuration option in ${\"[respecConfig]\"}.`;\n const hint = docLink`CR documents must have an ${\"[implementationReportURI]\"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;\n showError(msg, name, { hint });\n }\n if (!conf.implementationReportURI && conf.isPR) {\n const msg = docLink`PR documents should include an ${\"[implementationReportURI]\"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;\n showWarning(msg, name);\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\nfunction validatePatentPolicies(conf) {\n if (!conf.wgPatentPolicy) return;\n const policies = new Set([].concat(conf.wgPatentPolicy));\n if (\n policies.size &&\n ![...policies].every(policy => patentPolicies.includes(policy))\n ) {\n const invalidPolicies = [...policies].filter(\n policy => !patentPolicies.includes(policy)\n );\n const msg = docLink`Invalid ${\"[wgPatentPolicy]\"} value(s): ${codedJoinAnd(\n invalidPolicies\n )}.`;\n const hint = `Please use one of: ${codedJoinOr(patentPolicies)}.`;\n showError(msg, name, { hint });\n }\n if (policies.size !== 1) {\n const msg =\n \"When collaborating across multiple groups, they must use the same patent policy.\";\n const hint = docLink`For ${\"[wgPatentPolicy]\"}, please check the patent policies of each group. The patent policies were: ${[\n ...policies,\n ].join(\", \")}.`;\n showError(msg, name, { hint });\n }\n // We take the first policy\n conf.wgPatentPolicy = [...policies][0];\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 const msg = docLink`ReSpec does not support automated SotD generation for TAG findings.`;\n const hint = `Please add the prerequisite content in the 'sotd' section.`;\n showWarning(msg, name, { hint });\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 {Node} node\n * @return {node is Element}\n */\nfunction isElement(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n\nfunction hasGitHubIssuesLink(conf) {\n return (\n conf.github ||\n (conf.otherLinks &&\n conf.otherLinks.find(linkGroup =>\n linkGroup.data.find(\n l =>\n l.href &&\n l.href.toString().match(/^https:\\/\\/github\\.com\\/.*\\/issues/)\n )\n ))\n );\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\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: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for W3C specs\n */\nexport const name = \"w3c/defaults\";\nimport {\n W3CNotes,\n bgStatus,\n cgStatus,\n cgbgStatus,\n maybeRecTrack,\n recTrackStatus,\n} from \"./headers.js\";\nimport { codedJoinOr, docLink, showError } from \"../core/utils.js\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst w3cLogo = {\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\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": true,\n \"wpt-tests-exist\": false,\n a11y: false,\n },\n doJsonLd: false,\n logos: [],\n xref: true,\n wgId: \"\",\n};\n\nexport function run(conf) {\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\n Object.assign(conf, {\n ...coreDefaults,\n ...w3cDefaults,\n ...conf,\n lint,\n });\n\n if (conf.specStatus !== \"unofficial\" && !conf.hasOwnProperty(\"license\")) {\n conf.license = \"w3c-software-doc\";\n }\n\n processLogos(conf);\n\n if (conf.groupType && conf.specStatus) {\n validateStatusForGroup(conf);\n }\n}\n\nfunction processLogos(conf) {\n const status = conf.specStatus ?? \"\";\n // Always include the W3C logo and license for W3C Recommendation track.\n // Excludes \"ED\" status\n if ([...maybeRecTrack, ...recTrackStatus, ...W3CNotes].includes(status)) {\n conf.logos?.unshift(w3cLogo);\n }\n\n // Special case for \"ED\" status...\n // Allow overriding the logos, otherwise include the w3c logo.\n if (status === \"ED\" && conf.logos?.length === 0) {\n conf.logos.push(w3cLogo);\n }\n}\n\nfunction validateStatusForGroup(conf) {\n const { specStatus, groupType } = conf;\n switch (groupType) {\n case \"cg\": {\n if (![...cgbgStatus, \"unofficial\"].includes(specStatus)) {\n const msg = docLink`W3C Community Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(cgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"CG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"CG-DRAFT\";\n }\n break;\n }\n case \"bg\": {\n if (![...bgStatus, \"unofficial\"].includes(specStatus)) {\n const msg = docLink`W3C Business Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(bgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"BG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"BG-DRAFT\";\n }\n break;\n }\n case \"wg\": {\n if (cgbgStatus.includes(specStatus)) {\n const msg = docLink`W3C Working Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const hint = docLink`Please see ${\"[specStatus]\"} for appropriate values for this type of group.`;\n showError(msg, name, { hint });\n }\n break;\n }\n }\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\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: #c63501;\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 column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\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`;\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 css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\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 {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { 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 /** @type ResourceHintOption[] */\n const opts = [\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 const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\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 msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\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 \"DRAFT-FINDING\":\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 { html } from \"../core/import-maps.js\";\nimport { l10n } from \"../core/l10n.js\";\nexport const name = \"w3c/l10n\";\nconst additions = {\n en: {\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. Other documents may supersede\n this document. A list of current W3C publications and the latest revision\n of this technical report can be found in the\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> at\n https://www.w3.org/TR/.`,\n },\n ko: {\n status_at_publication: html`이 부분은 현재 문서의 발행 당시 상태에 대해\n 기술합니다. 다른 문서가 이 문서를 대체할 수 있습니다. W3C 발행 문서의 최신\n 목록 및 테크니컬 리포트 최신판을 https://www.w3.org/TR/ 의\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> 에서\n 열람할 수 있습니다.`,\n },\n zh: {\n status_at_publication: html`本章节描述了本文档的发布状态。其它更新版本可能会覆盖本文档。W3C的文档列\n 表和最新版本可通过<a href=\"https://www.w3.org/TR/\">W3C技术报告</a\n >索引访问。`,\n },\n ja: {\n status_at_publication: html`この節には、公開時点でのこの文書の位置づけが記されている。他の文書によって置き換えられる可能性がある。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a>\n (https://www.w3.org/TR/)`,\n },\n es: {\n status_at_publication: html`Esta sección describe el estado del presente\n documento al momento de su publicación. El presente documento puede ser\n remplazado por otros. Una lista de las publicaciones actuales del W3C y la\n última revisión del presente informe técnico puede hallarse en\n http://www.w3.org/TR/\n <a href=\"https://www.w3.org/TR/\">el índice de informes técnicos</a> del\n W3C.`,\n },\n de: {\n status_at_publication: html`Dieser Abschnitt beschreibt den Status des\n Dokuments zum Zeitpunkt der Publikation. Neuere Dokumente können dieses\n Dokument obsolet machen. Eine Liste der aktuellen Publikatinen des W3C und\n die aktuellste Fassung dieser Spezifikation kann im\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> unter\n https://www.w3.org/TR/ abgerufen werden.`,\n },\n};\n\nObject.keys(additions).forEach(key => {\n if (!l10n[key]) l10n[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 { docLink, getIntlData, showError, showWarning } from \"../core/utils.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 showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\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 de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\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 = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. 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 =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\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 { markdownToHtml, restructure } from \"./markdown.js\";\nimport { runTransforms, showError } from \"./utils.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(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 removeIncludeAttributes(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}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"无标题\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n\n let documentTitle = norm(h1Elem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","/**\n * This module updates the title and shortName\n * of a spec when there is a valid level configuration.\n *\n * Levels should be integers >= 0.\n */\n\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"w3c/level\";\n\nconst localizationStrings = {\n en: {\n level: \"Level\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.hasOwnProperty(\"level\")) return;\n\n const h1Elem = document.querySelector(\"h1#title\");\n\n const level = parseInt(conf.level);\n if (!Number.isInteger(level) || level < 0) {\n const msg = `The \\`level\\` configuration option must be a number greater or equal to 0. It is currently set to \\`${level}\\``;\n const title = \"Invalid level config.\";\n showError(msg, name, { title, elements: [h1Elem] });\n return;\n }\n\n h1Elem.append(` ${l10n.level} ${level}`);\n document.title = `${document.title} ${l10n.level} ${level}`;\n conf.shortName = `${conf.shortName}-${level}`;\n conf.level = level;\n}\n","// @ts-check\n// Module w3c/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"w3c/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n ko: {\n abstract: \"요약\",\n },\n zh: {\n abstract: \"摘要\",\n },\n ja: {\n abstract: \"要約\",\n },\n nl: {\n abstract: \"Samenvatting\",\n },\n es: {\n abstract: \"Resumen\",\n },\n de: {\n abstract: \"Zusammenfassung\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = 'Document must have one element with `id=\"abstract\"`.';\n showError(msg, name);\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.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 { showError } 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 = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\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 { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\nconst methodRegex = /(\\w+)\\((.*)\\)$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\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 {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\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 {boolean} nullable\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 // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\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, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\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 const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\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, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\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 element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\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 = htmlJoinComma(args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${identifier}</code></a\n ><code>(${argsText})</code>`;\n return element;\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 element = html`\"<a\n data-link-type=\"idl\"\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 >\"`;\n return element;\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 element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"WebIDL\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\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, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"WebIDL\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\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 = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(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 { idb } from \"./import-maps.js\";\n\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 = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n const obj = { id, ...data[id] };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\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\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\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;\n\n/** @type {Promise<Conf['biblio']>} */\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 /** @type {Conf['biblio']} */\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 * @returns {Promise<BiblioData>}\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\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\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\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n const idbRefs = await getReferencesFromIdb(neededRefs);\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, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.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 ko: {\n 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 ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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 endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\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) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > h2\")) {\n refSection.prepend(html`<h2>${l10n.references}</h2>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\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 * @typedef {ReturnType<typeof toRefContent>} 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 showError(msg, name);\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/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\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 }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} ref\n */\nfunction showRef({ ref, refcontent }) {\n const refId = `bib-${ref.toLowerCase()}`;\n if (refcontent) {\n return html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>${{ html: stringifyReference(refcontent) }}</dd>\n `;\n } else {\n return html`\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\n/** @param {BiblioData|string} ref */\nfunction 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 showError(msg, name);\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 getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } 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/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\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 ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\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 }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a data-xref-type=\"${xrefType}\" data-xref-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${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 html`<a data-cite=\"${ref}\"></a>`;\n }\n return html`<a href=\"${ref}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\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\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\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 : html`<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 html`<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 = splitByFor(matched);\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 let type = \"dfn\";\n switch (true) {\n case /task\\s+source$/i.test(matched):\n type = \"task-source\";\n break;\n }\n return html`<a\n data-link-type=\"${type}\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<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 abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : 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 = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\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 continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module w3c/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"w3c/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\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 keywordInterpretation(keywords, plural) {\n return html`<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://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die Schlüsselwörter\" : \"Das Schlüsselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemäß\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter Berücksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groß geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\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 = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h2>${l10n.conformance}</h2>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"attribute\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"attribute\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\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) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\"attribute\", { requiresFor: false, validator: validateDOMName }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"an HTML attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"an HTML attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n\n // A definition that ends with \"task source\" is a \"task-source\"...\n case /\\b task source$/i.test(linkingText):\n type = \"task-source\";\n processAsTaskSource(dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\nfunction processAsTaskSource(dfn) {\n // Task sources are exported by default.\n if (!dfn.matches(\".no-export, [data-noexport]\")) {\n dfn.dataset.export = \"\";\n }\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\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 if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\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 if (dfn.dataset.localLt) {\n dfn.dataset.localLt.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","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\naside.example,\ndiv.example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example,\ndiv.example {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\naside.example div.example span.example-title {\n color: #999;\n}\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\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, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { 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 ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport 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 document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\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`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\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","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.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: 0.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 display: inline-block;\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 {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue Summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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 getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${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 (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\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 const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\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(createIssueSummaryEntry(l10n.issue, report, div.id));\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\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\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) {\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 ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : 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 html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue} ${report.number}`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\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(html`<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\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 if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/** @param {string} bgColorHex background color as a hex value without '#' */\nfunction textColorFromBgColor(bgColorHex) {\n return parseInt(bgColorHex, 16) > 0xffffff / 2 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\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 showError(msg, name);\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 { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </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/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, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\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 = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\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 = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h2>Best Practices Summary</h2>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\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 {\n addId,\n getIntlData,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } 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: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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 html`<h2>${l10n.list_of_figures}</h2>`,\n html`<ul class=\"tof\">\n ${tof}\n </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 const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\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, html`<span class=\"fig-title\"></span>`);\n caption.prepend(l10n.fig, html`<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 html`<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 { showError, 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 {{ type: string, arguments: any[] }} idlAst\n * @param {string} parent\n * @param {string} name\n */\nfunction getAlternativeNames(idlAst, parent, name) {\n const { type } = idlAst;\n const asQualifiedName = `${parent}.${name}`;\n switch (type) {\n case \"constructor\":\n case \"operation\": {\n // Allow linking to \"method()\", method(arg) and \"method\" name.\n const asMethodName = `${name}()`;\n const asFullyQualifiedName = `${asQualifiedName}()`;\n const asMethodWithArgs = generateMethodNamesWithArgs(\n name,\n idlAst.arguments\n );\n return {\n local: [asQualifiedName, asFullyQualifiedName, name],\n exportable: [asMethodName, ...asMethodWithArgs],\n };\n }\n case \"attribute\":\n return {\n local: [asQualifiedName],\n exportable: [name],\n };\n }\n}\n\n/**\n * Generates all possible permutations of a method name based\n * on what arguments they method accepts.\n\n * Required arguments are always present, and optional ones\n * are stacked one by one.\n *\n * For examples: foo(req1, req2), foo(req1, req2, opt1) and so on.\n *\n * @param {String} operationName\n * @param {*} argsAst\n */\nfunction generateMethodNamesWithArgs(operationName, argsAst) {\n const operationNames = [];\n if (argsAst.length === 0) {\n return operationNames;\n }\n const required = []; // required arguments\n const optional = []; // optional arguments, including variadic ones\n for (const { name, optional: isOptional, variadic } of argsAst) {\n if (isOptional || variadic) {\n optional.push(name);\n } else {\n required.push(name);\n }\n }\n const requiredArgs = required.join(\", \");\n const requiredOperation = `${operationName}(${requiredArgs})`;\n operationNames.push(requiredOperation);\n const optionalOps = optional.map((_, index) => {\n const args = [...required, ...optional.slice(0, index + 1)].join(\", \");\n const result = `${operationName}(${args})`;\n return result;\n });\n operationNames.push(...optionalOps);\n return operationNames;\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 {Record<\"local\" | \"exportable\", string[]>} names\n */\nfunction addAlternativeNames(dfn, names) {\n const { local, exportable } = names;\n const lt = dfn.dataset.lt ? new Set(dfn.dataset.lt.split(\"|\")) : new Set();\n for (const item of exportable) {\n lt.add(item);\n }\n // Fix any ill-placed ones - local ones don't belong here\n local.filter(item => lt.has(item)).forEach(item => lt.delete(item));\n dfn.dataset.lt = [...lt].join(\"|\");\n dfn.dataset.localLt = local.join(\"|\");\n registerDefinition(dfn, [...local, ...exportable]);\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {...string} names\n */\nfunction findNormalDfn(defn, parent, ...names) {\n const { type } = defn;\n for (const name of names) {\n let resolvedName =\n type === \"enum-value\" && name === \"\" ? \"the-empty-string\" : name;\n let dfns = getDfns(resolvedName, parent, name, 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 const alternativeDfns = definitionMap.get(resolvedName);\n if (alternativeDfns && alternativeDfns.size === 1) {\n dfns = [...alternativeDfns];\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 const title = \"Duplicate definition.\";\n showError(msg, name, { title, elements: dfns });\n }\n if (dfns.length) {\n return dfns[0];\n }\n }\n}\n\n/**\n * @param {HTMLElement} dfnElem\n * @param {*} idlAst\n * @param {string} parent\n * @param {string} name\n */\nexport function decorateDfn(dfnElem, idlAst, parent, name) {\n if (!dfnElem.id) {\n const lCaseParent = parent.toLowerCase();\n const middle = lCaseParent ? `${lCaseParent}-` : \"\";\n let last = name.toLowerCase().replace(/[()]/g, \"\").replace(/\\s/g, \"-\");\n if (last === \"\") {\n last = \"the-empty-string\";\n dfnElem.setAttribute(\"aria-label\", \"the empty string\");\n }\n dfnElem.id = `dom-${middle}${last}`;\n }\n dfnElem.dataset.idl = idlAst.type;\n dfnElem.dataset.title = dfnElem.textContent;\n dfnElem.dataset.dfnFor = parent;\n // Derive the data-type for dictionary members, interface attributes,\n // and methods\n switch (idlAst.type) {\n case \"operation\":\n case \"attribute\":\n case \"field\":\n dfnElem.dataset.type = getDataType(idlAst);\n break;\n }\n\n // Mark the definition as code.\n if (\n !dfnElem.querySelector(\"code\") &&\n !dfnElem.closest(\"code\") &&\n dfnElem.children\n ) {\n wrapInner(dfnElem, dfnElem.ownerDocument.createElement(\"code\"));\n }\n\n // Add data-lt and data-local-lt values and register them\n switch (idlAst.type) {\n case \"attribute\":\n case \"constructor\":\n case \"operation\":\n addAlternativeNames(dfnElem, getAlternativeNames(idlAst, parent, name));\n break;\n }\n\n return dfnElem;\n}\n\n/**\n * @param {string} name\n * @param {string} parent data-dfn-for\n * @param {string} originalName\n * @param {string} type\n */\nfunction getDfns(name, parent, originalName, type) {\n const foundDfns = definitionMap.get(name);\n if (!foundDfns || foundDfns.size === 0) {\n return [];\n }\n const dfnForArray = [...foundDfns];\n // Definitions that have a name and [data-dfn-for] that exactly match the\n // IDL entity:\n const dfns = dfnForArray.filter(dfn => {\n // This is explicitly marked as a concept, so we can't use it\n if (dfn.dataset.dfnType === \"dfn\") return false;\n\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 (idlType === undefined) return \"\";\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","// @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 */\nexport const name = \"core/webidl-clipboard\";\n\nfunction createButton() {\n const copyButton = document.createElement(\"button\");\n copyButton.innerHTML =\n '<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>';\n copyButton.title = \"Copy IDL to clipboard\";\n copyButton.classList.add(\"respec-button-copy-paste\", \"removeOnSave\");\n return copyButton;\n}\n\nconst copyButton = createButton();\n\n/**\n * Adds a HTML button that copies WebIDL to the clipboard.\n *\n * @param {HTMLSpanElement} idlHeader\n */\nexport function addCopyIDLButton(idlHeader) {\n // There may be multiple <span>s of IDL, so we take everything\n // apart from the idl header.\n const pre = idlHeader.closest(\"pre.idl\");\n const idl = pre.cloneNode(true);\n idl.querySelector(\".idlHeader\").remove();\n const { textContent: idlText } = idl;\n const button = copyButton.cloneNode(true);\n button.addEventListener(\"click\", () => {\n navigator.clipboard.writeText(idlText);\n });\n idlHeader.append(button);\n}\n","/* --- WEB IDL --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\npre.idl {\n padding: 1em;\n position: relative;\n}\n\npre.idl > code {\n color: black;\n}\n\n@media print {\n pre.idl {\n white-space: pre-wrap;\n }\n}\n\n.idlHeader {\n display: block;\n width: 150px;\n background: #8ccbf2;\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.idlHeader a.self-link {\n margin-left: 0.3cm;\n text-decoration: none;\n border-bottom: none;\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/*.idlParam*/\n\n.idlParamName,\n.idlDefaultValue {\n font-style: italic;\n}\n\n.extAttr {\n color: #666;\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`;\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 {\n addHashId,\n docLink,\n showError,\n showWarning,\n wrapInner,\n xmlEscape,\n} from \"./utils.js\";\nimport { decorateDfn, findDfn } from \"./dfn-finder.js\";\nimport { html, webidl2 } from \"./import-maps.js\";\nimport { addCopyIDLButton } from \"./webidl-clipboard.js\";\nimport css from \"../styles/webidl.css.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/webidl\";\nconst pluginName = name;\n\nconst operationNames = {};\nconst idlPartials = {};\n\nconst templates = {\n wrap(items) {\n return items\n .flat()\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 html`<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 ? html`<a data-xref-type=\"interface\" data-cite=\"WebIDL\">${keyword}</a>`\n : // Other keywords like sequence, maplike, etc...\n html`<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 html`<a data-xref-type=\"${type}\" data-cite=\"${cite}\" data-lt=\"${lt}\"\n >${wrapped}</a\n >`;\n },\n name(escaped, { data, parent }) {\n if (data.idlType && data.idlType.type === \"argument-type\") {\n return html`<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 \"operation\":\n case \"constructor\":\n return defineIdlName(escaped, data, parent);\n default:\n return escaped;\n }\n },\n type(contents) {\n return html`<span class=\"idlType\">${contents}</span>`;\n },\n inheritance(contents) {\n return html`<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 html`<span class=\"${className}\">${contents}</span>`;\n }\n const parentName = parent ? parent.name : \"\";\n const { name, idlId } = getNameAndId(data, parentName);\n return html`<span\n class=\"${className}\"\n id=\"${idlId}\"\n data-idl\n data-title=\"${name}\"\n >${contents}</span\n >`;\n },\n extendedAttribute(contents) {\n const result = html`<span class=\"extAttr\">${contents}</span>`;\n return result;\n },\n extendedAttributeReference(name) {\n return html`<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 if (!dfn.matches(\"[data-noexport]\")) dfn.dataset.export = \"\";\n dfn.dataset.dfnType = linkType;\n }\n decorateDfn(dfn, data, parentName, name);\n const href = `#${dfn.id}`;\n return html`<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\n const isDefaultJSON =\n data.type === \"operation\" &&\n data.name === \"toJSON\" &&\n data.extAttrs.some(({ name }) => name === \"Default\");\n if (isDefaultJSON) {\n return html`<a data-link-type=\"dfn\" data-lt=\"default toJSON steps\"\n >${escaped}</a\n >`;\n }\n if (!data.partial) {\n const dfn = html`<dfn data-export data-dfn-type=\"${linkType}\"\n >${escaped}</dfn\n >`;\n registerDefinition(dfn, [name]);\n decorateDfn(dfn, data, parentName, name);\n return dfn;\n }\n\n const unlinkedAnchor = html`<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\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}.`;\n const hint = docLink`See ${\"using `data-dfn-for`|#data-dfn-for\"} in ReSpec's documentation.`;\n showWarning(msg, pluginName, { elements: [unlinkedAnchor], hint });\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 // For getters, setters, etc. \"anonymous-getter\",\n const prefix = defn.special && defn.name === \"\" ? \"anonymous-\" : \"\";\n let idlId = getIdlId(prefix + 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 || defn.special;\n default:\n return defn.name || defn.type;\n }\n}\n\n/**\n * @param {Element} idlElement\n * @param {number} index\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 const msg = `Failed to parse WebIDL: ${e.bareMessage}.`;\n showError(msg, pluginName, {\n title: e.bareMessage,\n details: `<pre>${e.context}</pre>`,\n elements: [idlElement],\n });\n // Skip this <pre> and move on to the next one.\n return [];\n }\n // we add \"idl\" as the canonical match, so both \"webidl\" and \"idl\" work\n idlElement.classList.add(\"def\", \"idl\");\n const highlights = webidl2.write(parse, { templates });\n html.bind(idlElement)`${highlights}`;\n wrapInner(idlElement, document.createElement(\"code\"));\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 if (elem.localName === \"dfn\") {\n registerDefinition(elem, [title]);\n }\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 addIDLHeader(idlElement);\n return parse;\n}\n/**\n * Adds a \"WebIDL\" decorative header/permalink to a block of WebIDL.\n * @param {HTMLPreElement} pre\n */\nexport function addIDLHeader(pre) {\n addHashId(pre, \"webidl\");\n const header = html`<span class=\"idlHeader\"\n ><a class=\"self-link\" href=\"${`#${pre.id}`}\">WebIDL</a></span\n >`;\n pre.prepend(header);\n addCopyIDLButton(header);\n}\n\nexport async function run() {\n const idls = document.querySelectorAll(\"pre.idl, pre.webidl\");\n if (!idls.length) {\n return;\n }\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.querySelector(\"head link, head > *:last-child\").before(style);\n\n const astArray = [...idls].map(renderWebIDL);\n\n const validations = webidl2.validate(astArray);\n for (const validation of validations) {\n let details = `<pre>${xmlEscape(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 const msg = `WebIDL validation error: ${validation.bareMessage}`;\n showError(msg, pluginName, {\n details,\n elements: [idls[validation.sourceName]],\n title: validation.bareMessage,\n });\n }\n document.normalize();\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\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 }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\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 (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\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\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\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: THIS_SPEC, 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, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\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 ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnFor = \"\", dfnType = \"dfn\" } = dfn.dataset;\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\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 = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor = dfnFor === (oldDfn.dataset.dfnFor || \"\");\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n const type = \"idl\" in dfn.dataset || dfnType !== \"dfn\" ? \"idl\" : \"dfn\";\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(type, dfn);\n addId(dfn, \"dfn\", title);\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n const type = linkType === \"dfn\" ? \"dfn\" : \"idl\";\n return dfnsByType.get(type) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (linkFor && !titleToDfns.get(linkFor) && linkFor !== dfnFor) {\n noLocalMatch = true;\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 noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\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 !noLocalMatch;\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 || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\nimport { API_URL } from \"./xref.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 * @typedef {import('core/xref').XrefDatabase} XrefDatabase\n */\n\nconst STORE_NAME = \"xrefs\";\nconst VERSION_CHECK_WAIT = 5 * 60 * 1000; // 5 min\n\nasync function getIdbCache() {\n /** @type {XrefDatabase} */\n const db = await idb.openDB(\"xref\", 2, {\n upgrade(db) {\n [...db.objectStoreNames].forEach(s => db.deleteObjectStore(s));\n const store = db.createObjectStore(STORE_NAME, { keyPath: \"query.id\" });\n store.createIndex(\"byTerm\", \"query.term\", { unique: false });\n },\n });\n return db;\n}\n\n/** @param {RequestEntry[]} queries */\nexport async function resolveXrefCache(queries) {\n /** @type {Map<string, SearchResultEntry[]>} */\n const cachedData = new Map();\n\n const bustCache = await shouldBustCache();\n if (bustCache) {\n await clearXrefData();\n return cachedData;\n }\n\n const requiredKeySet = new Set(queries.map(query => query.id));\n try {\n const cache = await getIdbCache();\n let cursor = await cache.transaction(STORE_NAME).store.openCursor();\n while (cursor) {\n if (requiredKeySet.has(cursor.key)) {\n cachedData.set(cursor.key, cursor.value.result);\n }\n cursor = await cursor.continue();\n }\n } catch (err) {\n console.error(err);\n }\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 */\nasync function shouldBustCache() {\n const key = \"XREF:LAST_VERSION_CHECK\";\n const lastChecked = parseInt(localStorage.getItem(key), 10);\n const now = Date.now();\n\n if (!lastChecked) {\n localStorage.setItem(key, now.toString());\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 localStorage.setItem(key, now.toString());\n return parseInt(lastUpdated, 10) > lastChecked;\n}\n\n/**\n * @param {RequestEntry[]} queries\n * @param {Map<string, SearchResultEntry[]>} results\n */\nexport async function cacheXrefData(queries, results) {\n try {\n const cache = await getIdbCache();\n const tx = cache.transaction(STORE_NAME, \"readwrite\");\n for (const query of queries) {\n const result = results.get(query.id);\n tx.objectStore(STORE_NAME).add({ query, result });\n }\n await tx.done;\n } catch (e) {\n console.error(e);\n }\n}\n\nexport async function clearXrefData() {\n try {\n await getIdbCache().then(db => db.clear(STORE_NAME));\n } catch (e) {\n console.error(e);\n }\n}\n","// @ts-check\n/**\n * @module core/xref\n *\n * Automatically adds external references.\n *\n * Searches for the terms which do not have a local definition at xref API and\n * for each query, adds `data-cite` attributes to respective elements.\n * `core/data-cite` later converts these data-cite attributes to actual links.\n * https://github.com/w3c/respec/issues/1662\n */\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 docLink,\n joinAnd,\n joinOr,\n nonNormativeSelector,\n norm as normalize,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { possibleExternalLinks } from \"./link-to-dfn.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/xref\";\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 * @param {Object} conf respecConfig\n */\nexport async function run(conf) {\n if (!conf.xref) {\n return;\n }\n\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 const elems = possibleExternalLinks.concat(findExplicitExternalLinks());\n if (!elems.length) return;\n\n /** @type {RequestEntry[]} */\n const queryKeys = [];\n for (const elem of elems) {\n const entry = getRequestEntry(elem);\n entry.id = await objectHash(entry);\n queryKeys.push(entry);\n }\n\n const data = await getData(queryKeys, xref.url);\n addDataCiteToTerms(elems, queryKeys, data, conf);\n\n sub(\"beforesave\", cleanup);\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 \":is(a,dfn)[data-cite]:not([data-cite=''],[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\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 const msg = `Invalid value for \\`xref\\` configuration option. Received: \"${xref}\".`;\n showError(msg, name);\n }\n }\n return config;\n\n function invalidProfileError(profile) {\n const supportedProfiles = joinOr(Object.keys(profiles), s => `\"${s}\"`);\n const msg =\n `Invalid profile \"${profile}\" in \\`respecConfig.xref\\`. ` +\n `Please use one of the supported profiles: ${supportedProfiles}.`;\n showError(msg, name);\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 const specs = getSpecContext(elem);\n const types = getTypeContext(elem, isIDL);\n const forContext = getForContext(elem, isIDL);\n\n return {\n // Add an empty `id` to ensure the shape of object returned stays same when\n // actual `id` is added later (minor perf optimization, also makes\n // TypeScript happy).\n id: \"\",\n term,\n types,\n ...(specs.length && { specs }),\n ...(typeof forContext === \"string\" && { for: forContext }),\n };\n}\n\n/** @param {HTMLElement} elem */\nexport function 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 * Get spec context as a fallback chain, where each level (sub-array) represents\n * decreasing priority.\n * @param {HTMLElement} elem\n */\nfunction getSpecContext(elem) {\n /** @type {string[][]} */\n const specs = [];\n\n /** @type {HTMLElement} */\n let dataciteElem = elem.closest(\"[data-cite]\");\n\n // Traverse up towards the root element, adding levels of lower priority specs\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);\n }\n if (dataciteElem === elem) break;\n dataciteElem = dataciteElem.parentElement.closest(\"[data-cite]\");\n }\n\n // If element itself contains data-cite, we don't take inline context into\n // account. The inline bibref context has lowest priority, if available.\n if (dataciteElem !== 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 if (inlineRefs.length) {\n specs.push(inlineRefs);\n }\n }\n\n const uniqueSpecContext = dedupeSpecContext(specs);\n return uniqueSpecContext;\n}\n\n/**\n * If we already have a spec in a higher priority level (closer to element) of\n * fallback chain, skip it from low priority levels, to prevent duplication.\n * @param {string[][]} specs\n * */\nfunction dedupeSpecContext(specs) {\n /** @type {string[][]} */\n const unique = [];\n for (const level of specs) {\n const higherPriority = unique[unique.length - 1] || [];\n const uniqueSpecs = [...new Set(level)].filter(\n spec => !higherPriority.includes(spec)\n );\n unique.push(uniqueSpecs.sort());\n }\n return unique;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getForContext(elem, isIDL) {\n if (elem.dataset.xrefFor) {\n return normalize(elem.dataset.xrefFor);\n }\n\n if (isIDL) {\n /** @type {HTMLElement} */\n const dataXrefForElem = elem.closest(\"[data-xref-for]\");\n if (dataXrefForElem) {\n return normalize(dataXrefForElem.dataset.xrefFor);\n }\n }\n\n return null;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getTypeContext(elem, isIDL) {\n if (isIDL) {\n if (elem.dataset.xrefType) {\n return elem.dataset.xrefType.split(\"|\");\n }\n return [\"_IDL_\"];\n }\n\n return [\"_CONCEPT_\"];\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(uniqueQueryKeys, 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, specs = [] } = query;\n const { uri, shortname, spec, normative, type, for: forContext } = result;\n // if authored spec context had `result.spec`, use it instead of shortname\n const cite = specs.flat().includes(spec) ? spec : shortname;\n // we use this \"partial\" URL to resolve parts of urls...\n // but sometimes we get lucky and we get an absolute URL from xref\n // which we can then use in other places (e.g., data-cite.js)\n const url = new URL(uri, \"https://partial\");\n const { pathname: citePath } = url;\n const citeFrag = url.hash.slice(1);\n const dataset = { cite, citePath, citeFrag, type };\n if (forContext) dataset.linkFor = forContext[0];\n if (url.origin && url.origin !== \"https://partial\") {\n dataset.citeHref = url.href;\n }\n Object.assign(elem.dataset, dataset);\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 = `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n const title = \"Normative reference to non-normative term.\";\n showWarning(msg, name, { title, elements: [elem] });\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(\"specs\", specs.join(\",\"));\n return url.href;\n };\n\n const howToFix = (howToCiteURL, originalTerm) => {\n return docLink`\n [See search matches for \"${originalTerm}\"](${howToCiteURL}) or\n ${\"[Learn about this error|#error-term-not-found]\"}.`;\n };\n\n for (const { query, elems } of notFound.values()) {\n const specs = query.specs ? [...new Set(query.specs.flat())].sort() : [];\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query);\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const hint = howToFix(formUrl, originalTerm);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const msg = `Couldn't find \"**${originalTerm}**\"${forParent} in this document or other cited documents: ${specsString}.`;\n const title = \"No matching definition found.\";\n showError(msg, name, { title, elements: elems, hint });\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 = joinAnd(specs, s => `**[${s}]**`);\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const moreInfo = howToFix(formUrl, originalTerm);\n const hint = docLink`To fix, use the ${\"[data-cite]\"} attribute to pick the one you mean from the appropriate specification. ${moreInfo}.`;\n const msg = `The term \"**${originalTerm}**\"${forParent} is ambiguous because it's defined in ${specsString}.`;\n const title = \"Definition is ambiguous.\";\n showError(msg, name, { title, elements: elems, hint });\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\nfunction cleanup(doc) {\n const elems = doc.querySelectorAll(\n \"a[data-xref-for], a[data-xref-type], a[data-link-for]\"\n );\n const attrToRemove = [\"data-xref-for\", \"data-xref-type\", \"data-link-for\"];\n elems.forEach(el => {\n attrToRemove.forEach(attr => el.removeAttribute(attr));\n });\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, wrapInner } from \"./utils.js\";\nimport { addIDLHeader } from \"./webidl.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.idl:not(.exclude) > code\")\n ).filter(idl => !idl.closest(nonNormativeSelector));\n\n if (idlIndex.length === 0) {\n const text = \"This specification doesn't normatively 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\n // Add our own IDL header\n idlIndexSec.appendChild(pre);\n wrapInner(pre, document.createElement(\"code\"));\n addIDLHeader(pre);\n}\n","/*\n@module \"core/dfn-index\"\nExtends and overrides some styles from `base.css`.\n*/\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nul.index {\n columns: 30ch;\n column-gap: 1.5em;\n}\n\nul.index li {\n list-style: inherit;\n}\n\nul.index li span {\n color: inherit;\n cursor: pointer;\n white-space: normal;\n}\n\n#index-defined-here ul.index li {\n font-size: 0.9rem;\n}\n\nul.index code {\n color: inherit;\n}\n\n#index-defined-here .print-only {\n display: none;\n}\n\n@media print {\n #index-defined-here .print-only {\n display: initial;\n }\n}\n`;\n","// @ts-check\n/**\n * If a `<section id=\"index\">` exists, it is filled by a list of terms defined\n * (locally) by current document and a list of terms referenced (external) by\n * current document.\n */\n\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport css from \"../styles/dfn-index.css.js\";\nimport { getTermFromElement } from \"./xref.js\";\nimport { html } from \"./import-maps.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\nimport { sub } from \"./pubsubhub.js\";\nimport { toCiteDetails } from \"./data-cite.js\";\n\nexport const name = \"core/dfn-index\";\n\nconst localizationStrings = {\n en: {\n heading: \"Index\",\n headingExternal: \"Terms defined by reference\",\n headlingLocal: \"Terms defined by this specification\",\n dfnOf: \"definition of\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Terms of these _types_ are wrapped in `<code>`.\nconst CODE_TYPES = new Set([\n \"attribute\",\n \"callback\",\n \"dict-member\",\n \"dictionary\",\n \"element-attr\",\n \"element\",\n \"enum-value\",\n \"enum\",\n \"exception\",\n \"extended-attribute\",\n \"interface\",\n \"method\",\n \"typedef\",\n]);\n\n/**\n * @typedef {{ term: string, type: string, linkFor: string, elem: HTMLAnchorElement }} Entry\n */\n\nexport function run() {\n const index = document.querySelector(\"section#index\");\n if (!index) {\n return;\n }\n\n const styleEl = document.createElement(\"style\");\n styleEl.textContent = css;\n document.head.appendChild(styleEl);\n\n index.classList.add(\"appendix\");\n if (!index.querySelector(\"h2\")) {\n index.prepend(html`<h2>${l10n.heading}</h2>`);\n }\n\n const localTermIndex = html`<section id=\"index-defined-here\">\n <h3>${l10n.headlingLocal}</h3>\n ${createLocalTermIndex()}\n </section>`;\n index.append(localTermIndex);\n\n const externalTermIndex = html`<section id=\"index-defined-elsewhere\">\n <h3>${l10n.headingExternal}</h3>\n ${createExternalTermIndex()}\n </section>`;\n index.append(externalTermIndex);\n for (const el of externalTermIndex.querySelectorAll(\".index-term\")) {\n addId(el, \"index-term\");\n }\n\n // XXX: This event is used to overcome an edge case with core/structure,\n // related to a circular dependency in plugin run order. We want\n // core/structure to run after dfn-index so the #index can be listed in the\n // TOC, but we also want section numbers in dfn-index. So, we \"split\"\n // core/dfn-index in two parts, one that runs before core/structure (using\n // plugin order in profile) and the other (following) after section numbers\n // are generated in core/structure (this event).\n sub(\"toc\", appendSectionNumbers, { once: true });\n\n sub(\"beforesave\", cleanup);\n}\n\nfunction createLocalTermIndex() {\n const dataSortedByTerm = collectLocalTerms();\n return html`<ul class=\"index\">\n ${dataSortedByTerm.map(([term, dfns]) => renderLocalTerm(term, dfns))}\n </ul>`;\n}\n\nfunction collectLocalTerms() {\n /** @type {Map<string, HTMLElement[]>} */\n const data = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"dfn:not([data-cite])\");\n for (const elem of elems) {\n if (!elem.id) continue;\n const text = norm(elem.textContent);\n const elemsByTerm = data.get(text) || data.set(text, []).get(text);\n elemsByTerm.push(elem);\n }\n\n const dataSortedByTerm = [...data].sort(([a], [b]) =>\n a.slice(a.search(/\\w/)).localeCompare(b.slice(b.search(/\\w/)))\n );\n\n return dataSortedByTerm;\n}\n\n/**\n * @param {string} term\n * @param {HTMLElement[]} dfns\n * @returns {HTMLLIElement}\n */\nfunction renderLocalTerm(term, dfns) {\n const renderItem = (dfn, text, suffix) => {\n const href = `#${dfn.id}`;\n return html`<li data-id=${dfn.id}>\n <a class=\"index-term\" href=\"${href}\">${{ html: text }}</a> ${suffix\n ? { html: suffix }\n : \"\"}\n </li>`;\n };\n\n if (dfns.length === 1) {\n const dfn = dfns[0];\n const type = getLocalTermType(dfn);\n const text = getLocalTermText(dfn, type, term);\n const suffix = getLocalTermSuffix(dfn, type, term);\n return renderItem(dfn, text, suffix);\n }\n return html`<li>\n ${term}\n <ul>\n ${dfns.map(dfn => {\n const type = getLocalTermType(dfn);\n const text = getLocalTermSuffix(dfn, type, term) || l10n.dfnOf;\n return renderItem(dfn, text);\n })}\n </ul>\n </li>`;\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermType(dfn) {\n const ds = dfn.dataset;\n const type = ds.dfnType || ds.idl || ds.linkType || \"\";\n switch (type) {\n case \"\":\n case \"dfn\":\n return \"\";\n default:\n return type;\n }\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermParentContext(dfn) {\n /** @type {HTMLElement} */\n const dfnFor = dfn.closest(\"[data-dfn-for]:not([data-dfn-for=''])\");\n return dfnFor ? dfnFor.dataset.dfnFor : \"\";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} term\n */\nfunction getLocalTermText(dfn, type, term) {\n let text = term;\n if (type === \"enum-value\") {\n text = `\"${text}\"`;\n }\n if (CODE_TYPES.has(type) || dfn.dataset.idl || dfn.closest(\"code\")) {\n text = `<code>${text}</code>`;\n }\n return text;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} [term=\"\"]\n */\nfunction getLocalTermSuffix(dfn, type, term = \"\") {\n if (term.startsWith(\"[[\")) {\n const parent = getLocalTermParentContext(dfn);\n return `internal slot for <code>${parent}</code>`;\n }\n\n switch (type) {\n case \"dict-member\":\n case \"method\":\n case \"attribute\":\n case \"enum-value\": {\n const typeText =\n type === \"dict-member\" ? \"member\" : type.replace(\"-\", \" \");\n const parent = getLocalTermParentContext(dfn);\n return `${typeText} for <code>${parent}</code>`;\n }\n case \"interface\":\n case \"dictionary\":\n case \"enum\": {\n return type;\n }\n case \"constructor\": {\n const parent = getLocalTermParentContext(dfn);\n return `for <code>${parent}</code>`;\n }\n default:\n return \"\";\n }\n}\n\nfunction appendSectionNumbers() {\n const getSectionNumber = id => {\n const dfn = document.getElementById(id);\n const sectionNumberEl = dfn.closest(\"section\").querySelector(\".secno\");\n const secNum = `§${sectionNumberEl.textContent.trim()}`;\n return html`<span class=\"print-only\">${secNum}</span>`;\n };\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"#index-defined-here li[data-id]\");\n elems.forEach(el => el.append(getSectionNumber(el.dataset.id)));\n}\n\nfunction createExternalTermIndex() {\n const data = collectExternalTerms();\n const dataSortedBySpec = [...data.entries()].sort(([specA], [specB]) =>\n specA.localeCompare(specB)\n );\n return html`<ul class=\"index\">\n ${dataSortedBySpec.map(\n ([spec, entries]) => html`<li data-spec=\"${spec}\">\n ${renderInlineCitation(spec)} defines the following:\n <ul>\n ${entries\n .sort((a, b) => a.term.localeCompare(b.term))\n .map(renderExternalTermEntry)}\n </ul>\n </li>`\n )}\n </ul>`;\n}\n\nfunction collectExternalTerms() {\n /** @type {Set<string>} */\n const uniqueReferences = new Set();\n /** @type {Map<string, Entry[]>} spec => entry[] */\n const data = new Map();\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elements = document.querySelectorAll(`a[data-cite]`);\n for (const elem of elements) {\n if (!elem.dataset.cite) {\n continue;\n }\n const uniqueID = elem.href;\n if (uniqueReferences.has(uniqueID)) {\n continue;\n }\n\n const { type, linkFor } = elem.dataset;\n const term = getTermFromElement(elem);\n if (!term) {\n continue; // <a data-cite=\"SPEC\"></a>\n }\n const spec = toCiteDetails(elem).key.toUpperCase();\n\n const entriesBySpec = data.get(spec) || data.set(spec, []).get(spec);\n entriesBySpec.push({ term, type, linkFor, elem });\n uniqueReferences.add(uniqueID);\n }\n\n return data;\n}\n\n/**\n * @param {Entry} entry\n * @returns {HTMLLIElement}\n */\nfunction renderExternalTermEntry(entry) {\n const { elem } = entry;\n const text = getTermText(entry);\n const el = html`<li>\n <span class=\"index-term\" data-href=\"${elem.href}\">${{ html: text }}</span>\n </li>`;\n return el;\n}\n\n// Terms of these _types_ are suffixed with their type info.\nconst TYPED_TYPES = new Map([\n [\"attribute\", \"attribute\"],\n [\"element-attr\", \"attribute\"],\n [\"element\", \"element\"],\n [\"enum\", \"enum\"],\n [\"exception\", \"exception\"],\n [\"extended-attribute\", \"extended attribute\"],\n [\"interface\", \"interface\"],\n]);\n\n// These _terms_ have type suffix \"type\".\nconst TYPE_TERMS = new Set([\n // Following are primitive types as per WebIDL spec:\n \"boolean\",\n \"byte\",\n \"octet\",\n \"short\",\n \"unsigned short\",\n \"long\",\n \"unsigned long\",\n \"long long\",\n \"unsigned long long\",\n \"float\",\n \"unrestricted float\",\n \"double\",\n \"unrestricted double\",\n // Following are not primitive types, but aren't interfaces either.\n \"undefined\",\n \"any\",\n \"object\",\n \"symbol\",\n]);\n\n/** @param {Entry} entry */\nfunction getTermText(entry) {\n const { term, type, linkFor } = entry;\n let text = term;\n\n if (CODE_TYPES.has(type)) {\n if (type === \"extended-attribute\") {\n text = `[${text}]`;\n }\n text = `<code>${text}</code>`;\n }\n\n const typeSuffix = TYPE_TERMS.has(term) ? \"type\" : TYPED_TYPES.get(type);\n if (typeSuffix) {\n text += ` ${typeSuffix}`;\n }\n\n if (linkFor) {\n let linkForText = linkFor;\n if (!/\\s/.test(linkFor)) {\n // If linkFor is a single word, highlight it.\n linkForText = `<code>${linkForText}</code>`;\n }\n if (type === \"element-attr\") {\n linkForText += \" element\";\n }\n text += ` (for ${linkForText})`;\n }\n\n return text;\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n doc\n .querySelectorAll(\"#index-defined-elsewhere li[data-spec]\")\n .forEach(el => el.removeAttribute(\"data-spec\"));\n\n doc\n .querySelectorAll(\"#index-defined-here li[data-id]\")\n .forEach(el => el.removeAttribute(\"data-id\"));\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 { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.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 = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\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 const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\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 html(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// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n docLink,\n getIntlData,\n parents,\n renameElement,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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 = html`<ol class=\"toc\"></ol>`;\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 ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\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(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, 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 * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\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) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\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: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<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 && conf.tocIntroductory === false) {\n const msg = \"Configuration option `tocIntroductory` is deprecated.\";\n const hint = docLink`Use the ${\"[`notoc`|#notoc-class]\"} CSS class to remove a section from the Table of Contents.`;\n showWarning(msg, name, { hint });\n }\n\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\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 return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<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 = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } 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 ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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(html`<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 { html } 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 // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n h.appendChild(html`\n <a href=\"${`#${id}`}\" class=\"self-link\" aria-label=\"§\"></a>\n `);\n }\n}\n","/* container for stats */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.caniuse-stats {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: baseline;\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[href] {\n white-space: nowrap;\n align-self: center;\n margin-left: 0.5em;\n}\n\n/* a browser version */\n.caniuse-cell {\n display: flex;\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 --supported: #2a8436;\n --no-support: #c44230;\n --no-support-alt: #b43b2b;\n --partial: #807301;\n --partial-alt: #746c00;\n\n color: #fff;\n background: repeating-linear-gradient(\n var(--caniuse-angle, 45deg),\n var(--caniuse-bg) 0,\n var(--caniuse-bg-alt) 1px,\n var(--caniuse-bg-alt) 0.4em,\n var(--caniuse-bg) calc(0.25em + 1px),\n var(--caniuse-bg) 0.75em\n );\n}\n\nli.caniuse-cell {\n margin-bottom: 1px;\n}\n\n.caniuse-cell:focus {\n outline: none;\n}\n\n/* supports */\n.caniuse-cell.y {\n background: var(--supported);\n}\n\n/* no support, disabled by default */\n.caniuse-cell.n,\n.caniuse-cell.d {\n --caniuse-angle: 45deg;\n --caniuse-bg: var(--no-support);\n --caniuse-bg-alt: var(--no-support-alt);\n}\n\n.caniuse-cell.d {\n --caniuse-angle: 180deg;\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.a,\n.caniuse-cell.x,\n.caniuse-cell.p {\n --caniuse-angle: 90deg;\n --caniuse-bg: var(--partial);\n --caniuse-bg-alt: var(--partial-alt);\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`;\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 { codedJoinAnd, docLink, showError, showWarning } from \"./utils.js\";\nimport { pub, sub } from \"./pubsubhub.js\";\nimport css from \"../styles/caniuse.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/caniuse\";\n\nconst API_URL = \"https://respec.org/caniuse/\";\n\nconst BROWSERS = new Set([\n \"and_chr\",\n \"and_ff\",\n \"and_uc\",\n \"android\",\n \"bb\",\n \"chrome\",\n \"edge\",\n \"firefox\",\n \"ie\",\n \"ios_saf\",\n \"op_mini\",\n \"op_mob\",\n \"opera\",\n \"safari\",\n \"samsung\",\n]);\n\nexport function prepare(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\n document.head.appendChild(html`<style class=\"removeOnSave\">\n ${css}\n </style>`);\n\n const apiUrl = options.apiURL || API_URL;\n // Initiate a fetch, but do not wait. Try to fill the cache early instead.\n conf.state[name] = {\n fetchPromise: fetchStats(apiUrl, options),\n };\n}\n\nexport async function run(conf) {\n const options = conf.caniuse;\n if (!options?.feature) return;\n\n const featureURL = new URL(options.feature, \"https://caniuse.com/\").href;\n\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = (async () => {\n try {\n const stats = await conf.state[name].fetchPromise;\n return html`${{ html: stats }}`;\n } catch (err) {\n const msg = `Couldn't find feature \"${options.feature}\" on caniuse.com.`;\n const hint = docLink`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${\"[caniuse]\"}`;\n showError(msg, name, { hint });\n console.error(err);\n return html`<a href=\"${featureURL}\">caniuse.com</a>`;\n }\n })();\n const definitionPair = html`<dt class=\"caniuse-title\">Browser support:</dt>\n <dd class=\"caniuse-stats\">\n ${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}\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 html.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 = codedJoinAnd(invalidBrowsers, { quotes: true });\n const msg = docLink`Invalid browser(s): (${names}) in the \\`browser\\` property of ${\"[caniuse]\"}.`;\n showWarning(msg, name);\n }\n }\n return caniuseConf;\n}\n\n/**\n * @param {string} apiURL\n * @typedef {Record<string, [string, string[]][]>} 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 searchParams.set(\"format\", \"html\");\n const url = `${apiURL}?${searchParams.toString()}`;\n const response = await fetch(url);\n if (!response.ok) {\n const { status, statusText } = response;\n throw new Error(`Failed to get caniuse data: (${status}) ${statusText}`);\n }\n const stats = await response.text();\n return stats;\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.mdn {\n font-size: 0.75em;\n position: absolute;\n right: 0.3em;\n min-width: 0;\n margin-top: 3em;\n}\n\n.mdn details {\n width: 100%;\n margin: 1px 0;\n position: relative;\n z-index: 10;\n box-sizing: border-box;\n padding: 0.4em;\n padding-top: 0;\n}\n\n.mdn details[open] {\n min-width: 25ch;\n max-width: 32ch;\n background: #fff;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n z-index: 11;\n margin-bottom: 0.4em;\n}\n\n.mdn summary {\n text-align: right;\n cursor: default;\n margin-right: -0.4em;\n}\n\n.mdn summary span {\n font-family: zillaslab, Palatino, \"Palatino Linotype\", serif;\n color: #fff;\n background-color: #000;\n display: inline-block;\n padding: 3px;\n}\n\n.mdn a {\n display: inline-block;\n word-break: break-all;\n}\n\n.mdn p {\n margin: 0;\n}\n\n.mdn .engines-all {\n color: #058b00;\n}\n.mdn .engines-some {\n color: #b00;\n}\n\n.mdn table {\n width: 100%;\n font-size: 0.9em;\n}\n\n.mdn td {\n border: none;\n}\n\n.mdn td:nth-child(2) {\n text-align: right;\n}\n\n.mdn .nosupportdata {\n font-style: italic;\n margin: 0;\n}\n\n.mdn tr::before {\n content: \"\";\n display: table-cell;\n width: 1.5em;\n height: 1.5em;\n background: no-repeat center center / contain;\n font-size: 0.75em;\n}\n\n.mdn .no,\n.mdn .unknown {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdn .no::before,\n.mdn .unknown::before {\n opacity: 0.5;\n}\n\n.mdn .chrome::before,\n.mdn .chrome_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://resources.whatwg.org/browser-logos/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/firefox.png);\n}\n\n.mdn .ie::before {\n background-image: url(https://resources.whatwg.org/browser-logos/ie.png);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari.png);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/android-webview.png);\n}\n`;\n","// @ts-check\nimport { fetchAndCache, getIntlData, showError } from \"./utils.js\";\nimport css from \"../styles/mdn-annotation.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/mdn-annotation\";\n\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:\n // https://github.com/mdn/browser-compat-data/blob/master/schemas/compat-data-schema.md#browser-identifiers.\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 localizationStrings = {\n en: {\n inAllEngines: \"This feature is in all major engines.\",\n inSomeEngines: \"This feature has limited support.\",\n },\n zh: {\n inAllEngines: \"所有主要引擎均支持此特性。\",\n inSomeEngines: \"此功能支持有限。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {HTMLElement} node\n */\nfunction insertMDNBox(node) {\n const targetAncestor = node.closest(\"section\");\n if (!targetAncestor) return;\n const { previousElementSibling: targetSibling } = 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 = html`<aside class=\"mdn\"></aside>`;\n targetAncestor.before(mdnBox);\n return mdnBox;\n}\n\n/**\n * @param {MdnEntry} mdnSpec\n * @returns {HTMLDetailsElement}\n */\nfunction attachMDNDetail(mdnSpec) {\n const { name, slug, summary, support, engines } = mdnSpec;\n const mdnSubPath = slug.slice(slug.indexOf(\"/\") + 1);\n const href = `${MDN_URL_BASE}${slug}`;\n const label = `Expand MDN details for ${name}`;\n const engineSupport = getEngineSupportIcons(engines);\n return html`<details>\n <summary aria-label=\"${label}\"><span>MDN</span>${engineSupport}</summary>\n <a title=\"${summary}\" href=\"${href}\">${mdnSubPath}</a>\n ${getEngineSupport(engines)}\n ${support\n ? buildBrowserSupportTable(support)\n : html`<p class=\"nosupportdata\">No support data.</p>`}\n </details>`;\n}\n\n/**\n * @param {MdnEntry['support']} support\n * @returns {HTMLTableElement}\n */\nfunction buildBrowserSupportTable(support) {\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {\"Yes\" | \"No\" | \"Unknown\"} yesNoUnknown\n * @param {string} version\n * @returns {HTMLTableRowElement}\n */\n function createRow(browserId, yesNoUnknown, version) {\n const displayStatus = yesNoUnknown === \"Unknown\" ? \"?\" : yesNoUnknown;\n const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`;\n return html`<tr class=\"${classList}\">\n <td>${MDN_BROWSERS[browserId]}</td>\n <td>${version ? version : displayStatus}</td>\n </tr>`;\n }\n\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {VersionDetails} versionData\n */\n function createRowFromBrowserData(browserId, versionData) {\n if (versionData.version_removed) {\n return createRow(browserId, \"No\", \"\");\n }\n const versionAdded = versionData.version_added;\n if (typeof versionAdded === \"boolean\") {\n return createRow(browserId, versionAdded ? \"Yes\" : \"No\", \"\");\n } else if (!versionAdded) {\n return createRow(browserId, \"Unknown\", \"\");\n } else {\n return createRow(browserId, \"Yes\", `${versionAdded}+`);\n }\n }\n\n return html`<table>\n ${Object.keys(MDN_BROWSERS).map(browserId => {\n return support[browserId]\n ? createRowFromBrowserData(browserId, support[browserId])\n : createRow(browserId, \"Unknown\", \"\");\n })}\n </table>`;\n}\n\nexport async function run(conf) {\n const mdnKey = getMdnKey(conf);\n if (!mdnKey) return;\n\n const mdnSpecJson = await getMdnData(mdnKey, conf.mdn);\n if (!mdnSpecJson) return;\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.append(style);\n\n for (const elem of findElements(mdnSpecJson)) {\n const mdnSpecArray = mdnSpecJson[elem.id];\n const mdnBox = insertMDNBox(elem);\n if (!mdnBox) continue;\n for (const spec of mdnSpecArray) {\n mdnBox.append(attachMDNDetail(spec));\n }\n }\n}\n\n/** @returns {string} */\nfunction getMdnKey(conf) {\n const { shortName, mdn } = conf;\n if (!mdn) return;\n if (typeof mdn === \"string\") return mdn;\n return mdn.key || shortName;\n}\n\n/**\n * @param {string} key MDN key\n * @param {object} mdnConf\n * @param {string} [mdnConf.specMapUrl]\n * @param {string} [mdnConf.baseJsonPath]\n * @param {number} [mdnConf.maxAge]\n *\n * @typedef {{ version_added: string|boolean|null, version_removed?: string }} VersionDetails\n * @typedef {Record<string | keyof MDN_BROWSERS, VersionDetails>} MdnSupportEntry\n * @typedef {{ name: string, title: string, slug: string, summary: string, support: MdnSupportEntry, engines: string[] }} MdnEntry\n * @typedef {Record<string, MdnEntry[]>} MdnData\n * @returns {Promise<MdnData|undefined>}\n */\nasync function getMdnData(key, mdnConf) {\n const { baseJsonPath = BASE_JSON_PATH, maxAge = 60 * 60 * 24 * 1000 } =\n mdnConf;\n const url = new URL(`${key}.json`, baseJsonPath).href;\n const res = await fetchAndCache(url, maxAge);\n if (res.status === 404) {\n const msg = `Could not find MDN data associated with key \"${key}\".`;\n const hint = \"Please add a valid key to `respecConfig.mdn`\";\n showError(msg, name, { hint });\n return;\n }\n return await res.json();\n}\n\n/**\n * Find elements that can have an annotation box attached.\n * @param {MdnData} data\n */\nfunction findElements(data) {\n /** @type {NodeListOf<HTMLElement>} */\n const elemsWithId = document.body.querySelectorAll(\"[id]:not(script)\");\n return [...elemsWithId].filter(({ id }) => Array.isArray(data[id]));\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLSpanElement}\n */\nfunction getEngineSupportIcons(engines) {\n if (engines.length === 3) {\n return html`<span title=\"${l10n.inAllEngines}\">✅</span>`;\n }\n if (engines.length < 2) {\n return html`<span title=\"${l10n.inSomeEngines}\">🚫</span>`;\n }\n return html`<span> </span>`;\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLParagraphElement|undefined}\n */\nfunction getEngineSupport(engines) {\n if (engines.length === 3) {\n return html`<p class=\"engines-all\">${l10n.inAllEngines}</p>`;\n }\n if (engines.length < 2) {\n return html`<p class=\"engines-some\">${l10n.inSomeEngines}</p>`;\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\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 get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\nfunction toDownloadLink(details) {\n const { id, href, fileName, title, type } = details;\n return html`<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}\n\nconst saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(toDownloadLink)}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n};\n\nconst supportsDownload = \"download\" in HTMLAnchorElement.prototype;\nlet button;\nif (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\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 const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"仕様検索\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"搜索 Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"🔎\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/xref/\";\n\nconst localizationStrings = {\n en: {\n title: \"Search definitions\",\n },\n ja: {\n title: \"定義検索\",\n },\n de: {\n title: \"Definitionen durchsuchen\",\n },\n zh: {\n title: \"搜索定义\",\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 onLoad = e => e.target.classList.add(\"ready\");\n const xrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=\"${onLoad}\"></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.title, xrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\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 = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\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://respec.org/docs'>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 ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\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 { resolveRef } from \"../core/biblio.js\";\nimport { showWarning } from \"../core/utils.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 const msg = `Canonical URI set to edDraft, but no edDraftURI is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n case \"TR\":\n if (trLatestUri) {\n conf.canonicalURI = trLatestUri;\n } else {\n const msg = `Canonical URI set to TR, but no shortName is set in configuration`;\n showWarning(msg, name);\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 const msg = `CanonicalURI is an invalid URL: ${err.message}`;\n showWarning(msg, name);\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: document.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","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\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","// @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\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\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 css from \"../styles/highlight.css.js\";\nimport { 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\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 document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\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://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${\"[testSuiteURI]\"} が見つかりません.`,\n tests: \"テスト\",\n test: \"テスト\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`本规范中包含测试,但在 ReSpec 配置中缺少 ${\"[testSuiteURI]\"}。`,\n tests: \"测试\",\n test: \"测试\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\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 = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${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 showError(l10n.missing_test_suite_uri, name);\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, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\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 const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\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 = [...elem.querySelectorAll(\":scope > 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 = [...dl.querySelectorAll(\":scope > 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 const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar: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`;\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 css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\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 = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === 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","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font: small Helvetica Neue, sans-serif, Droid Sans Fallback;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\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`;\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 css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\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","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\n\nexport const name = \"core/algorithms\";\n\nexport 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 = css;\n document.head.appendChild(style);\n }\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } 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 const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\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 const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\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 const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\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 const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // remove the figure's title\n const children = [...makeSafeCopy(figcaption).childNodes].filter(\n // @ts-ignore\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 const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\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 // @ts-ignore\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 // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\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 { html } from \"../import-maps.js\";\nimport { showError } 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 html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\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 && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<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: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\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","// @ts-check\n/**\n * This module adds a \"monetization\" meta-tag to enable web-monetization.\n *\n * The meta-tag is added only to \"live\" documents, and is removed from generated\n * static documents.\n */\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/web-monetization\";\n\nconst DEFAULT_PAYMENT_POINTER = \"$respec.org\";\n\nexport function run(conf) {\n const { monetization } = conf;\n if (monetization === false) {\n return;\n }\n\n const paymentPointer =\n typeof monetization === \"string\" ? monetization : DEFAULT_PAYMENT_POINTER;\n\n if (paymentPointer === DEFAULT_PAYMENT_POINTER) {\n document.head.append(\n html`<!-- Support ReSpec's development - https://opencollective.com/respec --> `\n );\n }\n document.head.append(html`<meta\n name=\"monetization\"\n content=\"${paymentPointer}\"\n class=\"removeOnSave\"\n />`);\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\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 showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"check-internal-slots\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-internal-slots\";\nexport const name = \"core/linter-rules/check-internal-slots\";\n\nconst localizationStrings = {\n en: {\n msg: \"Internal slots should be preceded by a '.'\",\n hint: \"Add a '.' between the elements mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"var+a\");\n const offendingElements = [...elems].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 showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\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 { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\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 { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst hasNoHeading = ({ firstElementChild: elem }) => {\n return elem === null || /^h[1-6]$/.test(elem.localName) === false;\n};\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [...document.querySelectorAll(\"section\")].filter(\n hasNoHeading\n );\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\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 { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"wpt-tests-exist\".\n * Warns about nonexistent web platform tests.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"wpt-tests-exist\";\nexport const name = \"core/linter-rules/wpt-tests-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"The following test could not be found in Web Platform Tests:\",\n hint: \"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const filesInWPT = await getFilesInWPT(conf.testSuiteURI, conf.githubAPI);\n if (!filesInWPT) {\n return;\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n for (const elem of testables) {\n elem.dataset.tests\n .split(/,/gm)\n .map(test => test.trim().split(\"#\")[0])\n .filter(test => test && !filesInWPT.has(test))\n .map(missingTest => {\n showWarning(`${l10n.msg} \\`${missingTest}\\`.`, name, {\n hint: l10n.hint,\n elements: [elem],\n });\n });\n }\n}\n\n/**\n * @param {string} testSuiteURI\n * @param {string} githubAPIBase\n */\nasync function getFilesInWPT(testSuiteURI, githubAPIBase) {\n let wptDirectory;\n try {\n const testSuiteURL = new URL(testSuiteURI);\n if (\n testSuiteURL.pathname.startsWith(\"/web-platform-tests/wpt/tree/master/\")\n ) {\n const re = /web-platform-tests\\/wpt\\/tree\\/master\\/(.+)/;\n wptDirectory = testSuiteURL.pathname.match(re)[1].replace(/\\//g, \"\");\n } else {\n wptDirectory = testSuiteURL.pathname.replace(/\\//g, \"\");\n }\n } catch (error) {\n const msg = \"Failed to parse WPT directory from testSuiteURI\";\n showWarning(msg, `linter/${name}`);\n console.error(error);\n return null;\n }\n\n const url = new URL(\"web-platform-tests/wpt/files\", `${githubAPIBase}/`);\n url.searchParams.set(\"path\", wptDirectory);\n\n const response = await fetch(url);\n if (!response.ok) {\n const error = await response.text();\n const msg =\n \"Failed to fetch files from WPT repository. \" +\n `Request failed with error: ${error} (${response.status})`;\n showWarning(msg, `linter/${name}`);\n return null;\n }\n /** @type {{ entries: string[] }} */\n const { entries } = await response.json();\n const files = entries.filter(entry => !entry.endsWith(\"/\"));\n return new Set(files);\n}\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 { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\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], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n","// @ts-check\n/**\n * Lints for accessibility issues using axe-core package.\n */\n\nimport { showError, showWarning } from \"../utils.js\";\n\nexport const name = \"core/linter-rules/a11y\";\n\nconst DISABLED_RULES = [\n \"color-contrast\", // too slow 🐢\n \"landmark-one-main\", // need to add a <main>, else it marks entire page as errored\n \"landmark-unique\",\n \"region\",\n];\n\nexport async function run(conf) {\n if (!conf.lint?.a11y && /** legacy */ !conf.a11y) {\n return;\n }\n const config = conf.lint?.a11y || /** legacy */ conf.a11y;\n\n const options = config === true ? {} : config;\n const violations = await getViolations(options);\n for (const violation of violations) {\n /**\n * We're grouping by failureSummary as it contains hints to fix the issue.\n * For example, with color-constrast rule, it tells about the present color\n * contrast and how to fix it. If we don't group, errors will be repetitive.\n * @type {Map<string, HTMLElement[]>}\n */\n const groupedBySummary = new Map();\n for (const node of violation.nodes) {\n const { failureSummary, element } = node;\n const elements =\n groupedBySummary.get(failureSummary) ||\n groupedBySummary.set(failureSummary, []).get(failureSummary);\n elements.push(element);\n }\n\n const { id, help, description, helpUrl } = violation;\n const title = `a11y/${id}: ${help}`;\n for (const [failureSummary, elements] of groupedBySummary) {\n const hints = formatHintsAsMarkdown(failureSummary);\n const details = `\\n\\n${description}.\\n\\n${hints}. ([Learn more](${helpUrl}))`;\n showWarning(title, name, { details, elements });\n }\n }\n}\n\n/**\n * @param {object} opts Options as described at https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter\n */\nasync function getViolations(opts) {\n const { rules, ...otherOptions } = opts;\n const options = {\n rules: {\n ...Object.fromEntries(DISABLED_RULES.map(id => [id, { enabled: false }])),\n ...rules,\n },\n ...otherOptions,\n elementRef: true,\n resultTypes: [\"violations\"],\n reporter: \"v1\", // v1 includes a `failureSummary`\n };\n\n let axe;\n try {\n axe = await importAxe();\n } catch (error) {\n const msg = \"Failed to load a11y linter.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n\n try {\n const result = await axe.run(document, options);\n return result.violations;\n } catch (error) {\n const msg = \"Error while looking for a11y issues.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n}\n\n/** @returns {Promise<typeof window.axe>} */\nfunction importAxe() {\n const script = document.createElement(\"script\");\n script.classList.add(\"remove\");\n script.src = \"https://unpkg.com/axe-core@3/axe.min.js\";\n document.head.appendChild(script);\n return new Promise((resolve, reject) => {\n script.onload = () => resolve(window.axe);\n script.onerror = reject;\n });\n}\n\n/** @param {string} text */\nfunction formatHintsAsMarkdown(text) {\n const results = [];\n for (const group of text.split(\"\\n\\n\")) {\n const [msg, ...opts] = group.split(/^\\s{2}/m);\n const options = opts.map(opt => `- ${opt.trimEnd()}`).join(\"\\n\");\n results.push(`${msg}${options}`);\n }\n return results.join(\"\\n\\n\");\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","[object Object]","target","prop","receiver","IDBTransaction","get","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","args","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","addEventListener","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","version","upgrade","blocking","terminated","open","openPromise","event","oldVersion","newVersion","db","source","position","current","message","kind","level","autofix","ruleName","sliceTokens","count","slice","Math","max","tokensToText","inputs","precedes","text","t","trivia","join","nextToken","type","length","line","precedingLastLine","splitted","split","lastLine","subsequentTokens","subsequentText","sourceContext","repeat","contextType","context","partial","node","hierarchy","parent","unshift","n","base","appendIfExist","contextAsText","bareMessage","sourceName","input","tokens","syntaxError","validationError","token","options","Base","Object","defineProperties","writable","json","inheritance","proto","descMap","getOwnPropertyDescriptors","key","entries","enumerable","getPrototypeOf","idlTypeIncludesDictionary","idlType","defs","useNullableInner","union","def","unique","typedefIncludesDictionary","cache","reference","dictionary","nullable","subtype","dictionaryIncludesRequiredField","dict","members","field","required","superdict","ArrayBase","Array","super","WrappedToken","tokeniser","consumeType","unescape","tokenName","list","parser","listName","extAttrValueSyntax","renamedLegacies","extAttrListItems","syntax","toks","ExtendedAttributeParameters","assign","consume","ret","autoParenter","secondaryName","rhsIsList","argument_list","close","hasRhs","rhsType","w","ts","reference_token","p","identifier","endsWith","item","separator","write","SimpleExtendedAttribute","params","parse","defineProperty","rhs","arguments","extAttr","arg","validate","extendedAttribute","extendedAttributeReference","ExtendedAttributes","push","probe","ea","type_suffix","obj","single_type","typeName","Type","return_type","type_with_extended_attributes","keyType","stringTypes","keyIdlType","valueType","generic_type","primitive_type","typeNameKeywords","generic","typ","or","union_type","extAttrs","Boolean","prefix","postfix","filter","typedef","targetToken","firstToken","ref","unescaped","type_body","Default","const_value","expression","const_data","negative","Argument","start_position","optional","variadic","argumentNameKeywords","default","unconsume","autofixOptionalDictionaryDefaultValue","indexOf","a","isLastRequiredArgument","getFirstToken","name_token","data","Tokeniser","Operation","special","regular","termination","argument","body","definition","nameless","Attribute","noInherit","readonly","startsWith","allowDangler","first","items","num_type","integer_type","decimal_type","voidToken","stringifier","getLastIndentation","str","lines","match","autofixAddExposedWindow","exposed","existing","test","values","x","y","isArray","tokenRe","decimal","integer","string","whitespace","comment","other","nonRegexTerminals","concat","punctuations","reserved","idl","lastCharIndex","nextChar","charAt","attemptTokenMatch","noFlushTrivia","currentTrivia","pop","lastIndex","WebIDLParseError","punctuation","re","exec","tokenise","probeType","candidates","EnumValue","Enum","v","Includes","mixin","Typedef","CallbackFunction","Container","instance","inheritable","allowedMembers","colon","mem","member","m","Constant","IterableLike","secondTypeRequired","secondTypeAllowed","argumentAllowed","argsOpen","argsClose","Constructor","static_member","Interface","every","oldConstructors","constructor","autofixConstructor","factoryFunctions","named","constructors","i","opNames","Set","getOperations","op","partials","mixins","mixinMap","ext","additions","forEachExtension","addition","add","existings","checkInterfaceMemberDuplication","interfaceDef","constructorExtAttr","indentation","memberIndent","parentTrivia","indentCh","getMemberIndentation","constructorOp","existingIndex","array","predicate","reverse","findIndex","findLastIndex","splice","removed","trim","Mixin","Field","Dictionary","Namespace","CallbackInterface","parseByTokens","interface_","opts","res","eof","concrete","definitions","noop","templates","Writer","raw","wrapper","bind","id","getMixinMap","include","validateIterable","ast","duplicates","groupDefinitions","dup","checkDuplicatedNames","it","flat","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","paramName","paramValue","toLowerCase","defaults$5","exports","getDefaults$1","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartLists","smartypants","tokenizer","walkTokens","xhtml","defaults","getDefaults","changeDefaults","newDefaults","escapeTest","escapeReplace","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","&","<",">","\"","'","getEscapeReplacement","ch","unescapeTest","unescape$1","_","String","fromCharCode","parseInt","substring","caret","nonWordAndColonTest","originIndependentUrl","baseUrls","justDomain","protocol","domain","resolveUrl","href","rtrim$1","relativeBase","invert","l","suffLen","currChar","substr","helpers","escape","encode","edit","regex","opt","val","getRegex","RegExp","cleanUrl","prot","decodeURIComponent","e","encodeURI","noopTest","merge","hasOwnProperty","splitCells","tableRow","cells","offset","escaped","curr","rtrim","findClosingBracket","b","checkSanitizeDeprecation","console","warn","repeatString","pattern","defaults$4","escape$2","outputLink","cap","link","title","Tokenizer_1","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","matchIndentInNode","indentInNode","indentCodeCompensation","heading","trimmed","depth","nptable","header","align","hr","blockquote","bull","isordered","ordered","start","loose","itemMatch","space","bcurr","bnext","addBack","istask","ischecked","endMatch","next","listItemStart","task","checked","pre","tag","table","lheading","paragraph","inline","inLink","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","linkLen","_escapes","links","reflink","nolink","maskedSrc","prevChar","emStrong","lDelim","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","min","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","merge$1","block$1","_paragraph","_label","_title","bullet","_tag","_comment","normal","inline$1","reflinkSearch","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Tokenizer$1","defaults$3","out","charCodeAt","random","toString","defaults$2","escape$1","Renderer_1","infostring","quote","slugger","slug","content","flags","TextRenderer_1","Slugger_1","seen","originalSlug","isDryRun","occurenceAccumulator","serialize","getNextSafeSlug","dryrun","Renderer$1","TextRenderer$1","Slugger$1","defaults$1","Lexer","create","lex","inlineTokens","blockTokens","top","lastToken","cutSrc","lastParagraphClipped","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","j","k","l2","row","keepPrevChar","keys","lastIndexOf","codespan","startInline","inlineText","Parser","textRenderer","parseInline","l3","cell","itemBody","checkbox","renderers","tablecell","tablerow","listitem","image","Tokenizer","Renderer","TextRenderer","Slugger","marked","err","pending","setTimeout","setOptions","use","childTokens","hasExtensions","pack","prevRenderer","prevTokenizer","lexInline","lexer","marked_1","globalThis","global","self","module","pluralize$1","root","pluralize","commonjsGlobal","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","hyperHTML","N","r","delete","configurable","o","s","WeakSet","u","insertBefore","selected","selectedIndex","f","querySelectorAll","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","g","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","detail","CustomEvent","_wire$","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","dispatchEvent","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","Component","diff","hyper","for","handleEvent","currentTarget","svg","state","defaultState","dispatch","component","setState","idb","_idb","webidl2","_webidl2","_marked","_pluralize","MIMEType","TypeError","parserMode","inputArray","from","char","trimEnd","fromEntries","parseMimeType","parameters","essence","mimeType","size","paramStr","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","origin","corsMode","location","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","docLang","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","xmlEscape","norm","getIntlData","localizationStrings","zh-hans","zh-cn","resolveLanguageAlias","concatDate","date","sep","format","humanDate","Date","langs","toLocaleString","runTransforms","flist","funcArgs","methods","meth","showWarning","fetchAndCache","maxAge","Request","cachedResponse","caches","headers","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","toISOString","cacheResponse","Response","blob","put","htmlJoinComma","joined","htmlJoinAnd","addHashId","addId","hash","imul","hashString","pfx","txt","noLC","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","getCanonicalKey","existingKey","find","makeSafeCopy","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","elements","msg","markAsOffending","stack","details","showError","pluginName","pub","toMDCode","codedJoinOr","quotes","addQuotes","codedJoinAnd","docLink","strings","linkingText","subscriptions","topic","cb","JSON","stringify","postMessage","sub","once","callbacks","unsub","removeList","mimeTypes","rsDocToDataURL","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","toJSON","ready","runAll","plugs","respec","respecIsReadyWarningShown","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","search","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","reindent","indents","leastIndent","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","Builder","tagName","section","findPosition","findParent","process","findHeader","structure","fragment","addHeader","addSection","addElement","restructure","structuredInternals","firstElementChild","processMDSections","conf","hasMDSections","isMDFormat","processedElem","rsUI","newBody","trimStart","firstTwo","lastTwo","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","createContextualFragment","rsErrorToHTML","li","lastElementChild","freshModal","createWarnButton","label","handler","_keyShort","icon","menuItem","owner","currentOwner","headingId","generateMarkdownLink","plugins","show","readyState","domReady","enable","ev","warning","ReSpec.run","hasLink","isLegacyFrag","LEGACY_OPTIONS","getGroupDetails","group","shortname","wgId","wg","URI","wgURI","patentURI","wgPatentURI","patentPolicy","wgPatentPolicy","groupType","status","usedLegacyOptions","groupDetails","groups","getMultipleGroupDetails","showLink","class","showLinkData","showLogo","logo","alt","height","width","until","es","ko","ja","zh","defaultLang","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","reduce","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","extras","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","ccLicense","w3cLicense","legalDisclaimer","w3cTrademark","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","edited_in_place","this_version","test_suite","implementation_report","prev_editor_draft","prev_version","prev_recommendation","latest_recommendation","nl","logos","specSubTitleElem","subtitle","getSpecSubTitleElem","prependW3C","isCR","longStatus","textStatus","dashDate","publishHumanDate","modificationDate","modificationHumanDate","inPlaceModificationDate","isTagFinding","isNoTrack","thisVersion","latestVersion","edDraftURI","testSuiteURI","implementationReportURI","isED","prevED","showPreviousVersion","prevVersion","prevRecURI","isRec","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","errata","shortName","alternateFormats","multipleAlternates","alternatesHTML","existingCopyright","overrideCopyright","isUnofficial","licenseInfo","linkLicense","short","copyrightStart","publishYear","additionalCopyrightHolders","isCCBY","noteIfDualLicense","isW3CSoftAndDocLicense","linkDocumentUse","renderOfficialCopyright","renderCopyright","cssClass","specTitleElem","specTitleElemClone","isCGFinal","sotd","isPreview","renderPreview","additionalContent","renderIsUnofficial","isMO","renderIsNoTrack","status_at_publication","isSubmission","isMemberSubmission","teamComment","publishDate","getUTCFullYear","submissionCommentNumber","patentPolicyURL","noteForMemberSubmission","isTeamSubmission","renderPublicList","noteForTeamSubmission","noteForSubmission","sotdAfterWGinfo","overrideStatus","proposedChanges","revisionTypes","wgHTML","anOrA","notYetRec","linkToWorkingGroup","linkToCommunity","updateableRec","humanRevisedRecEnd","reviewTarget","renderIsRec","statusExplanation","updatePolicy","reviewPolicy","specStatus","pubMode","humanCREnd","isPR","humanPREnd","isPER","humanPEREnd","renderNotRec","isNote","isIGNote","multipleWGs","recNotExpected","wgPatentHTML","charterDisclosureURI","producers","renderDeliverer","addPatentNote","additionalSections","prUrl","prNumber","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","wgPublicList","subjectPrefix","github","issueBase","W3CDate","w3Url","status2maturity","LS","LD","FPWD","LC","FPLC","FPWD-NOTE","WD-NOTE","LC-NOTE","IG-NOTE","WG-NOTE","publicationSpaces","Member-SUBM","Team-SUBM","finding","draft-finding","status2rdf","NOTE","WD","CR","CRD","PR","REC","PER","RSCND","status2text","CG-NOTE","MO","ED","unofficial","CG-DRAFT","CG-FINAL","BG-DRAFT","BG-FINAL","status2long","W3CNotes","maybeRecTrack","recTrackStatus","cgStatus","bgStatus","cgbgStatus","noTrackStatus","precededByAn","licenses","patentPolicies","baseLogo","freeze","validateDateAndRecover","fallbackDate","isFinite","formattedDate","collectSotdContent","sotdClone","hasChildNodes","license","isCGBG","isBasic","isRegular","host","lastModified","isRecTrack","noRecTrack","memSubmissionLogo","teamSubmissionLogo","linkGroup","hasGitHubIssuesLink","maturity","pubSpace","docVersion","latestPath","previousPublishDate","previousMaturity","prevMaturity","pubDate","prevPubDate","prevRecShortname","uri","rdfStatus","showThisVersion","isCRDraft","publishISODate","shortISODate","policies","policy","validatePatentPolicies","cgbgHeadersTmpl","headersTmpl","wgPotentialArray","idx","crEnd","prEnd","perEnd","contains","revisedRecEnd","notAllowed","mailToWGPublicList","cgbgSotdTmpl","sotdTmpl","populateSoTD","generatedSubtitle","coreDefaults","lint","no-headingless-sections","no-http-props","no-unused-vars","check-punctuation","local-refs-exist","check-internal-slots","check-charset","privsec-section","highlightVars","addSectionLinks","w3cLogo","w3cDefaults","wpt-tests-exist","a11y","doJsonLd","xref","processLogos","supportedStatus","validateStatusForGroup","insertStyle","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","toKeyValuePairs","initial-scale","shrink-to-fit","createMetaViewport","styleFile","styleVersion","isNaN","selectStyleVersion","useExperimentalStyles","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","nextLink","linkCSS","exportDoc","w3cStyle","resolveGithubPromise","rejectGithubPromise","file_a_bug","participate","commit_history","ghURL","tempURL","repoURL","org","repo","branch","newProps","githubToken","githubUser","atRiskBase","pullBase","otherLink","githubAPI","hostname","normalizedGHObj","apiBase","fullName","normalizedConfig","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","includables","promisesToInclude","includeId","default_title","h1Elem","isConnected","documentTitle","setDocumentTitle","isInteger","abstract","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","renderParent","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","openIdb","biblioDB","isAlias","resolveAlias","range","IDBKeyRange","only","openCursor","aliasOf","aliasesAndRefs","alias","promisesToAdd","flatMap","isInDB","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","addAll","resolveRef","entry","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","localBiblio","localAliases","normalizeReferences","allRefs","getRefKeys","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","refUrl","selectors","elems","linkType","decorateInlineReference","getAliases","badrefs","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","conformance","normativity","keywordInterpretation","terms","processConformance","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","validator","associateWith","knownTypes","computeType","dfnFor","validateDefinition","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","export","processAsTaskSource","closestType","computeExport","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","makeTitle","num","report","number","examples","div","inAside","exampleTitle","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bgColorHex","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","makeIssueSectionSummary","issuesAndNotes","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","sections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","topLevelEntities","findDfn","defn","findNormalDfn","findOperationDfn","resolvedName","dfns","getDfns","alternativeDfns","decorateDfn","dfnElem","idlAst","lCaseParent","last","getDataType","local","exportable","addAlternativeNames","asQualifiedName","operationName","argsAst","operationNames","isOptional","requiredArgs","requiredOperation","optionalOps","generateMethodNamesWithArgs","getAlternativeNames","originalName","foundDfns","dfnForArray","closestDfnFor","idlStruct","copyButton","createButton","addCopyIDLButton","idlHeader","idlText","clipboard","writeText","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","unlinkedAnchor","nameResolverMap","getDefnName","getIdlId","resolvePartial","overload","qualifiedName","fullyQualifiedName","resolveOverload","resolveNameAndId","renderWebIDL","idlElement","highlights","closestCite","cites","addIDLHeader","idls","astArray","validations","validation","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","STORE_NAME","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","queries","cachedData","lastChecked","localStorage","getItem","setItem","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","query","cursor","profiles","web-platform","getRequestEntry","getTermFromElement","specs","dataciteElem","closestSection","inlineRefs","higherPriority","uniqueSpecs","dedupeSpecContext","getSpecContext","types","getTypeContext","dataXrefForElem","getForContext","addDataCite","normative","closestNormative","closestInform","addToReferences","objectHash","buffer","TextEncoder","crypto","subtle","digest","bufferToHexString","Uint8Array","padStart","invalidProfileError","profile","normalizeConfig","bodyCite","externalDFNs","findExplicitExternalLinks","queryKeys","apiUrl","uniqueIds","uniqueQueryKeys","resultsFromCache","termsToLook","fetchedResults","Content-Type","fetchFromNetwork","cacheXrefData","getData","ambiguous","notFound","collector","getPrefilledFormURL","howToFix","howToCiteURL","originalTerm","formUrl","specsString","forParent","showErrors","addDataCiteToTerms","idlIndexSec","idlIndex","headingExternal","headlingLocal","dfnOf","CODE_TYPES","getLocalTermType","ds","getLocalTermParentContext","getLocalTermSuffix","appendSectionNumbers","secNum","getSectionNumber","collectExternalTerms","uniqueReferences","uniqueID","renderExternalTermEntry","typeSuffix","TYPE_TERMS","TYPED_TYPES","linkForText","getTermText","styleEl","localTermIndex","dataSortedByTerm","collectLocalTerms","renderItem","suffix","getLocalTermText","renderLocalTerm","createLocalTermIndex","externalTermIndex","dataSortedBySpec","specA","specB","createExternalTermIndex","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","span","tocIntroductory","renameSectionHeaders","noTOC","maxToc","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","informative","headings","BROWSERS","fetchStats","feature","versions","browsers","statusText","caniuse","DEFAULTS","caniuseConf","invalidBrowsers","browser","getNormalizedConf","fetchPromise","featureURL","headDlElem","contentPromise","stats","definitionPair","outputDoc","BASE_JSON_PATH","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","ie","opera","opera_android","safari","safari_ios","samsunginternet_android","webview_android","inAllEngines","inSomeEngines","insertMDNBox","targetAncestor","targetSibling","mdnBox","attachMDNDetail","mdnSpec","summary","support","engines","mdnSubPath","engineSupport","getEngineSupportIcons","getEngineSupport","createRow","browserId","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","getMdnData","findElements","mdnSpecArray","save_snapshot","downloadLinks","fileName","epubURL","toDownloadLink","saveDialog","supportsDownload","HTMLAnchorElement","addCommand","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","addPerson","ed","foaf:mbox","worksFor","addRef","jsonld","creator","publishedDate","isbn","canonicalURI","trLatestUri","@context","@vocab","@language","w3p","foaf","datePublished","@type","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","description","contributor","citationIds","citationContents","citation","addJSONLDInfo","fetchBase","workerPromise","workerScript","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","handleDuplicates","testURLs","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","createPanel","panelId","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","loadScript","varMap","variables","currentSection","processBox","matchingElement","selfLink","copy","processFigure","figcaption","figTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","HTMLElement","props","to","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","DEFAULT_PAYMENT_POINTER","monetization","paymentPointer","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","hasNoHeading","sectionContainsAlgorithm","varElems","varUsage","vars","saysPrivOrSec","saysConsiderations","filesInWPT","githubAPIBase","wptDirectory","testSuiteURL","files","getFilesInWPT","missingTest","offendingMembers","getOwnPropertyNames","DISABLED_RULES","formatHintsAsMarkdown","violations","otherOptions","enabled","elementRef","resultTypes","reporter","axe","onload","onerror","importAxe","getViolations","violation","groupedBySummary","nodes","failureSummary","help","helpUrl","hints"],"mappings":"uDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,IAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,GAElD,OAAON,OAAOC,QAAQG,QAAQE,KAEhCE,QAAQC,IAAIL,GAASM,KAAKC,GAAWR,KAAYQ,KAEnDV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,EAOZ,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,GClB5B,MAEDC,EAAOC,SAASC,gBAClBF,IAASA,EAAKG,aAAa,UAC7BH,EAAKI,KAAO,KACPJ,EAAKG,aAAa,SACrBH,EAAKK,IAAM,QAIR,MAAMC,EAAO,GAEPF,EAAOJ,EAAKI,8CAZL,8BAcb,SAAaG,GAClBA,EAAOD,KAAOA,EAAKF,IAASE,EAAKE,MCtBnC,IAAIC,EACAC,EAqBJ,MAAMC,EAAmB,IAAIC,QACvBC,EAAqB,IAAID,QACzBE,EAA2B,IAAIF,QAC/BG,EAAiB,IAAIH,QACrBI,EAAwB,IAAIJ,QA0DlC,IAAIK,EAAgB,CAChBC,IAAIC,EAAQC,EAAMC,GACd,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C,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACVzD,SAAQ,SAAUyD,GAClB,OAAOR,EAAU2B,gBAAgBnB,EAAK,GAAIA,EAAK,OAMjD,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,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,WACAzD,QAAQiD,EAAU4B,oBAEb5B,KAIT,IAAIA,GAAYF,GAAY9R,QC7fU+T,GAAU,SAASC,GAAgB,IAAItoB,EAAE,GAAG,IAAIA,EAAE3G,QAAQA,QAAQ,MAAMyf,GAAG9Y,EAAE3G,QAAQ,SAAS2G,EAAE8Y,GAAG,IAAIxX,EAAEwX,EAAErS,eAAe8hB,EAAEzP,EAAEI,eAAejJ,EAAEjG,EAAErP,UAAU,OAAOsV,EAAEuY,OAAO,SAAS1P,GAAG,OAAOzd,KAAKd,IAAIue,WAAWA,EAAEzd,KAAKwb,IAAI5G,EAAEjW,IAAI,SAAS8e,GAAG,OAAOzd,KAAKd,IAAIue,GAAGA,EAAEzd,KAAKwb,QAAG,GAAQ5G,EAAE1V,IAAI,SAASue,GAAG,OAAOyP,EAAE/sB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0C,IAAIlrC,SAAUuJ,IACzBo2E,WACd,MAAOp8E,GAIP,OAFAgjC,GADY,uCACG1mC,IACfshB,QAAQ5d,MAAMA,GACP,IA5DgB88E,CAAc92E,GACvC,IAAK,MAAM+2E,KAAaX,EAAY,CAOlC,MAAMY,EAAmB,IAAI57E,IAC7B,IAAK,MAAM6D,KAAQ83E,EAAUE,MAAO,CAClC,MAAMC,eAAEA,EAAcv8C,QAAEA,GAAY17B,GAElC+3E,EAAiBj/E,IAAIm/E,IACrBF,EAAiB5+E,IAAI8+E,EAAgB,IAAIn/E,IAAIm/E,IACtCjyE,KAAK01B,GAGhB,MAAMzpB,GAAEA,EAAEimE,KAAEA,EAAI9J,YAAEA,EAAW+J,QAAEA,GAAYL,EACrC1+D,EAAQ,QAAQnH,MAAOimE,IAC7B,IAAK,MAAOD,EAAgBv6C,KAAaq6C,EAAkB,CACzD,MAAMK,EAAQlB,GAAsBe,GAEpCz/C,GAAYpf,EAAO/hB,GAAM,CAAEymC,QADX,OAAOswC,SAAmBgK,oBAAwBD,MAC9Bz6C,SAAAA"} \ No newline at end of file +{"version":3,"file":"respec-w3c.js","sources":["../src/core/expose-modules.js","../src/core/l10n.js","../node_modules/idb/build/esm/wrap-idb-value.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/array-base.js","../node_modules/webidl2/lib/productions/token.js","../node_modules/webidl2/lib/productions/extended-attributes.js","../node_modules/webidl2/lib/productions/type.js","../node_modules/webidl2/lib/productions/default.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/productions/constructor.js","../node_modules/webidl2/lib/productions/interface.js","../node_modules/webidl2/lib/validators/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/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/reindent.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/w3c.js","../src/core/location-hash.js","../src/w3c/group.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/w3c/templates/headers.js","../src/w3c/templates/cgbg-headers.js","../src/w3c/templates/sotd.js","../src/w3c/templates/cgbg-sotd.js","../src/w3c/headers.js","../src/core/defaults.js","../src/w3c/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/w3c/style.js","../src/w3c/l10n.js","../src/core/github.js","../src/core/data-include.js","../src/core/title.js","../src/w3c/level.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-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/dfn-finder.js","../src/core/webidl-clipboard.js","../src/styles/webidl.css.js","../src/core/webidl.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/xref-db.js","../src/core/xref.js","../src/core/webidl-index.js","../src/styles/dfn-index.css.js","../src/core/dfn-index.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/styles/caniuse.css.js","../src/core/caniuse.js","../src/styles/mdn-annotation.css.js","../src/core/mdn-annotation.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/search-xref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/w3c/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/web-monetization.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/check-internal-slots.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.js"],"sourcesContent":["// @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\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 */\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\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));\n });\n }\n if (blocked)\n request.addEventListener('blocked', () => blocked());\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking)\n db.addEventListener('versionchange', () => blocking());\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked)\n request.addEventListener('blocked', () => blocked());\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * @param {string} text\n */\nfunction lastLine(text) {\n const splitted = text.split(\"\\n\");\n return splitted[splitted.length - 1];\n}\n\nfunction appendIfExist(base, target) {\n let result = base;\n if (target) {\n result += ` ${target}`;\n }\n return result;\n}\n\nfunction contextAsText(node) {\n const hierarchy = [node];\n while (node && node.parent) {\n const { parent } = node;\n hierarchy.unshift(parent);\n node = parent;\n }\n return hierarchy.map((n) => appendIfExist(n.type, n.name)).join(\" -> \");\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(\n source,\n position,\n current,\n message,\n kind,\n { level = \"error\", autofix, ruleName } = {}\n) {\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\"\n ? source[position].line\n : source.length > 1\n ? 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 =\n current && current.name\n ? `, ${contextType} \\`${current.partial ? \"partial \" : \"\"}${contextAsText(\n current\n )}\\``\n : \"\";\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(\n token,\n current,\n ruleName,\n message,\n options = {}\n) {\n options.ruleName = ruleName;\n return error(\n current.source,\n token.index,\n current,\n message,\n \"Validation\",\n options\n );\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, writable: true },\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(\n idlType,\n defs,\n { useNullableInner } = {}\n) {\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 // Set cached result to indeterminate to short-circuit circular definitions.\n // The final result will be updated to true or false.\n defs.cache.dictionaryIncludesRequiredField.set(dict, undefined);\n let result = dict.members.some((field) => field.required);\n if (!result && dict.inheritance) {\n const superdict = defs.unique.get(dict.inheritance);\n if (!superdict) {\n // Assume required members in the supertype if it is unknown.\n result = true;\n } else if (dictionaryIncludesRequiredField(superdict, defs)) {\n result = true;\n }\n }\n defs.cache.dictionaryIncludesRequiredField.set(dict, result);\n return result;\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 WrappedToken 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.consumeType(type);\n if (value) {\n return new WrappedToken({\n source: tokeniser.source,\n tokens: { value },\n });\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 { WrappedToken } 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 return list(tokeniser, {\n parser: WrappedToken.parser(tokeniser, tokenName),\n listName: tokenName + \" list\",\n });\n}\n\nconst extAttrValueSyntax = [\"identifier\", \"decimal\", \"integer\", \"string\"];\n\nconst shouldBeLegacyPrefixed = [\n \"NoInterfaceObject\",\n \"LenientSetter\",\n \"LenientThis\",\n \"TreatNonObjectAsNull\",\n \"Unforgeable\",\n];\n\nconst renamedLegacies = new Map([\n ...shouldBeLegacyPrefixed.map((name) => [name, `Legacy${name}`]),\n [\"NamedConstructor\", \"LegacyFactoryFunction\"],\n [\"OverrideBuiltins\", \"LegacyOverrideBuiltIns\"],\n [\"TreatNullAs\", \"LegacyNullToEmptyString\"],\n]);\n\n/**\n * This will allow a set of extended attribute values to be parsed.\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\nfunction extAttrListItems(tokeniser) {\n for (const syntax of extAttrValueSyntax) {\n const toks = tokens(tokeniser, syntax);\n if (toks.length) {\n return toks;\n }\n }\n tokeniser.error(\n `Expected identifiers, strings, decimals, or integers 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(\n new ExtendedAttributeParameters({ source: tokeniser.source, tokens })\n );\n if (tokens.assign) {\n tokens.secondaryName = tokeniser.consumeType(...extAttrValueSyntax);\n }\n tokens.open = tokeniser.consume(\"(\");\n if (tokens.open) {\n ret.list = ret.rhsIsList\n ? // [Exposed=(Window,Worker)]\n extAttrListItems(tokeniser)\n : // [LegacyFactoryFunction=Audio(DOMString src)] or [Constructor(DOMString str)]\n argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") ||\n 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 /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n function extended_attribute_listitem(item) {\n return w.ts.wrap([\n w.token(item.tokens.value),\n w.token(item.tokens.separator),\n ]);\n }\n const { rhsType } = this;\n return w.ts.wrap([\n w.token(this.tokens.assign),\n w.reference_token(this.tokens.secondaryName, this.parent),\n w.token(this.tokens.open),\n ...(!this.list\n ? []\n : this.list.map((p) => {\n return rhsType === \"identifier-list\"\n ? w.identifier(p, this.parent)\n : rhsType && rhsType.endsWith(\"-list\")\n ? extended_attribute_listitem(p)\n : p.write(w);\n })),\n w.token(this.tokens.close),\n ]);\n }\n}\n\nexport class SimpleExtendedAttribute extends Base {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consumeType(\"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\n ? list\n : 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 const { name } = this;\n if (name === \"LegacyNoInterfaceObject\") {\n const message = `\\`[LegacyNoInterfaceObject]\\` 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(\n this.tokens.name,\n this,\n \"no-nointerfaceobject\",\n message,\n { level: \"warning\" }\n );\n } else if (renamedLegacies.has(name)) {\n const message = `\\`[${name}]\\` extended attribute is a legacy feature \\\nthat is now renamed to \\`[${renamedLegacies.get(name)}]\\`. Refer to the \\\n[relevant upstream PR](https://github.com/heycam/webidl/pull/870) for more \\\ninformation.`;\n yield validationError(this.tokens.name, this, \"renamed-legacy\", message, {\n level: \"warning\",\n autofix: renameLegacyExtendedAttribute(this),\n });\n }\n for (const arg of this.arguments) {\n yield* arg.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n return w.ts.wrap([\n w.ts.trivia(this.tokens.name.trivia),\n w.ts.extendedAttribute(\n w.ts.wrap([\n w.ts.extendedAttributeReference(this.name),\n this.params.write(w),\n ])\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {SimpleExtendedAttribute} extAttr\n */\nfunction renameLegacyExtendedAttribute(extAttr) {\n return () => {\n const { name } = extAttr;\n extAttr.tokens.name.value = renamedLegacies.get(name);\n if (name === \"TreatNullAs\") {\n extAttr.params.tokens = {};\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(\n ...list(tokeniser, {\n parser: SimpleExtendedAttribute.parse,\n listName: \"extended attribute\",\n })\n );\n tokens.close =\n tokeniser.consume(\"]\") ||\n 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(\n \"Illegal double extended attribute lists, consider merging them\"\n );\n }\n return ret;\n }\n\n *validate(defs) {\n for (const extAttr of this) {\n yield* extAttr.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n if (!this.length) return \"\";\n return w.ts.wrap([\n w.token(this.tokens.open),\n ...this.map((ea) => ea.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n return_type,\n primitive_type,\n autoParenter,\n} from \"./helpers.js\";\nimport { stringTypes, typeNameKeywords } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction generic_type(tokeniser, typeName) {\n const base = tokeniser.consume(\n \"FrozenArray\",\n \"ObservableArray\",\n \"Promise\",\n \"sequence\",\n \"record\"\n );\n if (!base) {\n return;\n }\n const ret = autoParenter(\n new Type({ source: tokeniser.source, tokens: { base } })\n );\n ret.tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`No opening bracket after ${base.value}`);\n switch (base.value) {\n case \"Promise\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Promise type cannot have extended attribute\");\n const subtype =\n return_type(tokeniser, typeName) ||\n tokeniser.error(\"Missing Promise subtype\");\n ret.subtype.push(subtype);\n break;\n }\n case \"sequence\":\n case \"FrozenArray\":\n case \"ObservableArray\": {\n const subtype =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(`Missing ${base.value} subtype`);\n ret.subtype.push(subtype);\n break;\n }\n case \"record\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Record key cannot have extended attribute\");\n const keyType =\n tokeniser.consume(...stringTypes) ||\n tokeniser.error(`Record key must be one of: ${stringTypes.join(\", \")}`);\n const keyIdlType = new Type({\n source: tokeniser.source,\n tokens: { base: keyType },\n });\n keyIdlType.tokens.separator =\n tokeniser.consume(\",\") ||\n tokeniser.error(\"Missing comma after record key type\");\n keyIdlType.type = typeName;\n const valueType =\n type_with_extended_attributes(tokeniser, typeName) ||\n 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.value}`);\n ret.tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing closing bracket after ${base.value}`);\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 =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.consume(...stringTypes, ...typeNameKeywords);\n if (!base) {\n return;\n }\n ret = new Type({ source: tokeniser.source, tokens: { base } });\n if (tokeniser.probe(\"<\"))\n 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\")\n 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 =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(\"No type after open parenthesis or 'or' in union type\");\n if (typ.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be included in a union type\");\n if (typ.generic === \"Promise\")\n 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 } else break;\n }\n if (ret.idlType.length < 2) {\n tokeniser.error(\n \"At least two types are expected in a union type but found less\"\n );\n }\n tokens.close =\n 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 = new ExtendedAttributes({});\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 = [this.tokens.prefix, this.tokens.base, this.tokens.postfix]\n .filter((t) => t)\n .map((t) => t.value)\n .join(\" \");\n return unescape(name);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n\n if (this.idlType === \"void\") {\n const message = `\\`void\\` is now replaced by \\`undefined\\`. Refer to the \\\n[relevant GitHub issue](https://github.com/heycam/webidl/issues/60) \\\nfor more information.`;\n yield validationError(this.tokens.base, this, \"replace-void\", message, {\n autofix: replaceVoid(this),\n });\n }\n\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 = this.union\n ? this\n : typedef && typedef.type === \"typedef\"\n ? 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(\n targetToken,\n this,\n \"no-nullable-union-dict\",\n message\n );\n }\n } else {\n // allow some dictionary\n for (const subtype of this.subtype) {\n yield* subtype.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n const type_body = () => {\n if (this.union || this.generic) {\n return w.ts.wrap([\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n ...this.subtype.map((t) => t.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n const firstToken = this.tokens.prefix || this.tokens.base;\n const prefix = this.tokens.prefix\n ? [this.tokens.prefix.value, w.ts.trivia(this.tokens.base.trivia)]\n : [];\n const ref = w.reference(\n w.ts.wrap([\n ...prefix,\n this.tokens.base.value,\n w.token(this.tokens.postfix),\n ]),\n { unescaped: this.idlType, context: this }\n );\n return w.ts.wrap([w.ts.trivia(firstToken.trivia), ref]);\n };\n return w.ts.wrap([\n this.extAttrs.write(w),\n type_body(),\n w.token(this.tokens.nullable),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Type} type\n */\nfunction replaceVoid(type) {\n return () => {\n type.tokens.base.value = \"undefined\";\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 =\n const_value(tokeniser) ||\n tokeniser.consumeType(\"string\") ||\n tokeniser.consume(\"null\", \"[\", \"{\") ||\n tokeniser.error(\"No value for default\");\n const expression = [def];\n if (def.value === \"[\") {\n const close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\"Default sequence value must be empty\");\n expression.push(close);\n } else if (def.value === \"{\") {\n const close =\n tokeniser.consume(\"}\") ||\n tokeniser.error(\"Default dictionary value must be empty\");\n expression.push(close);\n }\n return new Default({\n source: tokeniser.source,\n tokens: { assign },\n expression,\n });\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 /** @param {import(\"../writer.js\").Writer)} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.assign),\n ...this.expression.map((t) => w.token(t)),\n ]);\n }\n}\n","// @ts-check\n\nimport { Base } from \"./base.js\";\nimport { Default } from \"./default.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n getFirstToken,\n} from \"./helpers.js\";\nimport { argumentNameKeywords, Tokeniser } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport {\n idlTypeIncludesDictionary,\n dictionaryIncludesRequiredField,\n} 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(\n new Argument({ source: tokeniser.source, tokens })\n );\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 =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.consume(...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.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n const result = idlTypeIncludesDictionary(this.idlType, defs, {\n useNullableInner: true,\n });\n if (result) {\n if (this.idlType.nullable) {\n const message = `Dictionary arguments cannot be nullable.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nullable-dict-arg\",\n message\n );\n } else if (!this.optional) {\n if (\n this.parent &&\n !dictionaryIncludesRequiredField(result.dictionary, defs) &&\n isLastRequiredArgument(this)\n ) {\n const message = `Dictionary argument must be optional if it has no required fields`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-optional\",\n message,\n {\n autofix: autofixDictionaryArgumentOptionality(this),\n }\n );\n }\n } else if (!this.default) {\n const message = `Optional dictionary arguments must have a default value of \\`{}\\`.`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-default\",\n message,\n {\n autofix: autofixOptionalDictionaryDefaultValue(this),\n }\n );\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.optional),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.variadic),\n w.name_token(this.tokens.name, { data: this }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.separator),\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 = {\n type: \"optional\",\n value: \"optional\",\n trivia: firstToken.trivia,\n };\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 {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} 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(\n new Operation({ source: tokeniser.source, tokens })\n );\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 =\n return_type(tokeniser) || tokeniser.error(\"Missing return type\");\n tokens.name =\n tokeniser.consumeType(\"identifier\") || tokeniser.consume(\"includes\");\n tokens.open =\n tokeniser.consume(\"(\") || tokeniser.error(\"Invalid operation\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated operation\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 yield* this.extAttrs.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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n const body = this.idlType\n ? [\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n ]\n : [];\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n this.tokens.name\n ? w.token(this.tokens.special)\n : w.token(this.tokens.special, w.ts.nameless, { data: this, parent }),\n ...body,\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","// @ts-check\n\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Attribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.special]\n * @param {boolean} [options.noInherit]\n * @param {boolean} [options.readonly]\n */\n static parse(\n tokeniser,\n { special, noInherit = false, readonly = false } = {}\n ) {\n const start_position = tokeniser.position;\n const tokens = { special };\n const ret = autoParenter(\n new Attribute({ source: tokeniser.source, tokens })\n );\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 =\n type_with_extended_attributes(tokeniser, \"attribute-type\") ||\n tokeniser.error(\"Attribute lacks a type\");\n tokens.name =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.consume(\"async\", \"required\") ||\n tokeniser.error(\"Attribute lacks a name\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n\n switch (this.idlType.generic) {\n case \"sequence\":\n case \"record\": {\n const message = `Attributes cannot accept ${this.idlType.generic} types.`;\n yield validationError(\n this.tokens.name,\n this,\n \"attr-invalid-type\",\n message\n );\n break;\n }\n default: {\n const { reference } =\n idlTypeIncludesDictionary(this.idlType, defs) || {};\n if (reference) {\n const targetToken = (this.idlType.union ? reference : this.idlType)\n .tokens.base;\n const message = \"Attributes cannot accept dictionary types.\";\n yield validationError(\n targetToken,\n this,\n \"attr-invalid-type\",\n message\n );\n }\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.special),\n w.token(this.tokens.readonly),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Type } from \"./type.js\";\nimport { Argument } from \"./argument.js\";\nimport {\n ExtendedAttributes,\n SimpleExtendedAttribute,\n} 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 (\n tokeniser.consumeType(\"decimal\", \"integer\") ||\n tokeniser.consume(\"true\", \"false\", \"Infinity\", \"-Infinity\", \"NaN\")\n );\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 \"decimal\":\n case \"integer\":\n return { type: \"number\", value };\n case \"string\":\n return { type: \"string\", value: value.slice(1, -1) };\n }\n\n switch (value) {\n case \"true\":\n case \"false\":\n return { type: \"boolean\", value: value === \"true\" };\n case \"Infinity\":\n case \"-Infinity\":\n return { type: \"Infinity\", negative: value.startsWith(\"-\") };\n case \"[\":\n return { type: \"sequence\", value: [] };\n case \"{\":\n return { type: \"dictionary\" };\n default:\n return { type: value };\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(\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"octet\",\n \"undefined\"\n );\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, {\n parser: Argument.parse,\n listName: \"arguments list\",\n });\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({\n source: tokeniser.source,\n tokens: { base: voidToken },\n });\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 =\n 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(\n new Tokeniser(\"[Exposed=Window]\")\n );\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:\n /-?(?=[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: /\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\//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 = [\"ByteString\", \"DOMString\", \"USVString\"];\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 \"ObservableArray\",\n \"Promise\",\n \"bigint\",\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 \"undefined\",\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(\n token.value\n )} is a reserved identifier and must not be used.`;\n throw new WebIDLParseError(\n syntaxError(tokens, lastIndex, null, message)\n );\n } else if (nonRegexTerminals.includes(token.value)) {\n token.type = \"inline\";\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({\n type: \"inline\",\n value: punctuation,\n trivia,\n line,\n index,\n });\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(\n syntaxError(this.source, this.position, this.current, message)\n );\n }\n\n /**\n * @param {string} type\n */\n probeType(type) {\n return (\n this.source.length > this.position &&\n this.source[this.position].type === type\n );\n }\n\n /**\n * @param {string} value\n */\n probe(value) {\n return (\n this.probeType(\"inline\") && this.source[this.position].value === value\n );\n }\n\n /**\n * @param {...string} candidates\n */\n consumeType(...candidates) {\n for (const type of candidates) {\n if (!this.probeType(type)) continue;\n const token = this.source[this.position];\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {...string} candidates\n */\n consume(...candidates) {\n if (!this.probeType(\"inline\")) return;\n const token = this.source[this.position];\n for (const value of candidates) {\n if (token.value !== value) continue;\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({\n message,\n bareMessage,\n context,\n line,\n sourceName,\n input,\n tokens,\n }) {\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 { WrappedToken } from \"./token.js\";\nimport { Base } from \"./base.js\";\n\nclass EnumValue extends WrappedToken {\n /**\n * @param {import(\"../tokeniser\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeType(\"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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.wrap([\n w.ts.trivia(this.tokens.value.trivia),\n w.ts.definition(\n w.ts.wrap(['\"', w.ts.name(this.value, { data: this, parent }), '\"']),\n { data: this, parent }\n ),\n w.token(this.tokens.separator),\n ]);\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 =\n tokeniser.consumeType(\"identifier\") ||\n 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.probeType(\"string\")) {\n tokeniser.error(\"No comma between enum values\");\n }\n tokens.close =\n tokeniser.consume(\"}\") || tokeniser.error(\"Unexpected value in enum\");\n if (!ret.values.length) {\n tokeniser.error(\"No value in enum\");\n }\n tokens.termination =\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.open),\n w.ts.wrap(this.values.map((v) => v.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\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.consumeType(\"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 =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Incomplete includes statement\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.reference_token(this.tokens.target, this),\n w.token(this.tokens.includes),\n w.reference_token(this.tokens.mixin, this),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} 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 =\n type_with_extended_attributes(tokeniser, \"typedef-type\") ||\n tokeniser.error(\"Typedef lacks a type\");\n tokens.name =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Typedef lacks a name\");\n tokeniser.current = ret.this;\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} 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(\n new CallbackFunction({ source: tokeniser.source, tokens })\n );\n tokens.name =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Callback lacks a name\");\n tokeniser.current = ret.this;\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Callback lacks an assignment\");\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Callback lacks a return type\");\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"Callback lacks parentheses for arguments\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated callback\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.assign),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.open),\n ...this.arguments.map((arg) => arg.write(w)),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\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 =\n tokeniser.consumeType(\"identifier\") ||\n 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 =\n tokeniser.consumeType(\"identifier\") ||\n 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 =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const inheritance = () => {\n if (!this.tokens.inheritance) {\n return \"\";\n }\n return w.ts.wrap([\n w.token(this.tokens.colon),\n w.ts.trivia(this.tokens.inheritance.trivia),\n w.ts.inheritance(\n w.reference(this.tokens.inheritance.value, { context: this })\n ),\n ]);\n };\n\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.callback),\n w.token(this.tokens.partial),\n w.token(this.tokens.base),\n w.token(this.tokens.mixin),\n w.name_token(this.tokens.name, { data: this }),\n inheritance(),\n w.token(this.tokens.open),\n w.ts.wrap(this.members.map((m) => m.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { Type } from \"./type.js\";\nimport {\n const_data,\n const_value,\n primitive_type,\n autoParenter,\n unescape,\n} 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 =\n tokeniser.consumeType(\"identifier\") ||\n 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 =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Const lacks a name\");\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Const lacks value assignment\");\n tokens.value =\n const_value(tokeniser) || tokeniser.error(\"Const lacks a value\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.assign),\n w.token(this.tokens.value),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n autoParenter,\n argument_list,\n} 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(\n new IterableLike({ source: tokeniser.source, tokens })\n );\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (!tokens.readonly) {\n tokens.async = tokeniser.consume(\"async\");\n }\n tokens.base = tokens.readonly\n ? tokeniser.consume(\"maplike\", \"setlike\")\n : tokens.async\n ? 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\";\n const secondTypeAllowed = secondTypeRequired || type === \"iterable\";\n const argumentAllowed = ret.async && type === \"iterable\";\n\n tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`Missing less-than sign \\`<\\` in ${type} declaration`);\n const first =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(`Missing a type argument in ${type} declaration`);\n ret.idlType = [first];\n ret.arguments = [];\n\n if (secondTypeAllowed) {\n first.tokens.separator = tokeniser.consume(\",\");\n if (first.tokens.separator) {\n ret.idlType.push(type_with_extended_attributes(tokeniser));\n } else if (secondTypeRequired) {\n tokeniser.error(`Missing second type argument in ${type} declaration`);\n }\n }\n\n tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing greater-than sign \\`>\\` in ${type} declaration`);\n\n if (tokeniser.probe(\"(\")) {\n if (argumentAllowed) {\n tokens.argsOpen = tokeniser.consume(\"(\");\n ret.arguments.push(...argument_list(tokeniser));\n tokens.argsClose =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unterminated async iterable argument list\");\n } else {\n tokeniser.error(`Arguments are only allowed for \\`async iterable\\``);\n }\n }\n\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 *validate(defs) {\n for (const type of this.idlType) {\n yield* type.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.readonly),\n w.token(this.tokens.async),\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n w.ts.wrap(this.idlType.map((t) => t.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.argsOpen),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.argsClose),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent: this.parent }\n );\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 =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"No argument list in constructor\");\n const args = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated constructor\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base, w.ts.nameless, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\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 {\n stringifier,\n autofixAddExposedWindow,\n getMemberIndentation,\n getLastIndentation,\n getFirstToken,\n findLastIndex,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\nimport { checkInterfaceMemberDuplication } from \"../validators/interface.js\";\nimport { Constructor } from \"./constructor.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.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 =\n 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(\n tokeniser,\n new Interface({ source: tokeniser.source, tokens }),\n {\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\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 ) {\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(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n const oldConstructors = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"Constructor\"\n );\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(\n constructor.tokens.name,\n this,\n \"constructor-member\",\n message,\n {\n autofix: autofixConstructor(this, constructor),\n }\n );\n }\n\n const isGlobal = this.extAttrs.some((extAttr) => extAttr.name === \"Global\");\n if (isGlobal) {\n const factoryFunctions = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"LegacyFactoryFunction\"\n );\n for (const named of factoryFunctions) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have factory functions.`;\n yield validationError(\n named.tokens.name,\n this,\n \"no-constructible-global\",\n message\n );\n }\n\n const constructors = this.members.filter(\n (member) => member.type === \"constructor\"\n );\n for (const named of constructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have constructors.`;\n yield validationError(\n named.tokens.base,\n this,\n \"no-constructible-global\",\n message\n );\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(\n interfaceDef.extAttrs.tokens.open.trivia\n );\n const memberIndent = interfaceDef.members.length\n ? getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia)\n : getMemberIndentation(indentation);\n const constructorOp = Constructor.parse(\n new Tokeniser(`\\n${memberIndent}constructor();`)\n );\n constructorOp.extAttrs = new ExtendedAttributes({});\n autoParenter(constructorOp).arguments = constructorExtAttr.arguments;\n\n const existingIndex = findLastIndex(\n interfaceDef.members,\n (m) => m.type === \"constructor\"\n );\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","// @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(\n addition.tokens.name,\n ext,\n \"no-cross-overload\",\n message\n );\n }\n }\n }\n\n function getOperations(i) {\n return i.members.filter(({ type }) => type === \"operation\");\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(\n tokeniser,\n new Mixin({ source: tokeniser.source, tokens }),\n {\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\n get type() {\n return \"interface mixin\";\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n} 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 =\n type_with_extended_attributes(tokeniser, \"dictionary-type\") ||\n tokeniser.error(\"Dictionary member lacks a type\");\n tokens.name =\n tokeniser.consumeType(\"identifier\") ||\n tokeniser.error(\"Dictionary member lacks a name\");\n ret.default = Default.parse(tokeniser);\n if (tokens.required && ret.default)\n tokeniser.error(\"Required member must not have a default\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n 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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.required),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\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(\n tokeniser,\n new Dictionary({ source: tokeniser.source, tokens }),\n {\n type: \"dictionary\",\n inheritable: !partial,\n allowedMembers: [[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\";\nimport { Constant } from \"./constant.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(\n tokeniser,\n new Namespace({ source: tokeniser.source, tokens }),\n {\n type: \"namespace\",\n allowedMembers: [\n [Attribute.parse, { noInherit: true, readonly: true }],\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"namespace\";\n }\n\n *validate(defs) {\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\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(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\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(\n tokeniser,\n new CallbackInterface({ source: tokeniser.source, tokens }),\n {\n type: \"callback interface\",\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"callback interface\";\n }\n}\n","import { 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 =\n 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 (\n Dictionary.parse(tokeniser, { partial }) ||\n interface_({ partial }) ||\n Namespace.parse(tokeniser, { partial }) ||\n error(\"Partial doesn't apply to anything\")\n );\n }\n\n function definition() {\n return (\n 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\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 = tokeniser.consumeType(\"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","function 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 class Writer {\n constructor(ts) {\n this.ts = Object.assign({}, templates, ts);\n }\n\n reference(raw, { unescaped, context }) {\n if (!unescaped) {\n unescaped = raw.startsWith(\"_\") ? raw.slice(1) : raw;\n }\n return this.ts.reference(raw, unescaped, context);\n }\n\n token(t, wrapper = noop, ...args) {\n if (!t) {\n return \"\";\n }\n const value = wrapper(t.value, ...args);\n return this.ts.wrap([this.ts.trivia(t.trivia), value]);\n }\n\n reference_token(t, context) {\n return this.token(t, this.reference.bind(this), { context });\n }\n\n name_token(t, arg) {\n return this.token(t, this.ts.name, arg);\n }\n\n identifier(id, context) {\n return this.ts.wrap([\n this.reference_token(id.tokens.value, context),\n this.token(id.tokens.separator),\n ]);\n }\n}\n\nexport function write(ast, { templates: ts = templates } = {}) {\n ts = Object.assign({}, templates, ts);\n\n const w = new Writer(ts);\n\n function dispatch(it) {\n if (it.type === \"eof\") {\n return ts.trivia(it.trivia);\n }\n return it.write(w);\n }\n return ts.wrap(ast.map(dispatch));\n}\n","import { 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 \"${\n unique.get(name).type\n }\" 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","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked - a markdown parser\n * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nvar defaults$5 = {exports: {}};\n\nfunction getDefaults$1() {\n return {\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartLists: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nfunction changeDefaults$1(newDefaults) {\n defaults$5.exports.defaults = newDefaults;\n}\n\ndefaults$5.exports = {\n defaults: getDefaults$1(),\n getDefaults: getDefaults$1,\n changeDefaults: changeDefaults$1\n};\n\n/**\n * Helpers\n */\n\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = /[&<>\"']/g;\nconst escapeTestNoEncode = /[<>\"']|&(?!#?\\w+;)/;\nconst escapeReplaceNoEncode = /[<>\"']|&(?!#?\\w+;)/g;\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$3(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\nfunction unescape$1(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, 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\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit$1(regex, opt) {\n regex = regex.source || regex;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\nfunction cleanUrl$1(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape$1(href))\n .replace(nonWordAndColonTest, '')\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\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\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 (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim$1(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest$1 = { exec: function noopTest() {} };\n\nfunction merge$2(obj) {\n let 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$1(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let 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 let 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$1(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - 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, l - suffLen);\n}\n\nfunction findClosingBracket$1(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; 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$1(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// copied from https://stackoverflow.com/a/5450113/806777\nfunction repeatString$1(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nvar helpers = {\n escape: escape$3,\n unescape: unescape$1,\n edit: edit$1,\n cleanUrl: cleanUrl$1,\n resolveUrl,\n noopTest: noopTest$1,\n merge: merge$2,\n splitCells: splitCells$1,\n rtrim: rtrim$1,\n findClosingBracket: findClosingBracket$1,\n checkSanitizeDeprecation: checkSanitizeDeprecation$1,\n repeatString: repeatString$1\n};\n\nconst { defaults: defaults$4 } = defaults$5.exports;\nconst {\n rtrim,\n splitCells,\n escape: escape$2,\n findClosingBracket\n} = helpers;\n\nfunction outputLink(cap, link, raw) {\n const href = link.href;\n const title = link.title ? escape$2(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n return {\n type: 'link',\n raw,\n href,\n title,\n text\n };\n } else {\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$2(text)\n };\n }\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nvar Tokenizer_1 = class Tokenizer {\n constructor(options) {\n this.options = options || defaults$4;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap) {\n if (cap[0].length > 1) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n return { raw: '\\n' };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim() : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text: text\n };\n }\n }\n\n nptable(src) {\n const cap = this.rules.block.nptable.exec(src);\n if (cap) {\n const 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 raw: cap[0]\n };\n\n if (item.header.length === item.align.length) {\n let l = item.align.length;\n let i;\n for (i = 0; i < l; 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 l = item.cells.length;\n for (i = 0; i < l; i++) {\n item.cells[i] = splitCells(item.cells[i], item.header.length);\n }\n\n return item;\n }\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *> ?/gm, '');\n\n return {\n type: 'blockquote',\n raw: cap[0],\n text\n };\n }\n }\n\n list(src) {\n const cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw = cap[0];\n const bull = cap[2];\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw,\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n // Get each top-level item.\n const itemMatch = cap[0].match(this.rules.block.item);\n\n let next = false,\n item,\n space,\n bcurr,\n bnext,\n addBack,\n loose,\n istask,\n ischecked,\n endMatch;\n\n let l = itemMatch.length;\n bcurr = this.rules.block.listItemStart.exec(itemMatch[0]);\n for (let i = 0; i < l; i++) {\n item = itemMatch[i];\n raw = item;\n\n if (!this.options.pedantic) {\n // Determine if current item contains the end of the list\n endMatch = item.match(new RegExp('\\\\n\\\\s*\\\\n {0,' + (bcurr[0].length - 1) + '}\\\\S'));\n if (endMatch) {\n addBack = item.length - endMatch.index + itemMatch.slice(i + 1).join('\\n').length;\n list.raw = list.raw.substring(0, list.raw.length - addBack);\n\n item = item.substring(0, endMatch.index);\n raw = item;\n l = i + 1;\n }\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 bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]);\n if (\n !this.options.pedantic\n ? bnext[1].length >= bcurr[0].length || bnext[1].length > 3\n : bnext[1].length > bcurr[1].length\n ) {\n // nested list or continuation\n itemMatch.splice(i, 2, itemMatch[i] + (!this.options.pedantic && bnext[1].length < bcurr[0].length && !itemMatch[i].match(/\\n$/) ? '' : '\\n') + itemMatch[i + 1]);\n i--;\n l--;\n continue;\n } else if (\n // different bullet style\n !this.options.pedantic || this.options.smartLists\n ? bnext[2][bnext[2].length - 1] !== bull[bull.length - 1]\n : isordered === (bnext[2].length === 1)\n ) {\n addBack = itemMatch.slice(i + 1).join('\\n').length;\n list.raw = list.raw.substring(0, list.raw.length - addBack);\n i = l - 1;\n }\n bcurr = bnext;\n }\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 // trim item newlines at end\n item = rtrim(item, '\\n');\n if (i !== l - 1) {\n raw = raw + '\\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(raw);\n if (i !== l - 1) {\n next = raw.slice(-2) === '\\n\\n';\n if (!loose) loose = next;\n }\n\n if (loose) {\n list.loose = true;\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.test(item);\n ischecked = undefined;\n if (istask) {\n ischecked = item[1] !== ' ';\n item = item.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: istask,\n checked: ischecked,\n loose: loose,\n text: item\n });\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n return {\n type: this.options.sanitize\n ? 'paragraph'\n : 'html',\n raw: cap[0],\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$2(cap[0])) : cap[0]\n };\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href: cap[2],\n title: cap[3]\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const 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 item.raw = cap[0];\n\n let l = item.align.length;\n let i;\n for (i = 0; i < l; 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 l = item.cells.length;\n for (i = 0; i < l; i++) {\n item.cells[i] = splitCells(\n item.cells[i].replace(/^ *\\| *| *\\| *$/g, ''),\n item.header.length);\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1]\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n return {\n type: 'paragraph',\n raw: cap[0],\n text: cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1]\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0]\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$2(cap[1])\n };\n }\n }\n\n tag(src, inLink, inRawBlock) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!inLink && /^<a /i.test(cap[0])) {\n inLink = true;\n } else if (inLink && /^<\\/a>/i.test(cap[0])) {\n inLink = false;\n }\n if (!inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n inRawBlock = true;\n } else if (inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink,\n inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape$2(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + 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 }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0]);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link || !link.href) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0]);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n return {\n type: 'em',\n raw: src.slice(0, lLength + match.index + rLength + 1),\n text: src.slice(1, lLength + match.index + rLength)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n return {\n type: 'strong',\n raw: src.slice(0, lLength + match.index + rLength + 1),\n text: src.slice(2, lLength + match.index + rLength - 1)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$2(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2]\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$2(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape$2(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$2(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape$2(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + text;\n } else {\n href = text;\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, inRawBlock, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$2(cap[0])) : cap[0];\n } else {\n text = escape$2(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n};\n\nconst {\n noopTest,\n edit,\n merge: merge$1\n} = helpers;\n\n/**\n * Block-Level Grammar\n */\nconst block$1 = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?:\\n+|$)|$)/,\n hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3})(bull) [\\s\\S]+?(?:hr|def|\\n{2,}(?! )(?! {0,3}bull )\\n*|\\s*$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\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 *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *\\n? *<?([^\\s>]+)>?(?:(?: +\\n? *| *\\n *)(title))? *(?:\\n+|$)/,\n nptable: noopTest,\n table: noopTest,\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]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock$1._label = /(?!\\s*\\])(?:\\\\[\\[\\]]|[^\\[\\]])+/;\nblock$1._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock$1.def = edit(block$1.def)\n .replace('label', block$1._label)\n .replace('title', block$1._title)\n .getRegex();\n\nblock$1.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock$1.item = /^( *)(bull) ?[^\\n]*(?:\\n(?! *bull ?)[^\\n]*)*/;\nblock$1.item = edit(block$1.item, 'gm')\n .replace(/bull/g, block$1.bullet)\n .getRegex();\n\nblock$1.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block$1.bullet)\n .getRegex();\n\nblock$1.list = edit(block$1.list)\n .replace(/bull/g, block$1.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block$1.def.source + ')')\n .getRegex();\n\nblock$1._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$1._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock$1.html = edit(block$1.html, 'i')\n .replace('comment', block$1._comment)\n .replace('tag', block$1._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock$1.paragraph = edit(block$1._paragraph)\n .replace('hr', block$1.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,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock$1.blockquote = edit(block$1.blockquote)\n .replace('paragraph', block$1.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock$1.normal = merge$1({}, block$1);\n\n/**\n * GFM Block Grammar\n */\n\nblock$1.gfm = merge$1({}, block$1.normal, {\n nptable: '^ *([^|\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}([-:]+ *\\\\|[-| :]*)' // Align\n + '(?:\\\\n((?:(?!\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)', // Cells\n table: '^ *\\\\|(.+)\\\\n' // Header\n + ' {0,3}\\\\|?( *[-:]+[-| :]*)' // Align\n + '(?:\\\\n *((?:(?!\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n});\n\nblock$1.gfm.nptable = edit(block$1.gfm.nptable)\n .replace('hr', block$1.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock$1.gfm.table = edit(block$1.gfm.table)\n .replace('hr', block$1.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock$1.pedantic = merge$1({}, block$1.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$1._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 fences: noopTest, // fences not supported\n paragraph: edit(block$1.normal._paragraph)\n .replace('hr', block$1.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block$1.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Inline-Level Grammar\n */\nconst inline$1 = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\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 reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip other delimiter (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /\\_\\_[^_*]*?\\*[^_*]*?\\_\\_|[punct_](\\*+)(?=[\\s]|$)|[^punct*_\\s](\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|[^punct*_\\s](\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /\\*\\*[^_*]*?\\_[^_*]*?\\*\\*|[punct*](\\_+)(?=[\\s]|$)|[^punct*_\\s](\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline$1._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline$1.punctuation = edit(inline$1.punctuation).replace(/punctuation/g, inline$1._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline$1.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\ninline$1.escapedEmSt = /\\\\\\*|\\\\_/g;\n\ninline$1._comment = edit(block$1._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline$1.emStrong.lDelim = edit(inline$1.emStrong.lDelim)\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1.emStrong.rDelimAst = edit(inline$1.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1.emStrong.rDelimUnd = edit(inline$1.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline$1._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline$1._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$1.autolink = edit(inline$1.autolink)\n .replace('scheme', inline$1._scheme)\n .replace('email', inline$1._email)\n .getRegex();\n\ninline$1._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline$1.tag = edit(inline$1.tag)\n .replace('comment', inline$1._comment)\n .replace('attribute', inline$1._attribute)\n .getRegex();\n\ninline$1._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline$1._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline$1._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline$1.link = edit(inline$1.link)\n .replace('label', inline$1._label)\n .replace('href', inline$1._href)\n .replace('title', inline$1._title)\n .getRegex();\n\ninline$1.reflink = edit(inline$1.reflink)\n .replace('label', inline$1._label)\n .getRegex();\n\ninline$1.reflinkSearch = edit(inline$1.reflinkSearch, 'g')\n .replace('reflink', inline$1.reflink)\n .replace('nolink', inline$1.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline$1.normal = merge$1({}, inline$1);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline$1.pedantic = merge$1({}, inline$1.normal, {\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline$1._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline$1._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline$1.gfm = merge$1({}, inline$1.normal, {\n escape: edit(inline$1.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~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n});\n\ninline$1.gfm.url = edit(inline$1.gfm.url, 'i')\n .replace('email', inline$1.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline$1.breaks = merge$1({}, inline$1.gfm, {\n br: edit(inline$1.br).replace('{2,}', '*').getRegex(),\n text: edit(inline$1.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n});\n\nvar rules = {\n block: block$1,\n inline: inline$1\n};\n\nconst Tokenizer$1 = Tokenizer_1;\nconst { defaults: defaults$3 } = defaults$5.exports;\nconst { block, inline } = rules;\nconst { repeatString } = helpers;\n\n/**\n * smartypants text replacement\n */\nfunction smartypants(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 email addresses\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; 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 * Block Lexer\n */\nvar Lexer_1 = class Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults$3;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer$1();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n')\n .replace(/\\t/g, ' ');\n\n this.blockTokens(src, this.tokens, true);\n\n this.inline(this.tokens);\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = [], top = true) {\n if (this.options.pedantic) {\n src = src.replace(/^ +$/gm, '');\n }\n let token, i, l, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call(this, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.type) {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // table no leading pipe (gfm)\n if (token = this.tokenizer.nptable(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n token.tokens = this.blockTokens(token.text, [], top);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n l = token.items.length;\n for (i = 0; i < l; i++) {\n token.items[i].tokens = this.blockTokens(token.items[i].text, [], false);\n }\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (top && (token = this.tokenizer.def(src))) {\n src = src.substring(token.raw.length);\n if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call(this, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n\n inline(tokens) {\n let i,\n j,\n k,\n l2,\n row,\n token;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n switch (token.type) {\n case 'paragraph':\n case 'text':\n case 'heading': {\n token.tokens = [];\n this.inlineTokens(token.text, token.tokens);\n break;\n }\n case 'table': {\n token.tokens = {\n header: [],\n cells: []\n };\n\n // header\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n token.tokens.header[j] = [];\n this.inlineTokens(token.header[j], token.tokens.header[j]);\n }\n\n // cells\n l2 = token.cells.length;\n for (j = 0; j < l2; j++) {\n row = token.cells[j];\n token.tokens.cells[j] = [];\n for (k = 0; k < row.length; k++) {\n token.tokens.cells[j][k] = [];\n this.inlineTokens(row[k], token.tokens.cells[j][k]);\n }\n }\n\n break;\n }\n case 'blockquote': {\n this.inline(token.tokens);\n break;\n }\n case 'list': {\n l2 = token.items.length;\n for (j = 0; j < l2; j++) {\n this.inline(token.items[j].tokens);\n }\n break;\n }\n }\n }\n\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = [], inLink = false, inRawBlock = false) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call(this, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src, inLink, inRawBlock)) {\n src = src.substring(token.raw.length);\n inLink = token.inLink;\n inRawBlock = token.inRawBlock;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n if (token.type === 'link') {\n token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);\n }\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (token.type === 'link') {\n token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);\n tokens.push(token);\n } else if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call(this, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, inRawBlock, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n};\n\nconst { defaults: defaults$2 } = defaults$5.exports;\nconst {\n cleanUrl,\n escape: escape$1\n} = helpers;\n\n/**\n * Renderer\n */\nvar Renderer_1 = class Renderer {\n constructor(options) {\n this.options = options || defaults$2;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape$1(lang, true)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n\n blockquote(quote) {\n return '<blockquote>\\n' + quote + '</blockquote>\\n';\n }\n\n html(html) {\n return html;\n }\n\n heading(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\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n listitem(text) {\n return '<li>' + text + '</li>\\n';\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n paragraph(text) {\n return '<p>' + text + '</p>\\n';\n }\n\n table(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\n tablerow(content) {\n return '<tr>\\n' + content + '</tr>\\n';\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? '<' + type + ' align=\"' + flags.align + '\">'\n : '<' + type + '>';\n return tag + content + '</' + type + '>\\n';\n }\n\n // span level renderer\n strong(text) {\n return '<strong>' + text + '</strong>';\n }\n\n em(text) {\n return '<em>' + text + '</em>';\n }\n\n codespan(text) {\n return '<code>' + text + '</code>';\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n del(text) {\n return '<del>' + text + '</del>';\n }\n\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + escape$1(href) + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = '<img src=\"' + href + '\" alt=\"' + text + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n};\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\n\nvar TextRenderer_1 = class TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n};\n\n/**\n * Slugger generates header id\n */\n\nvar Slugger_1 = class Slugger {\n constructor() {\n this.seen = {};\n }\n\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} options\n * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n};\n\nconst Renderer$1 = Renderer_1;\nconst TextRenderer$1 = TextRenderer_1;\nconst Slugger$1 = Slugger_1;\nconst { defaults: defaults$1 } = defaults$5.exports;\nconst {\n unescape\n} = helpers;\n\n/**\n * Parsing & Compiling\n */\nvar Parser_1 = class Parser {\n constructor(options) {\n this.options = options || defaults$1;\n this.options.renderer = this.options.renderer || new Renderer$1();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer$1();\n this.slugger = new Slugger$1();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call(this, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.tokens.header[j]),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.cells.length;\n for (j = 0; j < l2; j++) {\n row = token.tokens.cells[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k]),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'text') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call(this, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n};\n\nconst Lexer = Lexer_1;\nconst Parser = Parser_1;\nconst Tokenizer = Tokenizer_1;\nconst Renderer = Renderer_1;\nconst TextRenderer = TextRenderer_1;\nconst Slugger = Slugger_1;\nconst {\n merge,\n checkSanitizeDeprecation,\n escape\n} = helpers;\nconst {\n getDefaults,\n changeDefaults,\n defaults\n} = defaults$5.exports;\n\n/**\n * Marked\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 (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\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 (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n try {\n const tokens = Lexer.lex(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parse(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.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 changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const opts = merge({}, ...args);\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n let hasExtensions;\n\n args.forEach((pack) => {\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n hasExtensions = true;\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null;\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = (token) => {\n pack.walkTokens.call(this, token);\n if (walkTokens) {\n walkTokens(token);\n }\n };\n }\n\n if (hasExtensions) {\n opts.extensions = extensions;\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n for (const token of tokens) {\n callback(token);\n switch (token.type) {\n case 'table': {\n for (const cell of token.tokens.header) {\n marked.walkTokens(cell, callback);\n }\n for (const row of token.tokens.cells) {\n for (const cell of row) {\n marked.walkTokens(cell, callback);\n }\n }\n break;\n }\n case 'list': {\n marked.walkTokens(token.items, callback);\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n marked.walkTokens(token[childTokens], callback);\n });\n } else if (token.tokens) {\n marked.walkTokens(token.tokens, callback);\n }\n }\n }\n }\n};\n\n/**\n * Parse Inline\n */\nmarked.parseInline = function(src, opt) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked.parseInline(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked.parseInline(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n try {\n const tokens = Lexer.lexInline(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parseInline(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.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 * 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.Tokenizer = Tokenizer;\n\nmarked.Slugger = Slugger;\n\nmarked.parse = marked;\n\nvar marked_1 = marked;\n\nexport default marked_1;\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire (path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$1 = {exports: {}};\n\n/* global define */\n\n(function (module, exports) {\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}(pluralize$1));\n\nvar pluralize = pluralize$1.exports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";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 s=t.WeakMap,i={};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)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.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 c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+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,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=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)}).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,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):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,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.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:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=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(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[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||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var 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\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\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+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(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(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];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,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}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,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(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);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.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=l[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 c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^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),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.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(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.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},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(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($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;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++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(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&&!Ue.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,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));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)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(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}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\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 { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport _marked from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.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 html = hyperHTML;\n/** @type {import(\"marked\")} */\n// @ts-ignore\nexport const marked = _marked;\n/** @type {import(\"pluralize\")} */\n// @ts-ignore\nexport const pluralize = _pluralize;\n\n/** @type {import(\"sniffy-mimetype\")} */\n// @ts-ignore\nexport const MIMEType = _MIMEType;\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 { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\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\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\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) {\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\n/**\n * @param {Document} doc\n */\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} 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// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\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\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @param {string} lang\n */\nfunction resolveLanguageAlias(lang) {\n const aliases = {\n \"zh-hans\": \"zh\",\n \"zh-cn\": \"zh\",\n };\n return aliases[lang] || lang;\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = resolveLanguageAlias(lang.toLowerCase());\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-ignore\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = (data[lang] && data[lang][key]) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Formats a date to \"yyyy-mm-dd\".\n * @param {Date} date\n */\nexport function toShortIsoDate(date) {\n return ISODate.format(date);\n}\n\n/**\n * Given either a Date object or a date in `YYYY-MM-DD` format, return a\n * human-formatted date suitable for use in the specification.\n * @param {Date | string} [date]\n */\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\n/**\n * Given either a Date object or a date in `YYYY-MM-DD` format, return an ISO\n * formatted date suitable for use in a xsd:datetime item\n * @param {Date | string} date\n */\nexport function isoDate(date) {\n return (date instanceof Date ? date : new Date(date)).toISOString();\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\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/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\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\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\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 const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\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\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 = 24 * 60 * 60 * 1000) {\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.toISOString());\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// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * 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 (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || 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 return only whitespace-only nodes.\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 the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * 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\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\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 if (!linkForElem) result.push({ for: title, 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 * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\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 * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\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 /** @returns {Generator<string, never, never>} */\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\n/** @extends {Set<string>} */\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\n/**\n * @param {HTMLElement} node\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 => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\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\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n return strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n}\n","// @ts-check\nimport { expose } from \"./expose-modules.js\";\nimport { showError } from \"./utils.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 const msg = `Error when calling function ${cb.name}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\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\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 removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"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}\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 { html } 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\nexport function 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 prettify(cloneDoc);\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 = html`<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 = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n * This module also adds the legacy `document.respecIsReady` property for\n * backward compatibility. It is now an alias to `document.respec.ready`.\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { showWarning } from \"../core/utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", resolve, { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n\n let respecIsReadyWarningShown = false;\n Object.defineProperty(document, \"respecIsReady\", {\n get() {\n if (!respecIsReadyWarningShown) {\n const msg =\n \"`document.respecIsReady` is deprecated and will be removed in a future release.\";\n const hint = \"Use `document.respec.ready` instead.\";\n showWarning(msg, name, { hint });\n respecIsReadyWarningShown = true;\n }\n return document.respec.ready;\n },\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 { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\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 { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await 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\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\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 } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = 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 const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#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-save-button:link:focus {\n background: #193766;\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-error-list li > p:first-child,\n.respec-warning-list li > p:first-child {\n display: inline;\n}\n\n.respec-warning-list > li li,\n.respec-error-list > li li {\n margin: 0;\n list-style: disc;\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@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\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.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n`;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().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/**\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 { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\n/**\n * @param {string} text\n */\nexport function markdownToHtml(text) {\n const normalizedLeftPad = reindent(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 langPrefix: \"\",\n renderer: new Renderer(),\n });\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\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 * Re-structure DOM around elem whose markdown has been processed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem, elem.ownerDocument);\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}\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 = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\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 for (const processedElem of processMDSections(document.body)) {\n restructure(processedElem);\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 newBody = document.body.cloneNode(true);\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 workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\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.append(rsUI, fragment);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\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\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { joinAnd } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.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\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\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 = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\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 = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\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(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(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 ]);\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 /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec 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 respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\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 trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin ? ` <small>(Plugin: \"${err.plugin}\")</small>.` : \"\";\n const hint = err.hint ? ` ${err.hint}` : \"\";\n const elements = Array.isArray(err.elements)\n ? ` Occurred at: ${joinAnd(err.elements.map(generateMarkdownLink))}.`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n\n const text = `${err.message}${hint}${elements}${plugin}${details}`;\n return markdownToHtml(text);\n}\n\n/**\n * @param {Element} element\n * @param {number} i\n */\nfunction generateMarkdownLink(element, i) {\n return `[${i + 1}](#${element.id})`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/w3c/group.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/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/w3c/level.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/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/webidl.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/xref.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/webidl-index.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/dfn-index.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/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/dfn-panel.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 import(\"../src/core/web-monetization.js\"),\n /* Linters must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/check-internal-slots.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/wpt-tests-exist.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n import(\"../src/core/linter-rules/a11y.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.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 * @module w3c/group\n *\n * `group` is a shorthand configuration option for specifying `wg`, `wgId`,\n * `wgURI`, and `wgPatentURI` options.\n */\n\nimport {\n codedJoinAnd,\n docLink,\n fetchAndCache,\n showError,\n showWarning,\n} from \"../core/utils.js\";\n\nexport const name = \"w3c/group\";\n\nconst W3C_GROUPS_API = \"https://respec.org/w3c/groups/\";\nconst LEGACY_OPTIONS = [\"wg\", \"wgURI\", \"wgId\", \"wgPatentURI\", \"wgPatentPolicy\"];\n\nexport async function run(conf) {\n const usedLegacyOptions = LEGACY_OPTIONS.filter(opt => conf[opt]);\n\n if (!conf.group) {\n if (usedLegacyOptions.length) {\n const outdatedOptionsStr = codedJoinAnd(LEGACY_OPTIONS);\n const msg = `Configuration options ${outdatedOptionsStr} are deprecated.`;\n const hint = docLink`Please use the ${\"[group]\"} configuration option instead.`;\n showWarning(msg, name, { hint });\n }\n return;\n }\n\n if (usedLegacyOptions.length) {\n const outdatedOptionsStr = codedJoinAnd(usedLegacyOptions);\n const msg = docLink`Configuration options ${outdatedOptionsStr} are superseded by ${\"[group]\"} and will be overridden by ReSpec.`;\n const hint = docLink`Remove them from the document's ${\"[respecConfig]\"} to silence this warning.`;\n showWarning(msg, name, { hint });\n }\n\n const { group } = conf;\n const groupDetails = Array.isArray(group)\n ? await getMultipleGroupDetails(group)\n : await getGroupDetails(group);\n Object.assign(conf, groupDetails);\n}\n\n/** @param {string[]} groups */\nasync function getMultipleGroupDetails(groups) {\n const details = await Promise.all(groups.map(getGroupDetails));\n /** @type {{ [key in keyof GroupDetails]: GroupDetails[key][] }} */\n const result = {\n wg: [],\n wgId: [],\n wgURI: [],\n wgPatentURI: [],\n wgPatentPolicy: [],\n groupType: [],\n };\n for (const groupDetails of details.filter(o => o)) {\n for (const key of Object.keys(result)) {\n result[key].push(groupDetails[key]);\n }\n }\n return result;\n}\n\n/**\n * @param {string} group\n * @typedef {{ wgId: number, wg: string, wgURI: string, wgPatentURI: string, wgPatentPolicy: string, groupType: W3CGroupType }} GroupDetails\n * @returns {Promise<GroupDetails|undefined>}\n */\nasync function getGroupDetails(group) {\n let type = \"\";\n let shortname = group;\n if (group.includes(\"/\")) {\n [type, shortname] = group.split(\"/\", 2);\n }\n const url = new URL(`${shortname}/${type}`, W3C_GROUPS_API);\n const res = await fetchAndCache(url.href);\n if (res.ok) {\n const json = await res.json();\n const {\n id: wgId,\n name: wg,\n URI: wgURI,\n patentURI: wgPatentURI,\n patentPolicy: wgPatentPolicy,\n type: groupType,\n } = json;\n return { wg, wgId, wgURI, wgPatentURI, wgPatentPolicy, groupType };\n }\n\n const text = await res.text();\n const message = `Failed to fetch group details (HTTP: ${res.status}). ${text}`;\n const hint =\n res.status === 404\n ? docLink`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${\"[group]\"} configuration option.`\n : undefined;\n showError(message, name, { hint });\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.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\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n humanDate,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { lang as defaultLang } from \"../../core/l10n.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} 이전 `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 以前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` 直到 ${date} `;\n },\n },\n};\n\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nconst orcidIcon = () => html`<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\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n const l10n = localizationStrings[lang];\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n if (person.retiredDate) {\n const { retiredDate } = person;\n const time = html`<time datetime=\"${retiredDate}\"\n >${humanDate(retiredDate)}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\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 const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\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 return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData, humanDate, showWarning } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst name = \"w3c/templates/headers\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/legalcode\";\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\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n edited_in_place: \"edited in place\",\n this_version: \"This version:\",\n test_suite: \"Test suite:\",\n implementation_report: \"Implementation report:\",\n prev_editor_draft: \"Previous editor's draft:\",\n prev_version: \"Previous version:\",\n prev_recommendation: \"Previous Recommendation:\",\n latest_recommendation: \"Latest Recommendation:\",\n },\n ko: {\n author: \"저자:\",\n authors: \"저자:\",\n editor: \"편집자:\",\n editors: \"편집자:\",\n former_editor: \"이전 편집자:\",\n former_editors: \"이전 편집자:\",\n latest_editors_draft: \"최신 편집 초안:\",\n latest_published_version: \"최신 버전:\",\n this_version: \"현재 버전:\",\n },\n zh: {\n author: \"作者:\",\n authors: \"作者:\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n this_version: \"本版本:\",\n test_suite: \"测试套件:\",\n implementation_report: \"实现报告:\",\n prev_editor_draft: \"上一版编辑草稿:\",\n prev_version: \"上一版:\",\n prev_recommendation: \"上一版正式推荐标准:\",\n latest_recommendation: \"最新发布的正式推荐标准:\",\n },\n ja: {\n author: \"著者:\",\n authors: \"著者:\",\n editor: \"編者:\",\n editors: \"編者:\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n this_version: \"このバージョン:\",\n test_suite: \"テストスイート:\",\n implementation_report: \"実装レポート:\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n author: \"Autor:\",\n authors: \"Autores:\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n latest_editors_draft: \"Borrador de editor mas reciente:\",\n latest_published_version: \"Versión publicada mas reciente:\",\n this_version: \"Ésta versión:\",\n },\n de: {\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n former_editor: \"Frühere Mitwirkende:\",\n former_editors: \"Frühere Mitwirkende:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n this_version: \"Diese Fassung:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\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, options) => {\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${document.querySelector(\"h1#title\")}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.prependW3C ? \"W3C \" : \"\"}${conf.isCR\n ? `${conf.longStatus}`\n : `${conf.textStatus}`}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >${conf.modificationDate\n ? html`, ${l10n.edited_in_place}${\" \"}\n ${inPlaceModificationDate(conf.modificationDate)}`\n : \"\"}\n </h2>\n <dl>\n ${conf.isTagFinding || !conf.isNoTrack\n ? html`\n <dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>\n <dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>\n `\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>${l10n.test_suite}</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>${l10n.implementation_report}</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.isED && conf.prevED\n ? html`\n <dt>${l10n.prev_editor_draft}</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n ${conf.showPreviousVersion\n ? html`\n <dt>${l10n.prev_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>${l10n.prev_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `\n : html`\n <dt>${l10n.latest_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `}\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.errata\n ? html`<p>\n Please check the\n <a href=\"${conf.errata}\"><strong>errata</strong></a> for any errors or\n issues reported since publication.\n </p>`\n : \"\"}\n ${conf.isRec\n ? html`<p>\n See also\n <a\n href=\"${`https://www.w3.org/Translations/?technology=${conf.shortName}`}\"\n >\n <strong>translations</strong></a\n >.\n </p>`\n : \"\"}\n ${conf.alternateFormats\n ? html`<p>\n ${options.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n\n/**\n * @param {string} date document in-place edit date as YYYY-MM-DD\n * @returns {HTMLTimeElement}\n */\nfunction inPlaceModificationDate(date) {\n const modificationHumanDate = humanDate(new Date(date));\n return html`<time class=\"dt-modified\" datetime=\"${date}\"\n >${modificationHumanDate}</time\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`<a rel=\"license\" href=\"${url}\" class=\"${cssClass}\">${text}</a>`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.hasOwnProperty(\"overrideCopyright\")) {\n const msg = \"The `overrideCopyright` configuration option is deprecated.\";\n const hint =\n 'Please add a `<p class=\"copyright\">` element directly to your document instead';\n showWarning(msg, name, { hint });\n return html`${[conf.overrideCopyright]}`;\n }\n if (conf.isUnofficial && conf.licenseInfo) {\n return html`<p class=\"copyright\">\n This document is licensed under a\n ${linkLicense(conf.licenseInfo.name, conf.licenseInfo.url, \"subfoot\")}\n (${conf.licenseInfo.short}).\n </p>`;\n }\n return renderOfficialCopyright(conf);\n}\n\nfunction renderOfficialCopyright(conf) {\n return html`<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` ${[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\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 { html } from \"../../core/import-maps.js\";\nimport { l10n } from \"./headers.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nexport default (conf, options) => {\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n }\n\n const specTitleElem = document.querySelector(\"h1#title\");\n const specTitleElemClone = specTitleElem.cloneNode(true);\n\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${specTitleElem}\n ${conf.subtitle ? html`<h2 id=\"subtitle\">${conf.subtitle}</h2>` : \"\"}\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>${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>${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>${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.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 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.alternateFormats\n ? html`<p>\n ${options.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${existingCopyright\n ? existingCopyright\n : html`<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` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n the Contributors to the ${specTitleElemClone.childNodes}\n 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\n 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\n 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","// @ts-check\nimport { getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n sotd: \"Status of This Document\",\n },\n ko: {\n sotd: \"현재 문서의 상태\",\n },\n zh: {\n sotd: \"关于本文档\",\n },\n ja: {\n sotd: \"この文書の位置付け\",\n },\n nl: {\n sotd: \"Status van dit document\",\n },\n es: {\n sotd: \"Estado de este Document\",\n },\n de: {\n sotd: \"Status dieses Dokuments\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nexport default (conf, opts) => {\n return html`\n <h2>${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 `\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.isRec ? renderIsRec(conf) : renderNotRec(conf)}\n ${renderDeliverer(conf)}\n <p>\n This document is governed by the\n <a\n id=\"w3c_process_revision\"\n href=\"https://www.w3.org/2020/Process-20200915/\"\n >15 September 2020 W3C Process Document</a\n >.\n </p>\n ${conf.addPatentNote\n ? html`<p>${[conf.addPatentNote]}</p>`\n : \"\"}\n `}\n `}\n ${opts.additionalSections}\n `;\n};\n\nexport function renderPreview(conf) {\n const { prUrl, prNumber, edDraftURI } = conf;\n return html`<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 : \"\"}\n </summary>\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\nfunction renderIsUnofficial(opts) {\n const { additionalContent } = opts;\n return html`\n <p>\n This document is a 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 renderNotRec(conf) {\n let statusExplanation = \"\";\n let updatePolicy = html`This is a draft document and may be updated, replaced\n or obsoleted by other documents at any time. It is inappropriate to cite this\n document as other than work in progress.\n ${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"https://www.w3.org/2020/Process-20200915/#allow-new-features\"\n >new features</a\n >.`\n : \"\"}`;\n let reviewPolicy = \"\";\n if (conf.specStatus === \"CRD\") {\n statusExplanation =\n \"A Candidate Recommendation Draft integrates changes from the previous Candidate Recommendation that the Working Group intends to include in a subsequent Candidate Recommendation Snapshot.\";\n if (conf.pubMode === \"LS\") {\n updatePolicy =\n \"This document is maintained and updated at any time. Some parts of this document are work in progress. \";\n }\n } else if (conf.specStatus === \"CR\") {\n statusExplanation = html`A Candidate Recommendation Snapshot has received\n <a href=\"https://www.w3.org/2020/Process-20200915/#dfn-wide-review\"\n >wide review</a\n >\n and is intended to gather\n <a href=\"${conf.implementationReportURI}\">implementation experience</a>.`;\n updatePolicy = html`${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"https://www.w3.org/2020/Process-20200915/#allow-new-features\"\n >new features</a\n >.`\n : \"\"}`;\n if (conf.pubMode === \"LS\") {\n reviewPolicy = `Comments are welcome at any time but most especially before ${conf.humanCREnd}.`;\n } else {\n reviewPolicy = `This Candidate Recommendation is not expected to advance to Proposed Recommendation any earlier than ${conf.humanCREnd}.`;\n }\n } else if (conf.isPR) {\n reviewPolicy = html` The W3C Membership and other interested parties are\n invited to review the document and send comments through\n ${conf.humanPREnd}. Advisory Committee Representatives should consult\n their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended ${conf.humanCREnd}.`;\n } else if (conf.isPER) {\n reviewPolicy = html` W3C Advisory Committee Members are invited to send\n formal review comments on this Proposed Edited Recommendation to the W3C\n Team until ${conf.humanPEREnd}. Members of the Advisory Committee will\n find the appropriate review form for this document by consulting their\n list of current\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.`;\n }\n return html`<p>\n Publication as ${conf.anOrA} ${conf.textStatus} does not imply endorsement\n by the W3C Membership. ${statusExplanation}\n </p>\n ${updatePolicy ? html`<p>${updatePolicy}</p>` : \"\"}\n <p>${reviewPolicy}</p>`;\n}\n\nfunction renderIsRec({\n updateableRec,\n revisionTypes = [],\n humanRevisedRecEnd,\n}) {\n let reviewTarget = \"\";\n if (revisionTypes.includes(\"addition\")) {\n reviewTarget = \"additions\";\n }\n if (revisionTypes.includes(\"correction\") && !reviewTarget) {\n reviewTarget = \"corrections\";\n }\n return html`<p>\n A W3C Recommendation is a specification that, after extensive\n consensus-building, has received the endorsement of the W3C and its\n Members. W3C recommends the wide deployment of this specification as a\n standard for the Web.\n ${updateableRec\n ? html`Future updates to this Recommendation may incorporate\n <a\n href=\"https://www.w3.org/2020/Process-20200915/#allow-new-features\"\n >new features</a\n >.`\n : \"\"}\n </p>\n ${revisionTypes.includes(\"addition\")\n ? html`<p class=\"addition\">\n Proposed additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"correction\")\n ? html`<p class=\"correction\">\n Proposed corrections are marked in the document.\n </p>`\n : \"\"}\n ${reviewTarget\n ? html`<p>\n The W3C Membership and other interested parties are invited to review\n the proposed ${reviewTarget} and send comments through\n ${humanRevisedRecEnd}. Advisory Committee Representatives should\n consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\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 wgPatentPolicy,\n } = conf;\n\n const patentPolicyURL =\n wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/Consortium/Patent-Policy/\";\n\n const producers = !isIGNote\n ? html`\n This document was produced by ${multipleWGs ? \"groups\" : \"a group\"}\n operating under the\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >.\n `\n : \"\";\n const wontBeRec = recNotExpected\n ? `The ${\n multipleWGs ? \"groups do\" : \"group does\"\n } not expect this document to become a W3C Recommendation.`\n : \"\";\n return html`<p data-deliverer=\"${isNote || isIGNote ? wgId : null}\">\n ${producers} ${wontBeRec}\n ${!isNote && !isIGNote\n ? html`\n ${multipleWGs\n ? html` W3C maintains ${wgPatentHTML} `\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=\"${patentPolicyURL}#def-essential\">Essential Claim(s)</a>\n must disclose the information in accordance with\n <a href=\"${patentPolicyURL}#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\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\n const patentPolicyURL =\n conf.wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/Consortium/Patent-Policy/\";\n\n return html`<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, or\n 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 Member\n 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=\"${patentPolicyURL}#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\nfunction noteForTeamSubmission(conf, opts) {\n return html`\n ${renderPublicList(conf, opts)}\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\nexport function renderPublicList(conf, opts) {\n const { mailToWGPublicListWithSubject, mailToWGPublicListSubscription } =\n opts;\n const { wgPublicList, subjectPrefix } = conf;\n const archivesURL = `https://lists.w3.org/Archives/Public/${wgPublicList}/`;\n return html`<p>\n If you wish to make comments regarding this document, please send them to\n <a href=\"${mailToWGPublicListWithSubject}\">${wgPublicList}@w3.org</a>\n (<a href=\"${mailToWGPublicListSubscription}\">subscribe</a>,\n <a href=\"${archivesURL}\">archives</a>)${subjectPrefix\n ? html` with <code>${subjectPrefix}</code> at the start of your email's\n subject`\n : \"\"}.\n </p>`;\n}\n\nfunction linkToWorkingGroup(conf) {\n if (!conf.wg) {\n return;\n }\n let proposedChanges = null;\n if (conf.isRec && conf.revisionTypes && conf.revisionTypes.length) {\n if (conf.revisionTypes.includes(\"addition\")) {\n if (conf.revisionTypes.includes(\"correction\")) {\n proposedChanges = html`It includes\n <a href=\"https://www.w3.org/2020/Process-20200915/#proposed-changes\"\n >proposed changes</a\n >, introducing substantive changes and new features since the previous\n Recommentation.`;\n } else {\n proposedChanges = html`It includes\n <a href=\"https://www.w3.org/2020/Process-20200915/#proposed-addition\"\n >proposed additions</a\n >, introducing new features since the previous Recommentation.`;\n }\n } else if (conf.revisionTypes.includes(\"correction\")) {\n proposedChanges = html`It includes\n <a href=\"https://www.w3.org/2020/Process-20200915/#proposed-correction\"\n >proposed corrections</a\n >.`;\n }\n }\n return html`<p>\n This document was published by ${conf.wgHTML} as ${conf.anOrA}\n ${conf.longStatus}. ${proposedChanges}\n ${conf.notYetRec\n ? \"This document is intended to become a W3C Recommendation.\"\n : \"\"}\n </p>`;\n}\n\nexport function linkToCommunity(conf, opts) {\n if (!conf.github && !conf.wgPublicList) {\n return;\n }\n return html`<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 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` with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject`\n : \"\"}.\n `\n : \"\"}\n </p>`;\n}\n","// @ts-check\nimport {\n l10n,\n linkToCommunity,\n renderPreview,\n renderPublicList,\n} from \"./sotd.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\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.github && conf.wgPublicList ? renderPublicList(conf, opts) : \"\"}\n ${conf.github ? linkToCommunity(conf, opts) : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${opts.additionalSections}\n `;\n};\n","// @ts-check\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 specify 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// - 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 version of the specification.\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 {\n ISODate,\n codedJoinAnd,\n codedJoinOr,\n concatDate,\n docLink,\n htmlJoinAnd,\n showError,\n showWarning,\n} 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 { html } 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\n/**\n * Resolves against https://www.w3.org.\n * @param {string} href\n */\nfunction w3Url(href) {\n return new URL(href, \"https://www.w3.org/\").href;\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 publicationSpaces = {\n \"Member-SUBM\": \"/Submission\",\n \"Team-SUBM\": \"/TeamSubmission/\",\n finding: \"/2001/tag/doc\",\n \"draft-finding\": \"/2001/tag/doc\",\n};\n\nconst status2rdf = {\n NOTE: \"w3p:NOTE\",\n WD: \"w3p:WD\",\n LC: \"w3p:LastCall\",\n CR: \"w3p:CR\",\n CRD: \"w3p:CRD\",\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 CRD: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n PER: \"Proposed Edited Recommendation\",\n REC: \"Recommendation\",\n RSCND: \"Rescinded Recommendation\",\n unofficial: \"Unofficial Draft\",\n base: \"\",\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 CR: \"Candidate Recommendation Snapshot\",\n CRD: \"Candidate Recommendation Draft\",\n \"FPWD-NOTE\": \"First Public Working Group Note\",\n \"LC-NOTE\": \"Last Call Working Draft\",\n};\nexport const W3CNotes = [\"FPWD-NOTE\", \"WG-NOTE\"];\nexport const maybeRecTrack = [\"FPWD\", \"WD\"];\nexport const recTrackStatus = [\"FPLC\", \"LC\", \"CR\", \"CRD\", \"PR\", \"PER\", \"REC\"];\nexport const cgStatus = [\"CG-DRAFT\", \"CG-FINAL\"];\nexport const bgStatus = [\"BG-DRAFT\", \"BG-FINAL\"];\nexport const cgbgStatus = [...cgStatus, ...bgStatus];\nconst noTrackStatus = [\n \"base\",\n ...cgStatus,\n ...bgStatus,\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\nconst precededByAn = [\"ED\", \"IG-NOTE\"];\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"w3c-software\",\n {\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 ],\n [\n \"w3c-software-doc\",\n {\n name: \"W3C Software and Document Notice and License\",\n short: \"W3C Software and Document\",\n url: \"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\",\n },\n ],\n [\n \"cc-by\",\n {\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]);\n\nconst patentPolicies = [\"PP2017\", \"PP2020\"];\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 = docLink`${prop} is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = docLink`Missing required configuration: ${\"[specStatus]\"}.`;\n const hint = docLink`Please select an appropriate status from ${\"[specStatus]\"} based on your W3C group. If in doubt, use \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n }\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n if (conf.isUnofficial && !Array.isArray(conf.logos)) {\n conf.logos = [];\n }\n if (conf.isUnofficial) {\n if (conf.license && !licenses.has(conf.license)) {\n const msg = docLink`The ${\"[license]\"} configuration option has an invalid value: \"\\`${\n conf.license\n }\\`\". Defaulting to \"cc-by\".`;\n const hint = docLink`Please explicitly set ${\"[license]\"} to one of: ${codedJoinOr(\n [...licenses.keys()]\n )}.`;\n showError(msg, name, { hint });\n conf.license = \"cc-by\";\n }\n // default it to cc-by\n if (conf.license === undefined) {\n conf.license = \"cc-by\";\n }\n }\n\n conf.isCCBY = conf.license === \"cc-by\";\n conf.isW3CSoftAndDocLicense = conf.license === \"w3c-software-doc\";\n if (!conf.isUnofficial && [\"cc-by\"].includes(conf.license)) {\n const msg = docLink`License \"\\`${conf.license}\\`\" is not allowed for W3C Specifications.`;\n const hint = docLink`Please set ${\"[license]\"} to \"w3c-software-doc\" instead.`;\n showError(msg, name, { hint });\n }\n conf.licenseInfo = licenses.get(conf.license);\n conf.isCGBG = cgbgStatus.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\n if (conf.isRegular && !conf.shortName) {\n const msg = \"Missing required configuration: `shortName`\";\n showError(msg, name);\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 const wptLiveURL = `https://wpt.live/${conf.shortName}`;\n const hint = docLink`Please update your ${\"[testSuiteURI]\"} to point to the new tests repository (e.g., ${wptLiveURL}).`;\n showWarning(msg, name, { hint });\n }\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\n if (conf.isRecTrack && !hasGitHubIssuesLink(conf)) {\n const msg = docLink`Missing link to GitHub in head of document.`;\n const hint = docLink`Please add the ${\"[github]\"} configuration option to document's ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n if (!conf.edDraftURI) {\n conf.edDraftURI = \"\";\n if (conf.specStatus === \"ED\") {\n const msg = \"Editor's Drafts should set edDraftURI.\";\n showWarning(msg, name);\n }\n }\n const maturity = status2maturity[conf.specStatus] || conf.specStatus;\n const pubSpace = publicationSpaces[conf.specStatus] || \"/TR\";\n if (conf.isRegular) {\n const { shortName, publishDate } = conf;\n const year = conf.publishDate.getUTCFullYear();\n const date = concatDate(publishDate);\n const docVersion = `${maturity}-${shortName}-${date}`;\n conf.thisVersion = w3Url(`${pubSpace}/${year}/${docVersion}/`);\n }\n if (conf.specStatus === \"ED\") conf.thisVersion = conf.edDraftURI;\n\n const latestPath = `${pubSpace}/${conf.shortName}`;\n\n if (conf.latestVersion !== null) {\n conf.latestVersion = conf.latestVersion\n ? w3Url(`${conf.latestVersion}`)\n : w3Url(`${pubSpace}/${conf.shortName}/`);\n }\n\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n const msg = \"`previousPublishDate` is set, but not `previousMaturity`.\";\n showError(msg, name);\n }\n\n conf.previousPublishDate = validateDateAndRecover(\n conf,\n \"previousPublishDate\"\n );\n\n const prevMaturity =\n status2maturity[conf.previousMaturity] ?? conf.previousMaturity;\n if (conf.isTagFinding && conf.latestVersion) {\n const pubDate = ISODate.format(conf.publishDate);\n conf.thisVersion = w3Url(`${latestPath}-${pubDate}`);\n const prevPubDate = ISODate.format(conf.previousPublishDate);\n conf.prevVersion = w3Url(`${latestPath}-${prevPubDate}}`);\n } else if (conf.isCGBG || conf.isBasic) {\n conf.prevVersion = conf.prevVersion || \"\";\n } else {\n const year = conf.previousPublishDate.getUTCFullYear();\n const { shortName } = conf;\n const date = concatDate(conf.previousPublishDate);\n conf.prevVersion = w3Url(\n `${pubSpace}/${year}/${prevMaturity}-${shortName}-${date}/`\n );\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 const msg =\n \"This document is on the W3C Recommendation Track, but is missing the required 'Previous Version' link.\";\n const hint = docLink`Add ${\"[previousMaturity]\"} and ${\"[previousPublishDate]\"} to the document's ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n if (!conf.prevVersion) conf.prevVersion = \"\";\n }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = w3Url(`${pubSpace}/${conf.prevRecShortname}`);\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\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 const msg = \"At least one editor is required.\";\n showError(msg, name);\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 const msg = \"All alternate formats must have a uri and a label.\";\n showError(msg, name);\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 const msg = \"Recommendations must have an errata link.\";\n const hint = docLink`Add an ${\"[errata]\"} URL to your ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n conf.prependW3C = !conf.isBasic && !conf.isUnofficial;\n conf.isED = conf.specStatus === \"ED\";\n conf.isCR = conf.specStatus === \"CR\" || conf.specStatus === \"CRD\";\n conf.isCRDraft = conf.specStatus === \"CRD\";\n conf.isPR = conf.specStatus === \"PR\";\n conf.isPER = conf.specStatus === \"PER\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = W3CNotes.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 validatePatentPolicies(conf);\n\n // configuration done - yay!\n\n const options = {\n get multipleAlternates() {\n return conf.alternateFormats && conf.alternateFormats.length > 1;\n },\n get alternatesHTML() {\n return (\n conf.alternateFormats &&\n htmlJoinAnd(\n // We need to pass a string here...\n conf.alternateFormats.map(({ label }) => label),\n (_, i) => {\n const alt = conf.alternateFormats[i];\n return html`<a\n rel=\"alternate\"\n href=\"${alt.uri}\"\n hreflang=\"${alt?.lang ?? null}\"\n type=\"${alt?.type ?? null}\"\n >${alt.label}</a\n >`;\n }\n )\n );\n },\n };\n\n // insert into document\n const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf, options);\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 const msg =\n \"A Status of This Document must include at least on custom paragraph.\";\n const hint =\n \"Add a `<p>` in the 'sotd' section that reflects the status of this specification.\";\n showError(msg, name, { elements: [sotd], hint });\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 const msg = docLink`If one of ${\"[wg]\"}, ${\"[wgURI]\"}, or ${\"[wgPatentURI]\"} is an array, they all have to be.`;\n const hint = docLink`Use the ${\"[group]\"} option with an array instead.`;\n showError(msg, name, { hint });\n }\n if (conf.isCGBG && !conf.wg) {\n const msg = docLink`${\"[wg]\"} configuration option is required for this kind of document.`;\n showError(msg, name);\n }\n if (Array.isArray(conf.wg)) {\n conf.multipleWGs = conf.wg.length > 1;\n conf.wgHTML = htmlJoinAnd(conf.wg, (wg, idx) => {\n return html`the <a href=\"${conf.wgURI[idx]}\">${wg}</a>`;\n });\n\n conf.wgPatentHTML = htmlJoinAnd(conf.wg, (wg, i) => {\n return html`a\n <a href=\"${conf.wgPatentURI[i]}\" rel=\"disclosure\"\n >public list of any patent disclosures (${wg})</a\n >`;\n });\n } else {\n conf.multipleWGs = false;\n if (conf.wg) {\n conf.wgHTML = html`the <a href=\"${conf.wgURI}\">${conf.wg}</a>`;\n }\n }\n if (conf.specStatus === \"PR\" && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"} (needed to indicate end of previous CR).`;\n showError(msg, name);\n }\n\n if (conf.specStatus === \"CR\" && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"CR\", but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.crEnd = validateDateAndRecover(conf, \"crEnd\");\n conf.humanCREnd = W3CDate.format(conf.crEnd);\n\n if (conf.specStatus === \"PR\" && !conf.prEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[prEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.prEnd = validateDateAndRecover(conf, \"prEnd\");\n conf.humanPREnd = W3CDate.format(conf.prEnd);\n\n if (conf.specStatus === \"PER\" && !conf.perEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\", but no ${\"[prEnd]\"} is specified`;\n showError(msg, name);\n }\n conf.perEnd = validateDateAndRecover(conf, \"perEnd\");\n conf.humanPEREnd = W3CDate.format(conf.perEnd);\n\n if (conf.hasOwnProperty(\"updateableRec\")) {\n const msg = \"Configuration option `updateableRec` is deprecated.\";\n const hint = docLink`Add an ${\"[`updateable-rec`|#updateable-rec-class]\"} CSS class to the Status of This Document section instead.`;\n showWarning(msg, name, { hint });\n if (conf.updateableRec) {\n sotd.classList.add(\"updateable-rec\");\n }\n }\n\n conf.updateableRec = sotd.classList.contains(\"updateable-rec\");\n const revisionTypes = [\"addition\", \"correction\"];\n if (conf.specStatus === \"REC\" && conf.revisionTypes?.length > 0) {\n if (conf.revisionTypes.some(x => !revisionTypes.includes(x))) {\n const unknownRevisionTypes = conf.revisionTypes.filter(\n x => !revisionTypes.includes(x)\n );\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with unknown ${\"[revisionTypes]\"}: '${codedJoinOr(\n unknownRevisionTypes\n )}'.`;\n const hint = docLink`The valid values for ${\"[revisionTypes]\"} are: ${codedJoinOr(\n revisionTypes\n )}.`;\n showError(msg, name, { hint });\n }\n if (conf.revisionTypes.includes(\"addition\") && !conf.updateableRec) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed additions but the Recommendation is not marked as a allowing new features.`;\n showError(msg, name);\n }\n }\n\n if (\n conf.specStatus === \"REC\" &&\n conf.updateableRec &&\n conf.revisionTypes &&\n conf.revisionTypes.length > 0 &&\n !conf.revisedRecEnd\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed corrections or additions but no ${\"[revisedRecEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.revisedRecEnd = validateDateAndRecover(conf, \"revisedRecEnd\");\n conf.humanRevisedRecEnd = W3CDate.format(conf.revisedRecEnd);\n\n conf.recNotExpected =\n conf.noRecTrack || conf.recNotExpected\n ? true\n : !conf.isRecTrack && maturity == \"WD\" && conf.specStatus !== \"FPWD-NOTE\";\n if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) {\n const msg = docLink`Document configured as ${\"[noRecTrack]\"}, but its status (\"${\n conf.specStatus\n }\") puts it on the W3C Rec Track.`;\n const notAllowed = codedJoinOr(recTrackStatus, { quotes: true });\n const hint = `Status **can't** be any of: ${notAllowed}.`;\n showError(msg, name, { hint });\n }\n if (conf.isIGNote && !conf.charterDisclosureURI) {\n const msg = docLink`IG-NOTEs must link to charter's disclosure section using ${\"[charterDisclosureURI]\"}.`;\n showError(msg, name);\n }\n if (!sotd.classList.contains(\"override\")) {\n html.bind(sotd)`${populateSoTD(conf, sotd)}`;\n }\n\n if (!conf.implementationReportURI && conf.isCR) {\n const msg = docLink`Missing ${\"[implementationReportURI]\"} configuration option in ${\"[respecConfig]\"}.`;\n const hint = docLink`CR documents must have an ${\"[implementationReportURI]\"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;\n showError(msg, name, { hint });\n }\n if (!conf.implementationReportURI && conf.isPR) {\n const msg = docLink`PR documents should include an ${\"[implementationReportURI]\"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;\n showWarning(msg, name);\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\nfunction validatePatentPolicies(conf) {\n if (!conf.wgPatentPolicy) return;\n const policies = new Set([].concat(conf.wgPatentPolicy));\n if (\n policies.size &&\n ![...policies].every(policy => patentPolicies.includes(policy))\n ) {\n const invalidPolicies = [...policies].filter(\n policy => !patentPolicies.includes(policy)\n );\n const msg = docLink`Invalid ${\"[wgPatentPolicy]\"} value(s): ${codedJoinAnd(\n invalidPolicies\n )}.`;\n const hint = `Please use one of: ${codedJoinOr(patentPolicies)}.`;\n showError(msg, name, { hint });\n }\n if (policies.size !== 1) {\n const msg =\n \"When collaborating across multiple groups, they must use the same patent policy.\";\n const hint = docLink`For ${\"[wgPatentPolicy]\"}, please check the patent policies of each group. The patent policies were: ${[\n ...policies,\n ].join(\", \")}.`;\n showError(msg, name, { hint });\n }\n // We take the first policy\n conf.wgPatentPolicy = [...policies][0];\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 const msg = docLink`ReSpec does not support automated SotD generation for TAG findings.`;\n const hint = `Please add the prerequisite content in the 'sotd' section.`;\n showWarning(msg, name, { hint });\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 {Node} node\n * @return {node is Element}\n */\nfunction isElement(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n\nfunction hasGitHubIssuesLink(conf) {\n return (\n conf.github ||\n (conf.otherLinks &&\n conf.otherLinks.find(linkGroup =>\n linkGroup.data.find(\n l =>\n l.href &&\n l.href.toString().match(/^https:\\/\\/github\\.com\\/.*\\/issues/)\n )\n ))\n );\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\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: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for W3C specs\n */\nexport const name = \"w3c/defaults\";\nimport {\n W3CNotes,\n bgStatus,\n cgStatus,\n cgbgStatus,\n maybeRecTrack,\n recTrackStatus,\n} from \"./headers.js\";\nimport { codedJoinOr, docLink, showError } from \"../core/utils.js\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst w3cLogo = {\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\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": true,\n \"wpt-tests-exist\": false,\n a11y: false,\n },\n doJsonLd: false,\n logos: [],\n xref: true,\n wgId: \"\",\n};\n\nexport function run(conf) {\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\n Object.assign(conf, {\n ...coreDefaults,\n ...w3cDefaults,\n ...conf,\n lint,\n });\n\n if (conf.specStatus !== \"unofficial\" && !conf.hasOwnProperty(\"license\")) {\n conf.license = \"w3c-software-doc\";\n }\n\n processLogos(conf);\n\n if (conf.groupType && conf.specStatus) {\n validateStatusForGroup(conf);\n }\n}\n\nfunction processLogos(conf) {\n const status = conf.specStatus ?? \"\";\n // Always include the W3C logo and license for W3C Recommendation track.\n // Excludes \"ED\" status\n if ([...maybeRecTrack, ...recTrackStatus, ...W3CNotes].includes(status)) {\n conf.logos?.unshift(w3cLogo);\n }\n\n // Special case for \"ED\" status...\n // Allow overriding the logos, otherwise include the w3c logo.\n if (status === \"ED\" && conf.logos?.length === 0) {\n conf.logos.push(w3cLogo);\n }\n}\n\nfunction validateStatusForGroup(conf) {\n const { specStatus, groupType } = conf;\n switch (groupType) {\n case \"cg\": {\n if (![...cgbgStatus, \"unofficial\"].includes(specStatus)) {\n const msg = docLink`W3C Community Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(cgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"CG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"CG-DRAFT\";\n }\n break;\n }\n case \"bg\": {\n if (![...bgStatus, \"unofficial\"].includes(specStatus)) {\n const msg = docLink`W3C Business Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(bgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"BG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"BG-DRAFT\";\n }\n break;\n }\n case \"wg\": {\n if (cgbgStatus.includes(specStatus)) {\n const msg = docLink`W3C Working Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const hint = docLink`Please see ${\"[specStatus]\"} for appropriate values for this type of group.`;\n showError(msg, name, { hint });\n }\n break;\n }\n }\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\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: #c63501;\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 column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\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`;\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 css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\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 {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { 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 /** @type ResourceHintOption[] */\n const opts = [\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 const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\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 msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\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 \"DRAFT-FINDING\":\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 { html } from \"../core/import-maps.js\";\nimport { l10n } from \"../core/l10n.js\";\nexport const name = \"w3c/l10n\";\nconst additions = {\n en: {\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. Other documents may supersede\n this document. A list of current W3C publications and the latest revision\n of this technical report can be found in the\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> at\n https://www.w3.org/TR/.`,\n },\n ko: {\n status_at_publication: html`이 부분은 현재 문서의 발행 당시 상태에 대해\n 기술합니다. 다른 문서가 이 문서를 대체할 수 있습니다. W3C 발행 문서의 최신\n 목록 및 테크니컬 리포트 최신판을 https://www.w3.org/TR/ 의\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> 에서\n 열람할 수 있습니다.`,\n },\n zh: {\n status_at_publication: html`本章节描述了本文档的发布状态。其它更新版本可能会覆盖本文档。W3C的文档列\n 表和最新版本可通过<a href=\"https://www.w3.org/TR/\">W3C技术报告</a\n >索引访问。`,\n },\n ja: {\n status_at_publication: html`この節には、公開時点でのこの文書の位置づけが記されている。他の文書によって置き換えられる可能性がある。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a>\n (https://www.w3.org/TR/)`,\n },\n es: {\n status_at_publication: html`Esta sección describe el estado del presente\n documento al momento de su publicación. El presente documento puede ser\n remplazado por otros. Una lista de las publicaciones actuales del W3C y la\n última revisión del presente informe técnico puede hallarse en\n http://www.w3.org/TR/\n <a href=\"https://www.w3.org/TR/\">el índice de informes técnicos</a> del\n W3C.`,\n },\n de: {\n status_at_publication: html`Dieser Abschnitt beschreibt den Status des\n Dokuments zum Zeitpunkt der Publikation. Neuere Dokumente können dieses\n Dokument obsolet machen. Eine Liste der aktuellen Publikatinen des W3C und\n die aktuellste Fassung dieser Spezifikation kann im\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> unter\n https://www.w3.org/TR/ abgerufen werden.`,\n },\n};\n\nObject.keys(additions).forEach(key => {\n if (!l10n[key]) l10n[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 { docLink, getIntlData, showError, showWarning } from \"../core/utils.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 showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\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 de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\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 = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. 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 =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\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 { markdownToHtml, restructure } from \"./markdown.js\";\nimport { runTransforms, showError } from \"./utils.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(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 removeIncludeAttributes(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}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"无标题\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n\n let documentTitle = norm(h1Elem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","/**\n * This module updates the title and shortName\n * of a spec when there is a valid level configuration.\n *\n * Levels should be integers >= 0.\n */\n\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"w3c/level\";\n\nconst localizationStrings = {\n en: {\n level: \"Level\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.hasOwnProperty(\"level\")) return;\n\n const h1Elem = document.querySelector(\"h1#title\");\n\n const level = parseInt(conf.level);\n if (!Number.isInteger(level) || level < 0) {\n const msg = `The \\`level\\` configuration option must be a number greater or equal to 0. It is currently set to \\`${level}\\``;\n const title = \"Invalid level config.\";\n showError(msg, name, { title, elements: [h1Elem] });\n return;\n }\n\n h1Elem.append(` ${l10n.level} ${level}`);\n document.title = `${document.title} ${l10n.level} ${level}`;\n conf.shortName = `${conf.shortName}-${level}`;\n conf.level = level;\n}\n","// @ts-check\n// Module w3c/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"w3c/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n ko: {\n abstract: \"요약\",\n },\n zh: {\n abstract: \"摘要\",\n },\n ja: {\n abstract: \"要約\",\n },\n nl: {\n abstract: \"Samenvatting\",\n },\n es: {\n abstract: \"Resumen\",\n },\n de: {\n abstract: \"Zusammenfassung\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = 'Document must have one element with `id=\"abstract\"`.';\n showError(msg, name);\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.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 { showError } 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 = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\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 { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\nconst methodRegex = /(\\w+)\\((.*)\\)$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\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 {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\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 {boolean} nullable\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 // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\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, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\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 const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\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, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\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 element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\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 = htmlJoinComma(args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${identifier}</code></a\n ><code>(${argsText})</code>`;\n return element;\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 element = html`\"<a\n data-link-type=\"idl\"\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 >\"`;\n return element;\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 element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"WebIDL\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\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, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"WebIDL\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\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 = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(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 { idb } from \"./import-maps.js\";\n\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 = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n const obj = { id, ...data[id] };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\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\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\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;\n\n/** @type {Promise<Conf['biblio']>} */\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 /** @type {Conf['biblio']} */\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 * @returns {Promise<BiblioData>}\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\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\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\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n const idbRefs = await getReferencesFromIdb(neededRefs);\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, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.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 ko: {\n 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 ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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 endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\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) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > h2\")) {\n refSection.prepend(html`<h2>${l10n.references}</h2>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\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 * @typedef {ReturnType<typeof toRefContent>} 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 showError(msg, name);\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/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\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 }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} ref\n */\nfunction showRef({ ref, refcontent }) {\n const refId = `bib-${ref.toLowerCase()}`;\n if (refcontent) {\n return html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>${{ html: stringifyReference(refcontent) }}</dd>\n `;\n } else {\n return html`\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\n/** @param {BiblioData|string} ref */\nfunction 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 showError(msg, name);\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 getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } 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/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\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 ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\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 }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a data-xref-type=\"${xrefType}\" data-xref-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${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 html`<a data-cite=\"${ref}\"></a>`;\n }\n return html`<a href=\"${ref}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\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\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\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 : html`<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 html`<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 = splitByFor(matched);\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 let type = \"dfn\";\n switch (true) {\n case /task\\s+source$/i.test(matched):\n type = \"task-source\";\n break;\n }\n return html`<a\n data-link-type=\"${type}\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<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 abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : 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 = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\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 continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module w3c/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"w3c/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\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 keywordInterpretation(keywords, plural) {\n return html`<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://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die Schlüsselwörter\" : \"Das Schlüsselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemäß\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter Berücksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groß geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\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 = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h2>${l10n.conformance}</h2>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"attribute\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"attribute\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\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) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\"attribute\", { requiresFor: false, validator: validateDOMName }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"an HTML attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"an HTML attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n\n // A definition that ends with \"task source\" is a \"task-source\"...\n case /\\b task source$/i.test(linkingText):\n type = \"task-source\";\n processAsTaskSource(dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\nfunction processAsTaskSource(dfn) {\n // Task sources are exported by default.\n if (!dfn.matches(\".no-export, [data-noexport]\")) {\n dfn.dataset.export = \"\";\n }\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\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 if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\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 if (dfn.dataset.localLt) {\n dfn.dataset.localLt.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","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\naside.example,\ndiv.example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example,\ndiv.example {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\naside.example div.example span.example-title {\n color: #999;\n}\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\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, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { 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 ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport 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 document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\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`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\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","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.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: 0.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 display: inline-block;\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 {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue Summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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 getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${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 (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\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 const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\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(createIssueSummaryEntry(l10n.issue, report, div.id));\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\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\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) {\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 ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : 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 html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue} ${report.number}`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\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(html`<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\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 if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/** @param {string} bgColorHex background color as a hex value without '#' */\nfunction textColorFromBgColor(bgColorHex) {\n return parseInt(bgColorHex, 16) > 0xffffff / 2 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\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 showError(msg, name);\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 { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </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/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, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\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 = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\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 = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h2>Best Practices Summary</h2>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\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 {\n addId,\n getIntlData,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } 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: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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 html`<h2>${l10n.list_of_figures}</h2>`,\n html`<ul class=\"tof\">\n ${tof}\n </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 const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\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, html`<span class=\"fig-title\"></span>`);\n caption.prepend(l10n.fig, html`<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 html`<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 { showError, 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 {{ type: string, arguments: any[] }} idlAst\n * @param {string} parent\n * @param {string} name\n */\nfunction getAlternativeNames(idlAst, parent, name) {\n const { type } = idlAst;\n const asQualifiedName = `${parent}.${name}`;\n switch (type) {\n case \"constructor\":\n case \"operation\": {\n // Allow linking to \"method()\", method(arg) and \"method\" name.\n const asMethodName = `${name}()`;\n const asFullyQualifiedName = `${asQualifiedName}()`;\n const asMethodWithArgs = generateMethodNamesWithArgs(\n name,\n idlAst.arguments\n );\n return {\n local: [asQualifiedName, asFullyQualifiedName, name],\n exportable: [asMethodName, ...asMethodWithArgs],\n };\n }\n case \"attribute\":\n return {\n local: [asQualifiedName],\n exportable: [name],\n };\n }\n}\n\n/**\n * Generates all possible permutations of a method name based\n * on what arguments they method accepts.\n\n * Required arguments are always present, and optional ones\n * are stacked one by one.\n *\n * For examples: foo(req1, req2), foo(req1, req2, opt1) and so on.\n *\n * @param {String} operationName\n * @param {*} argsAst\n */\nfunction generateMethodNamesWithArgs(operationName, argsAst) {\n const operationNames = [];\n if (argsAst.length === 0) {\n return operationNames;\n }\n const required = []; // required arguments\n const optional = []; // optional arguments, including variadic ones\n for (const { name, optional: isOptional, variadic } of argsAst) {\n if (isOptional || variadic) {\n optional.push(name);\n } else {\n required.push(name);\n }\n }\n const requiredArgs = required.join(\", \");\n const requiredOperation = `${operationName}(${requiredArgs})`;\n operationNames.push(requiredOperation);\n const optionalOps = optional.map((_, index) => {\n const args = [...required, ...optional.slice(0, index + 1)].join(\", \");\n const result = `${operationName}(${args})`;\n return result;\n });\n operationNames.push(...optionalOps);\n return operationNames;\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 {Record<\"local\" | \"exportable\", string[]>} names\n */\nfunction addAlternativeNames(dfn, names) {\n const { local, exportable } = names;\n const lt = dfn.dataset.lt ? new Set(dfn.dataset.lt.split(\"|\")) : new Set();\n for (const item of exportable) {\n lt.add(item);\n }\n // Fix any ill-placed ones - local ones don't belong here\n local.filter(item => lt.has(item)).forEach(item => lt.delete(item));\n dfn.dataset.lt = [...lt].join(\"|\");\n dfn.dataset.localLt = local.join(\"|\");\n registerDefinition(dfn, [...local, ...exportable]);\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {...string} names\n */\nfunction findNormalDfn(defn, parent, ...names) {\n const { type } = defn;\n for (const name of names) {\n let resolvedName =\n type === \"enum-value\" && name === \"\" ? \"the-empty-string\" : name;\n let dfns = getDfns(resolvedName, parent, name, 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 const alternativeDfns = definitionMap.get(resolvedName);\n if (alternativeDfns && alternativeDfns.size === 1) {\n dfns = [...alternativeDfns];\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 const title = \"Duplicate definition.\";\n showError(msg, name, { title, elements: dfns });\n }\n if (dfns.length) {\n return dfns[0];\n }\n }\n}\n\n/**\n * @param {HTMLElement} dfnElem\n * @param {*} idlAst\n * @param {string} parent\n * @param {string} name\n */\nexport function decorateDfn(dfnElem, idlAst, parent, name) {\n if (!dfnElem.id) {\n const lCaseParent = parent.toLowerCase();\n const middle = lCaseParent ? `${lCaseParent}-` : \"\";\n let last = name.toLowerCase().replace(/[()]/g, \"\").replace(/\\s/g, \"-\");\n if (last === \"\") {\n last = \"the-empty-string\";\n dfnElem.setAttribute(\"aria-label\", \"the empty string\");\n }\n dfnElem.id = `dom-${middle}${last}`;\n }\n dfnElem.dataset.idl = idlAst.type;\n dfnElem.dataset.title = dfnElem.textContent;\n dfnElem.dataset.dfnFor = parent;\n // Derive the data-type for dictionary members, interface attributes,\n // and methods\n switch (idlAst.type) {\n case \"operation\":\n case \"attribute\":\n case \"field\":\n dfnElem.dataset.type = getDataType(idlAst);\n break;\n }\n\n // Mark the definition as code.\n if (\n !dfnElem.querySelector(\"code\") &&\n !dfnElem.closest(\"code\") &&\n dfnElem.children\n ) {\n wrapInner(dfnElem, dfnElem.ownerDocument.createElement(\"code\"));\n }\n\n // Add data-lt and data-local-lt values and register them\n switch (idlAst.type) {\n case \"attribute\":\n case \"constructor\":\n case \"operation\":\n addAlternativeNames(dfnElem, getAlternativeNames(idlAst, parent, name));\n break;\n }\n\n return dfnElem;\n}\n\n/**\n * @param {string} name\n * @param {string} parent data-dfn-for\n * @param {string} originalName\n * @param {string} type\n */\nfunction getDfns(name, parent, originalName, type) {\n const foundDfns = definitionMap.get(name);\n if (!foundDfns || foundDfns.size === 0) {\n return [];\n }\n const dfnForArray = [...foundDfns];\n // Definitions that have a name and [data-dfn-for] that exactly match the\n // IDL entity:\n const dfns = dfnForArray.filter(dfn => {\n // This is explicitly marked as a concept, so we can't use it\n if (dfn.dataset.dfnType === \"dfn\") return false;\n\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 (idlType === undefined) return \"\";\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","// @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 */\nexport const name = \"core/webidl-clipboard\";\n\nfunction createButton() {\n const copyButton = document.createElement(\"button\");\n copyButton.innerHTML =\n '<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>';\n copyButton.title = \"Copy IDL to clipboard\";\n copyButton.classList.add(\"respec-button-copy-paste\", \"removeOnSave\");\n return copyButton;\n}\n\nconst copyButton = createButton();\n\n/**\n * Adds a HTML button that copies WebIDL to the clipboard.\n *\n * @param {HTMLSpanElement} idlHeader\n */\nexport function addCopyIDLButton(idlHeader) {\n // There may be multiple <span>s of IDL, so we take everything\n // apart from the idl header.\n const pre = idlHeader.closest(\"pre.idl\");\n const idl = pre.cloneNode(true);\n idl.querySelector(\".idlHeader\").remove();\n const { textContent: idlText } = idl;\n const button = copyButton.cloneNode(true);\n button.addEventListener(\"click\", () => {\n navigator.clipboard.writeText(idlText);\n });\n idlHeader.append(button);\n}\n","/* --- WEB IDL --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\npre.idl {\n padding: 1em;\n position: relative;\n}\n\npre.idl > code {\n color: black;\n}\n\n@media print {\n pre.idl {\n white-space: pre-wrap;\n }\n}\n\n.idlHeader {\n display: block;\n width: 150px;\n background: #8ccbf2;\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.idlHeader a.self-link {\n margin-left: 0.3cm;\n text-decoration: none;\n border-bottom: none;\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/*.idlParam*/\n\n.idlParamName,\n.idlDefaultValue {\n font-style: italic;\n}\n\n.extAttr {\n color: #666;\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`;\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 {\n addHashId,\n docLink,\n showError,\n showWarning,\n wrapInner,\n xmlEscape,\n} from \"./utils.js\";\nimport { decorateDfn, findDfn } from \"./dfn-finder.js\";\nimport { html, webidl2 } from \"./import-maps.js\";\nimport { addCopyIDLButton } from \"./webidl-clipboard.js\";\nimport css from \"../styles/webidl.css.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/webidl\";\nconst pluginName = name;\n\nconst operationNames = {};\nconst idlPartials = {};\n\nconst templates = {\n wrap(items) {\n return items\n .flat()\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 html`<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 ? html`<a data-xref-type=\"interface\" data-cite=\"WebIDL\">${keyword}</a>`\n : // Other keywords like sequence, maplike, etc...\n html`<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 html`<a data-xref-type=\"${type}\" data-cite=\"${cite}\" data-lt=\"${lt}\"\n >${wrapped}</a\n >`;\n },\n name(escaped, { data, parent }) {\n if (data.idlType && data.idlType.type === \"argument-type\") {\n return html`<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 \"operation\":\n case \"constructor\":\n return defineIdlName(escaped, data, parent);\n default:\n return escaped;\n }\n },\n type(contents) {\n return html`<span class=\"idlType\">${contents}</span>`;\n },\n inheritance(contents) {\n return html`<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 html`<span class=\"${className}\">${contents}</span>`;\n }\n const parentName = parent ? parent.name : \"\";\n const { name, idlId } = getNameAndId(data, parentName);\n return html`<span\n class=\"${className}\"\n id=\"${idlId}\"\n data-idl\n data-title=\"${name}\"\n >${contents}</span\n >`;\n },\n extendedAttribute(contents) {\n const result = html`<span class=\"extAttr\">${contents}</span>`;\n return result;\n },\n extendedAttributeReference(name) {\n return html`<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 if (!dfn.matches(\"[data-noexport]\")) dfn.dataset.export = \"\";\n dfn.dataset.dfnType = linkType;\n }\n decorateDfn(dfn, data, parentName, name);\n const href = `#${dfn.id}`;\n return html`<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\n const isDefaultJSON =\n data.type === \"operation\" &&\n data.name === \"toJSON\" &&\n data.extAttrs.some(({ name }) => name === \"Default\");\n if (isDefaultJSON) {\n return html`<a data-link-type=\"dfn\" data-lt=\"default toJSON steps\"\n >${escaped}</a\n >`;\n }\n if (!data.partial) {\n const dfn = html`<dfn data-export data-dfn-type=\"${linkType}\"\n >${escaped}</dfn\n >`;\n registerDefinition(dfn, [name]);\n decorateDfn(dfn, data, parentName, name);\n return dfn;\n }\n\n const unlinkedAnchor = html`<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\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}.`;\n const hint = docLink`See ${\"using `data-dfn-for`|#data-dfn-for\"} in ReSpec's documentation.`;\n showWarning(msg, pluginName, { elements: [unlinkedAnchor], hint });\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 // For getters, setters, etc. \"anonymous-getter\",\n const prefix = defn.special && defn.name === \"\" ? \"anonymous-\" : \"\";\n let idlId = getIdlId(prefix + 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 || defn.special;\n default:\n return defn.name || defn.type;\n }\n}\n\n/**\n * @param {Element} idlElement\n * @param {number} index\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 const msg = `Failed to parse WebIDL: ${e.bareMessage}.`;\n showError(msg, pluginName, {\n title: e.bareMessage,\n details: `<pre>${e.context}</pre>`,\n elements: [idlElement],\n });\n // Skip this <pre> and move on to the next one.\n return [];\n }\n // we add \"idl\" as the canonical match, so both \"webidl\" and \"idl\" work\n idlElement.classList.add(\"def\", \"idl\");\n const highlights = webidl2.write(parse, { templates });\n html.bind(idlElement)`${highlights}`;\n wrapInner(idlElement, document.createElement(\"code\"));\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 if (elem.localName === \"dfn\") {\n registerDefinition(elem, [title]);\n }\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 addIDLHeader(idlElement);\n return parse;\n}\n/**\n * Adds a \"WebIDL\" decorative header/permalink to a block of WebIDL.\n * @param {HTMLPreElement} pre\n */\nexport function addIDLHeader(pre) {\n addHashId(pre, \"webidl\");\n const header = html`<span class=\"idlHeader\"\n ><a class=\"self-link\" href=\"${`#${pre.id}`}\">WebIDL</a></span\n >`;\n pre.prepend(header);\n addCopyIDLButton(header);\n}\n\nexport async function run() {\n const idls = document.querySelectorAll(\"pre.idl, pre.webidl\");\n if (!idls.length) {\n return;\n }\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.querySelector(\"head link, head > *:last-child\").before(style);\n\n const astArray = [...idls].map(renderWebIDL);\n\n const validations = webidl2.validate(astArray);\n for (const validation of validations) {\n let details = `<pre>${xmlEscape(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 const msg = `WebIDL validation error: ${validation.bareMessage}`;\n showError(msg, pluginName, {\n details,\n elements: [idls[validation.sourceName]],\n title: validation.bareMessage,\n });\n }\n document.normalize();\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\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 }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\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 (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\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\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\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: THIS_SPEC, 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, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\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 ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnFor = \"\", dfnType = \"dfn\" } = dfn.dataset;\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\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 = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor = dfnFor === (oldDfn.dataset.dfnFor || \"\");\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n const type = \"idl\" in dfn.dataset || dfnType !== \"dfn\" ? \"idl\" : \"dfn\";\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(type, dfn);\n addId(dfn, \"dfn\", title);\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n const type = linkType === \"dfn\" ? \"dfn\" : \"idl\";\n return dfnsByType.get(type) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (linkFor && !titleToDfns.get(linkFor) && linkFor !== dfnFor) {\n noLocalMatch = true;\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 noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\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 !noLocalMatch;\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 || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\nimport { API_URL } from \"./xref.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 * @typedef {import('core/xref').XrefDatabase} XrefDatabase\n */\n\nconst STORE_NAME = \"xrefs\";\nconst VERSION_CHECK_WAIT = 5 * 60 * 1000; // 5 min\n\nasync function getIdbCache() {\n /** @type {XrefDatabase} */\n const db = await idb.openDB(\"xref\", 2, {\n upgrade(db) {\n [...db.objectStoreNames].forEach(s => db.deleteObjectStore(s));\n const store = db.createObjectStore(STORE_NAME, { keyPath: \"query.id\" });\n store.createIndex(\"byTerm\", \"query.term\", { unique: false });\n },\n });\n return db;\n}\n\n/** @param {RequestEntry[]} queries */\nexport async function resolveXrefCache(queries) {\n /** @type {Map<string, SearchResultEntry[]>} */\n const cachedData = new Map();\n\n const bustCache = await shouldBustCache();\n if (bustCache) {\n await clearXrefData();\n return cachedData;\n }\n\n const requiredKeySet = new Set(queries.map(query => query.id));\n try {\n const cache = await getIdbCache();\n let cursor = await cache.transaction(STORE_NAME).store.openCursor();\n while (cursor) {\n if (requiredKeySet.has(cursor.key)) {\n cachedData.set(cursor.key, cursor.value.result);\n }\n cursor = await cursor.continue();\n }\n } catch (err) {\n console.error(err);\n }\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 */\nasync function shouldBustCache() {\n const key = \"XREF:LAST_VERSION_CHECK\";\n const lastChecked = parseInt(localStorage.getItem(key), 10);\n const now = Date.now();\n\n if (!lastChecked) {\n localStorage.setItem(key, now.toString());\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 localStorage.setItem(key, now.toString());\n return parseInt(lastUpdated, 10) > lastChecked;\n}\n\n/**\n * @param {RequestEntry[]} queries\n * @param {Map<string, SearchResultEntry[]>} results\n */\nexport async function cacheXrefData(queries, results) {\n try {\n const cache = await getIdbCache();\n const tx = cache.transaction(STORE_NAME, \"readwrite\");\n for (const query of queries) {\n const result = results.get(query.id);\n tx.objectStore(STORE_NAME).add({ query, result });\n }\n await tx.done;\n } catch (e) {\n console.error(e);\n }\n}\n\nexport async function clearXrefData() {\n try {\n await getIdbCache().then(db => db.clear(STORE_NAME));\n } catch (e) {\n console.error(e);\n }\n}\n","// @ts-check\n/**\n * @module core/xref\n *\n * Automatically adds external references.\n *\n * Searches for the terms which do not have a local definition at xref API and\n * for each query, adds `data-cite` attributes to respective elements.\n * `core/data-cite` later converts these data-cite attributes to actual links.\n * https://github.com/w3c/respec/issues/1662\n */\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 docLink,\n joinAnd,\n joinOr,\n nonNormativeSelector,\n norm as normalize,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { possibleExternalLinks } from \"./link-to-dfn.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/xref\";\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 * @param {Object} conf respecConfig\n */\nexport async function run(conf) {\n if (!conf.xref) {\n return;\n }\n\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 const elems = possibleExternalLinks.concat(findExplicitExternalLinks());\n if (!elems.length) return;\n\n /** @type {RequestEntry[]} */\n const queryKeys = [];\n for (const elem of elems) {\n const entry = getRequestEntry(elem);\n entry.id = await objectHash(entry);\n queryKeys.push(entry);\n }\n\n const data = await getData(queryKeys, xref.url);\n addDataCiteToTerms(elems, queryKeys, data, conf);\n\n sub(\"beforesave\", cleanup);\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 \":is(a,dfn)[data-cite]:not([data-cite=''],[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\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 const msg = `Invalid value for \\`xref\\` configuration option. Received: \"${xref}\".`;\n showError(msg, name);\n }\n }\n return config;\n\n function invalidProfileError(profile) {\n const supportedProfiles = joinOr(Object.keys(profiles), s => `\"${s}\"`);\n const msg =\n `Invalid profile \"${profile}\" in \\`respecConfig.xref\\`. ` +\n `Please use one of the supported profiles: ${supportedProfiles}.`;\n showError(msg, name);\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 const specs = getSpecContext(elem);\n const types = getTypeContext(elem, isIDL);\n const forContext = getForContext(elem, isIDL);\n\n return {\n // Add an empty `id` to ensure the shape of object returned stays same when\n // actual `id` is added later (minor perf optimization, also makes\n // TypeScript happy).\n id: \"\",\n term,\n types,\n ...(specs.length && { specs }),\n ...(typeof forContext === \"string\" && { for: forContext }),\n };\n}\n\n/** @param {HTMLElement} elem */\nexport function 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 * Get spec context as a fallback chain, where each level (sub-array) represents\n * decreasing priority.\n * @param {HTMLElement} elem\n */\nfunction getSpecContext(elem) {\n /** @type {string[][]} */\n const specs = [];\n\n /** @type {HTMLElement} */\n let dataciteElem = elem.closest(\"[data-cite]\");\n\n // Traverse up towards the root element, adding levels of lower priority specs\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);\n }\n if (dataciteElem === elem) break;\n dataciteElem = dataciteElem.parentElement.closest(\"[data-cite]\");\n }\n\n // If element itself contains data-cite, we don't take inline context into\n // account. The inline bibref context has lowest priority, if available.\n if (dataciteElem !== 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 if (inlineRefs.length) {\n specs.push(inlineRefs);\n }\n }\n\n const uniqueSpecContext = dedupeSpecContext(specs);\n return uniqueSpecContext;\n}\n\n/**\n * If we already have a spec in a higher priority level (closer to element) of\n * fallback chain, skip it from low priority levels, to prevent duplication.\n * @param {string[][]} specs\n * */\nfunction dedupeSpecContext(specs) {\n /** @type {string[][]} */\n const unique = [];\n for (const level of specs) {\n const higherPriority = unique[unique.length - 1] || [];\n const uniqueSpecs = [...new Set(level)].filter(\n spec => !higherPriority.includes(spec)\n );\n unique.push(uniqueSpecs.sort());\n }\n return unique;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getForContext(elem, isIDL) {\n if (elem.dataset.xrefFor) {\n return normalize(elem.dataset.xrefFor);\n }\n\n if (isIDL) {\n /** @type {HTMLElement} */\n const dataXrefForElem = elem.closest(\"[data-xref-for]\");\n if (dataXrefForElem) {\n return normalize(dataXrefForElem.dataset.xrefFor);\n }\n }\n\n return null;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getTypeContext(elem, isIDL) {\n if (isIDL) {\n if (elem.dataset.xrefType) {\n return elem.dataset.xrefType.split(\"|\");\n }\n return [\"_IDL_\"];\n }\n\n return [\"_CONCEPT_\"];\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(uniqueQueryKeys, 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, specs = [] } = query;\n const { uri, shortname, spec, normative, type, for: forContext } = result;\n // if authored spec context had `result.spec`, use it instead of shortname\n const cite = specs.flat().includes(spec) ? spec : shortname;\n // we use this \"partial\" URL to resolve parts of urls...\n // but sometimes we get lucky and we get an absolute URL from xref\n // which we can then use in other places (e.g., data-cite.js)\n const url = new URL(uri, \"https://partial\");\n const { pathname: citePath } = url;\n const citeFrag = url.hash.slice(1);\n const dataset = { cite, citePath, citeFrag, type };\n if (forContext) dataset.linkFor = forContext[0];\n if (url.origin && url.origin !== \"https://partial\") {\n dataset.citeHref = url.href;\n }\n Object.assign(elem.dataset, dataset);\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 = `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n const title = \"Normative reference to non-normative term.\";\n showWarning(msg, name, { title, elements: [elem] });\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(\"specs\", specs.join(\",\"));\n return url.href;\n };\n\n const howToFix = (howToCiteURL, originalTerm) => {\n return docLink`\n [See search matches for \"${originalTerm}\"](${howToCiteURL}) or\n ${\"[Learn about this error|#error-term-not-found]\"}.`;\n };\n\n for (const { query, elems } of notFound.values()) {\n const specs = query.specs ? [...new Set(query.specs.flat())].sort() : [];\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query);\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const hint = howToFix(formUrl, originalTerm);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const msg = `Couldn't find \"**${originalTerm}**\"${forParent} in this document or other cited documents: ${specsString}.`;\n const title = \"No matching definition found.\";\n showError(msg, name, { title, elements: elems, hint });\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 = joinAnd(specs, s => `**[${s}]**`);\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const moreInfo = howToFix(formUrl, originalTerm);\n const hint = docLink`To fix, use the ${\"[data-cite]\"} attribute to pick the one you mean from the appropriate specification. ${moreInfo}.`;\n const msg = `The term \"**${originalTerm}**\"${forParent} is ambiguous because it's defined in ${specsString}.`;\n const title = \"Definition is ambiguous.\";\n showError(msg, name, { title, elements: elems, hint });\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\nfunction cleanup(doc) {\n const elems = doc.querySelectorAll(\n \"a[data-xref-for], a[data-xref-type], a[data-link-for]\"\n );\n const attrToRemove = [\"data-xref-for\", \"data-xref-type\", \"data-link-for\"];\n elems.forEach(el => {\n attrToRemove.forEach(attr => el.removeAttribute(attr));\n });\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, wrapInner } from \"./utils.js\";\nimport { addIDLHeader } from \"./webidl.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.idl:not(.exclude) > code\")\n ).filter(idl => !idl.closest(nonNormativeSelector));\n\n if (idlIndex.length === 0) {\n const text = \"This specification doesn't normatively 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\n // Add our own IDL header\n idlIndexSec.appendChild(pre);\n wrapInner(pre, document.createElement(\"code\"));\n addIDLHeader(pre);\n}\n","/*\n@module \"core/dfn-index\"\nExtends and overrides some styles from `base.css`.\n*/\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nul.index {\n columns: 30ch;\n column-gap: 1.5em;\n}\n\nul.index li {\n list-style: inherit;\n}\n\nul.index li span {\n color: inherit;\n cursor: pointer;\n white-space: normal;\n}\n\n#index-defined-here ul.index li {\n font-size: 0.9rem;\n}\n\nul.index code {\n color: inherit;\n}\n\n#index-defined-here .print-only {\n display: none;\n}\n\n@media print {\n #index-defined-here .print-only {\n display: initial;\n }\n}\n`;\n","// @ts-check\n/**\n * If a `<section id=\"index\">` exists, it is filled by a list of terms defined\n * (locally) by current document and a list of terms referenced (external) by\n * current document.\n */\n\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport css from \"../styles/dfn-index.css.js\";\nimport { getTermFromElement } from \"./xref.js\";\nimport { html } from \"./import-maps.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\nimport { sub } from \"./pubsubhub.js\";\nimport { toCiteDetails } from \"./data-cite.js\";\n\nexport const name = \"core/dfn-index\";\n\nconst localizationStrings = {\n en: {\n heading: \"Index\",\n headingExternal: \"Terms defined by reference\",\n headlingLocal: \"Terms defined by this specification\",\n dfnOf: \"definition of\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Terms of these _types_ are wrapped in `<code>`.\nconst CODE_TYPES = new Set([\n \"attribute\",\n \"callback\",\n \"dict-member\",\n \"dictionary\",\n \"element-attr\",\n \"element\",\n \"enum-value\",\n \"enum\",\n \"exception\",\n \"extended-attribute\",\n \"interface\",\n \"method\",\n \"typedef\",\n]);\n\n/**\n * @typedef {{ term: string, type: string, linkFor: string, elem: HTMLAnchorElement }} Entry\n */\n\nexport function run() {\n const index = document.querySelector(\"section#index\");\n if (!index) {\n return;\n }\n\n const styleEl = document.createElement(\"style\");\n styleEl.textContent = css;\n document.head.appendChild(styleEl);\n\n index.classList.add(\"appendix\");\n if (!index.querySelector(\"h2\")) {\n index.prepend(html`<h2>${l10n.heading}</h2>`);\n }\n\n const localTermIndex = html`<section id=\"index-defined-here\">\n <h3>${l10n.headlingLocal}</h3>\n ${createLocalTermIndex()}\n </section>`;\n index.append(localTermIndex);\n\n const externalTermIndex = html`<section id=\"index-defined-elsewhere\">\n <h3>${l10n.headingExternal}</h3>\n ${createExternalTermIndex()}\n </section>`;\n index.append(externalTermIndex);\n for (const el of externalTermIndex.querySelectorAll(\".index-term\")) {\n addId(el, \"index-term\");\n }\n\n // XXX: This event is used to overcome an edge case with core/structure,\n // related to a circular dependency in plugin run order. We want\n // core/structure to run after dfn-index so the #index can be listed in the\n // TOC, but we also want section numbers in dfn-index. So, we \"split\"\n // core/dfn-index in two parts, one that runs before core/structure (using\n // plugin order in profile) and the other (following) after section numbers\n // are generated in core/structure (this event).\n sub(\"toc\", appendSectionNumbers, { once: true });\n\n sub(\"beforesave\", cleanup);\n}\n\nfunction createLocalTermIndex() {\n const dataSortedByTerm = collectLocalTerms();\n return html`<ul class=\"index\">\n ${dataSortedByTerm.map(([term, dfns]) => renderLocalTerm(term, dfns))}\n </ul>`;\n}\n\nfunction collectLocalTerms() {\n /** @type {Map<string, HTMLElement[]>} */\n const data = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"dfn:not([data-cite])\");\n for (const elem of elems) {\n if (!elem.id) continue;\n const text = norm(elem.textContent);\n const elemsByTerm = data.get(text) || data.set(text, []).get(text);\n elemsByTerm.push(elem);\n }\n\n const dataSortedByTerm = [...data].sort(([a], [b]) =>\n a.slice(a.search(/\\w/)).localeCompare(b.slice(b.search(/\\w/)))\n );\n\n return dataSortedByTerm;\n}\n\n/**\n * @param {string} term\n * @param {HTMLElement[]} dfns\n * @returns {HTMLLIElement}\n */\nfunction renderLocalTerm(term, dfns) {\n const renderItem = (dfn, text, suffix) => {\n const href = `#${dfn.id}`;\n return html`<li data-id=${dfn.id}>\n <a class=\"index-term\" href=\"${href}\">${{ html: text }}</a> ${suffix\n ? { html: suffix }\n : \"\"}\n </li>`;\n };\n\n if (dfns.length === 1) {\n const dfn = dfns[0];\n const type = getLocalTermType(dfn);\n const text = getLocalTermText(dfn, type, term);\n const suffix = getLocalTermSuffix(dfn, type, term);\n return renderItem(dfn, text, suffix);\n }\n return html`<li>\n ${term}\n <ul>\n ${dfns.map(dfn => {\n const type = getLocalTermType(dfn);\n const text = getLocalTermSuffix(dfn, type, term) || l10n.dfnOf;\n return renderItem(dfn, text);\n })}\n </ul>\n </li>`;\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermType(dfn) {\n const ds = dfn.dataset;\n const type = ds.dfnType || ds.idl || ds.linkType || \"\";\n switch (type) {\n case \"\":\n case \"dfn\":\n return \"\";\n default:\n return type;\n }\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermParentContext(dfn) {\n /** @type {HTMLElement} */\n const dfnFor = dfn.closest(\"[data-dfn-for]:not([data-dfn-for=''])\");\n return dfnFor ? dfnFor.dataset.dfnFor : \"\";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} term\n */\nfunction getLocalTermText(dfn, type, term) {\n let text = term;\n if (type === \"enum-value\") {\n text = `\"${text}\"`;\n }\n if (CODE_TYPES.has(type) || dfn.dataset.idl || dfn.closest(\"code\")) {\n text = `<code>${text}</code>`;\n }\n return text;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} [term=\"\"]\n */\nfunction getLocalTermSuffix(dfn, type, term = \"\") {\n if (term.startsWith(\"[[\")) {\n const parent = getLocalTermParentContext(dfn);\n return `internal slot for <code>${parent}</code>`;\n }\n\n switch (type) {\n case \"dict-member\":\n case \"method\":\n case \"attribute\":\n case \"enum-value\": {\n const typeText =\n type === \"dict-member\" ? \"member\" : type.replace(\"-\", \" \");\n const parent = getLocalTermParentContext(dfn);\n return `${typeText} for <code>${parent}</code>`;\n }\n case \"interface\":\n case \"dictionary\":\n case \"enum\": {\n return type;\n }\n case \"constructor\": {\n const parent = getLocalTermParentContext(dfn);\n return `for <code>${parent}</code>`;\n }\n default:\n return \"\";\n }\n}\n\nfunction appendSectionNumbers() {\n const getSectionNumber = id => {\n const dfn = document.getElementById(id);\n const sectionNumberEl = dfn.closest(\"section\").querySelector(\".secno\");\n const secNum = `§${sectionNumberEl.textContent.trim()}`;\n return html`<span class=\"print-only\">${secNum}</span>`;\n };\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"#index-defined-here li[data-id]\");\n elems.forEach(el => el.append(getSectionNumber(el.dataset.id)));\n}\n\nfunction createExternalTermIndex() {\n const data = collectExternalTerms();\n const dataSortedBySpec = [...data.entries()].sort(([specA], [specB]) =>\n specA.localeCompare(specB)\n );\n return html`<ul class=\"index\">\n ${dataSortedBySpec.map(\n ([spec, entries]) => html`<li data-spec=\"${spec}\">\n ${renderInlineCitation(spec)} defines the following:\n <ul>\n ${entries\n .sort((a, b) => a.term.localeCompare(b.term))\n .map(renderExternalTermEntry)}\n </ul>\n </li>`\n )}\n </ul>`;\n}\n\nfunction collectExternalTerms() {\n /** @type {Set<string>} */\n const uniqueReferences = new Set();\n /** @type {Map<string, Entry[]>} spec => entry[] */\n const data = new Map();\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elements = document.querySelectorAll(`a[data-cite]`);\n for (const elem of elements) {\n if (!elem.dataset.cite) {\n continue;\n }\n const uniqueID = elem.href;\n if (uniqueReferences.has(uniqueID)) {\n continue;\n }\n\n const { type, linkFor } = elem.dataset;\n const term = getTermFromElement(elem);\n if (!term) {\n continue; // <a data-cite=\"SPEC\"></a>\n }\n const spec = toCiteDetails(elem).key.toUpperCase();\n\n const entriesBySpec = data.get(spec) || data.set(spec, []).get(spec);\n entriesBySpec.push({ term, type, linkFor, elem });\n uniqueReferences.add(uniqueID);\n }\n\n return data;\n}\n\n/**\n * @param {Entry} entry\n * @returns {HTMLLIElement}\n */\nfunction renderExternalTermEntry(entry) {\n const { elem } = entry;\n const text = getTermText(entry);\n const el = html`<li>\n <span class=\"index-term\" data-href=\"${elem.href}\">${{ html: text }}</span>\n </li>`;\n return el;\n}\n\n// Terms of these _types_ are suffixed with their type info.\nconst TYPED_TYPES = new Map([\n [\"attribute\", \"attribute\"],\n [\"element-attr\", \"attribute\"],\n [\"element\", \"element\"],\n [\"enum\", \"enum\"],\n [\"exception\", \"exception\"],\n [\"extended-attribute\", \"extended attribute\"],\n [\"interface\", \"interface\"],\n]);\n\n// These _terms_ have type suffix \"type\".\nconst TYPE_TERMS = new Set([\n // Following are primitive types as per WebIDL spec:\n \"boolean\",\n \"byte\",\n \"octet\",\n \"short\",\n \"unsigned short\",\n \"long\",\n \"unsigned long\",\n \"long long\",\n \"unsigned long long\",\n \"float\",\n \"unrestricted float\",\n \"double\",\n \"unrestricted double\",\n // Following are not primitive types, but aren't interfaces either.\n \"undefined\",\n \"any\",\n \"object\",\n \"symbol\",\n]);\n\n/** @param {Entry} entry */\nfunction getTermText(entry) {\n const { term, type, linkFor } = entry;\n let text = term;\n\n if (CODE_TYPES.has(type)) {\n if (type === \"extended-attribute\") {\n text = `[${text}]`;\n }\n text = `<code>${text}</code>`;\n }\n\n const typeSuffix = TYPE_TERMS.has(term) ? \"type\" : TYPED_TYPES.get(type);\n if (typeSuffix) {\n text += ` ${typeSuffix}`;\n }\n\n if (linkFor) {\n let linkForText = linkFor;\n if (!/\\s/.test(linkFor)) {\n // If linkFor is a single word, highlight it.\n linkForText = `<code>${linkForText}</code>`;\n }\n if (type === \"element-attr\") {\n linkForText += \" element\";\n }\n text += ` (for ${linkForText})`;\n }\n\n return text;\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n doc\n .querySelectorAll(\"#index-defined-elsewhere li[data-spec]\")\n .forEach(el => el.removeAttribute(\"data-spec\"));\n\n doc\n .querySelectorAll(\"#index-defined-here li[data-id]\")\n .forEach(el => el.removeAttribute(\"data-id\"));\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 { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.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 = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\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 const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\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 html(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// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n docLink,\n getIntlData,\n parents,\n renameElement,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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 = html`<ol class=\"toc\"></ol>`;\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 ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\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(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, 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 * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\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) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\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: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<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 && conf.tocIntroductory === false) {\n const msg = \"Configuration option `tocIntroductory` is deprecated.\";\n const hint = docLink`Use the ${\"[`notoc`|#notoc-class]\"} CSS class to remove a section from the Table of Contents.`;\n showWarning(msg, name, { hint });\n }\n\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\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 return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<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 = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } 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 ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\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(html`<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 { html } 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 // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n h.appendChild(html`\n <a href=\"${`#${id}`}\" class=\"self-link\" aria-label=\"§\"></a>\n `);\n }\n}\n","/* container for stats */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.caniuse-stats {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: baseline;\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[href] {\n white-space: nowrap;\n align-self: center;\n margin-left: 0.5em;\n}\n\n/* a browser version */\n.caniuse-cell {\n display: flex;\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 --supported: #2a8436;\n --no-support: #c44230;\n --no-support-alt: #b43b2b;\n --partial: #807301;\n --partial-alt: #746c00;\n\n color: #fff;\n background: repeating-linear-gradient(\n var(--caniuse-angle, 45deg),\n var(--caniuse-bg) 0,\n var(--caniuse-bg-alt) 1px,\n var(--caniuse-bg-alt) 0.4em,\n var(--caniuse-bg) calc(0.25em + 1px),\n var(--caniuse-bg) 0.75em\n );\n}\n\nli.caniuse-cell {\n margin-bottom: 1px;\n}\n\n.caniuse-cell:focus {\n outline: none;\n}\n\n/* supports */\n.caniuse-cell.y {\n background: var(--supported);\n}\n\n/* no support, disabled by default */\n.caniuse-cell.n,\n.caniuse-cell.d {\n --caniuse-angle: 45deg;\n --caniuse-bg: var(--no-support);\n --caniuse-bg-alt: var(--no-support-alt);\n}\n\n.caniuse-cell.d {\n --caniuse-angle: 180deg;\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.a,\n.caniuse-cell.x,\n.caniuse-cell.p {\n --caniuse-angle: 90deg;\n --caniuse-bg: var(--partial);\n --caniuse-bg-alt: var(--partial-alt);\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`;\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 { codedJoinAnd, docLink, showError, showWarning } from \"./utils.js\";\nimport { pub, sub } from \"./pubsubhub.js\";\nimport css from \"../styles/caniuse.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/caniuse\";\n\nconst API_URL = \"https://respec.org/caniuse/\";\n\nconst BROWSERS = new Set([\n \"and_chr\",\n \"and_ff\",\n \"and_uc\",\n \"android\",\n \"bb\",\n \"chrome\",\n \"edge\",\n \"firefox\",\n \"ie\",\n \"ios_saf\",\n \"op_mini\",\n \"op_mob\",\n \"opera\",\n \"safari\",\n \"samsung\",\n]);\n\nexport function prepare(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\n document.head.appendChild(html`<style class=\"removeOnSave\">\n ${css}\n </style>`);\n\n const apiUrl = options.apiURL || API_URL;\n // Initiate a fetch, but do not wait. Try to fill the cache early instead.\n conf.state[name] = {\n fetchPromise: fetchStats(apiUrl, options),\n };\n}\n\nexport async function run(conf) {\n const options = conf.caniuse;\n if (!options?.feature) return;\n\n const featureURL = new URL(options.feature, \"https://caniuse.com/\").href;\n\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = (async () => {\n try {\n const stats = await conf.state[name].fetchPromise;\n return html`${{ html: stats }}`;\n } catch (err) {\n const msg = `Couldn't find feature \"${options.feature}\" on caniuse.com.`;\n const hint = docLink`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${\"[caniuse]\"}`;\n showError(msg, name, { hint });\n console.error(err);\n return html`<a href=\"${featureURL}\">caniuse.com</a>`;\n }\n })();\n const definitionPair = html`<dt class=\"caniuse-title\">Browser support:</dt>\n <dd class=\"caniuse-stats\">\n ${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}\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 html.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 = codedJoinAnd(invalidBrowsers, { quotes: true });\n const msg = docLink`Invalid browser(s): (${names}) in the \\`browser\\` property of ${\"[caniuse]\"}.`;\n showWarning(msg, name);\n }\n }\n return caniuseConf;\n}\n\n/**\n * @param {string} apiURL\n * @typedef {Record<string, [string, string[]][]>} 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 searchParams.set(\"format\", \"html\");\n const url = `${apiURL}?${searchParams.toString()}`;\n const response = await fetch(url);\n if (!response.ok) {\n const { status, statusText } = response;\n throw new Error(`Failed to get caniuse data: (${status}) ${statusText}`);\n }\n const stats = await response.text();\n return stats;\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.mdn {\n font-size: 0.75em;\n position: absolute;\n right: 0.3em;\n min-width: 0;\n margin-top: 3em;\n}\n\n.mdn details {\n width: 100%;\n margin: 1px 0;\n position: relative;\n z-index: 10;\n box-sizing: border-box;\n padding: 0.4em;\n padding-top: 0;\n}\n\n.mdn details[open] {\n min-width: 25ch;\n max-width: 32ch;\n background: #fff;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n z-index: 11;\n margin-bottom: 0.4em;\n}\n\n.mdn summary {\n text-align: right;\n cursor: default;\n margin-right: -0.4em;\n}\n\n.mdn summary span {\n font-family: zillaslab, Palatino, \"Palatino Linotype\", serif;\n color: #fff;\n background-color: #000;\n display: inline-block;\n padding: 3px;\n}\n\n.mdn a {\n display: inline-block;\n word-break: break-all;\n}\n\n.mdn p {\n margin: 0;\n}\n\n.mdn .engines-all {\n color: #058b00;\n}\n.mdn .engines-some {\n color: #b00;\n}\n\n.mdn table {\n width: 100%;\n font-size: 0.9em;\n}\n\n.mdn td {\n border: none;\n}\n\n.mdn td:nth-child(2) {\n text-align: right;\n}\n\n.mdn .nosupportdata {\n font-style: italic;\n margin: 0;\n}\n\n.mdn tr::before {\n content: \"\";\n display: table-cell;\n width: 1.5em;\n height: 1.5em;\n background: no-repeat center center / contain;\n font-size: 0.75em;\n}\n\n.mdn .no,\n.mdn .unknown {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdn .no::before,\n.mdn .unknown::before {\n opacity: 0.5;\n}\n\n.mdn .chrome::before,\n.mdn .chrome_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://resources.whatwg.org/browser-logos/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/firefox.png);\n}\n\n.mdn .ie::before {\n background-image: url(https://resources.whatwg.org/browser-logos/ie.png);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari.png);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/android-webview.png);\n}\n`;\n","// @ts-check\nimport { fetchAndCache, getIntlData, showError } from \"./utils.js\";\nimport css from \"../styles/mdn-annotation.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/mdn-annotation\";\n\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:\n // https://github.com/mdn/browser-compat-data/blob/master/schemas/compat-data-schema.md#browser-identifiers.\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 localizationStrings = {\n en: {\n inAllEngines: \"This feature is in all major engines.\",\n inSomeEngines: \"This feature has limited support.\",\n },\n zh: {\n inAllEngines: \"所有主要引擎均支持此特性。\",\n inSomeEngines: \"此功能支持有限。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {HTMLElement} node\n */\nfunction insertMDNBox(node) {\n const targetAncestor = node.closest(\"section\");\n if (!targetAncestor) return;\n const { previousElementSibling: targetSibling } = 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 = html`<aside class=\"mdn\"></aside>`;\n targetAncestor.before(mdnBox);\n return mdnBox;\n}\n\n/**\n * @param {MdnEntry} mdnSpec\n * @returns {HTMLDetailsElement}\n */\nfunction attachMDNDetail(mdnSpec) {\n const { name, slug, summary, support, engines } = mdnSpec;\n const mdnSubPath = slug.slice(slug.indexOf(\"/\") + 1);\n const href = `${MDN_URL_BASE}${slug}`;\n const label = `Expand MDN details for ${name}`;\n const engineSupport = getEngineSupportIcons(engines);\n return html`<details>\n <summary aria-label=\"${label}\"><span>MDN</span>${engineSupport}</summary>\n <a title=\"${summary}\" href=\"${href}\">${mdnSubPath}</a>\n ${getEngineSupport(engines)}\n ${support\n ? buildBrowserSupportTable(support)\n : html`<p class=\"nosupportdata\">No support data.</p>`}\n </details>`;\n}\n\n/**\n * @param {MdnEntry['support']} support\n * @returns {HTMLTableElement}\n */\nfunction buildBrowserSupportTable(support) {\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {\"Yes\" | \"No\" | \"Unknown\"} yesNoUnknown\n * @param {string} version\n * @returns {HTMLTableRowElement}\n */\n function createRow(browserId, yesNoUnknown, version) {\n const displayStatus = yesNoUnknown === \"Unknown\" ? \"?\" : yesNoUnknown;\n const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`;\n return html`<tr class=\"${classList}\">\n <td>${MDN_BROWSERS[browserId]}</td>\n <td>${version ? version : displayStatus}</td>\n </tr>`;\n }\n\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {VersionDetails} versionData\n */\n function createRowFromBrowserData(browserId, versionData) {\n if (versionData.version_removed) {\n return createRow(browserId, \"No\", \"\");\n }\n const versionAdded = versionData.version_added;\n if (typeof versionAdded === \"boolean\") {\n return createRow(browserId, versionAdded ? \"Yes\" : \"No\", \"\");\n } else if (!versionAdded) {\n return createRow(browserId, \"Unknown\", \"\");\n } else {\n return createRow(browserId, \"Yes\", `${versionAdded}+`);\n }\n }\n\n return html`<table>\n ${Object.keys(MDN_BROWSERS).map(browserId => {\n return support[browserId]\n ? createRowFromBrowserData(browserId, support[browserId])\n : createRow(browserId, \"Unknown\", \"\");\n })}\n </table>`;\n}\n\nexport async function run(conf) {\n const mdnKey = getMdnKey(conf);\n if (!mdnKey) return;\n\n const mdnSpecJson = await getMdnData(mdnKey, conf.mdn);\n if (!mdnSpecJson) return;\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.append(style);\n\n for (const elem of findElements(mdnSpecJson)) {\n const mdnSpecArray = mdnSpecJson[elem.id];\n const mdnBox = insertMDNBox(elem);\n if (!mdnBox) continue;\n for (const spec of mdnSpecArray) {\n mdnBox.append(attachMDNDetail(spec));\n }\n }\n}\n\n/** @returns {string} */\nfunction getMdnKey(conf) {\n const { shortName, mdn } = conf;\n if (!mdn) return;\n if (typeof mdn === \"string\") return mdn;\n return mdn.key || shortName;\n}\n\n/**\n * @param {string} key MDN key\n * @param {object} mdnConf\n * @param {string} [mdnConf.specMapUrl]\n * @param {string} [mdnConf.baseJsonPath]\n * @param {number} [mdnConf.maxAge]\n *\n * @typedef {{ version_added: string|boolean|null, version_removed?: string }} VersionDetails\n * @typedef {Record<string | keyof MDN_BROWSERS, VersionDetails>} MdnSupportEntry\n * @typedef {{ name: string, title: string, slug: string, summary: string, support: MdnSupportEntry, engines: string[] }} MdnEntry\n * @typedef {Record<string, MdnEntry[]>} MdnData\n * @returns {Promise<MdnData|undefined>}\n */\nasync function getMdnData(key, mdnConf) {\n const { baseJsonPath = BASE_JSON_PATH, maxAge = 60 * 60 * 24 * 1000 } =\n mdnConf;\n const url = new URL(`${key}.json`, baseJsonPath).href;\n const res = await fetchAndCache(url, maxAge);\n if (res.status === 404) {\n const msg = `Could not find MDN data associated with key \"${key}\".`;\n const hint = \"Please add a valid key to `respecConfig.mdn`\";\n showError(msg, name, { hint });\n return;\n }\n return await res.json();\n}\n\n/**\n * Find elements that can have an annotation box attached.\n * @param {MdnData} data\n */\nfunction findElements(data) {\n /** @type {NodeListOf<HTMLElement>} */\n const elemsWithId = document.body.querySelectorAll(\"[id]:not(script)\");\n return [...elemsWithId].filter(({ id }) => Array.isArray(data[id]));\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLSpanElement}\n */\nfunction getEngineSupportIcons(engines) {\n if (engines.length === 3) {\n return html`<span title=\"${l10n.inAllEngines}\">✅</span>`;\n }\n if (engines.length < 2) {\n return html`<span title=\"${l10n.inSomeEngines}\">🚫</span>`;\n }\n return html`<span> </span>`;\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLParagraphElement|undefined}\n */\nfunction getEngineSupport(engines) {\n if (engines.length === 3) {\n return html`<p class=\"engines-all\">${l10n.inAllEngines}</p>`;\n }\n if (engines.length < 2) {\n return html`<p class=\"engines-some\">${l10n.inSomeEngines}</p>`;\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\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 get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\nfunction toDownloadLink(details) {\n const { id, href, fileName, title, type } = details;\n return html`<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}\n\nconst saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(toDownloadLink)}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n};\n\nconst supportsDownload = \"download\" in HTMLAnchorElement.prototype;\nlet button;\nif (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\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 const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"仕様検索\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"搜索 Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"🔎\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/xref/\";\n\nconst localizationStrings = {\n en: {\n title: \"Search definitions\",\n },\n ja: {\n title: \"定義検索\",\n },\n de: {\n title: \"Definitionen durchsuchen\",\n },\n zh: {\n title: \"搜索定义\",\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 onLoad = e => e.target.classList.add(\"ready\");\n const xrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=\"${onLoad}\"></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.title, xrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\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 = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\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://respec.org/docs'>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 ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\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 { resolveRef } from \"../core/biblio.js\";\nimport { showWarning } from \"../core/utils.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 const msg = `Canonical URI set to edDraft, but no edDraftURI is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n case \"TR\":\n if (trLatestUri) {\n conf.canonicalURI = trLatestUri;\n } else {\n const msg = `Canonical URI set to TR, but no shortName is set in configuration`;\n showWarning(msg, name);\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 const msg = `CanonicalURI is an invalid URL: ${err.message}`;\n showWarning(msg, name);\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: document.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","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\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","// @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\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\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 css from \"../styles/highlight.css.js\";\nimport { 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\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 document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\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://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${\"[testSuiteURI]\"} が見つかりません.`,\n tests: \"テスト\",\n test: \"テスト\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`本规范中包含测试,但在 ReSpec 配置中缺少 ${\"[testSuiteURI]\"}。`,\n tests: \"测试\",\n test: \"测试\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\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 = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${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 showError(l10n.missing_test_suite_uri, name);\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, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\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 const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\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 = [...elem.querySelectorAll(\":scope > 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 = [...dl.querySelectorAll(\":scope > 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 const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar: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`;\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 css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\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 = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === 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","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font: small Helvetica Neue, sans-serif, Droid Sans Fallback;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\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`;\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 css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\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","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\n\nexport const name = \"core/algorithms\";\n\nexport 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 = css;\n document.head.appendChild(style);\n }\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } 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 const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\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 const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\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 const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\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 const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // remove the figure's title\n const children = [...makeSafeCopy(figcaption).childNodes].filter(\n // @ts-ignore\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 const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\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 // @ts-ignore\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 // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\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 { html } from \"../import-maps.js\";\nimport { showError } 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 html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\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 && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<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: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\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","// @ts-check\n/**\n * This module adds a \"monetization\" meta-tag to enable web-monetization.\n *\n * The meta-tag is added only to \"live\" documents, and is removed from generated\n * static documents.\n */\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/web-monetization\";\n\nexport function run(conf) {\n if (conf.monetization === false) {\n return;\n }\n const { monetization } = conf;\n\n const { removeOnSave, paymentPointer } = canonicalizeConfig(monetization);\n\n const cssClass = removeOnSave ? \"removeOnSave\" : null;\n document.head.append(html`<meta\n name=\"monetization\"\n content=\"${paymentPointer}\"\n class=\"${cssClass}\"\n />`);\n}\n\n/**\n * @param {object|string} rawConfig\n * - {string} paymentPointer - The payment pointer to use.\n * - {boolean} removeOnSave - Whether to remove the meta tag when the document is saved.\n */\nfunction canonicalizeConfig(rawConfig) {\n const config = {\n paymentPointer: \"$respec.org\",\n removeOnSave: true,\n };\n switch (typeof rawConfig) {\n case \"string\":\n config.paymentPointer = rawConfig;\n break;\n case \"object\":\n if (rawConfig.paymentPointer) {\n config.paymentPointer = String(rawConfig.paymentPointer);\n }\n if (rawConfig.removeOnSave === false) {\n config.removeOnSave = false;\n }\n break;\n }\n return config;\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\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 showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"check-internal-slots\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-internal-slots\";\nexport const name = \"core/linter-rules/check-internal-slots\";\n\nconst localizationStrings = {\n en: {\n msg: \"Internal slots should be preceded by a '.'\",\n hint: \"Add a '.' between the elements mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"var+a\");\n const offendingElements = [...elems].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 showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\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 { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\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 { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst hasNoHeading = ({ firstElementChild: elem }) => {\n return elem === null || /^h[1-6]$/.test(elem.localName) === false;\n};\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [...document.querySelectorAll(\"section\")].filter(\n hasNoHeading\n );\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\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 { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"wpt-tests-exist\".\n * Warns about nonexistent web platform tests.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"wpt-tests-exist\";\nexport const name = \"core/linter-rules/wpt-tests-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"The following test could not be found in Web Platform Tests:\",\n hint: \"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const filesInWPT = await getFilesInWPT(conf.testSuiteURI, conf.githubAPI);\n if (!filesInWPT) {\n return;\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n for (const elem of testables) {\n elem.dataset.tests\n .split(/,/gm)\n .map(test => test.trim().split(\"#\")[0])\n .filter(test => test && !filesInWPT.has(test))\n .map(missingTest => {\n showWarning(`${l10n.msg} \\`${missingTest}\\`.`, name, {\n hint: l10n.hint,\n elements: [elem],\n });\n });\n }\n}\n\n/**\n * @param {string} testSuiteURI\n * @param {string} githubAPIBase\n */\nasync function getFilesInWPT(testSuiteURI, githubAPIBase) {\n let wptDirectory;\n try {\n const testSuiteURL = new URL(testSuiteURI);\n if (\n testSuiteURL.pathname.startsWith(\"/web-platform-tests/wpt/tree/master/\")\n ) {\n const re = /web-platform-tests\\/wpt\\/tree\\/master\\/(.+)/;\n wptDirectory = testSuiteURL.pathname.match(re)[1].replace(/\\//g, \"\");\n } else {\n wptDirectory = testSuiteURL.pathname.replace(/\\//g, \"\");\n }\n } catch (error) {\n const msg = \"Failed to parse WPT directory from testSuiteURI\";\n showWarning(msg, `linter/${name}`);\n console.error(error);\n return null;\n }\n\n const url = new URL(\"web-platform-tests/wpt/files\", `${githubAPIBase}/`);\n url.searchParams.set(\"path\", wptDirectory);\n\n const response = await fetch(url);\n if (!response.ok) {\n const error = await response.text();\n const msg =\n \"Failed to fetch files from WPT repository. \" +\n `Request failed with error: ${error} (${response.status})`;\n showWarning(msg, `linter/${name}`);\n return null;\n }\n /** @type {{ entries: string[] }} */\n const { entries } = await response.json();\n const files = entries.filter(entry => !entry.endsWith(\"/\"));\n return new Set(files);\n}\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 { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\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], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n","// @ts-check\n/**\n * Lints for accessibility issues using axe-core package.\n */\n\nimport { showError, showWarning } from \"../utils.js\";\n\nexport const name = \"core/linter-rules/a11y\";\n\nconst DISABLED_RULES = [\n \"color-contrast\", // too slow 🐢\n \"landmark-one-main\", // need to add a <main>, else it marks entire page as errored\n \"landmark-unique\",\n \"region\",\n];\n\nexport async function run(conf) {\n if (!conf.lint?.a11y && /** legacy */ !conf.a11y) {\n return;\n }\n const config = conf.lint?.a11y || /** legacy */ conf.a11y;\n\n const options = config === true ? {} : config;\n const violations = await getViolations(options);\n for (const violation of violations) {\n /**\n * We're grouping by failureSummary as it contains hints to fix the issue.\n * For example, with color-constrast rule, it tells about the present color\n * contrast and how to fix it. If we don't group, errors will be repetitive.\n * @type {Map<string, HTMLElement[]>}\n */\n const groupedBySummary = new Map();\n for (const node of violation.nodes) {\n const { failureSummary, element } = node;\n const elements =\n groupedBySummary.get(failureSummary) ||\n groupedBySummary.set(failureSummary, []).get(failureSummary);\n elements.push(element);\n }\n\n const { id, help, description, helpUrl } = violation;\n const title = `a11y/${id}: ${help}`;\n for (const [failureSummary, elements] of groupedBySummary) {\n const hints = formatHintsAsMarkdown(failureSummary);\n const details = `\\n\\n${description}.\\n\\n${hints}. ([Learn more](${helpUrl}))`;\n showWarning(title, name, { details, elements });\n }\n }\n}\n\n/**\n * @param {object} opts Options as described at https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter\n */\nasync function getViolations(opts) {\n const { rules, ...otherOptions } = opts;\n const options = {\n rules: {\n ...Object.fromEntries(DISABLED_RULES.map(id => [id, { enabled: false }])),\n ...rules,\n },\n ...otherOptions,\n elementRef: true,\n resultTypes: [\"violations\"],\n reporter: \"v1\", // v1 includes a `failureSummary`\n };\n\n let axe;\n try {\n axe = await importAxe();\n } catch (error) {\n const msg = \"Failed to load a11y linter.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n\n try {\n const result = await axe.run(document, options);\n return result.violations;\n } catch (error) {\n const msg = \"Error while looking for a11y issues.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n}\n\n/** @returns {Promise<typeof window.axe>} */\nfunction importAxe() {\n const script = document.createElement(\"script\");\n script.classList.add(\"remove\");\n script.src = \"https://unpkg.com/axe-core@3/axe.min.js\";\n document.head.appendChild(script);\n return new Promise((resolve, reject) => {\n script.onload = () => resolve(window.axe);\n script.onerror = reject;\n });\n}\n\n/** @param {string} text */\nfunction formatHintsAsMarkdown(text) {\n const results = [];\n for (const group of text.split(\"\\n\\n\")) {\n const [msg, ...opts] = group.split(/^\\s{2}/m);\n const options = opts.map(opt => `- ${opt.trimEnd()}`).join(\"\\n\");\n results.push(`${msg}${options}`);\n }\n return results.join(\"\\n\\n\");\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","[object Object]","target","prop","receiver","IDBTransaction","get","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","args","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","addEventListener","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","version","upgrade","blocking","terminated","open","openPromise","event","oldVersion","newVersion","db","source","position","current","message","kind","level","autofix","ruleName","sliceTokens","count","slice","Math","max","tokensToText","inputs","precedes","text","t","trivia","join","nextToken","type","length","line","precedingLastLine","splitted","split","lastLine","subsequentTokens","subsequentText","sourceContext","repeat","contextType","context","partial","node","hierarchy","parent","unshift","n","base","appendIfExist","contextAsText","bareMessage","sourceName","input","tokens","syntaxError","validationError","token","options","Base","Object","defineProperties","writable","json","inheritance","proto","descMap","getOwnPropertyDescriptors","key","entries","enumerable","getPrototypeOf","idlTypeIncludesDictionary","idlType","defs","useNullableInner","union","def","unique","typedefIncludesDictionary","cache","reference","dictionary","nullable","subtype","dictionaryIncludesRequiredField","dict","members","field","required","superdict","ArrayBase","Array","super","WrappedToken","tokeniser","consumeType","unescape","tokenName","list","parser","listName","extAttrValueSyntax","renamedLegacies","extAttrListItems","syntax","toks","ExtendedAttributeParameters","assign","consume","ret","autoParenter","secondaryName","rhsIsList","argument_list","close","hasRhs","rhsType","w","ts","reference_token","p","identifier","endsWith","item","separator","write","SimpleExtendedAttribute","params","parse","defineProperty","rhs","arguments","extAttr","arg","validate","extendedAttribute","extendedAttributeReference","ExtendedAttributes","push","probe","ea","type_suffix","obj","single_type","typeName","Type","return_type","type_with_extended_attributes","keyType","stringTypes","keyIdlType","valueType","generic_type","primitive_type","typeNameKeywords","generic","typ","or","union_type","extAttrs","Boolean","prefix","postfix","filter","typedef","targetToken","firstToken","ref","unescaped","type_body","Default","const_value","expression","const_data","negative","Argument","start_position","optional","variadic","argumentNameKeywords","default","unconsume","autofixOptionalDictionaryDefaultValue","indexOf","a","isLastRequiredArgument","getFirstToken","name_token","data","Tokeniser","Operation","special","regular","termination","argument","body","definition","nameless","Attribute","noInherit","readonly","startsWith","allowDangler","first","items","num_type","integer_type","decimal_type","voidToken","stringifier","getLastIndentation","str","lines","match","autofixAddExposedWindow","exposed","existing","test","values","x","y","isArray","tokenRe","decimal","integer","string","whitespace","comment","other","nonRegexTerminals","concat","punctuations","reserved","idl","lastCharIndex","nextChar","charAt","attemptTokenMatch","noFlushTrivia","currentTrivia","pop","lastIndex","WebIDLParseError","punctuation","re","exec","tokenise","probeType","candidates","EnumValue","Enum","v","Includes","mixin","Typedef","CallbackFunction","Container","instance","inheritable","allowedMembers","colon","mem","member","m","Constant","IterableLike","secondTypeRequired","secondTypeAllowed","argumentAllowed","argsOpen","argsClose","Constructor","static_member","Interface","every","oldConstructors","constructor","autofixConstructor","factoryFunctions","named","constructors","i","opNames","Set","getOperations","op","partials","mixins","mixinMap","ext","additions","forEachExtension","addition","add","existings","checkInterfaceMemberDuplication","interfaceDef","constructorExtAttr","indentation","memberIndent","parentTrivia","indentCh","getMemberIndentation","constructorOp","existingIndex","array","predicate","reverse","findIndex","findLastIndex","splice","removed","trim","Mixin","Field","Dictionary","Namespace","CallbackInterface","parseByTokens","interface_","opts","res","eof","concrete","definitions","noop","templates","Writer","raw","wrapper","bind","id","getMixinMap","include","validateIterable","ast","duplicates","groupDefinitions","dup","checkDuplicatedNames","it","flat","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","paramName","paramValue","toLowerCase","defaults$5","exports","getDefaults$1","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartLists","smartypants","tokenizer","walkTokens","xhtml","defaults","getDefaults","changeDefaults","newDefaults","escapeTest","escapeReplace","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","&","<",">","\"","'","getEscapeReplacement","ch","unescapeTest","unescape$1","_","String","fromCharCode","parseInt","substring","caret","nonWordAndColonTest","originIndependentUrl","baseUrls","justDomain","protocol","domain","resolveUrl","href","rtrim$1","relativeBase","invert","l","suffLen","currChar","substr","helpers","escape","encode","edit","regex","opt","val","getRegex","RegExp","cleanUrl","prot","decodeURIComponent","e","encodeURI","noopTest","merge","hasOwnProperty","splitCells","tableRow","cells","offset","escaped","curr","rtrim","findClosingBracket","b","checkSanitizeDeprecation","console","warn","repeatString","pattern","defaults$4","escape$2","outputLink","cap","link","title","Tokenizer_1","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","matchIndentInNode","indentInNode","indentCodeCompensation","heading","trimmed","depth","nptable","header","align","hr","blockquote","bull","isordered","ordered","start","loose","itemMatch","space","bcurr","bnext","addBack","istask","ischecked","endMatch","next","listItemStart","task","checked","pre","tag","table","lheading","paragraph","inline","inLink","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","linkLen","_escapes","links","reflink","nolink","maskedSrc","prevChar","emStrong","lDelim","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","min","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","merge$1","block$1","_paragraph","_label","_title","bullet","_tag","_comment","normal","inline$1","reflinkSearch","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Tokenizer$1","defaults$3","out","charCodeAt","random","toString","defaults$2","escape$1","Renderer_1","infostring","quote","slugger","slug","content","flags","TextRenderer_1","Slugger_1","seen","originalSlug","isDryRun","occurenceAccumulator","serialize","getNextSafeSlug","dryrun","Renderer$1","TextRenderer$1","Slugger$1","defaults$1","Lexer","create","lex","inlineTokens","blockTokens","top","lastToken","cutSrc","lastParagraphClipped","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","j","k","l2","row","keepPrevChar","keys","lastIndexOf","codespan","startInline","inlineText","Parser","textRenderer","parseInline","l3","cell","itemBody","checkbox","renderers","tablecell","tablerow","listitem","image","Tokenizer","Renderer","TextRenderer","Slugger","marked","err","pending","setTimeout","setOptions","use","childTokens","hasExtensions","pack","prevRenderer","prevTokenizer","lexInline","lexer","marked_1","globalThis","global","self","module","pluralize$1","root","pluralize","commonjsGlobal","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","hyperHTML","N","r","delete","configurable","o","s","WeakSet","u","insertBefore","selected","selectedIndex","f","querySelectorAll","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","g","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","detail","CustomEvent","_wire$","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","dispatchEvent","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","Component","diff","hyper","for","handleEvent","currentTarget","svg","state","defaultState","dispatch","component","setState","idb","_idb","webidl2","_webidl2","_marked","_pluralize","MIMEType","TypeError","parserMode","inputArray","from","char","trimEnd","fromEntries","parseMimeType","parameters","essence","mimeType","size","paramStr","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","origin","corsMode","location","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","docLang","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","xmlEscape","norm","getIntlData","localizationStrings","zh-hans","zh-cn","resolveLanguageAlias","concatDate","date","sep","format","humanDate","Date","langs","toLocaleString","runTransforms","flist","funcArgs","methods","meth","showWarning","fetchAndCache","maxAge","Request","cachedResponse","caches","headers","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","toISOString","cacheResponse","Response","blob","put","htmlJoinComma","joined","htmlJoinAnd","addHashId","addId","hash","imul","hashString","pfx","txt","noLC","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","getCanonicalKey","existingKey","find","makeSafeCopy","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","elements","msg","markAsOffending","stack","details","showError","pluginName","pub","toMDCode","codedJoinOr","quotes","addQuotes","codedJoinAnd","docLink","strings","linkingText","subscriptions","topic","cb","JSON","stringify","postMessage","sub","once","callbacks","unsub","removeList","mimeTypes","rsDocToDataURL","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","toJSON","ready","runAll","plugs","respec","respecIsReadyWarningShown","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","search","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","reindent","indents","leastIndent","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","Builder","tagName","section","findPosition","findParent","process","findHeader","structure","fragment","addHeader","addSection","addElement","restructure","structuredInternals","firstElementChild","processMDSections","conf","hasMDSections","isMDFormat","processedElem","rsUI","newBody","trimStart","firstTwo","lastTwo","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","createContextualFragment","rsErrorToHTML","li","lastElementChild","freshModal","createWarnButton","label","handler","_keyShort","icon","menuItem","owner","currentOwner","headingId","generateMarkdownLink","plugins","show","readyState","domReady","enable","ev","warning","ReSpec.run","hasLink","isLegacyFrag","LEGACY_OPTIONS","getGroupDetails","group","shortname","wgId","wg","URI","wgURI","patentURI","wgPatentURI","patentPolicy","wgPatentPolicy","groupType","status","usedLegacyOptions","groupDetails","groups","getMultipleGroupDetails","showLink","class","showLinkData","showLogo","logo","alt","height","width","until","es","ko","ja","zh","defaultLang","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","reduce","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","extras","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","ccLicense","w3cLicense","legalDisclaimer","w3cTrademark","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","edited_in_place","this_version","test_suite","implementation_report","prev_editor_draft","prev_version","prev_recommendation","latest_recommendation","nl","logos","specSubTitleElem","subtitle","getSpecSubTitleElem","prependW3C","isCR","longStatus","textStatus","dashDate","publishHumanDate","modificationDate","modificationHumanDate","inPlaceModificationDate","isTagFinding","isNoTrack","thisVersion","latestVersion","edDraftURI","testSuiteURI","implementationReportURI","isED","prevED","showPreviousVersion","prevVersion","prevRecURI","isRec","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","errata","shortName","alternateFormats","multipleAlternates","alternatesHTML","existingCopyright","overrideCopyright","isUnofficial","licenseInfo","linkLicense","short","copyrightStart","publishYear","additionalCopyrightHolders","isCCBY","noteIfDualLicense","isW3CSoftAndDocLicense","linkDocumentUse","renderOfficialCopyright","renderCopyright","cssClass","specTitleElem","specTitleElemClone","isCGFinal","sotd","isPreview","renderPreview","additionalContent","renderIsUnofficial","isMO","renderIsNoTrack","status_at_publication","isSubmission","isMemberSubmission","teamComment","publishDate","getUTCFullYear","submissionCommentNumber","patentPolicyURL","noteForMemberSubmission","isTeamSubmission","renderPublicList","noteForTeamSubmission","noteForSubmission","sotdAfterWGinfo","overrideStatus","proposedChanges","revisionTypes","wgHTML","anOrA","notYetRec","linkToWorkingGroup","linkToCommunity","updateableRec","humanRevisedRecEnd","reviewTarget","renderIsRec","statusExplanation","updatePolicy","reviewPolicy","specStatus","pubMode","humanCREnd","isPR","humanPREnd","isPER","humanPEREnd","renderNotRec","isNote","isIGNote","multipleWGs","recNotExpected","wgPatentHTML","charterDisclosureURI","producers","renderDeliverer","addPatentNote","additionalSections","prUrl","prNumber","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","wgPublicList","subjectPrefix","github","issueBase","W3CDate","w3Url","status2maturity","LS","LD","FPWD","LC","FPLC","FPWD-NOTE","WD-NOTE","LC-NOTE","IG-NOTE","WG-NOTE","publicationSpaces","Member-SUBM","Team-SUBM","finding","draft-finding","status2rdf","NOTE","WD","CR","CRD","PR","REC","PER","RSCND","status2text","CG-NOTE","MO","ED","unofficial","CG-DRAFT","CG-FINAL","BG-DRAFT","BG-FINAL","status2long","W3CNotes","maybeRecTrack","recTrackStatus","cgStatus","bgStatus","cgbgStatus","noTrackStatus","precededByAn","licenses","patentPolicies","baseLogo","freeze","validateDateAndRecover","fallbackDate","isFinite","formattedDate","collectSotdContent","sotdClone","hasChildNodes","license","isCGBG","isBasic","isRegular","host","lastModified","isRecTrack","noRecTrack","memSubmissionLogo","teamSubmissionLogo","linkGroup","hasGitHubIssuesLink","maturity","pubSpace","docVersion","latestPath","previousPublishDate","previousMaturity","prevMaturity","pubDate","prevPubDate","prevRecShortname","uri","rdfStatus","showThisVersion","isCRDraft","publishISODate","shortISODate","policies","policy","validatePatentPolicies","cgbgHeadersTmpl","headersTmpl","wgPotentialArray","idx","crEnd","prEnd","perEnd","contains","revisedRecEnd","notAllowed","mailToWGPublicList","cgbgSotdTmpl","sotdTmpl","populateSoTD","generatedSubtitle","coreDefaults","lint","no-headingless-sections","no-http-props","no-unused-vars","check-punctuation","local-refs-exist","check-internal-slots","check-charset","privsec-section","highlightVars","addSectionLinks","w3cLogo","w3cDefaults","wpt-tests-exist","a11y","doJsonLd","xref","processLogos","supportedStatus","validateStatusForGroup","insertStyle","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","toKeyValuePairs","initial-scale","shrink-to-fit","createMetaViewport","styleFile","styleVersion","isNaN","selectStyleVersion","useExperimentalStyles","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","nextLink","linkCSS","exportDoc","w3cStyle","resolveGithubPromise","rejectGithubPromise","file_a_bug","participate","commit_history","ghURL","tempURL","repoURL","org","repo","branch","newProps","githubToken","githubUser","atRiskBase","pullBase","otherLink","githubAPI","hostname","normalizedGHObj","apiBase","fullName","normalizedConfig","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","includables","promisesToInclude","includeId","default_title","h1Elem","isConnected","documentTitle","setDocumentTitle","isInteger","abstract","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","renderParent","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","openIdb","biblioDB","isAlias","resolveAlias","range","IDBKeyRange","only","openCursor","aliasOf","aliasesAndRefs","alias","promisesToAdd","flatMap","isInDB","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","addAll","resolveRef","entry","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","localBiblio","localAliases","normalizeReferences","allRefs","getRefKeys","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","refUrl","selectors","elems","linkType","decorateInlineReference","getAliases","badrefs","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","conformance","normativity","keywordInterpretation","terms","processConformance","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","validator","associateWith","knownTypes","computeType","dfnFor","validateDefinition","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","export","processAsTaskSource","closestType","computeExport","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","makeTitle","num","report","number","examples","div","inAside","exampleTitle","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bgColorHex","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","makeIssueSectionSummary","issuesAndNotes","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","sections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","topLevelEntities","findDfn","defn","findNormalDfn","findOperationDfn","resolvedName","dfns","getDfns","alternativeDfns","decorateDfn","dfnElem","idlAst","lCaseParent","last","getDataType","local","exportable","addAlternativeNames","asQualifiedName","operationName","argsAst","operationNames","isOptional","requiredArgs","requiredOperation","optionalOps","generateMethodNamesWithArgs","getAlternativeNames","originalName","foundDfns","dfnForArray","closestDfnFor","idlStruct","copyButton","createButton","addCopyIDLButton","idlHeader","idlText","clipboard","writeText","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","unlinkedAnchor","nameResolverMap","getDefnName","getIdlId","resolvePartial","overload","qualifiedName","fullyQualifiedName","resolveOverload","resolveNameAndId","renderWebIDL","idlElement","highlights","closestCite","cites","addIDLHeader","idls","astArray","validations","validation","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","STORE_NAME","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","queries","cachedData","lastChecked","localStorage","getItem","setItem","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","query","cursor","profiles","web-platform","getRequestEntry","getTermFromElement","specs","dataciteElem","closestSection","inlineRefs","higherPriority","uniqueSpecs","dedupeSpecContext","getSpecContext","types","getTypeContext","dataXrefForElem","getForContext","addDataCite","normative","closestNormative","closestInform","addToReferences","objectHash","buffer","TextEncoder","crypto","subtle","digest","bufferToHexString","Uint8Array","padStart","invalidProfileError","profile","normalizeConfig","bodyCite","externalDFNs","findExplicitExternalLinks","queryKeys","apiUrl","uniqueIds","uniqueQueryKeys","resultsFromCache","termsToLook","fetchedResults","Content-Type","fetchFromNetwork","cacheXrefData","getData","ambiguous","notFound","collector","getPrefilledFormURL","howToFix","howToCiteURL","originalTerm","formUrl","specsString","forParent","showErrors","addDataCiteToTerms","idlIndexSec","idlIndex","headingExternal","headlingLocal","dfnOf","CODE_TYPES","getLocalTermType","ds","getLocalTermParentContext","getLocalTermSuffix","appendSectionNumbers","secNum","getSectionNumber","collectExternalTerms","uniqueReferences","uniqueID","renderExternalTermEntry","typeSuffix","TYPE_TERMS","TYPED_TYPES","linkForText","getTermText","styleEl","localTermIndex","dataSortedByTerm","collectLocalTerms","renderItem","suffix","getLocalTermText","renderLocalTerm","createLocalTermIndex","externalTermIndex","dataSortedBySpec","specA","specB","createExternalTermIndex","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","span","tocIntroductory","renameSectionHeaders","noTOC","maxToc","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","informative","headings","BROWSERS","fetchStats","feature","versions","browsers","statusText","caniuse","DEFAULTS","caniuseConf","invalidBrowsers","browser","getNormalizedConf","fetchPromise","featureURL","headDlElem","contentPromise","stats","definitionPair","outputDoc","BASE_JSON_PATH","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","ie","opera","opera_android","safari","safari_ios","samsunginternet_android","webview_android","inAllEngines","inSomeEngines","insertMDNBox","targetAncestor","targetSibling","mdnBox","attachMDNDetail","mdnSpec","summary","support","engines","mdnSubPath","engineSupport","getEngineSupportIcons","getEngineSupport","createRow","browserId","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","getMdnData","findElements","mdnSpecArray","save_snapshot","downloadLinks","fileName","epubURL","toDownloadLink","saveDialog","supportsDownload","HTMLAnchorElement","addCommand","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","addPerson","ed","foaf:mbox","worksFor","addRef","jsonld","creator","publishedDate","isbn","canonicalURI","trLatestUri","@context","@vocab","@language","w3p","foaf","datePublished","@type","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","description","contributor","citationIds","citationContents","citation","addJSONLDInfo","fetchBase","workerPromise","workerScript","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","handleDuplicates","testURLs","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","createPanel","panelId","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","loadScript","varMap","variables","currentSection","processBox","matchingElement","selfLink","copy","processFigure","figcaption","figTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","HTMLElement","props","to","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","monetization","removeOnSave","paymentPointer","rawConfig","canonicalizeConfig","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","hasNoHeading","sectionContainsAlgorithm","varElems","varUsage","vars","saysPrivOrSec","saysConsiderations","filesInWPT","githubAPIBase","wptDirectory","testSuiteURL","files","getFilesInWPT","missingTest","offendingMembers","getOwnPropertyNames","DISABLED_RULES","formatHintsAsMarkdown","violations","otherOptions","enabled","elementRef","resultTypes","reporter","axe","onload","onerror","importAxe","getViolations","violation","groupedBySummary","nodes","failureSummary","help","helpUrl","hints"],"mappings":"uDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,IAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,GAElD,OAAON,OAAOC,QAAQG,QAAQE,KAEhCE,QAAQC,IAAIL,GAASM,KAAKC,GAAWR,KAAYQ,KAEnDV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,EA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AAiC,SAClC,CAAC,sBAAuB,UACxB,CAAC,oBAAqB,SACtB,CAAC,SAAU,MACX,CAAC,WAAY,OACb,CAAC,OAAQ,QACTzD,SAAQ,SAAUyD,GAClB,OAAOR,EAAUyB,cAAcjB,EAAK,GAAIA,EAAK,OAM/C,CACE,CAAC,MAAO,IACR,CAAC,SAAU,MACX,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACVzD,SAAQ,SAAUyD,GAClB,OAAOR,EAAU2B,gBAAgBnB,EAAK,GAAIA,EAAK,OAMjD,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,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,WACAzD,QAAQiD,EAA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EAAgBz6C,KAAau6C,EAAkB,CACzD,MAAMK,EAAQlB,GAAsBe,GAEpC3/C,GAAYpf,EAAO/hB,GAAM,CAAEymC,QADX,OAAOswC,SAAmBkK,oBAAwBD,MAC9B36C,SAAAA"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index de1f11f368..7f2024e5e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "respec", - "version": "26.12.1", + "version": "26.13.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 11cce177f3..8db3ccf656 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "respec", - "version": "26.12.1", + "version": "26.13.0", "license": "W3C", "description": "A technical specification pre-processor.", "engines": {